@cloudscape-design/components-themeable 3.0.1319 → 3.0.1321
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/attribute-editor/styles.scss +5 -0
- package/lib/internal/scss/expandable-section/styles.scss +4 -5
- package/lib/internal/scss/internal/generated/custom-css-properties/index.scss +1 -1
- package/lib/internal/template/app-layout/drawer/overflow-menu.d.ts +2 -1
- package/lib/internal/template/app-layout/drawer/overflow-menu.d.ts.map +1 -1
- package/lib/internal/template/app-layout/drawer/overflow-menu.js.map +1 -1
- package/lib/internal/template/app-layout/visual-refresh-toolbar/drawer/global-ai-drawer.js.map +1 -1
- package/lib/internal/template/app-layout/visual-refresh-toolbar/drawer/global-bottom-drawer.js.map +1 -1
- package/lib/internal/template/app-layout/visual-refresh-toolbar/drawer/global-drawer.js.map +1 -1
- package/lib/internal/template/attribute-editor/styles.css.js +15 -15
- package/lib/internal/template/attribute-editor/styles.scoped.css +28 -25
- package/lib/internal/template/attribute-editor/styles.selectors.js +15 -15
- package/lib/internal/template/breadcrumb-group/implementation.d.ts +2 -1
- package/lib/internal/template/breadcrumb-group/implementation.d.ts.map +1 -1
- package/lib/internal/template/breadcrumb-group/implementation.js.map +1 -1
- package/lib/internal/template/breadcrumb-group/interfaces.d.ts +0 -4
- package/lib/internal/template/breadcrumb-group/interfaces.d.ts.map +1 -1
- package/lib/internal/template/breadcrumb-group/interfaces.js.map +1 -1
- package/lib/internal/template/breadcrumb-group/internal-interfaces.d.ts +6 -0
- package/lib/internal/template/breadcrumb-group/internal-interfaces.d.ts.map +1 -0
- package/lib/internal/template/breadcrumb-group/internal-interfaces.js +2 -0
- package/lib/internal/template/breadcrumb-group/internal-interfaces.js.map +1 -0
- package/lib/internal/template/breadcrumb-group/skeleton.js.map +1 -1
- package/lib/internal/template/button-dropdown/category-elements/category-element.d.ts +1 -1
- package/lib/internal/template/button-dropdown/category-elements/category-element.d.ts.map +1 -1
- package/lib/internal/template/button-dropdown/category-elements/category-element.js.map +1 -1
- package/lib/internal/template/button-dropdown/category-elements/expandable-category-element.d.ts +1 -1
- package/lib/internal/template/button-dropdown/category-elements/expandable-category-element.d.ts.map +1 -1
- package/lib/internal/template/button-dropdown/category-elements/expandable-category-element.js.map +1 -1
- package/lib/internal/template/button-dropdown/category-elements/mobile-expandable-category-element.d.ts +1 -1
- package/lib/internal/template/button-dropdown/category-elements/mobile-expandable-category-element.d.ts.map +1 -1
- package/lib/internal/template/button-dropdown/category-elements/mobile-expandable-category-element.js.map +1 -1
- package/lib/internal/template/button-dropdown/interfaces.d.ts +0 -101
- package/lib/internal/template/button-dropdown/interfaces.d.ts.map +1 -1
- package/lib/internal/template/button-dropdown/interfaces.js.map +1 -1
- package/lib/internal/template/button-dropdown/internal-interfaces.d.ts +104 -0
- package/lib/internal/template/button-dropdown/internal-interfaces.d.ts.map +1 -0
- package/lib/internal/template/button-dropdown/internal-interfaces.js +2 -0
- package/lib/internal/template/button-dropdown/internal-interfaces.js.map +1 -0
- package/lib/internal/template/button-dropdown/internal.d.ts +2 -1
- package/lib/internal/template/button-dropdown/internal.d.ts.map +1 -1
- package/lib/internal/template/button-dropdown/internal.js.map +1 -1
- package/lib/internal/template/button-dropdown/item-element/index.d.ts +1 -1
- package/lib/internal/template/button-dropdown/item-element/index.d.ts.map +1 -1
- package/lib/internal/template/button-dropdown/item-element/index.js.map +1 -1
- package/lib/internal/template/button-dropdown/items-list.d.ts +1 -1
- package/lib/internal/template/button-dropdown/items-list.d.ts.map +1 -1
- package/lib/internal/template/button-dropdown/items-list.js.map +1 -1
- package/lib/internal/template/button-group/icon-button-item.d.ts +2 -1
- package/lib/internal/template/button-group/icon-button-item.d.ts.map +1 -1
- package/lib/internal/template/button-group/icon-button-item.js.map +1 -1
- package/lib/internal/template/button-group/icon-toggle-button-item.d.ts +2 -1
- package/lib/internal/template/button-group/icon-toggle-button-item.d.ts.map +1 -1
- package/lib/internal/template/button-group/icon-toggle-button-item.js.map +1 -1
- package/lib/internal/template/button-group/interfaces.d.ts +0 -14
- package/lib/internal/template/button-group/interfaces.d.ts.map +1 -1
- package/lib/internal/template/button-group/interfaces.js.map +1 -1
- package/lib/internal/template/button-group/internal-interfaces.d.ts +16 -0
- package/lib/internal/template/button-group/internal-interfaces.d.ts.map +1 -0
- package/lib/internal/template/button-group/internal-interfaces.js +2 -0
- package/lib/internal/template/button-group/internal-interfaces.js.map +1 -0
- package/lib/internal/template/button-group/internal.d.ts +2 -1
- package/lib/internal/template/button-group/internal.d.ts.map +1 -1
- package/lib/internal/template/button-group/internal.js.map +1 -1
- package/lib/internal/template/column-layout/flexible-column-layout/index.d.ts +1 -1
- package/lib/internal/template/column-layout/flexible-column-layout/index.d.ts.map +1 -1
- package/lib/internal/template/column-layout/flexible-column-layout/index.js.map +1 -1
- package/lib/internal/template/column-layout/grid-column-layout.d.ts +1 -1
- package/lib/internal/template/column-layout/grid-column-layout.d.ts.map +1 -1
- package/lib/internal/template/column-layout/grid-column-layout.js.map +1 -1
- package/lib/internal/template/column-layout/interfaces.d.ts +0 -9
- package/lib/internal/template/column-layout/interfaces.d.ts.map +1 -1
- package/lib/internal/template/column-layout/interfaces.js.map +1 -1
- package/lib/internal/template/column-layout/internal-interfaces.d.ts +11 -0
- package/lib/internal/template/column-layout/internal-interfaces.d.ts.map +1 -0
- package/lib/internal/template/column-layout/internal-interfaces.js +2 -0
- package/lib/internal/template/column-layout/internal-interfaces.js.map +1 -0
- package/lib/internal/template/column-layout/internal.d.ts +1 -1
- package/lib/internal/template/column-layout/internal.d.ts.map +1 -1
- package/lib/internal/template/column-layout/internal.js.map +1 -1
- package/lib/internal/template/expandable-section/expandable-section-container.d.ts +1 -1
- package/lib/internal/template/expandable-section/expandable-section-container.d.ts.map +1 -1
- package/lib/internal/template/expandable-section/expandable-section-container.js.map +1 -1
- package/lib/internal/template/expandable-section/expandable-section-header.d.ts +2 -1
- package/lib/internal/template/expandable-section/expandable-section-header.d.ts.map +1 -1
- package/lib/internal/template/expandable-section/expandable-section-header.js.map +1 -1
- package/lib/internal/template/expandable-section/interfaces.d.ts +0 -1
- package/lib/internal/template/expandable-section/interfaces.d.ts.map +1 -1
- package/lib/internal/template/expandable-section/interfaces.js.map +1 -1
- package/lib/internal/template/expandable-section/internal-interfaces.d.ts +3 -0
- package/lib/internal/template/expandable-section/internal-interfaces.d.ts.map +1 -0
- package/lib/internal/template/expandable-section/internal-interfaces.js +2 -0
- package/lib/internal/template/expandable-section/internal-interfaces.js.map +1 -0
- package/lib/internal/template/expandable-section/internal.d.ts +2 -1
- package/lib/internal/template/expandable-section/internal.d.ts.map +1 -1
- package/lib/internal/template/expandable-section/internal.js.map +1 -1
- package/lib/internal/template/expandable-section/styles.css.js +35 -35
- package/lib/internal/template/expandable-section/styles.scoped.css +71 -74
- package/lib/internal/template/expandable-section/styles.selectors.js +35 -35
- package/lib/internal/template/expandable-section/utils.d.ts +1 -1
- package/lib/internal/template/expandable-section/utils.d.ts.map +1 -1
- package/lib/internal/template/expandable-section/utils.js.map +1 -1
- package/lib/internal/template/flashbar/collapsible-flashbar.d.ts +1 -1
- package/lib/internal/template/flashbar/collapsible-flashbar.d.ts.map +1 -1
- package/lib/internal/template/flashbar/collapsible-flashbar.js.map +1 -1
- package/lib/internal/template/flashbar/common.d.ts +2 -1
- package/lib/internal/template/flashbar/common.d.ts.map +1 -1
- package/lib/internal/template/flashbar/common.js.map +1 -1
- package/lib/internal/template/flashbar/implementation.d.ts +1 -1
- package/lib/internal/template/flashbar/implementation.d.ts.map +1 -1
- package/lib/internal/template/flashbar/implementation.js.map +1 -1
- package/lib/internal/template/flashbar/interfaces.d.ts +0 -2
- package/lib/internal/template/flashbar/interfaces.d.ts.map +1 -1
- package/lib/internal/template/flashbar/interfaces.js.map +1 -1
- package/lib/internal/template/flashbar/internal-interfaces.d.ts +4 -0
- package/lib/internal/template/flashbar/internal-interfaces.d.ts.map +1 -0
- package/lib/internal/template/flashbar/internal-interfaces.js +2 -0
- package/lib/internal/template/flashbar/internal-interfaces.js.map +1 -0
- package/lib/internal/template/flashbar/non-collapsible-flashbar.d.ts +1 -1
- package/lib/internal/template/flashbar/non-collapsible-flashbar.d.ts.map +1 -1
- package/lib/internal/template/flashbar/non-collapsible-flashbar.js.map +1 -1
- package/lib/internal/template/form-field/interfaces.d.ts +2 -15
- package/lib/internal/template/form-field/interfaces.d.ts.map +1 -1
- package/lib/internal/template/form-field/interfaces.js.map +1 -1
- package/lib/internal/template/form-field/internal-interfaces.d.ts +17 -0
- package/lib/internal/template/form-field/internal-interfaces.d.ts.map +1 -0
- package/lib/internal/template/form-field/internal-interfaces.js +2 -0
- package/lib/internal/template/form-field/internal-interfaces.js.map +1 -0
- package/lib/internal/template/form-field/internal.d.ts +1 -1
- package/lib/internal/template/form-field/internal.d.ts.map +1 -1
- package/lib/internal/template/form-field/internal.js.map +1 -1
- package/lib/internal/template/internal/base-component/styles.scoped.css +1 -1
- package/lib/internal/template/internal/components/menu-dropdown/interfaces.d.ts +1 -1
- package/lib/internal/template/internal/components/menu-dropdown/interfaces.d.ts.map +1 -1
- package/lib/internal/template/internal/components/menu-dropdown/interfaces.js.map +1 -1
- package/lib/internal/template/internal/environment.js +2 -2
- package/lib/internal/template/internal/environment.json +2 -2
- package/lib/internal/template/item-card/interfaces.d.ts +0 -19
- package/lib/internal/template/item-card/interfaces.d.ts.map +1 -1
- package/lib/internal/template/item-card/interfaces.js.map +1 -1
- package/lib/internal/template/item-card/internal-interfaces.d.ts +22 -0
- package/lib/internal/template/item-card/internal-interfaces.d.ts.map +1 -0
- package/lib/internal/template/item-card/internal-interfaces.js +2 -0
- package/lib/internal/template/item-card/internal-interfaces.js.map +1 -0
- package/lib/internal/template/item-card/internal.d.ts +1 -1
- package/lib/internal/template/item-card/internal.d.ts.map +1 -1
- package/lib/internal/template/item-card/internal.js.map +1 -1
- package/lib/internal/template/mixed-line-bar-chart/chart-container.d.ts +2 -1
- package/lib/internal/template/mixed-line-bar-chart/chart-container.d.ts.map +1 -1
- package/lib/internal/template/mixed-line-bar-chart/chart-container.js.map +1 -1
- package/lib/internal/template/mixed-line-bar-chart/chart-legend.d.ts +2 -1
- package/lib/internal/template/mixed-line-bar-chart/chart-legend.d.ts.map +1 -1
- package/lib/internal/template/mixed-line-bar-chart/chart-legend.js.map +1 -1
- package/lib/internal/template/mixed-line-bar-chart/data-series.d.ts +2 -1
- package/lib/internal/template/mixed-line-bar-chart/data-series.d.ts.map +1 -1
- package/lib/internal/template/mixed-line-bar-chart/data-series.js.map +1 -1
- package/lib/internal/template/mixed-line-bar-chart/domain.d.ts +2 -1
- package/lib/internal/template/mixed-line-bar-chart/domain.d.ts.map +1 -1
- package/lib/internal/template/mixed-line-bar-chart/domain.js.map +1 -1
- package/lib/internal/template/mixed-line-bar-chart/format-highlighted.d.ts +2 -1
- package/lib/internal/template/mixed-line-bar-chart/format-highlighted.d.ts.map +1 -1
- package/lib/internal/template/mixed-line-bar-chart/format-highlighted.js.map +1 -1
- package/lib/internal/template/mixed-line-bar-chart/interfaces.d.ts +0 -5
- package/lib/internal/template/mixed-line-bar-chart/interfaces.d.ts.map +1 -1
- package/lib/internal/template/mixed-line-bar-chart/interfaces.js.map +1 -1
- package/lib/internal/template/mixed-line-bar-chart/internal-interfaces.d.ts +7 -0
- package/lib/internal/template/mixed-line-bar-chart/internal-interfaces.d.ts.map +1 -0
- package/lib/internal/template/mixed-line-bar-chart/internal-interfaces.js +2 -0
- package/lib/internal/template/mixed-line-bar-chart/internal-interfaces.js.map +1 -0
- package/lib/internal/template/mixed-line-bar-chart/make-scaled-bar-groups.d.ts +2 -1
- package/lib/internal/template/mixed-line-bar-chart/make-scaled-bar-groups.d.ts.map +1 -1
- package/lib/internal/template/mixed-line-bar-chart/make-scaled-bar-groups.js.map +1 -1
- package/lib/internal/template/mixed-line-bar-chart/make-scaled-series.d.ts +2 -1
- package/lib/internal/template/mixed-line-bar-chart/make-scaled-series.d.ts.map +1 -1
- package/lib/internal/template/mixed-line-bar-chart/make-scaled-series.js.map +1 -1
- package/lib/internal/template/mixed-line-bar-chart/utils.d.ts +2 -1
- package/lib/internal/template/mixed-line-bar-chart/utils.d.ts.map +1 -1
- package/lib/internal/template/mixed-line-bar-chart/utils.js.map +1 -1
- package/lib/internal/template/navigable-group/interfaces.d.ts +0 -3
- package/lib/internal/template/navigable-group/interfaces.d.ts.map +1 -1
- package/lib/internal/template/navigable-group/interfaces.js.map +1 -1
- package/lib/internal/template/navigable-group/internal-interfaces.d.ts +5 -0
- package/lib/internal/template/navigable-group/internal-interfaces.d.ts.map +1 -0
- package/lib/internal/template/navigable-group/internal-interfaces.js +4 -0
- package/lib/internal/template/navigable-group/internal-interfaces.js.map +1 -0
- package/lib/internal/template/navigable-group/internal.d.ts +2 -1
- package/lib/internal/template/navigable-group/internal.d.ts.map +1 -1
- package/lib/internal/template/navigable-group/internal.js.map +1 -1
- package/lib/internal/template/popover/arrow.d.ts +1 -1
- package/lib/internal/template/popover/arrow.d.ts.map +1 -1
- package/lib/internal/template/popover/arrow.js.map +1 -1
- package/lib/internal/template/popover/container.d.ts +2 -1
- package/lib/internal/template/popover/container.d.ts.map +1 -1
- package/lib/internal/template/popover/container.js.map +1 -1
- package/lib/internal/template/popover/interfaces.d.ts +0 -4
- package/lib/internal/template/popover/interfaces.d.ts.map +1 -1
- package/lib/internal/template/popover/interfaces.js.map +1 -1
- package/lib/internal/template/popover/internal-interfaces.d.ts +5 -0
- package/lib/internal/template/popover/internal-interfaces.d.ts.map +1 -0
- package/lib/internal/template/popover/internal-interfaces.js +4 -0
- package/lib/internal/template/popover/internal-interfaces.js.map +1 -0
- package/lib/internal/template/popover/use-popover-position.d.ts +2 -1
- package/lib/internal/template/popover/use-popover-position.d.ts.map +1 -1
- package/lib/internal/template/popover/use-popover-position.js.map +1 -1
- package/lib/internal/template/popover/utils/positions.d.ts +2 -1
- package/lib/internal/template/popover/utils/positions.d.ts.map +1 -1
- package/lib/internal/template/popover/utils/positions.js.map +1 -1
- package/lib/internal/template/property-filter/controller.d.ts +2 -1
- package/lib/internal/template/property-filter/controller.d.ts.map +1 -1
- package/lib/internal/template/property-filter/controller.js.map +1 -1
- package/lib/internal/template/property-filter/i18n-utils.d.ts +2 -1
- package/lib/internal/template/property-filter/i18n-utils.d.ts.map +1 -1
- package/lib/internal/template/property-filter/i18n-utils.js.map +1 -1
- package/lib/internal/template/property-filter/interfaces.d.ts +1 -50
- package/lib/internal/template/property-filter/interfaces.d.ts.map +1 -1
- package/lib/internal/template/property-filter/interfaces.js.map +1 -1
- package/lib/internal/template/property-filter/internal-interfaces.d.ts +52 -0
- package/lib/internal/template/property-filter/internal-interfaces.d.ts.map +1 -0
- package/lib/internal/template/property-filter/internal-interfaces.js +4 -0
- package/lib/internal/template/property-filter/internal-interfaces.js.map +1 -0
- package/lib/internal/template/property-filter/internal.d.ts.map +1 -1
- package/lib/internal/template/property-filter/internal.js.map +1 -1
- package/lib/internal/template/property-filter/property-editor.d.ts +2 -1
- package/lib/internal/template/property-filter/property-editor.d.ts.map +1 -1
- package/lib/internal/template/property-filter/property-editor.js.map +1 -1
- package/lib/internal/template/property-filter/token-editor-inputs.d.ts +2 -1
- package/lib/internal/template/property-filter/token-editor-inputs.d.ts.map +1 -1
- package/lib/internal/template/property-filter/token-editor-inputs.js.map +1 -1
- package/lib/internal/template/property-filter/token-editor.d.ts +2 -1
- package/lib/internal/template/property-filter/token-editor.d.ts.map +1 -1
- package/lib/internal/template/property-filter/token-editor.js.map +1 -1
- package/lib/internal/template/property-filter/token.d.ts +2 -1
- package/lib/internal/template/property-filter/token.d.ts.map +1 -1
- package/lib/internal/template/property-filter/token.js.map +1 -1
- package/lib/internal/template/property-filter/utils.d.ts +2 -1
- package/lib/internal/template/property-filter/utils.d.ts.map +1 -1
- package/lib/internal/template/property-filter/utils.js.map +1 -1
- package/lib/internal/template/table/interfaces.d.ts +0 -1
- package/lib/internal/template/table/interfaces.d.ts.map +1 -1
- package/lib/internal/template/table/interfaces.js.map +1 -1
- package/lib/internal/template/table/internal-interfaces.d.ts +3 -0
- package/lib/internal/template/table/internal-interfaces.d.ts.map +1 -0
- package/lib/internal/template/table/internal-interfaces.js +2 -0
- package/lib/internal/template/table/internal-interfaces.js.map +1 -0
- package/lib/internal/template/table/selection/use-group-selection.d.ts +2 -1
- package/lib/internal/template/table/selection/use-group-selection.d.ts.map +1 -1
- package/lib/internal/template/table/selection/use-group-selection.js.map +1 -1
- package/lib/internal/template/table/selection/use-selection-focus-move.d.ts +1 -1
- package/lib/internal/template/table/selection/use-selection-focus-move.d.ts.map +1 -1
- package/lib/internal/template/table/selection/use-selection-focus-move.js.map +1 -1
- package/lib/internal/template/table/selection/use-selection.d.ts +2 -1
- package/lib/internal/template/table/selection/use-selection.d.ts.map +1 -1
- package/lib/internal/template/table/selection/use-selection.js.map +1 -1
- package/lib/internal/template/table/thead.d.ts +2 -1
- package/lib/internal/template/table/thead.d.ts.map +1 -1
- package/lib/internal/template/table/thead.js.map +1 -1
- package/lib/internal/template/table/use-table-focus-navigation.d.ts +2 -1
- package/lib/internal/template/table/use-table-focus-navigation.d.ts.map +1 -1
- package/lib/internal/template/table/use-table-focus-navigation.js.map +1 -1
- package/lib/internal/template/tooltip/interfaces.d.ts +0 -10
- package/lib/internal/template/tooltip/interfaces.d.ts.map +1 -1
- package/lib/internal/template/tooltip/interfaces.js.map +1 -1
- package/lib/internal/template/tooltip/internal-interfaces.d.ts +12 -0
- package/lib/internal/template/tooltip/internal-interfaces.d.ts.map +1 -0
- package/lib/internal/template/tooltip/internal-interfaces.js +2 -0
- package/lib/internal/template/tooltip/internal-interfaces.js.map +1 -0
- package/lib/internal/template/tooltip/internal.d.ts +1 -1
- package/lib/internal/template/tooltip/internal.d.ts.map +1 -1
- package/lib/internal/template/tooltip/internal.js.map +1 -1
- package/package.json +1 -1
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
|
|
6
6
|
@use '../internal/styles' as styles;
|
|
7
7
|
@use '../internal/styles/tokens' as awsui;
|
|
8
|
+
@use '../internal/styles/utils/theming' as theming;
|
|
8
9
|
@use './motion';
|
|
9
10
|
|
|
10
11
|
.root {
|
|
@@ -13,6 +14,10 @@
|
|
|
13
14
|
grid-template-rows: min-content;
|
|
14
15
|
gap: awsui.$space-grid-gutter;
|
|
15
16
|
align-items: start;
|
|
17
|
+
|
|
18
|
+
@include theming.one-theme-only {
|
|
19
|
+
gap: awsui.$space-scaled-s;
|
|
20
|
+
}
|
|
16
21
|
}
|
|
17
22
|
|
|
18
23
|
.empty {
|
|
@@ -14,9 +14,11 @@ $icon-width-normal: awsui.$size-icon-normal;
|
|
|
14
14
|
$icon-width-medium: awsui.$size-icon-medium;
|
|
15
15
|
$icon-margin-left: '(#{awsui.$line-height-body-m} - #{$icon-width-normal}) / -2';
|
|
16
16
|
$icon-margin-right-normal: '#{awsui.$space-xxs} + #{awsui.$border-divider-list-width}';
|
|
17
|
+
$icon-margin-right-small: calc(awsui.$space-xs - awsui.$space-xxxs);
|
|
17
18
|
$icon-margin-right-medium: awsui.$space-xs;
|
|
18
19
|
$icon-offset-inline: awsui.$space-xxs;
|
|
19
20
|
$icon-offset-block: awsui.$space-xxxs;
|
|
21
|
+
$icon-offset-container: 3px;
|
|
20
22
|
|
|
21
23
|
// Total space occupied by the expand icon on the left and its margins.
|
|
22
24
|
// Useful to keep elements correctly aligned.
|
|
@@ -57,16 +59,13 @@ $icon-total-space-medium: calc(#{$icon-width-medium} + #{$icon-margin-left} + #{
|
|
|
57
59
|
margin-inline-end: $icon-margin-right-medium;
|
|
58
60
|
@include theming.one-theme-only {
|
|
59
61
|
margin-inline-end: calc(#{$icon-margin-right-medium} + $icon-offset-inline);
|
|
60
|
-
inset-block-start: $icon-offset-
|
|
61
|
-
> .icon {
|
|
62
|
-
inset-block-start: calc(#{$icon-offset-block} * 3); // Double-check
|
|
63
|
-
}
|
|
62
|
+
inset-block-start: $icon-offset-container;
|
|
64
63
|
}
|
|
65
64
|
}
|
|
66
65
|
@include theming.one-theme-only {
|
|
67
66
|
display: inline-flex;
|
|
68
67
|
align-items: flex-start;
|
|
69
|
-
margin-inline
|
|
68
|
+
margin-inline: 0 $icon-margin-right-small;
|
|
70
69
|
> .icon {
|
|
71
70
|
inset-block-start: $icon-offset-block;
|
|
72
71
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { ButtonDropdownProps
|
|
1
|
+
import { ButtonDropdownProps } from '../../button-dropdown/interfaces';
|
|
2
|
+
import { InternalButtonDropdownProps } from '../../button-dropdown/internal-interfaces';
|
|
2
3
|
import { CancelableEventHandler } from '../../types/events';
|
|
3
4
|
import { AppLayoutProps } from '../interfaces';
|
|
4
5
|
type Drawer = AppLayoutProps.Drawer & {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"overflow-menu.d.ts","sourceRoot":"","sources":["../../../../src/app-layout/drawer/overflow-menu.tsx"],"names":[],"mappings":"AAIA,OAAO,
|
|
1
|
+
{"version":3,"file":"overflow-menu.d.ts","sourceRoot":"","sources":["../../../../src/app-layout/drawer/overflow-menu.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,mBAAmB,EAAE,MAAM,kCAAkC,CAAC;AAEvE,OAAO,EAAE,2BAA2B,EAAuB,MAAM,2CAA2C,CAAC;AAC7G,OAAO,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AAC5D,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAI/C,KAAK,MAAM,GAAG,cAAc,CAAC,MAAM,GAAG;IAAE,MAAM,CAAC,EAAE,OAAO,CAAA;CAAE,CAAC;AAE3D,UAAU,iBAAiB;IACzB,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IACrB,WAAW,EAAE,sBAAsB,CAAC,mBAAmB,CAAC,gBAAgB,CAAC,CAAC;IAC1E,oBAAoB,CAAC,EAAE,2BAA2B,CAAC,sBAAsB,CAAC,CAAC;IAC3E,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,uBAAuB,CAAC,EAAE,MAAM,CAAC;CAClC;AAYD,MAAM,CAAC,OAAO,UAAU,YAAY,CAAC,EACnC,KAAK,EAAE,OAAO,EACd,WAAW,EACX,oBAAoB,EACpB,SAAS,EACT,uBAAuB,GACxB,EAAE,iBAAiB,eA0BnB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"overflow-menu.js","sourceRoot":"","sources":["../../../../src/app-layout/drawer/overflow-menu.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"overflow-menu.js","sourceRoot":"","sources":["../../../../src/app-layout/drawer/overflow-menu.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,sBAAsB,MAAM,gCAAgC,CAAC;AAKpE,OAAO,cAAc,MAAM,+BAA+B,CAAC;AAY3D,MAAM,eAAe,GAAG,CAAC,MAAc,EAAE,cAAuB,EAAE,EAAE,CAAC,CAAC;IACpE,EAAE,EAAE,MAAM,CAAC,EAAE;IACb,IAAI,EAAE,MAAM,CAAC,UAAU,CAAC,UAAU;IAClC,QAAQ,EAAE,MAAM,CAAC,OAAQ,CAAC,QAAQ;IAClC,OAAO,EAAE,MAAM,CAAC,OAAQ,CAAC,OAAO;IAChC,KAAK,EAAE,MAAM,CAAC,KAAK;IACnB,QAAQ,EAAE,cAAc,CAAC,CAAC,CAAE,UAA2C,CAAC,CAAC,CAAC,SAAS;IACnF,OAAO,EAAE,MAAM,CAAC,MAAM;CACvB,CAAC,CAAC;AAEH,MAAM,CAAC,OAAO,UAAU,YAAY,CAAC,EACnC,KAAK,EAAE,OAAO,EACd,WAAW,EACX,oBAAoB,EACpB,SAAS,EACT,uBAAuB,GACL;IAClB,MAAM,gBAAgB,GAAG,uBAAuB,KAAK,SAAS,CAAC;IAC/D,MAAM,aAAa,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CAChD,eAAe,CAAC,IAAI,EAAE,gBAAgB,IAAI,KAAK,IAAI,uBAAuB,CAAC,CAC5E,CAAC;IACF,IAAI,KAAyC,CAAC;IAC9C,IAAI,gBAAgB,EAAE,CAAC;QACrB,KAAK,GAAG;YACN,EAAE,KAAK,EAAE,aAAa,CAAC,KAAK,CAAC,CAAC,EAAE,uBAAuB,CAAC,EAAE;YAC1D,EAAE,KAAK,EAAE,aAAa,CAAC,KAAK,CAAC,uBAAuB,CAAC,EAAE;SACxD,CAAC;IACJ,CAAC;SAAM,CAAC;QACN,KAAK,GAAG,aAAa,CAAC;IACxB,CAAC;IAED,OAAO,CACL,oBAAC,sBAAsB,IACrB,KAAK,EAAE,KAAK,EACZ,SAAS,EAAE,cAAc,CAAC,eAAe,CAAC,EAC1C,WAAW,EAAE,WAAW,EACxB,SAAS,EAAE,SAAS,EACpB,OAAO,EAAC,MAAM,EACd,oBAAoB,EAAE,oBAAoB,EAC1C,gBAAgB,EAAE,IAAI,GACtB,CACH,CAAC;AACJ,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\n\nimport { ButtonDropdownProps } from '../../button-dropdown/interfaces';\nimport InternalButtonDropdown from '../../button-dropdown/internal';\nimport { InternalButtonDropdownProps, InternalItemOrGroup } from '../../button-dropdown/internal-interfaces';\nimport { CancelableEventHandler } from '../../types/events';\nimport { AppLayoutProps } from '../interfaces';\n\nimport testutilStyles from '../test-classes/styles.css.js';\n\ntype Drawer = AppLayoutProps.Drawer & { active?: boolean };\n\ninterface OverflowMenuProps {\n items: Array<Drawer>;\n onItemClick: CancelableEventHandler<ButtonDropdownProps.ItemClickDetails>;\n customTriggerBuilder?: InternalButtonDropdownProps['customTriggerBuilder'];\n ariaLabel?: string;\n globalDrawersStartIndex?: number;\n}\n\nconst mapDrawerToItem = (drawer: Drawer, isTypeCheckbox: boolean) => ({\n id: drawer.id,\n text: drawer.ariaLabels.drawerName,\n iconName: drawer.trigger!.iconName,\n iconSvg: drawer.trigger!.iconSvg,\n badge: drawer.badge,\n itemType: isTypeCheckbox ? ('checkbox' as ButtonDropdownProps.ItemType) : undefined,\n checked: drawer.active,\n});\n\nexport default function OverflowMenu({\n items: drawers,\n onItemClick,\n customTriggerBuilder,\n ariaLabel,\n globalDrawersStartIndex,\n}: OverflowMenuProps) {\n const hasGlobalDrawers = globalDrawersStartIndex !== undefined;\n const itemsFlatList = drawers.map((item, index) =>\n mapDrawerToItem(item, hasGlobalDrawers && index >= globalDrawersStartIndex)\n );\n let items: ReadonlyArray<InternalItemOrGroup>;\n if (hasGlobalDrawers) {\n items = [\n { items: itemsFlatList.slice(0, globalDrawersStartIndex) },\n { items: itemsFlatList.slice(globalDrawersStartIndex) },\n ];\n } else {\n items = itemsFlatList;\n }\n\n return (\n <InternalButtonDropdown\n items={items}\n className={testutilStyles['overflow-menu']}\n onItemClick={onItemClick}\n ariaLabel={ariaLabel}\n variant=\"icon\"\n customTriggerBuilder={customTriggerBuilder}\n expandToViewport={true}\n />\n );\n}\n"]}
|
package/lib/internal/template/app-layout/visual-refresh-toolbar/drawer/global-ai-drawer.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"global-ai-drawer.js","sourceRoot":"","sources":["../../../../../src/app-layout/visual-refresh-toolbar/drawer/global-ai-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;AAGxB,OAAO,WAAW,MAAM,gCAAgC,CAAC;AACzD,OAAO,EAAE,6BAA6B,EAAE,MAAM,kCAAkC,CAAC;AACjF,OAAO,i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G,EAAE,CAAC,mBAAmB,CAAC,IAAI,CAAC,gBAC5B,MAAA,cAAc,aAAd,cAAc,uBAAd,cAAc,CAAE,UAAU,0CAAE,sBAAsB,IAE7D,MAAA,cAAc,aAAd,cAAc,uBAAd,cAAc,CAAE,UAAU,0CAAE,sBAAsB,CAC5C,CACV,CACG,CACF,CACP,CACM;4BACT,oBAAC,6BAA6B;gCAC5B,6BAAK,SAAS,EAAE,MAAM,CAAC,wBAAwB,CAAC,IAAG,cAAc,aAAd,cAAc,uBAAd,cAAc,CAAE,OAAO,CAAO,CACnD,CAC5B,CACF,CACA,CACT,CAAC;YACJ,CAAC,CACU,CACd,CAAC;QACJ,CAAC,CACU,CACiB,CACjC,CAAC;AACJ,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 { InternalItemOrGroup } from '../../../button-group/interfaces';\nimport ButtonGroup from '../../../button-group/internal';\nimport { AppLayoutBuiltInErrorBoundary } from '../../../error-boundary/internal';\nimport PanelResizeHandle from '../../../internal/components/panel-resize-handle';\nimport customCssProps from '../../../internal/generated/custom-css-properties';\nimport { usePrevious } from '../../../internal/hooks/use-previous';\nimport { getLimitedValue } from '../../../split-panel/utils/size-utils';\nimport { AppLayoutProps } from '../../interfaces';\nimport { FocusControlState } from '../../utils/use-focus-control';\nimport { AppLayoutInternals, InternalDrawer } from '../interfaces';\nimport { OnChangeParams } from '../state/use-ai-drawer';\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 AIDrawerProps {\n activeAiDrawerSize: number;\n minAiDrawerSize: number;\n aiDrawer: AppLayoutProps.Drawer | undefined;\n maxAiDrawerSize: number;\n ariaLabels: any;\n aiDrawerFocusControl: FocusControlState | undefined;\n isMobile: boolean;\n drawersOpenQueue: ReadonlyArray<string> | undefined;\n onActiveAiDrawerChange: undefined | ((newDrawerId: string | null, params?: OnChangeParams) => void);\n onActiveDrawerResize: (detail: { id: string; size: number }) => void;\n expandedDrawerId?: string | null;\n setExpandedDrawerId: (value: string | null) => void;\n}\n\ninterface AppLayoutGlobalAiDrawerImplementationProps {\n appLayoutInternals: AppLayoutInternals;\n show: boolean;\n activeAiDrawer:\n | (InternalDrawer & {\n exitExpandedModeTrigger?: {\n customIcon?: React.ReactNode;\n };\n })\n | null;\n aiDrawerProps: AIDrawerProps;\n}\n\nexport function AppLayoutGlobalAiDrawerImplementation({\n appLayoutInternals,\n show,\n activeAiDrawer,\n aiDrawerProps,\n}: AppLayoutGlobalAiDrawerImplementationProps) {\n const {\n activeAiDrawerSize,\n minAiDrawerSize,\n maxAiDrawerSize,\n ariaLabels,\n aiDrawerFocusControl,\n isMobile,\n drawersOpenQueue,\n onActiveAiDrawerChange,\n onActiveDrawerResize,\n expandedDrawerId,\n setExpandedDrawerId,\n } = aiDrawerProps;\n const { verticalOffsets, placement, drawerAnimationDisabled } = appLayoutInternals;\n const drawerRef = useRef<HTMLDivElement>(null);\n const activeDrawerId = activeAiDrawer?.id;\n\n const computedAriaLabels = {\n closeButton: activeAiDrawer ? activeAiDrawer.ariaLabels?.closeButton : ariaLabels?.toolsClose,\n content: activeAiDrawer ? activeAiDrawer.ariaLabels?.drawerName : ariaLabels?.tools,\n };\n\n const resizeProps = useResize({\n currentWidth: activeAiDrawerSize,\n minWidth: minAiDrawerSize,\n maxWidth: maxAiDrawerSize,\n panelRef: drawerRef,\n handleRef: aiDrawerFocusControl!.refs.slider,\n onResize: size => {\n onActiveDrawerResize({ id: activeDrawerId!, size });\n },\n position: 'side-start',\n });\n const size = getLimitedValue(minAiDrawerSize, activeAiDrawerSize, maxAiDrawerSize);\n const isExpanded = activeAiDrawer?.isExpandable && expandedDrawerId === activeDrawerId;\n const wasExpanded = usePrevious(isExpanded);\n const animationDisabled =\n drawerAnimationDisabled ||\n (activeAiDrawer?.defaultActive && !drawersOpenQueue?.includes(activeAiDrawer.id)) ||\n (wasExpanded && !isExpanded);\n const drawerHeight = `calc(100vh - ${verticalOffsets.toolbar + placement.insetBlockEnd}px)`;\n // disable resizing when the drawer is at its minimum width in a \"squeezed\" state\n // (window is between mobile and desktop sizes). At this point, the drawer can't be\n // resized in either direction, so we disable the resize handler\n const isResizingDisabled = maxAiDrawerSize < activeAiDrawerSize;\n let drawerActions: ReadonlyArray<InternalItemOrGroup> = [\n {\n type: 'icon-button',\n id: 'close',\n iconName: isMobile ? 'close' : 'angle-left',\n text: computedAriaLabels.closeButton,\n analyticsAction: 'close',\n },\n ];\n if (!isMobile && activeAiDrawer?.isExpandable) {\n drawerActions = [\n {\n type: 'icon-button',\n id: 'expand',\n iconName: isExpanded ? 'shrink' : 'expand',\n text: activeAiDrawer?.ariaLabels?.expandedModeButton ?? '',\n analyticsAction: isExpanded ? 'expand' : 'collapse',\n },\n ...drawerActions,\n ];\n }\n if (activeAiDrawer?.headerActions) {\n drawerActions = [\n {\n type: 'group',\n text: 'Actions',\n items: activeAiDrawer.headerActions!,\n },\n ...drawerActions,\n ];\n }\n\n return (\n <AppLayoutBuiltInErrorBoundary>\n <Transition nodeRef={drawerRef} in={show} appear={show} mountOnEnter={true} timeout={250}>\n {drawerTransitionState => {\n return (\n <Transition nodeRef={drawerRef} in={isExpanded} timeout={250}>\n {expandedTransitionState => {\n return (\n <aside\n id={activeAiDrawer?.id}\n aria-hidden={!activeAiDrawer}\n aria-label={computedAriaLabels.content}\n className={clsx(\n styles.drawer,\n styles['ai-drawer'],\n !animationDisabled && isExpanded && styles['with-expanded-motion'],\n {\n [sharedStyles['with-motion-horizontal']]: !animationDisabled,\n [testutilStyles['active-drawer']]: show,\n [styles['drawer-hidden']]: !show && drawerTransitionState === 'exited',\n [testutilStyles['drawer-closed']]: !activeAiDrawer,\n [styles['drawer-expanded']]: isExpanded,\n }\n )}\n ref={drawerRef}\n onBlur={e => {\n if (!e.relatedTarget || !e.currentTarget.contains(e.relatedTarget)) {\n aiDrawerFocusControl?.loseFocus();\n }\n }}\n style={{\n blockSize: drawerHeight,\n insetBlockStart: `${placement.insetBlockStart}px`,\n ...(!isMobile && {\n [customCssProps.drawerMinSize]: `${size}px`,\n [customCssProps.drawerSize]: `${['entering', 'entered'].includes(drawerTransitionState) ? size : 0}px`,\n }),\n }}\n data-testid={activeDrawerId && `awsui-app-layout-drawer-${activeDrawerId}`}\n >\n {!isMobile &&\n activeAiDrawer?.resizable &&\n (!isExpanded || expandedTransitionState !== 'entered') && (\n <div className={styles['drawer-slider']}>\n <PanelResizeHandle\n ref={aiDrawerFocusControl?.refs.slider}\n position=\"side-start\"\n className={clsx(testutilStyles['drawers-slider'], styles['ai-drawer-slider-handle'])}\n ariaLabel={activeAiDrawer?.ariaLabels?.resizeHandle}\n tooltipText={activeAiDrawer?.ariaLabels?.resizeHandleTooltipText}\n ariaValuenow={resizeProps.relativeSize}\n onKeyDown={resizeProps.onKeyDown}\n onPointerDown={resizeProps.onPointerDown}\n onDirectionClick={resizeProps.onDirectionClick}\n disabled={isResizingDisabled}\n />\n </div>\n )}\n <div className={clsx(styles['drawer-content-container'], sharedStyles['with-motion-horizontal'])}>\n <div className={styles['drawer-content']}>\n <header className={styles['drawer-content-header']}>\n <div className={styles['drawer-content-header-content']}>\n <AppLayoutBuiltInErrorBoundary renderFallback={() => <div />}>\n {activeAiDrawer?.header ?? <div />}\n </AppLayoutBuiltInErrorBoundary>\n <div className={styles['drawer-actions']}>\n <ButtonGroup\n dropdownExpandToViewport={false}\n variant=\"icon\"\n onItemClick={event => {\n switch (event.detail.id) {\n case 'close':\n onActiveAiDrawerChange?.(null, { initiatedByUserAction: true });\n break;\n case 'expand':\n setExpandedDrawerId(isExpanded ? null : activeDrawerId!);\n break;\n default:\n activeAiDrawer?.onHeaderActionClick?.(event);\n }\n }}\n ariaLabel=\"Left panel actions\"\n items={drawerActions}\n />\n </div>\n </div>\n {!isMobile && isExpanded && activeAiDrawer?.ariaLabels?.exitExpandedModeButton && (\n <div className={styles['drawer-back-to-console-slot']}>\n <div className={styles['drawer-back-to-console-button-wrapper']}>\n {activeAiDrawer?.exitExpandedModeTrigger?.customIcon ? (\n <button\n className={clsx(\n testutilStyles['active-ai-drawer-leave-expanded-mode-custom-button'],\n styles['drawer-back-to-console-custom-button']\n )}\n formAction=\"none\"\n onClick={() => setExpandedDrawerId(null)}\n aria-label={activeAiDrawer?.ariaLabels?.exitExpandedModeButton}\n >\n {activeAiDrawer?.exitExpandedModeTrigger?.customIcon}\n </button>\n ) : (\n <button\n className={clsx(\n testutilStyles['active-ai-drawer-leave-expanded-mode-custom-button'],\n styles['drawer-back-to-console-button']\n )}\n formAction=\"none\"\n onClick={() => setExpandedDrawerId(null)}\n aria-label={activeAiDrawer?.ariaLabels?.exitExpandedModeButton}\n >\n {activeAiDrawer?.ariaLabels?.exitExpandedModeButton}\n </button>\n )}\n </div>\n </div>\n )}\n </header>\n <AppLayoutBuiltInErrorBoundary>\n <div className={styles['drawer-content-content']}>{activeAiDrawer?.content}</div>\n </AppLayoutBuiltInErrorBoundary>\n </div>\n </div>\n </aside>\n );\n }}\n </Transition>\n );\n }}\n </Transition>\n </AppLayoutBuiltInErrorBoundary>\n );\n}\n"]}
|
|
1
|
+
{"version":3,"file":"global-ai-drawer.js","sourceRoot":"","sources":["../../../../../src/app-layout/visual-refresh-toolbar/drawer/global-ai-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,WAAW,MAAM,gCAAgC,CAAC;AAEzD,OAAO,EAAE,6BAA6B,EAAE,MAAM,kCAAkC,CAAC;AACjF,OAAO,iBAAiB,MAAM,kDAAkD,C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CAAC,IAAI,CAAC,gBAC5B,MAAA,cAAc,aAAd,cAAc,uBAAd,cAAc,CAAE,UAAU,0CAAE,sBAAsB,IAE7D,MAAA,cAAc,aAAd,cAAc,uBAAd,cAAc,CAAE,UAAU,0CAAE,sBAAsB,CAC5C,CACV,CACG,CACF,CACP,CACM;4BACT,oBAAC,6BAA6B;gCAC5B,6BAAK,SAAS,EAAE,MAAM,CAAC,wBAAwB,CAAC,IAAG,cAAc,aAAd,cAAc,uBAAd,cAAc,CAAE,OAAO,CAAO,CACnD,CAC5B,CACF,CACA,CACT,CAAC;YACJ,CAAC,CACU,CACd,CAAC;QACJ,CAAC,CACU,CACiB,CACjC,CAAC;AACJ,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 ButtonGroup from '../../../button-group/internal';\nimport { InternalItemOrGroup } from '../../../button-group/internal-interfaces';\nimport { AppLayoutBuiltInErrorBoundary } from '../../../error-boundary/internal';\nimport PanelResizeHandle from '../../../internal/components/panel-resize-handle';\nimport customCssProps from '../../../internal/generated/custom-css-properties';\nimport { usePrevious } from '../../../internal/hooks/use-previous';\nimport { getLimitedValue } from '../../../split-panel/utils/size-utils';\nimport { AppLayoutProps } from '../../interfaces';\nimport { FocusControlState } from '../../utils/use-focus-control';\nimport { AppLayoutInternals, InternalDrawer } from '../interfaces';\nimport { OnChangeParams } from '../state/use-ai-drawer';\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 AIDrawerProps {\n activeAiDrawerSize: number;\n minAiDrawerSize: number;\n aiDrawer: AppLayoutProps.Drawer | undefined;\n maxAiDrawerSize: number;\n ariaLabels: any;\n aiDrawerFocusControl: FocusControlState | undefined;\n isMobile: boolean;\n drawersOpenQueue: ReadonlyArray<string> | undefined;\n onActiveAiDrawerChange: undefined | ((newDrawerId: string | null, params?: OnChangeParams) => void);\n onActiveDrawerResize: (detail: { id: string; size: number }) => void;\n expandedDrawerId?: string | null;\n setExpandedDrawerId: (value: string | null) => void;\n}\n\ninterface AppLayoutGlobalAiDrawerImplementationProps {\n appLayoutInternals: AppLayoutInternals;\n show: boolean;\n activeAiDrawer:\n | (InternalDrawer & {\n exitExpandedModeTrigger?: {\n customIcon?: React.ReactNode;\n };\n })\n | null;\n aiDrawerProps: AIDrawerProps;\n}\n\nexport function AppLayoutGlobalAiDrawerImplementation({\n appLayoutInternals,\n show,\n activeAiDrawer,\n aiDrawerProps,\n}: AppLayoutGlobalAiDrawerImplementationProps) {\n const {\n activeAiDrawerSize,\n minAiDrawerSize,\n maxAiDrawerSize,\n ariaLabels,\n aiDrawerFocusControl,\n isMobile,\n drawersOpenQueue,\n onActiveAiDrawerChange,\n onActiveDrawerResize,\n expandedDrawerId,\n setExpandedDrawerId,\n } = aiDrawerProps;\n const { verticalOffsets, placement, drawerAnimationDisabled } = appLayoutInternals;\n const drawerRef = useRef<HTMLDivElement>(null);\n const activeDrawerId = activeAiDrawer?.id;\n\n const computedAriaLabels = {\n closeButton: activeAiDrawer ? activeAiDrawer.ariaLabels?.closeButton : ariaLabels?.toolsClose,\n content: activeAiDrawer ? activeAiDrawer.ariaLabels?.drawerName : ariaLabels?.tools,\n };\n\n const resizeProps = useResize({\n currentWidth: activeAiDrawerSize,\n minWidth: minAiDrawerSize,\n maxWidth: maxAiDrawerSize,\n panelRef: drawerRef,\n handleRef: aiDrawerFocusControl!.refs.slider,\n onResize: size => {\n onActiveDrawerResize({ id: activeDrawerId!, size });\n },\n position: 'side-start',\n });\n const size = getLimitedValue(minAiDrawerSize, activeAiDrawerSize, maxAiDrawerSize);\n const isExpanded = activeAiDrawer?.isExpandable && expandedDrawerId === activeDrawerId;\n const wasExpanded = usePrevious(isExpanded);\n const animationDisabled =\n drawerAnimationDisabled ||\n (activeAiDrawer?.defaultActive && !drawersOpenQueue?.includes(activeAiDrawer.id)) ||\n (wasExpanded && !isExpanded);\n const drawerHeight = `calc(100vh - ${verticalOffsets.toolbar + placement.insetBlockEnd}px)`;\n // disable resizing when the drawer is at its minimum width in a \"squeezed\" state\n // (window is between mobile and desktop sizes). At this point, the drawer can't be\n // resized in either direction, so we disable the resize handler\n const isResizingDisabled = maxAiDrawerSize < activeAiDrawerSize;\n let drawerActions: ReadonlyArray<InternalItemOrGroup> = [\n {\n type: 'icon-button',\n id: 'close',\n iconName: isMobile ? 'close' : 'angle-left',\n text: computedAriaLabels.closeButton,\n analyticsAction: 'close',\n },\n ];\n if (!isMobile && activeAiDrawer?.isExpandable) {\n drawerActions = [\n {\n type: 'icon-button',\n id: 'expand',\n iconName: isExpanded ? 'shrink' : 'expand',\n text: activeAiDrawer?.ariaLabels?.expandedModeButton ?? '',\n analyticsAction: isExpanded ? 'expand' : 'collapse',\n },\n ...drawerActions,\n ];\n }\n if (activeAiDrawer?.headerActions) {\n drawerActions = [\n {\n type: 'group',\n text: 'Actions',\n items: activeAiDrawer.headerActions!,\n },\n ...drawerActions,\n ];\n }\n\n return (\n <AppLayoutBuiltInErrorBoundary>\n <Transition nodeRef={drawerRef} in={show} appear={show} mountOnEnter={true} timeout={250}>\n {drawerTransitionState => {\n return (\n <Transition nodeRef={drawerRef} in={isExpanded} timeout={250}>\n {expandedTransitionState => {\n return (\n <aside\n id={activeAiDrawer?.id}\n aria-hidden={!activeAiDrawer}\n aria-label={computedAriaLabels.content}\n className={clsx(\n styles.drawer,\n styles['ai-drawer'],\n !animationDisabled && isExpanded && styles['with-expanded-motion'],\n {\n [sharedStyles['with-motion-horizontal']]: !animationDisabled,\n [testutilStyles['active-drawer']]: show,\n [styles['drawer-hidden']]: !show && drawerTransitionState === 'exited',\n [testutilStyles['drawer-closed']]: !activeAiDrawer,\n [styles['drawer-expanded']]: isExpanded,\n }\n )}\n ref={drawerRef}\n onBlur={e => {\n if (!e.relatedTarget || !e.currentTarget.contains(e.relatedTarget)) {\n aiDrawerFocusControl?.loseFocus();\n }\n }}\n style={{\n blockSize: drawerHeight,\n insetBlockStart: `${placement.insetBlockStart}px`,\n ...(!isMobile && {\n [customCssProps.drawerMinSize]: `${size}px`,\n [customCssProps.drawerSize]: `${['entering', 'entered'].includes(drawerTransitionState) ? size : 0}px`,\n }),\n }}\n data-testid={activeDrawerId && `awsui-app-layout-drawer-${activeDrawerId}`}\n >\n {!isMobile &&\n activeAiDrawer?.resizable &&\n (!isExpanded || expandedTransitionState !== 'entered') && (\n <div className={styles['drawer-slider']}>\n <PanelResizeHandle\n ref={aiDrawerFocusControl?.refs.slider}\n position=\"side-start\"\n className={clsx(testutilStyles['drawers-slider'], styles['ai-drawer-slider-handle'])}\n ariaLabel={activeAiDrawer?.ariaLabels?.resizeHandle}\n tooltipText={activeAiDrawer?.ariaLabels?.resizeHandleTooltipText}\n ariaValuenow={resizeProps.relativeSize}\n onKeyDown={resizeProps.onKeyDown}\n onPointerDown={resizeProps.onPointerDown}\n onDirectionClick={resizeProps.onDirectionClick}\n disabled={isResizingDisabled}\n />\n </div>\n )}\n <div className={clsx(styles['drawer-content-container'], sharedStyles['with-motion-horizontal'])}>\n <div className={styles['drawer-content']}>\n <header className={styles['drawer-content-header']}>\n <div className={styles['drawer-content-header-content']}>\n <AppLayoutBuiltInErrorBoundary renderFallback={() => <div />}>\n {activeAiDrawer?.header ?? <div />}\n </AppLayoutBuiltInErrorBoundary>\n <div className={styles['drawer-actions']}>\n <ButtonGroup\n dropdownExpandToViewport={false}\n variant=\"icon\"\n onItemClick={event => {\n switch (event.detail.id) {\n case 'close':\n onActiveAiDrawerChange?.(null, { initiatedByUserAction: true });\n break;\n case 'expand':\n setExpandedDrawerId(isExpanded ? null : activeDrawerId!);\n break;\n default:\n activeAiDrawer?.onHeaderActionClick?.(event);\n }\n }}\n ariaLabel=\"Left panel actions\"\n items={drawerActions}\n />\n </div>\n </div>\n {!isMobile && isExpanded && activeAiDrawer?.ariaLabels?.exitExpandedModeButton && (\n <div className={styles['drawer-back-to-console-slot']}>\n <div className={styles['drawer-back-to-console-button-wrapper']}>\n {activeAiDrawer?.exitExpandedModeTrigger?.customIcon ? (\n <button\n className={clsx(\n testutilStyles['active-ai-drawer-leave-expanded-mode-custom-button'],\n styles['drawer-back-to-console-custom-button']\n )}\n formAction=\"none\"\n onClick={() => setExpandedDrawerId(null)}\n aria-label={activeAiDrawer?.ariaLabels?.exitExpandedModeButton}\n >\n {activeAiDrawer?.exitExpandedModeTrigger?.customIcon}\n </button>\n ) : (\n <button\n className={clsx(\n testutilStyles['active-ai-drawer-leave-expanded-mode-custom-button'],\n styles['drawer-back-to-console-button']\n )}\n formAction=\"none\"\n onClick={() => setExpandedDrawerId(null)}\n aria-label={activeAiDrawer?.ariaLabels?.exitExpandedModeButton}\n >\n {activeAiDrawer?.ariaLabels?.exitExpandedModeButton}\n </button>\n )}\n </div>\n </div>\n )}\n </header>\n <AppLayoutBuiltInErrorBoundary>\n <div className={styles['drawer-content-content']}>{activeAiDrawer?.content}</div>\n </AppLayoutBuiltInErrorBoundary>\n </div>\n </div>\n </aside>\n );\n }}\n </Transition>\n );\n }}\n </Transition>\n </AppLayoutBuiltInErrorBoundary>\n );\n}\n"]}
|
package/lib/internal/template/app-layout/visual-refresh-toolbar/drawer/global-bottom-drawer.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"global-bottom-drawer.js","sourceRoot":"","sources":["../../../../../src/app-layout/visual-refresh-toolbar/drawer/global-bottom-drawer.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AACjD,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACpD,OAAO,IAAI,MAAM,MAAM,CAAC;AAGxB,OAAO,WAAW,MAAM,gCAAgC,CAAC;AACzD,OAAO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AI,CAAC,CAAC,IAAI;6BACjG,IAEA,YAAY,aAAZ,YAAY,uBAAZ,YAAY,CAAE,OAAO,CAClB,CACF,CACF,CACA,CACT,CAAC;QACJ,CAAC,CACU,CACiB,CACjC,CAAC;AACJ,CAAC;AAED,eAAe,yCAAyC,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useEffect, useRef } from 'react';\nimport { Transition } from 'react-transition-group';\nimport clsx from 'clsx';\n\nimport { InternalItemOrGroup } from '../../../button-group/interfaces';\nimport ButtonGroup from '../../../button-group/internal';\nimport { AppLayoutBuiltInErrorBoundary } from '../../../error-boundary/internal';\nimport PanelResizeHandle from '../../../internal/components/panel-resize-handle';\nimport customCssProps from '../../../internal/generated/custom-css-properties';\nimport { usePrevious } from '../../../internal/hooks/use-previous';\nimport { getLimitedValue } from '../../../split-panel/utils/size-utils';\nimport { Focusable } from '../../utils/use-focus-control';\nimport { getDrawerStyles } from '../compute-layout';\nimport { AppLayoutWidgetizedState, 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';\nexport function AppLayoutBottomDrawerWrapper({ widgetizedState }: { widgetizedState: AppLayoutWidgetizedState }) {\n const { activeGlobalBottomDrawerId, bottomDrawers } = widgetizedState;\n const openBottomDrawersHistory = useRef<Set<string>>(new Set());\n useEffect(() => {\n if (activeGlobalBottomDrawerId) {\n openBottomDrawersHistory.current.add(activeGlobalBottomDrawerId);\n }\n }, [activeGlobalBottomDrawerId]);\n\n return (\n <>\n {bottomDrawers.map(drawer => {\n return (\n <AppLayoutGlobalBottomDrawerImplementation\n key={drawer.id}\n activeDrawer={\n activeGlobalBottomDrawerId === drawer.id ||\n (drawer.preserveInactiveContent && openBottomDrawersHistory.current.has(drawer.id))\n ? drawer\n : undefined\n }\n show={activeGlobalBottomDrawerId === drawer.id}\n widgetizedState={widgetizedState}\n />\n );\n })}\n </>\n );\n}\n\ninterface AppLayoutGlobalDrawerImplementationProps {\n widgetizedState: AppLayoutWidgetizedState;\n show: boolean;\n activeDrawer: InternalDrawer | undefined;\n}\n\nconst GAP_HEIGHT = 10;\nconst RESIZE_HANDLER_HEIGHT = 18;\n\nfunction AppLayoutGlobalBottomDrawerImplementation({\n widgetizedState,\n show,\n activeDrawer,\n}: AppLayoutGlobalDrawerImplementationProps) {\n const {\n ariaLabels,\n isMobile,\n onActiveGlobalBottomDrawerChange,\n onActiveBottomDrawerResize,\n minGlobalBottomDrawerSize,\n activeGlobalBottomDrawerSize,\n drawersOpenQueue,\n expandedDrawerId,\n setExpandedDrawerId,\n activeAiDrawer,\n bottomDrawersFocusControl,\n getMaxGlobalBottomDrawerHeight,\n reportBottomDrawerSize,\n verticalOffsets,\n placement,\n drawerAnimationDisabled,\n } = widgetizedState;\n const drawerRef = useRef<HTMLDivElement>(null);\n const headerRef = useRef<HTMLHeadingElement>(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: mobileDrawerTopOffset, drawerHeight: drawerFullScreenHeight } = getDrawerStyles(\n verticalOffsets,\n isMobile,\n placement\n );\n const activeDrawerSize = activeGlobalBottomDrawerSize ?? 0;\n const minDrawerSize = minGlobalBottomDrawerSize ?? 0;\n const maxDrawerSize = getMaxGlobalBottomDrawerHeight();\n const refs = bottomDrawersFocusControl.refs;\n const resizeProps = useResize({\n currentWidth: activeDrawerSize,\n minWidth: minDrawerSize,\n maxWidth: maxDrawerSize,\n panelRef: drawerRef,\n handleRef: refs?.slider,\n onResize: size => onActiveBottomDrawerResize({ id: activeDrawerId!, size }),\n position: 'bottom',\n });\n const size = getLimitedValue(minDrawerSize, activeDrawerSize, maxDrawerSize);\n const lastOpenedDrawerId = drawersOpenQueue.length ? drawersOpenQueue[0] : null;\n const hasTriggerButton = !!activeDrawer?.trigger;\n const isExpanded = activeDrawer?.isExpandable && expandedDrawerId === activeDrawerId;\n const wasExpanded = usePrevious(isExpanded);\n const animationDisabled =\n drawerAnimationDisabled ||\n (activeDrawer?.defaultActive && !drawersOpenQueue.includes(activeDrawer.id)) ||\n (wasExpanded && !isExpanded);\n\n // Prevent main content scroll when bottom drawer opens with animations\n useEffect(() => {\n if (show && drawerRef.current) {\n const scrollTop = document.documentElement.scrollTop || document.body.scrollTop;\n const abortController = new AbortController();\n\n // Temporarily prevent scrolling during animation\n const preventScroll = () => {\n document.documentElement.scrollTop = scrollTop;\n document.body.scrollTop = scrollTop;\n };\n\n // Handle transition end to remove scroll prevention\n const handleTransitionEnd = (event: TransitionEvent) => {\n // Only handle transitions on the drawer element itself\n if (event.target === drawerRef.current) {\n abortController.abort();\n }\n };\n\n // Add scroll prevention during animation\n document.addEventListener('scroll', preventScroll, {\n passive: false,\n signal: abortController.signal,\n });\n\n drawerRef.current.addEventListener('transitionend', handleTransitionEnd, {\n signal: abortController.signal,\n });\n\n return () => {\n abortController.abort();\n };\n }\n }, [show]);\n\n let drawerActions: ReadonlyArray<InternalItemOrGroup> = [\n {\n type: 'icon-button',\n id: 'close',\n iconName: isMobile ? 'close' : 'angle-down',\n text: computedAriaLabels.closeButton ?? '',\n analyticsAction: 'close',\n },\n ];\n if (!isMobile && activeDrawer?.isExpandable) {\n drawerActions = [\n {\n type: 'icon-toggle-button',\n id: 'expand',\n iconName: isExpanded ? 'shrink' : 'expand',\n text: activeDrawer?.ariaLabels?.expandedModeButton ?? '',\n pressed: !!isExpanded,\n analyticsAction: isExpanded ? 'expand' : 'collapse',\n },\n ...drawerActions,\n ];\n }\n if (activeDrawer?.headerActions) {\n drawerActions = [\n {\n type: 'group',\n text: 'Actions',\n items: activeDrawer.headerActions!,\n },\n ...drawerActions,\n ];\n }\n\n useEffect(() => {\n reportBottomDrawerSize(size);\n }, [reportBottomDrawerSize, size]);\n\n return (\n <AppLayoutBuiltInErrorBoundary>\n <Transition\n nodeRef={drawerRef}\n in={show || isExpanded}\n appear={show || isExpanded}\n mountOnEnter={true}\n timeout={250}\n >\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['bottom-drawer'],\n styles[state],\n !animationDisabled && sharedStyles['with-motion-vertical'],\n !animationDisabled && isExpanded && styles['with-expanded-motion'],\n {\n [styles['drawer-hidden']]: !show && state === 'exited',\n [styles['last-opened']]: (!activeAiDrawer && lastOpenedDrawerId === activeDrawerId) || isExpanded,\n [testutilStyles['active-drawer']]: show,\n [styles['drawer-expanded']]: isExpanded,\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 bottomDrawersFocusControl.loseFocus();\n }\n }}\n style={{\n ...(isMobile && {\n blockSize: drawerFullScreenHeight,\n insetBlockStart: mobileDrawerTopOffset,\n }),\n ...(!isMobile && {\n [customCssProps.bottomDrawerSize]: `${['entering', 'entered'].includes(state) ? (isExpanded ? drawerFullScreenHeight : size + 'px') : 0}`,\n }),\n }}\n data-testid={`awsui-app-layout-drawer-${activeDrawerId}`}\n >\n <div className={clsx(styles['global-drawer-wrapper'])}>\n {!isMobile && !isExpanded && <div className={styles['drawer-gap']} />}\n {!isMobile && activeDrawer?.resizable && !isExpanded && (\n // Prevents receiving focus in Firefox\n <div className={styles['drawer-slider']} tabIndex={-1}>\n <PanelResizeHandle\n ref={refs?.slider}\n position=\"bottom\"\n className={testutilStyles['drawers-slider']}\n ariaLabel={activeDrawer?.ariaLabels?.resizeHandle}\n tooltipText={activeDrawer?.ariaLabels?.resizeHandleTooltipText}\n ariaValuenow={resizeProps.relativeSize}\n onKeyDown={resizeProps.onKeyDown}\n onDirectionClick={resizeProps.onDirectionClick}\n onPointerDown={resizeProps.onPointerDown}\n />\n </div>\n )}\n <header className={styles['bottom-drawer-content-header']} ref={headerRef}>\n <div className={styles['bottom-drawer-content-header-content']}>\n {activeDrawer?.header ?? <div />}\n <div className={styles['bottom-drawer-actions']}>\n <ButtonGroup\n dropdownExpandToViewport={false}\n variant=\"icon\"\n onItemClick={event => {\n switch (event.detail.id) {\n case 'close':\n onActiveGlobalBottomDrawerChange(null, { initiatedByUserAction: true });\n break;\n case 'expand':\n setExpandedDrawerId(isExpanded ? null : activeDrawerId);\n break;\n default:\n activeDrawer?.onHeaderActionClick?.(event);\n }\n }}\n ariaLabel=\"Global panel actions\"\n items={drawerActions}\n __internalRootRef={(root: HTMLElement) => {\n if (!root) {\n return;\n }\n refs.close = {\n current: root.querySelector('[data-itemid=\"close\"]') as unknown as Focusable,\n };\n }}\n />\n </div>\n </div>\n </header>\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\n className={styles['drawer-content']}\n style={{\n blockSize:\n isMobile || isExpanded\n ? drawerFullScreenHeight\n : `${size - GAP_HEIGHT - RESIZE_HANDLER_HEIGHT - (headerRef?.current?.clientHeight ?? 0)}px`,\n }}\n >\n {activeDrawer?.content}\n </div>\n </div>\n </div>\n </aside>\n );\n }}\n </Transition>\n </AppLayoutBuiltInErrorBoundary>\n );\n}\n\nexport default AppLayoutGlobalBottomDrawerImplementation;\n"]}
|
|
1
|
+
{"version":3,"file":"global-bottom-drawer.js","sourceRoot":"","sources":["../../../../../src/app-layout/visual-refresh-toolbar/drawer/global-bottom-drawer.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE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,KAAK,EAAE;gCACL,SAAS,EACP,QAAQ,IAAI,UAAU;oCACpB,CAAC,CAAC,sBAAsB;oCACxB,CAAC,CAAC,GAAG,IAAI,GAAG,UAAU,GAAG,qBAAqB,GAAG,CAAC,MAAA,MAAA,SAAS,aAAT,SAAS,uBAAT,SAAS,CAAE,OAAO,0CAAE,YAAY,mCAAI,CAAC,CAAC,IAAI;6BACjG,IAEA,YAAY,aAAZ,YAAY,uBAAZ,YAAY,CAAE,OAAO,CAClB,CACF,CACF,CACA,CACT,CAAC;QACJ,CAAC,CACU,CACiB,CACjC,CAAC;AACJ,CAAC;AAED,eAAe,yCAAyC,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useEffect, useRef } from 'react';\nimport { Transition } from 'react-transition-group';\nimport clsx from 'clsx';\n\nimport ButtonGroup from '../../../button-group/internal';\nimport { InternalItemOrGroup } from '../../../button-group/internal-interfaces';\nimport { AppLayoutBuiltInErrorBoundary } from '../../../error-boundary/internal';\nimport PanelResizeHandle from '../../../internal/components/panel-resize-handle';\nimport customCssProps from '../../../internal/generated/custom-css-properties';\nimport { usePrevious } from '../../../internal/hooks/use-previous';\nimport { getLimitedValue } from '../../../split-panel/utils/size-utils';\nimport { Focusable } from '../../utils/use-focus-control';\nimport { getDrawerStyles } from '../compute-layout';\nimport { AppLayoutWidgetizedState, 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';\nexport function AppLayoutBottomDrawerWrapper({ widgetizedState }: { widgetizedState: AppLayoutWidgetizedState }) {\n const { activeGlobalBottomDrawerId, bottomDrawers } = widgetizedState;\n const openBottomDrawersHistory = useRef<Set<string>>(new Set());\n useEffect(() => {\n if (activeGlobalBottomDrawerId) {\n openBottomDrawersHistory.current.add(activeGlobalBottomDrawerId);\n }\n }, [activeGlobalBottomDrawerId]);\n\n return (\n <>\n {bottomDrawers.map(drawer => {\n return (\n <AppLayoutGlobalBottomDrawerImplementation\n key={drawer.id}\n activeDrawer={\n activeGlobalBottomDrawerId === drawer.id ||\n (drawer.preserveInactiveContent && openBottomDrawersHistory.current.has(drawer.id))\n ? drawer\n : undefined\n }\n show={activeGlobalBottomDrawerId === drawer.id}\n widgetizedState={widgetizedState}\n />\n );\n })}\n </>\n );\n}\n\ninterface AppLayoutGlobalDrawerImplementationProps {\n widgetizedState: AppLayoutWidgetizedState;\n show: boolean;\n activeDrawer: InternalDrawer | undefined;\n}\n\nconst GAP_HEIGHT = 10;\nconst RESIZE_HANDLER_HEIGHT = 18;\n\nfunction AppLayoutGlobalBottomDrawerImplementation({\n widgetizedState,\n show,\n activeDrawer,\n}: AppLayoutGlobalDrawerImplementationProps) {\n const {\n ariaLabels,\n isMobile,\n onActiveGlobalBottomDrawerChange,\n onActiveBottomDrawerResize,\n minGlobalBottomDrawerSize,\n activeGlobalBottomDrawerSize,\n drawersOpenQueue,\n expandedDrawerId,\n setExpandedDrawerId,\n activeAiDrawer,\n bottomDrawersFocusControl,\n getMaxGlobalBottomDrawerHeight,\n reportBottomDrawerSize,\n verticalOffsets,\n placement,\n drawerAnimationDisabled,\n } = widgetizedState;\n const drawerRef = useRef<HTMLDivElement>(null);\n const headerRef = useRef<HTMLHeadingElement>(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: mobileDrawerTopOffset, drawerHeight: drawerFullScreenHeight } = getDrawerStyles(\n verticalOffsets,\n isMobile,\n placement\n );\n const activeDrawerSize = activeGlobalBottomDrawerSize ?? 0;\n const minDrawerSize = minGlobalBottomDrawerSize ?? 0;\n const maxDrawerSize = getMaxGlobalBottomDrawerHeight();\n const refs = bottomDrawersFocusControl.refs;\n const resizeProps = useResize({\n currentWidth: activeDrawerSize,\n minWidth: minDrawerSize,\n maxWidth: maxDrawerSize,\n panelRef: drawerRef,\n handleRef: refs?.slider,\n onResize: size => onActiveBottomDrawerResize({ id: activeDrawerId!, size }),\n position: 'bottom',\n });\n const size = getLimitedValue(minDrawerSize, activeDrawerSize, maxDrawerSize);\n const lastOpenedDrawerId = drawersOpenQueue.length ? drawersOpenQueue[0] : null;\n const hasTriggerButton = !!activeDrawer?.trigger;\n const isExpanded = activeDrawer?.isExpandable && expandedDrawerId === activeDrawerId;\n const wasExpanded = usePrevious(isExpanded);\n const animationDisabled =\n drawerAnimationDisabled ||\n (activeDrawer?.defaultActive && !drawersOpenQueue.includes(activeDrawer.id)) ||\n (wasExpanded && !isExpanded);\n\n // Prevent main content scroll when bottom drawer opens with animations\n useEffect(() => {\n if (show && drawerRef.current) {\n const scrollTop = document.documentElement.scrollTop || document.body.scrollTop;\n const abortController = new AbortController();\n\n // Temporarily prevent scrolling during animation\n const preventScroll = () => {\n document.documentElement.scrollTop = scrollTop;\n document.body.scrollTop = scrollTop;\n };\n\n // Handle transition end to remove scroll prevention\n const handleTransitionEnd = (event: TransitionEvent) => {\n // Only handle transitions on the drawer element itself\n if (event.target === drawerRef.current) {\n abortController.abort();\n }\n };\n\n // Add scroll prevention during animation\n document.addEventListener('scroll', preventScroll, {\n passive: false,\n signal: abortController.signal,\n });\n\n drawerRef.current.addEventListener('transitionend', handleTransitionEnd, {\n signal: abortController.signal,\n });\n\n return () => {\n abortController.abort();\n };\n }\n }, [show]);\n\n let drawerActions: ReadonlyArray<InternalItemOrGroup> = [\n {\n type: 'icon-button',\n id: 'close',\n iconName: isMobile ? 'close' : 'angle-down',\n text: computedAriaLabels.closeButton ?? '',\n analyticsAction: 'close',\n },\n ];\n if (!isMobile && activeDrawer?.isExpandable) {\n drawerActions = [\n {\n type: 'icon-toggle-button',\n id: 'expand',\n iconName: isExpanded ? 'shrink' : 'expand',\n text: activeDrawer?.ariaLabels?.expandedModeButton ?? '',\n pressed: !!isExpanded,\n analyticsAction: isExpanded ? 'expand' : 'collapse',\n },\n ...drawerActions,\n ];\n }\n if (activeDrawer?.headerActions) {\n drawerActions = [\n {\n type: 'group',\n text: 'Actions',\n items: activeDrawer.headerActions!,\n },\n ...drawerActions,\n ];\n }\n\n useEffect(() => {\n reportBottomDrawerSize(size);\n }, [reportBottomDrawerSize, size]);\n\n return (\n <AppLayoutBuiltInErrorBoundary>\n <Transition\n nodeRef={drawerRef}\n in={show || isExpanded}\n appear={show || isExpanded}\n mountOnEnter={true}\n timeout={250}\n >\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['bottom-drawer'],\n styles[state],\n !animationDisabled && sharedStyles['with-motion-vertical'],\n !animationDisabled && isExpanded && styles['with-expanded-motion'],\n {\n [styles['drawer-hidden']]: !show && state === 'exited',\n [styles['last-opened']]: (!activeAiDrawer && lastOpenedDrawerId === activeDrawerId) || isExpanded,\n [testutilStyles['active-drawer']]: show,\n [styles['drawer-expanded']]: isExpanded,\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 bottomDrawersFocusControl.loseFocus();\n }\n }}\n style={{\n ...(isMobile && {\n blockSize: drawerFullScreenHeight,\n insetBlockStart: mobileDrawerTopOffset,\n }),\n ...(!isMobile && {\n [customCssProps.bottomDrawerSize]: `${['entering', 'entered'].includes(state) ? (isExpanded ? drawerFullScreenHeight : size + 'px') : 0}`,\n }),\n }}\n data-testid={`awsui-app-layout-drawer-${activeDrawerId}`}\n >\n <div className={clsx(styles['global-drawer-wrapper'])}>\n {!isMobile && !isExpanded && <div className={styles['drawer-gap']} />}\n {!isMobile && activeDrawer?.resizable && !isExpanded && (\n // Prevents receiving focus in Firefox\n <div className={styles['drawer-slider']} tabIndex={-1}>\n <PanelResizeHandle\n ref={refs?.slider}\n position=\"bottom\"\n className={testutilStyles['drawers-slider']}\n ariaLabel={activeDrawer?.ariaLabels?.resizeHandle}\n tooltipText={activeDrawer?.ariaLabels?.resizeHandleTooltipText}\n ariaValuenow={resizeProps.relativeSize}\n onKeyDown={resizeProps.onKeyDown}\n onDirectionClick={resizeProps.onDirectionClick}\n onPointerDown={resizeProps.onPointerDown}\n />\n </div>\n )}\n <header className={styles['bottom-drawer-content-header']} ref={headerRef}>\n <div className={styles['bottom-drawer-content-header-content']}>\n {activeDrawer?.header ?? <div />}\n <div className={styles['bottom-drawer-actions']}>\n <ButtonGroup\n dropdownExpandToViewport={false}\n variant=\"icon\"\n onItemClick={event => {\n switch (event.detail.id) {\n case 'close':\n onActiveGlobalBottomDrawerChange(null, { initiatedByUserAction: true });\n break;\n case 'expand':\n setExpandedDrawerId(isExpanded ? null : activeDrawerId);\n break;\n default:\n activeDrawer?.onHeaderActionClick?.(event);\n }\n }}\n ariaLabel=\"Global panel actions\"\n items={drawerActions}\n __internalRootRef={(root: HTMLElement) => {\n if (!root) {\n return;\n }\n refs.close = {\n current: root.querySelector('[data-itemid=\"close\"]') as unknown as Focusable,\n };\n }}\n />\n </div>\n </div>\n </header>\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\n className={styles['drawer-content']}\n style={{\n blockSize:\n isMobile || isExpanded\n ? drawerFullScreenHeight\n : `${size - GAP_HEIGHT - RESIZE_HANDLER_HEIGHT - (headerRef?.current?.clientHeight ?? 0)}px`,\n }}\n >\n {activeDrawer?.content}\n </div>\n </div>\n </div>\n </aside>\n );\n }}\n </Transition>\n </AppLayoutBuiltInErrorBoundary>\n );\n}\n\nexport default AppLayoutGlobalBottomDrawerImplementation;\n"]}
|
|
@@ -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;AAGxB,OAAO,WAAW,MAAM,gCAAgC,CAAC;AACzD,OAAO,EAAE,6BAA6B,EAAE,MAAM,kCAAkC,CAAC;AACjF,OAAO,iBAAiB,MAAM,kDAAkD,CAAC;AACjF,OAAO,cAAc,MAAM,mDAAmD,CAAC;AAC/E,OAAO,EAAE,WAAW,EAAE,MAAM,sCAAsC,CAAC;AACnE,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;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,mBAAmB,EACnB,eAAe,EACf,gBAAgB,EAChB,gBAAgB,EAChB,mBAAmB,EACnB,cAAc,EACd,uBAAuB,GACxB,GAAG,kBAAkB,CAAC;IACvB,MAAM,SAAS,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C,CAAC,IAAI,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC;4CACxD,MAAM;wCACR;4CACE,MAAA,kBAAkB,aAAlB,kBAAkB,uBAAlB,kBAAkB,CAAE,mBAAmB,mEAAG,KAAK,CAAC,CAAC;oCACrD,CAAC;gCACH,CAAC,EACD,SAAS,EAAC,sBAAsB,EAChC,KAAK,EAAE,aAAa,EACpB,iBAAiB,EAAE,CAAC,IAAiB,EAAE,EAAE;oCACvC,IAAI,CAAC,IAAI,EAAE,CAAC;wCACV,OAAO;oCACT,CAAC;oCACD,IAAI,CAAC,KAAK,GAAG,EAAE,OAAO,EAAE,IAAI,CAAC,aAAa,CAAC,uBAAuB,CAAyB,EAAE,CAAC;gCAChG,CAAC,GACD,CACE;wBACN,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,CACF,CACA,CACT,CAAC;QACJ,CAAC,CACU,CACiB,CACjC,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 { InternalItemOrGroup } from '../../../button-group/interfaces';\nimport ButtonGroup from '../../../button-group/internal';\nimport { AppLayoutBuiltInErrorBoundary } from '../../../error-boundary/internal';\nimport PanelResizeHandle from '../../../internal/components/panel-resize-handle';\nimport customCssProps from '../../../internal/generated/custom-css-properties';\nimport { usePrevious } from '../../../internal/hooks/use-previous';\nimport { getLimitedValue } from '../../../split-panel/utils/size-utils';\nimport { Focusable } from '../../utils/use-focus-control';\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 activeGlobalDrawers,\n verticalOffsets,\n drawersOpenQueue,\n expandedDrawerId,\n setExpandedDrawerId,\n activeAiDrawer,\n drawerAnimationDisabled,\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 isExpanded = activeGlobalDrawer?.isExpandable && expandedDrawerId === activeDrawerId;\n const wasExpanded = usePrevious(isExpanded);\n const animationDisabled =\n drawerAnimationDisabled ||\n (activeGlobalDrawer?.defaultActive && !drawersOpenQueue.includes(activeGlobalDrawer.id)) ||\n (wasExpanded && !isExpanded);\n let drawerActions: ReadonlyArray<InternalItemOrGroup> = [\n {\n type: 'icon-button',\n id: 'close',\n iconName: isMobile ? 'close' : 'angle-right',\n text: computedAriaLabels.closeButton ?? '',\n analyticsAction: 'close',\n },\n ];\n if (!isMobile && activeGlobalDrawer?.isExpandable) {\n drawerActions = [\n {\n type: 'icon-button',\n id: 'expand',\n iconName: isExpanded ? 'shrink' : 'expand',\n text: activeGlobalDrawer?.ariaLabels?.expandedModeButton ?? '',\n analyticsAction: isExpanded ? 'expand' : 'collapse',\n },\n ...drawerActions,\n ];\n }\n if (activeGlobalDrawer?.headerActions) {\n drawerActions = [\n {\n type: 'group',\n text: 'Actions',\n items: activeGlobalDrawer.headerActions!,\n },\n ...drawerActions,\n ];\n }\n\n return (\n <AppLayoutBuiltInErrorBoundary>\n <Transition nodeRef={drawerRef} in={show || isExpanded} appear={show || isExpanded} 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 !animationDisabled && isExpanded && styles['with-expanded-motion'],\n {\n [styles['drawer-hidden']]: !show,\n [styles['last-opened']]: (!activeAiDrawer && lastOpenedDrawerId === activeDrawerId) || isExpanded,\n [testutilStyles['active-drawer']]: show,\n [styles['drawer-expanded']]: isExpanded,\n [styles['has-next-siblings']]:\n activeGlobalDrawers.findIndex(drawer => drawer.id === activeDrawerId) + 1 <\n activeGlobalDrawers.length,\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) ? (isExpanded ? '100%' : size + 'px') : 0}`,\n }),\n }}\n data-testid={`awsui-app-layout-drawer-${activeDrawerId}`}\n >\n <div className={clsx(styles['global-drawer-wrapper'])}>\n {!isMobile && <div className={styles['drawer-gap']}></div>}\n {!isMobile && activeGlobalDrawer?.resizable && !isExpanded && (\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 tooltipText={activeGlobalDrawer?.ariaLabels?.resizeHandleTooltipText}\n ariaValuenow={resizeProps.relativeSize}\n onKeyDown={resizeProps.onKeyDown}\n onDirectionClick={resizeProps.onDirectionClick}\n onPointerDown={resizeProps.onPointerDown}\n />\n </div>\n )}\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={styles['drawer-actions']}>\n <ButtonGroup\n dropdownExpandToViewport={false}\n variant=\"icon\"\n onItemClick={event => {\n switch (event.detail.id) {\n case 'close':\n onActiveGlobalDrawersChange(activeDrawerId, { initiatedByUserAction: true });\n break;\n case 'expand':\n setExpandedDrawerId(isExpanded ? null : activeDrawerId);\n break;\n default:\n activeGlobalDrawer?.onHeaderActionClick?.(event);\n }\n }}\n ariaLabel=\"Global panel actions\"\n items={drawerActions}\n __internalRootRef={(root: HTMLElement) => {\n if (!root) {\n return;\n }\n refs.close = { current: root.querySelector('[data-itemid=\"close\"]') as unknown as Focusable };\n }}\n />\n </div>\n <div className={styles['drawer-content']} style={{ blockSize: drawerHeight }}>\n {activeGlobalDrawer?.content}\n </div>\n </div>\n </div>\n </aside>\n );\n }}\n </Transition>\n </AppLayoutBuiltInErrorBoundary>\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,WAAW,MAAM,gCAAgC,CAAC;AAEzD,OAAO,EAAE,6BAA6B,EAAE,MAAM,kCAAkC,CAAC;AACjF,OAAO,iBAAiB,MAAM,kDAAkD,CAAC;AACjF,OAAO,cAAc,MAAM,mDAAmD,CAAC;AAC/E,OAAO,EAAE,WAAW,EAAE,MAAM,sCAAsC,CAAC;AACnE,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;AAQrC,SAAS,mCAAmC,CAAC,EAC3C,kBAAkB,EAClB,IAAI,EACJ,kBAAkB,GACuB;;IACzC,MAAM,EACJ,UAAU,EACV,yBAAyB,EACzB,QAAQ,EACR,SAAS,E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,KAAK,CAAC,MAAM,CAAC,EAAE,EAAE,CAAC;wCACxB,KAAK,OAAO;4CACV,2BAA2B,CAAC,cAAc,EAAE,EAAE,qBAAqB,EAAE,IAAI,EAAE,CAAC,CAAC;4CAC7E,MAAM;wCACR,KAAK,QAAQ;4CACX,mBAAmB,CAAC,UAAU,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC;4CACxD,MAAM;wCACR;4CACE,MAAA,kBAAkB,aAAlB,kBAAkB,uBAAlB,kBAAkB,CAAE,mBAAmB,mEAAG,KAAK,CAAC,CAAC;oCACrD,CAAC;gCACH,CAAC,EACD,SAAS,EAAC,sBAAsB,EAChC,KAAK,EAAE,aAAa,EACpB,iBAAiB,EAAE,CAAC,IAAiB,EAAE,EAAE;oCACvC,IAAI,CAAC,IAAI,EAAE,CAAC;wCACV,OAAO;oCACT,CAAC;oCACD,IAAI,CAAC,KAAK,GAAG,EAAE,OAAO,EAAE,IAAI,CAAC,aAAa,CAAC,uBAAuB,CAAyB,EAAE,CAAC;gCAChG,CAAC,GACD,CACE;wBACN,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,CACF,CACA,CACT,CAAC;QACJ,CAAC,CACU,CACiB,CACjC,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 ButtonGroup from '../../../button-group/internal';\nimport { InternalItemOrGroup } from '../../../button-group/internal-interfaces';\nimport { AppLayoutBuiltInErrorBoundary } from '../../../error-boundary/internal';\nimport PanelResizeHandle from '../../../internal/components/panel-resize-handle';\nimport customCssProps from '../../../internal/generated/custom-css-properties';\nimport { usePrevious } from '../../../internal/hooks/use-previous';\nimport { getLimitedValue } from '../../../split-panel/utils/size-utils';\nimport { Focusable } from '../../utils/use-focus-control';\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 activeGlobalDrawers,\n verticalOffsets,\n drawersOpenQueue,\n expandedDrawerId,\n setExpandedDrawerId,\n activeAiDrawer,\n drawerAnimationDisabled,\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 isExpanded = activeGlobalDrawer?.isExpandable && expandedDrawerId === activeDrawerId;\n const wasExpanded = usePrevious(isExpanded);\n const animationDisabled =\n drawerAnimationDisabled ||\n (activeGlobalDrawer?.defaultActive && !drawersOpenQueue.includes(activeGlobalDrawer.id)) ||\n (wasExpanded && !isExpanded);\n let drawerActions: ReadonlyArray<InternalItemOrGroup> = [\n {\n type: 'icon-button',\n id: 'close',\n iconName: isMobile ? 'close' : 'angle-right',\n text: computedAriaLabels.closeButton ?? '',\n analyticsAction: 'close',\n },\n ];\n if (!isMobile && activeGlobalDrawer?.isExpandable) {\n drawerActions = [\n {\n type: 'icon-button',\n id: 'expand',\n iconName: isExpanded ? 'shrink' : 'expand',\n text: activeGlobalDrawer?.ariaLabels?.expandedModeButton ?? '',\n analyticsAction: isExpanded ? 'expand' : 'collapse',\n },\n ...drawerActions,\n ];\n }\n if (activeGlobalDrawer?.headerActions) {\n drawerActions = [\n {\n type: 'group',\n text: 'Actions',\n items: activeGlobalDrawer.headerActions!,\n },\n ...drawerActions,\n ];\n }\n\n return (\n <AppLayoutBuiltInErrorBoundary>\n <Transition nodeRef={drawerRef} in={show || isExpanded} appear={show || isExpanded} 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 !animationDisabled && isExpanded && styles['with-expanded-motion'],\n {\n [styles['drawer-hidden']]: !show,\n [styles['last-opened']]: (!activeAiDrawer && lastOpenedDrawerId === activeDrawerId) || isExpanded,\n [testutilStyles['active-drawer']]: show,\n [styles['drawer-expanded']]: isExpanded,\n [styles['has-next-siblings']]:\n activeGlobalDrawers.findIndex(drawer => drawer.id === activeDrawerId) + 1 <\n activeGlobalDrawers.length,\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) ? (isExpanded ? '100%' : size + 'px') : 0}`,\n }),\n }}\n data-testid={`awsui-app-layout-drawer-${activeDrawerId}`}\n >\n <div className={clsx(styles['global-drawer-wrapper'])}>\n {!isMobile && <div className={styles['drawer-gap']}></div>}\n {!isMobile && activeGlobalDrawer?.resizable && !isExpanded && (\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 tooltipText={activeGlobalDrawer?.ariaLabels?.resizeHandleTooltipText}\n ariaValuenow={resizeProps.relativeSize}\n onKeyDown={resizeProps.onKeyDown}\n onDirectionClick={resizeProps.onDirectionClick}\n onPointerDown={resizeProps.onPointerDown}\n />\n </div>\n )}\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={styles['drawer-actions']}>\n <ButtonGroup\n dropdownExpandToViewport={false}\n variant=\"icon\"\n onItemClick={event => {\n switch (event.detail.id) {\n case 'close':\n onActiveGlobalDrawersChange(activeDrawerId, { initiatedByUserAction: true });\n break;\n case 'expand':\n setExpandedDrawerId(isExpanded ? null : activeDrawerId);\n break;\n default:\n activeGlobalDrawer?.onHeaderActionClick?.(event);\n }\n }}\n ariaLabel=\"Global panel actions\"\n items={drawerActions}\n __internalRootRef={(root: HTMLElement) => {\n if (!root) {\n return;\n }\n refs.close = { current: root.querySelector('[data-itemid=\"close\"]') as unknown as Focusable };\n }}\n />\n </div>\n <div className={styles['drawer-content']} style={{ blockSize: drawerHeight }}>\n {activeGlobalDrawer?.content}\n </div>\n </div>\n </div>\n </aside>\n );\n }}\n </Transition>\n </AppLayoutBuiltInErrorBoundary>\n );\n}\n\nexport default AppLayoutGlobalDrawerImplementation;\n"]}
|
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
|
|
2
2
|
import './styles.scoped.css';
|
|
3
3
|
export default {
|
|
4
|
-
"empty-appear": "awsui_empty-
|
|
5
|
-
"awsui-motion-fade-in": "awsui_awsui-motion-fade-
|
|
6
|
-
"root": "
|
|
7
|
-
"empty": "
|
|
8
|
-
"row": "
|
|
9
|
-
"divider": "
|
|
10
|
-
"row-control": "awsui_row-
|
|
11
|
-
"field": "
|
|
12
|
-
"additional-info": "awsui_additional-
|
|
13
|
-
"add-row": "awsui_add-
|
|
14
|
-
"add-button": "awsui_add-
|
|
15
|
-
"remove-button-container": "awsui_remove-button-
|
|
16
|
-
"remove-button-field-padding": "awsui_remove-button-field-
|
|
17
|
-
"remove-button-own-row": "awsui_remove-button-own-
|
|
18
|
-
"remove-button": "awsui_remove-
|
|
4
|
+
"empty-appear": "awsui_empty-appear_n4qlp_1v7sv_153",
|
|
5
|
+
"awsui-motion-fade-in": "awsui_awsui-motion-fade-in_n4qlp_1v7sv_1",
|
|
6
|
+
"root": "awsui_root_n4qlp_1v7sv_175",
|
|
7
|
+
"empty": "awsui_empty_n4qlp_1v7sv_153",
|
|
8
|
+
"row": "awsui_row_n4qlp_1v7sv_221",
|
|
9
|
+
"divider": "awsui_divider_n4qlp_1v7sv_225",
|
|
10
|
+
"row-control": "awsui_row-control_n4qlp_1v7sv_230",
|
|
11
|
+
"field": "awsui_field_n4qlp_1v7sv_234",
|
|
12
|
+
"additional-info": "awsui_additional-info_n4qlp_1v7sv_238",
|
|
13
|
+
"add-row": "awsui_add-row_n4qlp_1v7sv_285",
|
|
14
|
+
"add-button": "awsui_add-button_n4qlp_1v7sv_289",
|
|
15
|
+
"remove-button-container": "awsui_remove-button-container_n4qlp_1v7sv_293",
|
|
16
|
+
"remove-button-field-padding": "awsui_remove-button-field-padding_n4qlp_1v7sv_297",
|
|
17
|
+
"remove-button-own-row": "awsui_remove-button-own-row_n4qlp_1v7sv_301",
|
|
18
|
+
"remove-button": "awsui_remove-button_n4qlp_1v7sv_293"
|
|
19
19
|
};
|
|
20
20
|
|
|
@@ -150,10 +150,10 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
150
150
|
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
151
151
|
SPDX-License-Identifier: Apache-2.0
|
|
152
152
|
*/
|
|
153
|
-
.awsui_empty-
|
|
154
|
-
animation: awsui_awsui-motion-fade-
|
|
153
|
+
.awsui_empty-appear_n4qlp_1v7sv_153:not(#\9) {
|
|
154
|
+
animation: awsui_awsui-motion-fade-in_n4qlp_1v7sv_1 var(--motion-duration-transition-show-paced-0w35xp, 180ms) var(--motion-easing-transition-show-paced-ufdgkj, ease-out);
|
|
155
155
|
}
|
|
156
|
-
@keyframes awsui_awsui-motion-fade-
|
|
156
|
+
@keyframes awsui_awsui-motion-fade-in_n4qlp_1v7sv_1 {
|
|
157
157
|
from {
|
|
158
158
|
opacity: 0.2;
|
|
159
159
|
}
|
|
@@ -162,17 +162,17 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
162
162
|
}
|
|
163
163
|
}
|
|
164
164
|
@media (prefers-reduced-motion: reduce) {
|
|
165
|
-
.awsui_empty-
|
|
165
|
+
.awsui_empty-appear_n4qlp_1v7sv_153:not(#\9) {
|
|
166
166
|
animation: none;
|
|
167
167
|
transition: none;
|
|
168
168
|
}
|
|
169
169
|
}
|
|
170
|
-
.awsui-motion-disabled .awsui_empty-
|
|
170
|
+
.awsui-motion-disabled .awsui_empty-appear_n4qlp_1v7sv_153:not(#\9), .awsui-mode-entering .awsui_empty-appear_n4qlp_1v7sv_153:not(#\9) {
|
|
171
171
|
animation: none;
|
|
172
172
|
transition: none;
|
|
173
173
|
}
|
|
174
174
|
|
|
175
|
-
.
|
|
175
|
+
.awsui_root_n4qlp_1v7sv_175:not(#\9) {
|
|
176
176
|
border-collapse: separate;
|
|
177
177
|
border-spacing: 0;
|
|
178
178
|
box-sizing: border-box;
|
|
@@ -207,32 +207,35 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
207
207
|
gap: var(--space-grid-gutter-nm7ylt, 20px);
|
|
208
208
|
align-items: start;
|
|
209
209
|
}
|
|
210
|
+
.awsui-one-theme .awsui_root_n4qlp_1v7sv_175:not(#\9) {
|
|
211
|
+
gap: var(--space-scaled-s-gjhvjd, 12px);
|
|
212
|
+
}
|
|
210
213
|
|
|
211
|
-
.
|
|
214
|
+
.awsui_empty_n4qlp_1v7sv_153:not(#\9) {
|
|
212
215
|
font-size: var(--font-size-body-m-vv54cm, 14px);
|
|
213
216
|
line-height: var(--line-height-body-m-bedeoh, 22px);
|
|
214
217
|
color: var(--color-text-empty-vtt4l2, #687078);
|
|
215
218
|
grid-column: 1/-1;
|
|
216
219
|
}
|
|
217
220
|
|
|
218
|
-
.
|
|
221
|
+
.awsui_row_n4qlp_1v7sv_221:not(#\9) {
|
|
219
222
|
display: contents;
|
|
220
223
|
}
|
|
221
224
|
|
|
222
|
-
.
|
|
225
|
+
.awsui_divider_n4qlp_1v7sv_225:not(#\9) {
|
|
223
226
|
grid-column: 1/-1;
|
|
224
227
|
border-block-start: var(--border-divider-section-width-sznrdy, 1px) solid var(--color-border-divider-default-ipvpev, #eaeded);
|
|
225
228
|
}
|
|
226
229
|
|
|
227
|
-
.awsui_row-
|
|
230
|
+
.awsui_row-control_n4qlp_1v7sv_230:not(#\9) {
|
|
228
231
|
/* used in test-utils */
|
|
229
232
|
}
|
|
230
233
|
|
|
231
|
-
.
|
|
234
|
+
.awsui_field_n4qlp_1v7sv_234:not(#\9) {
|
|
232
235
|
min-inline-size: 40px;
|
|
233
236
|
}
|
|
234
237
|
|
|
235
|
-
.awsui_additional-
|
|
238
|
+
.awsui_additional-info_n4qlp_1v7sv_238:not(#\9) {
|
|
236
239
|
color: var(--color-text-form-secondary-4sp9un, #687078);
|
|
237
240
|
font-size: var(--font-size-body-s-psgqn2, 12px);
|
|
238
241
|
line-height: var(--line-height-body-s-otgtsr, 16px);
|
|
@@ -242,7 +245,7 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
242
245
|
margin-block-start: var(--space-xxs-jnczic, 4px);
|
|
243
246
|
/* stylelint-disable-next-line selector-max-type */
|
|
244
247
|
}
|
|
245
|
-
.awsui_additional-
|
|
248
|
+
.awsui_additional-info_n4qlp_1v7sv_238 > a:not(#\9) {
|
|
246
249
|
text-underline-offset: 0.3em;
|
|
247
250
|
text-decoration-thickness: var(--font-decoration-thickness-link-4tl2vi, 1px);
|
|
248
251
|
text-decoration-style: var(--font-decoration-style-link-7y21z4, solid);
|
|
@@ -257,50 +260,50 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
257
260
|
transition-duration: var(--motion-duration-refresh-only-medium-h3wrr6, 0ms);
|
|
258
261
|
}
|
|
259
262
|
@media (prefers-reduced-motion: reduce) {
|
|
260
|
-
.awsui_additional-
|
|
263
|
+
.awsui_additional-info_n4qlp_1v7sv_238 > a:not(#\9) {
|
|
261
264
|
animation: none;
|
|
262
265
|
transition: none;
|
|
263
266
|
}
|
|
264
267
|
}
|
|
265
|
-
.awsui-motion-disabled .awsui_additional-
|
|
268
|
+
.awsui-motion-disabled .awsui_additional-info_n4qlp_1v7sv_238 > a:not(#\9), .awsui-mode-entering .awsui_additional-info_n4qlp_1v7sv_238 > a:not(#\9) {
|
|
266
269
|
animation: none;
|
|
267
270
|
transition: none;
|
|
268
271
|
}
|
|
269
|
-
.awsui_additional-
|
|
272
|
+
.awsui_additional-info_n4qlp_1v7sv_238 > a:not(#\9):hover {
|
|
270
273
|
cursor: pointer;
|
|
271
274
|
color: var(--awsui-style-color-hover-6b9ypa, var(--color-text-link-hover-pqxtsy, #0a4a74));
|
|
272
275
|
}
|
|
273
|
-
.awsui_additional-
|
|
276
|
+
.awsui_additional-info_n4qlp_1v7sv_238 > a:not(#\9):focus {
|
|
274
277
|
outline: none;
|
|
275
278
|
}
|
|
276
|
-
.awsui_additional-
|
|
279
|
+
.awsui_additional-info_n4qlp_1v7sv_238 > a:not(#\9):active {
|
|
277
280
|
color: var(--awsui-style-color-active-6b9ypa, var(--color-text-link-hover-pqxtsy, #0a4a74));
|
|
278
281
|
}
|
|
279
|
-
.awsui_additional-
|
|
282
|
+
.awsui_additional-info_n4qlp_1v7sv_238 > a:not(#\9):active, .awsui_additional-info_n4qlp_1v7sv_238 > a:not(#\9):focus, .awsui_additional-info_n4qlp_1v7sv_238 > a:not(#\9):hover {
|
|
280
283
|
text-decoration-line: underline;
|
|
281
284
|
text-decoration-color: var(--color-text-link-decoration-hover-jnu2g9, currentColor);
|
|
282
285
|
}
|
|
283
286
|
|
|
284
|
-
.awsui_add-
|
|
287
|
+
.awsui_add-row_n4qlp_1v7sv_285:not(#\9) {
|
|
285
288
|
grid-column: 1/-1;
|
|
286
289
|
}
|
|
287
290
|
|
|
288
|
-
.awsui_add-
|
|
291
|
+
.awsui_add-button_n4qlp_1v7sv_289:not(#\9) {
|
|
289
292
|
/* used in test-utils */
|
|
290
293
|
}
|
|
291
294
|
|
|
292
|
-
.awsui_remove-button-
|
|
295
|
+
.awsui_remove-button-container_n4qlp_1v7sv_293:not(#\9) {
|
|
293
296
|
display: inline-block;
|
|
294
297
|
}
|
|
295
298
|
|
|
296
|
-
.awsui_remove-button-field-
|
|
299
|
+
.awsui_remove-button-field-padding_n4qlp_1v7sv_297:not(#\9) {
|
|
297
300
|
padding-block-start: calc(var(--space-xxs-jnczic, 4px) + var(--line-height-body-m-bedeoh, 22px));
|
|
298
301
|
}
|
|
299
302
|
|
|
300
|
-
.awsui_remove-button-own-
|
|
303
|
+
.awsui_remove-button-own-row_n4qlp_1v7sv_301:not(#\9) {
|
|
301
304
|
justify-self: end;
|
|
302
305
|
}
|
|
303
306
|
|
|
304
|
-
.awsui_remove-
|
|
307
|
+
.awsui_remove-button_n4qlp_1v7sv_293:not(#\9) {
|
|
305
308
|
/* used in test-utils */
|
|
306
309
|
}
|