@cloudscape-design/components-themeable 3.0.1340 → 3.0.1342

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 (212) hide show
  1. package/lib/internal/manifest.json +1 -1
  2. package/lib/internal/scss/expandable-section/styles.scss +142 -0
  3. package/lib/internal/scss/input/styles.scss +228 -37
  4. package/lib/internal/scss/internal/components/chart-legend/styles.scss +1 -0
  5. package/lib/internal/scss/internal/generated/custom-css-properties/index.scss +1 -1
  6. package/lib/internal/scss/multiselect/styles.scss +14 -0
  7. package/lib/internal/scss/pagination/styles.scss +9 -2
  8. package/lib/internal/scss/pagination/test-classes/styles.scss +8 -0
  9. package/lib/internal/scss/select/styles.scss +14 -1
  10. package/lib/internal/scss/side-navigation/styles.scss +62 -24
  11. package/lib/internal/scss/textarea/styles.scss +21 -2
  12. package/lib/internal/template/button-dropdown/filter.d.ts +1 -1
  13. package/lib/internal/template/button-dropdown/filter.d.ts.map +1 -1
  14. package/lib/internal/template/button-dropdown/internal.d.ts.map +1 -1
  15. package/lib/internal/template/button-dropdown/internal.js +2 -2
  16. package/lib/internal/template/button-dropdown/internal.js.map +1 -1
  17. package/lib/internal/template/button-dropdown/utils/use-button-dropdown.d.ts +1 -0
  18. package/lib/internal/template/button-dropdown/utils/use-button-dropdown.d.ts.map +1 -1
  19. package/lib/internal/template/button-dropdown/utils/use-button-dropdown.js +9 -0
  20. package/lib/internal/template/button-dropdown/utils/use-button-dropdown.js.map +1 -1
  21. package/lib/internal/template/expandable-section/expandable-section-header.d.ts +2 -1
  22. package/lib/internal/template/expandable-section/expandable-section-header.d.ts.map +1 -1
  23. package/lib/internal/template/expandable-section/expandable-section-header.js +57 -13
  24. package/lib/internal/template/expandable-section/expandable-section-header.js.map +1 -1
  25. package/lib/internal/template/expandable-section/interfaces.d.ts +1 -1
  26. package/lib/internal/template/expandable-section/interfaces.js.map +1 -1
  27. package/lib/internal/template/expandable-section/internal.d.ts +14 -1
  28. package/lib/internal/template/expandable-section/internal.d.ts.map +1 -1
  29. package/lib/internal/template/expandable-section/internal.js +3 -3
  30. package/lib/internal/template/expandable-section/internal.js.map +1 -1
  31. package/lib/internal/template/expandable-section/styles.css.js +42 -35
  32. package/lib/internal/template/expandable-section/styles.scoped.css +177 -69
  33. package/lib/internal/template/expandable-section/styles.selectors.js +42 -35
  34. package/lib/internal/template/i18n/context.d.ts +16 -4
  35. package/lib/internal/template/i18n/context.d.ts.map +1 -1
  36. package/lib/internal/template/i18n/context.js +10 -4
  37. package/lib/internal/template/i18n/context.js.map +1 -1
  38. package/lib/internal/template/i18n/index.d.ts +2 -0
  39. package/lib/internal/template/i18n/index.d.ts.map +1 -1
  40. package/lib/internal/template/i18n/index.js +1 -0
  41. package/lib/internal/template/i18n/index.js.map +1 -1
  42. package/lib/internal/template/i18n/messages/all.all.js +1 -1
  43. package/lib/internal/template/i18n/messages/all.all.json +1 -1
  44. package/lib/internal/template/i18n/messages/all.ar.js +1 -1
  45. package/lib/internal/template/i18n/messages/all.ar.json +1 -1
  46. package/lib/internal/template/i18n/messages/all.de.js +1 -1
  47. package/lib/internal/template/i18n/messages/all.de.json +1 -1
  48. package/lib/internal/template/i18n/messages/all.en-GB.js +1 -1
  49. package/lib/internal/template/i18n/messages/all.en-GB.json +1 -1
  50. package/lib/internal/template/i18n/messages/all.en.js +1 -1
  51. package/lib/internal/template/i18n/messages/all.en.json +1 -1
  52. package/lib/internal/template/i18n/messages/all.es.js +1 -1
  53. package/lib/internal/template/i18n/messages/all.es.json +1 -1
  54. package/lib/internal/template/i18n/messages/all.fr.js +1 -1
  55. package/lib/internal/template/i18n/messages/all.fr.json +1 -1
  56. package/lib/internal/template/i18n/messages/all.id.js +1 -1
  57. package/lib/internal/template/i18n/messages/all.id.json +1 -1
  58. package/lib/internal/template/i18n/messages/all.it.js +1 -1
  59. package/lib/internal/template/i18n/messages/all.it.json +1 -1
  60. package/lib/internal/template/i18n/messages/all.ja.js +1 -1
  61. package/lib/internal/template/i18n/messages/all.ja.json +1 -1
  62. package/lib/internal/template/i18n/messages/all.ko.js +1 -1
  63. package/lib/internal/template/i18n/messages/all.ko.json +1 -1
  64. package/lib/internal/template/i18n/messages/all.pt-BR.js +1 -1
  65. package/lib/internal/template/i18n/messages/all.pt-BR.json +1 -1
  66. package/lib/internal/template/i18n/messages/all.tr.js +1 -1
  67. package/lib/internal/template/i18n/messages/all.tr.json +1 -1
  68. package/lib/internal/template/i18n/messages/all.zh-CN.js +1 -1
  69. package/lib/internal/template/i18n/messages/all.zh-CN.json +1 -1
  70. package/lib/internal/template/i18n/messages/all.zh-TW.js +1 -1
  71. package/lib/internal/template/i18n/messages/all.zh-TW.json +1 -1
  72. package/lib/internal/template/i18n/messages-types.d.ts +5 -0
  73. package/lib/internal/template/i18n/messages-types.d.ts.map +1 -1
  74. package/lib/internal/template/i18n/messages-types.js.map +1 -1
  75. package/lib/internal/template/input/index.d.ts.map +1 -1
  76. package/lib/internal/template/input/index.js +4 -2
  77. package/lib/internal/template/input/index.js.map +1 -1
  78. package/lib/internal/template/input/interfaces.d.ts +9 -0
  79. package/lib/internal/template/input/interfaces.d.ts.map +1 -1
  80. package/lib/internal/template/input/interfaces.js.map +1 -1
  81. package/lib/internal/template/input/internal.d.ts +5 -5
  82. package/lib/internal/template/input/internal.d.ts.map +1 -1
  83. package/lib/internal/template/input/internal.js +60 -24
  84. package/lib/internal/template/input/internal.js.map +1 -1
  85. package/lib/internal/template/input/styles.css.js +28 -18
  86. package/lib/internal/template/input/styles.scoped.css +213 -52
  87. package/lib/internal/template/input/styles.selectors.js +28 -18
  88. package/lib/internal/template/input/utils.js +3 -3
  89. package/lib/internal/template/input/utils.js.map +1 -1
  90. package/lib/internal/template/internal/base-component/styles.scoped.css +297 -289
  91. package/lib/internal/template/internal/components/cartesian-chart/styles.css.js +28 -28
  92. package/lib/internal/template/internal/components/cartesian-chart/styles.scoped.css +35 -35
  93. package/lib/internal/template/internal/components/cartesian-chart/styles.selectors.js +28 -28
  94. package/lib/internal/template/internal/components/chart-legend/styles.css.js +6 -6
  95. package/lib/internal/template/internal/components/chart-legend/styles.scoped.css +16 -14
  96. package/lib/internal/template/internal/components/chart-legend/styles.selectors.js +6 -6
  97. package/lib/internal/template/internal/environment.js +2 -2
  98. package/lib/internal/template/internal/environment.json +2 -2
  99. package/lib/internal/template/internal/generated/styles/tokens.d.ts +1 -0
  100. package/lib/internal/template/internal/generated/styles/tokens.js +1 -0
  101. package/lib/internal/template/internal/generated/theming/index.cjs +31 -0
  102. package/lib/internal/template/internal/generated/theming/index.js +31 -0
  103. package/lib/internal/template/multiselect/embedded.d.ts +1 -1
  104. package/lib/internal/template/multiselect/index.d.ts.map +1 -1
  105. package/lib/internal/template/multiselect/index.js +4 -0
  106. package/lib/internal/template/multiselect/index.js.map +1 -1
  107. package/lib/internal/template/multiselect/interfaces.d.ts +8 -1
  108. package/lib/internal/template/multiselect/interfaces.d.ts.map +1 -1
  109. package/lib/internal/template/multiselect/interfaces.js.map +1 -1
  110. package/lib/internal/template/multiselect/internal.d.ts.map +1 -1
  111. package/lib/internal/template/multiselect/internal.js +22 -2
  112. package/lib/internal/template/multiselect/internal.js.map +1 -1
  113. package/lib/internal/template/multiselect/styles.css.js +5 -3
  114. package/lib/internal/template/multiselect/styles.scoped.css +13 -3
  115. package/lib/internal/template/multiselect/styles.selectors.js +5 -3
  116. package/lib/internal/template/multiselect/use-multiselect.d.ts +3 -2
  117. package/lib/internal/template/multiselect/use-multiselect.d.ts.map +1 -1
  118. package/lib/internal/template/multiselect/use-multiselect.js +5 -3
  119. package/lib/internal/template/multiselect/use-multiselect.js.map +1 -1
  120. package/lib/internal/template/pagination/index.d.ts.map +1 -1
  121. package/lib/internal/template/pagination/index.js +3 -3
  122. package/lib/internal/template/pagination/index.js.map +1 -1
  123. package/lib/internal/template/pagination/interfaces.d.ts +19 -3
  124. package/lib/internal/template/pagination/interfaces.d.ts.map +1 -1
  125. package/lib/internal/template/pagination/interfaces.js.map +1 -1
  126. package/lib/internal/template/pagination/internal.d.ts.map +1 -1
  127. package/lib/internal/template/pagination/internal.js +18 -6
  128. package/lib/internal/template/pagination/internal.js.map +1 -1
  129. package/lib/internal/template/pagination/styles.css.js +12 -11
  130. package/lib/internal/template/pagination/styles.scoped.css +34 -25
  131. package/lib/internal/template/pagination/styles.selectors.js +12 -11
  132. package/lib/internal/template/pagination/test-classes/styles.css.js +6 -0
  133. package/lib/internal/template/pagination/test-classes/styles.scoped.css +7 -0
  134. package/lib/internal/template/pagination/test-classes/styles.selectors.js +7 -0
  135. package/lib/internal/template/prompt-input/internal.d.ts.map +1 -1
  136. package/lib/internal/template/prompt-input/internal.js +14 -2
  137. package/lib/internal/template/prompt-input/internal.js.map +1 -1
  138. package/lib/internal/template/select/index.d.ts.map +1 -1
  139. package/lib/internal/template/select/index.js +4 -0
  140. package/lib/internal/template/select/index.js.map +1 -1
  141. package/lib/internal/template/select/interfaces.d.ts +39 -0
  142. package/lib/internal/template/select/interfaces.d.ts.map +1 -1
  143. package/lib/internal/template/select/interfaces.js.map +1 -1
  144. package/lib/internal/template/select/internal.d.ts.map +1 -1
  145. package/lib/internal/template/select/internal.js +20 -4
  146. package/lib/internal/template/select/internal.js.map +1 -1
  147. package/lib/internal/template/select/parts/filter.d.ts +1 -1
  148. package/lib/internal/template/select/parts/filter.d.ts.map +1 -1
  149. package/lib/internal/template/select/styles.css.js +3 -1
  150. package/lib/internal/template/select/styles.scoped.css +11 -1
  151. package/lib/internal/template/select/styles.selectors.js +3 -1
  152. package/lib/internal/template/select/utils/dropdown-customization.d.ts +20 -0
  153. package/lib/internal/template/select/utils/dropdown-customization.d.ts.map +1 -0
  154. package/lib/internal/template/select/utils/dropdown-customization.js +22 -0
  155. package/lib/internal/template/select/utils/dropdown-customization.js.map +1 -0
  156. package/lib/internal/template/select/utils/use-select.d.ts +4 -1
  157. package/lib/internal/template/select/utils/use-select.d.ts.map +1 -1
  158. package/lib/internal/template/select/utils/use-select.js +21 -4
  159. package/lib/internal/template/select/utils/use-select.js.map +1 -1
  160. package/lib/internal/template/side-navigation/parts.d.ts.map +1 -1
  161. package/lib/internal/template/side-navigation/parts.js +3 -2
  162. package/lib/internal/template/side-navigation/parts.js.map +1 -1
  163. package/lib/internal/template/side-navigation/styles.css.js +50 -48
  164. package/lib/internal/template/side-navigation/styles.scoped.css +106 -93
  165. package/lib/internal/template/side-navigation/styles.selectors.js +50 -48
  166. package/lib/internal/template/status-indicator/interfaces.d.ts +1 -1
  167. package/lib/internal/template/status-indicator/interfaces.d.ts.map +1 -1
  168. package/lib/internal/template/status-indicator/interfaces.js.map +1 -1
  169. package/lib/internal/template/status-indicator/internal.d.ts +2 -6
  170. package/lib/internal/template/status-indicator/internal.d.ts.map +1 -1
  171. package/lib/internal/template/status-indicator/internal.js.map +1 -1
  172. package/lib/internal/template/steps/interfaces.d.ts +2 -2
  173. package/lib/internal/template/steps/interfaces.d.ts.map +1 -1
  174. package/lib/internal/template/steps/interfaces.js.map +1 -1
  175. package/lib/internal/template/test-utils/dom/input/index.d.ts +2 -0
  176. package/lib/internal/template/test-utils/dom/input/index.js +6 -0
  177. package/lib/internal/template/test-utils/dom/input/index.js.map +1 -1
  178. package/lib/internal/template/test-utils/dom/multiselect/index.d.ts +16 -0
  179. package/lib/internal/template/test-utils/dom/multiselect/index.js +16 -0
  180. package/lib/internal/template/test-utils/dom/multiselect/index.js.map +1 -1
  181. package/lib/internal/template/test-utils/dom/pagination/index.d.ts +5 -1
  182. package/lib/internal/template/test-utils/dom/pagination/index.js +7 -0
  183. package/lib/internal/template/test-utils/dom/pagination/index.js.map +1 -1
  184. package/lib/internal/template/test-utils/dom/select/index.d.ts +16 -0
  185. package/lib/internal/template/test-utils/dom/select/index.js +16 -0
  186. package/lib/internal/template/test-utils/dom/select/index.js.map +1 -1
  187. package/lib/internal/template/test-utils/selectors/input/index.d.ts +2 -0
  188. package/lib/internal/template/test-utils/selectors/input/index.js +6 -0
  189. package/lib/internal/template/test-utils/selectors/input/index.js.map +1 -1
  190. package/lib/internal/template/test-utils/selectors/multiselect/index.d.ts +16 -0
  191. package/lib/internal/template/test-utils/selectors/multiselect/index.js +20 -0
  192. package/lib/internal/template/test-utils/selectors/multiselect/index.js.map +1 -1
  193. package/lib/internal/template/test-utils/selectors/pagination/index.d.ts +5 -1
  194. package/lib/internal/template/test-utils/selectors/pagination/index.js +7 -0
  195. package/lib/internal/template/test-utils/selectors/pagination/index.js.map +1 -1
  196. package/lib/internal/template/test-utils/selectors/select/index.d.ts +16 -0
  197. package/lib/internal/template/test-utils/selectors/select/index.js +20 -0
  198. package/lib/internal/template/test-utils/selectors/select/index.js.map +1 -1
  199. package/lib/internal/template/textarea/index.d.ts.map +1 -1
  200. package/lib/internal/template/textarea/index.js +11 -3
  201. package/lib/internal/template/textarea/index.js.map +1 -1
  202. package/lib/internal/template/textarea/interfaces.d.ts +12 -0
  203. package/lib/internal/template/textarea/interfaces.d.ts.map +1 -1
  204. package/lib/internal/template/textarea/interfaces.js.map +1 -1
  205. package/lib/internal/template/textarea/styles.css.js +9 -5
  206. package/lib/internal/template/textarea/styles.scoped.css +26 -14
  207. package/lib/internal/template/textarea/styles.selectors.js +9 -5
  208. package/package.json +1 -1
  209. package/lib/internal/template/status-indicator/internal-interfaces.d.ts +0 -3
  210. package/lib/internal/template/status-indicator/internal-interfaces.d.ts.map +0 -1
  211. package/lib/internal/template/status-indicator/internal-interfaces.js +0 -2
  212. package/lib/internal/template/status-indicator/internal-interfaces.js.map +0 -1
@@ -1795,6 +1795,10 @@ export var preset = {
1795
1795
  "light": "{colorBackgroundControlChecked}",
1796
1796
  "dark": "{colorBackgroundControlChecked}"
1797
1797
  },
1798
+ "colorBackgroundSideNavigationItemIconHover": {
1799
+ "light": "{colorPrimary50}",
1800
+ "dark": "{colorNeutral700}"
1801
+ },
1798
1802
  "colorBackgroundLayoutMain": {
1799
1803
  "light": "{colorWhite}",
1800
1804
  "dark": "{colorNeutral850}"
@@ -4799,6 +4803,10 @@ export var preset = {
4799
4803
  "light": "{colorBackgroundControlChecked}",
4800
4804
  "dark": "{colorBackgroundControlChecked}"
4801
4805
  },
4806
+ "colorBackgroundSideNavigationItemIconHover": {
4807
+ "light": "{colorNeutral700}",
4808
+ "dark": "{colorNeutral700}"
4809
+ },
4802
4810
  "colorBackgroundLayoutMain": {
4803
4811
  "light": "{colorNeutral850}",
4804
4812
  "dark": "{colorNeutral850}"
@@ -6615,6 +6623,10 @@ export var preset = {
6615
6623
  "light": "{colorBackgroundControlChecked}",
6616
6624
  "dark": "{colorBackgroundControlChecked}"
6617
6625
  },
6626
+ "colorBackgroundSideNavigationItemIconHover": {
6627
+ "light": "{colorNeutral700}",
6628
+ "dark": "{colorNeutral700}"
6629
+ },
6618
6630
  "colorBackgroundLayoutMain": {
6619
6631
  "light": "{colorNeutral950}",
6620
6632
  "dark": "{colorNeutral950}"
@@ -8359,6 +8371,10 @@ export var preset = {
8359
8371
  "light": "{colorBackgroundControlChecked}",
8360
8372
  "dark": "{colorBackgroundControlChecked}"
8361
8373
  },
8374
+ "colorBackgroundSideNavigationItemIconHover": {
8375
+ "light": "{colorPrimary50}",
8376
+ "dark": "{colorNeutral700}"
8377
+ },
8362
8378
  "colorBackgroundLayoutMain": {
8363
8379
  "light": "{colorWhite}",
8364
8380
  "dark": "{colorNeutral850}"
@@ -9949,6 +9965,10 @@ export var preset = {
9949
9965
  "light": "{colorBackgroundControlChecked}",
9950
9966
  "dark": "{colorBackgroundControlChecked}"
9951
9967
  },
9968
+ "colorBackgroundSideNavigationItemIconHover": {
9969
+ "light": "{colorPrimary50}",
9970
+ "dark": "{colorNeutral700}"
9971
+ },
9952
9972
  "colorBackgroundLayoutMain": {
9953
9973
  "light": "{colorWhite}",
9954
9974
  "dark": "{colorNeutral850}"
@@ -11539,6 +11559,10 @@ export var preset = {
11539
11559
  "light": "{colorBackgroundControlChecked}",
11540
11560
  "dark": "{colorBackgroundControlChecked}"
11541
11561
  },
11562
+ "colorBackgroundSideNavigationItemIconHover": {
11563
+ "light": "{colorPrimary50}",
11564
+ "dark": "{colorNeutral700}"
11565
+ },
11542
11566
  "colorBackgroundLayoutMain": {
11543
11567
  "light": "{colorWhite}",
11544
11568
  "dark": "{colorNeutral850}"
@@ -13131,6 +13155,10 @@ export var preset = {
13131
13155
  "light": "{colorBackgroundControlChecked}",
13132
13156
  "dark": "{colorBackgroundControlChecked}"
13133
13157
  },
13158
+ "colorBackgroundSideNavigationItemIconHover": {
13159
+ "light": "{colorNeutral700}",
13160
+ "dark": "{colorNeutral700}"
13161
+ },
13134
13162
  "colorBackgroundLayoutMain": {
13135
13163
  "light": "{colorNeutral850}",
13136
13164
  "dark": "{colorNeutral850}"
@@ -14932,6 +14960,7 @@ export var preset = {
14932
14960
  "colorBackgroundItemSelected": "color",
14933
14961
  "colorBackgroundSideNavigationItemActive": "color",
14934
14962
  "colorBackgroundSideNavigationItemActiveCollapsed": "color",
14963
+ "colorBackgroundSideNavigationItemIconHover": "color",
14935
14964
  "colorBackgroundLayoutMain": "color",
14936
14965
  "colorBackgroundLayoutAiDrawer": "color",
14937
14966
  "colorBackgroundDrawer": "color",
@@ -17215,6 +17244,7 @@ export var preset = {
17215
17244
  "colorBackgroundItemSelected": "color-background-item-selected",
17216
17245
  "colorBackgroundSideNavigationItemActive": "color-background-side-navigation-item-active",
17217
17246
  "colorBackgroundSideNavigationItemActiveCollapsed": "color-background-side-navigation-item-active-collapsed",
17247
+ "colorBackgroundSideNavigationItemIconHover": "color-background-side-navigation-item-icon-hover",
17218
17248
  "colorBackgroundLayoutMain": "color-background-layout-main",
17219
17249
  "colorBackgroundLayoutAiDrawer": "color-background-layout-ai-drawer",
17220
17250
  "colorBackgroundDrawer": "color-background-drawer",
@@ -18337,6 +18367,7 @@ export var preset = {
18337
18367
  "colorBackgroundItemSelected": "--color-background-item-selected-9gppru",
18338
18368
  "colorBackgroundSideNavigationItemActive": "--color-background-side-navigation-item-active-adfprg",
18339
18369
  "colorBackgroundSideNavigationItemActiveCollapsed": "--color-background-side-navigation-item-active-collapsed-ceubmy",
18370
+ "colorBackgroundSideNavigationItemIconHover": "--color-background-side-navigation-item-icon-hover-ul9ia1",
18340
18371
  "colorBackgroundLayoutMain": "--color-background-layout-main-5ilwcb",
18341
18372
  "colorBackgroundLayoutAiDrawer": "--color-background-layout-ai-drawer-b4mvv3",
18342
18373
  "colorBackgroundDrawer": "--color-background-drawer-5hs0eh",
@@ -4,7 +4,7 @@ import { MultiselectProps } from './interfaces';
4
4
  export type EmbeddedMultiselectProps = SomeRequired<Pick<MultiselectProps, 'options' | 'selectedOptions' | 'ariaLabel' | 'filteringType' | 'deselectAriaLabel' | 'virtualScroll' | 'statusType' | 'controlId' | 'onChange' | 'onLoadItems' | 'loadingText' | 'finishedText' | 'errorText' | 'recoveryText' | 'empty' | 'noMatch'>, 'options' | 'selectedOptions' | 'filteringType' | 'statusType'> & {
5
5
  filteringText?: string;
6
6
  };
7
- declare const EmbeddedMultiselect: React.ForwardRefExoticComponent<Pick<MultiselectProps, "onChange" | "ariaLabel" | "virtualScroll" | "onLoadItems" | "loadingText" | "filteringType" | "noMatch" | "errorText" | "recoveryText" | "deselectAriaLabel" | "statusType" | "empty" | "finishedText" | "controlId" | "options" | "selectedOptions"> & {
7
+ declare const EmbeddedMultiselect: React.ForwardRefExoticComponent<Pick<MultiselectProps, "onChange" | "ariaLabel" | "virtualScroll" | "onLoadItems" | "loadingText" | "filteringType" | "noMatch" | "statusType" | "empty" | "finishedText" | "errorText" | "recoveryText" | "controlId" | "options" | "selectedOptions" | "deselectAriaLabel"> & {
8
8
  filteringType: import("../dropdown/interfaces").OptionsFilteringType;
9
9
  statusType: import("../types/dropdown-status").DropdownStatusProps.StatusType;
10
10
  options: import("..").SelectProps.Options;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/multiselect/index.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,MAAM,OAAO,CAAC;AAO1B,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAKhD,OAAO,EAAE,gBAAgB,EAAE,CAAC;AAE5B,QAAA,MAAM,WAAW,+FAkEhB,CAAC;AAGF,eAAe,WAAW,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/multiselect/index.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,MAAM,OAAO,CAAC;AAO1B,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAKhD,OAAO,EAAE,gBAAgB,EAAE,CAAC;AAE5B,QAAA,MAAM,WAAW,+FAsEhB,CAAC;AAGF,eAAe,WAAW,CAAC"}
@@ -20,10 +20,14 @@ const Multiselect = React.forwardRef(({ options = [], filteringType = 'none', st
20
20
  virtualScroll: restProps.virtualScroll,
21
21
  readOnly: restProps.readOnly,
22
22
  enableSelectAll: restProps.enableSelectAll,
23
+ dropdownRole: restProps.dropdownRole,
23
24
  },
24
25
  metadata: {
25
26
  hasInlineLabel: Boolean(restProps.inlineLabelText),
26
27
  hasDisabledReasons: options.some(option => Boolean(option.disabledReason)),
28
+ hasDropdownHeader: Boolean(restProps.renderDropdownHeader),
29
+ hasDropdownFooter: Boolean(restProps.renderDropdownFooter),
30
+ hasDropdownAriaDescribedby: Boolean(restProps.dropdownAriaDescribedby),
27
31
  },
28
32
  });
29
33
  const componentAnalyticsMetadata = {
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/multiselect/index.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,YAAY,CAAC;AACb,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,6BAA6B,EAAE,MAAM,kEAAkE,CAAC;AAEjH,OAAO,gBAAgB,MAAM,sCAAsC,CAAC;AACpE,OAAO,EAAE,gBAAgB,EAAE,MAAM,sCAAsC,CAAC;AAGxE,OAAO,mBAAmB,MAAM,YAAY,CAAC;AAE7C,OAAO,+BAA+B,MAAM,wEA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AE,CAAC,GAAG,MAAM,CAAC,KAAK,EAAE,CAAC;YACnC,eAAe,EAAE,eAAe;iBAC7B,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC,MAAM,CAAC,KAAK,KAAK,SAAS,CAAC;gBAC7C,uFAAuF;gBACvF,2BAA2B;iBAC1B,GAAG,CAAC,MAAM,CAAC,EAAE,WAAC,OAAA,GAAG,MAAA,MAAM,CAAC,KAAK,mCAAI,MAAM,CAAC,KAAK,EAAE,CAAA,EAAA,CAAC;SACpD;KACF,CAAC;IAEF,OAAO,CACL,oBAAC,mBAAmB,IAClB,YAAY,EAAE,YAAY,EAC1B,OAAO,EAAE,OAAO,EAChB,aAAa,EAAE,aAAa,EAC5B,UAAU,EAAE,UAAU,EACtB,eAAe,EAAE,eAAe,EAChC,QAAQ,EAAE,QAAQ,EAClB,UAAU,EAAE,UAAU,KAClB,SAAS,KACT,kBAAkB,EACtB,GAAG,EAAE,GAAG,KACJ,6BAA6B,CAAC,EAAE,SAAS,EAAE,0BAA0B,EAAE,CAAC,GAC5E,CACH,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,gBAAgB,CAAC,WAAW,EAAE,aAAa,CAAC,CAAC;AAC7C,eAAe,WAAW,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n'use client';\nimport React from 'react';\n\nimport { getAnalyticsMetadataAttribute } from '@cloudscape-design/component-toolkit/internal/analytics-metadata';\n\nimport useBaseComponent from '../internal/hooks/use-base-component';\nimport { applyDisplayName } from '../internal/utils/apply-display-name';\nimport { GeneratedAnalyticsMetadataMultiselectComponent } from './analytics-metadata/interfaces';\nimport { MultiselectProps } from './interfaces';\nimport InternalMultiselect from './internal';\n\nimport buttonTriggerAnalyticsSelectors from '../internal/components/button-trigger/analytics-metadata/styles.css.js';\n\nexport { MultiselectProps };\n\nconst Multiselect = React.forwardRef(\n (\n {\n options = [],\n filteringType = 'none',\n statusType = 'finished',\n selectedOptions = [],\n keepOpen = true,\n hideTokens = false,\n renderOption,\n ...restProps\n }: MultiselectProps,\n ref: React.Ref<MultiselectProps.Ref>\n ) => {\n const baseComponentProps = useBaseComponent('Multiselect', {\n props: {\n inlineTokens: restProps.inlineTokens,\n autoFocus: restProps.autoFocus,\n expandToViewport: restProps.expandToViewport,\n filteringType,\n hideTokens,\n keepOpen,\n tokenLimit: restProps.tokenLimit,\n virtualScroll: restProps.virtualScroll,\n readOnly: restProps.readOnly,\n enableSelectAll: restProps.enableSelectAll,\n },\n metadata: {\n hasInlineLabel: Boolean(restProps.inlineLabelText),\n hasDisabledReasons: options.some(option => Boolean(option.disabledReason)),\n },\n });\n\n const componentAnalyticsMetadata: GeneratedAnalyticsMetadataMultiselectComponent = {\n name: 'awsui.Multiselect',\n label: `.${buttonTriggerAnalyticsSelectors['button-trigger']}`,\n properties: {\n disabled: `${!!restProps.disabled}`,\n selectedOptionsCount: `${selectedOptions.length}`,\n selectedOptionsValues: selectedOptions\n .filter(option => option.value !== undefined)\n .map(option => `${option.value}`),\n selectedOptions: selectedOptions\n .filter(option => option.value !== undefined)\n // fallback on value when label's undefined because in the dropdown if there's no label\n // the value will be shown.\n .map(option => `${option.label ?? option.value}`),\n },\n };\n\n return (\n <InternalMultiselect\n renderOption={renderOption}\n options={options}\n filteringType={filteringType}\n statusType={statusType}\n selectedOptions={selectedOptions}\n keepOpen={keepOpen}\n hideTokens={hideTokens}\n {...restProps}\n {...baseComponentProps}\n ref={ref}\n {...getAnalyticsMetadataAttribute({ component: componentAnalyticsMetadata })}\n />\n );\n }\n);\n\napplyDisplayName(Multiselect, 'Multiselect');\nexport default Multiselect;\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/multiselect/index.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,YAAY,CAAC;AACb,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,6BAA6B,EAAE,MAAM,kEAA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';\nimport React from 'react';\n\nimport { getAnalyticsMetadataAttribute } from '@cloudscape-design/component-toolkit/internal/analytics-metadata';\n\nimport useBaseComponent from '../internal/hooks/use-base-component';\nimport { applyDisplayName } from '../internal/utils/apply-display-name';\nimport { GeneratedAnalyticsMetadataMultiselectComponent } from './analytics-metadata/interfaces';\nimport { MultiselectProps } from './interfaces';\nimport InternalMultiselect from './internal';\n\nimport buttonTriggerAnalyticsSelectors from '../internal/components/button-trigger/analytics-metadata/styles.css.js';\n\nexport { MultiselectProps };\n\nconst Multiselect = React.forwardRef(\n (\n {\n options = [],\n filteringType = 'none',\n statusType = 'finished',\n selectedOptions = [],\n keepOpen = true,\n hideTokens = false,\n renderOption,\n ...restProps\n }: MultiselectProps,\n ref: React.Ref<MultiselectProps.Ref>\n ) => {\n const baseComponentProps = useBaseComponent('Multiselect', {\n props: {\n inlineTokens: restProps.inlineTokens,\n autoFocus: restProps.autoFocus,\n expandToViewport: restProps.expandToViewport,\n filteringType,\n hideTokens,\n keepOpen,\n tokenLimit: restProps.tokenLimit,\n virtualScroll: restProps.virtualScroll,\n readOnly: restProps.readOnly,\n enableSelectAll: restProps.enableSelectAll,\n dropdownRole: restProps.dropdownRole,\n },\n metadata: {\n hasInlineLabel: Boolean(restProps.inlineLabelText),\n hasDisabledReasons: options.some(option => Boolean(option.disabledReason)),\n hasDropdownHeader: Boolean(restProps.renderDropdownHeader),\n hasDropdownFooter: Boolean(restProps.renderDropdownFooter),\n hasDropdownAriaDescribedby: Boolean(restProps.dropdownAriaDescribedby),\n },\n });\n\n const componentAnalyticsMetadata: GeneratedAnalyticsMetadataMultiselectComponent = {\n name: 'awsui.Multiselect',\n label: `.${buttonTriggerAnalyticsSelectors['button-trigger']}`,\n properties: {\n disabled: `${!!restProps.disabled}`,\n selectedOptionsCount: `${selectedOptions.length}`,\n selectedOptionsValues: selectedOptions\n .filter(option => option.value !== undefined)\n .map(option => `${option.value}`),\n selectedOptions: selectedOptions\n .filter(option => option.value !== undefined)\n // fallback on value when label's undefined because in the dropdown if there's no label\n // the value will be shown.\n .map(option => `${option.label ?? option.value}`),\n },\n };\n\n return (\n <InternalMultiselect\n renderOption={renderOption}\n options={options}\n filteringType={filteringType}\n statusType={statusType}\n selectedOptions={selectedOptions}\n keepOpen={keepOpen}\n hideTokens={hideTokens}\n {...restProps}\n {...baseComponentProps}\n ref={ref}\n {...getAnalyticsMetadataAttribute({ component: componentAnalyticsMetadata })}\n />\n );\n }\n);\n\napplyDisplayName(Multiselect, 'Multiselect');\nexport default Multiselect;\n"]}
@@ -1,6 +1,6 @@
1
1
  import { ReactNode } from 'react';
2
2
  import { OptionsLoadItemsDetail } from '../dropdown/interfaces';
3
- import { BaseSelectProps } from '../select/interfaces';
3
+ import { BaseSelectProps, SelectProps } from '../select/interfaces';
4
4
  import { NonCancelableEventHandler } from '../types/events';
5
5
  import { OptionDefinition, OptionGroup as OptionGroupDefinition } from '../types/option';
6
6
  export interface MultiselectProps extends BaseSelectProps {
@@ -78,6 +78,13 @@ export declare namespace MultiselectProps {
78
78
  type Option = OptionDefinition;
79
79
  type OptionGroup = OptionGroupDefinition;
80
80
  type Options = ReadonlyArray<Option | OptionGroup>;
81
+ /**
82
+ * The argument passed to the dropdown render functions (`renderDropdownHeader`
83
+ * and `renderDropdownFooter`).
84
+ */
85
+ type DropdownContentProps = SelectProps.DropdownContentProps;
86
+ type DropdownRole = SelectProps.DropdownRole;
87
+ type DropdownContentRenderer = SelectProps.DropdownContentRenderer;
81
88
  interface LoadItemsDetail extends OptionsLoadItemsDetail {
82
89
  }
83
90
  interface MultiselectOptionItem {
@@ -1 +1 @@
1
- {"version":3,"file":"interfaces.d.ts","sourceRoot":"","sources":["../../../src/multiselect/interfaces.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAElC,OAAO,EAAE,sBAAsB,EAAE,MAAM,wBAAwB,CAAC;AAChE,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC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AC;KACnB;IACD,KAAY,eAAe,GAAG,qBAAqB,GAAG,0BAA0B,GAAG,wBAAwB,CAAC;IAC5G,KAAY,6BAA6B,GAAG,CAAC,KAAK,EAAE;QAClD,IAAI,EAAE,eAAe,CAAC;QACtB,UAAU,CAAC,EAAE,MAAM,CAAC;KACrB,KAAK,SAAS,GAAG,IAAI,CAAC;IAEvB,KAAY,yBAAyB,GAAG,CAAC,MAAM,EAAE,MAAM,KAAK,MAAM,CAAC;IACnE,KAAY,cAAc,GAAG,aAAa,GAAG,QAAQ,CAAC;IAEtD,UAAiB,WAAW;QAC1B,aAAa,CAAC,EAAE,MAAM,CAAC;QACvB,mBAAmB,CAAC,EAAE,MAAM,CAAC;QAC7B,kBAAkB,CAAC,EAAE,MAAM,CAAC;KAC7B;IAED,UAAiB,uBAAuB;QACtC,eAAe,EAAE,aAAa,CAAC,MAAM,CAAC,CAAC;KACxC;IAED,UAAiB,GAAG;QAClB;;WAEG;QACH,KAAK,IAAI,IAAI,CAAC;KACf;CACF"}
@@ -1 +1 @@
1
- {"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../src/multiselect/interfaces.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { ReactNode } from 'react';\n\nimport { OptionsLoadItemsDetail } from '../dropdown/interfaces';\nimport { BaseSelectProps } from '../select/interfaces';\nimport { NonCancelableEventHandler } from '../types/events';\nimport { OptionDefinition, OptionGroup as OptionGroupDefinition } from '../types/option';\n\nexport interface MultiselectProps extends BaseSelectProps {\n /**\n * Specifies the currently selected options.\n * Provide an empty array to clear the selection.\n */\n selectedOptions: ReadonlyArray<MultiselectProps.Option>;\n\n /**\n * Specifies an inline label that appears next to the multiselect trigger.\n */\n inlineLabelText?: string;\n /**\n * Determines whether the dropdown list stays open after the user selects an item.\n */\n keepOpen?: boolean;\n /**\n * Specifies the maximum number of displayed tokens. If the property isn't set, all of the tokens are displayed.\n */\n tokenLimit?: number;\n /**\n * Hides the tokens displayed underneath the component.\n * Only use this if the selected options are displayed elsewhere on the page.\n */\n hideTokens?: boolean;\n /**\n * Shows tokens inside the trigger instead of below it.\n */\n inlineTokens?: boolean;\n /**\n * Specifies an `aria-label` for the token deselection button.\n * @i18n\n */\n deselectAriaLabel?: MultiselectProps.DeselectAriaLabelFunction;\n /**\n * An object containing all the localized strings required by the component.\n *\n * * `selectAllText` (string) - Specifies the text to be displayed next to the checkbox that selects or deselects all options.\n * * `tokenLimitShowFewer` (string) - Specifies the text to be displayed in the \"Show fewer\" button for the token group control.\n * * `tokenLimitShowMore` (string) - Specifies the text to be displayed in the \"Show more\" button for the token group control. This string should not contain the number of hidden tokens\n * because this will be added by the component automatically.\n * @i18n\n */\n i18nStrings?: MultiselectProps.I18nStrings;\n onLoadItems?: NonCancelableEventHandler<MultiselectProps.LoadItemsDetail>;\n /**\n * Called when the user selects or deselects an option.\n * The event `detail` contains the current `selectedOptions`.\n */\n onChange?: NonCancelableEventHandler<MultiselectProps.MultiselectChangeDetail>;\n\n /**\n * Automatically focuses the trigger when component is mounted.\n */\n autoFocus?: boolean;\n\n /**\n * Adds an aria-label to the \"Show fewer\" button for the token group control.\n * Use to assign unique labels when there are multiple token groups with the same `tokenLimitShowFewer` label on one page.\n */\n tokenLimitShowFewerAriaLabel?: string;\n /**\n * Adds an aria-label to the \"Show more\" button for the token group control.\n * Use to assign unique labels when there are multiple token groups with the same `tokenLimitShowMore` label on one page.\n */\n tokenLimitShowMoreAriaLabel?: string;\n /**\n * Enables users to select and deselect all options with a special extra checkbox which is displayed at the start of the dropdown.\n */\n enableSelectAll?: boolean;\n /**\n * Specifies a render function to render custom options in the dropdown menu.\n */\n renderOption?: MultiselectProps.MultiselectOptionItemRenderer;\n}\n\nexport namespace MultiselectProps {\n export type Option = OptionDefinition;\n export type OptionGroup = OptionGroupDefinition;\n export type Options = ReadonlyArray<Option | OptionGroup>;\n /* eslint-disable-next-line @typescript-eslint/no-empty-object-type --\n * Required to create a distinct named type for the documenter.\n **/\n export interface LoadItemsDetail extends OptionsLoadItemsDetail {}\n export interface MultiselectOptionItem {\n type: 'item';\n index: number;\n option: Option;\n disabled: boolean;\n highlighted: boolean;\n selected: boolean;\n parent: MultiselectOptionGroupItem | null;\n }\n export interface MultiselectOptionGroupItem {\n type: 'group';\n index: number;\n option: OptionGroup;\n indeterminate: boolean;\n disabled: boolean;\n highlighted: boolean;\n selected: boolean;\n }\n export interface MultiselectSelectAllItem {\n type: 'select-all';\n option: Option;\n indeterminate: boolean;\n highlighted: boolean;\n selected: boolean;\n }\n export type MultiselectItem = MultiselectOptionItem | MultiselectOptionGroupItem | MultiselectSelectAllItem;\n export type MultiselectOptionItemRenderer = (props: {\n item: MultiselectItem;\n filterText?: string;\n }) => ReactNode | null;\n\n export type DeselectAriaLabelFunction = (option: Option) => string;\n export type TriggerVariant = 'placeholder' | 'tokens';\n\n export interface I18nStrings {\n selectAllText?: string;\n tokenLimitShowFewer?: string;\n tokenLimitShowMore?: string;\n }\n\n export interface MultiselectChangeDetail {\n selectedOptions: ReadonlyArray<Option>;\n }\n\n export interface Ref {\n /**\n * Sets focus on the element without opening the dropdown or showing a visual focus indicator.\n */\n focus(): void;\n }\n}\n"]}
1
+ {"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../src/multiselect/interfaces.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { ReactNode } from 'react';\n\nimport { OptionsLoadItemsDetail } from '../dropdown/interfaces';\nimport { BaseSelectProps, SelectProps } from '../select/interfaces';\nimport { NonCancelableEventHandler } from '../types/events';\nimport { OptionDefinition, OptionGroup as OptionGroupDefinition } from '../types/option';\n\nexport interface MultiselectProps extends BaseSelectProps {\n /**\n * Specifies the currently selected options.\n * Provide an empty array to clear the selection.\n */\n selectedOptions: ReadonlyArray<MultiselectProps.Option>;\n\n /**\n * Specifies an inline label that appears next to the multiselect trigger.\n */\n inlineLabelText?: string;\n /**\n * Determines whether the dropdown list stays open after the user selects an item.\n */\n keepOpen?: boolean;\n /**\n * Specifies the maximum number of displayed tokens. If the property isn't set, all of the tokens are displayed.\n */\n tokenLimit?: number;\n /**\n * Hides the tokens displayed underneath the component.\n * Only use this if the selected options are displayed elsewhere on the page.\n */\n hideTokens?: boolean;\n /**\n * Shows tokens inside the trigger instead of below it.\n */\n inlineTokens?: boolean;\n /**\n * Specifies an `aria-label` for the token deselection button.\n * @i18n\n */\n deselectAriaLabel?: MultiselectProps.DeselectAriaLabelFunction;\n /**\n * An object containing all the localized strings required by the component.\n *\n * * `selectAllText` (string) - Specifies the text to be displayed next to the checkbox that selects or deselects all options.\n * * `tokenLimitShowFewer` (string) - Specifies the text to be displayed in the \"Show fewer\" button for the token group control.\n * * `tokenLimitShowMore` (string) - Specifies the text to be displayed in the \"Show more\" button for the token group control. This string should not contain the number of hidden tokens\n * because this will be added by the component automatically.\n * @i18n\n */\n i18nStrings?: MultiselectProps.I18nStrings;\n onLoadItems?: NonCancelableEventHandler<MultiselectProps.LoadItemsDetail>;\n /**\n * Called when the user selects or deselects an option.\n * The event `detail` contains the current `selectedOptions`.\n */\n onChange?: NonCancelableEventHandler<MultiselectProps.MultiselectChangeDetail>;\n\n /**\n * Automatically focuses the trigger when component is mounted.\n */\n autoFocus?: boolean;\n\n /**\n * Adds an aria-label to the \"Show fewer\" button for the token group control.\n * Use to assign unique labels when there are multiple token groups with the same `tokenLimitShowFewer` label on one page.\n */\n tokenLimitShowFewerAriaLabel?: string;\n /**\n * Adds an aria-label to the \"Show more\" button for the token group control.\n * Use to assign unique labels when there are multiple token groups with the same `tokenLimitShowMore` label on one page.\n */\n tokenLimitShowMoreAriaLabel?: string;\n /**\n * Enables users to select and deselect all options with a special extra checkbox which is displayed at the start of the dropdown.\n */\n enableSelectAll?: boolean;\n /**\n * Specifies a render function to render custom options in the dropdown menu.\n */\n renderOption?: MultiselectProps.MultiselectOptionItemRenderer;\n}\n\nexport namespace MultiselectProps {\n export type Option = OptionDefinition;\n export type OptionGroup = OptionGroupDefinition;\n export type Options = ReadonlyArray<Option | OptionGroup>;\n\n /**\n * The argument passed to the dropdown render functions (`renderDropdownHeader`\n * and `renderDropdownFooter`).\n */\n export type DropdownContentProps = SelectProps.DropdownContentProps;\n export type DropdownRole = SelectProps.DropdownRole;\n export type DropdownContentRenderer = SelectProps.DropdownContentRenderer;\n /* eslint-disable-next-line @typescript-eslint/no-empty-object-type --\n * Required to create a distinct named type for the documenter.\n **/\n export interface LoadItemsDetail extends OptionsLoadItemsDetail {}\n export interface MultiselectOptionItem {\n type: 'item';\n index: number;\n option: Option;\n disabled: boolean;\n highlighted: boolean;\n selected: boolean;\n parent: MultiselectOptionGroupItem | null;\n }\n export interface MultiselectOptionGroupItem {\n type: 'group';\n index: number;\n option: OptionGroup;\n indeterminate: boolean;\n disabled: boolean;\n highlighted: boolean;\n selected: boolean;\n }\n export interface MultiselectSelectAllItem {\n type: 'select-all';\n option: Option;\n indeterminate: boolean;\n highlighted: boolean;\n selected: boolean;\n }\n export type MultiselectItem = MultiselectOptionItem | MultiselectOptionGroupItem | MultiselectSelectAllItem;\n export type MultiselectOptionItemRenderer = (props: {\n item: MultiselectItem;\n filterText?: string;\n }) => ReactNode | null;\n\n export type DeselectAriaLabelFunction = (option: Option) => string;\n export type TriggerVariant = 'placeholder' | 'tokens';\n\n export interface I18nStrings {\n selectAllText?: string;\n tokenLimitShowFewer?: string;\n tokenLimitShowMore?: string;\n }\n\n export interface MultiselectChangeDetail {\n selectedOptions: ReadonlyArray<Option>;\n }\n\n export interface Ref {\n /**\n * Sets focus on the element without opening the dropdown or showing a visual focus indicator.\n */\n focus(): void;\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"internal.d.ts","sourceRoot":"","sources":["../../../src/multiselect/internal.tsx"],"names":[],"mappings":"AAEA,OAAO,KAA2B,MAAM,OAAO,CAAC;AAYhD,OAAO,EAAE,0BAA0B,EAAE,MAAM,+CAA+C,CAAC;AAU3F,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAahD,QAAA,MAAM,mBAAmB;;;;;;;2EAoMxB,CAAC;AAEF,eAAe,mBAAmB,CAAC"}
1
+ {"version":3,"file":"internal.d.ts","sourceRoot":"","sources":["../../../src/multiselect/internal.tsx"],"names":[],"mappings":"AAEA,OAAO,KAA2B,MAAM,OAAO,CAAC;AAYhD,OAAO,EAAE,0BAA0B,EAAE,MAAM,+CAA+C,CAAC;AAW3F,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAahD,QAAA,MAAM,mBAAmB;;;;;;;2EA6NxB,CAAC;AAEF,eAAe,mBAAmB,CAAC"}
@@ -16,10 +16,11 @@ import Filter from '../select/parts/filter';
16
16
  import PlainList from '../select/parts/plain-list';
17
17
  import Trigger from '../select/parts/trigger';
18
18
  import VirtualList from '../select/parts/virtual-list';
19
+ import { composeDropdownContent } from '../select/utils/dropdown-customization';
19
20
  import InternalTokenGroup from '../token-group/internal';
20
21
  import { useMultiselect } from './use-multiselect';
21
22
  import styles from './styles.css.js';
22
- const InternalMultiselect = React.forwardRef(({ options, filteringType, filteringPlaceholder, filteringAriaLabel, filteringClearAriaLabel, ariaRequired, placeholder, disabled, readOnly, ariaLabel, inlineLabelText, selectedOptions, deselectAriaLabel, tokenLimit, i18nStrings, virtualScroll, inlineTokens = false, hideTokens, expandToViewport, tokenLimitShowFewerAriaLabel, tokenLimitShowMoreAriaLabel, __internalRootRef, autoFocus, enableSelectAll, renderOption, ...restProps }, externalRef) => {
23
+ const InternalMultiselect = React.forwardRef(({ options, filteringType, filteringPlaceholder, filteringAriaLabel, filteringClearAriaLabel, ariaRequired, placeholder, disabled, readOnly, ariaLabel, inlineLabelText, selectedOptions, deselectAriaLabel, tokenLimit, i18nStrings, virtualScroll, inlineTokens = false, hideTokens, expandToViewport, tokenLimitShowFewerAriaLabel, tokenLimitShowMoreAriaLabel, __internalRootRef, autoFocus, enableSelectAll, renderOption, renderDropdownHeader, renderDropdownFooter, dropdownRole, dropdownAriaDescribedby, ...restProps }, externalRef) => {
23
24
  var _a;
24
25
  const baseProps = getBaseProps(restProps);
25
26
  const formFieldContext = useFormFieldContext(restProps);
@@ -43,8 +44,16 @@ const InternalMultiselect = React.forwardRef(({ options, filteringType, filterin
43
44
  externalRef,
44
45
  enableSelectAll,
45
46
  i18nStrings,
47
+ dropdownRole,
48
+ dropdownAriaDescribedby,
46
49
  ...restProps,
47
50
  });
51
+ const dropdownContentProps = {
52
+ filterText: filteringValue,
53
+ closeDropdown: multiselectProps.closeDropdown,
54
+ };
55
+ const customDropdownHeader = renderDropdownHeader === null || renderDropdownHeader === void 0 ? void 0 : renderDropdownHeader(dropdownContentProps);
56
+ const customDropdownFooter = renderDropdownFooter === null || renderDropdownFooter === void 0 ? void 0 : renderDropdownFooter(dropdownContentProps);
48
57
  const filter = (React.createElement(Filter, { clearAriaLabel: filteringClearAriaLabel, filteringType: filteringType, placeholder: filteringPlaceholder, ariaLabel: filteringAriaLabel, ariaRequired: ariaRequired, value: filteringValue, ...multiselectProps.getFilterProps() }));
49
58
  const triggerRef = useRef(null);
50
59
  const [triggerWidth, setTriggerWidth] = useState(null);
@@ -72,10 +81,21 @@ const InternalMultiselect = React.forwardRef(({ options, filteringType, filterin
72
81
  const dropdownStatus = multiselectProps.dropdownStatus;
73
82
  const dropdownProps = multiselectProps.getDropdownProps();
74
83
  const hasFilteredOptions = multiselectProps.filteredOptions.length > 0;
84
+ const statusFooter = dropdownStatus.isSticky ? (React.createElement(DropdownFooter, { content: multiselectProps.isOpen ? dropdownStatus.content : null, id: footerId })) : null;
85
+ const { header: dropdownHeader, footer: dropdownFooter } = composeDropdownContent({
86
+ filter,
87
+ customDropdownHeader,
88
+ customDropdownFooter,
89
+ statusFooter,
90
+ dropdownHeaderClass: styles['dropdown-header'],
91
+ dropdownFooterClass: styles['dropdown-footer'],
92
+ });
75
93
  const hasOptions = useRef(options.length > 0);
76
94
  hasOptions.current = hasOptions.current || options.length > 0;
77
95
  return (React.createElement("div", { ...baseProps, ref: __internalRootRef, className: clsx(styles.root, baseProps.className), ...multiselectProps.getWrapperProps() },
78
- React.createElement(Dropdown, { ...dropdownProps, ariaLabelledby: dropdownProps.ariaRole ? joinStrings(ariaLabelId, controlId) : undefined, ariaDescribedby: dropdownProps.ariaRole ? (dropdownStatus.content ? footerId : undefined) : undefined, open: multiselectProps.isOpen, minWidth: getDropdownMinWidth({ expandToViewport, triggerWidth }), maxWidth: getBreakpointValue('xxs'), trigger: trigger, header: filter, footer: dropdownStatus.isSticky ? (React.createElement(DropdownFooter, { content: multiselectProps.isOpen ? dropdownStatus.content : null, id: footerId })) : null, expandToViewport: expandToViewport,
96
+ React.createElement(Dropdown, { ...dropdownProps, ariaLabelledby: dropdownProps.ariaRole ? joinStrings(ariaLabelId, controlId) : undefined, ariaDescribedby: dropdownProps.ariaRole
97
+ ? joinStrings(dropdownStatus.content ? footerId : undefined, dropdownAriaDescribedby)
98
+ : undefined, open: multiselectProps.isOpen, minWidth: getDropdownMinWidth({ expandToViewport, triggerWidth }), maxWidth: getBreakpointValue('xxs'), trigger: trigger, header: dropdownHeader, footer: dropdownFooter, expandToViewport: expandToViewport,
79
99
  // Forces dropdown position recalculation when new options are loaded
80
100
  contentKey: hasOptions.current.toString(), content: React.createElement(ListComponent, { renderOption: renderOption, listBottom: !dropdownStatus.isSticky ? (React.createElement(DropdownFooter, { content: multiselectProps.isOpen ? dropdownStatus.content : null, id: footerId })) : null, menuProps: { ...multiselectProps.getMenuProps(), ariaRequired }, getOptionProps: multiselectProps.getOptionProps, filteredOptions: multiselectProps.filteredOptions, filteringValue: filteringValue, ref: multiselectProps.scrollToIndex, hasDropdownStatus: dropdownStatus.content !== null, checkboxes: true, useInteractiveGroups: true, screenReaderContent: multiselectProps.announcement, highlightType: multiselectProps.highlightType, firstOptionSticky: hasFilteredOptions && enableSelectAll, isMultiSelect: true }) }),
81
101
  showTokens && (React.createElement(InternalTokenGroup, { ...multiselectProps.getTokenProps(), className: styles.tokens, alignment: "horizontal", limit: tokenLimit, items: tokens, i18nStrings: tokenGroupI18nStrings, limitShowMoreAriaLabel: tokenLimitShowMoreAriaLabel, limitShowFewerAriaLabel: tokenLimitShowFewerAriaLabel, disableOuterPadding: true, readOnly: readOnly, isItemReadOnly: item => item._readOnly })),
@@ -1 +1 @@
1
- {"version":3,"file":"internal.js","sourceRoot":"","sources":["../../../src/multiselect/internal.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAChD,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,iBAAiB,EAAE,WAAW,EAAE,MAAM,+CAA+C,CAAC;AAE/F,OAAO,QAAQ,MAAM,sBAAsB,CAAC;AAC5C,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,cAAc,MAAM,iDAAiD,CAAC;AAC7E,OAAO,gBAAgB,MAAM,0CAA0C,CAAC;AACxE,OAAO,EAAE,mBAAmB,EAAE,MAAM,wCAAwC,CAAC;AAG7E,OAAO,EAAE,mBAAmB,EAAE,MAAM,0CAA0C,CAAC;AAC/E,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AACxD,OAAO,MAAM,MAAM,wBAAwB,CAAC;AAC5C,OAAO,SAAS,MAAM,4BAA4B,CAAC;AACnD,OAAO,OAAO,MAAM,yBAAyB,CAAC;AAC9C,OAAO,WAAW,MAAM,8BAA8B,CAAC;AAEvD,OAAO,kBAAkB,MAAM,yBAAyB,CAAC;AAEzD,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC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AE,QAAQ,GAAI,CACnG,CAAC,CAAC,CAAC,IAAI,EAEV,SAAS,EAAE,EAAE,GAAG,gBAAgB,CAAC,YAAY,EAAE,EAAE,YAAY,EAAE,EAC/D,cAAc,EAAE,gBAAgB,CAAC,cAAc,EAC/C,eAAe,EAAE,gBAAgB,CAAC,eAAe,EACjD,cAAc,EAAE,cAAc,EAC9B,GAAG,EAAE,gBAAgB,CAAC,aAAa,EACnC,iBAAiB,EAAE,cAAc,CAAC,OAAO,KAAK,IAAI,EAClD,UAAU,EAAE,IAAI,EAChB,oBAAoB,EAAE,IAAI,EAC1B,mBAAmB,EAAE,gBAAgB,CAAC,YAAY,EAClD,aAAa,EAAE,gBAAgB,CAAC,aAAa,EAC7C,iBAAiB,EAAE,kBAAkB,IAAI,eAAe,EACxD,aAAa,EAAE,IAAI,GACnB,GAEJ;QAED,UAAU,IAAI,CACb,oBAAC,kBAAkB,OACb,gBAAgB,CAAC,aAAa,EAAE,EACpC,SAAS,EAAE,MAAM,CAAC,MAAM,EACxB,SAAS,EAAC,YAAY,EACtB,KAAK,EAAE,UAAU,EACjB,KAAK,EAAE,MAAM,EACb,WAAW,EAAE,qBAAqB,EAClC,sBAAsB,EAAE,2BAA2B,EACnD,uBAAuB,EAAE,4BAA4B,EACrD,mBAAmB,EAAE,IAAI,EACzB,QAAQ,EAAE,QAAQ,EAClB,cAAc,EAAE,IAAI,CAAC,EAAE,CAAE,IAAsB,CAAC,SAAS,GACzD,CACH;QAED,oBAAC,gBAAgB,IAAC,EAAE,EAAE,WAAW,IAAG,SAAS,IAAI,eAAe,CAAoB,CAChF,CACP,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,mBAAmB,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useRef, useState } from 'react';\nimport clsx from 'clsx';\n\nimport { useResizeObserver, useUniqueId } from '@cloudscape-design/component-toolkit/internal';\n\nimport Dropdown from '../dropdown/internal';\nimport { useInternalI18n } from '../i18n/context';\nimport { getBaseProps } from '../internal/base-component';\nimport { getBreakpointValue } from '../internal/breakpoints';\nimport DropdownFooter from '../internal/components/dropdown-footer/index.js';\nimport ScreenreaderOnly from '../internal/components/screenreader-only';\nimport { useFormFieldContext } from '../internal/context/form-field-context';\nimport { InternalBaseComponentProps } from '../internal/hooks/use-base-component/index.js';\nimport { SomeRequired } from '../internal/types';\nimport { getDropdownMinWidth } from '../internal/utils/get-dropdown-min-width';\nimport { joinStrings } from '../internal/utils/strings';\nimport Filter from '../select/parts/filter';\nimport PlainList from '../select/parts/plain-list';\nimport Trigger from '../select/parts/trigger';\nimport VirtualList from '../select/parts/virtual-list';\nimport { TokenGroupProps } from '../token-group/interfaces';\nimport InternalTokenGroup from '../token-group/internal';\nimport { MultiselectProps } from './interfaces';\nimport { useMultiselect } from './use-multiselect';\n\nimport styles from './styles.css.js';\n\ntype InternalMultiselectProps = SomeRequired<\n MultiselectProps,\n 'options' | 'selectedOptions' | 'filteringType' | 'statusType' | 'keepOpen' | 'hideTokens'\n> &\n InternalBaseComponentProps;\n\ntype ExtendedToken = TokenGroupProps.Item & { _readOnly: boolean };\n\nconst InternalMultiselect = React.forwardRef(\n (\n {\n options,\n filteringType,\n filteringPlaceholder,\n filteringAriaLabel,\n filteringClearAriaLabel,\n ariaRequired,\n placeholder,\n disabled,\n readOnly,\n ariaLabel,\n inlineLabelText,\n selectedOptions,\n deselectAriaLabel,\n tokenLimit,\n i18nStrings,\n virtualScroll,\n inlineTokens = false,\n hideTokens,\n expandToViewport,\n tokenLimitShowFewerAriaLabel,\n tokenLimitShowMoreAriaLabel,\n __internalRootRef,\n autoFocus,\n enableSelectAll,\n renderOption,\n ...restProps\n }: InternalMultiselectProps,\n externalRef: React.Ref<MultiselectProps.Ref>\n ) => {\n const baseProps = getBaseProps(restProps);\n const formFieldContext = useFormFieldContext(restProps);\n const i18n = useInternalI18n('multiselect');\n\n const selfControlId = useUniqueId('trigger');\n const controlId = formFieldContext.controlId ?? selfControlId;\n const ariaLabelId = useUniqueId('multiselect-ariaLabel-');\n const footerId = useUniqueId('multiselect-footer-');\n\n const [filteringValue, setFilteringValue] = useState('');\n const multiselectProps = useMultiselect({\n options,\n selectedOptions,\n filteringType,\n disabled,\n deselectAriaLabel,\n controlId,\n ariaLabelId,\n footerId,\n filteringValue,\n setFilteringValue,\n externalRef,\n enableSelectAll,\n i18nStrings,\n ...restProps,\n });\n\n const filter = (\n <Filter\n clearAriaLabel={filteringClearAriaLabel}\n filteringType={filteringType}\n placeholder={filteringPlaceholder}\n ariaLabel={filteringAriaLabel}\n ariaRequired={ariaRequired}\n value={filteringValue}\n {...multiselectProps.getFilterProps()}\n />\n );\n\n const triggerRef = useRef<HTMLButtonElement>(null);\n const [triggerWidth, setTriggerWidth] = useState<number | null>(null);\n useResizeObserver(\n () => triggerRef.current,\n entry => entry.borderBoxWidth > 0 && setTriggerWidth(entry.borderBoxWidth)\n );\n\n const trigger = (\n <Trigger\n ref={triggerRef}\n placeholder={placeholder}\n disabled={disabled}\n readOnly={readOnly}\n triggerProps={multiselectProps.getTriggerProps(disabled, autoFocus)}\n selectedOption={null}\n selectedOptions={selectedOptions}\n triggerVariant={inlineTokens ? 'tokens' : 'placeholder'}\n isOpen={multiselectProps.isOpen}\n inlineLabelText={inlineLabelText}\n {...formFieldContext}\n controlId={controlId}\n ariaLabelledby={joinStrings(formFieldContext.ariaLabelledby, ariaLabelId)}\n />\n );\n\n const tokens: Array<ExtendedToken> = selectedOptions.map(option => ({\n label: option.label,\n disabled,\n labelTag: option.labelTag,\n description: option.description,\n iconAlt: option.iconAlt,\n iconName: option.iconName,\n iconUrl: option.iconUrl,\n iconSvg: option.iconSvg,\n tags: option.tags,\n dismissLabel: i18n('deselectAriaLabel', deselectAriaLabel?.(option), format =>\n format({ option__label: option.label ?? '' })\n ),\n _readOnly: !!option.disabled,\n }));\n\n const ListComponent = virtualScroll ? VirtualList : PlainList;\n\n const showTokens = !hideTokens && !inlineTokens && tokens.length > 0;\n\n const tokenGroupI18nStrings: TokenGroupProps.I18nStrings = {\n limitShowFewer: i18nStrings?.tokenLimitShowFewer,\n limitShowMore: i18nStrings?.tokenLimitShowMore,\n };\n\n const dropdownStatus = multiselectProps.dropdownStatus;\n const dropdownProps = multiselectProps.getDropdownProps();\n const hasFilteredOptions = multiselectProps.filteredOptions.length > 0;\n\n const hasOptions = useRef(options.length > 0);\n hasOptions.current = hasOptions.current || options.length > 0;\n\n return (\n <div\n {...baseProps}\n ref={__internalRootRef}\n className={clsx(styles.root, baseProps.className)}\n {...multiselectProps.getWrapperProps()}\n >\n <Dropdown\n {...dropdownProps}\n ariaLabelledby={dropdownProps.ariaRole ? joinStrings(ariaLabelId, controlId) : undefined}\n ariaDescribedby={dropdownProps.ariaRole ? (dropdownStatus.content ? footerId : undefined) : undefined}\n open={multiselectProps.isOpen}\n minWidth={getDropdownMinWidth({ expandToViewport, triggerWidth })}\n maxWidth={getBreakpointValue('xxs')} // AWSUI-19898\n trigger={trigger}\n header={filter}\n footer={\n dropdownStatus.isSticky ? (\n <DropdownFooter content={multiselectProps.isOpen ? dropdownStatus.content : null} id={footerId} />\n ) : null\n }\n expandToViewport={expandToViewport}\n // Forces dropdown position recalculation when new options are loaded\n contentKey={hasOptions.current.toString()}\n content={\n <ListComponent\n renderOption={renderOption}\n listBottom={\n !dropdownStatus.isSticky ? (\n <DropdownFooter content={multiselectProps.isOpen ? dropdownStatus.content : null} id={footerId} />\n ) : null\n }\n menuProps={{ ...multiselectProps.getMenuProps(), ariaRequired }}\n getOptionProps={multiselectProps.getOptionProps}\n filteredOptions={multiselectProps.filteredOptions}\n filteringValue={filteringValue}\n ref={multiselectProps.scrollToIndex}\n hasDropdownStatus={dropdownStatus.content !== null}\n checkboxes={true}\n useInteractiveGroups={true}\n screenReaderContent={multiselectProps.announcement}\n highlightType={multiselectProps.highlightType}\n firstOptionSticky={hasFilteredOptions && enableSelectAll}\n isMultiSelect={true}\n />\n }\n />\n\n {showTokens && (\n <InternalTokenGroup\n {...multiselectProps.getTokenProps()}\n className={styles.tokens}\n alignment=\"horizontal\"\n limit={tokenLimit}\n items={tokens}\n i18nStrings={tokenGroupI18nStrings}\n limitShowMoreAriaLabel={tokenLimitShowMoreAriaLabel}\n limitShowFewerAriaLabel={tokenLimitShowFewerAriaLabel}\n disableOuterPadding={true}\n readOnly={readOnly}\n isItemReadOnly={item => (item as ExtendedToken)._readOnly}\n />\n )}\n\n <ScreenreaderOnly id={ariaLabelId}>{ariaLabel || inlineLabelText}</ScreenreaderOnly>\n </div>\n );\n }\n);\n\nexport default InternalMultiselect;\n"]}
1
+ {"version":3,"file":"internal.js","sourceRoot":"","sources":["../../../src/multiselect/internal.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAChD,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,iBAAiB,EAAE,WAAW,EAAE,MAAM,+CAA+C,CAAC;AAE/F,OAAO,QAAQ,MAAM,sBAAsB,CAAC;AAC5C,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,cAAc,MAAM,iDAAiD,CAAC;AAC7E,OAAO,gBAAgB,MAAM,0CAA0C,CAAC;AACxE,OAAO,EAAE,mBAAmB,EAAE,MAAM,wCAAwC,CAAC;AAG7E,OAAO,EAAE,mBAAmB,EAAE,MAAM,0CAA0C,CAAC;AAC/E,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AACxD,OAAO,MAAM,MAAM,wBAAwB,CAAC;AAC5C,OAAO,SAAS,MAAM,4BAA4B,CAAC;AACnD,OAAO,OAAO,MAAM,yBAAyB,CAA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AI,EAC1B,mBAAmB,EAAE,gBAAgB,CAAC,YAAY,EAClD,aAAa,EAAE,gBAAgB,CAAC,aAAa,EAC7C,iBAAiB,EAAE,kBAAkB,IAAI,eAAe,EACxD,aAAa,EAAE,IAAI,GACnB,GAEJ;QAED,UAAU,IAAI,CACb,oBAAC,kBAAkB,OACb,gBAAgB,CAAC,aAAa,EAAE,EACpC,SAAS,EAAE,MAAM,CAAC,MAAM,EACxB,SAAS,EAAC,YAAY,EACtB,KAAK,EAAE,UAAU,EACjB,KAAK,EAAE,MAAM,EACb,WAAW,EAAE,qBAAqB,EAClC,sBAAsB,EAAE,2BAA2B,EACnD,uBAAuB,EAAE,4BAA4B,EACrD,mBAAmB,EAAE,IAAI,EACzB,QAAQ,EAAE,QAAQ,EAClB,cAAc,EAAE,IAAI,CAAC,EAAE,CAAE,IAAsB,CAAC,SAAS,GACzD,CACH;QAED,oBAAC,gBAAgB,IAAC,EAAE,EAAE,WAAW,IAAG,SAAS,IAAI,eAAe,CAAoB,CAChF,CACP,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,mBAAmB,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useRef, useState } from 'react';\nimport clsx from 'clsx';\n\nimport { useResizeObserver, useUniqueId } from '@cloudscape-design/component-toolkit/internal';\n\nimport Dropdown from '../dropdown/internal';\nimport { useInternalI18n } from '../i18n/context';\nimport { getBaseProps } from '../internal/base-component';\nimport { getBreakpointValue } from '../internal/breakpoints';\nimport DropdownFooter from '../internal/components/dropdown-footer/index.js';\nimport ScreenreaderOnly from '../internal/components/screenreader-only';\nimport { useFormFieldContext } from '../internal/context/form-field-context';\nimport { InternalBaseComponentProps } from '../internal/hooks/use-base-component/index.js';\nimport { SomeRequired } from '../internal/types';\nimport { getDropdownMinWidth } from '../internal/utils/get-dropdown-min-width';\nimport { joinStrings } from '../internal/utils/strings';\nimport Filter from '../select/parts/filter';\nimport PlainList from '../select/parts/plain-list';\nimport Trigger from '../select/parts/trigger';\nimport VirtualList from '../select/parts/virtual-list';\nimport { composeDropdownContent } from '../select/utils/dropdown-customization';\nimport { TokenGroupProps } from '../token-group/interfaces';\nimport InternalTokenGroup from '../token-group/internal';\nimport { MultiselectProps } from './interfaces';\nimport { useMultiselect } from './use-multiselect';\n\nimport styles from './styles.css.js';\n\ntype InternalMultiselectProps = SomeRequired<\n MultiselectProps,\n 'options' | 'selectedOptions' | 'filteringType' | 'statusType' | 'keepOpen' | 'hideTokens'\n> &\n InternalBaseComponentProps;\n\ntype ExtendedToken = TokenGroupProps.Item & { _readOnly: boolean };\n\nconst InternalMultiselect = React.forwardRef(\n (\n {\n options,\n filteringType,\n filteringPlaceholder,\n filteringAriaLabel,\n filteringClearAriaLabel,\n ariaRequired,\n placeholder,\n disabled,\n readOnly,\n ariaLabel,\n inlineLabelText,\n selectedOptions,\n deselectAriaLabel,\n tokenLimit,\n i18nStrings,\n virtualScroll,\n inlineTokens = false,\n hideTokens,\n expandToViewport,\n tokenLimitShowFewerAriaLabel,\n tokenLimitShowMoreAriaLabel,\n __internalRootRef,\n autoFocus,\n enableSelectAll,\n renderOption,\n renderDropdownHeader,\n renderDropdownFooter,\n dropdownRole,\n dropdownAriaDescribedby,\n ...restProps\n }: InternalMultiselectProps,\n externalRef: React.Ref<MultiselectProps.Ref>\n ) => {\n const baseProps = getBaseProps(restProps);\n const formFieldContext = useFormFieldContext(restProps);\n const i18n = useInternalI18n('multiselect');\n\n const selfControlId = useUniqueId('trigger');\n const controlId = formFieldContext.controlId ?? selfControlId;\n const ariaLabelId = useUniqueId('multiselect-ariaLabel-');\n const footerId = useUniqueId('multiselect-footer-');\n\n const [filteringValue, setFilteringValue] = useState('');\n const multiselectProps = useMultiselect({\n options,\n selectedOptions,\n filteringType,\n disabled,\n deselectAriaLabel,\n controlId,\n ariaLabelId,\n footerId,\n filteringValue,\n setFilteringValue,\n externalRef,\n enableSelectAll,\n i18nStrings,\n dropdownRole,\n dropdownAriaDescribedby,\n ...restProps,\n });\n\n const dropdownContentProps: MultiselectProps.DropdownContentProps = {\n filterText: filteringValue,\n closeDropdown: multiselectProps.closeDropdown,\n };\n const customDropdownHeader = renderDropdownHeader?.(dropdownContentProps);\n const customDropdownFooter = renderDropdownFooter?.(dropdownContentProps);\n\n const filter = (\n <Filter\n clearAriaLabel={filteringClearAriaLabel}\n filteringType={filteringType}\n placeholder={filteringPlaceholder}\n ariaLabel={filteringAriaLabel}\n ariaRequired={ariaRequired}\n value={filteringValue}\n {...multiselectProps.getFilterProps()}\n />\n );\n\n const triggerRef = useRef<HTMLButtonElement>(null);\n const [triggerWidth, setTriggerWidth] = useState<number | null>(null);\n useResizeObserver(\n () => triggerRef.current,\n entry => entry.borderBoxWidth > 0 && setTriggerWidth(entry.borderBoxWidth)\n );\n\n const trigger = (\n <Trigger\n ref={triggerRef}\n placeholder={placeholder}\n disabled={disabled}\n readOnly={readOnly}\n triggerProps={multiselectProps.getTriggerProps(disabled, autoFocus)}\n selectedOption={null}\n selectedOptions={selectedOptions}\n triggerVariant={inlineTokens ? 'tokens' : 'placeholder'}\n isOpen={multiselectProps.isOpen}\n inlineLabelText={inlineLabelText}\n {...formFieldContext}\n controlId={controlId}\n ariaLabelledby={joinStrings(formFieldContext.ariaLabelledby, ariaLabelId)}\n />\n );\n\n const tokens: Array<ExtendedToken> = selectedOptions.map(option => ({\n label: option.label,\n disabled,\n labelTag: option.labelTag,\n description: option.description,\n iconAlt: option.iconAlt,\n iconName: option.iconName,\n iconUrl: option.iconUrl,\n iconSvg: option.iconSvg,\n tags: option.tags,\n dismissLabel: i18n('deselectAriaLabel', deselectAriaLabel?.(option), format =>\n format({ option__label: option.label ?? '' })\n ),\n _readOnly: !!option.disabled,\n }));\n\n const ListComponent = virtualScroll ? VirtualList : PlainList;\n\n const showTokens = !hideTokens && !inlineTokens && tokens.length > 0;\n\n const tokenGroupI18nStrings: TokenGroupProps.I18nStrings = {\n limitShowFewer: i18nStrings?.tokenLimitShowFewer,\n limitShowMore: i18nStrings?.tokenLimitShowMore,\n };\n\n const dropdownStatus = multiselectProps.dropdownStatus;\n const dropdownProps = multiselectProps.getDropdownProps();\n const hasFilteredOptions = multiselectProps.filteredOptions.length > 0;\n\n const statusFooter = dropdownStatus.isSticky ? (\n <DropdownFooter content={multiselectProps.isOpen ? dropdownStatus.content : null} id={footerId} />\n ) : null;\n const { header: dropdownHeader, footer: dropdownFooter } = composeDropdownContent({\n filter,\n customDropdownHeader,\n customDropdownFooter,\n statusFooter,\n dropdownHeaderClass: styles['dropdown-header'],\n dropdownFooterClass: styles['dropdown-footer'],\n });\n\n const hasOptions = useRef(options.length > 0);\n hasOptions.current = hasOptions.current || options.length > 0;\n\n return (\n <div\n {...baseProps}\n ref={__internalRootRef}\n className={clsx(styles.root, baseProps.className)}\n {...multiselectProps.getWrapperProps()}\n >\n <Dropdown\n {...dropdownProps}\n ariaLabelledby={dropdownProps.ariaRole ? joinStrings(ariaLabelId, controlId) : undefined}\n ariaDescribedby={\n dropdownProps.ariaRole\n ? joinStrings(dropdownStatus.content ? footerId : undefined, dropdownAriaDescribedby)\n : undefined\n }\n open={multiselectProps.isOpen}\n minWidth={getDropdownMinWidth({ expandToViewport, triggerWidth })}\n maxWidth={getBreakpointValue('xxs')} // AWSUI-19898\n trigger={trigger}\n header={dropdownHeader}\n footer={dropdownFooter}\n expandToViewport={expandToViewport}\n // Forces dropdown position recalculation when new options are loaded\n contentKey={hasOptions.current.toString()}\n content={\n <ListComponent\n renderOption={renderOption}\n listBottom={\n !dropdownStatus.isSticky ? (\n <DropdownFooter content={multiselectProps.isOpen ? dropdownStatus.content : null} id={footerId} />\n ) : null\n }\n menuProps={{ ...multiselectProps.getMenuProps(), ariaRequired }}\n getOptionProps={multiselectProps.getOptionProps}\n filteredOptions={multiselectProps.filteredOptions}\n filteringValue={filteringValue}\n ref={multiselectProps.scrollToIndex}\n hasDropdownStatus={dropdownStatus.content !== null}\n checkboxes={true}\n useInteractiveGroups={true}\n screenReaderContent={multiselectProps.announcement}\n highlightType={multiselectProps.highlightType}\n firstOptionSticky={hasFilteredOptions && enableSelectAll}\n isMultiSelect={true}\n />\n }\n />\n\n {showTokens && (\n <InternalTokenGroup\n {...multiselectProps.getTokenProps()}\n className={styles.tokens}\n alignment=\"horizontal\"\n limit={tokenLimit}\n items={tokens}\n i18nStrings={tokenGroupI18nStrings}\n limitShowMoreAriaLabel={tokenLimitShowMoreAriaLabel}\n limitShowFewerAriaLabel={tokenLimitShowFewerAriaLabel}\n disableOuterPadding={true}\n readOnly={readOnly}\n isItemReadOnly={item => (item as ExtendedToken)._readOnly}\n />\n )}\n\n <ScreenreaderOnly id={ariaLabelId}>{ariaLabel || inlineLabelText}</ScreenreaderOnly>\n </div>\n );\n }\n);\n\nexport default InternalMultiselect;\n"]}
@@ -1,8 +1,10 @@
1
1
 
2
2
  import './styles.scoped.css';
3
3
  export default {
4
- "root": "awsui_root_f8g6q_8yhj2_145",
5
- "embedded": "awsui_embedded_f8g6q_8yhj2_177",
6
- "tokens": "awsui_tokens_f8g6q_8yhj2_210"
4
+ "root": "awsui_root_f8g6q_ccpc2_145",
5
+ "embedded": "awsui_embedded_f8g6q_ccpc2_177",
6
+ "tokens": "awsui_tokens_f8g6q_ccpc2_210",
7
+ "dropdown-header": "awsui_dropdown-header_f8g6q_ccpc2_214",
8
+ "dropdown-footer": "awsui_dropdown-footer_f8g6q_ccpc2_220"
7
9
  };
8
10
 
@@ -142,7 +142,7 @@
142
142
  */
143
143
  /* Style used for links in slots/components that are text heavy, to help links stand out among
144
144
  surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F73#description */
145
- .awsui_root_f8g6q_8yhj2_145:not(#\9) {
145
+ .awsui_root_f8g6q_ccpc2_145:not(#\9) {
146
146
  border-collapse: separate;
147
147
  border-spacing: 0;
148
148
  box-sizing: border-box;
@@ -174,7 +174,7 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
174
174
  -moz-osx-font-smoothing: auto;
175
175
  }
176
176
 
177
- .awsui_embedded_f8g6q_8yhj2_177:not(#\9) {
177
+ .awsui_embedded_f8g6q_ccpc2_177:not(#\9) {
178
178
  border-collapse: separate;
179
179
  border-spacing: 0;
180
180
  box-sizing: border-box;
@@ -207,6 +207,16 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
207
207
  display: contents;
208
208
  }
209
209
 
210
- .awsui_tokens_f8g6q_8yhj2_210:not(#\9) {
210
+ .awsui_tokens_f8g6q_ccpc2_210:not(#\9) {
211
211
  margin-block-start: var(--space-scaled-xs-sppte9, 8px);
212
+ }
213
+
214
+ .awsui_dropdown-header_f8g6q_ccpc2_214:not(#\9) {
215
+ inline-size: 100%;
216
+ position: relative;
217
+ z-index: 4;
218
+ }
219
+
220
+ .awsui_dropdown-footer_f8g6q_ccpc2_220:not(#\9) {
221
+ inline-size: 100%;
212
222
  }
@@ -2,8 +2,10 @@
2
2
  // es-module interop with Babel and Typescript
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
4
  module.exports.default = {
5
- "root": "awsui_root_f8g6q_8yhj2_145",
6
- "embedded": "awsui_embedded_f8g6q_8yhj2_177",
7
- "tokens": "awsui_tokens_f8g6q_8yhj2_210"
5
+ "root": "awsui_root_f8g6q_ccpc2_145",
6
+ "embedded": "awsui_embedded_f8g6q_ccpc2_177",
7
+ "tokens": "awsui_tokens_f8g6q_ccpc2_210",
8
+ "dropdown-header": "awsui_dropdown-header_f8g6q_ccpc2_214",
9
+ "dropdown-footer": "awsui_dropdown-footer_f8g6q_ccpc2_220"
8
10
  };
9
11
 
@@ -5,7 +5,7 @@ import { SelectListProps } from '../select/parts/plain-list';
5
5
  import { TokenGroupProps } from '../token-group/interfaces';
6
6
  import { DropdownStatusProps } from '../types/dropdown-status';
7
7
  import { MultiselectProps } from './interfaces';
8
- type UseMultiselectOptions = SomeRequired<Pick<MultiselectProps, 'options' | 'selectedOptions' | 'filteringType' | 'filteringResultsText' | 'disabled' | 'noMatch' | 'renderHighlightedAriaLive' | 'deselectAriaLabel' | 'keepOpen' | 'onBlur' | 'onFocus' | 'onLoadItems' | 'onChange' | 'selectedAriaLabel' | 'enableSelectAll' | 'i18nStrings'> & DropdownStatusProps & {
8
+ type UseMultiselectOptions = SomeRequired<Pick<MultiselectProps, 'options' | 'selectedOptions' | 'filteringType' | 'filteringResultsText' | 'disabled' | 'noMatch' | 'renderHighlightedAriaLive' | 'deselectAriaLabel' | 'keepOpen' | 'onBlur' | 'onFocus' | 'onLoadItems' | 'onChange' | 'selectedAriaLabel' | 'enableSelectAll' | 'i18nStrings' | 'dropdownRole' | 'dropdownAriaDescribedby'> & DropdownStatusProps & {
9
9
  controlId?: string;
10
10
  ariaLabelId: string;
11
11
  footerId: string;
@@ -15,7 +15,7 @@ type UseMultiselectOptions = SomeRequired<Pick<MultiselectProps, 'options' | 'se
15
15
  }, 'options' | 'selectedOptions' | 'filteringType' | 'statusType' | 'keepOpen'> & {
16
16
  embedded?: boolean;
17
17
  };
18
- export declare function useMultiselect({ options, filteringType, filteringResultsText, disabled, statusType, empty, loadingText, finishedText, errorText, noMatch, renderHighlightedAriaLive, selectedOptions, deselectAriaLabel, keepOpen, onBlur, onFocus, onLoadItems, onChange, controlId, ariaLabelId, footerId, filteringValue, setFilteringValue, externalRef, embedded, enableSelectAll, i18nStrings, ...restProps }: UseMultiselectOptions): {
18
+ export declare function useMultiselect({ options, filteringType, filteringResultsText, disabled, statusType, empty, loadingText, finishedText, errorText, noMatch, renderHighlightedAriaLive, selectedOptions, deselectAriaLabel, keepOpen, onBlur, onFocus, onLoadItems, onChange, controlId, ariaLabelId, footerId, filteringValue, setFilteringValue, externalRef, embedded, enableSelectAll, i18nStrings, dropdownRole, dropdownAriaDescribedby, ...restProps }: UseMultiselectOptions): {
19
19
  isOpen: boolean;
20
20
  tokens: readonly TokenGroupProps.Item[];
21
21
  announcement: string;
@@ -69,6 +69,7 @@ export declare function useMultiselect({ options, filteringType, filteringResult
69
69
  onKeyDown: (event: React.KeyboardEvent) => void;
70
70
  };
71
71
  highlightedIndex: number;
72
+ closeDropdown: () => void;
72
73
  };
73
74
  export {};
74
75
  //# sourceMappingURL=use-multiselect.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"use-multiselect.d.ts","sourceRoot":"","sources":["../../../src/multiselect/use-multiselect.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAkD,MAAM,OAAO,CAAC;AAMvE,OAAO,EAAE,cAAc,EAAE,MAAM,0CAA0C,CAAC;AAI1E,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAEjD,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAO7D,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAC5D,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAE/D,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAEhD,KAAK,qBAAqB,GAAG,YAAY,CACvC,IAAI,CACF,gBAAgB,EACd,SAAS,GACT,iBAAiB,GACjB,eAAe,GACf,sBAAsB,GACtB,UAAU,GACV,SAAS,GACT,2BAA2B,GAC3B,mBAAmB,GACnB,UAAU,GACV,QAAQ,GACR,SAAS,GACT,aAAa,GACb,UAAU,GACV,mBAAmB,GACnB,iBAAiB,GACjB,aAAa,CAChB,GACC,mBAAmB,GAAG;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;IACjB,cAAc,EAAE,MAAM,CAAC;IACvB,iBAAiB,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAC5C,WAAW,EAAE,KAAK,CAAC,GAAG,CAAC,gBAAgB,CAAC,GAAG,CAAC,CAAC;CAC9C,EACH,SAAS,GAAG,iBAAiB,GAAG,eAAe,GAAG,YAAY,GAAG,UAAU,CAC5E,GAAG;IAAE,QAAQ,CAAC,EAAE,OAAO,CAAA;CAAE,CAAC;AAE3B,wBAAgB,cAAc,CAAC,EAC7B,OAAO,EACP,aAAa,EACb,oBAAoB,EACpB,QAAQ,EACR,UAAU,EACV,KAAK,EACL,WAAW,EACX,YAAY,EACZ,SAAS,EACT,OAAO,EACP,yBAAyB,EACzB,eAAe,EACf,iBAAiB,EACjB,QAAQ,EACR,MAAM,EACN,OAAO,EACP,WAAW,EACX,QAAQ,EACR,SAAS,EACT,WAAW,EACX,QAAQ,EACR,cAAc,EACd,iBAAiB,EACjB,WAAW,EACX,QAAQ,EACR,eAAe,EACf,WAAW,EACX,GAAG,SAAS,EACb,EAAE,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;6BA0Lc,KAAK,CAAC,UAAU;;;;;;;;;;EA0CrD"}
1
+ {"version":3,"file":"use-multiselect.d.ts","sourceRoot":"","sources":["../../../src/multiselect/use-multiselect.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAkD,MAAM,OAAO,CAAC;AAMvE,OAAO,EAAE,cAAc,EAAE,MAAM,0CAA0C,CAAC;AAI1E,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAEjD,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAO7D,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAC5D,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAE/D,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAEhD,KAAK,qBAAqB,GAAG,YAAY,CACvC,IAAI,CACF,gBAAgB,EACd,SAAS,GACT,iBAAiB,GACjB,eAAe,GACf,sBAAsB,GACtB,UAAU,GACV,SAAS,GACT,2BAA2B,GAC3B,mBAAmB,GACnB,UAAU,GACV,QAAQ,GACR,SAAS,GACT,aAAa,GACb,UAAU,GACV,mBAAmB,GACnB,iBAAiB,GACjB,aAAa,GACb,cAAc,GACd,yBAAyB,CAC5B,GACC,mBAAmB,GAAG;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;IACjB,cAAc,EAAE,MAAM,CAAC;IACvB,iBAAiB,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAC5C,WAAW,EAAE,KAAK,CAAC,GAAG,CAAC,gBAAgB,CAAC,GAAG,CAAC,CAAC;CAC9C,EACH,SAAS,GAAG,iBAAiB,GAAG,eAAe,GAAG,YAAY,GAAG,UAAU,CAC5E,GAAG;IAAE,QAAQ,CAAC,EAAE,OAAO,CAAA;CAAE,CAAC;AAE3B,wBAAgB,cAAc,CAAC,EAC7B,OAAO,EACP,aAAa,EACb,oBAAoB,EACpB,QAAQ,EACR,UAAU,EACV,KAAK,EACL,WAAW,EACX,YAAY,EACZ,SAAS,EACT,OAAO,EACP,yBAAyB,EACzB,eAAe,EACf,iBAAiB,EACjB,QAAQ,EACR,MAAM,EACN,OAAO,EACP,WAAW,EACX,QAAQ,EACR,SAAS,EACT,WAAW,EACX,QAAQ,EACR,cAAc,EACd,iBAAiB,EACjB,WAAW,EACX,QAAQ,EACR,eAAe,EACf,WAAW,EACX,YAAY,EACZ,uBAAuB,EACvB,GAAG,SAAS,EACb,EAAE,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;6BA4Lc,KAAK,CAAC,UAAU;;;;;;;;;;;EA2CrD"}
@@ -14,7 +14,7 @@ import { useAnnouncement } from '../select/utils/use-announcement';
14
14
  import { useLoadItems } from '../select/utils/use-load-items';
15
15
  import { useNativeSearch } from '../select/utils/use-native-search';
16
16
  import { useSelect } from '../select/utils/use-select';
17
- export function useMultiselect({ options, filteringType, filteringResultsText, disabled, statusType, empty, loadingText, finishedText, errorText, noMatch, renderHighlightedAriaLive, selectedOptions, deselectAriaLabel, keepOpen, onBlur, onFocus, onLoadItems, onChange, controlId, ariaLabelId, footerId, filteringValue, setFilteringValue, externalRef, embedded, enableSelectAll, i18nStrings, ...restProps }) {
17
+ export function useMultiselect({ options, filteringType, filteringResultsText, disabled, statusType, empty, loadingText, finishedText, errorText, noMatch, renderHighlightedAriaLive, selectedOptions, deselectAriaLabel, keepOpen, onBlur, onFocus, onLoadItems, onChange, controlId, ariaLabelId, footerId, filteringValue, setFilteringValue, externalRef, embedded, enableSelectAll, i18nStrings, dropdownRole, dropdownAriaDescribedby, ...restProps }) {
18
18
  checkOptionValueField('Multiselect', 'options', options);
19
19
  const i18n = useInternalI18n('multiselect');
20
20
  const i18nCommon = useInternalI18n('select');
@@ -81,7 +81,7 @@ export function useMultiselect({ options, filteringType, filteringResultsText, d
81
81
  });
82
82
  }, [selectedOptions, onChange, filteredNonParentOptions]);
83
83
  const scrollToIndex = useRef(null);
84
- const { isOpen, highlightType, highlightedOption, highlightedIndex, getTriggerProps, getDropdownProps, getFilterProps, getMenuProps, getOptionProps, highlightOption, announceSelected, focusActiveRef, } = useSelect({
84
+ const { isOpen, highlightType, highlightedOption, highlightedIndex, getTriggerProps, getDropdownProps, getFilterProps, getMenuProps, getOptionProps, highlightOption, announceSelected, focusActiveRef, closeDropdown, } = useSelect({
85
85
  selectedOptions,
86
86
  updateSelectedOption,
87
87
  options: visibleOptions,
@@ -98,6 +98,7 @@ export function useMultiselect({ options, filteringType, filteringResultsText, d
98
98
  isAllSelected,
99
99
  isSomeSelected,
100
100
  toggleAll,
101
+ dropdownRole,
101
102
  });
102
103
  const wrapperOnKeyDown = useNativeSearch({
103
104
  isEnabled: filteringType === 'none' && isOpen,
@@ -181,7 +182,7 @@ export function useMultiselect({ options, filteringType, filteringResultsText, d
181
182
  ...getMenuProps(),
182
183
  onLoadMore: handleLoadMore,
183
184
  ariaLabelledby: joinStrings(ariaLabelId, controlId),
184
- ariaDescribedby: dropdownStatus.content ? footerId : undefined,
185
+ ariaDescribedby: joinStrings(dropdownStatus.content ? footerId : undefined, dropdownAriaDescribedby),
185
186
  embedded,
186
187
  }),
187
188
  getOptionProps,
@@ -189,6 +190,7 @@ export function useMultiselect({ options, filteringType, filteringResultsText, d
189
190
  getDropdownProps: () => ({ ...getDropdownProps(), onMouseDown: dropdownOnMouseDown }),
190
191
  getWrapperProps: () => ({ onKeyDown: wrapperOnKeyDown }),
191
192
  highlightedIndex,
193
+ closeDropdown,
192
194
  };
193
195
  }
194
196
  //# sourceMappingURL=use-multiselect.js.map