@cloudscape-design/components 3.0.359 → 3.0.360

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 (31) hide show
  1. package/internal/breakpoints.d.ts +1 -0
  2. package/internal/breakpoints.d.ts.map +1 -1
  3. package/internal/breakpoints.js +3 -0
  4. package/internal/breakpoints.js.map +1 -1
  5. package/internal/components/autosuggest-input/index.d.ts.map +1 -1
  6. package/internal/components/autosuggest-input/index.js +1 -1
  7. package/internal/components/autosuggest-input/index.js.map +1 -1
  8. package/internal/components/dropdown/dropdown-fit-handler.d.ts +13 -2
  9. package/internal/components/dropdown/dropdown-fit-handler.d.ts.map +1 -1
  10. package/internal/components/dropdown/dropdown-fit-handler.js +30 -10
  11. package/internal/components/dropdown/dropdown-fit-handler.js.map +1 -1
  12. package/internal/components/dropdown/index.d.ts +1 -1
  13. package/internal/components/dropdown/index.d.ts.map +1 -1
  14. package/internal/components/dropdown/index.js +7 -6
  15. package/internal/components/dropdown/index.js.map +1 -1
  16. package/internal/components/dropdown/interfaces.d.ts +4 -0
  17. package/internal/components/dropdown/interfaces.d.ts.map +1 -1
  18. package/internal/components/dropdown/interfaces.js.map +1 -1
  19. package/internal/components/dropdown/styles.css.js +21 -20
  20. package/internal/components/dropdown/styles.scoped.css +38 -35
  21. package/internal/components/dropdown/styles.selectors.js +21 -20
  22. package/internal/environment.js +1 -1
  23. package/internal/environment.json +1 -1
  24. package/internal/manifest.json +1 -1
  25. package/multiselect/internal.d.ts.map +1 -1
  26. package/multiselect/internal.js +1 -1
  27. package/multiselect/internal.js.map +1 -1
  28. package/package.json +1 -1
  29. package/select/internal.d.ts.map +1 -1
  30. package/select/internal.js +1 -1
  31. package/select/internal.js.map +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"interfaces.js","sourceRoot":"lib/default/","sources":["internal/components/dropdown/interfaces.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { NonCancelableEventHandler } from '../../events';\nimport React from 'react';\n\nexport type OptionsFilteringType = 'none' | 'auto' | 'manual';\nexport interface OptionsLoadItemsDetail {\n filteringText: string;\n firstPage: boolean;\n samePage: boolean;\n}\n\nexport interface BaseDropdownHostProps extends ExpandToViewport {\n /**\n * If you have more than 500 options, enable this flag to apply a performance optimization\n * that makes the filtering experience smoother. We don't recommend enabling the feature if you\n * have less than 500 options, because the improvements to performance are offset by a\n * visible scrolling lag.\n *\n * When you set this flag to `true`, it removes options that are not currently in view from the DOM.\n * If your test accesses such options, you need to first scroll the options container\n * to the correct offset, before performing any operations on them. Use the element returned\n * by the `findOptionsContainer` test utility for this.\n */\n virtualScroll?: boolean;\n\n /**\n * Use this event to implement the asynchronous behavior for the component.\n *\n * The event is called in the following situations:\n * * The user scrolls to the end of the list of options, if `statusType` is set to `pending`.\n * * The user clicks on the recovery button in the error state.\n * * The user types inside the input field.\n * * The user focuses the input field.\n *\n * The detail object contains the following properties:\n * * `filteringText` - The value that you need to use to fetch options.\n * * `firstPage` - Indicates that you should fetch the first page of options that match the `filteringText`.\n * * `samePage` - Indicates that you should fetch the same page that you have previously fetched (for example, when the user clicks on the recovery button).\n **/\n onLoadItems?: NonCancelableEventHandler<OptionsLoadItemsDetail>;\n}\n\nexport interface DropdownProps extends ExpandToViewport {\n /**\n * Trigger element.\n */\n trigger: React.ReactNode;\n /**\n * \"Sticky\" header of the dropdown content\n */\n header?: React.ReactNode;\n /**\n * Footer slot fixed at the bottom of the dropdown\n */\n footer?: React.ReactNode;\n /**\n * Dropdown content elements.\n */\n children?: React.ReactNode;\n /**\n * Updating content key triggers dropdown position re-evaluation.\n */\n contentKey?: string;\n /**\n * Open state of the dropdown.\n */\n open?: boolean;\n /**\n * Called when a user clicks outside of the dropdown content, when it is open.\n */\n onDropdownClose?: NonCancelableEventHandler<null>;\n /**\n * Called when a mouse button is pressed inside the dropdown content.\n */\n onMouseDown?: React.MouseEventHandler;\n /**\n * Dropdown id\n */\n dropdownId?: string;\n /**\n * Stretches dropdown to occupy entire width.\n */\n stretchWidth?: boolean;\n /**\n * Stretches dropdown to occupy entire height.\n */\n stretchHeight?: boolean;\n\n /**\n * Stretches the trigger to the height of the dropdown container.\n */\n stretchTriggerHeight?: boolean;\n\n /**\n * Whether the dropdown content should be at least as wide as the trigger.\n *\n * @defaultValue true\n */\n stretchToTriggerWidth?: boolean;\n\n /**\n * Determines that the dropdown should preferably be aligned to the center of the trigger\n * instead of dropping left or right.\n */\n preferCenter?: boolean;\n\n /**\n * Indicates if this dropdown lies within a parent dropdown and positions itself relative to it (as a fly out).\n */\n interior?: boolean;\n /**\n * Sets the min width of the dropdown (in px)\n */\n minWidth?: number;\n /**\n * Whether the dropdown will have a scrollbar or not\n */\n scrollable?: boolean;\n\n /**\n * Whether the dropdown will have a focus loop including trigger, header, content and footer.\n */\n loopFocus?: boolean;\n\n /**\n * Called when focus enters the trigger or dropdown content.\n */\n onFocus?: NonCancelableEventHandler<Pick<React.FocusEvent, 'target' | 'relatedTarget'>>;\n\n /**\n * Called when focus leaves the trigger or dropdown content.\n */\n onBlur?: NonCancelableEventHandler<Pick<React.FocusEvent, 'target' | 'relatedTarget'>>;\n\n /**\n * ID for the dropdown content wrapper\n */\n dropdownContentId?: string;\n /**\n * HTML role for the dropdown content wrapper\n */\n dropdownContentRole?: string;\n /**\n * Labelledby for the dropdown (required when role=\"dialog\")\n */\n ariaLabelledby?: string;\n /**\n * Describedby for the dropdown (recommended when role=\"dialog\")\n */\n ariaDescribedby?: string;\n}\n\nexport interface ExpandToViewport {\n /**\n * By default, the dropdown height is constrained to fit inside the height of its next scrollable container element.\n * Enabling this property will allow the dropdown to extend beyond that container by using fixed positioning and\n * [React Portals](https://reactjs.org/docs/portals.html).\n *\n * Set this property if the dropdown would otherwise be constrained by a scrollable container,\n * for example inside table and split view layouts.\n *\n * However, use discretion. We recommend you don't enable this property unless necessary\n * because fixed positioning results in a slight, visible lag when scrolling complex pages.\n */\n expandToViewport?: boolean;\n}\n"]}
1
+ {"version":3,"file":"interfaces.js","sourceRoot":"lib/default/","sources":["internal/components/dropdown/interfaces.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { NonCancelableEventHandler } from '../../events';\nimport React from 'react';\n\nexport type OptionsFilteringType = 'none' | 'auto' | 'manual';\nexport interface OptionsLoadItemsDetail {\n filteringText: string;\n firstPage: boolean;\n samePage: boolean;\n}\n\nexport interface BaseDropdownHostProps extends ExpandToViewport {\n /**\n * If you have more than 500 options, enable this flag to apply a performance optimization\n * that makes the filtering experience smoother. We don't recommend enabling the feature if you\n * have less than 500 options, because the improvements to performance are offset by a\n * visible scrolling lag.\n *\n * When you set this flag to `true`, it removes options that are not currently in view from the DOM.\n * If your test accesses such options, you need to first scroll the options container\n * to the correct offset, before performing any operations on them. Use the element returned\n * by the `findOptionsContainer` test utility for this.\n */\n virtualScroll?: boolean;\n\n /**\n * Use this event to implement the asynchronous behavior for the component.\n *\n * The event is called in the following situations:\n * * The user scrolls to the end of the list of options, if `statusType` is set to `pending`.\n * * The user clicks on the recovery button in the error state.\n * * The user types inside the input field.\n * * The user focuses the input field.\n *\n * The detail object contains the following properties:\n * * `filteringText` - The value that you need to use to fetch options.\n * * `firstPage` - Indicates that you should fetch the first page of options that match the `filteringText`.\n * * `samePage` - Indicates that you should fetch the same page that you have previously fetched (for example, when the user clicks on the recovery button).\n **/\n onLoadItems?: NonCancelableEventHandler<OptionsLoadItemsDetail>;\n}\n\nexport interface DropdownProps extends ExpandToViewport {\n /**\n * Trigger element.\n */\n trigger: React.ReactNode;\n /**\n * \"Sticky\" header of the dropdown content\n */\n header?: React.ReactNode;\n /**\n * Footer slot fixed at the bottom of the dropdown\n */\n footer?: React.ReactNode;\n /**\n * Dropdown content elements.\n */\n children?: React.ReactNode;\n /**\n * Updating content key triggers dropdown position re-evaluation.\n */\n contentKey?: string;\n /**\n * Open state of the dropdown.\n */\n open?: boolean;\n /**\n * Called when a user clicks outside of the dropdown content, when it is open.\n */\n onDropdownClose?: NonCancelableEventHandler<null>;\n /**\n * Called when a mouse button is pressed inside the dropdown content.\n */\n onMouseDown?: React.MouseEventHandler;\n /**\n * Dropdown id\n */\n dropdownId?: string;\n /**\n * Stretches dropdown to occupy entire width.\n */\n stretchWidth?: boolean;\n /**\n * Stretches dropdown to occupy entire height.\n */\n stretchHeight?: boolean;\n\n /**\n * Stretches the trigger to the height of the dropdown container.\n */\n stretchTriggerHeight?: boolean;\n\n /**\n * Whether the dropdown content should be at least as wide as the trigger.\n *\n * @defaultValue true\n */\n stretchToTriggerWidth?: boolean;\n\n /**\n * Whether the dropdown content can grow beyond the width of the trigger.\n */\n stretchBeyondTriggerWidth?: boolean;\n\n /**\n * Determines that the dropdown should preferably be aligned to the center of the trigger\n * instead of dropping left or right.\n */\n preferCenter?: boolean;\n\n /**\n * Indicates if this dropdown lies within a parent dropdown and positions itself relative to it (as a fly out).\n */\n interior?: boolean;\n /**\n * Sets the min width of the dropdown (in px)\n */\n minWidth?: number;\n /**\n * Whether the dropdown will have a scrollbar or not\n */\n scrollable?: boolean;\n\n /**\n * Whether the dropdown will have a focus loop including trigger, header, content and footer.\n */\n loopFocus?: boolean;\n\n /**\n * Called when focus enters the trigger or dropdown content.\n */\n onFocus?: NonCancelableEventHandler<Pick<React.FocusEvent, 'target' | 'relatedTarget'>>;\n\n /**\n * Called when focus leaves the trigger or dropdown content.\n */\n onBlur?: NonCancelableEventHandler<Pick<React.FocusEvent, 'target' | 'relatedTarget'>>;\n\n /**\n * ID for the dropdown content wrapper\n */\n dropdownContentId?: string;\n /**\n * HTML role for the dropdown content wrapper\n */\n dropdownContentRole?: string;\n /**\n * Labelledby for the dropdown (required when role=\"dialog\")\n */\n ariaLabelledby?: string;\n /**\n * Describedby for the dropdown (recommended when role=\"dialog\")\n */\n ariaDescribedby?: string;\n}\n\nexport interface ExpandToViewport {\n /**\n * By default, the dropdown height is constrained to fit inside the height of its next scrollable container element.\n * Enabling this property will allow the dropdown to extend beyond that container by using fixed positioning and\n * [React Portals](https://reactjs.org/docs/portals.html).\n *\n * Set this property if the dropdown would otherwise be constrained by a scrollable container,\n * for example inside table and split view layouts.\n *\n * However, use discretion. We recommend you don't enable this property unless necessary\n * because fixed positioning results in a slight, visible lag when scrolling complex pages.\n */\n expandToViewport?: boolean;\n}\n"]}
@@ -1,25 +1,26 @@
1
1
 
2
2
  import './styles.scoped.css';
3
3
  export default {
4
- "dropdown-content-wrapper": "awsui_dropdown-content-wrapper_qwoo0_9z5o3_93",
5
- "awsui-motion-fade-in-dropdown": "awsui_awsui-motion-fade-in-dropdown_qwoo0_9z5o3_1",
6
- "refresh": "awsui_refresh_qwoo0_9z5o3_114",
7
- "awsui-motion-fade-in-0": "awsui_awsui-motion-fade-in-0_qwoo0_9z5o3_1",
8
- "root": "awsui_root_qwoo0_9z5o3_143",
9
- "interior": "awsui_interior_qwoo0_9z5o3_157",
10
- "dropdown": "awsui_dropdown_qwoo0_9z5o3_93",
11
- "use-portal": "awsui_use-portal_qwoo0_9z5o3_168",
12
- "dropdown-drop-up": "awsui_dropdown-drop-up_qwoo0_9z5o3_213",
13
- "with-limited-width": "awsui_with-limited-width_qwoo0_9z5o3_217",
14
- "dropdown-drop-left": "awsui_dropdown-drop-left_qwoo0_9z5o3_220",
15
- "dropdown-drop-right": "awsui_dropdown-drop-right_qwoo0_9z5o3_223",
16
- "occupy-entire-width": "awsui_occupy-entire-width_qwoo0_9z5o3_226",
17
- "hide-upper-border": "awsui_hide-upper-border_qwoo0_9z5o3_229",
18
- "open": "awsui_open_qwoo0_9z5o3_236",
19
- "nowrap": "awsui_nowrap_qwoo0_9z5o3_245",
20
- "is-empty": "awsui_is-empty_qwoo0_9z5o3_249",
21
- "dropdown-content": "awsui_dropdown-content_qwoo0_9z5o3_93",
22
- "ie11-wrapper": "awsui_ie11-wrapper_qwoo0_9z5o3_259",
23
- "stretch-trigger-height": "awsui_stretch-trigger-height_qwoo0_9z5o3_263"
4
+ "dropdown-content-wrapper": "awsui_dropdown-content-wrapper_qwoo0_1063r_93",
5
+ "awsui-motion-fade-in-dropdown": "awsui_awsui-motion-fade-in-dropdown_qwoo0_1063r_1",
6
+ "refresh": "awsui_refresh_qwoo0_1063r_114",
7
+ "awsui-motion-fade-in-0": "awsui_awsui-motion-fade-in-0_qwoo0_1063r_1",
8
+ "root": "awsui_root_qwoo0_1063r_143",
9
+ "interior": "awsui_interior_qwoo0_1063r_157",
10
+ "dropdown": "awsui_dropdown_qwoo0_1063r_93",
11
+ "use-portal": "awsui_use-portal_qwoo0_1063r_168",
12
+ "dropdown-drop-up": "awsui_dropdown-drop-up_qwoo0_1063r_213",
13
+ "with-limited-width": "awsui_with-limited-width_qwoo0_1063r_217",
14
+ "dropdown-drop-left": "awsui_dropdown-drop-left_qwoo0_1063r_220",
15
+ "dropdown-drop-right": "awsui_dropdown-drop-right_qwoo0_1063r_223",
16
+ "occupy-entire-width": "awsui_occupy-entire-width_qwoo0_1063r_226",
17
+ "stretch-beyond-trigger-width": "awsui_stretch-beyond-trigger-width_qwoo0_1063r_229",
18
+ "hide-upper-border": "awsui_hide-upper-border_qwoo0_1063r_232",
19
+ "open": "awsui_open_qwoo0_1063r_239",
20
+ "nowrap": "awsui_nowrap_qwoo0_1063r_248",
21
+ "is-empty": "awsui_is-empty_qwoo0_1063r_252",
22
+ "dropdown-content": "awsui_dropdown-content_qwoo0_1063r_93",
23
+ "ie11-wrapper": "awsui_ie11-wrapper_qwoo0_1063r_262",
24
+ "stretch-trigger-height": "awsui_stretch-trigger-height_qwoo0_1063r_266"
24
25
  };
25
26
 
@@ -90,10 +90,10 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
90
90
  Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
91
91
  SPDX-License-Identifier: Apache-2.0
92
92
  */
93
- .awsui_dropdown-content-wrapper_qwoo0_9z5o3_93:not(#\9) {
94
- animation: awsui_awsui-motion-fade-in-dropdown_qwoo0_9z5o3_1 var(--motion-duration-show-quick-aq3ump, 135ms) var(--motion-easing-show-quick-vc5zgd, ease-out);
93
+ .awsui_dropdown-content-wrapper_qwoo0_1063r_93:not(#\9) {
94
+ animation: awsui_awsui-motion-fade-in-dropdown_qwoo0_1063r_1 var(--motion-duration-show-quick-aq3ump, 135ms) var(--motion-easing-show-quick-vc5zgd, ease-out);
95
95
  }
96
- @keyframes awsui_awsui-motion-fade-in-dropdown_qwoo0_9z5o3_1 {
96
+ @keyframes awsui_awsui-motion-fade-in-dropdown_qwoo0_1063r_1 {
97
97
  from {
98
98
  opacity: 0.4;
99
99
  }
@@ -102,22 +102,22 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
102
102
  }
103
103
  }
104
104
  @media (prefers-reduced-motion: reduce) {
105
- .awsui_dropdown-content-wrapper_qwoo0_9z5o3_93:not(#\9) {
105
+ .awsui_dropdown-content-wrapper_qwoo0_1063r_93:not(#\9) {
106
106
  animation: none;
107
107
  transition: none;
108
108
  }
109
109
  }
110
- .awsui-motion-disabled .awsui_dropdown-content-wrapper_qwoo0_9z5o3_93:not(#\9), .awsui-mode-entering .awsui_dropdown-content-wrapper_qwoo0_9z5o3_93:not(#\9) {
110
+ .awsui-motion-disabled .awsui_dropdown-content-wrapper_qwoo0_1063r_93:not(#\9), .awsui-mode-entering .awsui_dropdown-content-wrapper_qwoo0_1063r_93:not(#\9) {
111
111
  animation: none;
112
112
  transition: none;
113
113
  }
114
- .awsui_dropdown-content-wrapper_qwoo0_9z5o3_93.awsui_refresh_qwoo0_9z5o3_114:not(#\9) {
114
+ .awsui_dropdown-content-wrapper_qwoo0_1063r_93.awsui_refresh_qwoo0_1063r_114:not(#\9) {
115
115
  transform-origin: top;
116
- animation-name: awsui_awsui-motion-fade-in-0_qwoo0_9z5o3_1;
116
+ animation-name: awsui_awsui-motion-fade-in-0_qwoo0_1063r_1;
117
117
  animation-duration: var(--motion-duration-show-quick-aq3ump, 135ms);
118
118
  animation-timing-function: var(--motion-easing-show-quick-vc5zgd, ease-out);
119
119
  }
120
- @keyframes awsui_awsui-motion-fade-in-0_qwoo0_9z5o3_1 {
120
+ @keyframes awsui_awsui-motion-fade-in-0_qwoo0_1063r_1 {
121
121
  from {
122
122
  opacity: 0;
123
123
  }
@@ -126,12 +126,12 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
126
126
  }
127
127
  }
128
128
  @media (prefers-reduced-motion: reduce) {
129
- .awsui_dropdown-content-wrapper_qwoo0_9z5o3_93.awsui_refresh_qwoo0_9z5o3_114:not(#\9) {
129
+ .awsui_dropdown-content-wrapper_qwoo0_1063r_93.awsui_refresh_qwoo0_1063r_114:not(#\9) {
130
130
  animation: none;
131
131
  transition: none;
132
132
  }
133
133
  }
134
- .awsui-motion-disabled .awsui_dropdown-content-wrapper_qwoo0_9z5o3_93.awsui_refresh_qwoo0_9z5o3_114:not(#\9), .awsui-mode-entering .awsui_dropdown-content-wrapper_qwoo0_9z5o3_93.awsui_refresh_qwoo0_9z5o3_114:not(#\9) {
134
+ .awsui-motion-disabled .awsui_dropdown-content-wrapper_qwoo0_1063r_93.awsui_refresh_qwoo0_1063r_114:not(#\9), .awsui-mode-entering .awsui_dropdown-content-wrapper_qwoo0_1063r_93.awsui_refresh_qwoo0_1063r_114:not(#\9) {
135
135
  animation: none;
136
136
  transition: none;
137
137
  }
@@ -140,7 +140,7 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
140
140
  Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
141
141
  SPDX-License-Identifier: Apache-2.0
142
142
  */
143
- .awsui_root_qwoo0_9z5o3_143:not(#\9) {
143
+ .awsui_root_qwoo0_1063r_143:not(#\9) {
144
144
  /* stylelint-disable-next-line plugin/no-unsupported-browser-features */
145
145
  border-collapse: separate;
146
146
  border-spacing: 0;
@@ -180,11 +180,11 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
180
180
  position: relative;
181
181
  white-space: inherit;
182
182
  }
183
- .awsui_root_qwoo0_9z5o3_143.awsui_interior_qwoo0_9z5o3_157:not(#\9) {
183
+ .awsui_root_qwoo0_1063r_143.awsui_interior_qwoo0_1063r_157:not(#\9) {
184
184
  position: static;
185
185
  }
186
186
 
187
- .awsui_dropdown_qwoo0_9z5o3_93:not(#\9) {
187
+ .awsui_dropdown_qwoo0_1063r_93:not(#\9) {
188
188
  position: absolute;
189
189
  display: none;
190
190
  z-index: 2000;
@@ -192,24 +192,24 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
192
192
  user-select: none;
193
193
  transform-origin: top;
194
194
  }
195
- .awsui_dropdown_qwoo0_9z5o3_93.awsui_use-portal_qwoo0_9z5o3_168:not(#\9) {
195
+ .awsui_dropdown_qwoo0_1063r_93.awsui_use-portal_qwoo0_1063r_168:not(#\9) {
196
196
  z-index: 7000;
197
197
  }
198
- .awsui_dropdown_qwoo0_9z5o3_93:not(#\9):not(.awsui_interior_qwoo0_9z5o3_157) {
198
+ .awsui_dropdown_qwoo0_1063r_93:not(#\9):not(.awsui_interior_qwoo0_1063r_157) {
199
199
  transform: translateY(0px);
200
200
  transition: transform var(--motion-duration-show-quick-aq3ump, 135ms);
201
201
  }
202
202
  @media (prefers-reduced-motion: reduce) {
203
- .awsui_dropdown_qwoo0_9z5o3_93:not(#\9):not(.awsui_interior_qwoo0_9z5o3_157) {
203
+ .awsui_dropdown_qwoo0_1063r_93:not(#\9):not(.awsui_interior_qwoo0_1063r_157) {
204
204
  animation: none;
205
205
  transition: none;
206
206
  }
207
207
  }
208
- .awsui-motion-disabled .awsui_dropdown_qwoo0_9z5o3_93:not(#\9):not(.awsui_interior_qwoo0_9z5o3_157), .awsui-mode-entering .awsui_dropdown_qwoo0_9z5o3_93:not(#\9):not(.awsui_interior_qwoo0_9z5o3_157) {
208
+ .awsui-motion-disabled .awsui_dropdown_qwoo0_1063r_93:not(#\9):not(.awsui_interior_qwoo0_1063r_157), .awsui-mode-entering .awsui_dropdown_qwoo0_1063r_93:not(#\9):not(.awsui_interior_qwoo0_1063r_157) {
209
209
  animation: none;
210
210
  transition: none;
211
211
  }
212
- .awsui_dropdown-content-wrapper_qwoo0_9z5o3_93:not(#\9) {
212
+ .awsui_dropdown-content-wrapper_qwoo0_1063r_93:not(#\9) {
213
213
  position: relative;
214
214
  background-color: var(--color-background-dropdown-item-default-be16w5, #ffffff);
215
215
  outline: none;
@@ -219,7 +219,7 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
219
219
  box-sizing: border-box;
220
220
  border-bottom: none;
221
221
  }
222
- .awsui_dropdown-content-wrapper_qwoo0_9z5o3_93:not(#\9)::after {
222
+ .awsui_dropdown-content-wrapper_qwoo0_1063r_93:not(#\9)::after {
223
223
  content: "";
224
224
  position: absolute;
225
225
  z-index: 1;
@@ -233,60 +233,63 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
233
233
  pointer-events: none;
234
234
  }
235
235
  @media screen and (-ms-high-contrast: active), (-ms-high-contrast: none) {
236
- .awsui_dropdown-content-wrapper_qwoo0_9z5o3_93:not(#\9) {
236
+ .awsui_dropdown-content-wrapper_qwoo0_1063r_93:not(#\9) {
237
237
  border: var(--border-field-width-09w7vk, 2px) solid var(--color-border-container-top-736buh, transparent);
238
238
  }
239
239
  }
240
- .awsui_dropdown-drop-up_qwoo0_9z5o3_213 > .awsui_dropdown-content-wrapper_qwoo0_9z5o3_93:not(#\9) {
240
+ .awsui_dropdown-drop-up_qwoo0_1063r_213 > .awsui_dropdown-content-wrapper_qwoo0_1063r_93:not(#\9) {
241
241
  transform-origin: bottom;
242
242
  box-shadow: var(--shadow-dropup-7m0sn5, 0px 4px 20px 1px rgba(0, 7, 22, 0.1));
243
243
  }
244
- .awsui_dropdown-drop-up_qwoo0_9z5o3_213.awsui_with-limited-width_qwoo0_9z5o3_217 > .awsui_dropdown-content-wrapper_qwoo0_9z5o3_93:not(#\9) {
244
+ .awsui_dropdown-drop-up_qwoo0_1063r_213.awsui_with-limited-width_qwoo0_1063r_217 > .awsui_dropdown-content-wrapper_qwoo0_1063r_93:not(#\9) {
245
245
  border-top: none;
246
246
  }
247
- .awsui_dropdown-drop-left_qwoo0_9z5o3_220:not(#\9) {
247
+ .awsui_dropdown-drop-left_qwoo0_1063r_220:not(#\9) {
248
248
  right: 0;
249
249
  }
250
- .awsui_dropdown-drop-right_qwoo0_9z5o3_223:not(#\9) {
250
+ .awsui_dropdown-drop-right_qwoo0_1063r_223:not(#\9) {
251
251
  left: 0;
252
252
  }
253
- .awsui_dropdown_qwoo0_9z5o3_93.awsui_occupy-entire-width_qwoo0_9z5o3_226:not(#\9) {
253
+ .awsui_dropdown_qwoo0_1063r_93.awsui_occupy-entire-width_qwoo0_1063r_226:not(#\9) {
254
254
  min-width: 100%;
255
255
  }
256
- .awsui_dropdown_qwoo0_9z5o3_93.awsui_hide-upper-border_qwoo0_9z5o3_229 > .awsui_dropdown-content-wrapper_qwoo0_9z5o3_93:not(#\9) {
256
+ .awsui_dropdown_qwoo0_1063r_93.awsui_stretch-beyond-trigger-width_qwoo0_1063r_229:not(#\9) {
257
+ width: max-content;
258
+ }
259
+ .awsui_dropdown_qwoo0_1063r_93.awsui_hide-upper-border_qwoo0_1063r_232 > .awsui_dropdown-content-wrapper_qwoo0_1063r_93:not(#\9) {
257
260
  border-top: none;
258
261
  }
259
- .awsui_dropdown_qwoo0_9z5o3_93.awsui_interior_qwoo0_9z5o3_157 > .awsui_dropdown-content-wrapper_qwoo0_9z5o3_93:not(#\9) {
262
+ .awsui_dropdown_qwoo0_1063r_93.awsui_interior_qwoo0_1063r_157 > .awsui_dropdown-content-wrapper_qwoo0_1063r_93:not(#\9) {
260
263
  margin-top: -1px;
261
264
  border-top: var(--border-divider-list-width-27y3k5, 1px) solid var(--color-border-container-top-736buh, transparent);
262
265
  }
263
- .awsui_dropdown_qwoo0_9z5o3_93.awsui_open_qwoo0_9z5o3_236:not(#\9) {
266
+ .awsui_dropdown_qwoo0_1063r_93.awsui_open_qwoo0_1063r_239:not(#\9) {
264
267
  display: block;
265
268
  }
266
- .awsui_dropdown_qwoo0_9z5o3_93.awsui_open_qwoo0_9z5o3_236:not(#\9):not(.awsui_interior_qwoo0_9z5o3_157).awsui_refresh_qwoo0_9z5o3_114[data-animating=true] {
269
+ .awsui_dropdown_qwoo0_1063r_93.awsui_open_qwoo0_1063r_239:not(#\9):not(.awsui_interior_qwoo0_1063r_157).awsui_refresh_qwoo0_1063r_114[data-animating=true] {
267
270
  transform: translateY(4px);
268
271
  }
269
- .awsui_dropdown_qwoo0_9z5o3_93.awsui_open_qwoo0_9z5o3_236:not(#\9):not(.awsui_interior_qwoo0_9z5o3_157).awsui_refresh_qwoo0_9z5o3_114[data-animating=true].awsui_dropdown-drop-up_qwoo0_9z5o3_213 {
272
+ .awsui_dropdown_qwoo0_1063r_93.awsui_open_qwoo0_1063r_239:not(#\9):not(.awsui_interior_qwoo0_1063r_157).awsui_refresh_qwoo0_1063r_114[data-animating=true].awsui_dropdown-drop-up_qwoo0_1063r_213 {
270
273
  transform: translateY(-4px);
271
274
  }
272
- .awsui_dropdown_qwoo0_9z5o3_93.awsui_open_qwoo0_9z5o3_236.awsui_nowrap_qwoo0_9z5o3_245:not(#\9) {
275
+ .awsui_dropdown_qwoo0_1063r_93.awsui_open_qwoo0_1063r_239.awsui_nowrap_qwoo0_1063r_248:not(#\9) {
273
276
  white-space: nowrap;
274
277
  overflow: scroll;
275
278
  }
276
- .awsui_dropdown_qwoo0_9z5o3_93.awsui_is-empty_qwoo0_9z5o3_249:not(#\9)::after {
279
+ .awsui_dropdown_qwoo0_1063r_93.awsui_is-empty_qwoo0_1063r_252:not(#\9)::after {
277
280
  display: none;
278
281
  }
279
282
 
280
- .awsui_dropdown-content_qwoo0_9z5o3_93:not(#\9) {
283
+ .awsui_dropdown-content_qwoo0_1063r_93:not(#\9) {
281
284
  display: flex;
282
285
  flex-direction: column;
283
286
  width: 100%;
284
287
  }
285
288
 
286
- .awsui_ie11-wrapper_qwoo0_9z5o3_259:not(#\9) {
289
+ .awsui_ie11-wrapper_qwoo0_1063r_262:not(#\9) {
287
290
  display: flex;
288
291
  }
289
292
 
290
- .awsui_stretch-trigger-height_qwoo0_9z5o3_263:not(#\9) {
293
+ .awsui_stretch-trigger-height_qwoo0_1063r_266:not(#\9) {
291
294
  height: 100%;
292
295
  }
@@ -2,25 +2,26 @@
2
2
  // es-module interop with Babel and Typescript
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
4
  module.exports.default = {
5
- "dropdown-content-wrapper": "awsui_dropdown-content-wrapper_qwoo0_9z5o3_93",
6
- "awsui-motion-fade-in-dropdown": "awsui_awsui-motion-fade-in-dropdown_qwoo0_9z5o3_1",
7
- "refresh": "awsui_refresh_qwoo0_9z5o3_114",
8
- "awsui-motion-fade-in-0": "awsui_awsui-motion-fade-in-0_qwoo0_9z5o3_1",
9
- "root": "awsui_root_qwoo0_9z5o3_143",
10
- "interior": "awsui_interior_qwoo0_9z5o3_157",
11
- "dropdown": "awsui_dropdown_qwoo0_9z5o3_93",
12
- "use-portal": "awsui_use-portal_qwoo0_9z5o3_168",
13
- "dropdown-drop-up": "awsui_dropdown-drop-up_qwoo0_9z5o3_213",
14
- "with-limited-width": "awsui_with-limited-width_qwoo0_9z5o3_217",
15
- "dropdown-drop-left": "awsui_dropdown-drop-left_qwoo0_9z5o3_220",
16
- "dropdown-drop-right": "awsui_dropdown-drop-right_qwoo0_9z5o3_223",
17
- "occupy-entire-width": "awsui_occupy-entire-width_qwoo0_9z5o3_226",
18
- "hide-upper-border": "awsui_hide-upper-border_qwoo0_9z5o3_229",
19
- "open": "awsui_open_qwoo0_9z5o3_236",
20
- "nowrap": "awsui_nowrap_qwoo0_9z5o3_245",
21
- "is-empty": "awsui_is-empty_qwoo0_9z5o3_249",
22
- "dropdown-content": "awsui_dropdown-content_qwoo0_9z5o3_93",
23
- "ie11-wrapper": "awsui_ie11-wrapper_qwoo0_9z5o3_259",
24
- "stretch-trigger-height": "awsui_stretch-trigger-height_qwoo0_9z5o3_263"
5
+ "dropdown-content-wrapper": "awsui_dropdown-content-wrapper_qwoo0_1063r_93",
6
+ "awsui-motion-fade-in-dropdown": "awsui_awsui-motion-fade-in-dropdown_qwoo0_1063r_1",
7
+ "refresh": "awsui_refresh_qwoo0_1063r_114",
8
+ "awsui-motion-fade-in-0": "awsui_awsui-motion-fade-in-0_qwoo0_1063r_1",
9
+ "root": "awsui_root_qwoo0_1063r_143",
10
+ "interior": "awsui_interior_qwoo0_1063r_157",
11
+ "dropdown": "awsui_dropdown_qwoo0_1063r_93",
12
+ "use-portal": "awsui_use-portal_qwoo0_1063r_168",
13
+ "dropdown-drop-up": "awsui_dropdown-drop-up_qwoo0_1063r_213",
14
+ "with-limited-width": "awsui_with-limited-width_qwoo0_1063r_217",
15
+ "dropdown-drop-left": "awsui_dropdown-drop-left_qwoo0_1063r_220",
16
+ "dropdown-drop-right": "awsui_dropdown-drop-right_qwoo0_1063r_223",
17
+ "occupy-entire-width": "awsui_occupy-entire-width_qwoo0_1063r_226",
18
+ "stretch-beyond-trigger-width": "awsui_stretch-beyond-trigger-width_qwoo0_1063r_229",
19
+ "hide-upper-border": "awsui_hide-upper-border_qwoo0_1063r_232",
20
+ "open": "awsui_open_qwoo0_1063r_239",
21
+ "nowrap": "awsui_nowrap_qwoo0_1063r_248",
22
+ "is-empty": "awsui_is-empty_qwoo0_1063r_252",
23
+ "dropdown-content": "awsui_dropdown-content_qwoo0_1063r_93",
24
+ "ie11-wrapper": "awsui_ie11-wrapper_qwoo0_1063r_262",
25
+ "stretch-trigger-height": "awsui_stretch-trigger-height_qwoo0_1063r_266"
25
26
  };
26
27
 
@@ -1,4 +1,4 @@
1
1
  export var PACKAGE_SOURCE = "components";
2
- export var PACKAGE_VERSION = "3.0.0 (afa885b8)";
2
+ export var PACKAGE_VERSION = "3.0.0 (3889d3eb)";
3
3
  export var THEME = "open-source-visual-refresh";
4
4
  export var ALWAYS_VISUAL_REFRESH = true;
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "PACKAGE_SOURCE": "components",
3
- "PACKAGE_VERSION": "3.0.0 (afa885b8)",
3
+ "PACKAGE_VERSION": "3.0.0 (3889d3eb)",
4
4
  "THEME": "default",
5
5
  "ALWAYS_VISUAL_REFRESH": false
6
6
  }
@@ -1,3 +1,3 @@
1
1
  {
2
- "commit": "afa885b8f378b602b2c3339e4acc2bf4bd60d192"
2
+ "commit": "3889d3eb7bc2a91cbfbd04c2155466df7fa2a9ec"
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;AAQhD,QAAA,MAAM,mBAAmB,4HAqTxB,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;AAQhD,QAAA,MAAM,mBAAmB,4HAsTxB,CAAC;AAEF,eAAe,mBAAmB,CAAC"}
@@ -168,7 +168,7 @@ const InternalMultiselect = React.forwardRef((_a, externalRef) => {
168
168
  const mergedRef = useMergeRefs(rootRef, __internalRootRef);
169
169
  const dropdownProps = getDropdownProps();
170
170
  return (React.createElement("div", Object.assign({}, baseProps, { ref: mergedRef, className: clsx(styles.root, baseProps.className), onKeyPress: handleNativeSearch }),
171
- React.createElement(Dropdown, Object.assign({}, dropdownProps, { ariaLabelledby: dropdownProps.dropdownContentRole ? joinStrings(multiSelectAriaLabelId, controlId) : undefined, ariaDescribedby: dropdownProps.dropdownContentRole ? (dropdownStatus.content ? footerId : undefined) : undefined, open: isOpen, trigger: trigger, header: filter, onMouseDown: handleMouseDown, footer: dropdownStatus.isSticky ? (React.createElement(DropdownFooter, { content: isOpen ? dropdownStatus.content : null, id: footerId })) : null, expandToViewport: expandToViewport }),
171
+ React.createElement(Dropdown, Object.assign({}, dropdownProps, { ariaLabelledby: dropdownProps.dropdownContentRole ? joinStrings(multiSelectAriaLabelId, controlId) : undefined, ariaDescribedby: dropdownProps.dropdownContentRole ? (dropdownStatus.content ? footerId : undefined) : undefined, open: isOpen, trigger: trigger, header: filter, onMouseDown: handleMouseDown, footer: dropdownStatus.isSticky ? (React.createElement(DropdownFooter, { content: isOpen ? dropdownStatus.content : null, id: footerId })) : null, expandToViewport: expandToViewport, stretchBeyondTriggerWidth: true }),
172
172
  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 })),
173
173
  showTokens && (React.createElement(InternalTokenGroup, { alignment: "horizontal", limit: tokenLimit, items: tokens, onDismiss: handleTokenDismiss, i18nStrings: tokenGroupI18nStrings })),
174
174
  React.createElement(ScreenreaderOnly, { id: multiSelectAriaLabelId }, ariaLabel)));
@@ -1 +1 @@
1
- {"version":3,"file":"internal.js","sourceRoot":"lib/default/","sources":["multiselect/internal.tsx"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;A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R,CAAC,cAAc,CAAC,QAAQ,CAAC,CAAC,CAAC,CACzB,oBAAC,cAAc,IAAC,OAAO,EAAE,MAAM,CAAC,CAAC,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,EAAE,EAAE,EAAE,QAAQ,GAAI,CAClF,CAAC,CAAC,CAAC,IAAI,EAEV,SAAS,EAAE,SAAS,EACpB,cAAc,EAAE,cAAc,EAC9B,eAAe,EAAE,eAAe,EAChC,cAAc,EAAE,cAAc,EAC9B,GAAG,EAAE,aAAa,EAClB,iBAAiB,EAAE,cAAc,CAAC,OAAO,KAAK,IAAI,EAClD,UAAU,EAAE,IAAI,EAChB,oBAAoB,EAAE,oBAAoB,EAC1C,mBAAmB,EAAE,YAAY,EACjC,aAAa,EAAE,aAAa,GAC5B,CACO;QACV,UAAU,IAAI,CACb,oBAAC,kBAAkB,IACjB,SAAS,EAAC,YAAY,EACtB,KAAK,EAAE,UAAU,EACjB,KAAK,EAAE,MAAM,EACb,SAAS,EAAE,kBAAkB,EAC7B,WAAW,EAAE,qBAAqB,GAClC,CACH;QACD,oBAAC,gBAAgB,IAAC,EAAE,EAAE,sBAAsB,IAAG,SAAS,CAAoB,CACxE,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, { useCallback, useEffect, useRef, useState } from 'react';\nimport clsx from 'clsx';\nimport { useMergeRefs } from '../internal/hooks/use-merge-refs';\n\nimport { InternalBaseComponentProps } from '../internal/hooks/use-base-component/index.js';\nimport { useFormFieldContext } from '../internal/context/form-field-context';\nimport { getBaseProps } from '../internal/base-component';\nimport { fireNonCancelableEvent } from '../internal/events';\nimport { useUniqueId } from '../internal/hooks/use-unique-id';\nimport { isGroup } from '../internal/components/option/utils/filter-options';\n\nimport DropdownFooter from '../internal/components/dropdown-footer/index.js';\nimport { prepareOptions } from '../internal/components/option/utils/prepare-options';\nimport { OptionDefinition, OptionGroup } from '../internal/components/option/interfaces';\nimport Dropdown from '../internal/components/dropdown';\nimport { useDropdownStatus } from '../internal/components/dropdown-status';\n\nimport { useSelect, MenuProps } from '../select/utils/use-select';\nimport { useNativeSearch } from '../select/utils/use-native-search';\nimport { useLoadItems } from '../select/utils/use-load-items';\nimport { useAnnouncement } from '../select/utils/use-announcement';\nimport { findOptionIndex } from '../select/utils/connect-options';\nimport PlainList, { SelectListProps } from '../select/parts/plain-list';\nimport VirtualList from '../select/parts/virtual-list';\nimport { checkOptionValueField } from '../select/utils/check-option-value-field.js';\nimport Filter from '../select/parts/filter';\nimport Trigger from '../select/parts/trigger';\n\nimport InternalTokenGroup from '../token-group/internal';\nimport { TokenGroupProps } from '../token-group/interfaces';\n\nimport { MultiselectProps } from './interfaces';\nimport styles from './styles.css.js';\nimport ScreenreaderOnly from '../internal/components/screenreader-only';\nimport { joinStrings } from '../internal/utils/strings';\nimport { useInternalI18n } from '../i18n/context';\n\ntype InternalMultiselectProps = MultiselectProps & InternalBaseComponentProps;\n\nconst InternalMultiselect = React.forwardRef(\n (\n {\n options = [],\n filteringType = 'none',\n filteringPlaceholder,\n filteringAriaLabel,\n filteringClearAriaLabel,\n filteringResultsText,\n ariaRequired,\n placeholder,\n disabled,\n ariaLabel,\n statusType = 'finished',\n empty,\n loadingText,\n finishedText,\n errorText,\n recoveryText,\n noMatch,\n selectedAriaLabel,\n renderHighlightedAriaLive,\n selectedOptions = [],\n deselectAriaLabel,\n keepOpen = true,\n tokenLimit,\n i18nStrings,\n onBlur,\n onFocus,\n onLoadItems,\n onChange,\n virtualScroll,\n hideTokens = false,\n expandToViewport,\n __internalRootRef = null,\n autoFocus,\n ...restProps\n }: InternalMultiselectProps,\n externalRef: React.Ref<MultiselectProps.Ref>\n ) => {\n checkOptionValueField('Multiselect', 'options', options);\n\n const baseProps = getBaseProps(restProps);\n const formFieldContext = useFormFieldContext(restProps);\n const i18n = useInternalI18n('multiselect');\n\n const { handleLoadMore, handleRecoveryClick, fireLoadItems } = useLoadItems({\n onLoadItems,\n options,\n statusType,\n });\n const useInteractiveGroups = true;\n const [filteringValue, setFilteringValue] = useState('');\n const { filteredOptions, parentMap, totalCount, matchesCount } = prepareOptions(\n options,\n filteringType,\n filteringValue\n );\n\n const updateSelectedOption = useCallback(\n (option: OptionDefinition | OptionGroup) => {\n const filtered = filteredOptions.filter(item => item.type !== 'parent').map(item => item.option);\n\n // switch between selection and deselection behavior, ignores disabled options to prevent\n // getting stuck on one behavior when an option is disabled and its state cannot be changed\n const isAllChildrenSelected = (optionsArray: OptionDefinition[]) =>\n optionsArray.every(item => findOptionIndex(selectedOptions, item) > -1 || item.disabled);\n const intersection = (visibleOptions: OptionDefinition[], options: OptionDefinition[]) =>\n visibleOptions.filter(item => findOptionIndex(options, item) > -1 && !item.disabled);\n const union = (visibleOptions: OptionDefinition[], options: OptionDefinition[]) =>\n visibleOptions.filter(item => findOptionIndex(options, item) === -1).concat(options);\n const select = (options: OptionDefinition[], selectedOptions: OptionDefinition[]) => {\n return union(selectedOptions, options);\n };\n const unselect = (options: OptionDefinition[], selectedOptions: OptionDefinition[]) => {\n return selectedOptions.filter(option => findOptionIndex(options, option) === -1);\n };\n let newSelectedOptions = [...selectedOptions];\n\n if (isGroup(option)) {\n const visibleOptions = intersection([...option.options], filtered);\n newSelectedOptions = isAllChildrenSelected(visibleOptions)\n ? unselect(visibleOptions, newSelectedOptions)\n : select(visibleOptions, newSelectedOptions);\n } else {\n newSelectedOptions = isAllChildrenSelected([option])\n ? unselect([option], newSelectedOptions)\n : select([option], newSelectedOptions);\n }\n\n fireNonCancelableEvent(onChange, {\n selectedOptions: newSelectedOptions,\n });\n },\n [onChange, selectedOptions, filteredOptions]\n );\n\n const rootRef = useRef<HTMLDivElement>(null);\n\n const selfControlId = useUniqueId('trigger');\n const controlId = formFieldContext.controlId ?? selfControlId;\n\n const multiSelectAriaLabelId = useUniqueId('multiselect-arialabel-');\n\n const footerId = useUniqueId('footer');\n\n const scrollToIndex = useRef<SelectListProps.SelectListRef>(null);\n const {\n isOpen,\n highlightType,\n highlightedOption,\n highlightedIndex,\n getTriggerProps,\n getDropdownProps,\n getFilterProps,\n getMenuProps,\n getOptionProps,\n highlightOption,\n announceSelected,\n } = useSelect({\n selectedOptions,\n updateSelectedOption,\n options: filteredOptions,\n filteringType,\n onFocus,\n onBlur,\n externalRef,\n keepOpen,\n fireLoadItems,\n setFilteringValue,\n useInteractiveGroups,\n statusType,\n });\n\n const handleNativeSearch = useNativeSearch({\n isEnabled: filteringType === 'none' && isOpen,\n options: filteredOptions,\n highlightOption: highlightOption,\n highlightedOption: highlightedOption?.option,\n useInteractiveGroups,\n });\n\n const isEmpty = !options || options.length === 0;\n const isNoMatch = filteredOptions && filteredOptions.length === 0;\n const isFiltered =\n filteringType !== 'none' && filteringValue.length > 0 && filteredOptions && filteredOptions.length > 0;\n const filteredText = isFiltered ? filteringResultsText?.(matchesCount, totalCount) : undefined;\n const dropdownStatus = useDropdownStatus({\n statusType,\n empty,\n loadingText,\n finishedText,\n errorText,\n recoveryText,\n isEmpty,\n isNoMatch,\n noMatch,\n isFiltered,\n filteringResultsText: filteredText,\n onRecoveryClick: handleRecoveryClick,\n errorIconAriaLabel: restProps.errorIconAriaLabel,\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 {...getFilterProps()}\n />\n );\n\n const trigger = (\n <Trigger\n placeholder={placeholder}\n disabled={disabled}\n triggerProps={getTriggerProps(disabled, autoFocus)}\n selectedOption={null}\n isOpen={isOpen}\n {...formFieldContext}\n controlId={controlId}\n ariaLabelledby={joinStrings(formFieldContext.ariaLabelledby, multiSelectAriaLabelId)}\n />\n );\n\n const menuProps: MenuProps = {\n ...getMenuProps(),\n onLoadMore: handleLoadMore,\n ariaLabelledby: joinStrings(multiSelectAriaLabelId, controlId),\n ariaDescribedby: dropdownStatus.content ? footerId : undefined,\n };\n\n const announcement = useAnnouncement({\n announceSelected,\n highlightedOption,\n getParent: option => parentMap.get(option)?.option as undefined | OptionGroup,\n selectedAriaLabel,\n renderHighlightedAriaLive,\n });\n\n const tokens: TokenGroupProps['items'] = selectedOptions.map(option => ({\n label: option.label,\n disabled: disabled || option.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 }));\n\n useEffect(() => {\n scrollToIndex.current?.(highlightedIndex);\n }, [highlightedIndex]);\n\n const ListComponent = virtualScroll ? VirtualList : PlainList;\n\n const handleMouseDown = (event: React.MouseEvent) => {\n const target = event.target as HTMLElement;\n\n if (target !== document.activeElement) {\n // prevent currently focused element from losing it\n event.preventDefault();\n }\n };\n\n const showTokens = !hideTokens && tokens.length > 0;\n const handleTokenDismiss: TokenGroupProps['onDismiss'] = ({ detail }) => {\n const optionToDeselect = selectedOptions[detail.itemIndex];\n updateSelectedOption(optionToDeselect);\n const targetRef = getTriggerProps().ref;\n if (targetRef.current) {\n targetRef.current.focus();\n }\n };\n\n const tokenGroupI18nStrings: TokenGroupProps.I18nStrings = {\n limitShowFewer: i18nStrings?.tokenLimitShowFewer,\n limitShowMore: i18nStrings?.tokenLimitShowMore,\n };\n\n const mergedRef = useMergeRefs(rootRef, __internalRootRef);\n\n const dropdownProps = getDropdownProps();\n\n return (\n <div\n {...baseProps}\n ref={mergedRef}\n className={clsx(styles.root, baseProps.className)}\n onKeyPress={handleNativeSearch}\n >\n <Dropdown\n {...dropdownProps}\n ariaLabelledby={\n dropdownProps.dropdownContentRole ? joinStrings(multiSelectAriaLabelId, controlId) : undefined\n }\n ariaDescribedby={\n dropdownProps.dropdownContentRole ? (dropdownStatus.content ? footerId : undefined) : undefined\n }\n open={isOpen}\n trigger={trigger}\n header={filter}\n onMouseDown={handleMouseDown}\n footer={\n dropdownStatus.isSticky ? (\n <DropdownFooter content={isOpen ? dropdownStatus.content : null} id={footerId} />\n ) : null\n }\n expandToViewport={expandToViewport}\n >\n <ListComponent\n listBottom={\n !dropdownStatus.isSticky ? (\n <DropdownFooter content={isOpen ? dropdownStatus.content : null} id={footerId} />\n ) : null\n }\n menuProps={menuProps}\n getOptionProps={getOptionProps}\n filteredOptions={filteredOptions}\n filteringValue={filteringValue}\n ref={scrollToIndex}\n hasDropdownStatus={dropdownStatus.content !== null}\n checkboxes={true}\n useInteractiveGroups={useInteractiveGroups}\n screenReaderContent={announcement}\n highlightType={highlightType}\n />\n </Dropdown>\n {showTokens && (\n <InternalTokenGroup\n alignment=\"horizontal\"\n limit={tokenLimit}\n items={tokens}\n onDismiss={handleTokenDismiss}\n i18nStrings={tokenGroupI18nStrings}\n />\n )}\n <ScreenreaderOnly id={multiSelectAriaLabelId}>{ariaLabel}</ScreenreaderOnly>\n </div>\n );\n }\n);\n\nexport default InternalMultiselect;\n"]}
1
+ {"version":3,"file":"internal.js","sourceRoot":"lib/default/","sources":["multiselect/internal.tsx"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACxE,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,YAAY,EAAE,MAAM,kCAAkC,CAAC;AAGhE,OAAO,EAAE,mBAAmB,EAAE,MAAM,wCAAwC,CAAC;AAC7E,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AAC5D,OAAO,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAC;AAC9D,OAAO,EAAE,O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D,UAAU,EAAE,IAAI,EAChB,oBAAoB,EAAE,oBAAoB,EAC1C,mBAAmB,EAAE,YAAY,EACjC,aAAa,EAAE,aAAa,GAC5B,CACO;QACV,UAAU,IAAI,CACb,oBAAC,kBAAkB,IACjB,SAAS,EAAC,YAAY,EACtB,KAAK,EAAE,UAAU,EACjB,KAAK,EAAE,MAAM,EACb,SAAS,EAAE,kBAAkB,EAC7B,WAAW,EAAE,qBAAqB,GAClC,CACH;QACD,oBAAC,gBAAgB,IAAC,EAAE,EAAE,sBAAsB,IAAG,SAAS,CAAoB,CACxE,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, { useCallback, useEffect, useRef, useState } from 'react';\nimport clsx from 'clsx';\nimport { useMergeRefs } from '../internal/hooks/use-merge-refs';\n\nimport { InternalBaseComponentProps } from '../internal/hooks/use-base-component/index.js';\nimport { useFormFieldContext } from '../internal/context/form-field-context';\nimport { getBaseProps } from '../internal/base-component';\nimport { fireNonCancelableEvent } from '../internal/events';\nimport { useUniqueId } from '../internal/hooks/use-unique-id';\nimport { isGroup } from '../internal/components/option/utils/filter-options';\n\nimport DropdownFooter from '../internal/components/dropdown-footer/index.js';\nimport { prepareOptions } from '../internal/components/option/utils/prepare-options';\nimport { OptionDefinition, OptionGroup } from '../internal/components/option/interfaces';\nimport Dropdown from '../internal/components/dropdown';\nimport { useDropdownStatus } from '../internal/components/dropdown-status';\n\nimport { useSelect, MenuProps } from '../select/utils/use-select';\nimport { useNativeSearch } from '../select/utils/use-native-search';\nimport { useLoadItems } from '../select/utils/use-load-items';\nimport { useAnnouncement } from '../select/utils/use-announcement';\nimport { findOptionIndex } from '../select/utils/connect-options';\nimport PlainList, { SelectListProps } from '../select/parts/plain-list';\nimport VirtualList from '../select/parts/virtual-list';\nimport { checkOptionValueField } from '../select/utils/check-option-value-field.js';\nimport Filter from '../select/parts/filter';\nimport Trigger from '../select/parts/trigger';\n\nimport InternalTokenGroup from '../token-group/internal';\nimport { TokenGroupProps } from '../token-group/interfaces';\n\nimport { MultiselectProps } from './interfaces';\nimport styles from './styles.css.js';\nimport ScreenreaderOnly from '../internal/components/screenreader-only';\nimport { joinStrings } from '../internal/utils/strings';\nimport { useInternalI18n } from '../i18n/context';\n\ntype InternalMultiselectProps = MultiselectProps & InternalBaseComponentProps;\n\nconst InternalMultiselect = React.forwardRef(\n (\n {\n options = [],\n filteringType = 'none',\n filteringPlaceholder,\n filteringAriaLabel,\n filteringClearAriaLabel,\n filteringResultsText,\n ariaRequired,\n placeholder,\n disabled,\n ariaLabel,\n statusType = 'finished',\n empty,\n loadingText,\n finishedText,\n errorText,\n recoveryText,\n noMatch,\n selectedAriaLabel,\n renderHighlightedAriaLive,\n selectedOptions = [],\n deselectAriaLabel,\n keepOpen = true,\n tokenLimit,\n i18nStrings,\n onBlur,\n onFocus,\n onLoadItems,\n onChange,\n virtualScroll,\n hideTokens = false,\n expandToViewport,\n __internalRootRef = null,\n autoFocus,\n ...restProps\n }: InternalMultiselectProps,\n externalRef: React.Ref<MultiselectProps.Ref>\n ) => {\n checkOptionValueField('Multiselect', 'options', options);\n\n const baseProps = getBaseProps(restProps);\n const formFieldContext = useFormFieldContext(restProps);\n const i18n = useInternalI18n('multiselect');\n\n const { handleLoadMore, handleRecoveryClick, fireLoadItems } = useLoadItems({\n onLoadItems,\n options,\n statusType,\n });\n const useInteractiveGroups = true;\n const [filteringValue, setFilteringValue] = useState('');\n const { filteredOptions, parentMap, totalCount, matchesCount } = prepareOptions(\n options,\n filteringType,\n filteringValue\n );\n\n const updateSelectedOption = useCallback(\n (option: OptionDefinition | OptionGroup) => {\n const filtered = filteredOptions.filter(item => item.type !== 'parent').map(item => item.option);\n\n // switch between selection and deselection behavior, ignores disabled options to prevent\n // getting stuck on one behavior when an option is disabled and its state cannot be changed\n const isAllChildrenSelected = (optionsArray: OptionDefinition[]) =>\n optionsArray.every(item => findOptionIndex(selectedOptions, item) > -1 || item.disabled);\n const intersection = (visibleOptions: OptionDefinition[], options: OptionDefinition[]) =>\n visibleOptions.filter(item => findOptionIndex(options, item) > -1 && !item.disabled);\n const union = (visibleOptions: OptionDefinition[], options: OptionDefinition[]) =>\n visibleOptions.filter(item => findOptionIndex(options, item) === -1).concat(options);\n const select = (options: OptionDefinition[], selectedOptions: OptionDefinition[]) => {\n return union(selectedOptions, options);\n };\n const unselect = (options: OptionDefinition[], selectedOptions: OptionDefinition[]) => {\n return selectedOptions.filter(option => findOptionIndex(options, option) === -1);\n };\n let newSelectedOptions = [...selectedOptions];\n\n if (isGroup(option)) {\n const visibleOptions = intersection([...option.options], filtered);\n newSelectedOptions = isAllChildrenSelected(visibleOptions)\n ? unselect(visibleOptions, newSelectedOptions)\n : select(visibleOptions, newSelectedOptions);\n } else {\n newSelectedOptions = isAllChildrenSelected([option])\n ? unselect([option], newSelectedOptions)\n : select([option], newSelectedOptions);\n }\n\n fireNonCancelableEvent(onChange, {\n selectedOptions: newSelectedOptions,\n });\n },\n [onChange, selectedOptions, filteredOptions]\n );\n\n const rootRef = useRef<HTMLDivElement>(null);\n\n const selfControlId = useUniqueId('trigger');\n const controlId = formFieldContext.controlId ?? selfControlId;\n\n const multiSelectAriaLabelId = useUniqueId('multiselect-arialabel-');\n\n const footerId = useUniqueId('footer');\n\n const scrollToIndex = useRef<SelectListProps.SelectListRef>(null);\n const {\n isOpen,\n highlightType,\n highlightedOption,\n highlightedIndex,\n getTriggerProps,\n getDropdownProps,\n getFilterProps,\n getMenuProps,\n getOptionProps,\n highlightOption,\n announceSelected,\n } = useSelect({\n selectedOptions,\n updateSelectedOption,\n options: filteredOptions,\n filteringType,\n onFocus,\n onBlur,\n externalRef,\n keepOpen,\n fireLoadItems,\n setFilteringValue,\n useInteractiveGroups,\n statusType,\n });\n\n const handleNativeSearch = useNativeSearch({\n isEnabled: filteringType === 'none' && isOpen,\n options: filteredOptions,\n highlightOption: highlightOption,\n highlightedOption: highlightedOption?.option,\n useInteractiveGroups,\n });\n\n const isEmpty = !options || options.length === 0;\n const isNoMatch = filteredOptions && filteredOptions.length === 0;\n const isFiltered =\n filteringType !== 'none' && filteringValue.length > 0 && filteredOptions && filteredOptions.length > 0;\n const filteredText = isFiltered ? filteringResultsText?.(matchesCount, totalCount) : undefined;\n const dropdownStatus = useDropdownStatus({\n statusType,\n empty,\n loadingText,\n finishedText,\n errorText,\n recoveryText,\n isEmpty,\n isNoMatch,\n noMatch,\n isFiltered,\n filteringResultsText: filteredText,\n onRecoveryClick: handleRecoveryClick,\n errorIconAriaLabel: restProps.errorIconAriaLabel,\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 {...getFilterProps()}\n />\n );\n\n const trigger = (\n <Trigger\n placeholder={placeholder}\n disabled={disabled}\n triggerProps={getTriggerProps(disabled, autoFocus)}\n selectedOption={null}\n isOpen={isOpen}\n {...formFieldContext}\n controlId={controlId}\n ariaLabelledby={joinStrings(formFieldContext.ariaLabelledby, multiSelectAriaLabelId)}\n />\n );\n\n const menuProps: MenuProps = {\n ...getMenuProps(),\n onLoadMore: handleLoadMore,\n ariaLabelledby: joinStrings(multiSelectAriaLabelId, controlId),\n ariaDescribedby: dropdownStatus.content ? footerId : undefined,\n };\n\n const announcement = useAnnouncement({\n announceSelected,\n highlightedOption,\n getParent: option => parentMap.get(option)?.option as undefined | OptionGroup,\n selectedAriaLabel,\n renderHighlightedAriaLive,\n });\n\n const tokens: TokenGroupProps['items'] = selectedOptions.map(option => ({\n label: option.label,\n disabled: disabled || option.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 }));\n\n useEffect(() => {\n scrollToIndex.current?.(highlightedIndex);\n }, [highlightedIndex]);\n\n const ListComponent = virtualScroll ? VirtualList : PlainList;\n\n const handleMouseDown = (event: React.MouseEvent) => {\n const target = event.target as HTMLElement;\n\n if (target !== document.activeElement) {\n // prevent currently focused element from losing it\n event.preventDefault();\n }\n };\n\n const showTokens = !hideTokens && tokens.length > 0;\n const handleTokenDismiss: TokenGroupProps['onDismiss'] = ({ detail }) => {\n const optionToDeselect = selectedOptions[detail.itemIndex];\n updateSelectedOption(optionToDeselect);\n const targetRef = getTriggerProps().ref;\n if (targetRef.current) {\n targetRef.current.focus();\n }\n };\n\n const tokenGroupI18nStrings: TokenGroupProps.I18nStrings = {\n limitShowFewer: i18nStrings?.tokenLimitShowFewer,\n limitShowMore: i18nStrings?.tokenLimitShowMore,\n };\n\n const mergedRef = useMergeRefs(rootRef, __internalRootRef);\n\n const dropdownProps = getDropdownProps();\n\n return (\n <div\n {...baseProps}\n ref={mergedRef}\n className={clsx(styles.root, baseProps.className)}\n onKeyPress={handleNativeSearch}\n >\n <Dropdown\n {...dropdownProps}\n ariaLabelledby={\n dropdownProps.dropdownContentRole ? joinStrings(multiSelectAriaLabelId, controlId) : undefined\n }\n ariaDescribedby={\n dropdownProps.dropdownContentRole ? (dropdownStatus.content ? footerId : undefined) : undefined\n }\n open={isOpen}\n trigger={trigger}\n header={filter}\n onMouseDown={handleMouseDown}\n footer={\n dropdownStatus.isSticky ? (\n <DropdownFooter content={isOpen ? dropdownStatus.content : null} id={footerId} />\n ) : null\n }\n expandToViewport={expandToViewport}\n stretchBeyondTriggerWidth={true}\n >\n <ListComponent\n listBottom={\n !dropdownStatus.isSticky ? (\n <DropdownFooter content={isOpen ? dropdownStatus.content : null} id={footerId} />\n ) : null\n }\n menuProps={menuProps}\n getOptionProps={getOptionProps}\n filteredOptions={filteredOptions}\n filteringValue={filteringValue}\n ref={scrollToIndex}\n hasDropdownStatus={dropdownStatus.content !== null}\n checkboxes={true}\n useInteractiveGroups={useInteractiveGroups}\n screenReaderContent={announcement}\n highlightType={highlightType}\n />\n </Dropdown>\n {showTokens && (\n <InternalTokenGroup\n alignment=\"horizontal\"\n limit={tokenLimit}\n items={tokens}\n onDismiss={handleTokenDismiss}\n i18nStrings={tokenGroupI18nStrings}\n />\n )}\n <ScreenreaderOnly id={multiSelectAriaLabelId}>{ariaLabel}</ScreenreaderOnly>\n </div>\n );\n }\n);\n\nexport default InternalMultiselect;\n"]}
package/package.json CHANGED
@@ -109,7 +109,7 @@
109
109
  "./internal/base-component/index.js",
110
110
  "./internal/base-component/styles.css.js"
111
111
  ],
112
- "version": "3.0.359",
112
+ "version": "3.0.360",
113
113
  "repository": {
114
114
  "type": "git",
115
115
  "url": "https://github.com/cloudscape-design/components.git"
@@ -1 +1 @@
1
- {"version":3,"file":"internal.d.ts","sourceRoot":"lib/default/","sources":["select/internal.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAsC,MAAM,OAAO,CAAC;AAW3D,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAa3C,OAAO,EAAE,0BAA0B,EAAE,MAAM,sCAAsC,CAAC;AAGlF,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAKjD,MAAM,WAAW,mBAAoB,SAAQ,YAAY,CAAC,WAAW,EAAE,SAAS,CAAC,EAAE,0BAA0B;IAC3G,kBAAkB,CAAC,EAAE,OAAO,CAAC;CAC9B;AAED,QAAA,MAAM,cAAc,6FAyOnB,CAAC;AAEF,eAAe,cAAc,CAAC"}
1
+ {"version":3,"file":"internal.d.ts","sourceRoot":"lib/default/","sources":["select/internal.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAsC,MAAM,OAAO,CAAC;AAW3D,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAa3C,OAAO,EAAE,0BAA0B,EAAE,MAAM,sCAAsC,CAAC;AAGlF,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAKjD,MAAM,WAAW,mBAAoB,SAAQ,YAAY,CAAC,WAAW,EAAE,SAAS,CAAC,EAAE,0BAA0B;IAC3G,kBAAkB,CAAC,EAAE,OAAO,CAAC;CAC9B;AAED,QAAA,MAAM,cAAc,6FA0OnB,CAAC;AAEF,eAAe,cAAc,CAAC"}
@@ -112,7 +112,7 @@ const InternalSelect = React.forwardRef((_a, externalRef) => {
112
112
  const mergedRef = useMergeRefs(rootRef, __internalRootRef);
113
113
  const dropdownProps = getDropdownProps();
114
114
  return (React.createElement("div", Object.assign({}, baseProps, { ref: mergedRef, className: clsx(styles.root, baseProps.className), onKeyPress: handleNativeSearch }),
115
- React.createElement(Dropdown, Object.assign({}, dropdownProps, { ariaLabelledby: dropdownProps.dropdownContentRole ? joinStrings(selectAriaLabelId, controlId) : undefined, ariaDescribedby: dropdownProps.dropdownContentRole ? (dropdownStatus.content ? footerId : undefined) : undefined, open: isOpen, stretchTriggerHeight: __inFilteringToken, trigger: trigger, header: filter, onMouseDown: handleMouseDown, footer: dropdownStatus.isSticky ? (React.createElement(DropdownFooter, { content: isOpen ? dropdownStatus.content : null, id: footerId })) : null, expandToViewport: expandToViewport }),
115
+ React.createElement(Dropdown, Object.assign({}, dropdownProps, { ariaLabelledby: dropdownProps.dropdownContentRole ? joinStrings(selectAriaLabelId, controlId) : undefined, ariaDescribedby: dropdownProps.dropdownContentRole ? (dropdownStatus.content ? footerId : undefined) : undefined, open: isOpen, stretchTriggerHeight: __inFilteringToken, stretchBeyondTriggerWidth: true, trigger: trigger, header: filter, onMouseDown: handleMouseDown, footer: dropdownStatus.isSticky ? (React.createElement(DropdownFooter, { content: isOpen ? dropdownStatus.content : null, id: footerId })) : null, expandToViewport: expandToViewport }),
116
116
  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, screenReaderContent: announcement, highlightType: highlightType })),
117
117
  React.createElement(ScreenreaderOnly, { id: selectAriaLabelId }, ariaLabel)));
118
118
  });
@@ -1 +1 @@
1
- {"version":3,"file":"internal.js","sourceRoot":"lib/default/","sources":["select/internal.tsx"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAC3D,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,MAAM,MAAM,iBAAiB,CAAC;AAErC,OAAO,QAAQ,MAAM,iCAAiC,CAAC;AACvD,OAAO,EAAE,iBAAiB,EAAE,MAAM,wCAAwC,CAAC;AAC3E,OAAO,MAAM,MAAM,gBAAgB,CAAC;AACpC,OAAO,OAAO,MAAM,iBAAiB,CAAC;AACtC,OAAO,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAC;AAE9D,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAE1D,OAAO,EAAE,cAAc,EAAE,MAAM,qDAAqD,CAAC;AACrF,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC/C,OAAO,EAAE,qBAAqB,EAAE,MAAM,kCAAkC,CAAC;AACzE,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAC5D,OAAO,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AAC5D,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AACtD,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAC3D,OAAO,EAAE,mBAAmB,EAAE,MAAM,wCAAwC,CAAC;AAC7E,OAAO,SAA8B,MAAM,oBAAoB,CAAC;AAChE,OAAO,WAAW,MAAM,sBAAsB,CAAC;AAC/C,OAA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AC,OAAO,CAAC,CAAC,CAAC,IAAI,EAAE,EAAE,EAAE,QAAQ,GAAI,CAClF,CAAC,CAAC,CAAC,IAAI,EAEV,SAAS,EAAE,SAAS,EACpB,cAAc,EAAE,cAAc,EAC9B,eAAe,EAAE,eAAe,EAChC,cAAc,EAAE,cAAc,EAC9B,GAAG,EAAE,aAAa,EAClB,iBAAiB,EAAE,cAAc,CAAC,OAAO,KAAK,IAAI,EAClD,mBAAmB,EAAE,YAAY,EACjC,aAAa,EAAE,aAAa,GAC5B,CACO;QACX,oBAAC,gBAAgB,IAAC,EAAE,EAAE,iBAAiB,IAAG,SAAS,CAAoB,CACnE,CACP,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,cAAc,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useState, useRef, useEffect } from 'react';\nimport clsx from 'clsx';\nimport styles from './styles.css.js';\n\nimport Dropdown from '../internal/components/dropdown';\nimport { useDropdownStatus } from '../internal/components/dropdown-status';\nimport Filter from './parts/filter';\nimport Trigger from './parts/trigger';\nimport { useUniqueId } from '../internal/hooks/use-unique-id';\n\nimport { getBaseProps } from '../internal/base-component';\nimport { SelectProps } from './interfaces';\nimport { prepareOptions } from '../internal/components/option/utils/prepare-options';\nimport { useSelect } from './utils/use-select';\nimport { checkOptionValueField } from './utils/check-option-value-field';\nimport { useNativeSearch } from './utils/use-native-search';\nimport { fireNonCancelableEvent } from '../internal/events';\nimport { useLoadItems } from './utils/use-load-items';\nimport { useAnnouncement } from './utils/use-announcement';\nimport { useFormFieldContext } from '../internal/context/form-field-context';\nimport PlainList, { SelectListProps } from './parts/plain-list';\nimport VirtualList from './parts/virtual-list';\nimport DropdownFooter from '../internal/components/dropdown-footer';\nimport checkControlled from '../internal/hooks/check-controlled';\nimport { InternalBaseComponentProps } from '../internal/hooks/use-base-component';\nimport { useMergeRefs } from '../internal/hooks/use-merge-refs';\nimport { OptionGroup } from '../internal/components/option/interfaces.js';\nimport { SomeRequired } from '../internal/types';\nimport ScreenreaderOnly from '../internal/components/screenreader-only/index.js';\nimport { joinStrings } from '../internal/utils/strings/join-strings.js';\nimport { useInternalI18n } from '../i18n/context.js';\n\nexport interface InternalSelectProps extends SomeRequired<SelectProps, 'options'>, InternalBaseComponentProps {\n __inFilteringToken?: boolean;\n}\n\nconst InternalSelect = React.forwardRef(\n (\n {\n options,\n filteringType = 'none',\n filteringPlaceholder,\n filteringAriaLabel,\n filteringClearAriaLabel,\n filteringResultsText,\n ariaRequired,\n placeholder,\n disabled,\n ariaLabel,\n statusType = 'finished',\n empty,\n loadingText,\n finishedText,\n errorText,\n recoveryText,\n noMatch,\n triggerVariant = 'label',\n renderHighlightedAriaLive,\n selectedOption,\n onBlur,\n onFocus,\n onLoadItems,\n onChange,\n virtualScroll,\n expandToViewport,\n autoFocus,\n __inFilteringToken,\n __internalRootRef = null,\n ...restProps\n }: InternalSelectProps,\n externalRef: React.Ref<SelectProps.Ref>\n ) => {\n const baseProps = getBaseProps(restProps);\n const formFieldContext = useFormFieldContext(restProps);\n\n const i18n = useInternalI18n('select');\n const errorIconAriaLabel = i18n('errorIconAriaLabel', restProps.errorIconAriaLabel);\n const selectedAriaLabel = i18n('selectedAriaLabel', restProps.selectedAriaLabel);\n\n const { handleLoadMore, handleRecoveryClick, fireLoadItems } = useLoadItems({\n onLoadItems,\n options,\n statusType,\n });\n\n checkControlled('Select', 'selectedOption', selectedOption, 'onChange', onChange);\n\n checkOptionValueField('Select', 'options', options);\n\n const [filteringValue, setFilteringValue] = useState('');\n\n const { filteredOptions, parentMap, totalCount, matchesCount } = prepareOptions(\n options,\n filteringType,\n filteringValue\n );\n\n const rootRef = useRef<HTMLDivElement>(null);\n const triggerRef = useRef<HTMLButtonElement>(null);\n\n const selfControlId = useUniqueId('trigger');\n const controlId = formFieldContext.controlId ?? selfControlId;\n\n const scrollToIndex = useRef<SelectListProps.SelectListRef>(null);\n const {\n isOpen,\n highlightType,\n highlightedOption,\n highlightedIndex,\n getTriggerProps,\n getDropdownProps,\n getFilterProps,\n getMenuProps,\n getOptionProps,\n highlightOption,\n selectOption,\n announceSelected,\n } = useSelect({\n selectedOptions: selectedOption ? [selectedOption] : [],\n updateSelectedOption: option => fireNonCancelableEvent(onChange, { selectedOption: option }),\n options: filteredOptions,\n filteringType,\n onBlur,\n onFocus,\n externalRef,\n fireLoadItems,\n setFilteringValue,\n statusType,\n });\n\n const handleNativeSearch = useNativeSearch({\n isEnabled: filteringType === 'none',\n options: filteredOptions,\n highlightOption: !isOpen ? selectOption : highlightOption,\n highlightedOption: !isOpen ? selectedOption : highlightedOption?.option,\n });\n\n const selectAriaLabelId = useUniqueId('select-arialabel-');\n const footerId = useUniqueId('footer');\n\n useEffect(() => {\n scrollToIndex.current?.(highlightedIndex);\n }, [highlightedIndex]);\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 {...getFilterProps()}\n />\n );\n\n const trigger = (\n <Trigger\n ref={triggerRef}\n placeholder={placeholder}\n disabled={disabled}\n triggerVariant={triggerVariant}\n triggerProps={getTriggerProps(disabled, autoFocus)}\n selectedOption={selectedOption}\n isOpen={isOpen}\n inFilteringToken={__inFilteringToken}\n {...formFieldContext}\n controlId={controlId}\n ariaLabelledby={joinStrings(formFieldContext.ariaLabelledby, selectAriaLabelId)}\n />\n );\n\n const isEmpty = !options || options.length === 0;\n const isNoMatch = filteredOptions && filteredOptions.length === 0;\n const isFiltered =\n filteringType !== 'none' && filteringValue.length > 0 && filteredOptions && filteredOptions.length > 0;\n const filteredText = isFiltered ? filteringResultsText?.(matchesCount, totalCount) : undefined;\n\n const dropdownStatus = useDropdownStatus({\n statusType,\n empty,\n loadingText,\n finishedText,\n errorText,\n recoveryText,\n isEmpty,\n isNoMatch,\n noMatch,\n isFiltered,\n filteringResultsText: filteredText,\n errorIconAriaLabel,\n onRecoveryClick: handleRecoveryClick,\n });\n\n const menuProps = {\n ...getMenuProps(),\n onLoadMore: handleLoadMore,\n ariaLabelledby: joinStrings(selectAriaLabelId, controlId),\n ariaDescribedby: dropdownStatus.content ? footerId : undefined,\n };\n\n const announcement = useAnnouncement({\n announceSelected,\n highlightedOption,\n getParent: option => parentMap.get(option)?.option as undefined | OptionGroup,\n selectedAriaLabel,\n renderHighlightedAriaLive,\n });\n\n const ListComponent = virtualScroll ? VirtualList : PlainList;\n\n const handleMouseDown = (event: React.MouseEvent) => {\n const target = event.target as HTMLElement;\n\n if (target !== document.activeElement) {\n // prevent currently focused element from losing it\n event.preventDefault();\n }\n };\n\n const mergedRef = useMergeRefs(rootRef, __internalRootRef);\n\n const dropdownProps = getDropdownProps();\n\n return (\n <div\n {...baseProps}\n ref={mergedRef}\n className={clsx(styles.root, baseProps.className)}\n onKeyPress={handleNativeSearch}\n >\n <Dropdown\n {...dropdownProps}\n ariaLabelledby={dropdownProps.dropdownContentRole ? joinStrings(selectAriaLabelId, controlId) : undefined}\n ariaDescribedby={\n dropdownProps.dropdownContentRole ? (dropdownStatus.content ? footerId : undefined) : undefined\n }\n open={isOpen}\n stretchTriggerHeight={__inFilteringToken}\n trigger={trigger}\n header={filter}\n onMouseDown={handleMouseDown}\n footer={\n dropdownStatus.isSticky ? (\n <DropdownFooter content={isOpen ? dropdownStatus.content : null} id={footerId} />\n ) : null\n }\n expandToViewport={expandToViewport}\n >\n <ListComponent\n listBottom={\n !dropdownStatus.isSticky ? (\n <DropdownFooter content={isOpen ? dropdownStatus.content : null} id={footerId} />\n ) : null\n }\n menuProps={menuProps}\n getOptionProps={getOptionProps}\n filteredOptions={filteredOptions}\n filteringValue={filteringValue}\n ref={scrollToIndex}\n hasDropdownStatus={dropdownStatus.content !== null}\n screenReaderContent={announcement}\n highlightType={highlightType}\n />\n </Dropdown>\n <ScreenreaderOnly id={selectAriaLabelId}>{ariaLabel}</ScreenreaderOnly>\n </div>\n );\n }\n);\n\nexport default InternalSelect;\n"]}
1
+ {"version":3,"file":"internal.js","sourceRoot":"lib/default/","sources":["select/internal.tsx"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAC3D,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,MAAM,MAAM,iBAAiB,CAAC;AAErC,OAAO,QAAQ,MAAM,iCAAiC,CAAC;AACvD,OAAO,EAAE,iBAAiB,EAAE,MAAM,wCAAwC,CAAC;AAC3E,OAAO,MAAM,MAAM,gBAAgB,CAAC;AACpC,OAAO,OAAO,MAAM,iBAAiB,CAAC;AACtC,OAAO,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAC;AAE9D,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAE1D,OAAO,EAAE,cAAc,EAAE,MAAM,qDAAqD,CAAC;AACrF,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC/C,OAAO,EAAE,qBAAqB,EAAE,MAAM,kCAAkC,CAAC;AACzE,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAC5D,OAAO,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AAC5D,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AACtD,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAC3D,OAAO,EAAE,mBAAmB,EAAE,MAAM,wCAAwC,CAAC;AAC7E,OAAO,SAA8B,MAAM,oBAAoB,CAAC;AAChE,OAAO,WAAW,MAAM,sBAAsB,CAAC;AAC/C,OAAO,cAAc,MAAM,wCAAwC,CAAC;AACpE,OAAO,eAAe,MAAM,oCAAoC,CAAC;AAEjE,OAAO,EAAE,YAAY,EAAE,MAAM,kCAAkC,CAAC;AAGhE,OAAO,gB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EAAE,SAAS,EACpB,cAAc,EAAE,cAAc,EAC9B,eAAe,EAAE,eAAe,EAChC,cAAc,EAAE,cAAc,EAC9B,GAAG,EAAE,aAAa,EAClB,iBAAiB,EAAE,cAAc,CAAC,OAAO,KAAK,IAAI,EAClD,mBAAmB,EAAE,YAAY,EACjC,aAAa,EAAE,aAAa,GAC5B,CACO;QACX,oBAAC,gBAAgB,IAAC,EAAE,EAAE,iBAAiB,IAAG,SAAS,CAAoB,CACnE,CACP,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,cAAc,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useState, useRef, useEffect } from 'react';\nimport clsx from 'clsx';\nimport styles from './styles.css.js';\n\nimport Dropdown from '../internal/components/dropdown';\nimport { useDropdownStatus } from '../internal/components/dropdown-status';\nimport Filter from './parts/filter';\nimport Trigger from './parts/trigger';\nimport { useUniqueId } from '../internal/hooks/use-unique-id';\n\nimport { getBaseProps } from '../internal/base-component';\nimport { SelectProps } from './interfaces';\nimport { prepareOptions } from '../internal/components/option/utils/prepare-options';\nimport { useSelect } from './utils/use-select';\nimport { checkOptionValueField } from './utils/check-option-value-field';\nimport { useNativeSearch } from './utils/use-native-search';\nimport { fireNonCancelableEvent } from '../internal/events';\nimport { useLoadItems } from './utils/use-load-items';\nimport { useAnnouncement } from './utils/use-announcement';\nimport { useFormFieldContext } from '../internal/context/form-field-context';\nimport PlainList, { SelectListProps } from './parts/plain-list';\nimport VirtualList from './parts/virtual-list';\nimport DropdownFooter from '../internal/components/dropdown-footer';\nimport checkControlled from '../internal/hooks/check-controlled';\nimport { InternalBaseComponentProps } from '../internal/hooks/use-base-component';\nimport { useMergeRefs } from '../internal/hooks/use-merge-refs';\nimport { OptionGroup } from '../internal/components/option/interfaces.js';\nimport { SomeRequired } from '../internal/types';\nimport ScreenreaderOnly from '../internal/components/screenreader-only/index.js';\nimport { joinStrings } from '../internal/utils/strings/join-strings.js';\nimport { useInternalI18n } from '../i18n/context.js';\n\nexport interface InternalSelectProps extends SomeRequired<SelectProps, 'options'>, InternalBaseComponentProps {\n __inFilteringToken?: boolean;\n}\n\nconst InternalSelect = React.forwardRef(\n (\n {\n options,\n filteringType = 'none',\n filteringPlaceholder,\n filteringAriaLabel,\n filteringClearAriaLabel,\n filteringResultsText,\n ariaRequired,\n placeholder,\n disabled,\n ariaLabel,\n statusType = 'finished',\n empty,\n loadingText,\n finishedText,\n errorText,\n recoveryText,\n noMatch,\n triggerVariant = 'label',\n renderHighlightedAriaLive,\n selectedOption,\n onBlur,\n onFocus,\n onLoadItems,\n onChange,\n virtualScroll,\n expandToViewport,\n autoFocus,\n __inFilteringToken,\n __internalRootRef = null,\n ...restProps\n }: InternalSelectProps,\n externalRef: React.Ref<SelectProps.Ref>\n ) => {\n const baseProps = getBaseProps(restProps);\n const formFieldContext = useFormFieldContext(restProps);\n\n const i18n = useInternalI18n('select');\n const errorIconAriaLabel = i18n('errorIconAriaLabel', restProps.errorIconAriaLabel);\n const selectedAriaLabel = i18n('selectedAriaLabel', restProps.selectedAriaLabel);\n\n const { handleLoadMore, handleRecoveryClick, fireLoadItems } = useLoadItems({\n onLoadItems,\n options,\n statusType,\n });\n\n checkControlled('Select', 'selectedOption', selectedOption, 'onChange', onChange);\n\n checkOptionValueField('Select', 'options', options);\n\n const [filteringValue, setFilteringValue] = useState('');\n\n const { filteredOptions, parentMap, totalCount, matchesCount } = prepareOptions(\n options,\n filteringType,\n filteringValue\n );\n\n const rootRef = useRef<HTMLDivElement>(null);\n const triggerRef = useRef<HTMLButtonElement>(null);\n\n const selfControlId = useUniqueId('trigger');\n const controlId = formFieldContext.controlId ?? selfControlId;\n\n const scrollToIndex = useRef<SelectListProps.SelectListRef>(null);\n const {\n isOpen,\n highlightType,\n highlightedOption,\n highlightedIndex,\n getTriggerProps,\n getDropdownProps,\n getFilterProps,\n getMenuProps,\n getOptionProps,\n highlightOption,\n selectOption,\n announceSelected,\n } = useSelect({\n selectedOptions: selectedOption ? [selectedOption] : [],\n updateSelectedOption: option => fireNonCancelableEvent(onChange, { selectedOption: option }),\n options: filteredOptions,\n filteringType,\n onBlur,\n onFocus,\n externalRef,\n fireLoadItems,\n setFilteringValue,\n statusType,\n });\n\n const handleNativeSearch = useNativeSearch({\n isEnabled: filteringType === 'none',\n options: filteredOptions,\n highlightOption: !isOpen ? selectOption : highlightOption,\n highlightedOption: !isOpen ? selectedOption : highlightedOption?.option,\n });\n\n const selectAriaLabelId = useUniqueId('select-arialabel-');\n const footerId = useUniqueId('footer');\n\n useEffect(() => {\n scrollToIndex.current?.(highlightedIndex);\n }, [highlightedIndex]);\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 {...getFilterProps()}\n />\n );\n\n const trigger = (\n <Trigger\n ref={triggerRef}\n placeholder={placeholder}\n disabled={disabled}\n triggerVariant={triggerVariant}\n triggerProps={getTriggerProps(disabled, autoFocus)}\n selectedOption={selectedOption}\n isOpen={isOpen}\n inFilteringToken={__inFilteringToken}\n {...formFieldContext}\n controlId={controlId}\n ariaLabelledby={joinStrings(formFieldContext.ariaLabelledby, selectAriaLabelId)}\n />\n );\n\n const isEmpty = !options || options.length === 0;\n const isNoMatch = filteredOptions && filteredOptions.length === 0;\n const isFiltered =\n filteringType !== 'none' && filteringValue.length > 0 && filteredOptions && filteredOptions.length > 0;\n const filteredText = isFiltered ? filteringResultsText?.(matchesCount, totalCount) : undefined;\n\n const dropdownStatus = useDropdownStatus({\n statusType,\n empty,\n loadingText,\n finishedText,\n errorText,\n recoveryText,\n isEmpty,\n isNoMatch,\n noMatch,\n isFiltered,\n filteringResultsText: filteredText,\n errorIconAriaLabel,\n onRecoveryClick: handleRecoveryClick,\n });\n\n const menuProps = {\n ...getMenuProps(),\n onLoadMore: handleLoadMore,\n ariaLabelledby: joinStrings(selectAriaLabelId, controlId),\n ariaDescribedby: dropdownStatus.content ? footerId : undefined,\n };\n\n const announcement = useAnnouncement({\n announceSelected,\n highlightedOption,\n getParent: option => parentMap.get(option)?.option as undefined | OptionGroup,\n selectedAriaLabel,\n renderHighlightedAriaLive,\n });\n\n const ListComponent = virtualScroll ? VirtualList : PlainList;\n\n const handleMouseDown = (event: React.MouseEvent) => {\n const target = event.target as HTMLElement;\n\n if (target !== document.activeElement) {\n // prevent currently focused element from losing it\n event.preventDefault();\n }\n };\n\n const mergedRef = useMergeRefs(rootRef, __internalRootRef);\n\n const dropdownProps = getDropdownProps();\n\n return (\n <div\n {...baseProps}\n ref={mergedRef}\n className={clsx(styles.root, baseProps.className)}\n onKeyPress={handleNativeSearch}\n >\n <Dropdown\n {...dropdownProps}\n ariaLabelledby={dropdownProps.dropdownContentRole ? joinStrings(selectAriaLabelId, controlId) : undefined}\n ariaDescribedby={\n dropdownProps.dropdownContentRole ? (dropdownStatus.content ? footerId : undefined) : undefined\n }\n open={isOpen}\n stretchTriggerHeight={__inFilteringToken}\n stretchBeyondTriggerWidth={true}\n trigger={trigger}\n header={filter}\n onMouseDown={handleMouseDown}\n footer={\n dropdownStatus.isSticky ? (\n <DropdownFooter content={isOpen ? dropdownStatus.content : null} id={footerId} />\n ) : null\n }\n expandToViewport={expandToViewport}\n >\n <ListComponent\n listBottom={\n !dropdownStatus.isSticky ? (\n <DropdownFooter content={isOpen ? dropdownStatus.content : null} id={footerId} />\n ) : null\n }\n menuProps={menuProps}\n getOptionProps={getOptionProps}\n filteredOptions={filteredOptions}\n filteringValue={filteringValue}\n ref={scrollToIndex}\n hasDropdownStatus={dropdownStatus.content !== null}\n screenReaderContent={announcement}\n highlightType={highlightType}\n />\n </Dropdown>\n <ScreenreaderOnly id={selectAriaLabelId}>{ariaLabel}</ScreenreaderOnly>\n </div>\n );\n }\n);\n\nexport default InternalSelect;\n"]}