@cloudscape-design/components 3.0.245 → 3.0.247
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/annotation-context/annotation/annotation-trigger.d.ts.map +1 -1
- package/annotation-context/annotation/annotation-trigger.js +1 -3
- package/annotation-context/annotation/annotation-trigger.js.map +1 -1
- package/annotation-context/annotation/styles.css.js +24 -24
- package/annotation-context/annotation/styles.scoped.css +30 -30
- package/annotation-context/annotation/styles.selectors.js +24 -24
- package/app-layout/drawer/index.d.ts +3 -21
- package/app-layout/drawer/index.d.ts.map +1 -1
- package/app-layout/drawer/index.js +25 -5
- package/app-layout/drawer/index.js.map +1 -1
- package/app-layout/drawer/interfaces.d.ts +84 -0
- package/app-layout/drawer/interfaces.d.ts.map +1 -0
- package/app-layout/drawer/interfaces.js +2 -0
- package/app-layout/drawer/interfaces.js.map +1 -0
- package/app-layout/drawer/resizable-drawer.d.ts +4 -0
- package/app-layout/drawer/resizable-drawer.d.ts.map +1 -0
- package/app-layout/drawer/resizable-drawer.js +51 -0
- package/app-layout/drawer/resizable-drawer.js.map +1 -0
- package/app-layout/drawer/styles.css.js +10 -5
- package/app-layout/drawer/styles.scoped.css +46 -10
- package/app-layout/drawer/styles.selectors.js +10 -5
- package/app-layout/index.d.ts.map +1 -1
- package/app-layout/index.js +142 -17
- package/app-layout/index.js.map +1 -1
- package/app-layout/mobile-toolbar/index.d.ts +10 -1
- package/app-layout/mobile-toolbar/index.d.ts.map +1 -1
- package/app-layout/mobile-toolbar/index.js +3 -2
- package/app-layout/mobile-toolbar/index.js.map +1 -1
- package/app-layout/mobile-toolbar/styles.css.js +5 -4
- package/app-layout/mobile-toolbar/styles.scoped.css +11 -7
- package/app-layout/mobile-toolbar/styles.selectors.js +5 -4
- package/app-layout/notifications/styles.css.js +3 -3
- package/app-layout/notifications/styles.scoped.css +7 -7
- package/app-layout/notifications/styles.selectors.js +3 -3
- package/app-layout/test-classes/styles.css.js +18 -13
- package/app-layout/test-classes/styles.scoped.css +33 -13
- package/app-layout/test-classes/styles.selectors.js +18 -13
- package/app-layout/toggles/index.d.ts.map +1 -1
- package/app-layout/toggles/index.js +2 -2
- package/app-layout/toggles/index.js.map +1 -1
- package/app-layout/toggles/interfaces.d.ts +3 -1
- package/app-layout/toggles/interfaces.d.ts.map +1 -1
- package/app-layout/toggles/interfaces.js.map +1 -1
- package/app-layout/utils/use-drawer-focus-control.d.ts +21 -0
- package/app-layout/utils/use-drawer-focus-control.d.ts.map +1 -0
- package/app-layout/utils/use-drawer-focus-control.js +65 -0
- package/app-layout/utils/use-drawer-focus-control.js.map +1 -0
- package/app-layout/visual-refresh/app-bar.d.ts.map +1 -1
- package/app-layout/visual-refresh/app-bar.js +8 -6
- package/app-layout/visual-refresh/app-bar.js.map +1 -1
- package/app-layout/visual-refresh/context.d.ts +13 -5
- package/app-layout/visual-refresh/context.d.ts.map +1 -1
- package/app-layout/visual-refresh/context.js +104 -49
- package/app-layout/visual-refresh/context.js.map +1 -1
- package/app-layout/visual-refresh/drawers.d.ts +47 -0
- package/app-layout/visual-refresh/drawers.d.ts.map +1 -0
- package/app-layout/visual-refresh/drawers.js +127 -0
- package/app-layout/visual-refresh/drawers.js.map +1 -0
- package/app-layout/visual-refresh/header.js +2 -2
- package/app-layout/visual-refresh/header.js.map +1 -1
- package/app-layout/visual-refresh/index.d.ts.map +1 -1
- package/app-layout/visual-refresh/index.js +3 -1
- package/app-layout/visual-refresh/index.js.map +1 -1
- package/app-layout/visual-refresh/layout.d.ts.map +1 -1
- package/app-layout/visual-refresh/layout.js +5 -42
- package/app-layout/visual-refresh/layout.js.map +1 -1
- package/app-layout/visual-refresh/main.d.ts.map +1 -1
- package/app-layout/visual-refresh/main.js +2 -3
- package/app-layout/visual-refresh/main.js.map +1 -1
- package/app-layout/visual-refresh/navigation.js +2 -2
- package/app-layout/visual-refresh/navigation.js.map +1 -1
- package/app-layout/visual-refresh/notifications.d.ts.map +1 -1
- package/app-layout/visual-refresh/notifications.js +2 -2
- package/app-layout/visual-refresh/notifications.js.map +1 -1
- package/app-layout/visual-refresh/split-panel.js +2 -2
- package/app-layout/visual-refresh/split-panel.js.map +1 -1
- package/app-layout/visual-refresh/styles.css.js +71 -61
- package/app-layout/visual-refresh/styles.scoped.css +437 -229
- package/app-layout/visual-refresh/styles.selectors.js +71 -61
- package/app-layout/visual-refresh/tools.d.ts.map +1 -1
- package/app-layout/visual-refresh/tools.js +7 -3
- package/app-layout/visual-refresh/tools.js.map +1 -1
- package/app-layout/visual-refresh/trigger-button.d.ts +4 -3
- package/app-layout/visual-refresh/trigger-button.d.ts.map +1 -1
- package/app-layout/visual-refresh/trigger-button.js +5 -6
- package/app-layout/visual-refresh/trigger-button.js.map +1 -1
- package/area-chart/internal.js +1 -1
- package/area-chart/internal.js.map +1 -1
- package/breadcrumb-group/item/item.d.ts.map +1 -1
- package/breadcrumb-group/item/item.js +2 -5
- package/breadcrumb-group/item/item.js.map +1 -1
- package/breadcrumb-group/item/styles.css.js +9 -9
- package/breadcrumb-group/item/styles.scoped.css +17 -17
- package/breadcrumb-group/item/styles.selectors.js +9 -9
- package/button/internal.d.ts.map +1 -1
- package/button/internal.js +2 -3
- package/button/internal.js.map +1 -1
- package/button/styles.css.js +19 -18
- package/button/styles.scoped.css +136 -136
- package/button/styles.selectors.js +19 -18
- package/calendar/grid/index.d.ts.map +1 -1
- package/calendar/grid/index.js +2 -4
- package/calendar/grid/index.js.map +1 -1
- package/calendar/styles.css.js +18 -18
- package/calendar/styles.scoped.css +38 -38
- package/calendar/styles.selectors.js +18 -18
- package/code-editor/styles.css.js +32 -32
- package/code-editor/styles.scoped.css +109 -109
- package/code-editor/styles.selectors.js +32 -32
- package/code-editor/tab-button.d.ts.map +1 -1
- package/code-editor/tab-button.js +2 -4
- package/code-editor/tab-button.js.map +1 -1
- package/date-picker/index.d.ts.map +1 -1
- package/date-picker/index.js +1 -3
- package/date-picker/index.js.map +1 -1
- package/date-picker/styles.css.js +7 -7
- package/date-picker/styles.scoped.css +9 -9
- package/date-picker/styles.selectors.js +7 -7
- package/date-range-picker/calendar/grids/grid.d.ts.map +1 -1
- package/date-range-picker/calendar/grids/grid.js +1 -3
- package/date-range-picker/calendar/grids/grid.js.map +1 -1
- package/date-range-picker/calendar/grids/index.d.ts.map +1 -1
- package/date-range-picker/calendar/grids/index.js +1 -3
- package/date-range-picker/calendar/grids/index.js.map +1 -1
- package/date-range-picker/calendar/grids/styles.css.js +25 -25
- package/date-range-picker/calendar/grids/styles.scoped.css +42 -42
- package/date-range-picker/calendar/grids/styles.selectors.js +25 -25
- package/date-range-picker/dropdown.d.ts.map +1 -1
- package/date-range-picker/dropdown.js +1 -3
- package/date-range-picker/dropdown.js.map +1 -1
- package/date-range-picker/styles.css.js +38 -38
- package/date-range-picker/styles.scoped.css +45 -45
- package/date-range-picker/styles.selectors.js +38 -38
- package/expandable-section/expandable-section-header.d.ts.map +1 -1
- package/expandable-section/expandable-section-header.js +3 -7
- package/expandable-section/expandable-section-header.js.map +1 -1
- package/expandable-section/styles.css.js +23 -23
- package/expandable-section/styles.scoped.css +44 -44
- package/expandable-section/styles.selectors.js +23 -23
- package/flashbar/collapsible-flashbar.d.ts.map +1 -1
- package/flashbar/collapsible-flashbar.js +1 -3
- package/flashbar/collapsible-flashbar.js.map +1 -1
- package/flashbar/flash.d.ts.map +1 -1
- package/flashbar/flash.js +1 -3
- package/flashbar/flash.js.map +1 -1
- package/flashbar/styles.css.js +45 -45
- package/flashbar/styles.scoped.css +169 -169
- package/flashbar/styles.selectors.js +45 -45
- package/internal/base-component/styles.scoped.css +24 -0
- package/internal/components/abstract-switch/index.d.ts.map +1 -1
- package/internal/components/abstract-switch/index.js +8 -4
- package/internal/components/abstract-switch/index.js.map +1 -1
- package/internal/components/abstract-switch/styles.css.js +13 -13
- package/internal/components/abstract-switch/styles.scoped.css +19 -19
- package/internal/components/abstract-switch/styles.selectors.js +13 -13
- package/internal/components/button-trigger/index.d.ts.map +1 -1
- package/internal/components/button-trigger/index.js +1 -3
- package/internal/components/button-trigger/index.js.map +1 -1
- package/internal/components/button-trigger/styles.css.js +9 -9
- package/internal/components/button-trigger/styles.scoped.css +23 -23
- package/internal/components/button-trigger/styles.selectors.js +9 -9
- package/internal/components/chart-legend/index.d.ts.map +1 -1
- package/internal/components/chart-legend/index.js +2 -4
- package/internal/components/chart-legend/index.js.map +1 -1
- package/internal/components/chart-legend/styles.css.js +6 -6
- package/internal/components/chart-legend/styles.scoped.css +15 -15
- package/internal/components/chart-legend/styles.selectors.js +6 -6
- package/internal/components/chart-plot/focus-outline.d.ts.map +1 -1
- package/internal/components/chart-plot/focus-outline.js +25 -3
- package/internal/components/chart-plot/focus-outline.js.map +1 -1
- package/internal/components/filtering-token/index.d.ts +2 -1
- package/internal/components/filtering-token/index.d.ts.map +1 -1
- package/internal/components/filtering-token/index.js +3 -5
- package/internal/components/filtering-token/index.js.map +1 -1
- package/internal/components/filtering-token/styles.css.js +7 -7
- package/internal/components/filtering-token/styles.scoped.css +13 -13
- package/internal/components/filtering-token/styles.selectors.js +7 -7
- package/internal/components/menu-dropdown/index.d.ts.map +1 -1
- package/internal/components/menu-dropdown/index.js +2 -4
- package/internal/components/menu-dropdown/index.js.map +1 -1
- package/internal/components/menu-dropdown/styles.css.js +7 -7
- package/internal/components/menu-dropdown/styles.scoped.css +13 -13
- package/internal/components/menu-dropdown/styles.selectors.js +7 -7
- package/internal/components/token-list/index.d.ts +1 -1
- package/internal/components/token-list/index.d.ts.map +1 -1
- package/internal/components/token-list/index.js +3 -3
- package/internal/components/token-list/index.js.map +1 -1
- package/internal/components/token-list/interfaces.d.ts +0 -1
- package/internal/components/token-list/interfaces.d.ts.map +1 -1
- package/internal/components/token-list/interfaces.js.map +1 -1
- package/internal/components/token-list/styles.css.js +9 -9
- package/internal/components/token-list/styles.scoped.css +20 -20
- package/internal/components/token-list/styles.selectors.js +9 -9
- package/internal/components/token-list/token-focus-controller.js +1 -1
- package/internal/components/token-list/token-focus-controller.js.map +1 -1
- package/internal/components/token-list/token-limit-toggle.d.ts.map +1 -1
- package/internal/components/token-list/token-limit-toggle.js +1 -3
- package/internal/components/token-list/token-limit-toggle.js.map +1 -1
- package/internal/environment.js +1 -1
- package/internal/generated/custom-css-properties/index.d.ts.map +1 -1
- package/internal/generated/custom-css-properties/index.js +31 -30
- package/internal/generated/custom-css-properties/index.js.map +1 -1
- package/internal/generated/styles/tokens.d.ts +2 -0
- package/internal/generated/styles/tokens.js +2 -0
- package/internal/generated/theming/index.cjs +140 -0
- package/internal/generated/theming/index.js +140 -0
- package/internal/hooks/focus-visible/index.d.ts +2 -5
- package/internal/hooks/focus-visible/index.d.ts.map +1 -1
- package/internal/hooks/focus-visible/index.js +42 -22
- package/internal/hooks/focus-visible/index.js.map +1 -1
- package/internal/hooks/use-base-component/index.d.ts.map +1 -1
- package/internal/hooks/use-base-component/index.js +2 -0
- package/internal/hooks/use-base-component/index.js.map +1 -1
- package/internal/manifest.json +1 -1
- package/link/internal.d.ts.map +1 -1
- package/link/internal.js +1 -3
- package/link/internal.js.map +1 -1
- package/link/styles.css.js +20 -20
- package/link/styles.scoped.css +71 -71
- package/link/styles.selectors.js +20 -20
- package/mixed-line-bar-chart/internal.js +1 -1
- package/mixed-line-bar-chart/internal.js.map +1 -1
- package/package.json +1 -1
- package/pagination/internal.d.ts.map +1 -1
- package/pagination/internal.js +1 -3
- package/pagination/internal.js.map +1 -1
- package/pagination/styles.css.js +9 -9
- package/pagination/styles.scoped.css +23 -23
- package/pagination/styles.selectors.js +9 -9
- package/pie-chart/index.js +1 -1
- package/pie-chart/index.js.map +1 -1
- package/popover/internal.d.ts.map +1 -1
- package/popover/internal.js +1 -3
- package/popover/internal.js.map +1 -1
- package/popover/styles.css.js +50 -50
- package/popover/styles.scoped.css +63 -63
- package/popover/styles.selectors.js +50 -50
- package/property-filter/index.d.ts.map +1 -1
- package/property-filter/index.js +2 -2
- package/property-filter/index.js.map +1 -1
- package/property-filter/token.d.ts.map +1 -1
- package/property-filter/token.js +1 -1
- package/property-filter/token.js.map +1 -1
- package/segmented-control/segment.d.ts.map +1 -1
- package/segmented-control/segment.js +1 -3
- package/segmented-control/segment.js.map +1 -1
- package/segmented-control/styles.css.js +14 -14
- package/segmented-control/styles.scoped.css +33 -33
- package/segmented-control/styles.selectors.js +14 -14
- package/side-navigation/internal.d.ts.map +1 -1
- package/side-navigation/internal.js +2 -5
- package/side-navigation/internal.js.map +1 -1
- package/side-navigation/styles.css.js +27 -27
- package/side-navigation/styles.scoped.css +37 -37
- package/side-navigation/styles.selectors.js +27 -27
- package/space-between/internal.js +1 -1
- package/space-between/internal.js.map +1 -1
- package/space-between/styles.css.js +20 -28
- package/space-between/styles.scoped.css +37 -101
- package/space-between/styles.selectors.js +20 -28
- package/split-panel/index.d.ts.map +1 -1
- package/split-panel/index.js +1 -3
- package/split-panel/index.js.map +1 -1
- package/split-panel/styles.css.js +59 -59
- package/split-panel/styles.scoped.css +81 -81
- package/split-panel/styles.selectors.js +59 -59
- package/table/body-cell/index.d.ts.map +1 -1
- package/table/body-cell/index.js +3 -3
- package/table/body-cell/index.js.map +1 -1
- package/table/body-cell/styles.css.js +18 -18
- package/table/body-cell/styles.scoped.css +57 -55
- package/table/body-cell/styles.selectors.js +18 -18
- package/table/header-cell/index.d.ts.map +1 -1
- package/table/header-cell/index.js +11 -9
- package/table/header-cell/index.js.map +1 -1
- package/table/header-cell/styles.css.js +19 -19
- package/table/header-cell/styles.scoped.css +32 -32
- package/table/header-cell/styles.selectors.js +19 -19
- package/table/internal.d.ts.map +1 -1
- package/table/internal.js +1 -3
- package/table/internal.js.map +1 -1
- package/table/resizer/styles.css.js +6 -6
- package/table/resizer/styles.scoped.css +11 -11
- package/table/resizer/styles.selectors.js +6 -6
- package/table/styles.css.js +33 -33
- package/table/styles.scoped.css +41 -41
- package/table/styles.selectors.js +33 -33
- package/tabs/index.d.ts.map +1 -1
- package/tabs/index.js +8 -3
- package/tabs/index.js.map +1 -1
- package/tabs/styles.css.js +21 -21
- package/tabs/styles.scoped.css +38 -38
- package/tabs/styles.selectors.js +21 -21
- package/tabs/tab-header-bar.d.ts.map +1 -1
- package/tabs/tab-header-bar.js +9 -3
- package/tabs/tab-header-bar.js.map +1 -1
- package/tag-editor/internal.d.ts.map +1 -1
- package/tag-editor/internal.js +2 -4
- package/tag-editor/internal.js.map +1 -1
- package/tag-editor/styles.css.js +3 -3
- package/tag-editor/styles.scoped.css +10 -10
- package/tag-editor/styles.selectors.js +3 -3
- package/token-group/dismiss-button.d.ts.map +1 -1
- package/token-group/dismiss-button.js +1 -3
- package/token-group/dismiss-button.js.map +1 -1
- package/token-group/internal.js +2 -2
- package/token-group/internal.js.map +1 -1
- package/token-group/styles.css.js +5 -5
- package/token-group/styles.scoped.css +12 -12
- package/token-group/styles.selectors.js +5 -5
- package/token-group/token.d.ts +3 -5
- package/token-group/token.d.ts.map +1 -1
- package/token-group/token.js +2 -2
- package/token-group/token.js.map +1 -1
- package/top-navigation/1.0-beta/internal.d.ts.map +1 -1
- package/top-navigation/1.0-beta/internal.js +1 -3
- package/top-navigation/1.0-beta/internal.js.map +1 -1
- package/top-navigation/1.0-beta/styles.css.js +25 -25
- package/top-navigation/1.0-beta/styles.scoped.css +42 -42
- package/top-navigation/1.0-beta/styles.selectors.js +25 -25
- package/top-navigation/internal.d.ts.map +1 -1
- package/top-navigation/internal.js +1 -3
- package/top-navigation/internal.js.map +1 -1
- package/top-navigation/parts/overflow-menu/menu-item.d.ts.map +1 -1
- package/top-navigation/parts/overflow-menu/menu-item.js +3 -7
- package/top-navigation/parts/overflow-menu/menu-item.js.map +1 -1
- package/top-navigation/styles.css.js +47 -47
- package/top-navigation/styles.scoped.css +66 -66
- package/top-navigation/styles.selectors.js +47 -47
- package/tutorial-panel/components/tutorial-list/index.d.ts.map +1 -1
- package/tutorial-panel/components/tutorial-list/index.js +1 -3
- package/tutorial-panel/components/tutorial-list/index.js.map +1 -1
- package/tutorial-panel/components/tutorial-list/styles.css.js +18 -18
- package/tutorial-panel/components/tutorial-list/styles.scoped.css +27 -27
- package/tutorial-panel/components/tutorial-list/styles.selectors.js +18 -18
- package/wizard/styles.css.js +32 -32
- package/wizard/styles.scoped.css +63 -63
- package/wizard/styles.selectors.js +32 -32
- package/wizard/wizard-form.d.ts.map +1 -1
- package/wizard/wizard-form.js +1 -3
- package/wizard/wizard-form.js.map +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"annotation-trigger.d.ts","sourceRoot":"lib/default/","sources":["annotation-context/annotation/annotation-trigger.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAsB,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"annotation-trigger.d.ts","sourceRoot":"lib/default/","sources":["annotation-context/annotation/annotation-trigger.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAsB,MAAM,OAAO,CAAC;AAG3C,OAAO,EAAE,sBAAsB,EAAE,MAAM,eAAe,CAAC;AAEvD,MAAM,WAAW,sBAAsB;IACrC,IAAI,EAAE,OAAO,CAAC;IAEd,OAAO,EAAE,MAAM,IAAI,CAAC;IAEpB,WAAW,EAAE,sBAAsB,CAAC,aAAa,CAAC,CAAC;IACnD,kBAAkB,EAAE,MAAM,CAAC;IAC3B,eAAe,EAAE,MAAM,CAAC;CACzB;;AAED,wBAuBG"}
|
|
@@ -3,14 +3,12 @@
|
|
|
3
3
|
import React, { useCallback } from 'react';
|
|
4
4
|
import styles from './styles.css.js';
|
|
5
5
|
import { AnnotationIcon } from './annotation-icon';
|
|
6
|
-
import useFocusVisible from '../../internal/hooks/focus-visible/index.js';
|
|
7
6
|
export default React.forwardRef(function AnnotationTrigger({ open, onClick: onClickHandler, i18nStrings, taskLocalStepIndex, totalLocalSteps }, ref) {
|
|
8
|
-
const focusVisible = useFocusVisible();
|
|
9
7
|
const onClick = useCallback((event) => {
|
|
10
8
|
event.preventDefault();
|
|
11
9
|
onClickHandler();
|
|
12
10
|
}, [onClickHandler]);
|
|
13
|
-
return (React.createElement("button",
|
|
11
|
+
return (React.createElement("button", { ref: ref, className: styles.hotspot, "aria-haspopup": "dialog", "aria-label": i18nStrings.labelHotspot(open, taskLocalStepIndex !== null && taskLocalStepIndex !== void 0 ? taskLocalStepIndex : 0, totalLocalSteps !== null && totalLocalSteps !== void 0 ? totalLocalSteps : 0), onClick: onClick },
|
|
14
12
|
React.createElement(AnnotationIcon, { open: open })));
|
|
15
13
|
});
|
|
16
14
|
//# sourceMappingURL=annotation-trigger.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"annotation-trigger.js","sourceRoot":"lib/default/","sources":["annotation-context/annotation/annotation-trigger.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AAC3C,OAAO,MAAM,MAAM,iBAAiB,CAAC;AACrC,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"annotation-trigger.js","sourceRoot":"lib/default/","sources":["annotation-context/annotation/annotation-trigger.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AAC3C,OAAO,MAAM,MAAM,iBAAiB,CAAC;AACrC,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAanD,eAAe,KAAK,CAAC,UAAU,CAA4C,SAAS,iBAAiB,CACnG,EAAE,IAAI,EAAE,OAAO,EAAE,cAAc,EAAE,WAAW,EAAE,kBAAkB,EAAE,eAAe,EAA0B,EAC3G,GAAG;IAEH,MAAM,OAAO,GAAG,WAAW,CACzB,CAAC,KAAuB,EAAE,EAAE;QAC1B,KAAK,CAAC,cAAc,EAAE,CAAC;QACvB,cAAc,EAAE,CAAC;IACnB,CAAC,EACD,CAAC,cAAc,CAAC,CACjB,CAAC;IAEF,OAAO,CACL,gCACE,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,MAAM,CAAC,OAAO,mBACX,QAAQ,gBACV,WAAW,CAAC,YAAY,CAAC,IAAI,EAAE,kBAAkB,aAAlB,kBAAkB,cAAlB,kBAAkB,GAAI,CAAC,EAAE,eAAe,aAAf,eAAe,cAAf,eAAe,GAAI,CAAC,CAAC,EACzF,OAAO,EAAE,OAAO;QAEhB,oBAAC,cAAc,IAAC,IAAI,EAAE,IAAI,GAAI,CACvB,CACV,CAAC;AACJ,CAAC,CAAC,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useCallback } from 'react';\nimport styles from './styles.css.js';\nimport { AnnotationIcon } from './annotation-icon';\nimport { AnnotationContextProps } from '../interfaces';\n\nexport interface AnnotationTriggerProps {\n open: boolean;\n\n onClick: () => void;\n\n i18nStrings: AnnotationContextProps['i18nStrings'];\n taskLocalStepIndex: number;\n totalLocalSteps: number;\n}\n\nexport default React.forwardRef<HTMLButtonElement, AnnotationTriggerProps>(function AnnotationTrigger(\n { open, onClick: onClickHandler, i18nStrings, taskLocalStepIndex, totalLocalSteps }: AnnotationTriggerProps,\n ref\n) {\n const onClick = useCallback(\n (event: React.MouseEvent) => {\n event.preventDefault();\n onClickHandler();\n },\n [onClickHandler]\n );\n\n return (\n <button\n ref={ref}\n className={styles.hotspot}\n aria-haspopup=\"dialog\"\n aria-label={i18nStrings.labelHotspot(open, taskLocalStepIndex ?? 0, totalLocalSteps ?? 0)}\n onClick={onClick}\n >\n <AnnotationIcon open={open} />\n </button>\n );\n});\n"]}
|
|
@@ -1,29 +1,29 @@
|
|
|
1
1
|
|
|
2
2
|
import './styles.scoped.css';
|
|
3
3
|
export default {
|
|
4
|
-
"arrow": "
|
|
5
|
-
"arrow-outer": "awsui_arrow-
|
|
6
|
-
"arrow-inner": "awsui_arrow-
|
|
7
|
-
"arrow-position-right-top": "awsui_arrow-position-right-
|
|
8
|
-
"arrow-position-right-bottom": "awsui_arrow-position-right-
|
|
9
|
-
"arrow-position-left-top": "awsui_arrow-position-left-
|
|
10
|
-
"arrow-position-left-bottom": "awsui_arrow-position-left-
|
|
11
|
-
"arrow-position-top-center": "awsui_arrow-position-top-
|
|
12
|
-
"arrow-position-top-responsive": "awsui_arrow-position-top-
|
|
13
|
-
"arrow-position-bottom-center": "awsui_arrow-position-bottom-
|
|
14
|
-
"arrow-position-bottom-responsive": "awsui_arrow-position-bottom-
|
|
15
|
-
"annotation": "
|
|
16
|
-
"next-button": "awsui_next-
|
|
17
|
-
"previous-button": "awsui_previous-
|
|
18
|
-
"finish-button": "awsui_finish-
|
|
19
|
-
"header": "
|
|
20
|
-
"step-counter-content": "awsui_step-counter-
|
|
21
|
-
"content": "
|
|
22
|
-
"description": "
|
|
23
|
-
"actionBar": "
|
|
24
|
-
"stepCounter": "
|
|
25
|
-
"divider": "
|
|
26
|
-
"hotspot": "
|
|
27
|
-
"icon": "
|
|
4
|
+
"arrow": "awsui_arrow_1hpp3_1fwnq_93",
|
|
5
|
+
"arrow-outer": "awsui_arrow-outer_1hpp3_1fwnq_97",
|
|
6
|
+
"arrow-inner": "awsui_arrow-inner_1hpp3_1fwnq_97",
|
|
7
|
+
"arrow-position-right-top": "awsui_arrow-position-right-top_1hpp3_1fwnq_128",
|
|
8
|
+
"arrow-position-right-bottom": "awsui_arrow-position-right-bottom_1hpp3_1fwnq_128",
|
|
9
|
+
"arrow-position-left-top": "awsui_arrow-position-left-top_1hpp3_1fwnq_131",
|
|
10
|
+
"arrow-position-left-bottom": "awsui_arrow-position-left-bottom_1hpp3_1fwnq_131",
|
|
11
|
+
"arrow-position-top-center": "awsui_arrow-position-top-center_1hpp3_1fwnq_134",
|
|
12
|
+
"arrow-position-top-responsive": "awsui_arrow-position-top-responsive_1hpp3_1fwnq_134",
|
|
13
|
+
"arrow-position-bottom-center": "awsui_arrow-position-bottom-center_1hpp3_1fwnq_137",
|
|
14
|
+
"arrow-position-bottom-responsive": "awsui_arrow-position-bottom-responsive_1hpp3_1fwnq_137",
|
|
15
|
+
"annotation": "awsui_annotation_1hpp3_1fwnq_145",
|
|
16
|
+
"next-button": "awsui_next-button_1hpp3_1fwnq_146",
|
|
17
|
+
"previous-button": "awsui_previous-button_1hpp3_1fwnq_147",
|
|
18
|
+
"finish-button": "awsui_finish-button_1hpp3_1fwnq_148",
|
|
19
|
+
"header": "awsui_header_1hpp3_1fwnq_149",
|
|
20
|
+
"step-counter-content": "awsui_step-counter-content_1hpp3_1fwnq_150",
|
|
21
|
+
"content": "awsui_content_1hpp3_1fwnq_151",
|
|
22
|
+
"description": "awsui_description_1hpp3_1fwnq_155",
|
|
23
|
+
"actionBar": "awsui_actionBar_1hpp3_1fwnq_160",
|
|
24
|
+
"stepCounter": "awsui_stepCounter_1hpp3_1fwnq_167",
|
|
25
|
+
"divider": "awsui_divider_1hpp3_1fwnq_171",
|
|
26
|
+
"hotspot": "awsui_hotspot_1hpp3_1fwnq_175",
|
|
27
|
+
"icon": "awsui_icon_1hpp3_1fwnq_215"
|
|
28
28
|
};
|
|
29
29
|
|
|
@@ -90,11 +90,11 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
90
90
|
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
91
91
|
SPDX-License-Identifier: Apache-2.0
|
|
92
92
|
*/
|
|
93
|
-
.
|
|
93
|
+
.awsui_arrow_1hpp3_1fwnq_93:not(#\9) {
|
|
94
94
|
width: 20px;
|
|
95
95
|
height: 10px;
|
|
96
96
|
}
|
|
97
|
-
.awsui_arrow-
|
|
97
|
+
.awsui_arrow-outer_1hpp3_1fwnq_97:not(#\9), .awsui_arrow-inner_1hpp3_1fwnq_97:not(#\9) {
|
|
98
98
|
position: absolute;
|
|
99
99
|
overflow: hidden;
|
|
100
100
|
width: 20px;
|
|
@@ -102,7 +102,7 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
102
102
|
top: 0;
|
|
103
103
|
left: 0;
|
|
104
104
|
}
|
|
105
|
-
.awsui_arrow-
|
|
105
|
+
.awsui_arrow-outer_1hpp3_1fwnq_97:not(#\9)::after, .awsui_arrow-inner_1hpp3_1fwnq_97:not(#\9)::after {
|
|
106
106
|
content: "";
|
|
107
107
|
box-sizing: border-box;
|
|
108
108
|
display: inline-block;
|
|
@@ -115,26 +115,26 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
115
115
|
transform: rotate(45deg);
|
|
116
116
|
transform-origin: 0 100%;
|
|
117
117
|
}
|
|
118
|
-
.awsui_arrow-
|
|
118
|
+
.awsui_arrow-outer_1hpp3_1fwnq_97:not(#\9)::after {
|
|
119
119
|
background-color: var(--color-border-status-info-546i7i, #0972d3);
|
|
120
120
|
}
|
|
121
|
-
.awsui_arrow-
|
|
121
|
+
.awsui_arrow-inner_1hpp3_1fwnq_97:not(#\9) {
|
|
122
122
|
top: 2px;
|
|
123
123
|
}
|
|
124
|
-
.awsui_arrow-
|
|
124
|
+
.awsui_arrow-inner_1hpp3_1fwnq_97:not(#\9)::after {
|
|
125
125
|
border-radius: 1px 0 0 0;
|
|
126
126
|
background-color: var(--color-background-status-info-usb30e, #f2f8fd);
|
|
127
127
|
}
|
|
128
|
-
.awsui_arrow-position-right-
|
|
128
|
+
.awsui_arrow-position-right-top_1hpp3_1fwnq_128 > .awsui_arrow-outer_1hpp3_1fwnq_97:not(#\9)::after, .awsui_arrow-position-right-bottom_1hpp3_1fwnq_128 > .awsui_arrow-outer_1hpp3_1fwnq_97:not(#\9)::after {
|
|
129
129
|
box-shadow: -0.71px 0.71px 4px -2px var(--color-shadow-default-3se70f, rgba(0, 7, 22, 0.12));
|
|
130
130
|
}
|
|
131
|
-
.awsui_arrow-position-left-
|
|
131
|
+
.awsui_arrow-position-left-top_1hpp3_1fwnq_131 > .awsui_arrow-outer_1hpp3_1fwnq_97:not(#\9)::after, .awsui_arrow-position-left-bottom_1hpp3_1fwnq_131 > .awsui_arrow-outer_1hpp3_1fwnq_97:not(#\9)::after {
|
|
132
132
|
box-shadow: 0.71px -0.71px 4px -2px var(--color-shadow-default-3se70f, rgba(0, 7, 22, 0.12));
|
|
133
133
|
}
|
|
134
|
-
.awsui_arrow-position-top-
|
|
134
|
+
.awsui_arrow-position-top-center_1hpp3_1fwnq_134 > .awsui_arrow-outer_1hpp3_1fwnq_97:not(#\9)::after, .awsui_arrow-position-top-responsive_1hpp3_1fwnq_134 > .awsui_arrow-outer_1hpp3_1fwnq_97:not(#\9)::after {
|
|
135
135
|
box-shadow: -0.71px -0.71px 4px -2px var(--color-shadow-default-3se70f, rgba(0, 7, 22, 0.12));
|
|
136
136
|
}
|
|
137
|
-
.awsui_arrow-position-bottom-
|
|
137
|
+
.awsui_arrow-position-bottom-center_1hpp3_1fwnq_137 > .awsui_arrow-outer_1hpp3_1fwnq_97:not(#\9)::after, .awsui_arrow-position-bottom-responsive_1hpp3_1fwnq_137 > .awsui_arrow-outer_1hpp3_1fwnq_97:not(#\9)::after {
|
|
138
138
|
box-shadow: 0.71px 0.71px 4px -2px var(--color-shadow-default-3se70f, rgba(0, 7, 22, 0.12));
|
|
139
139
|
}
|
|
140
140
|
|
|
@@ -142,37 +142,37 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
142
142
|
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
143
143
|
SPDX-License-Identifier: Apache-2.0
|
|
144
144
|
*/
|
|
145
|
-
.
|
|
146
|
-
.awsui_next-
|
|
147
|
-
.awsui_previous-
|
|
148
|
-
.awsui_finish-
|
|
149
|
-
.
|
|
150
|
-
.awsui_step-counter-
|
|
151
|
-
.
|
|
145
|
+
.awsui_annotation_1hpp3_1fwnq_145:not(#\9),
|
|
146
|
+
.awsui_next-button_1hpp3_1fwnq_146:not(#\9),
|
|
147
|
+
.awsui_previous-button_1hpp3_1fwnq_147:not(#\9),
|
|
148
|
+
.awsui_finish-button_1hpp3_1fwnq_148:not(#\9),
|
|
149
|
+
.awsui_header_1hpp3_1fwnq_149:not(#\9),
|
|
150
|
+
.awsui_step-counter-content_1hpp3_1fwnq_150:not(#\9),
|
|
151
|
+
.awsui_content_1hpp3_1fwnq_151:not(#\9) {
|
|
152
152
|
/* used in test-utils */
|
|
153
153
|
}
|
|
154
154
|
|
|
155
|
-
.
|
|
155
|
+
.awsui_description_1hpp3_1fwnq_155:not(#\9) {
|
|
156
156
|
overflow: hidden;
|
|
157
157
|
margin-top: var(--space-xxs-ynfts5, 4px);
|
|
158
158
|
}
|
|
159
159
|
|
|
160
|
-
.
|
|
160
|
+
.awsui_actionBar_1hpp3_1fwnq_160:not(#\9) {
|
|
161
161
|
display: flex;
|
|
162
162
|
justify-content: space-between;
|
|
163
163
|
align-items: center;
|
|
164
164
|
position: relative;
|
|
165
165
|
}
|
|
166
166
|
|
|
167
|
-
.
|
|
167
|
+
.awsui_stepCounter_1hpp3_1fwnq_167:not(#\9) {
|
|
168
168
|
margin-right: 20px;
|
|
169
169
|
}
|
|
170
170
|
|
|
171
|
-
.
|
|
171
|
+
.awsui_divider_1hpp3_1fwnq_171:not(#\9) {
|
|
172
172
|
border-bottom: var(--border-divider-section-width-4wm2it, 2px) solid var(--color-border-divider-default-7s2wjw, #e9ebed);
|
|
173
173
|
}
|
|
174
174
|
|
|
175
|
-
.
|
|
175
|
+
.awsui_hotspot_1hpp3_1fwnq_175:not(#\9) {
|
|
176
176
|
/* stylelint-disable-next-line plugin/no-unsupported-browser-features */
|
|
177
177
|
border-collapse: separate;
|
|
178
178
|
border-spacing: 0;
|
|
@@ -213,21 +213,21 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
213
213
|
border: none;
|
|
214
214
|
padding: 0;
|
|
215
215
|
cursor: pointer;
|
|
216
|
-
scroll-margin: var(--awsui-content-scroll-margin-
|
|
216
|
+
scroll-margin: var(--awsui-content-scroll-margin-3j0evk, 40px 0 0 0);
|
|
217
217
|
width: 16px;
|
|
218
218
|
height: 16px;
|
|
219
219
|
}
|
|
220
|
-
.
|
|
220
|
+
.awsui_hotspot_1hpp3_1fwnq_175:not(#\9):focus {
|
|
221
221
|
outline: none;
|
|
222
222
|
}
|
|
223
|
-
|
|
223
|
+
body[data-awsui-focus-visible=true] .awsui_hotspot_1hpp3_1fwnq_175:not(#\9):focus {
|
|
224
224
|
position: relative;
|
|
225
225
|
}
|
|
226
|
-
|
|
226
|
+
body[data-awsui-focus-visible=true] .awsui_hotspot_1hpp3_1fwnq_175:not(#\9):focus {
|
|
227
227
|
outline: 2px dotted transparent;
|
|
228
228
|
outline-offset: calc(2px - 1px);
|
|
229
229
|
}
|
|
230
|
-
|
|
230
|
+
body[data-awsui-focus-visible=true] .awsui_hotspot_1hpp3_1fwnq_175:not(#\9):focus::before {
|
|
231
231
|
content: " ";
|
|
232
232
|
display: block;
|
|
233
233
|
position: absolute;
|
|
@@ -238,13 +238,13 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
238
238
|
border-radius: var(--border-radius-control-circular-focus-ring-qawzn7, 4px);
|
|
239
239
|
box-shadow: 0 0 0 2px var(--color-border-item-focused-ap3b6s, #0972d3);
|
|
240
240
|
}
|
|
241
|
-
.
|
|
241
|
+
.awsui_hotspot_1hpp3_1fwnq_175 > .awsui_icon_1hpp3_1fwnq_215:not(#\9) {
|
|
242
242
|
position: relative;
|
|
243
243
|
stroke: var(--color-text-link-default-5f186r, #0972d3);
|
|
244
244
|
}
|
|
245
|
-
.
|
|
245
|
+
.awsui_hotspot_1hpp3_1fwnq_175:not(#\9):hover > .awsui_icon_1hpp3_1fwnq_215 {
|
|
246
246
|
stroke: var(--color-text-link-hover-kololx, #033160);
|
|
247
247
|
}
|
|
248
|
-
.
|
|
248
|
+
.awsui_hotspot_1hpp3_1fwnq_175:not(#\9):active > .awsui_icon_1hpp3_1fwnq_215 {
|
|
249
249
|
stroke: var(--color-text-link-default-5f186r, #0972d3);
|
|
250
250
|
}
|
|
@@ -2,29 +2,29 @@
|
|
|
2
2
|
// es-module interop with Babel and Typescript
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
4
|
module.exports.default = {
|
|
5
|
-
"arrow": "
|
|
6
|
-
"arrow-outer": "awsui_arrow-
|
|
7
|
-
"arrow-inner": "awsui_arrow-
|
|
8
|
-
"arrow-position-right-top": "awsui_arrow-position-right-
|
|
9
|
-
"arrow-position-right-bottom": "awsui_arrow-position-right-
|
|
10
|
-
"arrow-position-left-top": "awsui_arrow-position-left-
|
|
11
|
-
"arrow-position-left-bottom": "awsui_arrow-position-left-
|
|
12
|
-
"arrow-position-top-center": "awsui_arrow-position-top-
|
|
13
|
-
"arrow-position-top-responsive": "awsui_arrow-position-top-
|
|
14
|
-
"arrow-position-bottom-center": "awsui_arrow-position-bottom-
|
|
15
|
-
"arrow-position-bottom-responsive": "awsui_arrow-position-bottom-
|
|
16
|
-
"annotation": "
|
|
17
|
-
"next-button": "awsui_next-
|
|
18
|
-
"previous-button": "awsui_previous-
|
|
19
|
-
"finish-button": "awsui_finish-
|
|
20
|
-
"header": "
|
|
21
|
-
"step-counter-content": "awsui_step-counter-
|
|
22
|
-
"content": "
|
|
23
|
-
"description": "
|
|
24
|
-
"actionBar": "
|
|
25
|
-
"stepCounter": "
|
|
26
|
-
"divider": "
|
|
27
|
-
"hotspot": "
|
|
28
|
-
"icon": "
|
|
5
|
+
"arrow": "awsui_arrow_1hpp3_1fwnq_93",
|
|
6
|
+
"arrow-outer": "awsui_arrow-outer_1hpp3_1fwnq_97",
|
|
7
|
+
"arrow-inner": "awsui_arrow-inner_1hpp3_1fwnq_97",
|
|
8
|
+
"arrow-position-right-top": "awsui_arrow-position-right-top_1hpp3_1fwnq_128",
|
|
9
|
+
"arrow-position-right-bottom": "awsui_arrow-position-right-bottom_1hpp3_1fwnq_128",
|
|
10
|
+
"arrow-position-left-top": "awsui_arrow-position-left-top_1hpp3_1fwnq_131",
|
|
11
|
+
"arrow-position-left-bottom": "awsui_arrow-position-left-bottom_1hpp3_1fwnq_131",
|
|
12
|
+
"arrow-position-top-center": "awsui_arrow-position-top-center_1hpp3_1fwnq_134",
|
|
13
|
+
"arrow-position-top-responsive": "awsui_arrow-position-top-responsive_1hpp3_1fwnq_134",
|
|
14
|
+
"arrow-position-bottom-center": "awsui_arrow-position-bottom-center_1hpp3_1fwnq_137",
|
|
15
|
+
"arrow-position-bottom-responsive": "awsui_arrow-position-bottom-responsive_1hpp3_1fwnq_137",
|
|
16
|
+
"annotation": "awsui_annotation_1hpp3_1fwnq_145",
|
|
17
|
+
"next-button": "awsui_next-button_1hpp3_1fwnq_146",
|
|
18
|
+
"previous-button": "awsui_previous-button_1hpp3_1fwnq_147",
|
|
19
|
+
"finish-button": "awsui_finish-button_1hpp3_1fwnq_148",
|
|
20
|
+
"header": "awsui_header_1hpp3_1fwnq_149",
|
|
21
|
+
"step-counter-content": "awsui_step-counter-content_1hpp3_1fwnq_150",
|
|
22
|
+
"content": "awsui_content_1hpp3_1fwnq_151",
|
|
23
|
+
"description": "awsui_description_1hpp3_1fwnq_155",
|
|
24
|
+
"actionBar": "awsui_actionBar_1hpp3_1fwnq_160",
|
|
25
|
+
"stepCounter": "awsui_stepCounter_1hpp3_1fwnq_167",
|
|
26
|
+
"divider": "awsui_divider_1hpp3_1fwnq_171",
|
|
27
|
+
"hotspot": "awsui_hotspot_1hpp3_1fwnq_175",
|
|
28
|
+
"icon": "awsui_icon_1hpp3_1fwnq_215"
|
|
29
29
|
};
|
|
30
30
|
|
|
@@ -1,23 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
export interface DesktopDrawerProps {
|
|
6
|
-
contentClassName: string;
|
|
7
|
-
toggleClassName: string;
|
|
8
|
-
closeClassName: string;
|
|
9
|
-
toggleRefs: FocusControlRefs;
|
|
10
|
-
width: number;
|
|
11
|
-
topOffset: number | undefined;
|
|
12
|
-
bottomOffset: number | undefined;
|
|
13
|
-
ariaLabels: AppLayoutProps.Labels | undefined;
|
|
14
|
-
children: React.ReactNode;
|
|
15
|
-
type: keyof typeof togglesConfig;
|
|
16
|
-
isMobile: boolean;
|
|
17
|
-
isOpen: boolean;
|
|
18
|
-
onToggle: (isOpen: boolean) => void;
|
|
19
|
-
onClick?: (event: React.MouseEvent) => void;
|
|
20
|
-
onLoseFocus?: (event: React.FocusEvent) => void;
|
|
21
|
-
}
|
|
22
|
-
export declare function Drawer({ contentClassName, toggleClassName, closeClassName, width, type, toggleRefs, topOffset, bottomOffset, ariaLabels, children, isOpen, isMobile, onToggle, onClick, onLoseFocus, }: DesktopDrawerProps): JSX.Element;
|
|
2
|
+
import { DesktopDrawerProps, DrawerTriggersBarProps } from './interfaces';
|
|
3
|
+
export declare const Drawer: React.ForwardRefExoticComponent<DesktopDrawerProps & React.RefAttributes<HTMLDivElement>>;
|
|
4
|
+
export declare function DrawerTriggersBar({ isMobile, topOffset, bottomOffset, drawers, contentClassName, }: DrawerTriggersBarProps): JSX.Element;
|
|
23
5
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"lib/default/","sources":["app-layout/drawer/index.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAiB,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"lib/default/","sources":["app-layout/drawer/index.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAiB,MAAM,OAAO,CAAC;AAKtC,OAAO,EAAE,kBAAkB,EAAE,sBAAsB,EAAoC,MAAM,cAAc,CAAC;AAkB5G,eAAO,MAAM,MAAM,2FAyGlB,CAAC;AAEF,wBAAgB,iBAAiB,CAAC,EAChC,QAAQ,EACR,SAAS,EACT,YAAY,EACZ,OAAO,EACP,gBAAgB,GACjB,EAAE,sBAAsB,eAiCxB"}
|
|
@@ -21,15 +21,21 @@ import styles from './styles.css.js';
|
|
|
21
21
|
// * https://github.com/nvaccess/nvda/issues/5825
|
|
22
22
|
// * https://github.com/nvaccess/nvda/issues/5247
|
|
23
23
|
// * https://github.com/nvaccess/nvda/pull/8869 (reverted PR that was going to fix it)
|
|
24
|
-
export
|
|
24
|
+
export const Drawer = React.forwardRef(({ contentClassName, toggleClassName, closeClassName, width, type, toggleRefs, topOffset, bottomOffset, ariaLabels, drawersAriaLabels, children, isOpen, isMobile, onToggle, onClick, onLoseFocus, drawers, resizeHandle, }, ref) => {
|
|
25
|
+
const openButtonWrapperRef = useRef(null);
|
|
25
26
|
const { TagName, iconName, getLabels } = togglesConfig[type];
|
|
26
27
|
const { mainLabel, closeLabel, openLabel } = getLabels(ariaLabels);
|
|
27
28
|
const drawerContentWidthOpen = isMobile ? undefined : width;
|
|
28
29
|
const drawerContentWidth = isOpen ? drawerContentWidthOpen : undefined;
|
|
29
|
-
const
|
|
30
|
+
const getDrawersLabels = (labels = {}) => ({
|
|
31
|
+
drawerMainLabel: labels === null || labels === void 0 ? void 0 : labels.content,
|
|
32
|
+
drawerOpenLabel: labels === null || labels === void 0 ? void 0 : labels.triggerButton,
|
|
33
|
+
drawerCloseLabel: labels === null || labels === void 0 ? void 0 : labels.closeButton,
|
|
34
|
+
});
|
|
35
|
+
const { drawerMainLabel, drawerCloseLabel } = getDrawersLabels(drawersAriaLabels);
|
|
30
36
|
const regularOpenButton = (React.createElement(TagName, { ref: openButtonWrapperRef, "aria-label": mainLabel, className: styles.toggle, "aria-hidden": isOpen },
|
|
31
37
|
React.createElement(AppLayoutButton, { ref: toggleRefs.toggle, className: toggleClassName, iconName: iconName, ariaLabel: openLabel, onClick: () => onToggle(true), ariaExpanded: false })));
|
|
32
|
-
return (React.createElement("div", { className: clsx(styles.drawer, {
|
|
38
|
+
return (React.createElement("div", { ref: ref, className: clsx(styles.drawer, {
|
|
33
39
|
[styles['drawer-closed']]: !isOpen,
|
|
34
40
|
[testutilStyles['drawer-closed']]: !isOpen,
|
|
35
41
|
[styles['drawer-mobile']]: isMobile,
|
|
@@ -54,8 +60,22 @@ export function Drawer({ contentClassName, toggleClassName, closeClassName, widt
|
|
|
54
60
|
} },
|
|
55
61
|
React.createElement("div", { style: { width: drawerContentWidth, top: topOffset, bottom: bottomOffset }, className: clsx(styles['drawer-content'], contentClassName) },
|
|
56
62
|
!isMobile && regularOpenButton,
|
|
57
|
-
|
|
58
|
-
|
|
63
|
+
resizeHandle,
|
|
64
|
+
React.createElement(TagName, { "aria-label": drawers ? drawerMainLabel : mainLabel, "aria-hidden": !isOpen },
|
|
65
|
+
React.createElement(CloseButton, { ref: toggleRefs.close, className: closeClassName, ariaLabel: drawers ? drawerCloseLabel : closeLabel, onClick: () => {
|
|
66
|
+
onToggle(false);
|
|
67
|
+
drawers === null || drawers === void 0 ? void 0 : drawers.onChange({ activeDrawerId: undefined });
|
|
68
|
+
} }),
|
|
59
69
|
children))));
|
|
70
|
+
});
|
|
71
|
+
export function DrawerTriggersBar({ isMobile, topOffset, bottomOffset, drawers, contentClassName, }) {
|
|
72
|
+
var _a;
|
|
73
|
+
return (React.createElement("div", { className: clsx(styles.drawer, styles['drawer-closed'], testutilStyles['drawer-closed'], {
|
|
74
|
+
[styles['drawer-mobile']]: isMobile,
|
|
75
|
+
}) },
|
|
76
|
+
React.createElement("div", { style: { top: topOffset, bottom: bottomOffset }, className: clsx(styles['drawer-content'], styles['non-interactive'], contentClassName) }, !isMobile && (React.createElement("aside", { "aria-label": drawers === null || drawers === void 0 ? void 0 : drawers.ariaLabel, className: styles['drawer-triggers'] }, (_a = drawers === null || drawers === void 0 ? void 0 : drawers.items) === null || _a === void 0 ? void 0 : _a.map((item, index) => {
|
|
77
|
+
var _a;
|
|
78
|
+
return (React.createElement(AppLayoutButton, { className: clsx(styles.trigger, styles['trigger-drawer'], drawers.activeDrawerId === item.id && styles.selected), key: `drawer-trigger-${index}`, iconName: item.trigger.iconName, iconSvg: item.trigger.iconSvg, ariaLabel: (_a = item.ariaLabels) === null || _a === void 0 ? void 0 : _a.triggerButton, onClick: () => drawers.onChange({ activeDrawerId: item.id }), ariaExpanded: drawers.activeDrawerId !== undefined }));
|
|
79
|
+
}))))));
|
|
60
80
|
}
|
|
61
81
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"lib/default/","sources":["app-layout/drawer/index.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,KAAK,EAAE,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AACtC,OAAO,EAAE,eAAe,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAEzE,OAAO,cAAc,MAAM,+BAA+B,CAAC;AAC3D,OAAO,MAAM,MAAM,iBAAiB,CAAC;AAqBrC,0FAA0F;AAC1F,qFAAqF;AACrF,uFAAuF;AACvF,4EAA4E;AAC5E,wFAAwF;AACxF,0FAA0F;AAC1F,0FAA0F;AAC1F,wBAAwB;AACxB,0FAA0F;AAC1F,4FAA4F;AAC5F,WAAW;AACX,oBAAoB;AACpB,iDAAiD;AACjD,iDAAiD;AACjD,iDAAiD;AACjD,sFAAsF;AAEtF,MAAM,UAAU,MAAM,CAAC,EACrB,gBAAgB,EAChB,eAAe,EACf,cAAc,EACd,KAAK,EACL,IAAI,EACJ,UAAU,EACV,SAAS,EACT,YAAY,EACZ,UAAU,EACV,QAAQ,EACR,MAAM,EACN,QAAQ,EACR,QAAQ,EACR,OAAO,EACP,WAAW,GACQ;IACnB,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,GAAG,aAAa,CAAC,IAAI,CAAC,CAAC;IAC7D,MAAM,EAAE,SAAS,EAAE,UAAU,EAAE,SAAS,EAAE,GAAG,SAAS,CAAC,UAAU,CAAC,C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EAAE;gBACX,OAAO,CAAC,KAAK,CAAC,CAAC;aAChB;YAED,IAAI,CAAC,MAAM,EAAE;gBACX,sFAAsF;gBACtF,IACE,oBAAoB,CAAC,OAAO,KAAK,KAAK,CAAC,MAAM;oBAC7C,CAAC,CAAA,MAAA,oBAAoB,CAAC,OAAO,0CAAE,QAAQ,CAAC,KAAK,CAAC,MAAc,CAAC,CAAA,EAC7D;oBACA,QAAQ,CAAC,IAAI,CAAC,CAAC;iBAChB;aACF;QACH,CAAC;QAED,6BACE,KAAK,EAAE,EAAE,KAAK,EAAE,kBAAkB,EAAE,GAAG,EAAE,SAAS,EAAE,MAAM,EAAE,YAAY,EAAE,EAC1E,SAAS,EAAE,IAAI,CAAC,MAAM,CAAC,gBAAgB,CAAC,EAAE,gBAAgB,CAAC;YAE1D,CAAC,QAAQ,IAAI,iBAAiB;YAC/B,oBAAC,OAAO,kBAAa,SAAS,iBAAe,CAAC,MAAM;gBAClD,oBAAC,WAAW,IACV,GAAG,EAAE,UAAU,CAAC,KAAK,EACrB,SAAS,EAAE,cAAc,EACzB,SAAS,EAAE,UAAU,EACrB,OAAO,EAAE,GAAG,EAAE,CAAC,QAAQ,CAAC,KAAK,CAAC,GAC9B;gBACD,QAAQ,CACD,CACN,CACF,CACP,CAAC;AACJ,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport clsx from 'clsx';\nimport React, { useRef } from 'react';\nimport { AppLayoutButton, CloseButton, togglesConfig } from '../toggles';\nimport { AppLayoutProps } from '../interfaces';\nimport testutilStyles from '../test-classes/styles.css.js';\nimport styles from './styles.css.js';\nimport { FocusControlRefs } from '../utils/use-focus-control';\n\nexport interface DesktopDrawerProps {\n contentClassName: string;\n toggleClassName: string;\n closeClassName: string;\n toggleRefs: FocusControlRefs;\n width: number;\n topOffset: number | undefined;\n bottomOffset: number | undefined;\n ariaLabels: AppLayoutProps.Labels | undefined;\n children: React.ReactNode;\n type: keyof typeof togglesConfig;\n isMobile: boolean;\n isOpen: boolean;\n onToggle: (isOpen: boolean) => void;\n onClick?: (event: React.MouseEvent) => void;\n onLoseFocus?: (event: React.FocusEvent) => void;\n}\n\n// We are using two landmarks per drawer, i.e. two NAVs and two ASIDEs, because of several\n// known bugs in NVDA that cause focus changes within a container to sometimes not be\n// announced. As a result, we use one region for the open button and one region for the\n// actual drawer content, always hiding the other one when it's not visible.\n// An alternative solution to follow a more classic implementation here to only have one\n// button that triggers the opening/closing of the drawer also did not work due to another\n// series of bugs in NVDA (together with Firefox) which prevent the changed expanded state\n// from being announced.\n// Even with this workaround in place, the announcement of the close button when opening a\n// panel in NVDA is not working correctly. The suspected root cause is one of the bugs below\n// as well.\n// Relevant tickets:\n// * https://github.com/nvaccess/nvda/issues/6606\n// * https://github.com/nvaccess/nvda/issues/5825\n// * https://github.com/nvaccess/nvda/issues/5247\n// * https://github.com/nvaccess/nvda/pull/8869 (reverted PR that was going to fix it)\n\nexport function Drawer({\n contentClassName,\n toggleClassName,\n closeClassName,\n width,\n type,\n toggleRefs,\n topOffset,\n bottomOffset,\n ariaLabels,\n children,\n isOpen,\n isMobile,\n onToggle,\n onClick,\n onLoseFocus,\n}: DesktopDrawerProps) {\n const { TagName, iconName, getLabels } = togglesConfig[type];\n const { mainLabel, closeLabel, openLabel } = getLabels(ariaLabels);\n const drawerContentWidthOpen = isMobile ? undefined : width;\n const drawerContentWidth = isOpen ? drawerContentWidthOpen : undefined;\n const openButtonWrapperRef = useRef<HTMLElement | null>(null);\n\n const regularOpenButton = (\n <TagName ref={openButtonWrapperRef} aria-label={mainLabel} className={styles.toggle} aria-hidden={isOpen}>\n <AppLayoutButton\n ref={toggleRefs.toggle}\n className={toggleClassName}\n iconName={iconName}\n ariaLabel={openLabel}\n onClick={() => onToggle(true)}\n ariaExpanded={false}\n />\n </TagName>\n );\n\n return (\n <div\n className={clsx(styles.drawer, {\n [styles['drawer-closed']]: !isOpen,\n [testutilStyles['drawer-closed']]: !isOpen,\n [styles['drawer-mobile']]: isMobile,\n })}\n style={{ width: drawerContentWidth }}\n onBlur={\n onLoseFocus\n ? e => {\n if (!e.relatedTarget || !e.currentTarget.contains(e.relatedTarget)) {\n onLoseFocus(e);\n }\n }\n : undefined\n }\n onClick={event => {\n if (onClick) {\n onClick(event);\n }\n\n if (!isOpen) {\n // to prevent calling onToggle from the drawer when it's called from the toggle button\n if (\n openButtonWrapperRef.current === event.target ||\n !openButtonWrapperRef.current?.contains(event.target as Node)\n ) {\n onToggle(true);\n }\n }\n }}\n >\n <div\n style={{ width: drawerContentWidth, top: topOffset, bottom: bottomOffset }}\n className={clsx(styles['drawer-content'], contentClassName)}\n >\n {!isMobile && regularOpenButton}\n <TagName aria-label={mainLabel} aria-hidden={!isOpen}>\n <CloseButton\n ref={toggleRefs.close}\n className={closeClassName}\n ariaLabel={closeLabel}\n onClick={() => onToggle(false)}\n />\n {children}\n </TagName>\n </div>\n </div>\n );\n}\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"lib/default/","sources":["app-layout/drawer/index.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,KAAK,EAAE,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AACtC,OAAO,EAAE,eAAe,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAEzE,OAAO,cAAc,MAAM,+BAA+B,CAAC;AAC3D,OAAO,MAAM,MAAM,iBAAiB,CAAC;AAGrC,0FAA0F;AAC1F,qFAAqF;AACrF,uFAAuF;AACvF,4EAA4E;AAC5E,wFAAwF;AACxF,0FAA0F;AAC1F,0FAA0F;AAC1F,wBAAwB;AACxB,0FAA0F;AAC1F,4FAA4F;AAC5F,WAAW;AACX,oBAAoB;AACpB,iDAAiD;AACjD,iDAAiD;AACjD,iDAAiD;AACjD,sFAAsF;AACtF,MAAM,CAAC,MAAM,MAAM,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E,MAAM,CAAC,iBAAiB,CAAC,IACxE,MAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,KAAK,0CAAE,GAAG,CAAC,CAAC,IAAgB,EAAE,KAAa,EAAE,EAAE;;YAAC,OAAA,CACxD,oBAAC,eAAe,IACd,SAAS,EAAE,IAAI,CACb,MAAM,CAAC,OAAO,EACd,MAAM,CAAC,gBAAgB,CAAC,EACxB,OAAO,CAAC,cAAc,KAAK,IAAI,CAAC,EAAE,IAAI,MAAM,CAAC,QAAQ,CACtD,EACD,GAAG,EAAE,kBAAkB,KAAK,EAAE,EAC9B,QAAQ,EAAE,IAAI,CAAC,OAAO,CAAC,QAAQ,EAC/B,OAAO,EAAE,IAAI,CAAC,OAAO,CAAC,OAAO,EAC7B,SAAS,EAAE,MAAA,IAAI,CAAC,UAAU,0CAAE,aAAa,EACzC,OAAO,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE,cAAc,EAAE,IAAI,CAAC,EAAE,EAAE,CAAC,EAC5D,YAAY,EAAE,OAAO,CAAC,cAAc,KAAK,SAAS,GAClD,CACH,CAAA;SAAA,CAAC,CACI,CACT,CACG,CACF,CACP,CAAC;AACJ,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport clsx from 'clsx';\nimport React, { useRef } from 'react';\nimport { AppLayoutButton, CloseButton, togglesConfig } from '../toggles';\n\nimport testutilStyles from '../test-classes/styles.css.js';\nimport styles from './styles.css.js';\nimport { DesktopDrawerProps, DrawerTriggersBarProps, DrawerItem, DrawerItemAriaLabels } from './interfaces';\n\n// We are using two landmarks per drawer, i.e. two NAVs and two ASIDEs, because of several\n// known bugs in NVDA that cause focus changes within a container to sometimes not be\n// announced. As a result, we use one region for the open button and one region for the\n// actual drawer content, always hiding the other one when it's not visible.\n// An alternative solution to follow a more classic implementation here to only have one\n// button that triggers the opening/closing of the drawer also did not work due to another\n// series of bugs in NVDA (together with Firefox) which prevent the changed expanded state\n// from being announced.\n// Even with this workaround in place, the announcement of the close button when opening a\n// panel in NVDA is not working correctly. The suspected root cause is one of the bugs below\n// as well.\n// Relevant tickets:\n// * https://github.com/nvaccess/nvda/issues/6606\n// * https://github.com/nvaccess/nvda/issues/5825\n// * https://github.com/nvaccess/nvda/issues/5247\n// * https://github.com/nvaccess/nvda/pull/8869 (reverted PR that was going to fix it)\nexport const Drawer = React.forwardRef(\n (\n {\n contentClassName,\n toggleClassName,\n closeClassName,\n width,\n type,\n toggleRefs,\n topOffset,\n bottomOffset,\n ariaLabels,\n drawersAriaLabels,\n children,\n isOpen,\n isMobile,\n onToggle,\n onClick,\n onLoseFocus,\n drawers,\n resizeHandle,\n }: DesktopDrawerProps,\n ref: React.Ref<HTMLDivElement>\n ) => {\n const openButtonWrapperRef = useRef<HTMLElement | null>(null);\n const { TagName, iconName, getLabels } = togglesConfig[type];\n const { mainLabel, closeLabel, openLabel } = getLabels(ariaLabels);\n const drawerContentWidthOpen = isMobile ? undefined : width;\n const drawerContentWidth = isOpen ? drawerContentWidthOpen : undefined;\n\n const getDrawersLabels = (labels: DrawerItemAriaLabels = {}) => ({\n drawerMainLabel: labels?.content,\n drawerOpenLabel: labels?.triggerButton,\n drawerCloseLabel: labels?.closeButton,\n });\n const { drawerMainLabel, drawerCloseLabel } = getDrawersLabels(drawersAriaLabels);\n\n const regularOpenButton = (\n <TagName ref={openButtonWrapperRef} aria-label={mainLabel} className={styles.toggle} aria-hidden={isOpen}>\n <AppLayoutButton\n ref={toggleRefs.toggle}\n className={toggleClassName}\n iconName={iconName}\n ariaLabel={openLabel}\n onClick={() => onToggle(true)}\n ariaExpanded={false}\n />\n </TagName>\n );\n\n return (\n <div\n ref={ref}\n className={clsx(styles.drawer, {\n [styles['drawer-closed']]: !isOpen,\n [testutilStyles['drawer-closed']]: !isOpen,\n [styles['drawer-mobile']]: isMobile,\n })}\n style={{ width: drawerContentWidth }}\n onBlur={\n onLoseFocus\n ? e => {\n if (!e.relatedTarget || !e.currentTarget.contains(e.relatedTarget)) {\n onLoseFocus(e);\n }\n }\n : undefined\n }\n onClick={event => {\n if (onClick) {\n onClick(event);\n }\n if (!isOpen) {\n // to prevent calling onToggle from the drawer when it's called from the toggle button\n if (\n openButtonWrapperRef.current === event.target ||\n !openButtonWrapperRef.current?.contains(event.target as Node)\n ) {\n onToggle(true);\n }\n }\n }}\n >\n <div\n style={{ width: drawerContentWidth, top: topOffset, bottom: bottomOffset }}\n className={clsx(styles['drawer-content'], contentClassName)}\n >\n {!isMobile && regularOpenButton}\n {resizeHandle}\n <TagName aria-label={drawers ? drawerMainLabel : mainLabel} aria-hidden={!isOpen}>\n <CloseButton\n ref={toggleRefs.close}\n className={closeClassName}\n ariaLabel={drawers ? drawerCloseLabel : closeLabel}\n onClick={() => {\n onToggle(false);\n drawers?.onChange({ activeDrawerId: undefined });\n }}\n />\n {children}\n </TagName>\n </div>\n </div>\n );\n }\n);\n\nexport function DrawerTriggersBar({\n isMobile,\n topOffset,\n bottomOffset,\n drawers,\n contentClassName,\n}: DrawerTriggersBarProps) {\n return (\n <div\n className={clsx(styles.drawer, styles['drawer-closed'], testutilStyles['drawer-closed'], {\n [styles['drawer-mobile']]: isMobile,\n })}\n >\n <div\n style={{ top: topOffset, bottom: bottomOffset }}\n className={clsx(styles['drawer-content'], styles['non-interactive'], contentClassName)}\n >\n {!isMobile && (\n <aside aria-label={drawers?.ariaLabel} className={styles['drawer-triggers']}>\n {drawers?.items?.map((item: DrawerItem, index: number) => (\n <AppLayoutButton\n className={clsx(\n styles.trigger,\n styles['trigger-drawer'],\n drawers.activeDrawerId === item.id && styles.selected\n )}\n key={`drawer-trigger-${index}`}\n iconName={item.trigger.iconName}\n iconSvg={item.trigger.iconSvg}\n ariaLabel={item.ariaLabels?.triggerButton}\n onClick={() => drawers.onChange({ activeDrawerId: item.id })}\n ariaExpanded={drawers.activeDrawerId !== undefined}\n />\n ))}\n </aside>\n )}\n </div>\n </div>\n );\n}\n"]}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { ButtonProps } from '../../button/interfaces';
|
|
3
|
+
import { togglesConfig } from '../toggles';
|
|
4
|
+
import { AppLayoutProps } from '../interfaces';
|
|
5
|
+
import { IconProps } from '../../icon/interfaces';
|
|
6
|
+
import { DrawerFocusControlRefs } from '../utils/use-drawer-focus-control';
|
|
7
|
+
export interface DesktopDrawerProps {
|
|
8
|
+
contentClassName: string;
|
|
9
|
+
toggleClassName: string;
|
|
10
|
+
closeClassName: string;
|
|
11
|
+
toggleRefs: {
|
|
12
|
+
toggle: React.Ref<ButtonProps.Ref>;
|
|
13
|
+
close: React.Ref<ButtonProps.Ref>;
|
|
14
|
+
};
|
|
15
|
+
width: number;
|
|
16
|
+
topOffset: number | undefined;
|
|
17
|
+
bottomOffset: number | undefined;
|
|
18
|
+
ariaLabels: AppLayoutProps.Labels | undefined;
|
|
19
|
+
drawersAriaLabels?: DrawerItemAriaLabels | undefined;
|
|
20
|
+
children: React.ReactNode;
|
|
21
|
+
type: keyof typeof togglesConfig;
|
|
22
|
+
isMobile: boolean;
|
|
23
|
+
isOpen: boolean;
|
|
24
|
+
onToggle: (isOpen: boolean) => void;
|
|
25
|
+
onClick?: (event: React.MouseEvent) => void;
|
|
26
|
+
onLoseFocus?: (event: React.FocusEvent) => void;
|
|
27
|
+
drawers?: {
|
|
28
|
+
items: Array<DrawerItem>;
|
|
29
|
+
activeDrawerId: string | undefined;
|
|
30
|
+
onChange: (changeDetail: {
|
|
31
|
+
activeDrawerId: string | undefined;
|
|
32
|
+
}) => void;
|
|
33
|
+
};
|
|
34
|
+
resizeHandle?: React.ReactNode;
|
|
35
|
+
}
|
|
36
|
+
export interface ResizableDrawerProps extends DesktopDrawerProps {
|
|
37
|
+
activeDrawer: DrawerItem;
|
|
38
|
+
onResize: (resizeDetail: {
|
|
39
|
+
size: number;
|
|
40
|
+
id: string;
|
|
41
|
+
}) => void;
|
|
42
|
+
size: number;
|
|
43
|
+
getMaxWidth: () => number;
|
|
44
|
+
refs: DrawerFocusControlRefs;
|
|
45
|
+
}
|
|
46
|
+
export interface DrawerTriggersBarProps {
|
|
47
|
+
contentClassName: string;
|
|
48
|
+
topOffset: number | undefined;
|
|
49
|
+
bottomOffset: number | undefined;
|
|
50
|
+
isMobile: boolean;
|
|
51
|
+
drawers?: {
|
|
52
|
+
items: Array<DrawerItem>;
|
|
53
|
+
activeDrawerId: string | undefined;
|
|
54
|
+
onChange: (changeDetail: {
|
|
55
|
+
activeDrawerId: string | undefined;
|
|
56
|
+
}) => void;
|
|
57
|
+
ariaLabel: string;
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
export interface DrawerItemAriaLabels {
|
|
61
|
+
content?: string;
|
|
62
|
+
closeButton?: string;
|
|
63
|
+
triggerButton?: string;
|
|
64
|
+
resizeHandle?: string;
|
|
65
|
+
}
|
|
66
|
+
export interface DrawerItem {
|
|
67
|
+
id: string;
|
|
68
|
+
content: React.ReactNode;
|
|
69
|
+
trigger: {
|
|
70
|
+
iconName?: IconProps.Name;
|
|
71
|
+
iconSvg?: React.ReactNode;
|
|
72
|
+
};
|
|
73
|
+
ariaLabels: DrawerItemAriaLabels;
|
|
74
|
+
resizable?: boolean;
|
|
75
|
+
size?: number;
|
|
76
|
+
}
|
|
77
|
+
export interface SizeControlProps {
|
|
78
|
+
position: 'side';
|
|
79
|
+
splitPanelRef?: React.RefObject<HTMLDivElement>;
|
|
80
|
+
handleRef?: React.RefObject<HTMLDivElement>;
|
|
81
|
+
setSidePanelWidth: (width: number) => void;
|
|
82
|
+
setBottomPanelHeight: (height: number) => void;
|
|
83
|
+
}
|
|
84
|
+
//# sourceMappingURL=interfaces.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"interfaces.d.ts","sourceRoot":"lib/default/","sources":["app-layout/drawer/interfaces.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OA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,CAAC,EAAE,SAAS,CAAC,IAAI,CAAC;QAC1B,OAAO,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;KAC3B,CAAC;IACF,UAAU,EAAE,oBAAoB,CAAC;IACjC,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,EAAE,MAAM,CAAC;IACjB,aAAa,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC,cAAc,CAAC,CAAC;IAChD,SAAS,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC,cAAc,CAAC,CAAC;IAC5C,iBAAiB,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAC3C,oBAAoB,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;CAChD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"interfaces.js","sourceRoot":"lib/default/","sources":["app-layout/drawer/interfaces.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\nimport { ButtonProps } from '../../button/interfaces';\nimport { togglesConfig } from '../toggles';\nimport { AppLayoutProps } from '../interfaces';\nimport { IconProps } from '../../icon/interfaces';\n\nimport { DrawerFocusControlRefs } from '../utils/use-drawer-focus-control';\n\nexport interface DesktopDrawerProps {\n contentClassName: string;\n toggleClassName: string;\n closeClassName: string;\n toggleRefs: {\n toggle: React.Ref<ButtonProps.Ref>;\n close: React.Ref<ButtonProps.Ref>;\n };\n width: number;\n topOffset: number | undefined;\n bottomOffset: number | undefined;\n ariaLabels: AppLayoutProps.Labels | undefined;\n drawersAriaLabels?: DrawerItemAriaLabels | undefined;\n children: React.ReactNode;\n type: keyof typeof togglesConfig;\n isMobile: boolean;\n isOpen: boolean;\n onToggle: (isOpen: boolean) => void;\n onClick?: (event: React.MouseEvent) => void;\n onLoseFocus?: (event: React.FocusEvent) => void;\n drawers?: {\n items: Array<DrawerItem>;\n activeDrawerId: string | undefined;\n onChange: (changeDetail: { activeDrawerId: string | undefined }) => void;\n };\n resizeHandle?: React.ReactNode;\n}\n\nexport interface ResizableDrawerProps extends DesktopDrawerProps {\n activeDrawer: DrawerItem;\n onResize: (resizeDetail: { size: number; id: string }) => void;\n size: number;\n getMaxWidth: () => number;\n refs: DrawerFocusControlRefs;\n}\n\nexport interface DrawerTriggersBarProps {\n contentClassName: string;\n topOffset: number | undefined;\n bottomOffset: number | undefined;\n isMobile: boolean;\n drawers?: {\n items: Array<DrawerItem>;\n activeDrawerId: string | undefined;\n onChange: (changeDetail: { activeDrawerId: string | undefined }) => void;\n ariaLabel: string;\n };\n}\n\nexport interface DrawerItemAriaLabels {\n content?: string;\n closeButton?: string;\n triggerButton?: string;\n resizeHandle?: string;\n}\n\nexport interface DrawerItem {\n id: string;\n content: React.ReactNode;\n trigger: {\n iconName?: IconProps.Name;\n iconSvg?: React.ReactNode;\n };\n ariaLabels: DrawerItemAriaLabels;\n resizable?: boolean;\n size?: number;\n}\n\nexport interface SizeControlProps {\n position: 'side';\n splitPanelRef?: React.RefObject<HTMLDivElement>;\n handleRef?: React.RefObject<HTMLDivElement>;\n setSidePanelWidth: (width: number) => void;\n setBottomPanelHeight: (height: number) => void;\n}\n"]}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { ResizableDrawerProps } from './interfaces';
|
|
3
|
+
export declare const ResizableDrawer: ({ onResize, size, getMaxWidth, refs, activeDrawer, ...props }: ResizableDrawerProps) => JSX.Element;
|
|
4
|
+
//# sourceMappingURL=resizable-drawer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resizable-drawer.d.ts","sourceRoot":"lib/default/","sources":["app-layout/drawer/resizable-drawer.tsx"],"names":[],"mappings":";AAYA,OAAO,EAAoB,oBAAoB,EAAE,MAAM,cAAc,CAAC;AAEtE,eAAO,MAAM,eAAe,kEAOzB,oBAAoB,gBAsEtB,CAAC"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { __rest } from "tslib";
|
|
2
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
3
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
4
|
+
import clsx from 'clsx';
|
|
5
|
+
import React, { useEffect, useState, useRef } from 'react';
|
|
6
|
+
import { getLimitedValue } from '../../split-panel/utils/size-utils';
|
|
7
|
+
import { usePointerEvents } from '../../split-panel/utils/use-pointer-events';
|
|
8
|
+
import { useKeyboardEvents } from '../../split-panel/utils/use-keyboard-events';
|
|
9
|
+
import { Drawer } from './index';
|
|
10
|
+
import ResizeHandler from '../../split-panel/icons/resize-handler';
|
|
11
|
+
import splitPanelStyles from '../../split-panel/styles.css.js';
|
|
12
|
+
export const ResizableDrawer = (_a) => {
|
|
13
|
+
var { onResize, size, getMaxWidth, refs, activeDrawer } = _a, props = __rest(_a, ["onResize", "size", "getMaxWidth", "refs", "activeDrawer"]);
|
|
14
|
+
const { isOpen, children, isMobile } = props;
|
|
15
|
+
const MIN_WIDTH = (activeDrawer === null || activeDrawer === void 0 ? void 0 : activeDrawer.size) && activeDrawer.size < 280 ? activeDrawer === null || activeDrawer === void 0 ? void 0 : activeDrawer.size : 280;
|
|
16
|
+
const [relativeSize, setRelativeSize] = useState(0);
|
|
17
|
+
useEffect(() => {
|
|
18
|
+
// effects are called inside out in the components tree
|
|
19
|
+
// wait one frame to allow app-layout to complete its calculations
|
|
20
|
+
const handle = requestAnimationFrame(() => {
|
|
21
|
+
const maxSize = getMaxWidth();
|
|
22
|
+
setRelativeSize((size / maxSize) * 100);
|
|
23
|
+
});
|
|
24
|
+
return () => cancelAnimationFrame(handle);
|
|
25
|
+
}, [size, getMaxWidth]);
|
|
26
|
+
const setSidePanelWidth = (width) => {
|
|
27
|
+
const maxWidth = getMaxWidth();
|
|
28
|
+
const size = getLimitedValue(MIN_WIDTH, width, maxWidth);
|
|
29
|
+
const id = activeDrawer.id;
|
|
30
|
+
if (isOpen && maxWidth >= MIN_WIDTH) {
|
|
31
|
+
onResize({ size, id });
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
const position = 'side';
|
|
35
|
+
const setBottomPanelHeight = () => { };
|
|
36
|
+
const drawerRefObject = useRef(null);
|
|
37
|
+
const sizeControlProps = {
|
|
38
|
+
position,
|
|
39
|
+
splitPanelRef: drawerRefObject,
|
|
40
|
+
handleRef: refs.slider,
|
|
41
|
+
setSidePanelWidth,
|
|
42
|
+
setBottomPanelHeight,
|
|
43
|
+
};
|
|
44
|
+
const onSliderPointerDown = usePointerEvents(sizeControlProps);
|
|
45
|
+
const onKeyDown = useKeyboardEvents(sizeControlProps);
|
|
46
|
+
const resizeHandle = (React.createElement("div", { ref: refs.slider, role: "slider", tabIndex: 0, "aria-label": activeDrawer.ariaLabels.resizeHandle, "aria-valuemax": 100, "aria-valuemin": 0, "aria-valuenow": relativeSize, className: clsx(splitPanelStyles.slider, splitPanelStyles[`slider-side`]), onKeyDown: onKeyDown, onPointerDown: onSliderPointerDown },
|
|
47
|
+
React.createElement(ResizeHandler, { className: clsx(splitPanelStyles['slider-icon'], splitPanelStyles[`slider-icon-side`]) })));
|
|
48
|
+
return (React.createElement(Drawer, Object.assign({}, props, { ref: drawerRefObject, resizeHandle: !isMobile &&
|
|
49
|
+
activeDrawer.resizable && React.createElement("div", { className: splitPanelStyles['slider-wrapper-side'] }, resizeHandle) }), children));
|
|
50
|
+
};
|
|
51
|
+
//# sourceMappingURL=resizable-drawer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resizable-drawer.js","sourceRoot":"lib/default/","sources":["app-layout/drawer/resizable-drawer.tsx"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,KAAK,EAAE,EAAE,S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CACrG,CACP,CAAC;IAEF,OAAO,CACL,oBAAC,MAAM,oBACD,KAAK,IACT,GAAG,EAAE,eAAe,EACpB,YAAY,EACV,CAAC,QAAQ;YACT,YAAY,CAAC,SAAS,IAAI,6BAAK,SAAS,EAAE,gBAAgB,CAAC,qBAAqB,CAAC,IAAG,YAAY,CAAO,KAGxG,QAAQ,CACF,CACV,CAAC;AACJ,CAAC,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport clsx from 'clsx';\nimport React, { useEffect, useState, useRef } from 'react';\n\nimport { getLimitedValue } from '../../split-panel/utils/size-utils';\nimport { usePointerEvents } from '../../split-panel/utils/use-pointer-events';\nimport { useKeyboardEvents } from '../../split-panel/utils/use-keyboard-events';\nimport { Drawer } from './index';\n\nimport ResizeHandler from '../../split-panel/icons/resize-handler';\nimport splitPanelStyles from '../../split-panel/styles.css.js';\nimport { SizeControlProps, ResizableDrawerProps } from './interfaces';\n\nexport const ResizableDrawer = ({\n onResize,\n size,\n getMaxWidth,\n refs,\n activeDrawer,\n ...props\n}: ResizableDrawerProps) => {\n const { isOpen, children, isMobile } = props;\n\n const MIN_WIDTH = activeDrawer?.size && activeDrawer.size < 280 ? activeDrawer?.size : 280;\n const [relativeSize, setRelativeSize] = useState(0);\n\n useEffect(() => {\n // effects are called inside out in the components tree\n // wait one frame to allow app-layout to complete its calculations\n const handle = requestAnimationFrame(() => {\n const maxSize = getMaxWidth();\n setRelativeSize((size / maxSize) * 100);\n });\n return () => cancelAnimationFrame(handle);\n }, [size, getMaxWidth]);\n\n const setSidePanelWidth = (width: number) => {\n const maxWidth = getMaxWidth();\n const size = getLimitedValue(MIN_WIDTH, width, maxWidth);\n const id = activeDrawer.id;\n\n if (isOpen && maxWidth >= MIN_WIDTH) {\n onResize({ size, id });\n }\n };\n\n const position = 'side';\n const setBottomPanelHeight = () => {};\n const drawerRefObject = useRef<HTMLDivElement>(null);\n\n const sizeControlProps: SizeControlProps = {\n position,\n splitPanelRef: drawerRefObject,\n handleRef: refs.slider,\n setSidePanelWidth,\n setBottomPanelHeight,\n };\n\n const onSliderPointerDown = usePointerEvents(sizeControlProps);\n const onKeyDown = useKeyboardEvents(sizeControlProps);\n\n const resizeHandle = (\n <div\n ref={refs.slider}\n role=\"slider\"\n tabIndex={0}\n aria-label={activeDrawer.ariaLabels.resizeHandle}\n aria-valuemax={100}\n aria-valuemin={0}\n aria-valuenow={relativeSize}\n className={clsx(splitPanelStyles.slider, splitPanelStyles[`slider-side`])}\n onKeyDown={onKeyDown}\n onPointerDown={onSliderPointerDown}\n >\n <ResizeHandler className={clsx(splitPanelStyles['slider-icon'], splitPanelStyles[`slider-icon-side`])} />\n </div>\n );\n\n return (\n <Drawer\n {...props}\n ref={drawerRefObject}\n resizeHandle={\n !isMobile &&\n activeDrawer.resizable && <div className={splitPanelStyles['slider-wrapper-side']}>{resizeHandle}</div>\n }\n >\n {children}\n </Drawer>\n );\n};\n"]}
|