@cloudscape-design/components 3.0.247 → 3.0.249

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 (160) hide show
  1. package/app-layout/visual-refresh/app-bar.js +1 -1
  2. package/app-layout/visual-refresh/app-bar.js.map +1 -1
  3. package/app-layout/visual-refresh/context.d.ts +0 -1
  4. package/app-layout/visual-refresh/context.d.ts.map +1 -1
  5. package/app-layout/visual-refresh/context.js +3 -3
  6. package/app-layout/visual-refresh/context.js.map +1 -1
  7. package/autosuggest/internal.d.ts.map +1 -1
  8. package/autosuggest/internal.js +2 -1
  9. package/autosuggest/internal.js.map +1 -1
  10. package/autosuggest/options-list.d.ts +2 -1
  11. package/autosuggest/options-list.d.ts.map +1 -1
  12. package/autosuggest/options-list.js +8 -2
  13. package/autosuggest/options-list.js.map +1 -1
  14. package/button/internal.d.ts +1 -1
  15. package/button/internal.d.ts.map +1 -1
  16. package/button/internal.js +3 -2
  17. package/button/internal.js.map +1 -1
  18. package/button/styles.css.js +20 -19
  19. package/button/styles.scoped.css +298 -136
  20. package/button/styles.selectors.js +20 -19
  21. package/file-upload/default-formatters.d.ts +3 -0
  22. package/file-upload/default-formatters.d.ts.map +1 -0
  23. package/file-upload/default-formatters.js +23 -0
  24. package/file-upload/default-formatters.js.map +1 -0
  25. package/file-upload/dropzone/index.d.ts +9 -0
  26. package/file-upload/dropzone/index.d.ts.map +1 -0
  27. package/file-upload/dropzone/index.js +69 -0
  28. package/file-upload/dropzone/index.js.map +1 -0
  29. package/file-upload/dropzone/styles.css.js +7 -0
  30. package/file-upload/dropzone/styles.scoped.css +108 -0
  31. package/file-upload/dropzone/styles.selectors.js +8 -0
  32. package/file-upload/file-input/index.d.ts +14 -0
  33. package/file-upload/file-input/index.d.ts.map +1 -0
  34. package/file-upload/file-input/index.js +55 -0
  35. package/file-upload/file-input/index.js.map +1 -0
  36. package/file-upload/file-input/styles.css.js +8 -0
  37. package/file-upload/file-input/styles.scoped.css +21 -0
  38. package/file-upload/file-input/styles.selectors.js +9 -0
  39. package/file-upload/file-option/index.d.ts +10 -0
  40. package/file-upload/file-option/index.d.ts.map +1 -0
  41. package/file-upload/file-option/index.js +22 -0
  42. package/file-upload/file-option/index.js.map +1 -0
  43. package/file-upload/file-option/styles.css.js +12 -0
  44. package/file-upload/file-option/styles.scoped.css +35 -0
  45. package/file-upload/file-option/styles.selectors.js +13 -0
  46. package/file-upload/file-option/thumbnail.d.ts +7 -0
  47. package/file-upload/file-option/thumbnail.d.ts.map +1 -0
  48. package/file-upload/file-option/thumbnail.js +20 -0
  49. package/file-upload/file-option/thumbnail.js.map +1 -0
  50. package/file-upload/index.d.ts +6 -0
  51. package/file-upload/index.d.ts.map +1 -0
  52. package/file-upload/index.js +17 -0
  53. package/file-upload/index.js.map +1 -0
  54. package/file-upload/interfaces.d.ts +99 -0
  55. package/file-upload/interfaces.d.ts.map +1 -0
  56. package/file-upload/interfaces.js +4 -0
  57. package/file-upload/interfaces.js.map +1 -0
  58. package/file-upload/internal.d.ts +7 -0
  59. package/file-upload/internal.d.ts.map +1 -0
  60. package/file-upload/internal.js +72 -0
  61. package/file-upload/internal.js.map +1 -0
  62. package/file-upload/styles.css.js +7 -0
  63. package/file-upload/styles.scoped.css +16 -0
  64. package/file-upload/styles.selectors.js +8 -0
  65. package/form-field/internal.d.ts +6 -1
  66. package/form-field/internal.d.ts.map +1 -1
  67. package/form-field/internal.js +6 -3
  68. package/form-field/internal.js.map +1 -1
  69. package/index.d.ts +1 -0
  70. package/index.d.ts.map +1 -1
  71. package/index.js +1 -0
  72. package/index.js.map +1 -1
  73. package/internal/base-component/styles.scoped.css +17 -0
  74. package/internal/components/dropdown-footer/index.d.ts +1 -0
  75. package/internal/components/dropdown-footer/index.d.ts.map +1 -1
  76. package/internal/components/dropdown-footer/index.js +2 -2
  77. package/internal/components/dropdown-footer/index.js.map +1 -1
  78. package/internal/components/live-region/index.d.ts +2 -1
  79. package/internal/components/live-region/index.d.ts.map +1 -1
  80. package/internal/components/live-region/index.js +2 -2
  81. package/internal/components/live-region/index.js.map +1 -1
  82. package/internal/components/options-list/index.d.ts +1 -0
  83. package/internal/components/options-list/index.d.ts.map +1 -1
  84. package/internal/components/options-list/index.js +2 -2
  85. package/internal/components/options-list/index.js.map +1 -1
  86. package/internal/context/app-layout-context.d.ts +0 -1
  87. package/internal/context/app-layout-context.d.ts.map +1 -1
  88. package/internal/context/app-layout-context.js.map +1 -1
  89. package/internal/context/dynamic-overlap-context.d.ts +3 -0
  90. package/internal/context/dynamic-overlap-context.d.ts.map +1 -0
  91. package/internal/context/dynamic-overlap-context.js +5 -0
  92. package/internal/context/dynamic-overlap-context.js.map +1 -0
  93. package/internal/environment.js +1 -1
  94. package/internal/generated/theming/index.cjs +95 -0
  95. package/internal/generated/theming/index.js +95 -0
  96. package/internal/hooks/use-dynamic-overlap/index.js +7 -7
  97. package/internal/hooks/use-dynamic-overlap/index.js.map +1 -1
  98. package/internal/manifest.json +1 -1
  99. package/multiselect/internal.d.ts.map +1 -1
  100. package/multiselect/internal.js +4 -3
  101. package/multiselect/internal.js.map +1 -1
  102. package/package.json +2 -1
  103. package/property-filter/index.d.ts.map +1 -1
  104. package/property-filter/index.js +1 -1
  105. package/property-filter/index.js.map +1 -1
  106. package/property-filter/interfaces.d.ts +2 -1
  107. package/property-filter/interfaces.d.ts.map +1 -1
  108. package/property-filter/interfaces.js.map +1 -1
  109. package/property-filter/property-filter-autosuggest.d.ts.map +1 -1
  110. package/property-filter/property-filter-autosuggest.js +4 -2
  111. package/property-filter/property-filter-autosuggest.js.map +1 -1
  112. package/select/internal.d.ts.map +1 -1
  113. package/select/internal.js +4 -3
  114. package/select/internal.js.map +1 -1
  115. package/split-panel/interfaces.d.ts +8 -8
  116. package/split-panel/interfaces.d.ts.map +1 -1
  117. package/split-panel/interfaces.js.map +1 -1
  118. package/split-panel/preferences-modal.d.ts +7 -7
  119. package/split-panel/preferences-modal.d.ts.map +1 -1
  120. package/split-panel/preferences-modal.js.map +1 -1
  121. package/table/body-cell/index.js +1 -1
  122. package/table/body-cell/index.js.map +1 -1
  123. package/test-utils/dom/button/index.js +1 -6
  124. package/test-utils/dom/button/index.js.map +1 -1
  125. package/test-utils/dom/file-upload/index.d.ts +29 -0
  126. package/test-utils/dom/file-upload/index.js +66 -0
  127. package/test-utils/dom/file-upload/index.js.map +1 -0
  128. package/test-utils/dom/flashbar/index.d.ts +5 -1
  129. package/test-utils/dom/flashbar/index.js +7 -0
  130. package/test-utils/dom/flashbar/index.js.map +1 -1
  131. package/test-utils/dom/index.d.ts +3 -0
  132. package/test-utils/dom/index.js +10 -2
  133. package/test-utils/dom/index.js.map +1 -1
  134. package/test-utils/selectors/file-upload/index.d.ts +29 -0
  135. package/test-utils/selectors/file-upload/index.js +66 -0
  136. package/test-utils/selectors/file-upload/index.js.map +1 -0
  137. package/test-utils/selectors/flashbar/index.d.ts +5 -1
  138. package/test-utils/selectors/flashbar/index.js +7 -0
  139. package/test-utils/selectors/flashbar/index.js.map +1 -1
  140. package/test-utils/selectors/index.d.ts +3 -0
  141. package/test-utils/selectors/index.js +10 -2
  142. package/test-utils/selectors/index.js.map +1 -1
  143. package/test-utils/tsconfig.tsbuildinfo +1 -1
  144. package/token-group/styles.css.js +7 -5
  145. package/token-group/styles.scoped.css +41 -23
  146. package/token-group/styles.selectors.js +7 -5
  147. package/token-group/token.d.ts +4 -1
  148. package/token-group/token.d.ts.map +1 -1
  149. package/token-group/token.js +13 -4
  150. package/token-group/token.js.map +1 -1
  151. package/wizard/interfaces.d.ts +4 -0
  152. package/wizard/interfaces.d.ts.map +1 -1
  153. package/wizard/interfaces.js.map +1 -1
  154. package/wizard/wizard-actions.d.ts +2 -1
  155. package/wizard/wizard-actions.d.ts.map +1 -1
  156. package/wizard/wizard-actions.js +2 -2
  157. package/wizard/wizard-actions.js.map +1 -1
  158. package/wizard/wizard-form.d.ts.map +1 -1
  159. package/wizard/wizard-form.js +1 -1
  160. package/wizard/wizard-form.js.map +1 -1
@@ -41,7 +41,7 @@ import styles from './styles.css.js';
41
41
  */
42
42
  export default memo(LiveRegion);
43
43
  function LiveRegion(_a) {
44
- var { assertive = false, delay = 10, visible = false, tagName: TagName = 'span', children } = _a, restProps = __rest(_a, ["assertive", "delay", "visible", "tagName", "children"]);
44
+ var { assertive = false, delay = 10, visible = false, tagName: TagName = 'span', children, id } = _a, restProps = __rest(_a, ["assertive", "delay", "visible", "tagName", "children", "id"]);
45
45
  const sourceRef = useRef(null);
46
46
  const targetRef = useRef(null);
47
47
  /*
@@ -82,7 +82,7 @@ function LiveRegion(_a) {
82
82
  };
83
83
  });
84
84
  return (React.createElement(React.Fragment, null,
85
- visible && React.createElement(TagName, { ref: sourceRef }, children),
85
+ visible && (React.createElement(TagName, { ref: sourceRef, id: id }, children)),
86
86
  React.createElement(ScreenreaderOnly, Object.assign({}, restProps, { className: clsx(styles.root, restProps.className) }),
87
87
  !visible && (React.createElement(TagName, { ref: sourceRef, "aria-hidden": "true" }, children)),
88
88
  React.createElement("span", { ref: targetRef, "aria-atomic": "true", "aria-live": assertive ? 'assertive' : 'polite' }))));
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"lib/default/","sources":["internal/components/live-region/index.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;;AAEtC,0DAA0D;AAE1D,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,KAAK,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AACvD,OAAO,gBAA2C,MAAM,sBAAsB,CAAC;AAC/E,OAAO,MAAM,MAAM,iBAAiB,CAAC;AAUrC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,eAAe,IAAI,CAAC,UAAU,CAAC,CAAC;AAEhC,SAAS,UAAU,CAAC,EAOF;QAPE,EAClB,SAAS,GAAG,KAAK,EACjB,KAAK,GAAG,EAAE,EACV,OAAO,GAAG,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;YAED,8BAAM,GAAG,EAAE,SAAS,iBAAc,MAAM,eAAY,SAAS,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,QAAQ,GAAS,CAC9E,CAClB,CACJ,CAAC;AACJ,CAAC;AAED,oGAAoG;AACpG,oGAAoG;AACpG,0FAA0F;AAC1F,SAAS,gBAAgB,CAAC,IAAiB;IACzC,OAAO,CAAC,IAAI,CAAC,SAAS,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC;AAC5D,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n\n/* eslint-disable @cloudscape-design/prefer-live-region */\n\nimport clsx from 'clsx';\nimport React, { memo, useEffect, useRef } from 'react';\nimport ScreenreaderOnly, { ScreenreaderOnlyProps } from '../screenreader-only';\nimport styles from './styles.css.js';\n\nexport interface LiveRegionProps extends ScreenreaderOnlyProps {\n assertive?: boolean;\n delay?: number;\n visible?: boolean;\n tagName?: 'span' | 'div';\n children: React.ReactNode;\n}\n\n/**\n * The live region is hidden in the layout, but visible for screen readers.\n * It's purpose it to announce changes e.g. when custom navigation logic is used.\n *\n * The way live region works differently in different browsers and screen readers and\n * it is recommended to manually test every new implementation.\n *\n * If you notice there are different words being merged together,\n * check if there are text nodes not being wrapped in elements, like:\n * <LiveRegion>\n * {title}\n * <span><Details /></span>\n * </LiveRegion>\n *\n * To fix, wrap \"title\" in an element:\n * <LiveRegion>\n * <span>{title}</span>\n * <span><Details /></span>\n * </LiveRegion>\n *\n * Or create a single text node if possible:\n * <LiveRegion>\n * {`${title} ${details}`}\n * </LiveRegion>\n *\n * The live region is always atomic, because non-atomic regions can be treated by screen readers\n * differently and produce unexpected results. To imitate non-atomic announcements simply use\n * multiple live regions:\n * <>\n * <LiveRegion>{title}</LiveRegion>\n * <LiveRegion><Details /></LiveRegion>\n * </>\n */\nexport default memo(LiveRegion);\n\nfunction LiveRegion({\n assertive = false,\n delay = 10,\n visible = false,\n tagName: TagName = 'span',\n children,\n ...restProps\n}: LiveRegionProps) {\n const sourceRef = useRef<HTMLSpanElement & HTMLDivElement>(null);\n const targetRef = useRef<HTMLSpanElement & HTMLDivElement>(null);\n\n /*\n When React state changes, React often produces too many DOM updates, causing NVDA to\n issue many announcements for the same logical event (See https://github.com/nvaccess/nvda/issues/7996).\n\n The code below imitates a debouncing, scheduling a callback every time new React state\n update is detected. When a callback resolves, it copies content from a muted element\n to the live region, which is recognized by screen readers as an update.\n\n If the use case requires no announcement to be ignored, use delay = 0, but ensure it\n does not impact the performance. If it does, prefer using a string as children prop.\n */\n useEffect(() => {\n function updateLiveRegion() {\n if (targetRef.current && sourceRef.current) {\n const sourceContent = extractInnerText(sourceRef.current);\n const targetContent = extractInnerText(targetRef.current);\n if (targetContent !== sourceContent) {\n // The aria-atomic does not work properly in Voice Over, causing\n // certain parts of the content to be ignored. To fix that,\n // we assign the source text content as a single node.\n targetRef.current.innerText = sourceContent;\n }\n }\n }\n\n let timeoutId: null | number;\n if (delay) {\n timeoutId = setTimeout(updateLiveRegion, delay);\n } else {\n updateLiveRegion();\n }\n\n return () => {\n if (timeoutId) {\n clearTimeout(timeoutId);\n }\n };\n });\n\n return (\n <>\n {visible && <TagName ref={sourceRef}>{children}</TagName>}\n\n <ScreenreaderOnly {...restProps} className={clsx(styles.root, restProps.className)}>\n {!visible && (\n <TagName ref={sourceRef} aria-hidden=\"true\">\n {children}\n </TagName>\n )}\n\n <span ref={targetRef} aria-atomic=\"true\" aria-live={assertive ? 'assertive' : 'polite'}></span>\n </ScreenreaderOnly>\n </>\n );\n}\n\n// This only extracts text content from the node including all its children which is enough for now.\n// To make it more powerful, it is possible to create a more sophisticated extractor with respect to\n// ARIA properties to ignore aria-hidden nodes and read ARIA labels from the live content.\nfunction extractInnerText(node: HTMLElement) {\n return (node.innerText || '').replace(/\\s+/g, ' ').trim();\n}\n"]}
1
+ {"version":3,"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AC,gBAAgB,EAAE,KAAK,CAAC,CAAC;SACjD;aAAM;YACL,gBAAgB,EAAE,CAAC;SACpB;QAED,OAAO,GAAG,EAAE;YACV,IAAI,SAAS,EAAE;gBACb,YAAY,CAAC,SAAS,CAAC,CAAC;aACzB;QACH,CAAC,CAAC;IACJ,CAAC,CAAC,CAAC;IAEH,OAAO,CACL;QACG,OAAO,IAAI,CACV,oBAAC,OAAO,IAAC,GAAG,EAAE,SAAS,EAAE,EAAE,EAAE,EAAE,IAC5B,QAAQ,CACD,CACX;QAED,oBAAC,gBAAgB,oBAAK,SAAS,IAAE,SAAS,EAAE,IAAI,CAAC,MAAM,CAAC,IAAI,EAAE,SAAS,CAAC,SAAS,CAAC;YAC/E,CAAC,OAAO,IAAI,CACX,oBAAC,OAAO,IAAC,GAAG,EAAE,SAAS,iBAAc,MAAM,IACxC,QAAQ,CACD,CACX;YAED,8BAAM,GAAG,EAAE,SAAS,iBAAc,MAAM,eAAY,SAAS,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,QAAQ,GAAS,CAC9E,CAClB,CACJ,CAAC;AACJ,CAAC;AAED,oGAAoG;AACpG,oGAAoG;AACpG,0FAA0F;AAC1F,SAAS,gBAAgB,CAAC,IAAiB;IACzC,OAAO,CAAC,IAAI,CAAC,SAAS,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC;AAC5D,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n\n/* eslint-disable @cloudscape-design/prefer-live-region */\n\nimport clsx from 'clsx';\nimport React, { memo, useEffect, useRef } from 'react';\nimport ScreenreaderOnly, { ScreenreaderOnlyProps } from '../screenreader-only';\nimport styles from './styles.css.js';\n\nexport interface LiveRegionProps extends ScreenreaderOnlyProps {\n assertive?: boolean;\n delay?: number;\n visible?: boolean;\n tagName?: 'span' | 'div';\n children: React.ReactNode;\n id?: string;\n}\n\n/**\n * The live region is hidden in the layout, but visible for screen readers.\n * It's purpose it to announce changes e.g. when custom navigation logic is used.\n *\n * The way live region works differently in different browsers and screen readers and\n * it is recommended to manually test every new implementation.\n *\n * If you notice there are different words being merged together,\n * check if there are text nodes not being wrapped in elements, like:\n * <LiveRegion>\n * {title}\n * <span><Details /></span>\n * </LiveRegion>\n *\n * To fix, wrap \"title\" in an element:\n * <LiveRegion>\n * <span>{title}</span>\n * <span><Details /></span>\n * </LiveRegion>\n *\n * Or create a single text node if possible:\n * <LiveRegion>\n * {`${title} ${details}`}\n * </LiveRegion>\n *\n * The live region is always atomic, because non-atomic regions can be treated by screen readers\n * differently and produce unexpected results. To imitate non-atomic announcements simply use\n * multiple live regions:\n * <>\n * <LiveRegion>{title}</LiveRegion>\n * <LiveRegion><Details /></LiveRegion>\n * </>\n */\nexport default memo(LiveRegion);\n\nfunction LiveRegion({\n assertive = false,\n delay = 10,\n visible = false,\n tagName: TagName = 'span',\n children,\n id,\n ...restProps\n}: LiveRegionProps) {\n const sourceRef = useRef<HTMLSpanElement & HTMLDivElement>(null);\n const targetRef = useRef<HTMLSpanElement & HTMLDivElement>(null);\n\n /*\n When React state changes, React often produces too many DOM updates, causing NVDA to\n issue many announcements for the same logical event (See https://github.com/nvaccess/nvda/issues/7996).\n\n The code below imitates a debouncing, scheduling a callback every time new React state\n update is detected. When a callback resolves, it copies content from a muted element\n to the live region, which is recognized by screen readers as an update.\n\n If the use case requires no announcement to be ignored, use delay = 0, but ensure it\n does not impact the performance. If it does, prefer using a string as children prop.\n */\n useEffect(() => {\n function updateLiveRegion() {\n if (targetRef.current && sourceRef.current) {\n const sourceContent = extractInnerText(sourceRef.current);\n const targetContent = extractInnerText(targetRef.current);\n if (targetContent !== sourceContent) {\n // The aria-atomic does not work properly in Voice Over, causing\n // certain parts of the content to be ignored. To fix that,\n // we assign the source text content as a single node.\n targetRef.current.innerText = sourceContent;\n }\n }\n }\n\n let timeoutId: null | number;\n if (delay) {\n timeoutId = setTimeout(updateLiveRegion, delay);\n } else {\n updateLiveRegion();\n }\n\n return () => {\n if (timeoutId) {\n clearTimeout(timeoutId);\n }\n };\n });\n\n return (\n <>\n {visible && (\n <TagName ref={sourceRef} id={id}>\n {children}\n </TagName>\n )}\n\n <ScreenreaderOnly {...restProps} className={clsx(styles.root, restProps.className)}>\n {!visible && (\n <TagName ref={sourceRef} aria-hidden=\"true\">\n {children}\n </TagName>\n )}\n\n <span ref={targetRef} aria-atomic=\"true\" aria-live={assertive ? 'assertive' : 'polite'}></span>\n </ScreenreaderOnly>\n </>\n );\n}\n\n// This only extracts text content from the node including all its children which is enough for now.\n// To make it more powerful, it is possible to create a more sophisticated extractor with respect to\n// ARIA properties to ignore aria-hidden nodes and read ARIA labels from the live content.\nfunction extractInnerText(node: HTMLElement) {\n return (node.innerText || '').replace(/\\s+/g, ' ').trim();\n}\n"]}
@@ -22,6 +22,7 @@ export interface OptionsListProps extends BaseComponentProps {
22
22
  position?: React.CSSProperties['position'];
23
23
  role?: 'listbox' | 'list' | 'menu';
24
24
  ariaLabelledby?: string;
25
+ ariaDescribedby?: string;
25
26
  decreaseTopMargin?: boolean;
26
27
  }
27
28
  declare const _default: React.ForwardRefExoticComponent<OptionsListProps & React.RefAttributes<HTMLUListElement>>;
@@ -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,MAAM,WAAW,gBAAiB,SAAQ,kBAAkB;IAC1D,IAAI,CAAC,EAAE,OAAO,CAAC;IACf;;OAEG;IACH,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,gBAAgB,CAAC,EAAE,MA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AAyB,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"}
@@ -15,7 +15,7 @@ const getItemIndex = (containerRef, event) => {
15
15
  return mouseTarget ? parseInt(mouseTarget) : -1;
16
16
  };
17
17
  const OptionsList = (_a, ref) => {
18
- var { open, children, nativeAttributes = {}, onKeyDown, onBlur, onFocus, onLoadMore, onMouseUp, onMouseMove, position = 'relative', role = 'listbox', decreaseTopMargin = false, ariaLabelledby } = _a, restProps = __rest(_a, ["open", "children", "nativeAttributes", "onKeyDown", "onBlur", "onFocus", "onLoadMore", "onMouseUp", "onMouseMove", "position", "role", "decreaseTopMargin", "ariaLabelledby"]);
18
+ var { open, children, nativeAttributes = {}, onKeyDown, onBlur, onFocus, onLoadMore, onMouseUp, onMouseMove, position = 'relative', role = 'listbox', decreaseTopMargin = false, ariaLabelledby, ariaDescribedby } = _a, restProps = __rest(_a, ["open", "children", "nativeAttributes", "onKeyDown", "onBlur", "onFocus", "onLoadMore", "onMouseUp", "onMouseMove", "position", "role", "decreaseTopMargin", "ariaLabelledby", "ariaDescribedby"]);
19
19
  const baseProps = getBaseProps(restProps);
20
20
  const menuRef = useRef(null);
21
21
  const handleScroll = () => {
@@ -38,7 +38,7 @@ const OptionsList = (_a, ref) => {
38
38
  [styles['decrease-top-margin']]: decreaseTopMargin,
39
39
  });
40
40
  const mergedRef = useMergeRefs(ref, menuRef);
41
- return (React.createElement("ul", Object.assign({}, baseProps, nativeAttributes, { className: className, ref: mergedRef, style: { position }, role: role, onScroll: handleScroll, onKeyDown: event => onKeyDown && fireKeyboardEvent(onKeyDown, event), onMouseMove: event => onMouseMove === null || onMouseMove === void 0 ? void 0 : onMouseMove(getItemIndex(menuRef, event)), onMouseUp: event => onMouseUp === null || onMouseUp === void 0 ? void 0 : onMouseUp(getItemIndex(menuRef, event)), onBlur: event => fireNonCancelableEvent(onBlur, { relatedTarget: event.relatedTarget }), onFocus: () => fireNonCancelableEvent(onFocus), tabIndex: -1, "aria-labelledby": ariaLabelledby }), open && children));
41
+ return (React.createElement("ul", Object.assign({}, baseProps, nativeAttributes, { className: className, ref: mergedRef, style: { position }, role: role, onScroll: handleScroll, onKeyDown: event => onKeyDown && fireKeyboardEvent(onKeyDown, event), onMouseMove: event => onMouseMove === null || onMouseMove === void 0 ? void 0 : onMouseMove(getItemIndex(menuRef, event)), onMouseUp: event => onMouseUp === null || onMouseUp === void 0 ? void 0 : onMouseUp(getItemIndex(menuRef, event)), onBlur: event => fireNonCancelableEvent(onBlur, { relatedTarget: event.relatedTarget }), onFocus: () => fireNonCancelableEvent(onFocus), tabIndex: -1, "aria-labelledby": ariaLabelledby, "aria-describedby": ariaDescribedby }), open && children));
42
42
  };
43
43
  export default React.forwardRef(OptionsList);
44
44
  //# sourceMappingURL=index.js.map
@@ -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,EA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CAAC,sBAAsB,CAAC,OAAO,CAAC,EAC9C,QAAQ,EAAE,CAAC,CAAC,qBACK,cAAc,KAE9B,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';\n\nexport interface OptionsListProps extends BaseComponentProps {\n open?: boolean;\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 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 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 ...restProps\n }: OptionsListProps,\n ref: React.Ref<HTMLUListElement>\n) => {\n const baseProps = getBaseProps(restProps);\n const menuRef = useRef<HTMLUListElement>(null);\n\n const handleScroll = () => {\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) {\n return;\n }\n handleScroll();\n });\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 >\n {open && children}\n </ul>\n );\n};\n\nexport default React.forwardRef(OptionsList);\n"]}
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,sB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sB,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';\n\nexport interface OptionsListProps extends BaseComponentProps {\n open?: boolean;\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 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 = () => {\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) {\n return;\n }\n handleScroll();\n });\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"]}
@@ -4,7 +4,6 @@ export interface AppLayoutContextProps {
4
4
  stickyOffsetTop: number;
5
5
  hasBreadcrumbs: boolean;
6
6
  setHasStickyBackground?: (hasBackground: boolean) => void;
7
- setDynamicOverlapHeight?: (height: number) => void;
8
7
  }
9
8
  export declare const AppLayoutContext: import("react").Context<AppLayoutContextProps>;
10
9
  export declare function useAppLayoutContext(): AppLayoutContextProps;
@@ -1 +1 @@
1
- {"version":3,"file":"app-layout-context.d.ts","sourceRoot":"lib/default/","sources":["internal/context/app-layout-context.ts"],"names":[],"mappings":";AAIA,MAAM,WAAW,qBAAqB;IACpC,kBAAkB,EAAE,MAAM,CAAC;IAC3B,eAAe,EAAE,MAAM,CAAC;IACxB,cAAc,EAAE,OAAO,CAAC;IACxB,sBAAsB,CAAC,EAAE,CAAC,aAAa,EAAE,OAAO,KAAK,IAAI,CAAC;IAC1D,uBAAuB,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;CACpD;AAED,eAAO,MAAM,gBAAgB,gDAI3B,CAAC;AAEH,wBAAgB,mBAAmB,0BAElC"}
1
+ {"version":3,"file":"app-layout-context.d.ts","sourceRoot":"lib/default/","sources":["internal/context/app-layout-context.ts"],"names":[],"mappings":";AAIA,MAAM,WAAW,qBAAqB;IACpC,kBAAkB,EAAE,MAAM,CAAC;IAC3B,eAAe,EAAE,MAAM,CAAC;IACxB,cAAc,EAAE,OAAO,CAAC;IACxB,sBAAsB,CAAC,EAAE,CAAC,aAAa,EAAE,OAAO,KAAK,IAAI,CAAC;CAC3D;AAED,eAAO,MAAM,gBAAgB,gDAI3B,CAAC;AAEH,wBAAgB,mBAAmB,0BAElC"}
@@ -1 +1 @@
1
- {"version":3,"file":"app-layout-context.js","sourceRoot":"lib/default/","sources":["internal/context/app-layout-context.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAUlD,MAAM,CAAC,MAAM,gBAAgB,GAAG,aAAa,CAAwB;IACnE,eAAe,EAAE,CAAC;IAClB,kBAAkB,EAAE,CAAC;IACrB,cAAc,EAAE,KAAK;CACtB,CAAC,CAAC;AAEH,MAAM,UAAU,mBAAmB;IACjC,OAAO,UAAU,CAAC,gBAAgB,CAAC,CAAC;AACtC,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { useContext, createContext } from 'react';\n\nexport interface AppLayoutContextProps {\n stickyOffsetBottom: number;\n stickyOffsetTop: number;\n hasBreadcrumbs: boolean;\n setHasStickyBackground?: (hasBackground: boolean) => void;\n setDynamicOverlapHeight?: (height: number) => void;\n}\n\nexport const AppLayoutContext = createContext<AppLayoutContextProps>({\n stickyOffsetTop: 0,\n stickyOffsetBottom: 0,\n hasBreadcrumbs: false,\n});\n\nexport function useAppLayoutContext() {\n return useContext(AppLayoutContext);\n}\n"]}
1
+ {"version":3,"file":"app-layout-context.js","sourceRoot":"lib/default/","sources":["internal/context/app-layout-context.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AASlD,MAAM,CAAC,MAAM,gBAAgB,GAAG,aAAa,CAAwB;IACnE,eAAe,EAAE,CAAC;IAClB,kBAAkB,EAAE,CAAC;IACrB,cAAc,EAAE,KAAK;CACtB,CAAC,CAAC;AAEH,MAAM,UAAU,mBAAmB;IACjC,OAAO,UAAU,CAAC,gBAAgB,CAAC,CAAC;AACtC,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { useContext, createContext } from 'react';\n\nexport interface AppLayoutContextProps {\n stickyOffsetBottom: number;\n stickyOffsetTop: number;\n hasBreadcrumbs: boolean;\n setHasStickyBackground?: (hasBackground: boolean) => void;\n}\n\nexport const AppLayoutContext = createContext<AppLayoutContextProps>({\n stickyOffsetTop: 0,\n stickyOffsetBottom: 0,\n hasBreadcrumbs: false,\n});\n\nexport function useAppLayoutContext() {\n return useContext(AppLayoutContext);\n}\n"]}
@@ -0,0 +1,3 @@
1
+ /// <reference types="react" />
2
+ export declare const DynamicOverlapContext: import("react").Context<(overlapHeight: number) => void>;
3
+ //# sourceMappingURL=dynamic-overlap-context.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dynamic-overlap-context.d.ts","sourceRoot":"lib/default/","sources":["internal/context/dynamic-overlap-context.ts"],"names":[],"mappings":";AAIA,eAAO,MAAM,qBAAqB,0CAAiC,MAAM,KAAK,IAAI,CAAW,CAAC"}
@@ -0,0 +1,5 @@
1
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
+ // SPDX-License-Identifier: Apache-2.0
3
+ import { createContext } from 'react';
4
+ export const DynamicOverlapContext = createContext(() => { });
5
+ //# sourceMappingURL=dynamic-overlap-context.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dynamic-overlap-context.js","sourceRoot":"lib/default/","sources":["internal/context/dynamic-overlap-context.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAEtC,MAAM,CAAC,MAAM,qBAAqB,GAAG,aAAa,CAAkC,GAAG,EAAE,GAAE,CAAC,CAAC,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { createContext } from 'react';\n\nexport const DynamicOverlapContext = createContext<(overlapHeight: number) => void>(() => {});\n"]}
@@ -1,6 +1,6 @@
1
1
 
2
2
  export var PACKAGE_SOURCE = 'components';
3
- export var PACKAGE_VERSION = '3.0.0 (471735b)';
3
+ export var PACKAGE_VERSION = '3.0.0 (192f9e6)';
4
4
  export var THEME = 'open-source-visual-refresh';
5
5
  export var ALWAYS_VISUAL_REFRESH = true;
6
6
 
@@ -1587,6 +1587,22 @@ module.exports.preset = {
1587
1587
  "light": "{colorBlue200}",
1588
1588
  "dark": "{colorBlue600}"
1589
1589
  },
1590
+ "colorDropzoneBackgroundActive": {
1591
+ "light": "{colorGrey200}",
1592
+ "dark": "{colorGrey500}"
1593
+ },
1594
+ "colorDropzoneBackgroundHover": {
1595
+ "light": "{colorBlue200}",
1596
+ "dark": "{colorBlue600}"
1597
+ },
1598
+ "colorDropzoneTextActive": {
1599
+ "light": "{colorGrey550}",
1600
+ "dark": "{colorGrey800}"
1601
+ },
1602
+ "colorDropzoneTextHover": {
1603
+ "light": "{colorBlue800}",
1604
+ "dark": "{colorWhite}"
1605
+ },
1590
1606
  "fontBodyMLineHeight": "22px",
1591
1607
  "fontBodyMSize": "14px",
1592
1608
  "fontBodySLetterSpacing": "0.005em",
@@ -1664,6 +1680,7 @@ module.exports.preset = {
1664
1680
  "borderRadiusControlCircularFocusRing": "4px",
1665
1681
  "borderRadiusControlDefaultFocusRing": "4px",
1666
1682
  "borderRadiusDropdown": "{borderRadiusItem}",
1683
+ "borderRadiusDropzone": "12px",
1667
1684
  "borderRadiusFlashbar": "12px",
1668
1685
  "borderRadiusItem": "8px",
1669
1686
  "borderRadiusInput": "8px",
@@ -3522,6 +3539,22 @@ module.exports.preset = {
3522
3539
  "colorDragPlaceholderHover": {
3523
3540
  "light": "{colorBlue600}",
3524
3541
  "dark": "{colorBlue600}"
3542
+ },
3543
+ "colorDropzoneBackgroundActive": {
3544
+ "light": "{colorGrey500}",
3545
+ "dark": "{colorGrey500}"
3546
+ },
3547
+ "colorDropzoneBackgroundHover": {
3548
+ "light": "{colorBlue600}",
3549
+ "dark": "{colorBlue600}"
3550
+ },
3551
+ "colorDropzoneTextActive": {
3552
+ "light": "{colorGrey800}",
3553
+ "dark": "{colorGrey800}"
3554
+ },
3555
+ "colorDropzoneTextHover": {
3556
+ "light": "{colorWhite}",
3557
+ "dark": "{colorWhite}"
3525
3558
  }
3526
3559
  }
3527
3560
  },
@@ -4476,6 +4509,22 @@ module.exports.preset = {
4476
4509
  "colorDragPlaceholderHover": {
4477
4510
  "light": "{colorBlue600}",
4478
4511
  "dark": "{colorBlue600}"
4512
+ },
4513
+ "colorDropzoneBackgroundActive": {
4514
+ "light": "{colorGrey500}",
4515
+ "dark": "{colorGrey500}"
4516
+ },
4517
+ "colorDropzoneBackgroundHover": {
4518
+ "light": "{colorBlue600}",
4519
+ "dark": "{colorBlue600}"
4520
+ },
4521
+ "colorDropzoneTextActive": {
4522
+ "light": "{colorGrey800}",
4523
+ "dark": "{colorGrey800}"
4524
+ },
4525
+ "colorDropzoneTextHover": {
4526
+ "light": "{colorWhite}",
4527
+ "dark": "{colorWhite}"
4479
4528
  }
4480
4529
  }
4481
4530
  },
@@ -5370,6 +5419,22 @@ module.exports.preset = {
5370
5419
  "colorDragPlaceholderHover": {
5371
5420
  "light": "{colorBlue200}",
5372
5421
  "dark": "{colorBlue600}"
5422
+ },
5423
+ "colorDropzoneBackgroundActive": {
5424
+ "light": "{colorGrey200}",
5425
+ "dark": "{colorGrey500}"
5426
+ },
5427
+ "colorDropzoneBackgroundHover": {
5428
+ "light": "{colorBlue200}",
5429
+ "dark": "{colorBlue600}"
5430
+ },
5431
+ "colorDropzoneTextActive": {
5432
+ "light": "{colorGrey550}",
5433
+ "dark": "{colorGrey800}"
5434
+ },
5435
+ "colorDropzoneTextHover": {
5436
+ "light": "{colorBlue800}",
5437
+ "dark": "{colorWhite}"
5373
5438
  }
5374
5439
  }
5375
5440
  },
@@ -6264,6 +6329,22 @@ module.exports.preset = {
6264
6329
  "colorDragPlaceholderHover": {
6265
6330
  "light": "{colorBlue200}",
6266
6331
  "dark": "{colorBlue600}"
6332
+ },
6333
+ "colorDropzoneBackgroundActive": {
6334
+ "light": "{colorGrey200}",
6335
+ "dark": "{colorGrey500}"
6336
+ },
6337
+ "colorDropzoneBackgroundHover": {
6338
+ "light": "{colorBlue200}",
6339
+ "dark": "{colorBlue600}"
6340
+ },
6341
+ "colorDropzoneTextActive": {
6342
+ "light": "{colorGrey550}",
6343
+ "dark": "{colorGrey800}"
6344
+ },
6345
+ "colorDropzoneTextHover": {
6346
+ "light": "{colorBlue800}",
6347
+ "dark": "{colorWhite}"
6267
6348
  }
6268
6349
  }
6269
6350
  }
@@ -6645,6 +6726,10 @@ module.exports.preset = {
6645
6726
  "colorBoardPlaceholderHover": "color",
6646
6727
  "colorDragPlaceholderActive": "color",
6647
6728
  "colorDragPlaceholderHover": "color",
6729
+ "colorDropzoneBackgroundActive": "color",
6730
+ "colorDropzoneBackgroundHover": "color",
6731
+ "colorDropzoneTextActive": "color",
6732
+ "colorDropzoneTextHover": "color",
6648
6733
  "motionDurationExtraFast": "motion",
6649
6734
  "motionDurationExtraSlow": "motion",
6650
6735
  "motionDurationFast": "motion",
@@ -7670,6 +7755,10 @@ module.exports.preset = {
7670
7755
  "colorBoardPlaceholderHover": "color-board-placeholder-hover",
7671
7756
  "colorDragPlaceholderActive": "color-drag-placeholder-active",
7672
7757
  "colorDragPlaceholderHover": "color-drag-placeholder-hover",
7758
+ "colorDropzoneBackgroundActive": "color-dropzone-background-active",
7759
+ "colorDropzoneBackgroundHover": "color-dropzone-background-hover",
7760
+ "colorDropzoneTextActive": "color-dropzone-text-active",
7761
+ "colorDropzoneTextHover": "color-dropzone-text-hover",
7673
7762
  "fontBodyMLineHeight": "font-body-m-line-height",
7674
7763
  "fontBodyMSize": "font-body-m-size",
7675
7764
  "fontBodySLetterSpacing": "font-body-s-letter-spacing",
@@ -7747,6 +7836,7 @@ module.exports.preset = {
7747
7836
  "borderRadiusControlCircularFocusRing": "border-radius-control-circular-focus-ring",
7748
7837
  "borderRadiusControlDefaultFocusRing": "border-radius-control-default-focus-ring",
7749
7838
  "borderRadiusDropdown": "border-radius-dropdown",
7839
+ "borderRadiusDropzone": "border-radius-dropzone",
7750
7840
  "borderRadiusFlashbar": "border-radius-flashbar",
7751
7841
  "borderRadiusItem": "border-radius-item",
7752
7842
  "borderRadiusInput": "border-radius-input",
@@ -8330,6 +8420,10 @@ module.exports.preset = {
8330
8420
  "colorBoardPlaceholderHover": "--color-board-placeholder-hover-v1s7kq",
8331
8421
  "colorDragPlaceholderActive": "--color-drag-placeholder-active-fkpj7i",
8332
8422
  "colorDragPlaceholderHover": "--color-drag-placeholder-hover-3ohnz1",
8423
+ "colorDropzoneBackgroundActive": "--color-dropzone-background-active-g4zi07",
8424
+ "colorDropzoneBackgroundHover": "--color-dropzone-background-hover-j98f7z",
8425
+ "colorDropzoneTextActive": "--color-dropzone-text-active-aobpir",
8426
+ "colorDropzoneTextHover": "--color-dropzone-text-hover-ud2lnq",
8333
8427
  "fontBodyMLineHeight": "--font-body-m-line-height-i7xxvv",
8334
8428
  "fontBodyMSize": "--font-body-m-size-sregvd",
8335
8429
  "fontBodySLetterSpacing": "--font-body-s-letter-spacing-cy0oxj",
@@ -8407,6 +8501,7 @@ module.exports.preset = {
8407
8501
  "borderRadiusControlCircularFocusRing": "--border-radius-control-circular-focus-ring-qawzn7",
8408
8502
  "borderRadiusControlDefaultFocusRing": "--border-radius-control-default-focus-ring-7661kz",
8409
8503
  "borderRadiusDropdown": "--border-radius-dropdown-ujknaf",
8504
+ "borderRadiusDropzone": "--border-radius-dropzone-poqo08",
8410
8505
  "borderRadiusFlashbar": "--border-radius-flashbar-i7jm55",
8411
8506
  "borderRadiusItem": "--border-radius-item-u2ibpi",
8412
8507
  "borderRadiusInput": "--border-radius-input-txq8zy",
@@ -1587,6 +1587,22 @@ export var preset = {
1587
1587
  "light": "{colorBlue200}",
1588
1588
  "dark": "{colorBlue600}"
1589
1589
  },
1590
+ "colorDropzoneBackgroundActive": {
1591
+ "light": "{colorGrey200}",
1592
+ "dark": "{colorGrey500}"
1593
+ },
1594
+ "colorDropzoneBackgroundHover": {
1595
+ "light": "{colorBlue200}",
1596
+ "dark": "{colorBlue600}"
1597
+ },
1598
+ "colorDropzoneTextActive": {
1599
+ "light": "{colorGrey550}",
1600
+ "dark": "{colorGrey800}"
1601
+ },
1602
+ "colorDropzoneTextHover": {
1603
+ "light": "{colorBlue800}",
1604
+ "dark": "{colorWhite}"
1605
+ },
1590
1606
  "fontBodyMLineHeight": "22px",
1591
1607
  "fontBodyMSize": "14px",
1592
1608
  "fontBodySLetterSpacing": "0.005em",
@@ -1664,6 +1680,7 @@ export var preset = {
1664
1680
  "borderRadiusControlCircularFocusRing": "4px",
1665
1681
  "borderRadiusControlDefaultFocusRing": "4px",
1666
1682
  "borderRadiusDropdown": "{borderRadiusItem}",
1683
+ "borderRadiusDropzone": "12px",
1667
1684
  "borderRadiusFlashbar": "12px",
1668
1685
  "borderRadiusItem": "8px",
1669
1686
  "borderRadiusInput": "8px",
@@ -3522,6 +3539,22 @@ export var preset = {
3522
3539
  "colorDragPlaceholderHover": {
3523
3540
  "light": "{colorBlue600}",
3524
3541
  "dark": "{colorBlue600}"
3542
+ },
3543
+ "colorDropzoneBackgroundActive": {
3544
+ "light": "{colorGrey500}",
3545
+ "dark": "{colorGrey500}"
3546
+ },
3547
+ "colorDropzoneBackgroundHover": {
3548
+ "light": "{colorBlue600}",
3549
+ "dark": "{colorBlue600}"
3550
+ },
3551
+ "colorDropzoneTextActive": {
3552
+ "light": "{colorGrey800}",
3553
+ "dark": "{colorGrey800}"
3554
+ },
3555
+ "colorDropzoneTextHover": {
3556
+ "light": "{colorWhite}",
3557
+ "dark": "{colorWhite}"
3525
3558
  }
3526
3559
  }
3527
3560
  },
@@ -4476,6 +4509,22 @@ export var preset = {
4476
4509
  "colorDragPlaceholderHover": {
4477
4510
  "light": "{colorBlue600}",
4478
4511
  "dark": "{colorBlue600}"
4512
+ },
4513
+ "colorDropzoneBackgroundActive": {
4514
+ "light": "{colorGrey500}",
4515
+ "dark": "{colorGrey500}"
4516
+ },
4517
+ "colorDropzoneBackgroundHover": {
4518
+ "light": "{colorBlue600}",
4519
+ "dark": "{colorBlue600}"
4520
+ },
4521
+ "colorDropzoneTextActive": {
4522
+ "light": "{colorGrey800}",
4523
+ "dark": "{colorGrey800}"
4524
+ },
4525
+ "colorDropzoneTextHover": {
4526
+ "light": "{colorWhite}",
4527
+ "dark": "{colorWhite}"
4479
4528
  }
4480
4529
  }
4481
4530
  },
@@ -5370,6 +5419,22 @@ export var preset = {
5370
5419
  "colorDragPlaceholderHover": {
5371
5420
  "light": "{colorBlue200}",
5372
5421
  "dark": "{colorBlue600}"
5422
+ },
5423
+ "colorDropzoneBackgroundActive": {
5424
+ "light": "{colorGrey200}",
5425
+ "dark": "{colorGrey500}"
5426
+ },
5427
+ "colorDropzoneBackgroundHover": {
5428
+ "light": "{colorBlue200}",
5429
+ "dark": "{colorBlue600}"
5430
+ },
5431
+ "colorDropzoneTextActive": {
5432
+ "light": "{colorGrey550}",
5433
+ "dark": "{colorGrey800}"
5434
+ },
5435
+ "colorDropzoneTextHover": {
5436
+ "light": "{colorBlue800}",
5437
+ "dark": "{colorWhite}"
5373
5438
  }
5374
5439
  }
5375
5440
  },
@@ -6264,6 +6329,22 @@ export var preset = {
6264
6329
  "colorDragPlaceholderHover": {
6265
6330
  "light": "{colorBlue200}",
6266
6331
  "dark": "{colorBlue600}"
6332
+ },
6333
+ "colorDropzoneBackgroundActive": {
6334
+ "light": "{colorGrey200}",
6335
+ "dark": "{colorGrey500}"
6336
+ },
6337
+ "colorDropzoneBackgroundHover": {
6338
+ "light": "{colorBlue200}",
6339
+ "dark": "{colorBlue600}"
6340
+ },
6341
+ "colorDropzoneTextActive": {
6342
+ "light": "{colorGrey550}",
6343
+ "dark": "{colorGrey800}"
6344
+ },
6345
+ "colorDropzoneTextHover": {
6346
+ "light": "{colorBlue800}",
6347
+ "dark": "{colorWhite}"
6267
6348
  }
6268
6349
  }
6269
6350
  }
@@ -6645,6 +6726,10 @@ export var preset = {
6645
6726
  "colorBoardPlaceholderHover": "color",
6646
6727
  "colorDragPlaceholderActive": "color",
6647
6728
  "colorDragPlaceholderHover": "color",
6729
+ "colorDropzoneBackgroundActive": "color",
6730
+ "colorDropzoneBackgroundHover": "color",
6731
+ "colorDropzoneTextActive": "color",
6732
+ "colorDropzoneTextHover": "color",
6648
6733
  "motionDurationExtraFast": "motion",
6649
6734
  "motionDurationExtraSlow": "motion",
6650
6735
  "motionDurationFast": "motion",
@@ -7670,6 +7755,10 @@ export var preset = {
7670
7755
  "colorBoardPlaceholderHover": "color-board-placeholder-hover",
7671
7756
  "colorDragPlaceholderActive": "color-drag-placeholder-active",
7672
7757
  "colorDragPlaceholderHover": "color-drag-placeholder-hover",
7758
+ "colorDropzoneBackgroundActive": "color-dropzone-background-active",
7759
+ "colorDropzoneBackgroundHover": "color-dropzone-background-hover",
7760
+ "colorDropzoneTextActive": "color-dropzone-text-active",
7761
+ "colorDropzoneTextHover": "color-dropzone-text-hover",
7673
7762
  "fontBodyMLineHeight": "font-body-m-line-height",
7674
7763
  "fontBodyMSize": "font-body-m-size",
7675
7764
  "fontBodySLetterSpacing": "font-body-s-letter-spacing",
@@ -7747,6 +7836,7 @@ export var preset = {
7747
7836
  "borderRadiusControlCircularFocusRing": "border-radius-control-circular-focus-ring",
7748
7837
  "borderRadiusControlDefaultFocusRing": "border-radius-control-default-focus-ring",
7749
7838
  "borderRadiusDropdown": "border-radius-dropdown",
7839
+ "borderRadiusDropzone": "border-radius-dropzone",
7750
7840
  "borderRadiusFlashbar": "border-radius-flashbar",
7751
7841
  "borderRadiusItem": "border-radius-item",
7752
7842
  "borderRadiusInput": "border-radius-input",
@@ -8330,6 +8420,10 @@ export var preset = {
8330
8420
  "colorBoardPlaceholderHover": "--color-board-placeholder-hover-v1s7kq",
8331
8421
  "colorDragPlaceholderActive": "--color-drag-placeholder-active-fkpj7i",
8332
8422
  "colorDragPlaceholderHover": "--color-drag-placeholder-hover-3ohnz1",
8423
+ "colorDropzoneBackgroundActive": "--color-dropzone-background-active-g4zi07",
8424
+ "colorDropzoneBackgroundHover": "--color-dropzone-background-hover-j98f7z",
8425
+ "colorDropzoneTextActive": "--color-dropzone-text-active-aobpir",
8426
+ "colorDropzoneTextHover": "--color-dropzone-text-hover-ud2lnq",
8333
8427
  "fontBodyMLineHeight": "--font-body-m-line-height-i7xxvv",
8334
8428
  "fontBodyMSize": "--font-body-m-size-sregvd",
8335
8429
  "fontBodySLetterSpacing": "--font-body-s-letter-spacing-cy0oxj",
@@ -8407,6 +8501,7 @@ export var preset = {
8407
8501
  "borderRadiusControlCircularFocusRing": "--border-radius-control-circular-focus-ring-qawzn7",
8408
8502
  "borderRadiusControlDefaultFocusRing": "--border-radius-control-default-focus-ring-7661kz",
8409
8503
  "borderRadiusDropdown": "--border-radius-dropdown-ujknaf",
8504
+ "borderRadiusDropzone": "--border-radius-dropzone-poqo08",
8410
8505
  "borderRadiusFlashbar": "--border-radius-flashbar-i7jm55",
8411
8506
  "borderRadiusItem": "--border-radius-item-u2ibpi",
8412
8507
  "borderRadiusInput": "--border-radius-input-txq8zy",
@@ -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 { useLayoutEffect } from 'react';
4
- import { useAppLayoutContext } from '../../context/app-layout-context';
3
+ import { useContext, useLayoutEffect } from 'react';
4
+ import { DynamicOverlapContext } from '../../context/dynamic-overlap-context';
5
5
  import { useContainerQuery } from '../container-queries';
6
6
  /**
7
7
  * Observes the height of an element referenced by the returning ref and sets the value as overlapping
@@ -12,18 +12,18 @@ import { useContainerQuery } from '../container-queries';
12
12
  export function useDynamicOverlap(props) {
13
13
  var _a;
14
14
  const disabled = (_a = props === null || props === void 0 ? void 0 : props.disabled) !== null && _a !== void 0 ? _a : false;
15
- const { setDynamicOverlapHeight } = useAppLayoutContext();
16
- const [overlapContainerQuery, overlapElementRef] = useContainerQuery(rect => rect.height);
15
+ const setDynamicOverlapHeight = useContext(DynamicOverlapContext);
16
+ const [overlapHeight, overlapElementRef] = useContainerQuery(rect => rect.height);
17
17
  useLayoutEffect(function handleDynamicOverlapHeight() {
18
18
  if (!disabled) {
19
- setDynamicOverlapHeight === null || setDynamicOverlapHeight === void 0 ? void 0 : setDynamicOverlapHeight(overlapContainerQuery !== null && overlapContainerQuery !== void 0 ? overlapContainerQuery : 0);
19
+ setDynamicOverlapHeight(overlapHeight !== null && overlapHeight !== void 0 ? overlapHeight : 0);
20
20
  }
21
21
  return () => {
22
22
  if (!disabled) {
23
- setDynamicOverlapHeight === null || setDynamicOverlapHeight === void 0 ? void 0 : setDynamicOverlapHeight(0);
23
+ setDynamicOverlapHeight(0);
24
24
  }
25
25
  };
26
- }, [disabled, overlapContainerQuery, setDynamicOverlapHeight]);
26
+ }, [disabled, overlapHeight, setDynamicOverlapHeight]);
27
27
  return overlapElementRef;
28
28
  }
29
29
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"lib/default/","sources":["internal/hooks/use-dynamic-overlap/index.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,EAAE,eAAe,EAAE,MAAM,OAAO,CAAC;AAExC,OAAO,EAAE,mBAAmB,EAAE,MAAM,kCAAkC,CAAC;AACvE,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AASzD;;;;;GAKG;AACH,MAAM,UAAU,iBAAiB,CAAC,KAA8B;;IAC9D,MAAM,QAAQ,GAAG,MAAA,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,QAAQ,mCAAI,KAAK,CAAC;IAC1C,MAAM,EAAE,uBAAuB,EAAE,GAAG,mBAAmB,EAAE,CAAC;IAC1D,MAAM,CAAC,qBAAqB,EAAE,iBAAiB,CAAC,GAAG,iBAAiB,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IAE1F,eAAe,CACb,SAAS,0BAA0B;QACjC,IAAI,CAAC,QAAQ,EAAE;YACb,uBAAuB,aAAvB,uBAAuB,uBAAvB,uBAAuB,CAAG,qBAAqB,aAArB,qBAAqB,cAArB,qBAAqB,GAAI,CAAC,CAAC,CAAC;SACvD;QAED,OAAO,GAAG,EAAE;YACV,IAAI,CAAC,QAAQ,EAAE;gBACb,uBAAuB,aAAvB,uBAAuB,uBAAvB,uBAAuB,CAAG,CAAC,CAAC,CAAC;aAC9B;QACH,CAAC,CAAC;IACJ,CAAC,EACD,CAAC,QAAQ,EAAE,qBAAqB,EAAE,uBAAuB,CAAC,CAC3D,CAAC;IAEF,OAAO,iBAAiB,CAAC;AAC3B,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { useLayoutEffect } from 'react';\n\nimport { useAppLayoutContext } from '../../context/app-layout-context';\nimport { useContainerQuery } from '../container-queries';\n\nexport interface UseDynamicOverlapProps {\n /**\n * Disables hook if not needed. By default, `false`.\n */\n disabled?: boolean;\n}\n\n/**\n * Observes the height of an element referenced by the returning ref and sets the value as overlapping\n * height for the surrounding AppLayout component.\n * @param props.disabled disables hook if not applicable\n * @returns ref to be measured as overlapping height\n */\nexport function useDynamicOverlap(props?: UseDynamicOverlapProps) {\n const disabled = props?.disabled ?? false;\n const { setDynamicOverlapHeight } = useAppLayoutContext();\n const [overlapContainerQuery, overlapElementRef] = useContainerQuery(rect => rect.height);\n\n useLayoutEffect(\n function handleDynamicOverlapHeight() {\n if (!disabled) {\n setDynamicOverlapHeight?.(overlapContainerQuery ?? 0);\n }\n\n return () => {\n if (!disabled) {\n setDynamicOverlapHeight?.(0);\n }\n };\n },\n [disabled, overlapContainerQuery, setDynamicOverlapHeight]\n );\n\n return overlapElementRef;\n}\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"lib/default/","sources":["internal/hooks/use-dynamic-overlap/index.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,OAAO,CAAC;AAEpD,OAAO,EAAE,qBAAqB,EAAE,MAAM,uCAAuC,CAAC;AAC9E,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AASzD;;;;;GAKG;AACH,MAAM,UAAU,iBAAiB,CAAC,KAA8B;;IAC9D,MAAM,QAAQ,GAAG,MAAA,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,QAAQ,mCAAI,KAAK,CAAC;IAC1C,MAAM,uBAAuB,GAAG,UAAU,CAAC,qBAAqB,CAAC,CAAC;IAClE,MAAM,CAAC,aAAa,EAAE,iBAAiB,CAAC,GAAG,iBAAiB,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IAElF,eAAe,CACb,SAAS,0BAA0B;QACjC,IAAI,CAAC,QAAQ,EAAE;YACb,uBAAuB,CAAC,aAAa,aAAb,aAAa,cAAb,aAAa,GAAI,CAAC,CAAC,CAAC;SAC7C;QAED,OAAO,GAAG,EAAE;YACV,IAAI,CAAC,QAAQ,EAAE;gBACb,uBAAuB,CAAC,CAAC,CAAC,CAAC;aAC5B;QACH,CAAC,CAAC;IACJ,CAAC,EACD,CAAC,QAAQ,EAAE,aAAa,EAAE,uBAAuB,CAAC,CACnD,CAAC;IAEF,OAAO,iBAAiB,CAAC;AAC3B,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { useContext, useLayoutEffect } from 'react';\n\nimport { DynamicOverlapContext } from '../../context/dynamic-overlap-context';\nimport { useContainerQuery } from '../container-queries';\n\nexport interface UseDynamicOverlapProps {\n /**\n * Disables hook if not needed. By default, `false`.\n */\n disabled?: boolean;\n}\n\n/**\n * Observes the height of an element referenced by the returning ref and sets the value as overlapping\n * height for the surrounding AppLayout component.\n * @param props.disabled disables hook if not applicable\n * @returns ref to be measured as overlapping height\n */\nexport function useDynamicOverlap(props?: UseDynamicOverlapProps) {\n const disabled = props?.disabled ?? false;\n const setDynamicOverlapHeight = useContext(DynamicOverlapContext);\n const [overlapHeight, overlapElementRef] = useContainerQuery(rect => rect.height);\n\n useLayoutEffect(\n function handleDynamicOverlapHeight() {\n if (!disabled) {\n setDynamicOverlapHeight(overlapHeight ?? 0);\n }\n\n return () => {\n if (!disabled) {\n setDynamicOverlapHeight(0);\n }\n };\n },\n [disabled, overlapHeight, setDynamicOverlapHeight]\n );\n\n return overlapElementRef;\n}\n"]}
@@ -1,3 +1,3 @@
1
1
  {
2
- "commit": "471735b67df75c4cb69b1b7b201ef05ca6ddf2df"
2
+ "commit": "192f9e6a12828f9266fd2b80a86d911900b012bb"
3
3
  }
@@ -1 +1 @@
1
- {"version":3,"file":"internal.d.ts","sourceRoot":"lib/default/","sources":["multiselect/internal.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAmD,MAAM,OAAO,CAAC;AAIxE,OAAO,EAAE,0BAA0B,EAAE,MAAM,+CAA+C,CAAC;AA2B3F,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAOhD,QAAA,MAAM,mBAAmB,4HAsRxB,CAAC;AAEF,eAAe,mBAAmB,CAAC"}
1
+ {"version":3,"file":"internal.d.ts","sourceRoot":"lib/default/","sources":["multiselect/internal.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAmD,MAAM,OAAO,CAAC;AAIxE,OAAO,EAAE,0BAA0B,EAAE,MAAM,+CAA+C,CAAC;AA2B3F,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAOhD,QAAA,MAAM,mBAAmB,4HA+RxB,CAAC;AAEF,eAAe,mBAAmB,CAAC"}
@@ -74,6 +74,7 @@ const InternalMultiselect = React.forwardRef((_a, externalRef) => {
74
74
  const selfControlId = useUniqueId('trigger');
75
75
  const controlId = (_b = formFieldContext.controlId) !== null && _b !== void 0 ? _b : selfControlId;
76
76
  const multiSelectAriaLabelId = useUniqueId('multiselect-arialabel-');
77
+ const footerId = useUniqueId('footer');
77
78
  const scrollToIndex = useRef(null);
78
79
  const { isOpen, highlightType, highlightedOption, highlightedIndex, getTriggerProps, getDropdownProps, getFilterProps, getMenuProps, getOptionProps, highlightOption, announceSelected, } = useSelect({
79
80
  selectedOptions,
@@ -112,7 +113,7 @@ const InternalMultiselect = React.forwardRef((_a, externalRef) => {
112
113
  });
113
114
  const filter = (React.createElement(Filter, Object.assign({ clearAriaLabel: filteringClearAriaLabel, filteringType: filteringType, placeholder: filteringPlaceholder, ariaLabel: filteringAriaLabel, ariaRequired: ariaRequired, value: filteringValue }, getFilterProps())));
114
115
  const trigger = (React.createElement(Trigger, Object.assign({ placeholder: placeholder, disabled: disabled, triggerProps: getTriggerProps(disabled, autoFocus), selectedOption: null, isOpen: isOpen }, formFieldContext, { controlId: controlId, ariaLabelledby: joinStrings(formFieldContext.ariaLabelledby, multiSelectAriaLabelId) })));
115
- const menuProps = Object.assign(Object.assign({}, getMenuProps()), { onLoadMore: handleLoadMore, ariaLabelledby: joinStrings(multiSelectAriaLabelId, controlId) });
116
+ const menuProps = Object.assign(Object.assign({}, getMenuProps()), { onLoadMore: handleLoadMore, ariaLabelledby: joinStrings(multiSelectAriaLabelId, controlId), ariaDescribedby: dropdownStatus.content ? footerId : undefined });
116
117
  const announcement = useAnnouncement({
117
118
  announceSelected,
118
119
  highlightedOption,
@@ -159,8 +160,8 @@ const InternalMultiselect = React.forwardRef((_a, externalRef) => {
159
160
  };
160
161
  const mergedRef = useMergeRefs(rootRef, __internalRootRef);
161
162
  return (React.createElement("div", Object.assign({}, baseProps, { ref: mergedRef, className: clsx(styles.root, baseProps.className), onKeyPress: handleNativeSearch }),
162
- React.createElement(Dropdown, Object.assign({}, getDropdownProps(), { open: isOpen, trigger: trigger, header: filter, onMouseDown: handleMouseDown, footer: dropdownStatus.isSticky ? React.createElement(DropdownFooter, { content: isOpen ? dropdownStatus.content : null }) : null, expandToViewport: expandToViewport }),
163
- React.createElement(ListComponent, { listBottom: !dropdownStatus.isSticky ? React.createElement(DropdownFooter, { content: isOpen ? dropdownStatus.content : null }) : null, menuProps: menuProps, getOptionProps: getOptionProps, filteredOptions: filteredOptions, filteringValue: filteringValue, ref: scrollToIndex, hasDropdownStatus: dropdownStatus.content !== null, checkboxes: true, useInteractiveGroups: useInteractiveGroups, screenReaderContent: announcement, highlightType: highlightType })),
163
+ React.createElement(Dropdown, Object.assign({}, getDropdownProps(), { open: isOpen, trigger: trigger, header: filter, onMouseDown: handleMouseDown, footer: dropdownStatus.isSticky ? (React.createElement(DropdownFooter, { content: isOpen ? dropdownStatus.content : null, id: footerId })) : null, expandToViewport: expandToViewport }),
164
+ React.createElement(ListComponent, { listBottom: !dropdownStatus.isSticky ? (React.createElement(DropdownFooter, { content: isOpen ? dropdownStatus.content : null, id: footerId })) : null, menuProps: menuProps, getOptionProps: getOptionProps, filteredOptions: filteredOptions, filteringValue: filteringValue, ref: scrollToIndex, hasDropdownStatus: dropdownStatus.content !== null, checkboxes: true, useInteractiveGroups: useInteractiveGroups, screenReaderContent: announcement, highlightType: highlightType })),
164
165
  showTokens && (React.createElement(InternalTokenGroup, { alignment: "horizontal", limit: tokenLimit, items: tokens, onDismiss: handleTokenDismiss, i18nStrings: tokenGroupI18nStrings })),
165
166
  React.createElement(ScreenreaderOnly, { id: multiSelectAriaLabelId }, ariaLabel)));
166
167
  });