@telefonica/mistica 16.59.0-beta.1 → 16.60.0

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 (539) hide show
  1. package/css/mistica.css +1 -1
  2. package/dist/accordion.css-mistica.js +16 -16
  3. package/dist/align.css-mistica.js +2 -2
  4. package/dist/autocomplete.css-mistica.js +6 -6
  5. package/dist/avatar.css-mistica.js +3 -3
  6. package/dist/badge.css-mistica.js +7 -7
  7. package/dist/box.css-mistica.js +15 -15
  8. package/dist/boxed.css-mistica.js +31 -31
  9. package/dist/button-group.css-mistica.js +10 -10
  10. package/dist/button-layout.css-mistica.js +21 -21
  11. package/dist/button.css-mistica.js +51 -51
  12. package/dist/callout.css-mistica.js +16 -16
  13. package/dist/card-internal.css-mistica.js +38 -38
  14. package/dist/carousel.css-mistica.js +18 -18
  15. package/dist/checkbox.css-mistica.js +21 -21
  16. package/dist/chip.css-mistica.js +30 -30
  17. package/dist/circle.css-mistica.js +2 -2
  18. package/dist/community/advanced-data-card.css-mistica.js +26 -26
  19. package/dist/community/blocks.css-mistica.js +3 -3
  20. package/dist/community/example-component.css-mistica.js +2 -2
  21. package/dist/counter.css-mistica.js +12 -12
  22. package/dist/cover-hero.css-mistica.js +16 -16
  23. package/dist/credit-card-number-field.css-mistica.js +6 -6
  24. package/dist/date-field.css-mistica.js +1 -1
  25. package/dist/date-time-picker.css-mistica.js +2 -2
  26. package/dist/dialog.css-mistica.js +15 -15
  27. package/dist/divider.css-mistica.js +5 -5
  28. package/dist/double-field.css-mistica.js +4 -4
  29. package/dist/drawer.css-mistica.js +15 -15
  30. package/dist/empty-state-card.css-mistica.js +4 -4
  31. package/dist/empty-state.css-mistica.js +14 -14
  32. package/dist/fade-in.css-mistica.js +1 -1
  33. package/dist/feedback.css-mistica.js +14 -14
  34. package/dist/file-upload.css-mistica.js +14 -14
  35. package/dist/fixed-footer-layout.css-mistica.js +12 -12
  36. package/dist/form.css-mistica.js +2 -2
  37. package/dist/grid-layout.css-mistica.js +9 -9
  38. package/dist/grid.css-mistica.js +147 -147
  39. package/dist/header.css-mistica.js +5 -5
  40. package/dist/hero.css-mistica.js +11 -11
  41. package/dist/horizontal-scroll.css-mistica.js +3 -3
  42. package/dist/icon-button.css-mistica.js +66 -66
  43. package/dist/icons/icon-chevron.css-mistica.js +6 -6
  44. package/dist/icons/icon-error.css-mistica.js +3 -3
  45. package/dist/image.css-mistica.js +11 -11
  46. package/dist/inline.css-mistica.js +16 -16
  47. package/dist/list.css-mistica.js +15 -15
  48. package/dist/loading-bar.css-mistica.js +5 -5
  49. package/dist/loading-screen.css-mistica.js +15 -15
  50. package/dist/logo.css-mistica.js +9 -9
  51. package/dist/menu.css-mistica.js +24 -24
  52. package/dist/mosaic.css-mistica.js +3 -3
  53. package/dist/navigation-bar.css-mistica.js +45 -45
  54. package/dist/navigation-breadcrumbs.css-mistica.js +5 -5
  55. package/dist/package-version.js +2 -2
  56. package/dist/pin-field.css-mistica.js +10 -10
  57. package/dist/popover.css-mistica.js +2 -2
  58. package/dist/progress-bar.css-mistica.js +12 -12
  59. package/dist/radio-button.css-mistica.js +33 -33
  60. package/dist/rating.css-mistica.js +12 -12
  61. package/dist/responsive-layout.css-mistica.js +20 -20
  62. package/dist/screen-reader-only.css-mistica.js +2 -2
  63. package/dist/select.css-mistica.js +29 -29
  64. package/dist/sheet-action-row.css-mistica.js +2 -2
  65. package/dist/sheet-common.css-mistica.js +16 -16
  66. package/dist/sheet-info.css-mistica.js +4 -4
  67. package/dist/skeletons.css-mistica.js +12 -12
  68. package/dist/skins/skin-contract.css-mistica.js +686 -686
  69. package/dist/skip-link.css-mistica.js +3 -3
  70. package/dist/slider.css-mistica.js +28 -28
  71. package/dist/snackbar.css-mistica.js +16 -16
  72. package/dist/spinner.css-mistica.js +5 -5
  73. package/dist/square.css-mistica.js +2 -2
  74. package/dist/stack.css-mistica.js +9 -9
  75. package/dist/stacking-group.css-mistica.js +2 -2
  76. package/dist/stepper.css-mistica.js +16 -16
  77. package/dist/switch-component.css-mistica.js +53 -53
  78. package/dist/table.css-mistica.js +24 -24
  79. package/dist/tabs.css-mistica.js +30 -30
  80. package/dist/tag.css-mistica.js +5 -5
  81. package/dist/text-field-base.css-mistica.js +30 -30
  82. package/dist/text-field-components.css-mistica.js +23 -20
  83. package/dist/text-field-components.css.d.ts +1 -0
  84. package/dist/text-field-components.js +31 -25
  85. package/dist/text-link.css-mistica.js +10 -10
  86. package/dist/text.css-mistica.js +13 -13
  87. package/dist/theme-context.css-mistica.js +2 -2
  88. package/dist/timeline.css-mistica.js +18 -18
  89. package/dist/timer.css-mistica.js +13 -13
  90. package/dist/tooltip.css-mistica.js +12 -12
  91. package/dist/touchable.css-mistica.js +5 -5
  92. package/dist/utils/aspect-ratio-support.css-mistica.js +7 -7
  93. package/dist/video.css-mistica.js +2 -2
  94. package/dist/vivinho-loading-animation/vivinho-loading-animation.css-mistica.js +3 -3
  95. package/dist-es/accordion.css-mistica.js +7 -7
  96. package/dist-es/align.css-mistica.js +2 -2
  97. package/dist-es/autocomplete.css-mistica.js +2 -2
  98. package/dist-es/avatar.css-mistica.js +2 -2
  99. package/dist-es/badge.css-mistica.js +2 -2
  100. package/dist-es/box.css-mistica.js +15 -15
  101. package/dist-es/boxed.css-mistica.js +25 -25
  102. package/dist-es/button-group.css-mistica.js +2 -2
  103. package/dist-es/button-layout.css-mistica.js +16 -16
  104. package/dist-es/button.css-mistica.js +38 -38
  105. package/dist-es/callout.css-mistica.js +12 -12
  106. package/dist-es/card-internal.css-mistica.js +20 -20
  107. package/dist-es/carousel.css-mistica.js +10 -10
  108. package/dist-es/checkbox.css-mistica.js +14 -14
  109. package/dist-es/chip.css-mistica.js +17 -17
  110. package/dist-es/circle.css-mistica.js +2 -2
  111. package/dist-es/community/advanced-data-card.css-mistica.js +7 -7
  112. package/dist-es/community/blocks.css-mistica.js +2 -2
  113. package/dist-es/community/example-component.css-mistica.js +2 -2
  114. package/dist-es/counter.css-mistica.js +2 -2
  115. package/dist-es/cover-hero.css-mistica.js +4 -4
  116. package/dist-es/credit-card-number-field.css-mistica.js +4 -4
  117. package/dist-es/date-field.css-mistica.js +1 -1
  118. package/dist-es/date-time-picker.css-mistica.js +2 -2
  119. package/dist-es/dialog.css-mistica.js +5 -5
  120. package/dist-es/divider.css-mistica.js +5 -5
  121. package/dist-es/double-field.css-mistica.js +4 -4
  122. package/dist-es/drawer.css-mistica.js +2 -2
  123. package/dist-es/empty-state-card.css-mistica.js +2 -2
  124. package/dist-es/empty-state.css-mistica.js +7 -7
  125. package/dist-es/fade-in.css-mistica.js +1 -1
  126. package/dist-es/feedback.css-mistica.js +2 -2
  127. package/dist-es/file-upload.css-mistica.js +8 -8
  128. package/dist-es/fixed-footer-layout.css-mistica.js +4 -4
  129. package/dist-es/form.css-mistica.js +2 -2
  130. package/dist-es/grid-layout.css-mistica.js +4 -4
  131. package/dist-es/grid.css-mistica.js +127 -127
  132. package/dist-es/header.css-mistica.js +2 -2
  133. package/dist-es/hero.css-mistica.js +4 -4
  134. package/dist-es/horizontal-scroll.css-mistica.js +2 -2
  135. package/dist-es/icon-button.css-mistica.js +56 -56
  136. package/dist-es/icons/icon-chevron.css-mistica.js +4 -4
  137. package/dist-es/icons/icon-error.css-mistica.js +2 -2
  138. package/dist-es/image.css-mistica.js +4 -4
  139. package/dist-es/inline.css-mistica.js +10 -10
  140. package/dist-es/list.css-mistica.js +2 -2
  141. package/dist-es/loading-bar.css-mistica.js +2 -2
  142. package/dist-es/loading-screen.css-mistica.js +5 -5
  143. package/dist-es/logo.css-mistica.js +7 -7
  144. package/dist-es/menu.css-mistica.js +15 -15
  145. package/dist-es/mosaic.css-mistica.js +2 -2
  146. package/dist-es/navigation-bar.css-mistica.js +20 -20
  147. package/dist-es/navigation-breadcrumbs.css-mistica.js +2 -2
  148. package/dist-es/package-version.js +2 -2
  149. package/dist-es/pin-field.css-mistica.js +2 -2
  150. package/dist-es/popover.css-mistica.js +2 -2
  151. package/dist-es/progress-bar.css-mistica.js +8 -8
  152. package/dist-es/radio-button.css-mistica.js +25 -25
  153. package/dist-es/rating.css-mistica.js +4 -4
  154. package/dist-es/responsive-layout.css-mistica.js +7 -7
  155. package/dist-es/screen-reader-only.css-mistica.js +2 -2
  156. package/dist-es/select.css-mistica.js +20 -20
  157. package/dist-es/sheet-action-row.css-mistica.js +2 -2
  158. package/dist-es/sheet-common.css-mistica.js +2 -2
  159. package/dist-es/sheet-info.css-mistica.js +2 -2
  160. package/dist-es/skeletons.css-mistica.js +8 -8
  161. package/dist-es/skins/skin-contract.css-mistica.js +686 -686
  162. package/dist-es/skip-link.css-mistica.js +2 -2
  163. package/dist-es/slider.css-mistica.js +20 -20
  164. package/dist-es/snackbar.css-mistica.js +5 -5
  165. package/dist-es/spinner.css-mistica.js +2 -2
  166. package/dist-es/square.css-mistica.js +2 -2
  167. package/dist-es/stack.css-mistica.js +7 -7
  168. package/dist-es/stacking-group.css-mistica.js +2 -2
  169. package/dist-es/stepper.css-mistica.js +4 -4
  170. package/dist-es/style.css +1 -1
  171. package/dist-es/switch-component.css-mistica.js +41 -41
  172. package/dist-es/table.css-mistica.js +11 -11
  173. package/dist-es/tabs.css-mistica.js +21 -21
  174. package/dist-es/tag.css-mistica.js +2 -2
  175. package/dist-es/text-field-base.css-mistica.js +17 -17
  176. package/dist-es/text-field-components.css-mistica.js +4 -4
  177. package/dist-es/text-field-components.js +52 -46
  178. package/dist-es/text-link.css-mistica.js +9 -9
  179. package/dist-es/text.css-mistica.js +8 -8
  180. package/dist-es/theme-context.css-mistica.js +2 -2
  181. package/dist-es/timeline.css-mistica.js +11 -11
  182. package/dist-es/timer.css-mistica.js +7 -7
  183. package/dist-es/tooltip.css-mistica.js +3 -3
  184. package/dist-es/touchable.css-mistica.js +2 -2
  185. package/dist-es/utils/aspect-ratio-support.css-mistica.js +4 -4
  186. package/dist-es/video.css-mistica.js +2 -2
  187. package/dist-es/vivinho-loading-animation/vivinho-loading-animation.css-mistica.js +2 -2
  188. package/doc/llms.md +0 -24
  189. package/package.json +2 -14
  190. package/src/accordion.css.ts +0 -121
  191. package/src/accordion.tsx +0 -366
  192. package/src/align.css.ts +0 -7
  193. package/src/align.tsx +0 -32
  194. package/src/autocomplete.css.ts +0 -62
  195. package/src/autocomplete.tsx +0 -239
  196. package/src/avatar.css.ts +0 -14
  197. package/src/avatar.tsx +0 -120
  198. package/src/badge.css.ts +0 -51
  199. package/src/badge.tsx +0 -79
  200. package/src/box.css.ts +0 -51
  201. package/src/box.tsx +0 -114
  202. package/src/boxed.css.ts +0 -132
  203. package/src/boxed.tsx +0 -153
  204. package/src/button-fixed-footer-layout.tsx +0 -62
  205. package/src/button-group.css.ts +0 -75
  206. package/src/button-group.tsx +0 -91
  207. package/src/button-layout.css.ts +0 -162
  208. package/src/button-layout.tsx +0 -91
  209. package/src/button.css.ts +0 -758
  210. package/src/button.tsx +0 -632
  211. package/src/callout.css.ts +0 -50
  212. package/src/callout.tsx +0 -147
  213. package/src/card-cover.tsx +0 -242
  214. package/src/card-data.tsx +0 -152
  215. package/src/card-internal.css.ts +0 -271
  216. package/src/card-internal.tsx +0 -1724
  217. package/src/card-media.tsx +0 -157
  218. package/src/card-naked.tsx +0 -63
  219. package/src/carousel.css.ts +0 -522
  220. package/src/carousel.tsx +0 -1300
  221. package/src/checkbox.css.ts +0 -94
  222. package/src/checkbox.tsx +0 -192
  223. package/src/chip.css.ts +0 -204
  224. package/src/chip.tsx +0 -191
  225. package/src/circle.css.ts +0 -14
  226. package/src/circle.tsx +0 -52
  227. package/src/community/__screenshot_tests__/__image_snapshots__/advanced-data-card-screenshot-test-tsx-advanced-data-card-actions-button-and-link-footer-image-false-1-snap.png +0 -0
  228. package/src/community/__screenshot_tests__/__image_snapshots__/advanced-data-card-screenshot-test-tsx-advanced-data-card-actions-button-and-link-footer-image-true-1-snap.png +0 -0
  229. package/src/community/__screenshot_tests__/__image_snapshots__/advanced-data-card-screenshot-test-tsx-advanced-data-card-actions-button-footer-image-false-1-snap.png +0 -0
  230. package/src/community/__screenshot_tests__/__image_snapshots__/advanced-data-card-screenshot-test-tsx-advanced-data-card-actions-button-footer-image-true-1-snap.png +0 -0
  231. package/src/community/__screenshot_tests__/__image_snapshots__/advanced-data-card-screenshot-test-tsx-advanced-data-card-actions-link-footer-image-false-1-snap.png +0 -0
  232. package/src/community/__screenshot_tests__/__image_snapshots__/advanced-data-card-screenshot-test-tsx-advanced-data-card-actions-link-footer-image-true-1-snap.png +0 -0
  233. package/src/community/__screenshot_tests__/__image_snapshots__/advanced-data-card-screenshot-test-tsx-advanced-data-card-actions-none-footer-image-false-1-snap.png +0 -0
  234. package/src/community/__screenshot_tests__/__image_snapshots__/advanced-data-card-screenshot-test-tsx-advanced-data-card-actions-none-footer-image-true-1-snap.png +0 -0
  235. package/src/community/__screenshot_tests__/__image_snapshots__/advanced-data-card-screenshot-test-tsx-advanced-data-card-extras-0-1-snap.png +0 -0
  236. package/src/community/__screenshot_tests__/__image_snapshots__/advanced-data-card-screenshot-test-tsx-advanced-data-card-extras-1-1-snap.png +0 -0
  237. package/src/community/__screenshot_tests__/__image_snapshots__/advanced-data-card-screenshot-test-tsx-advanced-data-card-extras-3-1-snap.png +0 -0
  238. package/src/community/__screenshot_tests__/__image_snapshots__/advanced-data-card-screenshot-test-tsx-advanced-data-card-extras-3-no-divider-1-snap.png +0 -0
  239. package/src/community/__screenshot_tests__/__image_snapshots__/advanced-data-card-screenshot-test-tsx-advanced-data-card-inside-carousel-1-snap.png +0 -0
  240. package/src/community/__screenshot_tests__/__image_snapshots__/advanced-data-card-screenshot-test-tsx-advanced-data-card-without-stacking-group-with-top-actions-and-too-long-title-1-snap.png +0 -0
  241. package/src/community/__screenshot_tests__/__image_snapshots__/blocks-screenshot-test-tsx-blocks-highlighted-value-block-1-snap.png +0 -0
  242. package/src/community/__screenshot_tests__/__image_snapshots__/blocks-screenshot-test-tsx-blocks-information-block-1-snap.png +0 -0
  243. package/src/community/__screenshot_tests__/__image_snapshots__/blocks-screenshot-test-tsx-blocks-progress-block-1-snap.png +0 -0
  244. package/src/community/__screenshot_tests__/__image_snapshots__/blocks-screenshot-test-tsx-blocks-progress-block-2-snap.png +0 -0
  245. package/src/community/__screenshot_tests__/__image_snapshots__/blocks-screenshot-test-tsx-blocks-row-block-1-snap.png +0 -0
  246. package/src/community/__screenshot_tests__/__image_snapshots__/blocks-screenshot-test-tsx-blocks-simple-block-1-snap.png +0 -0
  247. package/src/community/__screenshot_tests__/__image_snapshots__/blocks-screenshot-test-tsx-blocks-value-block-1-snap.png +0 -0
  248. package/src/community/__screenshot_tests__/advanced-data-card-screenshot-test.tsx +0 -84
  249. package/src/community/__screenshot_tests__/blocks-screenshot-test.tsx +0 -72
  250. package/src/community/__stories__/advanced-data-card-carousel-story.tsx +0 -66
  251. package/src/community/__stories__/advanced-data-card-story.tsx +0 -158
  252. package/src/community/__stories__/blocks-story.tsx +0 -272
  253. package/src/community/__stories__/example-component-story.tsx +0 -15
  254. package/src/community/__stories__/index-story.tsx +0 -154
  255. package/src/community/__type_tests__/advanced-data-card-type-test.tsx +0 -40
  256. package/src/community/advanced-data-card.css.ts +0 -271
  257. package/src/community/advanced-data-card.tsx +0 -431
  258. package/src/community/blocks.css.ts +0 -12
  259. package/src/community/blocks.tsx +0 -290
  260. package/src/community/example-component.css.ts +0 -7
  261. package/src/community/example-component.tsx +0 -17
  262. package/src/community/index.tsx +0 -10
  263. package/src/counter.css.ts +0 -150
  264. package/src/counter.tsx +0 -215
  265. package/src/cover-hero-media.tsx +0 -39
  266. package/src/cover-hero.css.ts +0 -133
  267. package/src/cover-hero.tsx +0 -262
  268. package/src/credit-card-expiration-field.tsx +0 -187
  269. package/src/credit-card-fields.tsx +0 -56
  270. package/src/credit-card-number-field.css.ts +0 -47
  271. package/src/credit-card-number-field.tsx +0 -245
  272. package/src/cvv-field.tsx +0 -169
  273. package/src/date-field.css.ts +0 -14
  274. package/src/date-field.tsx +0 -130
  275. package/src/date-time-field.tsx +0 -141
  276. package/src/date-time-picker.css.ts +0 -126
  277. package/src/date-time-picker.tsx +0 -188
  278. package/src/decimal-field.tsx +0 -160
  279. package/src/desktop-container-type-context.tsx +0 -15
  280. package/src/dialog-context.tsx +0 -81
  281. package/src/dialog.css.ts +0 -155
  282. package/src/dialog.tsx +0 -423
  283. package/src/divider.css.ts +0 -10
  284. package/src/divider.tsx +0 -11
  285. package/src/double-field.css.ts +0 -33
  286. package/src/double-field.tsx +0 -71
  287. package/src/drawer.css.ts +0 -123
  288. package/src/drawer.tsx +0 -304
  289. package/src/email-field.tsx +0 -76
  290. package/src/empty-state-card.css.ts +0 -40
  291. package/src/empty-state-card.tsx +0 -92
  292. package/src/empty-state.css.ts +0 -119
  293. package/src/empty-state.tsx +0 -141
  294. package/src/fade-in.css.ts +0 -12
  295. package/src/fade-in.tsx +0 -40
  296. package/src/feedback.css.ts +0 -119
  297. package/src/feedback.tsx +0 -432
  298. package/src/file-upload.css.ts +0 -156
  299. package/src/file-upload.tsx +0 -612
  300. package/src/fixed-footer-layout.css.ts +0 -96
  301. package/src/fixed-footer-layout.tsx +0 -215
  302. package/src/fixed-to-top.tsx +0 -21
  303. package/src/focus-trap.tsx +0 -17
  304. package/src/form-context.tsx +0 -198
  305. package/src/form.css.ts +0 -5
  306. package/src/form.tsx +0 -287
  307. package/src/grid-layout.css.ts +0 -68
  308. package/src/grid-layout.tsx +0 -201
  309. package/src/grid.css.ts +0 -203
  310. package/src/grid.tsx +0 -241
  311. package/src/header.css.ts +0 -30
  312. package/src/header.tsx +0 -319
  313. package/src/hero.css.ts +0 -71
  314. package/src/hero.tsx +0 -318
  315. package/src/hooks.tsx +0 -313
  316. package/src/horizontal-scroll.css.ts +0 -43
  317. package/src/horizontal-scroll.tsx +0 -18
  318. package/src/iban-field.tsx +0 -218
  319. package/src/icon-button.css.ts +0 -561
  320. package/src/icon-button.tsx +0 -221
  321. package/src/icons/__stories__/mistica-icons-story.tsx +0 -192
  322. package/src/icons/icon-amex.tsx +0 -40
  323. package/src/icons/icon-chevron.css.ts +0 -23
  324. package/src/icons/icon-chevron.tsx +0 -150
  325. package/src/icons/icon-cvv-amex.tsx +0 -31
  326. package/src/icons/icon-cvv-visa-mc.tsx +0 -31
  327. package/src/icons/icon-error.css.ts +0 -27
  328. package/src/icons/icon-error.tsx +0 -207
  329. package/src/icons/icon-info.tsx +0 -86
  330. package/src/icons/icon-mastercard.tsx +0 -36
  331. package/src/icons/icon-success-vivo-new.tsx +0 -51
  332. package/src/icons/icon-success-vivo.tsx +0 -36
  333. package/src/icons/icon-success.tsx +0 -211
  334. package/src/icons/icon-visa.tsx +0 -32
  335. package/src/image.css.ts +0 -48
  336. package/src/image.tsx +0 -345
  337. package/src/index.tsx +0 -2466
  338. package/src/inline.css.ts +0 -131
  339. package/src/inline.tsx +0 -135
  340. package/src/integer-field.tsx +0 -93
  341. package/src/list.css.ts +0 -281
  342. package/src/list.tsx +0 -963
  343. package/src/loading-bar.css.ts +0 -69
  344. package/src/loading-bar.tsx +0 -25
  345. package/src/loading-screen.css.ts +0 -114
  346. package/src/loading-screen.tsx +0 -376
  347. package/src/logo-blau-shell.tsx +0 -30
  348. package/src/logo-blau.tsx +0 -60
  349. package/src/logo-common.tsx +0 -29
  350. package/src/logo-esimflag-shell.tsx +0 -30
  351. package/src/logo-esimflag.tsx +0 -56
  352. package/src/logo-movistar-new-shell.tsx +0 -30
  353. package/src/logo-movistar-new.tsx +0 -85
  354. package/src/logo-movistar-shell.tsx +0 -30
  355. package/src/logo-movistar.tsx +0 -63
  356. package/src/logo-o2-new-shell.tsx +0 -26
  357. package/src/logo-o2-new.tsx +0 -27
  358. package/src/logo-o2-shell.tsx +0 -26
  359. package/src/logo-o2.tsx +0 -27
  360. package/src/logo-telefonica-shell.tsx +0 -30
  361. package/src/logo-telefonica.tsx +0 -95
  362. package/src/logo-tu-shell.tsx +0 -26
  363. package/src/logo-tu.tsx +0 -28
  364. package/src/logo-vivo-shell.tsx +0 -30
  365. package/src/logo-vivo.tsx +0 -53
  366. package/src/logo.css.ts +0 -33
  367. package/src/logo.tsx +0 -313
  368. package/src/master-detail-layout.tsx +0 -28
  369. package/src/maybe-dismissable.css.ts +0 -37
  370. package/src/maybe-dismissable.tsx +0 -58
  371. package/src/media-queries.css.ts +0 -67
  372. package/src/menu.css.ts +0 -132
  373. package/src/menu.tsx +0 -468
  374. package/src/meter.tsx +0 -516
  375. package/src/modal-context-provider.tsx +0 -45
  376. package/src/month-field.tsx +0 -124
  377. package/src/mosaic.css.ts +0 -73
  378. package/src/mosaic.tsx +0 -205
  379. package/src/navigation-bar.css.ts +0 -558
  380. package/src/navigation-bar.tsx +0 -1637
  381. package/src/navigation-breadcrumbs.css.ts +0 -22
  382. package/src/navigation-breadcrumbs.tsx +0 -69
  383. package/src/negative-box.tsx +0 -15
  384. package/src/nestable-context.tsx +0 -139
  385. package/src/overlay.tsx +0 -86
  386. package/src/overscroll-color-context.tsx +0 -141
  387. package/src/package-version.tsx +0 -2
  388. package/src/password-field.tsx +0 -126
  389. package/src/phone-number-field-lite.tsx +0 -265
  390. package/src/phone-number-field.tsx +0 -171
  391. package/src/pin-field.css.ts +0 -90
  392. package/src/pin-field.tsx +0 -346
  393. package/src/placeholder.tsx +0 -41
  394. package/src/popover.css.ts +0 -8
  395. package/src/popover.tsx +0 -85
  396. package/src/portal.tsx +0 -43
  397. package/src/progress-bar.css.ts +0 -61
  398. package/src/progress-bar.tsx +0 -174
  399. package/src/radio-button.css.ts +0 -174
  400. package/src/radio-button.tsx +0 -322
  401. package/src/rating.css.ts +0 -128
  402. package/src/rating.tsx +0 -351
  403. package/src/responsive-layout.css.ts +0 -162
  404. package/src/responsive-layout.tsx +0 -106
  405. package/src/screen-reader-only.css.ts +0 -27
  406. package/src/screen-reader-only.tsx +0 -33
  407. package/src/screen-size-context-provider.tsx +0 -96
  408. package/src/screen-size-context.tsx +0 -23
  409. package/src/search-field.tsx +0 -126
  410. package/src/select.css.ts +0 -226
  411. package/src/select.tsx +0 -513
  412. package/src/sheet-action-row.css.ts +0 -33
  413. package/src/sheet-actions-list.tsx +0 -113
  414. package/src/sheet-actions.tsx +0 -95
  415. package/src/sheet-common.css.ts +0 -254
  416. package/src/sheet-common.tsx +0 -402
  417. package/src/sheet-info.css.ts +0 -19
  418. package/src/sheet-info.tsx +0 -127
  419. package/src/sheet-native.tsx +0 -189
  420. package/src/sheet-radio-list.tsx +0 -118
  421. package/src/sheet-root.tsx +0 -127
  422. package/src/sheet-types.tsx +0 -94
  423. package/src/sheet-web.tsx +0 -140
  424. package/src/skeleton-base.tsx +0 -38
  425. package/src/skeletons.css.ts +0 -56
  426. package/src/skeletons.tsx +0 -133
  427. package/src/skins/blau.tsx +0 -724
  428. package/src/skins/constants.tsx +0 -10
  429. package/src/skins/defaults.tsx +0 -104
  430. package/src/skins/esimflag.tsx +0 -728
  431. package/src/skins/movistar-new.tsx +0 -735
  432. package/src/skins/movistar.tsx +0 -740
  433. package/src/skins/o2-new.tsx +0 -731
  434. package/src/skins/o2.tsx +0 -727
  435. package/src/skins/skin-contract.css.ts +0 -380
  436. package/src/skins/telefonica.tsx +0 -768
  437. package/src/skins/tu.tsx +0 -741
  438. package/src/skins/types/colors.tsx +0 -286
  439. package/src/skins/types/index.tsx +0 -153
  440. package/src/skins/utils.tsx +0 -66
  441. package/src/skins/vivo-new.tsx +0 -745
  442. package/src/skins/vivo.tsx +0 -720
  443. package/src/skip-link.css.ts +0 -34
  444. package/src/skip-link.tsx +0 -52
  445. package/src/slider.css.ts +0 -181
  446. package/src/slider.tsx +0 -384
  447. package/src/snackbar-context.tsx +0 -98
  448. package/src/snackbar-native.ts +0 -37
  449. package/src/snackbar.css.ts +0 -176
  450. package/src/snackbar.tsx +0 -258
  451. package/src/spinner.css.ts +0 -66
  452. package/src/spinner.tsx +0 -136
  453. package/src/sprinkles.css.ts +0 -83
  454. package/src/square.css.ts +0 -15
  455. package/src/square.tsx +0 -55
  456. package/src/stack.css.ts +0 -44
  457. package/src/stack.tsx +0 -79
  458. package/src/stacking-group.css.ts +0 -15
  459. package/src/stacking-group.tsx +0 -82
  460. package/src/stepper.css.ts +0 -233
  461. package/src/stepper.tsx +0 -156
  462. package/src/switch-component.css.ts +0 -181
  463. package/src/switch-component.tsx +0 -187
  464. package/src/tab-focus.tsx +0 -68
  465. package/src/table-actions-header.tsx +0 -21
  466. package/src/table-cell-text.tsx +0 -35
  467. package/src/table.css.ts +0 -297
  468. package/src/table.tsx +0 -398
  469. package/src/tabs.css.ts +0 -212
  470. package/src/tabs.tsx +0 -263
  471. package/src/tag.css.ts +0 -42
  472. package/src/tag.tsx +0 -161
  473. package/src/test-utils/environment/setup-ssr.tsx +0 -10
  474. package/src/test-utils/fail-test-on-console-error.tsx +0 -22
  475. package/src/test-utils/index.tsx +0 -341
  476. package/src/test-utils/setup-ssr-test-env.tsx +0 -13
  477. package/src/test-utils/ssr.tsx +0 -197
  478. package/src/text-field-base.css.ts +0 -416
  479. package/src/text-field-base.tsx +0 -628
  480. package/src/text-field-components.css.ts +0 -159
  481. package/src/text-field-components.tsx +0 -225
  482. package/src/text-field.tsx +0 -118
  483. package/src/text-link.css.ts +0 -83
  484. package/src/text-link.tsx +0 -85
  485. package/src/text-tokens.tsx +0 -708
  486. package/src/text.css.ts +0 -60
  487. package/src/text.tsx +0 -516
  488. package/src/theme-context-provider.tsx +0 -370
  489. package/src/theme-context.css.ts +0 -3
  490. package/src/theme-context.tsx +0 -8
  491. package/src/theme-variant-context.tsx +0 -51
  492. package/src/theme.tsx +0 -184
  493. package/src/time-field.tsx +0 -99
  494. package/src/timeline.css.ts +0 -135
  495. package/src/timeline.tsx +0 -250
  496. package/src/timer.css.ts +0 -99
  497. package/src/timer.tsx +0 -420
  498. package/src/title.tsx +0 -119
  499. package/src/tooltip-context-provider.tsx +0 -57
  500. package/src/tooltip.css.ts +0 -106
  501. package/src/tooltip.tsx +0 -649
  502. package/src/touchable.css.ts +0 -56
  503. package/src/touchable.tsx +0 -355
  504. package/src/types/font-face.d.ts +0 -47
  505. package/src/types/libs.d.ts +0 -3
  506. package/src/utils/__tests__/analytics-test.tsx +0 -35
  507. package/src/utils/__tests__/browser-test.tsx +0 -28
  508. package/src/utils/__tests__/dom-test.tsx +0 -23
  509. package/src/utils/__tests__/helpers-test.tsx +0 -166
  510. package/src/utils/analytics.tsx +0 -28
  511. package/src/utils/animation.tsx +0 -201
  512. package/src/utils/aspect-ratio-support.css.ts +0 -28
  513. package/src/utils/aspect-ratio-support.tsx +0 -141
  514. package/src/utils/browser.tsx +0 -9
  515. package/src/utils/color.tsx +0 -46
  516. package/src/utils/common.tsx +0 -27
  517. package/src/utils/credit-card.tsx +0 -46
  518. package/src/utils/css.tsx +0 -25
  519. package/src/utils/document-visibility.tsx +0 -52
  520. package/src/utils/dom.tsx +0 -155
  521. package/src/utils/environment.tsx +0 -6
  522. package/src/utils/headings.tsx +0 -18
  523. package/src/utils/helpers.tsx +0 -182
  524. package/src/utils/keys.tsx +0 -8
  525. package/src/utils/locale.tsx +0 -27
  526. package/src/utils/platform.tsx +0 -94
  527. package/src/utils/region-code.tsx +0 -1
  528. package/src/utils/renders-element.tsx +0 -6
  529. package/src/utils/time.tsx +0 -22
  530. package/src/utils/types.tsx +0 -19
  531. package/src/utils/utility-types.tsx +0 -8
  532. package/src/video.css.ts +0 -11
  533. package/src/video.tsx +0 -355
  534. package/src/vivinho-loading-animation/in-lottie.json +0 -402
  535. package/src/vivinho-loading-animation/index.tsx +0 -90
  536. package/src/vivinho-loading-animation/out-lottie.json +0 -575
  537. package/src/vivinho-loading-animation/pulse-lottie.json +0 -551
  538. package/src/vivinho-loading-animation/vivinho-loading-animation.css.ts +0 -15
  539. package/src/vivinho-loading-animation/wave-lottie.json +0 -2829
package/src/list.tsx DELETED
@@ -1,963 +0,0 @@
1
- /*
2
- * Specs:
3
- * - Structure: https://www.figma.com/file/Be8QB9onmHunKCCAkIBAVr/Lists-Component-Specs?node-id=0%3A2
4
- * - Behavior: https://www.figma.com/file/Be8QB9onmHunKCCAkIBAVr/Lists-Component-Specs?node-id=0%3A608
5
- * - Assets: https://www.figma.com/file/Be8QB9onmHunKCCAkIBAVr/Lists-Component-Specs?node-id=0%3A1
6
- */
7
-
8
- 'use client';
9
- import * as React from 'react';
10
- import classNames from 'classnames';
11
- import {BaseTouchable} from './touchable';
12
- import {Text, Text2, Text1} from './text';
13
- import Box from './box';
14
- import Stack from './stack';
15
- import Badge from './badge';
16
- import {useThemeVariant} from './theme-variant-context';
17
- import IconChevronRightFilled from './generated/mistica-icons/icon-chevron-right-filled';
18
- import Switch from './switch-component';
19
- import RadioButton, {useRadioContext} from './radio-button';
20
- import Checkbox from './checkbox';
21
- import {InternalBoxed} from './boxed';
22
- import Divider from './divider';
23
- import {getPrefixedDataAttributes} from './utils/dom';
24
- import * as styles from './list.css';
25
- import * as mediaStyles from './image.css';
26
- import {vars} from './skins/skin-contract.css';
27
- import {applyCssVars} from './utils/css';
28
- import {IconButton, ToggleIconButton} from './icon-button';
29
- import ScreenReaderOnly from './screen-reader-only';
30
- import {useTheme} from './hooks';
31
-
32
- import type {IconButtonProps, ToggleIconButtonProps} from './icon-button';
33
- import type {TouchableElement, TouchableProps} from './touchable';
34
- import type {DataAttributes, TrackingEvent, IconProps} from './utils/types';
35
- import type {ExclusifyUnion} from './utils/utility-types';
36
-
37
- type Right = (({centerY}: {centerY: boolean}) => React.ReactNode) | React.ReactNode;
38
-
39
- interface CommonProps {
40
- children?: void; // no children allowed
41
- headline?: string | React.ReactNode;
42
- title: string;
43
- titleAs?: string;
44
- titleLinesMax?: number;
45
- subtitle?: string;
46
- subtitleLinesMax?: number;
47
- description?: string | null;
48
- descriptionLinesMax?: number;
49
- detail?: string;
50
- asset?: React.ReactNode;
51
- badge?: boolean | number;
52
- role?: string;
53
- touchableRole?: string;
54
- extra?: React.ReactNode;
55
- dataAttributes?: DataAttributes;
56
- disabled?: boolean;
57
- withChevron?: boolean;
58
- 'aria-label'?: string;
59
- right?: Right;
60
- danger?: boolean;
61
- tabIndex?: number;
62
- }
63
-
64
- const renderRight = (right: Right, centerY: boolean) => {
65
- if (typeof right === 'function') return right?.({centerY});
66
-
67
- return centerY ? (
68
- <div style={{display: 'flex', alignItems: 'center', height: '100%'}}>
69
- <div>{right}</div>
70
- </div>
71
- ) : (
72
- right
73
- );
74
- };
75
-
76
- interface ContentProps extends CommonProps {
77
- headlineRef?: React.Ref<HTMLDivElement>;
78
- rightRef?: React.Ref<HTMLDivElement>;
79
- extraRef?: React.Ref<HTMLDivElement>;
80
- control?: React.ReactNode;
81
- /** This id is to link the title with the related control */
82
- labelId?: string;
83
- }
84
-
85
- export const Content = ({
86
- withChevron,
87
- headline,
88
- headlineRef,
89
- extraRef,
90
- title,
91
- titleAs,
92
- titleLinesMax,
93
- subtitle,
94
- subtitleLinesMax,
95
- description,
96
- descriptionLinesMax,
97
- detail,
98
- asset,
99
- danger,
100
- badge,
101
- right,
102
- rightRef,
103
- extra,
104
- labelId,
105
- disabled,
106
- control,
107
- }: ContentProps): JSX.Element => {
108
- const outsideVariant = useThemeVariant();
109
- const numTextLines = [headline, title, subtitle, description, extra].filter(Boolean).length;
110
- const centerY = numTextLines === 1;
111
- const {textPresets} = useTheme();
112
-
113
- return (
114
- <div className={styles.content} id={labelId}>
115
- {asset && (
116
- <div
117
- className={classNames(styles.assetContainer, {
118
- [styles.center]: centerY,
119
- [styles.disabled]: disabled,
120
- })}
121
- // We don't want asset to be readable by screen readers
122
- aria-hidden
123
- data-testid="asset"
124
- >
125
- <div
126
- className={styles.asset}
127
- style={applyCssVars({
128
- color: danger
129
- ? {
130
- default: vars.colors.textError,
131
- alternative: vars.colors.textError,
132
- brand: vars.colors.textErrorBrand,
133
- negative: vars.colors.textErrorNegative,
134
- media: vars.colors.textErrorBrand,
135
- }[outsideVariant]
136
- : {
137
- default: vars.colors.textPrimary,
138
- alternative: vars.colors.textPrimary,
139
- brand: vars.colors.textPrimaryBrand,
140
- negative: vars.colors.textPrimaryNegative,
141
- media: vars.colors.textPrimaryMedia,
142
- }[outsideVariant],
143
- [mediaStyles.vars.mediaBorderRadius]: vars.borderRadii.mediaSmall,
144
- })}
145
- >
146
- {asset}
147
- </div>
148
- </div>
149
- )}
150
-
151
- <div
152
- className={classNames(styles.rowBody, {[styles.disabled]: disabled})}
153
- style={{justifyContent: centerY ? 'center' : 'flex-start'}}
154
- >
155
- <Text
156
- mobileSize={textPresets.text3.size.mobile}
157
- desktopSize={textPresets.text3.size.desktop}
158
- mobileLineHeight={textPresets.text3.lineHeight.mobile}
159
- desktopLineHeight={textPresets.text3.lineHeight.desktop}
160
- weight={textPresets.rowTitle.weight}
161
- color={danger ? vars.colors.textError : vars.colors.textPrimary}
162
- truncate={titleLinesMax}
163
- hyphens="auto"
164
- as={titleAs}
165
- dataAttributes={{testid: 'title'}}
166
- >
167
- {title}
168
- </Text>
169
- {headline && (
170
- <div ref={headlineRef} style={{order: -1, paddingBottom: 4}}>
171
- <Text1
172
- regular
173
- color={vars.colors.textPrimary}
174
- hyphens="auto"
175
- dataAttributes={{testid: 'headline'}}
176
- >
177
- {headline}
178
- </Text1>
179
- </div>
180
- )}
181
- {subtitle && (
182
- <Box paddingTop={2}>
183
- <Text2
184
- regular
185
- color={vars.colors.textPrimary}
186
- truncate={subtitleLinesMax}
187
- hyphens="auto"
188
- dataAttributes={{testid: 'subtitle'}}
189
- >
190
- {subtitle}
191
- </Text2>
192
- </Box>
193
- )}
194
- {description && (
195
- <Box paddingTop={2}>
196
- <Text2
197
- regular
198
- color={vars.colors.textSecondary}
199
- truncate={descriptionLinesMax}
200
- hyphens="auto"
201
- dataAttributes={{testid: 'description'}}
202
- >
203
- {description}
204
- </Text2>
205
- </Box>
206
- )}
207
- {extra && (
208
- <Box ref={extraRef} paddingTop={2} dataAttributes={{testid: 'slot'}}>
209
- {extra}
210
- </Box>
211
- )}
212
- </div>
213
-
214
- {badge && (
215
- <Box paddingLeft={16}>
216
- <div className={classNames(styles.badge, {[styles.disabled]: disabled})}>
217
- <Badge value={badge === true ? undefined : badge} />
218
- </div>
219
- </Box>
220
- )}
221
-
222
- {(detail || right || withChevron || control) && (
223
- <div className={classNames(styles.rightContent, {[styles.rightRestrictedWidth]: !!detail})}>
224
- {detail && (
225
- <div className={classNames(styles.detail, {[styles.disabled]: disabled})}>
226
- <Text2
227
- regular
228
- color={vars.colors.textSecondary}
229
- hyphens="auto"
230
- dataAttributes={{testid: 'detail'}}
231
- >
232
- {detail}
233
- </Text2>
234
- </div>
235
- )}
236
-
237
- {right && (
238
- <div
239
- className={classNames({
240
- [styles.detailRight]: !!detail,
241
- [styles.disabled]: disabled,
242
- })}
243
- ref={rightRef}
244
- data-testid="endSlot"
245
- >
246
- {renderRight(right, centerY)}
247
- </div>
248
- )}
249
-
250
- {withChevron && (
251
- <div
252
- style={{paddingLeft: detail || right ? 4 : 0}}
253
- className={classNames(styles.center, {[styles.disabled]: disabled})}
254
- data-testid="chevron"
255
- >
256
- <IconChevronRightFilled
257
- size={16}
258
- color={
259
- {
260
- default: vars.colors.chevronIndicator,
261
- alternative: vars.colors.chevronIndicator,
262
- brand: vars.colors.textSecondaryBrand,
263
- negative: vars.colors.textSecondaryNegative,
264
- media: vars.colors.textSecondaryBrand,
265
- }[outsideVariant]
266
- }
267
- />
268
- </div>
269
- )}
270
-
271
- {control && (
272
- <div style={{paddingLeft: detail || right ? 8 : 0}} className={styles.center}>
273
- {control}
274
- </div>
275
- )}
276
- </div>
277
- )}
278
- </div>
279
- );
280
- };
281
-
282
- type ControlProps = {
283
- name?: string;
284
- value?: boolean;
285
- defaultValue?: boolean;
286
- onChange?: (checked: boolean) => void;
287
- };
288
-
289
- interface BasicRowContentProps extends CommonProps {
290
- atomicReading?: boolean;
291
- }
292
-
293
- interface SwitchRowContentProps extends CommonProps {
294
- onPress?: (() => void) | undefined;
295
- trackingEvent?: TrackingEvent | ReadonlyArray<TrackingEvent>;
296
-
297
- switch: ControlProps | undefined;
298
- }
299
-
300
- interface CheckboxRowContentProps extends CommonProps {
301
- onPress?: (() => void) | undefined;
302
- trackingEvent?: TrackingEvent | ReadonlyArray<TrackingEvent>;
303
-
304
- checkbox: ControlProps | undefined;
305
- }
306
-
307
- interface RadioRowContentProps extends CommonProps {
308
- onPress?: (() => void) | undefined;
309
- trackingEvent?: TrackingEvent | ReadonlyArray<TrackingEvent>;
310
-
311
- radioValue: string;
312
- }
313
-
314
- interface IconButtonRowContentProps extends CommonProps {
315
- onPress?: (() => void) | undefined;
316
- trackingEvent?: TrackingEvent | ReadonlyArray<TrackingEvent>;
317
-
318
- iconButton: ExclusifyUnion<IconButtonProps | ToggleIconButtonProps> | undefined;
319
- }
320
-
321
- type TouchableCommonProps = {
322
- trackingEvent?: TrackingEvent | ReadonlyArray<TrackingEvent>;
323
- 'aria-label'?: string;
324
- 'aria-labelledby'?: string;
325
- 'aria-description'?: string;
326
- 'aria-describedby'?: string;
327
- 'aria-current'?: React.AriaAttributes['aria-current'];
328
- };
329
-
330
- interface HrefRowContentProps extends CommonProps, TouchableCommonProps {
331
- href: string | undefined;
332
- newTab?: boolean;
333
- loadOnTop?: boolean;
334
- onNavigate?: () => void | Promise<void>;
335
- }
336
-
337
- interface ToRowContentProps extends CommonProps, TouchableCommonProps {
338
- to: string | undefined;
339
- newTab?: boolean;
340
- fullPageOnWebView?: boolean;
341
- replace?: boolean;
342
- onNavigate?: () => void | Promise<void>;
343
- }
344
-
345
- interface OnPressRowContentProps extends CommonProps, TouchableCommonProps {
346
- onPress: (() => void) | undefined;
347
- }
348
-
349
- type RowContentProps = ExclusifyUnion<
350
- | BasicRowContentProps
351
- | SwitchRowContentProps
352
- | RadioRowContentProps
353
- | IconButtonRowContentProps
354
- | CheckboxRowContentProps
355
- | HrefRowContentProps
356
- | ToRowContentProps
357
- | OnPressRowContentProps
358
- >;
359
-
360
- const useControlState = ({
361
- value,
362
- defaultValue,
363
- onChange,
364
- }: {
365
- value?: boolean;
366
- defaultValue?: boolean;
367
- onChange?: (isChecked: boolean) => void;
368
- }): [boolean, () => void] => {
369
- const isControlledByParent = value !== undefined;
370
- const [isChecked, setIsChecked] = React.useState<boolean>(!!defaultValue);
371
-
372
- const toggle = () => {
373
- if (!isControlledByParent) {
374
- setIsChecked(!isChecked);
375
- }
376
- onChange?.(isControlledByParent ? !value : !isChecked);
377
- };
378
-
379
- return [isControlledByParent ? !!value : isChecked, toggle];
380
- };
381
-
382
- const hasControlProps = (
383
- obj: any
384
- ): obj is
385
- | SwitchRowContentProps
386
- | CheckboxRowContentProps
387
- | RadioRowContentProps
388
- | IconButtonRowContentProps => {
389
- return ['switch', 'checkbox', 'radioValue', 'iconButton'].some((prop) => obj[prop] !== undefined);
390
- };
391
-
392
- const getAssetText = (asset: React.ReactNode): string => {
393
- let text = '';
394
-
395
- const visit = (node: React.ReactNode) => {
396
- if (!node) return;
397
-
398
- if (React.isValidElement(node)) {
399
- const props: any = node.props;
400
-
401
- if (typeof props.alt === 'string' && props.alt.trim()) {
402
- text += (text ? ' ' : '') + props.alt.trim();
403
- }
404
- if (typeof props['aria-label'] === 'string' && props['aria-label'].trim()) {
405
- text += (text ? ' ' : '') + props['aria-label'].trim();
406
- }
407
- React.Children.forEach(props.children, visit);
408
- }
409
- };
410
-
411
- visit(asset);
412
-
413
- return text.trim();
414
- };
415
-
416
- const getNodeText = (node: HTMLElement | null): string => {
417
- const raw = node?.innerText || node?.textContent || '';
418
- /* In the real browser, innerText preserves line breaks between elements, but jsdom does not.
419
- As a result, when rows contain multiline content (e.g. `extra` with several Text components), jsdom returns the text concatenated without spaces.
420
- This causes the computed aria-label to differ from the real behaviour.
421
- To make tests reflect what VoiceOver would read in the browser, we normalise whitespace and insert missing spaces in test mode. */
422
- if (process.env.NODE_ENV === 'test') {
423
- return (
424
- raw
425
- // Normalise whitespace sequences to a single space
426
- .replace(/\s+/g, ' ')
427
- // Insert space between "non-space character" + "Uppercase"
428
- // Ex: "lineExtra" -> "line Extra", "1Extra" -> "1 Extra"
429
- .replace(/([^ ])([A-ZÁÉÍÓÚÑ])/g, '$1 $2')
430
- .trim()
431
- );
432
- }
433
- return raw;
434
- };
435
-
436
- const RowContent = React.forwardRef<TouchableElement, RowContentProps>((props, ref) => {
437
- const titleId = React.useId();
438
- const outsideVariant = useThemeVariant();
439
- const isOverBrand =
440
- outsideVariant === 'brand' || outsideVariant === 'media' || outsideVariant === 'negative';
441
- const {
442
- asset,
443
- headline,
444
- title,
445
- titleAs,
446
- titleLinesMax,
447
- subtitle,
448
- subtitleLinesMax,
449
- description,
450
- descriptionLinesMax,
451
- detail,
452
- danger,
453
- badge,
454
- role,
455
- touchableRole,
456
- extra,
457
- withChevron,
458
- dataAttributes,
459
- right,
460
- 'aria-label': ariaLabelProp,
461
- tabIndex,
462
- atomicReading,
463
- } = props;
464
-
465
- const [headlineText, setHeadlineText] = React.useState<string>('');
466
- const [extraText, setExtraText] = React.useState<string>('');
467
- const [rightText, setRightText] = React.useState<string>('');
468
- const assetText = getAssetText(asset);
469
-
470
- // iOS voiceover reads links with multiple lines as separate links. By setting aria-label and marking content as aria-hidden, we can make it read the whole row as one link.
471
- const computedAriaLabel = [
472
- title,
473
- assetText,
474
- headlineText,
475
- subtitle,
476
- description,
477
- extraText,
478
- detail,
479
- rightText,
480
- ]
481
- .filter(Boolean)
482
- .join(' ');
483
-
484
- const isInteractive = !!props.onPress || !!props.href || !!props.to;
485
- const ariaLabel = ariaLabelProp ?? (isInteractive ? computedAriaLabel : undefined);
486
-
487
- const radioContext = useRadioContext();
488
- const disabled = props.disabled || (props.radioValue !== undefined && radioContext.disabled);
489
- const hasHoverDefault = !disabled && !isOverBrand;
490
- const hasHoverInverse = !disabled && isOverBrand;
491
- const hasControl = hasControlProps(props);
492
- const hasChevron = hasControl ? false : withChevron ?? isInteractive;
493
-
494
- const interactiveProps = {
495
- href: props.href,
496
- newTab: props.newTab,
497
- loadOnTop: props.loadOnTop,
498
-
499
- to: props.to,
500
- fullPageOnWebView: props.fullPageOnWebView,
501
- replace: props.replace,
502
-
503
- onNavigate: props.onNavigate,
504
- onPress: props.onPress,
505
- trackingEvent: props.trackingEvent,
506
-
507
- 'aria-label': ariaLabel,
508
- 'aria-labelledby': props['aria-labelledby'],
509
- 'aria-description': props['aria-description'],
510
- 'aria-describedby': props['aria-describedby'],
511
- 'aria-current': props['aria-current'],
512
- } as TouchableProps;
513
-
514
- const [isChecked, toggle] = useControlState(props.switch || props.checkbox || {});
515
-
516
- const renderContent = (contentProps?: {control?: React.ReactNode; labelId?: string; role?: string}) => (
517
- <Content
518
- asset={asset}
519
- headline={headline}
520
- headlineRef={(node) => {
521
- if (node) {
522
- setHeadlineText(getNodeText(node));
523
- }
524
- }}
525
- title={title}
526
- titleAs={titleAs}
527
- subtitle={subtitle}
528
- description={description}
529
- badge={badge}
530
- titleLinesMax={titleLinesMax}
531
- subtitleLinesMax={subtitleLinesMax}
532
- descriptionLinesMax={descriptionLinesMax}
533
- detail={detail}
534
- danger={danger}
535
- right={right}
536
- rightRef={(node) => {
537
- if (node) {
538
- setRightText(getNodeText(node));
539
- }
540
- }}
541
- control={contentProps?.control}
542
- role={contentProps?.role}
543
- extra={extra}
544
- extraRef={(node) => {
545
- if (node) {
546
- setExtraText(getNodeText(node));
547
- }
548
- }}
549
- labelId={contentProps?.labelId}
550
- disabled={disabled}
551
- withChevron={hasChevron}
552
- />
553
- );
554
-
555
- if (isInteractive && !hasControl) {
556
- return (
557
- <BaseTouchable
558
- ref={ref}
559
- className={classNames(styles.rowContent, {
560
- [styles.touchableBackground]: hasHoverDefault,
561
- [styles.touchableBackgroundBrand]: hasHoverInverse,
562
- [styles.pointer]: !disabled,
563
- })}
564
- {...interactiveProps}
565
- role={touchableRole}
566
- dataAttributes={dataAttributes}
567
- disabled={disabled}
568
- tabIndex={tabIndex}
569
- >
570
- <Box
571
- paddingX={16}
572
- aria-hidden={!!props.to || !!props.href || props.touchableRole === 'link' || undefined}
573
- dataAttributes={{testid: 'content-container'}}
574
- >
575
- {renderContent({role})}
576
- </Box>
577
- </BaseTouchable>
578
- );
579
- }
580
-
581
- const renderRowWithDoubleInteraction = (control: React.ReactNode) => (
582
- <div
583
- className={styles.dualActionContainer}
584
- ref={ref as React.Ref<HTMLDivElement>}
585
- {...getPrefixedDataAttributes(dataAttributes)}
586
- >
587
- <BaseTouchable
588
- disabled={disabled}
589
- {...interactiveProps}
590
- role={touchableRole}
591
- className={classNames(styles.dualActionLeft, {
592
- [styles.touchableBackground]: hasHoverDefault,
593
- [styles.touchableBackgroundBrand]: hasHoverInverse,
594
- })}
595
- tabIndex={tabIndex}
596
- >
597
- {renderContent({labelId: titleId, role})}
598
- </BaseTouchable>
599
-
600
- <div className={styles.dualActionDivider} />
601
-
602
- {control}
603
- </div>
604
- );
605
-
606
- const renderRowWithSingleControl = (content: React.ReactNode, isContentInsideControl?: boolean) => (
607
- <div
608
- className={classNames(styles.rowContent, {
609
- [styles.touchableBackground]: hasHoverDefault && isContentInsideControl,
610
- [styles.touchableBackgroundBrand]: hasHoverInverse && isContentInsideControl,
611
- [styles.pointer]: !disabled && isContentInsideControl,
612
- })}
613
- ref={ref as React.Ref<HTMLDivElement>}
614
- {...getPrefixedDataAttributes(dataAttributes)}
615
- >
616
- {content}
617
- </div>
618
- );
619
-
620
- if (props.switch || props.checkbox) {
621
- const Control = props.switch ? Switch : Checkbox;
622
- const name = props.switch?.name ?? props.checkbox?.name ?? titleId;
623
-
624
- return isInteractive
625
- ? renderRowWithDoubleInteraction(
626
- <Control
627
- disabled={disabled}
628
- name={name}
629
- checked={isChecked}
630
- aria-label={ariaLabel}
631
- aria-labelledby={titleId}
632
- onChange={toggle}
633
- render={({controlElement}) => (
634
- <div className={styles.dualActionRight}>{controlElement}</div>
635
- )}
636
- />
637
- )
638
- : renderRowWithSingleControl(
639
- <Control
640
- disabled={disabled}
641
- name={name}
642
- checked={isChecked}
643
- aria-label={ariaLabel}
644
- aria-labelledby={titleId}
645
- onChange={toggle}
646
- render={({controlElement, labelId}) => (
647
- <Box paddingX={16} role={role}>
648
- {renderContent({
649
- labelId,
650
- control: <Stack space="around">{controlElement}</Stack>,
651
- })}
652
- </Box>
653
- )}
654
- />,
655
- true
656
- );
657
- }
658
-
659
- if (props.radioValue) {
660
- return isInteractive
661
- ? renderRowWithDoubleInteraction(
662
- <RadioButton
663
- value={props.radioValue}
664
- aria-label={ariaLabel}
665
- aria-labelledby={titleId}
666
- render={({controlElement}) => (
667
- <Stack space="around">
668
- <Box paddingX={16}>{controlElement}</Box>
669
- </Stack>
670
- )}
671
- />
672
- )
673
- : renderRowWithSingleControl(
674
- <RadioButton
675
- value={props.radioValue}
676
- aria-label={ariaLabel}
677
- aria-labelledby={titleId}
678
- render={({controlElement}) => (
679
- <Box paddingX={16} role={role}>
680
- {renderContent({
681
- labelId: titleId,
682
- control: <Stack space="around">{controlElement}</Stack>,
683
- })}
684
- </Box>
685
- )}
686
- />,
687
- true
688
- );
689
- }
690
-
691
- if (props.iconButton) {
692
- return isInteractive
693
- ? renderRowWithDoubleInteraction(
694
- <Box padding={16}>
695
- <Stack space="around">
696
- {props.iconButton.Icon ? (
697
- <IconButton {...props.iconButton} disabled={props.disabled} />
698
- ) : (
699
- <ToggleIconButton {...props.iconButton} disabled={props.disabled} />
700
- )}
701
- </Stack>
702
- </Box>
703
- )
704
- : renderRowWithSingleControl(
705
- <Box paddingX={16}>
706
- {renderContent({
707
- labelId: titleId,
708
- control: (
709
- <Stack space="around">
710
- {props.iconButton.Icon ? (
711
- <IconButton
712
- {...props.iconButton}
713
- disabled={props.disabled}
714
- role={role}
715
- />
716
- ) : (
717
- <ToggleIconButton
718
- {...props.iconButton}
719
- disabled={props.disabled}
720
- role={role}
721
- />
722
- )}
723
- </Stack>
724
- ),
725
- })}
726
- </Box>
727
- );
728
- }
729
-
730
- const shouldRenderScreenReaderOnly = !!ariaLabelProp || atomicReading;
731
-
732
- return (
733
- <div role={role}>
734
- <div
735
- className={classNames(styles.rowContent, styles.rowContentPadding)}
736
- // role="text" makes VoiceOver read the whole div as a single text block. This is needed for VoiceOver rectangle to
737
- // cover the whole row, otherwise it only covers the text inside ScreenReaderOnly
738
- role={shouldRenderScreenReaderOnly ? 'text' : undefined}
739
- {...getPrefixedDataAttributes(dataAttributes)}
740
- ref={ref as React.Ref<HTMLDivElement>}
741
- tabIndex={tabIndex}
742
- >
743
- <div aria-hidden={shouldRenderScreenReaderOnly}>{renderContent({role})}</div>
744
- {shouldRenderScreenReaderOnly && (
745
- <ScreenReaderOnly>
746
- <span>{ariaLabelProp ?? computedAriaLabel}</span>
747
- </ScreenReaderOnly>
748
- )}
749
- </div>
750
- </div>
751
- );
752
- });
753
-
754
- export const Row = React.forwardRef<TouchableElement, RowContentProps>(
755
- ({dataAttributes, role = 'listitem', ...props}, ref) => (
756
- <div role={role} className={styles.row}>
757
- <RowContent
758
- {...props}
759
- ref={ref}
760
- dataAttributes={{'component-name': 'Row', testid: 'Row', ...dataAttributes}}
761
- />
762
- </div>
763
- )
764
- );
765
-
766
- type CommonAccessibilityProps = {
767
- 'aria-live'?: 'polite' | 'off' | 'assertive';
768
- 'aria-atomic'?: boolean;
769
- };
770
-
771
- type RowListProps = {
772
- children: React.ReactNode;
773
- 'aria-label'?: string;
774
- 'aria-labelledby'?: string;
775
- /**
776
- * @deprecated Use 'aria-labelledby' instead. This will be removed in a future release.
777
- */
778
- ariaLabelledby?: string;
779
- role?: string;
780
- dataAttributes?: DataAttributes;
781
- } & CommonAccessibilityProps;
782
-
783
- export const RowList = ({
784
- children,
785
- ariaLabelledby,
786
- role = 'list',
787
- 'aria-label': ariaLabel,
788
- 'aria-labelledby': ariaLabelledBy = ariaLabelledby,
789
- 'aria-live': ariaLive = 'off',
790
- 'aria-atomic': ariaAtomic = false,
791
- dataAttributes,
792
- }: RowListProps): JSX.Element => {
793
- const childrenContent = React.Children.toArray(children).filter(Boolean);
794
- const lastIndex = childrenContent.length - 1;
795
-
796
- return (
797
- <div
798
- role={role}
799
- aria-labelledby={ariaLabelledBy}
800
- aria-label={ariaLabel}
801
- aria-live={ariaLive}
802
- aria-atomic={ariaAtomic}
803
- {...getPrefixedDataAttributes(dataAttributes, 'RowList')}
804
- >
805
- {childrenContent.map((child, index) => (
806
- <React.Fragment key={index}>
807
- {child}
808
- {index < lastIndex && (
809
- <Box paddingX={16}>
810
- <Divider />
811
- </Box>
812
- )}
813
- </React.Fragment>
814
- ))}
815
- </div>
816
- );
817
- };
818
-
819
- // danger + isInverse is not allowed
820
- type CommonBoxedRowProps =
821
- | {
822
- /**
823
- * @deprecated Use variant instead
824
- */
825
- isInverse?: false;
826
- variant?: 'default';
827
- danger: true;
828
- }
829
- | {
830
- /**
831
- * @deprecated Use variant instead
832
- */
833
- isInverse?: boolean;
834
- variant?: 'brand' | 'default';
835
- danger?: false;
836
- }
837
- | {
838
- /**
839
- * @deprecated Use variant instead
840
- */
841
- isInverse?: false;
842
- variant?: 'default';
843
- danger: boolean;
844
- };
845
-
846
- type BoxedRowProps = ExclusifyUnion<
847
- | BasicRowContentProps
848
- | SwitchRowContentProps
849
- | RadioRowContentProps
850
- | IconButtonRowContentProps
851
- | CheckboxRowContentProps
852
- | HrefRowContentProps
853
- | ToRowContentProps
854
- | OnPressRowContentProps
855
- > &
856
- CommonBoxedRowProps;
857
-
858
- export const BoxedRow = React.forwardRef<HTMLDivElement, BoxedRowProps>(({dataAttributes, ...props}, ref) => (
859
- <InternalBoxed
860
- overflow="visible"
861
- className={styles.boxed}
862
- variant={props.variant ?? (props.isInverse ? 'brand' : 'default')}
863
- ref={ref}
864
- dataAttributes={{'component-name': 'BoxedRow', testid: 'BoxedRow', ...dataAttributes}}
865
- >
866
- <RowContent {...props} />
867
- </InternalBoxed>
868
- ));
869
-
870
- type BoxedRowListProps = {
871
- children: React.ReactNode;
872
- 'aria-label'?: string;
873
- 'aria-labelledby'?: string;
874
- /**
875
- * @deprecated Use 'aria-labelledby' instead. This will be removed in a future release.
876
- */
877
- ariaLabelledby?: string;
878
- role?: string;
879
- dataAttributes?: DataAttributes;
880
- } & CommonAccessibilityProps;
881
-
882
- export const BoxedRowList = ({
883
- children,
884
- ariaLabelledby,
885
- role = 'list',
886
- dataAttributes,
887
- 'aria-label': ariaLabel,
888
- 'aria-labelledby': ariaLabelledBy = ariaLabelledby,
889
- 'aria-live': ariaLive = 'off',
890
- 'aria-atomic': ariaAtomic = false,
891
- }: BoxedRowListProps): JSX.Element => (
892
- <Stack
893
- space={16}
894
- role={role}
895
- aria-label={ariaLabel}
896
- aria-labelledby={ariaLabelledBy}
897
- aria-live={ariaLive}
898
- aria-atomic={ariaAtomic}
899
- dataAttributes={{'component-name': 'BoxedRowList', testid: 'BoxedRowList', ...dataAttributes}}
900
- >
901
- {children}
902
- </Stack>
903
- );
904
-
905
- type UnorderedListProps = {
906
- children: React.ReactNode;
907
- 'aria-label'?: string;
908
- 'aria-labelledby'?: string;
909
- };
910
-
911
- type OrderedListProps = UnorderedListProps;
912
-
913
- export const UnorderedList = ({
914
- children,
915
- 'aria-label': ariaLabel,
916
- 'aria-labelledby': ariaLabelledBy,
917
- }: UnorderedListProps): JSX.Element => {
918
- return (
919
- // role="list" is needed for accesibility in Safari+VoiceOver. See: https://developer.mozilla.org/en-US/docs/Web/CSS/list-style#accessibility
920
- // eslint-disable-next-line jsx-a11y/no-redundant-roles
921
- <ul role="list" className={styles.ul} aria-label={ariaLabel} aria-labelledby={ariaLabelledBy}>
922
- {children}
923
- </ul>
924
- );
925
- };
926
-
927
- export const OrderedList = ({
928
- children,
929
- 'aria-label': ariaLabel,
930
- 'aria-labelledby': ariaLabelledBy,
931
- }: OrderedListProps): JSX.Element => {
932
- return (
933
- // role="list" is needed for accesibility in Safari+VoiceOver. See: https://developer.mozilla.org/en-US/docs/Web/CSS/list-style#accessibility
934
- // eslint-disable-next-line jsx-a11y/no-redundant-roles
935
- <ol role="list" className={styles.ul} aria-label={ariaLabel} aria-labelledby={ariaLabelledBy}>
936
- {children}
937
- </ol>
938
- );
939
- };
940
-
941
- type ListItemProps = {
942
- children: React.ReactNode;
943
- Icon?: (props: IconProps) => JSX.Element;
944
- icon?: JSX.Element;
945
- withMarker?: boolean;
946
- };
947
-
948
- export const ListItem = ({children, Icon, icon, withMarker = true}: ListItemProps): JSX.Element => {
949
- return !withMarker ? (
950
- <li className={styles.liWithoutMarker}>
951
- <div className={styles.liContent}>{children}</div>
952
- </li>
953
- ) : Icon || icon ? (
954
- <li className={styles.liWithCustomIcon}>
955
- <Box paddingRight={{mobile: 8, desktop: 16}}>
956
- {Icon ? <Icon size="1em" color="currentColor" /> : icon}
957
- </Box>
958
- <div className={styles.liContent}>{children}</div>
959
- </li>
960
- ) : (
961
- <li className={styles.li}>{children}</li>
962
- );
963
- };