@cloudscape-design/components 3.0.810 → 3.0.812
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/resize/styles.css.js +5 -4
- package/app-layout/resize/styles.scoped.css +29 -9
- package/app-layout/resize/styles.selectors.js +5 -4
- package/app-layout/utils/interfaces.d.ts +0 -1
- package/app-layout/utils/interfaces.d.ts.map +1 -1
- package/app-layout/utils/interfaces.js.map +1 -1
- package/app-layout/utils/use-pointer-events.d.ts +1 -1
- package/app-layout/utils/use-pointer-events.d.ts.map +1 -1
- package/app-layout/utils/use-pointer-events.js +2 -6
- package/app-layout/utils/use-pointer-events.js.map +1 -1
- package/app-layout/utils/use-resize.d.ts.map +1 -1
- package/app-layout/utils/use-resize.js +0 -1
- package/app-layout/utils/use-resize.js.map +1 -1
- package/app-layout/visual-refresh-toolbar/drawer/global-drawer.d.ts.map +1 -1
- package/app-layout/visual-refresh-toolbar/drawer/global-drawer.js +2 -2
- package/app-layout/visual-refresh-toolbar/drawer/global-drawer.js.map +1 -1
- package/app-layout/visual-refresh-toolbar/drawer/local-drawer.js +2 -2
- package/app-layout/visual-refresh-toolbar/drawer/local-drawer.js.map +1 -1
- package/app-layout/visual-refresh-toolbar/drawer/use-resize.d.ts.map +1 -1
- package/app-layout/visual-refresh-toolbar/drawer/use-resize.js +0 -1
- package/app-layout/visual-refresh-toolbar/drawer/use-resize.js.map +1 -1
- package/app-layout/visual-refresh-toolbar/navigation/index.js +1 -1
- package/app-layout/visual-refresh-toolbar/navigation/index.js.map +1 -1
- package/app-layout/visual-refresh-toolbar/skeleton/index.js +2 -2
- package/app-layout/visual-refresh-toolbar/skeleton/index.js.map +1 -1
- package/button-group/icon-button-item.d.ts +2 -2
- package/button-group/icon-button-item.d.ts.map +1 -1
- package/button-group/icon-button-item.js +5 -2
- package/button-group/icon-button-item.js.map +1 -1
- package/button-group/item-element.d.ts.map +1 -1
- package/button-group/item-element.js +1 -1
- package/button-group/item-element.js.map +1 -1
- package/button-group/menu-dropdown-item.js +2 -2
- package/button-group/menu-dropdown-item.js.map +1 -1
- package/internal/base-component/styles.scoped.css +2 -0
- package/internal/environment.js +1 -1
- package/internal/environment.json +1 -1
- package/internal/generated/styles/tokens.d.ts +1 -0
- package/internal/generated/styles/tokens.js +1 -0
- package/internal/generated/theming/index.cjs +11 -0
- package/internal/generated/theming/index.js +11 -0
- package/internal/manifest.json +1 -1
- package/package.json +1 -1
- package/prompt-input/internal.d.ts.map +1 -1
- package/prompt-input/internal.js +2 -1
- package/prompt-input/internal.js.map +1 -1
- package/split-panel/bottom.js +1 -1
- package/split-panel/bottom.js.map +1 -1
- package/split-panel/implementation.d.ts.map +1 -1
- package/split-panel/implementation.js +0 -1
- package/split-panel/implementation.js.map +1 -1
- package/split-panel/side.js +1 -1
- package/split-panel/side.js.map +1 -1
- package/table/internal.js +2 -2
- package/table/internal.js.map +1 -1
- package/tiles/styles.css.js +30 -30
- package/tiles/styles.scoped.css +106 -105
- package/tiles/styles.selectors.js +30 -30
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
|
|
2
2
|
import './styles.scoped.css';
|
|
3
3
|
export default {
|
|
4
|
-
"with-motion": "awsui_with-
|
|
5
|
-
"
|
|
6
|
-
"resize-
|
|
7
|
-
"resize-
|
|
4
|
+
"with-motion-vertical": "awsui_with-motion-vertical_b18tp_8csc7_142",
|
|
5
|
+
"with-motion-horizontal": "awsui_with-motion-horizontal_b18tp_8csc7_161",
|
|
6
|
+
"resize-active": "awsui_resize-active_b18tp_8csc7_180",
|
|
7
|
+
"resize-side": "awsui_resize-side_b18tp_8csc7_191",
|
|
8
|
+
"resize-bottom": "awsui_resize-bottom_b18tp_8csc7_194"
|
|
8
9
|
};
|
|
9
10
|
|
|
@@ -139,40 +139,60 @@
|
|
|
139
139
|
/* Style used for links in slots/components that are text heavy, to help links stand out among
|
|
140
140
|
surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F73#description */
|
|
141
141
|
@media (min-width: 689px) {
|
|
142
|
-
.awsui_with-
|
|
142
|
+
.awsui_with-motion-vertical_b18tp_8csc7_142:not(#\9) {
|
|
143
143
|
transition: var(--motion-duration-refresh-only-medium-nf6485, 165ms);
|
|
144
|
-
transition-property: border-color, opacity, block-size,
|
|
144
|
+
transition-property: border-color, opacity, block-size, inset-block-start;
|
|
145
145
|
}
|
|
146
146
|
}
|
|
147
147
|
@media (min-width: 689px) and (prefers-reduced-motion: reduce) {
|
|
148
|
-
.awsui_with-
|
|
148
|
+
.awsui_with-motion-vertical_b18tp_8csc7_142:not(#\9) {
|
|
149
149
|
animation: none;
|
|
150
150
|
transition: none;
|
|
151
151
|
}
|
|
152
152
|
}
|
|
153
153
|
@media (min-width: 689px) {
|
|
154
|
-
.awsui-motion-disabled .awsui_with-
|
|
154
|
+
.awsui-motion-disabled .awsui_with-motion-vertical_b18tp_8csc7_142:not(#\9), .awsui-mode-entering .awsui_with-motion-vertical_b18tp_8csc7_142:not(#\9) {
|
|
155
|
+
animation: none;
|
|
156
|
+
transition: none;
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
@media (min-width: 689px) {
|
|
161
|
+
.awsui_with-motion-horizontal_b18tp_8csc7_161:not(#\9) {
|
|
162
|
+
transition: var(--motion-duration-refresh-only-medium-nf6485, 165ms);
|
|
163
|
+
transition-property: border-color, opacity, inline-size, inset-inline-start;
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
@media (min-width: 689px) and (prefers-reduced-motion: reduce) {
|
|
167
|
+
.awsui_with-motion-horizontal_b18tp_8csc7_161:not(#\9) {
|
|
168
|
+
animation: none;
|
|
169
|
+
transition: none;
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
@media (min-width: 689px) {
|
|
173
|
+
.awsui-motion-disabled .awsui_with-motion-horizontal_b18tp_8csc7_161:not(#\9), .awsui-mode-entering .awsui_with-motion-horizontal_b18tp_8csc7_161:not(#\9) {
|
|
155
174
|
animation: none;
|
|
156
175
|
transition: none;
|
|
157
176
|
}
|
|
158
177
|
}
|
|
159
178
|
|
|
160
179
|
/* stylelint-disable selector-combinator-disallowed-list, selector-max-type, selector-max-universal */
|
|
161
|
-
.awsui_resize-
|
|
180
|
+
.awsui_resize-active_b18tp_8csc7_180 *:not(#\9) {
|
|
162
181
|
-webkit-user-select: none;
|
|
163
182
|
user-select: none;
|
|
164
183
|
}
|
|
165
|
-
.awsui_resize-
|
|
184
|
+
.awsui_resize-active_b18tp_8csc7_180 * .awsui_with-motion-vertical_b18tp_8csc7_142:not(#\9),
|
|
185
|
+
.awsui_resize-active_b18tp_8csc7_180 * .awsui_with-motion-horizontal_b18tp_8csc7_161:not(#\9) {
|
|
166
186
|
transition: none;
|
|
167
187
|
animation: none;
|
|
168
188
|
}
|
|
169
|
-
.awsui_resize-
|
|
189
|
+
.awsui_resize-active_b18tp_8csc7_180 iframe:not(#\9) {
|
|
170
190
|
pointer-events: none;
|
|
171
191
|
}
|
|
172
|
-
.awsui_resize-
|
|
192
|
+
.awsui_resize-side_b18tp_8csc7_191 *:not(#\9) {
|
|
173
193
|
cursor: ew-resize;
|
|
174
194
|
}
|
|
175
|
-
.awsui_resize-
|
|
195
|
+
.awsui_resize-bottom_b18tp_8csc7_194 *:not(#\9) {
|
|
176
196
|
cursor: ns-resize;
|
|
177
197
|
}
|
|
178
198
|
|
|
@@ -2,9 +2,10 @@
|
|
|
2
2
|
// es-module interop with Babel and Typescript
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
4
|
module.exports.default = {
|
|
5
|
-
"with-motion": "awsui_with-
|
|
6
|
-
"
|
|
7
|
-
"resize-
|
|
8
|
-
"resize-
|
|
5
|
+
"with-motion-vertical": "awsui_with-motion-vertical_b18tp_8csc7_142",
|
|
6
|
+
"with-motion-horizontal": "awsui_with-motion-horizontal_b18tp_8csc7_161",
|
|
7
|
+
"resize-active": "awsui_resize-active_b18tp_8csc7_180",
|
|
8
|
+
"resize-side": "awsui_resize-side_b18tp_8csc7_191",
|
|
9
|
+
"resize-bottom": "awsui_resize-bottom_b18tp_8csc7_194"
|
|
9
10
|
};
|
|
10
11
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interfaces.d.ts","sourceRoot":"","sources":["../../../../src/app-layout/utils/interfaces.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,EAAE,MAAM,GAAG,QAAQ,CAAC;IAC5B,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC,cAAc,CAAC,CAAC;IAC3C,SAAS,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC,cAAc,CAAC,CAAC;IAC5C,QAAQ,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;
|
|
1
|
+
{"version":3,"file":"interfaces.d.ts","sourceRoot":"","sources":["../../../../src/app-layout/utils/interfaces.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,EAAE,MAAM,GAAG,QAAQ,CAAC;IAC5B,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC,cAAc,CAAC,CAAC;IAC3C,SAAS,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC,cAAc,CAAC,CAAC;IAC5C,QAAQ,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;CACrC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../../src/app-layout/utils/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\nexport interface SizeControlProps {\n position: 'side' | 'bottom';\n panelRef?: React.RefObject<HTMLDivElement>;\n handleRef?: React.RefObject<HTMLDivElement>;\n onResize: (newSize: number) => void;\n
|
|
1
|
+
{"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../../src/app-layout/utils/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\nexport interface SizeControlProps {\n position: 'side' | 'bottom';\n panelRef?: React.RefObject<HTMLDivElement>;\n handleRef?: React.RefObject<HTMLDivElement>;\n onResize: (newSize: number) => void;\n}\n"]}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { SizeControlProps } from './interfaces';
|
|
2
|
-
export declare const usePointerEvents: ({ position, panelRef, handleRef, onResize
|
|
2
|
+
export declare const usePointerEvents: ({ position, panelRef, handleRef, onResize }: SizeControlProps) => () => void;
|
|
3
3
|
//# sourceMappingURL=use-pointer-events.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-pointer-events.d.ts","sourceRoot":"","sources":["../../../../src/app-layout/utils/use-pointer-events.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAIhD,eAAO,MAAM,gBAAgB,
|
|
1
|
+
{"version":3,"file":"use-pointer-events.d.ts","sourceRoot":"","sources":["../../../../src/app-layout/utils/use-pointer-events.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAIhD,eAAO,MAAM,gBAAgB,gDAAiD,gBAAgB,eA+C7F,CAAC"}
|
|
@@ -3,12 +3,11 @@
|
|
|
3
3
|
import { useCallback } from 'react';
|
|
4
4
|
import { getIsRtl, getLogicalBoundingClientRect, getLogicalClientX, } from '@cloudscape-design/component-toolkit/internal';
|
|
5
5
|
import styles from '../resize/styles.css.js';
|
|
6
|
-
export const usePointerEvents = ({ position, panelRef, handleRef, onResize
|
|
6
|
+
export const usePointerEvents = ({ position, panelRef, handleRef, onResize }) => {
|
|
7
7
|
const onDocumentPointerMove = useCallback((event) => {
|
|
8
8
|
if (!panelRef || !panelRef.current || !handleRef || !handleRef.current) {
|
|
9
9
|
return;
|
|
10
10
|
}
|
|
11
|
-
panelRef.current.classList.remove(styles['with-motion']);
|
|
12
11
|
if (position === 'side') {
|
|
13
12
|
const mouseClientX = getLogicalClientX(event, getIsRtl(panelRef.current)) || 0;
|
|
14
13
|
// The handle offset aligns the cursor with the middle of the resize handle.
|
|
@@ -28,14 +27,11 @@ export const usePointerEvents = ({ position, panelRef, handleRef, onResize, hasT
|
|
|
28
27
|
if (!panelRef || !panelRef.current) {
|
|
29
28
|
return;
|
|
30
29
|
}
|
|
31
|
-
if (hasTransitions) {
|
|
32
|
-
panelRef.current.classList.add(styles['with-motion']);
|
|
33
|
-
}
|
|
34
30
|
document.body.classList.remove(styles['resize-active']);
|
|
35
31
|
document.body.classList.remove(styles[`resize-${position}`]);
|
|
36
32
|
document.removeEventListener('pointerup', onDocumentPointerUp);
|
|
37
33
|
document.removeEventListener('pointermove', onDocumentPointerMove);
|
|
38
|
-
}, [panelRef, onDocumentPointerMove, position
|
|
34
|
+
}, [panelRef, onDocumentPointerMove, position]);
|
|
39
35
|
const onSliderPointerDown = useCallback(() => {
|
|
40
36
|
document.body.classList.add(styles['resize-active']);
|
|
41
37
|
document.body.classList.add(styles[`resize-${position}`]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-pointer-events.js","sourceRoot":"","sources":["../../../../src/app-layout/utils/use-pointer-events.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AAEpC,OAAO,EACL,QAAQ,EACR,4BAA4B,EAC5B,iBAAiB,GAClB,MAAM,+CAA+C,CAAC;AAIvD,OAAO,MAAM,MAAM,yBAAyB,CAAC;AAE7C,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,
|
|
1
|
+
{"version":3,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Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { useCallback } from 'react';\n\nimport {\n getIsRtl,\n getLogicalBoundingClientRect,\n getLogicalClientX,\n} from '@cloudscape-design/component-toolkit/internal';\n\nimport { SizeControlProps } from './interfaces';\n\nimport styles from '../resize/styles.css.js';\n\nexport const usePointerEvents = ({ position, panelRef, handleRef, onResize }: SizeControlProps) => {\n const onDocumentPointerMove = useCallback(\n (event: PointerEvent) => {\n if (!panelRef || !panelRef.current || !handleRef || !handleRef.current) {\n return;\n }\n\n if (position === 'side') {\n const mouseClientX = getLogicalClientX(event, getIsRtl(panelRef.current)) || 0;\n\n // The handle offset aligns the cursor with the middle of the resize handle.\n const handleOffset = getLogicalBoundingClientRect(handleRef.current).inlineSize / 2;\n const width = getLogicalBoundingClientRect(panelRef.current).insetInlineEnd - mouseClientX + handleOffset;\n\n onResize(width);\n } else {\n const mouseClientY = event.clientY || 0;\n\n // The handle offset aligns the cursor with the middle of the resize handle.\n const handleOffset = getLogicalBoundingClientRect(handleRef.current).blockSize / 2;\n const height = getLogicalBoundingClientRect(panelRef.current).insetBlockEnd - mouseClientY + handleOffset;\n\n onResize(height);\n }\n },\n [position, panelRef, handleRef, onResize]\n );\n\n const onDocumentPointerUp = useCallback(() => {\n if (!panelRef || !panelRef.current) {\n return;\n }\n\n document.body.classList.remove(styles['resize-active']);\n document.body.classList.remove(styles[`resize-${position}`]);\n document.removeEventListener('pointerup', onDocumentPointerUp);\n document.removeEventListener('pointermove', onDocumentPointerMove);\n }, [panelRef, onDocumentPointerMove, position]);\n\n const onSliderPointerDown = useCallback(() => {\n document.body.classList.add(styles['resize-active']);\n document.body.classList.add(styles[`resize-${position}`]);\n document.addEventListener('pointerup', onDocumentPointerUp);\n document.addEventListener('pointermove', onDocumentPointerMove);\n }, [onDocumentPointerMove, onDocumentPointerUp, position]);\n\n return onSliderPointerDown;\n};\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-resize.d.ts","sourceRoot":"","sources":["../../../../src/app-layout/utils/use-resize.tsx"],"names":[],"mappings":"AAEA,OAAO,KAA8B,MAAM,OAAO,CAAC;AAInD,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAE/C,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAMvD,MAAM,WAAW,iBAAiB;IAChC,YAAY,EAAE,cAAc,CAAC,MAAM,GAAG,SAAS,CAAC;IAChD,gBAAgB,EAAE,MAAM,CAAC;IACzB,oBAAoB,EAAE,CAAC,MAAM,EAAE;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,KAAK,IAAI,CAAC;IACrE,WAAW,EAAE,gBAAgB,CAAC;IAC9B,WAAW,EAAE,OAAO,CAAC;IACrB,eAAe,EAAE,MAAM,CAAC;IACxB,eAAe,EAAE,MAAM,CAAC;CACzB;AAED,iBAAS,SAAS,CAChB,eAAe,EAAE,KAAK,CAAC,SAAS,CAAC,cAAc,CAAC,EAChD,EACE,YAAY,EACZ,gBAAgB,EAChB,oBAAoB,EACpB,WAAW,EACX,WAAW,EACX,eAAe,EACf,eAAe,GAChB,EAAE,iBAAiB;;;
|
|
1
|
+
{"version":3,"file":"use-resize.d.ts","sourceRoot":"","sources":["../../../../src/app-layout/utils/use-resize.tsx"],"names":[],"mappings":"AAEA,OAAO,KAA8B,MAAM,OAAO,CAAC;AAInD,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAE/C,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAMvD,MAAM,WAAW,iBAAiB;IAChC,YAAY,EAAE,cAAc,CAAC,MAAM,GAAG,SAAS,CAAC;IAChD,gBAAgB,EAAE,MAAM,CAAC;IACzB,oBAAoB,EAAE,CAAC,MAAM,EAAE;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,KAAK,IAAI,CAAC;IACrE,WAAW,EAAE,gBAAgB,CAAC;IAC9B,WAAW,EAAE,OAAO,CAAC;IACrB,eAAe,EAAE,MAAM,CAAC;IACxB,eAAe,EAAE,MAAM,CAAC;CACzB;AAED,iBAAS,SAAS,CAChB,eAAe,EAAE,KAAK,CAAC,SAAS,CAAC,cAAc,CAAC,EAChD,EACE,YAAY,EACZ,gBAAgB,EAChB,oBAAoB,EACpB,WAAW,EACX,WAAW,EACX,eAAe,EACf,eAAe,GAChB,EAAE,iBAAiB;;;EAiDrB;AAED,eAAe,SAAS,CAAC"}
|
|
@@ -32,7 +32,6 @@ function useResize(drawerRefObject, { activeDrawer, activeDrawerSize, onActiveDr
|
|
|
32
32
|
panelRef: drawerRefObject,
|
|
33
33
|
handleRef: drawersRefs.slider,
|
|
34
34
|
onResize: setSidePanelWidth,
|
|
35
|
-
hasTransitions: true,
|
|
36
35
|
};
|
|
37
36
|
const onSliderPointerDown = usePointerEvents(sizeControlProps);
|
|
38
37
|
const onKeyDown = useKeyboardEvents(sizeControlProps);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-resize.js","sourceRoot":"","sources":["../../../../src/app-layout/utils/use-resize.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEnD,OAAO,iBAAiB,MAAM,+CAA+C,CAAC;AAC9E,OAAO,EAAE,eAAe,EAAE,MAAM,oCAAoC,CAAC;AAIrE,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAC1D,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAExD,OAAO,cAAc,MAAM,+BAA+B,CAAC;AAY3D,SAAS,SAAS,CAChB,eAAgD,EAChD,EACE,YAAY,EACZ,gBAAgB,EAChB,oBAAoB,EACpB,WAAW,EACX,WAAW,EACX,eAAe,EACf,eAAe,GACG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AK,EAAE,QAAQ,CAAC,CAAC;QAC/D,MAAM,EAAE,GAAG,YAAY,aAAZ,YAAY,uBAAZ,YAAY,CAAE,EAAE,CAAC;QAE5B,IAAI,EAAE,IAAI,QAAQ,IAAI,eAAe,EAAE;YACrC,oBAAoB,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC,CAAC;SACpC;IACH,CAAC,CAAC;IAEF,MAAM,gBAAgB,GAAqB;QACzC,QAAQ,EAAE,MAAM;QAChB,QAAQ,EAAE,eAAe;QACzB,SAAS,EAAE,WAAW,CAAC,MAAM;QAC7B,QAAQ,EAAE,iBAAiB;KAC5B,CAAC;IAEF,MAAM,mBAAmB,GAAG,gBAAgB,CAAC,gBAAgB,CAAC,CAAC;IAC/D,MAAM,SAAS,GAAG,iBAAiB,CAAC,gBAAgB,CAAC,CAAC;IAEtD,MAAM,YAAY,GAAG,CACnB,oBAAC,iBAAiB,IAChB,GAAG,EAAE,WAAW,CAAC,MAAM,EACvB,QAAQ,EAAC,MAAM,EACf,SAAS,EAAE,MAAA,YAAY,aAAZ,YAAY,uBAAZ,YAAY,CAAE,UAAU,0CAAE,YAAY,EACjD,YAAY,EAAE,YAAY,EAC1B,SAAS,EAAE,cAAc,CAAC,gBAAgB,CAAC,EAC3C,SAAS,EAAE,SAAS,EACpB,aAAa,EAAE,mBAAmB,GAClC,CACH,CAAC;IAEF,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,CAAC;AACtC,CAAC;AAED,eAAe,SAAS,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useEffect, useState } from 'react';\n\nimport PanelResizeHandle from '../../internal/components/panel-resize-handle';\nimport { getLimitedValue } from '../../split-panel/utils/size-utils';\nimport { AppLayoutProps } from '../interfaces';\nimport { SizeControlProps } from './interfaces';\nimport { FocusControlRefs } from './use-focus-control';\nimport { useKeyboardEvents } from './use-keyboard-events';\nimport { usePointerEvents } from './use-pointer-events';\n\nimport testutilStyles from '../test-classes/styles.css.js';\n\nexport interface DrawerResizeProps {\n activeDrawer: AppLayoutProps.Drawer | undefined;\n activeDrawerSize: number;\n onActiveDrawerResize: (detail: { id: string; size: number }) => void;\n drawersRefs: FocusControlRefs;\n isToolsOpen: boolean;\n drawersMaxWidth: number;\n drawersMinWidth: number;\n}\n\nfunction useResize(\n drawerRefObject: React.RefObject<HTMLDivElement>,\n {\n activeDrawer,\n activeDrawerSize,\n onActiveDrawerResize,\n drawersRefs,\n isToolsOpen,\n drawersMinWidth,\n drawersMaxWidth,\n }: DrawerResizeProps\n) {\n const [relativeSize, setRelativeSize] = useState(0);\n\n const drawerSize = !activeDrawer && !isToolsOpen ? 0 : activeDrawerSize;\n\n useEffect(() => {\n // effects are called inside out in the components tree\n // wait one frame to allow app-layout to complete its calculations\n const handle = requestAnimationFrame(() => {\n const maxSize = drawersMaxWidth;\n setRelativeSize(((drawerSize - drawersMinWidth) / (maxSize - drawersMinWidth)) * 100);\n });\n return () => cancelAnimationFrame(handle);\n }, [drawerSize, drawersMaxWidth, drawersMinWidth]);\n\n const setSidePanelWidth = (width: number) => {\n const maxWidth = drawersMaxWidth;\n const size = getLimitedValue(drawersMinWidth, width, maxWidth);\n const id = activeDrawer?.id;\n\n if (id && maxWidth >= drawersMinWidth) {\n onActiveDrawerResize({ size, id });\n }\n };\n\n const sizeControlProps: SizeControlProps = {\n position: 'side',\n panelRef: drawerRefObject,\n handleRef: drawersRefs.slider,\n onResize: setSidePanelWidth,\n };\n\n const onSliderPointerDown = usePointerEvents(sizeControlProps);\n const onKeyDown = useKeyboardEvents(sizeControlProps);\n\n const resizeHandle = (\n <PanelResizeHandle\n ref={drawersRefs.slider}\n position=\"side\"\n ariaLabel={activeDrawer?.ariaLabels?.resizeHandle}\n ariaValuenow={relativeSize}\n className={testutilStyles['drawers-slider']}\n onKeyDown={onKeyDown}\n onPointerDown={onSliderPointerDown}\n />\n );\n\n return { resizeHandle, drawerSize };\n}\n\nexport default useResize;\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"global-drawer.d.ts","sourceRoot":"","sources":["../../../../../src/app-layout/visual-refresh-toolbar/drawer/global-drawer.tsx"],"names":[],"mappings":";AAQA,OAAO,EAAE,yBAAyB,EAAE,MAAM,0BAA0B,CAAC;AAGrE,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAElD,OAAO,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AAOnD,UAAU,wCAAwC;IAChD,kBAAkB,EAAE,kBAAkB,CAAC;IACvC,IAAI,EAAE,OAAO,CAAC;IACd,kBAAkB,EACd,CAAC,cAAc,CAAC,MAAM,GAAG;QAAE,MAAM,CAAC,EAAE,yBAAyB,CAAC;QAAC,MAAM,CAAC,EAAE,yBAAyB,CAAA;KAAE,CAAC,GACpG,SAAS,CAAC;CACf;AAED,iBAAS,mCAAmC,CAAC,EAC3C,kBAAkB,EAClB,IAAI,EACJ,kBAAkB,GACnB,EAAE,wCAAwC,
|
|
1
|
+
{"version":3,"file":"global-drawer.d.ts","sourceRoot":"","sources":["../../../../../src/app-layout/visual-refresh-toolbar/drawer/global-drawer.tsx"],"names":[],"mappings":";AAQA,OAAO,EAAE,yBAAyB,EAAE,MAAM,0BAA0B,CAAC;AAGrE,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAElD,OAAO,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AAOnD,UAAU,wCAAwC;IAChD,kBAAkB,EAAE,kBAAkB,CAAC;IACvC,IAAI,EAAE,OAAO,CAAC;IACd,kBAAkB,EACd,CAAC,cAAc,CAAC,MAAM,GAAG;QAAE,MAAM,CAAC,EAAE,yBAAyB,CAAC;QAAC,MAAM,CAAC,EAAE,yBAAyB,CAAA;KAAE,CAAC,GACpG,SAAS,CAAC;CACf;AAED,iBAAS,mCAAmC,CAAC,EAC3C,kBAAkB,EAClB,IAAI,EACJ,kBAAkB,GACnB,EAAE,wCAAwC,eAoH1C;AAED,eAAe,mCAAmC,CAAC"}
|
|
@@ -39,7 +39,7 @@ function AppLayoutGlobalDrawerImplementation({ appLayoutInternals, show, activeG
|
|
|
39
39
|
const hasTriggerButton = !!(activeGlobalDrawer === null || activeGlobalDrawer === void 0 ? void 0 : activeGlobalDrawer.trigger);
|
|
40
40
|
return (React.createElement(Transition, { nodeRef: drawerRef, in: show, appear: show, timeout: 0 }, state => {
|
|
41
41
|
var _a;
|
|
42
|
-
return (React.createElement("aside", { id: activeDrawerId, "aria-hidden": !show, "aria-label": computedAriaLabels.content, className: clsx(styles.drawer, styles['drawer-global'], styles[state], sharedStyles['with-motion'], {
|
|
42
|
+
return (React.createElement("aside", { id: activeDrawerId, "aria-hidden": !show, "aria-label": computedAriaLabels.content, className: clsx(styles.drawer, styles['drawer-global'], styles[state], sharedStyles['with-motion-horizontal'], {
|
|
43
43
|
[styles['drawer-hidden']]: !show,
|
|
44
44
|
[styles['last-opened']]: lastOpenedDrawerId === activeDrawerId,
|
|
45
45
|
[testutilStyles['active-drawer']]: show,
|
|
@@ -60,7 +60,7 @@ function AppLayoutGlobalDrawerImplementation({ appLayoutInternals, show, activeG
|
|
|
60
60
|
})), "data-testid": `awsui-app-layout-drawer-${activeDrawerId}` },
|
|
61
61
|
!isMobile && (activeGlobalDrawer === null || activeGlobalDrawer === void 0 ? void 0 : activeGlobalDrawer.resizable) && (React.createElement("div", { className: styles['drawer-slider'] },
|
|
62
62
|
React.createElement(PanelResizeHandle, { ref: refs === null || refs === void 0 ? void 0 : refs.slider, position: "side", className: testutilStyles['drawers-slider'], ariaLabel: (_a = activeGlobalDrawer === null || activeGlobalDrawer === void 0 ? void 0 : activeGlobalDrawer.ariaLabels) === null || _a === void 0 ? void 0 : _a.resizeHandle, ariaValuenow: resizeProps.relativeSize, onKeyDown: resizeProps.onKeyDown, onPointerDown: resizeProps.onPointerDown }))),
|
|
63
|
-
React.createElement("div", { className: clsx(styles['drawer-content-container'], sharedStyles['with-motion']) },
|
|
63
|
+
React.createElement("div", { className: clsx(styles['drawer-content-container'], sharedStyles['with-motion-horizontal']) },
|
|
64
64
|
React.createElement("div", { className: clsx(styles['drawer-close-button']) },
|
|
65
65
|
React.createElement(InternalButton, { ariaLabel: computedAriaLabels.closeButton, className: clsx({
|
|
66
66
|
[testutilStyles['active-drawer-close-button']]: activeDrawerId,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"global-drawer.js","sourceRoot":"","sources":["../../../../../src/app-layout/visual-refresh-toolbar/drawer/global-drawer.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AACtC,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACpD,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC1D,OAAO,iBAAiB,MAAM,kDAAkD,CAAC;AAEjF,OAAO,cAAc,MAAM,mDAAmD,CAAC;AAC/E,OAAO,EAAE,eAAe,EAAE,MAAM,uCAAuC,CAAC;AAExE,OAAO,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAEvD,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEzC,OAAO,YAAY,MAAM,4BAA4B,CAAC;AACtD,OAAO,cAAc,MAAM,kCAAkC,CAAC;AAC9D,OAAO,MAAM,MAAM,iBAAiB,CAAC;AAUrC,SAAS,mCAAmC,CAAC,EAC3C,kBAAkB,EAClB,IAAI,EACJ,kBAAkB,GACuB;;IACzC,MAAM,EACJ,UAAU,EACV,yBAAyB,EACzB,QAAQ,EACR,SAAS,EACT,2BAA2B,EAC3B,oBAAoB,EACpB,qBAAqB,EACrB,qBAAqB,EACrB,wBAAwB,EACxB,eAAe,EACf,gBAAgB,GACjB,GAAG,kBAAkB,CAAC;IACvB,MAAM,SAAS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WAAW,EACzC,SAAS,EAAE,IAAI,CAAC;4BACd,CAAC,cAAc,CAAC,4BAA4B,CAAC,CAAC,EAAE,cAAc;yBAC/D,CAAC,EACF,UAAU,EAAC,MAAM,EACjB,QAAQ,EAAE,QAAQ,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,aAAa,EAC5C,OAAO,EAAE,GAAG,EAAE,CAAC,2BAA2B,CAAC,cAAc,CAAC,EAC1D,GAAG,EAAE,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,KAAK,EAChB,OAAO,EAAC,MAAM,GACd,CACE;gBACN,6BAAK,SAAS,EAAE,MAAM,CAAC,gBAAgB,CAAC,IAAG,kBAAkB,aAAlB,kBAAkB,uBAAlB,kBAAkB,CAAE,OAAO,CAAO,CACzE,CACA,CACT,CAAC;IACJ,CAAC,CACU,CACd,CAAC;AACJ,CAAC;AAED,eAAe,mCAAmC,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 { Transition } from 'react-transition-group';\nimport clsx from 'clsx';\n\nimport { InternalButton } from '../../../button/internal';\nimport PanelResizeHandle from '../../../internal/components/panel-resize-handle';\nimport { NonCancelableEventHandler } from '../../../internal/events';\nimport customCssProps from '../../../internal/generated/custom-css-properties';\nimport { getLimitedValue } from '../../../split-panel/utils/size-utils';\nimport { AppLayoutProps } from '../../interfaces';\nimport { getDrawerTopOffset } from '../compute-layout';\nimport { AppLayoutInternals } from '../interfaces';\nimport { useResize } from './use-resize';\n\nimport sharedStyles from '../../resize/styles.css.js';\nimport testutilStyles from '../../test-classes/styles.css.js';\nimport styles from './styles.css.js';\n\ninterface AppLayoutGlobalDrawerImplementationProps {\n appLayoutInternals: AppLayoutInternals;\n show: boolean;\n activeGlobalDrawer:\n | (AppLayoutProps.Drawer & { onShow?: NonCancelableEventHandler; onHide?: NonCancelableEventHandler })\n | undefined;\n}\n\nfunction AppLayoutGlobalDrawerImplementation({\n appLayoutInternals,\n show,\n activeGlobalDrawer,\n}: AppLayoutGlobalDrawerImplementationProps) {\n const {\n ariaLabels,\n globalDrawersFocusControl,\n isMobile,\n placement,\n onActiveGlobalDrawersChange,\n onActiveDrawerResize,\n minGlobalDrawersSizes,\n maxGlobalDrawersSizes,\n activeGlobalDrawersSizes,\n verticalOffsets,\n drawersOpenQueue,\n } = appLayoutInternals;\n const drawerRef = useRef<HTMLDivElement>(null);\n const activeDrawerId = activeGlobalDrawer?.id ?? '';\n\n const computedAriaLabels = {\n closeButton: activeGlobalDrawer ? activeGlobalDrawer.ariaLabels?.closeButton : ariaLabels?.toolsClose,\n content: activeGlobalDrawer ? activeGlobalDrawer.ariaLabels?.drawerName : ariaLabels?.tools,\n };\n\n const drawersTopOffset = getDrawerTopOffset(verticalOffsets, isMobile, placement);\n const activeDrawerSize = (activeDrawerId ? activeGlobalDrawersSizes[activeDrawerId] : 0) ?? 0;\n const minDrawerSize = (activeDrawerId ? minGlobalDrawersSizes[activeDrawerId] : 0) ?? 0;\n const maxDrawerSize = (activeDrawerId ? maxGlobalDrawersSizes[activeDrawerId] : 0) ?? 0;\n const refs = globalDrawersFocusControl.refs[activeDrawerId];\n const resizeProps = useResize({\n currentWidth: activeDrawerSize,\n minWidth: minDrawerSize,\n maxWidth: maxDrawerSize,\n panelRef: drawerRef,\n handleRef: refs?.slider,\n onResize: size => onActiveDrawerResize({ id: activeDrawerId!, size }),\n });\n const size = getLimitedValue(minDrawerSize, activeDrawerSize, maxDrawerSize);\n const lastOpenedDrawerId = drawersOpenQueue.length ? drawersOpenQueue[0] : null;\n const hasTriggerButton = !!activeGlobalDrawer?.trigger;\n\n return (\n <Transition nodeRef={drawerRef} in={show} appear={show} timeout={0}>\n {state => {\n return (\n <aside\n id={activeDrawerId}\n aria-hidden={!show}\n aria-label={computedAriaLabels.content}\n className={clsx(styles.drawer, styles['drawer-global'], styles[state], sharedStyles['with-motion'], {\n [styles['drawer-hidden']]: !show,\n [styles['last-opened']]: lastOpenedDrawerId === activeDrawerId,\n [testutilStyles['active-drawer']]: show,\n })}\n ref={drawerRef}\n onBlur={e => {\n // Drawers with trigger buttons follow this restore focus logic:\n // If a previously focused element exists, restore focus on it; otherwise, focus on the associated trigger button.\n // This function resets the previously focused element.\n // If the drawer has no trigger button and loses focus on the previously focused element, it defaults to document.body,\n // which ideally should never happen.\n if (!hasTriggerButton) {\n return;\n }\n\n if (!e.relatedTarget || !e.currentTarget.contains(e.relatedTarget)) {\n globalDrawersFocusControl.loseFocus();\n }\n }}\n style={{\n blockSize: `calc(100vh - ${drawersTopOffset}px - ${placement.insetBlockEnd}px)`,\n insetBlockStart: drawersTopOffset,\n ...(!isMobile && {\n [customCssProps.drawerSize]: `${['entering', 'entered'].includes(state) ? size : 0}px`,\n }),\n }}\n data-testid={`awsui-app-layout-drawer-${activeDrawerId}`}\n >\n {!isMobile && activeGlobalDrawer?.resizable && (\n <div className={styles['drawer-slider']}>\n <PanelResizeHandle\n ref={refs?.slider}\n position=\"side\"\n className={testutilStyles['drawers-slider']}\n ariaLabel={activeGlobalDrawer?.ariaLabels?.resizeHandle}\n ariaValuenow={resizeProps.relativeSize}\n onKeyDown={resizeProps.onKeyDown}\n onPointerDown={resizeProps.onPointerDown}\n />\n </div>\n )}\n <div className={clsx(styles['drawer-content-container'], sharedStyles['with-motion'])}>\n <div className={clsx(styles['drawer-close-button'])}>\n <InternalButton\n ariaLabel={computedAriaLabels.closeButton}\n className={clsx({\n [testutilStyles['active-drawer-close-button']]: activeDrawerId,\n })}\n formAction=\"none\"\n iconName={isMobile ? 'close' : 'angle-right'}\n onClick={() => onActiveGlobalDrawersChange(activeDrawerId)}\n ref={refs?.close}\n variant=\"icon\"\n />\n </div>\n <div className={styles['drawer-content']}>{activeGlobalDrawer?.content}</div>\n </div>\n </aside>\n );\n }}\n </Transition>\n );\n}\n\nexport default AppLayoutGlobalDrawerImplementation;\n"]}
|
|
1
|
+
{"version":3,"file":"global-draw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,aAAJ,IAAI,uBAAJ,IAAI,CAAE,KAAK,EAChB,OAAO,EAAC,MAAM,GACd,CACE;gBACN,6BAAK,SAAS,EAAE,MAAM,CAAC,gBAAgB,CAAC,IAAG,kBAAkB,aAAlB,kBAAkB,uBAAlB,kBAAkB,CAAE,OAAO,CAAO,CACzE,CACA,CACT,CAAC;IACJ,CAAC,CACU,CACd,CAAC;AACJ,CAAC;AAED,eAAe,mCAAmC,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 { Transition } from 'react-transition-group';\nimport clsx from 'clsx';\n\nimport { InternalButton } from '../../../button/internal';\nimport PanelResizeHandle from '../../../internal/components/panel-resize-handle';\nimport { NonCancelableEventHandler } from '../../../internal/events';\nimport customCssProps from '../../../internal/generated/custom-css-properties';\nimport { getLimitedValue } from '../../../split-panel/utils/size-utils';\nimport { AppLayoutProps } from '../../interfaces';\nimport { getDrawerTopOffset } from '../compute-layout';\nimport { AppLayoutInternals } from '../interfaces';\nimport { useResize } from './use-resize';\n\nimport sharedStyles from '../../resize/styles.css.js';\nimport testutilStyles from '../../test-classes/styles.css.js';\nimport styles from './styles.css.js';\n\ninterface AppLayoutGlobalDrawerImplementationProps {\n appLayoutInternals: AppLayoutInternals;\n show: boolean;\n activeGlobalDrawer:\n | (AppLayoutProps.Drawer & { onShow?: NonCancelableEventHandler; onHide?: NonCancelableEventHandler })\n | undefined;\n}\n\nfunction AppLayoutGlobalDrawerImplementation({\n appLayoutInternals,\n show,\n activeGlobalDrawer,\n}: AppLayoutGlobalDrawerImplementationProps) {\n const {\n ariaLabels,\n globalDrawersFocusControl,\n isMobile,\n placement,\n onActiveGlobalDrawersChange,\n onActiveDrawerResize,\n minGlobalDrawersSizes,\n maxGlobalDrawersSizes,\n activeGlobalDrawersSizes,\n verticalOffsets,\n drawersOpenQueue,\n } = appLayoutInternals;\n const drawerRef = useRef<HTMLDivElement>(null);\n const activeDrawerId = activeGlobalDrawer?.id ?? '';\n\n const computedAriaLabels = {\n closeButton: activeGlobalDrawer ? activeGlobalDrawer.ariaLabels?.closeButton : ariaLabels?.toolsClose,\n content: activeGlobalDrawer ? activeGlobalDrawer.ariaLabels?.drawerName : ariaLabels?.tools,\n };\n\n const drawersTopOffset = getDrawerTopOffset(verticalOffsets, isMobile, placement);\n const activeDrawerSize = (activeDrawerId ? activeGlobalDrawersSizes[activeDrawerId] : 0) ?? 0;\n const minDrawerSize = (activeDrawerId ? minGlobalDrawersSizes[activeDrawerId] : 0) ?? 0;\n const maxDrawerSize = (activeDrawerId ? maxGlobalDrawersSizes[activeDrawerId] : 0) ?? 0;\n const refs = globalDrawersFocusControl.refs[activeDrawerId];\n const resizeProps = useResize({\n currentWidth: activeDrawerSize,\n minWidth: minDrawerSize,\n maxWidth: maxDrawerSize,\n panelRef: drawerRef,\n handleRef: refs?.slider,\n onResize: size => onActiveDrawerResize({ id: activeDrawerId!, size }),\n });\n const size = getLimitedValue(minDrawerSize, activeDrawerSize, maxDrawerSize);\n const lastOpenedDrawerId = drawersOpenQueue.length ? drawersOpenQueue[0] : null;\n const hasTriggerButton = !!activeGlobalDrawer?.trigger;\n\n return (\n <Transition nodeRef={drawerRef} in={show} appear={show} timeout={0}>\n {state => {\n return (\n <aside\n id={activeDrawerId}\n aria-hidden={!show}\n aria-label={computedAriaLabels.content}\n className={clsx(\n styles.drawer,\n styles['drawer-global'],\n styles[state],\n sharedStyles['with-motion-horizontal'],\n {\n [styles['drawer-hidden']]: !show,\n [styles['last-opened']]: lastOpenedDrawerId === activeDrawerId,\n [testutilStyles['active-drawer']]: show,\n }\n )}\n ref={drawerRef}\n onBlur={e => {\n // Drawers with trigger buttons follow this restore focus logic:\n // If a previously focused element exists, restore focus on it; otherwise, focus on the associated trigger button.\n // This function resets the previously focused element.\n // If the drawer has no trigger button and loses focus on the previously focused element, it defaults to document.body,\n // which ideally should never happen.\n if (!hasTriggerButton) {\n return;\n }\n\n if (!e.relatedTarget || !e.currentTarget.contains(e.relatedTarget)) {\n globalDrawersFocusControl.loseFocus();\n }\n }}\n style={{\n blockSize: `calc(100vh - ${drawersTopOffset}px - ${placement.insetBlockEnd}px)`,\n insetBlockStart: drawersTopOffset,\n ...(!isMobile && {\n [customCssProps.drawerSize]: `${['entering', 'entered'].includes(state) ? size : 0}px`,\n }),\n }}\n data-testid={`awsui-app-layout-drawer-${activeDrawerId}`}\n >\n {!isMobile && activeGlobalDrawer?.resizable && (\n <div className={styles['drawer-slider']}>\n <PanelResizeHandle\n ref={refs?.slider}\n position=\"side\"\n className={testutilStyles['drawers-slider']}\n ariaLabel={activeGlobalDrawer?.ariaLabels?.resizeHandle}\n ariaValuenow={resizeProps.relativeSize}\n onKeyDown={resizeProps.onKeyDown}\n onPointerDown={resizeProps.onPointerDown}\n />\n </div>\n )}\n <div className={clsx(styles['drawer-content-container'], sharedStyles['with-motion-horizontal'])}>\n <div className={clsx(styles['drawer-close-button'])}>\n <InternalButton\n ariaLabel={computedAriaLabels.closeButton}\n className={clsx({\n [testutilStyles['active-drawer-close-button']]: activeDrawerId,\n })}\n formAction=\"none\"\n iconName={isMobile ? 'close' : 'angle-right'}\n onClick={() => onActiveGlobalDrawersChange(activeDrawerId)}\n ref={refs?.close}\n variant=\"icon\"\n />\n </div>\n <div className={styles['drawer-content']}>{activeGlobalDrawer?.content}</div>\n </div>\n </aside>\n );\n }}\n </Transition>\n );\n}\n\nexport default AppLayoutGlobalDrawerImplementation;\n"]}
|
|
@@ -41,7 +41,7 @@ export function AppLayoutDrawerImplementation({ appLayoutInternals }) {
|
|
|
41
41
|
const lastOpenedDrawerId = (drawersOpenQueue === null || drawersOpenQueue === void 0 ? void 0 : drawersOpenQueue.length) ? drawersOpenQueue[0] : activeDrawerId;
|
|
42
42
|
return (React.createElement(Transition, { nodeRef: drawerRef, in: !!activeDrawer, appear: true, timeout: 0 }, state => {
|
|
43
43
|
var _a;
|
|
44
|
-
return (React.createElement("aside", { id: activeDrawerId, "aria-hidden": !activeDrawer, "aria-label": computedAriaLabels.content, className: clsx(styles.drawer, sharedStyles['with-motion'], {
|
|
44
|
+
return (React.createElement("aside", { id: activeDrawerId, "aria-hidden": !activeDrawer, "aria-label": computedAriaLabels.content, className: clsx(styles.drawer, sharedStyles['with-motion-horizontal'], {
|
|
45
45
|
[styles['last-opened']]: lastOpenedDrawerId === activeDrawerId,
|
|
46
46
|
[styles.legacy]: isLegacyDrawer,
|
|
47
47
|
[testutilStyles['active-drawer']]: !toolsOnlyMode && activeDrawerId,
|
|
@@ -58,7 +58,7 @@ export function AppLayoutDrawerImplementation({ appLayoutInternals }) {
|
|
|
58
58
|
})), "data-testid": `awsui-app-layout-drawer-${activeDrawerId}` },
|
|
59
59
|
!isMobile && (activeDrawer === null || activeDrawer === void 0 ? void 0 : activeDrawer.resizable) && (React.createElement("div", { className: styles['drawer-slider'] },
|
|
60
60
|
React.createElement(PanelResizeHandle, { ref: drawersFocusControl.refs.slider, position: "side", className: testutilStyles['drawers-slider'], ariaLabel: (_a = activeDrawer === null || activeDrawer === void 0 ? void 0 : activeDrawer.ariaLabels) === null || _a === void 0 ? void 0 : _a.resizeHandle, ariaValuenow: resizeProps.relativeSize, onKeyDown: resizeProps.onKeyDown, onPointerDown: resizeProps.onPointerDown }))),
|
|
61
|
-
React.createElement("div", { className: clsx(styles['drawer-content-container'], sharedStyles['with-motion']) },
|
|
61
|
+
React.createElement("div", { className: clsx(styles['drawer-content-container'], sharedStyles['with-motion-horizontal']) },
|
|
62
62
|
React.createElement("div", { className: clsx(styles['drawer-close-button']) },
|
|
63
63
|
React.createElement(InternalButton, { ariaLabel: computedAriaLabels.closeButton, className: clsx({
|
|
64
64
|
[testutilStyles['active-drawer-close-button']]: !isToolsDrawer && activeDrawerId,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"local-drawer.js","sourceRoot":"","sources":["../../../../../src/app-layout/visual-refresh-toolbar/drawer/local-drawer.tsx"],"names":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ACN,6BACE,SAAS,EAAE,IAAI,CACb,MAAM,CAAC,gBAAgB,CAAC,EACxB,cAAc,KAAK,eAAe,IAAI,MAAM,CAAC,uBAAuB,CAAC,CACtE,IAEA,YAAY,CACT;gBACL,cAAc,KAAK,eAAe,IAAI,CACrC,6BAAK,SAAS,EAAE,MAAM,CAAC,gBAAgB,CAAC,IAAG,YAAY,aAAZ,YAAY,uBAAZ,YAAY,CAAE,OAAO,CAAO,CACxE,CACG,CACA,CACT,CAAA;KAAA,CACU,CACd,CAAC;AACJ,CAAC;AAED,MAAM,CAAC,MAAM,+BAA+B,GAAG,yBAAyB,CAAC,6BAA6B,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 { Transition } from 'react-transition-group';\nimport clsx from 'clsx';\n\nimport { InternalButton } from '../../../button/internal';\nimport PanelResizeHandle from '../../../internal/components/panel-resize-handle';\nimport customCssProps from '../../../internal/generated/custom-css-properties';\nimport { createWidgetizedComponent } from '../../../internal/widgets';\nimport { getLimitedValue } from '../../../split-panel/utils/size-utils';\nimport { TOOLS_DRAWER_ID } from '../../utils/use-drawers';\nimport { getDrawerTopOffset } from '../compute-layout';\nimport { AppLayoutInternals } from '../interfaces';\nimport { useResize } from './use-resize';\n\nimport sharedStyles from '../../resize/styles.css.js';\nimport testutilStyles from '../../test-classes/styles.css.js';\nimport styles from './styles.css.js';\n\ninterface AppLayoutDrawerImplementationProps {\n appLayoutInternals: AppLayoutInternals;\n}\n\nexport function AppLayoutDrawerImplementation({ appLayoutInternals }: AppLayoutDrawerImplementationProps) {\n const {\n activeDrawer,\n minDrawerSize,\n activeDrawerSize,\n maxDrawerSize,\n ariaLabels,\n drawers,\n drawersFocusControl,\n isMobile,\n placement,\n verticalOffsets,\n drawersOpenQueue,\n onActiveDrawerChange,\n onActiveDrawerResize,\n } = appLayoutInternals;\n const drawerRef = useRef<HTMLDivElement>(null);\n const activeDrawerId = activeDrawer?.id;\n\n const computedAriaLabels = {\n closeButton: activeDrawer ? activeDrawer.ariaLabels?.closeButton : ariaLabels?.toolsClose,\n content: activeDrawer ? activeDrawer.ariaLabels?.drawerName : ariaLabels?.tools,\n };\n\n const drawersTopOffset = getDrawerTopOffset(verticalOffsets, isMobile, placement);\n const toolsOnlyMode = drawers.length === 1 && drawers[0].id === TOOLS_DRAWER_ID;\n const isToolsDrawer = activeDrawer?.id === TOOLS_DRAWER_ID || toolsOnlyMode;\n const toolsContent = drawers?.find(drawer => drawer.id === TOOLS_DRAWER_ID)?.content;\n const resizeProps = useResize({\n currentWidth: activeDrawerSize,\n minWidth: minDrawerSize,\n maxWidth: maxDrawerSize,\n panelRef: drawerRef,\n handleRef: drawersFocusControl.refs.slider,\n onResize: size => onActiveDrawerResize({ id: activeDrawerId!, size }),\n });\n // temporary handle a situation when app-layout is old, but this component come as a widget\n const isLegacyDrawer = drawersOpenQueue === undefined;\n const size = getLimitedValue(minDrawerSize, activeDrawerSize, maxDrawerSize);\n const lastOpenedDrawerId = drawersOpenQueue?.length ? drawersOpenQueue[0] : activeDrawerId;\n\n return (\n <Transition nodeRef={drawerRef} in={!!activeDrawer} appear={true} timeout={0}>\n {state => (\n <aside\n id={activeDrawerId}\n aria-hidden={!activeDrawer}\n aria-label={computedAriaLabels.content}\n className={clsx(styles.drawer, sharedStyles['with-motion'], {\n [styles['last-opened']]: lastOpenedDrawerId === activeDrawerId,\n [styles.legacy]: isLegacyDrawer,\n [testutilStyles['active-drawer']]: !toolsOnlyMode && activeDrawerId,\n [testutilStyles.tools]: isToolsDrawer,\n [styles['drawer-hidden']]: !activeDrawer,\n [testutilStyles['drawer-closed']]: !activeDrawer,\n })}\n ref={drawerRef}\n onBlur={e => {\n if (!e.relatedTarget || !e.currentTarget.contains(e.relatedTarget)) {\n drawersFocusControl.loseFocus();\n }\n }}\n style={{\n blockSize: `calc(100vh - ${drawersTopOffset}px - ${placement.insetBlockEnd}px)`,\n insetBlockStart: drawersTopOffset,\n ...(!isMobile &&\n !isLegacyDrawer && {\n [customCssProps.drawerSize]: `${['entering', 'entered'].includes(state) ? size : 0}px`,\n }),\n }}\n data-testid={`awsui-app-layout-drawer-${activeDrawerId}`}\n >\n {!isMobile && activeDrawer?.resizable && (\n <div className={styles['drawer-slider']}>\n <PanelResizeHandle\n ref={drawersFocusControl.refs.slider}\n position=\"side\"\n className={testutilStyles['drawers-slider']}\n ariaLabel={activeDrawer?.ariaLabels?.resizeHandle}\n ariaValuenow={resizeProps.relativeSize}\n onKeyDown={resizeProps.onKeyDown}\n onPointerDown={resizeProps.onPointerDown}\n />\n </div>\n )}\n <div className={clsx(styles['drawer-content-container'], sharedStyles['with-motion'])}>\n <div className={clsx(styles['drawer-close-button'])}>\n <InternalButton\n ariaLabel={computedAriaLabels.closeButton}\n className={clsx({\n [testutilStyles['active-drawer-close-button']]: !isToolsDrawer && activeDrawerId,\n [testutilStyles['tools-close']]: isToolsDrawer,\n })}\n formAction=\"none\"\n iconName={isMobile ? 'close' : 'angle-right'}\n onClick={() => onActiveDrawerChange(null)}\n ref={drawersFocusControl.refs.close}\n variant=\"icon\"\n />\n </div>\n <div\n className={clsx(\n styles['drawer-content'],\n activeDrawerId !== TOOLS_DRAWER_ID && styles['drawer-content-hidden']\n )}\n >\n {toolsContent}\n </div>\n {activeDrawerId !== TOOLS_DRAWER_ID && (\n <div className={styles['drawer-content']}>{activeDrawer?.content}</div>\n )}\n </div>\n </aside>\n )}\n </Transition>\n );\n}\n\nexport const createWidgetizedAppLayoutDrawer = createWidgetizedComponent(AppLayoutDrawerImplementation);\n"]}
|
|
1
|
+
{"version":3,"file":"local-drawer.js","sourceRoot":"","sources":["../../../../../src/app-layout/visual-refresh-toolbar/drawer/local-drawer.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AACtC,OAAO,EAAE,UAAU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ACtE,IAEA,YAAY,CACT;gBACL,cAAc,KAAK,eAAe,IAAI,CACrC,6BAAK,SAAS,EAAE,MAAM,CAAC,gBAAgB,CAAC,IAAG,YAAY,aAAZ,YAAY,uBAAZ,YAAY,CAAE,OAAO,CAAO,CACxE,CACG,CACA,CACT,CAAA;KAAA,CACU,CACd,CAAC;AACJ,CAAC;AAED,MAAM,CAAC,MAAM,+BAA+B,GAAG,yBAAyB,CAAC,6BAA6B,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 { Transition } from 'react-transition-group';\nimport clsx from 'clsx';\n\nimport { InternalButton } from '../../../button/internal';\nimport PanelResizeHandle from '../../../internal/components/panel-resize-handle';\nimport customCssProps from '../../../internal/generated/custom-css-properties';\nimport { createWidgetizedComponent } from '../../../internal/widgets';\nimport { getLimitedValue } from '../../../split-panel/utils/size-utils';\nimport { TOOLS_DRAWER_ID } from '../../utils/use-drawers';\nimport { getDrawerTopOffset } from '../compute-layout';\nimport { AppLayoutInternals } from '../interfaces';\nimport { useResize } from './use-resize';\n\nimport sharedStyles from '../../resize/styles.css.js';\nimport testutilStyles from '../../test-classes/styles.css.js';\nimport styles from './styles.css.js';\n\ninterface AppLayoutDrawerImplementationProps {\n appLayoutInternals: AppLayoutInternals;\n}\n\nexport function AppLayoutDrawerImplementation({ appLayoutInternals }: AppLayoutDrawerImplementationProps) {\n const {\n activeDrawer,\n minDrawerSize,\n activeDrawerSize,\n maxDrawerSize,\n ariaLabels,\n drawers,\n drawersFocusControl,\n isMobile,\n placement,\n verticalOffsets,\n drawersOpenQueue,\n onActiveDrawerChange,\n onActiveDrawerResize,\n } = appLayoutInternals;\n const drawerRef = useRef<HTMLDivElement>(null);\n const activeDrawerId = activeDrawer?.id;\n\n const computedAriaLabels = {\n closeButton: activeDrawer ? activeDrawer.ariaLabels?.closeButton : ariaLabels?.toolsClose,\n content: activeDrawer ? activeDrawer.ariaLabels?.drawerName : ariaLabels?.tools,\n };\n\n const drawersTopOffset = getDrawerTopOffset(verticalOffsets, isMobile, placement);\n const toolsOnlyMode = drawers.length === 1 && drawers[0].id === TOOLS_DRAWER_ID;\n const isToolsDrawer = activeDrawer?.id === TOOLS_DRAWER_ID || toolsOnlyMode;\n const toolsContent = drawers?.find(drawer => drawer.id === TOOLS_DRAWER_ID)?.content;\n const resizeProps = useResize({\n currentWidth: activeDrawerSize,\n minWidth: minDrawerSize,\n maxWidth: maxDrawerSize,\n panelRef: drawerRef,\n handleRef: drawersFocusControl.refs.slider,\n onResize: size => onActiveDrawerResize({ id: activeDrawerId!, size }),\n });\n // temporary handle a situation when app-layout is old, but this component come as a widget\n const isLegacyDrawer = drawersOpenQueue === undefined;\n const size = getLimitedValue(minDrawerSize, activeDrawerSize, maxDrawerSize);\n const lastOpenedDrawerId = drawersOpenQueue?.length ? drawersOpenQueue[0] : activeDrawerId;\n\n return (\n <Transition nodeRef={drawerRef} in={!!activeDrawer} appear={true} timeout={0}>\n {state => (\n <aside\n id={activeDrawerId}\n aria-hidden={!activeDrawer}\n aria-label={computedAriaLabels.content}\n className={clsx(styles.drawer, sharedStyles['with-motion-horizontal'], {\n [styles['last-opened']]: lastOpenedDrawerId === activeDrawerId,\n [styles.legacy]: isLegacyDrawer,\n [testutilStyles['active-drawer']]: !toolsOnlyMode && activeDrawerId,\n [testutilStyles.tools]: isToolsDrawer,\n [styles['drawer-hidden']]: !activeDrawer,\n [testutilStyles['drawer-closed']]: !activeDrawer,\n })}\n ref={drawerRef}\n onBlur={e => {\n if (!e.relatedTarget || !e.currentTarget.contains(e.relatedTarget)) {\n drawersFocusControl.loseFocus();\n }\n }}\n style={{\n blockSize: `calc(100vh - ${drawersTopOffset}px - ${placement.insetBlockEnd}px)`,\n insetBlockStart: drawersTopOffset,\n ...(!isMobile &&\n !isLegacyDrawer && {\n [customCssProps.drawerSize]: `${['entering', 'entered'].includes(state) ? size : 0}px`,\n }),\n }}\n data-testid={`awsui-app-layout-drawer-${activeDrawerId}`}\n >\n {!isMobile && activeDrawer?.resizable && (\n <div className={styles['drawer-slider']}>\n <PanelResizeHandle\n ref={drawersFocusControl.refs.slider}\n position=\"side\"\n className={testutilStyles['drawers-slider']}\n ariaLabel={activeDrawer?.ariaLabels?.resizeHandle}\n ariaValuenow={resizeProps.relativeSize}\n onKeyDown={resizeProps.onKeyDown}\n onPointerDown={resizeProps.onPointerDown}\n />\n </div>\n )}\n <div className={clsx(styles['drawer-content-container'], sharedStyles['with-motion-horizontal'])}>\n <div className={clsx(styles['drawer-close-button'])}>\n <InternalButton\n ariaLabel={computedAriaLabels.closeButton}\n className={clsx({\n [testutilStyles['active-drawer-close-button']]: !isToolsDrawer && activeDrawerId,\n [testutilStyles['tools-close']]: isToolsDrawer,\n })}\n formAction=\"none\"\n iconName={isMobile ? 'close' : 'angle-right'}\n onClick={() => onActiveDrawerChange(null)}\n ref={drawersFocusControl.refs.close}\n variant=\"icon\"\n />\n </div>\n <div\n className={clsx(\n styles['drawer-content'],\n activeDrawerId !== TOOLS_DRAWER_ID && styles['drawer-content-hidden']\n )}\n >\n {toolsContent}\n </div>\n {activeDrawerId !== TOOLS_DRAWER_ID && (\n <div className={styles['drawer-content']}>{activeDrawer?.content}</div>\n )}\n </div>\n </aside>\n )}\n </Transition>\n );\n}\n\nexport const createWidgetizedAppLayoutDrawer = createWidgetizedComponent(AppLayoutDrawerImplementation);\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-resize.d.ts","sourceRoot":"","sources":["../../../../../src/app-layout/visual-refresh-toolbar/drawer/use-resize.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAO1B,UAAU,WAAW;IACnB,YAAY,EAAE,MAAM,CAAC;IACrB,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC,cAAc,CAAC,CAAC;IAC1C,SAAS,EAAE,KAAK,CAAC,SAAS,CAAC,cAAc,CAAC,CAAC;IAC3C,QAAQ,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAC;CACtC;AAED,wBAAgB,SAAS,CAAC,EAAE,YAAY,EAAE,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE,SAAS,EAAE,QAAQ,EAAE,EAAE,WAAW;;;;
|
|
1
|
+
{"version":3,"file":"use-resize.d.ts","sourceRoot":"","sources":["../../../../../src/app-layout/visual-refresh-toolbar/drawer/use-resize.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAO1B,UAAU,WAAW;IACnB,YAAY,EAAE,MAAM,CAAC;IACrB,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC,cAAc,CAAC,CAAC;IAC1C,SAAS,EAAE,KAAK,CAAC,SAAS,CAAC,cAAc,CAAC,CAAC;IAC3C,QAAQ,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAC;CACtC;AAED,wBAAgB,SAAS,CAAC,EAAE,YAAY,EAAE,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE,SAAS,EAAE,QAAQ,EAAE,EAAE,WAAW;;;;EAuBzG"}
|
|
@@ -13,7 +13,6 @@ export function useResize({ currentWidth, minWidth, maxWidth, panelRef, handleRe
|
|
|
13
13
|
panelRef,
|
|
14
14
|
handleRef,
|
|
15
15
|
onResize: onResizeHandler,
|
|
16
|
-
hasTransitions: true,
|
|
17
16
|
};
|
|
18
17
|
const clampedWidth = getLimitedValue(minWidth, currentWidth, maxWidth);
|
|
19
18
|
const relativeSize = ((clampedWidth - minWidth) / (maxWidth - minWidth)) * 100;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-resize.js","sourceRoot":"","sources":["../../../../../src/app-layout/visual-refresh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;IACH,CAAC,CAAC;IAEF,MAAM,gBAAgB,GAAqB;QACzC,QAAQ,EAAE,MAAM;QAChB,QAAQ;QACR,SAAS;QACT,QAAQ,EAAE,eAAe;KAC1B,CAAC;IAEF,MAAM,YAAY,GAAG,eAAe,CAAC,QAAQ,EAAE,YAAY,EAAE,QAAQ,CAAC,CAAC;IACvE,MAAM,YAAY,GAAG,CAAC,CAAC,YAAY,GAAG,QAAQ,CAAC,GAAG,CAAC,QAAQ,GAAG,QAAQ,CAAC,CAAC,GAAG,GAAG,CAAC;IAE/E,MAAM,aAAa,GAAG,gBAAgB,CAAC,gBAAgB,CAAC,CAAC;IACzD,MAAM,SAAS,GAAG,iBAAiB,CAAC,gBAAgB,CAAC,CAAC;IAEtD,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,YAAY,EAAE,CAAC;AACpD,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\n\nimport { getLimitedValue } from '../../../split-panel/utils/size-utils';\nimport { SizeControlProps } from '../../utils/interfaces';\nimport { useKeyboardEvents } from '../../utils/use-keyboard-events';\nimport { usePointerEvents } from '../../utils/use-pointer-events';\n\ninterface ResizeProps {\n currentWidth: number;\n minWidth: number;\n maxWidth: number;\n panelRef: React.RefObject<HTMLDivElement>;\n handleRef: React.RefObject<HTMLDivElement>;\n onResize: (newWidth: number) => void;\n}\n\nexport function useResize({ currentWidth, minWidth, maxWidth, panelRef, handleRef, onResize }: ResizeProps) {\n const onResizeHandler = (newWidth: number) => {\n const size = getLimitedValue(minWidth, newWidth, maxWidth);\n\n if (maxWidth >= minWidth) {\n onResize(size);\n }\n };\n\n const sizeControlProps: SizeControlProps = {\n position: 'side',\n panelRef,\n handleRef,\n onResize: onResizeHandler,\n };\n\n const clampedWidth = getLimitedValue(minWidth, currentWidth, maxWidth);\n const relativeSize = ((clampedWidth - minWidth) / (maxWidth - minWidth)) * 100;\n\n const onPointerDown = usePointerEvents(sizeControlProps);\n const onKeyDown = useKeyboardEvents(sizeControlProps);\n\n return { onKeyDown, onPointerDown, relativeSize };\n}\n"]}
|
|
@@ -23,7 +23,7 @@ export function AppLayoutNavigationImplementation({ appLayoutInternals }) {
|
|
|
23
23
|
return (React.createElement("nav", { "aria-label": (_a = ariaLabels === null || ariaLabels === void 0 ? void 0 : ariaLabels.navigation) !== null && _a !== void 0 ? _a : undefined, className: clsx(styles.navigation, {
|
|
24
24
|
[styles['is-navigation-open']]: navigationOpen,
|
|
25
25
|
[testutilStyles['drawer-closed']]: !navigationOpen,
|
|
26
|
-
}, testutilStyles.navigation, sharedStyles['with-motion']), "aria-hidden": !navigationOpen, onClick: onNavigationClick, style: {
|
|
26
|
+
}, testutilStyles.navigation, sharedStyles['with-motion-horizontal']), "aria-hidden": !navigationOpen, onClick: onNavigationClick, style: {
|
|
27
27
|
blockSize: `calc(100vh - ${drawersTopOffset}px - ${placement.insetBlockEnd}px)`,
|
|
28
28
|
insetBlockStart: drawersTopOffset,
|
|
29
29
|
} },
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/app-layout/visual-refresh-toolbar/navigation/index.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,WAAW,EAAE,MAAM,0CAA0C,CAAC;AAEvE,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC1D,OAAO,EAAE,yBAAyB,EAAE,MAAM,2BAA2B,CAAC;AACtE,OAAO,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAGvD,OAAO,YAAY,MAAM,4BAA4B,CAAC;AACtD,OAAO,cAAc,MAAM,kCAAkC,CAAC;AAC9D,OAAO,MAAM,MAAM,iBAAiB,CAAC;AAMrC,MAAM,UAAU,iCAAiC,CAAC,EAAE,kBAAkB,EAA0C;;IAC9G,MAAM,EACJ,UAAU,EACV,kBAAkB,EAClB,QAAQ,EACR,cAAc,EACd,UAAU,EACV,sBAAsB,EACtB,SAAS,EACT,eAAe,GAChB,GAAG,kBAAkB,CAAC;IAEvB,MAAM,gBAAgB,GAAG,kBAAkB,CAAC,eAAe,EAAE,QAAQ,EAAE,SAAS,CAAC,CAAC;IAElF,0EAA0E;IAC1E,MAAM,iBAAiB,GAAG,CAAC,KAAuB,EAAE,EAAE;QACpD,MAAM,OAAO,GAAG,WAAW,CACzB,KAAK,CAAC,MAAqB,EAC3B,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,OAAO,KAAK,GAAG,IAAI,CAAC,CAAE,IAA0B,CAAC,IAAI,CACnE,CAAC;QACF,IAAI,OAAO,IAAI,QAAQ,EAAE;YACvB,kBAAkB,CAAC,KAAK,CAAC,CAAC;SAC3B;IACH,CAAC,CAAC;IAEF,OAAO,CACL,2CACc,MAAA,UAAU,aAAV,UAAU,uBAAV,UAAU,CAAE,UAAU,mCAAI,SAAS,EAC/C,SAAS,EAAE,IAAI,CACb,MAAM,CAAC,UAAU,EACjB;YACE,CAAC,MAAM,CAAC,oBAAoB,CAAC,CAAC,EAAE,cAAc;YAC9C,CAAC,cAAc,CAAC,eAAe,CAAC,CAAC,EAAE,CAAC,cAAc;SACnD,EACD,cAAc,CAAC,UAAU,EACzB,YAAY,CAAC,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/app-layout/visual-refresh-toolbar/navigation/index.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,WAAW,EAAE,MAAM,0CAA0C,CAAC;AAEvE,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC1D,OAAO,EAAE,yBAAyB,EAAE,MAAM,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AAC,aAAa,KAAK;YAC/E,eAAe,EAAE,gBAAgB;SAClC;QAED,6BAAK,SAAS,EAAE,IAAI,CAAC,MAAM,CAAC,kBAAkB,CAAC,CAAC;YAC9C,6BAAK,SAAS,EAAE,IAAI,CAAC,MAAM,CAAC,iBAAiB,CAAC,CAAC;gBAC7C,oBAAC,cAAc,IACb,SAAS,EAAE,MAAA,UAAU,aAAV,UAAU,uBAAV,UAAU,CAAE,eAAe,mCAAI,SAAS,EACnD,QAAQ,EAAE,QAAQ,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,YAAY,EAC3C,OAAO,EAAE,GAAG,EAAE,CAAC,kBAAkB,CAAC,KAAK,CAAC,EACxC,OAAO,EAAC,MAAM,EACd,UAAU,EAAC,MAAM,EACjB,SAAS,EAAE,cAAc,CAAC,kBAAkB,CAAC,EAC7C,GAAG,EAAE,sBAAsB,CAAC,IAAI,CAAC,KAAK,GACtC,CACE;YACL,UAAU,CACP,CACF,CACP,CAAC;AACJ,CAAC;AAED,MAAM,CAAC,MAAM,mCAAmC,GAAG,yBAAyB,CAAC,iCAAiC,CAAC,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\nimport clsx from 'clsx';\n\nimport { findUpUntil } from '@cloudscape-design/component-toolkit/dom';\n\nimport { InternalButton } from '../../../button/internal';\nimport { createWidgetizedComponent } from '../../../internal/widgets';\nimport { getDrawerTopOffset } from '../compute-layout';\nimport { AppLayoutInternals } from '../interfaces';\n\nimport sharedStyles from '../../resize/styles.css.js';\nimport testutilStyles from '../../test-classes/styles.css.js';\nimport styles from './styles.css.js';\n\ninterface AppLayoutNavigationImplementationProps {\n appLayoutInternals: AppLayoutInternals;\n}\n\nexport function AppLayoutNavigationImplementation({ appLayoutInternals }: AppLayoutNavigationImplementationProps) {\n const {\n ariaLabels,\n onNavigationToggle,\n isMobile,\n navigationOpen,\n navigation,\n navigationFocusControl,\n placement,\n verticalOffsets,\n } = appLayoutInternals;\n\n const drawersTopOffset = getDrawerTopOffset(verticalOffsets, isMobile, placement);\n\n // Close the Navigation drawer on mobile when a user clicks a link inside.\n const onNavigationClick = (event: React.MouseEvent) => {\n const hasLink = findUpUntil(\n event.target as HTMLElement,\n node => node.tagName === 'A' && !!(node as HTMLAnchorElement).href\n );\n if (hasLink && isMobile) {\n onNavigationToggle(false);\n }\n };\n\n return (\n <nav\n aria-label={ariaLabels?.navigation ?? undefined}\n className={clsx(\n styles.navigation,\n {\n [styles['is-navigation-open']]: navigationOpen,\n [testutilStyles['drawer-closed']]: !navigationOpen,\n },\n testutilStyles.navigation,\n sharedStyles['with-motion-horizontal']\n )}\n aria-hidden={!navigationOpen}\n onClick={onNavigationClick}\n style={{\n blockSize: `calc(100vh - ${drawersTopOffset}px - ${placement.insetBlockEnd}px)`,\n insetBlockStart: drawersTopOffset,\n }}\n >\n <div className={clsx(styles['animated-content'])}>\n <div className={clsx(styles['hide-navigation'])}>\n <InternalButton\n ariaLabel={ariaLabels?.navigationClose ?? undefined}\n iconName={isMobile ? 'close' : 'angle-left'}\n onClick={() => onNavigationToggle(false)}\n variant=\"icon\"\n formAction=\"none\"\n className={testutilStyles['navigation-close']}\n ref={navigationFocusControl.refs.close}\n />\n </div>\n {navigation}\n </div>\n </nav>\n );\n}\n\nexport const createWidgetizedAppLayoutNavigation = createWidgetizedComponent(AppLayoutNavigationImplementation);\n"]}
|
|
@@ -23,7 +23,7 @@ export const SkeletonLayout = React.forwardRef(({ style, notifications, headerVa
|
|
|
23
23
|
[customCssProps.toolsWidth]: `${toolsWidth}px`,
|
|
24
24
|
} },
|
|
25
25
|
toolbar,
|
|
26
|
-
navigation && (React.createElement("div", { className: clsx(styles.navigation, !navigationOpen && styles['panel-hidden'], toolsOpen && styles['unfocusable-mobile'], sharedStyles['with-motion']) }, navigation)),
|
|
26
|
+
navigation && (React.createElement("div", { className: clsx(styles.navigation, !navigationOpen && styles['panel-hidden'], toolsOpen && styles['unfocusable-mobile'], sharedStyles['with-motion-horizontal']) }, navigation)),
|
|
27
27
|
React.createElement("main", { className: clsx(styles['main-landmark'], isMobile && anyPanelOpen && styles['unfocusable-mobile']) },
|
|
28
28
|
notifications && (React.createElement("div", { className: clsx(styles['notifications-background'], headerVariant === 'high-contrast' && highContrastHeaderClassName) })),
|
|
29
29
|
notifications,
|
|
@@ -32,7 +32,7 @@ export const SkeletonLayout = React.forwardRef(({ style, notifications, headerVa
|
|
|
32
32
|
React.createElement("div", { className: clsx(styles.content, testutilStyles.content) }, content)),
|
|
33
33
|
bottomSplitPanel && (React.createElement("div", { className: clsx(styles['split-panel-bottom']), style: { insetBlockEnd: placement.insetBlockEnd } }, bottomSplitPanel))),
|
|
34
34
|
sideSplitPanel && (React.createElement("div", { className: clsx(styles['split-panel-side'], !splitPanelOpen && styles['panel-hidden']) }, sideSplitPanel)),
|
|
35
|
-
React.createElement("div", { className: clsx(styles.tools, !toolsOpen && styles['panel-hidden'], sharedStyles['with-motion'], navigationOpen && !toolsOpen && styles['unfocusable-mobile'], toolsOpen && styles['tools-open']) }, tools),
|
|
35
|
+
React.createElement("div", { className: clsx(styles.tools, !toolsOpen && styles['panel-hidden'], sharedStyles['with-motion-horizontal'], navigationOpen && !toolsOpen && styles['unfocusable-mobile'], toolsOpen && styles['tools-open']) }, tools),
|
|
36
36
|
React.createElement("div", { className: clsx(styles['global-tools'], !globalToolsOpen && styles['panel-hidden']) }, globalTools)));
|
|
37
37
|
});
|
|
38
38
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/app-layout/visual-refresh-toolbar/skeleton/index.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,cAAc,MAAM,mDAAmD,CAAC;AAC/E,O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,EAAE,UAAU,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,GAAG,eAAe,IAAI,CAAC,CAAC,CAAC,EAAE;YACrG,CAAC,cAAc,CAAC,eAAe,CAAC,EAAE,GAAG,eAAe,IAAI;YACxD,CAAC,cAAc,CAAC,UAAU,CAAC,EAAE,GAAG,UAAU,IAAI;SAC/C;QAEA,OAAO;QACP,UAAU,IAAI,CACb,6BACE,SAAS,EAAE,IAAI,CACb,MAAM,CAAC,UAAU,EACjB,CAAC,cAAc,IAAI,MAAM,CAAC,cAAc,CAAC,EACzC,SAAS,IAAI,MAAM,CAAC,oBAAoB,CAAC,EACzC,YAAY,CAAC,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/app-layout/visual-refresh-toolbar/skeleton/index.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,cAAc,MAAM,mDAAmD,CAAC;AAC/E,OAAO,EAAE,SAAS,EAAE,MAAM,oCAAoC,CAAC;AAC/D,OAAO,EAAE,2BAA2B,EAAE,MAAM,8CAA8C,CAAC;AAG3F,OAAO,YAAY,MAAM,4BAA4B,CAAC;AACtD,OAAO,cAAc,MAAM,kCAAkC,CAAC;AAC9D,OAAO,MAAM,MAAM,iBAAiB,CAAC;AAErC,MAAM,uBAAuB,GAA8B,CAAC,WAAW,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;AA6B3F,MAAM,CAAC,MAAM,cAAc,GAAG,KAAK,CAAC,UAAU,CAC5C,CACE,EACE,KAAK,EACL,aAAa,EACb,aAAa,EACb,aAAa,EACb,OAAO,EACP,UAAU,EACV,cAAc,EACd,eAAe,EACf,KAAK,EACL,WAAW,EACX,SAAS,EACT,UAAU,EACV,OAAO,EACP,cAAc,EACd,gBAAgB,EAChB,cAAc,EACd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,IAAI,MAAM,CAAC,cAAc,CAAC,CAAC,IAAG,WAAW,CAAO,CACzG,CACP,CAAC;AACJ,CAAC,CACF,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 customCssProps from '../../../internal/generated/custom-css-properties';\nimport { useMobile } from '../../../internal/hooks/use-mobile';\nimport { highContrastHeaderClassName } from '../../../internal/utils/content-header-utils';\nimport { AppLayoutPropsWithDefaults } from '../../interfaces';\n\nimport sharedStyles from '../../resize/styles.css.js';\nimport testutilStyles from '../../test-classes/styles.css.js';\nimport styles from './styles.css.js';\n\nconst contentTypeCustomWidths: Array<string | undefined> = ['dashboard', 'cards', 'table'];\n\ninterface SkeletonLayoutProps\n extends Pick<\n AppLayoutPropsWithDefaults,\n | 'notifications'\n | 'headerVariant'\n | 'contentHeader'\n | 'content'\n | 'contentType'\n | 'maxContentWidth'\n | 'disableContentPaddings'\n | 'navigation'\n | 'navigationOpen'\n | 'navigationWidth'\n | 'tools'\n | 'toolsOpen'\n | 'toolsWidth'\n | 'placement'\n > {\n style?: React.CSSProperties;\n toolbar?: React.ReactNode;\n splitPanelOpen?: boolean;\n sideSplitPanel?: React.ReactNode;\n bottomSplitPanel?: React.ReactNode;\n globalTools?: React.ReactNode;\n globalToolsOpen?: boolean;\n}\n\nexport const SkeletonLayout = React.forwardRef<HTMLDivElement, SkeletonLayoutProps>(\n (\n {\n style,\n notifications,\n headerVariant,\n contentHeader,\n content,\n navigation,\n navigationOpen,\n navigationWidth,\n tools,\n globalTools,\n toolsOpen,\n toolsWidth,\n toolbar,\n sideSplitPanel,\n bottomSplitPanel,\n splitPanelOpen,\n placement,\n contentType,\n maxContentWidth,\n disableContentPaddings,\n globalToolsOpen,\n },\n ref\n ) => {\n const isMobile = useMobile();\n const isMaxWidth = maxContentWidth === Number.MAX_VALUE || maxContentWidth === Number.MAX_SAFE_INTEGER;\n const anyPanelOpen = navigationOpen || toolsOpen;\n return (\n <div\n ref={ref}\n className={clsx(styles.root, testutilStyles.root, {\n [styles['has-adaptive-widths-default']]: !contentTypeCustomWidths.includes(contentType),\n [styles['has-adaptive-widths-dashboard']]: contentType === 'dashboard',\n })}\n style={{\n minBlockSize: `calc(100vh - ${placement.insetBlockStart + placement.insetBlockEnd}px)`,\n [customCssProps.maxContentWidth]: isMaxWidth ? '100%' : maxContentWidth ? `${maxContentWidth}px` : '',\n [customCssProps.navigationWidth]: `${navigationWidth}px`,\n [customCssProps.toolsWidth]: `${toolsWidth}px`,\n }}\n >\n {toolbar}\n {navigation && (\n <div\n className={clsx(\n styles.navigation,\n !navigationOpen && styles['panel-hidden'],\n toolsOpen && styles['unfocusable-mobile'],\n sharedStyles['with-motion-horizontal']\n )}\n >\n {navigation}\n </div>\n )}\n <main className={clsx(styles['main-landmark'], isMobile && anyPanelOpen && styles['unfocusable-mobile'])}>\n {notifications && (\n <div\n className={clsx(\n styles['notifications-background'],\n headerVariant === 'high-contrast' && highContrastHeaderClassName\n )}\n ></div>\n )}\n {notifications}\n <div\n className={clsx(styles.main, { [styles['main-disable-paddings']]: disableContentPaddings })}\n style={style}\n >\n {contentHeader && <div className={styles['content-header']}>{contentHeader}</div>}\n <div className={clsx(styles.content, testutilStyles.content)}>{content}</div>\n </div>\n {bottomSplitPanel && (\n <div className={clsx(styles['split-panel-bottom'])} style={{ insetBlockEnd: placement.insetBlockEnd }}>\n {bottomSplitPanel}\n </div>\n )}\n </main>\n {sideSplitPanel && (\n <div className={clsx(styles['split-panel-side'], !splitPanelOpen && styles['panel-hidden'])}>\n {sideSplitPanel}\n </div>\n )}\n <div\n className={clsx(\n styles.tools,\n !toolsOpen && styles['panel-hidden'],\n sharedStyles['with-motion-horizontal'],\n navigationOpen && !toolsOpen && styles['unfocusable-mobile'],\n toolsOpen && styles['tools-open']\n )}\n >\n {tools}\n </div>\n <div className={clsx(styles['global-tools'], !globalToolsOpen && styles['panel-hidden'])}>{globalTools}</div>\n </div>\n );\n }\n);\n"]}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { ButtonProps } from '../button/interfaces.js';
|
|
3
|
-
import { CancelableEventHandler
|
|
3
|
+
import { CancelableEventHandler } from '../internal/events/index.js';
|
|
4
4
|
import { ButtonGroupProps } from './interfaces.js';
|
|
5
5
|
declare const IconButtonItem: React.ForwardRefExoticComponent<{
|
|
6
6
|
item: ButtonGroupProps.IconButton;
|
|
7
7
|
showTooltip: boolean;
|
|
8
8
|
showFeedback: boolean;
|
|
9
|
-
onItemClick?: CancelableEventHandler<
|
|
9
|
+
onItemClick?: CancelableEventHandler<ButtonGroupProps.ItemClickDetails> | undefined;
|
|
10
10
|
} & React.RefAttributes<ButtonProps.Ref>>;
|
|
11
11
|
export default IconButtonItem;
|
|
12
12
|
//# sourceMappingURL=icon-button-item.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"icon-button-item.d.ts","sourceRoot":"","sources":["../../../src/button-group/icon-button-item.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAqB,MAAM,OAAO,CAAC;AAK1C,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAGtD,OAAO,EAAE,sBAAsB,
|
|
1
|
+
{"version":3,"file":"icon-button-item.d.ts","sourceRoot":"","sources":["../../../src/button-group/icon-button-item.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAqB,MAAM,OAAO,CAAC;AAK1C,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAGtD,OAAO,EAAE,sBAAsB,EAAuB,MAAM,6BAA6B,CAAC;AAE1F,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAInD,QAAA,MAAM,cAAc;UAQR,iBAAiB,UAAU;iBACpB,OAAO;kBACN,OAAO;;yCAkD1B,CAAC;AAEF,eAAe,cAAc,CAAC"}
|
|
@@ -5,6 +5,7 @@ import clsx from 'clsx';
|
|
|
5
5
|
import { warnOnce } from '@cloudscape-design/component-toolkit/internal';
|
|
6
6
|
import { InternalButton } from '../button/internal.js';
|
|
7
7
|
import Tooltip from '../internal/components/tooltip/index.js';
|
|
8
|
+
import { fireCancelableEvent } from '../internal/events/index.js';
|
|
8
9
|
import InternalLiveRegion from '../live-region/internal.js';
|
|
9
10
|
import testUtilStyles from './test-classes/styles.css.js';
|
|
10
11
|
const IconButtonItem = forwardRef(({ item, showTooltip, showFeedback, onItemClick, }, ref) => {
|
|
@@ -13,9 +14,11 @@ const IconButtonItem = forwardRef(({ item, showTooltip, showFeedback, onItemClic
|
|
|
13
14
|
if (!hasIcon) {
|
|
14
15
|
warnOnce('ButtonGroup', `Missing icon for item with id: ${item.id}`);
|
|
15
16
|
}
|
|
17
|
+
const canShowTooltip = Boolean(showTooltip && !item.disabled && !item.loading);
|
|
18
|
+
const canShowFeedback = Boolean(showTooltip && showFeedback && item.popoverFeedback);
|
|
16
19
|
return (React.createElement("div", { ref: containerRef },
|
|
17
|
-
React.createElement(InternalButton, { variant: "icon", loading: item.loading, loadingText: item.loadingText, disabled: item.disabled, iconName: hasIcon ? item.iconName : 'close',
|
|
18
|
-
|
|
20
|
+
React.createElement(InternalButton, { variant: "icon", loading: item.loading, loadingText: item.loadingText, disabled: item.disabled, __focusable: canShowFeedback, iconName: hasIcon ? item.iconName : 'close', iconUrl: item.iconUrl, iconSvg: item.iconSvg, iconAlt: item.text, ariaLabel: item.text, onClick: event => fireCancelableEvent(onItemClick, { id: item.id }, event), ref: ref, "data-testid": item.id, "data-itemid": item.id, className: clsx(testUtilStyles.item, testUtilStyles['button-group-item']), __title: "" }, item.text),
|
|
21
|
+
(canShowTooltip || canShowFeedback) && (React.createElement(Tooltip, { trackRef: containerRef, trackKey: item.id, value: (showFeedback && React.createElement(InternalLiveRegion, { tagName: "span" }, item.popoverFeedback)) ||
|
|
19
22
|
item.text, className: clsx(testUtilStyles.tooltip, testUtilStyles['button-group-tooltip']) }))));
|
|
20
23
|
});
|
|
21
24
|
export default IconButtonItem;
|