@cloudscape-design/components-themeable 3.0.1317 → 3.0.1319

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 (668) hide show
  1. package/lib/internal/manifest.json +1 -1
  2. package/lib/internal/scss/internal/generated/custom-css-properties/index.scss +1 -1
  3. package/lib/internal/template/action-card/interfaces.d.ts +3 -3
  4. package/lib/internal/template/action-card/interfaces.d.ts.map +1 -1
  5. package/lib/internal/template/action-card/interfaces.js.map +1 -1
  6. package/lib/internal/template/alert/interfaces.d.ts +3 -3
  7. package/lib/internal/template/alert/interfaces.d.ts.map +1 -1
  8. package/lib/internal/template/alert/interfaces.js.map +1 -1
  9. package/lib/internal/template/anchor-navigation/interfaces.d.ts +2 -2
  10. package/lib/internal/template/anchor-navigation/interfaces.d.ts.map +1 -1
  11. package/lib/internal/template/anchor-navigation/interfaces.js.map +1 -1
  12. package/lib/internal/template/annotation-context/interfaces.d.ts +1 -1
  13. package/lib/internal/template/annotation-context/interfaces.d.ts.map +1 -1
  14. package/lib/internal/template/annotation-context/interfaces.js.map +1 -1
  15. package/lib/internal/template/app-layout/classic.d.ts +1 -1
  16. package/lib/internal/template/app-layout/drawer/overflow-menu.d.ts +1 -1
  17. package/lib/internal/template/app-layout/drawer/overflow-menu.d.ts.map +1 -1
  18. package/lib/internal/template/app-layout/drawer/overflow-menu.js.map +1 -1
  19. package/lib/internal/template/app-layout/index.js.map +1 -1
  20. package/lib/internal/template/app-layout/interfaces.d.ts +3 -3
  21. package/lib/internal/template/app-layout/interfaces.d.ts.map +1 -1
  22. package/lib/internal/template/app-layout/interfaces.js.map +1 -1
  23. package/lib/internal/template/app-layout/internal.d.ts +1 -1
  24. package/lib/internal/template/app-layout/runtime-drawer/index.d.ts +1 -1
  25. package/lib/internal/template/app-layout/runtime-drawer/index.d.ts.map +1 -1
  26. package/lib/internal/template/app-layout/runtime-drawer/index.js.map +1 -1
  27. package/lib/internal/template/app-layout/visual-refresh/index.d.ts +1 -1
  28. package/lib/internal/template/app-layout/visual-refresh-toolbar/interfaces.d.ts +1 -1
  29. package/lib/internal/template/app-layout/visual-refresh-toolbar/interfaces.d.ts.map +1 -1
  30. package/lib/internal/template/app-layout/visual-refresh-toolbar/interfaces.js.map +1 -1
  31. package/lib/internal/template/app-layout/visual-refresh-toolbar/state/use-ai-drawer.d.ts +4 -4
  32. package/lib/internal/template/app-layout/visual-refresh-toolbar/state/use-bottom-drawers.d.ts +4 -4
  33. package/lib/internal/template/app-layout-toolbar/index.js.map +1 -1
  34. package/lib/internal/template/area-chart/elements/use-highlight-details.d.ts +1 -1
  35. package/lib/internal/template/area-chart/elements/use-highlight-details.d.ts.map +1 -1
  36. package/lib/internal/template/area-chart/elements/use-highlight-details.js.map +1 -1
  37. package/lib/internal/template/area-chart/interfaces.d.ts +1 -1
  38. package/lib/internal/template/area-chart/interfaces.d.ts.map +1 -1
  39. package/lib/internal/template/area-chart/interfaces.js.map +1 -1
  40. package/lib/internal/template/area-chart/model/compute-chart-props.d.ts +2 -2
  41. package/lib/internal/template/area-chart/model/compute-chart-props.d.ts.map +1 -1
  42. package/lib/internal/template/area-chart/model/compute-chart-props.js +2 -0
  43. package/lib/internal/template/area-chart/model/compute-chart-props.js.map +1 -1
  44. package/lib/internal/template/area-chart/model/index.d.ts +1 -1
  45. package/lib/internal/template/area-chart/model/index.d.ts.map +1 -1
  46. package/lib/internal/template/area-chart/model/index.js.map +1 -1
  47. package/lib/internal/template/area-chart/model/use-chart-model.d.ts +1 -1
  48. package/lib/internal/template/area-chart/model/use-chart-model.d.ts.map +1 -1
  49. package/lib/internal/template/area-chart/model/use-chart-model.js.map +1 -1
  50. package/lib/internal/template/area-chart/model/use-filter-props.d.ts +1 -1
  51. package/lib/internal/template/area-chart/model/use-filter-props.d.ts.map +1 -1
  52. package/lib/internal/template/area-chart/model/use-filter-props.js.map +1 -1
  53. package/lib/internal/template/area-chart/model/use-highlight-props.d.ts +1 -1
  54. package/lib/internal/template/area-chart/model/use-highlight-props.d.ts.map +1 -1
  55. package/lib/internal/template/area-chart/model/use-highlight-props.js.map +1 -1
  56. package/lib/internal/template/area-chart/model/utils.d.ts +1 -1
  57. package/lib/internal/template/area-chart/model/utils.d.ts.map +1 -1
  58. package/lib/internal/template/area-chart/model/utils.js.map +1 -1
  59. package/lib/internal/template/attribute-editor/interfaces.d.ts +3 -3
  60. package/lib/internal/template/attribute-editor/interfaces.d.ts.map +1 -1
  61. package/lib/internal/template/attribute-editor/interfaces.js.map +1 -1
  62. package/lib/internal/template/attribute-editor/row.d.ts +2 -2
  63. package/lib/internal/template/attribute-editor/row.d.ts.map +1 -1
  64. package/lib/internal/template/attribute-editor/row.js.map +1 -1
  65. package/lib/internal/template/autosuggest/autosuggest-option.d.ts +1 -1
  66. package/lib/internal/template/autosuggest/autosuggest-option.d.ts.map +1 -1
  67. package/lib/internal/template/autosuggest/autosuggest-option.js.map +1 -1
  68. package/lib/internal/template/autosuggest/interfaces.d.ts +5 -5
  69. package/lib/internal/template/autosuggest/interfaces.d.ts.map +1 -1
  70. package/lib/internal/template/autosuggest/interfaces.js.map +1 -1
  71. package/lib/internal/template/autosuggest/internal.d.ts.map +1 -1
  72. package/lib/internal/template/autosuggest/internal.js +1 -1
  73. package/lib/internal/template/autosuggest/internal.js.map +1 -1
  74. package/lib/internal/template/autosuggest/load-more-controller.d.ts +1 -1
  75. package/lib/internal/template/autosuggest/load-more-controller.d.ts.map +1 -1
  76. package/lib/internal/template/autosuggest/load-more-controller.js.map +1 -1
  77. package/lib/internal/template/badge/interfaces.d.ts +2 -2
  78. package/lib/internal/template/badge/interfaces.d.ts.map +1 -1
  79. package/lib/internal/template/badge/interfaces.js.map +1 -1
  80. package/lib/internal/template/bar-chart/interfaces.d.ts +1 -1
  81. package/lib/internal/template/bar-chart/interfaces.d.ts.map +1 -1
  82. package/lib/internal/template/bar-chart/interfaces.js.map +1 -1
  83. package/lib/internal/template/box/interfaces.d.ts +2 -2
  84. package/lib/internal/template/box/interfaces.d.ts.map +1 -1
  85. package/lib/internal/template/box/interfaces.js.map +1 -1
  86. package/lib/internal/template/breadcrumb-group/all-items-dropdown.d.ts +1 -1
  87. package/lib/internal/template/breadcrumb-group/all-items-dropdown.d.ts.map +1 -1
  88. package/lib/internal/template/breadcrumb-group/all-items-dropdown.js.map +1 -1
  89. package/lib/internal/template/breadcrumb-group/interfaces.d.ts +2 -2
  90. package/lib/internal/template/breadcrumb-group/interfaces.d.ts.map +1 -1
  91. package/lib/internal/template/breadcrumb-group/interfaces.js.map +1 -1
  92. package/lib/internal/template/button/interfaces.d.ts +3 -3
  93. package/lib/internal/template/button/interfaces.d.ts.map +1 -1
  94. package/lib/internal/template/button/interfaces.js.map +1 -1
  95. package/lib/internal/template/button-dropdown/interfaces.d.ts +3 -3
  96. package/lib/internal/template/button-dropdown/interfaces.d.ts.map +1 -1
  97. package/lib/internal/template/button-dropdown/interfaces.js.map +1 -1
  98. package/lib/internal/template/button-dropdown/utils/use-button-dropdown.d.ts +1 -1
  99. package/lib/internal/template/button-dropdown/utils/use-button-dropdown.d.ts.map +1 -1
  100. package/lib/internal/template/button-dropdown/utils/use-button-dropdown.js.map +1 -1
  101. package/lib/internal/template/button-group/file-input-item.d.ts +1 -1
  102. package/lib/internal/template/button-group/file-input-item.d.ts.map +1 -1
  103. package/lib/internal/template/button-group/file-input-item.js.map +1 -1
  104. package/lib/internal/template/button-group/icon-button-item.d.ts +1 -1
  105. package/lib/internal/template/button-group/icon-button-item.d.ts.map +1 -1
  106. package/lib/internal/template/button-group/icon-button-item.js +1 -1
  107. package/lib/internal/template/button-group/icon-button-item.js.map +1 -1
  108. package/lib/internal/template/button-group/icon-toggle-button-item.d.ts +1 -1
  109. package/lib/internal/template/button-group/icon-toggle-button-item.d.ts.map +1 -1
  110. package/lib/internal/template/button-group/icon-toggle-button-item.js.map +1 -1
  111. package/lib/internal/template/button-group/interfaces.d.ts +10 -2
  112. package/lib/internal/template/button-group/interfaces.d.ts.map +1 -1
  113. package/lib/internal/template/button-group/interfaces.js.map +1 -1
  114. package/lib/internal/template/button-group/item-element.d.ts +1 -1
  115. package/lib/internal/template/button-group/item-element.d.ts.map +1 -1
  116. package/lib/internal/template/button-group/item-element.js.map +1 -1
  117. package/lib/internal/template/button-group/menu-dropdown-item.d.ts +1 -1
  118. package/lib/internal/template/button-group/menu-dropdown-item.d.ts.map +1 -1
  119. package/lib/internal/template/button-group/menu-dropdown-item.js.map +1 -1
  120. package/lib/internal/template/calendar/interfaces.d.ts +3 -3
  121. package/lib/internal/template/calendar/interfaces.d.ts.map +1 -1
  122. package/lib/internal/template/calendar/interfaces.js.map +1 -1
  123. package/lib/internal/template/cards/interfaces.d.ts +2 -2
  124. package/lib/internal/template/cards/interfaces.d.ts.map +1 -1
  125. package/lib/internal/template/cards/interfaces.js.map +1 -1
  126. package/lib/internal/template/checkbox/base-checkbox.d.ts +3 -3
  127. package/lib/internal/template/checkbox/base-checkbox.d.ts.map +1 -1
  128. package/lib/internal/template/checkbox/base-checkbox.js.map +1 -1
  129. package/lib/internal/template/checkbox/interfaces.d.ts +2 -2
  130. package/lib/internal/template/checkbox/interfaces.d.ts.map +1 -1
  131. package/lib/internal/template/checkbox/interfaces.js.map +1 -1
  132. package/lib/internal/template/code-editor/error-screen.d.ts +1 -1
  133. package/lib/internal/template/code-editor/error-screen.d.ts.map +1 -1
  134. package/lib/internal/template/code-editor/error-screen.js.map +1 -1
  135. package/lib/internal/template/code-editor/interfaces.d.ts +3 -3
  136. package/lib/internal/template/code-editor/interfaces.d.ts.map +1 -1
  137. package/lib/internal/template/code-editor/interfaces.js.map +1 -1
  138. package/lib/internal/template/code-editor/listeners.d.ts +1 -1
  139. package/lib/internal/template/code-editor/listeners.d.ts.map +1 -1
  140. package/lib/internal/template/code-editor/listeners.js.map +1 -1
  141. package/lib/internal/template/code-editor/preferences-modal.js.map +1 -1
  142. package/lib/internal/template/collection-preferences/interfaces.d.ts +4 -4
  143. package/lib/internal/template/collection-preferences/interfaces.d.ts.map +1 -1
  144. package/lib/internal/template/collection-preferences/interfaces.js.map +1 -1
  145. package/lib/internal/template/column-layout/interfaces.d.ts +1 -1
  146. package/lib/internal/template/column-layout/interfaces.d.ts.map +1 -1
  147. package/lib/internal/template/column-layout/interfaces.js.map +1 -1
  148. package/lib/internal/template/container/interfaces.d.ts +1 -1
  149. package/lib/internal/template/container/interfaces.d.ts.map +1 -1
  150. package/lib/internal/template/container/interfaces.js.map +1 -1
  151. package/lib/internal/template/content-layout/interfaces.d.ts +1 -1
  152. package/lib/internal/template/content-layout/interfaces.d.ts.map +1 -1
  153. package/lib/internal/template/content-layout/interfaces.js.map +1 -1
  154. package/lib/internal/template/contexts/form-field.d.ts +2 -1
  155. package/lib/internal/template/contexts/form-field.d.ts.map +1 -1
  156. package/lib/internal/template/contexts/form-field.js +1 -1
  157. package/lib/internal/template/contexts/form-field.js.map +1 -1
  158. package/lib/internal/template/copy-to-clipboard/interfaces.d.ts +2 -2
  159. package/lib/internal/template/copy-to-clipboard/interfaces.d.ts.map +1 -1
  160. package/lib/internal/template/copy-to-clipboard/interfaces.js.map +1 -1
  161. package/lib/internal/template/date-input/interfaces.d.ts +3 -3
  162. package/lib/internal/template/date-input/interfaces.d.ts.map +1 -1
  163. package/lib/internal/template/date-input/interfaces.js.map +1 -1
  164. package/lib/internal/template/date-input/internal.d.ts.map +1 -1
  165. package/lib/internal/template/date-input/internal.js.map +1 -1
  166. package/lib/internal/template/date-picker/interfaces.d.ts +4 -4
  167. package/lib/internal/template/date-picker/interfaces.d.ts.map +1 -1
  168. package/lib/internal/template/date-picker/interfaces.js.map +1 -1
  169. package/lib/internal/template/date-range-picker/calendar/interfaces.d.ts +1 -1
  170. package/lib/internal/template/date-range-picker/calendar/interfaces.d.ts.map +1 -1
  171. package/lib/internal/template/date-range-picker/calendar/interfaces.js.map +1 -1
  172. package/lib/internal/template/date-range-picker/interfaces.d.ts +4 -4
  173. package/lib/internal/template/date-range-picker/interfaces.d.ts.map +1 -1
  174. package/lib/internal/template/date-range-picker/interfaces.js.map +1 -1
  175. package/lib/internal/template/divider/interfaces.d.ts +2 -2
  176. package/lib/internal/template/divider/interfaces.d.ts.map +1 -1
  177. package/lib/internal/template/divider/interfaces.js.map +1 -1
  178. package/lib/internal/template/drawer/interfaces.d.ts +2 -2
  179. package/lib/internal/template/drawer/interfaces.d.ts.map +1 -1
  180. package/lib/internal/template/drawer/interfaces.js.map +1 -1
  181. package/lib/internal/template/dropdown/interfaces.d.ts +1 -1
  182. package/lib/internal/template/dropdown/interfaces.d.ts.map +1 -1
  183. package/lib/internal/template/dropdown/interfaces.js.map +1 -1
  184. package/lib/internal/template/dropdown/internal.d.ts +1 -1
  185. package/lib/internal/template/dropdown/internal.d.ts.map +1 -1
  186. package/lib/internal/template/dropdown/internal.js.map +1 -1
  187. package/lib/internal/template/error-boundary/interfaces.d.ts +1 -1
  188. package/lib/internal/template/error-boundary/interfaces.d.ts.map +1 -1
  189. package/lib/internal/template/error-boundary/interfaces.js.map +1 -1
  190. package/lib/internal/template/expandable-section/interfaces.d.ts +2 -2
  191. package/lib/internal/template/expandable-section/interfaces.d.ts.map +1 -1
  192. package/lib/internal/template/expandable-section/interfaces.js.map +1 -1
  193. package/lib/internal/template/file-dropzone/interfaces.d.ts +2 -2
  194. package/lib/internal/template/file-dropzone/interfaces.d.ts.map +1 -1
  195. package/lib/internal/template/file-dropzone/interfaces.js.map +1 -1
  196. package/lib/internal/template/file-input/interfaces.d.ts +3 -3
  197. package/lib/internal/template/file-input/interfaces.d.ts.map +1 -1
  198. package/lib/internal/template/file-input/interfaces.js.map +1 -1
  199. package/lib/internal/template/file-token-group/file-token.d.ts +1 -1
  200. package/lib/internal/template/file-token-group/file-token.d.ts.map +1 -1
  201. package/lib/internal/template/file-token-group/file-token.js.map +1 -1
  202. package/lib/internal/template/file-token-group/interfaces.d.ts +2 -2
  203. package/lib/internal/template/file-token-group/interfaces.d.ts.map +1 -1
  204. package/lib/internal/template/file-token-group/interfaces.js.map +1 -1
  205. package/lib/internal/template/file-upload/interfaces.d.ts +3 -3
  206. package/lib/internal/template/file-upload/interfaces.d.ts.map +1 -1
  207. package/lib/internal/template/file-upload/interfaces.js.map +1 -1
  208. package/lib/internal/template/flashbar/common.d.ts +1 -1
  209. package/lib/internal/template/flashbar/interfaces.d.ts +2 -2
  210. package/lib/internal/template/flashbar/interfaces.d.ts.map +1 -1
  211. package/lib/internal/template/flashbar/interfaces.js.map +1 -1
  212. package/lib/internal/template/form/interfaces.d.ts +2 -2
  213. package/lib/internal/template/form/interfaces.d.ts.map +1 -1
  214. package/lib/internal/template/form/interfaces.js.map +1 -1
  215. package/lib/internal/template/form-field/interfaces.d.ts +2 -2
  216. package/lib/internal/template/form-field/interfaces.d.ts.map +1 -1
  217. package/lib/internal/template/form-field/interfaces.js.map +1 -1
  218. package/lib/internal/template/grid/interfaces.d.ts +2 -2
  219. package/lib/internal/template/grid/interfaces.d.ts.map +1 -1
  220. package/lib/internal/template/grid/interfaces.js.map +1 -1
  221. package/lib/internal/template/grid/internal.d.ts +1 -1
  222. package/lib/internal/template/grid/internal.d.ts.map +1 -1
  223. package/lib/internal/template/grid/internal.js.map +1 -1
  224. package/lib/internal/template/header/interfaces.d.ts +1 -1
  225. package/lib/internal/template/header/interfaces.d.ts.map +1 -1
  226. package/lib/internal/template/header/interfaces.js.map +1 -1
  227. package/lib/internal/template/help-panel/interfaces.d.ts +1 -1
  228. package/lib/internal/template/help-panel/interfaces.d.ts.map +1 -1
  229. package/lib/internal/template/help-panel/interfaces.js.map +1 -1
  230. package/lib/internal/template/hotspot/interfaces.d.ts +1 -1
  231. package/lib/internal/template/hotspot/interfaces.d.ts.map +1 -1
  232. package/lib/internal/template/hotspot/interfaces.js.map +1 -1
  233. package/lib/internal/template/icon/generated/icons.d.ts +2 -0
  234. package/lib/internal/template/icon/generated/icons.d.ts.map +1 -1
  235. package/lib/internal/template/icon/generated/icons.js +7 -0
  236. package/lib/internal/template/icon/generated/icons.js.map +1 -1
  237. package/lib/internal/template/icon/interfaces.d.ts +2 -2
  238. package/lib/internal/template/icon/interfaces.d.ts.map +1 -1
  239. package/lib/internal/template/icon/interfaces.js.map +1 -1
  240. package/lib/internal/template/icon-provider/interfaces.d.ts +2 -2
  241. package/lib/internal/template/icon-provider/interfaces.d.ts.map +1 -1
  242. package/lib/internal/template/icon-provider/interfaces.js.map +1 -1
  243. package/lib/internal/template/input/interfaces.d.ts +4 -4
  244. package/lib/internal/template/input/interfaces.d.ts.map +1 -1
  245. package/lib/internal/template/input/interfaces.js.map +1 -1
  246. package/lib/internal/template/input/internal.d.ts +3 -3
  247. package/lib/internal/template/input/internal.d.ts.map +1 -1
  248. package/lib/internal/template/input/internal.js.map +1 -1
  249. package/lib/internal/template/interfaces.d.ts +1 -1
  250. package/lib/internal/template/interfaces.d.ts.map +1 -1
  251. package/lib/internal/template/interfaces.js.map +1 -1
  252. package/lib/internal/template/internal/analytics/components/analytics-funnel.d.ts +2 -1
  253. package/lib/internal/template/internal/analytics/components/analytics-funnel.d.ts.map +1 -1
  254. package/lib/internal/template/internal/analytics/components/analytics-funnel.js.map +1 -1
  255. package/lib/internal/template/internal/analytics/context/analytics-context.d.ts +2 -1
  256. package/lib/internal/template/internal/analytics/context/analytics-context.d.ts.map +1 -1
  257. package/lib/internal/template/internal/analytics/context/analytics-context.js.map +1 -1
  258. package/lib/internal/template/internal/analytics/interfaces.d.ts +2 -15
  259. package/lib/internal/template/internal/analytics/interfaces.d.ts.map +1 -1
  260. package/lib/internal/template/internal/analytics/interfaces.js.map +1 -1
  261. package/lib/internal/template/internal/base-component/index.d.ts +3 -15
  262. package/lib/internal/template/internal/base-component/index.d.ts.map +1 -1
  263. package/lib/internal/template/internal/base-component/index.js.map +1 -1
  264. package/lib/internal/template/internal/base-component/styles.scoped.css +1 -1
  265. package/lib/internal/template/internal/breakpoints.d.ts +2 -1
  266. package/lib/internal/template/internal/breakpoints.d.ts.map +1 -1
  267. package/lib/internal/template/internal/breakpoints.js.map +1 -1
  268. package/lib/internal/template/internal/components/autosuggest-input/index.d.ts +3 -3
  269. package/lib/internal/template/internal/components/autosuggest-input/index.d.ts.map +1 -1
  270. package/lib/internal/template/internal/components/autosuggest-input/index.js.map +1 -1
  271. package/lib/internal/template/internal/components/button-trigger/index.d.ts +2 -2
  272. package/lib/internal/template/internal/components/button-trigger/index.d.ts.map +1 -1
  273. package/lib/internal/template/internal/components/button-trigger/index.js.map +1 -1
  274. package/lib/internal/template/internal/components/cartesian-chart/block-end-labels.d.ts +1 -1
  275. package/lib/internal/template/internal/components/cartesian-chart/block-end-labels.d.ts.map +1 -1
  276. package/lib/internal/template/internal/components/cartesian-chart/block-end-labels.js.map +1 -1
  277. package/lib/internal/template/internal/components/cartesian-chart/interfaces.d.ts +1 -209
  278. package/lib/internal/template/internal/components/cartesian-chart/interfaces.d.ts.map +1 -1
  279. package/lib/internal/template/internal/components/cartesian-chart/interfaces.js +2 -0
  280. package/lib/internal/template/internal/components/cartesian-chart/interfaces.js.map +1 -1
  281. package/lib/internal/template/internal/components/cartesian-chart/label-utils.d.ts +1 -1
  282. package/lib/internal/template/internal/components/cartesian-chart/label-utils.d.ts.map +1 -1
  283. package/lib/internal/template/internal/components/cartesian-chart/label-utils.js.map +1 -1
  284. package/lib/internal/template/internal/components/cartesian-chart/scales.d.ts +1 -1
  285. package/lib/internal/template/internal/components/cartesian-chart/scales.d.ts.map +1 -1
  286. package/lib/internal/template/internal/components/cartesian-chart/scales.js +0 -2
  287. package/lib/internal/template/internal/components/cartesian-chart/scales.js.map +1 -1
  288. package/lib/internal/template/internal/components/cartesian-chart/ticks.d.ts +1 -1
  289. package/lib/internal/template/internal/components/cartesian-chart/ticks.d.ts.map +1 -1
  290. package/lib/internal/template/internal/components/cartesian-chart/ticks.js.map +1 -1
  291. package/lib/internal/template/internal/components/chart-filter/index.d.ts +1 -1
  292. package/lib/internal/template/internal/components/chart-filter/index.d.ts.map +1 -1
  293. package/lib/internal/template/internal/components/chart-filter/index.js.map +1 -1
  294. package/lib/internal/template/internal/components/chart-series-details/index.d.ts +1 -1
  295. package/lib/internal/template/internal/components/chart-series-details/index.d.ts.map +1 -1
  296. package/lib/internal/template/internal/components/chart-series-details/index.js.map +1 -1
  297. package/lib/internal/template/internal/components/chart-series-marker/index.d.ts +1 -1
  298. package/lib/internal/template/internal/components/chart-series-marker/index.d.ts.map +1 -1
  299. package/lib/internal/template/internal/components/chart-series-marker/index.js.map +1 -1
  300. package/lib/internal/template/internal/components/chart-status-container/index.d.ts +2 -2
  301. package/lib/internal/template/internal/components/chart-status-container/index.d.ts.map +1 -1
  302. package/lib/internal/template/internal/components/chart-status-container/index.js.map +1 -1
  303. package/lib/internal/template/internal/components/chart-wrapper/index.d.ts +1 -1
  304. package/lib/internal/template/internal/components/chart-wrapper/index.d.ts.map +1 -1
  305. package/lib/internal/template/internal/components/chart-wrapper/index.js.map +1 -1
  306. package/lib/internal/template/internal/components/checkbox-icon/index.d.ts +1 -1
  307. package/lib/internal/template/internal/components/checkbox-icon/index.d.ts.map +1 -1
  308. package/lib/internal/template/internal/components/checkbox-icon/index.js.map +1 -1
  309. package/lib/internal/template/internal/components/dropdown-status/index.d.ts +3 -3
  310. package/lib/internal/template/internal/components/dropdown-status/index.d.ts.map +1 -1
  311. package/lib/internal/template/internal/components/dropdown-status/index.js.map +1 -1
  312. package/lib/internal/template/internal/components/masked-input/interfaces.d.ts +2 -2
  313. package/lib/internal/template/internal/components/masked-input/interfaces.d.ts.map +1 -1
  314. package/lib/internal/template/internal/components/masked-input/interfaces.js.map +1 -1
  315. package/lib/internal/template/internal/components/masked-input/use-mask.d.ts +1 -1
  316. package/lib/internal/template/internal/components/masked-input/use-mask.d.ts.map +1 -1
  317. package/lib/internal/template/internal/components/masked-input/use-mask.js.map +1 -1
  318. package/lib/internal/template/internal/components/option/interfaces.d.ts +3 -26
  319. package/lib/internal/template/internal/components/option/interfaces.d.ts.map +1 -1
  320. package/lib/internal/template/internal/components/option/interfaces.js.map +1 -1
  321. package/lib/internal/template/internal/components/option/option-announcer.d.ts +1 -1
  322. package/lib/internal/template/internal/components/option/option-announcer.d.ts.map +1 -1
  323. package/lib/internal/template/internal/components/option/option-announcer.js.map +1 -1
  324. package/lib/internal/template/internal/components/option/utils/filter-options.d.ts +2 -1
  325. package/lib/internal/template/internal/components/option/utils/filter-options.d.ts.map +1 -1
  326. package/lib/internal/template/internal/components/option/utils/filter-options.js.map +1 -1
  327. package/lib/internal/template/internal/components/option/utils/flatten-options.d.ts +2 -1
  328. package/lib/internal/template/internal/components/option/utils/flatten-options.d.ts.map +1 -1
  329. package/lib/internal/template/internal/components/option/utils/flatten-options.js.map +1 -1
  330. package/lib/internal/template/internal/components/options-list/index.d.ts +3 -3
  331. package/lib/internal/template/internal/components/options-list/index.d.ts.map +1 -1
  332. package/lib/internal/template/internal/components/options-list/index.js +1 -1
  333. package/lib/internal/template/internal/components/options-list/index.js.map +1 -1
  334. package/lib/internal/template/internal/components/options-list/utils/use-keyboard.d.ts +1 -1
  335. package/lib/internal/template/internal/components/options-list/utils/use-keyboard.d.ts.map +1 -1
  336. package/lib/internal/template/internal/components/options-list/utils/use-keyboard.js.map +1 -1
  337. package/lib/internal/template/internal/components/radio-button/index.d.ts +1 -1
  338. package/lib/internal/template/internal/components/radio-button/index.d.ts.map +1 -1
  339. package/lib/internal/template/internal/components/radio-button/index.js.map +1 -1
  340. package/lib/internal/template/internal/components/radio-button/interfaces.d.ts +1 -128
  341. package/lib/internal/template/internal/components/radio-button/interfaces.d.ts.map +1 -1
  342. package/lib/internal/template/internal/components/radio-button/interfaces.js +2 -0
  343. package/lib/internal/template/internal/components/radio-button/interfaces.js.map +1 -1
  344. package/lib/internal/template/internal/components/selectable-item/interfaces.d.ts +1 -1
  345. package/lib/internal/template/internal/components/selectable-item/interfaces.d.ts.map +1 -1
  346. package/lib/internal/template/internal/components/selectable-item/interfaces.js.map +1 -1
  347. package/lib/internal/template/internal/components/sortable-area/interfaces.d.ts +3 -9
  348. package/lib/internal/template/internal/components/sortable-area/interfaces.d.ts.map +1 -1
  349. package/lib/internal/template/internal/components/sortable-area/interfaces.js.map +1 -1
  350. package/lib/internal/template/internal/components/token-list/token-limit-toggle.d.ts +1 -1
  351. package/lib/internal/template/internal/components/token-list/token-limit-toggle.d.ts.map +1 -1
  352. package/lib/internal/template/internal/components/token-list/token-limit-toggle.js.map +1 -1
  353. package/lib/internal/template/internal/context/form-field-context.d.ts +2 -54
  354. package/lib/internal/template/internal/context/form-field-context.d.ts.map +1 -1
  355. package/lib/internal/template/internal/context/form-field-context.js.map +1 -1
  356. package/lib/internal/template/internal/do-not-use/feature-prompt/interfaces.d.ts +1 -1
  357. package/lib/internal/template/internal/do-not-use/feature-prompt/interfaces.d.ts.map +1 -1
  358. package/lib/internal/template/internal/do-not-use/feature-prompt/interfaces.js.map +1 -1
  359. package/lib/internal/template/internal/do-not-use/feature-prompt/internal.d.ts +1 -1
  360. package/lib/internal/template/internal/do-not-use/feature-prompt/internal.d.ts.map +1 -1
  361. package/lib/internal/template/internal/do-not-use/feature-prompt/internal.js.map +1 -1
  362. package/lib/internal/template/internal/environment.js +2 -2
  363. package/lib/internal/template/internal/environment.json +2 -2
  364. package/lib/internal/template/internal/events/index.d.ts +2 -24
  365. package/lib/internal/template/internal/events/index.d.ts.map +1 -1
  366. package/lib/internal/template/internal/events/index.js.map +1 -1
  367. package/lib/internal/template/internal/generated/theming/index.cjs +6 -0
  368. package/lib/internal/template/internal/generated/theming/index.cjs.d.ts +27 -0
  369. package/lib/internal/template/internal/generated/theming/index.d.ts +27 -0
  370. package/lib/internal/template/internal/generated/theming/index.js +6 -0
  371. package/lib/internal/template/internal/hooks/check-controlled/index.d.ts +1 -1
  372. package/lib/internal/template/internal/hooks/check-controlled/index.d.ts.map +1 -1
  373. package/lib/internal/template/internal/hooks/check-controlled/index.js.map +1 -1
  374. package/lib/internal/template/internal/hooks/container-queries/use-container-breakpoints.d.ts +1 -1
  375. package/lib/internal/template/internal/hooks/container-queries/use-container-breakpoints.d.ts.map +1 -1
  376. package/lib/internal/template/internal/hooks/container-queries/use-container-breakpoints.js.map +1 -1
  377. package/lib/internal/template/internal/hooks/use-base-component/index.d.ts +1 -1
  378. package/lib/internal/template/internal/hooks/use-base-component/index.d.ts.map +1 -1
  379. package/lib/internal/template/internal/hooks/use-base-component/index.js.map +1 -1
  380. package/lib/internal/template/internal/hooks/use-focus-tracker.d.ts +1 -1
  381. package/lib/internal/template/internal/hooks/use-focus-tracker.d.ts.map +1 -1
  382. package/lib/internal/template/internal/hooks/use-focus-tracker.js.map +1 -1
  383. package/lib/internal/template/internal/plugins/controllers/drawers.d.ts +1 -1
  384. package/lib/internal/template/internal/plugins/controllers/drawers.d.ts.map +1 -1
  385. package/lib/internal/template/internal/plugins/controllers/drawers.js.map +1 -1
  386. package/lib/internal/template/internal/plugins/widget/interfaces.d.ts +1 -1
  387. package/lib/internal/template/internal/plugins/widget/interfaces.d.ts.map +1 -1
  388. package/lib/internal/template/internal/plugins/widget/interfaces.js.map +1 -1
  389. package/lib/internal/template/internal/utils/date-time/interfaces.d.ts +1 -16
  390. package/lib/internal/template/internal/utils/date-time/interfaces.d.ts.map +1 -1
  391. package/lib/internal/template/internal/utils/date-time/interfaces.js.map +1 -1
  392. package/lib/internal/template/internal/utils/with-native-attributes.d.ts +2 -1
  393. package/lib/internal/template/internal/utils/with-native-attributes.d.ts.map +1 -1
  394. package/lib/internal/template/internal/utils/with-native-attributes.js.map +1 -1
  395. package/lib/internal/template/item-card/interfaces.d.ts +2 -2
  396. package/lib/internal/template/item-card/interfaces.d.ts.map +1 -1
  397. package/lib/internal/template/item-card/interfaces.js.map +1 -1
  398. package/lib/internal/template/key-value-pairs/interfaces.d.ts +1 -1
  399. package/lib/internal/template/key-value-pairs/interfaces.d.ts.map +1 -1
  400. package/lib/internal/template/key-value-pairs/interfaces.js.map +1 -1
  401. package/lib/internal/template/link/interfaces.d.ts +3 -3
  402. package/lib/internal/template/link/interfaces.d.ts.map +1 -1
  403. package/lib/internal/template/link/interfaces.js.map +1 -1
  404. package/lib/internal/template/list/interfaces.d.ts +3 -3
  405. package/lib/internal/template/list/interfaces.d.ts.map +1 -1
  406. package/lib/internal/template/list/interfaces.js.map +1 -1
  407. package/lib/internal/template/live-region/interfaces.d.ts +1 -1
  408. package/lib/internal/template/live-region/interfaces.d.ts.map +1 -1
  409. package/lib/internal/template/live-region/interfaces.js.map +1 -1
  410. package/lib/internal/template/mixed-line-bar-chart/chart-container.d.ts +1 -1
  411. package/lib/internal/template/mixed-line-bar-chart/chart-container.d.ts.map +1 -1
  412. package/lib/internal/template/mixed-line-bar-chart/chart-container.js.map +1 -1
  413. package/lib/internal/template/mixed-line-bar-chart/format-highlighted.d.ts +1 -1
  414. package/lib/internal/template/mixed-line-bar-chart/format-highlighted.d.ts.map +1 -1
  415. package/lib/internal/template/mixed-line-bar-chart/format-highlighted.js.map +1 -1
  416. package/lib/internal/template/mixed-line-bar-chart/interfaces.d.ts +1 -1
  417. package/lib/internal/template/mixed-line-bar-chart/interfaces.d.ts.map +1 -1
  418. package/lib/internal/template/mixed-line-bar-chart/interfaces.js.map +1 -1
  419. package/lib/internal/template/modal/interfaces.d.ts +3 -3
  420. package/lib/internal/template/modal/interfaces.d.ts.map +1 -1
  421. package/lib/internal/template/modal/interfaces.js.map +1 -1
  422. package/lib/internal/template/multiselect/embedded.d.ts +2 -2
  423. package/lib/internal/template/multiselect/interfaces.d.ts +2 -2
  424. package/lib/internal/template/multiselect/interfaces.d.ts.map +1 -1
  425. package/lib/internal/template/multiselect/interfaces.js.map +1 -1
  426. package/lib/internal/template/multiselect/internal.d.ts +1 -1
  427. package/lib/internal/template/multiselect/use-multiselect.d.ts +8 -8
  428. package/lib/internal/template/multiselect/use-multiselect.d.ts.map +1 -1
  429. package/lib/internal/template/multiselect/use-multiselect.js.map +1 -1
  430. package/lib/internal/template/navigable-group/interfaces.d.ts +1 -1
  431. package/lib/internal/template/navigable-group/interfaces.d.ts.map +1 -1
  432. package/lib/internal/template/navigable-group/interfaces.js.map +1 -1
  433. package/lib/internal/template/pagination/interfaces.d.ts +1 -1
  434. package/lib/internal/template/pagination/interfaces.d.ts.map +1 -1
  435. package/lib/internal/template/pagination/interfaces.js.map +1 -1
  436. package/lib/internal/template/pagination/internal.d.ts.map +1 -1
  437. package/lib/internal/template/pagination/internal.js.map +1 -1
  438. package/lib/internal/template/panel-layout/interfaces.d.ts +2 -2
  439. package/lib/internal/template/panel-layout/interfaces.d.ts.map +1 -1
  440. package/lib/internal/template/panel-layout/interfaces.js.map +1 -1
  441. package/lib/internal/template/pie-chart/interfaces.d.ts +2 -2
  442. package/lib/internal/template/pie-chart/interfaces.d.ts.map +1 -1
  443. package/lib/internal/template/pie-chart/interfaces.js.map +1 -1
  444. package/lib/internal/template/popover/interfaces.d.ts +1 -1
  445. package/lib/internal/template/popover/interfaces.d.ts.map +1 -1
  446. package/lib/internal/template/popover/interfaces.js.map +1 -1
  447. package/lib/internal/template/popover/internal.d.ts +1 -1
  448. package/lib/internal/template/popover/internal.d.ts.map +1 -1
  449. package/lib/internal/template/popover/internal.js.map +1 -1
  450. package/lib/internal/template/progress-bar/interfaces.d.ts +2 -2
  451. package/lib/internal/template/progress-bar/interfaces.d.ts.map +1 -1
  452. package/lib/internal/template/progress-bar/interfaces.js.map +1 -1
  453. package/lib/internal/template/prompt-input/core/menu-state.d.ts +2 -2
  454. package/lib/internal/template/prompt-input/core/menu-state.d.ts.map +1 -1
  455. package/lib/internal/template/prompt-input/core/menu-state.js.map +1 -1
  456. package/lib/internal/template/prompt-input/interfaces.d.ts +6 -6
  457. package/lib/internal/template/prompt-input/interfaces.d.ts.map +1 -1
  458. package/lib/internal/template/prompt-input/interfaces.js.map +1 -1
  459. package/lib/internal/template/property-filter/controller.d.ts +2 -2
  460. package/lib/internal/template/property-filter/controller.d.ts.map +1 -1
  461. package/lib/internal/template/property-filter/controller.js.map +1 -1
  462. package/lib/internal/template/property-filter/filter-options.js.map +1 -1
  463. package/lib/internal/template/property-filter/interfaces.d.ts +4 -4
  464. package/lib/internal/template/property-filter/interfaces.d.ts.map +1 -1
  465. package/lib/internal/template/property-filter/interfaces.js.map +1 -1
  466. package/lib/internal/template/property-filter/property-editor.d.ts +2 -2
  467. package/lib/internal/template/property-filter/property-editor.d.ts.map +1 -1
  468. package/lib/internal/template/property-filter/property-editor.js.map +1 -1
  469. package/lib/internal/template/property-filter/property-filter-autosuggest.d.ts +1 -1
  470. package/lib/internal/template/property-filter/property-filter-autosuggest.d.ts.map +1 -1
  471. package/lib/internal/template/property-filter/property-filter-autosuggest.js +1 -1
  472. package/lib/internal/template/property-filter/property-filter-autosuggest.js.map +1 -1
  473. package/lib/internal/template/property-filter/token-editor-inputs.d.ts +2 -2
  474. package/lib/internal/template/property-filter/token-editor-inputs.d.ts.map +1 -1
  475. package/lib/internal/template/property-filter/token-editor-inputs.js.map +1 -1
  476. package/lib/internal/template/property-filter/token-editor.d.ts +2 -2
  477. package/lib/internal/template/property-filter/token-editor.d.ts.map +1 -1
  478. package/lib/internal/template/property-filter/token-editor.js.map +1 -1
  479. package/lib/internal/template/property-filter/token.d.ts +2 -2
  480. package/lib/internal/template/property-filter/token.d.ts.map +1 -1
  481. package/lib/internal/template/property-filter/token.js.map +1 -1
  482. package/lib/internal/template/property-filter/use-load-items.d.ts +1 -1
  483. package/lib/internal/template/property-filter/use-load-items.d.ts.map +1 -1
  484. package/lib/internal/template/property-filter/use-load-items.js.map +1 -1
  485. package/lib/internal/template/radio-button/interfaces.d.ts +128 -2
  486. package/lib/internal/template/radio-button/interfaces.d.ts.map +1 -1
  487. package/lib/internal/template/radio-button/interfaces.js.map +1 -1
  488. package/lib/internal/template/radio-group/interfaces.d.ts +4 -4
  489. package/lib/internal/template/radio-group/interfaces.d.ts.map +1 -1
  490. package/lib/internal/template/radio-group/interfaces.js.map +1 -1
  491. package/lib/internal/template/s3-resource-selector/interfaces.d.ts +2 -2
  492. package/lib/internal/template/s3-resource-selector/interfaces.d.ts.map +1 -1
  493. package/lib/internal/template/s3-resource-selector/interfaces.js.map +1 -1
  494. package/lib/internal/template/s3-resource-selector/s3-in-context/index.d.ts +1 -1
  495. package/lib/internal/template/s3-resource-selector/s3-in-context/index.d.ts.map +1 -1
  496. package/lib/internal/template/s3-resource-selector/s3-in-context/index.js.map +1 -1
  497. package/lib/internal/template/s3-resource-selector/s3-in-context/use-versions-fetch.d.ts +1 -1
  498. package/lib/internal/template/segmented-control/interfaces.d.ts +2 -2
  499. package/lib/internal/template/segmented-control/interfaces.d.ts.map +1 -1
  500. package/lib/internal/template/segmented-control/interfaces.js.map +1 -1
  501. package/lib/internal/template/select/interfaces.d.ts +5 -5
  502. package/lib/internal/template/select/interfaces.d.ts.map +1 -1
  503. package/lib/internal/template/select/interfaces.js.map +1 -1
  504. package/lib/internal/template/select/internal.d.ts.map +1 -1
  505. package/lib/internal/template/select/internal.js.map +1 -1
  506. package/lib/internal/template/select/parts/item.d.ts.map +1 -1
  507. package/lib/internal/template/select/parts/item.js.map +1 -1
  508. package/lib/internal/template/select/parts/multiselect-item.d.ts.map +1 -1
  509. package/lib/internal/template/select/parts/multiselect-item.js.map +1 -1
  510. package/lib/internal/template/select/parts/trigger.d.ts +2 -2
  511. package/lib/internal/template/select/parts/trigger.d.ts.map +1 -1
  512. package/lib/internal/template/select/parts/trigger.js.map +1 -1
  513. package/lib/internal/template/select/utils/connect-options.d.ts +2 -1
  514. package/lib/internal/template/select/utils/connect-options.d.ts.map +1 -1
  515. package/lib/internal/template/select/utils/connect-options.js.map +1 -1
  516. package/lib/internal/template/select/utils/use-announcement.d.ts +1 -1
  517. package/lib/internal/template/select/utils/use-announcement.d.ts.map +1 -1
  518. package/lib/internal/template/select/utils/use-announcement.js.map +1 -1
  519. package/lib/internal/template/select/utils/use-load-items.d.ts +2 -2
  520. package/lib/internal/template/select/utils/use-load-items.d.ts.map +1 -1
  521. package/lib/internal/template/select/utils/use-load-items.js.map +1 -1
  522. package/lib/internal/template/select/utils/use-native-search.d.ts +2 -1
  523. package/lib/internal/template/select/utils/use-native-search.d.ts.map +1 -1
  524. package/lib/internal/template/select/utils/use-native-search.js.map +1 -1
  525. package/lib/internal/template/select/utils/use-select.d.ts +4 -3
  526. package/lib/internal/template/select/utils/use-select.d.ts.map +1 -1
  527. package/lib/internal/template/select/utils/use-select.js.map +1 -1
  528. package/lib/internal/template/side-navigation/interfaces.d.ts +2 -2
  529. package/lib/internal/template/side-navigation/interfaces.d.ts.map +1 -1
  530. package/lib/internal/template/side-navigation/interfaces.js.map +1 -1
  531. package/lib/internal/template/side-navigation/parts.d.ts.map +1 -1
  532. package/lib/internal/template/side-navigation/parts.js.map +1 -1
  533. package/lib/internal/template/skeleton/interfaces.d.ts +1 -1
  534. package/lib/internal/template/skeleton/interfaces.d.ts.map +1 -1
  535. package/lib/internal/template/skeleton/interfaces.js.map +1 -1
  536. package/lib/internal/template/slider/interfaces.d.ts +3 -3
  537. package/lib/internal/template/slider/interfaces.d.ts.map +1 -1
  538. package/lib/internal/template/slider/interfaces.js.map +1 -1
  539. package/lib/internal/template/space-between/interfaces.d.ts +2 -2
  540. package/lib/internal/template/space-between/interfaces.d.ts.map +1 -1
  541. package/lib/internal/template/space-between/interfaces.js.map +1 -1
  542. package/lib/internal/template/spinner/interfaces.d.ts +2 -2
  543. package/lib/internal/template/spinner/interfaces.d.ts.map +1 -1
  544. package/lib/internal/template/spinner/interfaces.js.map +1 -1
  545. package/lib/internal/template/split-panel/interfaces.d.ts +1 -1
  546. package/lib/internal/template/split-panel/interfaces.d.ts.map +1 -1
  547. package/lib/internal/template/split-panel/interfaces.js.map +1 -1
  548. package/lib/internal/template/status-indicator/interfaces.d.ts +2 -2
  549. package/lib/internal/template/status-indicator/interfaces.d.ts.map +1 -1
  550. package/lib/internal/template/status-indicator/interfaces.js.map +1 -1
  551. package/lib/internal/template/steps/interfaces.d.ts +1 -1
  552. package/lib/internal/template/steps/interfaces.d.ts.map +1 -1
  553. package/lib/internal/template/steps/interfaces.js.map +1 -1
  554. package/lib/internal/template/table/interfaces.d.ts +2 -2
  555. package/lib/internal/template/table/interfaces.d.ts.map +1 -1
  556. package/lib/internal/template/table/interfaces.js.map +1 -1
  557. package/lib/internal/template/table/thead.d.ts +1 -1
  558. package/lib/internal/template/table/thead.d.ts.map +1 -1
  559. package/lib/internal/template/table/thead.js.map +1 -1
  560. package/lib/internal/template/table/use-cell-editing.d.ts +1 -1
  561. package/lib/internal/template/table/use-cell-editing.d.ts.map +1 -1
  562. package/lib/internal/template/table/use-cell-editing.js.map +1 -1
  563. package/lib/internal/template/tabs/interfaces.d.ts +2 -2
  564. package/lib/internal/template/tabs/interfaces.d.ts.map +1 -1
  565. package/lib/internal/template/tabs/interfaces.js.map +1 -1
  566. package/lib/internal/template/tag-editor/index.d.ts.map +1 -1
  567. package/lib/internal/template/tag-editor/index.js.map +1 -1
  568. package/lib/internal/template/tag-editor/interfaces.d.ts +2 -2
  569. package/lib/internal/template/tag-editor/interfaces.d.ts.map +1 -1
  570. package/lib/internal/template/tag-editor/interfaces.js.map +1 -1
  571. package/lib/internal/template/tag-editor/internal.js.map +1 -1
  572. package/lib/internal/template/text-content/interfaces.d.ts +1 -1
  573. package/lib/internal/template/text-content/interfaces.d.ts.map +1 -1
  574. package/lib/internal/template/text-content/interfaces.js.map +1 -1
  575. package/lib/internal/template/text-filter/interfaces.d.ts +3 -3
  576. package/lib/internal/template/text-filter/interfaces.d.ts.map +1 -1
  577. package/lib/internal/template/text-filter/interfaces.js.map +1 -1
  578. package/lib/internal/template/textarea/interfaces.d.ts +4 -4
  579. package/lib/internal/template/textarea/interfaces.d.ts.map +1 -1
  580. package/lib/internal/template/textarea/interfaces.js.map +1 -1
  581. package/lib/internal/template/tiles/interfaces.d.ts +4 -4
  582. package/lib/internal/template/tiles/interfaces.d.ts.map +1 -1
  583. package/lib/internal/template/tiles/interfaces.js.map +1 -1
  584. package/lib/internal/template/time-input/interfaces.d.ts +2 -2
  585. package/lib/internal/template/time-input/interfaces.d.ts.map +1 -1
  586. package/lib/internal/template/time-input/interfaces.js.map +1 -1
  587. package/lib/internal/template/toggle/interfaces.d.ts +2 -2
  588. package/lib/internal/template/toggle/interfaces.d.ts.map +1 -1
  589. package/lib/internal/template/toggle/interfaces.js.map +1 -1
  590. package/lib/internal/template/toggle-button/interfaces.d.ts +2 -2
  591. package/lib/internal/template/toggle-button/interfaces.d.ts.map +1 -1
  592. package/lib/internal/template/toggle-button/interfaces.js.map +1 -1
  593. package/lib/internal/template/token/dismiss-button.d.ts +1 -1
  594. package/lib/internal/template/token/dismiss-button.d.ts.map +1 -1
  595. package/lib/internal/template/token/dismiss-button.js.map +1 -1
  596. package/lib/internal/template/token/interfaces.d.ts +2 -2
  597. package/lib/internal/template/token/interfaces.d.ts.map +1 -1
  598. package/lib/internal/template/token/interfaces.js.map +1 -1
  599. package/lib/internal/template/token-group/interfaces.d.ts +2 -2
  600. package/lib/internal/template/token-group/interfaces.d.ts.map +1 -1
  601. package/lib/internal/template/token-group/interfaces.js.map +1 -1
  602. package/lib/internal/template/tooltip/interfaces.d.ts +1 -1
  603. package/lib/internal/template/tooltip/interfaces.d.ts.map +1 -1
  604. package/lib/internal/template/tooltip/interfaces.js.map +1 -1
  605. package/lib/internal/template/top-navigation/interfaces.d.ts +2 -2
  606. package/lib/internal/template/top-navigation/interfaces.d.ts.map +1 -1
  607. package/lib/internal/template/top-navigation/interfaces.js.map +1 -1
  608. package/lib/internal/template/tree-view/interfaces.d.ts +2 -2
  609. package/lib/internal/template/tree-view/interfaces.d.ts.map +1 -1
  610. package/lib/internal/template/tree-view/interfaces.js.map +1 -1
  611. package/lib/internal/template/truncated-text/interfaces.d.ts +1 -1
  612. package/lib/internal/template/truncated-text/interfaces.d.ts.map +1 -1
  613. package/lib/internal/template/truncated-text/interfaces.js.map +1 -1
  614. package/lib/internal/template/tutorial-panel/index.js.map +1 -1
  615. package/lib/internal/template/tutorial-panel/interfaces.d.ts +2 -2
  616. package/lib/internal/template/tutorial-panel/interfaces.d.ts.map +1 -1
  617. package/lib/internal/template/tutorial-panel/interfaces.js.map +1 -1
  618. package/lib/internal/template/types/analytics.d.ts +16 -0
  619. package/lib/internal/template/types/analytics.d.ts.map +1 -0
  620. package/lib/internal/template/types/analytics.js +4 -0
  621. package/lib/internal/template/types/analytics.js.map +1 -0
  622. package/lib/internal/template/types/base-component.d.ts +15 -0
  623. package/lib/internal/template/types/base-component.d.ts.map +1 -0
  624. package/lib/internal/template/types/base-component.js +4 -0
  625. package/lib/internal/template/types/base-component.js.map +1 -0
  626. package/lib/internal/template/types/breakpoint.d.ts +2 -0
  627. package/lib/internal/template/types/breakpoint.d.ts.map +1 -0
  628. package/lib/internal/template/types/breakpoint.js +2 -0
  629. package/lib/internal/template/types/breakpoint.js.map +1 -0
  630. package/lib/internal/template/types/cartesian-chart.d.ts +210 -0
  631. package/lib/internal/template/types/cartesian-chart.d.ts.map +1 -0
  632. package/lib/internal/template/types/cartesian-chart.js +2 -0
  633. package/lib/internal/template/types/cartesian-chart.js.map +1 -0
  634. package/lib/internal/template/types/date-time.d.ts +17 -0
  635. package/lib/internal/template/types/date-time.d.ts.map +1 -0
  636. package/lib/internal/template/types/date-time.js +4 -0
  637. package/lib/internal/template/types/date-time.js.map +1 -0
  638. package/lib/internal/template/{internal/components/dropdown-status/interfaces.d.ts → types/dropdown-status.d.ts} +1 -1
  639. package/lib/internal/template/types/dropdown-status.d.ts.map +1 -0
  640. package/lib/internal/template/types/dropdown-status.js +2 -0
  641. package/lib/internal/template/types/dropdown-status.js.map +1 -0
  642. package/lib/internal/template/types/events.d.ts +25 -0
  643. package/lib/internal/template/types/events.d.ts.map +1 -0
  644. package/lib/internal/template/types/events.js +4 -0
  645. package/lib/internal/template/types/events.js.map +1 -0
  646. package/lib/internal/template/types/form-field.d.ts +55 -0
  647. package/lib/internal/template/types/form-field.d.ts.map +1 -0
  648. package/lib/internal/template/types/form-field.js +4 -0
  649. package/lib/internal/template/types/form-field.js.map +1 -0
  650. package/lib/internal/template/types/native-attributes.d.ts +3 -0
  651. package/lib/internal/template/types/native-attributes.d.ts.map +1 -0
  652. package/lib/internal/template/types/native-attributes.js +2 -0
  653. package/lib/internal/template/types/native-attributes.js.map +1 -0
  654. package/lib/internal/template/types/option.d.ts +27 -0
  655. package/lib/internal/template/types/option.d.ts.map +1 -0
  656. package/lib/internal/template/types/option.js +2 -0
  657. package/lib/internal/template/types/option.js.map +1 -0
  658. package/lib/internal/template/types/sortable-area.d.ts +9 -0
  659. package/lib/internal/template/types/sortable-area.d.ts.map +1 -0
  660. package/lib/internal/template/types/sortable-area.js +4 -0
  661. package/lib/internal/template/types/sortable-area.js.map +1 -0
  662. package/lib/internal/template/wizard/interfaces.d.ts +3 -3
  663. package/lib/internal/template/wizard/interfaces.d.ts.map +1 -1
  664. package/lib/internal/template/wizard/interfaces.js.map +1 -1
  665. package/package.json +1 -1
  666. package/lib/internal/template/internal/components/dropdown-status/interfaces.d.ts.map +0 -1
  667. package/lib/internal/template/internal/components/dropdown-status/interfaces.js +0 -2
  668. package/lib/internal/template/internal/components/dropdown-status/interfaces.js.map +0 -1
@@ -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, { ReactNode } from 'react';\n\nimport { BaseDropdownHostProps, OptionsFilteringType, OptionsLoadItemsDetail } from '../dropdown/interfaces';\nimport { BaseComponentProps } from '../internal/base-component';\nimport { DropdownStatusProps } from '../internal/components/dropdown-status/interfaces';\nimport { OptionDefinition, OptionGroup as OptionGroupDefinition } from '../internal/components/option/interfaces';\nimport { FormFieldValidationControlProps } from '../internal/context/form-field-context';\nimport { NonCancelableEventHandler } from '../internal/events';\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 *\n * #### OptionGroup\n * - `value` (string) - Used to locate option group in test utils.\n * - `options` (Option[]) - (Optional) The options under this group.\n *\n * #### Shared Option and OptionGroup properties\n * - `label` (string) - (Optional) Option or group text displayed to the user.\n * - `lang` (string) - (Optional) The language of the option or group, provided as a BCP 47 language tag.\n * - `description` (string) - (Optional) Further information about the option or group that appears below the label.\n * - `disabled` (boolean) - (Optional) Determines whether the option or group 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 or group.\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 or group.\n * - `iconAriaLabel` (string) - (Optional) Specifies alternate text for the icon. We recommend that you provide this for accessibility.\n * - `iconAlt` (string) - (Optional) **Deprecated**, replaced by \\`iconAriaLabel\\`. 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 * 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 /**\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 `selectedAriaLabel` 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 * Adds a small label inline with the input for saving vertical space in the UI.\n * For use with collection select filters only.\n */\n inlineLabelText?: string;\n onLoadItems?: NonCancelableEventHandler<SelectProps.LoadItemsDetail>;\n /**\n * Adds `aria-labelledby` to the component. If you're using this component within a form field,\n * don't set this property because the form field component automatically sets it.\n *\n * Use this property if the component isn't using `inlineLabelText` and isn't surrounded by a form field, or you want to override the value\n * automatically set by the form field (for example, if you have two components within a single form field).\n *\n * To use it correctly, define an ID for the element you want to use as label and set the property to that ID.\n */\n ariaLabelledby?: string;\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 * Specifies a render function to render custom options in the dropdown menu or trigger.\n */\n renderOption?: SelectProps.SelectOptionItemRenderer;\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 interface SelectOptionItem {\n type: 'item';\n index: number;\n option: Option;\n highlighted: boolean;\n selected: boolean;\n disabled: boolean;\n parent: SelectOptionGroupItem | null;\n }\n export interface SelectOptionGroupItem {\n type: 'group';\n index: number;\n option: OptionGroup;\n disabled: boolean;\n }\n export interface SelectTriggerOptionItem {\n type: 'trigger';\n option: Option;\n }\n export type SelectItem = SelectOptionItem | SelectOptionGroupItem | SelectTriggerOptionItem;\n export type SelectOptionItemRenderer = (props: { item: SelectItem; filterText?: string }) => ReactNode | null;\n\n /* eslint-disable-next-line @typescript-eslint/no-empty-object-type --\n * Required to create a distinct named type for the documenter.\n **/\n export interface LoadItemsDetail extends OptionsLoadItemsDetail {}\n\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, { ReactNode } from 'react';\n\nimport { BaseDropdownHostProps, OptionsFilteringType, OptionsLoadItemsDetail } from '../dropdown/interfaces';\nimport { BaseComponentProps } from '../types/base-component';\nimport { DropdownStatusProps } from '../types/dropdown-status';\nimport { NonCancelableEventHandler } from '../types/events';\nimport { FormFieldValidationControlProps } from '../types/form-field';\nimport { OptionDefinition, OptionGroup as OptionGroupDefinition } from '../types/option';\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 *\n * #### OptionGroup\n * - `value` (string) - Used to locate option group in test utils.\n * - `options` (Option[]) - (Optional) The options under this group.\n *\n * #### Shared Option and OptionGroup properties\n * - `label` (string) - (Optional) Option or group text displayed to the user.\n * - `lang` (string) - (Optional) The language of the option or group, provided as a BCP 47 language tag.\n * - `description` (string) - (Optional) Further information about the option or group that appears below the label.\n * - `disabled` (boolean) - (Optional) Determines whether the option or group 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 or group.\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 or group.\n * - `iconAriaLabel` (string) - (Optional) Specifies alternate text for the icon. We recommend that you provide this for accessibility.\n * - `iconAlt` (string) - (Optional) **Deprecated**, replaced by \\`iconAriaLabel\\`. 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 * 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 /**\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 `selectedAriaLabel` 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 * Adds a small label inline with the input for saving vertical space in the UI.\n * For use with collection select filters only.\n */\n inlineLabelText?: string;\n onLoadItems?: NonCancelableEventHandler<SelectProps.LoadItemsDetail>;\n /**\n * Adds `aria-labelledby` to the component. If you're using this component within a form field,\n * don't set this property because the form field component automatically sets it.\n *\n * Use this property if the component isn't using `inlineLabelText` and isn't surrounded by a form field, or you want to override the value\n * automatically set by the form field (for example, if you have two components within a single form field).\n *\n * To use it correctly, define an ID for the element you want to use as label and set the property to that ID.\n */\n ariaLabelledby?: string;\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 * Specifies a render function to render custom options in the dropdown menu or trigger.\n */\n renderOption?: SelectProps.SelectOptionItemRenderer;\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 interface SelectOptionItem {\n type: 'item';\n index: number;\n option: Option;\n highlighted: boolean;\n selected: boolean;\n disabled: boolean;\n parent: SelectOptionGroupItem | null;\n }\n export interface SelectOptionGroupItem {\n type: 'group';\n index: number;\n option: OptionGroup;\n disabled: boolean;\n }\n export interface SelectTriggerOptionItem {\n type: 'trigger';\n option: Option;\n }\n export type SelectItem = SelectOptionItem | SelectOptionGroupItem | SelectTriggerOptionItem;\n export type SelectOptionItemRenderer = (props: { item: SelectItem; filterText?: string }) => ReactNode | null;\n\n /* eslint-disable-next-line @typescript-eslint/no-empty-object-type --\n * Required to create a distinct named type for the documenter.\n **/\n export interface LoadItemsDetail extends OptionsLoadItemsDetail {}\n\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 +1 @@
1
- {"version":3,"file":"internal.d.ts","sourceRoot":"","sources":["../../../src/select/internal.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAsC,MAAM,OAAO,CAAC;AAgB3D,OAAO,EAAE,0BAA0B,EAAE,MAAM,sCAAsC,CAAC;AAClF,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAGjD,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAa3C,MAAM,WAAW,mBAAoB,SAAQ,YAAY,CAAC,WAAW,EAAE,SAAS,CAAC,EAAE,0BAA0B;IAC3G,kBAAkB,CAAC,EAAE,MAAM,GAAG,QAAQ,CAAC;CACxC;AAED,QAAA,MAAM,cAAc,6FAsQnB,CAAC;AAEF,eAAe,cAAc,CAAC"}
1
+ {"version":3,"file":"internal.d.ts","sourceRoot":"","sources":["../../../src/select/internal.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAsC,MAAM,OAAO,CAAC;AAe3D,OAAO,EAAE,0BAA0B,EAAE,MAAM,sCAAsC,CAAC;AAClF,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAIjD,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAa3C,MAAM,WAAW,mBAAoB,SAAQ,YAAY,CAAC,WAAW,EAAE,SAAS,CAAC,EAAE,0BAA0B;IAC3G,kBAAkB,CAAC,EAAE,MAAM,GAAG,QAAQ,CAAC;CACxC;AAED,QAAA,MAAM,cAAc,6FAsQnB,CAAC;AAEF,eAAe,cAAc,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"internal.js","sourceRoot":"","sources":["../../../src/select/internal.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAA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B,CACF,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, { useEffect, useRef, useState } from 'react';\nimport clsx from 'clsx';\n\nimport { useMergeRefs, useResizeObserver, useUniqueId, warnOnce } from '@cloudscape-design/component-toolkit/internal';\n\nimport Dropdown from '../dropdown/internal';\nimport { useInternalI18n } from '../i18n/context.js';\nimport { getBaseProps } from '../internal/base-component';\nimport { getBreakpointValue } from '../internal/breakpoints';\nimport DropdownFooter from '../internal/components/dropdown-footer';\nimport { useDropdownStatus } from '../internal/components/dropdown-status';\nimport { OptionGroup } from '../internal/components/option/interfaces.js';\nimport { prepareOptions } from '../internal/components/option/utils/prepare-options.js';\nimport { useFormFieldContext } from '../internal/context/form-field-context';\nimport { fireNonCancelableEvent } from '../internal/events';\nimport checkControlled from '../internal/hooks/check-controlled';\nimport { InternalBaseComponentProps } from '../internal/hooks/use-base-component';\nimport { SomeRequired } from '../internal/types';\nimport { getDropdownMinWidth } from '../internal/utils/get-dropdown-min-width';\nimport { joinStrings } from '../internal/utils/strings/join-strings.js';\nimport { SelectProps } from './interfaces';\nimport Filter from './parts/filter';\nimport PlainList, { SelectListProps } from './parts/plain-list';\nimport Trigger from './parts/trigger';\nimport VirtualList from './parts/virtual-list';\nimport { checkOptionValueField } from './utils/check-option-value-field';\nimport { useAnnouncement } from './utils/use-announcement';\nimport { useLoadItems } from './utils/use-load-items';\nimport { useNativeSearch } from './utils/use-native-search';\nimport { useSelect } from './utils/use-select';\n\nimport styles from './styles.css.js';\n\nexport interface InternalSelectProps extends SomeRequired<SelectProps, 'options'>, InternalBaseComponentProps {\n __inFilteringToken?: 'root' | 'nested';\n}\n\nconst InternalSelect = React.forwardRef(\n (\n {\n options,\n filteringType = 'none',\n filteringPlaceholder,\n filteringAriaLabel,\n filteringClearAriaLabel,\n filteringResultsText,\n inlineLabelText,\n ariaRequired,\n placeholder,\n disabled,\n readOnly,\n ariaLabel,\n statusType = 'finished',\n empty,\n loadingText,\n finishedText,\n errorText,\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,\n renderOption,\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 const recoveryText = i18n('recoveryText', restProps.recoveryText);\n\n if (restProps.recoveryText && !onLoadItems) {\n warnOnce('Select', '`onLoadItems` must be provided for `recoveryText` to be displayed.');\n }\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 const [triggerWidth, setTriggerWidth] = useState<number | null>(null);\n useResizeObserver(\n () => triggerRef.current,\n entry => entry.borderBoxWidth > 0 && setTriggerWidth(entry.borderBoxWidth)\n );\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 focusActiveRef,\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' && !readOnly,\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 renderOption={renderOption}\n ref={triggerRef}\n placeholder={placeholder}\n disabled={disabled}\n readOnly={readOnly}\n triggerVariant={triggerVariant}\n triggerProps={getTriggerProps(disabled, autoFocus)}\n selectedOption={selectedOption}\n isOpen={isOpen}\n inFilteringToken={__inFilteringToken}\n inlineLabelText={inlineLabelText}\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 filteringResultsText: filteredText,\n errorIconAriaLabel,\n onRecoveryClick: () => {\n handleRecoveryClick();\n focusActiveRef();\n },\n hasRecoveryCallback: !!onLoadItems,\n });\n\n const menuProps = {\n ...getMenuProps(),\n onLoadMore: handleLoadMore,\n ariaLabelledby: joinStrings(selectAriaLabelId, controlId),\n ariaDescribedby: dropdownStatus.content ? footerId : undefined,\n ariaRequired,\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 const hasOptions = useRef(options.length > 0);\n hasOptions.current = hasOptions.current || options.length > 0;\n\n return (\n <div\n {...baseProps}\n ref={mergedRef}\n className={clsx(styles.root, baseProps.className)}\n onKeyDown={handleNativeSearch}\n >\n <Dropdown\n {...dropdownProps}\n ariaLabelledby={dropdownProps.ariaRole ? joinStrings(selectAriaLabelId, controlId) : undefined}\n ariaDescribedby={dropdownProps.ariaRole ? (dropdownStatus.content ? footerId : undefined) : undefined}\n open={isOpen}\n stretchTriggerHeight={!!__inFilteringToken}\n minWidth={getDropdownMinWidth({ expandToViewport, triggerWidth })}\n maxWidth={getBreakpointValue('xxs')} // AWSUI-19898\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 // Forces dropdown position recalculation when new options are loaded\n contentKey={hasOptions.current.toString()}\n content={\n <ListComponent\n listBottom={\n !dropdownStatus.isSticky ? (\n <DropdownFooter content={isOpen ? dropdownStatus.content : null} id={footerId} />\n ) : null\n }\n renderOption={renderOption}\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 }\n />\n <div hidden={true} id={selectAriaLabelId}>\n {ariaLabel || inlineLabelText}\n </div>\n </div>\n );\n }\n);\n\nexport default InternalSelect;\n"]}
1
+ {"version":3,"file":"internal.js","sourceRoot":"","sources":["../../../src/select/internal.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC3D,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,YAAY,EAAE,iBAAiB,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,+CAA+C,CAAC;AAEvH,OAAO,QAAQ,MAAM,sBAAsB,CAAC;AAC5C,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,cAAc,MAAM,wCAAwC,CAAC;AACpE,OAAO,EAAE,iBAAiB,EAAE,MAAM,wCAAwC,CAAC;AAC3E,OAAO,EAAE,cAAc,EAAE,MAAM,wDAAwD,CAAC;AACxF,OAAO,EAAE,mBAAmB,EAAE,MAAM,wCAAwC,CAAC;AAC7E,OAAO,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AAC5D,OAAO,eAAe,MAAM,oCAAoC,CAAC;AAGjE,OAAO,EAAE,mBAAmB,EAAE,MAAM,0CAA0C,CAAC;AAC/E,OAAO,EAAE,WAAW,EAAE,MAAM,2CAA2C,CAAC;AAGxE,OAAO,MAAM,MAAM,gBAAgB,CAAC;AACpC,OAAO,SAA8B,MAAM,oBAA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CAClF,CAAC,CAAC,CAAC,IAAI,EAEV,YAAY,EAAE,YAAY,EAC1B,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,GAEJ;QACF,6BAAK,MAAM,EAAE,IAAI,EAAE,EAAE,EAAE,iBAAiB,IACrC,SAAS,IAAI,eAAe,CACzB,CACF,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, { useEffect, useRef, useState } from 'react';\nimport clsx from 'clsx';\n\nimport { useMergeRefs, useResizeObserver, useUniqueId, warnOnce } from '@cloudscape-design/component-toolkit/internal';\n\nimport Dropdown from '../dropdown/internal';\nimport { useInternalI18n } from '../i18n/context.js';\nimport { getBaseProps } from '../internal/base-component';\nimport { getBreakpointValue } from '../internal/breakpoints';\nimport DropdownFooter from '../internal/components/dropdown-footer';\nimport { useDropdownStatus } from '../internal/components/dropdown-status';\nimport { prepareOptions } from '../internal/components/option/utils/prepare-options.js';\nimport { useFormFieldContext } from '../internal/context/form-field-context';\nimport { fireNonCancelableEvent } from '../internal/events';\nimport checkControlled from '../internal/hooks/check-controlled';\nimport { InternalBaseComponentProps } from '../internal/hooks/use-base-component';\nimport { SomeRequired } from '../internal/types';\nimport { getDropdownMinWidth } from '../internal/utils/get-dropdown-min-width';\nimport { joinStrings } from '../internal/utils/strings/join-strings.js';\nimport { OptionGroup } from '../types/option';\nimport { SelectProps } from './interfaces';\nimport Filter from './parts/filter';\nimport PlainList, { SelectListProps } from './parts/plain-list';\nimport Trigger from './parts/trigger';\nimport VirtualList from './parts/virtual-list';\nimport { checkOptionValueField } from './utils/check-option-value-field';\nimport { useAnnouncement } from './utils/use-announcement';\nimport { useLoadItems } from './utils/use-load-items';\nimport { useNativeSearch } from './utils/use-native-search';\nimport { useSelect } from './utils/use-select';\n\nimport styles from './styles.css.js';\n\nexport interface InternalSelectProps extends SomeRequired<SelectProps, 'options'>, InternalBaseComponentProps {\n __inFilteringToken?: 'root' | 'nested';\n}\n\nconst InternalSelect = React.forwardRef(\n (\n {\n options,\n filteringType = 'none',\n filteringPlaceholder,\n filteringAriaLabel,\n filteringClearAriaLabel,\n filteringResultsText,\n inlineLabelText,\n ariaRequired,\n placeholder,\n disabled,\n readOnly,\n ariaLabel,\n statusType = 'finished',\n empty,\n loadingText,\n finishedText,\n errorText,\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,\n renderOption,\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 const recoveryText = i18n('recoveryText', restProps.recoveryText);\n\n if (restProps.recoveryText && !onLoadItems) {\n warnOnce('Select', '`onLoadItems` must be provided for `recoveryText` to be displayed.');\n }\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 const [triggerWidth, setTriggerWidth] = useState<number | null>(null);\n useResizeObserver(\n () => triggerRef.current,\n entry => entry.borderBoxWidth > 0 && setTriggerWidth(entry.borderBoxWidth)\n );\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 focusActiveRef,\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' && !readOnly,\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 renderOption={renderOption}\n ref={triggerRef}\n placeholder={placeholder}\n disabled={disabled}\n readOnly={readOnly}\n triggerVariant={triggerVariant}\n triggerProps={getTriggerProps(disabled, autoFocus)}\n selectedOption={selectedOption}\n isOpen={isOpen}\n inFilteringToken={__inFilteringToken}\n inlineLabelText={inlineLabelText}\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 filteringResultsText: filteredText,\n errorIconAriaLabel,\n onRecoveryClick: () => {\n handleRecoveryClick();\n focusActiveRef();\n },\n hasRecoveryCallback: !!onLoadItems,\n });\n\n const menuProps = {\n ...getMenuProps(),\n onLoadMore: handleLoadMore,\n ariaLabelledby: joinStrings(selectAriaLabelId, controlId),\n ariaDescribedby: dropdownStatus.content ? footerId : undefined,\n ariaRequired,\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 const hasOptions = useRef(options.length > 0);\n hasOptions.current = hasOptions.current || options.length > 0;\n\n return (\n <div\n {...baseProps}\n ref={mergedRef}\n className={clsx(styles.root, baseProps.className)}\n onKeyDown={handleNativeSearch}\n >\n <Dropdown\n {...dropdownProps}\n ariaLabelledby={dropdownProps.ariaRole ? joinStrings(selectAriaLabelId, controlId) : undefined}\n ariaDescribedby={dropdownProps.ariaRole ? (dropdownStatus.content ? footerId : undefined) : undefined}\n open={isOpen}\n stretchTriggerHeight={!!__inFilteringToken}\n minWidth={getDropdownMinWidth({ expandToViewport, triggerWidth })}\n maxWidth={getBreakpointValue('xxs')} // AWSUI-19898\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 // Forces dropdown position recalculation when new options are loaded\n contentKey={hasOptions.current.toString()}\n content={\n <ListComponent\n listBottom={\n !dropdownStatus.isSticky ? (\n <DropdownFooter content={isOpen ? dropdownStatus.content : null} id={footerId} />\n ) : null\n }\n renderOption={renderOption}\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 }\n />\n <div hidden={true} id={selectAriaLabelId}>\n {ariaLabel || inlineLabelText}\n </div>\n </div>\n );\n }\n);\n\nexport default InternalSelect;\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"item.d.ts","sourceRoot":"","sources":["../../../../src/select/parts/item.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAsC,MAAM,OAAO,CAAC;AAS3D,OAAO,EAAE,cAAc,EAAiC,MAAM,6CAA6C,CAAC;AAC5G,OAAO,EAAE,aAAa,EAAE,MAAM,sEAAsE,CAAC;AAIrG,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAI/C,MAAM,WAAW,SAAS,CAAC,CAAC,GAAG,WAAW,CAAC,wBAAwB;IACjE,KAAK,EAAE,MAAM,CAAC;IACd,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,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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,CAAC,QAAQ,IAAI,MAAM,CAAC,gBAAgB,CAAC,CAAC;YAC/F,CAAC,YAAY,IAAI,WAAW,IAAI,CAAC,QAAQ,IAAI,CAC5C,6BAAK,SAAS,EAAE,MAAM,CAAC,QAAQ;gBAC7B,oBAAC,YAAY,IAAC,OAAO,EAAE,QAAQ,IAAI,KAAK,EAAE,QAAQ,EAAE,MAAM,CAAC,QAAQ,GAAI,CACnE,CACP;YACD,oBAAC,MAAM,IACL,aAAa,EAAE,YAAY,EAC3B,MAAM,EAAE,EAAE,GAAG,aAAa,EAAE,QAAQ,EAAE,EACtC,iBAAiB,EAAE,WAAW,EAC9B,cAAc,EAAE,QAAQ,EACxB,aAAa,EAAE,cAAc,EAC7B,aAAa,EAAE,QAAQ,GACvB;YACD,CAAC,YAAY,IAAI,CAAC,WAAW,IAAI,CAAC,QAAQ,IAAI,QAAQ,IAAI,CACzD,6BAAK,SAAS,EAAE,MAAM,CAAC,eAAe,CAAC;gBACrC,oBAAC,YAAY,IAAC,IAAI,EAAC,OAAO,GAAG,CACzB,CACP;YACA,CAAC,YAAY,IAAI,oBAAoB,IAAI,CACxC;gBACG,aAAa;gBACb,WAAW,IAAI,cAAc,IAAI,CAChC,oBAAC,OAAO,IACN,SAAS,EAAE,MAAM,CAAC,yBAAyB,CAAC,EAC5C,QAAQ,EAAE,GAAG,EAAE,CAAC,WAAW,CAAC,OAAO,EACnC,OAAO,EAAE,cAAe,EACxB,QAAQ,EAAC,OAAO,EAChB,QAAQ,EAAE,GAAG,EAAE,CAAC,iBAAiB,CAAC,KAAK,CAAC,GACxC,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, { useEffect, useRef, useState } from 'react';\nimport clsx from 'clsx';\n\nimport { useMergeRefs } from '@cloudscape-design/component-toolkit/internal';\n\nimport InternalIcon from '../../icon/internal.js';\nimport { getBaseProps } from '../../internal/base-component';\nimport CheckboxIcon from '../../internal/components/checkbox-icon';\nimport Option from '../../internal/components/option';\nimport { DropdownOption, OptionDefinition, OptionGroup } from '../../internal/components/option/interfaces';\nimport { HighlightType } from '../../internal/components/options-list/utils/use-highlight-option.js';\nimport SelectableItem from '../../internal/components/selectable-item';\nimport useHiddenDescription from '../../internal/hooks/use-hidden-description';\nimport Tooltip from '../../tooltip/internal.js';\nimport { SelectProps } from '../interfaces.js';\n\nimport styles from './styles.css.js';\n\nexport interface ItemProps<T = SelectProps.SelectOptionItemRenderer> {\n index: number;\n virtualIndex?: number;\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 isPreviousSelected?: boolean;\n screenReaderContent?: string;\n ariaPosinset?: number;\n ariaSetsize?: number;\n highlightType?: HighlightType['type'];\n withScrollbar?: boolean;\n sticky?: boolean;\n renderOption?: T;\n parentProps?: ItemParentProps;\n}\n\nexport interface ItemParentProps {\n index: number;\n virtualIndex?: number;\n option: DropdownOption;\n disabled: boolean;\n}\nconst toSelectOptionGroupItem = (props: ItemParentProps): SelectProps.SelectOptionGroupItem => {\n return {\n type: 'group',\n index: props.virtualIndex ?? props.index,\n option: props.option.option as OptionGroup,\n disabled: props.disabled,\n };\n};\n\nconst toSelectOptionItem = (props: {\n index: number;\n virtualIndex?: number;\n option: DropdownOption;\n disabled: boolean;\n selected: boolean;\n highlighted: boolean;\n parentProps?: ItemParentProps;\n}): SelectProps.SelectOptionItem => {\n return {\n type: 'item',\n index: props.virtualIndex ?? props.index,\n option: props.option.option as OptionDefinition,\n selected: props.selected,\n highlighted: props.highlighted,\n disabled: props.disabled,\n parent: props.parentProps\n ? toSelectOptionGroupItem({\n index: props.parentProps?.index,\n virtualIndex: props.parentProps?.virtualIndex,\n option: props.parentProps?.option,\n disabled: props.disabled,\n })\n : null,\n };\n};\n\nconst Item = (\n {\n index,\n virtualIndex,\n option,\n highlighted,\n selected,\n filteringValue,\n hasCheckbox,\n virtualPosition,\n padBottom,\n isNextSelected,\n isPreviousSelected,\n screenReaderContent,\n ariaPosinset,\n ariaSetsize,\n highlightType,\n withScrollbar,\n sticky,\n renderOption,\n parentProps,\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 const [canShowTooltip, setCanShowTooltip] = useState(true);\n useEffect(() => setCanShowTooltip(true), [highlighted]);\n\n const getSelectItemProps = (option: DropdownOption): SelectProps.SelectItem => {\n if (option.type === 'parent') {\n return toSelectOptionGroupItem({\n option: option,\n index: index,\n virtualIndex: virtualIndex,\n disabled: !!disabled,\n });\n } else {\n return toSelectOptionItem({\n option: option,\n index: index,\n virtualIndex: virtualIndex,\n disabled: !!disabled,\n highlighted: !!highlighted,\n selected: !!selected,\n parentProps: parentProps,\n });\n }\n };\n\n const renderOptionWrapper = (option: DropdownOption) => {\n if (!renderOption) {\n return null;\n }\n\n return renderOption({ item: getSelectItemProps(option), filterText: filteringValue });\n };\n const renderResult = renderOptionWrapper(option);\n\n return (\n <SelectableItem\n disableContentStyling={!!renderResult}\n ariaSelected={Boolean(selected)}\n selected={selected}\n isNextSelected={isNextSelected}\n isPreviousSelected={isPreviousSelected}\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 value={option.option.value}\n withScrollbar={withScrollbar}\n sticky={sticky}\n {...baseProps}\n >\n <div className={clsx(styles.item, !isParent && wrappedOption.labelTag && styles['show-label-tag'])}>\n {!renderResult && hasCheckbox && !isParent && (\n <div className={styles.checkbox}>\n <CheckboxIcon checked={selected || false} disabled={option.disabled} />\n </div>\n )}\n <Option\n customContent={renderResult}\n option={{ ...wrappedOption, disabled }}\n highlightedOption={highlighted}\n selectedOption={selected}\n highlightText={filteringValue}\n isGroupOption={isParent}\n />\n {!renderResult && !hasCheckbox && !isParent && selected && (\n <div className={styles['selected-icon']}>\n <InternalIcon name=\"check\" />\n </div>\n )}\n {!renderResult && isDisabledWithReason && (\n <>\n {descriptionEl}\n {highlighted && canShowTooltip && (\n <Tooltip\n className={styles['disabled-reason-tooltip']}\n getTrack={() => internalRef.current}\n content={disabledReason!}\n position=\"right\"\n onEscape={() => setCanShowTooltip(false)}\n />\n )}\n </>\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,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC3D,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,YAAY,EAAE,MAAM,+CAA+C,CAAC;AAE7E,OAAO,YAAY,MAAM,wBAAwB,CAAC;AAClD,OAAO,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAC7D,OAAO,YAAY,MAAM,yCAAyC,CAAC;AACnE,OAAO,MAAM,MAAM,kCAAkC,CAAC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K,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, { useEffect, useRef, useState } from 'react';\nimport clsx from 'clsx';\n\nimport { useMergeRefs } from '@cloudscape-design/component-toolkit/internal';\n\nimport InternalIcon from '../../icon/internal.js';\nimport { getBaseProps } from '../../internal/base-component';\nimport CheckboxIcon from '../../internal/components/checkbox-icon';\nimport Option from '../../internal/components/option';\nimport { DropdownOption } from '../../internal/components/option/interfaces';\nimport { HighlightType } from '../../internal/components/options-list/utils/use-highlight-option.js';\nimport SelectableItem from '../../internal/components/selectable-item';\nimport useHiddenDescription from '../../internal/hooks/use-hidden-description';\nimport Tooltip from '../../tooltip/internal.js';\nimport { OptionDefinition, OptionGroup } from '../../types/option';\nimport { SelectProps } from '../interfaces.js';\n\nimport styles from './styles.css.js';\n\nexport interface ItemProps<T = SelectProps.SelectOptionItemRenderer> {\n index: number;\n virtualIndex?: number;\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 isPreviousSelected?: boolean;\n screenReaderContent?: string;\n ariaPosinset?: number;\n ariaSetsize?: number;\n highlightType?: HighlightType['type'];\n withScrollbar?: boolean;\n sticky?: boolean;\n renderOption?: T;\n parentProps?: ItemParentProps;\n}\n\nexport interface ItemParentProps {\n index: number;\n virtualIndex?: number;\n option: DropdownOption;\n disabled: boolean;\n}\nconst toSelectOptionGroupItem = (props: ItemParentProps): SelectProps.SelectOptionGroupItem => {\n return {\n type: 'group',\n index: props.virtualIndex ?? props.index,\n option: props.option.option as OptionGroup,\n disabled: props.disabled,\n };\n};\n\nconst toSelectOptionItem = (props: {\n index: number;\n virtualIndex?: number;\n option: DropdownOption;\n disabled: boolean;\n selected: boolean;\n highlighted: boolean;\n parentProps?: ItemParentProps;\n}): SelectProps.SelectOptionItem => {\n return {\n type: 'item',\n index: props.virtualIndex ?? props.index,\n option: props.option.option as OptionDefinition,\n selected: props.selected,\n highlighted: props.highlighted,\n disabled: props.disabled,\n parent: props.parentProps\n ? toSelectOptionGroupItem({\n index: props.parentProps?.index,\n virtualIndex: props.parentProps?.virtualIndex,\n option: props.parentProps?.option,\n disabled: props.disabled,\n })\n : null,\n };\n};\n\nconst Item = (\n {\n index,\n virtualIndex,\n option,\n highlighted,\n selected,\n filteringValue,\n hasCheckbox,\n virtualPosition,\n padBottom,\n isNextSelected,\n isPreviousSelected,\n screenReaderContent,\n ariaPosinset,\n ariaSetsize,\n highlightType,\n withScrollbar,\n sticky,\n renderOption,\n parentProps,\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 const [canShowTooltip, setCanShowTooltip] = useState(true);\n useEffect(() => setCanShowTooltip(true), [highlighted]);\n\n const getSelectItemProps = (option: DropdownOption): SelectProps.SelectItem => {\n if (option.type === 'parent') {\n return toSelectOptionGroupItem({\n option: option,\n index: index,\n virtualIndex: virtualIndex,\n disabled: !!disabled,\n });\n } else {\n return toSelectOptionItem({\n option: option,\n index: index,\n virtualIndex: virtualIndex,\n disabled: !!disabled,\n highlighted: !!highlighted,\n selected: !!selected,\n parentProps: parentProps,\n });\n }\n };\n\n const renderOptionWrapper = (option: DropdownOption) => {\n if (!renderOption) {\n return null;\n }\n\n return renderOption({ item: getSelectItemProps(option), filterText: filteringValue });\n };\n const renderResult = renderOptionWrapper(option);\n\n return (\n <SelectableItem\n disableContentStyling={!!renderResult}\n ariaSelected={Boolean(selected)}\n selected={selected}\n isNextSelected={isNextSelected}\n isPreviousSelected={isPreviousSelected}\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 value={option.option.value}\n withScrollbar={withScrollbar}\n sticky={sticky}\n {...baseProps}\n >\n <div className={clsx(styles.item, !isParent && wrappedOption.labelTag && styles['show-label-tag'])}>\n {!renderResult && hasCheckbox && !isParent && (\n <div className={styles.checkbox}>\n <CheckboxIcon checked={selected || false} disabled={option.disabled} />\n </div>\n )}\n <Option\n customContent={renderResult}\n option={{ ...wrappedOption, disabled }}\n highlightedOption={highlighted}\n selectedOption={selected}\n highlightText={filteringValue}\n isGroupOption={isParent}\n />\n {!renderResult && !hasCheckbox && !isParent && selected && (\n <div className={styles['selected-icon']}>\n <InternalIcon name=\"check\" />\n </div>\n )}\n {!renderResult && isDisabledWithReason && (\n <>\n {descriptionEl}\n {highlighted && canShowTooltip && (\n <Tooltip\n className={styles['disabled-reason-tooltip']}\n getTrack={() => internalRef.current}\n content={disabledReason!}\n position=\"right\"\n onEscape={() => setCanShowTooltip(false)}\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,KAAsC,MAAM,OAAO,CAAC;AAU3D,OAAO,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAEhE,OAAO,EAAE,eAAe,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AAGpD,UAAU,oBAAqB,SAAQ,SAAS,CAAC,gBAAgB,CAAC,6BAA6B,CAAC;IAC9F,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,WAAW,CAAC,EAAE,0BAA0B,CAAC;CAC1C;AAED,MAAM,WAAW,0BAA2B,SAAQ,eAAe;IACjE,aAAa,EAAE,OAAO,CAAC;IACvB,WAAW,EAAE,OAAO,CAAC;IACrB,QAAQ,EAAE,OAAO,CAAC;CACnB;;AAqMD,wBAA6D"}
1
+ {"version":3,"file":"multiselect-item.d.ts","sourceRoot":"","sources":["../../../../src/select/parts/multiselect-item.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAsC,MAAM,OAAO,CAAC;AAU3D,OAAO,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAGhE,OAAO,EAAE,eAAe,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AAGpD,UAAU,oBAAqB,SAAQ,SAAS,CAAC,gBAAgB,CAAC,6BAA6B,CAAC;IAC9F,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,WAAW,CAAC,EAAE,0BAA0B,CAAC;CAC1C;AAED,MAAM,WAAW,0BAA2B,SAAQ,eAAe;IACjE,aAAa,EAAE,OAAO,CAAC;IACvB,WAAW,EAAE,OAAO,CAAC;IACrB,QAAQ,EAAE,OAAO,CAAC;CACnB;;AAqMD,wBAA6D"}
@@ -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,EAAE,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAE3D,OAAO,EAAE,YAAY,EAAE,MAAM,+CAA+C,CAAC;AAE7E,OAAO,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAC7D,OAAO,YAAY,MAAM,yCAAyC,CAAC;AACnE,OAAO,M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EAC1B,WAAW,EAAE,MAAM,CAAC,WAAW,EAC/B,aAAa,EAAE,aAAa,EAC5B,MAAM,EAAE,MAAM,KACV,SAAS;QAEb,6BAAK,SAAS,EAAE,SAAS;YACtB,CAAC,YAAY,IAAI,WAAW,IAAI,CAC/B,6BAAK,SAAS,EAAE,MAAM,CAAC,QAAQ;gBAC7B,oBAAC,YAAY,IACX,OAAO,EAAE,QAAQ,EACjB,aAAa,EAAE,CAAC,QAAQ,IAAI,WAAW,CAAC,IAAI,aAAa,EACzD,QAAQ,EAAE,QAAQ,GAClB,CACE,CACP;YACD,oBAAC,MAAM,IACL,aAAa,EAAE,YAAY,EAC3B,MAAM,EAAE,EAAE,GAAG,aAAa,EAAE,QAAQ,EAAE,EACtC,iBAAiB,EAAE,WAAW,EAC9B,cAAc,EAAE,QAAQ,EACxB,aAAa,EAAE,cAAc,EAC7B,aAAa,EAAE,QAAQ,GACvB,CACE;QACL,CAAC,YAAY,IAAI,oBAAoB,IAAI,CACxC;YACG,aAAa;YACb,WAAW,IAAI,cAAc,IAAI,CAChC,oBAAC,OAAO,IACN,SAAS,EAAE,MAAM,CAAC,yBAAyB,CAAC,EAC5C,QAAQ,EAAE,GAAG,EAAE,CAAC,WAAW,CAAC,OAAO,EACnC,OAAO,EAAE,cAAe,EACxB,QAAQ,EAAC,OAAO,EAChB,QAAQ,EAAE,GAAG,EAAE,CAAC,iBAAiB,CAAC,KAAK,CAAC,GACxC,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, { useEffect, useRef, useState } from 'react';\n\nimport { useMergeRefs } from '@cloudscape-design/component-toolkit/internal';\n\nimport { getBaseProps } from '../../internal/base-component';\nimport CheckboxIcon from '../../internal/components/checkbox-icon';\nimport Option from '../../internal/components/option';\nimport { DropdownOption, OptionDefinition, OptionGroup } from '../../internal/components/option/interfaces';\nimport SelectableItem from '../../internal/components/selectable-item';\nimport useHiddenDescription from '../../internal/hooks/use-hidden-description';\nimport { MultiselectProps } from '../../multiselect/interfaces';\nimport Tooltip from '../../tooltip/internal.js';\nimport { ItemParentProps, ItemProps } from './item';\n\nimport styles from './styles.css.js';\ninterface MultiselectItemProps extends ItemProps<MultiselectProps.MultiselectOptionItemRenderer> {\n indeterminate?: boolean;\n parentProps?: MultiselectItemParentProps;\n}\n\nexport interface MultiselectItemParentProps extends ItemParentProps {\n indeterminate: boolean;\n highlighted: boolean;\n selected: boolean;\n}\nconst toMultiselectOptionGroupItem = (\n props: MultiselectItemParentProps\n): MultiselectProps.MultiselectOptionGroupItem => {\n return {\n type: 'group',\n index: props.virtualIndex ?? props.index,\n option: props.option.option as OptionGroup,\n indeterminate: props.indeterminate ?? false,\n selected: props.selected,\n highlighted: props.highlighted,\n disabled: props.disabled,\n };\n};\nconst toMultiselectOptionItem = (props: {\n index: number;\n virtualIndex?: number;\n option: DropdownOption;\n disabled: boolean;\n selected: boolean;\n highlighted: boolean;\n parentProps?: MultiselectItemParentProps;\n}): MultiselectProps.MultiselectOptionItem => {\n return {\n type: 'item',\n index: props.virtualIndex ?? props.index,\n option: props.option.option as OptionDefinition,\n selected: props.selected,\n highlighted: props.highlighted,\n disabled: props.disabled,\n parent: props.parentProps\n ? toMultiselectOptionGroupItem({\n index: props.parentProps?.index,\n virtualIndex: props.parentProps?.virtualIndex,\n option: props.parentProps?.option,\n disabled: props.disabled,\n highlighted: props.parentProps?.highlighted ?? false,\n indeterminate: props.parentProps?.indeterminate ?? false,\n selected: props.parentProps?.selected ?? false,\n })\n : null,\n };\n};\n\nconst MultiSelectItem = (\n {\n index,\n virtualIndex,\n option,\n highlighted,\n selected,\n filteringValue,\n hasCheckbox,\n virtualPosition,\n padBottom,\n isNextSelected,\n isPreviousSelected,\n indeterminate,\n screenReaderContent,\n ariaPosinset,\n ariaSetsize,\n highlightType,\n withScrollbar,\n sticky,\n renderOption,\n parentProps,\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 isSelectAll = option.type === 'select-all';\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 = styles.item;\n\n const { descriptionId, descriptionEl } = useHiddenDescription(disabledReason);\n\n const [canShowTooltip, setCanShowTooltip] = useState(true);\n useEffect(() => setCanShowTooltip(true), [highlighted]);\n\n const getMultiselectItemProps = (option: DropdownOption): MultiselectProps.MultiselectItem => {\n if (option.type === 'parent') {\n return toMultiselectOptionGroupItem({\n option: option,\n index: index,\n virtualIndex: virtualIndex,\n disabled: !!disabled,\n highlighted: !!highlighted,\n selected: !!selected,\n indeterminate: indeterminate ?? false,\n });\n } else if (option.type === 'select-all') {\n return {\n type: 'select-all',\n option: option.option as OptionDefinition,\n indeterminate: indeterminate ?? false,\n selected: !!selected,\n highlighted: !!highlighted,\n };\n } else {\n return toMultiselectOptionItem({\n option: option,\n index: index,\n virtualIndex: virtualIndex,\n disabled: !!disabled,\n highlighted: !!highlighted,\n selected: !!selected,\n parentProps: parentProps,\n });\n }\n };\n\n const renderOptionWrapper = (option: DropdownOption) => {\n if (!renderOption) {\n return null;\n }\n\n return renderOption({ item: getMultiselectItemProps(option), filterText: filteringValue });\n };\n\n const renderResult = renderOptionWrapper(option);\n\n return (\n <SelectableItem\n disableContentStyling={!!renderResult}\n ariaSelected={isParent && indeterminate ? undefined : Boolean(selected)}\n ariaChecked={isParent && indeterminate ? 'mixed' : Boolean(selected)}\n selected={selected}\n isNextSelected={isNextSelected}\n isPreviousSelected={isPreviousSelected}\n highlighted={highlighted}\n disabled={disabled}\n isParent={isParent}\n isChild={isChild}\n isSelectAll={isSelectAll}\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 value={option.option.value}\n afterHeader={option.afterHeader}\n withScrollbar={withScrollbar}\n sticky={sticky}\n {...baseProps}\n >\n <div className={className}>\n {!renderResult && hasCheckbox && (\n <div className={styles.checkbox}>\n <CheckboxIcon\n checked={selected}\n indeterminate={(isParent || isSelectAll) && indeterminate}\n disabled={disabled}\n />\n </div>\n )}\n <Option\n customContent={renderResult}\n option={{ ...wrappedOption, disabled }}\n highlightedOption={highlighted}\n selectedOption={selected}\n highlightText={filteringValue}\n isGroupOption={isParent}\n />\n </div>\n {!renderResult && isDisabledWithReason && (\n <>\n {descriptionEl}\n {highlighted && canShowTooltip && (\n <Tooltip\n className={styles['disabled-reason-tooltip']}\n getTrack={() => internalRef.current}\n content={disabledReason!}\n position=\"right\"\n onEscape={() => setCanShowTooltip(false)}\n />\n )}\n </>\n )}\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,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAE3D,OAAO,EAAE,YAAY,EAAE,MAAM,+CAA+C,CAAC;AAE7E,OAAO,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAC7D,OAAO,YAAY,MAAM,yCAAyC,CAAC;AACnE,OAAO,MAAM,MAA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AAW,EAAE,MAAM,CAAC,WAAW,EAC/B,aAAa,EAAE,aAAa,EAC5B,MAAM,EAAE,MAAM,KACV,SAAS;QAEb,6BAAK,SAAS,EAAE,SAAS;YACtB,CAAC,YAAY,IAAI,WAAW,IAAI,CAC/B,6BAAK,SAAS,EAAE,MAAM,CAAC,QAAQ;gBAC7B,oBAAC,YAAY,IACX,OAAO,EAAE,QAAQ,EACjB,aAAa,EAAE,CAAC,QAAQ,IAAI,WAAW,CAAC,IAAI,aAAa,EACzD,QAAQ,EAAE,QAAQ,GAClB,CACE,CACP;YACD,oBAAC,MAAM,IACL,aAAa,EAAE,YAAY,EAC3B,MAAM,EAAE,EAAE,GAAG,aAAa,EAAE,QAAQ,EAAE,EACtC,iBAAiB,EAAE,WAAW,EAC9B,cAAc,EAAE,QAAQ,EACxB,aAAa,EAAE,cAAc,EAC7B,aAAa,EAAE,QAAQ,GACvB,CACE;QACL,CAAC,YAAY,IAAI,oBAAoB,IAAI,CACxC;YACG,aAAa;YACb,WAAW,IAAI,cAAc,IAAI,CAChC,oBAAC,OAAO,IACN,SAAS,EAAE,MAAM,CAAC,yBAAyB,CAAC,EAC5C,QAAQ,EAAE,GAAG,EAAE,CAAC,WAAW,CAAC,OAAO,EACnC,OAAO,EAAE,cAAe,EACxB,QAAQ,EAAC,OAAO,EAChB,QAAQ,EAAE,GAAG,EAAE,CAAC,iBAAiB,CAAC,KAAK,CAAC,GACxC,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, { useEffect, useRef, useState } from 'react';\n\nimport { useMergeRefs } from '@cloudscape-design/component-toolkit/internal';\n\nimport { getBaseProps } from '../../internal/base-component';\nimport CheckboxIcon from '../../internal/components/checkbox-icon';\nimport Option from '../../internal/components/option';\nimport { DropdownOption } from '../../internal/components/option/interfaces';\nimport SelectableItem from '../../internal/components/selectable-item';\nimport useHiddenDescription from '../../internal/hooks/use-hidden-description';\nimport { MultiselectProps } from '../../multiselect/interfaces';\nimport Tooltip from '../../tooltip/internal.js';\nimport { OptionDefinition, OptionGroup } from '../../types/option';\nimport { ItemParentProps, ItemProps } from './item';\n\nimport styles from './styles.css.js';\ninterface MultiselectItemProps extends ItemProps<MultiselectProps.MultiselectOptionItemRenderer> {\n indeterminate?: boolean;\n parentProps?: MultiselectItemParentProps;\n}\n\nexport interface MultiselectItemParentProps extends ItemParentProps {\n indeterminate: boolean;\n highlighted: boolean;\n selected: boolean;\n}\nconst toMultiselectOptionGroupItem = (\n props: MultiselectItemParentProps\n): MultiselectProps.MultiselectOptionGroupItem => {\n return {\n type: 'group',\n index: props.virtualIndex ?? props.index,\n option: props.option.option as OptionGroup,\n indeterminate: props.indeterminate ?? false,\n selected: props.selected,\n highlighted: props.highlighted,\n disabled: props.disabled,\n };\n};\nconst toMultiselectOptionItem = (props: {\n index: number;\n virtualIndex?: number;\n option: DropdownOption;\n disabled: boolean;\n selected: boolean;\n highlighted: boolean;\n parentProps?: MultiselectItemParentProps;\n}): MultiselectProps.MultiselectOptionItem => {\n return {\n type: 'item',\n index: props.virtualIndex ?? props.index,\n option: props.option.option as OptionDefinition,\n selected: props.selected,\n highlighted: props.highlighted,\n disabled: props.disabled,\n parent: props.parentProps\n ? toMultiselectOptionGroupItem({\n index: props.parentProps?.index,\n virtualIndex: props.parentProps?.virtualIndex,\n option: props.parentProps?.option,\n disabled: props.disabled,\n highlighted: props.parentProps?.highlighted ?? false,\n indeterminate: props.parentProps?.indeterminate ?? false,\n selected: props.parentProps?.selected ?? false,\n })\n : null,\n };\n};\n\nconst MultiSelectItem = (\n {\n index,\n virtualIndex,\n option,\n highlighted,\n selected,\n filteringValue,\n hasCheckbox,\n virtualPosition,\n padBottom,\n isNextSelected,\n isPreviousSelected,\n indeterminate,\n screenReaderContent,\n ariaPosinset,\n ariaSetsize,\n highlightType,\n withScrollbar,\n sticky,\n renderOption,\n parentProps,\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 isSelectAll = option.type === 'select-all';\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 = styles.item;\n\n const { descriptionId, descriptionEl } = useHiddenDescription(disabledReason);\n\n const [canShowTooltip, setCanShowTooltip] = useState(true);\n useEffect(() => setCanShowTooltip(true), [highlighted]);\n\n const getMultiselectItemProps = (option: DropdownOption): MultiselectProps.MultiselectItem => {\n if (option.type === 'parent') {\n return toMultiselectOptionGroupItem({\n option: option,\n index: index,\n virtualIndex: virtualIndex,\n disabled: !!disabled,\n highlighted: !!highlighted,\n selected: !!selected,\n indeterminate: indeterminate ?? false,\n });\n } else if (option.type === 'select-all') {\n return {\n type: 'select-all',\n option: option.option as OptionDefinition,\n indeterminate: indeterminate ?? false,\n selected: !!selected,\n highlighted: !!highlighted,\n };\n } else {\n return toMultiselectOptionItem({\n option: option,\n index: index,\n virtualIndex: virtualIndex,\n disabled: !!disabled,\n highlighted: !!highlighted,\n selected: !!selected,\n parentProps: parentProps,\n });\n }\n };\n\n const renderOptionWrapper = (option: DropdownOption) => {\n if (!renderOption) {\n return null;\n }\n\n return renderOption({ item: getMultiselectItemProps(option), filterText: filteringValue });\n };\n\n const renderResult = renderOptionWrapper(option);\n\n return (\n <SelectableItem\n disableContentStyling={!!renderResult}\n ariaSelected={isParent && indeterminate ? undefined : Boolean(selected)}\n ariaChecked={isParent && indeterminate ? 'mixed' : Boolean(selected)}\n selected={selected}\n isNextSelected={isNextSelected}\n isPreviousSelected={isPreviousSelected}\n highlighted={highlighted}\n disabled={disabled}\n isParent={isParent}\n isChild={isChild}\n isSelectAll={isSelectAll}\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 value={option.option.value}\n afterHeader={option.afterHeader}\n withScrollbar={withScrollbar}\n sticky={sticky}\n {...baseProps}\n >\n <div className={className}>\n {!renderResult && hasCheckbox && (\n <div className={styles.checkbox}>\n <CheckboxIcon\n checked={selected}\n indeterminate={(isParent || isSelectAll) && indeterminate}\n disabled={disabled}\n />\n </div>\n )}\n <Option\n customContent={renderResult}\n option={{ ...wrappedOption, disabled }}\n highlightedOption={highlighted}\n selectedOption={selected}\n highlightText={filteringValue}\n isGroupOption={isParent}\n />\n </div>\n {!renderResult && isDisabledWithReason && (\n <>\n {descriptionEl}\n {highlighted && canShowTooltip && (\n <Tooltip\n className={styles['disabled-reason-tooltip']}\n getTrack={() => internalRef.current}\n content={disabledReason!}\n position=\"right\"\n onEscape={() => setCanShowTooltip(false)}\n />\n )}\n </>\n )}\n </SelectableItem>\n );\n};\n\nexport default React.memo(React.forwardRef(MultiSelectItem));\n"]}
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
- import { OptionDefinition } from '../../internal/components/option/interfaces';
3
- import { FormFieldValidationControlProps } from '../../internal/context/form-field-context';
4
2
  import { MultiselectProps } from '../../multiselect/interfaces';
3
+ import { FormFieldValidationControlProps } from '../../types/form-field';
4
+ import { OptionDefinition } from '../../types/option';
5
5
  import { SelectProps } from '../interfaces';
6
6
  import { SelectTriggerProps } from '../utils/use-select';
7
7
  export interface TriggerProps extends FormFieldValidationControlProps {
@@ -1 +1 @@
1
- {"version":3,"file":"trigger.d.ts","sourceRoot":"","sources":["../../../../src/select/parts/trigger.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAO1B,OAAO,EAAE,gBAAgB,EAAE,MAAM,6CAA6C,CAAC;AAC/E,OAAO,EAAE,+BAA+B,EAAE,MAAM,2CAA2C,CAAC;AAG5F,OAAO,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAEhE,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAIzD,MAAM,WAAW,YAAa,SAAQ,+BAA+B;IACnE,WAAW,EAAE,MAAM,GAAG,SAAS,CAAC;IAChC,QAAQ,EAAE,OAAO,GAAG,SAAS,CAAC;IAC9B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,YAAY,EAAE,kBAAkB,CAAC;IACjC,cAAc,EAAE,gBAAgB,GAAG,IAAI,CAAC;IACxC,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,cAAc,CAAC,EAAE,WAAW,CAAC,cAAc,GAAG,gBAAgB,CAAC,cAAc,CAAC;IAC9E,gBAAgB,CAAC,EAAE,MAAM,GAAG,QAAQ,CAAC;IACrC,eAAe,CAAC,EAAE,aAAa,CAAC,gBAAgB,CAAC,CAAC;IAClD,YAAY,CAAC,EAAE,WAAW,CAAC,wBAAwB,CAAC;CACrD;AAED,QAAA,MAAM,OAAO,wFA2IZ,CAAC;AAEF,eAAe,OAAO,CAAC"}
1
+ {"version":3,"file":"trigger.d.ts","sourceRoot":"","sources":["../../../../src/select/parts/trigger.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAS1B,OAAO,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAEhE,OAAO,EAAE,+BAA+B,EAAE,MAAM,wBAAwB,CAAC;AACzE,OAAO,EAAE,gBAAgB,EAAE,MAAM,o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J,CAAC,CACF,CAAC;AAEF,eAAe,OAAO,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';\n\nimport { useMergeRefs, useUniqueId } from '@cloudscape-design/component-toolkit/internal';\n\nimport ButtonTrigger from '../../internal/components/button-trigger';\nimport Option from '../../internal/components/option';\nimport { OptionDefinition } from '../../internal/components/option/interfaces';\nimport { FormFieldValidationControlProps } from '../../internal/context/form-field-context';\nimport { useVisualRefresh } from '../../internal/hooks/use-visual-mode';\nimport { joinStrings } from '../../internal/utils/strings';\nimport { MultiselectProps } from '../../multiselect/interfaces';\nimport InternalToken from '../../token/internal';\nimport { SelectProps } from '../interfaces';\nimport { SelectTriggerProps } from '../utils/use-select';\n\nimport styles from './styles.css.js';\n\nexport interface TriggerProps extends FormFieldValidationControlProps {\n placeholder: string | undefined;\n disabled: boolean | undefined;\n readOnly?: boolean;\n triggerProps: SelectTriggerProps;\n selectedOption: OptionDefinition | null;\n inlineLabelText?: string;\n isOpen?: boolean;\n triggerVariant?: SelectProps.TriggerVariant | MultiselectProps.TriggerVariant;\n inFilteringToken?: 'root' | 'nested';\n selectedOptions?: ReadonlyArray<OptionDefinition>;\n renderOption?: SelectProps.SelectOptionItemRenderer;\n}\n\nconst Trigger = React.forwardRef(\n (\n {\n ariaLabelledby,\n ariaDescribedby,\n controlId,\n invalid,\n inlineLabelText,\n warning,\n triggerProps,\n selectedOption,\n selectedOptions,\n triggerVariant,\n inFilteringToken,\n isOpen,\n placeholder,\n disabled,\n readOnly,\n renderOption,\n }: TriggerProps,\n ref: React.Ref<HTMLButtonElement>\n ) => {\n const isVisualRefresh = useVisualRefresh();\n const generatedId = useUniqueId();\n const id = controlId ?? generatedId;\n const triggerContentId = useUniqueId('trigger-content-');\n\n let ariaLabelledbyIds = joinStrings(ariaLabelledby, triggerContentId);\n\n let triggerContent = null;\n let hasCustomContent = false;\n if (triggerVariant === 'tokens') {\n if (selectedOptions?.length) {\n triggerContent = (\n <span\n className={clsx(\n styles['inline-token-trigger'],\n disabled && styles['inline-token-trigger--disabled'],\n isVisualRefresh && styles['visual-refresh']\n )}\n >\n <span className={styles['inline-token-list']}>\n {selectedOptions.map(({ label }, i) => (\n <InternalToken key={i} label={label} variant=\"inline\" disabled={disabled} />\n ))}\n </span>\n <span className={styles['inline-token-counter']} id={triggerContentId}>\n <span className={styles['inline-token-hidden-placeholder']}>{placeholder}</span>\n <span>({selectedOptions.length})</span>\n </span>\n </span>\n );\n ariaLabelledbyIds = ariaLabelledby;\n } else {\n triggerContent = (\n <span className={clsx(styles.placeholder, styles.trigger)} id={triggerContentId}>\n {placeholder}\n </span>\n );\n }\n } else if (!selectedOption) {\n triggerContent = (\n <span className={clsx(styles.placeholder, styles.trigger)} id={triggerContentId}>\n {placeholder}\n </span>\n );\n } else if (triggerVariant === 'option') {\n const triggerCustomContent = renderOption?.({\n filterText: undefined,\n item: {\n type: 'trigger',\n option: selectedOption,\n },\n });\n if (triggerCustomContent) {\n hasCustomContent = true;\n triggerContent = (\n <Option\n customContent={triggerCustomContent}\n id={triggerContentId}\n option={{ ...selectedOption, disabled }}\n triggerVariant={true}\n />\n );\n } else {\n triggerContent = (\n <Option id={triggerContentId} option={{ ...selectedOption, disabled }} triggerVariant={true} />\n );\n }\n } else {\n triggerContent = (\n <span id={triggerContentId} className={styles.trigger}>\n {selectedOption.label || selectedOption.value}\n </span>\n );\n }\n\n const mergedRef = useMergeRefs(triggerProps.ref, ref);\n const triggerButton = (\n <ButtonTrigger\n {...triggerProps}\n id={id}\n ref={mergedRef}\n pressed={!!isOpen}\n disabled={disabled}\n readOnly={readOnly}\n invalid={invalid}\n warning={warning && !invalid}\n inFilteringToken={inFilteringToken}\n inlineTokens={triggerVariant === 'tokens'}\n hasCustomContent={hasCustomContent}\n ariaDescribedby={ariaDescribedby}\n ariaLabelledby={ariaLabelledbyIds}\n >\n {triggerContent}\n </ButtonTrigger>\n );\n return (\n <>\n {inlineLabelText ? (\n <div className={styles['inline-label-wrapper']}>\n <label\n htmlFor={controlId}\n className={clsx(\n styles['inline-label'],\n disabled && styles['inline-label-disabled'],\n triggerVariant === 'tokens' && styles['inline-label-inline-tokens']\n )}\n >\n {inlineLabelText}\n </label>\n <div className={styles['inline-label-trigger-wrapper']}>{triggerButton}</div>\n </div>\n ) : (\n <>{triggerButton}</>\n )}\n </>\n );\n }\n);\n\nexport default Trigger;\n"]}
1
+ {"version":3,"file":"trigger.js","sourceRoot":"","sources":["../../../../src/select/parts/trigger.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,+CAA+C,CAAC;AAE1F,OAAO,aAAa,MAAM,0CAA0C,CAAC;AACrE,OAAO,MAAM,MAAM,kCAAkC,CAAC;AACtD,OAAO,EAAE,gBAAgB,EAAE,MAAM,sCAAsC,CAAC;AACxE,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAE3D,OAAO,aAAa,MAAM,sBAAsB,CAAC;AAMjD,OAAO,MAAM,MAAM,iBAAiB,CAAC;AAgBrC,MAAM,OAAO,GAAG,KAAK,CAAC,UAAU,CAC9B,CACE,EACE,cAAc,EACd,eAAe,EACf,SAAS,EACT,OAAO,EACP,eAAe,EACf,OAAO,EACP,YAAY,EACZ,cAAc,EACd,eAAe,EACf,cAAc,EACd,gBAAgB,EAChB,MAAM,EACN,WAAW,EACX,QAAQ,EACR,QAAQ,EACR,YAAY,GACC,EACf,GAAiC,EACjC,EAAE;IACF,MAAM,eAAe,GAAG,gBAAgB,EAAE,CAAC;IAC3C,MAAM,WAAW,GAAG,WAAW,EAAE,CAAC;IAClC,MAAM,EAAE,GAAG,SAAS,aAAT,SAAS,cAAT,SAAS,GAAI,WAAW,CAAC;IACpC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OAAO,EAAE,CAAC,CAAC,MAAM,EACjB,QAAQ,EAAE,QAAQ,EAClB,QAAQ,EAAE,QAAQ,EAClB,OAAO,EAAE,OAAO,EAChB,OAAO,EAAE,OAAO,IAAI,CAAC,OAAO,EAC5B,gBAAgB,EAAE,gBAAgB,EAClC,YAAY,EAAE,cAAc,KAAK,QAAQ,EACzC,gBAAgB,EAAE,gBAAgB,EAClC,eAAe,EAAE,eAAe,EAChC,cAAc,EAAE,iBAAiB,IAEhC,cAAc,CACD,CACjB,CAAC;IACF,OAAO,CACL,0CACG,eAAe,CAAC,CAAC,CAAC,CACjB,6BAAK,SAAS,EAAE,MAAM,CAAC,sBAAsB,CAAC;QAC5C,+BACE,OAAO,EAAE,SAAS,EAClB,SAAS,EAAE,IAAI,CACb,MAAM,CAAC,cAAc,CAAC,EACtB,QAAQ,IAAI,MAAM,CAAC,uBAAuB,CAAC,EAC3C,cAAc,KAAK,QAAQ,IAAI,MAAM,CAAC,4BAA4B,CAAC,CACpE,IAEA,eAAe,CACV;QACR,6BAAK,SAAS,EAAE,MAAM,CAAC,8BAA8B,CAAC,IAAG,aAAa,CAAO,CACzE,CACP,CAAC,CAAC,CAAC,CACF,0CAAG,aAAa,CAAI,CACrB,CACA,CACJ,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,OAAO,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';\n\nimport { useMergeRefs, useUniqueId } from '@cloudscape-design/component-toolkit/internal';\n\nimport ButtonTrigger from '../../internal/components/button-trigger';\nimport Option from '../../internal/components/option';\nimport { useVisualRefresh } from '../../internal/hooks/use-visual-mode';\nimport { joinStrings } from '../../internal/utils/strings';\nimport { MultiselectProps } from '../../multiselect/interfaces';\nimport InternalToken from '../../token/internal';\nimport { FormFieldValidationControlProps } from '../../types/form-field';\nimport { OptionDefinition } from '../../types/option';\nimport { SelectProps } from '../interfaces';\nimport { SelectTriggerProps } from '../utils/use-select';\n\nimport styles from './styles.css.js';\n\nexport interface TriggerProps extends FormFieldValidationControlProps {\n placeholder: string | undefined;\n disabled: boolean | undefined;\n readOnly?: boolean;\n triggerProps: SelectTriggerProps;\n selectedOption: OptionDefinition | null;\n inlineLabelText?: string;\n isOpen?: boolean;\n triggerVariant?: SelectProps.TriggerVariant | MultiselectProps.TriggerVariant;\n inFilteringToken?: 'root' | 'nested';\n selectedOptions?: ReadonlyArray<OptionDefinition>;\n renderOption?: SelectProps.SelectOptionItemRenderer;\n}\n\nconst Trigger = React.forwardRef(\n (\n {\n ariaLabelledby,\n ariaDescribedby,\n controlId,\n invalid,\n inlineLabelText,\n warning,\n triggerProps,\n selectedOption,\n selectedOptions,\n triggerVariant,\n inFilteringToken,\n isOpen,\n placeholder,\n disabled,\n readOnly,\n renderOption,\n }: TriggerProps,\n ref: React.Ref<HTMLButtonElement>\n ) => {\n const isVisualRefresh = useVisualRefresh();\n const generatedId = useUniqueId();\n const id = controlId ?? generatedId;\n const triggerContentId = useUniqueId('trigger-content-');\n\n let ariaLabelledbyIds = joinStrings(ariaLabelledby, triggerContentId);\n\n let triggerContent = null;\n let hasCustomContent = false;\n if (triggerVariant === 'tokens') {\n if (selectedOptions?.length) {\n triggerContent = (\n <span\n className={clsx(\n styles['inline-token-trigger'],\n disabled && styles['inline-token-trigger--disabled'],\n isVisualRefresh && styles['visual-refresh']\n )}\n >\n <span className={styles['inline-token-list']}>\n {selectedOptions.map(({ label }, i) => (\n <InternalToken key={i} label={label} variant=\"inline\" disabled={disabled} />\n ))}\n </span>\n <span className={styles['inline-token-counter']} id={triggerContentId}>\n <span className={styles['inline-token-hidden-placeholder']}>{placeholder}</span>\n <span>({selectedOptions.length})</span>\n </span>\n </span>\n );\n ariaLabelledbyIds = ariaLabelledby;\n } else {\n triggerContent = (\n <span className={clsx(styles.placeholder, styles.trigger)} id={triggerContentId}>\n {placeholder}\n </span>\n );\n }\n } else if (!selectedOption) {\n triggerContent = (\n <span className={clsx(styles.placeholder, styles.trigger)} id={triggerContentId}>\n {placeholder}\n </span>\n );\n } else if (triggerVariant === 'option') {\n const triggerCustomContent = renderOption?.({\n filterText: undefined,\n item: {\n type: 'trigger',\n option: selectedOption,\n },\n });\n if (triggerCustomContent) {\n hasCustomContent = true;\n triggerContent = (\n <Option\n customContent={triggerCustomContent}\n id={triggerContentId}\n option={{ ...selectedOption, disabled }}\n triggerVariant={true}\n />\n );\n } else {\n triggerContent = (\n <Option id={triggerContentId} option={{ ...selectedOption, disabled }} triggerVariant={true} />\n );\n }\n } else {\n triggerContent = (\n <span id={triggerContentId} className={styles.trigger}>\n {selectedOption.label || selectedOption.value}\n </span>\n );\n }\n\n const mergedRef = useMergeRefs(triggerProps.ref, ref);\n const triggerButton = (\n <ButtonTrigger\n {...triggerProps}\n id={id}\n ref={mergedRef}\n pressed={!!isOpen}\n disabled={disabled}\n readOnly={readOnly}\n invalid={invalid}\n warning={warning && !invalid}\n inFilteringToken={inFilteringToken}\n inlineTokens={triggerVariant === 'tokens'}\n hasCustomContent={hasCustomContent}\n ariaDescribedby={ariaDescribedby}\n ariaLabelledby={ariaLabelledbyIds}\n >\n {triggerContent}\n </ButtonTrigger>\n );\n return (\n <>\n {inlineLabelText ? (\n <div className={styles['inline-label-wrapper']}>\n <label\n htmlFor={controlId}\n className={clsx(\n styles['inline-label'],\n disabled && styles['inline-label-disabled'],\n triggerVariant === 'tokens' && styles['inline-label-inline-tokens']\n )}\n >\n {inlineLabelText}\n </label>\n <div className={styles['inline-label-trigger-wrapper']}>{triggerButton}</div>\n </div>\n ) : (\n <>{triggerButton}</>\n )}\n </>\n );\n }\n);\n\nexport default Trigger;\n"]}
@@ -1,4 +1,5 @@
1
- import { DropdownOption, OptionDefinition } from '../../internal/components/option/interfaces';
1
+ import { DropdownOption } from '../../internal/components/option/interfaces';
2
+ import { OptionDefinition } from '../../types/option';
2
3
  export declare const connectOptionsByValue: (options: ReadonlyArray<DropdownOption>, selectedOptions: ReadonlyArray<OptionDefinition>) => ReadonlyArray<DropdownOption>;
3
4
  export declare const findOptionIndex: (options: ReadonlyArray<OptionDefinition>, option: OptionDefinition) => number;
4
5
  //# sourceMappingURL=connect-options.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"connect-options.d.ts","sourceRoot":"","sources":["../../../../src/select/utils/connect-options.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,6CAA6C,CAAC;AAE/F,eAAO,MAAM,qBAAqB,GAChC,SAAS,aAAa,CAAC,cAAc,CAAC,EACtC,iBAAiB,aAAa,CAAC,gBAAgB,CAAC,KAC/C,aAAa,CAAC,cAAc,CAY9B,CAAC;AAEF,eAAO,MAAM,eAAe,GAAI,SAAS,aAAa,CAAC,gBAAgB,CAAC,EAAE,QAAQ,gBAAgB,WAQjG,CAAC"}
1
+ {"version":3,"file":"connect-options.d.ts","sourceRoot":"","sources":["../../../../src/select/utils/connect-options.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAE,MAAM,6CAA6C,CAAC;AAC7E,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAEtD,eAAO,MAAM,qBAAqB,GAChC,SAAS,aAAa,CAAC,cAAc,CAAC,EACtC,iBAAiB,aAAa,CAAC,gBAAgB,CAAC,KAC/C,aAAa,CAAC,cAAc,CAY9B,CAAC;AAEF,eAAO,MAAM,eAAe,GAAI,SAAS,aAAa,CAAC,gBAAgB,CAAC,EAAE,QAAQ,gBAAgB,WAQjG,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"connect-options.js","sourceRoot":"","sources":["../../../../src/select/utils/connect-options.ts"],"names":[],"mappings":"AAIA,MAAM,CAAC,MAAM,qBAAqB,GAAG,CACnC,OAAsC,EACtC,eAAgD,EACjB,EAAE;IACjC,OAAO,CAAC,eAAe,IAAI,EAAE,CAAC,CAAC,GAAG,CAAC,cAAc,CAAC,EAAE;QAClD,KAAK,MAAM,cAAc,IAAI,OAAO,EAAE,CAAC;YACrC,IACE,cAAc,CAAC,IAAI,KAAK,QAAQ;gBAC/B,cAAc,CAAC,MAA2B,CAAC,KAAK,KAAK,cAAc,CAAC,KAAK,EAC1E,CAAC;gBACD,OAAO,cAAc,CAAC;YACxB,CAAC;QACH,CAAC;QACD,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,CAAC;IACpC,CAAC,CAAC,CAAC;AACL,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,OAAwC,EAAE,MAAwB,EAAE,EAAE;IACpG,KAAK,IAAI,KAAK,GAAG,CAAC,EAAE,KAAK,GAAG,OAAO,CAAC,MAAM,EAAE,KAAK,EAAE,EAAE,CAAC;QACpD,MAAM,QAAQ,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC;QAChC,IAAI,QAAQ,KAAK,MAAM,IAAI,QAAQ,CAAC,KAAK,KAAK,MAAM,CAAC,KAAK,EAAE,CAAC;YAC3D,OAAO,KAAK,CAAC;QACf,CAAC;IACH,CAAC;IACD,OAAO,CAAC,CAAC,CAAC;AACZ,CAAC,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { DropdownOption, OptionDefinition } from '../../internal/components/option/interfaces';\n\nexport const connectOptionsByValue = (\n options: ReadonlyArray<DropdownOption>,\n selectedOptions: ReadonlyArray<OptionDefinition>\n): ReadonlyArray<DropdownOption> => {\n return (selectedOptions || []).map(selectedOption => {\n for (const dropdownOption of options) {\n if (\n dropdownOption.type !== 'parent' &&\n (dropdownOption.option as OptionDefinition).value === selectedOption.value\n ) {\n return dropdownOption;\n }\n }\n return { option: selectedOption };\n });\n};\n\nexport const findOptionIndex = (options: ReadonlyArray<OptionDefinition>, option: OptionDefinition) => {\n for (let index = 0; index < options.length; index++) {\n const __option = options[index];\n if (__option === option || __option.value === option.value) {\n return index;\n }\n }\n return -1;\n};\n"]}
1
+ {"version":3,"file":"connect-options.js","sourceRoot":"","sources":["../../../../src/select/utils/connect-options.ts"],"names":[],"mappings":"AAKA,MAAM,CAAC,MAAM,qBAAqB,GAAG,CACnC,OAAsC,EACtC,eAAgD,EACjB,EAAE;IACjC,OAAO,CAAC,eAAe,IAAI,EAAE,CAAC,CAAC,GAAG,CAAC,cAAc,CAAC,EAAE;QAClD,KAAK,MAAM,cAAc,IAAI,OAAO,EAAE,CAAC;YACrC,IACE,cAAc,CAAC,IAAI,KAAK,QAAQ;gBAC/B,cAAc,CAAC,MAA2B,CAAC,KAAK,KAAK,cAAc,CAAC,KAAK,EAC1E,CAAC;gBACD,OAAO,cAAc,CAAC;YACxB,CAAC;QACH,CAAC;QACD,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,CAAC;IACpC,CAAC,CAAC,CAAC;AACL,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,OAAwC,EAAE,MAAwB,EAAE,EAAE;IACpG,KAAK,IAAI,KAAK,GAAG,CAAC,EAAE,KAAK,GAAG,OAAO,CAAC,MAAM,EAAE,KAAK,EAAE,EAAE,CAAC;QACpD,MAAM,QAAQ,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC;QAChC,IAAI,QAAQ,KAAK,MAAM,IAAI,QAAQ,CAAC,KAAK,KAAK,MAAM,CAAC,KAAK,EAAE,CAAC;YAC3D,OAAO,KAAK,CAAC;QACf,CAAC;IACH,CAAC;IACD,OAAO,CAAC,CAAC,CAAC;AACZ,CAAC,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { DropdownOption } from '../../internal/components/option/interfaces';\nimport { OptionDefinition } from '../../types/option';\n\nexport const connectOptionsByValue = (\n options: ReadonlyArray<DropdownOption>,\n selectedOptions: ReadonlyArray<OptionDefinition>\n): ReadonlyArray<DropdownOption> => {\n return (selectedOptions || []).map(selectedOption => {\n for (const dropdownOption of options) {\n if (\n dropdownOption.type !== 'parent' &&\n (dropdownOption.option as OptionDefinition).value === selectedOption.value\n ) {\n return dropdownOption;\n }\n }\n return { option: selectedOption };\n });\n};\n\nexport const findOptionIndex = (options: ReadonlyArray<OptionDefinition>, option: OptionDefinition) => {\n for (let index = 0; index < options.length; index++) {\n const __option = options[index];\n if (__option === option || __option.value === option.value) {\n return index;\n }\n }\n return -1;\n};\n"]}
@@ -1,4 +1,4 @@
1
- import { OptionDefinition, OptionGroup } from '../../internal/components/option/interfaces';
1
+ import { OptionDefinition, OptionGroup } from '../../types/option';
2
2
  import { SelectProps } from '../interfaces';
3
3
  interface OptionHolder {
4
4
  option?: OptionDefinition | OptionGroup;
@@ -1 +1 @@
1
- {"version":3,"file":"use-announcement.d.ts","sourceRoot":"","sources":["../../../../src/select/utils/use-announcement.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,6CAA6C,CAAC;AAE5F,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAE5C,UAAU,YAAY;IACpB,MAAM,CAAC,EAAE,gBAAgB,GAAG,WAAW,CAAC;CACzC;AAED;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,MAAM,SAAS,YAAY,EAAE,EAC3D,aAAa,EACb,gBAAgB,EAChB,iBAAiB,EACjB,SAAS,EACT,iBAAiB,EACjB,yBAAyB,GAC1B,EAAE;IACD,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,gBAAgB,EAAE,OAAO,CAAC;IAC1B,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,SAAS,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,SAAS,GAAG,WAAW,CAAC;IACvD,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,yBAAyB,CAAC,EAAE,WAAW,CAAC,8BAA8B,CAAC;CACxE,UAuCA"}
1
+ {"version":3,"file":"use-announcement.d.ts","sourceRoot":"","sources":["../../../../src/select/utils/use-announcement.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACnE,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAE5C,UAAU,YAAY;IACpB,MAAM,CAAC,EAAE,gBAAgB,GAAG,WAAW,CAAC;CACzC;AAED;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,MAAM,SAAS,YAAY,EAAE,EAC3D,aAAa,EACb,gBAAgB,EAChB,iBAAiB,EACjB,SAAS,EACT,iBAAiB,EACjB,yBAAyB,GAC1B,EAAE;IACD,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,gBAAgB,EAAE,OAAO,CAAC;IAC1B,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,SAAS,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,SAAS,GAAG,WAAW,CAAC;IACvD,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,yBAAyB,CAAC,EAAE,WAAW,CAAC,8BAA8B,CAAC;CACxE,UAuCA"}
@@ -1 +1 @@
1
- {"version":3,"file":"use-announcement.js","sourceRoot":"","sources":["../../../../src/select/utils/use-announcement.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAG1C,OAAO,wBAAwB,MAAM,mDAAmD,CAAC;AAOzF;;;;;GAKG;AACH,MAAM,UAAU,eAAe,CAA8B,EAC3D,aAAa,EACb,gBAAgB,EAChB,iBAAiB,EACjB,SAAS,EACT,iBAAiB,EACjB,yBAAyB,GAQ1B;IACC,MAAM,kBAAkB,GAAG,MAAM,CAA0B,SAAS,CAAC,CAAC;IAEtE,iGAAiG;IACjG,SAAS,CAAC,GAAG,EAAE;QACb,IAAI,iBAAiB,EAAE,CAAC;YACtB,MAAM,OAAO,GAAG,qBAAqB,CAAC,GAAG,EAAE;gBACzC,kBAAkB,CAAC,OAAO,GAAG,SAAS,CAAC,iBAAiB,CAAC,CAAC;YAC5D,CAAC,CAAC,CAAC;YACH,OAAO,GAAG,EAAE,CAAC,oBAAoB,CAAC,OAAO,CAAC,CAAC;QAC7C,CAAC;IACH,CAAC,CAAC,CAAC;IAEH,IAAI,CAAC,iBAAiB,EAAE,CAAC;QACvB,OAAO,EAAE,CAAC;IACZ,CAAC;IAED,MAAM,MAAM,GAAG,iBAAiB,CAAC,MAA0B,CAAC;IAC5D,MAAM,MAAM,GAAG,SAAS,CAAC,iBAAiB,CAAC,CAAC;IAC5C,0EAA0E;IAC1E,MAAM,KAAK,GAAG,MAAM,IAAI,MAAM,KAAK,kBAAkB,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC;IAEnF,mCAAmC;IACnC,IAAI,yBAAyB,EAAE,CAAC;QAC9B,OAAO,yBAAyB,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;IAClD,CAAC;IAED,yEAAyE;IACzE,4FAA4F;IAC5F,yFAAyF;IACzF,8FAA8F;IAC9F,oFAAoF;IACpF,0FAA0F;IAC1F,uFAAuF;IACvF,oEAAoE;IACpE,+BAA+B;IAC/B,MAAM,oBAAoB,GAAG,gBAAgB,IAAI,iBAAiB,CAAC,CAAC,CAAC,iBAAiB,CAAC,CAAC,CAAC,EAAE,CAAC;IAC5F,MAAM,kBAAkB,GAAG,wBAAwB,CAAC,EAAE,MAAM,EAAE,WAAW,EAAE,KAAK,EAAE,aAAa,EAAE,CAAC,CAAC;IACnG,OAAO,CAAC,oBAAoB,EAAE,kBAAkB,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAC9E,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { useEffect, useRef } from 'react';\n\nimport { OptionDefinition, OptionGroup } from '../../internal/components/option/interfaces';\nimport defaultOptionDescription from '../../internal/components/option/option-announcer';\nimport { SelectProps } from '../interfaces';\n\ninterface OptionHolder {\n option?: OptionDefinition | OptionGroup;\n}\n\n/**\n * The hook produces the live region string to be announced when an option is highlighted.\n * This is a workaround to account for the issues with assistive technologies.\n *\n * If the testing reveals no issues with the native announcements the live-region can be removed.\n */\nexport function useAnnouncement<Option extends OptionHolder>({\n highlightText,\n announceSelected,\n highlightedOption,\n getParent,\n selectedAriaLabel,\n renderHighlightedAriaLive,\n}: {\n highlightText?: string;\n announceSelected: boolean;\n highlightedOption?: Option;\n getParent: (option: Option) => undefined | OptionGroup;\n selectedAriaLabel?: string;\n renderHighlightedAriaLive?: SelectProps.ContainingOptionAndGroupString;\n}) {\n const prevAnnouncedGroup = useRef<OptionGroup | undefined>(undefined);\n\n // Record previously announced group with a delay to account for possible re-renders of the hook.\n useEffect(() => {\n if (highlightedOption) {\n const frameId = requestAnimationFrame(() => {\n prevAnnouncedGroup.current = getParent(highlightedOption);\n });\n return () => cancelAnimationFrame(frameId);\n }\n });\n\n if (!highlightedOption) {\n return '';\n }\n\n const option = highlightedOption.option as OptionDefinition;\n const parent = getParent(highlightedOption);\n // Only announce parent group if it wasn't announced with previous option.\n const group = parent && parent !== prevAnnouncedGroup.current ? parent : undefined;\n\n // Use custom renderer if provided.\n if (renderHighlightedAriaLive) {\n return renderHighlightedAriaLive(option, group);\n }\n\n // Use default renderer with selected ARIA label if defined and relevant.\n // Note: We intentionally keep selectedAriaLabel in the live region announcement even though\n // we now use proper ARIA attributes (aria-selected, aria-checked, aria-multiselectable).\n // This is because NVDA and older versions of JAWS (e.g., 2022, still commonly used) have bugs\n // where they don't properly announce the selected state from ARIA attributes alone.\n // For newer screen readers (modern JAWS, VoiceOver), this results in redundant \"Selected\"\n // announcements, but this is preferable to the alternative where users hear \"Selected\"\n // followed by \"Not Selected\" due to missing ARIA attribute support.\n // See AWSUI-61639 for details.\n const selectedAnnouncement = announceSelected && selectedAriaLabel ? selectedAriaLabel : '';\n const defaultDescription = defaultOptionDescription({ option, parentGroup: group, highlightText });\n return [selectedAnnouncement, defaultDescription].filter(Boolean).join(' ');\n}\n"]}
1
+ {"version":3,"file":"use-announcement.js","sourceRoot":"","sources":["../../../../src/select/utils/use-announcement.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAE1C,OAAO,wBAAwB,MAAM,mDAAmD,CAAC;AAQzF;;;;;GAKG;AACH,MAAM,UAAU,eAAe,CAA8B,EAC3D,aAAa,EACb,gBAAgB,EAChB,iBAAiB,EACjB,SAAS,EACT,iBAAiB,EACjB,yBAAyB,GAQ1B;IACC,MAAM,kBAAkB,GAAG,MAAM,CAA0B,SAAS,CAAC,CAAC;IAEtE,iGAAiG;IACjG,SAAS,CAAC,GAAG,EAAE;QACb,IAAI,iBAAiB,EAAE,CAAC;YACtB,MAAM,OAAO,GAAG,qBAAqB,CAAC,GAAG,EAAE;gBACzC,kBAAkB,CAAC,OAAO,GAAG,SAAS,CAAC,iBAAiB,CAAC,CAAC;YAC5D,CAAC,CAAC,CAAC;YACH,OAAO,GAAG,EAAE,CAAC,oBAAoB,CAAC,OAAO,CAAC,CAAC;QAC7C,CAAC;IACH,CAAC,CAAC,CAAC;IAEH,IAAI,CAAC,iBAAiB,EAAE,CAAC;QACvB,OAAO,EAAE,CAAC;IACZ,CAAC;IAED,MAAM,MAAM,GAAG,iBAAiB,CAAC,MAA0B,CAAC;IAC5D,MAAM,MAAM,GAAG,SAAS,CAAC,iBAAiB,CAAC,CAAC;IAC5C,0EAA0E;IAC1E,MAAM,KAAK,GAAG,MAAM,IAAI,MAAM,KAAK,kBAAkB,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC;IAEnF,mCAAmC;IACnC,IAAI,yBAAyB,EAAE,CAAC;QAC9B,OAAO,yBAAyB,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;IAClD,CAAC;IAED,yEAAyE;IACzE,4FAA4F;IAC5F,yFAAyF;IACzF,8FAA8F;IAC9F,oFAAoF;IACpF,0FAA0F;IAC1F,uFAAuF;IACvF,oEAAoE;IACpE,+BAA+B;IAC/B,MAAM,oBAAoB,GAAG,gBAAgB,IAAI,iBAAiB,CAAC,CAAC,CAAC,iBAAiB,CAAC,CAAC,CAAC,EAAE,CAAC;IAC5F,MAAM,kBAAkB,GAAG,wBAAwB,CAAC,EAAE,MAAM,EAAE,WAAW,EAAE,KAAK,EAAE,aAAa,EAAE,CAAC,CAAC;IACnG,OAAO,CAAC,oBAAoB,EAAE,kBAAkB,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAC9E,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { useEffect, useRef } from 'react';\n\nimport defaultOptionDescription from '../../internal/components/option/option-announcer';\nimport { OptionDefinition, OptionGroup } from '../../types/option';\nimport { SelectProps } from '../interfaces';\n\ninterface OptionHolder {\n option?: OptionDefinition | OptionGroup;\n}\n\n/**\n * The hook produces the live region string to be announced when an option is highlighted.\n * This is a workaround to account for the issues with assistive technologies.\n *\n * If the testing reveals no issues with the native announcements the live-region can be removed.\n */\nexport function useAnnouncement<Option extends OptionHolder>({\n highlightText,\n announceSelected,\n highlightedOption,\n getParent,\n selectedAriaLabel,\n renderHighlightedAriaLive,\n}: {\n highlightText?: string;\n announceSelected: boolean;\n highlightedOption?: Option;\n getParent: (option: Option) => undefined | OptionGroup;\n selectedAriaLabel?: string;\n renderHighlightedAriaLive?: SelectProps.ContainingOptionAndGroupString;\n}) {\n const prevAnnouncedGroup = useRef<OptionGroup | undefined>(undefined);\n\n // Record previously announced group with a delay to account for possible re-renders of the hook.\n useEffect(() => {\n if (highlightedOption) {\n const frameId = requestAnimationFrame(() => {\n prevAnnouncedGroup.current = getParent(highlightedOption);\n });\n return () => cancelAnimationFrame(frameId);\n }\n });\n\n if (!highlightedOption) {\n return '';\n }\n\n const option = highlightedOption.option as OptionDefinition;\n const parent = getParent(highlightedOption);\n // Only announce parent group if it wasn't announced with previous option.\n const group = parent && parent !== prevAnnouncedGroup.current ? parent : undefined;\n\n // Use custom renderer if provided.\n if (renderHighlightedAriaLive) {\n return renderHighlightedAriaLive(option, group);\n }\n\n // Use default renderer with selected ARIA label if defined and relevant.\n // Note: We intentionally keep selectedAriaLabel in the live region announcement even though\n // we now use proper ARIA attributes (aria-selected, aria-checked, aria-multiselectable).\n // This is because NVDA and older versions of JAWS (e.g., 2022, still commonly used) have bugs\n // where they don't properly announce the selected state from ARIA attributes alone.\n // For newer screen readers (modern JAWS, VoiceOver), this results in redundant \"Selected\"\n // announcements, but this is preferable to the alternative where users hear \"Selected\"\n // followed by \"Not Selected\" due to missing ARIA attribute support.\n // See AWSUI-61639 for details.\n const selectedAnnouncement = announceSelected && selectedAriaLabel ? selectedAriaLabel : '';\n const defaultDescription = defaultOptionDescription({ option, parentGroup: group, highlightText });\n return [selectedAnnouncement, defaultDescription].filter(Boolean).join(' ');\n}\n"]}
@@ -1,5 +1,5 @@
1
- import { DropdownStatusProps } from '../../internal/components/dropdown-status';
2
- import { OptionDefinition, OptionGroup } from '../../internal/components/option/interfaces';
1
+ import { DropdownStatusProps } from '../../types/dropdown-status';
2
+ import { OptionDefinition, OptionGroup } from '../../types/option';
3
3
  import { SelectProps } from '../interfaces';
4
4
  interface UseLoadItemsProps {
5
5
  onLoadItems: SelectProps['onLoadItems'];
@@ -1 +1 @@
1
- {"version":3,"file":"use-load-items.d.ts","sourceRoot":"","sources":["../../../../src/select/utils/use-load-items.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,mBAAmB,EAAE,MAAM,2CAA2C,CAAC;AAChF,OAAO,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,6CAA6C,CAAC;AAE5F,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAE5C,UAAU,iBAAiB;IACzB,WAAW,EAAE,WAAW,CAAC,aAAa,CAAC,CAAC;IACxC,OAAO,EAAE,aAAa,CAAC,gBAAgB,GAAG,WAAW,CAAC,CAAC;IACvD,UAAU,EAAE,mBAAmB,CAAC,UAAU,CAAC;CAC5C;AAED,eAAO,MAAM,YAAY,GAAI,sCAAsC,iBAAiB;mCAG5C,MAAM;;;CA+B7C,CAAC"}
1
+ {"version":3,"file":"use-load-items.d.ts","sourceRoot":"","sources":["../../../../src/select/utils/use-load-items.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAC;AAClE,OAAO,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACnE,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAE5C,UAAU,iBAAiB;IACzB,WAAW,EAAE,WAAW,CAAC,aAAa,CAAC,CAAC;IACxC,OAAO,EAAE,aAAa,CAAC,gBAAgB,GAAG,WAAW,CAAC,CAAC;IACvD,UAAU,EAAE,mBAAmB,CAAC,UAAU,CAAC;CAC5C;AAED,eAAO,MAAM,YAAY,GAAI,sCAAsC,iBAAiB;mCAG5C,MAAM;;;CA+B7C,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"use-load-items.js","sourceRoot":"","sources":["../../../../src/select/utils/use-load-items.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAI/B,OAAO,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAC;AAS/D,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,EAAE,WAAW,EAAE,OAAO,EAAE,UAAU,EAAqB,EAAE,EAAE;IACtF,MAAM,iBAAiB,GAAG,MAAM,CAAqB,SAAS,CAAC,CAAC;IAEhE,MAAM,aAAa,GAAG,CAAC,aAAqB,EAAE,EAAE;QAC9C,IAAI,iBAAiB,CAAC,OAAO,KAAK,aAAa,EAAE,CAAC;YAChD,OAAO;QACT,CAAC;QACD,iBAAiB,CAAC,OAAO,GAAG,aAAa,CAAC;QAC1C,sBAAsB,CAAC,WAAW,EAAE,EAAE,aAAa,EAAE,SAAS,EAAE,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC,CAAC;IAC3F,CAAC,CAAC;IAEF,MAAM,cAAc,GAAG,GAAG,EAAE;QAC1B,MAAM,SAAS,GAAG,OAAO,CAAC,MAAM,KAAK,CAAC,CAAC;QACvC,IAAI,UAAU,KAAK,SAAS,EAAE,CAAC;YAC7B,sBAAsB,CAAC,WAAW,EAAE;gBAClC,SAAS;gBACT,QAAQ,EAAE,KAAK;gBACf,aAAa,EAAE,iBAAiB,CAAC,OAAO,IAAI,EAAE;aAC/C,CAAC,CAAC;QACL,CAAC;IACH,CAAC,CAAC;IAEF,MAAM,mBAAmB,GAAG,GAAG,EAAE,CAC/B,sBAAsB,CAAC,WAAW,EAAE;QAClC,SAAS,EAAE,KAAK;QAChB,QAAQ,EAAE,IAAI;QACd,aAAa,EAAE,iBAAiB,CAAC,OAAO,IAAI,EAAE;KAC/C,CAAC,CAAC;IAEL,OAAO;QACL,aAAa;QACb,cAAc;QACd,mBAAmB;KACpB,CAAC;AACJ,CAAC,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { useRef } from 'react';\n\nimport { DropdownStatusProps } from '../../internal/components/dropdown-status';\nimport { OptionDefinition, OptionGroup } from '../../internal/components/option/interfaces';\nimport { fireNonCancelableEvent } from '../../internal/events';\nimport { SelectProps } from '../interfaces';\n\ninterface UseLoadItemsProps {\n onLoadItems: SelectProps['onLoadItems'];\n options: ReadonlyArray<OptionDefinition | OptionGroup>;\n statusType: DropdownStatusProps.StatusType;\n}\n\nexport const useLoadItems = ({ onLoadItems, options, statusType }: UseLoadItemsProps) => {\n const prevFilteringText = useRef<string | undefined>(undefined);\n\n const fireLoadItems = (filteringText: string) => {\n if (prevFilteringText.current === filteringText) {\n return;\n }\n prevFilteringText.current = filteringText;\n fireNonCancelableEvent(onLoadItems, { filteringText, firstPage: true, samePage: false });\n };\n\n const handleLoadMore = () => {\n const firstPage = options.length === 0;\n if (statusType === 'pending') {\n fireNonCancelableEvent(onLoadItems, {\n firstPage,\n samePage: false,\n filteringText: prevFilteringText.current || '',\n });\n }\n };\n\n const handleRecoveryClick = () =>\n fireNonCancelableEvent(onLoadItems, {\n firstPage: false,\n samePage: true,\n filteringText: prevFilteringText.current || '',\n });\n\n return {\n fireLoadItems,\n handleLoadMore,\n handleRecoveryClick,\n };\n};\n"]}
1
+ {"version":3,"file":"use-load-items.js","sourceRoot":"","sources":["../../../../src/select/utils/use-load-items.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAC;AAW/D,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,EAAE,WAAW,EAAE,OAAO,EAAE,UAAU,EAAqB,EAAE,EAAE;IACtF,MAAM,iBAAiB,GAAG,MAAM,CAAqB,SAAS,CAAC,CAAC;IAEhE,MAAM,aAAa,GAAG,CAAC,aAAqB,EAAE,EAAE;QAC9C,IAAI,iBAAiB,CAAC,OAAO,KAAK,aAAa,EAAE,CAAC;YAChD,OAAO;QACT,CAAC;QACD,iBAAiB,CAAC,OAAO,GAAG,aAAa,CAAC;QAC1C,sBAAsB,CAAC,WAAW,EAAE,EAAE,aAAa,EAAE,SAAS,EAAE,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC,CAAC;IAC3F,CAAC,CAAC;IAEF,MAAM,cAAc,GAAG,GAAG,EAAE;QAC1B,MAAM,SAAS,GAAG,OAAO,CAAC,MAAM,KAAK,CAAC,CAAC;QACvC,IAAI,UAAU,KAAK,SAAS,EAAE,CAAC;YAC7B,sBAAsB,CAAC,WAAW,EAAE;gBAClC,SAAS;gBACT,QAAQ,EAAE,KAAK;gBACf,aAAa,EAAE,iBAAiB,CAAC,OAAO,IAAI,EAAE;aAC/C,CAAC,CAAC;QACL,CAAC;IACH,CAAC,CAAC;IAEF,MAAM,mBAAmB,GAAG,GAAG,EAAE,CAC/B,sBAAsB,CAAC,WAAW,EAAE;QAClC,SAAS,EAAE,KAAK;QAChB,QAAQ,EAAE,IAAI;QACd,aAAa,EAAE,iBAAiB,CAAC,OAAO,IAAI,EAAE;KAC/C,CAAC,CAAC;IAEL,OAAO;QACL,aAAa;QACb,cAAc;QACd,mBAAmB;KACpB,CAAC;AACJ,CAAC,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { useRef } from 'react';\n\nimport { fireNonCancelableEvent } from '../../internal/events';\nimport { DropdownStatusProps } from '../../types/dropdown-status';\nimport { OptionDefinition, OptionGroup } from '../../types/option';\nimport { SelectProps } from '../interfaces';\n\ninterface UseLoadItemsProps {\n onLoadItems: SelectProps['onLoadItems'];\n options: ReadonlyArray<OptionDefinition | OptionGroup>;\n statusType: DropdownStatusProps.StatusType;\n}\n\nexport const useLoadItems = ({ onLoadItems, options, statusType }: UseLoadItemsProps) => {\n const prevFilteringText = useRef<string | undefined>(undefined);\n\n const fireLoadItems = (filteringText: string) => {\n if (prevFilteringText.current === filteringText) {\n return;\n }\n prevFilteringText.current = filteringText;\n fireNonCancelableEvent(onLoadItems, { filteringText, firstPage: true, samePage: false });\n };\n\n const handleLoadMore = () => {\n const firstPage = options.length === 0;\n if (statusType === 'pending') {\n fireNonCancelableEvent(onLoadItems, {\n firstPage,\n samePage: false,\n filteringText: prevFilteringText.current || '',\n });\n }\n };\n\n const handleRecoveryClick = () =>\n fireNonCancelableEvent(onLoadItems, {\n firstPage: false,\n samePage: true,\n filteringText: prevFilteringText.current || '',\n });\n\n return {\n fireLoadItems,\n handleLoadMore,\n handleRecoveryClick,\n };\n};\n"]}
@@ -1,5 +1,6 @@
1
1
  import React from 'react';
2
- import type { DropdownOption, OptionDefinition } from '../../internal/components/option/interfaces';
2
+ import type { DropdownOption } from '../../internal/components/option/interfaces';
3
+ import type { OptionDefinition } from '../../types/option';
3
4
  interface UseNativeSearchProps {
4
5
  isEnabled: boolean;
5
6
  options: ReadonlyArray<DropdownOption>;
@@ -1 +1 @@
1
- {"version":3,"file":"use-native-search.d.ts","sourceRoot":"","sources":["../../../../src/select/utils/use-native-search.ts"],"names":[],"mappings":"AAEA,OAAO,KAAiB,MAAM,OAAO,CAAC;AAEtC,OAAO,KAAK,EAAE,cAAc,EAAE,gBAAgB,EAAe,MAAM,6CAA6C,CAAC;AAWjH,UAAU,oBAAoB;IAC5B,SAAS,EAAE,OAAO,CAAC;IACnB,OAAO,EAAE,aAAa,CAAC,cAAc,CAAC,CAAC;IACvC,eAAe,EAAE,CAAC,MAAM,EAAE,cAAc,KAAK,IAAI,CAAC;IAClD,iBAAiB,EAAE,gBAAgB,GAAG,SAAS,GAAG,IAAI,CAAC;IACvD,oBAAoB,CAAC,EAAE,OAAO,CAAC;CAChC;AA6CD,wBAAgB,eAAe,CAAC,EAC9B,SAAS,EACT,OAAO,EACP,eAAe,EACf,iBAAiB,EACjB,oBAAoB,GACrB,EAAE,oBAAoB,IAKb,OAAO,KAAK,CAAC,aAAa,UAoBnC"}
1
+ {"version":3,"file":"use-native-search.d.ts","sourceRoot":"","sources":["../../../../src/select/utils/use-native-search.ts"],"names":[],"mappings":"AAEA,OAAO,KAAiB,MAAM,OAAO,CAAC;AAEtC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,6CAA6C,CAAC;AAQlF,OAAO,KAAK,EAAE,gBAAgB,EAAe,MAAM,oBAAoB,CAAC;AAIxE,UAAU,oBAAoB;IAC5B,SAAS,EAAE,OAAO,CAAC;IACnB,OAAO,EAAE,aAAa,CAAC,cAAc,CAAC,CAAC;IACvC,eAAe,EAAE,CAAC,MAAM,EAAE,cAAc,KAAK,IAAI,CAAC;IAClD,iBAAiB,EAAE,gBAAgB,GAAG,SAAS,GAAG,IAAI,CAAC;IACvD,oBAAoB,CAAC,EAAE,OAAO,CAAC;CAChC;AA6CD,wBAAgB,eAAe,CAAC,EAC9B,SAAS,EACT,OAAO,EACP,eAAe,EACf,iBAAiB,EACjB,oBAAoB,GACrB,EAAE,oBAAoB,IAKb,OAAO,KAAK,CAAC,aAAa,UAoBnC"}
@@ -1 +1 @@
1
- {"version":3,"file":"use-native-search.js","sourceRoot":"","sources":["../../../../src/select/utils/use-native-search.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAc,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAGtC,OAAO,EACL,aAAa,EACb,OAAO,EACP,kBAAkB,EAClB,aAAa,GACd,MAAM,uDAAuD,CAAC;AAC/D,OAAO,EAAE,mBAAmB,EAAE,MAAM,4CAA4C,CAAC;AAEjF,MAAM,cAAc,GAAG,CAAC,GAAW,EAAE,EAAE,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;AAU/E,SAAS,kBAAkB,CACzB,OAAsC,EACtC,UAAkB,EAClB,gBAAmE,EACnE,oBAA8B;IAE9B,MAAM,kBAAkB,GAAG,oBAAoB,CAAC,CAAC,CAAC,kBAAkB,CAAC,CAAC,CAAC,aAAa,CAAC;IACrF,MAAM,MAAM,GAAG,CAAC,UAAkB,EAAE,EAAE,CACpC,aAAa,CAAC,OAAO,EAAE,UAAU,EAAE,IAAI,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC,kBAAkB,CAAC,MAAM,CAAC,CAAC,CAAC;IACxF,MAAM,eAAe,GAAG,MAAM,CAAC,UAAU,CA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AAM,iBAAiB,GAAG,mBAAmB,CAAC,GAAG,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,GAAG,EAAE,CAAC,EAAE,GAAG,CAAC,CAAC;IAE/E,OAAO,CAAC,KAA0B,EAAE,EAAE;QACpC,IAAI,CAAC,SAAS,EAAE,CAAC;YACf,OAAO;QACT,CAAC;QAED,MAAM,EAAE,GAAG,EAAE,GAAG,KAAK,CAAC;QAEtB,IAAI,CAAC,GAAG,IAAI,GAAG,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YAC7B,OAAO;QACT,CAAC;QAED,iBAAiB,EAAE,CAAC;QACpB,MAAM,QAAQ,GAAG,KAAK,CAAC,OAAO,GAAG,GAAG,CAAC;QACrC,KAAK,CAAC,OAAO,GAAG,QAAQ,CAAC;QAEzB,MAAM,aAAa,GAAG,kBAAkB,CAAC,OAAO,EAAE,QAAQ,EAAE,iBAAiB,EAAE,oBAAoB,CAAC,CAAC;QACrG,IAAI,aAAa,EAAE,CAAC;YAClB,eAAe,CAAC,aAAa,CAAC,CAAC;QACjC,CAAC;IACH,CAAC,CAAC;AACJ,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useRef } from 'react';\n\nimport type { DropdownOption, OptionDefinition, OptionGroup } from '../../internal/components/option/interfaces';\nimport {\n filterOptions,\n isGroup,\n isGroupInteractive,\n isInteractive,\n} from '../../internal/components/option/utils/filter-options';\nimport { useDebounceCallback } from '../../internal/hooks/use-debounce-callback';\n\nconst isRepeatedChar = (str: string) => str.split('').every(c => c === str[0]);\n\ninterface UseNativeSearchProps {\n isEnabled: boolean;\n options: ReadonlyArray<DropdownOption>;\n highlightOption: (option: DropdownOption) => void;\n highlightedOption: OptionDefinition | undefined | null;\n useInteractiveGroups?: boolean;\n}\n\nfunction findMatchingOption(\n options: ReadonlyArray<DropdownOption>,\n searchText: string,\n currentHighlight: OptionDefinition | OptionGroup | undefined | null,\n useInteractiveGroups?: boolean\n) {\n const interactivityCheck = useInteractiveGroups ? isGroupInteractive : isInteractive;\n const filter = (searchText: string) =>\n filterOptions(options, searchText, true).filter(option => interactivityCheck(option));\n const matchingOptions = filter(searchText);\n\n if (matchingOptions.length === 1) {\n return matchingOptions[0];\n }\n\n // Hit the same char over and over, we assume they want to cycle through\n if (currentHighlight && searchText.length > 1 && isRepeatedChar(searchText)) {\n const matchingOptions = filter(searchText[0]);\n\n if (matchingOptions.length > 0) {\n //handling OptionGroups when useInteractiveGroups is set\n let active: number = isGroup(currentHighlight)\n ? matchingOptions.map(({ option }) => option).indexOf(currentHighlight)\n : matchingOptions\n .map(({ option }) => (option as OptionDefinition).value)\n .indexOf((currentHighlight as OptionDefinition).value);\n\n // Pick the next thing (if something with this prefix wasn't selected\n // we'll end up with the first option)\n active += 1;\n active = active % matchingOptions.length;\n return matchingOptions[active];\n }\n }\n\n // We have multiple things that start with this prefix. Based on the\n // behavior of native select, this is considered after the repeated case\n if (matchingOptions.length > 0) {\n return matchingOptions[0];\n }\n return null;\n}\n\nexport function useNativeSearch({\n isEnabled,\n options,\n highlightOption,\n highlightedOption,\n useInteractiveGroups,\n}: UseNativeSearchProps) {\n const value = useRef('');\n\n const delayedResetValue = useDebounceCallback(() => (value.current = ''), 500);\n\n return (event: React.KeyboardEvent) => {\n if (!isEnabled) {\n return;\n }\n\n const { key } = event;\n\n if (!key || key.length !== 1) {\n return;\n }\n\n delayedResetValue();\n const newValue = value.current + key;\n value.current = newValue;\n\n const nextHighlight = findMatchingOption(options, newValue, highlightedOption, useInteractiveGroups);\n if (nextHighlight) {\n highlightOption(nextHighlight);\n }\n };\n}\n"]}
1
+ {"version":3,"file":"use-native-search.js","sourceRoot":"","sources":["../../../../src/select/utils/use-native-search.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAc,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAGtC,OAAO,EACL,aAAa,EACb,OAAO,EACP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E,iBAAiB,EAAE,oBAAoB,CAAC,CAAC;QACrG,IAAI,aAAa,EAAE,CAAC;YAClB,eAAe,CAAC,aAAa,CAAC,CAAC;QACjC,CAAC;IACH,CAAC,CAAC;AACJ,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useRef } from 'react';\n\nimport type { DropdownOption } from '../../internal/components/option/interfaces';\nimport {\n filterOptions,\n isGroup,\n isGroupInteractive,\n isInteractive,\n} from '../../internal/components/option/utils/filter-options';\nimport { useDebounceCallback } from '../../internal/hooks/use-debounce-callback';\nimport type { OptionDefinition, OptionGroup } from '../../types/option';\n\nconst isRepeatedChar = (str: string) => str.split('').every(c => c === str[0]);\n\ninterface UseNativeSearchProps {\n isEnabled: boolean;\n options: ReadonlyArray<DropdownOption>;\n highlightOption: (option: DropdownOption) => void;\n highlightedOption: OptionDefinition | undefined | null;\n useInteractiveGroups?: boolean;\n}\n\nfunction findMatchingOption(\n options: ReadonlyArray<DropdownOption>,\n searchText: string,\n currentHighlight: OptionDefinition | OptionGroup | undefined | null,\n useInteractiveGroups?: boolean\n) {\n const interactivityCheck = useInteractiveGroups ? isGroupInteractive : isInteractive;\n const filter = (searchText: string) =>\n filterOptions(options, searchText, true).filter(option => interactivityCheck(option));\n const matchingOptions = filter(searchText);\n\n if (matchingOptions.length === 1) {\n return matchingOptions[0];\n }\n\n // Hit the same char over and over, we assume they want to cycle through\n if (currentHighlight && searchText.length > 1 && isRepeatedChar(searchText)) {\n const matchingOptions = filter(searchText[0]);\n\n if (matchingOptions.length > 0) {\n //handling OptionGroups when useInteractiveGroups is set\n let active: number = isGroup(currentHighlight)\n ? matchingOptions.map(({ option }) => option).indexOf(currentHighlight)\n : matchingOptions\n .map(({ option }) => (option as OptionDefinition).value)\n .indexOf((currentHighlight as OptionDefinition).value);\n\n // Pick the next thing (if something with this prefix wasn't selected\n // we'll end up with the first option)\n active += 1;\n active = active % matchingOptions.length;\n return matchingOptions[active];\n }\n }\n\n // We have multiple things that start with this prefix. Based on the\n // behavior of native select, this is considered after the repeated case\n if (matchingOptions.length > 0) {\n return matchingOptions[0];\n }\n return null;\n}\n\nexport function useNativeSearch({\n isEnabled,\n options,\n highlightOption,\n highlightedOption,\n useInteractiveGroups,\n}: UseNativeSearchProps) {\n const value = useRef('');\n\n const delayedResetValue = useDebounceCallback(() => (value.current = ''), 500);\n\n return (event: React.KeyboardEvent) => {\n if (!isEnabled) {\n return;\n }\n\n const { key } = event;\n\n if (!key || key.length !== 1) {\n return;\n }\n\n delayedResetValue();\n const newValue = value.current + key;\n value.current = newValue;\n\n const nextHighlight = findMatchingOption(options, newValue, highlightedOption, useInteractiveGroups);\n if (nextHighlight) {\n highlightOption(nextHighlight);\n }\n };\n}\n"]}
@@ -1,10 +1,11 @@
1
1
  import React, { RefObject } from 'react';
2
2
  import { InternalDropdownProps } from '../../dropdown/internal';
3
3
  import { ButtonTriggerProps } from '../../internal/components/button-trigger';
4
- import { DropdownStatusProps } from '../../internal/components/dropdown-status';
5
- import { DropdownOption, OptionDefinition } from '../../internal/components/option/interfaces';
4
+ import { DropdownOption } from '../../internal/components/option/interfaces';
6
5
  import { OptionsListProps } from '../../internal/components/options-list';
7
- import { NonCancelableEventHandler } from '../../internal/events';
6
+ import { DropdownStatusProps } from '../../types/dropdown-status';
7
+ import { NonCancelableEventHandler } from '../../types/events';
8
+ import { OptionDefinition } from '../../types/option';
8
9
  import { FilterProps } from '../parts/filter';
9
10
  import { ItemProps } from '../parts/item';
10
11
  export type MenuProps = Omit<OptionsListProps, 'children'> & {
@@ -1 +1 @@
1
- {"version":3,"file":"use-select.d.ts","sourceRoot":"","sources":["../../../../src/select/utils/use-select.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,EAAE,SAAS,EAAe,MAAM,OAAO,CAAC;AAKtD,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,EAAE,kBAAkB,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