@cloudscape-design/components-themeable 3.0.835 → 3.0.837
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/lib/internal/manifest.json +1 -1
- package/lib/internal/scss/internal/components/file-token-group/constants.scss +14 -0
- package/lib/internal/scss/internal/components/file-token-group/styles.scss +143 -0
- package/lib/internal/scss/internal/components/file-token-group/test-classes/styles.scss +12 -0
- package/lib/internal/scss/internal/components/token-list/styles.scss +13 -1
- package/lib/internal/scss/token-group/constants.scss +0 -1
- package/lib/internal/scss/token-group/mixins.scss +27 -0
- package/lib/internal/scss/token-group/styles.scss +2 -33
- package/lib/internal/template/app-layout/split-panel/provider.d.ts +1 -0
- package/lib/internal/template/app-layout/split-panel/provider.d.ts.map +1 -1
- package/lib/internal/template/app-layout/split-panel/provider.js.map +1 -1
- package/lib/internal/template/app-layout/visual-refresh-toolbar/drawer/global-drawer.d.ts +2 -7
- package/lib/internal/template/app-layout/visual-refresh-toolbar/drawer/global-drawer.d.ts.map +1 -1
- package/lib/internal/template/app-layout/visual-refresh-toolbar/drawer/global-drawer.js +2 -1
- package/lib/internal/template/app-layout/visual-refresh-toolbar/drawer/global-drawer.js.map +1 -1
- package/lib/internal/template/app-layout/visual-refresh-toolbar/drawer/local-drawer.d.ts.map +1 -1
- package/lib/internal/template/app-layout/visual-refresh-toolbar/drawer/local-drawer.js +3 -1
- package/lib/internal/template/app-layout/visual-refresh-toolbar/drawer/local-drawer.js.map +1 -1
- package/lib/internal/template/app-layout/visual-refresh-toolbar/index.d.ts.map +1 -1
- package/lib/internal/template/app-layout/visual-refresh-toolbar/index.js +6 -1
- package/lib/internal/template/app-layout/visual-refresh-toolbar/index.js.map +1 -1
- package/lib/internal/template/app-layout/visual-refresh-toolbar/interfaces.d.ts +8 -4
- package/lib/internal/template/app-layout/visual-refresh-toolbar/interfaces.d.ts.map +1 -1
- package/lib/internal/template/app-layout/visual-refresh-toolbar/interfaces.js.map +1 -1
- package/lib/internal/template/app-layout/visual-refresh-toolbar/skeleton/index.d.ts +1 -0
- package/lib/internal/template/app-layout/visual-refresh-toolbar/skeleton/index.d.ts.map +1 -1
- package/lib/internal/template/app-layout/visual-refresh-toolbar/skeleton/index.js +2 -2
- package/lib/internal/template/app-layout/visual-refresh-toolbar/skeleton/index.js.map +1 -1
- package/lib/internal/template/app-layout/visual-refresh-toolbar/split-panel/index.d.ts +1 -1
- package/lib/internal/template/app-layout/visual-refresh-toolbar/split-panel/index.d.ts.map +1 -1
- package/lib/internal/template/app-layout/visual-refresh-toolbar/split-panel/index.js +4 -4
- package/lib/internal/template/app-layout/visual-refresh-toolbar/split-panel/index.js.map +1 -1
- package/lib/internal/template/file-upload/interfaces.d.ts +5 -0
- package/lib/internal/template/file-upload/interfaces.d.ts.map +1 -1
- package/lib/internal/template/file-upload/interfaces.js.map +1 -1
- package/lib/internal/template/file-upload/internal.d.ts.map +1 -1
- package/lib/internal/template/file-upload/internal.js +7 -13
- package/lib/internal/template/file-upload/internal.js.map +1 -1
- package/lib/internal/template/internal/components/file-token-group/default-formatters.d.ts.map +1 -0
- package/lib/internal/template/{file-upload → internal/components/file-token-group}/default-formatters.js +1 -1
- package/lib/internal/template/internal/components/file-token-group/default-formatters.js.map +1 -0
- package/lib/internal/template/internal/components/file-token-group/file-token.d.ts +32 -0
- package/lib/internal/template/internal/components/file-token-group/file-token.d.ts.map +1 -0
- package/lib/internal/template/internal/components/file-token-group/file-token.js +71 -0
- package/lib/internal/template/internal/components/file-token-group/file-token.js.map +1 -0
- package/lib/internal/template/internal/components/file-token-group/index.d.ts +8 -0
- package/lib/internal/template/internal/components/file-token-group/index.d.ts.map +1 -0
- package/lib/internal/template/internal/components/file-token-group/index.js +41 -0
- package/lib/internal/template/internal/components/file-token-group/index.js.map +1 -0
- package/lib/internal/template/internal/components/file-token-group/interfaces.d.ts +85 -0
- package/lib/internal/template/internal/components/file-token-group/interfaces.d.ts.map +1 -0
- package/lib/internal/template/internal/components/file-token-group/interfaces.js +2 -0
- package/lib/internal/template/internal/components/file-token-group/interfaces.js.map +1 -0
- package/lib/internal/template/internal/components/file-token-group/styles.css.js +27 -0
- package/lib/internal/template/internal/components/file-token-group/styles.scoped.css +375 -0
- package/lib/internal/template/internal/components/file-token-group/styles.selectors.js +28 -0
- package/lib/internal/template/internal/components/file-token-group/test-classes/styles.css.js +11 -0
- package/lib/internal/template/internal/components/file-token-group/test-classes/styles.scoped.css +12 -0
- package/lib/internal/template/internal/components/file-token-group/test-classes/styles.selectors.js +12 -0
- package/lib/internal/template/internal/components/file-token-group/thumbnail.d.ts.map +1 -0
- package/lib/internal/template/internal/components/file-token-group/thumbnail.js.map +1 -0
- package/lib/internal/template/internal/components/token-list/index.d.ts.map +1 -1
- package/lib/internal/template/internal/components/token-list/index.js +5 -1
- package/lib/internal/template/internal/components/token-list/index.js.map +1 -1
- package/lib/internal/template/internal/components/token-list/interfaces.d.ts +1 -1
- package/lib/internal/template/internal/components/token-list/interfaces.d.ts.map +1 -1
- package/lib/internal/template/internal/components/token-list/interfaces.js.map +1 -1
- package/lib/internal/template/internal/components/token-list/styles.css.js +10 -9
- package/lib/internal/template/internal/components/token-list/styles.scoped.css +41 -21
- package/lib/internal/template/internal/components/token-list/styles.selectors.js +10 -9
- package/lib/internal/template/internal/context/split-panel-context.d.ts +1 -0
- package/lib/internal/template/internal/context/split-panel-context.d.ts.map +1 -1
- package/lib/internal/template/internal/context/split-panel-context.js.map +1 -1
- package/lib/internal/template/internal/environment.js +1 -1
- package/lib/internal/template/internal/environment.json +1 -1
- package/lib/internal/template/split-panel/bottom.d.ts.map +1 -1
- package/lib/internal/template/split-panel/bottom.js +3 -2
- package/lib/internal/template/split-panel/bottom.js.map +1 -1
- package/lib/internal/template/split-panel/side.d.ts.map +1 -1
- package/lib/internal/template/split-panel/side.js +3 -2
- package/lib/internal/template/split-panel/side.js.map +1 -1
- package/lib/internal/template/test-utils/dom/file-upload/index.d.ts +1 -10
- package/lib/internal/template/test-utils/dom/file-upload/index.js +13 -36
- package/lib/internal/template/test-utils/dom/file-upload/index.js.map +1 -1
- package/lib/internal/template/test-utils/dom/internal/file-token-group.d.ts +21 -0
- package/lib/internal/template/test-utils/dom/internal/file-token-group.js +51 -0
- package/lib/internal/template/test-utils/dom/internal/file-token-group.js.map +1 -0
- package/lib/internal/template/test-utils/selectors/file-upload/index.d.ts +1 -10
- package/lib/internal/template/test-utils/selectors/file-upload/index.js +13 -36
- package/lib/internal/template/test-utils/selectors/file-upload/index.js.map +1 -1
- package/lib/internal/template/test-utils/selectors/internal/file-token-group.d.ts +21 -0
- package/lib/internal/template/test-utils/selectors/internal/file-token-group.js +51 -0
- package/lib/internal/template/test-utils/selectors/internal/file-token-group.js.map +1 -0
- package/lib/internal/template/test-utils/tsconfig.tsbuildinfo +1 -1
- package/lib/internal/template/token-group/styles.css.js +8 -10
- package/lib/internal/template/token-group/styles.scoped.css +25 -38
- package/lib/internal/template/token-group/styles.selectors.js +8 -10
- package/lib/internal/template/token-group/token.d.ts +1 -5
- package/lib/internal/template/token-group/token.d.ts.map +1 -1
- package/lib/internal/template/token-group/token.js +4 -11
- package/lib/internal/template/token-group/token.js.map +1 -1
- package/package.json +1 -1
- package/lib/internal/scss/file-upload/file-option/styles.scss +0 -34
- package/lib/internal/template/file-upload/default-formatters.d.ts.map +0 -1
- package/lib/internal/template/file-upload/default-formatters.js.map +0 -1
- package/lib/internal/template/file-upload/file-option/index.d.ts +0 -10
- package/lib/internal/template/file-upload/file-option/index.d.ts.map +0 -1
- package/lib/internal/template/file-upload/file-option/index.js +0 -22
- package/lib/internal/template/file-upload/file-option/index.js.map +0 -1
- package/lib/internal/template/file-upload/file-option/styles.css.js +0 -12
- package/lib/internal/template/file-upload/file-option/styles.scoped.css +0 -35
- package/lib/internal/template/file-upload/file-option/styles.selectors.js +0 -13
- package/lib/internal/template/file-upload/file-option/thumbnail.d.ts.map +0 -1
- package/lib/internal/template/file-upload/file-option/thumbnail.js.map +0 -1
- /package/lib/internal/template/{file-upload → internal/components/file-token-group}/default-formatters.d.ts +0 -0
- /package/lib/internal/template/{file-upload/file-option → internal/components/file-token-group}/thumbnail.d.ts +0 -0
- /package/lib/internal/template/{file-upload/file-option → internal/components/file-token-group}/thumbnail.js +0 -0
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
3
|
+
SPDX-License-Identifier: Apache-2.0
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
@use '../../styles/tokens' as awsui;
|
|
7
|
+
|
|
8
|
+
$image-size: 48px;
|
|
9
|
+
$file-token-height: 68px;
|
|
10
|
+
$compact-token-width: 230px;
|
|
11
|
+
$spinner-size: awsui.$size-icon-normal;
|
|
12
|
+
|
|
13
|
+
$token-background: awsui.$color-background-item-selected;
|
|
14
|
+
$token-border-color: awsui.$color-border-item-selected;
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
3
|
+
SPDX-License-Identifier: Apache-2.0
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
@use '../../styles/tokens' as awsui;
|
|
7
|
+
@use '../../styles' as styles;
|
|
8
|
+
@use './constants' as constants;
|
|
9
|
+
@use '../../../token-group/mixins.scss' as mixins;
|
|
10
|
+
@use '@cloudscape-design/component-toolkit/internal/focus-visible' as focus-visible;
|
|
11
|
+
|
|
12
|
+
@mixin token-box-validation {
|
|
13
|
+
border-inline-start-width: awsui.$border-invalid-width;
|
|
14
|
+
|
|
15
|
+
> .dismiss-button {
|
|
16
|
+
color: awsui.$color-text-interactive-default;
|
|
17
|
+
&:hover {
|
|
18
|
+
color: awsui.$color-text-interactive-hover;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.root {
|
|
24
|
+
@include styles.styles-reset();
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.file-loading-overlay {
|
|
28
|
+
position: absolute;
|
|
29
|
+
inset-inline-end: awsui.$space-static-xs;
|
|
30
|
+
inset-block-end: awsui.$space-static-xxs;
|
|
31
|
+
|
|
32
|
+
&-single-row {
|
|
33
|
+
inset-inline-end: awsui.$space-static-xxl;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
.file-option-name,
|
|
38
|
+
.file-option-size,
|
|
39
|
+
.file-option-last-modified {
|
|
40
|
+
text-overflow: ellipsis;
|
|
41
|
+
overflow: hidden;
|
|
42
|
+
white-space: nowrap;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
.file-option {
|
|
46
|
+
inline-size: 100%;
|
|
47
|
+
min-inline-size: 0;
|
|
48
|
+
display: flex;
|
|
49
|
+
gap: awsui.$space-scaled-xs;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
.file-option-thumbnail {
|
|
53
|
+
margin-block-start: awsui.$space-static-xxs;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
.file-option-thumbnail-image {
|
|
57
|
+
@include styles.font-body-s;
|
|
58
|
+
|
|
59
|
+
inline-size: constants.$image-size;
|
|
60
|
+
block-size: constants.$image-size;
|
|
61
|
+
object-fit: cover;
|
|
62
|
+
|
|
63
|
+
display: -webkit-box;
|
|
64
|
+
-webkit-line-clamp: 3;
|
|
65
|
+
-webkit-box-orient: vertical;
|
|
66
|
+
overflow: hidden;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
.file-option-metadata {
|
|
70
|
+
inline-size: 100%;
|
|
71
|
+
|
|
72
|
+
&.with-image {
|
|
73
|
+
inline-size: calc(100% - constants.$image-size);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
&.single-row-loading {
|
|
77
|
+
inline-size: calc(100% - constants.$spinner-size);
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
.token {
|
|
82
|
+
position: relative;
|
|
83
|
+
block-size: 100%;
|
|
84
|
+
display: flex;
|
|
85
|
+
flex-direction: column;
|
|
86
|
+
gap: awsui.$space-xxs;
|
|
87
|
+
|
|
88
|
+
&-grid {
|
|
89
|
+
display: grid;
|
|
90
|
+
grid-template-rows: max-content auto;
|
|
91
|
+
|
|
92
|
+
@include styles.media-breakpoint-down(styles.$breakpoint-x-small) {
|
|
93
|
+
display: flex;
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
&-contains-image {
|
|
98
|
+
grid-template-rows: constants.$file-token-height auto;
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
.token-box {
|
|
103
|
+
@include mixins.token-box-styles();
|
|
104
|
+
|
|
105
|
+
&.horizontal {
|
|
106
|
+
max-inline-size: constants.$compact-token-width;
|
|
107
|
+
|
|
108
|
+
@include styles.media-breakpoint-down(styles.$breakpoint-x-small) {
|
|
109
|
+
max-inline-size: 100%;
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
&.error {
|
|
114
|
+
border-color: awsui.$color-border-status-error;
|
|
115
|
+
@include token-box-validation;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
&.warning {
|
|
119
|
+
border-color: awsui.$color-border-status-warning;
|
|
120
|
+
@include token-box-validation;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
&.read-only {
|
|
124
|
+
border-color: awsui.$color-border-input-disabled;
|
|
125
|
+
background-color: awsui.$color-background-container-content;
|
|
126
|
+
pointer-events: none;
|
|
127
|
+
|
|
128
|
+
> .dismiss-button {
|
|
129
|
+
color: awsui.$color-text-button-inline-icon-disabled;
|
|
130
|
+
|
|
131
|
+
&:hover {
|
|
132
|
+
/* stylelint-disable-next-line plugin/no-unsupported-browser-features */
|
|
133
|
+
cursor: initial;
|
|
134
|
+
color: awsui.$color-text-button-inline-icon-disabled;
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
&.loading {
|
|
140
|
+
border-color: awsui.$color-border-control-disabled;
|
|
141
|
+
background-color: awsui.$color-background-container-content;
|
|
142
|
+
}
|
|
143
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
3
|
+
SPDX-License-Identifier: Apache-2.0
|
|
4
|
+
*/
|
|
5
|
+
.root,
|
|
6
|
+
.file-option-thumbnail,
|
|
7
|
+
.file-option-name,
|
|
8
|
+
.file-option-size,
|
|
9
|
+
.file-option-last-modified,
|
|
10
|
+
.ellipsis-active {
|
|
11
|
+
/* used in test-utils */
|
|
12
|
+
}
|
|
@@ -5,18 +5,20 @@
|
|
|
5
5
|
|
|
6
6
|
@use '../../styles/tokens' as awsui;
|
|
7
7
|
@use '../../styles' as styles;
|
|
8
|
+
@use '../../../internal/components/file-token-group/constants' as constants;
|
|
8
9
|
@use '@cloudscape-design/component-toolkit/internal/focus-visible' as focus-visible;
|
|
9
10
|
|
|
10
11
|
.root {
|
|
11
|
-
display: flex;
|
|
12
12
|
gap: awsui.$space-scaled-xs;
|
|
13
13
|
|
|
14
14
|
&.horizontal {
|
|
15
|
+
display: flex;
|
|
15
16
|
gap: awsui.$space-xs;
|
|
16
17
|
flex-direction: row;
|
|
17
18
|
flex-wrap: wrap;
|
|
18
19
|
}
|
|
19
20
|
&.vertical {
|
|
21
|
+
display: flex;
|
|
20
22
|
flex-direction: column;
|
|
21
23
|
}
|
|
22
24
|
}
|
|
@@ -41,6 +43,16 @@
|
|
|
41
43
|
&.vertical {
|
|
42
44
|
flex-direction: column;
|
|
43
45
|
}
|
|
46
|
+
&.grid {
|
|
47
|
+
display: grid;
|
|
48
|
+
gap: awsui.$space-xs;
|
|
49
|
+
grid-template-columns: repeat(auto-fill, constants.$compact-token-width);
|
|
50
|
+
|
|
51
|
+
@include styles.media-breakpoint-down(styles.$breakpoint-x-small) {
|
|
52
|
+
display: flex;
|
|
53
|
+
flex-direction: column;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
44
56
|
}
|
|
45
57
|
|
|
46
58
|
.list-item {
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
3
|
+
SPDX-License-Identifier: Apache-2.0
|
|
4
|
+
*/
|
|
5
|
+
@use '../internal/styles' as styles;
|
|
6
|
+
@use '../internal/styles/tokens' as awsui;
|
|
7
|
+
@use './constants' as constants;
|
|
8
|
+
|
|
9
|
+
@mixin token-box-styles {
|
|
10
|
+
position: relative;
|
|
11
|
+
block-size: 100%;
|
|
12
|
+
border-block: awsui.$border-field-width solid constants.$token-border-color;
|
|
13
|
+
border-inline: awsui.$border-field-width solid constants.$token-border-color;
|
|
14
|
+
padding-block-start: styles.$control-padding-vertical;
|
|
15
|
+
padding-block-end: styles.$control-padding-vertical;
|
|
16
|
+
padding-inline-start: styles.$control-padding-horizontal;
|
|
17
|
+
padding-inline-end: awsui.$space-xxs;
|
|
18
|
+
display: flex;
|
|
19
|
+
align-items: flex-start;
|
|
20
|
+
background: constants.$token-background;
|
|
21
|
+
border-start-start-radius: awsui.$border-radius-token;
|
|
22
|
+
border-start-end-radius: awsui.$border-radius-token;
|
|
23
|
+
border-end-start-radius: awsui.$border-radius-token;
|
|
24
|
+
border-end-end-radius: awsui.$border-radius-token;
|
|
25
|
+
color: awsui.$color-text-body-default;
|
|
26
|
+
box-sizing: border-box;
|
|
27
|
+
}
|
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
@use '../internal/styles/tokens' as awsui;
|
|
8
8
|
@use '@cloudscape-design/component-toolkit/internal/focus-visible' as focus-visible;
|
|
9
9
|
@use './constants' as constants;
|
|
10
|
+
@use './mixins.scss' as mixins;
|
|
10
11
|
|
|
11
12
|
.root {
|
|
12
13
|
@include styles.styles-reset;
|
|
@@ -51,41 +52,9 @@
|
|
|
51
52
|
}
|
|
52
53
|
|
|
53
54
|
.token-box {
|
|
54
|
-
|
|
55
|
-
border-block: awsui.$border-field-width solid constants.$token-border-color;
|
|
56
|
-
border-inline: awsui.$border-field-width solid constants.$token-border-color;
|
|
57
|
-
padding-block-start: styles.$control-padding-vertical;
|
|
58
|
-
padding-block-end: styles.$control-padding-vertical;
|
|
59
|
-
padding-inline-start: styles.$control-padding-horizontal;
|
|
60
|
-
padding-inline-end: awsui.$space-xxs;
|
|
61
|
-
display: flex;
|
|
62
|
-
align-items: flex-start;
|
|
63
|
-
background: constants.$token-background;
|
|
64
|
-
border-start-start-radius: awsui.$border-radius-token;
|
|
65
|
-
border-start-end-radius: awsui.$border-radius-token;
|
|
66
|
-
border-end-start-radius: awsui.$border-radius-token;
|
|
67
|
-
border-end-end-radius: awsui.$border-radius-token;
|
|
68
|
-
color: awsui.$color-text-body-default;
|
|
69
|
-
box-sizing: border-box;
|
|
55
|
+
@include mixins.token-box-styles();
|
|
70
56
|
}
|
|
71
|
-
@mixin token-box-validation {
|
|
72
|
-
border-inline-start-width: awsui.$border-invalid-width;
|
|
73
57
|
|
|
74
|
-
> .dismiss-button {
|
|
75
|
-
color: awsui.$color-text-interactive-default;
|
|
76
|
-
&:hover {
|
|
77
|
-
color: awsui.$color-text-interactive-hover;
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
.token-box-error {
|
|
82
|
-
border-color: awsui.$color-border-status-error;
|
|
83
|
-
@include token-box-validation;
|
|
84
|
-
}
|
|
85
|
-
.token-box-warning {
|
|
86
|
-
border-color: awsui.$color-border-status-warning;
|
|
87
|
-
@include token-box-validation;
|
|
88
|
-
}
|
|
89
58
|
.token-box-readonly {
|
|
90
59
|
border-color: awsui.$color-border-input-disabled;
|
|
91
60
|
background-color: awsui.$color-background-container-content;
|
|
@@ -5,6 +5,7 @@ export interface SplitPanelProviderProps extends SplitPanelContextBaseProps {
|
|
|
5
5
|
reportSize: (size: number) => void;
|
|
6
6
|
getMaxHeight: () => number;
|
|
7
7
|
children?: React.ReactNode;
|
|
8
|
+
animationDisabled?: boolean;
|
|
8
9
|
}
|
|
9
10
|
export declare function SplitPanelProvider({ children, size, getMaxHeight, maxWidth, reportSize, onResize, ...rest }: SplitPanelProviderProps): JSX.Element;
|
|
10
11
|
//# sourceMappingURL=provider.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"provider.d.ts","sourceRoot":"","sources":["../../../../src/app-layout/split-panel/provider.tsx"],"names":[],"mappings":"AAEA,OAAO,KAA8B,MAAM,OAAO,CAAC;AAEnD,OAAO,EAAE,0BAA0B,EAA6B,MAAM,4CAA4C,CAAC;AAInH,MAAM,WAAW,uBAAwB,SAAQ,0BAA0B;IACzE,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IACnC,YAAY,EAAE,MAAM,MAAM,CAAC;IAC3B,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"provider.d.ts","sourceRoot":"","sources":["../../../../src/app-layout/split-panel/provider.tsx"],"names":[],"mappings":"AAEA,OAAO,KAA8B,MAAM,OAAO,CAAC;AAEnD,OAAO,EAAE,0BAA0B,EAA6B,MAAM,4CAA4C,CAAC;AAInH,MAAM,WAAW,uBAAwB,SAAQ,0BAA0B;IACzE,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IACnC,YAAY,EAAE,MAAM,MAAM,CAAC;IAC3B,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,iBAAiB,CAAC,EAAE,OAAO,CAAC;CAC7B;AAED,wBAAgB,kBAAkB,CAAC,EACjC,QAAQ,EACR,IAAI,EACJ,YAAY,EACZ,QAAQ,EACR,UAAU,EACV,QAAQ,EACR,GAAG,IAAI,EACR,EAAE,uBAAuB,eA4CzB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"provider.js","sourceRoot":"","sources":["../../../../src/app-layout/split-panel/provider.tsx"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEnD,OAAO,EAA8B,yBAAyB,EAAE,MAAM,4CAA4C,CAAC;AACnH,OAAO,EAAE,eAAe,EAAE,MAAM,oCAAoC,CAAC;AACrE,OAAO,EAAE,sBAAsB,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"provider.js","sourceRoot":"","sources":["../../../../src/app-layout/split-panel/provider.tsx"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEnD,OAAO,EAA8B,yBAAyB,EAAE,MAAM,4CAA4C,CAAC;AACnH,OAAO,EAAE,eAAe,EAAE,MAAM,oCAAoC,CAAC;AACrE,OAAO,EAAE,sBAAsB,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAC;AAU5E,MAAM,UAAU,kBAAkB,CAAC,EAQT;QARS,EACjC,QAAQ,EACR,IAAI,EACJ,YAAY,EACZ,QAAQ,EACR,UAAU,EACV,QAAQ,OAEgB,EADrB,IAAI,cAP0B,0EAQlC,CADQ;IAEP,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC;IAClC,MAAM,CAAC,SAAS,EAAE,YAAY,CAAC,GAAG,QAAQ,CAAC,IAAI,CAAC,CAAC;IACjD,MAAM,OAAO,GAAG,QAAQ,KAAK,QAAQ,CAAC,CAAC,CAAC,sBAAsB,CAAC,CAAC,CAAC,qBAAqB,CAAC;IACvF,MAAM,OAAO,GAAG,QAAQ,KAAK,QAAQ,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,QAAQ,CAAC;IAC7D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AY,CAAC,YAAY,EAAE,CAAC,CAAC;QACnD,MAAM,CAAC,gBAAgB,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;QAC3C,OAAO,GAAG,EAAE,CAAC,MAAM,CAAC,mBAAmB,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;IAC7D,CAAC,EAAE,CAAC,QAAQ,EAAE,YAAY,CAAC,CAAC,CAAC;IAE7B,OAAO,CACL,oBAAC,yBAAyB,IAAC,KAAK,kCAAO,IAAI,KAAE,IAAI,EAAE,UAAU,EAAE,YAAY,EAAE,QAAQ,EAAE,sBAAsB,OAC1G,QAAQ,CACiB,CAC7B,CAAC;AACJ,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useEffect, useState } from 'react';\n\nimport { SplitPanelContextBaseProps, SplitPanelContextProvider } from '../../internal/context/split-panel-context';\nimport { getLimitedValue } from '../../split-panel/utils/size-utils';\nimport { SPLIT_PANEL_MIN_HEIGHT, SPLIT_PANEL_MIN_WIDTH } from './constants';\n\nexport interface SplitPanelProviderProps extends SplitPanelContextBaseProps {\n maxWidth: number;\n reportSize: (size: number) => void;\n getMaxHeight: () => number;\n children?: React.ReactNode;\n animationDisabled?: boolean;\n}\n\nexport function SplitPanelProvider({\n children,\n size,\n getMaxHeight,\n maxWidth,\n reportSize,\n onResize,\n ...rest\n}: SplitPanelProviderProps) {\n const { position, isOpen } = rest;\n const [maxHeight, setMaxHeight] = useState(size);\n const minSize = position === 'bottom' ? SPLIT_PANEL_MIN_HEIGHT : SPLIT_PANEL_MIN_WIDTH;\n const maxSize = position === 'bottom' ? maxHeight : maxWidth;\n const cappedSize = getLimitedValue(minSize, size, maxSize);\n const relativeSize = ((size - minSize) / (maxSize - minSize)) * 100;\n\n const onResizeWithValidation = (newSize: number) => {\n const maxSize = position === 'side' ? maxWidth : getMaxHeight();\n const isResizeValid = position === 'side' ? maxSize >= SPLIT_PANEL_MIN_WIDTH : maxSize >= SPLIT_PANEL_MIN_HEIGHT;\n if (isOpen && isResizeValid) {\n onResize(getLimitedValue(minSize, newSize, maxSize));\n }\n };\n\n useEffect(() => {\n if (position !== 'bottom') {\n return;\n }\n // effects are called inside out in the components tree\n // wait one frame to allow app-layout to complete its calculations\n const handle = requestAnimationFrame(() => setMaxHeight(getMaxHeight()));\n return () => cancelAnimationFrame(handle);\n }, [size, minSize, position, getMaxHeight]);\n\n useEffect(() => {\n reportSize(cappedSize);\n }, [reportSize, cappedSize]);\n\n useEffect(() => {\n if (position !== 'bottom') {\n return;\n }\n const handler = () => setMaxHeight(getMaxHeight());\n window.addEventListener('resize', handler);\n return () => window.removeEventListener('resize', handler);\n }, [position, getMaxHeight]);\n\n return (\n <SplitPanelContextProvider value={{ ...rest, size: cappedSize, relativeSize, onResize: onResizeWithValidation }}>\n {children}\n </SplitPanelContextProvider>\n );\n}\n"]}
|
|
@@ -1,14 +1,9 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import {
|
|
3
|
-
import { AppLayoutProps } from '../../interfaces';
|
|
4
|
-
import { AppLayoutInternals } from '../interfaces';
|
|
2
|
+
import { AppLayoutInternals, InternalDrawer } from '../interfaces';
|
|
5
3
|
interface AppLayoutGlobalDrawerImplementationProps {
|
|
6
4
|
appLayoutInternals: AppLayoutInternals;
|
|
7
5
|
show: boolean;
|
|
8
|
-
activeGlobalDrawer:
|
|
9
|
-
onShow?: NonCancelableEventHandler;
|
|
10
|
-
onHide?: NonCancelableEventHandler;
|
|
11
|
-
}) | undefined;
|
|
6
|
+
activeGlobalDrawer: InternalDrawer | undefined;
|
|
12
7
|
}
|
|
13
8
|
declare function AppLayoutGlobalDrawerImplementation({ appLayoutInternals, show, activeGlobalDrawer, }: AppLayoutGlobalDrawerImplementationProps): JSX.Element;
|
|
14
9
|
export default AppLayoutGlobalDrawerImplementation;
|
package/lib/internal/template/app-layout/visual-refresh-toolbar/drawer/global-drawer.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"global-drawer.d.ts","sourceRoot":"","sources":["../../../../../src/app-layout/visual-refresh-toolbar/drawer/global-drawer.tsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"global-drawer.d.ts","sourceRoot":"","sources":["../../../../../src/app-layout/visual-refresh-toolbar/drawer/global-drawer.tsx"],"names":[],"mappings":";AAWA,OAAO,EAAE,kBAAkB,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAOnE,UAAU,wCAAwC;IAChD,kBAAkB,EAAE,kBAAkB,CAAC;IACvC,IAAI,EAAE,OAAO,CAAC;IACd,kBAAkB,EAAE,cAAc,GAAG,SAAS,CAAC;CAChD;AAED,iBAAS,mCAAmC,CAAC,EAC3C,kBAAkB,EAClB,IAAI,EACJ,kBAAkB,GACnB,EAAE,wCAAwC,eA0H1C;AAED,eAAe,mCAAmC,CAAC"}
|
|
@@ -37,9 +37,10 @@ function AppLayoutGlobalDrawerImplementation({ appLayoutInternals, show, activeG
|
|
|
37
37
|
const size = getLimitedValue(minDrawerSize, activeDrawerSize, maxDrawerSize);
|
|
38
38
|
const lastOpenedDrawerId = drawersOpenQueue.length ? drawersOpenQueue[0] : null;
|
|
39
39
|
const hasTriggerButton = !!(activeGlobalDrawer === null || activeGlobalDrawer === void 0 ? void 0 : activeGlobalDrawer.trigger);
|
|
40
|
+
const animationDisabled = (activeGlobalDrawer === null || activeGlobalDrawer === void 0 ? void 0 : activeGlobalDrawer.defaultActive) && !drawersOpenQueue.includes(activeGlobalDrawer.id);
|
|
40
41
|
return (React.createElement(Transition, { nodeRef: drawerRef, in: show, appear: show, timeout: 0 }, state => {
|
|
41
42
|
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-horizontal'], {
|
|
43
|
+
return (React.createElement("aside", { id: activeDrawerId, "aria-hidden": !show, "aria-label": computedAriaLabels.content, className: clsx(styles.drawer, styles['drawer-global'], styles[state], !animationDisabled && sharedStyles['with-motion-horizontal'], {
|
|
43
44
|
[styles['drawer-hidden']]: !show,
|
|
44
45
|
[styles['last-opened']]: lastOpenedDrawerId === activeDrawerId,
|
|
45
46
|
[testutilStyles['active-drawer']]: show,
|
|
@@ -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,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAEpD,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,GAAG,MAAM,CAAiB,IAAI,CAA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,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,EAAE,KAAK,EAAE,EAAE,SAAS,EAAE,YAAY,EAAE,IACzE,kBAAkB,aAAlB,kBAAkB,uBAAlB,kBAAkB,CAAE,OAAO,CACxB,CACF,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 { getDrawerStyles } 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 { drawerTopOffset, drawerHeight } = getDrawerStyles(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: drawerHeight,\n insetBlockStart: drawerTopOffset,\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\n className={clsx(styles['drawer-content-container'], sharedStyles['with-motion-horizontal'])}\n data-testid={`awsui-app-layout-drawer-content-${activeDrawerId}`}\n >\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']} style={{ blockSize: drawerHeight }}>\n {activeGlobalDrawer?.content}\n </div>\n </div>\n </aside>\n );\n }}\n </Transition>\n );\n}\n\nexport default AppLayoutGlobalDrawerImplementation;\n"]}
|
|
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;AACjF,OAAO,cAAc,MAAM,mDAAmD,CAAC;AAC/E,OAAO,EAAE,eAAe,EAAE,MAAM,uCAAuC,CAAC;AACxE,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAEpD,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;AAQrC,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,GAAG,MAAM,CAAiB,IAAI,CAAC,CAAC;IAC/C,MAAM,cAAc,GAAG,MAAA,kBAAkB,aAAlB,kBAAkB,uBAAlB,kBAAkB,CAAE,EAAE,mCAAI,EAAE,CAAC;IAEpD,MAAM,kBAAkB,GAAG;QACzB,WAAW,EAAE,kBAAkB,CAAC,CAAC,CAA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AAC;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,EAAE,KAAK,EAAE,EAAE,SAAS,EAAE,YAAY,EAAE,IACzE,kBAAkB,aAAlB,kBAAkB,uBAAlB,kBAAkB,CAAE,OAAO,CACxB,CACF,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 customCssProps from '../../../internal/generated/custom-css-properties';\nimport { getLimitedValue } from '../../../split-panel/utils/size-utils';\nimport { getDrawerStyles } from '../compute-layout';\nimport { AppLayoutInternals, InternalDrawer } 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: InternalDrawer | 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 { drawerTopOffset, drawerHeight } = getDrawerStyles(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 const animationDisabled = activeGlobalDrawer?.defaultActive && !drawersOpenQueue.includes(activeGlobalDrawer.id);\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 !animationDisabled && 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: drawerHeight,\n insetBlockStart: drawerTopOffset,\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\n className={clsx(styles['drawer-content-container'], sharedStyles['with-motion-horizontal'])}\n data-testid={`awsui-app-layout-drawer-content-${activeDrawerId}`}\n >\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']} style={{ blockSize: drawerHeight }}>\n {activeGlobalDrawer?.content}\n </div>\n </div>\n </aside>\n );\n }}\n </Transition>\n );\n}\n\nexport default AppLayoutGlobalDrawerImplementation;\n"]}
|
package/lib/internal/template/app-layout/visual-refresh-toolbar/drawer/local-drawer.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"local-drawer.d.ts","sourceRoot":"","sources":["../../../../../src/app-layout/visual-refresh-toolbar/drawer/local-drawer.tsx"],"names":[],"mappings":";AAaA,OAAO,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AAOnD,UAAU,kCAAkC;IAC1C,kBAAkB,EAAE,kBAAkB,CAAC;CACxC;AAED,wBAAgB,6BAA6B,CAAC,EAAE,kBAAkB,EAAE,EAAE,kCAAkC,
|
|
1
|
+
{"version":3,"file":"local-drawer.d.ts","sourceRoot":"","sources":["../../../../../src/app-layout/visual-refresh-toolbar/drawer/local-drawer.tsx"],"names":[],"mappings":";AAaA,OAAO,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AAOnD,UAAU,kCAAkC;IAC1C,kBAAkB,EAAE,kBAAkB,CAAC;CACxC;AAED,wBAAgB,6BAA6B,CAAC,EAAE,kBAAkB,EAAE,EAAE,kCAAkC,eAyHvG;AAED,eAAO,MAAM,+BAA+B,qGAA2D,CAAC"}
|
|
@@ -39,9 +39,11 @@ export function AppLayoutDrawerImplementation({ appLayoutInternals }) {
|
|
|
39
39
|
const isLegacyDrawer = drawersOpenQueue === undefined;
|
|
40
40
|
const size = getLimitedValue(minDrawerSize, activeDrawerSize, maxDrawerSize);
|
|
41
41
|
const lastOpenedDrawerId = (drawersOpenQueue === null || drawersOpenQueue === void 0 ? void 0 : drawersOpenQueue.length) ? drawersOpenQueue[0] : activeDrawerId;
|
|
42
|
+
const animationDisabled = (activeDrawer === null || activeDrawer === void 0 ? void 0 : activeDrawer.defaultActive) && !drawersOpenQueue.includes(activeDrawer.id);
|
|
42
43
|
return (React.createElement(Transition, { nodeRef: drawerRef, in: !!activeDrawer, appear: true, timeout: 0 }, state => {
|
|
43
44
|
var _a;
|
|
44
|
-
return (React.createElement("aside", { id: activeDrawerId, "aria-hidden": !activeDrawer, "aria-label": computedAriaLabels.content, className: clsx(styles.drawer,
|
|
45
|
+
return (React.createElement("aside", { id: activeDrawerId, "aria-hidden": !activeDrawer, "aria-label": computedAriaLabels.content, className: clsx(styles.drawer, {
|
|
46
|
+
[sharedStyles['with-motion-horizontal']]: !animationDisabled,
|
|
45
47
|
[styles['last-opened']]: lastOpenedDrawerId === activeDrawerId,
|
|
46
48
|
[styles.legacy]: isLegacyDrawer,
|
|
47
49
|
[testutilStyles['active-drawer']]: !toolsOnlyMode && activeDrawerId,
|
|
@@ -1 +1 @@
|
|
|
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,EAAE,MAAM,wBAAwB,CAAC;AACpD,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC1D,OAAO,iBAAiB,MAAM,kDAAkD,CAAC;AACjF,OAAO,cAAc,MAAM,mDAAmD,CAAC;AAC/E,OAAO,EAAE,yBAAyB,EAAE,MAAM,2BAA2B,CAAC;AACtE,OAAO,EAAE,eAAe,EAAE,MAAM,uCAAuC,CAAC;AACxE,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAC1D,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAEpD,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;AAMrC,MAAM,UAAU,6BAA6B,CAAC,EAAE,kBAAkB,EAAsC;;IACtG,MAA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S,EAAE,kBAAkB,CAAC,WAAW,EACzC,SAAS,EAAE,IAAI,CAAC;4BACd,CAAC,cAAc,CAAC,4BAA4B,CAAC,CAAC,EAAE,CAAC,aAAa,IAAI,cAAc;4BAChF,CAAC,cAAc,CAAC,aAAa,CAAC,CAAC,EAAE,aAAa;yBAC/C,CAAC,EACF,UAAU,EAAC,MAAM,EACjB,QAAQ,EAAE,QAAQ,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,aAAa,EAC5C,OAAO,EAAE,GAAG,EAAE,CAAC,oBAAoB,CAAC,IAAI,CAAC,EACzC,GAAG,EAAE,mBAAmB,CAAC,IAAI,CAAC,KAAK,EACnC,OAAO,EAAC,MAAM,GACd,CACE;gBACN,6BACE,SAAS,EAAE,IAAI,CACb,MAAM,CAAC,gBAAgB,CAAC,EACxB,cAAc,KAAK,eAAe,IAAI,MAAM,CAAC,uBAAuB,CAAC,CACtE,EACD,KAAK,EAAE,EAAE,SAAS,EAAE,YAAY,EAAE,IAEjC,YAAY,CACT;gBACL,cAAc,KAAK,eAAe,IAAI,CACrC,6BAAK,SAAS,EAAE,MAAM,CAAC,gBAAgB,CAAC,EAAE,KAAK,EAAE,EAAE,SAAS,EAAE,YAAY,EAAE,IACzE,YAAY,aAAZ,YAAY,uBAAZ,YAAY,CAAE,OAAO,CAClB,CACP,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 { getDrawerStyles } 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 { drawerTopOffset, drawerHeight } = getDrawerStyles(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: drawerHeight,\n insetBlockStart: drawerTopOffset,\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 style={{ blockSize: drawerHeight }}\n >\n {toolsContent}\n </div>\n {activeDrawerId !== TOOLS_DRAWER_ID && (\n <div className={styles['drawer-content']} style={{ blockSize: drawerHeight }}>\n {activeDrawer?.content}\n </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,EAAE,MAAM,wBAAwB,CAAC;AACpD,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC1D,OAAO,iBAAiB,MAAM,kDAAkD,CAAC;AACjF,OAAO,cAAc,MAAM,mDAAmD,CAAC;AAC/E,OAAO,EAAE,yBAAyB,EAAE,MAAM,2BAA2B,CAAC;AACtE,OAAO,EAAE,eAAe,EAAE,MAAM,uCAAuC,CAAC;AACxE,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAC1D,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAEpD,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;AAMrC,MAAM,UAAU,6BAA6B,CAAC,EAAE,kBAAkB,EAAsC;;IACtG,MAAM,EACJ,YAAY,EACZ,aA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,CAAC,0BAA0B,CAAC,EAAE,YAAY,CAAC,wBAAwB,CAAC,CAAC;gBAC9F,6BAAK,SAAS,EAAE,IAAI,CAAC,MAAM,CAAC,qBAAqB,CAAC,CAAC;oBACjD,oBAAC,cAAc,IACb,SAAS,EAAE,kBAAkB,CAAC,WAAW,EACzC,SAAS,EAAE,IAAI,CAAC;4BACd,CAAC,cAAc,CAAC,4BAA4B,CAAC,CAAC,EAAE,CAAC,aAAa,IAAI,cAAc;4BAChF,CAAC,cAAc,CAAC,aAAa,CAAC,CAAC,EAAE,aAAa;yBAC/C,CAAC,EACF,UAAU,EAAC,MAAM,EACjB,QAAQ,EAAE,QAAQ,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,aAAa,EAC5C,OAAO,EAAE,GAAG,EAAE,CAAC,oBAAoB,CAAC,IAAI,CAAC,EACzC,GAAG,EAAE,mBAAmB,CAAC,IAAI,CAAC,KAAK,EACnC,OAAO,EAAC,MAAM,GACd,CACE;gBACN,6BACE,SAAS,EAAE,IAAI,CACb,MAAM,CAAC,gBAAgB,CAAC,EACxB,cAAc,KAAK,eAAe,IAAI,MAAM,CAAC,uBAAuB,CAAC,CACtE,EACD,KAAK,EAAE,EAAE,SAAS,EAAE,YAAY,EAAE,IAEjC,YAAY,CACT;gBACL,cAAc,KAAK,eAAe,IAAI,CACrC,6BAAK,SAAS,EAAE,MAAM,CAAC,gBAAgB,CAAC,EAAE,KAAK,EAAE,EAAE,SAAS,EAAE,YAAY,EAAE,IACzE,YAAY,aAAZ,YAAY,uBAAZ,YAAY,CAAE,OAAO,CAClB,CACP,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 { getDrawerStyles } 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 { drawerTopOffset, drawerHeight } = getDrawerStyles(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 const animationDisabled = activeDrawer?.defaultActive && !drawersOpenQueue.includes(activeDrawer.id);\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, {\n [sharedStyles['with-motion-horizontal']]: !animationDisabled,\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: drawerHeight,\n insetBlockStart: drawerTopOffset,\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 style={{ blockSize: drawerHeight }}\n >\n {toolsContent}\n </div>\n {activeDrawerId !== TOOLS_DRAWER_ID && (\n <div className={styles['drawer-content']} style={{ blockSize: drawerHeight }}>\n {activeDrawer?.content}\n </div>\n )}\n </div>\n </aside>\n )}\n </Transition>\n );\n}\n\nexport const createWidgetizedAppLayoutDrawer = createWidgetizedComponent(AppLayoutDrawerImplementation);\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/app-layout/visual-refresh-toolbar/index.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAmD,MAAM,OAAO,CAAC;AAcxE,OAAO,EAAE,cAAc,EAA8B,MAAM,eAAe,CAAC;AAoB3E,QAAA,MAAM,6BAA6B;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/app-layout/visual-refresh-toolbar/index.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAmD,MAAM,OAAO,CAAC;AAcxE,OAAO,EAAE,cAAc,EAA8B,MAAM,eAAe,CAAC;AAoB3E,QAAA,MAAM,6BAA6B;;;;;;;;;;;;;;;4CA6clC,CAAC;AAEF,eAAe,6BAA6B,CAAC"}
|
|
@@ -29,6 +29,8 @@ const AppLayoutVisualRefreshToolbar = React.forwardRef((_a, forwardRef) => {
|
|
|
29
29
|
const [toolbarState, setToolbarState] = useState('show');
|
|
30
30
|
const [toolbarHeight, setToolbarHeight] = useState(0);
|
|
31
31
|
const [notificationsHeight, setNotificationsHeight] = useState(0);
|
|
32
|
+
const [navigationAnimationDisabled, setNavigationAnimationDisabled] = useState(true);
|
|
33
|
+
const [splitPanelAnimationDisabled, setSplitPanelAnimationDisabled] = useState(true);
|
|
32
34
|
const [toolsOpen = false, setToolsOpen] = useControllable(controlledToolsOpen, onToolsChange, false, {
|
|
33
35
|
componentName: 'AppLayout',
|
|
34
36
|
controlledProp: 'toolsOpen',
|
|
@@ -86,6 +88,7 @@ const AppLayoutVisualRefreshToolbar = React.forwardRef((_a, forwardRef) => {
|
|
|
86
88
|
changeHandler: 'onSplitPanelToggle',
|
|
87
89
|
});
|
|
88
90
|
const onSplitPanelToggleHandler = () => {
|
|
91
|
+
setSplitPanelAnimationDisabled(false);
|
|
89
92
|
setSplitPanelOpen(!splitPanelOpen);
|
|
90
93
|
splitPanelFocusControl.setLastInteraction({ type: splitPanelOpen ? 'close' : 'open' });
|
|
91
94
|
fireNonCancelableEvent(onSplitPanelToggle, { open: !splitPanelOpen });
|
|
@@ -115,6 +118,7 @@ const AppLayoutVisualRefreshToolbar = React.forwardRef((_a, forwardRef) => {
|
|
|
115
118
|
const navigationFocusControl = useFocusControl(navigationOpen);
|
|
116
119
|
const splitPanelFocusControl = useSplitPanelFocusControl([splitPanelPreferences, splitPanelOpen]);
|
|
117
120
|
const onNavigationToggle = useStableCallback((open) => {
|
|
121
|
+
setNavigationAnimationDisabled(false);
|
|
118
122
|
navigationFocusControl.setFocus();
|
|
119
123
|
fireNonCancelableEvent(onNavigationChange, { open });
|
|
120
124
|
});
|
|
@@ -214,6 +218,7 @@ const AppLayoutVisualRefreshToolbar = React.forwardRef((_a, forwardRef) => {
|
|
|
214
218
|
onNavigationToggle,
|
|
215
219
|
onActiveDrawerChange: onActiveDrawerChangeHandler,
|
|
216
220
|
onActiveDrawerResize,
|
|
221
|
+
splitPanelAnimationDisabled,
|
|
217
222
|
};
|
|
218
223
|
const splitPanelInternals = {
|
|
219
224
|
bottomOffset: 0,
|
|
@@ -299,7 +304,7 @@ const AppLayoutVisualRefreshToolbar = React.forwardRef((_a, forwardRef) => {
|
|
|
299
304
|
!hasToolbar && breadcrumbs ? React.createElement(ScreenreaderOnly, null, breadcrumbs) : null,
|
|
300
305
|
React.createElement(SkeletonLayout, { ref: intersectionObserverRef, style: Object.assign({ [globalVars.stickyVerticalTopOffset]: `${verticalOffsets.header}px`, [globalVars.stickyVerticalBottomOffset]: `${placement.insetBlockEnd}px`, paddingBlockEnd: splitPanelOpen && splitPanelPosition === 'bottom' ? splitPanelReportedSize : '' }, (!isMobile ? { minWidth: `${minContentWidth}px` } : {})), toolbar: hasToolbar && React.createElement(AppLayoutToolbar, { appLayoutInternals: appLayoutInternals, toolbarProps: toolbarProps }), notifications: notifications && (React.createElement(AppLayoutNotifications, { appLayoutInternals: appLayoutInternals }, notifications)), headerVariant: headerVariant, contentHeader: contentHeader,
|
|
301
306
|
// delay rendering the content until registration of this instance is complete
|
|
302
|
-
content: registered ? content : null, navigation: resolvedNavigation && React.createElement(AppLayoutNavigation, { appLayoutInternals: appLayoutInternals }), navigationOpen: resolvedNavigationOpen, navigationWidth: navigationWidth, tools: drawers && drawers.length > 0 && React.createElement(AppLayoutDrawer, { appLayoutInternals: appLayoutInternals }), globalTools: React.createElement(ActiveDrawersContext.Provider, { value: activeGlobalDrawersIds },
|
|
307
|
+
content: registered ? content : null, navigation: resolvedNavigation && React.createElement(AppLayoutNavigation, { appLayoutInternals: appLayoutInternals }), navigationOpen: resolvedNavigationOpen, navigationWidth: navigationWidth, navigationAnimationDisabled: navigationAnimationDisabled, tools: drawers && drawers.length > 0 && React.createElement(AppLayoutDrawer, { appLayoutInternals: appLayoutInternals }), globalTools: React.createElement(ActiveDrawersContext.Provider, { value: activeGlobalDrawersIds },
|
|
303
308
|
React.createElement(AppLayoutGlobalDrawers, { appLayoutInternals: appLayoutInternals })), globalToolsOpen: !!activeGlobalDrawersIds.length, toolsOpen: !!activeDrawer, toolsWidth: activeDrawerSize, sideSplitPanel: splitPanelPosition === 'side' && (React.createElement(AppLayoutSplitPanelSide, { appLayoutInternals: appLayoutInternals, splitPanelInternals: splitPanelInternals }, splitPanel)), bottomSplitPanel: splitPanelPosition === 'bottom' && (React.createElement(AppLayoutSplitPanelBottom, { appLayoutInternals: appLayoutInternals, splitPanelInternals: splitPanelInternals }, splitPanel)), splitPanelOpen: splitPanelOpen, placement: placement, contentType: contentType, maxContentWidth: maxContentWidth, disableContentPaddings: disableContentPaddings })));
|
|
304
309
|
});
|
|
305
310
|
export default AppLayoutVisualRefreshToolbar;
|