@cloudscape-design/components 3.0.839 → 3.0.841

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 (865) hide show
  1. package/alert/styles.css.js +28 -28
  2. package/alert/styles.scoped.css +43 -49
  3. package/alert/styles.selectors.js +28 -28
  4. package/anchor-navigation/styles.css.js +8 -8
  5. package/anchor-navigation/styles.scoped.css +18 -21
  6. package/anchor-navigation/styles.selectors.js +8 -8
  7. package/annotation-context/annotation/annotation-icon.d.ts +2 -1
  8. package/annotation-context/annotation/annotation-icon.d.ts.map +1 -1
  9. package/annotation-context/annotation/annotation-icon.js.map +1 -1
  10. package/annotation-context/annotation/annotation-popover.d.ts +2 -1
  11. package/annotation-context/annotation/annotation-popover.d.ts.map +1 -1
  12. package/annotation-context/annotation/annotation-popover.js.map +1 -1
  13. package/annotation-context/annotation/annotation-trigger.d.ts +1 -1
  14. package/annotation-context/annotation/annotation-trigger.d.ts.map +1 -1
  15. package/annotation-context/annotation/annotation-trigger.js.map +1 -1
  16. package/annotation-context/annotation/closed-annotation.d.ts +2 -1
  17. package/annotation-context/annotation/closed-annotation.d.ts.map +1 -1
  18. package/annotation-context/annotation/closed-annotation.js.map +1 -1
  19. package/annotation-context/annotation/open-annotation.d.ts +2 -1
  20. package/annotation-context/annotation/open-annotation.d.ts.map +1 -1
  21. package/annotation-context/annotation/open-annotation.js.map +1 -1
  22. package/annotation-context/annotation/styles.css.js +24 -24
  23. package/annotation-context/annotation/styles.scoped.css +30 -33
  24. package/annotation-context/annotation/styles.selectors.js +24 -24
  25. package/app-layout/classic.d.ts.map +1 -1
  26. package/app-layout/classic.js +6 -3
  27. package/app-layout/classic.js.map +1 -1
  28. package/app-layout/defaults.d.ts +2 -1
  29. package/app-layout/defaults.d.ts.map +1 -1
  30. package/app-layout/defaults.js.map +1 -1
  31. package/app-layout/split-panel/constants.d.ts +0 -1
  32. package/app-layout/split-panel/constants.d.ts.map +1 -1
  33. package/app-layout/split-panel/constants.js +0 -1
  34. package/app-layout/split-panel/constants.js.map +1 -1
  35. package/app-layout/split-panel/split-panel-forced-position.d.ts +5 -0
  36. package/app-layout/split-panel/split-panel-forced-position.d.ts.map +1 -0
  37. package/app-layout/split-panel/split-panel-forced-position.js +30 -0
  38. package/app-layout/split-panel/split-panel-forced-position.js.map +1 -0
  39. package/app-layout/utils/use-pointer-events.d.ts.map +1 -1
  40. package/app-layout/utils/use-pointer-events.js +19 -10
  41. package/app-layout/utils/use-pointer-events.js.map +1 -1
  42. package/app-layout/utils/use-resize.d.ts +1 -1
  43. package/app-layout/utils/use-resize.d.ts.map +1 -1
  44. package/app-layout/utils/use-resize.js.map +1 -1
  45. package/app-layout/utils/use-split-panel-focus-control.d.ts +2 -1
  46. package/app-layout/utils/use-split-panel-focus-control.d.ts.map +1 -1
  47. package/app-layout/utils/use-split-panel-focus-control.js.map +1 -1
  48. package/app-layout/visual-refresh/context.d.ts.map +1 -1
  49. package/app-layout/visual-refresh/context.js +5 -2
  50. package/app-layout/visual-refresh/context.js.map +1 -1
  51. package/app-layout/visual-refresh/drawers.d.ts +0 -8
  52. package/app-layout/visual-refresh/drawers.d.ts.map +1 -1
  53. package/app-layout/visual-refresh/drawers.js +1 -1
  54. package/app-layout/visual-refresh/drawers.js.map +1 -1
  55. package/app-layout/visual-refresh/styles.css.js +86 -86
  56. package/app-layout/visual-refresh/styles.scoped.css +163 -169
  57. package/app-layout/visual-refresh/styles.selectors.js +86 -86
  58. package/app-layout/visual-refresh-toolbar/compute-layout.d.ts.map +1 -1
  59. package/app-layout/visual-refresh-toolbar/compute-layout.js +6 -3
  60. package/app-layout/visual-refresh-toolbar/compute-layout.js.map +1 -1
  61. package/app-layout/visual-refresh-toolbar/drawer/local-drawer.js +1 -1
  62. package/app-layout/visual-refresh-toolbar/drawer/local-drawer.js.map +1 -1
  63. package/app-layout/visual-refresh-toolbar/index.d.ts.map +1 -1
  64. package/app-layout/visual-refresh-toolbar/index.js +32 -2
  65. package/app-layout/visual-refresh-toolbar/index.js.map +1 -1
  66. package/app-layout/visual-refresh-toolbar/skeleton/styles.css.js +19 -19
  67. package/app-layout/visual-refresh-toolbar/skeleton/styles.scoped.css +35 -50
  68. package/app-layout/visual-refresh-toolbar/skeleton/styles.selectors.js +19 -19
  69. package/app-layout/visual-refresh-toolbar/split-panel/index.d.ts +1 -1
  70. package/app-layout/visual-refresh-toolbar/split-panel/index.d.ts.map +1 -1
  71. package/app-layout/visual-refresh-toolbar/split-panel/index.js +3 -1
  72. package/app-layout/visual-refresh-toolbar/split-panel/index.js.map +1 -1
  73. package/app-layout/visual-refresh-toolbar/toolbar/drawer-triggers.d.ts.map +1 -1
  74. package/app-layout/visual-refresh-toolbar/toolbar/drawer-triggers.js +3 -5
  75. package/app-layout/visual-refresh-toolbar/toolbar/drawer-triggers.js.map +1 -1
  76. package/app-layout/visual-refresh-toolbar/toolbar/index.d.ts.map +1 -1
  77. package/app-layout/visual-refresh-toolbar/toolbar/index.js +4 -1
  78. package/app-layout/visual-refresh-toolbar/toolbar/index.js.map +1 -1
  79. package/app-layout/visual-refresh-toolbar/toolbar/styles.css.js +13 -13
  80. package/app-layout/visual-refresh-toolbar/toolbar/styles.scoped.css +15 -18
  81. package/app-layout/visual-refresh-toolbar/toolbar/styles.selectors.js +13 -13
  82. package/area-chart/elements/area-series.d.ts +1 -1
  83. package/area-chart/elements/area-series.d.ts.map +1 -1
  84. package/area-chart/elements/area-series.js.map +1 -1
  85. package/area-chart/elements/threshold-series.d.ts +1 -1
  86. package/area-chart/elements/threshold-series.d.ts.map +1 -1
  87. package/area-chart/elements/threshold-series.js.map +1 -1
  88. package/attribute-editor/internal.d.ts.map +1 -1
  89. package/attribute-editor/internal.js +5 -1
  90. package/attribute-editor/internal.js.map +1 -1
  91. package/attribute-editor/row.d.ts +2 -1
  92. package/attribute-editor/row.d.ts.map +1 -1
  93. package/attribute-editor/row.js.map +1 -1
  94. package/attribute-editor/styles.css.js +14 -14
  95. package/attribute-editor/styles.scoped.css +24 -27
  96. package/attribute-editor/styles.selectors.js +14 -14
  97. package/autosuggest/analytics-metadata/interfaces.d.ts +0 -4
  98. package/autosuggest/analytics-metadata/interfaces.d.ts.map +1 -1
  99. package/autosuggest/analytics-metadata/interfaces.js.map +1 -1
  100. package/autosuggest/autosuggest-option.d.ts +1 -1
  101. package/autosuggest/autosuggest-option.d.ts.map +1 -1
  102. package/autosuggest/autosuggest-option.js.map +1 -1
  103. package/autosuggest/internal.d.ts +1 -1
  104. package/autosuggest/internal.d.ts.map +1 -1
  105. package/autosuggest/internal.js.map +1 -1
  106. package/autosuggest/load-more-controller.d.ts +3 -2
  107. package/autosuggest/load-more-controller.d.ts.map +1 -1
  108. package/autosuggest/load-more-controller.js.map +1 -1
  109. package/autosuggest/options-list.d.ts +2 -1
  110. package/autosuggest/options-list.d.ts.map +1 -1
  111. package/autosuggest/options-list.js.map +1 -1
  112. package/badge/styles.css.js +10 -10
  113. package/badge/styles.scoped.css +10 -13
  114. package/badge/styles.selectors.js +10 -10
  115. package/breadcrumb-group/analytics-metadata/interfaces.d.ts +0 -7
  116. package/breadcrumb-group/analytics-metadata/interfaces.d.ts.map +1 -1
  117. package/breadcrumb-group/analytics-metadata/interfaces.js.map +1 -1
  118. package/breadcrumb-group/styles.css.js +10 -10
  119. package/breadcrumb-group/styles.scoped.css +11 -14
  120. package/breadcrumb-group/styles.selectors.js +10 -10
  121. package/button/styles.css.js +21 -21
  122. package/button/styles.scoped.css +154 -157
  123. package/button/styles.selectors.js +21 -21
  124. package/button-dropdown/interfaces.d.ts +4 -3
  125. package/button-dropdown/interfaces.d.ts.map +1 -1
  126. package/button-dropdown/interfaces.js.map +1 -1
  127. package/button-dropdown/item-element/index.d.ts +0 -7
  128. package/button-dropdown/item-element/index.d.ts.map +1 -1
  129. package/button-dropdown/item-element/index.js.map +1 -1
  130. package/button-dropdown/mobile-expandable-group/mobile-expandable-group.d.ts +1 -1
  131. package/button-dropdown/mobile-expandable-group/mobile-expandable-group.d.ts.map +1 -1
  132. package/button-dropdown/mobile-expandable-group/mobile-expandable-group.js.map +1 -1
  133. package/button-dropdown/mobile-expandable-group/styles.css.js +5 -5
  134. package/button-dropdown/mobile-expandable-group/styles.scoped.css +5 -8
  135. package/button-dropdown/mobile-expandable-group/styles.selectors.js +5 -5
  136. package/button-dropdown/tooltip.d.ts +2 -1
  137. package/button-dropdown/tooltip.d.ts.map +1 -1
  138. package/button-dropdown/tooltip.js.map +1 -1
  139. package/button-dropdown/utils/menu-item.d.ts +3 -2
  140. package/button-dropdown/utils/menu-item.d.ts.map +1 -1
  141. package/button-dropdown/utils/menu-item.js.map +1 -1
  142. package/button-group/styles.css.js +4 -4
  143. package/button-group/styles.scoped.css +4 -7
  144. package/button-group/styles.selectors.js +4 -4
  145. package/calendar/grid/index.d.ts +2 -1
  146. package/calendar/grid/index.d.ts.map +1 -1
  147. package/calendar/grid/index.js.map +1 -1
  148. package/calendar/styles.css.js +21 -21
  149. package/calendar/styles.scoped.css +43 -46
  150. package/calendar/styles.selectors.js +21 -21
  151. package/cards/styles.css.js +39 -39
  152. package/cards/styles.scoped.css +50 -53
  153. package/cards/styles.selectors.js +39 -39
  154. package/checkbox/styles.css.js +3 -3
  155. package/checkbox/styles.scoped.css +5 -8
  156. package/checkbox/styles.selectors.js +3 -3
  157. package/code-editor/pane.d.ts +2 -1
  158. package/code-editor/pane.d.ts.map +1 -1
  159. package/code-editor/pane.js.map +1 -1
  160. package/code-editor/styles.css.js +33 -33
  161. package/code-editor/styles.scoped.css +135 -138
  162. package/code-editor/styles.selectors.js +33 -33
  163. package/collection-preferences/analytics-metadata/interfaces.d.ts +0 -24
  164. package/collection-preferences/analytics-metadata/interfaces.d.ts.map +1 -1
  165. package/collection-preferences/analytics-metadata/interfaces.js.map +1 -1
  166. package/collection-preferences/content-display/content-display-option.d.ts +1 -1
  167. package/collection-preferences/content-display/content-display-option.d.ts.map +1 -1
  168. package/collection-preferences/content-display/content-display-option.js.map +1 -1
  169. package/collection-preferences/content-display/index.d.ts.map +1 -1
  170. package/collection-preferences/content-display/index.js +18 -42
  171. package/collection-preferences/content-display/index.js.map +1 -1
  172. package/collection-preferences/content-display/styles.css.js +12 -13
  173. package/collection-preferences/content-display/styles.scoped.css +15 -47
  174. package/collection-preferences/content-display/styles.selectors.js +12 -13
  175. package/collection-preferences/styles.css.js +38 -39
  176. package/collection-preferences/styles.scoped.css +42 -74
  177. package/collection-preferences/styles.selectors.js +38 -39
  178. package/column-layout/flexible-column-layout/styles.css.js +5 -5
  179. package/column-layout/flexible-column-layout/styles.scoped.css +22 -7
  180. package/column-layout/flexible-column-layout/styles.selectors.js +5 -5
  181. package/column-layout/styles.css.js +13 -13
  182. package/column-layout/styles.scoped.css +43 -46
  183. package/column-layout/styles.selectors.js +13 -13
  184. package/container/styles.css.js +31 -31
  185. package/container/styles.scoped.css +54 -57
  186. package/container/styles.selectors.js +31 -31
  187. package/copy-to-clipboard/internal.d.ts +2 -1
  188. package/copy-to-clipboard/internal.d.ts.map +1 -1
  189. package/copy-to-clipboard/internal.js +2 -2
  190. package/copy-to-clipboard/internal.js.map +1 -1
  191. package/copy-to-clipboard/styles.css.js +3 -4
  192. package/copy-to-clipboard/styles.scoped.css +3 -7
  193. package/copy-to-clipboard/styles.selectors.js +3 -4
  194. package/date-picker/index.js +1 -1
  195. package/date-picker/index.js.map +1 -1
  196. package/date-picker/styles.css.js +7 -7
  197. package/date-picker/styles.scoped.css +9 -12
  198. package/date-picker/styles.selectors.js +7 -7
  199. package/date-range-picker/calendar/grids/index.d.ts +2 -1
  200. package/date-range-picker/calendar/grids/index.d.ts.map +1 -1
  201. package/date-range-picker/calendar/grids/index.js.map +1 -1
  202. package/date-range-picker/calendar/grids/monthly-grid.d.ts +2 -1
  203. package/date-range-picker/calendar/grids/monthly-grid.d.ts.map +1 -1
  204. package/date-range-picker/calendar/grids/monthly-grid.js.map +1 -1
  205. package/date-range-picker/calendar/range-inputs.d.ts +1 -1
  206. package/date-range-picker/calendar/range-inputs.d.ts.map +1 -1
  207. package/date-range-picker/calendar/range-inputs.js.map +1 -1
  208. package/date-range-picker/dropdown.d.ts +2 -2
  209. package/date-range-picker/dropdown.d.ts.map +1 -1
  210. package/date-range-picker/dropdown.js +2 -2
  211. package/date-range-picker/dropdown.js.map +1 -1
  212. package/date-range-picker/interfaces.d.ts +2 -1
  213. package/date-range-picker/interfaces.d.ts.map +1 -1
  214. package/date-range-picker/interfaces.js.map +1 -1
  215. package/date-range-picker/relative-range/index.d.ts +2 -1
  216. package/date-range-picker/relative-range/index.d.ts.map +1 -1
  217. package/date-range-picker/relative-range/index.js.map +1 -1
  218. package/date-range-picker/styles.css.js +38 -38
  219. package/date-range-picker/styles.scoped.css +47 -50
  220. package/date-range-picker/styles.selectors.js +38 -38
  221. package/drawer/implementation.d.ts +2 -1
  222. package/drawer/implementation.d.ts.map +1 -1
  223. package/drawer/implementation.js.map +1 -1
  224. package/drawer/interfaces.d.ts +2 -1
  225. package/drawer/interfaces.d.ts.map +1 -1
  226. package/drawer/interfaces.js.map +1 -1
  227. package/drawer/styles.css.js +5 -5
  228. package/drawer/styles.scoped.css +10 -13
  229. package/drawer/styles.selectors.js +5 -5
  230. package/expandable-section/expandable-section-container.d.ts +2 -1
  231. package/expandable-section/expandable-section-container.d.ts.map +1 -1
  232. package/expandable-section/expandable-section-container.js.map +1 -1
  233. package/expandable-section/expandable-section-header.d.ts +0 -1
  234. package/expandable-section/expandable-section-header.d.ts.map +1 -1
  235. package/expandable-section/expandable-section-header.js +1 -1
  236. package/expandable-section/expandable-section-header.js.map +1 -1
  237. package/expandable-section/internal.d.ts +2 -1
  238. package/expandable-section/internal.d.ts.map +1 -1
  239. package/expandable-section/internal.js.map +1 -1
  240. package/expandable-section/styles.css.js +34 -34
  241. package/expandable-section/styles.scoped.css +65 -68
  242. package/expandable-section/styles.selectors.js +34 -34
  243. package/file-token-group/file-token.d.ts +1 -1
  244. package/file-token-group/file-token.d.ts.map +1 -1
  245. package/file-token-group/file-token.js.map +1 -1
  246. package/file-token-group/styles.css.js +22 -22
  247. package/file-token-group/styles.scoped.css +29 -32
  248. package/file-token-group/styles.selectors.js +22 -22
  249. package/file-upload/interfaces.d.ts +0 -5
  250. package/file-upload/interfaces.d.ts.map +1 -1
  251. package/file-upload/interfaces.js.map +1 -1
  252. package/flashbar/analytics-metadata/interfaces.d.ts +0 -6
  253. package/flashbar/analytics-metadata/interfaces.d.ts.map +1 -1
  254. package/flashbar/analytics-metadata/interfaces.js.map +1 -1
  255. package/flashbar/collapsible-flashbar.d.ts +0 -1
  256. package/flashbar/collapsible-flashbar.d.ts.map +1 -1
  257. package/flashbar/collapsible-flashbar.js.map +1 -1
  258. package/flashbar/flash.d.ts +2 -1
  259. package/flashbar/flash.d.ts.map +1 -1
  260. package/flashbar/flash.js.map +1 -1
  261. package/flashbar/non-collapsible-flashbar.d.ts +0 -1
  262. package/flashbar/non-collapsible-flashbar.d.ts.map +1 -1
  263. package/flashbar/non-collapsible-flashbar.js.map +1 -1
  264. package/flashbar/styles.css.js +50 -50
  265. package/flashbar/styles.scoped.css +148 -151
  266. package/flashbar/styles.selectors.js +50 -50
  267. package/flashbar/utils.d.ts +2 -1
  268. package/flashbar/utils.d.ts.map +1 -1
  269. package/flashbar/utils.js.map +1 -1
  270. package/form/styles.css.js +8 -8
  271. package/form/styles.scoped.css +8 -11
  272. package/form/styles.selectors.js +8 -8
  273. package/form-field/styles.css.js +24 -24
  274. package/form-field/styles.scoped.css +38 -41
  275. package/form-field/styles.selectors.js +24 -24
  276. package/grid/internal.d.ts +1 -1
  277. package/grid/internal.d.ts.map +1 -1
  278. package/grid/internal.js.map +1 -1
  279. package/grid/styles.css.js +53 -53
  280. package/grid/styles.scoped.css +54 -57
  281. package/grid/styles.selectors.js +53 -53
  282. package/header/styles.css.js +34 -34
  283. package/header/styles.scoped.css +50 -53
  284. package/header/styles.selectors.js +34 -34
  285. package/help-panel/implementation.d.ts +2 -1
  286. package/help-panel/implementation.d.ts.map +1 -1
  287. package/help-panel/implementation.js.map +1 -1
  288. package/help-panel/styles.css.js +6 -6
  289. package/help-panel/styles.scoped.css +67 -70
  290. package/help-panel/styles.selectors.js +6 -6
  291. package/i18n/context.d.ts +1 -1
  292. package/i18n/context.d.ts.map +1 -1
  293. package/i18n/context.js.map +1 -1
  294. package/i18n/testing.d.ts +2 -1
  295. package/i18n/testing.d.ts.map +1 -1
  296. package/i18n/testing.js.map +1 -1
  297. package/input/styles.css.js +13 -13
  298. package/input/styles.scoped.css +32 -35
  299. package/input/styles.selectors.js +13 -13
  300. package/internal/analytics/components/analytics-funnel.d.ts +0 -1
  301. package/internal/analytics/components/analytics-funnel.d.ts.map +1 -1
  302. package/internal/analytics/components/analytics-funnel.js +1 -1
  303. package/internal/analytics/components/analytics-funnel.js.map +1 -1
  304. package/internal/analytics/interfaces.d.ts +17 -24
  305. package/internal/analytics/interfaces.d.ts.map +1 -1
  306. package/internal/analytics/interfaces.js.map +1 -1
  307. package/internal/analytics/selectors.d.ts +1 -1
  308. package/internal/analytics/selectors.d.ts.map +1 -1
  309. package/internal/analytics/selectors.js +2 -1
  310. package/internal/analytics/selectors.js.map +1 -1
  311. package/internal/components/autosuggest-input/index.d.ts +2 -2
  312. package/internal/components/autosuggest-input/index.d.ts.map +1 -1
  313. package/internal/components/autosuggest-input/index.js.map +1 -1
  314. package/internal/components/button-trigger/styles.css.js +13 -13
  315. package/internal/components/button-trigger/styles.scoped.css +27 -30
  316. package/internal/components/button-trigger/styles.selectors.js +13 -13
  317. package/internal/components/cartesian-chart/highlighted-point.d.ts +1 -1
  318. package/internal/components/cartesian-chart/highlighted-point.d.ts.map +1 -1
  319. package/internal/components/cartesian-chart/highlighted-point.js.map +1 -1
  320. package/internal/components/cartesian-chart/scales.d.ts +4 -5
  321. package/internal/components/cartesian-chart/scales.d.ts.map +1 -1
  322. package/internal/components/cartesian-chart/scales.js +1 -1
  323. package/internal/components/cartesian-chart/scales.js.map +1 -1
  324. package/internal/components/cartesian-chart/vertical-marker.d.ts +1 -1
  325. package/internal/components/cartesian-chart/vertical-marker.d.ts.map +1 -1
  326. package/internal/components/cartesian-chart/vertical-marker.js.map +1 -1
  327. package/internal/components/chart-filter/index.d.ts +1 -1
  328. package/internal/components/chart-filter/index.d.ts.map +1 -1
  329. package/internal/components/chart-filter/index.js.map +1 -1
  330. package/internal/components/chart-filter/styles.css.js +3 -3
  331. package/internal/components/chart-filter/styles.scoped.css +3 -6
  332. package/internal/components/chart-filter/styles.selectors.js +3 -3
  333. package/internal/components/chart-legend/index.d.ts +1 -1
  334. package/internal/components/chart-legend/index.d.ts.map +1 -1
  335. package/internal/components/chart-legend/index.js.map +1 -1
  336. package/internal/components/chart-legend/styles.css.js +6 -6
  337. package/internal/components/chart-legend/styles.scoped.css +15 -18
  338. package/internal/components/chart-legend/styles.selectors.js +6 -6
  339. package/internal/components/chart-plot/application-controller.d.ts +1 -1
  340. package/internal/components/chart-plot/application-controller.d.ts.map +1 -1
  341. package/internal/components/chart-plot/application-controller.js.map +1 -1
  342. package/internal/components/chart-plot/focus-outline.d.ts +2 -1
  343. package/internal/components/chart-plot/focus-outline.d.ts.map +1 -1
  344. package/internal/components/chart-plot/focus-outline.js.map +1 -1
  345. package/internal/components/chart-plot/index.d.ts +1 -1
  346. package/internal/components/chart-plot/index.d.ts.map +1 -1
  347. package/internal/components/chart-plot/index.js.map +1 -1
  348. package/internal/components/chart-popover/index.d.ts +1 -1
  349. package/internal/components/chart-popover/index.d.ts.map +1 -1
  350. package/internal/components/chart-popover/index.js.map +1 -1
  351. package/internal/components/chart-popover/styles.css.js +3 -3
  352. package/internal/components/chart-popover/styles.scoped.css +3 -6
  353. package/internal/components/chart-popover/styles.selectors.js +3 -3
  354. package/internal/components/chart-series-details/index.d.ts +1 -1
  355. package/internal/components/chart-series-details/index.d.ts.map +1 -1
  356. package/internal/components/chart-series-details/index.js.map +1 -1
  357. package/internal/components/chart-series-details/styles.css.js +20 -20
  358. package/internal/components/chart-series-details/styles.scoped.css +33 -42
  359. package/internal/components/chart-series-details/styles.selectors.js +20 -20
  360. package/internal/components/chart-series-marker/styles.css.js +5 -5
  361. package/internal/components/chart-series-marker/styles.scoped.css +7 -10
  362. package/internal/components/chart-series-marker/styles.selectors.js +5 -5
  363. package/internal/components/chart-wrapper/styles.css.js +9 -9
  364. package/internal/components/chart-wrapper/styles.scoped.css +9 -12
  365. package/internal/components/chart-wrapper/styles.selectors.js +9 -9
  366. package/internal/components/checkbox-icon/index.d.ts +1 -10
  367. package/internal/components/checkbox-icon/index.d.ts.map +1 -1
  368. package/internal/components/checkbox-icon/index.js +1 -1
  369. package/internal/components/checkbox-icon/index.js.map +1 -1
  370. package/internal/components/dnd-container/index.d.ts +28 -0
  371. package/internal/components/dnd-container/index.d.ts.map +1 -0
  372. package/internal/components/dnd-container/index.js +67 -0
  373. package/internal/components/dnd-container/index.js.map +1 -0
  374. package/internal/components/dnd-container/interfaces.d.ts +13 -0
  375. package/internal/components/dnd-container/interfaces.d.ts.map +1 -0
  376. package/internal/components/dnd-container/interfaces.js +4 -0
  377. package/internal/components/dnd-container/interfaces.js.map +1 -0
  378. package/internal/components/dnd-container/keyboard-sensor/defaults.d.ts.map +1 -0
  379. package/internal/components/dnd-container/keyboard-sensor/defaults.js.map +1 -0
  380. package/internal/components/dnd-container/keyboard-sensor/index.d.ts.map +1 -0
  381. package/{collection-preferences/content-display → internal/components/dnd-container}/keyboard-sensor/index.js +1 -1
  382. package/internal/components/dnd-container/keyboard-sensor/index.js.map +1 -0
  383. package/internal/components/dnd-container/keyboard-sensor/utilities/events.d.ts +7 -0
  384. package/internal/components/dnd-container/keyboard-sensor/utilities/events.d.ts.map +1 -0
  385. package/{collection-preferences/content-display → internal/components/dnd-container}/keyboard-sensor/utilities/events.js +0 -4
  386. package/internal/components/dnd-container/keyboard-sensor/utilities/events.js.map +1 -0
  387. package/internal/components/dnd-container/keyboard-sensor/utilities/listeners.d.ts.map +1 -0
  388. package/internal/components/dnd-container/keyboard-sensor/utilities/listeners.js.map +1 -0
  389. package/internal/components/dnd-container/keyboard-sensor/utilities/scroll.d.ts +8 -0
  390. package/internal/components/dnd-container/keyboard-sensor/utilities/scroll.d.ts.map +1 -0
  391. package/{collection-preferences/content-display → internal/components/dnd-container}/keyboard-sensor/utilities/scroll.js +2 -2
  392. package/internal/components/dnd-container/keyboard-sensor/utilities/scroll.js.map +1 -0
  393. package/internal/components/dnd-container/styles.css.js +6 -0
  394. package/internal/components/dnd-container/styles.scoped.css +168 -0
  395. package/internal/components/dnd-container/styles.selectors.js +7 -0
  396. package/{collection-preferences/content-display → internal/components/dnd-container}/use-drag-and-drop-reorder.d.ts +2 -4
  397. package/internal/components/dnd-container/use-drag-and-drop-reorder.d.ts.map +1 -0
  398. package/{collection-preferences/content-display → internal/components/dnd-container}/use-drag-and-drop-reorder.js +4 -4
  399. package/internal/components/dnd-container/use-drag-and-drop-reorder.js.map +1 -0
  400. package/internal/components/dnd-container/use-live-announcements.d.ts +11 -0
  401. package/internal/components/dnd-container/use-live-announcements.d.ts.map +1 -0
  402. package/{collection-preferences/content-display → internal/components/dnd-container}/use-live-announcements.js +6 -6
  403. package/internal/components/dnd-container/use-live-announcements.js.map +1 -0
  404. package/internal/components/dropdown/dropdown-fit-handler.d.ts +0 -30
  405. package/internal/components/dropdown/dropdown-fit-handler.d.ts.map +1 -1
  406. package/internal/components/dropdown/dropdown-fit-handler.js +4 -4
  407. package/internal/components/dropdown/dropdown-fit-handler.js.map +1 -1
  408. package/internal/components/dropdown/styles.css.js +20 -20
  409. package/internal/components/dropdown/styles.scoped.css +37 -40
  410. package/internal/components/dropdown/styles.selectors.js +20 -20
  411. package/internal/components/dropdown-footer/styles.css.js +3 -3
  412. package/internal/components/dropdown-footer/styles.scoped.css +3 -6
  413. package/internal/components/dropdown-footer/styles.selectors.js +3 -3
  414. package/internal/components/dropdown-status/styles.css.js +2 -2
  415. package/internal/components/dropdown-status/styles.scoped.css +2 -5
  416. package/internal/components/dropdown-status/styles.selectors.js +2 -2
  417. package/internal/components/focus-lock/utils.d.ts +0 -1
  418. package/internal/components/focus-lock/utils.d.ts.map +1 -1
  419. package/internal/components/focus-lock/utils.js +1 -1
  420. package/internal/components/focus-lock/utils.js.map +1 -1
  421. package/internal/components/masked-input/index.d.ts +1 -2
  422. package/internal/components/masked-input/index.d.ts.map +1 -1
  423. package/internal/components/masked-input/index.js +0 -1
  424. package/internal/components/masked-input/index.js.map +1 -1
  425. package/internal/components/masked-input/utils/mask-format.d.ts +1 -1
  426. package/internal/components/masked-input/utils/mask-format.d.ts.map +1 -1
  427. package/internal/components/masked-input/utils/mask-format.js.map +1 -1
  428. package/internal/components/menu-dropdown/styles.css.js +7 -7
  429. package/internal/components/menu-dropdown/styles.scoped.css +13 -16
  430. package/internal/components/menu-dropdown/styles.selectors.js +7 -7
  431. package/internal/components/option/highlight-match.d.ts +2 -1
  432. package/internal/components/option/highlight-match.d.ts.map +1 -1
  433. package/internal/components/option/highlight-match.js.map +1 -1
  434. package/internal/components/option/interfaces.d.ts +3 -2
  435. package/internal/components/option/interfaces.d.ts.map +1 -1
  436. package/internal/components/option/interfaces.js.map +1 -1
  437. package/internal/components/option/styles.css.js +17 -17
  438. package/internal/components/option/styles.scoped.css +29 -32
  439. package/internal/components/option/styles.selectors.js +17 -17
  440. package/internal/components/options-list/styles.css.js +3 -3
  441. package/internal/components/options-list/styles.scoped.css +3 -6
  442. package/internal/components/options-list/styles.selectors.js +3 -3
  443. package/internal/components/options-list/utils/use-highlight-option.d.ts +2 -1
  444. package/internal/components/options-list/utils/use-highlight-option.d.ts.map +1 -1
  445. package/internal/components/options-list/utils/use-highlight-option.js +2 -2
  446. package/internal/components/options-list/utils/use-highlight-option.js.map +1 -1
  447. package/internal/components/screenreader-only/index.d.ts +2 -1
  448. package/internal/components/screenreader-only/index.d.ts.map +1 -1
  449. package/internal/components/screenreader-only/index.js.map +1 -1
  450. package/internal/components/tab-trap/index.d.ts +2 -1
  451. package/internal/components/tab-trap/index.d.ts.map +1 -1
  452. package/internal/components/tab-trap/index.js.map +1 -1
  453. package/internal/components/token-list/styles.css.js +10 -10
  454. package/internal/components/token-list/styles.scoped.css +22 -25
  455. package/internal/components/token-list/styles.selectors.js +10 -10
  456. package/internal/components/transition/index.d.ts +2 -1
  457. package/internal/components/transition/index.d.ts.map +1 -1
  458. package/internal/components/transition/index.js.map +1 -1
  459. package/internal/context/single-tab-stop-navigation-context.d.ts +2 -4
  460. package/internal/context/single-tab-stop-navigation-context.d.ts.map +1 -1
  461. package/internal/context/single-tab-stop-navigation-context.js.map +1 -1
  462. package/internal/context/table-component-context.d.ts +2 -2
  463. package/internal/context/table-component-context.d.ts.map +1 -1
  464. package/internal/context/table-component-context.js +1 -1
  465. package/internal/context/table-component-context.js.map +1 -1
  466. package/internal/environment.js +1 -1
  467. package/internal/environment.json +1 -1
  468. package/internal/events/index.d.ts +1 -0
  469. package/internal/events/index.d.ts.map +1 -1
  470. package/internal/events/index.js +1 -0
  471. package/internal/events/index.js.map +1 -1
  472. package/internal/hooks/forward-focus/radio-group.d.ts +2 -1
  473. package/internal/hooks/forward-focus/radio-group.d.ts.map +1 -1
  474. package/internal/hooks/forward-focus/radio-group.js.map +1 -1
  475. package/internal/hooks/use-dynamic-overlap/index.d.ts +2 -1
  476. package/internal/hooks/use-dynamic-overlap/index.d.ts.map +1 -1
  477. package/internal/hooks/use-dynamic-overlap/index.js.map +1 -1
  478. package/internal/keycode.d.ts +1 -5
  479. package/internal/keycode.d.ts.map +1 -1
  480. package/internal/keycode.js +0 -4
  481. package/internal/keycode.js.map +1 -1
  482. package/internal/manifest.json +1 -1
  483. package/internal/plugins/controllers/action-buttons.d.ts +1 -1
  484. package/internal/plugins/controllers/action-buttons.d.ts.map +1 -1
  485. package/internal/plugins/controllers/action-buttons.js.map +1 -1
  486. package/internal/plugins/controllers/alert-flash-content.d.ts +3 -3
  487. package/internal/plugins/controllers/alert-flash-content.d.ts.map +1 -1
  488. package/internal/plugins/controllers/alert-flash-content.js.map +1 -1
  489. package/internal/plugins/controllers/app-layout-widget.d.ts +1 -1
  490. package/internal/plugins/controllers/app-layout-widget.d.ts.map +1 -1
  491. package/internal/plugins/controllers/app-layout-widget.js.map +1 -1
  492. package/internal/plugins/controllers/drawers.d.ts +4 -4
  493. package/internal/plugins/controllers/drawers.d.ts.map +1 -1
  494. package/internal/plugins/controllers/drawers.js.map +1 -1
  495. package/internal/utils/handle-key.d.ts +2 -1
  496. package/internal/utils/handle-key.d.ts.map +1 -1
  497. package/internal/utils/handle-key.js.map +1 -1
  498. package/internal/utils/throttle.d.ts +2 -1
  499. package/internal/utils/throttle.d.ts.map +1 -1
  500. package/internal/utils/throttle.js.map +1 -1
  501. package/key-value-pairs/styles.css.js +8 -8
  502. package/key-value-pairs/styles.scoped.css +9 -15
  503. package/key-value-pairs/styles.selectors.js +8 -8
  504. package/link/styles.css.js +20 -20
  505. package/link/styles.scoped.css +71 -74
  506. package/link/styles.selectors.js +20 -20
  507. package/live-region/internal.d.ts +1 -1
  508. package/live-region/internal.d.ts.map +1 -1
  509. package/live-region/internal.js.map +1 -1
  510. package/mixed-line-bar-chart/bar-groups.d.ts +2 -1
  511. package/mixed-line-bar-chart/bar-groups.d.ts.map +1 -1
  512. package/mixed-line-bar-chart/bar-groups.js.map +1 -1
  513. package/mixed-line-bar-chart/bar-series.d.ts +2 -1
  514. package/mixed-line-bar-chart/bar-series.d.ts.map +1 -1
  515. package/mixed-line-bar-chart/bar-series.js.map +1 -1
  516. package/mixed-line-bar-chart/data-series.d.ts +2 -1
  517. package/mixed-line-bar-chart/data-series.d.ts.map +1 -1
  518. package/mixed-line-bar-chart/data-series.js.map +1 -1
  519. package/mixed-line-bar-chart/interfaces.d.ts +0 -2
  520. package/mixed-line-bar-chart/interfaces.d.ts.map +1 -1
  521. package/mixed-line-bar-chart/interfaces.js.map +1 -1
  522. package/mixed-line-bar-chart/line-series.d.ts +2 -1
  523. package/mixed-line-bar-chart/line-series.d.ts.map +1 -1
  524. package/mixed-line-bar-chart/line-series.js.map +1 -1
  525. package/modal/index.d.ts.map +1 -1
  526. package/modal/index.js +8 -2
  527. package/modal/index.js.map +1 -1
  528. package/modal/internal.js +1 -1
  529. package/modal/internal.js.map +1 -1
  530. package/modal/styles.css.js +23 -23
  531. package/modal/styles.scoped.css +38 -44
  532. package/modal/styles.selectors.js +23 -23
  533. package/multiselect/analytics-metadata/interfaces.d.ts +0 -4
  534. package/multiselect/analytics-metadata/interfaces.d.ts.map +1 -1
  535. package/multiselect/analytics-metadata/interfaces.js.map +1 -1
  536. package/multiselect/styles.css.js +3 -3
  537. package/multiselect/styles.scoped.css +3 -9
  538. package/multiselect/styles.selectors.js +3 -3
  539. package/package.json +1 -1
  540. package/pagination/styles.css.js +9 -9
  541. package/pagination/styles.scoped.css +23 -26
  542. package/pagination/styles.selectors.js +9 -9
  543. package/pie-chart/interfaces.d.ts +2 -1
  544. package/pie-chart/interfaces.d.ts.map +1 -1
  545. package/pie-chart/interfaces.js.map +1 -1
  546. package/pie-chart/labels.d.ts +1 -1
  547. package/pie-chart/labels.d.ts.map +1 -1
  548. package/pie-chart/labels.js.map +1 -1
  549. package/pie-chart/pie-chart.d.ts +2 -7
  550. package/pie-chart/pie-chart.d.ts.map +1 -1
  551. package/pie-chart/pie-chart.js.map +1 -1
  552. package/popover/arrow.d.ts +1 -1
  553. package/popover/arrow.d.ts.map +1 -1
  554. package/popover/arrow.js.map +1 -1
  555. package/popover/body.d.ts.map +1 -1
  556. package/popover/body.js +0 -1
  557. package/popover/body.js.map +1 -1
  558. package/popover/container.d.ts +2 -1
  559. package/popover/container.d.ts.map +1 -1
  560. package/popover/container.js.map +1 -1
  561. package/popover/internal.d.ts +1 -0
  562. package/popover/internal.d.ts.map +1 -1
  563. package/popover/internal.js +2 -2
  564. package/popover/internal.js.map +1 -1
  565. package/popover/styles.css.js +53 -52
  566. package/popover/styles.scoped.css +71 -77
  567. package/popover/styles.selectors.js +53 -52
  568. package/progress-bar/styles.css.js +19 -19
  569. package/progress-bar/styles.scoped.css +30 -33
  570. package/progress-bar/styles.selectors.js +19 -19
  571. package/prompt-input/internal.d.ts +1 -1
  572. package/prompt-input/internal.d.ts.map +1 -1
  573. package/prompt-input/internal.js.map +1 -1
  574. package/prompt-input/styles.css.js +14 -14
  575. package/prompt-input/styles.scoped.css +39 -51
  576. package/prompt-input/styles.selectors.js +14 -14
  577. package/property-filter/analytics-metadata/interfaces.d.ts +0 -15
  578. package/property-filter/analytics-metadata/interfaces.d.ts.map +1 -1
  579. package/property-filter/analytics-metadata/interfaces.js.map +1 -1
  580. package/property-filter/controller.d.ts +0 -1
  581. package/property-filter/controller.d.ts.map +1 -1
  582. package/property-filter/controller.js +1 -1
  583. package/property-filter/controller.js.map +1 -1
  584. package/property-filter/filtering-token/styles.css.js +18 -18
  585. package/property-filter/filtering-token/styles.scoped.css +41 -44
  586. package/property-filter/filtering-token/styles.selectors.js +18 -18
  587. package/property-filter/interfaces.d.ts +1 -6
  588. package/property-filter/interfaces.d.ts.map +1 -1
  589. package/property-filter/interfaces.js.map +1 -1
  590. package/property-filter/internal.d.ts +0 -2
  591. package/property-filter/internal.d.ts.map +1 -1
  592. package/property-filter/internal.js.map +1 -1
  593. package/property-filter/styles.css.js +39 -39
  594. package/property-filter/styles.scoped.css +41 -47
  595. package/property-filter/styles.selectors.js +39 -39
  596. package/property-filter/utils.d.ts +0 -1
  597. package/property-filter/utils.d.ts.map +1 -1
  598. package/property-filter/utils.js +1 -1
  599. package/property-filter/utils.js.map +1 -1
  600. package/radio-group/styles.css.js +10 -10
  601. package/radio-group/styles.scoped.css +16 -19
  602. package/radio-group/styles.selectors.js +10 -10
  603. package/s3-resource-selector/s3-modal/basic-table.d.ts +0 -6
  604. package/s3-resource-selector/s3-modal/basic-table.d.ts.map +1 -1
  605. package/s3-resource-selector/s3-modal/basic-table.js +1 -1
  606. package/s3-resource-selector/s3-modal/basic-table.js.map +1 -1
  607. package/segmented-control/segment.d.ts +2 -1
  608. package/segmented-control/segment.d.ts.map +1 -1
  609. package/segmented-control/segment.js.map +1 -1
  610. package/segmented-control/styles.css.js +15 -15
  611. package/segmented-control/styles.scoped.css +34 -37
  612. package/segmented-control/styles.selectors.js +15 -15
  613. package/select/analytics-metadata/interfaces.d.ts +0 -4
  614. package/select/analytics-metadata/interfaces.d.ts.map +1 -1
  615. package/select/analytics-metadata/interfaces.js.map +1 -1
  616. package/select/styles.css.js +1 -1
  617. package/select/styles.scoped.css +1 -4
  618. package/select/styles.selectors.js +1 -1
  619. package/select/utils/render-options.d.ts +2 -1
  620. package/select/utils/render-options.d.ts.map +1 -1
  621. package/select/utils/render-options.js.map +1 -1
  622. package/select/utils/use-native-search.d.ts +0 -1
  623. package/select/utils/use-native-search.d.ts.map +1 -1
  624. package/select/utils/use-native-search.js +1 -1
  625. package/select/utils/use-native-search.js.map +1 -1
  626. package/side-navigation/analytics-metadata/interfaces.d.ts +0 -2
  627. package/side-navigation/analytics-metadata/interfaces.d.ts.map +1 -1
  628. package/side-navigation/analytics-metadata/interfaces.js.map +1 -1
  629. package/side-navigation/implementation.d.ts +2 -1
  630. package/side-navigation/implementation.d.ts.map +1 -1
  631. package/side-navigation/implementation.js.map +1 -1
  632. package/side-navigation/parts.d.ts +2 -2
  633. package/side-navigation/parts.d.ts.map +1 -1
  634. package/side-navigation/parts.js.map +1 -1
  635. package/side-navigation/styles.css.js +30 -30
  636. package/side-navigation/styles.scoped.css +46 -49
  637. package/side-navigation/styles.selectors.js +30 -30
  638. package/slider/internal.d.ts +2 -1
  639. package/slider/internal.d.ts.map +1 -1
  640. package/slider/internal.js.map +1 -1
  641. package/slider/slider-labels.d.ts +2 -1
  642. package/slider/slider-labels.d.ts.map +1 -1
  643. package/slider/slider-labels.js.map +1 -1
  644. package/slider/styles.css.js +26 -26
  645. package/slider/styles.scoped.css +76 -79
  646. package/slider/styles.selectors.js +26 -26
  647. package/slider/tick-marks.d.ts +2 -4
  648. package/slider/tick-marks.d.ts.map +1 -1
  649. package/slider/tick-marks.js.map +1 -1
  650. package/split-panel/bottom.d.ts.map +1 -1
  651. package/split-panel/bottom.js +13 -3
  652. package/split-panel/bottom.js.map +1 -1
  653. package/split-panel/implementation.js +1 -1
  654. package/split-panel/implementation.js.map +1 -1
  655. package/split-panel/styles.css.js +26 -26
  656. package/split-panel/styles.scoped.css +43 -51
  657. package/split-panel/styles.selectors.js +26 -26
  658. package/steps/internal.d.ts +1 -1
  659. package/steps/internal.d.ts.map +1 -1
  660. package/steps/internal.js +1 -1
  661. package/steps/internal.js.map +1 -1
  662. package/steps/styles.css.js +6 -6
  663. package/steps/styles.scoped.css +7 -10
  664. package/steps/styles.selectors.js +6 -6
  665. package/table/expandable-rows/styles.css.js +3 -3
  666. package/table/expandable-rows/styles.scoped.css +13 -16
  667. package/table/expandable-rows/styles.selectors.js +3 -3
  668. package/table/interfaces.d.ts +3 -2
  669. package/table/interfaces.d.ts.map +1 -1
  670. package/table/interfaces.js.map +1 -1
  671. package/table/internal.js +2 -2
  672. package/table/internal.js.map +1 -1
  673. package/table/progressive-loading/loader-cell.d.ts +2 -1
  674. package/table/progressive-loading/loader-cell.d.ts.map +1 -1
  675. package/table/progressive-loading/loader-cell.js.map +1 -1
  676. package/table/resizer/styles.css.js +8 -8
  677. package/table/resizer/styles.scoped.css +15 -18
  678. package/table/resizer/styles.selectors.js +8 -8
  679. package/table/selection/utils.d.ts +0 -1
  680. package/table/selection/utils.d.ts.map +1 -1
  681. package/table/selection/utils.js +1 -1
  682. package/table/selection/utils.js.map +1 -1
  683. package/table/sticky-columns/use-sticky-columns.d.ts +1 -21
  684. package/table/sticky-columns/use-sticky-columns.d.ts.map +1 -1
  685. package/table/sticky-columns/use-sticky-columns.js +1 -1
  686. package/table/sticky-columns/use-sticky-columns.js.map +1 -1
  687. package/table/sticky-scrollbar/sticky-scrollbar.d.ts.map +1 -1
  688. package/table/sticky-scrollbar/sticky-scrollbar.js +6 -2
  689. package/table/sticky-scrollbar/sticky-scrollbar.js.map +1 -1
  690. package/table/sticky-scrollbar/styles.css.js +6 -6
  691. package/table/sticky-scrollbar/styles.scoped.css +10 -7
  692. package/table/sticky-scrollbar/styles.selectors.js +6 -6
  693. package/table/table-role/grid-navigation.js +10 -0
  694. package/table/table-role/grid-navigation.js.map +1 -1
  695. package/table/table-role/index.d.ts +1 -1
  696. package/table/table-role/index.d.ts.map +1 -1
  697. package/table/table-role/index.js.map +1 -1
  698. package/table/use-cell-editing.d.ts +1 -1
  699. package/table/use-cell-editing.d.ts.map +1 -1
  700. package/table/use-cell-editing.js.map +1 -1
  701. package/tabs/styles.css.js +28 -28
  702. package/tabs/styles.scoped.css +49 -52
  703. package/tabs/styles.selectors.js +28 -28
  704. package/tabs/tab-header-bar.d.ts +2 -1
  705. package/tabs/tab-header-bar.d.ts.map +1 -1
  706. package/tabs/tab-header-bar.js.map +1 -1
  707. package/tag-editor/internal.d.ts +2 -1
  708. package/tag-editor/internal.d.ts.map +1 -1
  709. package/tag-editor/internal.js.map +1 -1
  710. package/test-utils/dom/anchor-navigation/index.d.ts +2 -1
  711. package/test-utils/dom/anchor-navigation/index.js +0 -2
  712. package/test-utils/dom/anchor-navigation/index.js.map +1 -1
  713. package/test-utils/dom/autosuggest/index.d.ts +0 -3
  714. package/test-utils/dom/autosuggest/index.js +1 -2
  715. package/test-utils/dom/autosuggest/index.js.map +1 -1
  716. package/test-utils/dom/cards/index.d.ts +3 -2
  717. package/test-utils/dom/cards/index.js +0 -3
  718. package/test-utils/dom/cards/index.js.map +1 -1
  719. package/test-utils/dom/key-value-pairs/index.d.ts +3 -2
  720. package/test-utils/dom/key-value-pairs/index.js +0 -3
  721. package/test-utils/dom/key-value-pairs/index.js.map +1 -1
  722. package/test-utils/dom/steps/index.d.ts +2 -1
  723. package/test-utils/dom/steps/index.js +0 -2
  724. package/test-utils/dom/steps/index.js.map +1 -1
  725. package/test-utils/dom/tabs/index.d.ts +2 -1
  726. package/test-utils/dom/tabs/index.js +0 -2
  727. package/test-utils/dom/tabs/index.js.map +1 -1
  728. package/test-utils/dom/tag-editor/index.d.ts +2 -1
  729. package/test-utils/dom/tag-editor/index.js +0 -2
  730. package/test-utils/dom/tag-editor/index.js.map +1 -1
  731. package/test-utils/selectors/anchor-navigation/index.d.ts +2 -1
  732. package/test-utils/selectors/anchor-navigation/index.js +0 -2
  733. package/test-utils/selectors/anchor-navigation/index.js.map +1 -1
  734. package/test-utils/selectors/autosuggest/index.d.ts +0 -3
  735. package/test-utils/selectors/autosuggest/index.js +1 -2
  736. package/test-utils/selectors/autosuggest/index.js.map +1 -1
  737. package/test-utils/selectors/cards/index.d.ts +3 -2
  738. package/test-utils/selectors/cards/index.js +0 -3
  739. package/test-utils/selectors/cards/index.js.map +1 -1
  740. package/test-utils/selectors/key-value-pairs/index.d.ts +3 -2
  741. package/test-utils/selectors/key-value-pairs/index.js +0 -3
  742. package/test-utils/selectors/key-value-pairs/index.js.map +1 -1
  743. package/test-utils/selectors/steps/index.d.ts +2 -1
  744. package/test-utils/selectors/steps/index.js +0 -2
  745. package/test-utils/selectors/steps/index.js.map +1 -1
  746. package/test-utils/selectors/tabs/index.d.ts +2 -1
  747. package/test-utils/selectors/tabs/index.js +0 -2
  748. package/test-utils/selectors/tabs/index.js.map +1 -1
  749. package/test-utils/selectors/tag-editor/index.d.ts +2 -1
  750. package/test-utils/selectors/tag-editor/index.js +0 -2
  751. package/test-utils/selectors/tag-editor/index.js.map +1 -1
  752. package/test-utils/tsconfig.tsbuildinfo +1 -1
  753. package/text-content/styles.css.js +1 -1
  754. package/text-content/styles.scoped.css +60 -63
  755. package/text-content/styles.selectors.js +1 -1
  756. package/text-filter/analytics-metadata/interfaces.d.ts +0 -2
  757. package/text-filter/analytics-metadata/interfaces.d.ts.map +1 -1
  758. package/text-filter/analytics-metadata/interfaces.js.map +1 -1
  759. package/text-filter/styles.css.js +3 -3
  760. package/text-filter/styles.scoped.css +3 -6
  761. package/text-filter/styles.selectors.js +3 -3
  762. package/textarea/styles.css.js +5 -5
  763. package/textarea/styles.scoped.css +14 -17
  764. package/textarea/styles.selectors.js +5 -5
  765. package/tiles/styles.css.js +30 -30
  766. package/tiles/styles.scoped.css +71 -77
  767. package/tiles/styles.selectors.js +30 -30
  768. package/toggle/styles.css.js +10 -10
  769. package/toggle/styles.scoped.css +17 -20
  770. package/toggle/styles.selectors.js +10 -10
  771. package/toggle-button/internal.d.ts +0 -1
  772. package/toggle-button/internal.d.ts.map +1 -1
  773. package/toggle-button/internal.js +0 -1
  774. package/toggle-button/internal.js.map +1 -1
  775. package/token-group/analytics-metadata/interfaces.d.ts +0 -2
  776. package/token-group/analytics-metadata/interfaces.d.ts.map +1 -1
  777. package/token-group/analytics-metadata/interfaces.js.map +1 -1
  778. package/token-group/styles.css.js +8 -8
  779. package/token-group/styles.scoped.css +16 -19
  780. package/token-group/styles.selectors.js +8 -8
  781. package/top-navigation/1.0-beta/internal.d.ts +2 -1
  782. package/top-navigation/1.0-beta/internal.d.ts.map +1 -1
  783. package/top-navigation/1.0-beta/internal.js.map +1 -1
  784. package/top-navigation/1.0-beta/parts/overflow-menu.d.ts +2 -1
  785. package/top-navigation/1.0-beta/parts/overflow-menu.d.ts.map +1 -1
  786. package/top-navigation/1.0-beta/parts/overflow-menu.js.map +1 -1
  787. package/top-navigation/1.0-beta/styles.css.js +25 -25
  788. package/top-navigation/1.0-beta/styles.scoped.css +42 -45
  789. package/top-navigation/1.0-beta/styles.selectors.js +25 -25
  790. package/top-navigation/1.0-beta/use-top-navigation.d.ts +4 -24
  791. package/top-navigation/1.0-beta/use-top-navigation.d.ts.map +1 -1
  792. package/top-navigation/1.0-beta/use-top-navigation.js +2 -2
  793. package/top-navigation/1.0-beta/use-top-navigation.js.map +1 -1
  794. package/top-navigation/internal.d.ts +2 -1
  795. package/top-navigation/internal.d.ts.map +1 -1
  796. package/top-navigation/internal.js.map +1 -1
  797. package/top-navigation/parts/overflow-menu/router.d.ts +1 -10
  798. package/top-navigation/parts/overflow-menu/router.d.ts.map +1 -1
  799. package/top-navigation/parts/overflow-menu/router.js +1 -1
  800. package/top-navigation/parts/overflow-menu/router.js.map +1 -1
  801. package/top-navigation/styles.css.js +47 -47
  802. package/top-navigation/styles.scoped.css +66 -75
  803. package/top-navigation/styles.selectors.js +47 -47
  804. package/top-navigation/use-top-navigation.d.ts +4 -3
  805. package/top-navigation/use-top-navigation.d.ts.map +1 -1
  806. package/top-navigation/use-top-navigation.js.map +1 -1
  807. package/tutorial-panel/components/tutorial-detail-view/styles.css.js +20 -20
  808. package/tutorial-panel/components/tutorial-detail-view/styles.scoped.css +21 -24
  809. package/tutorial-panel/components/tutorial-detail-view/styles.selectors.js +20 -20
  810. package/tutorial-panel/components/tutorial-detail-view/task-list.d.ts +2 -1
  811. package/tutorial-panel/components/tutorial-detail-view/task-list.d.ts.map +1 -1
  812. package/tutorial-panel/components/tutorial-detail-view/task-list.js.map +1 -1
  813. package/tutorial-panel/components/tutorial-list/index.d.ts +2 -1
  814. package/tutorial-panel/components/tutorial-list/index.d.ts.map +1 -1
  815. package/tutorial-panel/components/tutorial-list/index.js.map +1 -1
  816. package/tutorial-panel/components/tutorial-list/styles.css.js +18 -18
  817. package/tutorial-panel/components/tutorial-list/styles.scoped.css +27 -36
  818. package/tutorial-panel/components/tutorial-list/styles.selectors.js +18 -18
  819. package/tutorial-panel/styles.css.js +1 -1
  820. package/tutorial-panel/styles.scoped.css +1 -4
  821. package/tutorial-panel/styles.selectors.js +1 -1
  822. package/wizard/analytics-metadata/interfaces.d.ts +0 -21
  823. package/wizard/analytics-metadata/interfaces.d.ts.map +1 -1
  824. package/wizard/analytics-metadata/interfaces.js.map +1 -1
  825. package/wizard/styles.css.js +30 -30
  826. package/wizard/styles.scoped.css +58 -61
  827. package/wizard/styles.selectors.js +30 -30
  828. package/wizard/wizard-form.d.ts +1 -4
  829. package/wizard/wizard-form.d.ts.map +1 -1
  830. package/wizard/wizard-form.js +1 -1
  831. package/wizard/wizard-form.js.map +1 -1
  832. package/app-layout/split-panel/split-panel-utils.d.ts +0 -12
  833. package/app-layout/split-panel/split-panel-utils.d.ts.map +0 -1
  834. package/app-layout/split-panel/split-panel-utils.js +0 -28
  835. package/app-layout/split-panel/split-panel-utils.js.map +0 -1
  836. package/collection-preferences/content-display/draggable-option.d.ts +0 -9
  837. package/collection-preferences/content-display/draggable-option.d.ts.map +0 -1
  838. package/collection-preferences/content-display/draggable-option.js +0 -27
  839. package/collection-preferences/content-display/draggable-option.js.map +0 -1
  840. package/collection-preferences/content-display/keyboard-sensor/defaults.d.ts.map +0 -1
  841. package/collection-preferences/content-display/keyboard-sensor/defaults.js.map +0 -1
  842. package/collection-preferences/content-display/keyboard-sensor/index.d.ts.map +0 -1
  843. package/collection-preferences/content-display/keyboard-sensor/index.js.map +0 -1
  844. package/collection-preferences/content-display/keyboard-sensor/utilities/events.d.ts +0 -11
  845. package/collection-preferences/content-display/keyboard-sensor/utilities/events.d.ts.map +0 -1
  846. package/collection-preferences/content-display/keyboard-sensor/utilities/events.js.map +0 -1
  847. package/collection-preferences/content-display/keyboard-sensor/utilities/listeners.d.ts.map +0 -1
  848. package/collection-preferences/content-display/keyboard-sensor/utilities/listeners.js.map +0 -1
  849. package/collection-preferences/content-display/keyboard-sensor/utilities/scroll.d.ts +0 -30
  850. package/collection-preferences/content-display/keyboard-sensor/utilities/scroll.d.ts.map +0 -1
  851. package/collection-preferences/content-display/keyboard-sensor/utilities/scroll.js.map +0 -1
  852. package/collection-preferences/content-display/use-drag-and-drop-reorder.d.ts.map +0 -1
  853. package/collection-preferences/content-display/use-drag-and-drop-reorder.js.map +0 -1
  854. package/collection-preferences/content-display/use-live-announcements.d.ts +0 -12
  855. package/collection-preferences/content-display/use-live-announcements.d.ts.map +0 -1
  856. package/collection-preferences/content-display/use-live-announcements.js.map +0 -1
  857. package/internal/hooks/use-mutation-observer/index.d.ts +0 -8
  858. package/internal/hooks/use-mutation-observer/index.d.ts.map +0 -1
  859. package/internal/hooks/use-mutation-observer/index.js +0 -26
  860. package/internal/hooks/use-mutation-observer/index.js.map +0 -1
  861. /package/{collection-preferences/content-display → internal/components/dnd-container}/keyboard-sensor/defaults.d.ts +0 -0
  862. /package/{collection-preferences/content-display → internal/components/dnd-container}/keyboard-sensor/defaults.js +0 -0
  863. /package/{collection-preferences/content-display → internal/components/dnd-container}/keyboard-sensor/index.d.ts +0 -0
  864. /package/{collection-preferences/content-display → internal/components/dnd-container}/keyboard-sensor/utilities/listeners.d.ts +0 -0
  865. /package/{collection-preferences/content-display → internal/components/dnd-container}/keyboard-sensor/utilities/listeners.js +0 -0
@@ -1 +1 @@
1
- {"version":3,"file":"bar-series.js","sourceRoot":"","sources":["../../../src/mixed-line-bar-chart/bar-series.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,IAAI,MAAM,MAAM,CAAC;AAGxB,OAAO,EAAE,gBAAgB,EAAE,MAAM,mCAAmC,CAAC;AAErE,OAAO,EAAE,4BAA4B,EAAE,MAAM,qCAAqC,CAAC;AAEnF,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAoB,MAAM,SAAS,CAAC;AAElE,OAAO,MAAM,MAAM,iBAAiB,CAAC;AA2BrC,MAAM,CAAC,OAAO,UAAU,SAAS,CAA2B,EAC1D,IAAI,EACJ,MAAM,EACN,KAAK,EACL,MAAM,EACN,MAAM,EACN,WAAW,EACX,MAAM,EACN,qBAAqB,EACrB,gBAAgB,EAChB,WAAW,EACX,QAAQ,EACR,iBAAiB,EACjB,gBAAgB,EAChB,KAAK,GACa;IAClB,MAAM,SAAS,GAAG,gBAAgB,EAAE,CAAC;IACrC,MAAM,SAAS,GAAG,CAAC,CAAC,gBAAgB,CAAC;IACrC,MAAM,UAAU,GAAG,IAAI,KAAK,GAAG,CAAC;IAEhC,MAAM,YAAY,GAAG,CAAC,GAAG,EAAE;;QACzB,IAAI,MAAM,CAAC,IAAI,KAAK,KAAK,IAAI,CAAC,MAAM,CAAC,aAAa,EAAE,EAAE;YACp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IAAE,EAAE,EAAE,EAAE,IAAI,CAAC;SAChE;QACD,IAAI,IAAI,KAAK,MAAM,EAAE;YACnB,OAAO,4CAAM,GAAG,EAAE,CAAC,IAAM,SAAS,EAAM,UAAU,IAAE,EAAE,EAAE,CAAC,IAAI,CAAC;SAC/D;QACD,OAAO,4CAAM,GAAG,EAAE,CAAC,EAAE,CAAC,EAAE,4BAA4B,CAAC,SAAS,EAAE,EAAE,EAAE,IAAI,CAAC,IAAM,UAAU,EAAI,CAAC;IAChG,CAAC,CAAC,CACA,CACL,CAAC;AACJ,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\nimport clsx from 'clsx';\n\nimport { ChartScale, NumericChartScale } from '../internal/components/cartesian-chart/scales';\nimport { useVisualRefresh } from '../internal/hooks/use-visual-mode';\nimport { ScaleContinuousNumeric, ScaleTime } from '../internal/vendor/d3-scale';\nimport { createOneSideRoundedRectPath } from './create-one-side-rounded-rect-path';\nimport { ChartDataTypes, MixedLineBarChartProps } from './interfaces';\nimport { getKeyValue, matchesX, StackedBarValues } from './utils';\n\nimport styles from './styles.css.js';\n\nexport interface BarSeriesProps<T> {\n axis: 'x' | 'y';\n\n series: MixedLineBarChartProps.BarDataSeries<T>;\n\n color: string;\n totalSeriesCount: number;\n seriesIndex: number;\n\n xScale: ChartScale;\n yScale: NumericChartScale;\n\n plotSize: number;\n chartAreaClipPath: string;\n\n highlighted: boolean;\n dimmed: boolean;\n highlightedGroupIndex: number | null;\n\n // Contains values to be used for stacked bars.\n stackedBarValues?: StackedBarValues;\n\n isRtl?: boolean;\n}\n\nexport default function BarSeries<T extends ChartDataTypes>({\n axis,\n series,\n color,\n xScale,\n yScale,\n highlighted,\n dimmed,\n highlightedGroupIndex,\n totalSeriesCount,\n seriesIndex,\n plotSize,\n chartAreaClipPath,\n stackedBarValues,\n isRtl,\n}: BarSeriesProps<T>) {\n const isRefresh = useVisualRefresh();\n const isStacked = !!stackedBarValues;\n const isVertical = axis === 'x';\n\n const xCoordinates = (() => {\n if (series.type !== 'bar' || !xScale.isCategorical()) {\n return [];\n }\n\n const yContinuosScale: ScaleContinuousNumeric<number, number> | ScaleTime<number, number> = yScale.d3Scale;\n const xPoints = (series.data as ReadonlyArray<MixedLineBarChartProps.Datum<ChartDataTypes>>).map(\n ({ x }) => xScale.d3Scale(x) || NaN\n );\n\n const zeroY = yScale.d3Scale(0) ?? NaN;\n const baseY = isFinite(zeroY) ? Math.min(plotSize, zeroY) : plotSize;\n\n let barWidth = xScale.d3Scale.bandwidth();\n\n const PADDING = 4;\n const MINWIDTH = 4;\n\n if (!isStacked && totalSeriesCount > 1) {\n // Regular grouped bars\n barWidth = (barWidth - (totalSeriesCount - 1) * PADDING) / totalSeriesCount;\n barWidth = Math.max(barWidth, MINWIDTH);\n }\n\n return xPoints.map((x, i) => {\n const d = series.data[i];\n const key = getKeyValue(d.x);\n let barX = x;\n let yValue = d.y;\n let isRoundedStart = !isStacked;\n let isRoundedEnd = !isStacked;\n\n // Stacked bars\n if (isStacked) {\n const allXValues = stackedBarValues.get(key) ?? new Map();\n yValue = allXValues.get(seriesIndex) ?? 0;\n const allXValuesSorted = Array.from(allXValues.values()).sort((a, b) => a - b);\n isRoundedStart = yValue === allXValuesSorted[0];\n isRoundedEnd = yValue === allXValuesSorted[allXValuesSorted.length - 1];\n }\n // Regular grouped bars\n else if (totalSeriesCount > 1) {\n barX += seriesIndex * (barWidth + PADDING);\n }\n\n // Account for negative values growing \"down\" instead of \"up\"\n yValue = yValue < 0 ? yValue - d.y : yValue;\n\n return {\n x: barX,\n y: yContinuosScale(yValue) ?? NaN,\n width: barWidth,\n height: Math.abs((yContinuosScale(d.y) ?? NaN) - baseY),\n isRoundedStart,\n isRoundedEnd,\n };\n });\n })();\n\n const highlightedXValue = highlightedGroupIndex !== null ? xScale.domain[highlightedGroupIndex] : null;\n\n return (\n <g\n aria-label={series.title}\n clipPath={`url(#${chartAreaClipPath})`}\n className={clsx(styles.series, styles['series--bar'], {\n [styles['series--highlighted']]: highlighted,\n [styles['series--dimmed']]: dimmed,\n })}\n >\n {xCoordinates.map(({ x, y, width, height, isRoundedStart, isRoundedEnd }, i) => {\n if (!isFinite(x) || !isFinite(height)) {\n return;\n }\n\n // Create margins between stacked series but only when series data is not too small.\n const baseHeightOffset = isStacked ? 3 : 0;\n const isSmallBar = height < 4;\n const heightOffset = isSmallBar ? 0 : baseHeightOffset;\n const widthOffset = 2;\n\n const rx = isRefresh ? (isSmallBar ? 2 : 4) : 0;\n const placement = isVertical\n ? {\n x: x + widthOffset / 2,\n y: y + heightOffset / 2,\n width: width - widthOffset,\n height: height - heightOffset,\n }\n : {\n x: y - (!isRtl ? height : 0) + heightOffset / 2,\n y: x + widthOffset / 2,\n width: height - heightOffset,\n height: width - widthOffset,\n };\n\n const className = clsx(styles.series__rect, {\n [styles['series--dimmed']]: highlightedXValue !== null && !matchesX(highlightedXValue, series.data[i].x),\n });\n const styleProps = { fill: color, className };\n\n let side: 'left' | 'right' | 'top' | 'bottom' | 'all' | 'none' = 'none';\n if (isRoundedStart && isRoundedEnd) {\n side = 'all';\n } else if (!isRoundedStart && !isRoundedEnd) {\n side = 'none';\n } else if (isVertical) {\n side = isRoundedStart ? 'bottom' : 'top';\n } else if (!isRtl) {\n side = isRoundedStart ? 'left' : 'right';\n } else {\n side = isRoundedStart ? 'right' : 'left';\n }\n\n if (side === 'all') {\n return <rect key={i} {...placement} {...styleProps} rx={rx} />;\n }\n if (side === 'none') {\n return <rect key={i} {...placement} {...styleProps} rx={0} />;\n }\n return <path key={i} d={createOneSideRoundedRectPath(placement, rx, side)} {...styleProps} />;\n })}\n </g>\n );\n}\n"]}
1
+ {"version":3,"file":"bar-series.js","sourceRoot":"","sources":["../../../src/mixed-line-bar-chart/bar-series.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OA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I,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;SACzG,CAAC,CAAC;QACH,MAAM,UAAU,GAAG,EAAE,IAAI,EAAE,KAAK,EAAE,SAAS,EAAE,CAAC;QAE9C,IAAI,IAAI,GAAyD,MAAM,CAAC;QACxE,IAAI,cAAc,IAAI,YAAY,EAAE;YAClC,IAAI,GAAG,KAAK,CAAC;SACd;aAAM,IAAI,CAAC,cAAc,IAAI,CAAC,YAAY,EAAE;YAC3C,IAAI,GAAG,MAAM,CAAC;SACf;aAAM,IAAI,UAAU,EAAE;YACrB,IAAI,GAAG,cAAc,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC;SAC1C;aAAM,IAAI,CAAC,KAAK,EAAE;YACjB,IAAI,GAAG,cAAc,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,CAAC;SAC1C;aAAM;YACL,IAAI,GAAG,cAAc,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC;SAC1C;QAED,IAAI,IAAI,KAAK,KAAK,EAAE;YAClB,OAAO,4CAAM,GAAG,EAAE,CAAC,IAAM,SAAS,EAAM,UAAU,IAAE,EAAE,EAAE,EAAE,IAAI,CAAC;SAChE;QACD,IAAI,IAAI,KAAK,MAAM,EAAE;YACnB,OAAO,4CAAM,GAAG,EAAE,CAAC,IAAM,SAAS,EAAM,UAAU,IAAE,EAAE,EAAE,CAAC,IAAI,CAAC;SAC/D;QACD,OAAO,4CAAM,GAAG,EAAE,CAAC,EAAE,CAAC,EAAE,4BAA4B,CAAC,SAAS,EAAE,EAAE,EAAE,IAAI,CAAC,IAAM,UAAU,EAAI,CAAC;IAChG,CAAC,CAAC,CACA,CACL,CAAC;AACJ,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\nimport clsx from 'clsx';\n\nimport { ChartScale, NumericChartScale } from '../internal/components/cartesian-chart/scales';\nimport { useVisualRefresh } from '../internal/hooks/use-visual-mode';\nimport { ScaleContinuousNumeric, ScaleTime } from '../internal/vendor/d3-scale';\nimport { createOneSideRoundedRectPath } from './create-one-side-rounded-rect-path';\nimport { ChartDataTypes, MixedLineBarChartProps } from './interfaces';\nimport { getKeyValue, matchesX, StackedBarValues } from './utils';\n\nimport styles from './styles.css.js';\n\ninterface BarSeriesProps<T> {\n axis: 'x' | 'y';\n\n series: MixedLineBarChartProps.BarDataSeries<T>;\n\n color: string;\n totalSeriesCount: number;\n seriesIndex: number;\n\n xScale: ChartScale;\n yScale: NumericChartScale;\n\n plotSize: number;\n chartAreaClipPath: string;\n\n highlighted: boolean;\n dimmed: boolean;\n highlightedGroupIndex: number | null;\n\n // Contains values to be used for stacked bars.\n stackedBarValues?: StackedBarValues;\n\n isRtl?: boolean;\n}\n\nexport default function BarSeries<T extends ChartDataTypes>({\n axis,\n series,\n color,\n xScale,\n yScale,\n highlighted,\n dimmed,\n highlightedGroupIndex,\n totalSeriesCount,\n seriesIndex,\n plotSize,\n chartAreaClipPath,\n stackedBarValues,\n isRtl,\n}: BarSeriesProps<T>) {\n const isRefresh = useVisualRefresh();\n const isStacked = !!stackedBarValues;\n const isVertical = axis === 'x';\n\n const xCoordinates = (() => {\n if (series.type !== 'bar' || !xScale.isCategorical()) {\n return [];\n }\n\n const yContinuosScale: ScaleContinuousNumeric<number, number> | ScaleTime<number, number> = yScale.d3Scale;\n const xPoints = (series.data as ReadonlyArray<MixedLineBarChartProps.Datum<ChartDataTypes>>).map(\n ({ x }) => xScale.d3Scale(x) || NaN\n );\n\n const zeroY = yScale.d3Scale(0) ?? NaN;\n const baseY = isFinite(zeroY) ? Math.min(plotSize, zeroY) : plotSize;\n\n let barWidth = xScale.d3Scale.bandwidth();\n\n const PADDING = 4;\n const MINWIDTH = 4;\n\n if (!isStacked && totalSeriesCount > 1) {\n // Regular grouped bars\n barWidth = (barWidth - (totalSeriesCount - 1) * PADDING) / totalSeriesCount;\n barWidth = Math.max(barWidth, MINWIDTH);\n }\n\n return xPoints.map((x, i) => {\n const d = series.data[i];\n const key = getKeyValue(d.x);\n let barX = x;\n let yValue = d.y;\n let isRoundedStart = !isStacked;\n let isRoundedEnd = !isStacked;\n\n // Stacked bars\n if (isStacked) {\n const allXValues = stackedBarValues.get(key) ?? new Map();\n yValue = allXValues.get(seriesIndex) ?? 0;\n const allXValuesSorted = Array.from(allXValues.values()).sort((a, b) => a - b);\n isRoundedStart = yValue === allXValuesSorted[0];\n isRoundedEnd = yValue === allXValuesSorted[allXValuesSorted.length - 1];\n }\n // Regular grouped bars\n else if (totalSeriesCount > 1) {\n barX += seriesIndex * (barWidth + PADDING);\n }\n\n // Account for negative values growing \"down\" instead of \"up\"\n yValue = yValue < 0 ? yValue - d.y : yValue;\n\n return {\n x: barX,\n y: yContinuosScale(yValue) ?? NaN,\n width: barWidth,\n height: Math.abs((yContinuosScale(d.y) ?? NaN) - baseY),\n isRoundedStart,\n isRoundedEnd,\n };\n });\n })();\n\n const highlightedXValue = highlightedGroupIndex !== null ? xScale.domain[highlightedGroupIndex] : null;\n\n return (\n <g\n aria-label={series.title}\n clipPath={`url(#${chartAreaClipPath})`}\n className={clsx(styles.series, styles['series--bar'], {\n [styles['series--highlighted']]: highlighted,\n [styles['series--dimmed']]: dimmed,\n })}\n >\n {xCoordinates.map(({ x, y, width, height, isRoundedStart, isRoundedEnd }, i) => {\n if (!isFinite(x) || !isFinite(height)) {\n return;\n }\n\n // Create margins between stacked series but only when series data is not too small.\n const baseHeightOffset = isStacked ? 3 : 0;\n const isSmallBar = height < 4;\n const heightOffset = isSmallBar ? 0 : baseHeightOffset;\n const widthOffset = 2;\n\n const rx = isRefresh ? (isSmallBar ? 2 : 4) : 0;\n const placement = isVertical\n ? {\n x: x + widthOffset / 2,\n y: y + heightOffset / 2,\n width: width - widthOffset,\n height: height - heightOffset,\n }\n : {\n x: y - (!isRtl ? height : 0) + heightOffset / 2,\n y: x + widthOffset / 2,\n width: height - heightOffset,\n height: width - widthOffset,\n };\n\n const className = clsx(styles.series__rect, {\n [styles['series--dimmed']]: highlightedXValue !== null && !matchesX(highlightedXValue, series.data[i].x),\n });\n const styleProps = { fill: color, className };\n\n let side: 'left' | 'right' | 'top' | 'bottom' | 'all' | 'none' = 'none';\n if (isRoundedStart && isRoundedEnd) {\n side = 'all';\n } else if (!isRoundedStart && !isRoundedEnd) {\n side = 'none';\n } else if (isVertical) {\n side = isRoundedStart ? 'bottom' : 'top';\n } else if (!isRtl) {\n side = isRoundedStart ? 'left' : 'right';\n } else {\n side = isRoundedStart ? 'right' : 'left';\n }\n\n if (side === 'all') {\n return <rect key={i} {...placement} {...styleProps} rx={rx} />;\n }\n if (side === 'none') {\n return <rect key={i} {...placement} {...styleProps} rx={0} />;\n }\n return <path key={i} d={createOneSideRoundedRectPath(placement, rx, side)} {...styleProps} />;\n })}\n </g>\n );\n}\n"]}
@@ -1,7 +1,7 @@
1
1
  /// <reference types="react" />
2
2
  import { ChartScale, NumericChartScale } from '../internal/components/cartesian-chart/scales';
3
3
  import { ChartDataTypes, InternalChartSeries, MixedLineBarChartProps } from './interfaces';
4
- export interface DataSeriesProps<T> {
4
+ interface DataSeriesProps<T> {
5
5
  axis: 'x' | 'y';
6
6
  plotHeight: number;
7
7
  plotWidth: number;
@@ -15,4 +15,5 @@ export interface DataSeriesProps<T> {
15
15
  isRtl?: boolean;
16
16
  }
17
17
  export default function DataSeries<T extends ChartDataTypes>({ axis, plotHeight, plotWidth, highlightedGroupIndex, highlightedSeries, stackedBars, isGroupNavigation, visibleSeries, xScale, yScale, isRtl, }: DataSeriesProps<T>): JSX.Element;
18
+ export {};
18
19
  //# sourceMappingURL=data-series.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"data-series.d.ts","sourceRoot":"","sources":["../../../src/mixed-line-bar-chart/data-series.tsx"],"names":[],"mappings":";AAKA,OAAO,EAAE,UAAU,EAAE,iBAAiB,EAAE,MAAM,+CAA+C,CAAC;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AC,CAAC,CAAC,GAAG,IAAI,CAAC;IAChE,qBAAqB,EAAE,MAAM,GAAG,IAAI,CAAC;IAErC,WAAW,EAAE,OAAO,CAAC;IACrB,iBAAiB,EAAE,OAAO,CAAC;IAE3B,aAAa,EAAE,aAAa,CAAC,mBAAmB,CAAC,CAAC,CAAC,CAAC,CAAC;IACrD,MAAM,EAAE,UAAU,CAAC;IACnB,MAAM,EAAE,iBAAiB,CAAC;IAC1B,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AAED,MAAM,CAAC,OAAO,UAAU,UAAU,CAAC,CAAC,SAAS,cAAc,EAAE,EAC3D,IAAI,EACJ,UAAU,EACV,SAAS,EACT,qBAAqB,EACrB,iBAAiB,EACjB,WAAW,EACX,iBAAiB,EACjB,aAAa,EACb,MAAM,EACN,MAAM,EACN,KAAK,GACN,EAAE,eAAe,CAAC,CAAC,CAAC,eAsFpB"}
@@ -1 +1 @@
1
- {"version":3,"file":"data-series.js","sourceRoot":"","sources":["../../../src/mixed-line-bar-chart/data-series.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,IAAI,MAAM,MAAM,CAAC;AAGxB,OAAO,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAC;AAC9D,OAAO,SAAS,MAAM,cAAc,CAAC;AAErC,OAAO,UAAU,MAAM,eAAe,CAAC;AACvC,OAAO,EAAE,yBAAyB,EAAE,MAAM,SAAS,CAAC;AAEpD,OAAO,MAAM,MAAM,iBAAiB,CAAC;AAErC,qEAAqE;AACrE,MAAM,YAAY,GAAG,CAAC,CAAC;AAoBvB,MAAM,CAAC,OAAO,UAAU,UAAU,CAA2B,EAC3D,IAAI,EACJ,UAAU,EACV,SAAS,EACT,qBAAqB,EACrB,iBAAiB,EACjB,WAAW,EACX,iBAAiB,EACjB,aAAa,EACb,MAAM,EACN,MAAM,EACN,KAAK,GACc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BAAgB,EAAE,gBAAgB,EAClC,qBAAqB,EAAE,qBAAqB,EAC5C,KAAK,EAAE,KAAK,GACZ,CACH,CAAC;aACL;QACH,CAAC,CAAC,CACA,CACH,CACJ,CAAC;AACJ,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useMemo } from 'react';\nimport clsx from 'clsx';\n\nimport { ChartScale, NumericChartScale } from '../internal/components/cartesian-chart/scales';\nimport { useUniqueId } from '../internal/hooks/use-unique-id';\nimport BarSeries from './bar-series';\nimport { ChartDataTypes, InternalChartSeries, MixedLineBarChartProps } from './interfaces';\nimport LineSeries from './line-series';\nimport { calculateStackedBarValues } from './utils';\n\nimport styles from './styles.css.js';\n\n// Should have the same value as the `border-line-chart-width` token.\nconst STROKE_WIDTH = 2;\n\nexport interface DataSeriesProps<T> {\n axis: 'x' | 'y';\n\n plotHeight: number;\n plotWidth: number;\n\n highlightedSeries: MixedLineBarChartProps.ChartSeries<T> | null;\n highlightedGroupIndex: number | null;\n\n stackedBars: boolean;\n isGroupNavigation: boolean;\n\n visibleSeries: ReadonlyArray<InternalChartSeries<T>>;\n xScale: ChartScale;\n yScale: NumericChartScale;\n isRtl?: boolean;\n}\n\nexport default function DataSeries<T extends ChartDataTypes>({\n axis,\n plotHeight,\n plotWidth,\n highlightedGroupIndex,\n highlightedSeries,\n stackedBars,\n isGroupNavigation,\n visibleSeries,\n xScale,\n yScale,\n isRtl,\n}: DataSeriesProps<T>) {\n const chartAreaClipPath = useUniqueId('awsui-mixed-line-bar-chart__chart-area-');\n\n // Lines get a small extra space at the top and bottom to account for the strokes when they are at the edge of the graph.\n const lineAreaClipPath = useUniqueId('awsui-line-chart__chart-area-');\n\n const stackedBarValues = useMemo(() => {\n if (!stackedBars) {\n return undefined;\n }\n const barData: Array<readonly MixedLineBarChartProps.Datum<ChartDataTypes>[]> = [];\n visibleSeries.forEach(({ series }) => {\n if (series.type === 'bar') {\n barData.push(series.data);\n } else {\n barData.push([]);\n }\n });\n return calculateStackedBarValues(barData);\n }, [visibleSeries, stackedBars]);\n\n return (\n <>\n <defs aria-hidden=\"true\">\n <clipPath id={chartAreaClipPath}>\n <rect x={0} y={0} width={plotWidth} height={plotHeight} />\n </clipPath>\n <clipPath id={lineAreaClipPath}>\n <rect x={0} y={-STROKE_WIDTH / 2} width={plotWidth} height={plotHeight + STROKE_WIDTH} />\n </clipPath>\n </defs>\n <g aria-hidden={isGroupNavigation ? true : undefined} role=\"group\">\n {visibleSeries.map(({ series, color }, index) => {\n const isHighlighted = series === highlightedSeries;\n const isDimmed = !!highlightedSeries && !isHighlighted;\n\n switch (series.type) {\n case 'line':\n case 'threshold': {\n return (\n <g\n key={index}\n role=\"group\"\n aria-label={series.title}\n className={clsx(styles.series, styles[`series--${series.type}`], {\n [styles['series--highlighted']]: isHighlighted,\n [styles['series--dimmed']]: isDimmed,\n })}\n >\n <LineSeries\n axis={axis}\n series={series}\n color={color}\n xScale={xScale}\n yScale={yScale}\n chartAreaClipPath={lineAreaClipPath}\n />\n </g>\n );\n }\n\n case 'bar':\n return (\n <BarSeries\n key={index}\n axis={axis}\n series={series}\n color={color}\n totalSeriesCount={visibleSeries.filter(s => s.series.type === 'bar').length}\n seriesIndex={index}\n xScale={xScale}\n yScale={yScale}\n plotSize={axis === 'y' ? plotWidth : plotHeight}\n highlighted={isHighlighted}\n dimmed={isDimmed}\n chartAreaClipPath={chartAreaClipPath}\n stackedBarValues={stackedBarValues}\n highlightedGroupIndex={highlightedGroupIndex}\n isRtl={isRtl}\n />\n );\n }\n })}\n </g>\n </>\n );\n}\n"]}
1
+ {"version":3,"file":"data-series.js","sourceRoot":"","sources":["../../../src/mixed-line-bar-chart/data-series.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,IAAI,MAAM,MAAM,CAAC;AAG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AK,EACV,IAAI,EAAE,IAAI,EACV,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,KAAK,EACZ,gBAAgB,EAAE,aAAa,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,KAAK,KAAK,CAAC,CAAC,MAAM,EAC3E,WAAW,EAAE,KAAK,EAClB,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,IAAI,KAAK,GAAG,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,UAAU,EAC/C,WAAW,EAAE,aAAa,EAC1B,MAAM,EAAE,QAAQ,EAChB,iBAAiB,EAAE,iBAAiB,EACpC,gBAAgB,EAAE,gBAAgB,EAClC,qBAAqB,EAAE,qBAAqB,EAC5C,KAAK,EAAE,KAAK,GACZ,CACH,CAAC;aACL;QACH,CAAC,CAAC,CACA,CACH,CACJ,CAAC;AACJ,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useMemo } from 'react';\nimport clsx from 'clsx';\n\nimport { ChartScale, NumericChartScale } from '../internal/components/cartesian-chart/scales';\nimport { useUniqueId } from '../internal/hooks/use-unique-id';\nimport BarSeries from './bar-series';\nimport { ChartDataTypes, InternalChartSeries, MixedLineBarChartProps } from './interfaces';\nimport LineSeries from './line-series';\nimport { calculateStackedBarValues } from './utils';\n\nimport styles from './styles.css.js';\n\n// Should have the same value as the `border-line-chart-width` token.\nconst STROKE_WIDTH = 2;\n\ninterface DataSeriesProps<T> {\n axis: 'x' | 'y';\n\n plotHeight: number;\n plotWidth: number;\n\n highlightedSeries: MixedLineBarChartProps.ChartSeries<T> | null;\n highlightedGroupIndex: number | null;\n\n stackedBars: boolean;\n isGroupNavigation: boolean;\n\n visibleSeries: ReadonlyArray<InternalChartSeries<T>>;\n xScale: ChartScale;\n yScale: NumericChartScale;\n isRtl?: boolean;\n}\n\nexport default function DataSeries<T extends ChartDataTypes>({\n axis,\n plotHeight,\n plotWidth,\n highlightedGroupIndex,\n highlightedSeries,\n stackedBars,\n isGroupNavigation,\n visibleSeries,\n xScale,\n yScale,\n isRtl,\n}: DataSeriesProps<T>) {\n const chartAreaClipPath = useUniqueId('awsui-mixed-line-bar-chart__chart-area-');\n\n // Lines get a small extra space at the top and bottom to account for the strokes when they are at the edge of the graph.\n const lineAreaClipPath = useUniqueId('awsui-line-chart__chart-area-');\n\n const stackedBarValues = useMemo(() => {\n if (!stackedBars) {\n return undefined;\n }\n const barData: Array<readonly MixedLineBarChartProps.Datum<ChartDataTypes>[]> = [];\n visibleSeries.forEach(({ series }) => {\n if (series.type === 'bar') {\n barData.push(series.data);\n } else {\n barData.push([]);\n }\n });\n return calculateStackedBarValues(barData);\n }, [visibleSeries, stackedBars]);\n\n return (\n <>\n <defs aria-hidden=\"true\">\n <clipPath id={chartAreaClipPath}>\n <rect x={0} y={0} width={plotWidth} height={plotHeight} />\n </clipPath>\n <clipPath id={lineAreaClipPath}>\n <rect x={0} y={-STROKE_WIDTH / 2} width={plotWidth} height={plotHeight + STROKE_WIDTH} />\n </clipPath>\n </defs>\n <g aria-hidden={isGroupNavigation ? true : undefined} role=\"group\">\n {visibleSeries.map(({ series, color }, index) => {\n const isHighlighted = series === highlightedSeries;\n const isDimmed = !!highlightedSeries && !isHighlighted;\n\n switch (series.type) {\n case 'line':\n case 'threshold': {\n return (\n <g\n key={index}\n role=\"group\"\n aria-label={series.title}\n className={clsx(styles.series, styles[`series--${series.type}`], {\n [styles['series--highlighted']]: isHighlighted,\n [styles['series--dimmed']]: isDimmed,\n })}\n >\n <LineSeries\n axis={axis}\n series={series}\n color={color}\n xScale={xScale}\n yScale={yScale}\n chartAreaClipPath={lineAreaClipPath}\n />\n </g>\n );\n }\n\n case 'bar':\n return (\n <BarSeries\n key={index}\n axis={axis}\n series={series}\n color={color}\n totalSeriesCount={visibleSeries.filter(s => s.series.type === 'bar').length}\n seriesIndex={index}\n xScale={xScale}\n yScale={yScale}\n plotSize={axis === 'y' ? plotWidth : plotHeight}\n highlighted={isHighlighted}\n dimmed={isDimmed}\n chartAreaClipPath={chartAreaClipPath}\n stackedBarValues={stackedBarValues}\n highlightedGroupIndex={highlightedGroupIndex}\n isRtl={isRtl}\n />\n );\n }\n })}\n </g>\n </>\n );\n}\n"]}
@@ -1,9 +1,7 @@
1
1
  import { ReactNode } from 'react';
2
2
  import { CartesianChartProps } from '../internal/components/cartesian-chart/interfaces';
3
3
  export type ChartDataTypes = number | string | Date;
4
- export type SeriesType = 'line' | 'bar';
5
4
  export type ScaleType = 'linear' | 'log' | 'time' | 'categorical';
6
- export type ScaleRange = [number, number];
7
5
  export interface InternalChartSeries<T> {
8
6
  index: number;
9
7
  color: string;
@@ -1 +1 @@
1
- {"version":3,"file":"interfaces.d.ts","sourceRoot":"","sources":["../../../src/mixed-line-bar-chart/interfaces.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAElC,OAAO,EAAE,mBAAmB,EAAE,MAAM,mDAAmD,CAAC;AAExF,MAAM,MAAM,cAAc,GAAG,MAAM,GAAG,MAAM,GAAG,IAAI,CAAC;AAEpD,MAAM,MAAM,UAAU,GAAG,MAAM,GAAG,KAAK,CAAC;AACxC,MAAM,MAAM,SAAS,GAAG,QAAQ,GAAG,KAAK,GAAG,MAAM,GAAG,aAAa,CAAC;AAClE,MAAM,MAAM,UAAU,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;AAE1C,MAAM,WAAW,mBAAmB,CAAC,CAAC;IACpC,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,sBAAsB,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC;CAC/C;AAGD,MAAM,WAAW,qBAAqB,CAAC,CAAC,SAAS,cAAc,CAC7D,SAAQ,mBAAmB,CAAC,CAAC,EAAE,sBAAsB,CAAC,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CAAC;CACjB"}
@@ -1 +1 @@
1
- {"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../src/mixed-line-bar-chart/interfaces.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { ReactNode } from 'react';\n\nimport { CartesianChartProps } from '../internal/components/cartesian-chart/interfaces';\n\nexport type ChartDataTypes = number | string | Date;\n\nexport type SeriesType = 'line' | 'bar';\nexport type ScaleType = 'linear' | 'log' | 'time' | 'categorical';\nexport type ScaleRange = [number, number];\n\nexport interface InternalChartSeries<T> {\n index: number;\n color: string;\n series: MixedLineBarChartProps.ChartSeries<T>;\n}\n\n// Properties that are shared as is (including API doc comments) by mixed, line and bar charts.\nexport interface CommonMixedChartProps<T extends ChartDataTypes>\n extends CartesianChartProps<T, MixedLineBarChartProps.ChartSeries<T>> {\n /**\n * When set to `true`, adds a visual emphasis on the zero baseline axis.\n * See the usage guidelines for more details.\n */\n emphasizeBaselineAxis?: boolean;\n\n /**\n * A function that determines the details that are displayed in the popover for each series.\n * Use this for wrapping keys or values in external links, or to display a metric breakdown by adding an additional level of nested items.\n *\n * The function is called with the parameters `{ series, x, y }` representing the series, the highlighted x coordinate value and its corresponding y value respectively,\n * and should return the following properties:\n * * `key` (ReactNode) - Name of the series.\n * * `value` (ReactNode) - Value of the series at the highlighted x coordinate.\n * * `subItems` (ReadonlyArray<{ key: ReactNode; value: ReactNode }>) - (Optional) List of nested key-value pairs.\n * * `expandable` (boolean) - (Optional) Determines whether the optional list of nested items provided via `subItems` is expandable. This is `false` by default.\n */\n detailPopoverSeriesContent?: MixedLineBarChartProps.DetailPopoverSeriesContent<T>;\n}\n\nexport interface MixedLineBarChartProps<T extends ChartDataTypes> extends CommonMixedChartProps<T> {\n /**\n * Array that represents the source of data for the displayed chart.\n * Each element can represent a line series, bar series, or a threshold, and can have the following properties:\n *\n * * `title` (string): A human-readable title for this series.\n * * `type` (string): Series type (`\"line\"`, `\"bar\"`, or `\"threshold\"`).\n * * `data` (Array): For line and bar series, an array of data points, represented as objects with `x` and `y` properties.\n * * `y` (number): For threshold series, the value of the threshold.\n * * `color` (string): (Optional) A color hex value for this series. When assigned, it takes priority over the automatically assigned color.\n * * `valueFormatter` (Function): (Optional) A function that formats data values before rendering in the UI, For example, in the details popover.\n */\n series: ReadonlyArray<MixedLineBarChartProps.ChartSeries<T>>;\n\n /**\n * When set to `true`, bars in the same data point are stacked instead of grouped next to each other.\n */\n stackedBars?: boolean;\n\n /**\n * When set to `true`, the x and y axes are flipped, which causes any bars to be rendered horizontally instead of vertically.\n * This can only be used when the chart consists exclusively of bar series.\n */\n horizontalBars?: boolean;\n\n /**\n * Determines the type of scale for values on the x axis.\n * Use `categorical` for charts with bars.\n */\n xScaleType?: ScaleType;\n}\n\nexport namespace MixedLineBarChartProps {\n export interface Datum<T> {\n x: T;\n y: number;\n }\n\n interface IDataSeries<T> {\n type: 'line' | 'bar' | 'threshold';\n title: string;\n color?: string;\n\n // This makes sure that the element type of the array is reduced to just one type,\n // even if `T` is a union type, e.g. `number | string`.\n data: T extends unknown ? ReadonlyArray<Datum<T>> : ReadonlyArray<Datum<T>>;\n valueFormatter?: T extends unknown\n ? CartesianChartProps.ValueFormatter<number, T>\n : CartesianChartProps.ValueFormatter<number, T>;\n }\n\n export interface BarDataSeries<T> extends IDataSeries<T> {\n type: 'bar';\n }\n\n export interface LineDataSeries<T> extends IDataSeries<T> {\n type: 'line';\n }\n\n export interface ThresholdSeries<T = any> extends Omit<IDataSeries<never>, 'data' | 'valueFormatter'> {\n type: 'threshold';\n y?: number;\n x?: T;\n valueFormatter?: CartesianChartProps.TickFormatter<number>;\n }\n\n export interface YThresholdSeries extends Omit<ThresholdSeries<never>, 'x'> {\n type: 'threshold';\n y: number;\n valueFormatter?: CartesianChartProps.TickFormatter<number>;\n }\n\n export interface XThresholdSeries<T> extends Omit<ThresholdSeries<T>, 'y' | 'valueFormatter'> {\n type: 'threshold';\n x: T;\n }\n\n export type DataSeries<T> = LineDataSeries<T> | BarDataSeries<T>;\n\n export type ChartSeries<T> = DataSeries<T> | ThresholdSeries<T>;\n\n export type FilterChangeDetail<T> = CartesianChartProps.FilterChangeDetail<ChartSeries<T>>;\n\n export type HighlightChangeDetail<T> = CartesianChartProps.HighlightChangeDetail<ChartSeries<T>>;\n\n export type TickFormatter<T> = CartesianChartProps.TickFormatter<T>;\n\n export type ValueFormatter<YType, XType = null> = CartesianChartProps.ValueFormatter<YType, XType>;\n\n export type I18nStrings<T> = CartesianChartProps.I18nStrings<T>;\n\n export interface DetailPopoverSeriesData<T> {\n series: ChartSeries<T>;\n x: T;\n y: number;\n }\n\n export interface DetailPopoverSeriesKeyValuePair {\n key: ReactNode;\n value: ReactNode;\n expandable?: boolean;\n subItems?: ReadonlyArray<{ key: ReactNode; value: ReactNode }>;\n }\n\n export interface DetailPopoverSeriesContent<T> {\n (data: DetailPopoverSeriesData<T>): DetailPopoverSeriesKeyValuePair;\n }\n}\n\nexport interface VerticalMarkerX<T> {\n scaledX: number;\n label: T | null;\n}\n"]}
1
+ {"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../src/mixed-line-bar-chart/interfaces.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { ReactNode } from 'react';\n\nimport { CartesianChartProps } from '../internal/components/cartesian-chart/interfaces';\n\nexport type ChartDataTypes = number | string | Date;\n\nexport type ScaleType = 'linear' | 'log' | 'time' | 'categorical';\n\nexport interface InternalChartSeries<T> {\n index: number;\n color: string;\n series: MixedLineBarChartProps.ChartSeries<T>;\n}\n\n// Properties that are shared as is (including API doc comments) by mixed, line and bar charts.\nexport interface CommonMixedChartProps<T extends ChartDataTypes>\n extends CartesianChartProps<T, MixedLineBarChartProps.ChartSeries<T>> {\n /**\n * When set to `true`, adds a visual emphasis on the zero baseline axis.\n * See the usage guidelines for more details.\n */\n emphasizeBaselineAxis?: boolean;\n\n /**\n * A function that determines the details that are displayed in the popover for each series.\n * Use this for wrapping keys or values in external links, or to display a metric breakdown by adding an additional level of nested items.\n *\n * The function is called with the parameters `{ series, x, y }` representing the series, the highlighted x coordinate value and its corresponding y value respectively,\n * and should return the following properties:\n * * `key` (ReactNode) - Name of the series.\n * * `value` (ReactNode) - Value of the series at the highlighted x coordinate.\n * * `subItems` (ReadonlyArray<{ key: ReactNode; value: ReactNode }>) - (Optional) List of nested key-value pairs.\n * * `expandable` (boolean) - (Optional) Determines whether the optional list of nested items provided via `subItems` is expandable. This is `false` by default.\n */\n detailPopoverSeriesContent?: MixedLineBarChartProps.DetailPopoverSeriesContent<T>;\n}\n\nexport interface MixedLineBarChartProps<T extends ChartDataTypes> extends CommonMixedChartProps<T> {\n /**\n * Array that represents the source of data for the displayed chart.\n * Each element can represent a line series, bar series, or a threshold, and can have the following properties:\n *\n * * `title` (string): A human-readable title for this series.\n * * `type` (string): Series type (`\"line\"`, `\"bar\"`, or `\"threshold\"`).\n * * `data` (Array): For line and bar series, an array of data points, represented as objects with `x` and `y` properties.\n * * `y` (number): For threshold series, the value of the threshold.\n * * `color` (string): (Optional) A color hex value for this series. When assigned, it takes priority over the automatically assigned color.\n * * `valueFormatter` (Function): (Optional) A function that formats data values before rendering in the UI, For example, in the details popover.\n */\n series: ReadonlyArray<MixedLineBarChartProps.ChartSeries<T>>;\n\n /**\n * When set to `true`, bars in the same data point are stacked instead of grouped next to each other.\n */\n stackedBars?: boolean;\n\n /**\n * When set to `true`, the x and y axes are flipped, which causes any bars to be rendered horizontally instead of vertically.\n * This can only be used when the chart consists exclusively of bar series.\n */\n horizontalBars?: boolean;\n\n /**\n * Determines the type of scale for values on the x axis.\n * Use `categorical` for charts with bars.\n */\n xScaleType?: ScaleType;\n}\n\nexport namespace MixedLineBarChartProps {\n export interface Datum<T> {\n x: T;\n y: number;\n }\n\n interface IDataSeries<T> {\n type: 'line' | 'bar' | 'threshold';\n title: string;\n color?: string;\n\n // This makes sure that the element type of the array is reduced to just one type,\n // even if `T` is a union type, e.g. `number | string`.\n data: T extends unknown ? ReadonlyArray<Datum<T>> : ReadonlyArray<Datum<T>>;\n valueFormatter?: T extends unknown\n ? CartesianChartProps.ValueFormatter<number, T>\n : CartesianChartProps.ValueFormatter<number, T>;\n }\n\n export interface BarDataSeries<T> extends IDataSeries<T> {\n type: 'bar';\n }\n\n export interface LineDataSeries<T> extends IDataSeries<T> {\n type: 'line';\n }\n\n export interface ThresholdSeries<T = any> extends Omit<IDataSeries<never>, 'data' | 'valueFormatter'> {\n type: 'threshold';\n y?: number;\n x?: T;\n valueFormatter?: CartesianChartProps.TickFormatter<number>;\n }\n\n export interface YThresholdSeries extends Omit<ThresholdSeries<never>, 'x'> {\n type: 'threshold';\n y: number;\n valueFormatter?: CartesianChartProps.TickFormatter<number>;\n }\n\n export interface XThresholdSeries<T> extends Omit<ThresholdSeries<T>, 'y' | 'valueFormatter'> {\n type: 'threshold';\n x: T;\n }\n\n export type DataSeries<T> = LineDataSeries<T> | BarDataSeries<T>;\n\n export type ChartSeries<T> = DataSeries<T> | ThresholdSeries<T>;\n\n export type FilterChangeDetail<T> = CartesianChartProps.FilterChangeDetail<ChartSeries<T>>;\n\n export type HighlightChangeDetail<T> = CartesianChartProps.HighlightChangeDetail<ChartSeries<T>>;\n\n export type TickFormatter<T> = CartesianChartProps.TickFormatter<T>;\n\n export type ValueFormatter<YType, XType = null> = CartesianChartProps.ValueFormatter<YType, XType>;\n\n export type I18nStrings<T> = CartesianChartProps.I18nStrings<T>;\n\n export interface DetailPopoverSeriesData<T> {\n series: ChartSeries<T>;\n x: T;\n y: number;\n }\n\n export interface DetailPopoverSeriesKeyValuePair {\n key: ReactNode;\n value: ReactNode;\n expandable?: boolean;\n subItems?: ReadonlyArray<{ key: ReactNode; value: ReactNode }>;\n }\n\n export interface DetailPopoverSeriesContent<T> {\n (data: DetailPopoverSeriesData<T>): DetailPopoverSeriesKeyValuePair;\n }\n}\n\nexport interface VerticalMarkerX<T> {\n scaledX: number;\n label: T | null;\n}\n"]}
@@ -1,7 +1,7 @@
1
1
  /// <reference types="react" />
2
2
  import { ChartScale, NumericChartScale } from '../internal/components/cartesian-chart/scales';
3
3
  import { MixedLineBarChartProps } from './interfaces';
4
- export interface LineSeriesProps<T> {
4
+ interface LineSeriesProps<T> {
5
5
  axis: 'x' | 'y';
6
6
  series: MixedLineBarChartProps.LineDataSeries<T> | MixedLineBarChartProps.ThresholdSeries<T>;
7
7
  color: string;
@@ -10,4 +10,5 @@ export interface LineSeriesProps<T> {
10
10
  yScale: NumericChartScale;
11
11
  }
12
12
  export default function LineSeries<T>({ axis, series, color, xScale, yScale, chartAreaClipPath }: LineSeriesProps<T>): JSX.Element | null;
13
+ export {};
13
14
  //# sourceMappingURL=line-series.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"line-series.d.ts","sourceRoot":"","sources":["../../../src/mixed-line-bar-chart/line-series.tsx"],"names":[],"mappings":";AAKA,OAAO,EAAE,UAAU,EAAE,iBAAiB,EAAE,MAAM,+CAA+C,CAAC;AAC9F,OAAO,EAAE,sBAAsB,EAAE,MAAM,cAAc,CAAC;AAGtD,MAAM,WAAW,eAAe,CAAC,CAAC;IAChC,IAAI,EAAE,GAAG,GAAG,GAAG,CAAC;IAChB,MAAM,EAAE,sBAAsB,CAAC,cAAc,CAAC,CAAC,CAAC,GAAG,sBAAsB,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC;IAE7F,KAAK,EAAE,MAAM,CAAC;IACd,iBAAiB,EAAE,MAAM,CAAC;IAE1B,MAAM,EAAE,UAAU,CAAC;IACnB,MAAM,EAAE,iBAAiB,CAAC;CAC3B;AAED,MAAM,CAAC,OAAO,UAAU,UAAU,CAAC,CAAC,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,iBAAiB,EAAE,EAAE,eAAe,CAAC,CAAC,CAAC,sBA8CnH"}
1
+ {"version":3,"file":"line-series.d.ts","sourceRoot":"","sources":["../../../src/mixed-line-bar-chart/line-series.tsx"],"names":[],"mappings":";AAKA,OAAO,EAAE,UAAU,EAAE,iBAAiB,EAAE,MAAM,+CAA+C,CAAC;AAC9F,OAAO,EAAE,sBAAsB,EAAE,MAAM,cAAc,CAAC;AAGtD,UAAU,eAAe,CAAC,CAAC;IACzB,IAAI,EAAE,GAAG,GAAG,GAAG,CAAC;IAChB,MAAM,EAAE,sBAAsB,CAAC,cAAc,CAAC,CAAC,CAAC,GAAG,sBAAsB,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC;IAE7F,KAAK,EAAE,MAAM,CAAC;IACd,iBAAiB,EAAE,MAAM,CAAC;IAE1B,MAAM,EAAE,UAAU,CAAC;IACnB,MAAM,EAAE,iBAAiB,CAAC;CAC3B;AAED,MAAM,CAAC,OAAO,UAAU,UAAU,CAAC,CAAC,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,iBAAiB,EAAE,EAAE,eAAe,CAAC,CAAC,CAAC,sBA8CnH"}
@@ -1 +1 @@
1
- {"version":3,"file":"line-series.js","sourceRoot":"","sources":["../../../src/mixed-line-bar-chart/line-series.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,IAAI,EAAE,MAAM,UAAU,CAAC;AAIhC,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAarD,MAAM,CAAC,OAAO,UAAU,UAAU,CAAI,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,iBAAiB,EAAsB;;IAClH,MAAM,WAAW,GAAG,EAAE,aAAa,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,QAAQ,iBAAiB,GAAG,EAAE,CAAC;IAEnG,w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E,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC;QAC/F,OAAO,8CAAU,WAAW,EAAM,WAAW,EAAI,CAAC;KACnD;IACD,wEAAwE;IACxE,sGAAsG;SACjG,IAAI,YAAY,CAAC,MAAM,CAAC,EAAE;QAC7B,MAAM,CAAC,EAAE,EAAE,EAAE,CAAC,GAAG,MAAM,CAAC,OAAO,CAAC,KAAK,EAAE,CAAC;QACxC,MAAM,OAAO,GAAG,MAAM,CAAC,aAAa,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,MAAM,CAAC,OAAO,CAAC,SAAS,EAAE,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAC7F,MAAM,CAAC,GAAG,CAAC,MAAA,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,CAAQ,CAAC,mCAAI,GAAG,CAAC,GAAG,OAAO,CAAC;QAC7D,MAAM,WAAW,GAAG,IAAI,KAAK,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC;QAC/F,OAAO,8CAAU,WAAW,EAAM,WAAW,EAAI,CAAC;KACnD;IACD,qCAAqC;SAChC;QACH,OAAO,IAAI,CAAC;KACb;AACH,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\nimport { line } from 'd3-shape';\n\nimport { ChartScale, NumericChartScale } from '../internal/components/cartesian-chart/scales';\nimport { MixedLineBarChartProps } from './interfaces';\nimport { isXThreshold, isYThreshold } from './utils';\n\nexport interface LineSeriesProps<T> {\n axis: 'x' | 'y';\n series: MixedLineBarChartProps.LineDataSeries<T> | MixedLineBarChartProps.ThresholdSeries<T>;\n\n color: string;\n chartAreaClipPath: string;\n\n xScale: ChartScale;\n yScale: NumericChartScale;\n}\n\nexport default function LineSeries<T>({ axis, series, color, xScale, yScale, chartAreaClipPath }: LineSeriesProps<T>) {\n const commonProps = { 'aria-hidden': true, stroke: color, clipPath: `url(#${chartAreaClipPath})` };\n\n // Render data path. The chart orientation is ignored as only horizontally-oriented lines are supported.\n if (series.type === 'line') {\n const lineGenerator = line<MixedLineBarChartProps.Datum<T>>()\n .x((d: MixedLineBarChartProps.Datum<T>) => {\n let x = xScale.d3Scale(d.x as any) || 0;\n if (xScale.isCategorical()) {\n const offset = Math.max(0, xScale.d3Scale.bandwidth() - 1) / 2;\n x += offset;\n }\n return x;\n })\n .y((d: MixedLineBarChartProps.Datum<T>) => yScale.d3Scale(d.y) || 0);\n\n // Filter out any data that is not part of the xScale\n const visibleData = series.data.filter(({ x }) => xScale.d3Scale(x as any) !== undefined);\n\n return (\n <path\n {...commonProps}\n d={lineGenerator(visibleData as unknown as Array<MixedLineBarChartProps.Datum<T>>) || ''}\n />\n );\n }\n // Render a horizontal line (vertical if chart orientation is inverted).\n else if (isYThreshold(series)) {\n const [x1, x2] = xScale.d3Scale.range();\n const y = yScale.d3Scale(series.y);\n const coordinates = axis === 'x' ? { x1, x2, y1: y, y2: y } : { x1: y, x2: y, y1: x1, y2: x2 };\n return <line {...commonProps} {...coordinates} />;\n }\n // Render a vertical line (horizontal if chart orientation is inverted).\n // The offset is necessary for categorical scale to render the line in the middle of the category bar.\n else if (isXThreshold(series)) {\n const [y1, y2] = yScale.d3Scale.range();\n const xOffset = xScale.isCategorical() ? Math.max(0, xScale.d3Scale.bandwidth() - 1) / 2 : 0;\n const x = (xScale.d3Scale(series.x as any) ?? NaN) + xOffset;\n const coordinates = axis === 'x' ? { x1: x, x2: x, y1, y2 } : { x1: y1, x2: y2, y1: x, y2: x };\n return <line {...commonProps} {...coordinates} />;\n }\n // Bar series are handled separately.\n else {\n return null;\n }\n}\n"]}
1
+ {"version":3,"file":"line-series.js","sourceRoot":"","sources":["../../../src/mixed-line-bar-chart/line-series.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,IAAI,EAAE,MAAM,UAAU,CAAC;AAIhC,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAarD,MAAM,CAAC,OAAO,UAAU,UAAU,CAAI,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,iBAAiB,EAAsB;;IAClH,MAAM,WAAW,GAAG,EAAE,aAAa,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,QAAQ,iBAAiB,GAAG,EAAE,CAAC;IAEnG,wGAAwG;IACxG,IAAI,MAAM,CAAC,IAAI,KAAK,MAAM,EAAE;QAC1B,MAAM,aAAa,GAAG,IAAI,EAAmC;aAC1D,CAAC,CAAC,CAAC,CAAkC,EAAE,EAAE;YACxC,IAAI,CAAC,GAAG,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,CAAQ,CAAC,IAAI,CAAC,CAAC;YACxC,IAAI,MAAM,CAAC,aAAa,EAAE,EAAE;gBAC1B,MAAM,MAAM,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,MAAM,CAAC,OAAO,CAAC,SAAS,EAAE,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC;gBAC/D,CAAC,IAAI,MAAM,CAAC;aACb;YACD,OAAO,CAAC,CAAC;QACX,CAAC,CAAC;aACD,CAAC,CAAC,CAAC,CAAkC,EAAE,EAAE,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAA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AAC,GAAG,CAAC,MAAA,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,CAAQ,CAAC,mCAAI,GAAG,CAAC,GAAG,OAAO,CAAC;QAC7D,MAAM,WAAW,GAAG,IAAI,KAAK,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC;QAC/F,OAAO,8CAAU,WAAW,EAAM,WAAW,EAAI,CAAC;KACnD;IACD,qCAAqC;SAChC;QACH,OAAO,IAAI,CAAC;KACb;AACH,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\nimport { line } from 'd3-shape';\n\nimport { ChartScale, NumericChartScale } from '../internal/components/cartesian-chart/scales';\nimport { MixedLineBarChartProps } from './interfaces';\nimport { isXThreshold, isYThreshold } from './utils';\n\ninterface LineSeriesProps<T> {\n axis: 'x' | 'y';\n series: MixedLineBarChartProps.LineDataSeries<T> | MixedLineBarChartProps.ThresholdSeries<T>;\n\n color: string;\n chartAreaClipPath: string;\n\n xScale: ChartScale;\n yScale: NumericChartScale;\n}\n\nexport default function LineSeries<T>({ axis, series, color, xScale, yScale, chartAreaClipPath }: LineSeriesProps<T>) {\n const commonProps = { 'aria-hidden': true, stroke: color, clipPath: `url(#${chartAreaClipPath})` };\n\n // Render data path. The chart orientation is ignored as only horizontally-oriented lines are supported.\n if (series.type === 'line') {\n const lineGenerator = line<MixedLineBarChartProps.Datum<T>>()\n .x((d: MixedLineBarChartProps.Datum<T>) => {\n let x = xScale.d3Scale(d.x as any) || 0;\n if (xScale.isCategorical()) {\n const offset = Math.max(0, xScale.d3Scale.bandwidth() - 1) / 2;\n x += offset;\n }\n return x;\n })\n .y((d: MixedLineBarChartProps.Datum<T>) => yScale.d3Scale(d.y) || 0);\n\n // Filter out any data that is not part of the xScale\n const visibleData = series.data.filter(({ x }) => xScale.d3Scale(x as any) !== undefined);\n\n return (\n <path\n {...commonProps}\n d={lineGenerator(visibleData as unknown as Array<MixedLineBarChartProps.Datum<T>>) || ''}\n />\n );\n }\n // Render a horizontal line (vertical if chart orientation is inverted).\n else if (isYThreshold(series)) {\n const [x1, x2] = xScale.d3Scale.range();\n const y = yScale.d3Scale(series.y);\n const coordinates = axis === 'x' ? { x1, x2, y1: y, y2: y } : { x1: y, x2: y, y1: x1, y2: x2 };\n return <line {...commonProps} {...coordinates} />;\n }\n // Render a vertical line (horizontal if chart orientation is inverted).\n // The offset is necessary for categorical scale to render the line in the middle of the category bar.\n else if (isXThreshold(series)) {\n const [y1, y2] = yScale.d3Scale.range();\n const xOffset = xScale.isCategorical() ? Math.max(0, xScale.d3Scale.bandwidth() - 1) / 2 : 0;\n const x = (xScale.d3Scale(series.x as any) ?? NaN) + xOffset;\n const coordinates = axis === 'x' ? { x1: x, x2: x, y1, y2 } : { x1: y1, x2: y2, y1: x, y2: x };\n return <line {...commonProps} {...coordinates} />;\n }\n // Bar series are handled separately.\n else {\n return null;\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/modal/index.tsx"],"names":[],"mappings":";AAaA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAK1C,OAAO,EAAE,UAAU,EAAE,CAAC;AA0CtB,MAAM,CAAC,OAAO,UAAU,KAAK,CAAC,EAAE,IAAe,EAAE,GAAG,KAAK,EAAE,EAAE,UAAU,eA2BtE"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/modal/index.tsx"],"names":[],"mappings":";AAeA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAK1C,OAAO,EAAE,UAAU,EAAE,CAAC;AAgDtB,MAAM,CAAC,OAAO,UAAU,KAAK,CAAC,EAAE,IAAe,EAAE,GAAG,KAAK,EAAE,EAAE,UAAU,eA2BtE"}
package/modal/index.js CHANGED
@@ -4,17 +4,23 @@ import { __rest } from "tslib";
4
4
  import React from 'react';
5
5
  import { AnalyticsFunnel, AnalyticsFunnelStep, AnalyticsFunnelSubStep, } from '../internal/analytics/components/analytics-funnel';
6
6
  import { useFunnel } from '../internal/analytics/hooks/use-funnel';
7
+ import { DATA_ATTR_MODAL_ID } from '../internal/analytics/selectors';
7
8
  import { getAnalyticsMetadataProps } from '../internal/base-component';
8
9
  import useBaseComponent from '../internal/hooks/use-base-component';
10
+ import { useUniqueId } from '../internal/hooks/use-unique-id';
9
11
  import { applyDisplayName } from '../internal/utils/apply-display-name';
10
12
  import InternalModal, { InternalModalAsFunnel } from './internal';
11
13
  import styles from './styles.css.js';
12
14
  function ModalWithAnalyticsFunnel(_a) {
13
15
  var { analyticsMetadata, baseComponentProps, size = 'medium' } = _a, props = __rest(_a, ["analyticsMetadata", "baseComponentProps", "size"]);
14
- return (React.createElement(AnalyticsFunnel, { mounted: props.visible, funnelIdentifier: analyticsMetadata === null || analyticsMetadata === void 0 ? void 0 : analyticsMetadata.instanceIdentifier, funnelFlowType: analyticsMetadata === null || analyticsMetadata === void 0 ? void 0 : analyticsMetadata.flowType, funnelErrorContext: analyticsMetadata === null || analyticsMetadata === void 0 ? void 0 : analyticsMetadata.errorContext, funnelResourceType: analyticsMetadata === null || analyticsMetadata === void 0 ? void 0 : analyticsMetadata.resourceType, funnelType: "modal", optionalStepNumbers: [], totalFunnelSteps: 1, funnelNameSelectors: [`.${styles['header--text']}`] },
16
+ const modalId = useUniqueId();
17
+ const dataAttributes = {
18
+ [DATA_ATTR_MODAL_ID]: modalId,
19
+ };
20
+ return (React.createElement(AnalyticsFunnel, { mounted: props.visible, funnelIdentifier: analyticsMetadata === null || analyticsMetadata === void 0 ? void 0 : analyticsMetadata.instanceIdentifier, funnelFlowType: analyticsMetadata === null || analyticsMetadata === void 0 ? void 0 : analyticsMetadata.flowType, funnelErrorContext: analyticsMetadata === null || analyticsMetadata === void 0 ? void 0 : analyticsMetadata.errorContext, funnelResourceType: analyticsMetadata === null || analyticsMetadata === void 0 ? void 0 : analyticsMetadata.resourceType, funnelType: "modal", optionalStepNumbers: [], totalFunnelSteps: 1, funnelNameSelectors: [`[${DATA_ATTR_MODAL_ID}="${CSS.escape(modalId)}"] .${styles['header--text']}`] },
15
21
  React.createElement(AnalyticsFunnelStep, { mounted: props.visible, stepIdentifier: analyticsMetadata === null || analyticsMetadata === void 0 ? void 0 : analyticsMetadata.instanceIdentifier, stepErrorContext: analyticsMetadata === null || analyticsMetadata === void 0 ? void 0 : analyticsMetadata.errorContext, stepNumber: 1 },
16
22
  React.createElement(AnalyticsFunnelSubStep, { subStepIdentifier: analyticsMetadata === null || analyticsMetadata === void 0 ? void 0 : analyticsMetadata.instanceIdentifier, subStepErrorContext: analyticsMetadata === null || analyticsMetadata === void 0 ? void 0 : analyticsMetadata.errorContext },
17
- React.createElement(InternalModalAsFunnel, Object.assign({ size: size }, props, baseComponentProps, { __injectAnalyticsComponentMetadata: true }))))));
23
+ React.createElement(InternalModalAsFunnel, Object.assign({ size: size }, props, baseComponentProps, dataAttributes, { __injectAnalyticsComponentMetadata: true }))))));
18
24
  }
19
25
  export default function Modal(_a) {
20
26
  var { size = 'medium' } = _a, props = __rest(_a, ["size"]);
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/modal/index.tsx"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EACL,eAAe,EACf,mBAAmB,EACnB,sBAAsB,GACvB,MAAM,mDAAmD,CAAC;AAC3D,OAAO,EAAE,SAAS,EAAE,MAAM,wCAAwC,CAAC;AACnE,OAAO,EAAkC,yBAAyB,EAAE,MAAM,4BAA4B,CAAC;AACvG,OAAO,gBA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AAC,qBAAqB,kBACpB,IAAI,EAAE,IAAI,IACN,KAAK,EACL,kBAAkB,IACtB,kCAAkC,EAAE,IAAI,IACxC,CACqB,CACL,CACN,CACnB,CAAC;AACJ,CAAC;AAED,MAAM,CAAC,OAAO,UAAU,KAAK,CAAC,EAAyC;QAAzC,EAAE,IAAI,GAAG,QAAQ,OAAwB,EAAnB,KAAK,cAA3B,QAA6B,CAAF;IACvD,MAAM,EAAE,UAAU,EAAE,GAAG,SAAS,EAAE,CAAC;IACnC,MAAM,iBAAiB,GAAG,yBAAyB,CAAC,KAAuC,CAAC,CAAC;IAC7F,MAAM,kBAAkB,GAAG,gBAAgB,CACzC,OAAO,EACP;QACE,KAAK,EAAE,EAAE,IAAI,EAAE,sBAAsB,EAAE,KAAK,CAAC,sBAAsB,EAAE;QACrE,QAAQ,EAAE;YACR,eAAe,EAAE,OAAO,CAAC,iBAAiB,aAAjB,iBAAiB,uBAAjB,iBAAiB,CAAE,YAAY,CAAC;YACzD,qBAAqB,EAAE,OAAO,CAAC,iBAAiB,aAAjB,iBAAiB,uBAAjB,iBAAiB,CAAE,kBAAkB,CAAC;SACtE;KACF,EACD,iBAAiB,CAClB,CAAC;IAEF,IAAI,CAAC,UAAU,EAAE;QACf,OAAO,CACL,oBAAC,wBAAwB,kBACvB,iBAAiB,EAAE,iBAAiB,EACpC,kBAAkB,EAAE,kBAAkB,EACtC,IAAI,EAAE,IAAI,IACN,KAAK,EACT,CACH,CAAC;KACH;IAED,OAAO,oBAAC,aAAa,kBAAC,IAAI,EAAE,IAAI,IAAM,KAAK,EAAM,kBAAkB,IAAE,kCAAkC,EAAE,IAAI,IAAI,CAAC;AACpH,CAAC;AAED,gBAAgB,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\n\nimport {\n AnalyticsFunnel,\n AnalyticsFunnelStep,\n AnalyticsFunnelSubStep,\n} from '../internal/analytics/components/analytics-funnel';\nimport { useFunnel } from '../internal/analytics/hooks/use-funnel';\nimport { BasePropsWithAnalyticsMetadata, getAnalyticsMetadataProps } from '../internal/base-component';\nimport useBaseComponent from '../internal/hooks/use-base-component';\nimport { applyDisplayName } from '../internal/utils/apply-display-name';\nimport { ModalProps } from './interfaces';\nimport InternalModal, { InternalModalAsFunnel } from './internal';\n\nimport styles from './styles.css.js';\n\nexport { ModalProps };\n\nfunction ModalWithAnalyticsFunnel({\n analyticsMetadata,\n baseComponentProps,\n size = 'medium',\n ...props\n}: ModalProps & { analyticsMetadata: any; baseComponentProps: ReturnType<typeof useBaseComponent> }) {\n return (\n <AnalyticsFunnel\n mounted={props.visible}\n funnelIdentifier={analyticsMetadata?.instanceIdentifier}\n funnelFlowType={analyticsMetadata?.flowType}\n funnelErrorContext={analyticsMetadata?.errorContext}\n funnelResourceType={analyticsMetadata?.resourceType}\n funnelType=\"modal\"\n optionalStepNumbers={[]}\n totalFunnelSteps={1}\n funnelNameSelectors={[`.${styles['header--text']}`]}\n >\n <AnalyticsFunnelStep\n mounted={props.visible}\n stepIdentifier={analyticsMetadata?.instanceIdentifier}\n stepErrorContext={analyticsMetadata?.errorContext}\n stepNumber={1}\n >\n <AnalyticsFunnelSubStep\n subStepIdentifier={analyticsMetadata?.instanceIdentifier}\n subStepErrorContext={analyticsMetadata?.errorContext}\n >\n <InternalModalAsFunnel\n size={size}\n {...props}\n {...baseComponentProps}\n __injectAnalyticsComponentMetadata={true}\n />\n </AnalyticsFunnelSubStep>\n </AnalyticsFunnelStep>\n </AnalyticsFunnel>\n );\n}\n\nexport default function Modal({ size = 'medium', ...props }: ModalProps) {\n const { isInFunnel } = useFunnel();\n const analyticsMetadata = getAnalyticsMetadataProps(props as BasePropsWithAnalyticsMetadata);\n const baseComponentProps = useBaseComponent(\n 'Modal',\n {\n props: { size, disableContentPaddings: props.disableContentPaddings },\n metadata: {\n hasResourceType: Boolean(analyticsMetadata?.resourceType),\n hasInstanceIdentifier: Boolean(analyticsMetadata?.instanceIdentifier),\n },\n },\n analyticsMetadata\n );\n\n if (!isInFunnel) {\n return (\n <ModalWithAnalyticsFunnel\n analyticsMetadata={analyticsMetadata}\n baseComponentProps={baseComponentProps}\n size={size}\n {...props}\n />\n );\n }\n\n return <InternalModal size={size} {...props} {...baseComponentProps} __injectAnalyticsComponentMetadata={true} />;\n}\n\napplyDisplayName(Modal, 'Modal');\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/modal/index.tsx"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EACL,eAAe,EACf,mBAAmB,EACnB,sBAAsB,GACvB,MAAM,mDAAmD,CAAC;AAC3D,OAAO,EAAE,SAAS,EAAE,MAAM,wCAAwC,CAAC;AACnE,OAAO,EAAE,kBAAkB,EAAE,MAAM,iCAAiC,CAAC;AACrE,OAAO,EAAkC,yBAAyB,EAAE,MAAM,4BAA4B,CAAC;AACvG,OAAO,gBAAgB,MAAM,sCAAsC,CAAC;AACpE,OAAO,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAC;AAC9D,OAAO,EAAE,gBAAgB,EAAE,MAAM,sCAAsC,CAAC;AAExE,OAAO,aAAa,EAAE,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAC;AAElE,OAAO,MAAM,MAAM,iBAAiB,CAAC;AAIrC,SAAS,wBAAwB,CAAC,EAKiE;QALjE,EAChC,iBAAiB,EACjB,kBAAkB,EAClB,IAAI,GAAG,QAAQ,OAEkF,EAD9F,KAAK,cAJwB,mDAKjC,CADS;IAER,MAAM,OAAO,GAAG,WAAW,EAAE,CAAC;IAC9B,MAAM,cAAc,GAAG;QACrB,CAAC,kBAAkB,CAAC,EAAE,OAAO;KAC9B,CAAC;IAEF,OAAO,CACL,oBAAC,eAAe,IACd,OAAO,EAAE,KAAK,CAAC,OAAO,EACtB,gBAAgB,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AAiB,GAAG,yBAAyB,CAAC,KAAuC,CAAC,CAAC;IAC7F,MAAM,kBAAkB,GAAG,gBAAgB,CACzC,OAAO,EACP;QACE,KAAK,EAAE,EAAE,IAAI,EAAE,sBAAsB,EAAE,KAAK,CAAC,sBAAsB,EAAE;QACrE,QAAQ,EAAE;YACR,eAAe,EAAE,OAAO,CAAC,iBAAiB,aAAjB,iBAAiB,uBAAjB,iBAAiB,CAAE,YAAY,CAAC;YACzD,qBAAqB,EAAE,OAAO,CAAC,iBAAiB,aAAjB,iBAAiB,uBAAjB,iBAAiB,CAAE,kBAAkB,CAAC;SACtE;KACF,EACD,iBAAiB,CAClB,CAAC;IAEF,IAAI,CAAC,UAAU,EAAE;QACf,OAAO,CACL,oBAAC,wBAAwB,kBACvB,iBAAiB,EAAE,iBAAiB,EACpC,kBAAkB,EAAE,kBAAkB,EACtC,IAAI,EAAE,IAAI,IACN,KAAK,EACT,CACH,CAAC;KACH;IAED,OAAO,oBAAC,aAAa,kBAAC,IAAI,EAAE,IAAI,IAAM,KAAK,EAAM,kBAAkB,IAAE,kCAAkC,EAAE,IAAI,IAAI,CAAC;AACpH,CAAC;AAED,gBAAgB,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\n\nimport {\n AnalyticsFunnel,\n AnalyticsFunnelStep,\n AnalyticsFunnelSubStep,\n} from '../internal/analytics/components/analytics-funnel';\nimport { useFunnel } from '../internal/analytics/hooks/use-funnel';\nimport { DATA_ATTR_MODAL_ID } from '../internal/analytics/selectors';\nimport { BasePropsWithAnalyticsMetadata, getAnalyticsMetadataProps } from '../internal/base-component';\nimport useBaseComponent from '../internal/hooks/use-base-component';\nimport { useUniqueId } from '../internal/hooks/use-unique-id';\nimport { applyDisplayName } from '../internal/utils/apply-display-name';\nimport { ModalProps } from './interfaces';\nimport InternalModal, { InternalModalAsFunnel } from './internal';\n\nimport styles from './styles.css.js';\n\nexport { ModalProps };\n\nfunction ModalWithAnalyticsFunnel({\n analyticsMetadata,\n baseComponentProps,\n size = 'medium',\n ...props\n}: ModalProps & { analyticsMetadata: any; baseComponentProps: ReturnType<typeof useBaseComponent> }) {\n const modalId = useUniqueId();\n const dataAttributes = {\n [DATA_ATTR_MODAL_ID]: modalId,\n };\n\n return (\n <AnalyticsFunnel\n mounted={props.visible}\n funnelIdentifier={analyticsMetadata?.instanceIdentifier}\n funnelFlowType={analyticsMetadata?.flowType}\n funnelErrorContext={analyticsMetadata?.errorContext}\n funnelResourceType={analyticsMetadata?.resourceType}\n funnelType=\"modal\"\n optionalStepNumbers={[]}\n totalFunnelSteps={1}\n funnelNameSelectors={[`[${DATA_ATTR_MODAL_ID}=\"${CSS.escape(modalId)}\"] .${styles['header--text']}`]}\n >\n <AnalyticsFunnelStep\n mounted={props.visible}\n stepIdentifier={analyticsMetadata?.instanceIdentifier}\n stepErrorContext={analyticsMetadata?.errorContext}\n stepNumber={1}\n >\n <AnalyticsFunnelSubStep\n subStepIdentifier={analyticsMetadata?.instanceIdentifier}\n subStepErrorContext={analyticsMetadata?.errorContext}\n >\n <InternalModalAsFunnel\n size={size}\n {...props}\n {...baseComponentProps}\n {...dataAttributes}\n __injectAnalyticsComponentMetadata={true}\n />\n </AnalyticsFunnelSubStep>\n </AnalyticsFunnelStep>\n </AnalyticsFunnel>\n );\n}\n\nexport default function Modal({ size = 'medium', ...props }: ModalProps) {\n const { isInFunnel } = useFunnel();\n const analyticsMetadata = getAnalyticsMetadataProps(props as BasePropsWithAnalyticsMetadata);\n const baseComponentProps = useBaseComponent(\n 'Modal',\n {\n props: { size, disableContentPaddings: props.disableContentPaddings },\n metadata: {\n hasResourceType: Boolean(analyticsMetadata?.resourceType),\n hasInstanceIdentifier: Boolean(analyticsMetadata?.instanceIdentifier),\n },\n },\n analyticsMetadata\n );\n\n if (!isInFunnel) {\n return (\n <ModalWithAnalyticsFunnel\n analyticsMetadata={analyticsMetadata}\n baseComponentProps={baseComponentProps}\n size={size}\n {...props}\n />\n );\n }\n\n return <InternalModal size={size} {...props} {...baseComponentProps} __injectAnalyticsComponentMetadata={true} />;\n}\n\napplyDisplayName(Modal, 'Modal');\n"]}
package/modal/internal.js CHANGED
@@ -154,7 +154,7 @@ function PortaledModal(_a) {
154
154
  componentLoadingCount,
155
155
  emitTimeToContentReadyInModal,
156
156
  } },
157
- React.createElement("div", Object.assign({}, baseProps, __funnelProps, __funnelStepProps, { className: clsx(styles.root, { [styles.hidden]: !visible }, baseProps.className, isRefresh && styles.refresh), role: "dialog", "aria-modal": true, "aria-labelledby": headerId, onMouseDown: onOverlayMouseDown, onClick: onOverlayClick, ref: mergedRef, style: footerHeight ? { scrollPaddingBottom: footerHeight } : undefined, "data-awsui-referrer-id": ((_b = subStepRef.current) === null || _b === void 0 ? void 0 : _b.id) || referrerId }),
157
+ React.createElement("div", Object.assign({}, baseProps, __funnelProps, __funnelStepProps, { className: clsx(styles.root, { [styles.hidden]: !visible }, baseProps.className, isRefresh && styles.refresh), role: "dialog", "aria-labelledby": headerId, onMouseDown: onOverlayMouseDown, onClick: onOverlayClick, ref: mergedRef, style: footerHeight ? { scrollPaddingBottom: footerHeight } : undefined, "data-awsui-referrer-id": ((_b = subStepRef.current) === null || _b === void 0 ? void 0 : _b.id) || referrerId }),
158
158
  React.createElement(FocusLock, { disabled: !visible, autoFocus: true, restoreFocus: true, className: styles['focus-lock'] },
159
159
  React.createElement("div", Object.assign({ className: clsx(styles.dialog, styles[size], styles[`breakpoint-${breakpoint}`], isRefresh && styles.refresh), onKeyDown: escKeyHandler }, metadataAttribute),
160
160
  React.createElement("div", { className: styles.container },
@@ -1 +1 @@
1
- {"version":3,"file":"internal.js","sourceRoot":"","sources":["../../../src/modal/internal.tsx"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,OAAO,CA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EAAE,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE,kBAAkB,CAAC,MAAM,CAAC;oCAC5D,oBAAC,cAAc,IACb,OAAO,EAAC,IAAI,EACZ,wBAAwB,EAAE,IAAI,EAC9B,OAAO,EACL,6CACM,6BAA6B,CAAC;4CAChC,MAAM,EAAE,SAAS;yCACiC,CAAC;4CAErD,oBAAC,cAAc,IACb,SAAS,EAAE,cAAc,EACzB,SAAS,EAAE,MAAM,CAAC,iBAAiB,CAAC,EACpC,OAAO,EAAC,eAAe,EACvB,QAAQ,EAAC,OAAO,EAChB,UAAU,EAAC,MAAM,EACjB,OAAO,EAAE,kBAAkB,GAC3B,CACE;wCAGR,8BAAM,GAAG,EAAE,SAAS,EAAE,EAAE,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,CAAC,cAAc,CAAC,IAClE,MAAM,CACF,CACQ,CACb;gCACN,2CACE,GAAG,EAAE,YAAY,IACb,oBAAoB,IACxB,SAAS,EAAE,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,EAAE,CAAC,MAAM,CAAC,aAAa,CAAC,CAAC,EAAE,sBAAsB,EAAE,CAAC;oCAEnF,QAAQ;oCACT,6BAAK,GAAG,EAAE,iBAAiB,GAAI,CAC3B;gCACL,MAAM,IAAI,CACT,oBAAC,aAAa,CAAC,QAAQ,IAAC,KAAK,EAAE,EAAE,OAAO,EAAE,aAAa,EAAE;oCACvD,6BAAK,GAAG,EAAE,SAAS,EAAE,SAAS,EAAE,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE,WAAW,IAAI,MAAM,CAAC,eAAe,CAAC,CAAC,IACxF,MAAM,CACH,CACiB,CAC1B,CACG,CACF,CACI,CACR,CACgB,CACF,CACW,CACtC,CAAC;AACJ,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useEffect, useRef } from 'react';\nimport clsx from 'clsx';\n\nimport { useContainerQuery } from '@cloudscape-design/component-toolkit';\nimport { getAnalyticsMetadataAttribute } from '@cloudscape-design/component-toolkit/internal/analytics-metadata';\n\nimport { InternalButton } from '../button/internal';\nimport InternalHeader from '../header/internal';\nimport { useInternalI18n } from '../i18n/context';\nimport { PerformanceMetrics } from '../internal/analytics';\nimport {\n FunnelNameSelectorContext,\n FunnelStepContextValue,\n FunnelSubStepContextValue,\n} from '../internal/analytics/context/analytics-context';\nimport { FunnelProps, useFunnel, useFunnelStep, useFunnelSubStep } from '../internal/analytics/hooks/use-funnel';\nimport { getBaseProps } from '../internal/base-component';\nimport FocusLock from '../internal/components/focus-lock';\nimport Portal from '../internal/components/portal';\nimport { ButtonContext, ButtonContextProps } from '../internal/context/button-context';\nimport { ModalContext } from '../internal/context/modal-context';\nimport ResetContextsForModal from '../internal/context/reset-contexts-for-modal';\nimport { fireNonCancelableEvent } from '../internal/events';\nimport { useContainerBreakpoints } from '../internal/hooks/container-queries';\nimport { InternalBaseComponentProps } from '../internal/hooks/use-base-component';\nimport { useIntersectionObserver } from '../internal/hooks/use-intersection-observer';\nimport { useMergeRefs } from '../internal/hooks/use-merge-refs';\nimport { useUniqueId } from '../internal/hooks/use-unique-id';\nimport { useVisualRefresh } from '../internal/hooks/use-visual-mode';\nimport { KeyCode } from '../internal/keycode';\nimport { SomeRequired } from '../internal/types';\nimport {\n GeneratedAnalyticsMetadataModalComponent,\n GeneratedAnalyticsMetadataModalDismiss,\n} from './analytics-metadata/interfaces';\nimport { disableBodyScrolling, enableBodyScrolling } from './body-scroll';\nimport { ModalProps } from './interfaces';\n\nimport analyticsSelectors from './analytics-metadata/styles.css.js';\nimport styles from './styles.css.js';\n\nexport function InternalModalAsFunnel(props: InternalModalProps) {\n const { funnelProps, funnelSubmit, funnelNextOrSubmitAttempt } = useFunnel();\n const { funnelStepProps } = useFunnelStep();\n const { subStepRef, funnelSubStepProps } = useFunnelSubStep();\n const onButtonClick: ButtonContextProps['onClick'] = ({ variant }) => {\n if (variant === 'primary') {\n funnelNextOrSubmitAttempt();\n funnelSubmit();\n }\n };\n\n return (\n <InternalModal\n __funnelProps={funnelProps}\n __funnelStepProps={funnelStepProps}\n __subStepRef={subStepRef}\n __subStepFunnelProps={funnelSubStepProps}\n onButtonClick={onButtonClick}\n {...props}\n />\n );\n}\n\ntype InternalModalProps = SomeRequired<ModalProps, 'size'> &\n InternalBaseComponentProps & {\n __funnelProps?: FunnelProps;\n __funnelStepProps?: FunnelStepContextValue['funnelStepProps'];\n __subStepRef?: FunnelSubStepContextValue['subStepRef'];\n __subStepFunnelProps?: FunnelSubStepContextValue['funnelSubStepProps'];\n __injectAnalyticsComponentMetadata?: boolean;\n onButtonClick?: ButtonContextProps['onClick'];\n referrerId?: string;\n };\n\nexport default function InternalModal({ modalRoot, getModalRoot, removeModalRoot, ...rest }: InternalModalProps) {\n return (\n <Portal container={modalRoot} getContainer={getModalRoot} removeContainer={removeModalRoot}>\n <PortaledModal {...rest} />\n </Portal>\n );\n}\n\ntype PortaledModalProps = Omit<InternalModalProps, 'modalRoot' | 'getModalRoot' | 'removeModalRoot'>;\n\n// Separate component to prevent the Portal from getting in the way of refs, as it needs extra cycles to render the inner components.\n// useContainerQuery needs its targeted element to exist on the first render in order to work properly.\nfunction PortaledModal({\n size,\n visible,\n header,\n children,\n footer,\n disableContentPaddings,\n onButtonClick = () => {},\n onDismiss,\n __internalRootRef = null,\n __injectAnalyticsComponentMetadata,\n __funnelProps,\n __funnelStepProps,\n __subStepRef,\n __subStepFunnelProps,\n referrerId,\n ...rest\n}: PortaledModalProps) {\n const instanceUniqueId = useUniqueId();\n const headerId = `${rest.id || instanceUniqueId}-header`;\n const lastMouseDownElementRef = useRef<HTMLElement | null>(null);\n const [breakpoint, breakpointsRef] = useContainerBreakpoints(['xs']);\n\n const i18n = useInternalI18n('modal');\n const closeAriaLabel = i18n('closeAriaLabel', rest.closeAriaLabel);\n\n const refObject = useRef<HTMLDivElement>(null);\n const mergedRef = useMergeRefs(breakpointsRef, refObject, __internalRootRef);\n\n const isRefresh = useVisualRefresh();\n\n const baseProps = getBaseProps(rest);\n\n const analyticsComponentMetadata: GeneratedAnalyticsMetadataModalComponent = {\n name: 'awsui.Modal',\n label: `.${analyticsSelectors.header} h2`,\n };\n const metadataAttribute = __injectAnalyticsComponentMetadata\n ? getAnalyticsMetadataAttribute({ component: analyticsComponentMetadata })\n : {};\n const loadStartTime = useRef<number>(0);\n const loadCompleteTime = useRef<number>(0);\n const componentLoadingCount = useRef<number>(0);\n const performanceMetricLogged = useRef<boolean>(false);\n\n // enable body scroll and restore focus if unmounting while visible\n useEffect(() => {\n return () => {\n enableBodyScrolling();\n };\n }, []);\n\n const resetModalPerformanceData = () => {\n loadStartTime.current = performance.now();\n loadCompleteTime.current = 0;\n performanceMetricLogged.current = false;\n };\n\n const emitTimeToContentReadyInModal = (loadCompleteTime: number) => {\n if (\n componentLoadingCount.current === 0 &&\n loadStartTime.current &&\n loadStartTime.current !== 0 &&\n !performanceMetricLogged.current\n ) {\n const timeToContentReadyInModal = loadCompleteTime - loadStartTime.current;\n PerformanceMetrics.modalPerformanceData({\n timeToContentReadyInModal,\n instanceIdentifier: instanceUniqueId,\n componentIdentifier: headerRef.current?.textContent || '',\n });\n performanceMetricLogged.current = true;\n }\n };\n\n const MODAL_READY_TIMEOUT = 100;\n /**\n * This useEffect is triggered when the visible attribute of modal changes.\n * When modal becomes visible, modal performance metrics are reset marking the beginning loading process.\n * To ensure that the modal component ready metric is always emitted, a setTimeout is implemented.\n * This setTimeout automatically emits the component ready metric after a specified duration.\n */\n useEffect(() => {\n if (visible) {\n disableBodyScrolling();\n resetModalPerformanceData();\n setTimeout(() => {\n emitTimeToContentReadyInModal(loadStartTime.current);\n }, MODAL_READY_TIMEOUT);\n } else {\n enableBodyScrolling();\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [visible]);\n\n // Because we hide the element with styles (and not actually detach it from DOM), we need to scroll to top\n useEffect(() => {\n if (visible && refObject.current) {\n refObject.current.scrollTop = 0;\n }\n }, [visible]);\n\n const dismiss = (reason: string) => fireNonCancelableEvent(onDismiss, { reason });\n\n const onOverlayMouseDown = (event: React.MouseEvent) => {\n lastMouseDownElementRef.current = event.target as HTMLElement;\n };\n const onOverlayClick = (event: React.MouseEvent) => {\n const overlay = refObject.current;\n const lastClicked = lastMouseDownElementRef.current;\n\n if (event.target === overlay && lastClicked === overlay) {\n dismiss('overlay');\n }\n };\n const onCloseButtonClick = () => dismiss('closeButton');\n const escKeyHandler = (event: React.KeyboardEvent) => {\n if (event.keyCode === KeyCode.escape) {\n dismiss('keyboard');\n }\n };\n\n // We use an empty div element at the end of the content slot as a sentinel\n // to detect when the user has scrolled to the bottom.\n const { ref: stickySentinelRef, isIntersecting: footerStuck } = useIntersectionObserver();\n\n // Add extra scroll padding to account for the height of the sticky footer,\n // to prevent it from covering focused elements.\n const [footerHeight, footerRef] = useContainerQuery(rect => rect.borderBoxHeight);\n const headerRef = useRef<HTMLDivElement>(null);\n const { subStepRef } = useFunnelSubStep();\n\n return (\n <FunnelNameSelectorContext.Provider value={`.${styles['header--text']}`}>\n <ResetContextsForModal>\n <ModalContext.Provider\n value={{\n isInModal: true,\n componentLoadingCount,\n emitTimeToContentReadyInModal,\n }}\n >\n <div\n {...baseProps}\n {...__funnelProps}\n {...__funnelStepProps}\n className={clsx(\n styles.root,\n { [styles.hidden]: !visible },\n baseProps.className,\n isRefresh && styles.refresh\n )}\n role=\"dialog\"\n aria-modal={true}\n aria-labelledby={headerId}\n onMouseDown={onOverlayMouseDown}\n onClick={onOverlayClick}\n ref={mergedRef}\n style={footerHeight ? { scrollPaddingBottom: footerHeight } : undefined}\n data-awsui-referrer-id={subStepRef.current?.id || referrerId}\n >\n <FocusLock disabled={!visible} autoFocus={true} restoreFocus={true} className={styles['focus-lock']}>\n <div\n className={clsx(\n styles.dialog,\n styles[size],\n styles[`breakpoint-${breakpoint}`],\n isRefresh && styles.refresh\n )}\n onKeyDown={escKeyHandler}\n {...metadataAttribute}\n >\n <div className={styles.container}>\n <div className={clsx(styles.header, analyticsSelectors.header)}>\n <InternalHeader\n variant=\"h2\"\n __disableActionsWrapping={true}\n actions={\n <div\n {...getAnalyticsMetadataAttribute({\n action: 'dismiss',\n } as Partial<GeneratedAnalyticsMetadataModalDismiss>)}\n >\n <InternalButton\n ariaLabel={closeAriaLabel}\n className={styles['dismiss-control']}\n variant=\"modal-dismiss\"\n iconName=\"close\"\n formAction=\"none\"\n onClick={onCloseButtonClick}\n />\n </div>\n }\n >\n <span ref={headerRef} id={headerId} className={styles['header--text']}>\n {header}\n </span>\n </InternalHeader>\n </div>\n <div\n ref={__subStepRef}\n {...__subStepFunnelProps}\n className={clsx(styles.content, { [styles['no-paddings']]: disableContentPaddings })}\n >\n {children}\n <div ref={stickySentinelRef} />\n </div>\n {footer && (\n <ButtonContext.Provider value={{ onClick: onButtonClick }}>\n <div ref={footerRef} className={clsx(styles.footer, footerStuck && styles['footer--stuck'])}>\n {footer}\n </div>\n </ButtonContext.Provider>\n )}\n </div>\n </div>\n </FocusLock>\n </div>\n </ModalContext.Provider>\n </ResetContextsForModal>\n </FunnelNameSelectorContext.Provider>\n );\n}\n"]}
1
+ {"version":3,"file":"internal.js","sourceRoot":"","sources":["../../../src/modal/internal.tsx"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AACjD,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,iBAAiB,EAAE,MAAM,sCAAsC,CAAC;AACzE,OAAO,EAAE,6BAA6B,EAAE,MAAM,kEAAkE,CAAC;AAEjH,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,cAAc,MAAM,oBAAoB,CAAC;AAChD,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAC3D,O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UAAU,EAAC,MAAM,EACjB,OAAO,EAAE,kBAAkB,GAC3B,CACE;wCAGR,8BAAM,GAAG,EAAE,SAAS,EAAE,EAAE,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,CAAC,cAAc,CAAC,IAClE,MAAM,CACF,CACQ,CACb;gCACN,2CACE,GAAG,EAAE,YAAY,IACb,oBAAoB,IACxB,SAAS,EAAE,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,EAAE,CAAC,MAAM,CAAC,aAAa,CAAC,CAAC,EAAE,sBAAsB,EAAE,CAAC;oCAEnF,QAAQ;oCACT,6BAAK,GAAG,EAAE,iBAAiB,GAAI,CAC3B;gCACL,MAAM,IAAI,CACT,oBAAC,aAAa,CAAC,QAAQ,IAAC,KAAK,EAAE,EAAE,OAAO,EAAE,aAAa,EAAE;oCACvD,6BAAK,GAAG,EAAE,SAAS,EAAE,SAAS,EAAE,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE,WAAW,IAAI,MAAM,CAAC,eAAe,CAAC,CAAC,IACxF,MAAM,CACH,CACiB,CAC1B,CACG,CACF,CACI,CACR,CACgB,CACF,CACW,CACtC,CAAC;AACJ,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useEffect, useRef } from 'react';\nimport clsx from 'clsx';\n\nimport { useContainerQuery } from '@cloudscape-design/component-toolkit';\nimport { getAnalyticsMetadataAttribute } from '@cloudscape-design/component-toolkit/internal/analytics-metadata';\n\nimport { InternalButton } from '../button/internal';\nimport InternalHeader from '../header/internal';\nimport { useInternalI18n } from '../i18n/context';\nimport { PerformanceMetrics } from '../internal/analytics';\nimport {\n FunnelNameSelectorContext,\n FunnelStepContextValue,\n FunnelSubStepContextValue,\n} from '../internal/analytics/context/analytics-context';\nimport { FunnelProps, useFunnel, useFunnelStep, useFunnelSubStep } from '../internal/analytics/hooks/use-funnel';\nimport { getBaseProps } from '../internal/base-component';\nimport FocusLock from '../internal/components/focus-lock';\nimport Portal from '../internal/components/portal';\nimport { ButtonContext, ButtonContextProps } from '../internal/context/button-context';\nimport { ModalContext } from '../internal/context/modal-context';\nimport ResetContextsForModal from '../internal/context/reset-contexts-for-modal';\nimport { fireNonCancelableEvent } from '../internal/events';\nimport { useContainerBreakpoints } from '../internal/hooks/container-queries';\nimport { InternalBaseComponentProps } from '../internal/hooks/use-base-component';\nimport { useIntersectionObserver } from '../internal/hooks/use-intersection-observer';\nimport { useMergeRefs } from '../internal/hooks/use-merge-refs';\nimport { useUniqueId } from '../internal/hooks/use-unique-id';\nimport { useVisualRefresh } from '../internal/hooks/use-visual-mode';\nimport { KeyCode } from '../internal/keycode';\nimport { SomeRequired } from '../internal/types';\nimport {\n GeneratedAnalyticsMetadataModalComponent,\n GeneratedAnalyticsMetadataModalDismiss,\n} from './analytics-metadata/interfaces';\nimport { disableBodyScrolling, enableBodyScrolling } from './body-scroll';\nimport { ModalProps } from './interfaces';\n\nimport analyticsSelectors from './analytics-metadata/styles.css.js';\nimport styles from './styles.css.js';\n\nexport function InternalModalAsFunnel(props: InternalModalProps) {\n const { funnelProps, funnelSubmit, funnelNextOrSubmitAttempt } = useFunnel();\n const { funnelStepProps } = useFunnelStep();\n const { subStepRef, funnelSubStepProps } = useFunnelSubStep();\n const onButtonClick: ButtonContextProps['onClick'] = ({ variant }) => {\n if (variant === 'primary') {\n funnelNextOrSubmitAttempt();\n funnelSubmit();\n }\n };\n\n return (\n <InternalModal\n __funnelProps={funnelProps}\n __funnelStepProps={funnelStepProps}\n __subStepRef={subStepRef}\n __subStepFunnelProps={funnelSubStepProps}\n onButtonClick={onButtonClick}\n {...props}\n />\n );\n}\n\ntype InternalModalProps = SomeRequired<ModalProps, 'size'> &\n InternalBaseComponentProps & {\n __funnelProps?: FunnelProps;\n __funnelStepProps?: FunnelStepContextValue['funnelStepProps'];\n __subStepRef?: FunnelSubStepContextValue['subStepRef'];\n __subStepFunnelProps?: FunnelSubStepContextValue['funnelSubStepProps'];\n __injectAnalyticsComponentMetadata?: boolean;\n onButtonClick?: ButtonContextProps['onClick'];\n referrerId?: string;\n };\n\nexport default function InternalModal({ modalRoot, getModalRoot, removeModalRoot, ...rest }: InternalModalProps) {\n return (\n <Portal container={modalRoot} getContainer={getModalRoot} removeContainer={removeModalRoot}>\n <PortaledModal {...rest} />\n </Portal>\n );\n}\n\ntype PortaledModalProps = Omit<InternalModalProps, 'modalRoot' | 'getModalRoot' | 'removeModalRoot'>;\n\n// Separate component to prevent the Portal from getting in the way of refs, as it needs extra cycles to render the inner components.\n// useContainerQuery needs its targeted element to exist on the first render in order to work properly.\nfunction PortaledModal({\n size,\n visible,\n header,\n children,\n footer,\n disableContentPaddings,\n onButtonClick = () => {},\n onDismiss,\n __internalRootRef = null,\n __injectAnalyticsComponentMetadata,\n __funnelProps,\n __funnelStepProps,\n __subStepRef,\n __subStepFunnelProps,\n referrerId,\n ...rest\n}: PortaledModalProps) {\n const instanceUniqueId = useUniqueId();\n const headerId = `${rest.id || instanceUniqueId}-header`;\n const lastMouseDownElementRef = useRef<HTMLElement | null>(null);\n const [breakpoint, breakpointsRef] = useContainerBreakpoints(['xs']);\n\n const i18n = useInternalI18n('modal');\n const closeAriaLabel = i18n('closeAriaLabel', rest.closeAriaLabel);\n\n const refObject = useRef<HTMLDivElement>(null);\n const mergedRef = useMergeRefs(breakpointsRef, refObject, __internalRootRef);\n\n const isRefresh = useVisualRefresh();\n\n const baseProps = getBaseProps(rest);\n\n const analyticsComponentMetadata: GeneratedAnalyticsMetadataModalComponent = {\n name: 'awsui.Modal',\n label: `.${analyticsSelectors.header} h2`,\n };\n const metadataAttribute = __injectAnalyticsComponentMetadata\n ? getAnalyticsMetadataAttribute({ component: analyticsComponentMetadata })\n : {};\n const loadStartTime = useRef<number>(0);\n const loadCompleteTime = useRef<number>(0);\n const componentLoadingCount = useRef<number>(0);\n const performanceMetricLogged = useRef<boolean>(false);\n\n // enable body scroll and restore focus if unmounting while visible\n useEffect(() => {\n return () => {\n enableBodyScrolling();\n };\n }, []);\n\n const resetModalPerformanceData = () => {\n loadStartTime.current = performance.now();\n loadCompleteTime.current = 0;\n performanceMetricLogged.current = false;\n };\n\n const emitTimeToContentReadyInModal = (loadCompleteTime: number) => {\n if (\n componentLoadingCount.current === 0 &&\n loadStartTime.current &&\n loadStartTime.current !== 0 &&\n !performanceMetricLogged.current\n ) {\n const timeToContentReadyInModal = loadCompleteTime - loadStartTime.current;\n PerformanceMetrics.modalPerformanceData({\n timeToContentReadyInModal,\n instanceIdentifier: instanceUniqueId,\n componentIdentifier: headerRef.current?.textContent || '',\n });\n performanceMetricLogged.current = true;\n }\n };\n\n const MODAL_READY_TIMEOUT = 100;\n /**\n * This useEffect is triggered when the visible attribute of modal changes.\n * When modal becomes visible, modal performance metrics are reset marking the beginning loading process.\n * To ensure that the modal component ready metric is always emitted, a setTimeout is implemented.\n * This setTimeout automatically emits the component ready metric after a specified duration.\n */\n useEffect(() => {\n if (visible) {\n disableBodyScrolling();\n resetModalPerformanceData();\n setTimeout(() => {\n emitTimeToContentReadyInModal(loadStartTime.current);\n }, MODAL_READY_TIMEOUT);\n } else {\n enableBodyScrolling();\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [visible]);\n\n // Because we hide the element with styles (and not actually detach it from DOM), we need to scroll to top\n useEffect(() => {\n if (visible && refObject.current) {\n refObject.current.scrollTop = 0;\n }\n }, [visible]);\n\n const dismiss = (reason: string) => fireNonCancelableEvent(onDismiss, { reason });\n\n const onOverlayMouseDown = (event: React.MouseEvent) => {\n lastMouseDownElementRef.current = event.target as HTMLElement;\n };\n const onOverlayClick = (event: React.MouseEvent) => {\n const overlay = refObject.current;\n const lastClicked = lastMouseDownElementRef.current;\n\n if (event.target === overlay && lastClicked === overlay) {\n dismiss('overlay');\n }\n };\n const onCloseButtonClick = () => dismiss('closeButton');\n const escKeyHandler = (event: React.KeyboardEvent) => {\n if (event.keyCode === KeyCode.escape) {\n dismiss('keyboard');\n }\n };\n\n // We use an empty div element at the end of the content slot as a sentinel\n // to detect when the user has scrolled to the bottom.\n const { ref: stickySentinelRef, isIntersecting: footerStuck } = useIntersectionObserver();\n\n // Add extra scroll padding to account for the height of the sticky footer,\n // to prevent it from covering focused elements.\n const [footerHeight, footerRef] = useContainerQuery(rect => rect.borderBoxHeight);\n const headerRef = useRef<HTMLDivElement>(null);\n const { subStepRef } = useFunnelSubStep();\n\n return (\n <FunnelNameSelectorContext.Provider value={`.${styles['header--text']}`}>\n <ResetContextsForModal>\n <ModalContext.Provider\n value={{\n isInModal: true,\n componentLoadingCount,\n emitTimeToContentReadyInModal,\n }}\n >\n <div\n {...baseProps}\n {...__funnelProps}\n {...__funnelStepProps}\n className={clsx(\n styles.root,\n { [styles.hidden]: !visible },\n baseProps.className,\n isRefresh && styles.refresh\n )}\n role=\"dialog\"\n aria-labelledby={headerId}\n onMouseDown={onOverlayMouseDown}\n onClick={onOverlayClick}\n ref={mergedRef}\n style={footerHeight ? { scrollPaddingBottom: footerHeight } : undefined}\n data-awsui-referrer-id={subStepRef.current?.id || referrerId}\n >\n <FocusLock disabled={!visible} autoFocus={true} restoreFocus={true} className={styles['focus-lock']}>\n <div\n className={clsx(\n styles.dialog,\n styles[size],\n styles[`breakpoint-${breakpoint}`],\n isRefresh && styles.refresh\n )}\n onKeyDown={escKeyHandler}\n {...metadataAttribute}\n >\n <div className={styles.container}>\n <div className={clsx(styles.header, analyticsSelectors.header)}>\n <InternalHeader\n variant=\"h2\"\n __disableActionsWrapping={true}\n actions={\n <div\n {...getAnalyticsMetadataAttribute({\n action: 'dismiss',\n } as Partial<GeneratedAnalyticsMetadataModalDismiss>)}\n >\n <InternalButton\n ariaLabel={closeAriaLabel}\n className={styles['dismiss-control']}\n variant=\"modal-dismiss\"\n iconName=\"close\"\n formAction=\"none\"\n onClick={onCloseButtonClick}\n />\n </div>\n }\n >\n <span ref={headerRef} id={headerId} className={styles['header--text']}>\n {header}\n </span>\n </InternalHeader>\n </div>\n <div\n ref={__subStepRef}\n {...__subStepFunnelProps}\n className={clsx(styles.content, { [styles['no-paddings']]: disableContentPaddings })}\n >\n {children}\n <div ref={stickySentinelRef} />\n </div>\n {footer && (\n <ButtonContext.Provider value={{ onClick: onButtonClick }}>\n <div ref={footerRef} className={clsx(styles.footer, footerStuck && styles['footer--stuck'])}>\n {footer}\n </div>\n </ButtonContext.Provider>\n )}\n </div>\n </div>\n </FocusLock>\n </div>\n </ModalContext.Provider>\n </ResetContextsForModal>\n </FunnelNameSelectorContext.Provider>\n );\n}\n"]}
@@ -1,28 +1,28 @@
1
1
 
2
2
  import './styles.scoped.css';
3
3
  export default {
4
- "dialog": "awsui_dialog_1d2i7_11r6m_165",
5
- "modal-slide-up": "awsui_modal-slide-up_1d2i7_11r6m_1",
6
- "awsui-motion-fade-in-0": "awsui_awsui-motion-fade-in-0_1d2i7_11r6m_1",
7
- "refresh": "awsui_refresh_1d2i7_11r6m_188",
8
- "awsui-motion-scale-popup": "awsui_awsui-motion-scale-popup_1d2i7_11r6m_1",
9
- "root": "awsui_root_1d2i7_11r6m_221",
10
- "awsui-motion-fade-in": "awsui_awsui-motion-fade-in_1d2i7_11r6m_1",
11
- "hidden": "awsui_hidden_1d2i7_11r6m_301",
12
- "focus-lock": "awsui_focus-lock_1d2i7_11r6m_305",
13
- "small": "awsui_small_1d2i7_11r6m_325",
14
- "medium": "awsui_medium_1d2i7_11r6m_328",
15
- "large": "awsui_large_1d2i7_11r6m_331",
16
- "max": "awsui_max_1d2i7_11r6m_334",
17
- "breakpoint-xs": "awsui_breakpoint-xs_1d2i7_11r6m_334",
18
- "container": "awsui_container_1d2i7_11r6m_340",
19
- "content": "awsui_content_1d2i7_11r6m_384",
20
- "no-paddings": "awsui_no-paddings_1d2i7_11r6m_389",
21
- "header": "awsui_header_1d2i7_11r6m_394",
22
- "header--text": "awsui_header--text_1d2i7_11r6m_406",
23
- "footer": "awsui_footer_1d2i7_11r6m_410",
24
- "footer--stuck": "awsui_footer--stuck_1d2i7_11r6m_419",
25
- "dismiss-control": "awsui_dismiss-control_1d2i7_11r6m_431",
26
- "modal-open": "awsui_modal-open_1d2i7_11r6m_435"
4
+ "dialog": "awsui_dialog_1d2i7_tft8j_165",
5
+ "modal-slide-up": "awsui_modal-slide-up_1d2i7_tft8j_1",
6
+ "awsui-motion-fade-in-0": "awsui_awsui-motion-fade-in-0_1d2i7_tft8j_1",
7
+ "refresh": "awsui_refresh_1d2i7_tft8j_188",
8
+ "awsui-motion-scale-popup": "awsui_awsui-motion-scale-popup_1d2i7_tft8j_1",
9
+ "root": "awsui_root_1d2i7_tft8j_221",
10
+ "awsui-motion-fade-in": "awsui_awsui-motion-fade-in_1d2i7_tft8j_1",
11
+ "hidden": "awsui_hidden_1d2i7_tft8j_298",
12
+ "focus-lock": "awsui_focus-lock_1d2i7_tft8j_302",
13
+ "small": "awsui_small_1d2i7_tft8j_322",
14
+ "medium": "awsui_medium_1d2i7_tft8j_325",
15
+ "large": "awsui_large_1d2i7_tft8j_328",
16
+ "max": "awsui_max_1d2i7_tft8j_331",
17
+ "breakpoint-xs": "awsui_breakpoint-xs_1d2i7_tft8j_331",
18
+ "container": "awsui_container_1d2i7_tft8j_337",
19
+ "content": "awsui_content_1d2i7_tft8j_378",
20
+ "no-paddings": "awsui_no-paddings_1d2i7_tft8j_383",
21
+ "header": "awsui_header_1d2i7_tft8j_388",
22
+ "header--text": "awsui_header--text_1d2i7_tft8j_400",
23
+ "footer": "awsui_footer_1d2i7_tft8j_404",
24
+ "footer--stuck": "awsui_footer--stuck_1d2i7_tft8j_413",
25
+ "dismiss-control": "awsui_dismiss-control_1d2i7_tft8j_425",
26
+ "modal-open": "awsui_modal-open_1d2i7_tft8j_429"
27
27
  };
28
28