@cloudscape-design/components 3.0.220 → 3.0.222

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 (1000) hide show
  1. package/alert/index.js +4 -4
  2. package/alert/index.js.map +1 -1
  3. package/alert/internal.js +14 -15
  4. package/alert/internal.js.map +1 -1
  5. package/annotation-context/annotation/annotation-icon.js +1 -2
  6. package/annotation-context/annotation/annotation-icon.js.map +1 -1
  7. package/annotation-context/annotation/annotation-popover.js +6 -7
  8. package/annotation-context/annotation/annotation-popover.js.map +1 -1
  9. package/annotation-context/annotation/annotation-trigger.js +4 -6
  10. package/annotation-context/annotation/annotation-trigger.js.map +1 -1
  11. package/annotation-context/annotation/closed-annotation.js +4 -5
  12. package/annotation-context/annotation/closed-annotation.js.map +1 -1
  13. package/annotation-context/annotation/open-annotation.js +2 -3
  14. package/annotation-context/annotation/open-annotation.js.map +1 -1
  15. package/annotation-context/context.js +7 -7
  16. package/annotation-context/context.js.map +1 -1
  17. package/annotation-context/index.js +62 -69
  18. package/annotation-context/index.js.map +1 -1
  19. package/app-layout/content-wrapper/index.js +2 -3
  20. package/app-layout/content-wrapper/index.js.map +1 -1
  21. package/app-layout/defaults.js +13 -14
  22. package/app-layout/defaults.js.map +1 -1
  23. package/app-layout/drawer.js +16 -18
  24. package/app-layout/drawer.js.map +1 -1
  25. package/app-layout/index.js +111 -113
  26. package/app-layout/index.js.map +1 -1
  27. package/app-layout/mobile-toolbar/index.js +7 -9
  28. package/app-layout/mobile-toolbar/index.js.map +1 -1
  29. package/app-layout/navigation-panel.js +5 -8
  30. package/app-layout/navigation-panel.js.map +1 -1
  31. package/app-layout/notifications/index.js +2 -2
  32. package/app-layout/notifications/index.js.map +1 -1
  33. package/app-layout/toggles/index.js +14 -22
  34. package/app-layout/toggles/index.js.map +1 -1
  35. package/app-layout/tools-and-split-panel.js +6 -9
  36. package/app-layout/tools-and-split-panel.js.map +1 -1
  37. package/app-layout/utils/use-content-height.js +14 -15
  38. package/app-layout/utils/use-content-height.js.map +1 -1
  39. package/app-layout/utils/use-content-width.js +8 -8
  40. package/app-layout/utils/use-content-width.js.map +1 -1
  41. package/app-layout/utils/use-focus-control.js +7 -8
  42. package/app-layout/utils/use-focus-control.js.map +1 -1
  43. package/app-layout/utils/use-observed-element.js +3 -3
  44. package/app-layout/utils/use-observed-element.js.map +1 -1
  45. package/app-layout/utils/use-window-width.js +4 -4
  46. package/app-layout/utils/use-window-width.js.map +1 -1
  47. package/app-layout/visual-refresh/app-bar.js +19 -20
  48. package/app-layout/visual-refresh/app-bar.js.map +1 -1
  49. package/app-layout/visual-refresh/background.js +9 -10
  50. package/app-layout/visual-refresh/background.js.map +1 -1
  51. package/app-layout/visual-refresh/context.js +101 -59
  52. package/app-layout/visual-refresh/context.js.map +1 -1
  53. package/app-layout/visual-refresh/header.js +6 -7
  54. package/app-layout/visual-refresh/header.js.map +1 -1
  55. package/app-layout/visual-refresh/index.js +3 -4
  56. package/app-layout/visual-refresh/index.js.map +1 -1
  57. package/app-layout/visual-refresh/layout.js +18 -21
  58. package/app-layout/visual-refresh/layout.js.map +1 -1
  59. package/app-layout/visual-refresh/main.js +17 -18
  60. package/app-layout/visual-refresh/main.js.map +1 -1
  61. package/app-layout/visual-refresh/navigation.js +22 -24
  62. package/app-layout/visual-refresh/navigation.js.map +1 -1
  63. package/app-layout/visual-refresh/notifications.js +6 -7
  64. package/app-layout/visual-refresh/notifications.js.map +1 -1
  65. package/app-layout/visual-refresh/split-panel.js +36 -43
  66. package/app-layout/visual-refresh/split-panel.js.map +1 -1
  67. package/app-layout/visual-refresh/tools.js +32 -34
  68. package/app-layout/visual-refresh/tools.js.map +1 -1
  69. package/app-layout/visual-refresh/trigger-button.js +5 -8
  70. package/app-layout/visual-refresh/trigger-button.js.map +1 -1
  71. package/area-chart/chart-container.js +18 -19
  72. package/area-chart/chart-container.js.map +1 -1
  73. package/area-chart/elements/area-chart-filter.js +7 -8
  74. package/area-chart/elements/area-chart-filter.js.map +1 -1
  75. package/area-chart/elements/area-chart-legend.js +6 -9
  76. package/area-chart/elements/area-chart-legend.js.map +1 -1
  77. package/area-chart/elements/area-series.js +12 -13
  78. package/area-chart/elements/area-series.js.map +1 -1
  79. package/area-chart/elements/chart-popover.js +4 -6
  80. package/area-chart/elements/chart-popover.js.map +1 -1
  81. package/area-chart/elements/data-series.js +14 -17
  82. package/area-chart/elements/data-series.js.map +1 -1
  83. package/area-chart/elements/highlighted-point.js +6 -7
  84. package/area-chart/elements/highlighted-point.js.map +1 -1
  85. package/area-chart/elements/threshold-series.js +5 -7
  86. package/area-chart/elements/threshold-series.js.map +1 -1
  87. package/area-chart/elements/use-highlight-details.js +28 -30
  88. package/area-chart/elements/use-highlight-details.js.map +1 -1
  89. package/area-chart/elements/vertical-marker.js +6 -7
  90. package/area-chart/elements/vertical-marker.js.map +1 -1
  91. package/area-chart/index.js +4 -4
  92. package/area-chart/index.js.map +1 -1
  93. package/area-chart/internal.js +40 -41
  94. package/area-chart/internal.js.map +1 -1
  95. package/area-chart/model/async-store.js +23 -30
  96. package/area-chart/model/async-store.js.map +1 -1
  97. package/area-chart/model/compute-chart-props.js +11 -12
  98. package/area-chart/model/compute-chart-props.js.map +1 -1
  99. package/area-chart/model/create-series-decorator.js +11 -13
  100. package/area-chart/model/create-series-decorator.js.map +1 -1
  101. package/area-chart/model/interactions-store.js +47 -54
  102. package/area-chart/model/interactions-store.js.map +1 -1
  103. package/area-chart/model/use-chart-model.js +85 -89
  104. package/area-chart/model/use-chart-model.js.map +1 -1
  105. package/area-chart/model/use-filter-props.js +6 -6
  106. package/area-chart/model/use-filter-props.js.map +1 -1
  107. package/area-chart/model/use-highlight-props.js +6 -6
  108. package/area-chart/model/use-highlight-props.js.map +1 -1
  109. package/area-chart/model/utils.js +46 -59
  110. package/area-chart/model/utils.js.map +1 -1
  111. package/attribute-editor/additional-info.js +2 -5
  112. package/attribute-editor/additional-info.js.map +1 -1
  113. package/attribute-editor/index.js +5 -5
  114. package/attribute-editor/index.js.map +1 -1
  115. package/attribute-editor/internal.js +20 -20
  116. package/attribute-editor/internal.js.map +1 -1
  117. package/attribute-editor/row.js +17 -25
  118. package/attribute-editor/row.js.map +1 -1
  119. package/autosuggest/autosuggest-option.js +12 -12
  120. package/autosuggest/autosuggest-option.js.map +1 -1
  121. package/autosuggest/index.js +6 -6
  122. package/autosuggest/index.js.map +1 -1
  123. package/autosuggest/internal.js +39 -39
  124. package/autosuggest/internal.js.map +1 -1
  125. package/autosuggest/load-more-controller.js +10 -14
  126. package/autosuggest/load-more-controller.js.map +1 -1
  127. package/autosuggest/options-controller.js +31 -32
  128. package/autosuggest/options-controller.js.map +1 -1
  129. package/autosuggest/options-list.js +12 -13
  130. package/autosuggest/options-list.js.map +1 -1
  131. package/autosuggest/plain-list.js +15 -17
  132. package/autosuggest/plain-list.js.map +1 -1
  133. package/autosuggest/utils/utils.js +12 -12
  134. package/autosuggest/utils/utils.js.map +1 -1
  135. package/autosuggest/virtual-list.js +14 -16
  136. package/autosuggest/virtual-list.js.map +1 -1
  137. package/badge/index.js +6 -6
  138. package/badge/index.js.map +1 -1
  139. package/bar-chart/index.js +6 -6
  140. package/bar-chart/index.js.map +1 -1
  141. package/box/index.js +4 -4
  142. package/box/index.js.map +1 -1
  143. package/box/internal.js +12 -12
  144. package/box/internal.js.map +1 -1
  145. package/breadcrumb-group/index.js +4 -4
  146. package/breadcrumb-group/index.js.map +1 -1
  147. package/breadcrumb-group/internal.js +24 -25
  148. package/breadcrumb-group/internal.js.map +1 -1
  149. package/breadcrumb-group/item/item.js +32 -34
  150. package/breadcrumb-group/item/item.js.map +1 -1
  151. package/button/icon-helper.js +6 -6
  152. package/button/icon-helper.js.map +1 -1
  153. package/button/index.js +6 -6
  154. package/button/index.js.map +1 -1
  155. package/button/internal.js +32 -33
  156. package/button/internal.js.map +1 -1
  157. package/button-dropdown/category-elements/category-element.js +3 -5
  158. package/button-dropdown/category-elements/category-element.js.map +1 -1
  159. package/button-dropdown/category-elements/expandable-category-element.js +23 -26
  160. package/button-dropdown/category-elements/expandable-category-element.js.map +1 -1
  161. package/button-dropdown/category-elements/mobile-expandable-category-element.js +27 -30
  162. package/button-dropdown/category-elements/mobile-expandable-category-element.js.map +1 -1
  163. package/button-dropdown/index.js +6 -6
  164. package/button-dropdown/index.js.map +1 -1
  165. package/button-dropdown/internal.js +28 -29
  166. package/button-dropdown/internal.js.map +1 -1
  167. package/button-dropdown/item-element/index.js +30 -36
  168. package/button-dropdown/item-element/index.js.map +1 -1
  169. package/button-dropdown/items-list.js +3 -4
  170. package/button-dropdown/items-list.js.map +1 -1
  171. package/button-dropdown/mobile-expandable-group/mobile-expandable-group.js +2 -4
  172. package/button-dropdown/mobile-expandable-group/mobile-expandable-group.js.map +1 -1
  173. package/button-dropdown/tooltip.js +22 -24
  174. package/button-dropdown/tooltip.js.map +1 -1
  175. package/button-dropdown/utils/create-items-tree.js +21 -23
  176. package/button-dropdown/utils/create-items-tree.js.map +1 -1
  177. package/button-dropdown/utils/menu-item.js +6 -9
  178. package/button-dropdown/utils/menu-item.js.map +1 -1
  179. package/button-dropdown/utils/move-highlight.js +3 -4
  180. package/button-dropdown/utils/move-highlight.js.map +1 -1
  181. package/button-dropdown/utils/use-button-dropdown.js +31 -33
  182. package/button-dropdown/utils/use-button-dropdown.js.map +1 -1
  183. package/button-dropdown/utils/use-hidden-description.js +3 -3
  184. package/button-dropdown/utils/use-hidden-description.js.map +1 -1
  185. package/button-dropdown/utils/use-highlighted-menu.js +40 -42
  186. package/button-dropdown/utils/use-highlighted-menu.js.map +1 -1
  187. package/button-dropdown/utils/utils.js +5 -9
  188. package/button-dropdown/utils/utils.js.map +1 -1
  189. package/calendar/grid/index.js +25 -28
  190. package/calendar/grid/index.js.map +1 -1
  191. package/calendar/header/header-button.js +4 -6
  192. package/calendar/header/header-button.js.map +1 -1
  193. package/calendar/header/index.js +1 -2
  194. package/calendar/header/index.js.map +1 -1
  195. package/calendar/index.js +4 -4
  196. package/calendar/index.js.map +1 -1
  197. package/calendar/internal.js +27 -27
  198. package/calendar/internal.js.map +1 -1
  199. package/calendar/utils/intl.js +12 -13
  200. package/calendar/utils/intl.js.map +1 -1
  201. package/calendar/utils/navigation.js +3 -3
  202. package/calendar/utils/navigation.js.map +1 -1
  203. package/cards/cards-layout-helper.js +12 -12
  204. package/cards/cards-layout-helper.js.map +1 -1
  205. package/cards/index.js +53 -63
  206. package/cards/index.js.map +1 -1
  207. package/checkbox/index.js +4 -4
  208. package/checkbox/index.js.map +1 -1
  209. package/checkbox/internal.d.ts +1 -0
  210. package/checkbox/internal.d.ts.map +1 -1
  211. package/checkbox/internal.js +9 -9
  212. package/checkbox/internal.js.map +1 -1
  213. package/code-editor/ace-modes.js +1 -1
  214. package/code-editor/ace-modes.js.map +1 -1
  215. package/code-editor/ace-themes.js +2 -2
  216. package/code-editor/ace-themes.js.map +1 -1
  217. package/code-editor/error-screen.js +3 -4
  218. package/code-editor/error-screen.js.map +1 -1
  219. package/code-editor/index.js +61 -65
  220. package/code-editor/index.js.map +1 -1
  221. package/code-editor/listeners.js +5 -5
  222. package/code-editor/listeners.js.map +1 -1
  223. package/code-editor/loading-screen.js +2 -2
  224. package/code-editor/loading-screen.js.map +1 -1
  225. package/code-editor/pane.js +21 -25
  226. package/code-editor/pane.js.map +1 -1
  227. package/code-editor/preferences-modal.js +12 -13
  228. package/code-editor/preferences-modal.js.map +1 -1
  229. package/code-editor/resizable-box/index.js +14 -15
  230. package/code-editor/resizable-box/index.js.map +1 -1
  231. package/code-editor/setup-editor.js +20 -20
  232. package/code-editor/setup-editor.js.map +1 -1
  233. package/code-editor/status-bar.js +19 -22
  234. package/code-editor/status-bar.js.map +1 -1
  235. package/code-editor/tab-button.js +7 -10
  236. package/code-editor/tab-button.js.map +1 -1
  237. package/code-editor/util.js +6 -6
  238. package/code-editor/util.js.map +1 -1
  239. package/collection-preferences/index.js +21 -23
  240. package/collection-preferences/index.js.map +1 -1
  241. package/collection-preferences/utils.js +25 -57
  242. package/collection-preferences/utils.js.map +1 -1
  243. package/collection-preferences/visible-content.js +23 -27
  244. package/collection-preferences/visible-content.js.map +1 -1
  245. package/column-layout/index.js +6 -6
  246. package/column-layout/index.js.map +1 -1
  247. package/column-layout/internal.js +20 -21
  248. package/column-layout/internal.js.map +1 -1
  249. package/column-layout/util.js +2 -2
  250. package/column-layout/util.js.map +1 -1
  251. package/container/index.js +5 -5
  252. package/container/index.js.map +1 -1
  253. package/container/internal.js +30 -31
  254. package/container/internal.js.map +1 -1
  255. package/container/use-sticky-header.js +25 -25
  256. package/container/use-sticky-header.js.map +1 -1
  257. package/content-layout/index.js +2 -3
  258. package/content-layout/index.js.map +1 -1
  259. package/content-layout/internal.js +15 -16
  260. package/content-layout/internal.js.map +1 -1
  261. package/date-input/index.js +3 -4
  262. package/date-input/index.js.map +1 -1
  263. package/date-input/internal.js +8 -8
  264. package/date-input/internal.js.map +1 -1
  265. package/date-picker/index.js +28 -28
  266. package/date-picker/index.js.map +1 -1
  267. package/date-range-picker/calendar/grids/grid.js +54 -57
  268. package/date-range-picker/calendar/grids/grid.js.map +1 -1
  269. package/date-range-picker/calendar/grids/index.js +27 -28
  270. package/date-range-picker/calendar/grids/index.js.map +1 -1
  271. package/date-range-picker/calendar/header/header-button.js +4 -6
  272. package/date-range-picker/calendar/header/header-button.js.map +1 -1
  273. package/date-range-picker/calendar/header/index.js +6 -7
  274. package/date-range-picker/calendar/header/index.js.map +1 -1
  275. package/date-range-picker/calendar/index.js +40 -45
  276. package/date-range-picker/calendar/index.js.map +1 -1
  277. package/date-range-picker/calendar/range-inputs.js +5 -6
  278. package/date-range-picker/calendar/range-inputs.js.map +1 -1
  279. package/date-range-picker/calendar/utils.js +2 -2
  280. package/date-range-picker/calendar/utils.js.map +1 -1
  281. package/date-range-picker/dropdown.js +29 -34
  282. package/date-range-picker/dropdown.js.map +1 -1
  283. package/date-range-picker/index.js +40 -43
  284. package/date-range-picker/index.js.map +1 -1
  285. package/date-range-picker/mode-switcher.js +2 -3
  286. package/date-range-picker/mode-switcher.js.map +1 -1
  287. package/date-range-picker/relative-range/index.js +36 -40
  288. package/date-range-picker/relative-range/index.js.map +1 -1
  289. package/date-range-picker/time-offset.js +5 -5
  290. package/date-range-picker/time-offset.js.map +1 -1
  291. package/date-range-picker/utils.js +4 -5
  292. package/date-range-picker/utils.js.map +1 -1
  293. package/expandable-section/expandable-section-container.js +5 -5
  294. package/expandable-section/expandable-section-container.js.map +1 -1
  295. package/expandable-section/expandable-section-header.js +18 -23
  296. package/expandable-section/expandable-section-header.js.map +1 -1
  297. package/expandable-section/index.js +4 -4
  298. package/expandable-section/index.js.map +1 -1
  299. package/expandable-section/internal.js +22 -22
  300. package/expandable-section/internal.js.map +1 -1
  301. package/flashbar/collapsible-flashbar.js +103 -118
  302. package/flashbar/collapsible-flashbar.js.map +1 -1
  303. package/flashbar/common.js +26 -35
  304. package/flashbar/common.js.map +1 -1
  305. package/flashbar/constant.js +1 -1
  306. package/flashbar/constant.js.map +1 -1
  307. package/flashbar/flash.js +23 -26
  308. package/flashbar/flash.js.map +1 -1
  309. package/flashbar/index.js +3 -4
  310. package/flashbar/index.js.map +1 -1
  311. package/flashbar/internal/analytics.js +12 -12
  312. package/flashbar/internal/analytics.js.map +1 -1
  313. package/flashbar/non-collapsible-flashbar.js +10 -10
  314. package/flashbar/non-collapsible-flashbar.js.map +1 -1
  315. package/flashbar/utils.js +25 -27
  316. package/flashbar/utils.js.map +1 -1
  317. package/form/index.js +4 -4
  318. package/form/index.js.map +1 -1
  319. package/form/internal.js +5 -6
  320. package/form/internal.js.map +1 -1
  321. package/form-field/index.js +4 -4
  322. package/form-field/index.js.map +1 -1
  323. package/form-field/internal.js +20 -23
  324. package/form-field/internal.js.map +1 -1
  325. package/form-field/util.js +9 -10
  326. package/form-field/util.js.map +1 -1
  327. package/grid/index.js +6 -6
  328. package/grid/index.js.map +1 -1
  329. package/grid/internal.js +14 -15
  330. package/grid/internal.js.map +1 -1
  331. package/header/index.js +4 -4
  332. package/header/index.js.map +1 -1
  333. package/header/internal.js +15 -15
  334. package/header/internal.js.map +1 -1
  335. package/help-panel/index.js +7 -7
  336. package/help-panel/index.js.map +1 -1
  337. package/hotspot/index.js +12 -12
  338. package/hotspot/index.js.map +1 -1
  339. package/icon/icons.js +1 -1
  340. package/icon/index.js +4 -4
  341. package/icon/index.js.map +1 -1
  342. package/icon/internal.js +18 -18
  343. package/icon/internal.js.map +1 -1
  344. package/input/index.js +36 -17
  345. package/input/index.js.map +1 -1
  346. package/input/internal.js +30 -25
  347. package/input/internal.js.map +1 -1
  348. package/input/utils.js +4 -5
  349. package/input/utils.js.map +1 -1
  350. package/internal/animate.js +27 -32
  351. package/internal/animate.js.map +1 -1
  352. package/internal/base-component/index.js +2 -2
  353. package/internal/base-component/index.js.map +1 -1
  354. package/internal/breakpoints.js +7 -12
  355. package/internal/breakpoints.js.map +1 -1
  356. package/internal/components/abstract-switch/index.d.ts +2 -1
  357. package/internal/components/abstract-switch/index.d.ts.map +1 -1
  358. package/internal/components/abstract-switch/index.js +19 -19
  359. package/internal/components/abstract-switch/index.js.map +1 -1
  360. package/internal/components/abstract-switch/styles.css.js +13 -12
  361. package/internal/components/abstract-switch/styles.scoped.css +21 -21
  362. package/internal/components/abstract-switch/styles.selectors.js +13 -12
  363. package/internal/components/autosuggest-input/index.js +38 -38
  364. package/internal/components/autosuggest-input/index.js.map +1 -1
  365. package/internal/components/button-trigger/index.js +7 -7
  366. package/internal/components/button-trigger/index.js.map +1 -1
  367. package/internal/components/cartesian-chart/axis-label.js +1 -2
  368. package/internal/components/cartesian-chart/axis-label.js.map +1 -1
  369. package/internal/components/cartesian-chart/bottom-labels.js +20 -26
  370. package/internal/components/cartesian-chart/bottom-labels.js.map +1 -1
  371. package/internal/components/cartesian-chart/constants.js +5 -5
  372. package/internal/components/cartesian-chart/constants.js.map +1 -1
  373. package/internal/components/cartesian-chart/emphasized-baseline.js +4 -5
  374. package/internal/components/cartesian-chart/emphasized-baseline.js.map +1 -1
  375. package/internal/components/cartesian-chart/highlighted-point.js +1 -2
  376. package/internal/components/cartesian-chart/highlighted-point.js.map +1 -1
  377. package/internal/components/cartesian-chart/label-utils.js +20 -24
  378. package/internal/components/cartesian-chart/label-utils.js.map +1 -1
  379. package/internal/components/cartesian-chart/labels-measure.js +6 -7
  380. package/internal/components/cartesian-chart/labels-measure.js.map +1 -1
  381. package/internal/components/cartesian-chart/left-labels.js +13 -17
  382. package/internal/components/cartesian-chart/left-labels.js.map +1 -1
  383. package/internal/components/cartesian-chart/scales.js +21 -26
  384. package/internal/components/cartesian-chart/scales.js.map +1 -1
  385. package/internal/components/cartesian-chart/ticks.js +9 -10
  386. package/internal/components/cartesian-chart/ticks.js.map +1 -1
  387. package/internal/components/cartesian-chart/vertical-grid-lines.js +3 -4
  388. package/internal/components/cartesian-chart/vertical-grid-lines.js.map +1 -1
  389. package/internal/components/cartesian-chart/vertical-marker.js +3 -4
  390. package/internal/components/cartesian-chart/vertical-marker.js.map +1 -1
  391. package/internal/components/chart-filter/index.js +13 -14
  392. package/internal/components/chart-filter/index.js.map +1 -1
  393. package/internal/components/chart-legend/index.js +26 -29
  394. package/internal/components/chart-legend/index.js.map +1 -1
  395. package/internal/components/chart-plot/application-controller.js +21 -25
  396. package/internal/components/chart-plot/application-controller.js.map +1 -1
  397. package/internal/components/chart-plot/focus-outline.js +7 -8
  398. package/internal/components/chart-plot/focus-outline.js.map +1 -1
  399. package/internal/components/chart-plot/index.js +33 -34
  400. package/internal/components/chart-plot/index.js.map +1 -1
  401. package/internal/components/chart-popover/index.js +11 -12
  402. package/internal/components/chart-popover/index.js.map +1 -1
  403. package/internal/components/chart-series-details/index.js +13 -17
  404. package/internal/components/chart-series-details/index.js.map +1 -1
  405. package/internal/components/chart-series-marker/index.js +2 -3
  406. package/internal/components/chart-series-marker/index.js.map +1 -1
  407. package/internal/components/chart-status-container/index.js +8 -10
  408. package/internal/components/chart-status-container/index.js.map +1 -1
  409. package/internal/components/checkbox-icon/index.js +18 -19
  410. package/internal/components/checkbox-icon/index.js.map +1 -1
  411. package/internal/components/dark-ribbon/index.js +13 -14
  412. package/internal/components/dark-ribbon/index.js.map +1 -1
  413. package/internal/components/dropdown/context.js +4 -5
  414. package/internal/components/dropdown/context.js.map +1 -1
  415. package/internal/components/dropdown/dropdown-fit-handler.js +74 -81
  416. package/internal/components/dropdown/dropdown-fit-handler.js.map +1 -1
  417. package/internal/components/dropdown/index.js +57 -65
  418. package/internal/components/dropdown/index.js.map +1 -1
  419. package/internal/components/dropdown-footer/index.js +2 -6
  420. package/internal/components/dropdown-footer/index.js.map +1 -1
  421. package/internal/components/dropdown-status/index.js +5 -7
  422. package/internal/components/dropdown-status/index.js.map +1 -1
  423. package/internal/components/filtering-token/index.js +4 -6
  424. package/internal/components/filtering-token/index.js.map +1 -1
  425. package/internal/components/focus-lock/index.js +10 -11
  426. package/internal/components/focus-lock/index.js.map +1 -1
  427. package/internal/components/focus-lock/utils.js +4 -4
  428. package/internal/components/focus-lock/utils.js.map +1 -1
  429. package/internal/components/live-region/index.js +10 -10
  430. package/internal/components/live-region/index.js.map +1 -1
  431. package/internal/components/masked-input/index.js +22 -24
  432. package/internal/components/masked-input/index.js.map +1 -1
  433. package/internal/components/masked-input/keyboard-handler.js +18 -18
  434. package/internal/components/masked-input/keyboard-handler.js.map +1 -1
  435. package/internal/components/masked-input/use-mask.js +24 -28
  436. package/internal/components/masked-input/use-mask.js.map +1 -1
  437. package/internal/components/masked-input/utils/keys.js +4 -6
  438. package/internal/components/masked-input/utils/keys.js.map +1 -1
  439. package/internal/components/masked-input/utils/mask-format.js +103 -113
  440. package/internal/components/masked-input/utils/mask-format.js.map +1 -1
  441. package/internal/components/masked-input/utils/strings.js +1 -4
  442. package/internal/components/masked-input/utils/strings.js.map +1 -1
  443. package/internal/components/menu-dropdown/index.js +10 -12
  444. package/internal/components/menu-dropdown/index.js.map +1 -1
  445. package/internal/components/option/highlight-match.js +14 -18
  446. package/internal/components/option/highlight-match.js.map +1 -1
  447. package/internal/components/option/index.js +13 -13
  448. package/internal/components/option/index.js.map +1 -1
  449. package/internal/components/option/option-announcer.js +1 -1
  450. package/internal/components/option/option-announcer.js.map +1 -1
  451. package/internal/components/option/option-parts.js +28 -45
  452. package/internal/components/option/option-parts.js.map +1 -1
  453. package/internal/components/option/utils/filter-options.js +16 -19
  454. package/internal/components/option/utils/filter-options.js.map +1 -1
  455. package/internal/components/option/utils/flatten-options.js +15 -15
  456. package/internal/components/option/utils/flatten-options.js.map +1 -1
  457. package/internal/components/option/utils/prepare-options.js +3 -3
  458. package/internal/components/option/utils/prepare-options.js.map +1 -1
  459. package/internal/components/options-list/index.js +19 -20
  460. package/internal/components/options-list/index.js.map +1 -1
  461. package/internal/components/options-list/utils/test-indexes.js +11 -11
  462. package/internal/components/options-list/utils/test-indexes.js.map +1 -1
  463. package/internal/components/options-list/utils/use-highlight-option.js +17 -21
  464. package/internal/components/options-list/utils/use-highlight-option.js.map +1 -1
  465. package/internal/components/options-list/utils/use-ids.js +2 -2
  466. package/internal/components/options-list/utils/use-ids.js.map +1 -1
  467. package/internal/components/options-list/utils/use-keyboard.js +6 -8
  468. package/internal/components/options-list/utils/use-keyboard.js.map +1 -1
  469. package/internal/components/options-list/utils/use-open-state.js +6 -7
  470. package/internal/components/options-list/utils/use-open-state.js.map +1 -1
  471. package/internal/components/portal/index.js +5 -6
  472. package/internal/components/portal/index.js.map +1 -1
  473. package/internal/components/screenreader-only/index.js +1 -2
  474. package/internal/components/screenreader-only/index.js.map +1 -1
  475. package/internal/components/selectable-item/index.js +25 -26
  476. package/internal/components/selectable-item/index.js.map +1 -1
  477. package/internal/components/tab-trap/index.js +1 -2
  478. package/internal/components/tab-trap/index.js.map +1 -1
  479. package/internal/components/transition/index.js +16 -16
  480. package/internal/components/transition/index.js.map +1 -1
  481. package/internal/components/visual-context/index.js +6 -7
  482. package/internal/components/visual-context/index.js.map +1 -1
  483. package/internal/context/app-layout-context.js +2 -2
  484. package/internal/context/app-layout-context.js.map +1 -1
  485. package/internal/context/form-field-context.js +4 -4
  486. package/internal/context/form-field-context.js.map +1 -1
  487. package/internal/context/split-panel-context.js +3 -3
  488. package/internal/context/split-panel-context.js.map +1 -1
  489. package/internal/debounce.js +6 -11
  490. package/internal/debounce.js.map +1 -1
  491. package/internal/environment.js +1 -1
  492. package/internal/events/index.js +12 -16
  493. package/internal/events/index.js.map +1 -1
  494. package/internal/focus-tracker.js +22 -27
  495. package/internal/focus-tracker.js.map +1 -1
  496. package/internal/generated/custom-css-properties/index.js +2 -2
  497. package/internal/generated/custom-css-properties/index.js.map +1 -1
  498. package/internal/hooks/check-controlled/index.js +1 -1
  499. package/internal/hooks/check-controlled/index.js.map +1 -1
  500. package/internal/hooks/container-queries/use-container-breakpoints.js +2 -2
  501. package/internal/hooks/container-queries/use-container-breakpoints.js.map +1 -1
  502. package/internal/hooks/container-queries/use-container-query.js +5 -6
  503. package/internal/hooks/container-queries/use-container-query.js.map +1 -1
  504. package/internal/hooks/container-queries/use-resize-observer.js +13 -13
  505. package/internal/hooks/container-queries/use-resize-observer.js.map +1 -1
  506. package/internal/hooks/focus-visible/index.js +8 -8
  507. package/internal/hooks/focus-visible/index.js.map +1 -1
  508. package/internal/hooks/forward-focus/index.js +5 -9
  509. package/internal/hooks/forward-focus/index.js.map +1 -1
  510. package/internal/hooks/forward-focus/radio-group.js +7 -7
  511. package/internal/hooks/forward-focus/radio-group.js.map +1 -1
  512. package/internal/hooks/use-base-component/component-metadata.js +5 -5
  513. package/internal/hooks/use-base-component/component-metadata.js.map +1 -1
  514. package/internal/hooks/use-base-component/index.js +1 -1
  515. package/internal/hooks/use-base-component/index.js.map +1 -1
  516. package/internal/hooks/use-controllable/index.js +16 -17
  517. package/internal/hooks/use-controllable/index.js.map +1 -1
  518. package/internal/hooks/use-date-cache/index.js +2 -2
  519. package/internal/hooks/use-date-cache/index.js.map +1 -1
  520. package/internal/hooks/use-debounce-callback/index.js +3 -7
  521. package/internal/hooks/use-debounce-callback/index.js.map +1 -1
  522. package/internal/hooks/use-dynamic-overlap/index.js +4 -4
  523. package/internal/hooks/use-dynamic-overlap/index.js.map +1 -1
  524. package/internal/hooks/use-effect-on-update.js +2 -2
  525. package/internal/hooks/use-effect-on-update.js.map +1 -1
  526. package/internal/hooks/use-focus-tracker.js +7 -8
  527. package/internal/hooks/use-focus-tracker.js.map +1 -1
  528. package/internal/hooks/use-has-rendered/index.js +6 -6
  529. package/internal/hooks/use-has-rendered/index.js.map +1 -1
  530. package/internal/hooks/use-merge-refs/index.js +5 -9
  531. package/internal/hooks/use-merge-refs/index.js.map +1 -1
  532. package/internal/hooks/use-mobile/index.js +7 -7
  533. package/internal/hooks/use-mobile/index.js.map +1 -1
  534. package/internal/hooks/use-mouse-down-target.js +5 -5
  535. package/internal/hooks/use-mouse-down-target.js.map +1 -1
  536. package/internal/hooks/use-mutation-observer/index.js +5 -5
  537. package/internal/hooks/use-mutation-observer/index.js.map +1 -1
  538. package/internal/hooks/use-portal-mode-classes/index.js +10 -12
  539. package/internal/hooks/use-portal-mode-classes/index.js.map +1 -1
  540. package/internal/hooks/use-previous/index.js +3 -3
  541. package/internal/hooks/use-previous/index.js.map +1 -1
  542. package/internal/hooks/use-scroll-sync/index.js +8 -9
  543. package/internal/hooks/use-scroll-sync/index.js.map +1 -1
  544. package/internal/hooks/use-singleton-handler/index.js +12 -14
  545. package/internal/hooks/use-singleton-handler/index.js.map +1 -1
  546. package/internal/hooks/use-stable-event-handler/index.js +3 -10
  547. package/internal/hooks/use-stable-event-handler/index.js.map +1 -1
  548. package/internal/hooks/use-telemetry/index.js +2 -2
  549. package/internal/hooks/use-telemetry/index.js.map +1 -1
  550. package/internal/hooks/use-telemetry/telemetry.js +3 -4
  551. package/internal/hooks/use-telemetry/telemetry.js.map +1 -1
  552. package/internal/hooks/use-unique-id/index.js +3 -3
  553. package/internal/hooks/use-unique-id/index.js.map +1 -1
  554. package/internal/hooks/use-visual-mode/index.js +11 -11
  555. package/internal/hooks/use-visual-mode/index.js.map +1 -1
  556. package/internal/is-development.js +1 -1
  557. package/internal/is-development.js.map +1 -1
  558. package/internal/logging.js +2 -2
  559. package/internal/logging.js.map +1 -1
  560. package/internal/manifest.json +1 -1
  561. package/internal/metrics/log-clients.js +18 -27
  562. package/internal/metrics/log-clients.js.map +1 -1
  563. package/internal/metrics/metrics-formatters.js +11 -14
  564. package/internal/metrics/metrics-formatters.js.map +1 -1
  565. package/internal/metrics/metrics.js +27 -33
  566. package/internal/metrics/metrics.js.map +1 -1
  567. package/internal/motion.js +2 -2
  568. package/internal/motion.js.map +1 -1
  569. package/internal/styles/colors.js +1 -1
  570. package/internal/styles/colors.js.map +1 -1
  571. package/internal/utils/browser-scrollbar-size.js +5 -5
  572. package/internal/utils/browser-scrollbar-size.js.map +1 -1
  573. package/internal/utils/calculate-once.js +2 -2
  574. package/internal/utils/calculate-once.js.map +1 -1
  575. package/internal/utils/check-safe-url.js +4 -4
  576. package/internal/utils/check-safe-url.js.map +1 -1
  577. package/internal/utils/create-category-color-scale.js +6 -9
  578. package/internal/utils/create-category-color-scale.js.map +1 -1
  579. package/internal/utils/date-time/format-date-range.js +3 -3
  580. package/internal/utils/date-time/format-date-range.js.map +1 -1
  581. package/internal/utils/date-time/format-date.js +4 -4
  582. package/internal/utils/date-time/format-date.js.map +1 -1
  583. package/internal/utils/date-time/format-time.js +5 -5
  584. package/internal/utils/date-time/format-time.js.map +1 -1
  585. package/internal/utils/date-time/format-timezone-offset.js +4 -4
  586. package/internal/utils/date-time/format-timezone-offset.js.map +1 -1
  587. package/internal/utils/date-time/is-iso-date-only.js +1 -1
  588. package/internal/utils/date-time/is-iso-date-only.js.map +1 -1
  589. package/internal/utils/date-time/join-date-time.js +3 -3
  590. package/internal/utils/date-time/join-date-time.js.map +1 -1
  591. package/internal/utils/date-time/parse-date.js +5 -6
  592. package/internal/utils/date-time/parse-date.js.map +1 -1
  593. package/internal/utils/date-time/parse-timezone-offset.js +5 -5
  594. package/internal/utils/date-time/parse-timezone-offset.js.map +1 -1
  595. package/internal/utils/date-time/shift-timezone-offset.js +6 -6
  596. package/internal/utils/date-time/shift-timezone-offset.js.map +1 -1
  597. package/internal/utils/dom.js +12 -12
  598. package/internal/utils/dom.js.map +1 -1
  599. package/internal/utils/external-props.js +3 -3
  600. package/internal/utils/external-props.js.map +1 -1
  601. package/internal/utils/focus-svg-element.js +1 -1
  602. package/internal/utils/focus-svg-element.js.map +1 -1
  603. package/internal/utils/locale/merge-locales.js +1 -1
  604. package/internal/utils/locale/merge-locales.js.map +1 -1
  605. package/internal/utils/locale/normalize-locale.js +3 -3
  606. package/internal/utils/locale/normalize-locale.js.map +1 -1
  607. package/internal/utils/promises.js +7 -11
  608. package/internal/utils/promises.js.map +1 -1
  609. package/internal/utils/scrollable-containers.js +14 -18
  610. package/internal/utils/scrollable-containers.js.map +1 -1
  611. package/internal/utils/strings/join-strings.js +1 -5
  612. package/internal/utils/strings/join-strings.js.map +1 -1
  613. package/internal/utils/strings/pad-left-zeros.js +1 -1
  614. package/internal/utils/strings/pad-left-zeros.js.map +1 -1
  615. package/internal/utils/throttle.js +10 -15
  616. package/internal/utils/throttle.js.map +1 -1
  617. package/internal/utils/use-container-width.js +3 -5
  618. package/internal/utils/use-container-width.js.map +1 -1
  619. package/line-chart/index.js +6 -6
  620. package/line-chart/index.js.map +1 -1
  621. package/link/index.js +5 -5
  622. package/link/index.js.map +1 -1
  623. package/link/internal.js +25 -25
  624. package/link/internal.js.map +1 -1
  625. package/mixed-line-bar-chart/bar-groups.js +3 -4
  626. package/mixed-line-bar-chart/bar-groups.js.map +1 -1
  627. package/mixed-line-bar-chart/bar-series.js +24 -33
  628. package/mixed-line-bar-chart/bar-series.js.map +1 -1
  629. package/mixed-line-bar-chart/chart-container.js +123 -138
  630. package/mixed-line-bar-chart/chart-container.js.map +1 -1
  631. package/mixed-line-bar-chart/chart-filters.js +10 -17
  632. package/mixed-line-bar-chart/chart-filters.js.map +1 -1
  633. package/mixed-line-bar-chart/chart-legend.js +9 -13
  634. package/mixed-line-bar-chart/chart-legend.js.map +1 -1
  635. package/mixed-line-bar-chart/chart-popover.js +3 -4
  636. package/mixed-line-bar-chart/chart-popover.js.map +1 -1
  637. package/mixed-line-bar-chart/data-series.js +13 -17
  638. package/mixed-line-bar-chart/data-series.js.map +1 -1
  639. package/mixed-line-bar-chart/domain.js +32 -39
  640. package/mixed-line-bar-chart/domain.js.map +1 -1
  641. package/mixed-line-bar-chart/format-highlighted.js +13 -14
  642. package/mixed-line-bar-chart/format-highlighted.js.map +1 -1
  643. package/mixed-line-bar-chart/hooks/use-mouse-hover.js +32 -34
  644. package/mixed-line-bar-chart/hooks/use-mouse-hover.js.map +1 -1
  645. package/mixed-line-bar-chart/hooks/use-navigation.js +48 -57
  646. package/mixed-line-bar-chart/hooks/use-navigation.js.map +1 -1
  647. package/mixed-line-bar-chart/hooks/use-popover.js +7 -7
  648. package/mixed-line-bar-chart/hooks/use-popover.js.map +1 -1
  649. package/mixed-line-bar-chart/index.js +4 -4
  650. package/mixed-line-bar-chart/index.js.map +1 -1
  651. package/mixed-line-bar-chart/internal.js +47 -49
  652. package/mixed-line-bar-chart/internal.js.map +1 -1
  653. package/mixed-line-bar-chart/line-series.js +19 -24
  654. package/mixed-line-bar-chart/line-series.js.map +1 -1
  655. package/mixed-line-bar-chart/make-scaled-bar-groups.js +10 -11
  656. package/mixed-line-bar-chart/make-scaled-bar-groups.js.map +1 -1
  657. package/mixed-line-bar-chart/make-scaled-series.js +30 -38
  658. package/mixed-line-bar-chart/make-scaled-series.js.map +1 -1
  659. package/mixed-line-bar-chart/utils.js +18 -21
  660. package/mixed-line-bar-chart/utils.js.map +1 -1
  661. package/modal/body-scroll.js +4 -4
  662. package/modal/body-scroll.js.map +1 -1
  663. package/modal/index.js +4 -4
  664. package/modal/index.js.map +1 -1
  665. package/modal/internal.js +24 -25
  666. package/modal/internal.js.map +1 -1
  667. package/multiselect/index.js +5 -5
  668. package/multiselect/index.js.map +1 -1
  669. package/multiselect/internal.js +81 -88
  670. package/multiselect/internal.js.map +1 -1
  671. package/package.json +1 -1
  672. package/pagination/index.js +2 -3
  673. package/pagination/index.js.map +1 -1
  674. package/pagination/internal.js +16 -17
  675. package/pagination/internal.js.map +1 -1
  676. package/pagination/utils.js +12 -12
  677. package/pagination/utils.js.map +1 -1
  678. package/pie-chart/index.js +38 -39
  679. package/pie-chart/index.js.map +1 -1
  680. package/pie-chart/labels.js +38 -42
  681. package/pie-chart/labels.js.map +1 -1
  682. package/pie-chart/pie-chart.js +65 -67
  683. package/pie-chart/pie-chart.js.map +1 -1
  684. package/pie-chart/responsive-text.js +9 -10
  685. package/pie-chart/responsive-text.js.map +1 -1
  686. package/pie-chart/segments.js +27 -31
  687. package/pie-chart/segments.js.map +1 -1
  688. package/pie-chart/utils.js +32 -35
  689. package/pie-chart/utils.js.map +1 -1
  690. package/popover/arrow.js +2 -2
  691. package/popover/arrow.js.map +1 -1
  692. package/popover/body.js +16 -19
  693. package/popover/body.js.map +1 -1
  694. package/popover/container.js +52 -55
  695. package/popover/container.js.map +1 -1
  696. package/popover/index.js +6 -6
  697. package/popover/index.js.map +1 -1
  698. package/popover/internal.js +28 -28
  699. package/popover/internal.js.map +1 -1
  700. package/popover/utils/positions.js +54 -66
  701. package/popover/utils/positions.js.map +1 -1
  702. package/progress-bar/index.js +17 -17
  703. package/progress-bar/index.js.map +1 -1
  704. package/progress-bar/internal.js +12 -16
  705. package/progress-bar/internal.js.map +1 -1
  706. package/property-filter/controller.js +117 -125
  707. package/property-filter/controller.js.map +1 -1
  708. package/property-filter/filter-options.js +8 -11
  709. package/property-filter/filter-options.js.map +1 -1
  710. package/property-filter/index.js +50 -50
  711. package/property-filter/index.js.map +1 -1
  712. package/property-filter/property-editor.js +4 -5
  713. package/property-filter/property-editor.js.map +1 -1
  714. package/property-filter/property-filter-autosuggest.js +39 -39
  715. package/property-filter/property-filter-autosuggest.js.map +1 -1
  716. package/property-filter/token-editor.js +55 -66
  717. package/property-filter/token-editor.js.map +1 -1
  718. package/property-filter/token.js +9 -11
  719. package/property-filter/token.js.map +1 -1
  720. package/property-filter/use-load-items.js +8 -12
  721. package/property-filter/use-load-items.js.map +1 -1
  722. package/property-filter/utils.js +13 -18
  723. package/property-filter/utils.js.map +1 -1
  724. package/radio-group/index.js +3 -4
  725. package/radio-group/index.js.map +1 -1
  726. package/radio-group/internal.js +9 -9
  727. package/radio-group/internal.js.map +1 -1
  728. package/radio-group/radio-button.js +12 -15
  729. package/radio-group/radio-button.js.map +1 -1
  730. package/s3-resource-selector/index.js +29 -29
  731. package/s3-resource-selector/index.js.map +1 -1
  732. package/s3-resource-selector/s3-in-context/index.js +16 -18
  733. package/s3-resource-selector/s3-in-context/index.js.map +1 -1
  734. package/s3-resource-selector/s3-in-context/search-input.js +3 -4
  735. package/s3-resource-selector/s3-in-context/search-input.js.map +1 -1
  736. package/s3-resource-selector/s3-in-context/use-versions-fetch.js +16 -16
  737. package/s3-resource-selector/s3-in-context/use-versions-fetch.js.map +1 -1
  738. package/s3-resource-selector/s3-in-context/validation.js +6 -6
  739. package/s3-resource-selector/s3-in-context/validation.js.map +1 -1
  740. package/s3-resource-selector/s3-modal/basic-table.js +19 -20
  741. package/s3-resource-selector/s3-modal/basic-table.js.map +1 -1
  742. package/s3-resource-selector/s3-modal/buckets-table.js +11 -13
  743. package/s3-resource-selector/s3-modal/buckets-table.js.map +1 -1
  744. package/s3-resource-selector/s3-modal/column-formats.js +5 -5
  745. package/s3-resource-selector/s3-modal/column-formats.js.map +1 -1
  746. package/s3-resource-selector/s3-modal/empty-state.js +1 -2
  747. package/s3-resource-selector/s3-modal/empty-state.js.map +1 -1
  748. package/s3-resource-selector/s3-modal/index.js +37 -43
  749. package/s3-resource-selector/s3-modal/index.js.map +1 -1
  750. package/s3-resource-selector/s3-modal/objects-table.js +12 -14
  751. package/s3-resource-selector/s3-modal/objects-table.js.map +1 -1
  752. package/s3-resource-selector/s3-modal/table-utils.js +9 -12
  753. package/s3-resource-selector/s3-modal/table-utils.js.map +1 -1
  754. package/s3-resource-selector/s3-modal/versions-table.js +10 -12
  755. package/s3-resource-selector/s3-modal/versions-table.js.map +1 -1
  756. package/s3-resource-selector/utils.js +1 -1
  757. package/s3-resource-selector/utils.js.map +1 -1
  758. package/segmented-control/index.js +2 -3
  759. package/segmented-control/index.js.map +1 -1
  760. package/segmented-control/internal-segmented-control.js +16 -17
  761. package/segmented-control/internal-segmented-control.js.map +1 -1
  762. package/segmented-control/internal.js +14 -14
  763. package/segmented-control/internal.js.map +1 -1
  764. package/segmented-control/segment.js +3 -6
  765. package/segmented-control/segment.js.map +1 -1
  766. package/select/index.js +6 -6
  767. package/select/index.js.map +1 -1
  768. package/select/internal.js +58 -58
  769. package/select/internal.js.map +1 -1
  770. package/select/parts/filter.js +4 -4
  771. package/select/parts/filter.js.map +1 -1
  772. package/select/parts/item.js +10 -10
  773. package/select/parts/item.js.map +1 -1
  774. package/select/parts/multiselect-item.js +13 -14
  775. package/select/parts/multiselect-item.js.map +1 -1
  776. package/select/parts/plain-list.js +13 -15
  777. package/select/parts/plain-list.js.map +1 -1
  778. package/select/parts/trigger.js +7 -9
  779. package/select/parts/trigger.js.map +1 -1
  780. package/select/parts/virtual-list.js +27 -33
  781. package/select/parts/virtual-list.js.map +1 -1
  782. package/select/utils/check-option-value-field.js +2 -2
  783. package/select/utils/check-option-value-field.js.map +1 -1
  784. package/select/utils/connect-options.js +6 -7
  785. package/select/utils/connect-options.js.map +1 -1
  786. package/select/utils/get-item-props.js +4 -7
  787. package/select/utils/get-item-props.js.map +1 -1
  788. package/select/utils/render-options.js +13 -15
  789. package/select/utils/render-options.js.map +1 -1
  790. package/select/utils/use-announcement.js +10 -11
  791. package/select/utils/use-announcement.js.map +1 -1
  792. package/select/utils/use-load-items.js +16 -19
  793. package/select/utils/use-load-items.js.map +1 -1
  794. package/select/utils/use-native-search.js +20 -29
  795. package/select/utils/use-native-search.js.map +1 -1
  796. package/select/utils/use-select.js +89 -96
  797. package/select/utils/use-select.js.map +1 -1
  798. package/side-navigation/index.js +10 -10
  799. package/side-navigation/index.js.map +1 -1
  800. package/side-navigation/internal.js +35 -46
  801. package/side-navigation/internal.js.map +1 -1
  802. package/side-navigation/util.js +9 -12
  803. package/side-navigation/util.js.map +1 -1
  804. package/space-between/index.js +4 -4
  805. package/space-between/index.js.map +1 -1
  806. package/space-between/internal.js +7 -7
  807. package/space-between/internal.js.map +1 -1
  808. package/spinner/index.js +4 -4
  809. package/spinner/index.js.map +1 -1
  810. package/spinner/internal.js +4 -4
  811. package/spinner/internal.js.map +1 -1
  812. package/split-panel/bottom.js +22 -25
  813. package/split-panel/bottom.js.map +1 -1
  814. package/split-panel/icons/bottom-icon-refresh.js +11 -13
  815. package/split-panel/icons/bottom-icon-refresh.js.map +1 -1
  816. package/split-panel/icons/bottom-icon.js +1 -1
  817. package/split-panel/icons/bottom-icon.js.map +1 -1
  818. package/split-panel/icons/resize-handler.js +3 -6
  819. package/split-panel/icons/resize-handler.js.map +1 -1
  820. package/split-panel/icons/side-position-refresh.js +12 -14
  821. package/split-panel/icons/side-position-refresh.js.map +1 -1
  822. package/split-panel/icons/side-position.js +1 -1
  823. package/split-panel/icons/side-position.js.map +1 -1
  824. package/split-panel/index.js +65 -65
  825. package/split-panel/index.js.map +1 -1
  826. package/split-panel/preferences-modal.js +9 -9
  827. package/split-panel/preferences-modal.js.map +1 -1
  828. package/split-panel/side.js +12 -15
  829. package/split-panel/side.js.map +1 -1
  830. package/split-panel/utils/size-utils.js +3 -3
  831. package/split-panel/utils/size-utils.js.map +1 -1
  832. package/split-panel/utils/use-keyboard-events.js +13 -17
  833. package/split-panel/utils/use-keyboard-events.js.map +1 -1
  834. package/split-panel/utils/use-pointer-events.js +12 -13
  835. package/split-panel/utils/use-pointer-events.js.map +1 -1
  836. package/status-indicator/index.js +4 -4
  837. package/status-indicator/index.js.map +1 -1
  838. package/status-indicator/internal.js +9 -10
  839. package/status-indicator/internal.js.map +1 -1
  840. package/table/body-cell/click-away.js +9 -10
  841. package/table/body-cell/click-away.js.map +1 -1
  842. package/table/body-cell/index.js +18 -18
  843. package/table/body-cell/index.js.map +1 -1
  844. package/table/body-cell/inline-editor.js +32 -46
  845. package/table/body-cell/inline-editor.js.map +1 -1
  846. package/table/body-cell/td-element.js +2 -4
  847. package/table/body-cell/td-element.js.map +1 -1
  848. package/table/body-cell/use-stable-scroll-position.js +10 -13
  849. package/table/body-cell/use-stable-scroll-position.js.map +1 -1
  850. package/table/header-cell/index.d.ts +4 -2
  851. package/table/header-cell/index.d.ts.map +1 -1
  852. package/table/header-cell/index.js +33 -34
  853. package/table/header-cell/index.js.map +1 -1
  854. package/table/header-cell/utils.js +10 -12
  855. package/table/header-cell/utils.js.map +1 -1
  856. package/table/index.js +5 -5
  857. package/table/index.js.map +1 -1
  858. package/table/internal.d.ts.map +1 -1
  859. package/table/internal.js +94 -118
  860. package/table/internal.js.map +1 -1
  861. package/table/resizer/index.d.ts +5 -1
  862. package/table/resizer/index.d.ts.map +1 -1
  863. package/table/resizer/index.js +40 -39
  864. package/table/resizer/index.js.map +1 -1
  865. package/table/selection-control/index.d.ts +4 -1
  866. package/table/selection-control/index.d.ts.map +1 -1
  867. package/table/selection-control/index.js +11 -11
  868. package/table/selection-control/index.js.map +1 -1
  869. package/table/sticky-header.d.ts +2 -2
  870. package/table/sticky-header.d.ts.map +1 -1
  871. package/table/sticky-header.js +16 -15
  872. package/table/sticky-header.js.map +1 -1
  873. package/table/sticky-scrollbar.js +5 -6
  874. package/table/sticky-scrollbar.js.map +1 -1
  875. package/table/sticky-scrolling.js +10 -10
  876. package/table/sticky-scrolling.js.map +1 -1
  877. package/table/thead.d.ts +11 -3
  878. package/table/thead.d.ts.map +1 -1
  879. package/table/thead.js +13 -13
  880. package/table/thead.js.map +1 -1
  881. package/table/tools-header.js +4 -5
  882. package/table/tools-header.js.map +1 -1
  883. package/table/use-column-widths.js +34 -44
  884. package/table/use-column-widths.js.map +1 -1
  885. package/table/use-row-events.js +10 -11
  886. package/table/use-row-events.js.map +1 -1
  887. package/table/use-selection.js +75 -81
  888. package/table/use-selection.js.map +1 -1
  889. package/table/use-sticky-header.js +16 -16
  890. package/table/use-sticky-header.js.map +1 -1
  891. package/table/use-sticky-scrollbar.js +42 -42
  892. package/table/use-sticky-scrollbar.js.map +1 -1
  893. package/table/use-table-focus-navigation.js +27 -28
  894. package/table/use-table-focus-navigation.js.map +1 -1
  895. package/table/utils.js +7 -7
  896. package/table/utils.js.map +1 -1
  897. package/tabs/index.js +30 -33
  898. package/tabs/index.js.map +1 -1
  899. package/tabs/scroll-utils.js +12 -13
  900. package/tabs/scroll-utils.js.map +1 -1
  901. package/tabs/smooth-scroll.js +17 -17
  902. package/tabs/smooth-scroll.js.map +1 -1
  903. package/tabs/tab-header-bar.js +61 -66
  904. package/tabs/tab-header-bar.js.map +1 -1
  905. package/tag-editor/index.js +59 -72
  906. package/tag-editor/index.js.map +1 -1
  907. package/tag-editor/internal.js +21 -29
  908. package/tag-editor/internal.js.map +1 -1
  909. package/tag-editor/utils.js +7 -8
  910. package/tag-editor/utils.js.map +1 -1
  911. package/tag-editor/validation.js +16 -18
  912. package/tag-editor/validation.js.map +1 -1
  913. package/text-content/index.js +6 -6
  914. package/text-content/index.js.map +1 -1
  915. package/text-filter/index.js +3 -4
  916. package/text-filter/index.js.map +1 -1
  917. package/text-filter/internal.js +10 -10
  918. package/text-filter/internal.js.map +1 -1
  919. package/textarea/index.js +23 -24
  920. package/textarea/index.js.map +1 -1
  921. package/theming/index.js +2 -3
  922. package/theming/index.js.map +1 -1
  923. package/tiles/index.js +3 -4
  924. package/tiles/index.js.map +1 -1
  925. package/tiles/internal.js +17 -17
  926. package/tiles/internal.js.map +1 -1
  927. package/tiles/tile.js +7 -9
  928. package/tiles/tile.js.map +1 -1
  929. package/time-input/index.js +5 -5
  930. package/time-input/index.js.map +1 -1
  931. package/time-input/internal.js +9 -9
  932. package/time-input/internal.js.map +1 -1
  933. package/toggle/index.js +3 -4
  934. package/toggle/index.js.map +1 -1
  935. package/toggle/internal.js +15 -16
  936. package/toggle/internal.js.map +1 -1
  937. package/token-group/dismiss-button.js +5 -7
  938. package/token-group/dismiss-button.js.map +1 -1
  939. package/token-group/index.js +4 -4
  940. package/token-group/index.js.map +1 -1
  941. package/token-group/internal.js +14 -14
  942. package/token-group/internal.js.map +1 -1
  943. package/token-group/toggle.js +7 -9
  944. package/token-group/toggle.js.map +1 -1
  945. package/top-navigation/1.0-beta/index.js +4 -4
  946. package/top-navigation/1.0-beta/index.js.map +1 -1
  947. package/top-navigation/1.0-beta/internal.js +43 -46
  948. package/top-navigation/1.0-beta/internal.js.map +1 -1
  949. package/top-navigation/1.0-beta/parts/overflow-menu.js +16 -17
  950. package/top-navigation/1.0-beta/parts/overflow-menu.js.map +1 -1
  951. package/top-navigation/1.0-beta/parts/utility.js +9 -12
  952. package/top-navigation/1.0-beta/parts/utility.js.map +1 -1
  953. package/top-navigation/1.0-beta/use-top-navigation.js +46 -54
  954. package/top-navigation/1.0-beta/use-top-navigation.js.map +1 -1
  955. package/top-navigation/index.js +4 -4
  956. package/top-navigation/index.js.map +1 -1
  957. package/top-navigation/internal.js +64 -71
  958. package/top-navigation/internal.js.map +1 -1
  959. package/top-navigation/parts/overflow-menu/header.js +3 -4
  960. package/top-navigation/parts/overflow-menu/header.js.map +1 -1
  961. package/top-navigation/parts/overflow-menu/index.js +4 -5
  962. package/top-navigation/parts/overflow-menu/index.js.map +1 -1
  963. package/top-navigation/parts/overflow-menu/menu-item.js +56 -61
  964. package/top-navigation/parts/overflow-menu/menu-item.js.map +1 -1
  965. package/top-navigation/parts/overflow-menu/router.js +11 -13
  966. package/top-navigation/parts/overflow-menu/router.js.map +1 -1
  967. package/top-navigation/parts/overflow-menu/views/submenu.js +6 -8
  968. package/top-navigation/parts/overflow-menu/views/submenu.js.map +1 -1
  969. package/top-navigation/parts/overflow-menu/views/utilities.js +5 -7
  970. package/top-navigation/parts/overflow-menu/views/utilities.js.map +1 -1
  971. package/top-navigation/parts/utility.js +12 -15
  972. package/top-navigation/parts/utility.js.map +1 -1
  973. package/top-navigation/use-top-navigation.js +52 -59
  974. package/top-navigation/use-top-navigation.js.map +1 -1
  975. package/tutorial-panel/components/tutorial-detail-view/congratulation-screen.js +5 -7
  976. package/tutorial-panel/components/tutorial-detail-view/congratulation-screen.js.map +1 -1
  977. package/tutorial-panel/components/tutorial-detail-view/index.js +6 -7
  978. package/tutorial-panel/components/tutorial-detail-view/index.js.map +1 -1
  979. package/tutorial-panel/components/tutorial-detail-view/task-list.js +8 -15
  980. package/tutorial-panel/components/tutorial-detail-view/task-list.js.map +1 -1
  981. package/tutorial-panel/components/tutorial-detail-view/task.js +5 -6
  982. package/tutorial-panel/components/tutorial-detail-view/task.js.map +1 -1
  983. package/tutorial-panel/components/tutorial-list/index.js +19 -22
  984. package/tutorial-panel/components/tutorial-list/index.js.map +1 -1
  985. package/tutorial-panel/index.js +8 -8
  986. package/tutorial-panel/index.js.map +1 -1
  987. package/wizard/index.js +28 -28
  988. package/wizard/index.js.map +1 -1
  989. package/wizard/internal/analytics.js +32 -42
  990. package/wizard/internal/analytics.js.map +1 -1
  991. package/wizard/unmount.js +6 -13
  992. package/wizard/unmount.js.map +1 -1
  993. package/wizard/wizard-actions.js +7 -8
  994. package/wizard/wizard-actions.js.map +1 -1
  995. package/wizard/wizard-form-header.js +2 -3
  996. package/wizard/wizard-form-header.js.map +1 -1
  997. package/wizard/wizard-form.js +14 -16
  998. package/wizard/wizard-form.js.map +1 -1
  999. package/wizard/wizard-navigation.js +19 -25
  1000. package/wizard/wizard-navigation.js.map +1 -1
@@ -2,85 +2,78 @@
2
2
  // SPDX-License-Identifier: Apache-2.0
3
3
  import { getOverflowParents, getOverflowParentDimensions } from '../../utils/scrollable-containers';
4
4
  import styles from './styles.css.js';
5
- var AVAILABLE_SPACE_RESERVE_DEFAULT = 50;
6
- var AVAILABLE_SPACE_RESERVE_MOBILE_VERTICAL = 19; // 50 - 31
7
- var AVAILABLE_SPACE_RESERVE_MOBILE_HORIZONTAL = 20;
8
- var getClosestParentDimensions = function (element) {
9
- var parents = getOverflowParents(element).map(function (el) {
10
- var _a = el.getBoundingClientRect(), height = _a.height, width = _a.width, top = _a.top, left = _a.left;
5
+ const AVAILABLE_SPACE_RESERVE_DEFAULT = 50;
6
+ const AVAILABLE_SPACE_RESERVE_MOBILE_VERTICAL = 19; // 50 - 31
7
+ const AVAILABLE_SPACE_RESERVE_MOBILE_HORIZONTAL = 20;
8
+ const getClosestParentDimensions = (element) => {
9
+ const parents = getOverflowParents(element).map(el => {
10
+ const { height, width, top, left } = el.getBoundingClientRect();
11
11
  return {
12
- height: height,
13
- width: width,
14
- top: top,
15
- left: left
12
+ height,
13
+ width,
14
+ top,
15
+ left,
16
16
  };
17
17
  });
18
18
  return parents.shift();
19
19
  };
20
- export var getAvailableSpace = function (trigger, dropdown, overflowParents, stretchWidth, stretchHeight, isMobile) {
21
- if (stretchWidth === void 0) { stretchWidth = false; }
22
- if (stretchHeight === void 0) { stretchHeight = false; }
23
- var availableSpaceReserveVertical = stretchHeight
20
+ export const getAvailableSpace = (trigger, dropdown, overflowParents, stretchWidth = false, stretchHeight = false, isMobile) => {
21
+ const availableSpaceReserveVertical = stretchHeight
24
22
  ? 0
25
23
  : isMobile
26
24
  ? AVAILABLE_SPACE_RESERVE_MOBILE_VERTICAL
27
25
  : AVAILABLE_SPACE_RESERVE_DEFAULT;
28
- var availableSpaceReserveHorizontal = stretchWidth
26
+ const availableSpaceReserveHorizontal = stretchWidth
29
27
  ? 0
30
28
  : isMobile
31
29
  ? AVAILABLE_SPACE_RESERVE_MOBILE_HORIZONTAL
32
30
  : AVAILABLE_SPACE_RESERVE_DEFAULT;
33
- var _a = trigger.getBoundingClientRect(), triggerBottom = _a.bottom, triggerLeft = _a.left, triggerRight = _a.right;
34
- return overflowParents.reduce(function (_a, overflowParent) {
35
- var above = _a.above, below = _a.below, left = _a.left, right = _a.right;
36
- var offsetTop = triggerBottom - overflowParent.top;
37
- var currentAbove = offsetTop - trigger.offsetHeight - availableSpaceReserveVertical;
38
- var currentBelow = overflowParent.height - offsetTop - availableSpaceReserveVertical;
39
- var currentLeft = triggerRight - overflowParent.left - availableSpaceReserveHorizontal;
40
- var currentRight = overflowParent.left + overflowParent.width - triggerLeft - availableSpaceReserveHorizontal;
31
+ const { bottom: triggerBottom, left: triggerLeft, right: triggerRight } = trigger.getBoundingClientRect();
32
+ return overflowParents.reduce(({ above, below, left, right }, overflowParent) => {
33
+ const offsetTop = triggerBottom - overflowParent.top;
34
+ const currentAbove = offsetTop - trigger.offsetHeight - availableSpaceReserveVertical;
35
+ const currentBelow = overflowParent.height - offsetTop - availableSpaceReserveVertical;
36
+ const currentLeft = triggerRight - overflowParent.left - availableSpaceReserveHorizontal;
37
+ const currentRight = overflowParent.left + overflowParent.width - triggerLeft - availableSpaceReserveHorizontal;
41
38
  return {
42
39
  above: Math.min(above, currentAbove),
43
40
  below: Math.min(below, currentBelow),
44
41
  left: Math.min(left, currentLeft),
45
- right: Math.min(right, currentRight)
42
+ right: Math.min(right, currentRight),
46
43
  };
47
44
  }, { above: Number.MAX_VALUE, below: Number.MAX_VALUE, left: Number.MAX_VALUE, right: Number.MAX_VALUE });
48
45
  };
49
- export var getInteriorAvailableSpace = function (trigger, dropdown, overflowParents, isMobile) {
50
- var AVAILABLE_SPACE_RESERVE_VERTICAL = isMobile
46
+ export const getInteriorAvailableSpace = (trigger, dropdown, overflowParents, isMobile) => {
47
+ const AVAILABLE_SPACE_RESERVE_VERTICAL = isMobile
51
48
  ? AVAILABLE_SPACE_RESERVE_MOBILE_VERTICAL
52
49
  : AVAILABLE_SPACE_RESERVE_DEFAULT;
53
- var AVAILABLE_SPACE_RESERVE_HORIZONTAL = isMobile
50
+ const AVAILABLE_SPACE_RESERVE_HORIZONTAL = isMobile
54
51
  ? AVAILABLE_SPACE_RESERVE_MOBILE_HORIZONTAL
55
52
  : AVAILABLE_SPACE_RESERVE_DEFAULT;
56
- var _a = trigger.getBoundingClientRect(), triggerBottom = _a.bottom, triggerTop = _a.top, triggerLeft = _a.left, triggerRight = _a.right;
57
- return overflowParents.reduce(function (_a, overflowParent) {
58
- var above = _a.above, below = _a.below, left = _a.left, right = _a.right;
59
- var currentAbove = triggerBottom - overflowParent.top - AVAILABLE_SPACE_RESERVE_VERTICAL;
60
- var currentBelow = overflowParent.height - triggerTop + overflowParent.top - AVAILABLE_SPACE_RESERVE_VERTICAL;
61
- var currentLeft = triggerLeft - overflowParent.left - AVAILABLE_SPACE_RESERVE_HORIZONTAL;
62
- var currentRight = overflowParent.left + overflowParent.width - triggerRight - AVAILABLE_SPACE_RESERVE_HORIZONTAL;
53
+ const { bottom: triggerBottom, top: triggerTop, left: triggerLeft, right: triggerRight, } = trigger.getBoundingClientRect();
54
+ return overflowParents.reduce(({ above, below, left, right }, overflowParent) => {
55
+ const currentAbove = triggerBottom - overflowParent.top - AVAILABLE_SPACE_RESERVE_VERTICAL;
56
+ const currentBelow = overflowParent.height - triggerTop + overflowParent.top - AVAILABLE_SPACE_RESERVE_VERTICAL;
57
+ const currentLeft = triggerLeft - overflowParent.left - AVAILABLE_SPACE_RESERVE_HORIZONTAL;
58
+ const currentRight = overflowParent.left + overflowParent.width - triggerRight - AVAILABLE_SPACE_RESERVE_HORIZONTAL;
63
59
  return {
64
60
  above: Math.min(above, currentAbove),
65
61
  below: Math.min(below, currentBelow),
66
62
  left: Math.min(left, currentLeft),
67
- right: Math.min(right, currentRight)
63
+ right: Math.min(right, currentRight),
68
64
  };
69
65
  }, { above: Number.MAX_VALUE, below: Number.MAX_VALUE, left: Number.MAX_VALUE, right: Number.MAX_VALUE });
70
66
  };
71
- export var getDropdownPosition = function (trigger, dropdown, overflowParents, minWidth, preferCenter, stretchWidth, stretchHeight, isMobile) {
72
- if (preferCenter === void 0) { preferCenter = false; }
73
- if (stretchWidth === void 0) { stretchWidth = false; }
74
- if (stretchHeight === void 0) { stretchHeight = false; }
75
- var availableSpace = getAvailableSpace(trigger, dropdown, overflowParents, stretchWidth, stretchHeight, isMobile);
76
- var triggerWidth = trigger.getBoundingClientRect().width;
67
+ export const getDropdownPosition = (trigger, dropdown, overflowParents, minWidth, preferCenter = false, stretchWidth = false, stretchHeight = false, isMobile) => {
68
+ const availableSpace = getAvailableSpace(trigger, dropdown, overflowParents, stretchWidth, stretchHeight, isMobile);
69
+ const triggerWidth = trigger.getBoundingClientRect().width;
77
70
  minWidth = minWidth ? Math.min(triggerWidth, minWidth) : triggerWidth;
78
- var requiredWidth = dropdown.getBoundingClientRect().width;
71
+ const requiredWidth = dropdown.getBoundingClientRect().width;
79
72
  // dropdown should not be smaller than the trigger
80
- var idealWidth = Math.max(requiredWidth, minWidth);
81
- var dropLeft;
82
- var left = null;
83
- var width = idealWidth;
73
+ const idealWidth = Math.max(requiredWidth, minWidth);
74
+ let dropLeft;
75
+ let left = null;
76
+ let width = idealWidth;
84
77
  //1. Can it be positioned with ideal width to the right?
85
78
  if (idealWidth <= availableSpace.right) {
86
79
  dropLeft = false;
@@ -95,34 +88,34 @@ export var getDropdownPosition = function (trigger, dropdown, overflowParents, m
95
88
  width = Math.max(availableSpace.left, availableSpace.right, minWidth);
96
89
  }
97
90
  if (preferCenter) {
98
- var spillOver = (idealWidth - triggerWidth) / 2;
91
+ const spillOver = (idealWidth - triggerWidth) / 2;
99
92
  // availableSpace always includes the trigger width, but we want to exclude that
100
- var availableOutsideLeft = availableSpace.left - triggerWidth;
101
- var availableOutsideRight = availableSpace.right - triggerWidth;
102
- var fitsInCenter = availableOutsideLeft >= spillOver && availableOutsideRight >= spillOver;
93
+ const availableOutsideLeft = availableSpace.left - triggerWidth;
94
+ const availableOutsideRight = availableSpace.right - triggerWidth;
95
+ const fitsInCenter = availableOutsideLeft >= spillOver && availableOutsideRight >= spillOver;
103
96
  if (fitsInCenter) {
104
97
  left = -spillOver;
105
98
  }
106
99
  }
107
- var dropUp = availableSpace.below < dropdown.offsetHeight && availableSpace.above > availableSpace.below;
108
- var availableHeight = dropUp ? availableSpace.above : availableSpace.below;
100
+ const dropUp = availableSpace.below < dropdown.offsetHeight && availableSpace.above > availableSpace.below;
101
+ const availableHeight = dropUp ? availableSpace.above : availableSpace.below;
109
102
  // Try and crop the bottom item when all options can't be displayed, affordance for "there's more"
110
- var croppedHeight = stretchHeight ? availableHeight : Math.floor(availableHeight / 31) * 31 + 16;
103
+ const croppedHeight = stretchHeight ? availableHeight : Math.floor(availableHeight / 31) * 31 + 16;
111
104
  return {
112
- dropUp: dropUp,
113
- dropLeft: dropLeft,
114
- left: left === null ? 'auto' : "".concat(left, "px"),
115
- height: "".concat(croppedHeight, "px"),
116
- width: "".concat(width, "px")
105
+ dropUp,
106
+ dropLeft,
107
+ left: left === null ? 'auto' : `${left}px`,
108
+ height: `${croppedHeight}px`,
109
+ width: `${width}px`,
117
110
  };
118
111
  };
119
- export var getInteriorDropdownPosition = function (trigger, dropdown, overflowParents, isMobile) {
120
- var availableSpace = getInteriorAvailableSpace(trigger, dropdown, overflowParents, isMobile);
121
- var _a = trigger.getBoundingClientRect(), triggerBottom = _a.bottom, triggerTop = _a.top, triggerWidth = _a.width;
122
- var _b = getClosestParentDimensions(trigger), parentDropdownTop = _b.top, parentDropdownHeight = _b.height;
123
- var dropLeft;
124
- var width = dropdown.getBoundingClientRect().width;
125
- var top = triggerTop - parentDropdownTop;
112
+ export const getInteriorDropdownPosition = (trigger, dropdown, overflowParents, isMobile) => {
113
+ const availableSpace = getInteriorAvailableSpace(trigger, dropdown, overflowParents, isMobile);
114
+ const { bottom: triggerBottom, top: triggerTop, width: triggerWidth } = trigger.getBoundingClientRect();
115
+ const { top: parentDropdownTop, height: parentDropdownHeight } = getClosestParentDimensions(trigger);
116
+ let dropLeft;
117
+ let width = dropdown.getBoundingClientRect().width;
118
+ const top = triggerTop - parentDropdownTop;
126
119
  if (width <= availableSpace.right) {
127
120
  dropLeft = false;
128
121
  }
@@ -133,23 +126,23 @@ export var getInteriorDropdownPosition = function (trigger, dropdown, overflowPa
133
126
  dropLeft = availableSpace.left > availableSpace.right;
134
127
  width = Math.max(availableSpace.left, availableSpace.right);
135
128
  }
136
- var left = dropLeft ? 0 - width : triggerWidth;
137
- var dropUp = availableSpace.below < dropdown.offsetHeight && availableSpace.above > availableSpace.below;
138
- var bottom = dropUp ? parentDropdownTop + parentDropdownHeight - triggerBottom : 0;
139
- var availableHeight = dropUp ? availableSpace.above : availableSpace.below;
129
+ const left = dropLeft ? 0 - width : triggerWidth;
130
+ const dropUp = availableSpace.below < dropdown.offsetHeight && availableSpace.above > availableSpace.below;
131
+ const bottom = dropUp ? parentDropdownTop + parentDropdownHeight - triggerBottom : 0;
132
+ const availableHeight = dropUp ? availableSpace.above : availableSpace.below;
140
133
  // Try and crop the bottom item when all options can't be displayed, affordance for "there's more"
141
- var croppedHeight = Math.floor(availableHeight / 31) * 31 + 16;
134
+ const croppedHeight = Math.floor(availableHeight / 31) * 31 + 16;
142
135
  return {
143
- dropUp: dropUp,
144
- dropLeft: dropLeft,
145
- height: "".concat(croppedHeight, "px"),
146
- width: "".concat(width, "px"),
147
- top: "".concat(top, "px"),
148
- bottom: "".concat(bottom, "px"),
149
- left: "".concat(left, "px")
136
+ dropUp,
137
+ dropLeft,
138
+ height: `${croppedHeight}px`,
139
+ width: `${width}px`,
140
+ top: `${top}px`,
141
+ bottom: `${bottom}px`,
142
+ left: `${left}px`,
150
143
  };
151
144
  };
152
- export var calculatePosition = function (dropdownElement, triggerElement, verticalContainerElement, interior, expandToViewport, preferCenter, stretchWidth, stretchHeight, isMobile, minWidth) {
145
+ export const calculatePosition = (dropdownElement, triggerElement, verticalContainerElement, interior, expandToViewport, preferCenter, stretchWidth, stretchHeight, isMobile, minWidth) => {
153
146
  // cleaning previously assigned values,
154
147
  // so that they are not reused in case of screen resize and similar events
155
148
  verticalContainerElement.style.maxHeight = '';
@@ -160,11 +153,11 @@ export var calculatePosition = function (dropdownElement, triggerElement, vertic
160
153
  dropdownElement.classList.remove(styles['dropdown-drop-left']);
161
154
  dropdownElement.classList.remove(styles['dropdown-drop-right']);
162
155
  dropdownElement.classList.remove(styles['dropdown-drop-up']);
163
- var overflowParents = getOverflowParentDimensions(dropdownElement, interior, expandToViewport, stretchHeight);
164
- var position = interior
156
+ const overflowParents = getOverflowParentDimensions(dropdownElement, interior, expandToViewport, stretchHeight);
157
+ const position = interior
165
158
  ? getInteriorDropdownPosition(triggerElement, dropdownElement, overflowParents, isMobile)
166
159
  : getDropdownPosition(triggerElement, dropdownElement, overflowParents, minWidth, preferCenter, stretchWidth, stretchHeight, isMobile);
167
- var triggerBox = triggerElement.getBoundingClientRect();
160
+ const triggerBox = triggerElement.getBoundingClientRect();
168
161
  return [position, triggerBox];
169
162
  };
170
163
  //# sourceMappingURL=dropdown-fit-handler.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"dropdown-fit-handler.js","sourceRoot":"","sources":["../../../../../src/internal/components/dropdown/dropdown-fit-handler.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,EAAc,kBAAkB,EAAE,2BAA2B,EAAE,MAAM,mCAAmC,CAAC;AAChH,OAAO,MAAM,MAAM,iBAAiB,CAAC;AAErC,IAAM,+BAA+B,GAAG,EAAE,CAAC;AAC3C,IAAM,uCAAuC,GAAG,EAAE,CAAC,CAAC,UAAU;AAC9D,IAAM,yCAAyC,GAAG,EAAE,CAAC;AAoBrD,IAAM,0BAA0B,GAAG,UAAC,OAAoB;IACtD,IAAM,OAAO,GAAG,kBAAkB,CAAC,OAAO,CAAC,CAAC,GAAG,CAAC,UAAA,EAAE;QAC1C,IAAA,KAA+B,EAAE,CAAC,qBAAqB,EAAE,EAAvD,MAAM,YAAA,EAAE,KAAK,WAAA,EAAE,GAAG,SAAA,EAAE,IAAI,UAA+B,CAAC;QAChE,OAAO;YACL,MAAM,QAAA;YACN,KAAK,OAAA;YACL,GAAG,KAAA;YACH,IAAI,MAAA;SACL,CAAC;IACJ,CAAC,C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IAClC,eAAe,CAAC,KAAK,CAAC,IAAI,GAAG,EAAE,CAAC;IAEhC,eAAe,CAAC,SAAS,CAAC,MAAM,CAAC,MAAM,CAAC,oBAAoB,CAAC,CAAC,CAAC;IAC/D,eAAe,CAAC,SAAS,CAAC,MAAM,CAAC,MAAM,CAAC,qBAAqB,CAAC,CAAC,CAAC;IAChE,eAAe,CAAC,SAAS,CAAC,MAAM,CAAC,MAAM,CAAC,kBAAkB,CAAC,CAAC,CAAC;IAE7D,IAAM,eAAe,GAAG,2BAA2B,CAAC,eAAe,EAAE,QAAQ,EAAE,gBAAgB,EAAE,aAAa,CAAC,CAAC;IAChH,IAAM,QAAQ,GAAG,QAAQ;QACvB,CAAC,CAAC,2BAA2B,CAAC,cAAc,EAAE,eAAe,EAAE,eAAe,EAAE,QAAQ,CAAC;QACzF,CAAC,CAAC,mBAAmB,CACjB,cAAc,EACd,eAAe,EACf,eAAe,EACf,QAAQ,EACR,YAAY,EACZ,YAAY,EACZ,aAAa,EACb,QAAQ,CACT,CAAC;IACN,IAAM,UAAU,GAAG,cAAc,CAAC,qBAAqB,EAAE,CAAC;IAC1D,OAAO,CAAC,QAAQ,EAAE,UAAU,CAAC,CAAC;AAChC,CAAC,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { Dimensions, getOverflowParents, getOverflowParentDimensions } from '../../utils/scrollable-containers';\nimport styles from './styles.css.js';\n\nconst AVAILABLE_SPACE_RESERVE_DEFAULT = 50;\nconst AVAILABLE_SPACE_RESERVE_MOBILE_VERTICAL = 19; // 50 - 31\nconst AVAILABLE_SPACE_RESERVE_MOBILE_HORIZONTAL = 20;\n\ninterface AvailableSpace {\n above: number;\n below: number;\n left: number;\n right: number;\n}\nexport interface DropdownPosition {\n height: string;\n width: string;\n dropUp: boolean;\n dropLeft: boolean;\n left: string;\n}\nexport interface InteriorDropdownPosition extends DropdownPosition {\n bottom: string;\n top: string;\n}\n\nconst getClosestParentDimensions = (element: HTMLElement): any => {\n const parents = getOverflowParents(element).map(el => {\n const { height, width, top, left } = el.getBoundingClientRect();\n return {\n height,\n width,\n top,\n left,\n };\n });\n\n return parents.shift();\n};\n\nexport const getAvailableSpace = (\n trigger: HTMLElement,\n dropdown: HTMLElement,\n overflowParents: ReadonlyArray<Dimensions>,\n stretchWidth = false,\n stretchHeight = false,\n isMobile?: boolean\n): AvailableSpace => {\n const availableSpaceReserveVertical = stretchHeight\n ? 0\n : isMobile\n ? AVAILABLE_SPACE_RESERVE_MOBILE_VERTICAL\n : AVAILABLE_SPACE_RESERVE_DEFAULT;\n const availableSpaceReserveHorizontal = stretchWidth\n ? 0\n : isMobile\n ? AVAILABLE_SPACE_RESERVE_MOBILE_HORIZONTAL\n : AVAILABLE_SPACE_RESERVE_DEFAULT;\n const { bottom: triggerBottom, left: triggerLeft, right: triggerRight } = trigger.getBoundingClientRect();\n\n return overflowParents.reduce(\n ({ above, below, left, right }, overflowParent) => {\n const offsetTop = triggerBottom - overflowParent.top;\n const currentAbove = offsetTop - trigger.offsetHeight - availableSpaceReserveVertical;\n const currentBelow = overflowParent.height - offsetTop - availableSpaceReserveVertical;\n const currentLeft = triggerRight - overflowParent.left - availableSpaceReserveHorizontal;\n const currentRight = overflowParent.left + overflowParent.width - triggerLeft - availableSpaceReserveHorizontal;\n\n return {\n above: Math.min(above, currentAbove),\n below: Math.min(below, currentBelow),\n left: Math.min(left, currentLeft),\n right: Math.min(right, currentRight),\n };\n },\n { above: Number.MAX_VALUE, below: Number.MAX_VALUE, left: Number.MAX_VALUE, right: Number.MAX_VALUE }\n );\n};\n\nexport const getInteriorAvailableSpace = (\n trigger: HTMLElement,\n dropdown: HTMLElement,\n overflowParents: ReadonlyArray<Dimensions>,\n isMobile?: boolean\n): AvailableSpace => {\n const AVAILABLE_SPACE_RESERVE_VERTICAL = isMobile\n ? AVAILABLE_SPACE_RESERVE_MOBILE_VERTICAL\n : AVAILABLE_SPACE_RESERVE_DEFAULT;\n const AVAILABLE_SPACE_RESERVE_HORIZONTAL = isMobile\n ? AVAILABLE_SPACE_RESERVE_MOBILE_HORIZONTAL\n : AVAILABLE_SPACE_RESERVE_DEFAULT;\n const {\n bottom: triggerBottom,\n top: triggerTop,\n left: triggerLeft,\n right: triggerRight,\n } = trigger.getBoundingClientRect();\n\n return overflowParents.reduce(\n ({ above, below, left, right }, overflowParent) => {\n const currentAbove = triggerBottom - overflowParent.top - AVAILABLE_SPACE_RESERVE_VERTICAL;\n const currentBelow = overflowParent.height - triggerTop + overflowParent.top - AVAILABLE_SPACE_RESERVE_VERTICAL;\n const currentLeft = triggerLeft - overflowParent.left - AVAILABLE_SPACE_RESERVE_HORIZONTAL;\n const currentRight =\n overflowParent.left + overflowParent.width - triggerRight - AVAILABLE_SPACE_RESERVE_HORIZONTAL;\n\n return {\n above: Math.min(above, currentAbove),\n below: Math.min(below, currentBelow),\n left: Math.min(left, currentLeft),\n right: Math.min(right, currentRight),\n };\n },\n { above: Number.MAX_VALUE, below: Number.MAX_VALUE, left: Number.MAX_VALUE, right: Number.MAX_VALUE }\n );\n};\n\nexport const getDropdownPosition = (\n trigger: HTMLElement,\n dropdown: HTMLElement,\n overflowParents: ReadonlyArray<Dimensions>,\n minWidth?: number,\n preferCenter = false,\n stretchWidth = false,\n stretchHeight = false,\n isMobile?: boolean\n): DropdownPosition => {\n const availableSpace = getAvailableSpace(trigger, dropdown, overflowParents, stretchWidth, stretchHeight, isMobile);\n const triggerWidth = trigger.getBoundingClientRect().width;\n minWidth = minWidth ? Math.min(triggerWidth, minWidth) : triggerWidth;\n const requiredWidth = dropdown.getBoundingClientRect().width;\n // dropdown should not be smaller than the trigger\n const idealWidth = Math.max(requiredWidth, minWidth);\n\n let dropLeft: boolean;\n let left: number | null = null;\n let width = idealWidth;\n\n //1. Can it be positioned with ideal width to the right?\n if (idealWidth <= availableSpace.right) {\n dropLeft = false;\n //2. Can it be positioned with ideal width to the left?\n } else if (idealWidth <= availableSpace.left) {\n dropLeft = true;\n //3. Fit into biggest available space either on left or right\n } else {\n dropLeft = availableSpace.left > availableSpace.right;\n width = Math.max(availableSpace.left, availableSpace.right, minWidth);\n }\n\n if (preferCenter) {\n const spillOver = (idealWidth - triggerWidth) / 2;\n\n // availableSpace always includes the trigger width, but we want to exclude that\n const availableOutsideLeft = availableSpace.left - triggerWidth;\n const availableOutsideRight = availableSpace.right - triggerWidth;\n\n const fitsInCenter = availableOutsideLeft >= spillOver && availableOutsideRight >= spillOver;\n if (fitsInCenter) {\n left = -spillOver;\n }\n }\n\n const dropUp = availableSpace.below < dropdown.offsetHeight && availableSpace.above > availableSpace.below;\n const availableHeight = dropUp ? availableSpace.above : availableSpace.below;\n // Try and crop the bottom item when all options can't be displayed, affordance for \"there's more\"\n const croppedHeight = stretchHeight ? availableHeight : Math.floor(availableHeight / 31) * 31 + 16;\n\n return {\n dropUp,\n dropLeft,\n left: left === null ? 'auto' : `${left}px`,\n height: `${croppedHeight}px`,\n width: `${width}px`,\n };\n};\n\nexport const getInteriorDropdownPosition = (\n trigger: HTMLElement,\n dropdown: HTMLElement,\n overflowParents: ReadonlyArray<Dimensions>,\n isMobile?: boolean\n): InteriorDropdownPosition => {\n const availableSpace = getInteriorAvailableSpace(trigger, dropdown, overflowParents, isMobile);\n const { bottom: triggerBottom, top: triggerTop, width: triggerWidth } = trigger.getBoundingClientRect();\n const { top: parentDropdownTop, height: parentDropdownHeight } = getClosestParentDimensions(trigger);\n\n let dropLeft;\n\n let width = dropdown.getBoundingClientRect().width;\n const top = triggerTop - parentDropdownTop;\n if (width <= availableSpace.right) {\n dropLeft = false;\n } else if (width <= availableSpace.left) {\n dropLeft = true;\n } else {\n dropLeft = availableSpace.left > availableSpace.right;\n width = Math.max(availableSpace.left, availableSpace.right);\n }\n\n const left = dropLeft ? 0 - width : triggerWidth;\n\n const dropUp = availableSpace.below < dropdown.offsetHeight && availableSpace.above > availableSpace.below;\n const bottom = dropUp ? parentDropdownTop + parentDropdownHeight - triggerBottom : 0;\n const availableHeight = dropUp ? availableSpace.above : availableSpace.below;\n // Try and crop the bottom item when all options can't be displayed, affordance for \"there's more\"\n const croppedHeight = Math.floor(availableHeight / 31) * 31 + 16;\n\n return {\n dropUp,\n dropLeft,\n height: `${croppedHeight}px`,\n width: `${width}px`,\n top: `${top}px`,\n bottom: `${bottom}px`,\n left: `${left}px`,\n };\n};\n\nexport const calculatePosition = (\n dropdownElement: HTMLDivElement,\n triggerElement: HTMLDivElement,\n verticalContainerElement: HTMLDivElement,\n interior: boolean,\n expandToViewport: boolean,\n preferCenter: boolean,\n stretchWidth: boolean,\n stretchHeight: boolean,\n isMobile: boolean,\n minWidth?: number\n): [DropdownPosition, DOMRect] => {\n // cleaning previously assigned values,\n // so that they are not reused in case of screen resize and similar events\n verticalContainerElement.style.maxHeight = '';\n dropdownElement.style.width = '';\n dropdownElement.style.top = '';\n dropdownElement.style.bottom = '';\n dropdownElement.style.left = '';\n\n dropdownElement.classList.remove(styles['dropdown-drop-left']);\n dropdownElement.classList.remove(styles['dropdown-drop-right']);\n dropdownElement.classList.remove(styles['dropdown-drop-up']);\n\n const overflowParents = getOverflowParentDimensions(dropdownElement, interior, expandToViewport, stretchHeight);\n const position = interior\n ? getInteriorDropdownPosition(triggerElement, dropdownElement, overflowParents, isMobile)\n : getDropdownPosition(\n triggerElement,\n dropdownElement,\n overflowParents,\n minWidth,\n preferCenter,\n stretchWidth,\n stretchHeight,\n isMobile\n );\n const triggerBox = triggerElement.getBoundingClientRect();\n return [position, triggerBox];\n};\n"]}
1
+ {"version":3,"file":"dropdown-fit-handler.js","sourceRoot":"","sources":["../../../../../src/internal/components/dropdown/dropdown-fit-handler.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,EAAc,kBAAkB,EAAE,2BAA2B,EAAE,MAAM,mCAAmC,CAAC;AAChH,OAAO,MAAM,MAAM,iBAAiB,CAAC;AAErC,MAAM,+BAA+B,GAAG,EAAE,CAA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SPDX-License-Identifier: Apache-2.0\nimport { Dimensions, getOverflowParents, getOverflowParentDimensions } from '../../utils/scrollable-containers';\nimport styles from './styles.css.js';\n\nconst AVAILABLE_SPACE_RESERVE_DEFAULT = 50;\nconst AVAILABLE_SPACE_RESERVE_MOBILE_VERTICAL = 19; // 50 - 31\nconst AVAILABLE_SPACE_RESERVE_MOBILE_HORIZONTAL = 20;\n\ninterface AvailableSpace {\n above: number;\n below: number;\n left: number;\n right: number;\n}\nexport interface DropdownPosition {\n height: string;\n width: string;\n dropUp: boolean;\n dropLeft: boolean;\n left: string;\n}\nexport interface InteriorDropdownPosition extends DropdownPosition {\n bottom: string;\n top: string;\n}\n\nconst getClosestParentDimensions = (element: HTMLElement): any => {\n const parents = getOverflowParents(element).map(el => {\n const { height, width, top, left } = el.getBoundingClientRect();\n return {\n height,\n width,\n top,\n left,\n };\n });\n\n return parents.shift();\n};\n\nexport const getAvailableSpace = (\n trigger: HTMLElement,\n dropdown: HTMLElement,\n overflowParents: ReadonlyArray<Dimensions>,\n stretchWidth = false,\n stretchHeight = false,\n isMobile?: boolean\n): AvailableSpace => {\n const availableSpaceReserveVertical = stretchHeight\n ? 0\n : isMobile\n ? AVAILABLE_SPACE_RESERVE_MOBILE_VERTICAL\n : AVAILABLE_SPACE_RESERVE_DEFAULT;\n const availableSpaceReserveHorizontal = stretchWidth\n ? 0\n : isMobile\n ? AVAILABLE_SPACE_RESERVE_MOBILE_HORIZONTAL\n : AVAILABLE_SPACE_RESERVE_DEFAULT;\n const { bottom: triggerBottom, left: triggerLeft, right: triggerRight } = trigger.getBoundingClientRect();\n\n return overflowParents.reduce(\n ({ above, below, left, right }, overflowParent) => {\n const offsetTop = triggerBottom - overflowParent.top;\n const currentAbove = offsetTop - trigger.offsetHeight - availableSpaceReserveVertical;\n const currentBelow = overflowParent.height - offsetTop - availableSpaceReserveVertical;\n const currentLeft = triggerRight - overflowParent.left - availableSpaceReserveHorizontal;\n const currentRight = overflowParent.left + overflowParent.width - triggerLeft - availableSpaceReserveHorizontal;\n\n return {\n above: Math.min(above, currentAbove),\n below: Math.min(below, currentBelow),\n left: Math.min(left, currentLeft),\n right: Math.min(right, currentRight),\n };\n },\n { above: Number.MAX_VALUE, below: Number.MAX_VALUE, left: Number.MAX_VALUE, right: Number.MAX_VALUE }\n );\n};\n\nexport const getInteriorAvailableSpace = (\n trigger: HTMLElement,\n dropdown: HTMLElement,\n overflowParents: ReadonlyArray<Dimensions>,\n isMobile?: boolean\n): AvailableSpace => {\n const AVAILABLE_SPACE_RESERVE_VERTICAL = isMobile\n ? AVAILABLE_SPACE_RESERVE_MOBILE_VERTICAL\n : AVAILABLE_SPACE_RESERVE_DEFAULT;\n const AVAILABLE_SPACE_RESERVE_HORIZONTAL = isMobile\n ? AVAILABLE_SPACE_RESERVE_MOBILE_HORIZONTAL\n : AVAILABLE_SPACE_RESERVE_DEFAULT;\n const {\n bottom: triggerBottom,\n top: triggerTop,\n left: triggerLeft,\n right: triggerRight,\n } = trigger.getBoundingClientRect();\n\n return overflowParents.reduce(\n ({ above, below, left, right }, overflowParent) => {\n const currentAbove = triggerBottom - overflowParent.top - AVAILABLE_SPACE_RESERVE_VERTICAL;\n const currentBelow = overflowParent.height - triggerTop + overflowParent.top - AVAILABLE_SPACE_RESERVE_VERTICAL;\n const currentLeft = triggerLeft - overflowParent.left - AVAILABLE_SPACE_RESERVE_HORIZONTAL;\n const currentRight =\n overflowParent.left + overflowParent.width - triggerRight - AVAILABLE_SPACE_RESERVE_HORIZONTAL;\n\n return {\n above: Math.min(above, currentAbove),\n below: Math.min(below, currentBelow),\n left: Math.min(left, currentLeft),\n right: Math.min(right, currentRight),\n };\n },\n { above: Number.MAX_VALUE, below: Number.MAX_VALUE, left: Number.MAX_VALUE, right: Number.MAX_VALUE }\n );\n};\n\nexport const getDropdownPosition = (\n trigger: HTMLElement,\n dropdown: HTMLElement,\n overflowParents: ReadonlyArray<Dimensions>,\n minWidth?: number,\n preferCenter = false,\n stretchWidth = false,\n stretchHeight = false,\n isMobile?: boolean\n): DropdownPosition => {\n const availableSpace = getAvailableSpace(trigger, dropdown, overflowParents, stretchWidth, stretchHeight, isMobile);\n const triggerWidth = trigger.getBoundingClientRect().width;\n minWidth = minWidth ? Math.min(triggerWidth, minWidth) : triggerWidth;\n const requiredWidth = dropdown.getBoundingClientRect().width;\n // dropdown should not be smaller than the trigger\n const idealWidth = Math.max(requiredWidth, minWidth);\n\n let dropLeft: boolean;\n let left: number | null = null;\n let width = idealWidth;\n\n //1. Can it be positioned with ideal width to the right?\n if (idealWidth <= availableSpace.right) {\n dropLeft = false;\n //2. Can it be positioned with ideal width to the left?\n } else if (idealWidth <= availableSpace.left) {\n dropLeft = true;\n //3. Fit into biggest available space either on left or right\n } else {\n dropLeft = availableSpace.left > availableSpace.right;\n width = Math.max(availableSpace.left, availableSpace.right, minWidth);\n }\n\n if (preferCenter) {\n const spillOver = (idealWidth - triggerWidth) / 2;\n\n // availableSpace always includes the trigger width, but we want to exclude that\n const availableOutsideLeft = availableSpace.left - triggerWidth;\n const availableOutsideRight = availableSpace.right - triggerWidth;\n\n const fitsInCenter = availableOutsideLeft >= spillOver && availableOutsideRight >= spillOver;\n if (fitsInCenter) {\n left = -spillOver;\n }\n }\n\n const dropUp = availableSpace.below < dropdown.offsetHeight && availableSpace.above > availableSpace.below;\n const availableHeight = dropUp ? availableSpace.above : availableSpace.below;\n // Try and crop the bottom item when all options can't be displayed, affordance for \"there's more\"\n const croppedHeight = stretchHeight ? availableHeight : Math.floor(availableHeight / 31) * 31 + 16;\n\n return {\n dropUp,\n dropLeft,\n left: left === null ? 'auto' : `${left}px`,\n height: `${croppedHeight}px`,\n width: `${width}px`,\n };\n};\n\nexport const getInteriorDropdownPosition = (\n trigger: HTMLElement,\n dropdown: HTMLElement,\n overflowParents: ReadonlyArray<Dimensions>,\n isMobile?: boolean\n): InteriorDropdownPosition => {\n const availableSpace = getInteriorAvailableSpace(trigger, dropdown, overflowParents, isMobile);\n const { bottom: triggerBottom, top: triggerTop, width: triggerWidth } = trigger.getBoundingClientRect();\n const { top: parentDropdownTop, height: parentDropdownHeight } = getClosestParentDimensions(trigger);\n\n let dropLeft;\n\n let width = dropdown.getBoundingClientRect().width;\n const top = triggerTop - parentDropdownTop;\n if (width <= availableSpace.right) {\n dropLeft = false;\n } else if (width <= availableSpace.left) {\n dropLeft = true;\n } else {\n dropLeft = availableSpace.left > availableSpace.right;\n width = Math.max(availableSpace.left, availableSpace.right);\n }\n\n const left = dropLeft ? 0 - width : triggerWidth;\n\n const dropUp = availableSpace.below < dropdown.offsetHeight && availableSpace.above > availableSpace.below;\n const bottom = dropUp ? parentDropdownTop + parentDropdownHeight - triggerBottom : 0;\n const availableHeight = dropUp ? availableSpace.above : availableSpace.below;\n // Try and crop the bottom item when all options can't be displayed, affordance for \"there's more\"\n const croppedHeight = Math.floor(availableHeight / 31) * 31 + 16;\n\n return {\n dropUp,\n dropLeft,\n height: `${croppedHeight}px`,\n width: `${width}px`,\n top: `${top}px`,\n bottom: `${bottom}px`,\n left: `${left}px`,\n };\n};\n\nexport const calculatePosition = (\n dropdownElement: HTMLDivElement,\n triggerElement: HTMLDivElement,\n verticalContainerElement: HTMLDivElement,\n interior: boolean,\n expandToViewport: boolean,\n preferCenter: boolean,\n stretchWidth: boolean,\n stretchHeight: boolean,\n isMobile: boolean,\n minWidth?: number\n): [DropdownPosition, DOMRect] => {\n // cleaning previously assigned values,\n // so that they are not reused in case of screen resize and similar events\n verticalContainerElement.style.maxHeight = '';\n dropdownElement.style.width = '';\n dropdownElement.style.top = '';\n dropdownElement.style.bottom = '';\n dropdownElement.style.left = '';\n\n dropdownElement.classList.remove(styles['dropdown-drop-left']);\n dropdownElement.classList.remove(styles['dropdown-drop-right']);\n dropdownElement.classList.remove(styles['dropdown-drop-up']);\n\n const overflowParents = getOverflowParentDimensions(dropdownElement, interior, expandToViewport, stretchHeight);\n const position = interior\n ? getInteriorDropdownPosition(triggerElement, dropdownElement, overflowParents, isMobile)\n : getDropdownPosition(\n triggerElement,\n dropdownElement,\n overflowParents,\n minWidth,\n preferCenter,\n stretchWidth,\n stretchHeight,\n isMobile\n );\n const triggerBox = triggerElement.getBoundingClientRect();\n return [position, triggerBox];\n};\n"]}
@@ -1,4 +1,3 @@
1
- import { __spreadArray } from "tslib";
2
1
  // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
2
  // SPDX-License-Identifier: Apache-2.0
4
3
  import styles from './styles.css.js';
@@ -15,8 +14,7 @@ import { DropdownContextProvider } from './context';
15
14
  import { useMobile } from '../../hooks/use-mobile';
16
15
  import TabTrap from '../tab-trap/index.js';
17
16
  import { getFirstFocusable, getLastFocusable } from '../focus-lock/utils.js';
18
- var DropdownContainer = function (_a) {
19
- var children = _a.children, _b = _a.renderWithPortal, renderWithPortal = _b === void 0 ? false : _b, id = _a.id, open = _a.open;
17
+ const DropdownContainer = ({ children, renderWithPortal = false, id, open }) => {
20
18
  if (renderWithPortal) {
21
19
  if (open) {
22
20
  return createPortal(React.createElement("div", { id: id }, children), document.body);
@@ -29,19 +27,17 @@ var DropdownContainer = function (_a) {
29
27
  return React.createElement(React.Fragment, null, children);
30
28
  }
31
29
  };
32
- var TransitionContent = function (_a) {
33
- var _b;
34
- var state = _a.state, transitionRef = _a.transitionRef, dropdownClasses = _a.dropdownClasses, stretchWidth = _a.stretchWidth, interior = _a.interior, isRefresh = _a.isRefresh, dropdownRef = _a.dropdownRef, verticalContainerRef = _a.verticalContainerRef, expandToViewport = _a.expandToViewport, header = _a.header, children = _a.children, footer = _a.footer, position = _a.position, open = _a.open, onMouseDown = _a.onMouseDown;
35
- var contentRef = useMergeRefs(dropdownRef, transitionRef);
36
- return (React.createElement("div", { className: clsx(styles.dropdown, dropdownClasses, (_b = {},
37
- _b[styles.open] = open,
38
- _b[styles['with-limited-width']] = !stretchWidth,
39
- _b[styles['hide-upper-border']] = stretchWidth,
40
- _b[styles.interior] = interior,
41
- _b[styles['is-empty']] = !header && !children,
42
- _b[styles.refresh] = isRefresh,
43
- _b[styles['use-portal']] = expandToViewport && !interior,
44
- _b)), ref: contentRef, "data-open": open, "data-animating": state !== 'exited', "aria-hidden": !open, onMouseDown: onMouseDown },
30
+ const TransitionContent = ({ state, transitionRef, dropdownClasses, stretchWidth, interior, isRefresh, dropdownRef, verticalContainerRef, expandToViewport, header, children, footer, position, open, onMouseDown, }) => {
31
+ const contentRef = useMergeRefs(dropdownRef, transitionRef);
32
+ return (React.createElement("div", { className: clsx(styles.dropdown, dropdownClasses, {
33
+ [styles.open]: open,
34
+ [styles['with-limited-width']]: !stretchWidth,
35
+ [styles['hide-upper-border']]: stretchWidth,
36
+ [styles.interior]: interior,
37
+ [styles['is-empty']]: !header && !children,
38
+ [styles.refresh]: isRefresh,
39
+ [styles['use-portal']]: expandToViewport && !interior,
40
+ }), ref: contentRef, "data-open": open, "data-animating": state !== 'exited', "aria-hidden": !open, onMouseDown: onMouseDown },
45
41
  React.createElement("div", { className: clsx(styles['dropdown-content-wrapper'], isRefresh && styles.refresh) },
46
42
  React.createElement("div", { className: styles['ie11-wrapper'] },
47
43
  React.createElement("div", { ref: verticalContainerRef, className: styles['dropdown-content'] },
@@ -50,26 +46,25 @@ var TransitionContent = function (_a) {
50
46
  children,
51
47
  footer))))));
52
48
  };
53
- var Dropdown = function (_a) {
54
- var children = _a.children, trigger = _a.trigger, open = _a.open, onDropdownClose = _a.onDropdownClose, onMouseDown = _a.onMouseDown, header = _a.header, footer = _a.footer, dropdownId = _a.dropdownId, _b = _a.stretchTriggerHeight, stretchTriggerHeight = _b === void 0 ? false : _b, _c = _a.stretchWidth, stretchWidth = _c === void 0 ? true : _c, _d = _a.stretchHeight, stretchHeight = _d === void 0 ? false : _d, _e = _a.stretchToTriggerWidth, stretchToTriggerWidth = _e === void 0 ? true : _e, _f = _a.expandToViewport, expandToViewport = _f === void 0 ? false : _f, _g = _a.preferCenter, preferCenter = _g === void 0 ? false : _g, _h = _a.interior, interior = _h === void 0 ? false : _h, minWidth = _a.minWidth, _j = _a.scrollable, scrollable = _j === void 0 ? true : _j, _k = _a.loopFocus, loopFocus = _k === void 0 ? expandToViewport : _k, onFocus = _a.onFocus, onBlur = _a.onBlur, contentKey = _a.contentKey;
55
- var wrapperRef = useRef(null);
56
- var triggerRef = useRef(null);
57
- var dropdownRef = useRef(null);
58
- var dropdownContainerRef = useRef(null);
49
+ const Dropdown = ({ children, trigger, open, onDropdownClose, onMouseDown, header, footer, dropdownId, stretchTriggerHeight = false, stretchWidth = true, stretchHeight = false, stretchToTriggerWidth = true, expandToViewport = false, preferCenter = false, interior = false, minWidth, scrollable = true, loopFocus = expandToViewport, onFocus, onBlur, contentKey, }) => {
50
+ const wrapperRef = useRef(null);
51
+ const triggerRef = useRef(null);
52
+ const dropdownRef = useRef(null);
53
+ const dropdownContainerRef = useRef(null);
59
54
  // This container is only needed to apply max-height to. We can't move max-height to it's parent
60
55
  // because of an IE11 issue with flexbox. https://github.com/philipwalton/flexbugs/issues/216
61
- var verticalContainerRef = useRef(null);
56
+ const verticalContainerRef = useRef(null);
62
57
  // To keep track of the initial position (drop up/down) which is kept the same during fixed repositioning
63
- var fixedPosition = useRef(null);
64
- var isRefresh = useVisualRefresh();
65
- var dropdownClasses = usePortalModeClasses(triggerRef);
66
- var _l = useState('bottom-right'), position = _l[0], setPosition = _l[1];
67
- var isMobile = useMobile();
68
- var setDropdownPosition = function (position, triggerBox, target, verticalContainer) {
69
- var entireWidth = !interior && stretchWidth;
58
+ const fixedPosition = useRef(null);
59
+ const isRefresh = useVisualRefresh();
60
+ const dropdownClasses = usePortalModeClasses(triggerRef);
61
+ const [position, setPosition] = useState('bottom-right');
62
+ const isMobile = useMobile();
63
+ const setDropdownPosition = (position, triggerBox, target, verticalContainer) => {
64
+ const entireWidth = !interior && stretchWidth;
70
65
  if (!stretchWidth) {
71
66
  // 1px offset for dropdowns where the dropdown itself needs a border, rather than on the items
72
- verticalContainer.style.maxHeight = "".concat(parseInt(position.height) + 1, "px");
67
+ verticalContainer.style.maxHeight = `${parseInt(position.height) + 1}px`;
73
68
  }
74
69
  else {
75
70
  verticalContainer.style.maxHeight = position.height;
@@ -100,16 +95,16 @@ var Dropdown = function (_a) {
100
95
  if (expandToViewport && !interior) {
101
96
  target.style.position = 'fixed';
102
97
  if (position.dropUp) {
103
- target.style.bottom = "calc(100% - ".concat(triggerBox.top, "px)");
98
+ target.style.bottom = `calc(100% - ${triggerBox.top}px)`;
104
99
  }
105
100
  else {
106
- target.style.top = "".concat(triggerBox.bottom, "px");
101
+ target.style.top = `${triggerBox.bottom}px`;
107
102
  }
108
103
  if (position.dropLeft) {
109
- target.style.left = "calc(".concat(triggerBox.right, "px - ").concat(position.width, ")");
104
+ target.style.left = `calc(${triggerBox.right}px - ${position.width})`;
110
105
  }
111
106
  else {
112
- target.style.left = "".concat(triggerBox.left, "px");
107
+ target.style.left = `${triggerBox.left}px`;
113
108
  }
114
109
  // Keep track of the initial dropdown position and direction.
115
110
  // Dropdown direction doesn't need to change as the user scrolls, just needs to stay attached to the trigger.
@@ -141,29 +136,26 @@ var Dropdown = function (_a) {
141
136
  setPosition('bottom-right');
142
137
  }
143
138
  };
144
- var isOutsideDropdown = function (element) {
145
- return (!wrapperRef.current || !wrapperRef.current.contains(element)) &&
146
- (!dropdownContainerRef.current || !dropdownContainerRef.current.contains(element));
147
- };
148
- var focusHandler = function (event) {
139
+ const isOutsideDropdown = (element) => (!wrapperRef.current || !wrapperRef.current.contains(element)) &&
140
+ (!dropdownContainerRef.current || !dropdownContainerRef.current.contains(element));
141
+ const focusHandler = (event) => {
149
142
  if (!event.relatedTarget || isOutsideDropdown(event.relatedTarget)) {
150
143
  fireNonCancelableEvent(onFocus, event);
151
144
  }
152
145
  };
153
- var blurHandler = function (event) {
146
+ const blurHandler = (event) => {
154
147
  if (!event.relatedTarget || isOutsideDropdown(event.relatedTarget)) {
155
148
  fireNonCancelableEvent(onBlur, event);
156
149
  }
157
150
  };
158
- useLayoutEffect(function () {
159
- var onDropdownOpen = function () {
151
+ useLayoutEffect(() => {
152
+ const onDropdownOpen = () => {
160
153
  if (open && dropdownRef.current && triggerRef.current && verticalContainerRef.current) {
161
154
  // calculate scroll width only for dropdowns that has a scrollbar and ignore it for date picker components
162
155
  if (scrollable) {
163
156
  dropdownRef.current.classList.add(styles.nowrap);
164
157
  }
165
- setDropdownPosition.apply(void 0, __spreadArray(__spreadArray([], calculatePosition(dropdownRef.current, triggerRef.current, verticalContainerRef.current, interior, expandToViewport, preferCenter, stretchWidth, stretchHeight, isMobile, minWidth), false), [dropdownRef.current,
166
- verticalContainerRef.current], false));
158
+ setDropdownPosition(...calculatePosition(dropdownRef.current, triggerRef.current, verticalContainerRef.current, interior, expandToViewport, preferCenter, stretchWidth, stretchHeight, isMobile, minWidth), dropdownRef.current, verticalContainerRef.current);
167
159
  if (scrollable) {
168
160
  dropdownRef.current.classList.remove(styles.nowrap);
169
161
  }
@@ -175,11 +167,11 @@ var Dropdown = function (_a) {
175
167
  window.addEventListener('scroll', onDropdownOpen);
176
168
  // only listen to window scroll within very short time after the dropdown opens
177
169
  // do not want to interfere dropdown position on scroll afterwards
178
- var timeoutId_1 = setTimeout(function () {
170
+ const timeoutId = setTimeout(() => {
179
171
  window.removeEventListener('scroll', onDropdownOpen);
180
172
  }, 500);
181
- return function () {
182
- clearTimeout(timeoutId_1);
173
+ return () => {
174
+ clearTimeout(timeoutId);
183
175
  window.removeEventListener('scroll', onDropdownOpen);
184
176
  };
185
177
  }
@@ -187,42 +179,42 @@ var Dropdown = function (_a) {
187
179
  // eslint-disable-next-line react-hooks/exhaustive-deps
188
180
  }, [open, dropdownRef, triggerRef, verticalContainerRef, interior, stretchWidth, isMobile, contentKey]);
189
181
  // subscribe to outside click
190
- useEffect(function () {
182
+ useEffect(() => {
191
183
  if (!open) {
192
184
  return;
193
185
  }
194
- var clickListener = function (e) {
186
+ const clickListener = (e) => {
195
187
  var _a, _b;
196
188
  if (!((_a = dropdownRef.current) === null || _a === void 0 ? void 0 : _a.contains(e.target)) && !((_b = triggerRef.current) === null || _b === void 0 ? void 0 : _b.contains(e.target))) {
197
189
  fireNonCancelableEvent(onDropdownClose);
198
190
  }
199
191
  };
200
192
  window.addEventListener('click', clickListener, true);
201
- return function () {
193
+ return () => {
202
194
  window.removeEventListener('click', clickListener, true);
203
195
  };
204
196
  }, [open, onDropdownClose]);
205
197
  // sync dropdown position on scroll and resize
206
- useLayoutEffect(function () {
198
+ useLayoutEffect(() => {
207
199
  if (!expandToViewport || !open) {
208
200
  return;
209
201
  }
210
- var updateDropdownPosition = function () {
202
+ const updateDropdownPosition = () => {
211
203
  if (triggerRef.current && dropdownRef.current && verticalContainerRef.current) {
212
- var triggerRect = triggerRef.current.getBoundingClientRect();
213
- var target = dropdownRef.current;
204
+ const triggerRect = triggerRef.current.getBoundingClientRect();
205
+ const target = dropdownRef.current;
214
206
  if (fixedPosition.current) {
215
207
  if (fixedPosition.current.dropUp) {
216
- dropdownRef.current.style.bottom = "calc(100% - ".concat(triggerRect.top, "px)");
208
+ dropdownRef.current.style.bottom = `calc(100% - ${triggerRect.top}px)`;
217
209
  }
218
210
  else {
219
- target.style.top = "".concat(triggerRect.bottom, "px");
211
+ target.style.top = `${triggerRect.bottom}px`;
220
212
  }
221
213
  if (fixedPosition.current.dropLeft) {
222
- target.style.left = "calc(".concat(triggerRect.right, "px - ").concat(fixedPosition.current.width, ")");
214
+ target.style.left = `calc(${triggerRect.right}px - ${fixedPosition.current.width})`;
223
215
  }
224
216
  else {
225
- target.style.left = "".concat(triggerRect.left, "px");
217
+ target.style.left = `${triggerRect.left}px`;
226
218
  }
227
219
  }
228
220
  }
@@ -230,20 +222,20 @@ var Dropdown = function (_a) {
230
222
  updateDropdownPosition();
231
223
  window.addEventListener('scroll', updateDropdownPosition, true);
232
224
  window.addEventListener('resize', updateDropdownPosition, true);
233
- return function () {
225
+ return () => {
234
226
  window.removeEventListener('scroll', updateDropdownPosition, true);
235
227
  window.removeEventListener('resize', updateDropdownPosition, true);
236
228
  };
237
229
  }, [open, expandToViewport]);
238
230
  return (React.createElement("div", { className: clsx(styles.root, interior && styles.interior, stretchTriggerHeight && styles['stretch-trigger-height']), ref: wrapperRef, onFocus: focusHandler, onBlur: blurHandler },
239
231
  React.createElement("div", { className: clsx(stretchTriggerHeight && styles['stretch-trigger-height']), ref: triggerRef }, trigger),
240
- React.createElement(TabTrap, { focusNextCallback: function () { var _a; return dropdownRef.current && ((_a = getFirstFocusable(dropdownRef.current)) === null || _a === void 0 ? void 0 : _a.focus()); }, disabled: !open || !loopFocus }),
232
+ React.createElement(TabTrap, { focusNextCallback: () => { var _a; return dropdownRef.current && ((_a = getFirstFocusable(dropdownRef.current)) === null || _a === void 0 ? void 0 : _a.focus()); }, disabled: !open || !loopFocus }),
241
233
  React.createElement(DropdownContainer, { renderWithPortal: expandToViewport && !interior, id: dropdownId, open: open },
242
- React.createElement(Transition, { "in": open !== null && open !== void 0 ? open : false, exit: false }, function (state, ref) { return (React.createElement("div", { ref: dropdownContainerRef },
243
- React.createElement(TabTrap, { focusNextCallback: function () { var _a; return triggerRef.current && ((_a = getLastFocusable(triggerRef.current)) === null || _a === void 0 ? void 0 : _a.focus()); }, disabled: !open || !loopFocus }),
234
+ React.createElement(Transition, { in: open !== null && open !== void 0 ? open : false, exit: false }, (state, ref) => (React.createElement("div", { ref: dropdownContainerRef },
235
+ React.createElement(TabTrap, { focusNextCallback: () => { var _a; return triggerRef.current && ((_a = getLastFocusable(triggerRef.current)) === null || _a === void 0 ? void 0 : _a.focus()); }, disabled: !open || !loopFocus }),
244
236
  React.createElement(TransitionContent, { state: state, transitionRef: ref, dropdownClasses: dropdownClasses, open: open, stretchWidth: stretchWidth, interior: interior, header: header, expandToViewport: expandToViewport, footer: footer, onMouseDown: onMouseDown, isRefresh: isRefresh, dropdownRef: dropdownRef, verticalContainerRef: verticalContainerRef, position: position }, children),
245
- React.createElement(TabTrap, { focusNextCallback: function () { var _a; return triggerRef.current && ((_a = getFirstFocusable(triggerRef.current)) === null || _a === void 0 ? void 0 : _a.focus()); }, disabled: !open || !loopFocus }))); }))));
237
+ React.createElement(TabTrap, { focusNextCallback: () => { var _a; return triggerRef.current && ((_a = getFirstFocusable(triggerRef.current)) === null || _a === void 0 ? void 0 : _a.focus()); }, disabled: !open || !loopFocus })))))));
246
238
  };
247
- var isInteriorPosition = function (position) { return position.bottom !== undefined; };
239
+ const isInteriorPosition = (position) => position.bottom !== undefined;
248
240
  export default Dropdown;
249
241
  //# sourceMappingURL=index.js.map