@cloudscape-design/components 3.0.602 → 3.0.603
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/classic.d.ts +5 -0
- package/app-layout/classic.d.ts.map +1 -1
- package/app-layout/classic.js +10 -18
- package/app-layout/classic.js.map +1 -1
- package/app-layout/defaults.d.ts +0 -1
- package/app-layout/defaults.d.ts.map +1 -1
- package/app-layout/defaults.js +1 -2
- package/app-layout/defaults.js.map +1 -1
- package/app-layout/implementation.d.ts +5 -0
- package/app-layout/implementation.d.ts.map +1 -1
- package/app-layout/index.d.ts.map +1 -1
- package/app-layout/index.js +31 -6
- package/app-layout/index.js.map +1 -1
- package/app-layout/interfaces.d.ts +1 -1
- package/app-layout/interfaces.d.ts.map +1 -1
- package/app-layout/interfaces.js.map +1 -1
- package/app-layout/internal.d.ts +5 -0
- package/app-layout/internal.d.ts.map +1 -1
- package/app-layout/utils/use-resize.d.ts +2 -1
- package/app-layout/utils/use-resize.d.ts.map +1 -1
- package/app-layout/utils/use-resize.js +7 -9
- package/app-layout/utils/use-resize.js.map +1 -1
- package/app-layout/visual-refresh/context.d.ts +1 -4
- package/app-layout/visual-refresh/context.d.ts.map +1 -1
- package/app-layout/visual-refresh/context.js +28 -64
- package/app-layout/visual-refresh/context.js.map +1 -1
- package/app-layout/visual-refresh/drawers.js +4 -4
- package/app-layout/visual-refresh/drawers.js.map +1 -1
- package/app-layout/visual-refresh/index.d.ts +5 -0
- package/app-layout/visual-refresh/index.d.ts.map +1 -1
- package/app-layout/visual-refresh/layout.js +2 -2
- package/app-layout/visual-refresh/layout.js.map +1 -1
- package/app-layout/visual-refresh/main.js +2 -2
- package/app-layout/visual-refresh/main.js.map +1 -1
- package/app-layout/visual-refresh/mobile-toolbar.js +3 -3
- package/app-layout/visual-refresh/mobile-toolbar.js.map +1 -1
- package/app-layout/visual-refresh/navigation.d.ts.map +1 -1
- package/app-layout/visual-refresh/navigation.js +10 -12
- package/app-layout/visual-refresh/navigation.js.map +1 -1
- package/app-layout/visual-refresh/split-panel.d.ts.map +1 -1
- package/app-layout/visual-refresh/split-panel.js +5 -5
- package/app-layout/visual-refresh/split-panel.js.map +1 -1
- package/app-layout/visual-refresh/styles.css.js +81 -81
- package/app-layout/visual-refresh/styles.scoped.css +169 -181
- package/app-layout/visual-refresh/styles.selectors.js +81 -81
- package/app-layout/visual-refresh/tools.d.ts.map +1 -1
- package/app-layout/visual-refresh/tools.js +2 -3
- package/app-layout/visual-refresh/tools.js.map +1 -1
- package/internal/environment.js +1 -1
- package/internal/environment.json +1 -1
- package/internal/manifest.json +1 -1
- package/package.json +1 -1
|
@@ -2,86 +2,86 @@
|
|
|
2
2
|
// es-module interop with Babel and Typescript
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
4
|
module.exports.default = {
|
|
5
|
-
"background": "
|
|
6
|
-
"scrolling-background": "awsui_scrolling-
|
|
7
|
-
"sticky-background": "awsui_sticky-
|
|
8
|
-
"has-sticky-notifications": "awsui_has-sticky-
|
|
9
|
-
"breadcrumbs": "
|
|
10
|
-
"has-sticky-background": "awsui_has-sticky-
|
|
11
|
-
"drawers-container": "awsui_drawers-
|
|
12
|
-
"has-open-drawer": "awsui_has-open-
|
|
13
|
-
"disable-body-scroll": "awsui_disable-body-
|
|
14
|
-
"drawers-desktop-triggers-container": "awsui_drawers-desktop-triggers-
|
|
15
|
-
"has-multiple-triggers": "awsui_has-multiple-
|
|
16
|
-
"drawers-mobile-triggers-container": "awsui_drawers-mobile-triggers-
|
|
17
|
-
"drawers-trigger-content": "awsui_drawers-trigger-
|
|
18
|
-
"drawers-trigger-overflow": "awsui_drawers-trigger-
|
|
19
|
-
"drawers-trigger": "awsui_drawers-
|
|
20
|
-
"drawer": "
|
|
21
|
-
"drawer-content-container": "awsui_drawer-content-
|
|
22
|
-
"drawer-close-button": "awsui_drawer-close-
|
|
23
|
-
"drawer-content": "awsui_drawer-
|
|
24
|
-
"drawer-content-hidden": "awsui_drawer-content-
|
|
25
|
-
"drawer-slider": "awsui_drawer-
|
|
26
|
-
"is-drawer-open": "awsui_is-drawer-
|
|
27
|
-
"content": "
|
|
28
|
-
"layout": "
|
|
29
|
-
"has-max-content-width": "awsui_has-max-content-
|
|
30
|
-
"content-type-dashboard": "awsui_content-type-
|
|
31
|
-
"content-type-table": "awsui_content-type-
|
|
32
|
-
"content-type-cards": "awsui_content-type-
|
|
33
|
-
"is-overlap-disabled": "awsui_is-overlap-
|
|
34
|
-
"is-hide-mobile-toolbar": "awsui_is-hide-mobile-
|
|
35
|
-
"has-content-gap-left": "awsui_has-content-gap-
|
|
36
|
-
"has-content-gap-right": "awsui_has-content-gap-
|
|
37
|
-
"content-first-child-notifications": "awsui_content-first-child-
|
|
38
|
-
"has-breadcrumbs": "awsui_has-
|
|
39
|
-
"content-first-child-header": "awsui_content-first-child-
|
|
40
|
-
"has-header": "awsui_has-
|
|
41
|
-
"content-first-child-main": "awsui_content-first-child-
|
|
42
|
-
"disable-content-paddings": "awsui_disable-content-
|
|
43
|
-
"has-split-panel": "awsui_has-split-
|
|
44
|
-
"split-panel-position-bottom": "awsui_split-panel-position-
|
|
45
|
-
"block-body-scroll": "awsui_block-body-
|
|
46
|
-
"unfocusable": "
|
|
47
|
-
"container": "
|
|
48
|
-
"is-navigation-open": "awsui_is-navigation-
|
|
49
|
-
"is-tools-open": "awsui_is-tools-
|
|
50
|
-
"is-split-panel-open": "awsui_is-split-panel-
|
|
51
|
-
"split-panel-position-side": "awsui_split-panel-position-
|
|
52
|
-
"has-active-drawer": "awsui_has-active-
|
|
53
|
-
"mobile-toolbar": "awsui_mobile-
|
|
54
|
-
"remove-high-contrast-header": "awsui_remove-high-contrast-
|
|
55
|
-
"mobile-toolbar-nav": "awsui_mobile-toolbar-
|
|
56
|
-
"mobile-toolbar-breadcrumbs": "awsui_mobile-toolbar-
|
|
57
|
-
"mobile-toolbar-tools": "awsui_mobile-toolbar-
|
|
58
|
-
"navigation-container": "awsui_navigation-
|
|
59
|
-
"show-navigation": "awsui_show-
|
|
60
|
-
"animating": "
|
|
61
|
-
"showButtons": "
|
|
62
|
-
"navigation": "
|
|
63
|
-
"openNavigation": "
|
|
64
|
-
"animated-content": "awsui_animated-
|
|
65
|
-
"hide-navigation": "awsui_hide-
|
|
66
|
-
"notifications": "
|
|
67
|
-
"sticky-notifications": "awsui_sticky-
|
|
68
|
-
"split-panel-bottom": "awsui_split-panel-
|
|
69
|
-
"position-bottom": "awsui_position-
|
|
70
|
-
"openSplitPanelBottom": "
|
|
71
|
-
"split-panel-side": "awsui_split-panel-
|
|
72
|
-
"position-side": "awsui_position-
|
|
73
|
-
"tools-container": "awsui_tools-
|
|
74
|
-
"tools": "
|
|
75
|
-
"openTools": "
|
|
76
|
-
"has-tools-form-persistence": "awsui_has-tools-form-
|
|
77
|
-
"hide-tools": "awsui_hide-
|
|
78
|
-
"show-tools": "awsui_show-
|
|
79
|
-
"has-tools-form": "awsui_has-tools-
|
|
80
|
-
"trigger-badge-wrapper": "awsui_trigger-badge-
|
|
81
|
-
"trigger": "
|
|
82
|
-
"selected": "
|
|
83
|
-
"badge": "
|
|
84
|
-
"trigger-wrapper": "awsui_trigger-
|
|
85
|
-
"dot": "
|
|
5
|
+
"background": "awsui_background_hyvsj_1cour_99",
|
|
6
|
+
"scrolling-background": "awsui_scrolling-background_hyvsj_1cour_102",
|
|
7
|
+
"sticky-background": "awsui_sticky-background_hyvsj_1cour_108",
|
|
8
|
+
"has-sticky-notifications": "awsui_has-sticky-notifications_hyvsj_1cour_116",
|
|
9
|
+
"breadcrumbs": "awsui_breadcrumbs_hyvsj_1cour_129",
|
|
10
|
+
"has-sticky-background": "awsui_has-sticky-background_hyvsj_1cour_139",
|
|
11
|
+
"drawers-container": "awsui_drawers-container_hyvsj_1cour_151",
|
|
12
|
+
"has-open-drawer": "awsui_has-open-drawer_hyvsj_1cour_162",
|
|
13
|
+
"disable-body-scroll": "awsui_disable-body-scroll_hyvsj_1cour_185",
|
|
14
|
+
"drawers-desktop-triggers-container": "awsui_drawers-desktop-triggers-container_hyvsj_1cour_190",
|
|
15
|
+
"has-multiple-triggers": "awsui_has-multiple-triggers_hyvsj_1cour_231",
|
|
16
|
+
"drawers-mobile-triggers-container": "awsui_drawers-mobile-triggers-container_hyvsj_1cour_241",
|
|
17
|
+
"drawers-trigger-content": "awsui_drawers-trigger-content_hyvsj_1cour_245",
|
|
18
|
+
"drawers-trigger-overflow": "awsui_drawers-trigger-overflow_hyvsj_1cour_259",
|
|
19
|
+
"drawers-trigger": "awsui_drawers-trigger_hyvsj_1cour_245",
|
|
20
|
+
"drawer": "awsui_drawer_hyvsj_1cour_151",
|
|
21
|
+
"drawer-content-container": "awsui_drawer-content-container_hyvsj_1cour_290",
|
|
22
|
+
"drawer-close-button": "awsui_drawer-close-button_hyvsj_1cour_299",
|
|
23
|
+
"drawer-content": "awsui_drawer-content_hyvsj_1cour_290",
|
|
24
|
+
"drawer-content-hidden": "awsui_drawer-content-hidden_hyvsj_1cour_307",
|
|
25
|
+
"drawer-slider": "awsui_drawer-slider_hyvsj_1cour_310",
|
|
26
|
+
"is-drawer-open": "awsui_is-drawer-open_hyvsj_1cour_317",
|
|
27
|
+
"content": "awsui_content_hyvsj_1cour_343",
|
|
28
|
+
"layout": "awsui_layout_hyvsj_1cour_364",
|
|
29
|
+
"has-max-content-width": "awsui_has-max-content-width_hyvsj_1cour_447",
|
|
30
|
+
"content-type-dashboard": "awsui_content-type-dashboard_hyvsj_1cour_462",
|
|
31
|
+
"content-type-table": "awsui_content-type-table_hyvsj_1cour_476",
|
|
32
|
+
"content-type-cards": "awsui_content-type-cards_hyvsj_1cour_476",
|
|
33
|
+
"is-overlap-disabled": "awsui_is-overlap-disabled_hyvsj_1cour_482",
|
|
34
|
+
"is-hide-mobile-toolbar": "awsui_is-hide-mobile-toolbar_hyvsj_1cour_485",
|
|
35
|
+
"has-content-gap-left": "awsui_has-content-gap-left_hyvsj_1cour_517",
|
|
36
|
+
"has-content-gap-right": "awsui_has-content-gap-right_hyvsj_1cour_520",
|
|
37
|
+
"content-first-child-notifications": "awsui_content-first-child-notifications_hyvsj_1cour_530",
|
|
38
|
+
"has-breadcrumbs": "awsui_has-breadcrumbs_hyvsj_1cour_533",
|
|
39
|
+
"content-first-child-header": "awsui_content-first-child-header_hyvsj_1cour_536",
|
|
40
|
+
"has-header": "awsui_has-header_hyvsj_1cour_536",
|
|
41
|
+
"content-first-child-main": "awsui_content-first-child-main_hyvsj_1cour_557",
|
|
42
|
+
"disable-content-paddings": "awsui_disable-content-paddings_hyvsj_1cour_557",
|
|
43
|
+
"has-split-panel": "awsui_has-split-panel_hyvsj_1cour_600",
|
|
44
|
+
"split-panel-position-bottom": "awsui_split-panel-position-bottom_hyvsj_1cour_600",
|
|
45
|
+
"block-body-scroll": "awsui_block-body-scroll_hyvsj_1cour_616",
|
|
46
|
+
"unfocusable": "awsui_unfocusable_hyvsj_1cour_621",
|
|
47
|
+
"container": "awsui_container_hyvsj_1cour_631",
|
|
48
|
+
"is-navigation-open": "awsui_is-navigation-open_hyvsj_1cour_657",
|
|
49
|
+
"is-tools-open": "awsui_is-tools-open_hyvsj_1cour_660",
|
|
50
|
+
"is-split-panel-open": "awsui_is-split-panel-open_hyvsj_1cour_660",
|
|
51
|
+
"split-panel-position-side": "awsui_split-panel-position-side_hyvsj_1cour_660",
|
|
52
|
+
"has-active-drawer": "awsui_has-active-drawer_hyvsj_1cour_660",
|
|
53
|
+
"mobile-toolbar": "awsui_mobile-toolbar_hyvsj_1cour_669",
|
|
54
|
+
"remove-high-contrast-header": "awsui_remove-high-contrast-header_hyvsj_1cour_686",
|
|
55
|
+
"mobile-toolbar-nav": "awsui_mobile-toolbar-nav_hyvsj_1cour_690",
|
|
56
|
+
"mobile-toolbar-breadcrumbs": "awsui_mobile-toolbar-breadcrumbs_hyvsj_1cour_694",
|
|
57
|
+
"mobile-toolbar-tools": "awsui_mobile-toolbar-tools_hyvsj_1cour_698",
|
|
58
|
+
"navigation-container": "awsui_navigation-container_hyvsj_1cour_707",
|
|
59
|
+
"show-navigation": "awsui_show-navigation_hyvsj_1cour_745",
|
|
60
|
+
"animating": "awsui_animating_hyvsj_1cour_768",
|
|
61
|
+
"showButtons": "awsui_showButtons_hyvsj_1cour_1",
|
|
62
|
+
"navigation": "awsui_navigation_hyvsj_1cour_707",
|
|
63
|
+
"openNavigation": "awsui_openNavigation_hyvsj_1cour_1",
|
|
64
|
+
"animated-content": "awsui_animated-content_hyvsj_1cour_830",
|
|
65
|
+
"hide-navigation": "awsui_hide-navigation_hyvsj_1cour_839",
|
|
66
|
+
"notifications": "awsui_notifications_hyvsj_1cour_849",
|
|
67
|
+
"sticky-notifications": "awsui_sticky-notifications_hyvsj_1cour_855",
|
|
68
|
+
"split-panel-bottom": "awsui_split-panel-bottom_hyvsj_1cour_872",
|
|
69
|
+
"position-bottom": "awsui_position-bottom_hyvsj_1cour_919",
|
|
70
|
+
"openSplitPanelBottom": "awsui_openSplitPanelBottom_hyvsj_1cour_1",
|
|
71
|
+
"split-panel-side": "awsui_split-panel-side_hyvsj_1cour_948",
|
|
72
|
+
"position-side": "awsui_position-side_hyvsj_1cour_961",
|
|
73
|
+
"tools-container": "awsui_tools-container_hyvsj_1cour_983",
|
|
74
|
+
"tools": "awsui_tools_hyvsj_1cour_983",
|
|
75
|
+
"openTools": "awsui_openTools_hyvsj_1cour_1",
|
|
76
|
+
"has-tools-form-persistence": "awsui_has-tools-form-persistence_hyvsj_1cour_1074",
|
|
77
|
+
"hide-tools": "awsui_hide-tools_hyvsj_1cour_1084",
|
|
78
|
+
"show-tools": "awsui_show-tools_hyvsj_1cour_1096",
|
|
79
|
+
"has-tools-form": "awsui_has-tools-form_hyvsj_1cour_1074",
|
|
80
|
+
"trigger-badge-wrapper": "awsui_trigger-badge-wrapper_hyvsj_1cour_1179",
|
|
81
|
+
"trigger": "awsui_trigger_hyvsj_1cour_1179",
|
|
82
|
+
"selected": "awsui_selected_hyvsj_1cour_1253",
|
|
83
|
+
"badge": "awsui_badge_hyvsj_1cour_1273",
|
|
84
|
+
"trigger-wrapper": "awsui_trigger-wrapper_hyvsj_1cour_1277",
|
|
85
|
+
"dot": "awsui_dot_hyvsj_1cour_1288"
|
|
86
86
|
};
|
|
87
87
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tools.d.ts","sourceRoot":"","sources":["../../../../src/app-layout/visual-refresh/tools.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAW1B,UAAU,UAAU;IAClB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B;AAED;;;;;;;GAOG;AACH,MAAM,CAAC,OAAO,UAAU,KAAK,CAAC,EAAE,QAAQ,EAAE,EAAE,UAAU,
|
|
1
|
+
{"version":3,"file":"tools.d.ts","sourceRoot":"","sources":["../../../../src/app-layout/visual-refresh/tools.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAW1B,UAAU,UAAU;IAClB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B;AAED;;;;;;;GAOG;AACH,MAAM,CAAC,OAAO,UAAU,KAAK,CAAC,EAAE,QAAQ,EAAE,EAAE,UAAU,sBAwIrD"}
|
|
@@ -19,7 +19,7 @@ import customCssProps from '../../internal/generated/custom-css-properties';
|
|
|
19
19
|
* split panel in large viewports;
|
|
20
20
|
*/
|
|
21
21
|
export default function Tools({ children }) {
|
|
22
|
-
const { ariaLabels, disableBodyScroll, drawers, handleSplitPanelClick, handleToolsClick,
|
|
22
|
+
const { ariaLabels, disableBodyScroll, drawers, handleSplitPanelClick, handleToolsClick, hasDrawerViewportOverlay, isMobile, isSplitPanelOpen, isToolsOpen, loseToolsFocus, splitPanel, splitPanelControlId, splitPanelDisplayed, splitPanelPosition, splitPanelRefs, splitPanelToggle, tools, toolsControlId, toolsHide, toolsRefs, toolsWidth, } = useAppLayoutInternals();
|
|
23
23
|
const hasSplitPanel = !!splitPanel && getSplitPanelStatus(splitPanelDisplayed, splitPanelPosition);
|
|
24
24
|
const hasToolsForm = getToolsFormStatus(hasSplitPanel, isMobile, isSplitPanelOpen, isToolsOpen, toolsHide);
|
|
25
25
|
const hasToolsFormPersistence = getToolsFormPersistence(hasSplitPanel, isSplitPanelOpen, isToolsOpen, toolsHide);
|
|
@@ -39,8 +39,7 @@ export default function Tools({ children }) {
|
|
|
39
39
|
[testutilStyles['drawer-closed']]: !isToolsOpen,
|
|
40
40
|
}), style: {
|
|
41
41
|
[customCssProps.toolsAnimationStartingOpacity]: `${hasSplitPanel && isSplitPanelOpen ? 1 : 0}`,
|
|
42
|
-
|
|
43
|
-
[customCssProps.toolsWidth]: hasDefaultToolsWidth ? '' : `${toolsWidth}px`,
|
|
42
|
+
[customCssProps.toolsWidth]: `${toolsWidth}px`,
|
|
44
43
|
}, onBlur: e => {
|
|
45
44
|
if (!e.relatedTarget || !e.currentTarget.contains(e.relatedTarget)) {
|
|
46
45
|
loseToolsFocus();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tools.js","sourceRoot":"","sources":["../../../../src/app-layout/visual-refresh/tools.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,qBAAqB,EAAE,MAAM,WAAW,CAAC;AAClD,OAAO,aAAa,MAAM,kBAAkB,CAAC;AAC7C,OAAO,MAAM,MAAM,iBAAiB,CAAC;AACrC,OAAO,gBAAgB,MAAM,iCAAiC,CAAC;AAC/D,OAAO,cAAc,MAAM,+BAA+B,CAAC;AAC3D,OAAO,EAAE,UAAU,EAAE,MAAM,sCAAsC,CAAC;AAClE,OAAO,cAAc,MAAM,gDAAgD,CAAC;AAM5E;;;;;;;GAOG;AACH,MAAM,CAA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WAAqB,EACrB,SAAmB;IAEnB,IAAI,uBAAuB,GAAG,KAAK,CAAC;IAEpC,2DAA2D;IAC3D,IAAI,aAAa,IAAI,CAAC,SAAS,IAAI,CAAC,gBAAgB,IAAI,WAAW,CAAC,EAAE;QACpE,uBAAuB,GAAG,IAAI,CAAC;KAChC;IAED,OAAO,uBAAuB,CAAC;AACjC,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\nimport clsx from 'clsx';\nimport { InternalButton } from '../../button/internal';\nimport { useAppLayoutInternals } from './context';\nimport TriggerButton from './trigger-button';\nimport styles from './styles.css.js';\nimport splitPanelStyles from '../../split-panel/styles.css.js';\nimport testutilStyles from '../test-classes/styles.css.js';\nimport { Transition } from '../../internal/components/transition';\nimport customCssProps from '../../internal/generated/custom-css-properties';\n\ninterface ToolsProps {\n children: React.ReactNode;\n}\n\n/**\n * The Tools component consists of the following elements:\n * the container, or root element, that sits as a direct child to the Layout grid definition;\n * the split panel, which exists only if there is a split panel in side position;\n * the tools, or drawer, that contains the hide tools form and the children passed through the API;\n * the show tools form that contains the triggers for both the drawer and the\n * split panel in large viewports;\n */\nexport default function Tools({ children }: ToolsProps) {\n const {\n ariaLabels,\n disableBodyScroll,\n drawers,\n handleSplitPanelClick,\n handleToolsClick,\n hasDefaultToolsWidth,\n hasDrawerViewportOverlay,\n isMobile,\n isSplitPanelOpen,\n isToolsOpen,\n loseToolsFocus,\n splitPanel,\n splitPanelControlId,\n splitPanelDisplayed,\n splitPanelPosition,\n splitPanelRefs,\n splitPanelToggle,\n tools,\n toolsControlId,\n toolsHide,\n toolsRefs,\n toolsWidth,\n } = useAppLayoutInternals();\n\n const hasSplitPanel = !!splitPanel && getSplitPanelStatus(splitPanelDisplayed, splitPanelPosition);\n const hasToolsForm = getToolsFormStatus(hasSplitPanel, isMobile, isSplitPanelOpen, isToolsOpen, toolsHide);\n const hasToolsFormPersistence = getToolsFormPersistence(hasSplitPanel, isSplitPanelOpen, isToolsOpen, toolsHide);\n const isUnfocusable = hasDrawerViewportOverlay && !isToolsOpen;\n\n /**\n * If the drawers property is defined the SplitPanel will be mounted and rendered\n * by the Drawers component.\n */\n if ((toolsHide && !hasSplitPanel) || drawers) {\n return null;\n }\n\n return (\n <Transition in={isToolsOpen ?? false}>\n {(state, transitionEventsRef) => (\n <div\n className={clsx(styles['tools-container'], {\n [styles['disable-body-scroll']]: disableBodyScroll,\n [styles.unfocusable]: isUnfocusable,\n [testutilStyles['drawer-closed']]: !isToolsOpen,\n })}\n style={{\n [customCssProps.toolsAnimationStartingOpacity]: `${hasSplitPanel && isSplitPanelOpen ? 1 : 0}`,\n // Overwrite the default tools width (depends on breakpoints) only when the `toolsWidth` property has been set.\n [customCssProps.toolsWidth]: hasDefaultToolsWidth ? '' : `${toolsWidth}px`,\n }}\n onBlur={e => {\n if (!e.relatedTarget || !e.currentTarget.contains(e.relatedTarget)) {\n loseToolsFocus();\n }\n }}\n >\n {children}\n\n {!toolsHide && (\n <aside\n id={toolsControlId}\n aria-hidden={!isToolsOpen ? true : false}\n aria-label={ariaLabels?.tools ?? undefined}\n className={clsx(\n styles.tools,\n {\n [styles.animating]: state === 'entering',\n [styles['has-tools-form-persistence']]: hasToolsFormPersistence,\n [styles['is-tools-open']]: isToolsOpen,\n },\n testutilStyles.tools\n )}\n ref={state !== 'exiting' ? transitionEventsRef : undefined}\n >\n <div className={clsx(styles['animated-content'])}>\n <div className={clsx(styles['hide-tools'])}>\n <InternalButton\n ariaLabel={ariaLabels?.toolsClose ?? undefined}\n iconName={isMobile ? 'close' : 'angle-right'}\n onClick={() => handleToolsClick(false)}\n variant=\"icon\"\n formAction=\"none\"\n className={testutilStyles['tools-close']}\n ref={toolsRefs.close}\n />\n </div>\n\n {tools}\n </div>\n </aside>\n )}\n\n {!isMobile && (\n <aside\n aria-hidden={!hasToolsForm ? true : false}\n aria-label={ariaLabels?.tools ?? undefined}\n className={clsx(styles['show-tools'], {\n [styles.animating]: state === 'exiting',\n [styles['has-tools-form']]: hasToolsForm,\n [styles['has-tools-form-persistence']]: hasToolsFormPersistence,\n })}\n ref={state === 'exiting' ? transitionEventsRef : undefined}\n data-testid=\"side-split-panel-drawer\"\n >\n {!toolsHide && (\n <TriggerButton\n ariaLabel={ariaLabels?.toolsToggle}\n ariaControls={toolsControlId}\n ariaExpanded={isToolsOpen}\n iconName=\"status-info\"\n onClick={() => handleToolsClick(!isToolsOpen)}\n selected={hasSplitPanel && isToolsOpen}\n className={testutilStyles['tools-toggle']}\n ref={toolsRefs.toggle}\n />\n )}\n\n {hasSplitPanel && splitPanelToggle.displayed && (\n <TriggerButton\n ariaLabel={splitPanelToggle.ariaLabel}\n ariaControls={splitPanelControlId}\n ariaExpanded={!!isSplitPanelOpen}\n iconName=\"view-vertical\"\n onClick={() => handleSplitPanelClick()}\n selected={hasSplitPanel && isSplitPanelOpen}\n className={splitPanelStyles['open-button']}\n ref={splitPanelRefs.toggle}\n />\n )}\n </aside>\n )}\n </div>\n )}\n </Transition>\n );\n}\n\n/**\n * This simple function returns the presence of the split panel as a child of the\n * Tools component. It must exist and be in side position.\n */\nfunction getSplitPanelStatus(splitPanelDisplayed: boolean, splitPanelPosition: string) {\n return splitPanelDisplayed && splitPanelPosition === 'side' ? true : false;\n}\n\n/**\n * By default the Tools form is styled as display: none; This behavior should\n * be unchanged in mobile viewports where the Tools form is always suppressed.\n * In large viewports, however the Tools form and its corresponding buttons\n * should be present in the UI under the below circumstances.\n */\nfunction getToolsFormStatus(\n hasSplitPanel: boolean,\n isMobile: boolean,\n isSplitPanelOpen?: boolean,\n isToolsOpen?: boolean,\n toolsHide?: boolean\n) {\n let hasToolsForm = false;\n\n if (!isMobile) {\n // Both the Split Panel and Tools button are needed\n if (hasSplitPanel && !toolsHide) {\n hasToolsForm = true;\n }\n\n // The Split Panel button is needed\n if (hasSplitPanel && !isSplitPanelOpen && toolsHide) {\n hasToolsForm = true;\n }\n\n // The Tools button is needed\n if (!hasSplitPanel && !toolsHide && !isToolsOpen) {\n hasToolsForm = true;\n }\n }\n\n return hasToolsForm;\n}\n\n/**\n * Under two scenarios the Tools form that contains the triggers\n * for the Tools content and the Split Panel may be persistent\n * in the UI (as opposed to disappearing when one of the drawers\n * is open). This will also add a white background as opposed to the\n * default transparent background. The buttons will present and in a\n * selected / not selected state.\n */\nfunction getToolsFormPersistence(\n hasSplitPanel: boolean,\n isSplitPanelOpen?: boolean,\n isToolsOpen?: boolean,\n toolsHide?: boolean\n) {\n let hasToolsFormPersistence = false;\n\n // Both Tools and Split Panel exist and one or both is open\n if (hasSplitPanel && !toolsHide && (isSplitPanelOpen || isToolsOpen)) {\n hasToolsFormPersistence = true;\n }\n\n return hasToolsFormPersistence;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"tools.js","sourceRoot":"","sources":["../../../../src/app-layout/visual-refresh/tools.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,qBAAqB,EAAE,MAAM,WAAW,CAAC;AAClD,OAAO,aAAa,MAAM,kBAAkB,CAAC;AAC7C,OAAO,MAAM,MAAM,iBAAiB,CAAC;AACrC,OAAO,gBAAgB,MAAM,iCAAiC,CAAC;AAC/D,OAAO,cAAc,MAAM,+BAA+B,CAAC;AAC3D,OAAO,EAAE,UAAU,EAAE,MAAM,sCAAsC,CAAC;AAClE,OAAO,cAAc,MAAM,gDAAgD,CAAC;AAM5E;;;;;;;GAOG;AACH,MAAM,CAAC,OAAO,UAAU,KAAK,CAAC,EAAE,QAAQ,EAAc;IACpD,MAAM,EACJ,UAAU,EACV,iBAAiB,EACjB,OAAO,EACP,qBAAqB,EACrB,gBAAgB,EAChB,wBAAwB,EACxB,QAAQ,EACR,gBAAgB,EAChB,W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on.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\nimport clsx from 'clsx';\nimport { InternalButton } from '../../button/internal';\nimport { useAppLayoutInternals } from './context';\nimport TriggerButton from './trigger-button';\nimport styles from './styles.css.js';\nimport splitPanelStyles from '../../split-panel/styles.css.js';\nimport testutilStyles from '../test-classes/styles.css.js';\nimport { Transition } from '../../internal/components/transition';\nimport customCssProps from '../../internal/generated/custom-css-properties';\n\ninterface ToolsProps {\n children: React.ReactNode;\n}\n\n/**\n * The Tools component consists of the following elements:\n * the container, or root element, that sits as a direct child to the Layout grid definition;\n * the split panel, which exists only if there is a split panel in side position;\n * the tools, or drawer, that contains the hide tools form and the children passed through the API;\n * the show tools form that contains the triggers for both the drawer and the\n * split panel in large viewports;\n */\nexport default function Tools({ children }: ToolsProps) {\n const {\n ariaLabels,\n disableBodyScroll,\n drawers,\n handleSplitPanelClick,\n handleToolsClick,\n hasDrawerViewportOverlay,\n isMobile,\n isSplitPanelOpen,\n isToolsOpen,\n loseToolsFocus,\n splitPanel,\n splitPanelControlId,\n splitPanelDisplayed,\n splitPanelPosition,\n splitPanelRefs,\n splitPanelToggle,\n tools,\n toolsControlId,\n toolsHide,\n toolsRefs,\n toolsWidth,\n } = useAppLayoutInternals();\n\n const hasSplitPanel = !!splitPanel && getSplitPanelStatus(splitPanelDisplayed, splitPanelPosition);\n const hasToolsForm = getToolsFormStatus(hasSplitPanel, isMobile, isSplitPanelOpen, isToolsOpen, toolsHide);\n const hasToolsFormPersistence = getToolsFormPersistence(hasSplitPanel, isSplitPanelOpen, isToolsOpen, toolsHide);\n const isUnfocusable = hasDrawerViewportOverlay && !isToolsOpen;\n\n /**\n * If the drawers property is defined the SplitPanel will be mounted and rendered\n * by the Drawers component.\n */\n if ((toolsHide && !hasSplitPanel) || drawers) {\n return null;\n }\n\n return (\n <Transition in={isToolsOpen ?? false}>\n {(state, transitionEventsRef) => (\n <div\n className={clsx(styles['tools-container'], {\n [styles['disable-body-scroll']]: disableBodyScroll,\n [styles.unfocusable]: isUnfocusable,\n [testutilStyles['drawer-closed']]: !isToolsOpen,\n })}\n style={{\n [customCssProps.toolsAnimationStartingOpacity]: `${hasSplitPanel && isSplitPanelOpen ? 1 : 0}`,\n [customCssProps.toolsWidth]: `${toolsWidth}px`,\n }}\n onBlur={e => {\n if (!e.relatedTarget || !e.currentTarget.contains(e.relatedTarget)) {\n loseToolsFocus();\n }\n }}\n >\n {children}\n\n {!toolsHide && (\n <aside\n id={toolsControlId}\n aria-hidden={!isToolsOpen ? true : false}\n aria-label={ariaLabels?.tools ?? undefined}\n className={clsx(\n styles.tools,\n {\n [styles.animating]: state === 'entering',\n [styles['has-tools-form-persistence']]: hasToolsFormPersistence,\n [styles['is-tools-open']]: isToolsOpen,\n },\n testutilStyles.tools\n )}\n ref={state !== 'exiting' ? transitionEventsRef : undefined}\n >\n <div className={clsx(styles['animated-content'])}>\n <div className={clsx(styles['hide-tools'])}>\n <InternalButton\n ariaLabel={ariaLabels?.toolsClose ?? undefined}\n iconName={isMobile ? 'close' : 'angle-right'}\n onClick={() => handleToolsClick(false)}\n variant=\"icon\"\n formAction=\"none\"\n className={testutilStyles['tools-close']}\n ref={toolsRefs.close}\n />\n </div>\n\n {tools}\n </div>\n </aside>\n )}\n\n {!isMobile && (\n <aside\n aria-hidden={!hasToolsForm ? true : false}\n aria-label={ariaLabels?.tools ?? undefined}\n className={clsx(styles['show-tools'], {\n [styles.animating]: state === 'exiting',\n [styles['has-tools-form']]: hasToolsForm,\n [styles['has-tools-form-persistence']]: hasToolsFormPersistence,\n })}\n ref={state === 'exiting' ? transitionEventsRef : undefined}\n data-testid=\"side-split-panel-drawer\"\n >\n {!toolsHide && (\n <TriggerButton\n ariaLabel={ariaLabels?.toolsToggle}\n ariaControls={toolsControlId}\n ariaExpanded={isToolsOpen}\n iconName=\"status-info\"\n onClick={() => handleToolsClick(!isToolsOpen)}\n selected={hasSplitPanel && isToolsOpen}\n className={testutilStyles['tools-toggle']}\n ref={toolsRefs.toggle}\n />\n )}\n\n {hasSplitPanel && splitPanelToggle.displayed && (\n <TriggerButton\n ariaLabel={splitPanelToggle.ariaLabel}\n ariaControls={splitPanelControlId}\n ariaExpanded={!!isSplitPanelOpen}\n iconName=\"view-vertical\"\n onClick={() => handleSplitPanelClick()}\n selected={hasSplitPanel && isSplitPanelOpen}\n className={splitPanelStyles['open-button']}\n ref={splitPanelRefs.toggle}\n />\n )}\n </aside>\n )}\n </div>\n )}\n </Transition>\n );\n}\n\n/**\n * This simple function returns the presence of the split panel as a child of the\n * Tools component. It must exist and be in side position.\n */\nfunction getSplitPanelStatus(splitPanelDisplayed: boolean, splitPanelPosition: string) {\n return splitPanelDisplayed && splitPanelPosition === 'side' ? true : false;\n}\n\n/**\n * By default the Tools form is styled as display: none; This behavior should\n * be unchanged in mobile viewports where the Tools form is always suppressed.\n * In large viewports, however the Tools form and its corresponding buttons\n * should be present in the UI under the below circumstances.\n */\nfunction getToolsFormStatus(\n hasSplitPanel: boolean,\n isMobile: boolean,\n isSplitPanelOpen?: boolean,\n isToolsOpen?: boolean,\n toolsHide?: boolean\n) {\n let hasToolsForm = false;\n\n if (!isMobile) {\n // Both the Split Panel and Tools button are needed\n if (hasSplitPanel && !toolsHide) {\n hasToolsForm = true;\n }\n\n // The Split Panel button is needed\n if (hasSplitPanel && !isSplitPanelOpen && toolsHide) {\n hasToolsForm = true;\n }\n\n // The Tools button is needed\n if (!hasSplitPanel && !toolsHide && !isToolsOpen) {\n hasToolsForm = true;\n }\n }\n\n return hasToolsForm;\n}\n\n/**\n * Under two scenarios the Tools form that contains the triggers\n * for the Tools content and the Split Panel may be persistent\n * in the UI (as opposed to disappearing when one of the drawers\n * is open). This will also add a white background as opposed to the\n * default transparent background. The buttons will present and in a\n * selected / not selected state.\n */\nfunction getToolsFormPersistence(\n hasSplitPanel: boolean,\n isSplitPanelOpen?: boolean,\n isToolsOpen?: boolean,\n toolsHide?: boolean\n) {\n let hasToolsFormPersistence = false;\n\n // Both Tools and Split Panel exist and one or both is open\n if (hasSplitPanel && !toolsHide && (isSplitPanelOpen || isToolsOpen)) {\n hasToolsFormPersistence = true;\n }\n\n return hasToolsFormPersistence;\n}\n"]}
|
package/internal/environment.js
CHANGED
package/internal/manifest.json
CHANGED
package/package.json
CHANGED