@cloudscape-design/components-themeable 3.0.833 → 3.0.835
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/drawer/styles.scss +5 -0
- package/lib/internal/scss/app-layout/visual-refresh/drawers.scss +1 -0
- package/lib/internal/scss/app-layout/visual-refresh/navigation.scss +6 -0
- package/lib/internal/scss/app-layout/visual-refresh-toolbar/drawer/styles.scss +3 -4
- package/lib/internal/scss/app-layout/visual-refresh-toolbar/navigation/styles.scss +6 -0
- package/lib/internal/scss/table/body-cell/styles.scss +19 -40
- package/lib/internal/template/app-layout/drawer/index.d.ts.map +1 -1
- package/lib/internal/template/app-layout/drawer/index.js +3 -1
- package/lib/internal/template/app-layout/drawer/index.js.map +1 -1
- package/lib/internal/template/app-layout/drawer/styles.css.js +14 -13
- package/lib/internal/template/app-layout/drawer/styles.scoped.css +26 -21
- package/lib/internal/template/app-layout/drawer/styles.selectors.js +14 -13
- package/lib/internal/template/app-layout/utils/use-drawers.d.ts.map +1 -1
- package/lib/internal/template/app-layout/utils/use-drawers.js +5 -1
- package/lib/internal/template/app-layout/utils/use-drawers.js.map +1 -1
- package/lib/internal/template/app-layout/visual-refresh/navigation.js +1 -1
- package/lib/internal/template/app-layout/visual-refresh/navigation.js.map +1 -1
- package/lib/internal/template/app-layout/visual-refresh/styles.css.js +86 -85
- package/lib/internal/template/app-layout/visual-refresh/styles.scoped.css +168 -162
- package/lib/internal/template/app-layout/visual-refresh/styles.selectors.js +86 -85
- package/lib/internal/template/app-layout/visual-refresh-toolbar/compute-layout.d.ts +4 -1
- package/lib/internal/template/app-layout/visual-refresh-toolbar/compute-layout.d.ts.map +1 -1
- package/lib/internal/template/app-layout/visual-refresh-toolbar/compute-layout.js +4 -2
- package/lib/internal/template/app-layout/visual-refresh-toolbar/compute-layout.js.map +1 -1
- 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 +5 -5
- 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 +5 -5
- 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/drawer/styles.css.js +10 -10
- package/lib/internal/template/app-layout/visual-refresh-toolbar/drawer/styles.scoped.css +12 -14
- package/lib/internal/template/app-layout/visual-refresh-toolbar/drawer/styles.selectors.js +10 -10
- package/lib/internal/template/app-layout/visual-refresh-toolbar/navigation/index.js +5 -5
- package/lib/internal/template/app-layout/visual-refresh-toolbar/navigation/index.js.map +1 -1
- package/lib/internal/template/app-layout/visual-refresh-toolbar/navigation/styles.css.js +5 -4
- package/lib/internal/template/app-layout/visual-refresh-toolbar/navigation/styles.scoped.css +10 -5
- package/lib/internal/template/app-layout/visual-refresh-toolbar/navigation/styles.selectors.js +5 -4
- 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/internal/environment.js +1 -1
- package/lib/internal/template/internal/environment.json +1 -1
- package/lib/internal/template/table/body-cell/disabled-inline-editor.d.ts +1 -1
- package/lib/internal/template/table/body-cell/disabled-inline-editor.d.ts.map +1 -1
- package/lib/internal/template/table/body-cell/disabled-inline-editor.js +4 -4
- package/lib/internal/template/table/body-cell/disabled-inline-editor.js.map +1 -1
- package/lib/internal/template/table/body-cell/index.d.ts +0 -1
- package/lib/internal/template/table/body-cell/index.d.ts.map +1 -1
- package/lib/internal/template/table/body-cell/index.js +4 -4
- package/lib/internal/template/table/body-cell/index.js.map +1 -1
- package/lib/internal/template/table/body-cell/styles.css.js +46 -47
- package/lib/internal/template/table/body-cell/styles.scoped.css +301 -331
- package/lib/internal/template/table/body-cell/styles.selectors.js +46 -47
- package/package.json +1 -1
|
@@ -36,6 +36,8 @@
|
|
|
36
36
|
position: fixed;
|
|
37
37
|
overflow: auto;
|
|
38
38
|
background-color: awsui.$color-background-layout-panel-content;
|
|
39
|
+
display: flex;
|
|
40
|
+
flex-direction: column;
|
|
39
41
|
.drawer-mobile > & {
|
|
40
42
|
z-index: constants.$drawer-z-index-mobile;
|
|
41
43
|
inset: 0;
|
|
@@ -58,6 +60,9 @@
|
|
|
58
60
|
block-size: 100%;
|
|
59
61
|
position: relative;
|
|
60
62
|
}
|
|
63
|
+
> .drawer-content-wrapper {
|
|
64
|
+
flex: 1;
|
|
65
|
+
}
|
|
61
66
|
}
|
|
62
67
|
|
|
63
68
|
.drawer-triggers-wrapper {
|
|
@@ -93,6 +93,8 @@ nav.navigation {
|
|
|
93
93
|
word-wrap: break-word;
|
|
94
94
|
pointer-events: auto;
|
|
95
95
|
border-inline-end: solid awsui.$border-divider-section-width awsui.$color-border-divider-default;
|
|
96
|
+
display: flex;
|
|
97
|
+
flex-direction: column;
|
|
96
98
|
|
|
97
99
|
// Animation for the Navigation opacity and width when it is added to the DOM
|
|
98
100
|
@keyframes openNavigation {
|
|
@@ -132,6 +134,10 @@ nav.navigation {
|
|
|
132
134
|
inline-size: var(#{custom-props.$navigationWidth});
|
|
133
135
|
}
|
|
134
136
|
|
|
137
|
+
& > .content-container {
|
|
138
|
+
flex-grow: 1;
|
|
139
|
+
}
|
|
140
|
+
|
|
135
141
|
// The Navigation drawer will take up the entire viewport on mobile
|
|
136
142
|
@include styles.media-breakpoint-down(styles.$breakpoint-x-small) {
|
|
137
143
|
#{custom-props.$navigationWidth}: 100vw;
|
|
@@ -49,10 +49,8 @@
|
|
|
49
49
|
|
|
50
50
|
&.drawer-global {
|
|
51
51
|
@include mobile-only {
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
&.last-opened {
|
|
55
|
-
display: block;
|
|
52
|
+
&:not(.last-opened) {
|
|
53
|
+
display: none;
|
|
56
54
|
}
|
|
57
55
|
}
|
|
58
56
|
}
|
|
@@ -73,6 +71,7 @@
|
|
|
73
71
|
grid-column: 3;
|
|
74
72
|
grid-row: 2;
|
|
75
73
|
z-index: 1;
|
|
74
|
+
align-self: start;
|
|
76
75
|
}
|
|
77
76
|
|
|
78
77
|
> .drawer-content {
|
|
@@ -20,6 +20,8 @@
|
|
|
20
20
|
overscroll-behavior-y: contain;
|
|
21
21
|
word-wrap: break-word;
|
|
22
22
|
pointer-events: auto;
|
|
23
|
+
display: flex;
|
|
24
|
+
flex-direction: column;
|
|
23
25
|
|
|
24
26
|
// All content is hidden by the overflow-x property
|
|
25
27
|
&:not(.is-navigation-open) {
|
|
@@ -28,6 +30,10 @@
|
|
|
28
30
|
display: none;
|
|
29
31
|
}
|
|
30
32
|
|
|
33
|
+
& > .content-container {
|
|
34
|
+
flex-grow: 1;
|
|
35
|
+
}
|
|
36
|
+
|
|
31
37
|
/*
|
|
32
38
|
A non-semantic node is added with a fixed width equal to the final Navigation
|
|
33
39
|
width. This will create the visual appearance of horizontal movement and
|
|
@@ -119,8 +119,8 @@ $cell-negative-space-vertical: 2px;
|
|
|
119
119
|
.body-cell {
|
|
120
120
|
box-sizing: border-box;
|
|
121
121
|
border-block-start: awsui.$border-divider-list-width solid transparent;
|
|
122
|
-
word-wrap: break-word;
|
|
123
122
|
border-block-end: awsui.$border-divider-list-width solid awsui.$color-border-divider-secondary;
|
|
123
|
+
word-wrap: break-word;
|
|
124
124
|
font-weight: inherit;
|
|
125
125
|
text-align: start;
|
|
126
126
|
|
|
@@ -147,7 +147,7 @@ $cell-negative-space-vertical: 2px;
|
|
|
147
147
|
&.is-visual-refresh:first-child {
|
|
148
148
|
&:not(.has-striped-rows) {
|
|
149
149
|
@include cell-padding-inline-start(awsui.$space-xxxs);
|
|
150
|
-
&:not(.body-cell-edit-active).body-cell-
|
|
150
|
+
&:not(.body-cell-edit-active).body-cell-editable:hover {
|
|
151
151
|
@include cell-padding-inline-start(calc(#{awsui.$space-xxxs} + #{awsui.$border-divider-list-width}));
|
|
152
152
|
}
|
|
153
153
|
}
|
|
@@ -431,19 +431,14 @@ $cell-negative-space-vertical: 2px;
|
|
|
431
431
|
> .body-cell-content {
|
|
432
432
|
overflow: visible;
|
|
433
433
|
}
|
|
434
|
-
&.sticky-cell {
|
|
435
|
-
position: sticky;
|
|
436
|
-
}
|
|
437
434
|
}
|
|
438
435
|
|
|
439
436
|
&:not(.body-cell-edit-active) {
|
|
440
|
-
|
|
441
|
-
cursor: pointer;
|
|
437
|
+
cursor: pointer;
|
|
442
438
|
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
}
|
|
439
|
+
// Include interactive padding even when a cell is not hovered to prevent jittering when resizableColumns=false.
|
|
440
|
+
&:not(.resizable-columns) {
|
|
441
|
+
@include cell-padding-inline-end($interactive-column-padding-inline-end);
|
|
447
442
|
}
|
|
448
443
|
|
|
449
444
|
@mixin focused-editor-styles {
|
|
@@ -466,18 +461,10 @@ $cell-negative-space-vertical: 2px;
|
|
|
466
461
|
// These edit buttons are special because they are visually hidden (opacity: 0), but exposed to assistive technology.
|
|
467
462
|
// It's therefore important to display the focus outline, even when a keyboard use wasn't detected.
|
|
468
463
|
// For example, when an edit button is selected from the VoiceOver rotor menu.
|
|
469
|
-
|
|
464
|
+
&:focus-within {
|
|
470
465
|
@include cell-focus-outline;
|
|
471
466
|
}
|
|
472
|
-
// When a cell is not interactive the focus outline must be present for the editor button.
|
|
473
|
-
&:not(.body-cell-interactive) > .body-cell-editor-wrapper > .body-cell-editor,
|
|
474
|
-
&:not(.body-cell-interactive) > .expandable-cell-content > .body-cell-editor-wrapper > .body-cell-editor {
|
|
475
|
-
@include focus-visible.when-visible {
|
|
476
|
-
@include styles.focus-highlight(awsui.$space-button-inline-icon-focus-outline-gutter);
|
|
477
|
-
}
|
|
478
|
-
}
|
|
479
467
|
|
|
480
|
-
&:not(.body-cell-interactive),
|
|
481
468
|
&:focus-within:focus-within,
|
|
482
469
|
&.body-cell-edit-disabled-popover {
|
|
483
470
|
&.body-cell-has-success {
|
|
@@ -492,15 +479,25 @@ $cell-negative-space-vertical: 2px;
|
|
|
492
479
|
}
|
|
493
480
|
}
|
|
494
481
|
|
|
495
|
-
|
|
482
|
+
&:hover:hover {
|
|
483
|
+
position: relative;
|
|
484
|
+
|
|
496
485
|
background-color: awsui.$color-background-dropdown-item-hover;
|
|
497
486
|
border-block: awsui.$border-divider-list-width solid awsui.$color-border-editable-cell-hover;
|
|
498
487
|
border-inline: awsui.$border-divider-list-width solid awsui.$color-border-editable-cell-hover;
|
|
499
488
|
inset-inline: calc(-1 * #{awsui.$border-divider-list-width});
|
|
500
|
-
|
|
489
|
+
&.sticky-cell {
|
|
490
|
+
position: sticky;
|
|
491
|
+
}
|
|
501
492
|
|
|
502
493
|
&:first-child {
|
|
503
494
|
inset-inline: 0;
|
|
495
|
+
border-start-start-radius: awsui.$border-radius-item;
|
|
496
|
+
border-end-start-radius: awsui.$border-radius-item;
|
|
497
|
+
}
|
|
498
|
+
&:last-child {
|
|
499
|
+
border-start-end-radius: awsui.$border-radius-item;
|
|
500
|
+
border-end-end-radius: awsui.$border-radius-item;
|
|
504
501
|
}
|
|
505
502
|
|
|
506
503
|
& > .body-cell-editor-wrapper,
|
|
@@ -527,28 +524,10 @@ $cell-negative-space-vertical: 2px;
|
|
|
527
524
|
&.body-cell-first-row:not(.body-cell-selected) {
|
|
528
525
|
@include cell-padding-block(calc(#{$cell-vertical-padding} - calc(#{awsui.$border-divider-list-width})));
|
|
529
526
|
}
|
|
530
|
-
&.sticky-cell {
|
|
531
|
-
position: sticky;
|
|
532
|
-
}
|
|
533
527
|
@include focused-editor-styles;
|
|
534
528
|
}
|
|
535
529
|
}
|
|
536
530
|
}
|
|
537
|
-
&-editable.is-visual-refresh:not(.body-cell-edit-active).body-cell-interactive:hover {
|
|
538
|
-
&:first-child {
|
|
539
|
-
border-start-start-radius: awsui.$border-radius-item;
|
|
540
|
-
border-end-start-radius: awsui.$border-radius-item;
|
|
541
|
-
}
|
|
542
|
-
&:last-child {
|
|
543
|
-
border-start-end-radius: awsui.$border-radius-item;
|
|
544
|
-
border-end-end-radius: awsui.$border-radius-item;
|
|
545
|
-
}
|
|
546
|
-
&.body-cell-first-row > .body-cell-success,
|
|
547
|
-
&.body-cell-first-row > .body-cell-editor-wrapper,
|
|
548
|
-
&.body-cell-first-row > .expandable-cell-content > .body-cell-editor-wrapper {
|
|
549
|
-
@include cell-padding-block-start(awsui.$border-divider-list-width);
|
|
550
|
-
}
|
|
551
|
-
}
|
|
552
531
|
|
|
553
532
|
@include focus-visible.when-visible {
|
|
554
533
|
@include cell-focus-outline;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/app-layout/drawer/index.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAiB,MAAM,OAAO,CAAC;AAWtC,OAAO,EAAE,kBAAkB,EAAE,sBAAsB,EAAE,MAAM,cAAc,CAAC;AAsB1E,eAAO,MAAM,MAAM,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/app-layout/drawer/index.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAiB,MAAM,OAAO,CAAC;AAWtC,OAAO,EAAE,kBAAkB,EAAE,sBAAsB,EAAE,MAAM,cAAc,CAAC;AAsB1E,eAAO,MAAM,MAAM,2FA4GlB,CAAC;AAoDF,eAAO,MAAM,iBAAiB,4GAS3B,sBAAsB,gBAyFxB,CAAC"}
|
|
@@ -62,7 +62,9 @@ export const Drawer = React.forwardRef(({ id, contentClassName, toggleClassName,
|
|
|
62
62
|
[testutilStyles['drawer-closed']]: !isOpen,
|
|
63
63
|
}) },
|
|
64
64
|
!isMobile && !hideOpenButton && regularOpenButton,
|
|
65
|
-
React.createElement(TagName, { className: clsx(resizeHandle && styles['drawer-resize-content']), "aria-label": mainLabel, "aria-hidden": !isOpen
|
|
65
|
+
React.createElement(TagName, { className: clsx(resizeHandle && styles['drawer-resize-content'], styles['drawer-content-wrapper']), "aria-label": mainLabel, "aria-hidden": !isOpen, style: {
|
|
66
|
+
blockSize: `calc(100vh - ${(topOffset || 0) + (bottomOffset || 0)}px)`,
|
|
67
|
+
} },
|
|
66
68
|
!isMobile && isOpen && React.createElement("div", { className: styles['resize-handle-wrapper'] }, resizeHandle),
|
|
67
69
|
React.createElement(CloseButton, { ref: toggleRefs.close, className: closeClassName, ariaLabel: closeLabel, onClick: () => {
|
|
68
70
|
onToggle(false);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/app-layout/drawer/index.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AACtC,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,iBAAiB,EAAE,MAAM,sCAAsC,CAAC;AACzE,OAAO,EAAE,cAAc,EAAE,MAAM,+CAA+C,CAAC;AAE/E,OAAO,EAAE,yBAAyB,EAAE,MAAM,0CAA0C,CAAC;AAErF,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AACtE,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAE/C,OAAO,YAAY,MAAM,iBAAiB,CAAC;AAE3C,OAAO,cAAc,MAAM,+BAA+B,CAAC;AAC3D,OAAO,MAAM,MAAM,iBAAiB,CAAC;AAErC,0FAA0F;AAC1F,qFAAqF;AACrF,uFAAuF;AACvF,4EAA4E;AAC5E,wFAAwF;AACxF,0FAA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affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useRef } from 'react';\nimport clsx from 'clsx';\n\nimport { useContainerQuery } from '@cloudscape-design/component-toolkit';\nimport { useDensityMode } from '@cloudscape-design/component-toolkit/internal';\n\nimport { getVisualContextClassname } from '../../internal/components/visual-context';\nimport { AppLayoutProps } from '../interfaces';\nimport { CloseButton, ToggleButton, togglesConfig } from '../toggles';\nimport { TOOLS_DRAWER_ID } from '../utils/use-drawers';\nimport { splitItems } from './drawers-helpers';\nimport { DesktopDrawerProps, DrawerTriggersBarProps } from './interfaces';\nimport OverflowMenu from './overflow-menu';\n\nimport testutilStyles from '../test-classes/styles.css.js';\nimport styles from './styles.css.js';\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 id,\n contentClassName,\n toggleClassName,\n closeClassName,\n width,\n type,\n toggleRefs,\n topOffset,\n bottomOffset,\n ariaLabels,\n children,\n hideOpenButton,\n isOpen,\n isHidden,\n isMobile,\n onToggle,\n onClick,\n onLoseFocus,\n resizeHandle,\n }: DesktopDrawerProps,\n ref: React.Ref<HTMLDivElement>\n ) => {\n const openButtonWrapperRef = useRef<HTMLElement | null>(null);\n const { TagName, iconName } = togglesConfig[type];\n const { mainLabel, closeLabel, openLabel } = ariaLabels;\n const drawerContentWidthOpen = isMobile ? undefined : width;\n const drawerContentWidth = isOpen ? drawerContentWidthOpen : undefined;\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={isOpen ? undefined : false}\n />\n </TagName>\n );\n\n return (\n <div\n ref={ref}\n className={clsx(styles.drawer, {\n [styles.hide]: isHidden,\n [styles['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 id={id}\n style={{ width: drawerContentWidth, top: topOffset, bottom: bottomOffset }}\n className={clsx(styles['drawer-content'], styles['drawer-content-clickable'], contentClassName, {\n [testutilStyles['drawer-closed']]: !isOpen,\n })}\n >\n {!isMobile && !hideOpenButton && regularOpenButton}\n <TagName\n className={clsx(resizeHandle && styles['drawer-resize-content'])}\n aria-label={mainLabel}\n aria-hidden={!isOpen}\n >\n {!isMobile && isOpen && <div className={styles['resize-handle-wrapper']}>{resizeHandle}</div>}\n <CloseButton\n ref={toggleRefs.close}\n className={closeClassName}\n ariaLabel={closeLabel}\n onClick={() => {\n onToggle(false);\n }}\n />\n {children}\n </TagName>\n </div>\n </div>\n );\n }\n);\n\ninterface DrawerTriggerProps {\n testUtilsClassName?: string;\n ariaLabel: string | undefined;\n ariaExpanded: boolean;\n ariaControls?: string;\n badge: boolean | undefined;\n itemId?: string;\n isActive: boolean;\n trigger: AppLayoutProps.Drawer['trigger'];\n onClick: (() => void) | undefined;\n}\n\nconst DrawerTrigger = React.forwardRef(\n (\n {\n testUtilsClassName,\n ariaLabel,\n ariaExpanded,\n ariaControls,\n badge,\n itemId,\n isActive,\n trigger,\n onClick,\n }: DrawerTriggerProps,\n ref: React.Ref<{ focus: () => void }>\n ) => (\n <div\n className={clsx(\n styles['drawer-trigger'],\n isActive && styles['drawer-trigger-active'],\n isActive && getVisualContextClassname('app-layout-tools-drawer-trigger')\n )}\n onClick={onClick}\n >\n <ToggleButton\n ref={ref}\n className={testUtilsClassName}\n iconName={trigger!.iconName}\n iconSvg={trigger!.iconSvg}\n ariaLabel={ariaLabel}\n ariaExpanded={ariaExpanded}\n ariaControls={ariaControls}\n badge={badge}\n testId={itemId && `awsui-app-layout-trigger-${itemId}`}\n />\n </div>\n )\n);\n\nexport const DrawerTriggersBar = ({\n isMobile,\n topOffset,\n bottomOffset,\n activeDrawerId,\n ariaLabels,\n drawers,\n drawerRefs,\n onDrawerChange,\n}: DrawerTriggersBarProps) => {\n const containerRef = React.useRef<HTMLDivElement>(null);\n const previousActiveDrawerId = useRef(activeDrawerId);\n const [containerHeight, triggersContainerRef] = useContainerQuery(rect => rect.contentBoxHeight);\n const isCompactMode = useDensityMode(containerRef) === 'compact';\n\n if (activeDrawerId) {\n previousActiveDrawerId.current = activeDrawerId;\n }\n\n const getIndexOfOverflowItem = () => {\n if (containerHeight) {\n const ITEM_HEIGHT = isCompactMode ? 34 : 38;\n const overflowSpot = containerHeight / 1.5;\n\n const index = Math.floor(overflowSpot / ITEM_HEIGHT);\n\n return index;\n }\n return 0;\n };\n\n const { visibleItems, overflowItems } = splitItems(drawers, getIndexOfOverflowItem(), activeDrawerId);\n const overflowMenuHasBadge = !!overflowItems.find(item => item.badge);\n\n return (\n <div\n className={clsx(styles.drawer, styles['drawer-closed'], testutilStyles['drawer-closed'], {\n [styles['drawer-mobile']]: isMobile,\n [styles.hide]: drawers.length === 1 && !!activeDrawerId,\n })}\n ref={containerRef}\n >\n <div\n ref={triggersContainerRef}\n style={{ top: topOffset, bottom: bottomOffset }}\n className={clsx(styles['drawer-content'], {\n [styles['drawer-content-clickable']]: drawers.length === 1,\n })}\n onClick={\n drawers.length === 1\n ? () => onDrawerChange(drawers[0].id !== activeDrawerId ? drawers[0].id : null)\n : undefined\n }\n >\n {!isMobile && (\n <aside aria-label={ariaLabels?.drawers} role=\"region\">\n <div className={styles['drawer-triggers-wrapper']} role=\"toolbar\" aria-orientation=\"vertical\">\n {visibleItems.map((item, index) => {\n return (\n <DrawerTrigger\n key={index}\n testUtilsClassName={clsx(\n testutilStyles['drawers-trigger'],\n item.id === TOOLS_DRAWER_ID && testutilStyles['tools-toggle']\n )}\n ariaExpanded={activeDrawerId === item.id}\n ref={item.id === previousActiveDrawerId.current ? drawerRefs.toggle : undefined}\n ariaLabel={item.ariaLabels?.triggerButton}\n ariaControls={activeDrawerId === item.id ? item.id : undefined}\n trigger={item.trigger}\n badge={item.badge}\n itemId={item.id}\n isActive={activeDrawerId === item.id}\n onClick={\n drawers.length !== 1\n ? () => onDrawerChange(item.id !== activeDrawerId ? item.id : null)\n : undefined\n }\n />\n );\n })}\n {overflowItems.length > 0 && (\n <div className={styles['drawer-trigger']}>\n <OverflowMenu\n ariaLabel={\n overflowMenuHasBadge ? ariaLabels?.drawersOverflowWithBadge : ariaLabels?.drawersOverflow\n }\n items={overflowItems}\n onItemClick={({ detail }) => onDrawerChange(detail.id)}\n />\n </div>\n )}\n </div>\n </aside>\n )}\n </div>\n </div>\n );\n};\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/app-layout/drawer/index.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AACtC,OAAO,IAAI,MAAM,MAAM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AAC;4BAClB,CAAC,CAAC,GAAG,EAAE,CAAC,cAAc,CAAC,IAAI,CAAC,EAAE,KAAK,cAAc,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC;4BACnE,CAAC,CAAC,SAAS,GAEf,CACH,CAAC;gBACJ,CAAC,CAAC;gBACD,aAAa,CAAC,MAAM,GAAG,CAAC,IAAI,CAC3B,6BAAK,SAAS,EAAE,MAAM,CAAC,gBAAgB,CAAC;oBACtC,oBAAC,YAAY,IACX,SAAS,EACP,oBAAoB,CAAC,CAAC,CAAC,UAAU,aAAV,UAAU,uBAAV,UAAU,CAAE,wBAAwB,CAAC,CAAC,CAAC,UAAU,aAAV,UAAU,uBAAV,UAAU,CAAE,eAAe,EAE3F,KAAK,EAAE,aAAa,EACpB,WAAW,EAAE,CAAC,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC,cAAc,CAAC,MAAM,CAAC,EAAE,CAAC,GACtD,CACE,CACP,CACG,CACA,CACT,CACG,CACF,CACP,CAAC;AACJ,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 clsx from 'clsx';\n\nimport { useContainerQuery } from '@cloudscape-design/component-toolkit';\nimport { useDensityMode } from '@cloudscape-design/component-toolkit/internal';\n\nimport { getVisualContextClassname } from '../../internal/components/visual-context';\nimport { AppLayoutProps } from '../interfaces';\nimport { CloseButton, ToggleButton, togglesConfig } from '../toggles';\nimport { TOOLS_DRAWER_ID } from '../utils/use-drawers';\nimport { splitItems } from './drawers-helpers';\nimport { DesktopDrawerProps, DrawerTriggersBarProps } from './interfaces';\nimport OverflowMenu from './overflow-menu';\n\nimport testutilStyles from '../test-classes/styles.css.js';\nimport styles from './styles.css.js';\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 id,\n contentClassName,\n toggleClassName,\n closeClassName,\n width,\n type,\n toggleRefs,\n topOffset,\n bottomOffset,\n ariaLabels,\n children,\n hideOpenButton,\n isOpen,\n isHidden,\n isMobile,\n onToggle,\n onClick,\n onLoseFocus,\n resizeHandle,\n }: DesktopDrawerProps,\n ref: React.Ref<HTMLDivElement>\n ) => {\n const openButtonWrapperRef = useRef<HTMLElement | null>(null);\n const { TagName, iconName } = togglesConfig[type];\n const { mainLabel, closeLabel, openLabel } = ariaLabels;\n const drawerContentWidthOpen = isMobile ? undefined : width;\n const drawerContentWidth = isOpen ? drawerContentWidthOpen : undefined;\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={isOpen ? undefined : false}\n />\n </TagName>\n );\n\n return (\n <div\n ref={ref}\n className={clsx(styles.drawer, {\n [styles.hide]: isHidden,\n [styles['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 id={id}\n style={{ width: drawerContentWidth, top: topOffset, bottom: bottomOffset }}\n className={clsx(styles['drawer-content'], styles['drawer-content-clickable'], contentClassName, {\n [testutilStyles['drawer-closed']]: !isOpen,\n })}\n >\n {!isMobile && !hideOpenButton && regularOpenButton}\n <TagName\n className={clsx(resizeHandle && styles['drawer-resize-content'], styles['drawer-content-wrapper'])}\n aria-label={mainLabel}\n aria-hidden={!isOpen}\n style={{\n blockSize: `calc(100vh - ${(topOffset || 0) + (bottomOffset || 0)}px)`,\n }}\n >\n {!isMobile && isOpen && <div className={styles['resize-handle-wrapper']}>{resizeHandle}</div>}\n <CloseButton\n ref={toggleRefs.close}\n className={closeClassName}\n ariaLabel={closeLabel}\n onClick={() => {\n onToggle(false);\n }}\n />\n {children}\n </TagName>\n </div>\n </div>\n );\n }\n);\n\ninterface DrawerTriggerProps {\n testUtilsClassName?: string;\n ariaLabel: string | undefined;\n ariaExpanded: boolean;\n ariaControls?: string;\n badge: boolean | undefined;\n itemId?: string;\n isActive: boolean;\n trigger: AppLayoutProps.Drawer['trigger'];\n onClick: (() => void) | undefined;\n}\n\nconst DrawerTrigger = React.forwardRef(\n (\n {\n testUtilsClassName,\n ariaLabel,\n ariaExpanded,\n ariaControls,\n badge,\n itemId,\n isActive,\n trigger,\n onClick,\n }: DrawerTriggerProps,\n ref: React.Ref<{ focus: () => void }>\n ) => (\n <div\n className={clsx(\n styles['drawer-trigger'],\n isActive && styles['drawer-trigger-active'],\n isActive && getVisualContextClassname('app-layout-tools-drawer-trigger')\n )}\n onClick={onClick}\n >\n <ToggleButton\n ref={ref}\n className={testUtilsClassName}\n iconName={trigger!.iconName}\n iconSvg={trigger!.iconSvg}\n ariaLabel={ariaLabel}\n ariaExpanded={ariaExpanded}\n ariaControls={ariaControls}\n badge={badge}\n testId={itemId && `awsui-app-layout-trigger-${itemId}`}\n />\n </div>\n )\n);\n\nexport const DrawerTriggersBar = ({\n isMobile,\n topOffset,\n bottomOffset,\n activeDrawerId,\n ariaLabels,\n drawers,\n drawerRefs,\n onDrawerChange,\n}: DrawerTriggersBarProps) => {\n const containerRef = React.useRef<HTMLDivElement>(null);\n const previousActiveDrawerId = useRef(activeDrawerId);\n const [containerHeight, triggersContainerRef] = useContainerQuery(rect => rect.contentBoxHeight);\n const isCompactMode = useDensityMode(containerRef) === 'compact';\n\n if (activeDrawerId) {\n previousActiveDrawerId.current = activeDrawerId;\n }\n\n const getIndexOfOverflowItem = () => {\n if (containerHeight) {\n const ITEM_HEIGHT = isCompactMode ? 34 : 38;\n const overflowSpot = containerHeight / 1.5;\n\n const index = Math.floor(overflowSpot / ITEM_HEIGHT);\n\n return index;\n }\n return 0;\n };\n\n const { visibleItems, overflowItems } = splitItems(drawers, getIndexOfOverflowItem(), activeDrawerId);\n const overflowMenuHasBadge = !!overflowItems.find(item => item.badge);\n\n return (\n <div\n className={clsx(styles.drawer, styles['drawer-closed'], testutilStyles['drawer-closed'], {\n [styles['drawer-mobile']]: isMobile,\n [styles.hide]: drawers.length === 1 && !!activeDrawerId,\n })}\n ref={containerRef}\n >\n <div\n ref={triggersContainerRef}\n style={{ top: topOffset, bottom: bottomOffset }}\n className={clsx(styles['drawer-content'], {\n [styles['drawer-content-clickable']]: drawers.length === 1,\n })}\n onClick={\n drawers.length === 1\n ? () => onDrawerChange(drawers[0].id !== activeDrawerId ? drawers[0].id : null)\n : undefined\n }\n >\n {!isMobile && (\n <aside aria-label={ariaLabels?.drawers} role=\"region\">\n <div className={styles['drawer-triggers-wrapper']} role=\"toolbar\" aria-orientation=\"vertical\">\n {visibleItems.map((item, index) => {\n return (\n <DrawerTrigger\n key={index}\n testUtilsClassName={clsx(\n testutilStyles['drawers-trigger'],\n item.id === TOOLS_DRAWER_ID && testutilStyles['tools-toggle']\n )}\n ariaExpanded={activeDrawerId === item.id}\n ref={item.id === previousActiveDrawerId.current ? drawerRefs.toggle : undefined}\n ariaLabel={item.ariaLabels?.triggerButton}\n ariaControls={activeDrawerId === item.id ? item.id : undefined}\n trigger={item.trigger}\n badge={item.badge}\n itemId={item.id}\n isActive={activeDrawerId === item.id}\n onClick={\n drawers.length !== 1\n ? () => onDrawerChange(item.id !== activeDrawerId ? item.id : null)\n : undefined\n }\n />\n );\n })}\n {overflowItems.length > 0 && (\n <div className={styles['drawer-trigger']}>\n <OverflowMenu\n ariaLabel={\n overflowMenuHasBadge ? ariaLabels?.drawersOverflowWithBadge : ariaLabels?.drawersOverflow\n }\n items={overflowItems}\n onItemClick={({ detail }) => onDrawerChange(detail.id)}\n />\n </div>\n )}\n </div>\n </aside>\n )}\n </div>\n </div>\n );\n};\n"]}
|
|
@@ -1,18 +1,19 @@
|
|
|
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
|
-
"drawer-content-clickable": "awsui_drawer-content-
|
|
11
|
-
"drawer-resize-content": "awsui_drawer-resize-
|
|
12
|
-
"drawer-
|
|
13
|
-
"drawer-
|
|
14
|
-
"drawer-trigger
|
|
15
|
-
"
|
|
16
|
-
"
|
|
4
|
+
"toggle": "awsui_toggle_1uo6m_11o8o_189",
|
|
5
|
+
"drawer-triggers": "awsui_drawer-triggers_1uo6m_11o8o_195",
|
|
6
|
+
"drawer": "awsui_drawer_1uo6m_11o8o_195",
|
|
7
|
+
"drawer-mobile": "awsui_drawer-mobile_1uo6m_11o8o_205",
|
|
8
|
+
"drawer-closed": "awsui_drawer-closed_1uo6m_11o8o_208",
|
|
9
|
+
"drawer-content": "awsui_drawer-content_1uo6m_11o8o_215",
|
|
10
|
+
"drawer-content-clickable": "awsui_drawer-content-clickable_1uo6m_11o8o_229",
|
|
11
|
+
"drawer-resize-content": "awsui_drawer-resize-content_1uo6m_11o8o_239",
|
|
12
|
+
"drawer-content-wrapper": "awsui_drawer-content-wrapper_1uo6m_11o8o_244",
|
|
13
|
+
"drawer-triggers-wrapper": "awsui_drawer-triggers-wrapper_1uo6m_11o8o_248",
|
|
14
|
+
"drawer-trigger": "awsui_drawer-trigger_1uo6m_11o8o_195",
|
|
15
|
+
"drawer-trigger-active": "awsui_drawer-trigger-active_1uo6m_11o8o_267",
|
|
16
|
+
"resize-handle-wrapper": "awsui_resize-handle-wrapper_1uo6m_11o8o_275",
|
|
17
|
+
"hide": "awsui_hide_1uo6m_11o8o_285"
|
|
17
18
|
};
|
|
18
19
|
|
|
@@ -186,88 +186,93 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
186
186
|
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
187
187
|
SPDX-License-Identifier: Apache-2.0
|
|
188
188
|
*/
|
|
189
|
-
.
|
|
189
|
+
.awsui_toggle_1uo6m_11o8o_189:not(#\9) {
|
|
190
190
|
box-sizing: border-box;
|
|
191
191
|
padding-block: var(--space-xxs-y2432o, 4px);
|
|
192
192
|
padding-inline: 7px;
|
|
193
193
|
}
|
|
194
194
|
|
|
195
|
-
.awsui_drawer-
|
|
195
|
+
.awsui_drawer-triggers_1uo6m_11o8o_195:not(#\9) {
|
|
196
196
|
box-sizing: border-box;
|
|
197
197
|
}
|
|
198
198
|
|
|
199
|
-
.
|
|
199
|
+
.awsui_drawer_1uo6m_11o8o_195:not(#\9) {
|
|
200
200
|
flex-shrink: 0;
|
|
201
201
|
position: relative;
|
|
202
202
|
word-wrap: break-word;
|
|
203
203
|
box-shadow: var(--shadow-panel-yrshw4, 0 1px 1px 0 rgba(0, 28, 36, 0.3), 1px 1px 1px 0 rgba(0, 28, 36, 0.15), -1px 1px 1px 0 rgba(0, 28, 36, 0.15));
|
|
204
204
|
}
|
|
205
|
-
.
|
|
205
|
+
.awsui_drawer_1uo6m_11o8o_195:not(#\9):not(.awsui_drawer-mobile_1uo6m_11o8o_205) {
|
|
206
206
|
z-index: 830;
|
|
207
207
|
}
|
|
208
|
-
.awsui_drawer-
|
|
208
|
+
.awsui_drawer-closed_1uo6m_11o8o_208:not(#\9) {
|
|
209
209
|
min-inline-size: 40px;
|
|
210
210
|
}
|
|
211
|
-
.awsui_drawer-
|
|
211
|
+
.awsui_drawer-closed_1uo6m_11o8o_208.awsui_drawer-mobile_1uo6m_11o8o_205:not(#\9) {
|
|
212
212
|
display: none;
|
|
213
213
|
}
|
|
214
214
|
|
|
215
|
-
.awsui_drawer-
|
|
215
|
+
.awsui_drawer-content_1uo6m_11o8o_215:not(#\9) {
|
|
216
216
|
position: fixed;
|
|
217
217
|
overflow: auto;
|
|
218
218
|
background-color: var(--color-background-layout-panel-content-70ws8g, #ffffff);
|
|
219
|
+
display: flex;
|
|
220
|
+
flex-direction: column;
|
|
219
221
|
}
|
|
220
|
-
.awsui_drawer-
|
|
222
|
+
.awsui_drawer-mobile_1uo6m_11o8o_205 > .awsui_drawer-content_1uo6m_11o8o_215:not(#\9) {
|
|
221
223
|
z-index: 1001;
|
|
222
224
|
inset: 0;
|
|
223
225
|
}
|
|
224
|
-
.awsui_drawer-
|
|
226
|
+
.awsui_drawer-closed_1uo6m_11o8o_208 > .awsui_drawer-content_1uo6m_11o8o_215:not(#\9) {
|
|
225
227
|
inline-size: 40px;
|
|
226
228
|
}
|
|
227
|
-
.awsui_drawer-
|
|
229
|
+
.awsui_drawer-closed_1uo6m_11o8o_208 > .awsui_drawer-content_1uo6m_11o8o_215.awsui_drawer-content-clickable_1uo6m_11o8o_229:not(#\9) {
|
|
228
230
|
cursor: pointer;
|
|
229
231
|
color: var(--color-text-interactive-default-t1snbz, #545b64);
|
|
230
232
|
}
|
|
231
|
-
.awsui_drawer-
|
|
233
|
+
.awsui_drawer-closed_1uo6m_11o8o_208 > .awsui_drawer-content_1uo6m_11o8o_215.awsui_drawer-content-clickable_1uo6m_11o8o_229:not(#\9):hover {
|
|
232
234
|
background: var(--color-background-layout-panel-hover-7apn2n, #eaeded);
|
|
233
235
|
}
|
|
234
|
-
.awsui_drawer-
|
|
236
|
+
.awsui_drawer-content_1uo6m_11o8o_215 > [aria-hidden=true]:not(#\9) {
|
|
235
237
|
display: none;
|
|
236
238
|
}
|
|
237
|
-
.awsui_drawer-
|
|
239
|
+
.awsui_drawer-content_1uo6m_11o8o_215 > .awsui_drawer-resize-content_1uo6m_11o8o_239:not(#\9) {
|
|
238
240
|
overflow: auto;
|
|
239
241
|
block-size: 100%;
|
|
240
242
|
position: relative;
|
|
241
243
|
}
|
|
244
|
+
.awsui_drawer-content_1uo6m_11o8o_215 > .awsui_drawer-content-wrapper_1uo6m_11o8o_244:not(#\9) {
|
|
245
|
+
flex: 1;
|
|
246
|
+
}
|
|
242
247
|
|
|
243
|
-
.awsui_drawer-triggers-
|
|
248
|
+
.awsui_drawer-triggers-wrapper_1uo6m_11o8o_248:not(#\9) {
|
|
244
249
|
display: flex;
|
|
245
250
|
flex-direction: column;
|
|
246
251
|
text-align: center;
|
|
247
252
|
align-items: stretch;
|
|
248
253
|
}
|
|
249
254
|
|
|
250
|
-
.awsui_drawer-
|
|
255
|
+
.awsui_drawer-trigger_1uo6m_11o8o_195:not(#\9) {
|
|
251
256
|
padding-block: var(--space-xxs-y2432o, 4px);
|
|
252
257
|
padding-inline: 7px;
|
|
253
258
|
cursor: pointer;
|
|
254
259
|
color: var(--color-text-interactive-default-t1snbz, #545b64);
|
|
255
260
|
}
|
|
256
|
-
.awsui_drawer-
|
|
261
|
+
.awsui_drawer-trigger_1uo6m_11o8o_195:not(#\9):not(:first-child) {
|
|
257
262
|
border-block-start: 1px solid var(--color-border-layout-5gml03, #d5dbdb);
|
|
258
263
|
}
|
|
259
|
-
.awsui_drawer-
|
|
264
|
+
.awsui_drawer-trigger_1uo6m_11o8o_195:not(#\9):hover {
|
|
260
265
|
color: var(--color-text-layout-toggle-hover-2duwd4, #0073bb);
|
|
261
266
|
}
|
|
262
|
-
.awsui_drawer-trigger-
|
|
267
|
+
.awsui_drawer-trigger-active_1uo6m_11o8o_267:not(#\9), .awsui_drawer-trigger-active_1uo6m_11o8o_267:not(#\9):hover {
|
|
263
268
|
background-color: var(--color-background-layout-toggle-selected-default-qcp7lk, #0073bb);
|
|
264
269
|
color: var(--color-text-layout-toggle-active-ox34la, #ffffff);
|
|
265
270
|
}
|
|
266
|
-
.awsui_drawer-content-
|
|
271
|
+
.awsui_drawer-content-clickable_1uo6m_11o8o_229 > .awsui_drawer-triggers-wrapper_1uo6m_11o8o_248 > .awsui_drawer-trigger_1uo6m_11o8o_195:not(#\9):hover {
|
|
267
272
|
color: var(--color-text-interactive-default-t1snbz, #545b64);
|
|
268
273
|
}
|
|
269
274
|
|
|
270
|
-
.awsui_resize-handle-
|
|
275
|
+
.awsui_resize-handle-wrapper_1uo6m_11o8o_275:not(#\9) {
|
|
271
276
|
position: absolute;
|
|
272
277
|
inset-inline-start: 0;
|
|
273
278
|
inset-block-start: 0;
|
|
@@ -277,6 +282,6 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
277
282
|
z-index: 1;
|
|
278
283
|
}
|
|
279
284
|
|
|
280
|
-
.
|
|
285
|
+
.awsui_hide_1uo6m_11o8o_285:not(#\9) {
|
|
281
286
|
display: none;
|
|
282
287
|
}
|
|
@@ -2,18 +2,19 @@
|
|
|
2
2
|
// es-module interop with Babel and Typescript
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
4
|
module.exports.default = {
|
|
5
|
-
"toggle": "
|
|
6
|
-
"drawer-triggers": "awsui_drawer-
|
|
7
|
-
"drawer": "
|
|
8
|
-
"drawer-mobile": "awsui_drawer-
|
|
9
|
-
"drawer-closed": "awsui_drawer-
|
|
10
|
-
"drawer-content": "awsui_drawer-
|
|
11
|
-
"drawer-content-clickable": "awsui_drawer-content-
|
|
12
|
-
"drawer-resize-content": "awsui_drawer-resize-
|
|
13
|
-
"drawer-
|
|
14
|
-
"drawer-
|
|
15
|
-
"drawer-trigger
|
|
16
|
-
"
|
|
17
|
-
"
|
|
5
|
+
"toggle": "awsui_toggle_1uo6m_11o8o_189",
|
|
6
|
+
"drawer-triggers": "awsui_drawer-triggers_1uo6m_11o8o_195",
|
|
7
|
+
"drawer": "awsui_drawer_1uo6m_11o8o_195",
|
|
8
|
+
"drawer-mobile": "awsui_drawer-mobile_1uo6m_11o8o_205",
|
|
9
|
+
"drawer-closed": "awsui_drawer-closed_1uo6m_11o8o_208",
|
|
10
|
+
"drawer-content": "awsui_drawer-content_1uo6m_11o8o_215",
|
|
11
|
+
"drawer-content-clickable": "awsui_drawer-content-clickable_1uo6m_11o8o_229",
|
|
12
|
+
"drawer-resize-content": "awsui_drawer-resize-content_1uo6m_11o8o_239",
|
|
13
|
+
"drawer-content-wrapper": "awsui_drawer-content-wrapper_1uo6m_11o8o_244",
|
|
14
|
+
"drawer-triggers-wrapper": "awsui_drawer-triggers-wrapper_1uo6m_11o8o_248",
|
|
15
|
+
"drawer-trigger": "awsui_drawer-trigger_1uo6m_11o8o_195",
|
|
16
|
+
"drawer-trigger-active": "awsui_drawer-trigger-active_1uo6m_11o8o_267",
|
|
17
|
+
"resize-handle-wrapper": "awsui_resize-handle-wrapper_1uo6m_11o8o_275",
|
|
18
|
+
"hide": "awsui_hide_1uo6m_11o8o_285"
|
|
18
19
|
};
|
|
19
20
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-drawers.d.ts","sourceRoot":"","sources":["../../../../src/app-layout/utils/use-drawers.ts"],"names":[],"mappings":"AAEA,OAAO,KAAsC,MAAM,OAAO,CAAC;AAQ3D,OAAO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AE,cAAc,EAAE,MAAM,eAAe,CAAC;AAI/C,eAAO,MAAM,eAAe,yBAAyB,CAAC;AAEtD,UAAU,UAAU;IAClB,SAAS,EAAE,OAAO,GAAG,SAAS,CAAC;IAC/B,SAAS,EAAE,OAAO,GAAG,SAAS,CAAC;IAC/B,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,KAAK,CAAC,SAAS,GAAG,SAAS,CAAC;IACnC,aAAa,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,CAAC;IAC1C,UAAU,EAAE,cAAc,CAAC,MAAM,GAAG,SAAS,CAAC;IAC9C,mBAAmB,CAAC,EAAE,OAAO,CAAC;CAC/B;AAsJD,eAAO,MAAM,eAAe,MAAM,CAAC;AAEnC,KAAK,eAAe,GAAG,IAAI,CAAC,cAAc,EAAE,SAAS,GAAG,gBAAgB,GAAG,gBAAgB,CAAC,GAAG;IAC7F,uBAAuB,CAAC,EAAE,OAAO,CAAC;IAClC,mBAAmB,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;IAChE,oBAAoB,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAC;CACnD,CAAC;AAEF,wBAAgB,UAAU,CACxB,EACE,OAAO,EACP,cAAc,EAAE,wBAAwB,EACxC,cAAc,EACd,mBAAmB,EACnB,oBAAoB,EACpB,uBAAuB,EAAE,qBAAqB,GAC/C,EAAE,eAAe,EAClB,UAAU,EAAE,cAAc,CAAC,YAAY,CAAC,EACxC,UAAU,EAAE,UAAU;;;;;;;;;;;;;;wCAmBqB,MAAM,GAAG,IAAI;;YAPN,MAAM;cAAQ,MAAM;;4CA2BvB,MAAM;EAiFtD"}
|
|
@@ -186,7 +186,11 @@ export function useDrawers({ drawers, activeDrawerId: controlledActiveDrawerId,
|
|
|
186
186
|
? [...localBefore, ...drawers, ...localAfter]
|
|
187
187
|
: applyToolsDrawer(toolsProps, runtimeDrawers);
|
|
188
188
|
// support toolsOpen in runtime-drawers-only mode
|
|
189
|
-
let activeDrawerIdResolved = (toolsProps === null || toolsProps === void 0 ? void 0 : toolsProps.toolsOpen) && !hasOwnDrawers
|
|
189
|
+
let activeDrawerIdResolved = (toolsProps === null || toolsProps === void 0 ? void 0 : toolsProps.toolsOpen) && !hasOwnDrawers
|
|
190
|
+
? TOOLS_DRAWER_ID
|
|
191
|
+
: activeDrawerId !== TOOLS_DRAWER_ID
|
|
192
|
+
? activeDrawerId
|
|
193
|
+
: null;
|
|
190
194
|
const activeDrawer = combinedLocalDrawers === null || combinedLocalDrawers === void 0 ? void 0 : combinedLocalDrawers.find(drawer => drawer.id === activeDrawerIdResolved);
|
|
191
195
|
// ensure that id is only defined when the drawer exists
|
|
192
196
|
activeDrawerIdResolved = (_a = activeDrawer === null || activeDrawer === void 0 ? void 0 : activeDrawer.id) !== null && _a !== void 0 ? _a : null;
|