@cloudscape-design/components 3.0.31 → 3.0.32

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 (36) hide show
  1. package/app-layout/index.d.ts.map +1 -1
  2. package/app-layout/index.js +6 -21
  3. package/app-layout/index.js.map +1 -1
  4. package/app-layout/notifications/index.d.ts.map +1 -1
  5. package/app-layout/notifications/index.js +5 -16
  6. package/app-layout/notifications/index.js.map +1 -1
  7. package/app-layout/notifications/styles.css.js +1 -1
  8. package/app-layout/notifications/styles.scoped.css +2 -1
  9. package/app-layout/notifications/styles.selectors.js +1 -1
  10. package/autosuggest/internal.d.ts +0 -7
  11. package/autosuggest/internal.d.ts.map +1 -1
  12. package/autosuggest/internal.js +9 -20
  13. package/autosuggest/internal.js.map +1 -1
  14. package/internal/environment.js +1 -1
  15. package/package.json +1 -1
  16. package/property-filter/controller.d.ts +2 -2
  17. package/property-filter/controller.js +3 -3
  18. package/property-filter/controller.js.map +1 -1
  19. package/property-filter/index.d.ts.map +1 -1
  20. package/property-filter/index.js +3 -3
  21. package/property-filter/index.js.map +1 -1
  22. package/property-filter/property-filter-autosuggest.d.ts +14 -0
  23. package/property-filter/property-filter-autosuggest.d.ts.map +1 -0
  24. package/property-filter/property-filter-autosuggest.js +143 -0
  25. package/property-filter/property-filter-autosuggest.js.map +1 -0
  26. package/app-layout/dark-header/index.d.ts +0 -11
  27. package/app-layout/dark-header/index.d.ts.map +0 -1
  28. package/app-layout/dark-header/index.js +0 -10
  29. package/app-layout/dark-header/index.js.map +0 -1
  30. package/app-layout/dark-header/styles.css.js +0 -6
  31. package/app-layout/dark-header/styles.scoped.css +0 -13
  32. package/app-layout/dark-header/styles.selectors.js +0 -7
  33. package/app-layout/utils/use-sticky-position.d.ts +0 -2
  34. package/app-layout/utils/use-sticky-position.d.ts.map +0 -1
  35. package/app-layout/utils/use-sticky-position.js +0 -54
  36. package/app-layout/utils/use-sticky-position.js.map +0 -1
@@ -1 +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,CAAC,gBAAgB,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;QAChD,OAAO,EAAE,CAAC;QACV,OAAO,cAAM,OAAA,WAAW,CAAC,mBAAmB,CAAC,QAAQ,EAAE,OAAO,CAAC,EAAlD,CAAkD,CAAC;IAClE,CAAC,EAAE,CAAC,SAAS,EAAE,WAAW,EAAE,YAAY,EAAE,eAAe,EAAE,oBAAoB,CAAC,CAAC,CAAC;IAElF,OAAO,CAAC,SAAS,EAAE,WAAW,CAAU,CAAC;AAC3C,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useEffect, useRef } from 'react';\nimport { useContainerQuery } from '../../internal/hooks/container-queries';\nimport { useMergeRefs } from '../../internal/hooks/use-merge-refs';\n\nfunction getScrollableContainers(element: HTMLElement) {\n let node: HTMLElement | null = element;\n\n while ((node = node.parentElement) && node !== document.body) {\n if (['scroll', 'auto'].indexOf(getComputedStyle(node).overflow) > -1) {\n return node;\n }\n }\n return null;\n}\n\nexport function useStickyPosition(topOffset = 0) {\n const [stickyHeight, stickyMeasureRef] = useContainerQuery(rect => rect.height);\n const stickyRefObject = useRef<HTMLDivElement>(null);\n const stickyRef = useMergeRefs(stickyMeasureRef, stickyRefObject);\n\n const [stickyWidth, placeholderMeasureRef] = useContainerQuery(rect => rect.width);\n const placeholderRefObject = useRef<HTMLDivElement>(null);\n const placeholderRef = useMergeRefs(placeholderMeasureRef, placeholderRefObject);\n\n const placeholder = <div ref={placeholderRef} />;\n\n useEffect(() => {\n if (!stickyRefObject.current || !placeholderRefObject.current) {\n return;\n }\n const stickyElement = stickyRefObject.current;\n const placeholder = placeholderRefObject.current;\n const scrollParent = getScrollableContainers(stickyElement);\n const handler = () => {\n const stickyBox = stickyElement.getBoundingClientRect();\n const containerBox = scrollParent ? scrollParent.getBoundingClientRect() : { top: 0 };\n if (stickyBox.top - containerBox.top <= topOffset) {\n stickyElement.style.position = 'fixed';\n stickyElement.style.width = `${stickyWidth}px`;\n stickyElement.style.top = `${topOffset}px`;\n placeholder.style.height = `${stickyHeight}px`;\n } else {\n stickyElement.style.position = '';\n stickyElement.style.width = ``;\n stickyElement.style.top = ``;\n placeholder.style.height = ``;\n }\n };\n const eventTarget = scrollParent || window;\n eventTarget.addEventListener('scroll', handler);\n handler();\n return () => eventTarget.removeEventListener('scroll', handler);\n }, [topOffset, stickyWidth, stickyHeight, stickyRefObject, placeholderRefObject]);\n\n return [stickyRef, placeholder] as const;\n}\n"]}