@cloudscape-design/components-themeable 3.0.349 → 3.0.351
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/app-layout/constants.scss +3 -8
- package/lib/internal/scss/app-layout/drawer/styles.scss +26 -35
- package/lib/internal/scss/app-layout/mobile-toolbar/styles.scss +9 -22
- package/lib/internal/scss/app-layout/toggles/styles.scss +18 -0
- package/lib/internal/scss/table/body-cell/styles.scss +27 -8
- package/lib/internal/template/alert/index.d.ts.map +1 -1
- package/lib/internal/template/alert/index.js +36 -1
- package/lib/internal/template/alert/index.js.map +1 -1
- package/lib/internal/template/app-layout/drawer/index.js +6 -5
- package/lib/internal/template/app-layout/drawer/index.js.map +1 -1
- package/lib/internal/template/app-layout/drawer/interfaces.d.ts +6 -3
- package/lib/internal/template/app-layout/drawer/interfaces.d.ts.map +1 -1
- package/lib/internal/template/app-layout/drawer/interfaces.js.map +1 -1
- package/lib/internal/template/app-layout/drawer/styles.css.js +10 -10
- package/lib/internal/template/app-layout/drawer/styles.scoped.css +32 -35
- package/lib/internal/template/app-layout/drawer/styles.selectors.js +10 -10
- package/lib/internal/template/app-layout/mobile-toolbar/index.d.ts.map +1 -1
- package/lib/internal/template/app-layout/mobile-toolbar/index.js +6 -5
- package/lib/internal/template/app-layout/mobile-toolbar/index.js.map +1 -1
- package/lib/internal/template/app-layout/mobile-toolbar/styles.css.js +8 -6
- package/lib/internal/template/app-layout/mobile-toolbar/styles.scoped.css +11 -23
- package/lib/internal/template/app-layout/mobile-toolbar/styles.selectors.js +8 -6
- package/lib/internal/template/app-layout/toggles/index.d.ts +3 -1
- package/lib/internal/template/app-layout/toggles/index.d.ts.map +1 -1
- package/lib/internal/template/app-layout/toggles/index.js +6 -3
- package/lib/internal/template/app-layout/toggles/index.js.map +1 -1
- package/lib/internal/template/app-layout/toggles/interfaces.d.ts +3 -2
- package/lib/internal/template/app-layout/toggles/interfaces.d.ts.map +1 -1
- package/lib/internal/template/app-layout/toggles/interfaces.js.map +1 -1
- package/lib/internal/template/app-layout/toggles/styles.css.js +2 -1
- package/lib/internal/template/app-layout/toggles/styles.scoped.css +31 -1
- package/lib/internal/template/app-layout/toggles/styles.selectors.js +2 -1
- package/lib/internal/template/app-layout/visual-refresh/drawers.d.ts.map +1 -1
- package/lib/internal/template/app-layout/visual-refresh/drawers.js +2 -2
- package/lib/internal/template/app-layout/visual-refresh/drawers.js.map +1 -1
- package/lib/internal/template/app-layout/visual-refresh/trigger-button.d.ts +1 -0
- package/lib/internal/template/app-layout/visual-refresh/trigger-button.d.ts.map +1 -1
- package/lib/internal/template/app-layout/visual-refresh/trigger-button.js +2 -2
- package/lib/internal/template/app-layout/visual-refresh/trigger-button.js.map +1 -1
- package/lib/internal/template/internal/analytics/components/analytics-funnel.js +2 -2
- package/lib/internal/template/internal/analytics/components/analytics-funnel.js.map +1 -1
- package/lib/internal/template/internal/analytics/hooks/use-funnel.js +1 -1
- package/lib/internal/template/internal/analytics/hooks/use-funnel.js.map +1 -1
- package/lib/internal/template/internal/base-component/styles.scoped.css +0 -11
- package/lib/internal/template/internal/environment.js +1 -1
- package/lib/internal/template/internal/generated/theming/index.cjs +0 -27
- package/lib/internal/template/internal/generated/theming/index.js +0 -27
- package/lib/internal/template/table/body-cell/index.d.ts.map +1 -1
- package/lib/internal/template/table/body-cell/index.js +22 -3
- package/lib/internal/template/table/body-cell/index.js.map +1 -1
- package/lib/internal/template/table/body-cell/styles.css.js +28 -28
- package/lib/internal/template/table/body-cell/styles.scoped.css +93 -77
- package/lib/internal/template/table/body-cell/styles.selectors.js +28 -28
- package/lib/internal/template/test-utils/dom/app-layout/index.d.ts +1 -0
- package/lib/internal/template/test-utils/dom/app-layout/index.js +3 -0
- package/lib/internal/template/test-utils/dom/app-layout/index.js.map +1 -1
- package/lib/internal/template/test-utils/selectors/app-layout/index.d.ts +1 -0
- package/lib/internal/template/test-utils/selectors/app-layout/index.js +3 -0
- package/lib/internal/template/test-utils/selectors/app-layout/index.js.map +1 -1
- package/lib/internal/template/test-utils/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
|
@@ -8,14 +8,9 @@
|
|
|
8
8
|
|
|
9
9
|
// Toggle should have 40px width, whereas button is 26px wide.
|
|
10
10
|
// 40 - 26 = 14px in total or 7px on each side
|
|
11
|
-
$
|
|
12
|
-
$
|
|
13
|
-
$toggle-padding: $
|
|
14
|
-
|
|
15
|
-
// New styles for when there are drawers
|
|
16
|
-
$drawers-padding-horizontal: 0.6 * styles.$base-size;
|
|
17
|
-
$drawers-padding-vertical: awsui.$space-scaled-xs;
|
|
18
|
-
$drawers-padding: $drawers-padding-vertical $drawers-padding-horizontal;
|
|
11
|
+
$_toggle-padding-horizontal: 0.7 * styles.$base-size;
|
|
12
|
+
$_toggle-padding-vertical: awsui.$space-xxs;
|
|
13
|
+
$toggle-padding: $_toggle-padding-vertical $_toggle-padding-horizontal;
|
|
19
14
|
|
|
20
15
|
$sidebar-size-closed: 4 * styles.$base-size;
|
|
21
16
|
|
|
@@ -3,6 +3,8 @@
|
|
|
3
3
|
SPDX-License-Identifier: Apache-2.0
|
|
4
4
|
*/
|
|
5
5
|
@use '../../internal/styles/tokens' as awsui;
|
|
6
|
+
@use '../../internal/styles' as styles;
|
|
7
|
+
@use '../../internal/hooks/focus-visible' as focus-visible;
|
|
6
8
|
@use '../constants' as constants;
|
|
7
9
|
|
|
8
10
|
// should be above sticky notifications
|
|
@@ -29,7 +31,6 @@ $drawer-z-index-mobile: 1001;
|
|
|
29
31
|
}
|
|
30
32
|
&-closed {
|
|
31
33
|
min-width: constants.$sidebar-size-closed;
|
|
32
|
-
cursor: pointer;
|
|
33
34
|
&.drawer-mobile {
|
|
34
35
|
display: none;
|
|
35
36
|
}
|
|
@@ -48,13 +49,11 @@ $drawer-z-index-mobile: 1001;
|
|
|
48
49
|
}
|
|
49
50
|
.drawer-closed > & {
|
|
50
51
|
width: constants.$sidebar-size-closed;
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
&.non-interactive {
|
|
52
|
+
&.drawer-content-clickable {
|
|
53
|
+
cursor: pointer;
|
|
54
|
+
color: awsui.$color-text-interactive-default;
|
|
55
55
|
&:hover {
|
|
56
|
-
background: awsui.$color-background-layout-panel-
|
|
57
|
-
cursor: default;
|
|
56
|
+
background: awsui.$color-background-layout-panel-hover;
|
|
58
57
|
}
|
|
59
58
|
}
|
|
60
59
|
}
|
|
@@ -63,34 +62,26 @@ $drawer-z-index-mobile: 1001;
|
|
|
63
62
|
}
|
|
64
63
|
}
|
|
65
64
|
|
|
66
|
-
.
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
padding: constants.$drawers-padding-vertical awsui.$space-s;
|
|
73
|
-
margin-top: 1px;
|
|
74
|
-
|
|
75
|
-
&:not(:last-child) {
|
|
76
|
-
box-shadow: 0px 1px awsui.$color-shadow-layout-toggle;
|
|
77
|
-
}
|
|
78
|
-
&-drawer {
|
|
79
|
-
&:hover:not(.selected) {
|
|
80
|
-
color: awsui.$color-text-layout-toggle-hover;
|
|
81
|
-
&:not(:last-child) {
|
|
82
|
-
box-shadow: 0px 1px awsui.$color-shadow-layout-toggle;
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
}
|
|
65
|
+
.drawer-triggers-wrapper {
|
|
66
|
+
display: flex;
|
|
67
|
+
flex-direction: column;
|
|
68
|
+
text-align: center;
|
|
69
|
+
align-items: stretch;
|
|
70
|
+
}
|
|
86
71
|
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
72
|
+
.drawer-trigger {
|
|
73
|
+
padding: constants.$toggle-padding;
|
|
74
|
+
cursor: pointer;
|
|
75
|
+
color: awsui.$color-text-interactive-default;
|
|
76
|
+
&:not(:first-child) {
|
|
77
|
+
border-top: 1px solid awsui.$color-border-layout;
|
|
78
|
+
}
|
|
79
|
+
&:hover {
|
|
80
|
+
color: awsui.$color-text-layout-toggle-hover;
|
|
81
|
+
}
|
|
82
|
+
&-active,
|
|
83
|
+
&-active:hover {
|
|
84
|
+
background-color: awsui.$color-background-layout-toggle-selected-default;
|
|
85
|
+
color: awsui.$color-text-layout-toggle-active;
|
|
95
86
|
}
|
|
96
87
|
}
|
|
@@ -12,7 +12,6 @@
|
|
|
12
12
|
}
|
|
13
13
|
|
|
14
14
|
.mobile-bar {
|
|
15
|
-
/* stylelint-disable-next-line plugin/no-unsupported-browser-features */
|
|
16
15
|
position: sticky;
|
|
17
16
|
display: flex;
|
|
18
17
|
align-items: center;
|
|
@@ -32,38 +31,26 @@
|
|
|
32
31
|
margin-right: awsui.$space-m;
|
|
33
32
|
}
|
|
34
33
|
|
|
35
|
-
.mobile-trigger-with-drawers {
|
|
36
|
-
width: constants.$sidebar-size-closed;
|
|
37
|
-
display: flex;
|
|
38
|
-
justify-content: center;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
34
|
.mobile-toggle {
|
|
42
35
|
box-sizing: border-box;
|
|
43
36
|
cursor: pointer;
|
|
44
37
|
z-index: 1;
|
|
45
38
|
padding: constants.$toggle-padding;
|
|
46
39
|
width: constants.$sidebar-size-closed;
|
|
47
|
-
|
|
40
|
+
color: awsui.$color-text-interactive-default;
|
|
41
|
+
&-type-navigation {
|
|
48
42
|
border-right: 1px solid awsui.$color-border-layout;
|
|
49
43
|
}
|
|
50
|
-
|
|
44
|
+
&-type-tools,
|
|
45
|
+
&-type-drawer {
|
|
51
46
|
border-left: 1px solid awsui.$color-border-layout;
|
|
52
47
|
}
|
|
53
|
-
&:hover
|
|
48
|
+
&:hover {
|
|
54
49
|
background: awsui.$color-background-layout-panel-hover;
|
|
55
50
|
}
|
|
51
|
+
}
|
|
56
52
|
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
padding: 0;
|
|
61
|
-
height: 100%;
|
|
62
|
-
|
|
63
|
-
> .mobile-trigger-with-drawers {
|
|
64
|
-
border-left: 1px solid awsui.$color-border-layout;
|
|
65
|
-
display: flex;
|
|
66
|
-
align-items: center;
|
|
67
|
-
}
|
|
68
|
-
}
|
|
53
|
+
.drawers-container {
|
|
54
|
+
display: flex;
|
|
55
|
+
align-items: stretch;
|
|
69
56
|
}
|
|
@@ -7,6 +7,24 @@
|
|
|
7
7
|
@use '../../internal/styles' as styles;
|
|
8
8
|
@use '../../internal/hooks/focus-visible' as focus-visible;
|
|
9
9
|
|
|
10
|
+
.toggle-button {
|
|
11
|
+
cursor: pointer;
|
|
12
|
+
border: 0;
|
|
13
|
+
// resemble button styles with an extra 1px offset for non-existing here border width
|
|
14
|
+
$padding-vertical: calc(#{awsui.$space-scaled-xxs} + 1px);
|
|
15
|
+
$padding-horizontal: calc(#{awsui.$space-xxs} + 1px);
|
|
16
|
+
padding: $padding-vertical $padding-horizontal;
|
|
17
|
+
background: transparent;
|
|
18
|
+
color: currentColor;
|
|
19
|
+
&:focus {
|
|
20
|
+
outline: none;
|
|
21
|
+
text-decoration: none;
|
|
22
|
+
}
|
|
23
|
+
@include focus-visible.when-visible {
|
|
24
|
+
@include styles.focus-highlight(awsui.$space-button-inline-icon-focus-outline-gutter);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
|
|
10
28
|
.close-button {
|
|
11
29
|
position: absolute;
|
|
12
30
|
outline: none;
|
|
@@ -18,6 +18,12 @@ $cell-horizontal-padding-w-border: calc(#{$cell-edge-horizontal-padding} + #{aws
|
|
|
18
18
|
$selected-border: awsui.$border-item-width solid awsui.$color-border-item-selected;
|
|
19
19
|
$selected-border-placeholder: awsui.$border-divider-list-width solid awsui.$color-border-item-placeholder;
|
|
20
20
|
$border-placeholder: awsui.$border-item-width solid transparent;
|
|
21
|
+
$icon-width-with-spacing: calc(#{awsui.$size-icon-normal} + #{awsui.$space-xs});
|
|
22
|
+
// Right paddings of the absolute positioned icons (success icon is shown next to the edit icon)
|
|
23
|
+
$edit-button-padding-right: calc(
|
|
24
|
+
#{awsui.$space-xs} + #{awsui.$space-xxs}
|
|
25
|
+
); // Cell vertical padding + xxs space that would normally come from the button.
|
|
26
|
+
$success-icon-padding-right: calc(#{$edit-button-padding-right} + #{$icon-width-with-spacing});
|
|
21
27
|
|
|
22
28
|
.body-cell {
|
|
23
29
|
box-sizing: border-box;
|
|
@@ -180,6 +186,15 @@ $border-placeholder: awsui.$border-item-width solid transparent;
|
|
|
180
186
|
&-selected:not(.body-cell-prev-selected) {
|
|
181
187
|
padding-top: $cell-vertical-padding;
|
|
182
188
|
}
|
|
189
|
+
|
|
190
|
+
&-editor {
|
|
191
|
+
padding: 0 $edit-button-padding-right 0 0;
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
&-success {
|
|
195
|
+
padding: 0 $success-icon-padding-right 0 0;
|
|
196
|
+
}
|
|
197
|
+
|
|
183
198
|
&-success,
|
|
184
199
|
&-editor {
|
|
185
200
|
top: 0;
|
|
@@ -196,10 +211,7 @@ $border-placeholder: awsui.$border-item-width solid transparent;
|
|
|
196
211
|
outline: 0;
|
|
197
212
|
background: 0;
|
|
198
213
|
border: 0;
|
|
199
|
-
padding: 0;
|
|
200
214
|
|
|
201
|
-
// Additional xxs padding that would normally come from the Inline Icon Button
|
|
202
|
-
padding-right: calc(#{awsui.$space-xs} + #{awsui.$space-xxs});
|
|
203
215
|
color: awsui.$color-text-button-normal-default;
|
|
204
216
|
|
|
205
217
|
&:hover {
|
|
@@ -256,20 +268,22 @@ $border-placeholder: awsui.$border-item-width solid transparent;
|
|
|
256
268
|
opacity: 1;
|
|
257
269
|
}
|
|
258
270
|
& > .body-cell-success {
|
|
259
|
-
opacity:
|
|
271
|
+
opacity: 1;
|
|
260
272
|
}
|
|
261
273
|
}
|
|
262
274
|
& > .body-cell-editor {
|
|
263
275
|
opacity: 0;
|
|
264
276
|
}
|
|
265
|
-
&.body-cell-has-success {
|
|
266
|
-
padding-right: calc(#{$cell-horizontal-padding} + #{awsui.$space-l});
|
|
267
|
-
}
|
|
268
277
|
// We don't use our focus-visible polyfill here because it doesn't work properly with screen readers.
|
|
269
278
|
// These edit buttons are special because they are visually hidden (opacity: 0), but exposed to assistive technology.
|
|
270
279
|
// It's therefore important to display the focus outline, even when a keyboard user wasn't detected.
|
|
271
280
|
// For example, when an edit button is selected from the VoiceOver rotor menu.
|
|
272
281
|
&:focus-within {
|
|
282
|
+
padding-right: calc(#{$cell-horizontal-padding} + #{awsui.$space-l});
|
|
283
|
+
&.body-cell-has-success {
|
|
284
|
+
// After a successful edit, we display the success icon next to the edit button and need additional padding to not let the text overflow the success icon.
|
|
285
|
+
padding-right: calc(#{$cell-horizontal-padding} + #{awsui.$space-l} + #{$icon-width-with-spacing});
|
|
286
|
+
}
|
|
273
287
|
@include focused-editor-styles;
|
|
274
288
|
@include styles.focus-highlight(
|
|
275
289
|
(
|
|
@@ -293,7 +307,11 @@ $border-placeholder: awsui.$border-item-width solid transparent;
|
|
|
293
307
|
right: 0;
|
|
294
308
|
}
|
|
295
309
|
& > .body-cell-editor {
|
|
296
|
-
padding-right: calc(#{
|
|
310
|
+
padding-right: calc(#{$edit-button-padding-right} - (2 * #{awsui.$border-divider-list-width}));
|
|
311
|
+
}
|
|
312
|
+
& > .body-cell-success {
|
|
313
|
+
// Update padding to avoid a jumping icon because of the additional borders added when hovering an editable cell.
|
|
314
|
+
padding-right: calc(#{$success-icon-padding-right} - (2 * #{awsui.$border-divider-list-width}));
|
|
297
315
|
}
|
|
298
316
|
&.body-cell-last-row.body-cell-selected,
|
|
299
317
|
&.body-cell-next-selected {
|
|
@@ -322,6 +340,7 @@ $border-placeholder: awsui.$border-item-width solid transparent;
|
|
|
322
340
|
border-top-right-radius: awsui.$border-radius-item;
|
|
323
341
|
border-bottom-right-radius: awsui.$border-radius-item;
|
|
324
342
|
}
|
|
343
|
+
&.body-cell-first-row > .body-cell-success,
|
|
325
344
|
&.body-cell-first-row > .body-cell-editor {
|
|
326
345
|
padding-top: awsui.$border-divider-list-width;
|
|
327
346
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"lib/default/","sources":["alert/index.tsx"],"names":[],"mappings":";AAIA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"lib/default/","sources":["alert/index.tsx"],"names":[],"mappings":";AAIA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAO1C,OAAO,EAAE,UAAU,EAAE,CAAC;AAEtB,MAAM,CAAC,OAAO,UAAU,KAAK,CAAC,EAAE,IAAa,EAAE,OAAc,EAAE,GAAG,KAAK,EAAE,EAAE,UAAU,eAyCpF"}
|
|
@@ -1,13 +1,48 @@
|
|
|
1
1
|
import { __rest } from "tslib";
|
|
2
2
|
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
3
3
|
// SPDX-License-Identifier: Apache-2.0
|
|
4
|
-
import React from 'react';
|
|
4
|
+
import React, { useEffect } from 'react';
|
|
5
5
|
import { applyDisplayName } from '../internal/utils/apply-display-name';
|
|
6
6
|
import InternalAlert from './internal';
|
|
7
7
|
import useBaseComponent from '../internal/hooks/use-base-component';
|
|
8
|
+
import { FunnelMetrics } from '../internal/analytics';
|
|
9
|
+
import { useFunnel, useFunnelStep, useFunnelSubStep } from '../internal/analytics/hooks/use-funnel';
|
|
10
|
+
import { getNameFromSelector, getSubStepAllSelector } from '../internal/analytics/selectors';
|
|
8
11
|
export default function Alert(_a) {
|
|
9
12
|
var { type = 'info', visible = true } = _a, props = __rest(_a, ["type", "visible"]);
|
|
10
13
|
const baseComponentProps = useBaseComponent('Alert');
|
|
14
|
+
const { funnelInteractionId, submissionAttempt, funnelState, errorCount } = useFunnel();
|
|
15
|
+
const { stepNumber, stepNameSelector } = useFunnelStep();
|
|
16
|
+
const { subStepSelector, subStepNameSelector } = useFunnelSubStep();
|
|
17
|
+
useEffect(() => {
|
|
18
|
+
if (funnelInteractionId && visible && type === 'error' && funnelState.current !== 'complete') {
|
|
19
|
+
const stepName = getNameFromSelector(stepNameSelector);
|
|
20
|
+
const subStepName = getNameFromSelector(subStepNameSelector);
|
|
21
|
+
errorCount.current++;
|
|
22
|
+
if (subStepSelector) {
|
|
23
|
+
FunnelMetrics.funnelSubStepError({
|
|
24
|
+
funnelInteractionId,
|
|
25
|
+
subStepSelector,
|
|
26
|
+
subStepName,
|
|
27
|
+
subStepNameSelector,
|
|
28
|
+
stepNumber,
|
|
29
|
+
stepName,
|
|
30
|
+
stepNameSelector,
|
|
31
|
+
subStepAllSelector: getSubStepAllSelector(),
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
else {
|
|
35
|
+
FunnelMetrics.funnelError({
|
|
36
|
+
funnelInteractionId,
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
return () => {
|
|
40
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
41
|
+
errorCount.current--;
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
45
|
+
}, [funnelInteractionId, visible, submissionAttempt, errorCount]);
|
|
11
46
|
return React.createElement(InternalAlert, Object.assign({ type: type, visible: visible }, props, baseComponentProps));
|
|
12
47
|
}
|
|
13
48
|
applyDisplayName(Alert, 'Alert');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"lib/default/","sources":["alert/index.tsx"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"lib/default/","sources":["alert/index.tsx"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACzC,OAAO,EAAE,gBAAgB,EAAE,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aACJ;iBAAM;gBACL,aAAa,CAAC,WAAW,CAAC;oBACxB,mBAAmB;iBACpB,CAAC,CAAC;aACJ;YAED,OAAO,GAAG,EAAE;gBACV,uDAAuD;gBACvD,UAAU,CAAC,OAAO,EAAE,CAAC;YACvB,CAAC,CAAC;SACH;QAED,uDAAuD;IACzD,CAAC,EAAE,CAAC,mBAAmB,EAAE,OAAO,EAAE,iBAAiB,EAAE,UAAU,CAAC,CAAC,CAAC;IAElE,OAAO,oBAAC,aAAa,kBAAC,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,IAAM,KAAK,EAAM,kBAAkB,EAAI,CAAC;AAC5F,CAAC;AAED,gBAAgB,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useEffect } from 'react';\nimport { applyDisplayName } from '../internal/utils/apply-display-name';\nimport { AlertProps } from './interfaces';\nimport InternalAlert from './internal';\nimport useBaseComponent from '../internal/hooks/use-base-component';\nimport { FunnelMetrics } from '../internal/analytics';\nimport { useFunnel, useFunnelStep, useFunnelSubStep } from '../internal/analytics/hooks/use-funnel';\nimport { getNameFromSelector, getSubStepAllSelector } from '../internal/analytics/selectors';\n\nexport { AlertProps };\n\nexport default function Alert({ type = 'info', visible = true, ...props }: AlertProps) {\n const baseComponentProps = useBaseComponent('Alert');\n\n const { funnelInteractionId, submissionAttempt, funnelState, errorCount } = useFunnel();\n const { stepNumber, stepNameSelector } = useFunnelStep();\n const { subStepSelector, subStepNameSelector } = useFunnelSubStep();\n\n useEffect(() => {\n if (funnelInteractionId && visible && type === 'error' && funnelState.current !== 'complete') {\n const stepName = getNameFromSelector(stepNameSelector);\n const subStepName = getNameFromSelector(subStepNameSelector);\n\n errorCount.current++;\n\n if (subStepSelector) {\n FunnelMetrics.funnelSubStepError({\n funnelInteractionId,\n subStepSelector,\n subStepName,\n subStepNameSelector,\n stepNumber,\n stepName,\n stepNameSelector,\n subStepAllSelector: getSubStepAllSelector(),\n });\n } else {\n FunnelMetrics.funnelError({\n funnelInteractionId,\n });\n }\n\n return () => {\n // eslint-disable-next-line react-hooks/exhaustive-deps\n errorCount.current--;\n };\n }\n\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [funnelInteractionId, visible, submissionAttempt, errorCount]);\n\n return <InternalAlert type={type} visible={visible} {...props} {...baseComponentProps} />;\n}\n\napplyDisplayName(Alert, 'Alert');\n"]}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// SPDX-License-Identifier: Apache-2.0
|
|
3
3
|
import clsx from 'clsx';
|
|
4
4
|
import React, { useRef } from 'react';
|
|
5
|
-
import {
|
|
5
|
+
import { ToggleButton, CloseButton, togglesConfig } from '../toggles';
|
|
6
6
|
import testutilStyles from '../test-classes/styles.css.js';
|
|
7
7
|
import styles from './styles.css.js';
|
|
8
8
|
// We are using two landmarks per drawer, i.e. two NAVs and two ASIDEs, because of several
|
|
@@ -34,7 +34,7 @@ export const Drawer = React.forwardRef(({ contentClassName, toggleClassName, clo
|
|
|
34
34
|
});
|
|
35
35
|
const { drawerMainLabel, drawerCloseLabel } = getDrawersLabels(drawersAriaLabels);
|
|
36
36
|
const regularOpenButton = (React.createElement(TagName, { ref: openButtonWrapperRef, "aria-label": mainLabel, className: styles.toggle, "aria-hidden": isOpen },
|
|
37
|
-
React.createElement(
|
|
37
|
+
React.createElement(ToggleButton, { ref: toggleRefs.toggle, className: toggleClassName, iconName: iconName, ariaLabel: openLabel, onClick: () => onToggle(true), ariaExpanded: false })));
|
|
38
38
|
return (React.createElement("div", { ref: ref, className: clsx(styles.drawer, {
|
|
39
39
|
[styles['drawer-closed']]: !isOpen,
|
|
40
40
|
[testutilStyles['drawer-closed']]: !isOpen,
|
|
@@ -58,7 +58,7 @@ export const Drawer = React.forwardRef(({ contentClassName, toggleClassName, clo
|
|
|
58
58
|
}
|
|
59
59
|
}
|
|
60
60
|
} },
|
|
61
|
-
React.createElement("div", { style: { width: drawerContentWidth, top: topOffset, bottom: bottomOffset }, className: clsx(styles['drawer-content'], contentClassName) },
|
|
61
|
+
React.createElement("div", { style: { width: drawerContentWidth, top: topOffset, bottom: bottomOffset }, className: clsx(styles['drawer-content'], styles['drawer-content-clickable'], contentClassName) },
|
|
62
62
|
!isMobile && regularOpenButton,
|
|
63
63
|
resizeHandle,
|
|
64
64
|
React.createElement(TagName, { "aria-label": drawers ? drawerMainLabel : mainLabel, "aria-hidden": !isOpen },
|
|
@@ -73,9 +73,10 @@ export function DrawerTriggersBar({ isMobile, topOffset, bottomOffset, drawers,
|
|
|
73
73
|
return (React.createElement("div", { className: clsx(styles.drawer, styles['drawer-closed'], testutilStyles['drawer-closed'], {
|
|
74
74
|
[styles['drawer-mobile']]: isMobile,
|
|
75
75
|
}) },
|
|
76
|
-
React.createElement("div", { style: { top: topOffset, bottom: bottomOffset }, className:
|
|
76
|
+
React.createElement("div", { style: { top: topOffset, bottom: bottomOffset }, className: styles['drawer-content'] }, !isMobile && (React.createElement("aside", { "aria-label": drawers === null || drawers === void 0 ? void 0 : drawers.ariaLabel, className: clsx(styles['drawer-triggers-wrapper'], contentClassName) }, (_a = drawers === null || drawers === void 0 ? void 0 : drawers.items) === null || _a === void 0 ? void 0 : _a.map((item, index) => {
|
|
77
77
|
var _a;
|
|
78
|
-
return (React.createElement(
|
|
78
|
+
return (React.createElement("span", { key: index, className: clsx(styles['drawer-trigger'], drawers.activeDrawerId === item.id && styles['drawer-trigger-active']), onClick: () => drawers.onChange({ activeDrawerId: item.id !== drawers.activeDrawerId ? item.id : undefined }) },
|
|
79
|
+
React.createElement(ToggleButton, { className: toggleClassName, iconName: item.trigger.iconName, iconSvg: item.trigger.iconSvg, ariaLabel: (_a = item.ariaLabels) === null || _a === void 0 ? void 0 : _a.triggerButton, ariaExpanded: drawers.activeDrawerId !== undefined, testId: `awsui-app-layout-trigger-${item.id}` })));
|
|
79
80
|
}))))));
|
|
80
81
|
}
|
|
81
82
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"lib/default/","sources":["app-layout/drawer/index.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,KAAK,EAAE,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AACtC,OAAO,EAAE,eAAe,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAEzE,OAAO,cAAc,MAAM,+BAA+B,CAAC;AAC3D,OAAO,MAAM,MAAM,iBAAiB,CAAC;AAGrC,0FAA0F;AAC1F,qFAAqF;AACrF,uFAAuF;AACvF,4EAA4E;AAC5E,wFAAwF;AACxF,0FAA0F;AAC1F,0FAA0F;AAC1F,wBAAwB;AACxB,0FAA0F;AAC1F,4FAA4F;AAC5F,WAAW;AACX,oBAAoB;AACpB,iDAAiD;AACjD,iDAAiD;AACjD,iDAAiD;AACjD,sFAAsF;AACtF,MAAM,CAAC,MAAM,MAAM,GAAG,KAAK,CAAC,UAAU,CACpC,CACE,EACE,gBAAgB,EAChB,eAAe,EACf,cAAc,EACd,KAAK,EACL,IAAI,EACJ,UAAU,EACV,SAAS,EACT,YAAY,EACZ,UAAU,EACV,iBAAiB,EACjB,QAAQ,EACR,MAAM,EACN,QAAQ,EACR,QAAQ,EACR,OAAO,EACP,WAAW,EACX,OAAO,EACP,YAAY,GACO,EACrB,GAA8B,EAC9B,EAAE;IACF,MAAM,oBAAoB,GAAG,MAAM,CAAqB,IAAI,CAAC,CAAC;IAC9D,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,GAAG,aAAa,CAAC,IAAI,CAAC,CAAC;IAC7D,MAAM,EAAE,SAAS,EAAE,UAAU,EAAE,SAAS,EAAE,GAAG,SAAS,CAAC,UAAU,CAAC,CAAC;IACnE,MAAM,sBAAsB,GAAG,QAAQ,CAAC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,0CAAE,aAAa,EACzC,OAAO,EAAE,GAAG,EAAE,CACZ,OAAO,CAAC,QAAQ,CAAC,EAAE,cAAc,EAAE,IAAI,CAAC,EAAE,KAAK,OAAO,CAAC,cAAc,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC,SAAS,EAAE,CAAC,EAEhG,YAAY,EAAE,OAAO,CAAC,cAAc,KAAK,SAAS,GAClD,CACH,CAAA;SAAA,CAAC,CACI,CACT,CACG,CACF,CACP,CAAC;AACJ,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport clsx from 'clsx';\nimport React, { useRef } from 'react';\nimport { AppLayoutButton, CloseButton, togglesConfig } from '../toggles';\n\nimport testutilStyles from '../test-classes/styles.css.js';\nimport styles from './styles.css.js';\nimport { DesktopDrawerProps, DrawerTriggersBarProps, DrawerItem, DrawerItemAriaLabels } from './interfaces';\n\n// We are using two landmarks per drawer, i.e. two NAVs and two ASIDEs, because of several\n// known bugs in NVDA that cause focus changes within a container to sometimes not be\n// announced. As a result, we use one region for the open button and one region for the\n// actual drawer content, always hiding the other one when it's not visible.\n// An alternative solution to follow a more classic implementation here to only have one\n// button that triggers the opening/closing of the drawer also did not work due to another\n// series of bugs in NVDA (together with Firefox) which prevent the changed expanded state\n// from being announced.\n// Even with this workaround in place, the announcement of the close button when opening a\n// panel in NVDA is not working correctly. The suspected root cause is one of the bugs below\n// as well.\n// Relevant tickets:\n// * https://github.com/nvaccess/nvda/issues/6606\n// * https://github.com/nvaccess/nvda/issues/5825\n// * https://github.com/nvaccess/nvda/issues/5247\n// * https://github.com/nvaccess/nvda/pull/8869 (reverted PR that was going to fix it)\nexport const Drawer = React.forwardRef(\n (\n {\n contentClassName,\n toggleClassName,\n closeClassName,\n width,\n type,\n toggleRefs,\n topOffset,\n bottomOffset,\n ariaLabels,\n drawersAriaLabels,\n children,\n isOpen,\n isMobile,\n onToggle,\n onClick,\n onLoseFocus,\n drawers,\n resizeHandle,\n }: DesktopDrawerProps,\n ref: React.Ref<HTMLDivElement>\n ) => {\n const openButtonWrapperRef = useRef<HTMLElement | null>(null);\n const { TagName, iconName, getLabels } = togglesConfig[type];\n const { mainLabel, closeLabel, openLabel } = getLabels(ariaLabels);\n const drawerContentWidthOpen = isMobile ? undefined : width;\n const drawerContentWidth = isOpen ? drawerContentWidthOpen : undefined;\n\n const getDrawersLabels = (labels: DrawerItemAriaLabels = {}) => ({\n drawerMainLabel: labels?.content,\n drawerOpenLabel: labels?.triggerButton,\n drawerCloseLabel: labels?.closeButton,\n });\n const { drawerMainLabel, drawerCloseLabel } = getDrawersLabels(drawersAriaLabels);\n\n const regularOpenButton = (\n <TagName ref={openButtonWrapperRef} aria-label={mainLabel} className={styles.toggle} aria-hidden={isOpen}>\n <AppLayoutButton\n ref={toggleRefs.toggle}\n className={toggleClassName}\n iconName={iconName}\n ariaLabel={openLabel}\n onClick={() => onToggle(true)}\n ariaExpanded={false}\n />\n </TagName>\n );\n\n return (\n <div\n ref={ref}\n className={clsx(styles.drawer, {\n [styles['drawer-closed']]: !isOpen,\n [testutilStyles['drawer-closed']]: !isOpen,\n [styles['drawer-mobile']]: isMobile,\n })}\n style={{ width: drawerContentWidth }}\n onBlur={\n onLoseFocus\n ? e => {\n if (!e.relatedTarget || !e.currentTarget.contains(e.relatedTarget)) {\n onLoseFocus(e);\n }\n }\n : undefined\n }\n onClick={event => {\n if (onClick) {\n onClick(event);\n }\n if (!isOpen) {\n // to prevent calling onToggle from the drawer when it's called from the toggle button\n if (\n openButtonWrapperRef.current === event.target ||\n !openButtonWrapperRef.current?.contains(event.target as Node)\n ) {\n onToggle(true);\n }\n }\n }}\n >\n <div\n style={{ width: drawerContentWidth, top: topOffset, bottom: bottomOffset }}\n className={clsx(styles['drawer-content'], contentClassName)}\n >\n {!isMobile && regularOpenButton}\n {resizeHandle}\n <TagName aria-label={drawers ? drawerMainLabel : mainLabel} aria-hidden={!isOpen}>\n <CloseButton\n ref={toggleRefs.close}\n className={closeClassName}\n ariaLabel={drawers ? drawerCloseLabel : closeLabel}\n onClick={() => {\n onToggle(false);\n drawers?.onChange({ activeDrawerId: undefined });\n }}\n />\n {children}\n </TagName>\n </div>\n </div>\n );\n }\n);\n\nexport function DrawerTriggersBar({\n isMobile,\n topOffset,\n bottomOffset,\n drawers,\n contentClassName,\n toggleClassName,\n}: DrawerTriggersBarProps) {\n return (\n <div\n className={clsx(styles.drawer, styles['drawer-closed'], testutilStyles['drawer-closed'], {\n [styles['drawer-mobile']]: isMobile,\n })}\n >\n <div\n style={{ top: topOffset, bottom: bottomOffset }}\n className={clsx(styles['drawer-content'], styles['non-interactive'])}\n >\n {!isMobile && (\n <aside aria-label={drawers?.ariaLabel} className={clsx(styles['drawer-triggers'], contentClassName)}>\n {drawers?.items?.map((item: DrawerItem, index: number) => (\n <AppLayoutButton\n className={clsx(\n toggleClassName,\n styles.trigger,\n styles['trigger-drawer'],\n drawers.activeDrawerId === item.id && styles.selected\n )}\n key={`drawer-trigger-${index}`}\n iconName={item.trigger.iconName}\n iconSvg={item.trigger.iconSvg}\n ariaLabel={item.ariaLabels?.triggerButton}\n onClick={() =>\n drawers.onChange({ activeDrawerId: item.id !== drawers.activeDrawerId ? item.id : undefined })\n }\n ariaExpanded={drawers.activeDrawerId !== undefined}\n />\n ))}\n </aside>\n )}\n </div>\n </div>\n );\n}\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"lib/default/","sources":["app-layout/drawer/index.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,KAAK,EAAE,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AACtC,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAEtE,OAAO,cAAc,MAAM,+BAA+B,CAAC;AAC3D,OAAO,MAAM,MAAM,iBA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.\n// SPDX-License-Identifier: Apache-2.0\nimport clsx from 'clsx';\nimport React, { useRef } from 'react';\nimport { ToggleButton, CloseButton, togglesConfig } from '../toggles';\n\nimport testutilStyles from '../test-classes/styles.css.js';\nimport styles from './styles.css.js';\nimport { DesktopDrawerProps, DrawerTriggersBarProps, DrawerItem, DrawerItemAriaLabels } from './interfaces';\n\n// We are using two landmarks per drawer, i.e. two NAVs and two ASIDEs, because of several\n// known bugs in NVDA that cause focus changes within a container to sometimes not be\n// announced. As a result, we use one region for the open button and one region for the\n// actual drawer content, always hiding the other one when it's not visible.\n// An alternative solution to follow a more classic implementation here to only have one\n// button that triggers the opening/closing of the drawer also did not work due to another\n// series of bugs in NVDA (together with Firefox) which prevent the changed expanded state\n// from being announced.\n// Even with this workaround in place, the announcement of the close button when opening a\n// panel in NVDA is not working correctly. The suspected root cause is one of the bugs below\n// as well.\n// Relevant tickets:\n// * https://github.com/nvaccess/nvda/issues/6606\n// * https://github.com/nvaccess/nvda/issues/5825\n// * https://github.com/nvaccess/nvda/issues/5247\n// * https://github.com/nvaccess/nvda/pull/8869 (reverted PR that was going to fix it)\nexport const Drawer = React.forwardRef(\n (\n {\n contentClassName,\n toggleClassName,\n closeClassName,\n width,\n type,\n toggleRefs,\n topOffset,\n bottomOffset,\n ariaLabels,\n drawersAriaLabels,\n children,\n isOpen,\n isMobile,\n onToggle,\n onClick,\n onLoseFocus,\n drawers,\n resizeHandle,\n }: DesktopDrawerProps,\n ref: React.Ref<HTMLDivElement>\n ) => {\n const openButtonWrapperRef = useRef<HTMLElement | null>(null);\n const { TagName, iconName, getLabels } = togglesConfig[type];\n const { mainLabel, closeLabel, openLabel } = getLabels(ariaLabels);\n const drawerContentWidthOpen = isMobile ? undefined : width;\n const drawerContentWidth = isOpen ? drawerContentWidthOpen : undefined;\n\n const getDrawersLabels = (labels: DrawerItemAriaLabels = {}) => ({\n drawerMainLabel: labels?.content,\n drawerOpenLabel: labels?.triggerButton,\n drawerCloseLabel: labels?.closeButton,\n });\n const { drawerMainLabel, drawerCloseLabel } = getDrawersLabels(drawersAriaLabels);\n\n const regularOpenButton = (\n <TagName ref={openButtonWrapperRef} aria-label={mainLabel} className={styles.toggle} aria-hidden={isOpen}>\n <ToggleButton\n ref={toggleRefs.toggle}\n className={toggleClassName}\n iconName={iconName}\n ariaLabel={openLabel}\n onClick={() => onToggle(true)}\n ariaExpanded={false}\n />\n </TagName>\n );\n\n return (\n <div\n ref={ref}\n className={clsx(styles.drawer, {\n [styles['drawer-closed']]: !isOpen,\n [testutilStyles['drawer-closed']]: !isOpen,\n [styles['drawer-mobile']]: isMobile,\n })}\n style={{ width: drawerContentWidth }}\n onBlur={\n onLoseFocus\n ? e => {\n if (!e.relatedTarget || !e.currentTarget.contains(e.relatedTarget)) {\n onLoseFocus(e);\n }\n }\n : undefined\n }\n onClick={event => {\n if (onClick) {\n onClick(event);\n }\n if (!isOpen) {\n // to prevent calling onToggle from the drawer when it's called from the toggle button\n if (\n openButtonWrapperRef.current === event.target ||\n !openButtonWrapperRef.current?.contains(event.target as Node)\n ) {\n onToggle(true);\n }\n }\n }}\n >\n <div\n style={{ width: drawerContentWidth, top: topOffset, bottom: bottomOffset }}\n className={clsx(styles['drawer-content'], styles['drawer-content-clickable'], contentClassName)}\n >\n {!isMobile && regularOpenButton}\n {resizeHandle}\n <TagName aria-label={drawers ? drawerMainLabel : mainLabel} aria-hidden={!isOpen}>\n <CloseButton\n ref={toggleRefs.close}\n className={closeClassName}\n ariaLabel={drawers ? drawerCloseLabel : closeLabel}\n onClick={() => {\n onToggle(false);\n drawers?.onChange({ activeDrawerId: undefined });\n }}\n />\n {children}\n </TagName>\n </div>\n </div>\n );\n }\n);\n\nexport function DrawerTriggersBar({\n isMobile,\n topOffset,\n bottomOffset,\n drawers,\n contentClassName,\n toggleClassName,\n}: DrawerTriggersBarProps) {\n return (\n <div\n className={clsx(styles.drawer, styles['drawer-closed'], testutilStyles['drawer-closed'], {\n [styles['drawer-mobile']]: isMobile,\n })}\n >\n <div style={{ top: topOffset, bottom: bottomOffset }} className={styles['drawer-content']}>\n {!isMobile && (\n <aside aria-label={drawers?.ariaLabel} className={clsx(styles['drawer-triggers-wrapper'], contentClassName)}>\n {drawers?.items?.map((item: DrawerItem, index: number) => (\n <span\n key={index}\n className={clsx(\n styles['drawer-trigger'],\n drawers.activeDrawerId === item.id && styles['drawer-trigger-active']\n )}\n onClick={() =>\n drawers.onChange({ activeDrawerId: item.id !== drawers.activeDrawerId ? item.id : undefined })\n }\n >\n <ToggleButton\n className={toggleClassName}\n iconName={item.trigger.iconName}\n iconSvg={item.trigger.iconSvg}\n ariaLabel={item.ariaLabels?.triggerButton}\n ariaExpanded={drawers.activeDrawerId !== undefined}\n testId={`awsui-app-layout-trigger-${item.id}`}\n />\n </span>\n ))}\n </aside>\n )}\n </div>\n </div>\n );\n}\n"]}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { ButtonProps } from '../../button/interfaces';
|
|
3
2
|
import { togglesConfig } from '../toggles';
|
|
4
3
|
import { AppLayoutProps } from '../interfaces';
|
|
5
4
|
import { IconProps } from '../../icon/interfaces';
|
|
@@ -10,8 +9,12 @@ export interface DesktopDrawerProps {
|
|
|
10
9
|
toggleClassName: string;
|
|
11
10
|
closeClassName: string;
|
|
12
11
|
toggleRefs: {
|
|
13
|
-
toggle: React.Ref<
|
|
14
|
-
|
|
12
|
+
toggle: React.Ref<{
|
|
13
|
+
focus(): void;
|
|
14
|
+
}>;
|
|
15
|
+
close: React.Ref<{
|
|
16
|
+
focus(): void;
|
|
17
|
+
}>;
|
|
15
18
|
};
|
|
16
19
|
width: number;
|
|
17
20
|
topOffset: number | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interfaces.d.ts","sourceRoot":"lib/default/","sources":["app-layout/drawer/interfaces.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,
|
|
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a,CAAC,EAAE,MAAM,CAAC;IACvB,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED,MAAM,WAAW,UAAU;IACzB,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,EAAE,KAAK,CAAC,SAAS,CAAC;IACzB,OAAO,EAAE;QACP,QAAQ,CAAC,EAAE,SAAS,CAAC,IAAI,CAAC;QAC1B,OAAO,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;KAC3B,CAAC;IACF,UAAU,EAAE,oBAAoB,CAAC;IACjC,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,yBAAyB,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,EAAE,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;CACpE;AAED,MAAM,WAAW,mBAAmB;IAClC,OAAO,CAAC,EAAE;QACR,KAAK,EAAE,KAAK,CAAC,UAAU,CAAC,CAAC;QACzB,cAAc,CAAC,EAAE,MAAM,CAAC;QACxB,QAAQ,CAAC,EAAE,yBAAyB,CAAC,MAAM,CAAC,CAAC;QAC7C,QAAQ,CAAC,EAAE,yBAAyB,CAAC;YAAE,IAAI,EAAE,MAAM,CAAC;YAAC,EAAE,EAAE,MAAM,CAAA;SAAE,CAAC,CAAC;QACnE,SAAS,CAAC,EAAE,MAAM,CAAC;KACpB,CAAC;CACH"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interfaces.js","sourceRoot":"lib/default/","sources":["app-layout/drawer/interfaces.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\nimport {
|
|
1
|
+
{"version":3,"file":"interfaces.js","sourceRoot":"lib/default/","sources":["app-layout/drawer/interfaces.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\nimport { togglesConfig } from '../toggles';\nimport { AppLayoutProps } from '../interfaces';\nimport { IconProps } from '../../icon/interfaces';\nimport { NonCancelableEventHandler } from '../../internal/events';\n\nimport { DrawerFocusControlRefs } from '../utils/use-drawer-focus-control';\n\nexport interface DesktopDrawerProps {\n contentClassName: string;\n toggleClassName: string;\n closeClassName: string;\n toggleRefs: {\n toggle: React.Ref<{ focus(): void }>;\n close: React.Ref<{ focus(): void }>;\n };\n width: number;\n topOffset: number | undefined;\n bottomOffset: number | undefined;\n ariaLabels: AppLayoutProps.Labels | undefined;\n drawersAriaLabels?: DrawerItemAriaLabels | undefined;\n children: React.ReactNode;\n type: keyof typeof togglesConfig;\n isMobile: boolean;\n isOpen: boolean;\n onToggle: (isOpen: boolean) => void;\n onClick?: (event: React.MouseEvent) => void;\n onLoseFocus?: (event: React.FocusEvent) => void;\n drawers?: {\n items: Array<DrawerItem>;\n activeDrawerId: string | undefined;\n onChange: (changeDetail: { activeDrawerId: string | undefined }) => void;\n };\n resizeHandle?: React.ReactNode;\n}\n\nexport interface ResizableDrawerProps extends DesktopDrawerProps {\n activeDrawer?: DrawerItem;\n onResize: (resizeDetail: { size: number; id: string }) => void;\n size: number;\n getMaxWidth: () => number;\n refs: DrawerFocusControlRefs;\n}\n\nexport interface DrawerTriggersBarProps {\n contentClassName: string;\n toggleClassName: string;\n topOffset: number | undefined;\n bottomOffset: number | undefined;\n isMobile: boolean;\n drawers?: {\n items: Array<DrawerItem>;\n activeDrawerId?: string;\n onChange: (changeDetail: { activeDrawerId: string | undefined }) => void;\n ariaLabel?: string;\n };\n}\n\nexport interface DrawerItemAriaLabels {\n content?: string;\n closeButton?: string;\n triggerButton?: string;\n resizeHandle?: string;\n}\n\nexport interface DrawerItem {\n id: string;\n content: React.ReactNode;\n trigger: {\n iconName?: IconProps.Name;\n iconSvg?: React.ReactNode;\n };\n ariaLabels: DrawerItemAriaLabels;\n resizable?: boolean;\n defaultSize?: number;\n onResize?: NonCancelableEventHandler<{ size: number; id: string }>;\n}\n\nexport interface InternalDrawerProps {\n drawers?: {\n items: Array<DrawerItem>;\n activeDrawerId?: string;\n onChange?: NonCancelableEventHandler<string>;\n onResize?: NonCancelableEventHandler<{ size: number; id: string }>;\n ariaLabel?: string;\n };\n}\n"]}
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
|
|
2
2
|
import './styles.scoped.css';
|
|
3
3
|
export default {
|
|
4
|
-
"toggle": "
|
|
5
|
-
"drawer-triggers": "awsui_drawer-
|
|
6
|
-
"drawer": "
|
|
7
|
-
"drawer-mobile": "awsui_drawer-
|
|
8
|
-
"drawer-closed": "awsui_drawer-
|
|
9
|
-
"drawer-content": "awsui_drawer-
|
|
10
|
-
"
|
|
11
|
-
"
|
|
12
|
-
"trigger
|
|
13
|
-
"
|
|
4
|
+
"toggle": "awsui_toggle_1uo6m_1fg2f_97",
|
|
5
|
+
"drawer-triggers": "awsui_drawer-triggers_1uo6m_1fg2f_102",
|
|
6
|
+
"drawer": "awsui_drawer_1uo6m_1fg2f_102",
|
|
7
|
+
"drawer-mobile": "awsui_drawer-mobile_1uo6m_1fg2f_112",
|
|
8
|
+
"drawer-closed": "awsui_drawer-closed_1uo6m_1fg2f_115",
|
|
9
|
+
"drawer-content": "awsui_drawer-content_1uo6m_1fg2f_122",
|
|
10
|
+
"drawer-content-clickable": "awsui_drawer-content-clickable_1uo6m_1fg2f_137",
|
|
11
|
+
"drawer-triggers-wrapper": "awsui_drawer-triggers-wrapper_1uo6m_1fg2f_148",
|
|
12
|
+
"drawer-trigger": "awsui_drawer-trigger_1uo6m_1fg2f_102",
|
|
13
|
+
"drawer-trigger-active": "awsui_drawer-trigger-active_1uo6m_1fg2f_166"
|
|
14
14
|
};
|
|
15
15
|
|