@cloudscape-design/components 3.0.347 → 3.0.349

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 (427) hide show
  1. package/alert/styles.css.js +19 -19
  2. package/alert/styles.scoped.css +64 -64
  3. package/alert/styles.selectors.js +19 -19
  4. package/annotation-context/annotation/styles.css.js +24 -24
  5. package/annotation-context/annotation/styles.scoped.css +46 -46
  6. package/annotation-context/annotation/styles.selectors.js +24 -24
  7. package/app-layout/content-wrapper/styles.css.js +3 -3
  8. package/app-layout/content-wrapper/styles.scoped.css +10 -10
  9. package/app-layout/content-wrapper/styles.selectors.js +3 -3
  10. package/app-layout/drawer/styles.css.js +10 -10
  11. package/app-layout/drawer/styles.scoped.css +28 -28
  12. package/app-layout/drawer/styles.selectors.js +10 -10
  13. package/app-layout/mobile-toolbar/styles.css.js +8 -8
  14. package/app-layout/mobile-toolbar/styles.scoped.css +18 -18
  15. package/app-layout/mobile-toolbar/styles.selectors.js +8 -8
  16. package/app-layout/notifications/styles.css.js +3 -3
  17. package/app-layout/notifications/styles.scoped.css +7 -7
  18. package/app-layout/notifications/styles.selectors.js +3 -3
  19. package/app-layout/styles.css.js +17 -17
  20. package/app-layout/styles.scoped.css +30 -30
  21. package/app-layout/styles.selectors.js +17 -17
  22. package/app-layout/toggles/styles.css.js +2 -2
  23. package/app-layout/toggles/styles.scoped.css +16 -16
  24. package/app-layout/toggles/styles.selectors.js +2 -2
  25. package/app-layout/visual-refresh/styles.css.js +69 -69
  26. package/app-layout/visual-refresh/styles.scoped.css +267 -267
  27. package/app-layout/visual-refresh/styles.selectors.js +69 -69
  28. package/area-chart/styles.css.js +6 -6
  29. package/area-chart/styles.scoped.css +16 -16
  30. package/area-chart/styles.selectors.js +6 -6
  31. package/attribute-editor/styles.css.js +14 -14
  32. package/attribute-editor/styles.scoped.css +48 -48
  33. package/attribute-editor/styles.selectors.js +14 -14
  34. package/badge/styles.css.js +5 -5
  35. package/badge/styles.scoped.css +20 -20
  36. package/badge/styles.selectors.js +5 -5
  37. package/box/styles.css.js +189 -189
  38. package/box/styles.scoped.css +418 -418
  39. package/box/styles.selectors.js +189 -189
  40. package/breadcrumb-group/item/styles.css.js +9 -9
  41. package/breadcrumb-group/item/styles.scoped.css +28 -28
  42. package/breadcrumb-group/item/styles.selectors.js +9 -9
  43. package/breadcrumb-group/styles.css.js +7 -7
  44. package/breadcrumb-group/styles.scoped.css +22 -22
  45. package/breadcrumb-group/styles.selectors.js +7 -7
  46. package/button/styles.css.js +20 -20
  47. package/button/styles.scoped.css +472 -472
  48. package/button/styles.selectors.js +20 -20
  49. package/button-dropdown/category-elements/styles.css.js +13 -13
  50. package/button-dropdown/category-elements/styles.scoped.css +50 -50
  51. package/button-dropdown/category-elements/styles.selectors.js +13 -13
  52. package/button-dropdown/interfaces.d.ts +2 -15
  53. package/button-dropdown/interfaces.d.ts.map +1 -1
  54. package/button-dropdown/interfaces.js.map +1 -1
  55. package/button-dropdown/item-element/styles.css.js +14 -14
  56. package/button-dropdown/item-element/styles.scoped.css +42 -42
  57. package/button-dropdown/item-element/styles.selectors.js +14 -14
  58. package/button-dropdown/mobile-expandable-group/styles.css.js +5 -5
  59. package/button-dropdown/mobile-expandable-group/styles.scoped.css +10 -10
  60. package/button-dropdown/mobile-expandable-group/styles.selectors.js +5 -5
  61. package/button-dropdown/styles.css.js +14 -14
  62. package/button-dropdown/styles.scoped.css +32 -32
  63. package/button-dropdown/styles.selectors.js +14 -14
  64. package/calendar/styles.css.js +18 -18
  65. package/calendar/styles.scoped.css +89 -89
  66. package/calendar/styles.selectors.js +18 -18
  67. package/cards/styles.css.js +38 -38
  68. package/cards/styles.scoped.css +99 -99
  69. package/cards/styles.selectors.js +38 -38
  70. package/checkbox/styles.css.js +3 -3
  71. package/checkbox/styles.scoped.css +16 -16
  72. package/checkbox/styles.selectors.js +3 -3
  73. package/code-editor/resizable-box/styles.css.js +3 -3
  74. package/code-editor/resizable-box/styles.scoped.css +8 -8
  75. package/code-editor/resizable-box/styles.selectors.js +3 -3
  76. package/code-editor/styles.css.js +32 -32
  77. package/code-editor/styles.scoped.css +228 -219
  78. package/code-editor/styles.selectors.js +32 -32
  79. package/collection-preferences/content-display/styles.css.js +11 -11
  80. package/collection-preferences/content-display/styles.scoped.css +42 -42
  81. package/collection-preferences/content-display/styles.selectors.js +11 -11
  82. package/collection-preferences/styles.css.js +37 -37
  83. package/collection-preferences/styles.scoped.css +81 -81
  84. package/collection-preferences/styles.selectors.js +37 -37
  85. package/column-layout/flexible-column-layout/styles.css.js +5 -5
  86. package/column-layout/flexible-column-layout/styles.scoped.css +8 -8
  87. package/column-layout/flexible-column-layout/styles.selectors.js +5 -5
  88. package/column-layout/styles.css.js +13 -13
  89. package/column-layout/styles.scoped.css +55 -55
  90. package/column-layout/styles.selectors.js +13 -13
  91. package/container/styles.css.js +28 -28
  92. package/container/styles.scoped.css +94 -94
  93. package/container/styles.selectors.js +28 -28
  94. package/content-layout/styles.css.js +7 -7
  95. package/content-layout/styles.scoped.css +17 -17
  96. package/content-layout/styles.selectors.js +7 -7
  97. package/date-picker/styles.css.js +7 -7
  98. package/date-picker/styles.scoped.css +16 -16
  99. package/date-picker/styles.selectors.js +7 -7
  100. package/date-range-picker/calendar/grids/styles.css.js +25 -25
  101. package/date-range-picker/calendar/grids/styles.scoped.css +95 -95
  102. package/date-range-picker/calendar/grids/styles.selectors.js +25 -25
  103. package/date-range-picker/relative-range/styles.css.js +9 -9
  104. package/date-range-picker/relative-range/styles.scoped.css +16 -16
  105. package/date-range-picker/relative-range/styles.selectors.js +9 -9
  106. package/date-range-picker/styles.css.js +38 -38
  107. package/date-range-picker/styles.scoped.css +76 -76
  108. package/date-range-picker/styles.selectors.js +38 -38
  109. package/expandable-section/styles.css.js +29 -29
  110. package/expandable-section/styles.scoped.css +106 -106
  111. package/expandable-section/styles.selectors.js +29 -29
  112. package/file-upload/dropzone/styles.css.js +2 -2
  113. package/file-upload/dropzone/styles.scoped.css +9 -9
  114. package/file-upload/dropzone/styles.selectors.js +2 -2
  115. package/file-upload/file-input/styles.css.js +4 -4
  116. package/file-upload/file-input/styles.scoped.css +14 -14
  117. package/file-upload/file-input/styles.selectors.js +4 -4
  118. package/file-upload/file-option/styles.css.js +7 -7
  119. package/file-upload/file-option/styles.scoped.css +10 -10
  120. package/file-upload/file-option/styles.selectors.js +7 -7
  121. package/file-upload/styles.css.js +2 -2
  122. package/file-upload/styles.scoped.css +4 -4
  123. package/file-upload/styles.selectors.js +2 -2
  124. package/flashbar/collapsible-flashbar.d.ts.map +1 -1
  125. package/flashbar/collapsible-flashbar.js +8 -5
  126. package/flashbar/collapsible-flashbar.js.map +1 -1
  127. package/flashbar/flash.d.ts.map +1 -1
  128. package/flashbar/flash.js +2 -1
  129. package/flashbar/flash.js.map +1 -1
  130. package/flashbar/non-collapsible-flashbar.d.ts.map +1 -1
  131. package/flashbar/non-collapsible-flashbar.js +1 -2
  132. package/flashbar/non-collapsible-flashbar.js.map +1 -1
  133. package/flashbar/styles.css.js +46 -46
  134. package/flashbar/styles.scoped.css +250 -246
  135. package/flashbar/styles.selectors.js +46 -46
  136. package/flashbar/utils.js +1 -1
  137. package/flashbar/utils.js.map +1 -1
  138. package/form/styles.css.js +9 -9
  139. package/form/styles.scoped.css +20 -20
  140. package/form/styles.selectors.js +9 -9
  141. package/form-field/styles.css.js +19 -19
  142. package/form-field/styles.scoped.css +52 -52
  143. package/form-field/styles.selectors.js +19 -19
  144. package/grid/styles.css.js +53 -53
  145. package/grid/styles.scoped.css +60 -60
  146. package/grid/styles.selectors.js +53 -53
  147. package/header/styles.css.js +33 -33
  148. package/header/styles.scoped.css +114 -114
  149. package/header/styles.selectors.js +33 -33
  150. package/help-panel/styles.css.js +4 -4
  151. package/help-panel/styles.scoped.css +172 -172
  152. package/help-panel/styles.selectors.js +4 -4
  153. package/hotspot/styles.css.js +7 -7
  154. package/hotspot/styles.scoped.css +10 -10
  155. package/hotspot/styles.selectors.js +7 -7
  156. package/i18n/index.d.ts +1 -1
  157. package/i18n/index.d.ts.map +1 -1
  158. package/i18n/index.js +1 -1
  159. package/i18n/index.js.map +1 -1
  160. package/i18n/provider.d.ts.map +1 -1
  161. package/i18n/provider.js +4 -2
  162. package/i18n/provider.js.map +1 -1
  163. package/i18n/testing.d.ts.map +1 -1
  164. package/i18n/testing.js +2 -0
  165. package/i18n/testing.js.map +1 -1
  166. package/icon/styles.css.js +21 -21
  167. package/icon/styles.scoped.css +81 -81
  168. package/icon/styles.selectors.js +21 -21
  169. package/input/styles.css.js +12 -12
  170. package/input/styles.scoped.css +73 -73
  171. package/input/styles.selectors.js +12 -12
  172. package/internal/analytics/components/analytics-funnel.d.ts.map +1 -1
  173. package/internal/analytics/components/analytics-funnel.js +50 -1
  174. package/internal/analytics/components/analytics-funnel.js.map +1 -1
  175. package/internal/analytics/context/analytics-context.d.ts +13 -0
  176. package/internal/analytics/context/analytics-context.d.ts.map +1 -1
  177. package/internal/analytics/context/analytics-context.js +4 -0
  178. package/internal/analytics/context/analytics-context.js.map +1 -1
  179. package/internal/analytics/hooks/use-funnel.d.ts +4 -0
  180. package/internal/analytics/hooks/use-funnel.d.ts.map +1 -1
  181. package/internal/analytics/hooks/use-funnel.js +73 -20
  182. package/internal/analytics/hooks/use-funnel.js.map +1 -1
  183. package/internal/base-component/styles.scoped.css +1696 -1635
  184. package/internal/components/abstract-switch/styles.css.js +13 -13
  185. package/internal/components/abstract-switch/styles.scoped.css +26 -26
  186. package/internal/components/abstract-switch/styles.selectors.js +13 -13
  187. package/internal/components/button-trigger/styles.css.js +9 -9
  188. package/internal/components/button-trigger/styles.scoped.css +63 -63
  189. package/internal/components/button-trigger/styles.selectors.js +9 -9
  190. package/internal/components/cartesian-chart/styles.css.js +27 -27
  191. package/internal/components/cartesian-chart/styles.scoped.css +41 -41
  192. package/internal/components/cartesian-chart/styles.selectors.js +27 -27
  193. package/internal/components/chart-filter/styles.css.js +3 -3
  194. package/internal/components/chart-filter/styles.scoped.css +7 -7
  195. package/internal/components/chart-filter/styles.selectors.js +3 -3
  196. package/internal/components/chart-legend/styles.css.js +6 -6
  197. package/internal/components/chart-legend/styles.scoped.css +23 -23
  198. package/internal/components/chart-legend/styles.selectors.js +6 -6
  199. package/internal/components/chart-plot/styles.css.js +5 -5
  200. package/internal/components/chart-plot/styles.scoped.css +6 -6
  201. package/internal/components/chart-plot/styles.selectors.js +5 -5
  202. package/internal/components/chart-popover/index.js +1 -1
  203. package/internal/components/chart-popover/index.js.map +1 -1
  204. package/internal/components/chart-popover/styles.css.js +3 -3
  205. package/internal/components/chart-popover/styles.scoped.css +9 -9
  206. package/internal/components/chart-popover/styles.selectors.js +3 -3
  207. package/internal/components/chart-series-details/styles.css.js +5 -5
  208. package/internal/components/chart-series-details/styles.scoped.css +20 -20
  209. package/internal/components/chart-series-details/styles.selectors.js +5 -5
  210. package/internal/components/chart-series-marker/styles.css.js +5 -5
  211. package/internal/components/chart-series-marker/styles.scoped.css +14 -14
  212. package/internal/components/chart-series-marker/styles.selectors.js +5 -5
  213. package/internal/components/chart-status-container/styles.css.js +2 -2
  214. package/internal/components/chart-status-container/styles.scoped.css +3 -3
  215. package/internal/components/chart-status-container/styles.selectors.js +2 -2
  216. package/internal/components/chart-wrapper/styles.css.js +9 -9
  217. package/internal/components/chart-wrapper/styles.scoped.css +15 -15
  218. package/internal/components/chart-wrapper/styles.selectors.js +9 -9
  219. package/internal/components/checkbox-icon/styles.css.js +7 -7
  220. package/internal/components/checkbox-icon/styles.scoped.css +18 -18
  221. package/internal/components/checkbox-icon/styles.selectors.js +7 -7
  222. package/internal/components/dark-ribbon/styles.css.js +2 -2
  223. package/internal/components/dark-ribbon/styles.scoped.css +4 -4
  224. package/internal/components/dark-ribbon/styles.selectors.js +2 -2
  225. package/internal/components/dropdown/interfaces.d.ts +8 -5
  226. package/internal/components/dropdown/interfaces.d.ts.map +1 -1
  227. package/internal/components/dropdown/interfaces.js.map +1 -1
  228. package/internal/components/dropdown/styles.css.js +20 -20
  229. package/internal/components/dropdown/styles.scoped.css +51 -51
  230. package/internal/components/dropdown/styles.selectors.js +20 -20
  231. package/internal/components/dropdown-footer/styles.css.js +3 -3
  232. package/internal/components/dropdown-footer/styles.scoped.css +9 -9
  233. package/internal/components/dropdown-footer/styles.selectors.js +3 -3
  234. package/internal/components/dropdown-status/styles.css.js +2 -2
  235. package/internal/components/dropdown-status/styles.scoped.css +8 -8
  236. package/internal/components/dropdown-status/styles.selectors.js +2 -2
  237. package/internal/components/filtering-token/styles.css.js +7 -7
  238. package/internal/components/filtering-token/styles.scoped.css +34 -34
  239. package/internal/components/filtering-token/styles.selectors.js +7 -7
  240. package/internal/components/handle/styles.css.js +2 -2
  241. package/internal/components/handle/styles.scoped.css +12 -12
  242. package/internal/components/handle/styles.selectors.js +2 -2
  243. package/internal/components/menu-dropdown/styles.css.js +7 -7
  244. package/internal/components/menu-dropdown/styles.scoped.css +32 -32
  245. package/internal/components/menu-dropdown/styles.selectors.js +7 -7
  246. package/internal/components/option/styles.css.js +17 -17
  247. package/internal/components/option/styles.scoped.css +47 -47
  248. package/internal/components/option/styles.selectors.js +17 -17
  249. package/internal/components/options-list/styles.css.js +2 -2
  250. package/internal/components/options-list/styles.scoped.css +7 -7
  251. package/internal/components/options-list/styles.selectors.js +2 -2
  252. package/internal/components/selectable-item/styles.css.js +16 -16
  253. package/internal/components/selectable-item/styles.scoped.css +70 -70
  254. package/internal/components/selectable-item/styles.selectors.js +16 -16
  255. package/internal/components/token-list/styles.css.js +9 -9
  256. package/internal/components/token-list/styles.scoped.css +40 -40
  257. package/internal/components/token-list/styles.selectors.js +9 -9
  258. package/internal/environment.js +1 -1
  259. package/internal/environment.json +1 -1
  260. package/internal/generated/styles/tokens.d.ts +1 -0
  261. package/internal/generated/styles/tokens.js +306 -305
  262. package/internal/generated/theming/index.cjs +1830 -821
  263. package/internal/generated/theming/index.cjs.d.ts +192 -0
  264. package/internal/generated/theming/index.d.ts +192 -0
  265. package/internal/generated/theming/index.js +1830 -821
  266. package/internal/manifest.json +1 -1
  267. package/internal/utils/dom.d.ts +1 -1
  268. package/internal/utils/dom.d.ts.map +1 -1
  269. package/internal/utils/dom.js +1 -1
  270. package/internal/utils/dom.js.map +1 -1
  271. package/link/styles.css.js +20 -20
  272. package/link/styles.scoped.css +163 -163
  273. package/link/styles.selectors.js +20 -20
  274. package/mixed-line-bar-chart/styles.css.js +11 -11
  275. package/mixed-line-bar-chart/styles.scoped.css +24 -24
  276. package/mixed-line-bar-chart/styles.selectors.js +11 -11
  277. package/modal/styles.css.js +23 -23
  278. package/modal/styles.scoped.css +67 -67
  279. package/modal/styles.selectors.js +23 -23
  280. package/multiselect/styles.css.js +1 -1
  281. package/multiselect/styles.scoped.css +5 -5
  282. package/multiselect/styles.selectors.js +1 -1
  283. package/package.json +1 -1
  284. package/pagination/styles.css.js +9 -9
  285. package/pagination/styles.scoped.css +47 -47
  286. package/pagination/styles.selectors.js +9 -9
  287. package/pie-chart/index.d.ts.map +1 -1
  288. package/pie-chart/index.js +1 -2
  289. package/pie-chart/index.js.map +1 -1
  290. package/pie-chart/pie-chart.d.ts +1 -3
  291. package/pie-chart/pie-chart.d.ts.map +1 -1
  292. package/pie-chart/pie-chart.js +16 -17
  293. package/pie-chart/pie-chart.js.map +1 -1
  294. package/pie-chart/segments.d.ts +1 -2
  295. package/pie-chart/segments.d.ts.map +1 -1
  296. package/pie-chart/segments.js +2 -2
  297. package/pie-chart/segments.js.map +1 -1
  298. package/pie-chart/styles.css.js +27 -27
  299. package/pie-chart/styles.scoped.css +63 -63
  300. package/pie-chart/styles.selectors.js +27 -27
  301. package/popover/styles.css.js +50 -50
  302. package/popover/styles.scoped.css +104 -104
  303. package/popover/styles.selectors.js +50 -50
  304. package/progress-bar/styles.css.js +18 -18
  305. package/progress-bar/styles.scoped.css +58 -58
  306. package/progress-bar/styles.selectors.js +18 -18
  307. package/property-filter/styles.css.js +29 -29
  308. package/property-filter/styles.scoped.css +52 -52
  309. package/property-filter/styles.selectors.js +29 -29
  310. package/radio-group/styles.css.js +9 -9
  311. package/radio-group/styles.scoped.css +37 -37
  312. package/radio-group/styles.selectors.js +9 -9
  313. package/s3-resource-selector/s3-in-context/styles.css.js +7 -7
  314. package/s3-resource-selector/s3-in-context/styles.scoped.css +12 -12
  315. package/s3-resource-selector/s3-in-context/styles.selectors.js +7 -7
  316. package/segmented-control/styles.css.js +14 -14
  317. package/segmented-control/styles.scoped.css +78 -78
  318. package/segmented-control/styles.selectors.js +14 -14
  319. package/select/parts/styles.css.js +9 -9
  320. package/select/parts/styles.scoped.css +17 -17
  321. package/select/parts/styles.selectors.js +9 -9
  322. package/select/styles.css.js +1 -1
  323. package/select/styles.scoped.css +5 -5
  324. package/select/styles.selectors.js +1 -1
  325. package/side-navigation/styles.css.js +28 -28
  326. package/side-navigation/styles.scoped.css +92 -92
  327. package/side-navigation/styles.selectors.js +28 -28
  328. package/space-between/styles.css.js +23 -23
  329. package/space-between/styles.scoped.css +40 -40
  330. package/space-between/styles.selectors.js +23 -23
  331. package/spinner/styles.css.js +13 -13
  332. package/spinner/styles.scoped.css +35 -35
  333. package/spinner/styles.selectors.js +13 -13
  334. package/split-panel/styles.css.js +56 -56
  335. package/split-panel/styles.scoped.css +146 -146
  336. package/split-panel/styles.selectors.js +56 -56
  337. package/status-indicator/styles.css.js +22 -22
  338. package/status-indicator/styles.scoped.css +46 -46
  339. package/status-indicator/styles.selectors.js +22 -22
  340. package/table/body-cell/styles.css.js +28 -28
  341. package/table/body-cell/styles.scoped.css +155 -155
  342. package/table/body-cell/styles.selectors.js +28 -28
  343. package/table/body-cell/td-element.d.ts +3 -1
  344. package/table/body-cell/td-element.d.ts.map +1 -1
  345. package/table/body-cell/td-element.js +5 -7
  346. package/table/body-cell/td-element.js.map +1 -1
  347. package/table/header-cell/index.d.ts +2 -0
  348. package/table/header-cell/index.d.ts.map +1 -1
  349. package/table/header-cell/index.js +4 -3
  350. package/table/header-cell/index.js.map +1 -1
  351. package/table/header-cell/styles.css.js +24 -24
  352. package/table/header-cell/styles.scoped.css +93 -93
  353. package/table/header-cell/styles.selectors.js +24 -24
  354. package/table/header-cell/utils.d.ts +0 -1
  355. package/table/header-cell/utils.d.ts.map +1 -1
  356. package/table/header-cell/utils.js +0 -6
  357. package/table/header-cell/utils.js.map +1 -1
  358. package/table/internal.d.ts.map +1 -1
  359. package/table/internal.js +9 -8
  360. package/table/internal.js.map +1 -1
  361. package/table/resizer/styles.css.js +6 -6
  362. package/table/resizer/styles.scoped.css +27 -27
  363. package/table/resizer/styles.selectors.js +6 -6
  364. package/table/selection-control/styles.css.js +3 -3
  365. package/table/selection-control/styles.scoped.css +4 -4
  366. package/table/selection-control/styles.selectors.js +3 -3
  367. package/table/sticky-header.d.ts +2 -0
  368. package/table/sticky-header.d.ts.map +1 -1
  369. package/table/sticky-header.js +3 -2
  370. package/table/sticky-header.js.map +1 -1
  371. package/table/styles.css.js +34 -34
  372. package/table/styles.scoped.css +84 -84
  373. package/table/styles.selectors.js +34 -34
  374. package/table/table-role/index.d.ts +2 -0
  375. package/table/table-role/index.d.ts.map +1 -0
  376. package/table/table-role/index.js +4 -0
  377. package/table/table-role/index.js.map +1 -0
  378. package/table/table-role/table-role-helper.d.ts +22 -0
  379. package/table/table-role/table-role-helper.d.ts.map +1 -0
  380. package/table/table-role/table-role-helper.js +47 -0
  381. package/table/table-role/table-role-helper.js.map +1 -0
  382. package/table/thead.d.ts +2 -0
  383. package/table/thead.d.ts.map +1 -1
  384. package/table/thead.js +4 -3
  385. package/table/thead.js.map +1 -1
  386. package/tabs/styles.css.js +21 -21
  387. package/tabs/styles.scoped.css +86 -86
  388. package/tabs/styles.selectors.js +21 -21
  389. package/tag-editor/styles.css.js +3 -3
  390. package/tag-editor/styles.scoped.css +24 -24
  391. package/tag-editor/styles.selectors.js +3 -3
  392. package/text-content/styles.css.js +1 -1
  393. package/text-content/styles.scoped.css +130 -130
  394. package/text-content/styles.selectors.js +1 -1
  395. package/text-filter/styles.css.js +3 -3
  396. package/text-filter/styles.scoped.css +10 -10
  397. package/text-filter/styles.selectors.js +3 -3
  398. package/textarea/styles.css.js +4 -4
  399. package/textarea/styles.scoped.css +40 -40
  400. package/textarea/styles.selectors.js +4 -4
  401. package/tiles/styles.css.js +29 -29
  402. package/tiles/styles.scoped.css +128 -128
  403. package/tiles/styles.selectors.js +29 -29
  404. package/toggle/styles.css.js +8 -8
  405. package/toggle/styles.scoped.css +27 -27
  406. package/toggle/styles.selectors.js +8 -8
  407. package/token-group/styles.css.js +7 -7
  408. package/token-group/styles.scoped.css +42 -42
  409. package/token-group/styles.selectors.js +7 -7
  410. package/top-navigation/1.0-beta/styles.css.js +25 -25
  411. package/top-navigation/1.0-beta/styles.scoped.css +84 -84
  412. package/top-navigation/1.0-beta/styles.selectors.js +25 -25
  413. package/top-navigation/styles.css.js +47 -47
  414. package/top-navigation/styles.scoped.css +148 -148
  415. package/top-navigation/styles.selectors.js +47 -47
  416. package/tutorial-panel/components/tutorial-detail-view/styles.css.js +20 -20
  417. package/tutorial-panel/components/tutorial-detail-view/styles.scoped.css +43 -43
  418. package/tutorial-panel/components/tutorial-detail-view/styles.selectors.js +20 -20
  419. package/tutorial-panel/components/tutorial-list/styles.css.js +18 -18
  420. package/tutorial-panel/components/tutorial-list/styles.scoped.css +50 -50
  421. package/tutorial-panel/components/tutorial-list/styles.selectors.js +18 -18
  422. package/tutorial-panel/styles.css.js +1 -1
  423. package/tutorial-panel/styles.scoped.css +6 -6
  424. package/tutorial-panel/styles.selectors.js +1 -1
  425. package/wizard/styles.css.js +31 -31
  426. package/wizard/styles.scoped.css +124 -124
  427. package/wizard/styles.selectors.js +31 -31
@@ -1,8 +1,9 @@
1
1
  // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
2
  // SPDX-License-Identifier: Apache-2.0
3
+ import { __awaiter } from "tslib";
3
4
  import { useContext } from 'react';
4
5
  import { FunnelContext, FunnelStepContext, FunnelSubStepContext } from '../context/analytics-context';
5
- import { DATA_ATTR_FUNNEL_INTERACTION_ID, DATA_ATTR_FUNNEL_SUBSTEP, getSubStepAllSelector } from '../selectors';
6
+ import { DATA_ATTR_FUNNEL_INTERACTION_ID, DATA_ATTR_FUNNEL_SUBSTEP, getNameFromSelector, getSubStepAllSelector, } from '../selectors';
6
7
  import { FunnelMetrics } from '../';
7
8
  /**
8
9
  * Custom React Hook to manage and interact with FunnelSubStep.
@@ -16,39 +17,91 @@ import { FunnelMetrics } from '../';
16
17
  */
17
18
  export const useFunnelSubStep = () => {
18
19
  const context = useContext(FunnelSubStepContext);
19
- const { funnelInteractionId, funnelState } = useFunnel();
20
+ const { funnelInteractionId, funnelState, latestFocusCleanupFunction } = useFunnel();
20
21
  const { stepNumber, stepNameSelector } = useFunnelStep();
21
- const { subStepId, subStepSelector, subStepNameSelector, subStepRef, isNestedSubStep } = context;
22
+ const { subStepId, subStepSelector, subStepNameSelector, subStepRef, isNestedSubStep, mousePressed, isFocusedSubStep, focusCleanupFunction, } = context;
22
23
  if (isNestedSubStep) {
23
24
  return context;
24
25
  }
25
- const onFocus = (event) => {
26
- if (funnelInteractionId &&
27
- subStepRef.current &&
28
- (!event.relatedTarget || !subStepRef.current.contains(event.relatedTarget))) {
26
+ const onFocus = (event) => __awaiter(void 0, void 0, void 0, function* () {
27
+ var _a;
28
+ const element = event.target;
29
+ // Ignore spurious focus events, such as when the browser window is focused again.
30
+ yield new Promise(r => setTimeout(r, 1));
31
+ if (document.activeElement !== element) {
32
+ return;
33
+ }
34
+ if (isFocusedSubStep.current) {
35
+ return;
36
+ }
37
+ isFocusedSubStep.current = true;
38
+ if (funnelInteractionId && subStepId) {
39
+ /*
40
+ If the previously focused substep has provided a cleanup function, we
41
+ call it here on behalf of the previously focused substep.
42
+ */
43
+ (_a = latestFocusCleanupFunction.current) === null || _a === void 0 ? void 0 : _a.call(latestFocusCleanupFunction);
29
44
  FunnelMetrics.funnelSubStepStart({
30
45
  funnelInteractionId,
31
46
  subStepSelector,
32
47
  subStepNameSelector,
48
+ subStepName: getNameFromSelector(subStepNameSelector),
33
49
  stepNumber,
34
50
  stepNameSelector,
35
51
  subStepAllSelector: getSubStepAllSelector(),
36
52
  });
53
+ /*
54
+ This cleanup function will be called when the user leaves this substep.
55
+ The function might be called either:
56
+
57
+ - by the next focused substep as `latestFocusCleanupFunction`
58
+ (through a separate instance of the function we're currently in), or
59
+
60
+ - by the same substep as `focusCleanupFunction`
61
+ (through the `onMouseUp` handler or the `onBlur` handler).
62
+ */
63
+ let cleanupFunctionHasBeenRun = false;
64
+ focusCleanupFunction.current = () => {
65
+ if (cleanupFunctionHasBeenRun) {
66
+ return;
67
+ }
68
+ cleanupFunctionHasBeenRun = true;
69
+ if (funnelState.current !== 'cancelled') {
70
+ FunnelMetrics.funnelSubStepComplete({
71
+ funnelInteractionId,
72
+ subStepSelector,
73
+ subStepNameSelector,
74
+ subStepName: getNameFromSelector(subStepNameSelector),
75
+ stepNumber,
76
+ stepNameSelector,
77
+ subStepAllSelector: getSubStepAllSelector(),
78
+ });
79
+ }
80
+ };
81
+ latestFocusCleanupFunction.current = focusCleanupFunction.current;
37
82
  }
38
- };
83
+ });
39
84
  const onBlur = (event) => {
40
- if (funnelInteractionId &&
41
- subStepRef.current &&
42
- !subStepRef.current.contains(event.relatedTarget) &&
43
- funnelState.current !== 'cancelled') {
44
- FunnelMetrics.funnelSubStepComplete({
45
- funnelInteractionId,
46
- subStepSelector,
47
- subStepNameSelector,
48
- stepNumber,
49
- stepNameSelector,
50
- subStepAllSelector: getSubStepAllSelector(),
51
- });
85
+ var _a;
86
+ if (mousePressed.current) {
87
+ /*
88
+ Ignore blur events that are caused by mouse interaction, because these events don't
89
+ always reflect user intention. For example, clicking the label of an interactive form
90
+ element will briefly blur it.
91
+ The mouse-caused events are handled in the global `onMouseUp` handler of the substep
92
+ context instead.
93
+ */
94
+ return;
95
+ }
96
+ if (!subStepRef.current || !subStepRef.current.contains(event.relatedTarget) || !event.relatedTarget) {
97
+ isFocusedSubStep.current = false;
98
+ if (funnelInteractionId && subStepId && funnelState.current !== 'cancelled') {
99
+ /*
100
+ Run this substep's own focus cleanup function if another substep
101
+ hasn't already done it for us.
102
+ */
103
+ (_a = focusCleanupFunction.current) === null || _a === void 0 ? void 0 : _a.call(focusCleanupFunction);
104
+ }
52
105
  }
53
106
  };
54
107
  const funnelSubStepProps = funnelInteractionId
@@ -1 +1 @@
1
- {"version":3,"file":"use-funnel.js","sourceRoot":"lib/default/","sources":["internal/analytics/hooks/use-funnel.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AAEtC,OAAO,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AACnC,OAAO,EAAE,aAAa,EAAE,iBAAiB,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAC;AACtG,OAAO,EAAE,+BAA+B,EAAE,wBAAwB,EAAE,qBAAqB,EAAE,MAAM,cAAc,CAAC;AAChH,OAAO,EAAE,aAAa,EAAE,MAAM,KAAK,CAAC;AAEpC;;;;;;;;;GASG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,GAAG,EAAE;IACnC,MAAM,OAAO,GAAG,UAAU,CAAC,oBAAoB,CAAC,CAAC;IACjD,MAAM,EAAE,mBAAmB,EAAE,WAAW,EAAE,GAAG,SAAS,EAAE,CAAC;IACzD,MAAM,EAAE,UAAU,EAAE,gBAAgB,EAAE,GAAG,aAAa,EAAE,CAAC;IAEzD,MAAM,EAAE,SAAS,EAAE,eAAe,EAAE,mBAAmB,EAAE,UAAU,EAAE,eAAe,EAAE,GAAG,OAAO,CAAC;IAEjG,IAAI,eAAe,EAAE;QACnB,OAAO,OAAO,CAAC;KAChB;IAED,MAAM,OAAO,GAAG,CAAC,KAAuC,EAAE,EAAE;QAC1D,IACE,mBAAmB;YACnB,UAAU,CAAC,OAAO;YAClB,CAAC,CAAC,KAAK,CAAC,aAAa,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAC,aAAqB,CAAC,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P,uBAAS,WAAW,IAAK,OAAO,EAAG;AACrC,CAAC,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport { useContext } from 'react';\nimport { FunnelContext, FunnelStepContext, FunnelSubStepContext } from '../context/analytics-context';\nimport { DATA_ATTR_FUNNEL_INTERACTION_ID, DATA_ATTR_FUNNEL_SUBSTEP, getSubStepAllSelector } from '../selectors';\nimport { FunnelMetrics } from '../';\n\n/**\n * Custom React Hook to manage and interact with FunnelSubStep.\n * This hook will provide necessary properties and methods required\n * to track and manage interactions with a FunnelSubStep component.\n *\n * The `onFocus` method is used to track the beginning of interaction with the FunnelSubStep.\n * The `onBlur` method is used to track the completion of interaction with the FunnelSubStep.\n * The subStepId is a unique identifier for the funnel sub-step.\n * The subStepRef is a reference to the DOM element of the funnel sub-step.\n */\nexport const useFunnelSubStep = () => {\n const context = useContext(FunnelSubStepContext);\n const { funnelInteractionId, funnelState } = useFunnel();\n const { stepNumber, stepNameSelector } = useFunnelStep();\n\n const { subStepId, subStepSelector, subStepNameSelector, subStepRef, isNestedSubStep } = context;\n\n if (isNestedSubStep) {\n return context;\n }\n\n const onFocus = (event: React.FocusEvent<HTMLDivElement>) => {\n if (\n funnelInteractionId &&\n subStepRef.current &&\n (!event.relatedTarget || !subStepRef.current.contains(event.relatedTarget as Node))\n ) {\n FunnelMetrics.funnelSubStepStart({\n funnelInteractionId,\n subStepSelector,\n subStepNameSelector,\n stepNumber,\n stepNameSelector,\n subStepAllSelector: getSubStepAllSelector(),\n });\n }\n };\n\n const onBlur = (event: React.FocusEvent<HTMLDivElement>) => {\n if (\n funnelInteractionId &&\n subStepRef.current &&\n !subStepRef.current.contains(event.relatedTarget) &&\n funnelState.current !== 'cancelled'\n ) {\n FunnelMetrics.funnelSubStepComplete({\n funnelInteractionId,\n subStepSelector,\n subStepNameSelector,\n stepNumber,\n stepNameSelector,\n subStepAllSelector: getSubStepAllSelector(),\n });\n }\n };\n\n const funnelSubStepProps: Record<string, any> = funnelInteractionId\n ? {\n [DATA_ATTR_FUNNEL_SUBSTEP]: subStepId,\n onFocus,\n onBlur,\n }\n : {};\n\n return { funnelSubStepProps, ...context };\n};\n\n/**\n * Custom React Hook to manage and interact with FunnelStep.\n * This hook will provide necessary properties required to track\n * and manage interactions with a FunnelStep component.\n *\n * The 'data-analytics-funnel-step' property of funnelStepProps is used to track the index of the current step in the funnel.\n * The context contains additional properties of the FunnelStep.\n */\nexport const useFunnelStep = () => {\n const context = useContext(FunnelStepContext);\n return context;\n};\n\n/**\n * Custom React Hook to manage and interact with Funnel.\n * This hook will provide necessary properties required to track\n * and manage interactions with a Funnel component.\n *\n * The 'data-analytics-funnel-interaction-id' property of funnelProps is used to track the unique identifier of the current interaction with the funnel.\n */\nexport const useFunnel = () => {\n const context = useContext(FunnelContext);\n const funnelProps: Record<string, string | number | boolean | undefined> = context.funnelInteractionId\n ? {\n [DATA_ATTR_FUNNEL_INTERACTION_ID]: context.funnelInteractionId,\n }\n : {};\n\n return { funnelProps, ...context };\n};\n"]}
1
+ {"version":3,"file":"use-funnel.js","sourceRoot":"lib/default/","sources":["internal/analytics/hooks/use-funnel.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;;AAEtC,OAAO,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AACnC,OAAO,EAAE,aAAa,EAAE,iBAAiB,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAC;AACtG,OAAO,EACL,+BAA+B,EAC/B,wBAAwB,EACxB,mBAAmB,EACnB,qBAAqB,GACtB,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,aAAa,EAAE,MAAM,KAAK,CAAC;AAEpC;;;;;;;;;GASG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,GAAG,EAAE;IACnC,MAAM,OAAO,GAAG,UAAU,CAAC,oBAAoB,CAAC,CAAC;IACjD,MAAM,EAAE,mBAAmB,EAAE,WAAW,EA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,MAAM,OAAO,GAAG,UAAU,CAAC,aAAa,CAAC,CAAC;IAC1C,MAAM,WAAW,GAA0D,OAAO,CAAC,mBAAmB;QACpG,CAAC,CAAC;YACE,CAAC,+BAA+B,CAAC,EAAE,OAAO,CAAC,mBAAmB;SAC/D;QACH,CAAC,CAAC,EAAE,CAAC;IAEP,uBAAS,WAAW,IAAK,OAAO,EAAG;AACrC,CAAC,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport { useContext } from 'react';\nimport { FunnelContext, FunnelStepContext, FunnelSubStepContext } from '../context/analytics-context';\nimport {\n DATA_ATTR_FUNNEL_INTERACTION_ID,\n DATA_ATTR_FUNNEL_SUBSTEP,\n getNameFromSelector,\n getSubStepAllSelector,\n} from '../selectors';\nimport { FunnelMetrics } from '../';\n\n/**\n * Custom React Hook to manage and interact with FunnelSubStep.\n * This hook will provide necessary properties and methods required\n * to track and manage interactions with a FunnelSubStep component.\n *\n * The `onFocus` method is used to track the beginning of interaction with the FunnelSubStep.\n * The `onBlur` method is used to track the completion of interaction with the FunnelSubStep.\n * The subStepId is a unique identifier for the funnel sub-step.\n * The subStepRef is a reference to the DOM element of the funnel sub-step.\n */\nexport const useFunnelSubStep = () => {\n const context = useContext(FunnelSubStepContext);\n const { funnelInteractionId, funnelState, latestFocusCleanupFunction } = useFunnel();\n const { stepNumber, stepNameSelector } = useFunnelStep();\n\n const {\n subStepId,\n subStepSelector,\n subStepNameSelector,\n subStepRef,\n isNestedSubStep,\n mousePressed,\n isFocusedSubStep,\n focusCleanupFunction,\n } = context;\n\n if (isNestedSubStep) {\n return context;\n }\n\n const onFocus = async (event: React.FocusEvent<HTMLDivElement>) => {\n const element = event.target;\n // Ignore spurious focus events, such as when the browser window is focused again.\n await new Promise(r => setTimeout(r, 1));\n if (document.activeElement !== element) {\n return;\n }\n\n if (isFocusedSubStep.current) {\n return;\n }\n isFocusedSubStep.current = true;\n\n if (funnelInteractionId && subStepId) {\n /*\n If the previously focused substep has provided a cleanup function, we\n call it here on behalf of the previously focused substep.\n */\n latestFocusCleanupFunction.current?.();\n\n FunnelMetrics.funnelSubStepStart({\n funnelInteractionId,\n subStepSelector,\n subStepNameSelector,\n subStepName: getNameFromSelector(subStepNameSelector),\n stepNumber,\n stepNameSelector,\n subStepAllSelector: getSubStepAllSelector(),\n });\n\n /*\n This cleanup function will be called when the user leaves this substep.\n The function might be called either:\n\n - by the next focused substep as `latestFocusCleanupFunction`\n (through a separate instance of the function we're currently in), or\n\n - by the same substep as `focusCleanupFunction`\n (through the `onMouseUp` handler or the `onBlur` handler).\n */\n let cleanupFunctionHasBeenRun = false;\n focusCleanupFunction.current = () => {\n if (cleanupFunctionHasBeenRun) {\n return;\n }\n cleanupFunctionHasBeenRun = true;\n\n if (funnelState.current !== 'cancelled') {\n FunnelMetrics.funnelSubStepComplete({\n funnelInteractionId,\n subStepSelector,\n subStepNameSelector,\n subStepName: getNameFromSelector(subStepNameSelector),\n stepNumber,\n stepNameSelector,\n subStepAllSelector: getSubStepAllSelector(),\n });\n }\n };\n latestFocusCleanupFunction.current = focusCleanupFunction.current;\n }\n };\n\n const onBlur = (event: React.FocusEvent<HTMLDivElement>) => {\n if (mousePressed.current) {\n /*\n Ignore blur events that are caused by mouse interaction, because these events don't\n always reflect user intention. For example, clicking the label of an interactive form\n element will briefly blur it.\n The mouse-caused events are handled in the global `onMouseUp` handler of the substep\n context instead.\n */\n return;\n }\n\n if (!subStepRef.current || !subStepRef.current.contains(event.relatedTarget) || !event.relatedTarget) {\n isFocusedSubStep.current = false;\n\n if (funnelInteractionId && subStepId && funnelState.current !== 'cancelled') {\n /*\n Run this substep's own focus cleanup function if another substep\n hasn't already done it for us.\n */\n focusCleanupFunction.current?.();\n }\n }\n };\n\n const funnelSubStepProps: Record<string, any> = funnelInteractionId\n ? {\n [DATA_ATTR_FUNNEL_SUBSTEP]: subStepId,\n onFocus,\n onBlur,\n }\n : {};\n\n return { funnelSubStepProps, ...context };\n};\n\n/**\n * Custom React Hook to manage and interact with FunnelStep.\n * This hook will provide necessary properties required to track\n * and manage interactions with a FunnelStep component.\n *\n * The 'data-analytics-funnel-step' property of funnelStepProps is used to track the index of the current step in the funnel.\n * The context contains additional properties of the FunnelStep.\n */\nexport const useFunnelStep = () => {\n const context = useContext(FunnelStepContext);\n return context;\n};\n\n/**\n * Custom React Hook to manage and interact with Funnel.\n * This hook will provide necessary properties required to track\n * and manage interactions with a Funnel component.\n *\n * The 'data-analytics-funnel-interaction-id' property of funnelProps is used to track the unique identifier of the current interaction with the funnel.\n */\nexport const useFunnel = () => {\n const context = useContext(FunnelContext);\n const funnelProps: Record<string, string | number | boolean | undefined> = context.funnelInteractionId\n ? {\n [DATA_ATTR_FUNNEL_INTERACTION_ID]: context.funnelInteractionId,\n }\n : {};\n\n return { funnelProps, ...context };\n};\n"]}