@cloudscape-design/components 3.0.359 → 3.0.361

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.
Files changed (106) hide show
  1. package/app-layout/index.d.ts.map +1 -1
  2. package/app-layout/index.js +4 -5
  3. package/app-layout/index.js.map +1 -1
  4. package/app-layout/utils/use-content-width.js +1 -1
  5. package/app-layout/utils/use-content-width.js.map +1 -1
  6. package/app-layout/utils/use-observed-element.js +1 -1
  7. package/app-layout/utils/use-observed-element.js.map +1 -1
  8. package/area-chart/model/use-chart-model.d.ts.map +1 -1
  9. package/area-chart/model/use-chart-model.js +2 -2
  10. package/area-chart/model/use-chart-model.js.map +1 -1
  11. package/code-editor/listeners.js +2 -2
  12. package/code-editor/listeners.js.map +1 -1
  13. package/code-editor/resizable-box/index.js +2 -2
  14. package/code-editor/resizable-box/index.js.map +1 -1
  15. package/internal/breakpoints.d.ts +1 -0
  16. package/internal/breakpoints.d.ts.map +1 -1
  17. package/internal/breakpoints.js +3 -0
  18. package/internal/breakpoints.js.map +1 -1
  19. package/internal/components/autosuggest-input/index.d.ts.map +1 -1
  20. package/internal/components/autosuggest-input/index.js +1 -1
  21. package/internal/components/autosuggest-input/index.js.map +1 -1
  22. package/internal/components/dark-ribbon/index.js +2 -2
  23. package/internal/components/dark-ribbon/index.js.map +1 -1
  24. package/internal/components/dropdown/dropdown-fit-handler.d.ts +13 -2
  25. package/internal/components/dropdown/dropdown-fit-handler.d.ts.map +1 -1
  26. package/internal/components/dropdown/dropdown-fit-handler.js +30 -10
  27. package/internal/components/dropdown/dropdown-fit-handler.js.map +1 -1
  28. package/internal/components/dropdown/index.d.ts +1 -1
  29. package/internal/components/dropdown/index.d.ts.map +1 -1
  30. package/internal/components/dropdown/index.js +7 -6
  31. package/internal/components/dropdown/index.js.map +1 -1
  32. package/internal/components/dropdown/interfaces.d.ts +4 -0
  33. package/internal/components/dropdown/interfaces.d.ts.map +1 -1
  34. package/internal/components/dropdown/interfaces.js.map +1 -1
  35. package/internal/components/dropdown/styles.css.js +21 -20
  36. package/internal/components/dropdown/styles.scoped.css +38 -35
  37. package/internal/components/dropdown/styles.selectors.js +21 -20
  38. package/internal/components/options-list/index.d.ts.map +1 -1
  39. package/internal/components/options-list/index.js +2 -2
  40. package/internal/components/options-list/index.js.map +1 -1
  41. package/internal/environment.js +1 -1
  42. package/internal/environment.json +1 -1
  43. package/internal/hooks/container-queries/index.d.ts +0 -1
  44. package/internal/hooks/container-queries/index.d.ts.map +1 -1
  45. package/internal/hooks/container-queries/index.js +0 -1
  46. package/internal/hooks/container-queries/index.js.map +1 -1
  47. package/internal/hooks/container-queries/use-height-measure.js +1 -1
  48. package/internal/hooks/container-queries/use-height-measure.js.map +1 -1
  49. package/internal/hooks/use-dynamic-overlap/index.js +1 -1
  50. package/internal/hooks/use-dynamic-overlap/index.js.map +1 -1
  51. package/internal/hooks/use-mobile/index.js +1 -1
  52. package/internal/hooks/use-mobile/index.js.map +1 -1
  53. package/internal/hooks/use-mouse-down-target.js +1 -1
  54. package/internal/hooks/use-mouse-down-target.js.map +1 -1
  55. package/internal/hooks/use-mutation-observer/index.d.ts.map +1 -1
  56. package/internal/hooks/use-mutation-observer/index.js +2 -3
  57. package/internal/hooks/use-mutation-observer/index.js.map +1 -1
  58. package/internal/manifest.json +1 -1
  59. package/multiselect/internal.d.ts.map +1 -1
  60. package/multiselect/internal.js +1 -1
  61. package/multiselect/internal.js.map +1 -1
  62. package/package.json +1 -1
  63. package/pie-chart/labels.js +1 -1
  64. package/pie-chart/labels.js.map +1 -1
  65. package/popover/container.d.ts.map +1 -1
  66. package/popover/container.js +1 -1
  67. package/popover/container.js.map +1 -1
  68. package/s3-resource-selector/s3-in-context/use-versions-fetch.d.ts.map +1 -1
  69. package/s3-resource-selector/s3-in-context/use-versions-fetch.js +2 -2
  70. package/s3-resource-selector/s3-in-context/use-versions-fetch.js.map +1 -1
  71. package/s3-resource-selector/s3-modal/basic-table.d.ts.map +1 -1
  72. package/s3-resource-selector/s3-modal/basic-table.js +2 -2
  73. package/s3-resource-selector/s3-modal/basic-table.js.map +1 -1
  74. package/select/internal.d.ts.map +1 -1
  75. package/select/internal.js +1 -1
  76. package/select/internal.js.map +1 -1
  77. package/split-panel/bottom.js +1 -1
  78. package/split-panel/bottom.js.map +1 -1
  79. package/table/body-cell/click-away.js +2 -2
  80. package/table/body-cell/click-away.js.map +1 -1
  81. package/table/resizer/index.js +3 -3
  82. package/table/resizer/index.js.map +1 -1
  83. package/table/sticky-columns/use-sticky-columns.d.ts.map +1 -1
  84. package/table/sticky-columns/use-sticky-columns.js +2 -3
  85. package/table/sticky-columns/use-sticky-columns.js.map +1 -1
  86. package/table/use-sticky-header.js +1 -1
  87. package/table/use-sticky-header.js.map +1 -1
  88. package/tag-editor/index.d.ts.map +1 -1
  89. package/tag-editor/index.js +6 -6
  90. package/tag-editor/index.js.map +1 -1
  91. package/internal/hooks/container-queries/use-resize-observer.d.ts +0 -21
  92. package/internal/hooks/container-queries/use-resize-observer.d.ts.map +0 -1
  93. package/internal/hooks/container-queries/use-resize-observer.js +0 -54
  94. package/internal/hooks/container-queries/use-resize-observer.js.map +0 -1
  95. package/internal/hooks/container-queries/utils.d.ts +0 -4
  96. package/internal/hooks/container-queries/utils.d.ts.map +0 -1
  97. package/internal/hooks/container-queries/utils.js +0 -10
  98. package/internal/hooks/container-queries/utils.js.map +0 -1
  99. package/internal/hooks/use-singleton-handler/index.d.ts +0 -11
  100. package/internal/hooks/use-singleton-handler/index.d.ts.map +0 -1
  101. package/internal/hooks/use-singleton-handler/index.js +0 -45
  102. package/internal/hooks/use-singleton-handler/index.js.map +0 -1
  103. package/internal/hooks/use-stable-event-handler/index.d.ts +0 -10
  104. package/internal/hooks/use-stable-event-handler/index.d.ts.map +0 -1
  105. package/internal/hooks/use-stable-event-handler/index.js +0 -19
  106. package/internal/hooks/use-stable-event-handler/index.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":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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,MAAM,KAAK,SAAS,CAAC;AAEvG,eAAe,QAAQ,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport styles from './styles.css.js';\nimport clsx from 'clsx';\nimport { useMergeRefs } from '../../hooks/use-merge-refs';\nimport React, { useEffect, useLayoutEffect, useRef, useState } from 'react';\nimport { createPortal } from 'react-dom';\nimport { fireNonCancelableEvent } from '../../events';\nimport { DropdownProps } from './interfaces';\nimport { DropdownPosition, InteriorDropdownPosition, calculatePosition } from './dropdown-fit-handler';\nimport { Transition, TransitionStatus } from '../transition';\nimport { useVisualRefresh } from '../../hooks/use-visual-mode';\nimport { usePortalModeClasses } from '../../hooks/use-portal-mode-classes';\nimport { DropdownContextProvider, DropdownContextProviderProps } from './context';\nimport { useMobile } from '../../hooks/use-mobile';\nimport TabTrap from '../tab-trap/index.js';\nimport { getFirstFocusable, getLastFocusable } from '../focus-lock/utils.js';\nimport { useUniqueId } from '../../hooks/use-unique-id/index.js';\n\ninterface DropdownContainerProps {\n children?: React.ReactNode;\n renderWithPortal?: boolean;\n id?: string;\n referrerId?: string;\n open?: boolean;\n}\n\nconst DropdownContainer = ({ children, renderWithPortal = false, id, referrerId, open }: DropdownContainerProps) => {\n if (renderWithPortal) {\n if (open) {\n return createPortal(\n <div id={id} data-awsui-referrer-id={referrerId}>\n {children}\n </div>,\n document.body\n );\n } else {\n return null;\n }\n } else {\n return <>{children}</>;\n }\n};\n\ninterface TransitionContentProps {\n state: TransitionStatus;\n transitionRef: React.MutableRefObject<any>;\n dropdownClasses: string;\n stretchWidth: boolean;\n interior: boolean;\n isRefresh: boolean;\n dropdownRef: React.RefObject<HTMLDivElement>;\n verticalContainerRef: React.RefObject<HTMLDivElement>;\n expandToViewport?: boolean;\n header?: React.ReactNode;\n children?: React.ReactNode;\n footer?: React.ReactNode;\n position?: DropdownContextProviderProps['position'];\n open?: boolean;\n onMouseDown?: React.MouseEventHandler<Element>;\n id?: string;\n role?: string;\n ariaLabelledby?: string;\n ariaDescribedby?: string;\n}\n\nconst TransitionContent = ({\n state,\n transitionRef,\n dropdownClasses,\n stretchWidth,\n interior,\n isRefresh,\n dropdownRef,\n verticalContainerRef,\n expandToViewport,\n header,\n children,\n footer,\n position,\n open,\n onMouseDown,\n id,\n role,\n ariaLabelledby,\n ariaDescribedby,\n}: TransitionContentProps) => {\n const contentRef = useMergeRefs(dropdownRef, transitionRef);\n return (\n <div\n className={clsx(styles.dropdown, dropdownClasses, {\n [styles.open]: open,\n [styles['with-limited-width']]: !stretchWidth,\n [styles['hide-upper-border']]: stretchWidth,\n [styles.interior]: interior,\n [styles['is-empty']]: !header && !children,\n [styles.refresh]: isRefresh,\n [styles['use-portal']]: expandToViewport && !interior,\n })}\n ref={contentRef}\n id={id}\n role={role}\n aria-labelledby={ariaLabelledby}\n aria-describedby={ariaDescribedby}\n data-open={open}\n data-animating={state !== 'exited'}\n aria-hidden={!open}\n onMouseDown={onMouseDown}\n >\n <div className={clsx(styles['dropdown-content-wrapper'], isRefresh && styles.refresh)}>\n <div className={styles['ie11-wrapper']}>\n <div ref={verticalContainerRef} className={styles['dropdown-content']}>\n <DropdownContextProvider position={position}>\n {header}\n {children}\n {footer}\n </DropdownContextProvider>\n </div>\n </div>\n </div>\n </div>\n );\n};\n\nconst Dropdown = ({\n children,\n trigger,\n open,\n onDropdownClose,\n onMouseDown,\n header,\n footer,\n dropdownId,\n stretchTriggerHeight = false,\n stretchWidth = true,\n stretchHeight = false,\n stretchToTriggerWidth = true,\n expandToViewport = false,\n preferCenter = false,\n interior = false,\n minWidth,\n scrollable = true,\n loopFocus = expandToViewport,\n onFocus,\n onBlur,\n contentKey,\n dropdownContentId,\n dropdownContentRole,\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 // This container is only needed to apply max-height to. We can't move max-height to it's parent\n // because of an IE11 issue with flexbox. https://github.com/philipwalton/flexbugs/issues/216\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 const setDropdownPosition = (\n position: DropdownPosition | InteriorDropdownPosition,\n triggerBox: DOMRect,\n target: HTMLDivElement,\n verticalContainer: HTMLDivElement\n ) => {\n const entireWidth = !interior && stretchWidth;\n if (!stretchWidth) {\n // 1px offset for dropdowns where the dropdown itself needs a border, rather than on the items\n verticalContainer.style.maxHeight = `${parseInt(position.height) + 1}px`;\n } else {\n verticalContainer.style.maxHeight = position.height;\n }\n\n if (entireWidth && !expandToViewport) {\n if (stretchToTriggerWidth) {\n target.classList.add(styles['occupy-entire-width']);\n }\n } else {\n target.style.width = position.width;\n }\n // Using styles for main dropdown to adjust its position as preferred alternative\n if (position.dropUp && !interior) {\n target.classList.add(styles['dropdown-drop-up']);\n if (!expandToViewport) {\n target.style.bottom = '100%';\n }\n } else {\n target.classList.remove(styles['dropdown-drop-up']);\n }\n target.classList.add(position.dropLeft ? styles['dropdown-drop-left'] : styles['dropdown-drop-right']);\n\n if (position.left && position.left !== 'auto') {\n target.style.left = position.left;\n }\n\n // Position normal overflow dropdowns with fixed positioning relative to viewport\n if (expandToViewport && !interior) {\n target.style.position = 'fixed';\n if (position.dropUp) {\n target.style.bottom = `calc(100% - ${triggerBox.top}px)`;\n } else {\n target.style.top = `${triggerBox.bottom}px`;\n }\n if (position.dropLeft) {\n target.style.left = `calc(${triggerBox.right}px - ${position.width})`;\n } else {\n target.style.left = `${triggerBox.left}px`;\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.dropUp) {\n target.style.bottom = position.bottom;\n } else {\n target.style.top = position.top;\n }\n target.style.left = position.left;\n }\n\n if (position.dropUp && position.dropLeft) {\n setPosition('top-left');\n } else if (position.dropUp) {\n setPosition('top-right');\n } else if (position.dropLeft) {\n setPosition('bottom-left');\n } else {\n setPosition('bottom-right');\n }\n };\n\n const isOutsideDropdown = (element: Element) =>\n (!wrapperRef.current || !wrapperRef.current.contains(element)) &&\n (!dropdownContainerRef.current || !dropdownContainerRef.current.contains(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 useLayoutEffect(() => {\n const onDropdownOpen = () => {\n if (open && dropdownRef.current && triggerRef.current && verticalContainerRef.current) {\n // calculate scroll width only for dropdowns that has a scrollbar and ignore it for date picker components\n if (scrollable) {\n dropdownRef.current.classList.add(styles.nowrap);\n }\n setDropdownPosition(\n ...calculatePosition(\n dropdownRef.current,\n triggerRef.current,\n verticalContainerRef.current,\n interior,\n expandToViewport,\n preferCenter,\n stretchWidth,\n stretchHeight,\n isMobile,\n minWidth\n ),\n dropdownRef.current,\n verticalContainerRef.current\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, stretchWidth, isMobile, contentKey]);\n\n // subscribe to outside click\n useEffect(() => {\n if (!open) {\n return;\n }\n const clickListener = (e: MouseEvent) => {\n if (!dropdownRef.current?.contains(e.target as Node) && !triggerRef.current?.contains(e.target as Node)) {\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) {\n const triggerRect = triggerRef.current.getBoundingClientRect();\n const target = dropdownRef.current;\n if (fixedPosition.current) {\n if (fixedPosition.current.dropUp) {\n dropdownRef.current.style.bottom = `calc(100% - ${triggerRect.top}px)`;\n } else {\n target.style.top = `${triggerRect.bottom}px`;\n }\n if (fixedPosition.current.dropLeft) {\n target.style.left = `calc(${triggerRect.right}px - ${fixedPosition.current.width})`;\n } else {\n target.style.left = `${triggerRect.left}px`;\n }\n }\n }\n };\n\n updateDropdownPosition();\n\n window.addEventListener('scroll', updateDropdownPosition, true);\n window.addEventListener('resize', updateDropdownPosition, true);\n return () => {\n window.removeEventListener('scroll', updateDropdownPosition, true);\n window.removeEventListener('resize', updateDropdownPosition, true);\n };\n }, [open, expandToViewport]);\n\n const referrerId = useUniqueId();\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 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 stretchWidth={stretchWidth}\n interior={interior}\n header={header}\n expandToViewport={expandToViewport}\n footer={footer}\n onMouseDown={onMouseDown}\n isRefresh={isRefresh}\n dropdownRef={dropdownRef}\n verticalContainerRef={verticalContainerRef}\n position={position}\n id={dropdownContentId}\n role={dropdownContentRole}\n ariaLabelledby={ariaLabelledby}\n ariaDescribedby={ariaDescribedby}\n >\n {children}\n </TransitionContent>\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).bottom !== undefined;\n\nexport default Dropdown;\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"lib/default/","sources":["internal/components/dropdown/index.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,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,eAAe,IAE/B,QAAQ,CACS;gBAEpB,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,MAAM,KAAK,SAAS,CAAC;AAEvG,eAAe,QAAQ,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport styles from './styles.css.js';\nimport clsx from 'clsx';\nimport { useMergeRefs } from '../../hooks/use-merge-refs';\nimport React, { useEffect, useLayoutEffect, useRef, useState } from 'react';\nimport { createPortal } from 'react-dom';\nimport { fireNonCancelableEvent } from '../../events';\nimport { DropdownProps } from './interfaces';\nimport {\n DropdownPosition,\n InteriorDropdownPosition,\n calculatePosition,\n defaultMaxDropdownWidth,\n} from './dropdown-fit-handler';\nimport { Transition, TransitionStatus } from '../transition';\nimport { useVisualRefresh } from '../../hooks/use-visual-mode';\nimport { usePortalModeClasses } from '../../hooks/use-portal-mode-classes';\nimport { DropdownContextProvider, DropdownContextProviderProps } from './context';\nimport { useMobile } from '../../hooks/use-mobile';\nimport TabTrap from '../tab-trap/index.js';\nimport { getFirstFocusable, getLastFocusable } from '../focus-lock/utils.js';\nimport { useUniqueId } from '../../hooks/use-unique-id/index.js';\n\ninterface DropdownContainerProps {\n children?: React.ReactNode;\n renderWithPortal?: boolean;\n id?: string;\n referrerId?: string;\n open?: boolean;\n}\n\nconst DropdownContainer = ({ children, renderWithPortal = false, id, referrerId, open }: DropdownContainerProps) => {\n if (renderWithPortal) {\n if (open) {\n return createPortal(\n <div id={id} data-awsui-referrer-id={referrerId}>\n {children}\n </div>,\n document.body\n );\n } else {\n return null;\n }\n } else {\n return <>{children}</>;\n }\n};\n\ninterface TransitionContentProps {\n state: TransitionStatus;\n transitionRef: React.MutableRefObject<any>;\n dropdownClasses: string;\n stretchWidth: boolean;\n interior: boolean;\n isRefresh: boolean;\n dropdownRef: React.RefObject<HTMLDivElement>;\n verticalContainerRef: React.RefObject<HTMLDivElement>;\n expandToViewport?: boolean;\n stretchBeyondTriggerWidth?: boolean;\n header?: React.ReactNode;\n children?: React.ReactNode;\n footer?: React.ReactNode;\n position?: DropdownContextProviderProps['position'];\n open?: boolean;\n onMouseDown?: React.MouseEventHandler<Element>;\n id?: string;\n role?: string;\n ariaLabelledby?: string;\n ariaDescribedby?: string;\n}\n\nconst TransitionContent = ({\n state,\n transitionRef,\n dropdownClasses,\n stretchWidth,\n interior,\n isRefresh,\n dropdownRef,\n verticalContainerRef,\n expandToViewport,\n stretchBeyondTriggerWidth,\n header,\n children,\n footer,\n position,\n open,\n onMouseDown,\n id,\n role,\n ariaLabelledby,\n ariaDescribedby,\n}: TransitionContentProps) => {\n const contentRef = useMergeRefs(dropdownRef, transitionRef);\n return (\n <div\n className={clsx(styles.dropdown, dropdownClasses, {\n [styles.open]: open,\n [styles['with-limited-width']]: !stretchWidth,\n [styles['hide-upper-border']]: stretchWidth,\n [styles.interior]: interior,\n [styles['is-empty']]: !header && !children,\n [styles.refresh]: isRefresh,\n [styles['use-portal']]: expandToViewport && !interior,\n [styles['stretch-beyond-trigger-width']]: stretchBeyondTriggerWidth,\n })}\n ref={contentRef}\n id={id}\n role={role}\n aria-labelledby={ariaLabelledby}\n aria-describedby={ariaDescribedby}\n data-open={open}\n data-animating={state !== 'exited'}\n aria-hidden={!open}\n style={stretchBeyondTriggerWidth ? { maxWidth: defaultMaxDropdownWidth } : {}}\n onMouseDown={onMouseDown}\n >\n <div className={clsx(styles['dropdown-content-wrapper'], isRefresh && styles.refresh)}>\n <div className={styles['ie11-wrapper']}>\n <div ref={verticalContainerRef} className={styles['dropdown-content']}>\n <DropdownContextProvider position={position}>\n {header}\n {children}\n {footer}\n </DropdownContextProvider>\n </div>\n </div>\n </div>\n </div>\n );\n};\n\nconst Dropdown = ({\n children,\n trigger,\n open,\n onDropdownClose,\n onMouseDown,\n header,\n footer,\n dropdownId,\n stretchTriggerHeight = false,\n stretchWidth = true,\n stretchHeight = false,\n stretchToTriggerWidth = true,\n stretchBeyondTriggerWidth = false,\n expandToViewport = false,\n preferCenter = false,\n interior = false,\n minWidth,\n scrollable = true,\n loopFocus = expandToViewport,\n onFocus,\n onBlur,\n contentKey,\n dropdownContentId,\n dropdownContentRole,\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 // This container is only needed to apply max-height to. We can't move max-height to it's parent\n // because of an IE11 issue with flexbox. https://github.com/philipwalton/flexbugs/issues/216\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 const setDropdownPosition = (\n position: DropdownPosition | InteriorDropdownPosition,\n triggerBox: DOMRect,\n target: HTMLDivElement,\n verticalContainer: HTMLDivElement\n ) => {\n const entireWidth = !interior && stretchWidth;\n if (!stretchWidth) {\n // 1px offset for dropdowns where the dropdown itself needs a border, rather than on the items\n verticalContainer.style.maxHeight = `${parseInt(position.height) + 1}px`;\n } else {\n verticalContainer.style.maxHeight = position.height;\n }\n\n if (entireWidth && !expandToViewport) {\n if (stretchToTriggerWidth) {\n target.classList.add(styles['occupy-entire-width']);\n }\n } else {\n target.style.width = position.width;\n }\n // Using styles for main dropdown to adjust its position as preferred alternative\n if (position.dropUp && !interior) {\n target.classList.add(styles['dropdown-drop-up']);\n if (!expandToViewport) {\n target.style.bottom = '100%';\n }\n } else {\n target.classList.remove(styles['dropdown-drop-up']);\n }\n target.classList.add(position.dropLeft ? styles['dropdown-drop-left'] : styles['dropdown-drop-right']);\n\n if (position.left && position.left !== 'auto') {\n target.style.left = position.left;\n }\n\n // Position normal overflow dropdowns with fixed positioning relative to viewport\n if (expandToViewport && !interior) {\n target.style.position = 'fixed';\n if (position.dropUp) {\n target.style.bottom = `calc(100% - ${triggerBox.top}px)`;\n } else {\n target.style.top = `${triggerBox.bottom}px`;\n }\n if (position.dropLeft) {\n target.style.left = `calc(${triggerBox.right}px - ${position.width})`;\n } else {\n target.style.left = `${triggerBox.left}px`;\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.dropUp) {\n target.style.bottom = position.bottom;\n } else {\n target.style.top = position.top;\n }\n target.style.left = position.left;\n }\n\n if (position.dropUp && position.dropLeft) {\n setPosition('top-left');\n } else if (position.dropUp) {\n setPosition('top-right');\n } else if (position.dropLeft) {\n setPosition('bottom-left');\n } else {\n setPosition('bottom-right');\n }\n };\n\n const isOutsideDropdown = (element: Element) =>\n (!wrapperRef.current || !wrapperRef.current.contains(element)) &&\n (!dropdownContainerRef.current || !dropdownContainerRef.current.contains(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 useLayoutEffect(() => {\n const onDropdownOpen = () => {\n if (open && dropdownRef.current && triggerRef.current && verticalContainerRef.current) {\n // calculate scroll width only for dropdowns that has a scrollbar and ignore it for date picker components\n if (scrollable) {\n dropdownRef.current.classList.add(styles.nowrap);\n }\n setDropdownPosition(\n ...calculatePosition(\n dropdownRef.current,\n triggerRef.current,\n verticalContainerRef.current,\n interior,\n expandToViewport,\n preferCenter,\n stretchWidth,\n stretchHeight,\n isMobile,\n minWidth,\n stretchBeyondTriggerWidth\n ),\n dropdownRef.current,\n verticalContainerRef.current\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, stretchWidth, isMobile, contentKey]);\n\n // subscribe to outside click\n useEffect(() => {\n if (!open) {\n return;\n }\n const clickListener = (e: MouseEvent) => {\n if (!dropdownRef.current?.contains(e.target as Node) && !triggerRef.current?.contains(e.target as Node)) {\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) {\n const triggerRect = triggerRef.current.getBoundingClientRect();\n const target = dropdownRef.current;\n if (fixedPosition.current) {\n if (fixedPosition.current.dropUp) {\n dropdownRef.current.style.bottom = `calc(100% - ${triggerRect.top}px)`;\n } else {\n target.style.top = `${triggerRect.bottom}px`;\n }\n if (fixedPosition.current.dropLeft) {\n target.style.left = `calc(${triggerRect.right}px - ${fixedPosition.current.width})`;\n } else {\n target.style.left = `${triggerRect.left}px`;\n }\n }\n }\n };\n\n updateDropdownPosition();\n\n window.addEventListener('scroll', updateDropdownPosition, true);\n window.addEventListener('resize', updateDropdownPosition, true);\n return () => {\n window.removeEventListener('scroll', updateDropdownPosition, true);\n window.removeEventListener('resize', updateDropdownPosition, true);\n };\n }, [open, expandToViewport]);\n\n const referrerId = useUniqueId();\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 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 stretchWidth={stretchWidth}\n interior={interior}\n header={header}\n expandToViewport={expandToViewport}\n stretchBeyondTriggerWidth={stretchBeyondTriggerWidth}\n footer={footer}\n onMouseDown={onMouseDown}\n isRefresh={isRefresh}\n dropdownRef={dropdownRef}\n verticalContainerRef={verticalContainerRef}\n position={position}\n id={dropdownContentId}\n role={dropdownContentRole}\n ariaLabelledby={ariaLabelledby}\n ariaDescribedby={ariaDescribedby}\n >\n {children}\n </TransitionContent>\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).bottom !== undefined;\n\nexport default Dropdown;\n"]}
@@ -90,6 +90,10 @@ export interface DropdownProps extends ExpandToViewport {
90
90
  * @defaultValue true
91
91
  */
92
92
  stretchToTriggerWidth?: boolean;
93
+ /**
94
+ * Whether the dropdown content can grow beyond the width of the trigger.
95
+ */
96
+ stretchBeyondTriggerWidth?: boolean;
93
97
  /**
94
98
  * Determines that the dropdown should preferably be aligned to the center of the trigger
95
99
  * instead of dropping left or right.
@@ -1 +1 @@
1
- {"version":3,"file":"interfaces.d.ts","sourceRoot":"lib/default/","sources":["internal/components/dropdown/interfaces.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,yBAAyB,EAAE,MAAM,cAAc,CAAC;AACzD,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,MAAM,MAAM,oBAAoB,GAAG,MAAM,GAAG,MAAM,GAAG,QAAQ,CAAC;AAC9D,MAAM,WAAW,sBAAsB;IACrC,aAAa,EAAE,MAAM,CAAC;IACtB,SAAS,EAAE,OAAO,CAAC;IACnB,QAAQ,EAAE,OAAO,CAAC;CACnB;AAED,MAAM,WAAW,qBAAsB,SAAQ,gBAAgB;IAC7D;;;;;;;;;;OAUG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;IAExB;;;;;;;;;;;;;QAaI;IACJ,WAAW,CAAC,EAAE,yBAAyB,CAAC,sBAAsB,CAAC,CAAC;CACjE;AAED,MAAM,WAAW,aAAc,SAAQ,gBAAgB;IACrD;;OAEG;IACH,OAAO,EAAE,KAAK,CAAC,SAAS,CAAC;IACzB;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"],"names":[],"mappings":"","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { NonCancelableEventHandler } from '../../events';\nimport React from 'react';\n\nexport type OptionsFilteringType = 'none' | 'auto' | 'manual';\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 * \"Sticky\" header of the dropdown content\n */\n header?: React.ReactNode;\n /**\n * Footer slot fixed at the bottom of the dropdown\n */\n footer?: React.ReactNode;\n /**\n * Dropdown content elements.\n */\n children?: React.ReactNode;\n /**\n * Updating content key triggers dropdown position re-evaluation.\n */\n contentKey?: string;\n /**\n * Open state of the dropdown.\n */\n open?: boolean;\n /**\n * Called when a user clicks outside of the dropdown content, when it is open.\n */\n onDropdownClose?: NonCancelableEventHandler<null>;\n /**\n * Called when a mouse button is pressed inside the dropdown content.\n */\n onMouseDown?: React.MouseEventHandler;\n /**\n * Dropdown id\n */\n dropdownId?: string;\n /**\n * Stretches dropdown to occupy entire width.\n */\n stretchWidth?: boolean;\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 * Whether the dropdown content should be at least as wide as the trigger.\n *\n * @defaultValue true\n */\n stretchToTriggerWidth?: boolean;\n\n /**\n * Determines that the dropdown should preferably be aligned to the center of the trigger\n * instead of dropping left or right.\n */\n preferCenter?: 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 * Sets the min width of the dropdown (in px)\n */\n minWidth?: number;\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 * ID for the dropdown content wrapper\n */\n dropdownContentId?: string;\n /**\n * HTML role for the dropdown content wrapper\n */\n dropdownContentRole?: string;\n /**\n * Labelledby for the dropdown (required when role=\"dialog\")\n */\n ariaLabelledby?: string;\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 * However, use discretion. We recommend you 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
+ {"version":3,"file":"interfaces.js","sourceRoot":"lib/default/","sources":["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 { NonCancelableEventHandler } from '../../events';\nimport React from 'react';\n\nexport type OptionsFilteringType = 'none' | 'auto' | 'manual';\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 * \"Sticky\" header of the dropdown content\n */\n header?: React.ReactNode;\n /**\n * Footer slot fixed at the bottom of the dropdown\n */\n footer?: React.ReactNode;\n /**\n * Dropdown content elements.\n */\n children?: React.ReactNode;\n /**\n * Updating content key triggers dropdown position re-evaluation.\n */\n contentKey?: string;\n /**\n * Open state of the dropdown.\n */\n open?: boolean;\n /**\n * Called when a user clicks outside of the dropdown content, when it is open.\n */\n onDropdownClose?: NonCancelableEventHandler<null>;\n /**\n * Called when a mouse button is pressed inside the dropdown content.\n */\n onMouseDown?: React.MouseEventHandler;\n /**\n * Dropdown id\n */\n dropdownId?: string;\n /**\n * Stretches dropdown to occupy entire width.\n */\n stretchWidth?: boolean;\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 * Whether the dropdown content should be at least as wide as the trigger.\n *\n * @defaultValue true\n */\n stretchToTriggerWidth?: boolean;\n\n /**\n * Whether the dropdown content can grow beyond the width of the trigger.\n */\n stretchBeyondTriggerWidth?: boolean;\n\n /**\n * Determines that the dropdown should preferably be aligned to the center of the trigger\n * instead of dropping left or right.\n */\n preferCenter?: 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 * Sets the min width of the dropdown (in px)\n */\n minWidth?: number;\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 * ID for the dropdown content wrapper\n */\n dropdownContentId?: string;\n /**\n * HTML role for the dropdown content wrapper\n */\n dropdownContentRole?: string;\n /**\n * Labelledby for the dropdown (required when role=\"dialog\")\n */\n ariaLabelledby?: string;\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 * However, use discretion. We recommend you 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,26 @@
1
1
 
2
2
  import './styles.scoped.css';
3
3
  export default {
4
- "dropdown-content-wrapper": "awsui_dropdown-content-wrapper_qwoo0_9z5o3_93",
5
- "awsui-motion-fade-in-dropdown": "awsui_awsui-motion-fade-in-dropdown_qwoo0_9z5o3_1",
6
- "refresh": "awsui_refresh_qwoo0_9z5o3_114",
7
- "awsui-motion-fade-in-0": "awsui_awsui-motion-fade-in-0_qwoo0_9z5o3_1",
8
- "root": "awsui_root_qwoo0_9z5o3_143",
9
- "interior": "awsui_interior_qwoo0_9z5o3_157",
10
- "dropdown": "awsui_dropdown_qwoo0_9z5o3_93",
11
- "use-portal": "awsui_use-portal_qwoo0_9z5o3_168",
12
- "dropdown-drop-up": "awsui_dropdown-drop-up_qwoo0_9z5o3_213",
13
- "with-limited-width": "awsui_with-limited-width_qwoo0_9z5o3_217",
14
- "dropdown-drop-left": "awsui_dropdown-drop-left_qwoo0_9z5o3_220",
15
- "dropdown-drop-right": "awsui_dropdown-drop-right_qwoo0_9z5o3_223",
16
- "occupy-entire-width": "awsui_occupy-entire-width_qwoo0_9z5o3_226",
17
- "hide-upper-border": "awsui_hide-upper-border_qwoo0_9z5o3_229",
18
- "open": "awsui_open_qwoo0_9z5o3_236",
19
- "nowrap": "awsui_nowrap_qwoo0_9z5o3_245",
20
- "is-empty": "awsui_is-empty_qwoo0_9z5o3_249",
21
- "dropdown-content": "awsui_dropdown-content_qwoo0_9z5o3_93",
22
- "ie11-wrapper": "awsui_ie11-wrapper_qwoo0_9z5o3_259",
23
- "stretch-trigger-height": "awsui_stretch-trigger-height_qwoo0_9z5o3_263"
4
+ "dropdown-content-wrapper": "awsui_dropdown-content-wrapper_qwoo0_1063r_93",
5
+ "awsui-motion-fade-in-dropdown": "awsui_awsui-motion-fade-in-dropdown_qwoo0_1063r_1",
6
+ "refresh": "awsui_refresh_qwoo0_1063r_114",
7
+ "awsui-motion-fade-in-0": "awsui_awsui-motion-fade-in-0_qwoo0_1063r_1",
8
+ "root": "awsui_root_qwoo0_1063r_143",
9
+ "interior": "awsui_interior_qwoo0_1063r_157",
10
+ "dropdown": "awsui_dropdown_qwoo0_1063r_93",
11
+ "use-portal": "awsui_use-portal_qwoo0_1063r_168",
12
+ "dropdown-drop-up": "awsui_dropdown-drop-up_qwoo0_1063r_213",
13
+ "with-limited-width": "awsui_with-limited-width_qwoo0_1063r_217",
14
+ "dropdown-drop-left": "awsui_dropdown-drop-left_qwoo0_1063r_220",
15
+ "dropdown-drop-right": "awsui_dropdown-drop-right_qwoo0_1063r_223",
16
+ "occupy-entire-width": "awsui_occupy-entire-width_qwoo0_1063r_226",
17
+ "stretch-beyond-trigger-width": "awsui_stretch-beyond-trigger-width_qwoo0_1063r_229",
18
+ "hide-upper-border": "awsui_hide-upper-border_qwoo0_1063r_232",
19
+ "open": "awsui_open_qwoo0_1063r_239",
20
+ "nowrap": "awsui_nowrap_qwoo0_1063r_248",
21
+ "is-empty": "awsui_is-empty_qwoo0_1063r_252",
22
+ "dropdown-content": "awsui_dropdown-content_qwoo0_1063r_93",
23
+ "ie11-wrapper": "awsui_ie11-wrapper_qwoo0_1063r_262",
24
+ "stretch-trigger-height": "awsui_stretch-trigger-height_qwoo0_1063r_266"
24
25
  };
25
26
 
@@ -90,10 +90,10 @@ 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
- .awsui_dropdown-content-wrapper_qwoo0_9z5o3_93:not(#\9) {
94
- animation: awsui_awsui-motion-fade-in-dropdown_qwoo0_9z5o3_1 var(--motion-duration-show-quick-aq3ump, 135ms) var(--motion-easing-show-quick-vc5zgd, ease-out);
93
+ .awsui_dropdown-content-wrapper_qwoo0_1063r_93:not(#\9) {
94
+ animation: awsui_awsui-motion-fade-in-dropdown_qwoo0_1063r_1 var(--motion-duration-show-quick-aq3ump, 135ms) var(--motion-easing-show-quick-vc5zgd, ease-out);
95
95
  }
96
- @keyframes awsui_awsui-motion-fade-in-dropdown_qwoo0_9z5o3_1 {
96
+ @keyframes awsui_awsui-motion-fade-in-dropdown_qwoo0_1063r_1 {
97
97
  from {
98
98
  opacity: 0.4;
99
99
  }
@@ -102,22 +102,22 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
102
102
  }
103
103
  }
104
104
  @media (prefers-reduced-motion: reduce) {
105
- .awsui_dropdown-content-wrapper_qwoo0_9z5o3_93:not(#\9) {
105
+ .awsui_dropdown-content-wrapper_qwoo0_1063r_93:not(#\9) {
106
106
  animation: none;
107
107
  transition: none;
108
108
  }
109
109
  }
110
- .awsui-motion-disabled .awsui_dropdown-content-wrapper_qwoo0_9z5o3_93:not(#\9), .awsui-mode-entering .awsui_dropdown-content-wrapper_qwoo0_9z5o3_93:not(#\9) {
110
+ .awsui-motion-disabled .awsui_dropdown-content-wrapper_qwoo0_1063r_93:not(#\9), .awsui-mode-entering .awsui_dropdown-content-wrapper_qwoo0_1063r_93:not(#\9) {
111
111
  animation: none;
112
112
  transition: none;
113
113
  }
114
- .awsui_dropdown-content-wrapper_qwoo0_9z5o3_93.awsui_refresh_qwoo0_9z5o3_114:not(#\9) {
114
+ .awsui_dropdown-content-wrapper_qwoo0_1063r_93.awsui_refresh_qwoo0_1063r_114:not(#\9) {
115
115
  transform-origin: top;
116
- animation-name: awsui_awsui-motion-fade-in-0_qwoo0_9z5o3_1;
116
+ animation-name: awsui_awsui-motion-fade-in-0_qwoo0_1063r_1;
117
117
  animation-duration: var(--motion-duration-show-quick-aq3ump, 135ms);
118
118
  animation-timing-function: var(--motion-easing-show-quick-vc5zgd, ease-out);
119
119
  }
120
- @keyframes awsui_awsui-motion-fade-in-0_qwoo0_9z5o3_1 {
120
+ @keyframes awsui_awsui-motion-fade-in-0_qwoo0_1063r_1 {
121
121
  from {
122
122
  opacity: 0;
123
123
  }
@@ -126,12 +126,12 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
126
126
  }
127
127
  }
128
128
  @media (prefers-reduced-motion: reduce) {
129
- .awsui_dropdown-content-wrapper_qwoo0_9z5o3_93.awsui_refresh_qwoo0_9z5o3_114:not(#\9) {
129
+ .awsui_dropdown-content-wrapper_qwoo0_1063r_93.awsui_refresh_qwoo0_1063r_114:not(#\9) {
130
130
  animation: none;
131
131
  transition: none;
132
132
  }
133
133
  }
134
- .awsui-motion-disabled .awsui_dropdown-content-wrapper_qwoo0_9z5o3_93.awsui_refresh_qwoo0_9z5o3_114:not(#\9), .awsui-mode-entering .awsui_dropdown-content-wrapper_qwoo0_9z5o3_93.awsui_refresh_qwoo0_9z5o3_114:not(#\9) {
134
+ .awsui-motion-disabled .awsui_dropdown-content-wrapper_qwoo0_1063r_93.awsui_refresh_qwoo0_1063r_114:not(#\9), .awsui-mode-entering .awsui_dropdown-content-wrapper_qwoo0_1063r_93.awsui_refresh_qwoo0_1063r_114:not(#\9) {
135
135
  animation: none;
136
136
  transition: none;
137
137
  }
@@ -140,7 +140,7 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
140
140
  Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
141
141
  SPDX-License-Identifier: Apache-2.0
142
142
  */
143
- .awsui_root_qwoo0_9z5o3_143:not(#\9) {
143
+ .awsui_root_qwoo0_1063r_143:not(#\9) {
144
144
  /* stylelint-disable-next-line plugin/no-unsupported-browser-features */
145
145
  border-collapse: separate;
146
146
  border-spacing: 0;
@@ -180,11 +180,11 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
180
180
  position: relative;
181
181
  white-space: inherit;
182
182
  }
183
- .awsui_root_qwoo0_9z5o3_143.awsui_interior_qwoo0_9z5o3_157:not(#\9) {
183
+ .awsui_root_qwoo0_1063r_143.awsui_interior_qwoo0_1063r_157:not(#\9) {
184
184
  position: static;
185
185
  }
186
186
 
187
- .awsui_dropdown_qwoo0_9z5o3_93:not(#\9) {
187
+ .awsui_dropdown_qwoo0_1063r_93:not(#\9) {
188
188
  position: absolute;
189
189
  display: none;
190
190
  z-index: 2000;
@@ -192,24 +192,24 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
192
192
  user-select: none;
193
193
  transform-origin: top;
194
194
  }
195
- .awsui_dropdown_qwoo0_9z5o3_93.awsui_use-portal_qwoo0_9z5o3_168:not(#\9) {
195
+ .awsui_dropdown_qwoo0_1063r_93.awsui_use-portal_qwoo0_1063r_168:not(#\9) {
196
196
  z-index: 7000;
197
197
  }
198
- .awsui_dropdown_qwoo0_9z5o3_93:not(#\9):not(.awsui_interior_qwoo0_9z5o3_157) {
198
+ .awsui_dropdown_qwoo0_1063r_93:not(#\9):not(.awsui_interior_qwoo0_1063r_157) {
199
199
  transform: translateY(0px);
200
200
  transition: transform var(--motion-duration-show-quick-aq3ump, 135ms);
201
201
  }
202
202
  @media (prefers-reduced-motion: reduce) {
203
- .awsui_dropdown_qwoo0_9z5o3_93:not(#\9):not(.awsui_interior_qwoo0_9z5o3_157) {
203
+ .awsui_dropdown_qwoo0_1063r_93:not(#\9):not(.awsui_interior_qwoo0_1063r_157) {
204
204
  animation: none;
205
205
  transition: none;
206
206
  }
207
207
  }
208
- .awsui-motion-disabled .awsui_dropdown_qwoo0_9z5o3_93:not(#\9):not(.awsui_interior_qwoo0_9z5o3_157), .awsui-mode-entering .awsui_dropdown_qwoo0_9z5o3_93:not(#\9):not(.awsui_interior_qwoo0_9z5o3_157) {
208
+ .awsui-motion-disabled .awsui_dropdown_qwoo0_1063r_93:not(#\9):not(.awsui_interior_qwoo0_1063r_157), .awsui-mode-entering .awsui_dropdown_qwoo0_1063r_93:not(#\9):not(.awsui_interior_qwoo0_1063r_157) {
209
209
  animation: none;
210
210
  transition: none;
211
211
  }
212
- .awsui_dropdown-content-wrapper_qwoo0_9z5o3_93:not(#\9) {
212
+ .awsui_dropdown-content-wrapper_qwoo0_1063r_93:not(#\9) {
213
213
  position: relative;
214
214
  background-color: var(--color-background-dropdown-item-default-be16w5, #ffffff);
215
215
  outline: none;
@@ -219,7 +219,7 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
219
219
  box-sizing: border-box;
220
220
  border-bottom: none;
221
221
  }
222
- .awsui_dropdown-content-wrapper_qwoo0_9z5o3_93:not(#\9)::after {
222
+ .awsui_dropdown-content-wrapper_qwoo0_1063r_93:not(#\9)::after {
223
223
  content: "";
224
224
  position: absolute;
225
225
  z-index: 1;
@@ -233,60 +233,63 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
233
233
  pointer-events: none;
234
234
  }
235
235
  @media screen and (-ms-high-contrast: active), (-ms-high-contrast: none) {
236
- .awsui_dropdown-content-wrapper_qwoo0_9z5o3_93:not(#\9) {
236
+ .awsui_dropdown-content-wrapper_qwoo0_1063r_93:not(#\9) {
237
237
  border: var(--border-field-width-09w7vk, 2px) solid var(--color-border-container-top-736buh, transparent);
238
238
  }
239
239
  }
240
- .awsui_dropdown-drop-up_qwoo0_9z5o3_213 > .awsui_dropdown-content-wrapper_qwoo0_9z5o3_93:not(#\9) {
240
+ .awsui_dropdown-drop-up_qwoo0_1063r_213 > .awsui_dropdown-content-wrapper_qwoo0_1063r_93:not(#\9) {
241
241
  transform-origin: bottom;
242
242
  box-shadow: var(--shadow-dropup-7m0sn5, 0px 4px 20px 1px rgba(0, 7, 22, 0.1));
243
243
  }
244
- .awsui_dropdown-drop-up_qwoo0_9z5o3_213.awsui_with-limited-width_qwoo0_9z5o3_217 > .awsui_dropdown-content-wrapper_qwoo0_9z5o3_93:not(#\9) {
244
+ .awsui_dropdown-drop-up_qwoo0_1063r_213.awsui_with-limited-width_qwoo0_1063r_217 > .awsui_dropdown-content-wrapper_qwoo0_1063r_93:not(#\9) {
245
245
  border-top: none;
246
246
  }
247
- .awsui_dropdown-drop-left_qwoo0_9z5o3_220:not(#\9) {
247
+ .awsui_dropdown-drop-left_qwoo0_1063r_220:not(#\9) {
248
248
  right: 0;
249
249
  }
250
- .awsui_dropdown-drop-right_qwoo0_9z5o3_223:not(#\9) {
250
+ .awsui_dropdown-drop-right_qwoo0_1063r_223:not(#\9) {
251
251
  left: 0;
252
252
  }
253
- .awsui_dropdown_qwoo0_9z5o3_93.awsui_occupy-entire-width_qwoo0_9z5o3_226:not(#\9) {
253
+ .awsui_dropdown_qwoo0_1063r_93.awsui_occupy-entire-width_qwoo0_1063r_226:not(#\9) {
254
254
  min-width: 100%;
255
255
  }
256
- .awsui_dropdown_qwoo0_9z5o3_93.awsui_hide-upper-border_qwoo0_9z5o3_229 > .awsui_dropdown-content-wrapper_qwoo0_9z5o3_93:not(#\9) {
256
+ .awsui_dropdown_qwoo0_1063r_93.awsui_stretch-beyond-trigger-width_qwoo0_1063r_229:not(#\9) {
257
+ width: max-content;
258
+ }
259
+ .awsui_dropdown_qwoo0_1063r_93.awsui_hide-upper-border_qwoo0_1063r_232 > .awsui_dropdown-content-wrapper_qwoo0_1063r_93:not(#\9) {
257
260
  border-top: none;
258
261
  }
259
- .awsui_dropdown_qwoo0_9z5o3_93.awsui_interior_qwoo0_9z5o3_157 > .awsui_dropdown-content-wrapper_qwoo0_9z5o3_93:not(#\9) {
262
+ .awsui_dropdown_qwoo0_1063r_93.awsui_interior_qwoo0_1063r_157 > .awsui_dropdown-content-wrapper_qwoo0_1063r_93:not(#\9) {
260
263
  margin-top: -1px;
261
264
  border-top: var(--border-divider-list-width-27y3k5, 1px) solid var(--color-border-container-top-736buh, transparent);
262
265
  }
263
- .awsui_dropdown_qwoo0_9z5o3_93.awsui_open_qwoo0_9z5o3_236:not(#\9) {
266
+ .awsui_dropdown_qwoo0_1063r_93.awsui_open_qwoo0_1063r_239:not(#\9) {
264
267
  display: block;
265
268
  }
266
- .awsui_dropdown_qwoo0_9z5o3_93.awsui_open_qwoo0_9z5o3_236:not(#\9):not(.awsui_interior_qwoo0_9z5o3_157).awsui_refresh_qwoo0_9z5o3_114[data-animating=true] {
269
+ .awsui_dropdown_qwoo0_1063r_93.awsui_open_qwoo0_1063r_239:not(#\9):not(.awsui_interior_qwoo0_1063r_157).awsui_refresh_qwoo0_1063r_114[data-animating=true] {
267
270
  transform: translateY(4px);
268
271
  }
269
- .awsui_dropdown_qwoo0_9z5o3_93.awsui_open_qwoo0_9z5o3_236:not(#\9):not(.awsui_interior_qwoo0_9z5o3_157).awsui_refresh_qwoo0_9z5o3_114[data-animating=true].awsui_dropdown-drop-up_qwoo0_9z5o3_213 {
272
+ .awsui_dropdown_qwoo0_1063r_93.awsui_open_qwoo0_1063r_239:not(#\9):not(.awsui_interior_qwoo0_1063r_157).awsui_refresh_qwoo0_1063r_114[data-animating=true].awsui_dropdown-drop-up_qwoo0_1063r_213 {
270
273
  transform: translateY(-4px);
271
274
  }
272
- .awsui_dropdown_qwoo0_9z5o3_93.awsui_open_qwoo0_9z5o3_236.awsui_nowrap_qwoo0_9z5o3_245:not(#\9) {
275
+ .awsui_dropdown_qwoo0_1063r_93.awsui_open_qwoo0_1063r_239.awsui_nowrap_qwoo0_1063r_248:not(#\9) {
273
276
  white-space: nowrap;
274
277
  overflow: scroll;
275
278
  }
276
- .awsui_dropdown_qwoo0_9z5o3_93.awsui_is-empty_qwoo0_9z5o3_249:not(#\9)::after {
279
+ .awsui_dropdown_qwoo0_1063r_93.awsui_is-empty_qwoo0_1063r_252:not(#\9)::after {
277
280
  display: none;
278
281
  }
279
282
 
280
- .awsui_dropdown-content_qwoo0_9z5o3_93:not(#\9) {
283
+ .awsui_dropdown-content_qwoo0_1063r_93:not(#\9) {
281
284
  display: flex;
282
285
  flex-direction: column;
283
286
  width: 100%;
284
287
  }
285
288
 
286
- .awsui_ie11-wrapper_qwoo0_9z5o3_259:not(#\9) {
289
+ .awsui_ie11-wrapper_qwoo0_1063r_262:not(#\9) {
287
290
  display: flex;
288
291
  }
289
292
 
290
- .awsui_stretch-trigger-height_qwoo0_9z5o3_263:not(#\9) {
293
+ .awsui_stretch-trigger-height_qwoo0_1063r_266:not(#\9) {
291
294
  height: 100%;
292
295
  }
@@ -2,25 +2,26 @@
2
2
  // es-module interop with Babel and Typescript
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
4
  module.exports.default = {
5
- "dropdown-content-wrapper": "awsui_dropdown-content-wrapper_qwoo0_9z5o3_93",
6
- "awsui-motion-fade-in-dropdown": "awsui_awsui-motion-fade-in-dropdown_qwoo0_9z5o3_1",
7
- "refresh": "awsui_refresh_qwoo0_9z5o3_114",
8
- "awsui-motion-fade-in-0": "awsui_awsui-motion-fade-in-0_qwoo0_9z5o3_1",
9
- "root": "awsui_root_qwoo0_9z5o3_143",
10
- "interior": "awsui_interior_qwoo0_9z5o3_157",
11
- "dropdown": "awsui_dropdown_qwoo0_9z5o3_93",
12
- "use-portal": "awsui_use-portal_qwoo0_9z5o3_168",
13
- "dropdown-drop-up": "awsui_dropdown-drop-up_qwoo0_9z5o3_213",
14
- "with-limited-width": "awsui_with-limited-width_qwoo0_9z5o3_217",
15
- "dropdown-drop-left": "awsui_dropdown-drop-left_qwoo0_9z5o3_220",
16
- "dropdown-drop-right": "awsui_dropdown-drop-right_qwoo0_9z5o3_223",
17
- "occupy-entire-width": "awsui_occupy-entire-width_qwoo0_9z5o3_226",
18
- "hide-upper-border": "awsui_hide-upper-border_qwoo0_9z5o3_229",
19
- "open": "awsui_open_qwoo0_9z5o3_236",
20
- "nowrap": "awsui_nowrap_qwoo0_9z5o3_245",
21
- "is-empty": "awsui_is-empty_qwoo0_9z5o3_249",
22
- "dropdown-content": "awsui_dropdown-content_qwoo0_9z5o3_93",
23
- "ie11-wrapper": "awsui_ie11-wrapper_qwoo0_9z5o3_259",
24
- "stretch-trigger-height": "awsui_stretch-trigger-height_qwoo0_9z5o3_263"
5
+ "dropdown-content-wrapper": "awsui_dropdown-content-wrapper_qwoo0_1063r_93",
6
+ "awsui-motion-fade-in-dropdown": "awsui_awsui-motion-fade-in-dropdown_qwoo0_1063r_1",
7
+ "refresh": "awsui_refresh_qwoo0_1063r_114",
8
+ "awsui-motion-fade-in-0": "awsui_awsui-motion-fade-in-0_qwoo0_1063r_1",
9
+ "root": "awsui_root_qwoo0_1063r_143",
10
+ "interior": "awsui_interior_qwoo0_1063r_157",
11
+ "dropdown": "awsui_dropdown_qwoo0_1063r_93",
12
+ "use-portal": "awsui_use-portal_qwoo0_1063r_168",
13
+ "dropdown-drop-up": "awsui_dropdown-drop-up_qwoo0_1063r_213",
14
+ "with-limited-width": "awsui_with-limited-width_qwoo0_1063r_217",
15
+ "dropdown-drop-left": "awsui_dropdown-drop-left_qwoo0_1063r_220",
16
+ "dropdown-drop-right": "awsui_dropdown-drop-right_qwoo0_1063r_223",
17
+ "occupy-entire-width": "awsui_occupy-entire-width_qwoo0_1063r_226",
18
+ "stretch-beyond-trigger-width": "awsui_stretch-beyond-trigger-width_qwoo0_1063r_229",
19
+ "hide-upper-border": "awsui_hide-upper-border_qwoo0_1063r_232",
20
+ "open": "awsui_open_qwoo0_1063r_239",
21
+ "nowrap": "awsui_nowrap_qwoo0_1063r_248",
22
+ "is-empty": "awsui_is-empty_qwoo0_1063r_252",
23
+ "dropdown-content": "awsui_dropdown-content_qwoo0_1063r_93",
24
+ "ie11-wrapper": "awsui_ie11-wrapper_qwoo0_1063r_262",
25
+ "stretch-trigger-height": "awsui_stretch-trigger-height_qwoo0_1063r_266"
25
26
  };
26
27
 
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"lib/default/","sources":["internal/components/options-list/index.tsx"],"names":[],"mappings":"AAIA,OAAO,KAA4B,MAAM,OAAO,CAAC;AACjD,OAAO,EAAE,kBAAkB,EAAgB,MAAM,sBAAsB,CAAC;AACxE,OAAO,EAEL,yBAAyB,EACzB,sBAAsB,EACtB,aAAa,EAEd,MAAM,cAAc,CAAC;AAItB,OAAO,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAEzD,MAAM,WAAW,gBAAiB,SAAQ,kBAAkB;IAC1D,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,UAAU,EAAE,mBAAmB,CAAC,UAAU,CAAC;IAC3C;;OAEG;IACH,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,gBAAgB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IACvC;;OAEG;IACH,UAAU,CAAC,EAAE,yBAAyB,CAAC;IACvC,SAAS,CAAC,EAAE,sBAAsB,CAAC,aAAa,CAAC,CAAC;IAClD,MAAM,CAAC,EAAE,yBAAyB,CAAC;QAAE,aAAa,EAAE,IAAI,GAAG,IAAI,CAAA;KAAE,CAAC,CAAC;IACnE,OAAO,CAAC,EAAE,yBAAyB,CAAC;IACpC,SAAS,CAAC,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,IAAI,CAAC;IACxC,WAAW,CAAC,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,IAAI,CAAC;IAC1C,QAAQ,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC,UAAU,CAAC,CAAC;IAC3C,IAAI,CAAC,EAAE,SAAS,GAAG,MAAM,GAAG,MAAM,CAAC;IACnC,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,iBAAiB,CAAC,EAAE,OAAO,CAAC;CAC7B;;AAmFD,wBAA6C"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"lib/default/","sources":["internal/components/options-list/index.tsx"],"names":[],"mappings":"AAIA,OAAO,KAA4B,MAAM,OAAO,CAAC;AACjD,OAAO,EAAE,kBAAkB,EAAgB,MAAM,sBAAsB,CAAC;AACxE,OAAO,EAEL,yBAAyB,EACzB,sBAAsB,EACtB,aAAa,EAEd,MAAM,cAAc,CAAC;AAGtB,OAAO,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAGzD,MAAM,WAAW,gBAAiB,SAAQ,kBAAkB;IAC1D,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,UAAU,EAAE,mBAAmB,CAAC,UAAU,CAAC;IAC3C;;OAEG;IACH,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,gBAAgB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IACvC;;OAEG;IACH,UAAU,CAAC,EAAE,yBAAyB,CAAC;IACvC,SAAS,CAAC,EAAE,sBAAsB,CAAC,aAAa,CAAC,CAAC;IAClD,MAAM,CAAC,EAAE,yBAAyB,CAAC;QAAE,aAAa,EAAE,IAAI,GAAG,IAAI,CAAA;KAAE,CAAC,CAAC;IACnE,OAAO,CAAC,EAAE,yBAAyB,CAAC;IACpC,SAAS,CAAC,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,IAAI,CAAC;IACxC,WAAW,CAAC,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,IAAI,CAAC;IAC1C,QAAQ,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC,UAAU,CAAC,CAAC;IAC3C,IAAI,CAAC,EAAE,SAAS,GAAG,MAAM,GAAG,MAAM,CAAC;IACnC,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,iBAAiB,CAAC,EAAE,OAAO,CAAC;CAC7B;;AAmFD,wBAA6C"}
@@ -8,7 +8,7 @@ import { getBaseProps } from '../../base-component';
8
8
  import { fireNonCancelableEvent, fireKeyboardEvent, } from '../../events';
9
9
  import { findUpUntil } from '../../utils/dom';
10
10
  import styles from './styles.css.js';
11
- import { useStableEventHandler } from '../../hooks/use-stable-event-handler';
11
+ import { useStableCallback } from '@cloudscape-design/component-toolkit/internal';
12
12
  const BOTTOM_TRIGGER_OFFSET = 80;
13
13
  const getItemIndex = (containerRef, event) => {
14
14
  const target = findUpUntil(event.target, element => element === containerRef.current || !!element.dataset.mouseTarget);
@@ -19,7 +19,7 @@ const OptionsList = (_a, ref) => {
19
19
  var { open, statusType, children, nativeAttributes = {}, onKeyDown, onBlur, onFocus, onLoadMore, onMouseUp, onMouseMove, position = 'relative', role = 'listbox', decreaseTopMargin = false, ariaLabelledby, ariaDescribedby } = _a, restProps = __rest(_a, ["open", "statusType", "children", "nativeAttributes", "onKeyDown", "onBlur", "onFocus", "onLoadMore", "onMouseUp", "onMouseMove", "position", "role", "decreaseTopMargin", "ariaLabelledby", "ariaDescribedby"]);
20
20
  const baseProps = getBaseProps(restProps);
21
21
  const menuRef = useRef(null);
22
- const handleScroll = useStableEventHandler(() => {
22
+ const handleScroll = useStableCallback(() => {
23
23
  const scrollContainer = menuRef === null || menuRef === void 0 ? void 0 : menuRef.current;
24
24
  if (scrollContainer) {
25
25
  const bottomEdgePosition = scrollContainer.scrollTop + scrollContainer.clientHeight;
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"lib/default/","sources":["internal/components/options-list/index.tsx"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AACjD,OAAO,EAAsB,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACxE,OAAO,EACL,sBAAsB,EAItB,iBAAiB,GAClB,MAAM,cA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EAAE,KAAK,CAAC,aAAa,EAAE,CAAC,EACvF,OAAO,EAAE,GAAG,EAAE,CAAC,sBAAsB,CAAC,OAAO,CAAC,EAC9C,QAAQ,EAAE,CAAC,CAAC,qBACK,cAAc,sBACb,eAAe,KAEhC,IAAI,IAAI,QAAQ,CACd,CACN,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,KAAK,CAAC,UAAU,CAAC,WAAW,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 { useMergeRefs } from '../../hooks/use-merge-refs';\nimport React, { useEffect, useRef } from 'react';\nimport { BaseComponentProps, getBaseProps } from '../../base-component';\nimport {\n fireNonCancelableEvent,\n NonCancelableEventHandler,\n CancelableEventHandler,\n BaseKeyDetail,\n fireKeyboardEvent,\n} from '../../events';\nimport { findUpUntil } from '../../utils/dom';\nimport styles from './styles.css.js';\nimport { useStableEventHandler } from '../../hooks/use-stable-event-handler';\nimport { DropdownStatusProps } from '../dropdown-status';\n\nexport interface OptionsListProps extends BaseComponentProps {\n open?: boolean;\n statusType: DropdownStatusProps.StatusType;\n /**\n * Options list\n */\n children: React.ReactNode;\n nativeAttributes?: Record<string, any>;\n /**\n * Called when more items need to be loaded.\n */\n onLoadMore?: NonCancelableEventHandler;\n onKeyDown?: CancelableEventHandler<BaseKeyDetail>;\n onBlur?: NonCancelableEventHandler<{ relatedTarget: Node | null }>;\n onFocus?: NonCancelableEventHandler;\n onMouseUp?: (itemIndex: number) => void;\n onMouseMove?: (itemIndex: number) => void;\n position?: React.CSSProperties['position'];\n role?: 'listbox' | 'list' | 'menu';\n ariaLabelledby?: string;\n ariaDescribedby?: string;\n decreaseTopMargin?: boolean;\n}\n\nconst BOTTOM_TRIGGER_OFFSET = 80;\n\nconst getItemIndex = (containerRef: React.RefObject<HTMLElement>, event: React.MouseEvent) => {\n const target = findUpUntil(\n event.target as HTMLElement,\n element => element === containerRef.current || !!element.dataset.mouseTarget\n );\n const mouseTarget = target?.dataset.mouseTarget;\n return mouseTarget ? parseInt(mouseTarget) : -1;\n};\n\nconst OptionsList = (\n {\n open,\n statusType,\n children,\n nativeAttributes = {},\n onKeyDown,\n onBlur,\n onFocus,\n onLoadMore,\n onMouseUp,\n onMouseMove,\n position = 'relative',\n role = 'listbox',\n decreaseTopMargin = false,\n ariaLabelledby,\n ariaDescribedby,\n ...restProps\n }: OptionsListProps,\n ref: React.Ref<HTMLUListElement>\n) => {\n const baseProps = getBaseProps(restProps);\n const menuRef = useRef<HTMLUListElement>(null);\n\n const handleScroll = useStableEventHandler(() => {\n const scrollContainer = menuRef?.current;\n if (scrollContainer) {\n const bottomEdgePosition = scrollContainer.scrollTop + scrollContainer.clientHeight;\n const remainingScrollHeight = scrollContainer.scrollHeight - bottomEdgePosition;\n if (remainingScrollHeight < BOTTOM_TRIGGER_OFFSET) {\n fireNonCancelableEvent(onLoadMore);\n }\n }\n });\n\n useEffect(() => {\n if (open && statusType === 'pending') {\n handleScroll();\n }\n }, [open, statusType, handleScroll]);\n\n const className = clsx(styles['options-list'], {\n [styles['decrease-top-margin']]: decreaseTopMargin,\n });\n\n const mergedRef = useMergeRefs(ref, menuRef);\n\n return (\n <ul\n {...baseProps}\n {...nativeAttributes}\n className={className}\n ref={mergedRef}\n style={{ position }}\n role={role}\n onScroll={handleScroll}\n onKeyDown={event => onKeyDown && fireKeyboardEvent(onKeyDown, event)}\n onMouseMove={event => onMouseMove?.(getItemIndex(menuRef, event))}\n onMouseUp={event => onMouseUp?.(getItemIndex(menuRef, event))}\n onBlur={event => fireNonCancelableEvent(onBlur, { relatedTarget: event.relatedTarget })}\n onFocus={() => fireNonCancelableEvent(onFocus)}\n tabIndex={-1}\n aria-labelledby={ariaLabelledby}\n aria-describedby={ariaDescribedby}\n >\n {open && children}\n </ul>\n );\n};\n\nexport default React.forwardRef(OptionsList);\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"lib/default/","s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CAAC,EACpE,WAAW,EAAE,KAAK,CAAC,EAAE,CAAC,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAG,YAAY,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC,EACjE,SAAS,EAAE,KAAK,CAAC,EAAE,CAAC,SAAS,aAAT,SAAS,uBAAT,SAAS,CAAG,YAAY,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC,EAC7D,MAAM,EAAE,KAAK,CAAC,EAAE,CAAC,sBAAsB,CAAC,MAAM,EAAE,EAAE,aAAa,EAAE,KAAK,CAAC,aAAa,EAAE,CAAC,EACvF,OAAO,EAAE,GAAG,EAAE,CAAC,sBAAsB,CAAC,OAAO,CAAC,EAC9C,QAAQ,EAAE,CAAC,CAAC,qBACK,cAAc,sBACb,eAAe,KAEhC,IAAI,IAAI,QAAQ,CACd,CACN,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,KAAK,CAAC,UAAU,CAAC,WAAW,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 { useMergeRefs } from '../../hooks/use-merge-refs';\nimport React, { useEffect, useRef } from 'react';\nimport { BaseComponentProps, getBaseProps } from '../../base-component';\nimport {\n fireNonCancelableEvent,\n NonCancelableEventHandler,\n CancelableEventHandler,\n BaseKeyDetail,\n fireKeyboardEvent,\n} from '../../events';\nimport { findUpUntil } from '../../utils/dom';\nimport styles from './styles.css.js';\nimport { DropdownStatusProps } from '../dropdown-status';\nimport { useStableCallback } from '@cloudscape-design/component-toolkit/internal';\n\nexport interface OptionsListProps extends BaseComponentProps {\n open?: boolean;\n statusType: DropdownStatusProps.StatusType;\n /**\n * Options list\n */\n children: React.ReactNode;\n nativeAttributes?: Record<string, any>;\n /**\n * Called when more items need to be loaded.\n */\n onLoadMore?: NonCancelableEventHandler;\n onKeyDown?: CancelableEventHandler<BaseKeyDetail>;\n onBlur?: NonCancelableEventHandler<{ relatedTarget: Node | null }>;\n onFocus?: NonCancelableEventHandler;\n onMouseUp?: (itemIndex: number) => void;\n onMouseMove?: (itemIndex: number) => void;\n position?: React.CSSProperties['position'];\n role?: 'listbox' | 'list' | 'menu';\n ariaLabelledby?: string;\n ariaDescribedby?: string;\n decreaseTopMargin?: boolean;\n}\n\nconst BOTTOM_TRIGGER_OFFSET = 80;\n\nconst getItemIndex = (containerRef: React.RefObject<HTMLElement>, event: React.MouseEvent) => {\n const target = findUpUntil(\n event.target as HTMLElement,\n element => element === containerRef.current || !!element.dataset.mouseTarget\n );\n const mouseTarget = target?.dataset.mouseTarget;\n return mouseTarget ? parseInt(mouseTarget) : -1;\n};\n\nconst OptionsList = (\n {\n open,\n statusType,\n children,\n nativeAttributes = {},\n onKeyDown,\n onBlur,\n onFocus,\n onLoadMore,\n onMouseUp,\n onMouseMove,\n position = 'relative',\n role = 'listbox',\n decreaseTopMargin = false,\n ariaLabelledby,\n ariaDescribedby,\n ...restProps\n }: OptionsListProps,\n ref: React.Ref<HTMLUListElement>\n) => {\n const baseProps = getBaseProps(restProps);\n const menuRef = useRef<HTMLUListElement>(null);\n\n const handleScroll = useStableCallback(() => {\n const scrollContainer = menuRef?.current;\n if (scrollContainer) {\n const bottomEdgePosition = scrollContainer.scrollTop + scrollContainer.clientHeight;\n const remainingScrollHeight = scrollContainer.scrollHeight - bottomEdgePosition;\n if (remainingScrollHeight < BOTTOM_TRIGGER_OFFSET) {\n fireNonCancelableEvent(onLoadMore);\n }\n }\n });\n\n useEffect(() => {\n if (open && statusType === 'pending') {\n handleScroll();\n }\n }, [open, statusType, handleScroll]);\n\n const className = clsx(styles['options-list'], {\n [styles['decrease-top-margin']]: decreaseTopMargin,\n });\n\n const mergedRef = useMergeRefs(ref, menuRef);\n\n return (\n <ul\n {...baseProps}\n {...nativeAttributes}\n className={className}\n ref={mergedRef}\n style={{ position }}\n role={role}\n onScroll={handleScroll}\n onKeyDown={event => onKeyDown && fireKeyboardEvent(onKeyDown, event)}\n onMouseMove={event => onMouseMove?.(getItemIndex(menuRef, event))}\n onMouseUp={event => onMouseUp?.(getItemIndex(menuRef, event))}\n onBlur={event => fireNonCancelableEvent(onBlur, { relatedTarget: event.relatedTarget })}\n onFocus={() => fireNonCancelableEvent(onFocus)}\n tabIndex={-1}\n aria-labelledby={ariaLabelledby}\n aria-describedby={ariaDescribedby}\n >\n {open && children}\n </ul>\n );\n};\n\nexport default React.forwardRef(OptionsList);\n"]}
@@ -1,4 +1,4 @@
1
1
  export var PACKAGE_SOURCE = "components";
2
- export var PACKAGE_VERSION = "3.0.0 (afa885b8)";
2
+ export var PACKAGE_VERSION = "3.0.0 (2ca759e2)";
3
3
  export var THEME = "open-source-visual-refresh";
4
4
  export var ALWAYS_VISUAL_REFRESH = true;
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "PACKAGE_SOURCE": "components",
3
- "PACKAGE_VERSION": "3.0.0 (afa885b8)",
3
+ "PACKAGE_VERSION": "3.0.0 (2ca759e2)",
4
4
  "THEME": "default",
5
5
  "ALWAYS_VISUAL_REFRESH": false
6
6
  }
@@ -1,3 +1,2 @@
1
1
  export * from './use-container-breakpoints';
2
- export * from './use-resize-observer';
3
2
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"lib/default/","sources":["internal/hooks/container-queries/index.ts"],"names":[],"mappings":"AAGA,cAAc,6BAA6B,CAAC;AAC5C,cAAc,uBAAuB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"lib/default/","sources":["internal/hooks/container-queries/index.ts"],"names":[],"mappings":"AAGA,cAAc,6BAA6B,CAAC"}
@@ -1,5 +1,4 @@
1
1
  // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
2
  // SPDX-License-Identifier: Apache-2.0
3
3
  export * from './use-container-breakpoints';
4
- export * from './use-resize-observer';
5
4
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"lib/default/","sources":["internal/hooks/container-queries/index.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AAEtC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,uBAAuB,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nexport * from './use-container-breakpoints';\nexport * from './use-resize-observer';\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"lib/default/","sources":["internal/hooks/container-queries/index.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AAEtC,cAAc,6BAA6B,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nexport * from './use-container-breakpoints';\n"]}
@@ -1,7 +1,7 @@
1
1
  // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
2
  // SPDX-License-Identifier: Apache-2.0
3
+ import { useResizeObserver } from '@cloudscape-design/component-toolkit/internal';
3
4
  import { useCallback, useState } from 'react';
4
- import { useResizeObserver } from './use-resize-observer';
5
5
  /**
6
6
  * Conditional resize observer for border box height used in charts.
7
7
  */
@@ -1 +1 @@
1
- {"version":3,"file":"use-height-measure.js","sourceRoot":"lib/default/","sources":["internal/hooks/container-queries/use-height-measure.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AAEtC,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC9C,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAE1D;;GAEG;AACH,MAAM,UAAU,gBAAgB,CAC9B,UAAiD,EACjD,IAAI,GAAG,KAAK,EACZ,OAA6B,EAAE;IAE/B,MAAM,CAAC,cAAc,EAAE,SAAS,CAAC,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAC;IAChD,uDAAuD;IACvD,MAAM,gBAAgB,GAAG,WAAW,CAAC,UAAU,EAAE,CAAC,GAAG,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC;IAClE,iBAAiB,CAAC,gBAAgB,EAAE,KAAK,CAAC,EAAE,CAAC,CAAC,IAAI,IAAI,SAAS,CAAC,KAAK,CAAC,eAAe,CAAC,CAAC,CAAC;IACxF,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,SAAS,CAAC;AAC5C,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport { useCallback, useState } from 'react';\nimport { useResizeObserver } from './use-resize-observer';\n\n/**\n * Conditional resize observer for border box height used in charts.\n */\nexport function useHeightMeasure(\n getMeasure: () => null | HTMLElement | SVGElement,\n skip = false,\n deps: React.DependencyList = []\n) {\n const [measuredHeight, setHeight] = useState(0);\n // eslint-disable-next-line react-hooks/exhaustive-deps\n const stableGetMeasure = useCallback(getMeasure, [...deps, skip]);\n useResizeObserver(stableGetMeasure, entry => !skip && setHeight(entry.borderBoxHeight));\n return !skip ? measuredHeight : undefined;\n}\n"]}
1
+ {"version":3,"file":"use-height-measure.js","sourceRoot":"lib/default/","sources":["internal/hooks/container-queries/use-height-measure.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AAEtC,OAAO,EAAE,iBAAiB,EAAE,MAAM,+CAA+C,CAAC;AAClF,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAE9C;;GAEG;AACH,MAAM,UAAU,gBAAgB,CAC9B,UAAiD,EACjD,IAAI,GAAG,KAAK,EACZ,OAA6B,EAAE;IAE/B,MAAM,CAAC,cAAc,EAAE,SAAS,CAAC,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAC;IAChD,uDAAuD;IACvD,MAAM,gBAAgB,GAAG,WAAW,CAAC,UAAU,EAAE,CAAC,GAAG,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC;IAClE,iBAAiB,CAAC,gBAAgB,EAAE,KAAK,CAAC,EAAE,CAAC,CAAC,IAAI,IAAI,SAAS,CAAC,KAAK,CAAC,eAAe,CAAC,CAAC,CAAC;IACxF,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,SAAS,CAAC;AAC5C,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport { useResizeObserver } from '@cloudscape-design/component-toolkit/internal';\nimport { useCallback, useState } from 'react';\n\n/**\n * Conditional resize observer for border box height used in charts.\n */\nexport function useHeightMeasure(\n getMeasure: () => null | HTMLElement | SVGElement,\n skip = false,\n deps: React.DependencyList = []\n) {\n const [measuredHeight, setHeight] = useState(0);\n // eslint-disable-next-line react-hooks/exhaustive-deps\n const stableGetMeasure = useCallback(getMeasure, [...deps, skip]);\n useResizeObserver(stableGetMeasure, entry => !skip && setHeight(entry.borderBoxHeight));\n return !skip ? measuredHeight : undefined;\n}\n"]}