@cloudscape-design/components 3.0.681 → 3.0.682

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 (192) hide show
  1. package/button/index.d.ts.map +1 -1
  2. package/button/index.js +2 -2
  3. package/button/index.js.map +1 -1
  4. package/button/interfaces.d.ts +6 -0
  5. package/button/interfaces.d.ts.map +1 -1
  6. package/button/interfaces.js.map +1 -1
  7. package/button/internal.d.ts.map +1 -1
  8. package/button/internal.js +15 -4
  9. package/button/internal.js.map +1 -1
  10. package/button/styles.css.js +20 -19
  11. package/button/styles.scoped.css +161 -167
  12. package/button/styles.selectors.js +20 -19
  13. package/button/test-classes/styles.css.js +6 -0
  14. package/button/test-classes/styles.scoped.css +7 -0
  15. package/button/test-classes/styles.selectors.js +7 -0
  16. package/button-dropdown/category-elements/expandable-category-element.js +1 -1
  17. package/button-dropdown/category-elements/expandable-category-element.js.map +1 -1
  18. package/button-dropdown/category-elements/mobile-expandable-category-element.js +1 -1
  19. package/button-dropdown/category-elements/mobile-expandable-category-element.js.map +1 -1
  20. package/button-dropdown/index.d.ts.map +1 -1
  21. package/button-dropdown/index.js +2 -2
  22. package/button-dropdown/index.js.map +1 -1
  23. package/button-dropdown/interfaces.d.ts +7 -0
  24. package/button-dropdown/interfaces.d.ts.map +1 -1
  25. package/button-dropdown/interfaces.js.map +1 -1
  26. package/button-dropdown/internal.d.ts.map +1 -1
  27. package/button-dropdown/internal.js +4 -2
  28. package/button-dropdown/internal.js.map +1 -1
  29. package/button-dropdown/item-element/index.js +1 -1
  30. package/button-dropdown/item-element/index.js.map +1 -1
  31. package/calendar/grid/index.d.ts +3 -1
  32. package/calendar/grid/index.d.ts.map +1 -1
  33. package/calendar/grid/index.js +26 -6
  34. package/calendar/grid/index.js.map +1 -1
  35. package/calendar/grid/use-calendar-grid-keyboard-navigation.d.ts +2 -1
  36. package/calendar/grid/use-calendar-grid-keyboard-navigation.d.ts.map +1 -1
  37. package/calendar/grid/use-calendar-grid-keyboard-navigation.js +8 -5
  38. package/calendar/grid/use-calendar-grid-keyboard-navigation.js.map +1 -1
  39. package/calendar/interfaces.d.ts +9 -0
  40. package/calendar/interfaces.d.ts.map +1 -1
  41. package/calendar/interfaces.js.map +1 -1
  42. package/calendar/internal.d.ts +1 -1
  43. package/calendar/internal.d.ts.map +1 -1
  44. package/calendar/internal.js +7 -5
  45. package/calendar/internal.js.map +1 -1
  46. package/calendar/styles.css.js +21 -20
  47. package/calendar/styles.scoped.css +46 -42
  48. package/calendar/styles.selectors.js +21 -20
  49. package/calendar/utils/navigation.d.ts +10 -10
  50. package/calendar/utils/navigation.d.ts.map +1 -1
  51. package/calendar/utils/navigation.js +29 -29
  52. package/calendar/utils/navigation.js.map +1 -1
  53. package/date-picker/index.d.ts.map +1 -1
  54. package/date-picker/index.js +2 -2
  55. package/date-picker/index.js.map +1 -1
  56. package/date-range-picker/calendar/grids/grid.d.ts +2 -1
  57. package/date-range-picker/calendar/grids/grid.d.ts.map +1 -1
  58. package/date-range-picker/calendar/grids/grid.js +55 -7
  59. package/date-range-picker/calendar/grids/grid.js.map +1 -1
  60. package/date-range-picker/calendar/grids/index.d.ts +2 -1
  61. package/date-range-picker/calendar/grids/index.d.ts.map +1 -1
  62. package/date-range-picker/calendar/grids/index.js +20 -12
  63. package/date-range-picker/calendar/grids/index.js.map +1 -1
  64. package/date-range-picker/calendar/grids/styles.css.js +28 -27
  65. package/date-range-picker/calendar/grids/styles.scoped.css +46 -42
  66. package/date-range-picker/calendar/grids/styles.selectors.js +28 -27
  67. package/date-range-picker/calendar/index.d.ts +2 -1
  68. package/date-range-picker/calendar/index.d.ts.map +1 -1
  69. package/date-range-picker/calendar/index.js +2 -2
  70. package/date-range-picker/calendar/index.js.map +1 -1
  71. package/date-range-picker/dropdown.d.ts +2 -2
  72. package/date-range-picker/dropdown.d.ts.map +1 -1
  73. package/date-range-picker/dropdown.js +2 -2
  74. package/date-range-picker/dropdown.js.map +1 -1
  75. package/date-range-picker/index.d.ts.map +1 -1
  76. package/date-range-picker/index.js +2 -2
  77. package/date-range-picker/index.js.map +1 -1
  78. package/date-range-picker/interfaces.d.ts +9 -0
  79. package/date-range-picker/interfaces.d.ts.map +1 -1
  80. package/date-range-picker/interfaces.js.map +1 -1
  81. package/internal/base-component/styles.scoped.css +12 -10
  82. package/internal/components/option/interfaces.d.ts +2 -0
  83. package/internal/components/option/interfaces.d.ts.map +1 -1
  84. package/internal/components/option/interfaces.js.map +1 -1
  85. package/internal/components/selectable-item/index.d.ts +1 -0
  86. package/internal/components/selectable-item/index.d.ts.map +1 -1
  87. package/internal/components/selectable-item/index.js +3 -0
  88. package/internal/components/selectable-item/index.js.map +1 -1
  89. package/internal/components/tooltip/index.d.ts +3 -1
  90. package/internal/components/tooltip/index.d.ts.map +1 -1
  91. package/internal/components/tooltip/index.js +3 -3
  92. package/internal/components/tooltip/index.js.map +1 -1
  93. package/internal/environment.js +1 -1
  94. package/internal/environment.json +1 -1
  95. package/internal/generated/styles/tokens.d.ts +2 -0
  96. package/internal/generated/styles/tokens.js +4 -2
  97. package/internal/generated/theming/index.cjs +78 -12
  98. package/internal/generated/theming/index.cjs.d.ts +16 -0
  99. package/internal/generated/theming/index.d.ts +16 -0
  100. package/internal/generated/theming/index.js +78 -12
  101. package/{button-dropdown/utils/use-hidden-description.d.ts → internal/hooks/use-hidden-description/index.d.ts} +2 -1
  102. package/internal/hooks/use-hidden-description/index.d.ts.map +1 -0
  103. package/{button-dropdown/utils/use-hidden-description.js → internal/hooks/use-hidden-description/index.js} +3 -2
  104. package/internal/hooks/use-hidden-description/index.js.map +1 -0
  105. package/internal/manifest.json +1 -1
  106. package/package.json +1 -1
  107. package/segmented-control/interfaces.d.ts +2 -0
  108. package/segmented-control/interfaces.d.ts.map +1 -1
  109. package/segmented-control/interfaces.js.map +1 -1
  110. package/segmented-control/internal-segmented-control.d.ts.map +1 -1
  111. package/segmented-control/internal-segmented-control.js +11 -8
  112. package/segmented-control/internal-segmented-control.js.map +1 -1
  113. package/segmented-control/segment.d.ts.map +1 -1
  114. package/segmented-control/segment.js +14 -4
  115. package/segmented-control/segment.js.map +1 -1
  116. package/segmented-control/styles.css.js +15 -14
  117. package/segmented-control/styles.scoped.css +37 -33
  118. package/segmented-control/styles.selectors.js +15 -14
  119. package/select/interfaces.d.ts +1 -0
  120. package/select/interfaces.d.ts.map +1 -1
  121. package/select/interfaces.js.map +1 -1
  122. package/select/parts/filter.d.ts +1 -1
  123. package/select/parts/item.d.ts.map +1 -1
  124. package/select/parts/item.js +13 -3
  125. package/select/parts/item.js.map +1 -1
  126. package/select/parts/multiselect-item.d.ts.map +1 -1
  127. package/select/parts/multiselect-item.js +15 -3
  128. package/select/parts/multiselect-item.js.map +1 -1
  129. package/select/parts/styles.css.js +17 -16
  130. package/select/parts/styles.scoped.css +21 -17
  131. package/select/parts/styles.selectors.js +17 -16
  132. package/split-panel/icons/styles.css.js +22 -22
  133. package/split-panel/icons/styles.scoped.css +25 -25
  134. package/split-panel/icons/styles.selectors.js +22 -22
  135. package/table/body-cell/disabled-inline-editor.js +1 -1
  136. package/table/body-cell/disabled-inline-editor.js.map +1 -1
  137. package/tabs/interfaces.d.ts +5 -0
  138. package/tabs/interfaces.d.ts.map +1 -1
  139. package/tabs/interfaces.js.map +1 -1
  140. package/tabs/styles.css.js +28 -25
  141. package/tabs/styles.scoped.css +60 -49
  142. package/tabs/styles.selectors.js +28 -25
  143. package/tabs/tab-header-bar.d.ts.map +1 -1
  144. package/tabs/tab-header-bar.js +38 -14
  145. package/tabs/tab-header-bar.js.map +1 -1
  146. package/test-utils/dom/button/index.d.ts +1 -0
  147. package/test-utils/dom/button/index.js +6 -2
  148. package/test-utils/dom/button/index.js.map +1 -1
  149. package/test-utils/dom/button-dropdown/index.d.ts +2 -1
  150. package/test-utils/dom/button-dropdown/index.js +5 -1
  151. package/test-utils/dom/button-dropdown/index.js.map +1 -1
  152. package/test-utils/dom/calendar/index.d.ts +4 -1
  153. package/test-utils/dom/calendar/index.js +8 -1
  154. package/test-utils/dom/calendar/index.js.map +1 -1
  155. package/test-utils/dom/date-range-picker/index.d.ts +4 -1
  156. package/test-utils/dom/date-range-picker/index.js +8 -2
  157. package/test-utils/dom/date-range-picker/index.js.map +1 -1
  158. package/test-utils/dom/internal/dropdown-host.js.map +1 -1
  159. package/test-utils/dom/internal/option.d.ts +1 -0
  160. package/test-utils/dom/internal/option.js +4 -0
  161. package/test-utils/dom/internal/option.js.map +1 -1
  162. package/test-utils/dom/segmented-control/index.d.ts +9 -0
  163. package/test-utils/dom/segmented-control/index.js +15 -0
  164. package/test-utils/dom/segmented-control/index.js.map +1 -1
  165. package/test-utils/dom/tabs/index.d.ts +9 -2
  166. package/test-utils/dom/tabs/index.js +15 -2
  167. package/test-utils/dom/tabs/index.js.map +1 -1
  168. package/test-utils/selectors/button/index.d.ts +1 -0
  169. package/test-utils/selectors/button/index.js +6 -2
  170. package/test-utils/selectors/button/index.js.map +1 -1
  171. package/test-utils/selectors/button-dropdown/index.d.ts +2 -1
  172. package/test-utils/selectors/button-dropdown/index.js +5 -1
  173. package/test-utils/selectors/button-dropdown/index.js.map +1 -1
  174. package/test-utils/selectors/calendar/index.d.ts +4 -1
  175. package/test-utils/selectors/calendar/index.js +8 -1
  176. package/test-utils/selectors/calendar/index.js.map +1 -1
  177. package/test-utils/selectors/date-range-picker/index.d.ts +4 -1
  178. package/test-utils/selectors/date-range-picker/index.js +8 -2
  179. package/test-utils/selectors/date-range-picker/index.js.map +1 -1
  180. package/test-utils/selectors/internal/dropdown-host.js.map +1 -1
  181. package/test-utils/selectors/internal/option.d.ts +1 -0
  182. package/test-utils/selectors/internal/option.js +4 -0
  183. package/test-utils/selectors/internal/option.js.map +1 -1
  184. package/test-utils/selectors/segmented-control/index.d.ts +9 -0
  185. package/test-utils/selectors/segmented-control/index.js +15 -0
  186. package/test-utils/selectors/segmented-control/index.js.map +1 -1
  187. package/test-utils/selectors/tabs/index.d.ts +9 -2
  188. package/test-utils/selectors/tabs/index.js +15 -2
  189. package/test-utils/selectors/tabs/index.js.map +1 -1
  190. package/test-utils/tsconfig.tsbuildinfo +1 -1
  191. package/button-dropdown/utils/use-hidden-description.d.ts.map +0 -1
  192. package/button-dropdown/utils/use-hidden-description.js.map +0 -1
@@ -98,7 +98,7 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
98
98
  Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
99
99
  SPDX-License-Identifier: Apache-2.0
100
100
  */
101
- .awsui_segment_8cbea_gkapv_101:not(#\9) {
101
+ .awsui_segment_8cbea_8e18d_101:not(#\9) {
102
102
  font-size: var(--font-size-body-m-x4okxb, 14px);
103
103
  line-height: var(--line-height-body-m-30ar75, 20px);
104
104
  word-wrap: break-word;
@@ -117,41 +117,41 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
117
117
  color: var(--color-text-segment-default-nncpby, #414d5c);
118
118
  overflow: visible;
119
119
  }
120
- .awsui_segment_8cbea_gkapv_101:not(#\9):focus {
120
+ .awsui_segment_8cbea_8e18d_101:not(#\9):focus {
121
121
  outline: none;
122
122
  }
123
- .awsui_segment_8cbea_gkapv_101:not(#\9):nth-child(1) {
123
+ .awsui_segment_8cbea_8e18d_101:not(#\9):nth-child(1) {
124
124
  grid-column: 1;
125
125
  -ms-grid-column: 1;
126
126
  }
127
- .awsui_segment_8cbea_gkapv_101:not(#\9):nth-child(2) {
127
+ .awsui_segment_8cbea_8e18d_101:not(#\9):nth-child(2) {
128
128
  grid-column: 2;
129
129
  -ms-grid-column: 2;
130
130
  }
131
- .awsui_segment_8cbea_gkapv_101:not(#\9):nth-child(3) {
131
+ .awsui_segment_8cbea_8e18d_101:not(#\9):nth-child(3) {
132
132
  grid-column: 3;
133
133
  -ms-grid-column: 3;
134
134
  }
135
- .awsui_segment_8cbea_gkapv_101:not(#\9):nth-child(4) {
135
+ .awsui_segment_8cbea_8e18d_101:not(#\9):nth-child(4) {
136
136
  grid-column: 4;
137
137
  -ms-grid-column: 4;
138
138
  }
139
- .awsui_segment_8cbea_gkapv_101:not(#\9):nth-child(5) {
139
+ .awsui_segment_8cbea_8e18d_101:not(#\9):nth-child(5) {
140
140
  grid-column: 5;
141
141
  -ms-grid-column: 5;
142
142
  }
143
- .awsui_segment_8cbea_gkapv_101:not(#\9):nth-child(6) {
143
+ .awsui_segment_8cbea_8e18d_101:not(#\9):nth-child(6) {
144
144
  grid-column: 6;
145
145
  -ms-grid-column: 6;
146
146
  }
147
- body[data-awsui-focus-visible=true] .awsui_segment_8cbea_gkapv_101:not(#\9):focus {
147
+ body[data-awsui-focus-visible=true] .awsui_segment_8cbea_8e18d_101:not(#\9):focus {
148
148
  position: relative;
149
149
  }
150
- body[data-awsui-focus-visible=true] .awsui_segment_8cbea_gkapv_101:not(#\9):focus {
150
+ body[data-awsui-focus-visible=true] .awsui_segment_8cbea_8e18d_101:not(#\9):focus {
151
151
  outline: 2px dotted transparent;
152
152
  outline-offset: calc(var(--space-segmented-control-focus-outline-gutter-gbye20, 4px) - 1px);
153
153
  }
154
- body[data-awsui-focus-visible=true] .awsui_segment_8cbea_gkapv_101:not(#\9):focus::before {
154
+ body[data-awsui-focus-visible=true] .awsui_segment_8cbea_8e18d_101:not(#\9):focus::before {
155
155
  content: " ";
156
156
  display: block;
157
157
  position: absolute;
@@ -165,59 +165,59 @@ body[data-awsui-focus-visible=true] .awsui_segment_8cbea_gkapv_101:not(#\9):focu
165
165
  border-end-end-radius: var(--border-radius-control-default-focus-ring-u8zbsz, 4px);
166
166
  box-shadow: 0 0 0 2px var(--color-border-item-focused-b2ntyl, #0972d3);
167
167
  }
168
- .awsui_segment_8cbea_gkapv_101:not(#\9):last-child {
168
+ .awsui_segment_8cbea_8e18d_101:not(#\9):last-child {
169
169
  border-inline-end-width: var(--border-field-width-09w7vk, 2px);
170
170
  border-start-start-radius: 0;
171
171
  border-start-end-radius: var(--border-radius-button-ypmfry, 20px);
172
172
  border-end-start-radius: 0;
173
173
  border-end-end-radius: var(--border-radius-button-ypmfry, 20px);
174
174
  }
175
- .awsui_segment_8cbea_gkapv_101:not(#\9):first-child {
175
+ .awsui_segment_8cbea_8e18d_101:not(#\9):first-child {
176
176
  border-start-start-radius: var(--border-radius-button-ypmfry, 20px);
177
177
  border-start-end-radius: 0;
178
178
  border-end-start-radius: var(--border-radius-button-ypmfry, 20px);
179
179
  border-end-end-radius: 0;
180
180
  }
181
- .awsui_segment_8cbea_gkapv_101.awsui_disabled_8cbea_gkapv_181:not(#\9) {
181
+ .awsui_segment_8cbea_8e18d_101.awsui_disabled_8cbea_8e18d_181:not(#\9) {
182
182
  background: var(--color-background-segment-disabled-o4y9v5, #ffffff);
183
183
  border-color: var(--color-border-segment-disabled-ylnixy, #414d5c);
184
184
  color: var(--color-text-interactive-disabled-z7a3t4, #9ba7b6);
185
185
  }
186
- .awsui_segment_8cbea_gkapv_101:not(#\9):not(.awsui_disabled_8cbea_gkapv_181) + .awsui_segment_8cbea_gkapv_101.awsui_disabled_8cbea_gkapv_181 {
186
+ .awsui_segment_8cbea_8e18d_101:not(#\9):not(.awsui_disabled_8cbea_8e18d_181) + .awsui_segment_8cbea_8e18d_101.awsui_disabled_8cbea_8e18d_181 {
187
187
  border-inline-start-color: var(--color-border-segment-default-a5zrkd, #414d5c);
188
188
  }
189
- .awsui_segment_8cbea_gkapv_101.awsui_selected_8cbea_gkapv_189:not(#\9) {
189
+ .awsui_segment_8cbea_8e18d_101.awsui_selected_8cbea_8e18d_189:not(#\9) {
190
190
  background: var(--color-background-segment-active-366806, #0972d3);
191
191
  border-color: var(--color-border-segment-active-9ah16u, #414d5c);
192
192
  color: var(--color-text-segment-active-6s77n9, #ffffff);
193
193
  }
194
- .awsui_segment_8cbea_gkapv_101.awsui_selected_8cbea_gkapv_189 + .awsui_segment_8cbea_gkapv_101:not(#\9), .awsui_segment_8cbea_gkapv_101.awsui_selected_8cbea_gkapv_189 + .awsui_segment_8cbea_gkapv_101.awsui_disabled_8cbea_gkapv_181:not(#\9) {
194
+ .awsui_segment_8cbea_8e18d_101.awsui_selected_8cbea_8e18d_189 + .awsui_segment_8cbea_8e18d_101:not(#\9), .awsui_segment_8cbea_8e18d_101.awsui_selected_8cbea_8e18d_189 + .awsui_segment_8cbea_8e18d_101.awsui_disabled_8cbea_8e18d_181:not(#\9) {
195
195
  border-inline-start-color: var(--color-border-segment-active-9ah16u, #414d5c);
196
196
  }
197
- .awsui_segment_8cbea_gkapv_101:not(#\9):hover:not(.awsui_selected_8cbea_gkapv_189):not(.awsui_disabled_8cbea_gkapv_181):not(:focus) {
197
+ .awsui_segment_8cbea_8e18d_101:not(#\9):hover:not(.awsui_selected_8cbea_8e18d_189):not(.awsui_disabled_8cbea_8e18d_181):not(:focus) {
198
198
  background: var(--color-background-segment-hover-jysoxv, #ffffff);
199
199
  color: var(--color-text-segment-hover-k5ujfk, #0972d3);
200
200
  border-color: var(--color-border-segment-hover-ggg2rz, #414d5c);
201
201
  cursor: pointer;
202
202
  }
203
- .awsui_segment_8cbea_gkapv_101:not(#\9):hover:not(.awsui_selected_8cbea_gkapv_189):not(.awsui_disabled_8cbea_gkapv_181):not(:focus) + .awsui_segment_8cbea_gkapv_101:not(.awsui_selected_8cbea_gkapv_189) {
203
+ .awsui_segment_8cbea_8e18d_101:not(#\9):hover:not(.awsui_selected_8cbea_8e18d_189):not(.awsui_disabled_8cbea_8e18d_181):not(:focus) + .awsui_segment_8cbea_8e18d_101:not(.awsui_selected_8cbea_8e18d_189) {
204
204
  border-inline-start-color: var(--color-border-segment-hover-ggg2rz, #414d5c);
205
205
  }
206
- .awsui_segment_8cbea_gkapv_101.awsui_selected_8cbea_gkapv_189 + .awsui_segment_8cbea_gkapv_101:not(#\9):hover:not(.awsui_selected_8cbea_gkapv_189):not(.awsui_disabled_8cbea_gkapv_181):not(:focus) {
206
+ .awsui_segment_8cbea_8e18d_101.awsui_selected_8cbea_8e18d_189 + .awsui_segment_8cbea_8e18d_101:not(#\9):hover:not(.awsui_selected_8cbea_8e18d_189):not(.awsui_disabled_8cbea_8e18d_181):not(:focus) {
207
207
  border-inline-start-color: var(--color-border-segment-active-9ah16u, #414d5c);
208
208
  }
209
209
 
210
- .awsui_icon_8cbea_gkapv_210:not(#\9) {
210
+ .awsui_icon_8cbea_8e18d_210:not(#\9) {
211
211
  /* used in test-utils */
212
212
  }
213
213
 
214
- .awsui_with-text_8cbea_gkapv_214:not(#\9) {
214
+ .awsui_with-text_8cbea_8e18d_214:not(#\9) {
215
215
  position: relative;
216
216
  inset-inline-start: calc(-1 * var(--space-xxs-p8yyaw, 4px));
217
217
  margin-inline-end: var(--space-xxs-p8yyaw, 4px);
218
218
  }
219
219
 
220
- .awsui_with-no-text_8cbea_gkapv_220:not(#\9) {
220
+ .awsui_with-no-text_8cbea_8e18d_220:not(#\9) {
221
221
  margin-inline: auto;
222
222
  inset-inline: 0;
223
223
  }
@@ -226,7 +226,7 @@ body[data-awsui-focus-visible=true] .awsui_segment_8cbea_gkapv_101:not(#\9):focu
226
226
  Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
227
227
  SPDX-License-Identifier: Apache-2.0
228
228
  */
229
- .awsui_root_8cbea_gkapv_229:not(#\9) {
229
+ .awsui_root_8cbea_8e18d_229:not(#\9) {
230
230
  border-collapse: separate;
231
231
  border-spacing: 0;
232
232
  box-sizing: border-box;
@@ -262,40 +262,44 @@ body[data-awsui-focus-visible=true] .awsui_segment_8cbea_gkapv_101:not(#\9):focu
262
262
  -moz-osx-font-smoothing: auto;
263
263
  }
264
264
 
265
- .awsui_segment-part_8cbea_gkapv_264:not(#\9) {
265
+ .awsui_segment-part_8cbea_8e18d_264:not(#\9) {
266
266
  display: inline-grid;
267
267
  }
268
268
  @media (max-width: 688px) {
269
- .awsui_segment-part_8cbea_gkapv_264:not(#\9) {
269
+ .awsui_segment-part_8cbea_8e18d_264:not(#\9) {
270
270
  display: none;
271
271
  }
272
272
  }
273
273
 
274
- .awsui_select_8cbea_gkapv_189:not(#\9) {
274
+ .awsui_select_8cbea_8e18d_189:not(#\9) {
275
275
  display: none;
276
276
  }
277
277
  @media (max-width: 688px) {
278
- .awsui_select_8cbea_gkapv_189:not(#\9) {
278
+ .awsui_select_8cbea_8e18d_189:not(#\9) {
279
279
  display: block;
280
280
  }
281
281
  }
282
282
 
283
- .awsui_segment-count-2_8cbea_gkapv_283:not(#\9) {
283
+ .awsui_segment-count-2_8cbea_8e18d_283:not(#\9) {
284
284
  grid-template-columns: 1fr 1fr;
285
285
  }
286
286
 
287
- .awsui_segment-count-3_8cbea_gkapv_287:not(#\9) {
287
+ .awsui_segment-count-3_8cbea_8e18d_287:not(#\9) {
288
288
  grid-template-columns: 1fr 1fr 1fr;
289
289
  }
290
290
 
291
- .awsui_segment-count-4_8cbea_gkapv_291:not(#\9) {
291
+ .awsui_segment-count-4_8cbea_8e18d_291:not(#\9) {
292
292
  grid-template-columns: 1fr 1fr 1fr 1fr;
293
293
  }
294
294
 
295
- .awsui_segment-count-5_8cbea_gkapv_295:not(#\9) {
295
+ .awsui_segment-count-5_8cbea_8e18d_295:not(#\9) {
296
296
  grid-template-columns: 1fr 1fr 1fr 1fr 1fr;
297
297
  }
298
298
 
299
- .awsui_segment-count-6_8cbea_gkapv_299:not(#\9) {
299
+ .awsui_segment-count-6_8cbea_8e18d_299:not(#\9) {
300
300
  grid-template-columns: 1fr 1fr 1fr 1fr 1fr 1fr;
301
+ }
302
+
303
+ .awsui_disabled-reason-tooltip_8cbea_8e18d_303:not(#\9) {
304
+ /* used in test-utils or tests */
301
305
  }
@@ -2,19 +2,20 @@
2
2
  // es-module interop with Babel and Typescript
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
4
  module.exports.default = {
5
- "segment": "awsui_segment_8cbea_gkapv_101",
6
- "disabled": "awsui_disabled_8cbea_gkapv_181",
7
- "selected": "awsui_selected_8cbea_gkapv_189",
8
- "icon": "awsui_icon_8cbea_gkapv_210",
9
- "with-text": "awsui_with-text_8cbea_gkapv_214",
10
- "with-no-text": "awsui_with-no-text_8cbea_gkapv_220",
11
- "root": "awsui_root_8cbea_gkapv_229",
12
- "segment-part": "awsui_segment-part_8cbea_gkapv_264",
13
- "select": "awsui_select_8cbea_gkapv_189",
14
- "segment-count-2": "awsui_segment-count-2_8cbea_gkapv_283",
15
- "segment-count-3": "awsui_segment-count-3_8cbea_gkapv_287",
16
- "segment-count-4": "awsui_segment-count-4_8cbea_gkapv_291",
17
- "segment-count-5": "awsui_segment-count-5_8cbea_gkapv_295",
18
- "segment-count-6": "awsui_segment-count-6_8cbea_gkapv_299"
5
+ "segment": "awsui_segment_8cbea_8e18d_101",
6
+ "disabled": "awsui_disabled_8cbea_8e18d_181",
7
+ "selected": "awsui_selected_8cbea_8e18d_189",
8
+ "icon": "awsui_icon_8cbea_8e18d_210",
9
+ "with-text": "awsui_with-text_8cbea_8e18d_214",
10
+ "with-no-text": "awsui_with-no-text_8cbea_8e18d_220",
11
+ "root": "awsui_root_8cbea_8e18d_229",
12
+ "segment-part": "awsui_segment-part_8cbea_8e18d_264",
13
+ "select": "awsui_select_8cbea_8e18d_189",
14
+ "segment-count-2": "awsui_segment-count-2_8cbea_8e18d_283",
15
+ "segment-count-3": "awsui_segment-count-3_8cbea_8e18d_287",
16
+ "segment-count-4": "awsui_segment-count-4_8cbea_8e18d_291",
17
+ "segment-count-5": "awsui_segment-count-5_8cbea_8e18d_295",
18
+ "segment-count-6": "awsui_segment-count-6_8cbea_8e18d_299",
19
+ "disabled-reason-tooltip": "awsui_disabled-reason-tooltip_8cbea_8e18d_303"
19
20
  };
20
21
 
@@ -16,6 +16,7 @@ export interface BaseSelectProps extends BaseDropdownHostProps, BaseComponentPro
16
16
  * - `lang` (string) - (Optional) The language of the option, provided as a BCP 47 language tag.
17
17
  * - `description` (string) - (Optional) Further information about the option that appears below the label.
18
18
  * - `disabled` (boolean) - (Optional) Determines whether the option is disabled.
19
+ * - `disabledReason` (string) - (Optional) Displays tooltip near the item when disabled. Use to provide additional context.
19
20
  * - `labelTag` (string) - (Optional) A label tag that provides additional guidance, shown next to the label.
20
21
  * - `tags` [string[]] - (Optional) A list of tags giving further guidance about the option.
21
22
  * - `filteringTags` [string[]] - (Optional) A list of additional tags used for automatic filtering.
@@ -1 +1 @@
1
- {"version":3,"file":"interfaces.d.ts","sourceRoot":"","sources":["../../../src/select/interfaces.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAChE,OAAO,EAAE,+BAA+B,EAAE,MAAM,wCAAwC,CAAC;AACzF,OAAO,EAAE,yBAAyB,EAAE,MAAM,oBAAoB,CAAC;AAC/D,OAAO,EAAE,gBAAgB,EAAE,WAAW,IAAI,qBAAqB,EAAE,MAAM,0CAA0C,CAAC;AAClH,OAAO,EAAE,mBAAmB,EAAE,MAAM,mDAAmD,CAAC;AACxF,OAAO,EACL,qBAAqB,EACrB,oBAAoB,EACpB,sBAAsB,EACvB,MAAM,4CAA4C,CAAC;AAEpD,MAAM,WAAW,eACf,SAAQ,qBAAqB,EAC3B,kBAAkB,EAClB,+BAA+B,EAC/B,mBAAmB;IACrB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;QA8BI;IACJ,OAAO,CAAC,EAAE,WAAW,CAAC,OAAO,CAAC;IAC9B;;;;;;;;;;;;;;;;QAgBI;IACJ,aAAa,CAAC,EAAE,oBAAoB,CAAC;IAErC;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;OAEG;IACH,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAE9B;;OAEG;IACH,oBAAoB,CAAC,EAAE,CAAC,YAAY,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,KAAK,MAAM,CAAC;IAC5E;;OAEG;IACH,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B;;;OAGG;IACH,uBAAuB,CAAC,EAAE,MAAM,CAAC;IACjC;;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Ac,EAAE,MAAM,CAAC;KACxB;IAED,UAAiB,8BAA8B;QAC7C,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,WAAW,GAAG,MAAM,CAAC;KAC/C;IAED,UAAiB,GAAG;QAClB;;WAEG;QACH,KAAK,IAAI,IAAI,CAAC;KACf;CACF"}
@@ -1 +1 @@
1
- {"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../src/select/interfaces.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\nimport { BaseComponentProps } from '../internal/base-component';\nimport { FormFieldValidationControlProps } from '../internal/context/form-field-context';\nimport { NonCancelableEventHandler } from '../internal/events';\nimport { OptionDefinition, OptionGroup as OptionGroupDefinition } from '../internal/components/option/interfaces';\nimport { DropdownStatusProps } from '../internal/components/dropdown-status/interfaces';\nimport {\n BaseDropdownHostProps,\n OptionsFilteringType,\n OptionsLoadItemsDetail,\n} from '../internal/components/dropdown/interfaces';\n\nexport interface BaseSelectProps\n extends BaseDropdownHostProps,\n BaseComponentProps,\n FormFieldValidationControlProps,\n DropdownStatusProps {\n /**\n * Specifies an array of options that are displayed to the user as a dropdown list.\n * The options can be grouped using `OptionGroup` objects.\n *\n * #### Option\n * - `value` (string) - The returned value of the option when selected.\n * - `label` (string) - (Optional) Option text displayed to the user.\n * - `lang` (string) - (Optional) The language of the option, provided as a BCP 47 language tag.\n * - `description` (string) - (Optional) Further information about the option that appears below the label.\n * - `disabled` (boolean) - (Optional) Determines whether the option is disabled.\n * - `labelTag` (string) - (Optional) A label tag that provides additional guidance, shown next to the label.\n * - `tags` [string[]] - (Optional) A list of tags giving further guidance about the option.\n * - `filteringTags` [string[]] - (Optional) A list of additional tags used for automatic filtering.\n * - `iconName` (string) - (Optional) Specifies the name of an [icon](/components/icon/) to display in the option.\n * - `iconAlt` (string) - (Optional) Specifies alternate text for a custom icon, for use with `iconUrl`.\n * - `iconUrl` (string) - (Optional) URL of a custom icon.\n * - `iconSvg` (ReactNode) - (Optional) Custom SVG icon. Equivalent to the `svg` slot of the [icon component](/components/icon/).\n *\n * #### OptionGroup\n * - `label` (string) - Option group text displayed to the user.\n * - `disabled` (boolean) - (Optional) Determines whether the option group is disabled.\n * - `options` (Option[]) - (Optional) The options under this group.\n *\n * Note: Only one level of option nesting is supported.\n *\n * If you want to use the built-in filtering capabilities of this component, provide\n * a list of all valid options here and they will be automatically filtered based on the user's filtering input.\n *\n * Alternatively, you can listen to the `onChange` or `onLoadItems` event and set new options\n * on your own.\n **/\n options?: SelectProps.Options;\n /**\n * Determines how filtering is applied to the list of `options`:\n *\n * * `auto` - The component will automatically filter options based on user input.\n * * `manual` - You will set up `onChange` or `onLoadItems` event listeners and filter options on your side or request\n * them from server.\n *\n * By default the component will filter the provided `options` based on the value of the filtering input field.\n * Only options that have a `value`, `label`, `description` or `labelTag` that contains the input value as a substring\n * are displayed in the list of options.\n *\n * If you set this property to `manual`, this default filtering mechanism is disabled and all provided `options` are\n * displayed in the dropdown list. In that case make sure that you use the `onChange` or `onLoadItems` events in order\n * to set the `options` property to the options that are relevant for the user, given the filtering input value.\n *\n * Note: Manual filtering doesn't disable match highlighting.\n **/\n filteringType?: OptionsFilteringType;\n\n /**\n * Determines whether the whole select component is disabled.\n */\n disabled?: boolean;\n /**\n * Specifies the placeholder to display in the filtering input if filtering is enabled.\n */\n filteringPlaceholder?: string;\n\n /**\n * Specifies the text to display with the number of matches at the bottom of the dropdown menu while filtering.\n */\n filteringResultsText?: (matchesCount: number, totalCount: number) => string;\n /**\n * Adds an `aria-label` on the built-in filtering input if filtering is enabled.\n */\n filteringAriaLabel?: string;\n /**\n * Adds an `aria-label` to the clear button inside the search input.\n * @i18n\n */\n filteringClearAriaLabel?: string;\n /**\n * @deprecated Has no effect.\n */\n name?: string;\n /**\n * Specifies the hint text that's displayed in the field when no option has been selected.\n */\n placeholder?: string;\n /**\n * Specifies the ID for the trigger component. It uses an automatically generated ID by default.\n */\n controlId?: string;\n /**\n * Adds `aria-required` to the native input element.\n */\n ariaRequired?: boolean;\n /**\n * Adds `aria-label` to the select element.\n * Use this if you don't have a visible label for this control.\n */\n ariaLabel?: string;\n /**\n * Specifies the localized string that describes an option as being selected.\n * This is required to provide a good screen reader experience. For more information, see the\n * [accessibility guidelines](/components/select/?tabId=usage#accessibility-guidelines).\n * @i18n\n */\n selectedAriaLabel?: string;\n /**\n * Overrides the element that is announced to screen readers\n * when the highlighted option changes. By default, this announces\n * the option's name and properties, and its selected state if\n * the `selectedLabel` property is defined.\n * The highlighted option is provided, and its group (if groups\n * are used and it differs from the group of the previously highlighted option).\n *\n * For more information, see the\n * [accessibility guidelines](/components/select/?tabId=usage#accessibility-guidelines).\n */\n renderHighlightedAriaLive?: SelectProps.ContainingOptionAndGroupString;\n /**\n * Displayed for `filteringType=\"auto\"` when there are no matches for the filtering.\n */\n noMatch?: React.ReactNode;\n /**\n * Called when input focus is removed from the UI control.\n */\n onBlur?: NonCancelableEventHandler;\n /**\n * Called when input focus is set onto the UI control.\n */\n onFocus?: NonCancelableEventHandler;\n\n /**\n * Specifies if the control is read-only, which prevents the\n * user from both modifying the value and opening the dropdown. A read-only control is still focusable.\n */\n readOnly?: boolean;\n}\n\nexport interface SelectProps extends BaseSelectProps {\n /**\n * Defines the variant of the trigger. You can use a simple label or the entire option (`label | option`)\n */\n triggerVariant?: SelectProps.TriggerVariant;\n /**\n * Specifies the currently selected option.\n * If you want to clear the selection, use `null`.\n */\n selectedOption: SelectProps.Option | null;\n /**\n * Called when the user selects an option.\n * The event `detail` contains the current `selectedOption`.\n */\n onChange?: NonCancelableEventHandler<SelectProps.ChangeDetail>;\n\n /**\n * Automatically focuses the trigger when component is mounted.\n */\n autoFocus?: boolean;\n}\n\nexport namespace SelectProps {\n export type FilteringType = OptionsFilteringType;\n export type TriggerVariant = 'label' | 'option';\n\n export type Option = OptionDefinition;\n export type OptionGroup = OptionGroupDefinition;\n export type Options = ReadonlyArray<Option | OptionGroup>;\n\n export type LoadItemsDetail = OptionsLoadItemsDetail;\n\n export interface ChangeDetail {\n selectedOption: Option;\n }\n\n export interface ContainingOptionAndGroupString {\n (option: Option, group?: OptionGroup): string;\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/select/interfaces.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\nimport { BaseComponentProps } from '../internal/base-component';\nimport { FormFieldValidationControlProps } from '../internal/context/form-field-context';\nimport { NonCancelableEventHandler } from '../internal/events';\nimport { OptionDefinition, OptionGroup as OptionGroupDefinition } from '../internal/components/option/interfaces';\nimport { DropdownStatusProps } from '../internal/components/dropdown-status/interfaces';\nimport {\n BaseDropdownHostProps,\n OptionsFilteringType,\n OptionsLoadItemsDetail,\n} from '../internal/components/dropdown/interfaces';\n\nexport interface BaseSelectProps\n extends BaseDropdownHostProps,\n BaseComponentProps,\n FormFieldValidationControlProps,\n DropdownStatusProps {\n /**\n * Specifies an array of options that are displayed to the user as a dropdown list.\n * The options can be grouped using `OptionGroup` objects.\n *\n * #### Option\n * - `value` (string) - The returned value of the option when selected.\n * - `label` (string) - (Optional) Option text displayed to the user.\n * - `lang` (string) - (Optional) The language of the option, provided as a BCP 47 language tag.\n * - `description` (string) - (Optional) Further information about the option that appears below the label.\n * - `disabled` (boolean) - (Optional) Determines whether the option is disabled.\n * - `disabledReason` (string) - (Optional) Displays tooltip near the item when disabled. Use to provide additional context.\n * - `labelTag` (string) - (Optional) A label tag that provides additional guidance, shown next to the label.\n * - `tags` [string[]] - (Optional) A list of tags giving further guidance about the option.\n * - `filteringTags` [string[]] - (Optional) A list of additional tags used for automatic filtering.\n * - `iconName` (string) - (Optional) Specifies the name of an [icon](/components/icon/) to display in the option.\n * - `iconAlt` (string) - (Optional) Specifies alternate text for a custom icon, for use with `iconUrl`.\n * - `iconUrl` (string) - (Optional) URL of a custom icon.\n * - `iconSvg` (ReactNode) - (Optional) Custom SVG icon. Equivalent to the `svg` slot of the [icon component](/components/icon/).\n *\n * #### OptionGroup\n * - `label` (string) - Option group text displayed to the user.\n * - `disabled` (boolean) - (Optional) Determines whether the option group is disabled.\n * - `options` (Option[]) - (Optional) The options under this group.\n *\n * Note: Only one level of option nesting is supported.\n *\n * If you want to use the built-in filtering capabilities of this component, provide\n * a list of all valid options here and they will be automatically filtered based on the user's filtering input.\n *\n * Alternatively, you can listen to the `onChange` or `onLoadItems` event and set new options\n * on your own.\n **/\n options?: SelectProps.Options;\n /**\n * Determines how filtering is applied to the list of `options`:\n *\n * * `auto` - The component will automatically filter options based on user input.\n * * `manual` - You will set up `onChange` or `onLoadItems` event listeners and filter options on your side or request\n * them from server.\n *\n * By default the component will filter the provided `options` based on the value of the filtering input field.\n * Only options that have a `value`, `label`, `description` or `labelTag` that contains the input value as a substring\n * are displayed in the list of options.\n *\n * If you set this property to `manual`, this default filtering mechanism is disabled and all provided `options` are\n * displayed in the dropdown list. In that case make sure that you use the `onChange` or `onLoadItems` events in order\n * to set the `options` property to the options that are relevant for the user, given the filtering input value.\n *\n * Note: Manual filtering doesn't disable match highlighting.\n **/\n filteringType?: OptionsFilteringType;\n\n /**\n * Determines whether the whole select component is disabled.\n */\n disabled?: boolean;\n /**\n * Specifies the placeholder to display in the filtering input if filtering is enabled.\n */\n filteringPlaceholder?: string;\n\n /**\n * Specifies the text to display with the number of matches at the bottom of the dropdown menu while filtering.\n */\n filteringResultsText?: (matchesCount: number, totalCount: number) => string;\n /**\n * Adds an `aria-label` on the built-in filtering input if filtering is enabled.\n */\n filteringAriaLabel?: string;\n /**\n * Adds an `aria-label` to the clear button inside the search input.\n * @i18n\n */\n filteringClearAriaLabel?: string;\n /**\n * @deprecated Has no effect.\n */\n name?: string;\n /**\n * Specifies the hint text that's displayed in the field when no option has been selected.\n */\n placeholder?: string;\n /**\n * Specifies the ID for the trigger component. It uses an automatically generated ID by default.\n */\n controlId?: string;\n /**\n * Adds `aria-required` to the native input element.\n */\n ariaRequired?: boolean;\n /**\n * Adds `aria-label` to the select element.\n * Use this if you don't have a visible label for this control.\n */\n ariaLabel?: string;\n /**\n * Specifies the localized string that describes an option as being selected.\n * This is required to provide a good screen reader experience. For more information, see the\n * [accessibility guidelines](/components/select/?tabId=usage#accessibility-guidelines).\n * @i18n\n */\n selectedAriaLabel?: string;\n /**\n * Overrides the element that is announced to screen readers\n * when the highlighted option changes. By default, this announces\n * the option's name and properties, and its selected state if\n * the `selectedLabel` property is defined.\n * The highlighted option is provided, and its group (if groups\n * are used and it differs from the group of the previously highlighted option).\n *\n * For more information, see the\n * [accessibility guidelines](/components/select/?tabId=usage#accessibility-guidelines).\n */\n renderHighlightedAriaLive?: SelectProps.ContainingOptionAndGroupString;\n /**\n * Displayed for `filteringType=\"auto\"` when there are no matches for the filtering.\n */\n noMatch?: React.ReactNode;\n /**\n * Called when input focus is removed from the UI control.\n */\n onBlur?: NonCancelableEventHandler;\n /**\n * Called when input focus is set onto the UI control.\n */\n onFocus?: NonCancelableEventHandler;\n\n /**\n * Specifies if the control is read-only, which prevents the\n * user from both modifying the value and opening the dropdown. A read-only control is still focusable.\n */\n readOnly?: boolean;\n}\n\nexport interface SelectProps extends BaseSelectProps {\n /**\n * Defines the variant of the trigger. You can use a simple label or the entire option (`label | option`)\n */\n triggerVariant?: SelectProps.TriggerVariant;\n /**\n * Specifies the currently selected option.\n * If you want to clear the selection, use `null`.\n */\n selectedOption: SelectProps.Option | null;\n /**\n * Called when the user selects an option.\n * The event `detail` contains the current `selectedOption`.\n */\n onChange?: NonCancelableEventHandler<SelectProps.ChangeDetail>;\n\n /**\n * Automatically focuses the trigger when component is mounted.\n */\n autoFocus?: boolean;\n}\n\nexport namespace SelectProps {\n export type FilteringType = OptionsFilteringType;\n export type TriggerVariant = 'label' | 'option';\n\n export type Option = OptionDefinition;\n export type OptionGroup = OptionGroupDefinition;\n export type Options = ReadonlyArray<Option | OptionGroup>;\n\n export type LoadItemsDetail = OptionsLoadItemsDetail;\n\n export interface ChangeDetail {\n selectedOption: Option;\n }\n\n export interface ContainingOptionAndGroupString {\n (option: Option, group?: OptionGroup): string;\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"]}
@@ -5,6 +5,6 @@ export interface FilterProps extends InternalInputProps {
5
5
  ref?: React.Ref<HTMLInputElement>;
6
6
  filteringType: SelectProps.FilteringType;
7
7
  }
8
- declare const Filter: React.ForwardRefExoticComponent<Pick<FilterProps, "disabled" | "autoComplete" | "autoFocus" | "name" | "className" | "id" | "placeholder" | "inputMode" | "type" | "readOnly" | "step" | "value" | "onFocus" | "onBlur" | "onChange" | "onKeyDown" | "onKeyUp" | "warning" | "invalid" | "__internalRootRef" | "ariaLabel" | "ariaDescribedby" | "__nativeAttributes" | "clearAriaLabel" | "ariaLabelledby" | "controlId" | "filteringType" | "ariaRequired" | "disableBrowserAutocorrect" | "spellcheck" | "__leftIcon" | "__leftIconVariant" | "__onLeftIconClick" | "__rightIcon" | "__onRightIconClick" | "__noBorderRadius" | "__onDelayedInput" | "__onBlurWithDetail" | "__inheritFormFieldProps"> & React.RefAttributes<HTMLInputElement>>;
8
+ declare const Filter: React.ForwardRefExoticComponent<Pick<FilterProps, "disabled" | "autoComplete" | "autoFocus" | "name" | "className" | "id" | "placeholder" | "inputMode" | "type" | "readOnly" | "step" | "value" | "onFocus" | "onBlur" | "onChange" | "onKeyDown" | "onKeyUp" | "warning" | "invalid" | "__internalRootRef" | "ariaLabel" | "ariaDescribedby" | "clearAriaLabel" | "ariaLabelledby" | "__nativeAttributes" | "controlId" | "filteringType" | "ariaRequired" | "disableBrowserAutocorrect" | "spellcheck" | "__leftIcon" | "__leftIconVariant" | "__onLeftIconClick" | "__rightIcon" | "__onRightIconClick" | "__noBorderRadius" | "__onDelayedInput" | "__onBlurWithDetail" | "__inheritFormFieldProps"> & React.RefAttributes<HTMLInputElement>>;
9
9
  export default Filter;
10
10
  //# sourceMappingURL=filter.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"item.d.ts","sourceRoot":"","sources":["../../../../src/select/parts/item.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAM1B,OAAO,EAAE,cAAc,EAAoB,MAAM,6CAA6C,CAAC;AAG/F,OAAO,EAAE,aAAa,EAAE,MAAM,sEAAsE,CAAC;AAErG,MAAM,WAAW,SAAS;IACxB,MAAM,EAAE,cAAc,CAAC;IACvB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,aAAa,CAAC,EAAE,aAAa,CAAC,MAAM,CAAC,CAAC;CACvC;;AAuED,wBAAkD"}
1
+ {"version":3,"file":"item.d.ts","sourceRoot":"","sources":["../../../../src/select/parts/item.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAiB,MAAM,OAAO,CAAC;AAMtC,OAAO,EAAE,cAAc,EAAoB,MAAM,6CAA6C,CAAC;AAG/F,OAAO,EAAE,aAAa,EAAE,MAAM,sEAAsE,CAAC;AAKrG,MAAM,WAAW,SAAS;IACxB,MAAM,EAAE,cAAc,CAAC;IACvB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,aAAa,CAAC,EAAE,aAAa,CAAC,MAAM,CAAC,CAAC;CACvC;;AA0FD,wBAAkD"}
@@ -1,7 +1,7 @@
1
1
  import { __rest } from "tslib";
2
2
  // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
3
  // SPDX-License-Identifier: Apache-2.0
4
- import React from 'react';
4
+ import React, { useRef } from 'react';
5
5
  import clsx from 'clsx';
6
6
  import styles from './styles.css.js';
7
7
  import Option from '../../internal/components/option';
@@ -9,6 +9,9 @@ import SelectableItem from '../../internal/components/selectable-item';
9
9
  import { getBaseProps } from '../../internal/base-component';
10
10
  import CheckboxIcon from '../../internal/components/checkbox-icon';
11
11
  import InternalIcon from '../../icon/internal.js';
12
+ import useHiddenDescription from '../../internal/hooks/use-hidden-description';
13
+ import Tooltip from '../../internal/components/tooltip';
14
+ import { useMergeRefs } from '../../internal/hooks/use-merge-refs';
12
15
  const Item = (_a, ref) => {
13
16
  var { option, highlighted, selected, filteringValue, hasCheckbox, virtualPosition, padBottom, isNextSelected, screenReaderContent, ariaPosinset, ariaSetsize, highlightType } = _a, restProps = __rest(_a, ["option", "highlighted", "selected", "filteringValue", "hasCheckbox", "virtualPosition", "padBottom", "isNextSelected", "screenReaderContent", "ariaPosinset", "ariaSetsize", "highlightType"]);
14
17
  const baseProps = getBaseProps(restProps);
@@ -16,13 +19,20 @@ const Item = (_a, ref) => {
16
19
  const isChild = option.type === 'child';
17
20
  const wrappedOption = option.option;
18
21
  const disabled = option.disabled || wrappedOption.disabled;
19
- return (React.createElement(SelectableItem, Object.assign({ ariaSelected: Boolean(selected), selected: selected, isNextSelected: isNextSelected, highlighted: highlighted, disabled: option.disabled, isParent: isParent, isChild: isChild, ref: ref, virtualPosition: virtualPosition, padBottom: padBottom, screenReaderContent: screenReaderContent, ariaPosinset: ariaPosinset, ariaSetsize: ariaSetsize, highlightType: highlightType }, baseProps),
22
+ const disabledReason = disabled && wrappedOption.disabledReason ? wrappedOption.disabledReason : '';
23
+ const isDisabledWithReason = !!disabledReason;
24
+ const internalRef = useRef(null);
25
+ const { descriptionEl, descriptionId } = useHiddenDescription(disabledReason);
26
+ return (React.createElement(SelectableItem, Object.assign({ ariaSelected: Boolean(selected), selected: selected, isNextSelected: isNextSelected, highlighted: highlighted, disabled: option.disabled, isParent: isParent, isChild: isChild, ref: useMergeRefs(ref, internalRef), virtualPosition: virtualPosition, padBottom: padBottom, screenReaderContent: screenReaderContent, ariaPosinset: ariaPosinset, ariaSetsize: ariaSetsize, highlightType: highlightType, ariaDescribedby: isDisabledWithReason ? descriptionId : '' }, baseProps),
20
27
  React.createElement("div", { className: clsx(styles.item, !isParent && wrappedOption.labelTag && styles['show-label-tag']) },
21
28
  hasCheckbox && !isParent && (React.createElement("div", { className: styles.checkbox },
22
29
  React.createElement(CheckboxIcon, { checked: selected || false, disabled: option.disabled }))),
23
30
  isParent ? (React.createElement("span", null, wrappedOption.label || wrappedOption.value)) : (React.createElement(Option, { option: Object.assign(Object.assign({}, wrappedOption), { disabled }), highlightedOption: highlighted, selectedOption: selected, highlightText: filteringValue })),
24
31
  !hasCheckbox && !isParent && selected && (React.createElement("div", { className: styles['selected-icon'] },
25
- React.createElement(InternalIcon, { name: "check" }))))));
32
+ React.createElement(InternalIcon, { name: "check" }))),
33
+ isDisabledWithReason && (React.createElement(React.Fragment, null,
34
+ descriptionEl,
35
+ highlighted && (React.createElement(Tooltip, { className: styles['disabled-reason-tooltip'], trackRef: internalRef, value: disabledReason, position: "right" })))))));
26
36
  };
27
37
  export default React.memo(React.forwardRef(Item));
28
38
  //# sourceMappingURL=item.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"item.js","sourceRoot":"","sources":["../../../../src/select/parts/item.tsx"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,MAAM,MAAM,iBAAiB,CAAC;AACrC,OAAO,MAAM,MAAM,kCAAkC,CAAC;AACtD,OAAO,cAAc,MAAM,2CAA2C,CAAC;AACvE,OAAO,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAE7D,OAAO,YAAY,MAAM,yCAAyC,CAAC;AACnE,OAAO,YAAY,MAAM,wBAAwB,CAAC;AAkBlD,MAAM,IAAI,GAAG,CACX,EAcY,EACZ,GAA8B,EAC9B,EAAE;QAhBF,EACE,MAAM,EACN,WAAW,EACX,QAAQ,EACR,cAAc,EACd,WAAW,EACX,eAAe,EACf,SAAS,EACT,cAAc,EACd,mBAAmB,EACnB,YAAY,EACZ,WAAW,EACX,aAAa,OAEH,EADP,SAAS,cAbd,+LAcC,CADa;IAId,MAAM,SAAS,GAAG,YAAY,CAAC,SAAS,CAAC,CAAC;IAE1C,MAAM,QAAQ,GAAG,MAAM,CAAC,IAAI,KAAK,QAAQ,CAAC;IAC1C,MAAM,OAAO,GAAG,MAAM,CAAC,IAAI,KAAK,OAAO,CAAC;IACxC,MAAM,aAAa,GAAqB,MAAM,CAAC,MAAM,CAAC;IACtD,MAAM,QAAQ,GAAG,MAAM,CAAC,QAAQ,IAAI,aAAa,CAAC,QAAQ,CAAC;IAE3D,OAAO,CACL,oBAAC,cAAc,kBACb,YAAY,EAAE,OAAO,CAAC,QAAQ,CAAC,EAC/B,QAAQ,EAAE,QAAQ,EAClB,cAAc,EAAE,cAAc,EAC9B,WAAW,EAAE,WAAW,EACxB,QAAQ,EAAE,MAAM,CAAC,QAAQ,EACzB,QAAQ,EAAE,QAAQ,EAClB,OAAO,EAAE,OAAO,EAChB,GAAG,EAAE,GAAG,EACR,eAAe,EAAE,eAAe,EAChC,SAAS,EAAE,SAAS,EACpB,mBAAmB,EAAE,mBAAmB,EACxC,YAAY,EAAE,YAAY,EAC1B,WAAW,EAAE,WAAW,EACxB,aAAa,EAAE,aAAa,IACxB,SAAS;QAEb,6BAAK,SAAS,EAAE,IAAI,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC,QAAQ,IAAI,aAAa,CAAC,QAAQ,IAAI,MAAM,CAAC,gBAAgB,CAAC,CAAC;YAC/F,WAAW,IAAI,CAAC,QAAQ,IAAI,CAC3B,6BAAK,SAAS,EAAE,MAAM,CAAC,QAAQ;gBAC7B,oBAAC,YAAY,IAAC,OAAO,EAAE,QAAQ,IAAI,KAAK,EAAE,QAAQ,EAAE,MAAM,CAAC,QAAQ,GAAI,CACnE,CACP;YACA,QAAQ,CAAC,CAAC,CAAC,CACV,kCAAO,aAAa,CAAC,KAAK,IAAI,aAAa,CAAC,KAAK,CAAQ,CAC1D,CAAC,CAAC,CAAC,CACF,oBAAC,MAAM,IACL,MAAM,kCAAO,aAAa,KAAE,QAAQ,KACpC,iBAAiB,EAAE,WAAW,EAC9B,cAAc,EAAE,QAAQ,EACxB,aAAa,EAAE,cAAc,GAC7B,CACH;YACA,CAAC,WAAW,IAAI,CAAC,QAAQ,IAAI,QAAQ,IAAI,CACxC,6BAAK,SAAS,EAAE,MAAM,CAAC,eAAe,CAAC;gBACrC,oBAAC,YAAY,IAAC,IAAI,EAAC,OAAO,GAAG,CACzB,CACP,CACG,CACS,CAClB,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\nimport clsx from 'clsx';\nimport styles from './styles.css.js';\nimport Option from '../../internal/components/option';\nimport SelectableItem from '../../internal/components/selectable-item';\nimport { getBaseProps } from '../../internal/base-component';\nimport { DropdownOption, OptionDefinition } from '../../internal/components/option/interfaces';\nimport CheckboxIcon from '../../internal/components/checkbox-icon';\nimport InternalIcon from '../../icon/internal.js';\nimport { HighlightType } from '../../internal/components/options-list/utils/use-highlight-option.js';\n\nexport interface ItemProps {\n option: DropdownOption;\n highlighted?: boolean;\n selected?: boolean;\n filteringValue?: string;\n hasCheckbox?: boolean;\n virtualPosition?: number;\n padBottom?: boolean;\n isNextSelected?: boolean;\n screenReaderContent?: string;\n ariaPosinset?: number;\n ariaSetsize?: number;\n highlightType?: HighlightType['type'];\n}\n\nconst Item = (\n {\n option,\n highlighted,\n selected,\n filteringValue,\n hasCheckbox,\n virtualPosition,\n padBottom,\n isNextSelected,\n screenReaderContent,\n ariaPosinset,\n ariaSetsize,\n highlightType,\n ...restProps\n }: ItemProps,\n ref: React.Ref<HTMLDivElement>\n) => {\n const baseProps = getBaseProps(restProps);\n\n const isParent = option.type === 'parent';\n const isChild = option.type === 'child';\n const wrappedOption: OptionDefinition = option.option;\n const disabled = option.disabled || wrappedOption.disabled;\n\n return (\n <SelectableItem\n ariaSelected={Boolean(selected)}\n selected={selected}\n isNextSelected={isNextSelected}\n highlighted={highlighted}\n disabled={option.disabled}\n isParent={isParent}\n isChild={isChild}\n ref={ref}\n virtualPosition={virtualPosition}\n padBottom={padBottom}\n screenReaderContent={screenReaderContent}\n ariaPosinset={ariaPosinset}\n ariaSetsize={ariaSetsize}\n highlightType={highlightType}\n {...baseProps}\n >\n <div className={clsx(styles.item, !isParent && wrappedOption.labelTag && styles['show-label-tag'])}>\n {hasCheckbox && !isParent && (\n <div className={styles.checkbox}>\n <CheckboxIcon checked={selected || false} disabled={option.disabled} />\n </div>\n )}\n {isParent ? (\n <span>{wrappedOption.label || wrappedOption.value}</span>\n ) : (\n <Option\n option={{ ...wrappedOption, disabled }}\n highlightedOption={highlighted}\n selectedOption={selected}\n highlightText={filteringValue}\n />\n )}\n {!hasCheckbox && !isParent && selected && (\n <div className={styles['selected-icon']}>\n <InternalIcon name=\"check\" />\n </div>\n )}\n </div>\n </SelectableItem>\n );\n};\n\nexport default React.memo(React.forwardRef(Item));\n"]}
1
+ {"version":3,"file":"item.js","sourceRoot":"","sources":["../../../../src/select/parts/item.tsx"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AACtC,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,MAAM,MAAM,iBAAiB,CAAC;AACrC,OAAO,MAAM,MAAM,kCAAkC,CAAC;AACtD,OAAO,cAAc,MAAM,2CAA2C,CAAC;AACvE,OAAO,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAE7D,OAAO,YAAY,MAAM,yCAAyC,CAAC;AACnE,OAAO,YAAY,MAAM,wBAAwB,CAAC;AAElD,OAAO,oBAAoB,MAAM,6CAA6C,CAAC;AAC/E,OAAO,OAAO,MAAM,mCAAmC,CAAC;AACxD,OAAO,EAAE,YAAY,EAAE,MAAM,qCAAqC,CAAC;AAiBnE,MAAM,IAAI,GAAG,CACX,EAcY,EACZ,GAA8B,EAC9B,EAAE;QAhBF,EACE,MAAM,EACN,WAAW,EACX,QAAQ,EACR,cAAc,EACd,WAAW,EACX,eAAe,EACf,SAAS,EACT,cAAc,EACd,mBAAmB,EACnB,YAAY,EACZ,WAAW,EACX,aAAa,OAEH,EADP,SAAS,cAbd,+LAcC,CADa;IAId,MAAM,SAAS,GAAG,YAAY,CAAC,SAAS,CAAC,CAAC;IAE1C,MAAM,QAAQ,GAAG,MAAM,CAAC,IAAI,KAAK,QAAQ,CAAC;IAC1C,MAAM,OAAO,GAAG,MAAM,CAAC,IAAI,KAAK,OAAO,CAAC;IACxC,MAAM,aAAa,GAAqB,MAAM,CAAC,MAAM,CAAC;IACtD,MAAM,QAAQ,GAAG,MAAM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QAAQ,CAAC,CAAC,CAAC,CACV,kCAAO,aAAa,CAAC,KAAK,IAAI,aAAa,CAAC,KAAK,CAAQ,CAC1D,CAAC,CAAC,CAAC,CACF,oBAAC,MAAM,IACL,MAAM,kCAAO,aAAa,KAAE,QAAQ,KACpC,iBAAiB,EAAE,WAAW,EAC9B,cAAc,EAAE,QAAQ,EACxB,aAAa,EAAE,cAAc,GAC7B,CACH;YACA,CAAC,WAAW,IAAI,CAAC,QAAQ,IAAI,QAAQ,IAAI,CACxC,6BAAK,SAAS,EAAE,MAAM,CAAC,eAAe,CAAC;gBACrC,oBAAC,YAAY,IAAC,IAAI,EAAC,OAAO,GAAG,CACzB,CACP;YACA,oBAAoB,IAAI,CACvB;gBACG,aAAa;gBACb,WAAW,IAAI,CACd,oBAAC,OAAO,IACN,SAAS,EAAE,MAAM,CAAC,yBAAyB,CAAC,EAC5C,QAAQ,EAAE,WAAW,EACrB,KAAK,EAAE,cAAe,EACtB,QAAQ,EAAC,OAAO,GAChB,CACH,CACA,CACJ,CACG,CACS,CAClB,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useRef } from 'react';\nimport clsx from 'clsx';\nimport styles from './styles.css.js';\nimport Option from '../../internal/components/option';\nimport SelectableItem from '../../internal/components/selectable-item';\nimport { getBaseProps } from '../../internal/base-component';\nimport { DropdownOption, OptionDefinition } from '../../internal/components/option/interfaces';\nimport CheckboxIcon from '../../internal/components/checkbox-icon';\nimport InternalIcon from '../../icon/internal.js';\nimport { HighlightType } from '../../internal/components/options-list/utils/use-highlight-option.js';\nimport useHiddenDescription from '../../internal/hooks/use-hidden-description';\nimport Tooltip from '../../internal/components/tooltip';\nimport { useMergeRefs } from '../../internal/hooks/use-merge-refs';\n\nexport interface ItemProps {\n option: DropdownOption;\n highlighted?: boolean;\n selected?: boolean;\n filteringValue?: string;\n hasCheckbox?: boolean;\n virtualPosition?: number;\n padBottom?: boolean;\n isNextSelected?: boolean;\n screenReaderContent?: string;\n ariaPosinset?: number;\n ariaSetsize?: number;\n highlightType?: HighlightType['type'];\n}\n\nconst Item = (\n {\n option,\n highlighted,\n selected,\n filteringValue,\n hasCheckbox,\n virtualPosition,\n padBottom,\n isNextSelected,\n screenReaderContent,\n ariaPosinset,\n ariaSetsize,\n highlightType,\n ...restProps\n }: ItemProps,\n ref: React.Ref<HTMLDivElement>\n) => {\n const baseProps = getBaseProps(restProps);\n\n const isParent = option.type === 'parent';\n const isChild = option.type === 'child';\n const wrappedOption: OptionDefinition = option.option;\n const disabled = option.disabled || wrappedOption.disabled;\n const disabledReason = disabled && wrappedOption.disabledReason ? wrappedOption.disabledReason : '';\n const isDisabledWithReason = !!disabledReason;\n const internalRef = useRef<HTMLDivElement>(null);\n\n const { descriptionEl, descriptionId } = useHiddenDescription(disabledReason);\n\n return (\n <SelectableItem\n ariaSelected={Boolean(selected)}\n selected={selected}\n isNextSelected={isNextSelected}\n highlighted={highlighted}\n disabled={option.disabled}\n isParent={isParent}\n isChild={isChild}\n ref={useMergeRefs(ref, internalRef)}\n virtualPosition={virtualPosition}\n padBottom={padBottom}\n screenReaderContent={screenReaderContent}\n ariaPosinset={ariaPosinset}\n ariaSetsize={ariaSetsize}\n highlightType={highlightType}\n ariaDescribedby={isDisabledWithReason ? descriptionId : ''}\n {...baseProps}\n >\n <div className={clsx(styles.item, !isParent && wrappedOption.labelTag && styles['show-label-tag'])}>\n {hasCheckbox && !isParent && (\n <div className={styles.checkbox}>\n <CheckboxIcon checked={selected || false} disabled={option.disabled} />\n </div>\n )}\n {isParent ? (\n <span>{wrappedOption.label || wrappedOption.value}</span>\n ) : (\n <Option\n option={{ ...wrappedOption, disabled }}\n highlightedOption={highlighted}\n selectedOption={selected}\n highlightText={filteringValue}\n />\n )}\n {!hasCheckbox && !isParent && selected && (\n <div className={styles['selected-icon']}>\n <InternalIcon name=\"check\" />\n </div>\n )}\n {isDisabledWithReason && (\n <>\n {descriptionEl}\n {highlighted && (\n <Tooltip\n className={styles['disabled-reason-tooltip']}\n trackRef={internalRef}\n value={disabledReason!}\n position=\"right\"\n />\n )}\n </>\n )}\n </div>\n </SelectableItem>\n );\n};\n\nexport default React.memo(React.forwardRef(Item));\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"multiselect-item.d.ts","sourceRoot":"","sources":["../../../../src/select/parts/multiselect-item.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAQ1B,OAAO,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AACnC,UAAU,oBAAqB,SAAQ,SAAS;IAC9C,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB;;AAoED,wBAA6D"}
1
+ {"version":3,"file":"multiselect-item.d.ts","sourceRoot":"","sources":["../../../../src/select/parts/multiselect-item.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAiB,MAAM,OAAO,CAAC;AAQtC,OAAO,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AAInC,UAAU,oBAAqB,SAAQ,SAAS;IAC9C,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB;;AA0FD,wBAA6D"}
@@ -1,13 +1,16 @@
1
1
  import { __rest } from "tslib";
2
2
  // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
3
  // SPDX-License-Identifier: Apache-2.0
4
- import React from 'react';
4
+ import React, { useRef } from 'react';
5
5
  import clsx from 'clsx';
6
6
  import styles from './styles.css.js';
7
7
  import Option from '../../internal/components/option';
8
8
  import SelectableItem from '../../internal/components/selectable-item';
9
9
  import { getBaseProps } from '../../internal/base-component';
10
10
  import CheckboxIcon from '../../internal/components/checkbox-icon';
11
+ import useHiddenDescription from '../../internal/hooks/use-hidden-description';
12
+ import { useMergeRefs } from '../../internal/hooks/use-merge-refs';
13
+ import Tooltip from '../../internal/components/tooltip';
11
14
  const MultiSelectItem = (_a, ref) => {
12
15
  var { option, highlighted, selected, filteringValue, hasCheckbox, virtualPosition, padBottom, isNextSelected, indeterminate, screenReaderContent, ariaPosinset, ariaSetsize, highlightType } = _a, restProps = __rest(_a, ["option", "highlighted", "selected", "filteringValue", "hasCheckbox", "virtualPosition", "padBottom", "isNextSelected", "indeterminate", "screenReaderContent", "ariaPosinset", "ariaSetsize", "highlightType"]);
13
16
  const baseProps = getBaseProps(restProps);
@@ -15,14 +18,23 @@ const MultiSelectItem = (_a, ref) => {
15
18
  const isChild = option.type === 'child';
16
19
  const wrappedOption = option.option;
17
20
  const disabled = option.disabled || wrappedOption.disabled;
21
+ const disabledReason = disabled && (option.disabledReason || wrappedOption.disabledReason)
22
+ ? option.disabledReason || wrappedOption.disabledReason
23
+ : '';
24
+ const isDisabledWithReason = !!disabledReason;
25
+ const internalRef = useRef(null);
18
26
  const className = clsx(styles.item, {
19
27
  [styles.disabled]: disabled,
20
28
  });
21
- return (React.createElement(SelectableItem, Object.assign({ ariaChecked: isParent && indeterminate ? 'mixed' : Boolean(selected), selected: selected, isNextSelected: isNextSelected, highlighted: highlighted, disabled: disabled, isParent: isParent, isChild: isChild, highlightType: highlightType, ref: ref, virtualPosition: virtualPosition, padBottom: padBottom, useInteractiveGroups: true, screenReaderContent: screenReaderContent, ariaPosinset: ariaPosinset, ariaSetsize: ariaSetsize }, baseProps),
29
+ const { descriptionId, descriptionEl } = useHiddenDescription(disabledReason);
30
+ return (React.createElement(SelectableItem, Object.assign({ ariaChecked: isParent && indeterminate ? 'mixed' : Boolean(selected), selected: selected, isNextSelected: isNextSelected, highlighted: highlighted, disabled: disabled, isParent: isParent, isChild: isChild, highlightType: highlightType, ref: useMergeRefs(ref, internalRef), virtualPosition: virtualPosition, padBottom: padBottom, useInteractiveGroups: true, screenReaderContent: screenReaderContent, ariaPosinset: ariaPosinset, ariaSetsize: ariaSetsize, ariaDescribedby: isDisabledWithReason ? descriptionId : '' }, baseProps),
22
31
  React.createElement("div", { className: className },
23
32
  hasCheckbox && (React.createElement("div", { className: styles.checkbox },
24
33
  React.createElement(CheckboxIcon, { checked: selected, indeterminate: isParent && indeterminate, disabled: option.disabled }))),
25
- React.createElement(Option, { option: Object.assign(Object.assign({}, wrappedOption), { disabled }), highlightedOption: highlighted, selectedOption: selected, highlightText: filteringValue, isGroupOption: isParent }))));
34
+ React.createElement(Option, { option: Object.assign(Object.assign({}, wrappedOption), { disabled }), highlightedOption: highlighted, selectedOption: selected, highlightText: filteringValue, isGroupOption: isParent })),
35
+ isDisabledWithReason && (React.createElement(React.Fragment, null,
36
+ descriptionEl,
37
+ highlighted && (React.createElement(Tooltip, { className: styles['disabled-reason-tooltip'], trackRef: internalRef, value: disabledReason, position: "right" }))))));
26
38
  };
27
39
  export default React.memo(React.forwardRef(MultiSelectItem));
28
40
  //# sourceMappingURL=multiselect-item.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"multiselect-item.js","sourceRoot":"","sources":["../../../../src/select/parts/multiselect-item.tsx"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,MAAM,MAAM,iBAAiB,CAAC;AACrC,OAAO,MAAM,MAAM,kCAAkC,CAAC;AACtD,OAAO,cAAc,MAAM,2CAA2C,CAAC;AACvE,OAAO,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAE7D,OAAO,YAAY,MAAM,yCAAyC,CAAC;AAMnE,MAAM,eAAe,GAAG,CACtB,EAeuB,EACvB,GAA8B,EAC9B,EAAE;QAjBF,EACE,MAAM,EACN,WAAW,EACX,QAAQ,EACR,cAAc,EACd,WAAW,EACX,eAAe,EACf,SAAS,EACT,cAAc,EACd,aAAa,EACb,mBAAmB,EACnB,YAAY,EACZ,WAAW,EACX,aAAa,OAEQ,EADlB,SAAS,cAdd,gNAeC,CAD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iBAAiB,EAAE,WAAW,EAC9B,cAAc,EAAE,QAAQ,EACxB,aAAa,EAAE,cAAc,EAC7B,aAAa,EAAE,QAAQ,GACvB,CACE,CACS,CAClB,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,eAAe,CAAC,CAAC,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\nimport clsx from 'clsx';\nimport styles from './styles.css.js';\nimport Option from '../../internal/components/option';\nimport SelectableItem from '../../internal/components/selectable-item';\nimport { getBaseProps } from '../../internal/base-component';\nimport { OptionDefinition } from '../../internal/components/option/interfaces';\nimport CheckboxIcon from '../../internal/components/checkbox-icon';\nimport { ItemProps } from './item';\ninterface MultiselectItemProps extends ItemProps {\n indeterminate?: boolean;\n}\n\nconst MultiSelectItem = (\n {\n option,\n highlighted,\n selected,\n filteringValue,\n hasCheckbox,\n virtualPosition,\n padBottom,\n isNextSelected,\n indeterminate,\n screenReaderContent,\n ariaPosinset,\n ariaSetsize,\n highlightType,\n ...restProps\n }: MultiselectItemProps,\n ref: React.Ref<HTMLDivElement>\n) => {\n const baseProps = getBaseProps(restProps);\n\n const isParent = option.type === 'parent';\n const isChild = option.type === 'child';\n const wrappedOption: OptionDefinition = option.option;\n const disabled = option.disabled || wrappedOption.disabled;\n const className = clsx(styles.item, {\n [styles.disabled]: disabled,\n });\n\n return (\n <SelectableItem\n ariaChecked={isParent && indeterminate ? 'mixed' : Boolean(selected)}\n selected={selected}\n isNextSelected={isNextSelected}\n highlighted={highlighted}\n disabled={disabled}\n isParent={isParent}\n isChild={isChild}\n highlightType={highlightType}\n ref={ref}\n virtualPosition={virtualPosition}\n padBottom={padBottom}\n useInteractiveGroups={true}\n screenReaderContent={screenReaderContent}\n ariaPosinset={ariaPosinset}\n ariaSetsize={ariaSetsize}\n {...baseProps}\n >\n <div className={className}>\n {hasCheckbox && (\n <div className={styles.checkbox}>\n <CheckboxIcon checked={selected} indeterminate={isParent && indeterminate} disabled={option.disabled} />\n </div>\n )}\n <Option\n option={{ ...wrappedOption, disabled }}\n highlightedOption={highlighted}\n selectedOption={selected}\n highlightText={filteringValue}\n isGroupOption={isParent}\n />\n </div>\n </SelectableItem>\n );\n};\n\nexport default React.memo(React.forwardRef(MultiSelectItem));\n"]}
1
+ {"version":3,"file":"multiselect-item.js","sourceRoot":"","sources":["../../../../src/select/parts/multiselect-item.tsx"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AACtC,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,MAAM,MAAM,iBAAiB,CAAC;AACrC,OAAO,MAAM,MAAM,kCAAkC,CAAC;AACtD,OAAO,cAAc,MAAM,2CAA2C,CAAC;AACvE,OAAO,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAE7D,OAAO,YAAY,MAAM,yCAAyC,CAAC;AAEnE,OAAO,oBAAoB,MAAM,6CAA6C,CAAC;AAC/E,OAAO,EAAE,YAAY,EAAE,MAAM,qCAAqC,CAAC;AACnE,OAAO,OAAO,MAAM,mCAAmC,CAAC;AAKxD,MAAM,eAAe,GAAG,CACtB,EAeuB,EACvB,GAA8B,EAC9B,EAAE;QAjBF,EACE,MAAM,EACN,WAAW,EACX,QAAQ,EACR,cAAc,EACd,WAAW,EACX,eAAe,EACf,SAAS,EACT,cAAc,EACd,aAAa,EACb,mBAAmB,EACnB,YAAY,EACZ,WAAW,EACX,aAAa,OAEQ,EADlB,SAAS,cAdd,gNAeC,CADa;IAId,MAAM,SAAS,GAAG,YAAY,CAAC,SAAS,CAAC,CAAC;IAE1C,MAAM,QAAQ,GAAG,MAAM,CAAC,IAAI,KAAK,QAAQ,CAAC;IAC1C,MAAM,OAAO,GAAG,MAAM,CAAC,IAAI,KAAK,OAAO,CA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AAS;QAEb,6BAAK,SAAS,EAAE,SAAS;YACtB,WAAW,IAAI,CACd,6BAAK,SAAS,EAAE,MAAM,CAAC,QAAQ;gBAC7B,oBAAC,YAAY,IAAC,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,QAAQ,IAAI,aAAa,EAAE,QAAQ,EAAE,MAAM,CAAC,QAAQ,GAAI,CACpG,CACP;YACD,oBAAC,MAAM,IACL,MAAM,kCAAO,aAAa,KAAE,QAAQ,KACpC,iBAAiB,EAAE,WAAW,EAC9B,cAAc,EAAE,QAAQ,EACxB,aAAa,EAAE,cAAc,EAC7B,aAAa,EAAE,QAAQ,GACvB,CACE;QACL,oBAAoB,IAAI,CACvB;YACG,aAAa;YACb,WAAW,IAAI,CACd,oBAAC,OAAO,IACN,SAAS,EAAE,MAAM,CAAC,yBAAyB,CAAC,EAC5C,QAAQ,EAAE,WAAW,EACrB,KAAK,EAAE,cAAe,EACtB,QAAQ,EAAC,OAAO,GAChB,CACH,CACA,CACJ,CACc,CAClB,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,eAAe,CAAC,CAAC,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useRef } from 'react';\nimport clsx from 'clsx';\nimport styles from './styles.css.js';\nimport Option from '../../internal/components/option';\nimport SelectableItem from '../../internal/components/selectable-item';\nimport { getBaseProps } from '../../internal/base-component';\nimport { OptionDefinition } from '../../internal/components/option/interfaces';\nimport CheckboxIcon from '../../internal/components/checkbox-icon';\nimport { ItemProps } from './item';\nimport useHiddenDescription from '../../internal/hooks/use-hidden-description';\nimport { useMergeRefs } from '../../internal/hooks/use-merge-refs';\nimport Tooltip from '../../internal/components/tooltip';\ninterface MultiselectItemProps extends ItemProps {\n indeterminate?: boolean;\n}\n\nconst MultiSelectItem = (\n {\n option,\n highlighted,\n selected,\n filteringValue,\n hasCheckbox,\n virtualPosition,\n padBottom,\n isNextSelected,\n indeterminate,\n screenReaderContent,\n ariaPosinset,\n ariaSetsize,\n highlightType,\n ...restProps\n }: MultiselectItemProps,\n ref: React.Ref<HTMLDivElement>\n) => {\n const baseProps = getBaseProps(restProps);\n\n const isParent = option.type === 'parent';\n const isChild = option.type === 'child';\n const wrappedOption: OptionDefinition = option.option;\n const disabled = option.disabled || wrappedOption.disabled;\n const disabledReason =\n disabled && (option.disabledReason || wrappedOption.disabledReason)\n ? option.disabledReason || wrappedOption.disabledReason\n : '';\n const isDisabledWithReason = !!disabledReason;\n const internalRef = useRef<HTMLDivElement>(null);\n const className = clsx(styles.item, {\n [styles.disabled]: disabled,\n });\n\n const { descriptionId, descriptionEl } = useHiddenDescription(disabledReason);\n\n return (\n <SelectableItem\n ariaChecked={isParent && indeterminate ? 'mixed' : Boolean(selected)}\n selected={selected}\n isNextSelected={isNextSelected}\n highlighted={highlighted}\n disabled={disabled}\n isParent={isParent}\n isChild={isChild}\n highlightType={highlightType}\n ref={useMergeRefs(ref, internalRef)}\n virtualPosition={virtualPosition}\n padBottom={padBottom}\n useInteractiveGroups={true}\n screenReaderContent={screenReaderContent}\n ariaPosinset={ariaPosinset}\n ariaSetsize={ariaSetsize}\n ariaDescribedby={isDisabledWithReason ? descriptionId : ''}\n {...baseProps}\n >\n <div className={className}>\n {hasCheckbox && (\n <div className={styles.checkbox}>\n <CheckboxIcon checked={selected} indeterminate={isParent && indeterminate} disabled={option.disabled} />\n </div>\n )}\n <Option\n option={{ ...wrappedOption, disabled }}\n highlightedOption={highlighted}\n selectedOption={selected}\n highlightText={filteringValue}\n isGroupOption={isParent}\n />\n </div>\n {isDisabledWithReason && (\n <>\n {descriptionEl}\n {highlighted && (\n <Tooltip\n className={styles['disabled-reason-tooltip']}\n trackRef={internalRef}\n value={disabledReason!}\n position=\"right\"\n />\n )}\n </>\n )}\n </SelectableItem>\n );\n};\n\nexport default React.memo(React.forwardRef(MultiSelectItem));\n"]}
@@ -1,21 +1,22 @@
1
1
 
2
2
  import './styles.scoped.css';
3
3
  export default {
4
- "placeholder": "awsui_placeholder_dwuol_k04db_97",
5
- "item": "awsui_item_dwuol_k04db_102",
6
- "checkbox": "awsui_checkbox_dwuol_k04db_106",
7
- "filter": "awsui_filter_dwuol_k04db_115",
8
- "trigger": "awsui_trigger_dwuol_k04db_120",
9
- "layout-strut": "awsui_layout-strut_dwuol_k04db_126",
10
- "list-bottom": "awsui_list-bottom_dwuol_k04db_132",
11
- "selected-icon": "awsui_selected-icon_dwuol_k04db_136",
12
- "show-label-tag": "awsui_show-label-tag_dwuol_k04db_140",
13
- "inline-token-trigger": "awsui_inline-token-trigger_dwuol_k04db_144",
14
- "inline-token-list": "awsui_inline-token-list_dwuol_k04db_151",
15
- "inline-token": "awsui_inline-token_dwuol_k04db_144",
16
- "visual-refresh": "awsui_visual-refresh_dwuol_k04db_181",
17
- "inline-token-hidden-placeholder": "awsui_inline-token-hidden-placeholder_dwuol_k04db_188",
18
- "inline-token-counter": "awsui_inline-token-counter_dwuol_k04db_194",
19
- "inline-token-trigger--disabled": "awsui_inline-token-trigger--disabled_dwuol_k04db_198"
4
+ "placeholder": "awsui_placeholder_dwuol_1bifm_97",
5
+ "item": "awsui_item_dwuol_1bifm_102",
6
+ "checkbox": "awsui_checkbox_dwuol_1bifm_106",
7
+ "filter": "awsui_filter_dwuol_1bifm_115",
8
+ "trigger": "awsui_trigger_dwuol_1bifm_120",
9
+ "layout-strut": "awsui_layout-strut_dwuol_1bifm_126",
10
+ "list-bottom": "awsui_list-bottom_dwuol_1bifm_132",
11
+ "selected-icon": "awsui_selected-icon_dwuol_1bifm_136",
12
+ "show-label-tag": "awsui_show-label-tag_dwuol_1bifm_140",
13
+ "inline-token-trigger": "awsui_inline-token-trigger_dwuol_1bifm_144",
14
+ "inline-token-list": "awsui_inline-token-list_dwuol_1bifm_151",
15
+ "inline-token": "awsui_inline-token_dwuol_1bifm_144",
16
+ "visual-refresh": "awsui_visual-refresh_dwuol_1bifm_181",
17
+ "inline-token-hidden-placeholder": "awsui_inline-token-hidden-placeholder_dwuol_1bifm_188",
18
+ "inline-token-counter": "awsui_inline-token-counter_dwuol_1bifm_194",
19
+ "inline-token-trigger--disabled": "awsui_inline-token-trigger--disabled_dwuol_1bifm_198",
20
+ "disabled-reason-tooltip": "awsui_disabled-reason-tooltip_dwuol_1bifm_204"
20
21
  };
21
22