@cloudscape-design/components-themeable 3.0.1212 → 3.0.1214
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/internal/manifest.json +1 -1
- package/lib/internal/scss/internal/components/card/styles.scss +1 -0
- package/lib/internal/scss/internal/components/dropdown/styles.scss +4 -0
- package/lib/internal/scss/internal/generated/custom-css-properties/index.scss +1 -1
- package/lib/internal/scss/internal/styles/typography/constants.scss +1 -0
- package/lib/internal/scss/internal/styles/typography/mixins.scss +26 -11
- package/lib/internal/scss/wizard/styles.scss +21 -6
- package/lib/internal/template/button-dropdown/internal.js +1 -1
- package/lib/internal/template/button-dropdown/internal.js.map +1 -1
- package/lib/internal/template/cards/styles.css.js +38 -38
- package/lib/internal/template/cards/styles.scoped.css +40 -39
- package/lib/internal/template/cards/styles.selectors.js +38 -38
- package/lib/internal/template/date-picker/index.js +1 -1
- package/lib/internal/template/date-picker/index.js.map +1 -1
- package/lib/internal/template/date-range-picker/dropdown.d.ts +2 -2
- package/lib/internal/template/date-range-picker/dropdown.d.ts.map +1 -1
- package/lib/internal/template/date-range-picker/dropdown.js +2 -2
- package/lib/internal/template/date-range-picker/dropdown.js.map +1 -1
- package/lib/internal/template/date-range-picker/index.js +2 -2
- package/lib/internal/template/date-range-picker/index.js.map +1 -1
- package/lib/internal/template/header/styles.css.js +34 -34
- package/lib/internal/template/header/styles.scoped.css +55 -52
- package/lib/internal/template/header/styles.selectors.js +34 -34
- package/lib/internal/template/help-panel/styles.css.js +6 -6
- package/lib/internal/template/help-panel/styles.scoped.css +72 -67
- package/lib/internal/template/help-panel/styles.selectors.js +6 -6
- package/lib/internal/template/internal/base-component/styles.scoped.css +3 -1
- package/lib/internal/template/internal/components/card/styles.css.js +11 -11
- package/lib/internal/template/internal/components/card/styles.scoped.css +26 -24
- package/lib/internal/template/internal/components/card/styles.selectors.js +11 -11
- package/lib/internal/template/internal/components/dropdown/index.d.ts +1 -1
- package/lib/internal/template/internal/components/dropdown/index.d.ts.map +1 -1
- package/lib/internal/template/internal/components/dropdown/index.js +35 -6
- package/lib/internal/template/internal/components/dropdown/index.js.map +1 -1
- package/lib/internal/template/internal/components/dropdown/interfaces.d.ts +19 -2
- package/lib/internal/template/internal/components/dropdown/interfaces.d.ts.map +1 -1
- package/lib/internal/template/internal/components/dropdown/interfaces.js.map +1 -1
- package/lib/internal/template/internal/components/dropdown/styles.css.js +20 -20
- package/lib/internal/template/internal/components/dropdown/styles.scoped.css +67 -37
- package/lib/internal/template/internal/components/dropdown/styles.selectors.js +20 -20
- package/lib/internal/template/internal/environment.js +2 -2
- package/lib/internal/template/internal/environment.json +2 -2
- package/lib/internal/template/internal/generated/styles/tokens.d.ts +1 -0
- package/lib/internal/template/internal/generated/styles/tokens.js +1 -0
- package/lib/internal/template/internal/generated/theming/index.cjs +5 -0
- package/lib/internal/template/internal/generated/theming/index.cjs.d.ts +9 -0
- package/lib/internal/template/internal/generated/theming/index.d.ts +9 -0
- package/lib/internal/template/internal/generated/theming/index.js +5 -0
- package/lib/internal/template/popover/styles.css.js +57 -57
- package/lib/internal/template/popover/styles.scoped.css +91 -89
- package/lib/internal/template/popover/styles.selectors.js +57 -57
- package/lib/internal/template/side-navigation/styles.css.js +30 -30
- package/lib/internal/template/side-navigation/styles.scoped.css +47 -46
- package/lib/internal/template/side-navigation/styles.selectors.js +30 -30
- package/lib/internal/template/text-content/styles.css.js +1 -1
- package/lib/internal/template/text-content/styles.scoped.css +65 -60
- package/lib/internal/template/text-content/styles.selectors.js +1 -1
- package/lib/internal/template/top-navigation/styles.css.js +47 -47
- package/lib/internal/template/top-navigation/styles.scoped.css +66 -65
- package/lib/internal/template/top-navigation/styles.selectors.js +47 -47
- package/lib/internal/template/wizard/internal.d.ts.map +1 -1
- package/lib/internal/template/wizard/internal.js +6 -2
- package/lib/internal/template/wizard/internal.js.map +1 -1
- package/lib/internal/template/wizard/styles.css.js +30 -30
- package/lib/internal/template/wizard/styles.scoped.css +76 -63
- package/lib/internal/template/wizard/styles.selectors.js +30 -30
- package/lib/internal/template/wizard/wizard-form.d.ts +0 -1
- package/lib/internal/template/wizard/wizard-form.d.ts.map +1 -1
- package/lib/internal/template/wizard/wizard-form.js +1 -4
- package/lib/internal/template/wizard/wizard-form.js.map +1 -1
- package/lib/internal/template/wizard/wizard-navigation.d.ts.map +1 -1
- package/lib/internal/template/wizard/wizard-navigation.js +13 -86
- package/lib/internal/template/wizard/wizard-navigation.js.map +1 -1
- package/lib/internal/template/wizard/wizard-step-list.d.ts +27 -0
- package/lib/internal/template/wizard/wizard-step-list.d.ts.map +1 -0
- package/lib/internal/template/wizard/wizard-step-list.js +105 -0
- package/lib/internal/template/wizard/wizard-step-list.js.map +1 -0
- package/lib/internal/template/wizard/wizard-step-navigation-expandable.d.ts +16 -0
- package/lib/internal/template/wizard/wizard-step-navigation-expandable.d.ts.map +1 -0
- package/lib/internal/template/wizard/wizard-step-navigation-expandable.js +18 -0
- package/lib/internal/template/wizard/wizard-step-navigation-expandable.js.map +1 -0
- package/package.json +1 -1
|
@@ -29,7 +29,7 @@ const DropdownContainer = ({ triggerRef, children, renderWithPortal, id, referre
|
|
|
29
29
|
const currentDocument = (_b = (_a = triggerRef.current) === null || _a === void 0 ? void 0 : _a.ownerDocument) !== null && _b !== void 0 ? _b : document;
|
|
30
30
|
return createPortal(React.createElement("div", { id: id, "data-awsui-referrer-id": referrerId }, children), currentDocument.body);
|
|
31
31
|
};
|
|
32
|
-
const TransitionContent = ({ state, transitionRef, dropdownClasses, matchTriggerWidth, hideBlockBorder, interior, isRefresh, dropdownRef, verticalContainerRef, expandToViewport, minWidth, maxWidth, header, content, footer, position, open, onMouseDown, id, ariaRole, ariaLabel, ariaLabelledby, ariaDescribedby, }) => {
|
|
32
|
+
const TransitionContent = ({ state, transitionRef, dropdownClasses, matchTriggerWidth, hideBlockBorder, interior, isRefresh, dropdownRef, verticalContainerRef, expandToViewport, minWidth, maxWidth, header, content, footer, position, open, onMouseDown, onFocusEnter, onFocusLeave, id, ariaRole, ariaLabel, ariaLabelledby, ariaDescribedby, }) => {
|
|
33
33
|
const contentRef = useMergeRefs(dropdownRef, transitionRef);
|
|
34
34
|
const dropdownStyles = {};
|
|
35
35
|
if (minWidth) {
|
|
@@ -46,7 +46,7 @@ const TransitionContent = ({ state, transitionRef, dropdownClasses, matchTrigger
|
|
|
46
46
|
[styles.refresh]: isRefresh,
|
|
47
47
|
[styles['use-portal']]: expandToViewport && !interior,
|
|
48
48
|
[styles['use-flexible-width']]: !matchTriggerWidth && !interior,
|
|
49
|
-
}), ref: contentRef, id: id, role: ariaRole, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledby, "aria-describedby": ariaDescribedby, "data-open": open, "data-animating": state !== 'exited', "aria-hidden": !open, style: dropdownStyles, onMouseDown: onMouseDown },
|
|
49
|
+
}), ref: contentRef, id: id, role: ariaRole, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledby, "aria-describedby": ariaDescribedby, "data-open": open, "data-animating": state !== 'exited', "aria-hidden": !open, style: dropdownStyles, onMouseDown: onMouseDown, onFocus: onFocusEnter, onBlur: onFocusLeave },
|
|
50
50
|
React.createElement("div", { className: clsx(styles['dropdown-content-wrapper'], !header && !content && styles['is-empty'], isRefresh && styles.refresh) },
|
|
51
51
|
React.createElement("div", { ref: verticalContainerRef, className: styles['dropdown-content'] },
|
|
52
52
|
React.createElement(DropdownContextProvider, { position: position },
|
|
@@ -54,7 +54,7 @@ const TransitionContent = ({ state, transitionRef, dropdownClasses, matchTrigger
|
|
|
54
54
|
content,
|
|
55
55
|
footer)))));
|
|
56
56
|
};
|
|
57
|
-
const Dropdown = ({ content, trigger, open,
|
|
57
|
+
const Dropdown = ({ content, trigger, open, onOutsideClick, onMouseDown, header, footer, dropdownId, stretchTriggerHeight = false, stretchHeight = false, minWidth, maxWidth, hideBlockBorder = true, expandToViewport = false, preferredAlignment = 'start', interior = false, scrollable = true, loopFocus = expandToViewport, onFocus, onBlur, onFocusEnter, onFocusLeave, onEscape, contentKey, dropdownContentId, ariaRole, ariaLabel, ariaLabelledby, ariaDescribedby, }) => {
|
|
58
58
|
const wrapperRef = useRef(null);
|
|
59
59
|
const triggerRef = useRef(null);
|
|
60
60
|
const dropdownRef = useRef(null);
|
|
@@ -144,6 +144,17 @@ const Dropdown = ({ content, trigger, open, onDropdownClose, onMouseDown, header
|
|
|
144
144
|
fireNonCancelableEvent(onBlur, event);
|
|
145
145
|
}
|
|
146
146
|
};
|
|
147
|
+
const isOutsideDropdownContent = (element) => !dropdownRef.current || !nodeBelongs(dropdownRef.current, element);
|
|
148
|
+
const focusEnterHandler = (event) => {
|
|
149
|
+
if (!event.relatedTarget || isOutsideDropdownContent(event.relatedTarget)) {
|
|
150
|
+
fireNonCancelableEvent(onFocusEnter, event);
|
|
151
|
+
}
|
|
152
|
+
};
|
|
153
|
+
const focusLeaveHandler = (event) => {
|
|
154
|
+
if (!event.relatedTarget || isOutsideDropdownContent(event.relatedTarget)) {
|
|
155
|
+
fireNonCancelableEvent(onFocusLeave, event);
|
|
156
|
+
}
|
|
157
|
+
};
|
|
147
158
|
// Check if the dropdown has enough space to fit with its desired width constraints
|
|
148
159
|
// If not, remove the class that allows flexible width sizing
|
|
149
160
|
const fixStretching = () => {
|
|
@@ -204,14 +215,32 @@ const Dropdown = ({ content, trigger, open, onDropdownClose, onMouseDown, header
|
|
|
204
215
|
// shadow root if the component is rendered inside shadow DOM.
|
|
205
216
|
const target = event.composedPath ? event.composedPath()[0] : event.target;
|
|
206
217
|
if (!nodeBelongs(dropdownRef.current, target) && !nodeBelongs(triggerRef.current, target)) {
|
|
207
|
-
fireNonCancelableEvent(
|
|
218
|
+
fireNonCancelableEvent(onOutsideClick);
|
|
208
219
|
}
|
|
209
220
|
};
|
|
210
221
|
window.addEventListener('click', clickListener, true);
|
|
211
222
|
return () => {
|
|
212
223
|
window.removeEventListener('click', clickListener, true);
|
|
213
224
|
};
|
|
214
|
-
}, [open,
|
|
225
|
+
}, [open, onOutsideClick]);
|
|
226
|
+
// subscribe to Escape key press
|
|
227
|
+
useEffect(() => {
|
|
228
|
+
// Only add the listener if onEscape callback is provided
|
|
229
|
+
if (!open || !onEscape) {
|
|
230
|
+
return;
|
|
231
|
+
}
|
|
232
|
+
const keydownListener = (event) => {
|
|
233
|
+
if (event.key === 'Escape') {
|
|
234
|
+
// Prevent any surrounding modals or dialogs from acting on this Escape key
|
|
235
|
+
event.stopPropagation();
|
|
236
|
+
fireNonCancelableEvent(onEscape);
|
|
237
|
+
}
|
|
238
|
+
};
|
|
239
|
+
window.addEventListener('keydown', keydownListener, true);
|
|
240
|
+
return () => {
|
|
241
|
+
window.removeEventListener('keydown', keydownListener, true);
|
|
242
|
+
};
|
|
243
|
+
}, [open, onEscape]);
|
|
215
244
|
// sync dropdown position on scroll and resize
|
|
216
245
|
useLayoutEffect(() => {
|
|
217
246
|
if (!expandToViewport || !open) {
|
|
@@ -264,7 +293,7 @@ const Dropdown = ({ content, trigger, open, onDropdownClose, onMouseDown, header
|
|
|
264
293
|
React.createElement(DropdownContainer, { triggerRef: triggerRef, renderWithPortal: expandToViewport && !interior, id: dropdownId, referrerId: referrerId, open: open },
|
|
265
294
|
React.createElement(Transition, { in: open !== null && open !== void 0 ? open : false, exit: false }, (state, ref) => (React.createElement("div", { ref: dropdownContainerRef },
|
|
266
295
|
React.createElement(TabTrap, { focusNextCallback: () => { var _a; return triggerRef.current && ((_a = getLastFocusable(triggerRef.current)) === null || _a === void 0 ? void 0 : _a.focus()); }, disabled: !open || !loopFocus }),
|
|
267
|
-
React.createElement(TransitionContent, { state: state, transitionRef: ref, dropdownClasses: dropdownClasses, open: open, matchTriggerWidth: matchTriggerWidth, hideBlockBorder: hideBlockBorder, interior: interior, header: header, content: content, expandToViewport: expandToViewport, minWidth: getMinWidthCssValue(), maxWidth: getMaxWidthCssValue(), footer: footer, onMouseDown: onMouseDown, isRefresh: isRefresh, dropdownRef: dropdownRef, verticalContainerRef: verticalContainerRef, position: position, id: dropdownContentId, ariaRole: ariaRole, ariaLabel: ariaLabel, ariaLabelledby: ariaLabelledby, ariaDescribedby: ariaDescribedby }),
|
|
296
|
+
React.createElement(TransitionContent, { state: state, transitionRef: ref, dropdownClasses: dropdownClasses, open: open, matchTriggerWidth: matchTriggerWidth, hideBlockBorder: hideBlockBorder, interior: interior, header: header, content: content, expandToViewport: expandToViewport, minWidth: getMinWidthCssValue(), maxWidth: getMaxWidthCssValue(), footer: footer, onMouseDown: onMouseDown, onFocusEnter: focusEnterHandler, onFocusLeave: focusLeaveHandler, isRefresh: isRefresh, dropdownRef: dropdownRef, verticalContainerRef: verticalContainerRef, position: position, id: dropdownContentId, ariaRole: ariaRole, ariaLabel: ariaLabel, ariaLabelledby: ariaLabelledby, ariaDescribedby: ariaDescribedby }),
|
|
268
297
|
React.createElement(TabTrap, { focusNextCallback: () => { var _a; return triggerRef.current && ((_a = getFirstFocusable(triggerRef.current)) === null || _a === void 0 ? void 0 : _a.focus()); }, disabled: !open || !loopFocus })))))));
|
|
269
298
|
};
|
|
270
299
|
const isInteriorPosition = (position) => position.insetBlockEnd !== undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/internal/components/dropdown/index.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC5E,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,YAAY,EAAE,iBAAiB,EAAE,WAAW,EAAE,MAAM,+CAA+C,CAAC;AAC7G,OAAO,EAAE,4BAA4B,EAAE,MAAM,+CAA+C,CAAC;AAE7F,OAAO,EAAE,sBAAsB,EAAE,MAAM,cAAc,CAAC;AACtD,OAAO,cAAc,MAAM,uCAAuC,CAAC;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,MAAM,kBAAkB,GAAG,CACzB,QAAqD,EACf,EAAE,CAAE,QAAqC,CAAC,aAAa,KAAK,SAAS,CAAC;AAE9G,eAAe,QAAQ,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useEffect, useLayoutEffect, useRef, useState } from 'react';\nimport { createPortal } from 'react-dom';\nimport clsx from 'clsx';\n\nimport { useMergeRefs, useResizeObserver, useUniqueId } from '@cloudscape-design/component-toolkit/internal';\nimport { getLogicalBoundingClientRect } from '@cloudscape-design/component-toolkit/internal';\n\nimport { fireNonCancelableEvent } from '../../events';\nimport customCssProps from '../../generated/custom-css-properties';\nimport { useMobile } from '../../hooks/use-mobile';\nimport { usePortalModeClasses } from '../../hooks/use-portal-mode-classes';\nimport { useVisualRefresh } from '../../hooks/use-visual-mode';\nimport { nodeBelongs } from '../../utils/node-belongs';\nimport { getFirstFocusable, getLastFocusable } from '../focus-lock/utils.js';\nimport TabTrap from '../tab-trap/index.js';\nimport { Transition, TransitionStatus } from '../transition';\nimport { DropdownContextProvider, DropdownContextProviderProps } from './context';\nimport {\n calculatePosition,\n DropdownPosition,\n hasEnoughSpaceForFlexibleWidth,\n InteriorDropdownPosition,\n} from './dropdown-fit-handler';\nimport { applyDropdownPositionRelativeToViewport, LogicalDOMRect } from './dropdown-position';\nimport { DropdownProps } from './interfaces';\n\nimport styles from './styles.css.js';\n\ninterface DropdownContainerProps {\n triggerRef: React.RefObject<HTMLElement>;\n children?: React.ReactNode;\n renderWithPortal: boolean;\n id?: string;\n referrerId?: string;\n open?: boolean;\n}\n\nconst DropdownContainer = ({\n triggerRef,\n children,\n renderWithPortal,\n id,\n referrerId,\n open,\n}: DropdownContainerProps) => {\n if (!renderWithPortal) {\n return <>{children}</>;\n }\n if (!open) {\n return null;\n }\n const currentDocument = triggerRef.current?.ownerDocument ?? document;\n return createPortal(\n <div id={id} data-awsui-referrer-id={referrerId}>\n {children}\n </div>,\n currentDocument.body\n );\n};\n\ninterface TransitionContentProps {\n state: TransitionStatus;\n transitionRef: React.MutableRefObject<any>;\n dropdownClasses: string;\n matchTriggerWidth: boolean;\n hideBlockBorder: boolean;\n interior: boolean;\n isRefresh: boolean;\n dropdownRef: React.RefObject<HTMLDivElement>;\n verticalContainerRef: React.RefObject<HTMLDivElement>;\n expandToViewport?: boolean;\n minWidth?: string;\n maxWidth?: string;\n header?: React.ReactNode;\n content?: React.ReactNode;\n footer?: React.ReactNode;\n position?: DropdownContextProviderProps['position'];\n open?: boolean;\n onMouseDown?: React.MouseEventHandler<Element>;\n id?: string;\n ariaRole?: string;\n ariaLabel?: string;\n ariaLabelledby?: string;\n ariaDescribedby?: string;\n}\n\nconst TransitionContent = ({\n state,\n transitionRef,\n dropdownClasses,\n matchTriggerWidth,\n hideBlockBorder,\n interior,\n isRefresh,\n dropdownRef,\n verticalContainerRef,\n expandToViewport,\n minWidth,\n maxWidth,\n header,\n content,\n footer,\n position,\n open,\n onMouseDown,\n id,\n ariaRole,\n ariaLabel,\n ariaLabelledby,\n ariaDescribedby,\n}: TransitionContentProps) => {\n const contentRef = useMergeRefs(dropdownRef, transitionRef);\n const dropdownStyles: Record<string, string> = {};\n if (minWidth) {\n dropdownStyles[customCssProps.dropdownDefaultMinWidth] = minWidth;\n }\n if (maxWidth) {\n dropdownStyles[customCssProps.dropdownDefaultMaxWidth] = maxWidth;\n }\n return (\n <div\n className={clsx(styles.dropdown, dropdownClasses, {\n [styles.open]: open,\n [styles['with-limited-width']]: !matchTriggerWidth,\n [styles['hide-block-border']]: hideBlockBorder,\n [styles.interior]: interior,\n [styles.refresh]: isRefresh,\n [styles['use-portal']]: expandToViewport && !interior,\n [styles['use-flexible-width']]: !matchTriggerWidth && !interior,\n })}\n ref={contentRef}\n id={id}\n role={ariaRole}\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledby}\n aria-describedby={ariaDescribedby}\n data-open={open}\n data-animating={state !== 'exited'}\n aria-hidden={!open}\n style={dropdownStyles}\n onMouseDown={onMouseDown}\n >\n <div\n className={clsx(\n styles['dropdown-content-wrapper'],\n !header && !content && styles['is-empty'],\n isRefresh && styles.refresh\n )}\n >\n <div ref={verticalContainerRef} className={styles['dropdown-content']}>\n <DropdownContextProvider position={position}>\n {header}\n {content}\n {footer}\n </DropdownContextProvider>\n </div>\n </div>\n </div>\n );\n};\n\nconst Dropdown = ({\n content,\n trigger,\n open,\n onDropdownClose,\n onMouseDown,\n header,\n footer,\n dropdownId,\n stretchTriggerHeight = false,\n stretchHeight = false,\n minWidth,\n maxWidth,\n hideBlockBorder = true,\n expandToViewport = false,\n preferredAlignment = 'start',\n interior = false,\n scrollable = true,\n loopFocus = expandToViewport,\n onFocus,\n onBlur,\n contentKey,\n dropdownContentId,\n ariaRole,\n ariaLabel,\n ariaLabelledby,\n ariaDescribedby,\n}: DropdownProps) => {\n const wrapperRef = useRef<HTMLDivElement | null>(null);\n const triggerRef = useRef<HTMLDivElement | null>(null);\n const dropdownRef = useRef<HTMLDivElement | null>(null);\n const dropdownContainerRef = useRef<HTMLDivElement | null>(null);\n const verticalContainerRef = useRef<HTMLDivElement>(null);\n // To keep track of the initial position (drop up/down) which is kept the same during fixed repositioning\n const fixedPosition = useRef<DropdownPosition | null>(null);\n\n const isRefresh = useVisualRefresh();\n\n const dropdownClasses = usePortalModeClasses(triggerRef);\n const [position, setPosition] = useState<DropdownContextProviderProps['position']>('bottom-right');\n\n const isMobile = useMobile();\n\n // Derive if dropdown should match trigger width exactly\n // This happens when both minWidth and maxWidth are explicitly set to 'trigger'\n const matchTriggerWidth = minWidth === 'trigger' && maxWidth === 'trigger';\n\n // Convert preferredAlignment to boolean for internal positioning logic\n const preferCenter = preferredAlignment === 'center';\n\n const setDropdownPosition = (\n position: DropdownPosition | InteriorDropdownPosition,\n triggerBox: LogicalDOMRect,\n target: HTMLDivElement,\n verticalContainer: HTMLDivElement\n ) => {\n verticalContainer.style.maxBlockSize = position.blockSize;\n\n // Only apply occupy-entire-width when matching trigger width exactly and not in portal mode\n if (!interior && matchTriggerWidth && !expandToViewport) {\n target.classList.add(styles['occupy-entire-width']);\n } else {\n target.style.inlineSize = position.inlineSize;\n }\n\n // Using styles for main dropdown to adjust its position as preferred alternative\n if (position.dropBlockStart && !interior) {\n target.classList.add(styles['dropdown-drop-up']);\n if (!expandToViewport) {\n target.style.insetBlockEnd = '100%';\n }\n } else {\n target.classList.remove(styles['dropdown-drop-up']);\n }\n target.classList.add(position.dropInlineStart ? styles['dropdown-drop-left'] : styles['dropdown-drop-right']);\n\n if (position.insetInlineStart && position.insetInlineStart !== 'auto') {\n target.style.insetInlineStart = position.insetInlineStart;\n }\n\n // Position normal overflow dropdowns with fixed positioning relative to viewport\n if (expandToViewport && !interior) {\n applyDropdownPositionRelativeToViewport({\n position,\n dropdownElement: target,\n triggerRect: triggerBox,\n isMobile,\n });\n // Keep track of the initial dropdown position and direction.\n // Dropdown direction doesn't need to change as the user scrolls, just needs to stay attached to the trigger.\n fixedPosition.current = position;\n return;\n }\n\n // For an interior dropdown (the fly out) we need exact values for positioning\n // and classes are not enough\n // usage of relative position is impossible due to overwrite of overflow-x\n if (interior && isInteriorPosition(position)) {\n if (position.dropBlockStart) {\n target.style.insetBlockEnd = position.insetBlockEnd;\n } else {\n target.style.insetBlockStart = position.insetBlockStart;\n }\n target.style.insetInlineStart = position.insetInlineStart;\n }\n\n if (position.dropBlockStart && position.dropInlineStart) {\n setPosition('top-left');\n } else if (position.dropBlockStart) {\n setPosition('top-right');\n } else if (position.dropInlineStart) {\n setPosition('bottom-left');\n } else {\n setPosition('bottom-right');\n }\n };\n\n const isOutsideDropdown = (element: Element) =>\n (!wrapperRef.current || !nodeBelongs(wrapperRef.current, element)) &&\n (!dropdownContainerRef.current || !nodeBelongs(dropdownContainerRef.current, element));\n\n const focusHandler = (event: React.FocusEvent) => {\n if (!event.relatedTarget || isOutsideDropdown(event.relatedTarget)) {\n fireNonCancelableEvent(onFocus, event);\n }\n };\n\n const blurHandler = (event: React.FocusEvent) => {\n if (!event.relatedTarget || isOutsideDropdown(event.relatedTarget)) {\n fireNonCancelableEvent(onBlur, event);\n }\n };\n\n // Check if the dropdown has enough space to fit with its desired width constraints\n // If not, remove the class that allows flexible width sizing\n const fixStretching = () => {\n const classNameToRemove = styles['use-flexible-width'];\n if (\n open &&\n dropdownRef.current &&\n triggerRef.current &&\n dropdownRef.current.classList.contains(classNameToRemove) &&\n !hasEnoughSpaceForFlexibleWidth({\n triggerElement: triggerRef.current,\n dropdownElement: dropdownRef.current,\n minWidthConstraint: minWidth,\n maxWidthConstraint: maxWidth,\n expandToViewport,\n stretchHeight,\n isMobile,\n })\n ) {\n dropdownRef.current.classList.remove(classNameToRemove);\n }\n };\n\n useResizeObserver(() => dropdownRef.current, fixStretching);\n\n useLayoutEffect(() => {\n const onDropdownOpen = () => {\n if (open && dropdownRef.current && triggerRef.current && verticalContainerRef.current) {\n if (scrollable) {\n dropdownRef.current.classList.add(styles.nowrap);\n }\n\n setDropdownPosition(\n ...calculatePosition(\n dropdownRef.current,\n triggerRef.current,\n verticalContainerRef.current,\n interior,\n expandToViewport,\n preferCenter,\n matchTriggerWidth,\n stretchHeight,\n isMobile,\n minWidth,\n maxWidth\n ),\n dropdownRef.current,\n verticalContainerRef.current\n );\n\n if (scrollable) {\n dropdownRef.current.classList.remove(styles.nowrap);\n }\n }\n };\n onDropdownOpen();\n\n if (open) {\n // window may scroll when dropdown opens, for example when soft keyboard shows up\n window.addEventListener('scroll', onDropdownOpen);\n // only listen to window scroll within very short time after the dropdown opens\n // do not want to interfere dropdown position on scroll afterwards\n const timeoutId = setTimeout(() => {\n window.removeEventListener('scroll', onDropdownOpen);\n }, 500);\n\n return () => {\n clearTimeout(timeoutId);\n window.removeEventListener('scroll', onDropdownOpen);\n };\n }\n // See AWSUI-13040\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [open, dropdownRef, triggerRef, verticalContainerRef, interior, matchTriggerWidth, isMobile, contentKey]);\n\n // subscribe to outside click\n useEffect(() => {\n if (!open) {\n return;\n }\n const clickListener = (event: MouseEvent) => {\n // Since the listener is registered on the window, `event.target` will incorrectly point at the\n // shadow root if the component is rendered inside shadow DOM.\n const target = event.composedPath ? event.composedPath()[0] : event.target;\n if (!nodeBelongs(dropdownRef.current, target) && !nodeBelongs(triggerRef.current, target)) {\n fireNonCancelableEvent(onDropdownClose);\n }\n };\n window.addEventListener('click', clickListener, true);\n\n return () => {\n window.removeEventListener('click', clickListener, true);\n };\n }, [open, onDropdownClose]);\n\n // sync dropdown position on scroll and resize\n useLayoutEffect(() => {\n if (!expandToViewport || !open) {\n return;\n }\n const updateDropdownPosition = () => {\n if (triggerRef.current && dropdownRef.current && verticalContainerRef.current && fixedPosition.current) {\n applyDropdownPositionRelativeToViewport({\n position: fixedPosition.current,\n dropdownElement: dropdownRef.current,\n triggerRect: getLogicalBoundingClientRect(triggerRef.current),\n isMobile,\n });\n }\n };\n\n updateDropdownPosition();\n\n const controller = new AbortController();\n window.addEventListener('scroll', updateDropdownPosition, { capture: true, signal: controller.signal });\n window.addEventListener('resize', updateDropdownPosition, { capture: true, signal: controller.signal });\n return () => {\n controller.abort();\n };\n }, [open, expandToViewport, isMobile]);\n\n const referrerId = useUniqueId();\n\n // Compute CSS variable values for min/max width\n // These will be used by the use-flexible-width CSS class\n const getMinWidthCssValue = (): string | undefined => {\n if (minWidth === undefined) {\n return undefined;\n }\n if (typeof minWidth === 'number') {\n return `${minWidth}px`;\n }\n // 'trigger' maps to 100% (relative to parent)\n return '100%';\n };\n\n const getMaxWidthCssValue = (): string | undefined => {\n if (maxWidth === undefined) {\n return 'none';\n }\n if (typeof maxWidth === 'number') {\n return `${maxWidth}px`;\n }\n // 'trigger' maps to 100% (relative to parent)\n return '100%';\n };\n\n return (\n <div\n className={clsx(\n styles.root,\n interior && styles.interior,\n stretchTriggerHeight && styles['stretch-trigger-height']\n )}\n ref={wrapperRef}\n onFocus={focusHandler}\n onBlur={blurHandler}\n >\n <div id={referrerId} className={clsx(stretchTriggerHeight && styles['stretch-trigger-height'])} ref={triggerRef}>\n {trigger}\n </div>\n\n <TabTrap\n focusNextCallback={() => dropdownRef.current && getFirstFocusable(dropdownRef.current)?.focus()}\n disabled={!open || !loopFocus}\n />\n\n <DropdownContainer\n triggerRef={triggerRef}\n renderWithPortal={expandToViewport && !interior}\n id={dropdownId}\n referrerId={referrerId}\n open={open}\n >\n <Transition in={open ?? false} exit={false}>\n {(state, ref) => (\n <div ref={dropdownContainerRef}>\n <TabTrap\n focusNextCallback={() => triggerRef.current && getLastFocusable(triggerRef.current)?.focus()}\n disabled={!open || !loopFocus}\n />\n\n <TransitionContent\n state={state}\n transitionRef={ref}\n dropdownClasses={dropdownClasses}\n open={open}\n matchTriggerWidth={matchTriggerWidth}\n hideBlockBorder={hideBlockBorder}\n interior={interior}\n header={header}\n content={content}\n expandToViewport={expandToViewport}\n minWidth={getMinWidthCssValue()}\n maxWidth={getMaxWidthCssValue()}\n footer={footer}\n onMouseDown={onMouseDown}\n isRefresh={isRefresh}\n dropdownRef={dropdownRef}\n verticalContainerRef={verticalContainerRef}\n position={position}\n id={dropdownContentId}\n ariaRole={ariaRole}\n ariaLabel={ariaLabel}\n ariaLabelledby={ariaLabelledby}\n ariaDescribedby={ariaDescribedby}\n />\n\n <TabTrap\n focusNextCallback={() => triggerRef.current && getFirstFocusable(triggerRef.current)?.focus()}\n disabled={!open || !loopFocus}\n />\n </div>\n )}\n </Transition>\n </DropdownContainer>\n </div>\n );\n};\n\nconst isInteriorPosition = (\n position: DropdownPosition | InteriorDropdownPosition\n): position is InteriorDropdownPosition => (position as InteriorDropdownPosition).insetBlockEnd !== undefined;\n\nexport default Dropdown;\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/internal/components/dropdown/index.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,eAAe,EAAE,MA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ACpB,WAAW,EAAE,WAAW,EACxB,oBAAoB,EAAE,oBAAoB,EAC1C,QAAQ,EAAE,QAAQ,EAClB,EAAE,EAAE,iBAAiB,EACrB,QAAQ,EAAE,QAAQ,EAClB,SAAS,EAAE,SAAS,EACpB,cAAc,EAAE,cAAc,EAC9B,eAAe,EAAE,eAAe,GAChC;gBAEF,oBAAC,OAAO,IACN,iBAAiB,EAAE,GAAG,EAAE,WAAC,OAAA,UAAU,CAAC,OAAO,KAAI,MAAA,iBAAiB,CAAC,UAAU,CAAC,OAAO,CAAC,0CAAE,KAAK,EAAE,CAAA,CAAA,EAAA,EAC7F,QAAQ,EAAE,CAAC,IAAI,IAAI,CAAC,SAAS,GAC7B,CACE,CACP,CACU,CACK,CAChB,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,kBAAkB,GAAG,CACzB,QAAqD,EACf,EAAE,CAAE,QAAqC,CAAC,aAAa,KAAK,SAAS,CAAC;AAE9G,eAAe,QAAQ,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useEffect, useLayoutEffect, useRef, useState } from 'react';\nimport { createPortal } from 'react-dom';\nimport clsx from 'clsx';\n\nimport { useMergeRefs, useResizeObserver, useUniqueId } from '@cloudscape-design/component-toolkit/internal';\nimport { getLogicalBoundingClientRect } from '@cloudscape-design/component-toolkit/internal';\n\nimport { fireNonCancelableEvent } from '../../events';\nimport customCssProps from '../../generated/custom-css-properties';\nimport { useMobile } from '../../hooks/use-mobile';\nimport { usePortalModeClasses } from '../../hooks/use-portal-mode-classes';\nimport { useVisualRefresh } from '../../hooks/use-visual-mode';\nimport { nodeBelongs } from '../../utils/node-belongs';\nimport { getFirstFocusable, getLastFocusable } from '../focus-lock/utils.js';\nimport TabTrap from '../tab-trap/index.js';\nimport { Transition, TransitionStatus } from '../transition';\nimport { DropdownContextProvider, DropdownContextProviderProps } from './context';\nimport {\n calculatePosition,\n DropdownPosition,\n hasEnoughSpaceForFlexibleWidth,\n InteriorDropdownPosition,\n} from './dropdown-fit-handler';\nimport { applyDropdownPositionRelativeToViewport, LogicalDOMRect } from './dropdown-position';\nimport { DropdownProps } from './interfaces';\n\nimport styles from './styles.css.js';\n\ninterface DropdownContainerProps {\n triggerRef: React.RefObject<HTMLElement>;\n children?: React.ReactNode;\n renderWithPortal: boolean;\n id?: string;\n referrerId?: string;\n open?: boolean;\n}\n\nconst DropdownContainer = ({\n triggerRef,\n children,\n renderWithPortal,\n id,\n referrerId,\n open,\n}: DropdownContainerProps) => {\n if (!renderWithPortal) {\n return <>{children}</>;\n }\n if (!open) {\n return null;\n }\n const currentDocument = triggerRef.current?.ownerDocument ?? document;\n return createPortal(\n <div id={id} data-awsui-referrer-id={referrerId}>\n {children}\n </div>,\n currentDocument.body\n );\n};\n\ninterface TransitionContentProps {\n state: TransitionStatus;\n transitionRef: React.MutableRefObject<any>;\n dropdownClasses: string;\n matchTriggerWidth: boolean;\n hideBlockBorder: boolean;\n interior: boolean;\n isRefresh: boolean;\n dropdownRef: React.RefObject<HTMLDivElement>;\n verticalContainerRef: React.RefObject<HTMLDivElement>;\n expandToViewport?: boolean;\n minWidth?: string;\n maxWidth?: string;\n header?: React.ReactNode;\n content?: React.ReactNode;\n footer?: React.ReactNode;\n position?: DropdownContextProviderProps['position'];\n open?: boolean;\n onMouseDown?: React.MouseEventHandler<Element>;\n onFocusEnter?: React.FocusEventHandler<Element>;\n onFocusLeave?: React.FocusEventHandler<Element>;\n id?: string;\n ariaRole?: string;\n ariaLabel?: string;\n ariaLabelledby?: string;\n ariaDescribedby?: string;\n}\n\nconst TransitionContent = ({\n state,\n transitionRef,\n dropdownClasses,\n matchTriggerWidth,\n hideBlockBorder,\n interior,\n isRefresh,\n dropdownRef,\n verticalContainerRef,\n expandToViewport,\n minWidth,\n maxWidth,\n header,\n content,\n footer,\n position,\n open,\n onMouseDown,\n onFocusEnter,\n onFocusLeave,\n id,\n ariaRole,\n ariaLabel,\n ariaLabelledby,\n ariaDescribedby,\n}: TransitionContentProps) => {\n const contentRef = useMergeRefs(dropdownRef, transitionRef);\n const dropdownStyles: Record<string, string> = {};\n if (minWidth) {\n dropdownStyles[customCssProps.dropdownDefaultMinWidth] = minWidth;\n }\n if (maxWidth) {\n dropdownStyles[customCssProps.dropdownDefaultMaxWidth] = maxWidth;\n }\n return (\n <div\n className={clsx(styles.dropdown, dropdownClasses, {\n [styles.open]: open,\n [styles['with-limited-width']]: !matchTriggerWidth,\n [styles['hide-block-border']]: hideBlockBorder,\n [styles.interior]: interior,\n [styles.refresh]: isRefresh,\n [styles['use-portal']]: expandToViewport && !interior,\n [styles['use-flexible-width']]: !matchTriggerWidth && !interior,\n })}\n ref={contentRef}\n id={id}\n role={ariaRole}\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledby}\n aria-describedby={ariaDescribedby}\n data-open={open}\n data-animating={state !== 'exited'}\n aria-hidden={!open}\n style={dropdownStyles}\n onMouseDown={onMouseDown}\n onFocus={onFocusEnter}\n onBlur={onFocusLeave}\n >\n <div\n className={clsx(\n styles['dropdown-content-wrapper'],\n !header && !content && styles['is-empty'],\n isRefresh && styles.refresh\n )}\n >\n <div ref={verticalContainerRef} className={styles['dropdown-content']}>\n <DropdownContextProvider position={position}>\n {header}\n {content}\n {footer}\n </DropdownContextProvider>\n </div>\n </div>\n </div>\n );\n};\n\nconst Dropdown = ({\n content,\n trigger,\n open,\n onOutsideClick,\n onMouseDown,\n header,\n footer,\n dropdownId,\n stretchTriggerHeight = false,\n stretchHeight = false,\n minWidth,\n maxWidth,\n hideBlockBorder = true,\n expandToViewport = false,\n preferredAlignment = 'start',\n interior = false,\n scrollable = true,\n loopFocus = expandToViewport,\n onFocus,\n onBlur,\n onFocusEnter,\n onFocusLeave,\n onEscape,\n contentKey,\n dropdownContentId,\n ariaRole,\n ariaLabel,\n ariaLabelledby,\n ariaDescribedby,\n}: DropdownProps) => {\n const wrapperRef = useRef<HTMLDivElement | null>(null);\n const triggerRef = useRef<HTMLDivElement | null>(null);\n const dropdownRef = useRef<HTMLDivElement | null>(null);\n const dropdownContainerRef = useRef<HTMLDivElement | null>(null);\n const verticalContainerRef = useRef<HTMLDivElement>(null);\n // To keep track of the initial position (drop up/down) which is kept the same during fixed repositioning\n const fixedPosition = useRef<DropdownPosition | null>(null);\n\n const isRefresh = useVisualRefresh();\n\n const dropdownClasses = usePortalModeClasses(triggerRef);\n const [position, setPosition] = useState<DropdownContextProviderProps['position']>('bottom-right');\n\n const isMobile = useMobile();\n\n // Derive if dropdown should match trigger width exactly\n // This happens when both minWidth and maxWidth are explicitly set to 'trigger'\n const matchTriggerWidth = minWidth === 'trigger' && maxWidth === 'trigger';\n\n // Convert preferredAlignment to boolean for internal positioning logic\n const preferCenter = preferredAlignment === 'center';\n\n const setDropdownPosition = (\n position: DropdownPosition | InteriorDropdownPosition,\n triggerBox: LogicalDOMRect,\n target: HTMLDivElement,\n verticalContainer: HTMLDivElement\n ) => {\n verticalContainer.style.maxBlockSize = position.blockSize;\n\n // Only apply occupy-entire-width when matching trigger width exactly and not in portal mode\n if (!interior && matchTriggerWidth && !expandToViewport) {\n target.classList.add(styles['occupy-entire-width']);\n } else {\n target.style.inlineSize = position.inlineSize;\n }\n\n // Using styles for main dropdown to adjust its position as preferred alternative\n if (position.dropBlockStart && !interior) {\n target.classList.add(styles['dropdown-drop-up']);\n if (!expandToViewport) {\n target.style.insetBlockEnd = '100%';\n }\n } else {\n target.classList.remove(styles['dropdown-drop-up']);\n }\n target.classList.add(position.dropInlineStart ? styles['dropdown-drop-left'] : styles['dropdown-drop-right']);\n\n if (position.insetInlineStart && position.insetInlineStart !== 'auto') {\n target.style.insetInlineStart = position.insetInlineStart;\n }\n\n // Position normal overflow dropdowns with fixed positioning relative to viewport\n if (expandToViewport && !interior) {\n applyDropdownPositionRelativeToViewport({\n position,\n dropdownElement: target,\n triggerRect: triggerBox,\n isMobile,\n });\n // Keep track of the initial dropdown position and direction.\n // Dropdown direction doesn't need to change as the user scrolls, just needs to stay attached to the trigger.\n fixedPosition.current = position;\n return;\n }\n\n // For an interior dropdown (the fly out) we need exact values for positioning\n // and classes are not enough\n // usage of relative position is impossible due to overwrite of overflow-x\n if (interior && isInteriorPosition(position)) {\n if (position.dropBlockStart) {\n target.style.insetBlockEnd = position.insetBlockEnd;\n } else {\n target.style.insetBlockStart = position.insetBlockStart;\n }\n target.style.insetInlineStart = position.insetInlineStart;\n }\n\n if (position.dropBlockStart && position.dropInlineStart) {\n setPosition('top-left');\n } else if (position.dropBlockStart) {\n setPosition('top-right');\n } else if (position.dropInlineStart) {\n setPosition('bottom-left');\n } else {\n setPosition('bottom-right');\n }\n };\n\n const isOutsideDropdown = (element: Element) =>\n (!wrapperRef.current || !nodeBelongs(wrapperRef.current, element)) &&\n (!dropdownContainerRef.current || !nodeBelongs(dropdownContainerRef.current, element));\n\n const focusHandler = (event: React.FocusEvent) => {\n if (!event.relatedTarget || isOutsideDropdown(event.relatedTarget)) {\n fireNonCancelableEvent(onFocus, event);\n }\n };\n\n const blurHandler = (event: React.FocusEvent) => {\n if (!event.relatedTarget || isOutsideDropdown(event.relatedTarget)) {\n fireNonCancelableEvent(onBlur, event);\n }\n };\n\n const isOutsideDropdownContent = (element: Element) =>\n !dropdownRef.current || !nodeBelongs(dropdownRef.current, element);\n\n const focusEnterHandler = (event: React.FocusEvent) => {\n if (!event.relatedTarget || isOutsideDropdownContent(event.relatedTarget)) {\n fireNonCancelableEvent(onFocusEnter, event);\n }\n };\n\n const focusLeaveHandler = (event: React.FocusEvent) => {\n if (!event.relatedTarget || isOutsideDropdownContent(event.relatedTarget)) {\n fireNonCancelableEvent(onFocusLeave, event);\n }\n };\n\n // Check if the dropdown has enough space to fit with its desired width constraints\n // If not, remove the class that allows flexible width sizing\n const fixStretching = () => {\n const classNameToRemove = styles['use-flexible-width'];\n if (\n open &&\n dropdownRef.current &&\n triggerRef.current &&\n dropdownRef.current.classList.contains(classNameToRemove) &&\n !hasEnoughSpaceForFlexibleWidth({\n triggerElement: triggerRef.current,\n dropdownElement: dropdownRef.current,\n minWidthConstraint: minWidth,\n maxWidthConstraint: maxWidth,\n expandToViewport,\n stretchHeight,\n isMobile,\n })\n ) {\n dropdownRef.current.classList.remove(classNameToRemove);\n }\n };\n\n useResizeObserver(() => dropdownRef.current, fixStretching);\n\n useLayoutEffect(() => {\n const onDropdownOpen = () => {\n if (open && dropdownRef.current && triggerRef.current && verticalContainerRef.current) {\n if (scrollable) {\n dropdownRef.current.classList.add(styles.nowrap);\n }\n\n setDropdownPosition(\n ...calculatePosition(\n dropdownRef.current,\n triggerRef.current,\n verticalContainerRef.current,\n interior,\n expandToViewport,\n preferCenter,\n matchTriggerWidth,\n stretchHeight,\n isMobile,\n minWidth,\n maxWidth\n ),\n dropdownRef.current,\n verticalContainerRef.current\n );\n\n if (scrollable) {\n dropdownRef.current.classList.remove(styles.nowrap);\n }\n }\n };\n onDropdownOpen();\n\n if (open) {\n // window may scroll when dropdown opens, for example when soft keyboard shows up\n window.addEventListener('scroll', onDropdownOpen);\n // only listen to window scroll within very short time after the dropdown opens\n // do not want to interfere dropdown position on scroll afterwards\n const timeoutId = setTimeout(() => {\n window.removeEventListener('scroll', onDropdownOpen);\n }, 500);\n\n return () => {\n clearTimeout(timeoutId);\n window.removeEventListener('scroll', onDropdownOpen);\n };\n }\n // See AWSUI-13040\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [open, dropdownRef, triggerRef, verticalContainerRef, interior, matchTriggerWidth, isMobile, contentKey]);\n\n // subscribe to outside click\n useEffect(() => {\n if (!open) {\n return;\n }\n const clickListener = (event: MouseEvent) => {\n // Since the listener is registered on the window, `event.target` will incorrectly point at the\n // shadow root if the component is rendered inside shadow DOM.\n const target = event.composedPath ? event.composedPath()[0] : event.target;\n if (!nodeBelongs(dropdownRef.current, target) && !nodeBelongs(triggerRef.current, target)) {\n fireNonCancelableEvent(onOutsideClick);\n }\n };\n window.addEventListener('click', clickListener, true);\n\n return () => {\n window.removeEventListener('click', clickListener, true);\n };\n }, [open, onOutsideClick]);\n\n // subscribe to Escape key press\n useEffect(() => {\n // Only add the listener if onEscape callback is provided\n if (!open || !onEscape) {\n return;\n }\n const keydownListener = (event: KeyboardEvent) => {\n if (event.key === 'Escape') {\n // Prevent any surrounding modals or dialogs from acting on this Escape key\n event.stopPropagation();\n fireNonCancelableEvent(onEscape);\n }\n };\n window.addEventListener('keydown', keydownListener, true);\n\n return () => {\n window.removeEventListener('keydown', keydownListener, true);\n };\n }, [open, onEscape]);\n\n // sync dropdown position on scroll and resize\n useLayoutEffect(() => {\n if (!expandToViewport || !open) {\n return;\n }\n const updateDropdownPosition = () => {\n if (triggerRef.current && dropdownRef.current && verticalContainerRef.current && fixedPosition.current) {\n applyDropdownPositionRelativeToViewport({\n position: fixedPosition.current,\n dropdownElement: dropdownRef.current,\n triggerRect: getLogicalBoundingClientRect(triggerRef.current),\n isMobile,\n });\n }\n };\n\n updateDropdownPosition();\n\n const controller = new AbortController();\n window.addEventListener('scroll', updateDropdownPosition, { capture: true, signal: controller.signal });\n window.addEventListener('resize', updateDropdownPosition, { capture: true, signal: controller.signal });\n return () => {\n controller.abort();\n };\n }, [open, expandToViewport, isMobile]);\n\n const referrerId = useUniqueId();\n\n // Compute CSS variable values for min/max width\n // These will be used by the use-flexible-width CSS class\n const getMinWidthCssValue = (): string | undefined => {\n if (minWidth === undefined) {\n return undefined;\n }\n if (typeof minWidth === 'number') {\n return `${minWidth}px`;\n }\n // 'trigger' maps to 100% (relative to parent)\n return '100%';\n };\n\n const getMaxWidthCssValue = (): string | undefined => {\n if (maxWidth === undefined) {\n return 'none';\n }\n if (typeof maxWidth === 'number') {\n return `${maxWidth}px`;\n }\n // 'trigger' maps to 100% (relative to parent)\n return '100%';\n };\n\n return (\n <div\n className={clsx(\n styles.root,\n interior && styles.interior,\n stretchTriggerHeight && styles['stretch-trigger-height']\n )}\n ref={wrapperRef}\n onFocus={focusHandler}\n onBlur={blurHandler}\n >\n <div id={referrerId} className={clsx(stretchTriggerHeight && styles['stretch-trigger-height'])} ref={triggerRef}>\n {trigger}\n </div>\n\n <TabTrap\n focusNextCallback={() => dropdownRef.current && getFirstFocusable(dropdownRef.current)?.focus()}\n disabled={!open || !loopFocus}\n />\n\n <DropdownContainer\n triggerRef={triggerRef}\n renderWithPortal={expandToViewport && !interior}\n id={dropdownId}\n referrerId={referrerId}\n open={open}\n >\n <Transition in={open ?? false} exit={false}>\n {(state, ref) => (\n <div ref={dropdownContainerRef}>\n <TabTrap\n focusNextCallback={() => triggerRef.current && getLastFocusable(triggerRef.current)?.focus()}\n disabled={!open || !loopFocus}\n />\n\n <TransitionContent\n state={state}\n transitionRef={ref}\n dropdownClasses={dropdownClasses}\n open={open}\n matchTriggerWidth={matchTriggerWidth}\n hideBlockBorder={hideBlockBorder}\n interior={interior}\n header={header}\n content={content}\n expandToViewport={expandToViewport}\n minWidth={getMinWidthCssValue()}\n maxWidth={getMaxWidthCssValue()}\n footer={footer}\n onMouseDown={onMouseDown}\n onFocusEnter={focusEnterHandler}\n onFocusLeave={focusLeaveHandler}\n isRefresh={isRefresh}\n dropdownRef={dropdownRef}\n verticalContainerRef={verticalContainerRef}\n position={position}\n id={dropdownContentId}\n ariaRole={ariaRole}\n ariaLabel={ariaLabel}\n ariaLabelledby={ariaLabelledby}\n ariaDescribedby={ariaDescribedby}\n />\n\n <TabTrap\n focusNextCallback={() => triggerRef.current && getFirstFocusable(triggerRef.current)?.focus()}\n disabled={!open || !loopFocus}\n />\n </div>\n )}\n </Transition>\n </DropdownContainer>\n </div>\n );\n};\n\nconst isInteriorPosition = (\n position: DropdownPosition | InteriorDropdownPosition\n): position is InteriorDropdownPosition => (position as InteriorDropdownPosition).insetBlockEnd !== undefined;\n\nexport default Dropdown;\n"]}
|
|
@@ -71,9 +71,11 @@ export interface DropdownProps extends ExpandToViewport {
|
|
|
71
71
|
*/
|
|
72
72
|
open?: boolean;
|
|
73
73
|
/**
|
|
74
|
-
* Called when
|
|
74
|
+
* Called when the user clicks outside the dropdown and trigger.
|
|
75
|
+
* The dropdown does not close automatically - the parent component
|
|
76
|
+
* must update the `open` prop to close the dropdown.
|
|
75
77
|
*/
|
|
76
|
-
|
|
78
|
+
onOutsideClick?: NonCancelableEventHandler<null>;
|
|
77
79
|
/**
|
|
78
80
|
* Called when a mouse button is pressed inside the dropdown content.
|
|
79
81
|
*/
|
|
@@ -134,6 +136,21 @@ export interface DropdownProps extends ExpandToViewport {
|
|
|
134
136
|
* Called when focus leaves the trigger or dropdown content.
|
|
135
137
|
*/
|
|
136
138
|
onBlur?: NonCancelableEventHandler<Pick<React.FocusEvent, 'target' | 'relatedTarget'>>;
|
|
139
|
+
/**
|
|
140
|
+
* Called when focus enters the dropdown content from outside.
|
|
141
|
+
* This fires only once when focus moves into the dropdown, not when moving between elements within it.
|
|
142
|
+
*/
|
|
143
|
+
onFocusEnter?: NonCancelableEventHandler<Pick<React.FocusEvent, 'target' | 'relatedTarget'>>;
|
|
144
|
+
/**
|
|
145
|
+
* Called when focus leaves the dropdown content entirely.
|
|
146
|
+
*/
|
|
147
|
+
onFocusLeave?: NonCancelableEventHandler<Pick<React.FocusEvent, 'target' | 'relatedTarget'>>;
|
|
148
|
+
/**
|
|
149
|
+
* Called when the user presses the Escape key while the dropdown is open.
|
|
150
|
+
* The dropdown does not close automatically - the parent component
|
|
151
|
+
* must update the `open` prop to close the dropdown.
|
|
152
|
+
*/
|
|
153
|
+
onEscape?: NonCancelableEventHandler;
|
|
137
154
|
/**
|
|
138
155
|
* ID for the dropdown content wrapper
|
|
139
156
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interfaces.d.ts","sourceRoot":"","sources":["../../../../../src/internal/components/dropdown/interfaces.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,yBAAyB,EAAE,MAAM,cAAc,CAAC;AAEzD,MAAM,MAAM,oBAAoB,GAAG,MAAM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E1B;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB;;OAEG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IAErB;;OAEG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IAEpB;;OAEG;IACH,OAAO,CAAC,EAAE,yBAAyB,CAAC,IAAI,CAAC,KAAK,CAAC,UAAU,EAAE,QAAQ,GAAG,eAAe,CAAC,CAAC,CAAC;IAExF;;OAEG;IACH,MAAM,CAAC,EAAE,yBAAyB,CAAC,IAAI,CAAC,KAAK,CAAC,UAAU,EAAE,QAAQ,GAAG,eAAe,CAAC,CAAC,CAAC;IAEvF;;;OAGG;IACH,YAAY,CAAC,EAAE,yBAAyB,CAAC,IAAI,CAAC,KAAK,CAAC,UAAU,EAAE,QAAQ,GAAG,eAAe,CAAC,CAAC,CAAC;IAE7F;;OAEG;IACH,YAAY,CAAC,EAAE,yBAAyB,CAAC,IAAI,CAAC,KAAK,CAAC,UAAU,EAAE,QAAQ,GAAG,eAAe,CAAC,CAAC,CAAC;IAE7F;;;;OAIG;IACH,QAAQ,CAAC,EAAE,yBAAyB,CAAC;IAErC;;OAEG;IACH,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAE3B;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;OAEG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;IAExB;;OAEG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED,MAAM,WAAW,gBAAgB;IAC/B;;;;;;;;;;OAUG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAC;CAC5B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../../../src/internal/components/dropdown/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';\n\nimport { NonCancelableEventHandler } from '../../events';\n\nexport type OptionsFilteringType = 'none' | 'auto' | 'manual';\n\n/**\n * Alignment of the dropdown relative to its trigger.\n */\nexport type DropdownAlignment =\n | 'start' // Aligns to the start edge of trigger (default)\n | 'center'; // Centers dropdown on trigger\n\n/**\n * Width constraint for the dropdown.\n * - 'trigger': references the trigger element's width\n * - number: width in pixels\n */\nexport type DropdownWidthConstraint = 'trigger' | number;\n\nexport interface OptionsLoadItemsDetail {\n filteringText: string;\n firstPage: boolean;\n samePage: boolean;\n}\n\nexport interface BaseDropdownHostProps extends ExpandToViewport {\n /**\n * If you have more than 500 options, enable this flag to apply a performance optimization\n * that makes the filtering experience smoother. We don't recommend enabling the feature if you\n * have less than 500 options, because the improvements to performance are offset by a\n * visible scrolling lag.\n *\n * When you set this flag to `true`, it removes options that are not currently in view from the DOM.\n * If your test accesses such options, you need to first scroll the options container\n * to the correct offset, before performing any operations on them. Use the element returned\n * by the `findOptionsContainer` test utility for this.\n */\n virtualScroll?: boolean;\n\n /**\n * Use this event to implement the asynchronous behavior for the component.\n *\n * The event is called in the following situations:\n * * The user scrolls to the end of the list of options, if `statusType` is set to `pending`.\n * * The user clicks on the recovery button in the error state.\n * * The user types inside the input field.\n * * The user focuses the input field.\n *\n * The detail object contains the following properties:\n * * `filteringText` - The value that you need to use to fetch options.\n * * `firstPage` - Indicates that you should fetch the first page of options that match the `filteringText`.\n * * `samePage` - Indicates that you should fetch the same page that you have previously fetched (for example, when the user clicks on the recovery button).\n **/\n onLoadItems?: NonCancelableEventHandler<OptionsLoadItemsDetail>;\n}\n\nexport interface DropdownProps extends ExpandToViewport {\n /**\n * Trigger element.\n */\n trigger: React.ReactNode;\n\n /**\n * \"Sticky\" header of the dropdown content\n */\n header?: React.ReactNode;\n\n /**\n * Footer slot fixed at the bottom of the dropdown\n */\n footer?: React.ReactNode;\n\n /**\n * Dropdown content elements.\n */\n content?: React.ReactNode;\n\n /**\n * Updating content key triggers dropdown position re-evaluation.\n */\n contentKey?: string;\n\n /**\n * Open state of the dropdown.\n */\n open?: boolean;\n\n /**\n * Called when
|
|
1
|
+
{"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../../../src/internal/components/dropdown/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';\n\nimport { NonCancelableEventHandler } from '../../events';\n\nexport type OptionsFilteringType = 'none' | 'auto' | 'manual';\n\n/**\n * Alignment of the dropdown relative to its trigger.\n */\nexport type DropdownAlignment =\n | 'start' // Aligns to the start edge of trigger (default)\n | 'center'; // Centers dropdown on trigger\n\n/**\n * Width constraint for the dropdown.\n * - 'trigger': references the trigger element's width\n * - number: width in pixels\n */\nexport type DropdownWidthConstraint = 'trigger' | number;\n\nexport interface OptionsLoadItemsDetail {\n filteringText: string;\n firstPage: boolean;\n samePage: boolean;\n}\n\nexport interface BaseDropdownHostProps extends ExpandToViewport {\n /**\n * If you have more than 500 options, enable this flag to apply a performance optimization\n * that makes the filtering experience smoother. We don't recommend enabling the feature if you\n * have less than 500 options, because the improvements to performance are offset by a\n * visible scrolling lag.\n *\n * When you set this flag to `true`, it removes options that are not currently in view from the DOM.\n * If your test accesses such options, you need to first scroll the options container\n * to the correct offset, before performing any operations on them. Use the element returned\n * by the `findOptionsContainer` test utility for this.\n */\n virtualScroll?: boolean;\n\n /**\n * Use this event to implement the asynchronous behavior for the component.\n *\n * The event is called in the following situations:\n * * The user scrolls to the end of the list of options, if `statusType` is set to `pending`.\n * * The user clicks on the recovery button in the error state.\n * * The user types inside the input field.\n * * The user focuses the input field.\n *\n * The detail object contains the following properties:\n * * `filteringText` - The value that you need to use to fetch options.\n * * `firstPage` - Indicates that you should fetch the first page of options that match the `filteringText`.\n * * `samePage` - Indicates that you should fetch the same page that you have previously fetched (for example, when the user clicks on the recovery button).\n **/\n onLoadItems?: NonCancelableEventHandler<OptionsLoadItemsDetail>;\n}\n\nexport interface DropdownProps extends ExpandToViewport {\n /**\n * Trigger element.\n */\n trigger: React.ReactNode;\n\n /**\n * \"Sticky\" header of the dropdown content\n */\n header?: React.ReactNode;\n\n /**\n * Footer slot fixed at the bottom of the dropdown\n */\n footer?: React.ReactNode;\n\n /**\n * Dropdown content elements.\n */\n content?: React.ReactNode;\n\n /**\n * Updating content key triggers dropdown position re-evaluation.\n */\n contentKey?: string;\n\n /**\n * Open state of the dropdown.\n */\n open?: boolean;\n\n /**\n * Called when the user clicks outside the dropdown and trigger.\n * The dropdown does not close automatically - the parent component\n * must update the `open` prop to close the dropdown.\n */\n onOutsideClick?: NonCancelableEventHandler<null>;\n\n /**\n * Called when a mouse button is pressed inside the dropdown content.\n */\n onMouseDown?: React.MouseEventHandler;\n\n /**\n * Dropdown id\n */\n dropdownId?: string;\n\n /**\n * Stretches dropdown to occupy entire height.\n */\n stretchHeight?: boolean;\n\n /**\n * Stretches the trigger to the height of the dropdown container.\n */\n stretchTriggerHeight?: boolean;\n\n /**\n * Minimum width constraint for the dropdown.\n * - Number: minimum width in pixels\n * - 'trigger': dropdown will be at least as wide as the trigger\n * - undefined: no minimum constraint (fits content)\n */\n minWidth?: DropdownWidthConstraint;\n\n /**\n * Maximum width constraint for the dropdown.\n * - Number: maximum width in pixels\n * - 'trigger': dropdown cannot exceed the trigger width\n * - undefined: fit to content width (no max constraint)\n */\n maxWidth?: DropdownWidthConstraint;\n\n /**\n * Preferred alignment of the dropdown relative to its trigger.\n * The dropdown will attempt this alignment first, but will automatically\n * adjust if there's insufficient space on the preferred side.\n */\n preferredAlignment?: DropdownAlignment;\n\n /**\n * Hides the block (top/bottom) borders of the dropdown content wrapper.\n */\n hideBlockBorder?: boolean;\n\n /**\n * Indicates if this dropdown lies within a parent dropdown and positions itself relative to it (as a fly out).\n */\n interior?: boolean;\n\n /**\n * Whether the dropdown will have a scrollbar or not\n */\n scrollable?: boolean;\n\n /**\n * Whether the dropdown will have a focus loop including trigger, header, content and footer.\n */\n loopFocus?: boolean;\n\n /**\n * Called when focus enters the trigger or dropdown content.\n */\n onFocus?: NonCancelableEventHandler<Pick<React.FocusEvent, 'target' | 'relatedTarget'>>;\n\n /**\n * Called when focus leaves the trigger or dropdown content.\n */\n onBlur?: NonCancelableEventHandler<Pick<React.FocusEvent, 'target' | 'relatedTarget'>>;\n\n /**\n * Called when focus enters the dropdown content from outside.\n * This fires only once when focus moves into the dropdown, not when moving between elements within it.\n */\n onFocusEnter?: NonCancelableEventHandler<Pick<React.FocusEvent, 'target' | 'relatedTarget'>>;\n\n /**\n * Called when focus leaves the dropdown content entirely.\n */\n onFocusLeave?: NonCancelableEventHandler<Pick<React.FocusEvent, 'target' | 'relatedTarget'>>;\n\n /**\n * Called when the user presses the Escape key while the dropdown is open.\n * The dropdown does not close automatically - the parent component\n * must update the `open` prop to close the dropdown.\n */\n onEscape?: NonCancelableEventHandler;\n\n /**\n * ID for the dropdown content wrapper\n */\n dropdownContentId?: string;\n\n /**\n * HTML role for the dropdown content wrapper\n */\n ariaRole?: string;\n\n /**\n * Aria label for the dropdown content wrapper\n */\n ariaLabel?: string;\n\n /**\n * Labelledby for the dropdown (required when role=\"dialog\")\n */\n ariaLabelledby?: string;\n\n /**\n * Describedby for the dropdown (recommended when role=\"dialog\")\n */\n ariaDescribedby?: string;\n}\n\nexport interface ExpandToViewport {\n /**\n * By default, the dropdown height is constrained to fit inside the height of its next scrollable container element.\n * Enabling this property will allow the dropdown to extend beyond that container by using fixed positioning and\n * [React Portals](https://reactjs.org/docs/portals.html).\n *\n * Set this property if the dropdown would otherwise be constrained by a scrollable container,\n * for example inside table and split view layouts.\n *\n * We recommend you use discretion, and don't enable this property unless necessary\n * because fixed positioning results in a slight, visible lag when scrolling complex pages.\n */\n expandToViewport?: boolean;\n}\n"]}
|
|
@@ -1,25 +1,25 @@
|
|
|
1
1
|
|
|
2
2
|
import './styles.scoped.css';
|
|
3
3
|
export default {
|
|
4
|
-
"dropdown-content-wrapper": "awsui_dropdown-content-
|
|
5
|
-
"awsui-motion-fade-in-dropdown": "awsui_awsui-motion-fade-in-
|
|
6
|
-
"refresh": "
|
|
7
|
-
"awsui-motion-fade-in-0": "awsui_awsui-motion-fade-in-
|
|
8
|
-
"root": "
|
|
9
|
-
"interior": "
|
|
10
|
-
"dropdown": "
|
|
11
|
-
"use-portal": "awsui_use-
|
|
12
|
-
"is-empty": "awsui_is-
|
|
13
|
-
"dropdown-drop-up": "awsui_dropdown-drop-
|
|
14
|
-
"with-limited-width": "awsui_with-limited-
|
|
15
|
-
"dropdown-drop-left": "awsui_dropdown-drop-
|
|
16
|
-
"dropdown-drop-right": "awsui_dropdown-drop-
|
|
17
|
-
"occupy-entire-width": "awsui_occupy-entire-
|
|
18
|
-
"use-flexible-width": "awsui_use-flexible-
|
|
19
|
-
"hide-block-border": "awsui_hide-block-
|
|
20
|
-
"open": "
|
|
21
|
-
"nowrap": "
|
|
22
|
-
"dropdown-content": "awsui_dropdown-
|
|
23
|
-
"stretch-trigger-height": "awsui_stretch-trigger-
|
|
4
|
+
"dropdown-content-wrapper": "awsui_dropdown-content-wrapper_qwoo0_1cll7_153",
|
|
5
|
+
"awsui-motion-fade-in-dropdown": "awsui_awsui-motion-fade-in-dropdown_qwoo0_1cll7_1",
|
|
6
|
+
"refresh": "awsui_refresh_qwoo0_1cll7_174",
|
|
7
|
+
"awsui-motion-fade-in-0": "awsui_awsui-motion-fade-in-0_qwoo0_1cll7_1",
|
|
8
|
+
"root": "awsui_root_qwoo0_1cll7_199",
|
|
9
|
+
"interior": "awsui_interior_qwoo0_1cll7_232",
|
|
10
|
+
"dropdown": "awsui_dropdown_qwoo0_1cll7_153",
|
|
11
|
+
"use-portal": "awsui_use-portal_qwoo0_1cll7_242",
|
|
12
|
+
"is-empty": "awsui_is-empty_qwoo0_1cll7_318",
|
|
13
|
+
"dropdown-drop-up": "awsui_dropdown-drop-up_qwoo0_1cll7_325",
|
|
14
|
+
"with-limited-width": "awsui_with-limited-width_qwoo0_1cll7_329",
|
|
15
|
+
"dropdown-drop-left": "awsui_dropdown-drop-left_qwoo0_1cll7_332",
|
|
16
|
+
"dropdown-drop-right": "awsui_dropdown-drop-right_qwoo0_1cll7_335",
|
|
17
|
+
"occupy-entire-width": "awsui_occupy-entire-width_qwoo0_1cll7_338",
|
|
18
|
+
"use-flexible-width": "awsui_use-flexible-width_qwoo0_1cll7_341",
|
|
19
|
+
"hide-block-border": "awsui_hide-block-border_qwoo0_1cll7_349",
|
|
20
|
+
"open": "awsui_open_qwoo0_1cll7_358",
|
|
21
|
+
"nowrap": "awsui_nowrap_qwoo0_1cll7_367",
|
|
22
|
+
"dropdown-content": "awsui_dropdown-content_qwoo0_1cll7_153",
|
|
23
|
+
"stretch-trigger-height": "awsui_stretch-trigger-height_qwoo0_1cll7_378"
|
|
24
24
|
};
|
|
25
25
|
|
|
@@ -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_dropdown-content-
|
|
154
|
-
animation: awsui_awsui-motion-fade-in-
|
|
153
|
+
.awsui_dropdown-content-wrapper_qwoo0_1cll7_153:not(#\9) {
|
|
154
|
+
animation: awsui_awsui-motion-fade-in-dropdown_qwoo0_1cll7_1 var(--motion-duration-show-quick-i2gulq, 135ms) var(--motion-easing-show-quick-xucy9w, ease-out);
|
|
155
155
|
}
|
|
156
|
-
@keyframes awsui_awsui-motion-fade-in-
|
|
156
|
+
@keyframes awsui_awsui-motion-fade-in-dropdown_qwoo0_1cll7_1 {
|
|
157
157
|
from {
|
|
158
158
|
opacity: 0.4;
|
|
159
159
|
}
|
|
@@ -162,22 +162,22 @@ 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_dropdown-content-
|
|
165
|
+
.awsui_dropdown-content-wrapper_qwoo0_1cll7_153:not(#\9) {
|
|
166
166
|
animation: none;
|
|
167
167
|
transition: none;
|
|
168
168
|
}
|
|
169
169
|
}
|
|
170
|
-
.awsui-motion-disabled .awsui_dropdown-content-
|
|
170
|
+
.awsui-motion-disabled .awsui_dropdown-content-wrapper_qwoo0_1cll7_153:not(#\9), .awsui-mode-entering .awsui_dropdown-content-wrapper_qwoo0_1cll7_153:not(#\9) {
|
|
171
171
|
animation: none;
|
|
172
172
|
transition: none;
|
|
173
173
|
}
|
|
174
|
-
.awsui_dropdown-content-
|
|
174
|
+
.awsui_dropdown-content-wrapper_qwoo0_1cll7_153.awsui_refresh_qwoo0_1cll7_174:not(#\9) {
|
|
175
175
|
transform-origin: top;
|
|
176
|
-
animation-name: awsui_awsui-motion-fade-in-
|
|
176
|
+
animation-name: awsui_awsui-motion-fade-in-0_qwoo0_1cll7_1;
|
|
177
177
|
animation-duration: var(--motion-duration-show-quick-i2gulq, 135ms);
|
|
178
178
|
animation-timing-function: var(--motion-easing-show-quick-xucy9w, ease-out);
|
|
179
179
|
}
|
|
180
|
-
@keyframes awsui_awsui-motion-fade-in-
|
|
180
|
+
@keyframes awsui_awsui-motion-fade-in-0_qwoo0_1cll7_1 {
|
|
181
181
|
from {
|
|
182
182
|
opacity: 0;
|
|
183
183
|
}
|
|
@@ -186,17 +186,17 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
186
186
|
}
|
|
187
187
|
}
|
|
188
188
|
@media (prefers-reduced-motion: reduce) {
|
|
189
|
-
.awsui_dropdown-content-
|
|
189
|
+
.awsui_dropdown-content-wrapper_qwoo0_1cll7_153.awsui_refresh_qwoo0_1cll7_174:not(#\9) {
|
|
190
190
|
animation: none;
|
|
191
191
|
transition: none;
|
|
192
192
|
}
|
|
193
193
|
}
|
|
194
|
-
.awsui-motion-disabled .awsui_dropdown-content-
|
|
194
|
+
.awsui-motion-disabled .awsui_dropdown-content-wrapper_qwoo0_1cll7_153.awsui_refresh_qwoo0_1cll7_174:not(#\9), .awsui-mode-entering .awsui_dropdown-content-wrapper_qwoo0_1cll7_153.awsui_refresh_qwoo0_1cll7_174:not(#\9) {
|
|
195
195
|
animation: none;
|
|
196
196
|
transition: none;
|
|
197
197
|
}
|
|
198
198
|
|
|
199
|
-
.
|
|
199
|
+
.awsui_root_qwoo0_1cll7_199:not(#\9) {
|
|
200
200
|
border-collapse: separate;
|
|
201
201
|
border-spacing: 0;
|
|
202
202
|
box-sizing: border-box;
|
|
@@ -229,34 +229,64 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
229
229
|
position: relative;
|
|
230
230
|
white-space: inherit;
|
|
231
231
|
}
|
|
232
|
-
.
|
|
232
|
+
.awsui_root_qwoo0_1cll7_199.awsui_interior_qwoo0_1cll7_232:not(#\9) {
|
|
233
233
|
position: static;
|
|
234
234
|
}
|
|
235
235
|
|
|
236
|
-
.
|
|
236
|
+
.awsui_dropdown_qwoo0_1cll7_153:not(#\9) {
|
|
237
237
|
position: absolute;
|
|
238
238
|
display: none;
|
|
239
239
|
z-index: 2000;
|
|
240
240
|
transform-origin: top;
|
|
241
241
|
}
|
|
242
|
-
.
|
|
242
|
+
.awsui_dropdown_qwoo0_1cll7_153.awsui_use-portal_qwoo0_1cll7_242:not(#\9) {
|
|
243
243
|
z-index: 7000;
|
|
244
244
|
}
|
|
245
|
-
.
|
|
245
|
+
.awsui_dropdown_qwoo0_1cll7_153:not(#\9):not(.awsui_interior_qwoo0_1cll7_232) {
|
|
246
246
|
transform: translateY(0px);
|
|
247
247
|
transition: transform var(--motion-duration-show-quick-i2gulq, 135ms);
|
|
248
248
|
}
|
|
249
249
|
@media (prefers-reduced-motion: reduce) {
|
|
250
|
-
.
|
|
250
|
+
.awsui_dropdown_qwoo0_1cll7_153:not(#\9):not(.awsui_interior_qwoo0_1cll7_232) {
|
|
251
251
|
animation: none;
|
|
252
252
|
transition: none;
|
|
253
253
|
}
|
|
254
254
|
}
|
|
255
|
-
.awsui-motion-disabled .
|
|
255
|
+
.awsui-motion-disabled .awsui_dropdown_qwoo0_1cll7_153:not(#\9):not(.awsui_interior_qwoo0_1cll7_232), .awsui-mode-entering .awsui_dropdown_qwoo0_1cll7_153:not(#\9):not(.awsui_interior_qwoo0_1cll7_232) {
|
|
256
256
|
animation: none;
|
|
257
257
|
transition: none;
|
|
258
258
|
}
|
|
259
|
-
.awsui_dropdown-content-
|
|
259
|
+
.awsui_dropdown-content-wrapper_qwoo0_1cll7_153:not(#\9) {
|
|
260
|
+
border-collapse: separate;
|
|
261
|
+
border-spacing: 0;
|
|
262
|
+
box-sizing: border-box;
|
|
263
|
+
caption-side: top;
|
|
264
|
+
cursor: auto;
|
|
265
|
+
direction: inherit;
|
|
266
|
+
empty-cells: show;
|
|
267
|
+
font-family: serif;
|
|
268
|
+
font-style: normal;
|
|
269
|
+
font-variant: normal;
|
|
270
|
+
font-stretch: normal;
|
|
271
|
+
hyphens: none;
|
|
272
|
+
letter-spacing: normal;
|
|
273
|
+
list-style: disc outside none;
|
|
274
|
+
tab-size: 8;
|
|
275
|
+
text-align: start;
|
|
276
|
+
text-indent: 0;
|
|
277
|
+
text-shadow: none;
|
|
278
|
+
text-transform: none;
|
|
279
|
+
visibility: visible;
|
|
280
|
+
white-space: normal;
|
|
281
|
+
word-spacing: normal;
|
|
282
|
+
font-size: var(--font-size-body-m-vv54cm, 14px);
|
|
283
|
+
line-height: var(--line-height-body-m-bedeoh, 22px);
|
|
284
|
+
color: var(--color-text-body-default-5qid0u, #16191f);
|
|
285
|
+
font-weight: 400;
|
|
286
|
+
font-family: var(--font-family-base-8x5ngf, "Noto Sans", "Helvetica Neue", Roboto, Arial, sans-serif);
|
|
287
|
+
-webkit-font-smoothing: auto;
|
|
288
|
+
-moz-osx-font-smoothing: auto;
|
|
289
|
+
white-space: inherit;
|
|
260
290
|
position: relative;
|
|
261
291
|
background-color: var(--color-background-dropdown-item-default-fhmksr, #ffffff);
|
|
262
292
|
outline: none;
|
|
@@ -268,7 +298,7 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
268
298
|
border-block: var(--border-divider-list-width-8ggz94, 1px) solid var(--color-border-container-top-svitxz, #eaeded);
|
|
269
299
|
box-sizing: border-box;
|
|
270
300
|
}
|
|
271
|
-
.awsui_dropdown-content-
|
|
301
|
+
.awsui_dropdown-content-wrapper_qwoo0_1cll7_153:not(#\9)::after {
|
|
272
302
|
content: "";
|
|
273
303
|
position: absolute;
|
|
274
304
|
z-index: 1;
|
|
@@ -285,66 +315,66 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
285
315
|
border-end-end-radius: var(--border-radius-dropdown-oaxffg, 0px);
|
|
286
316
|
pointer-events: none;
|
|
287
317
|
}
|
|
288
|
-
.awsui_dropdown-content-
|
|
318
|
+
.awsui_dropdown-content-wrapper_qwoo0_1cll7_153.awsui_is-empty_qwoo0_1cll7_318:not(#\9)::after {
|
|
289
319
|
display: none;
|
|
290
320
|
}
|
|
291
|
-
.
|
|
321
|
+
.awsui_dropdown_qwoo0_1cll7_153 > .awsui_dropdown-content-wrapper_qwoo0_1cll7_153:not(#\9) {
|
|
292
322
|
border-block-start: var(--border-divider-list-width-8ggz94, 1px) solid var(--color-border-container-top-svitxz, #eaeded);
|
|
293
323
|
border-block-end: var(--border-divider-list-width-8ggz94, 1px) solid var(--color-border-dropdown-group-dg9zg5, #eaeded);
|
|
294
324
|
}
|
|
295
|
-
.awsui_dropdown-drop-
|
|
325
|
+
.awsui_dropdown-drop-up_qwoo0_1cll7_325 > .awsui_dropdown-content-wrapper_qwoo0_1cll7_153:not(#\9) {
|
|
296
326
|
transform-origin: bottom;
|
|
297
327
|
box-shadow: var(--shadow-dropup-44quix, 0 -1px 1px 0 rgba(0, 28, 36, 0.3), 1px -1px 1px 0 rgba(0, 28, 36, 0.15), -1px -1px 1px 0 rgba(0, 28, 36, 0.15));
|
|
298
328
|
}
|
|
299
|
-
.awsui_dropdown-drop-
|
|
329
|
+
.awsui_dropdown-drop-up_qwoo0_1cll7_325.awsui_with-limited-width_qwoo0_1cll7_329 > .awsui_dropdown-content-wrapper_qwoo0_1cll7_153:not(#\9) {
|
|
300
330
|
border-block-start: none;
|
|
301
331
|
}
|
|
302
|
-
.awsui_dropdown-drop-
|
|
332
|
+
.awsui_dropdown-drop-left_qwoo0_1cll7_332:not(#\9) {
|
|
303
333
|
inset-inline-end: 0;
|
|
304
334
|
}
|
|
305
|
-
.awsui_dropdown-drop-
|
|
335
|
+
.awsui_dropdown-drop-right_qwoo0_1cll7_335:not(#\9) {
|
|
306
336
|
inset-inline-start: 0;
|
|
307
337
|
}
|
|
308
|
-
.
|
|
338
|
+
.awsui_dropdown_qwoo0_1cll7_153.awsui_occupy-entire-width_qwoo0_1cll7_338:not(#\9) {
|
|
309
339
|
min-inline-size: 100%;
|
|
310
340
|
}
|
|
311
|
-
.
|
|
341
|
+
.awsui_dropdown_qwoo0_1cll7_153.awsui_use-flexible-width_qwoo0_1cll7_341:not(#\9) {
|
|
312
342
|
inline-size: max-content;
|
|
313
343
|
max-inline-size: var(--awsui-dropdown-default-max-width-c5ek4l, none);
|
|
314
344
|
min-inline-size: var(--awsui-dropdown-default-min-width-c5ek4l, auto);
|
|
315
345
|
}
|
|
316
|
-
.
|
|
346
|
+
.awsui_dropdown_qwoo0_1cll7_153.awsui_interior_qwoo0_1cll7_232 > .awsui_dropdown-content-wrapper_qwoo0_1cll7_153:not(#\9) {
|
|
317
347
|
margin-block-start: -1px;
|
|
318
348
|
}
|
|
319
|
-
.
|
|
349
|
+
.awsui_dropdown_qwoo0_1cll7_153.awsui_hide-block-border_qwoo0_1cll7_349 > .awsui_dropdown-content-wrapper_qwoo0_1cll7_153:not(#\9) {
|
|
320
350
|
border-block-start: none;
|
|
321
351
|
}
|
|
322
|
-
.
|
|
352
|
+
.awsui_dropdown_qwoo0_1cll7_153.awsui_hide-block-border_qwoo0_1cll7_349:not(#\9):not(.awsui_dropdown-drop-up_qwoo0_1cll7_325) > .awsui_dropdown-content-wrapper_qwoo0_1cll7_153 {
|
|
323
353
|
border-block-end: none;
|
|
324
354
|
}
|
|
325
|
-
.
|
|
355
|
+
.awsui_dropdown_qwoo0_1cll7_153.awsui_hide-block-border_qwoo0_1cll7_349.awsui_refresh_qwoo0_1cll7_174 > .awsui_dropdown-content-wrapper_qwoo0_1cll7_153:not(#\9) {
|
|
326
356
|
border-block-end: none;
|
|
327
357
|
}
|
|
328
|
-
.
|
|
358
|
+
.awsui_dropdown_qwoo0_1cll7_153.awsui_open_qwoo0_1cll7_358:not(#\9) {
|
|
329
359
|
display: block;
|
|
330
360
|
}
|
|
331
|
-
.
|
|
361
|
+
.awsui_dropdown_qwoo0_1cll7_153.awsui_open_qwoo0_1cll7_358:not(#\9):not(.awsui_interior_qwoo0_1cll7_232).awsui_refresh_qwoo0_1cll7_174[data-animating=true] {
|
|
332
362
|
transform: translateY(4px);
|
|
333
363
|
}
|
|
334
|
-
.
|
|
364
|
+
.awsui_dropdown_qwoo0_1cll7_153.awsui_open_qwoo0_1cll7_358:not(#\9):not(.awsui_interior_qwoo0_1cll7_232).awsui_refresh_qwoo0_1cll7_174[data-animating=true].awsui_dropdown-drop-up_qwoo0_1cll7_325 {
|
|
335
365
|
transform: translateY(-4px);
|
|
336
366
|
}
|
|
337
|
-
.
|
|
367
|
+
.awsui_dropdown_qwoo0_1cll7_153.awsui_open_qwoo0_1cll7_358.awsui_nowrap_qwoo0_1cll7_367:not(#\9) {
|
|
338
368
|
white-space: nowrap;
|
|
339
369
|
overflow: scroll;
|
|
340
370
|
}
|
|
341
371
|
|
|
342
|
-
.awsui_dropdown-
|
|
372
|
+
.awsui_dropdown-content_qwoo0_1cll7_153:not(#\9) {
|
|
343
373
|
display: flex;
|
|
344
374
|
flex-direction: column;
|
|
345
375
|
inline-size: 100%;
|
|
346
376
|
}
|
|
347
377
|
|
|
348
|
-
.awsui_stretch-trigger-
|
|
378
|
+
.awsui_stretch-trigger-height_qwoo0_1cll7_378:not(#\9) {
|
|
349
379
|
block-size: 100%;
|
|
350
380
|
}
|