@oxy.so/bloom 23.5.0 → 23.7.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 (388) hide show
  1. package/NOTICE +28 -0
  2. package/android/src/main/java/so/oxy/bloom/BloomPackage.kt +3 -1
  3. package/android/src/main/java/so/oxy/bloom/icons/BloomIcon.kt +251 -0
  4. package/android/src/main/java/so/oxy/bloom/icons/IconPathParser.java +660 -0
  5. package/docs/adoption-matrix.mdx +1 -4
  6. package/docs/bloom-language-codemod.mdx +6 -2
  7. package/docs/bloom-language-modifiers.mdx +22 -6
  8. package/docs/bloom-language-nodes.mdx +3 -58
  9. package/docs/bloom-language.mdx +15 -36
  10. package/docs/empty-state.mdx +2 -3
  11. package/docs/icons.mdx +29 -1
  12. package/docs/public-parts.mdx +2 -7
  13. package/docs/task-catalog.json +1 -1
  14. package/docs/task-catalog.mdx +1 -1
  15. package/lib/commonjs/icons/TEMPLATE.js +25 -160
  16. package/lib/commonjs/icons/TEMPLATE.js.map +1 -1
  17. package/lib/commonjs/icons/glyph-svg.js +47 -0
  18. package/lib/commonjs/icons/glyph-svg.js.map +1 -0
  19. package/lib/commonjs/icons/glyph.js +29 -0
  20. package/lib/commonjs/icons/glyph.js.map +1 -0
  21. package/lib/commonjs/icons/glyph.native.js +112 -0
  22. package/lib/commonjs/icons/glyph.native.js.map +1 -0
  23. package/lib/commonjs/index.js +279 -485
  24. package/lib/commonjs/index.js.map +1 -1
  25. package/lib/commonjs/index.web.js +279 -485
  26. package/lib/commonjs/index.web.js.map +1 -1
  27. package/lib/commonjs/locale/translations/ar.js +0 -39
  28. package/lib/commonjs/locale/translations/ar.js.map +1 -1
  29. package/lib/commonjs/locale/translations/bn.js +0 -34
  30. package/lib/commonjs/locale/translations/bn.js.map +1 -1
  31. package/lib/commonjs/locale/translations/ca.js +0 -35
  32. package/lib/commonjs/locale/translations/ca.js.map +1 -1
  33. package/lib/commonjs/locale/translations/de.js +0 -35
  34. package/lib/commonjs/locale/translations/de.js.map +1 -1
  35. package/lib/commonjs/locale/translations/es.js +0 -35
  36. package/lib/commonjs/locale/translations/es.js.map +1 -1
  37. package/lib/commonjs/locale/translations/fr.js +0 -35
  38. package/lib/commonjs/locale/translations/fr.js.map +1 -1
  39. package/lib/commonjs/locale/translations/hi.js +0 -35
  40. package/lib/commonjs/locale/translations/hi.js.map +1 -1
  41. package/lib/commonjs/locale/translations/id.js +0 -34
  42. package/lib/commonjs/locale/translations/id.js.map +1 -1
  43. package/lib/commonjs/locale/translations/it.js +0 -35
  44. package/lib/commonjs/locale/translations/it.js.map +1 -1
  45. package/lib/commonjs/locale/translations/ja.js +0 -34
  46. package/lib/commonjs/locale/translations/ja.js.map +1 -1
  47. package/lib/commonjs/locale/translations/pt.js +0 -35
  48. package/lib/commonjs/locale/translations/pt.js.map +1 -1
  49. package/lib/commonjs/locale/translations/ru.js +0 -37
  50. package/lib/commonjs/locale/translations/ru.js.map +1 -1
  51. package/lib/commonjs/locale/translations/tr.js +0 -34
  52. package/lib/commonjs/locale/translations/tr.js.map +1 -1
  53. package/lib/commonjs/locale/translations/zh.js +0 -34
  54. package/lib/commonjs/locale/translations/zh.js.map +1 -1
  55. package/lib/commonjs/subtle-hover/SubtleHover.js +94 -31
  56. package/lib/commonjs/subtle-hover/SubtleHover.js.map +1 -1
  57. package/lib/commonjs/subtle-hover/index.js +7 -0
  58. package/lib/commonjs/subtle-hover/index.js.map +1 -1
  59. package/lib/commonjs/subtle-hover/use-press-highlight.js +95 -0
  60. package/lib/commonjs/subtle-hover/use-press-highlight.js.map +1 -0
  61. package/lib/module/icons/TEMPLATE.js +25 -158
  62. package/lib/module/icons/TEMPLATE.js.map +1 -1
  63. package/lib/module/icons/glyph-svg.js +41 -0
  64. package/lib/module/icons/glyph-svg.js.map +1 -0
  65. package/lib/module/icons/glyph.js +25 -0
  66. package/lib/module/icons/glyph.js.map +1 -0
  67. package/lib/module/icons/glyph.native.js +108 -0
  68. package/lib/module/icons/glyph.native.js.map +1 -0
  69. package/lib/module/index.js +0 -14
  70. package/lib/module/index.js.map +1 -1
  71. package/lib/module/index.web.js +0 -14
  72. package/lib/module/index.web.js.map +1 -1
  73. package/lib/module/locale/translations/ar.js +0 -39
  74. package/lib/module/locale/translations/ar.js.map +1 -1
  75. package/lib/module/locale/translations/bn.js +0 -34
  76. package/lib/module/locale/translations/bn.js.map +1 -1
  77. package/lib/module/locale/translations/ca.js +0 -35
  78. package/lib/module/locale/translations/ca.js.map +1 -1
  79. package/lib/module/locale/translations/de.js +0 -35
  80. package/lib/module/locale/translations/de.js.map +1 -1
  81. package/lib/module/locale/translations/es.js +0 -35
  82. package/lib/module/locale/translations/es.js.map +1 -1
  83. package/lib/module/locale/translations/fr.js +0 -35
  84. package/lib/module/locale/translations/fr.js.map +1 -1
  85. package/lib/module/locale/translations/hi.js +0 -35
  86. package/lib/module/locale/translations/hi.js.map +1 -1
  87. package/lib/module/locale/translations/id.js +0 -34
  88. package/lib/module/locale/translations/id.js.map +1 -1
  89. package/lib/module/locale/translations/it.js +0 -35
  90. package/lib/module/locale/translations/it.js.map +1 -1
  91. package/lib/module/locale/translations/ja.js +0 -34
  92. package/lib/module/locale/translations/ja.js.map +1 -1
  93. package/lib/module/locale/translations/pt.js +0 -35
  94. package/lib/module/locale/translations/pt.js.map +1 -1
  95. package/lib/module/locale/translations/ru.js +0 -37
  96. package/lib/module/locale/translations/ru.js.map +1 -1
  97. package/lib/module/locale/translations/tr.js +0 -34
  98. package/lib/module/locale/translations/tr.js.map +1 -1
  99. package/lib/module/locale/translations/zh.js +0 -34
  100. package/lib/module/locale/translations/zh.js.map +1 -1
  101. package/lib/module/subtle-hover/SubtleHover.js +95 -32
  102. package/lib/module/subtle-hover/SubtleHover.js.map +1 -1
  103. package/lib/module/subtle-hover/index.js +1 -0
  104. package/lib/module/subtle-hover/index.js.map +1 -1
  105. package/lib/module/subtle-hover/use-press-highlight.js +92 -0
  106. package/lib/module/subtle-hover/use-press-highlight.js.map +1 -0
  107. package/lib/typescript/commonjs/icons/TEMPLATE.d.ts +1 -1
  108. package/lib/typescript/commonjs/icons/TEMPLATE.d.ts.map +1 -1
  109. package/lib/typescript/commonjs/icons/glyph-svg.d.ts +17 -0
  110. package/lib/typescript/commonjs/icons/glyph-svg.d.ts.map +1 -0
  111. package/lib/typescript/commonjs/icons/glyph.d.ts +11 -0
  112. package/lib/typescript/commonjs/icons/glyph.d.ts.map +1 -0
  113. package/lib/typescript/commonjs/icons/glyph.native.d.ts +20 -0
  114. package/lib/typescript/commonjs/icons/glyph.native.d.ts.map +1 -0
  115. package/lib/typescript/commonjs/index.d.ts +0 -9
  116. package/lib/typescript/commonjs/index.d.ts.map +1 -1
  117. package/lib/typescript/commonjs/index.web.d.ts +0 -9
  118. package/lib/typescript/commonjs/index.web.d.ts.map +1 -1
  119. package/lib/typescript/commonjs/locale/translations/ar.d.ts.map +1 -1
  120. package/lib/typescript/commonjs/locale/translations/bn.d.ts.map +1 -1
  121. package/lib/typescript/commonjs/locale/translations/ca.d.ts.map +1 -1
  122. package/lib/typescript/commonjs/locale/translations/de.d.ts.map +1 -1
  123. package/lib/typescript/commonjs/locale/translations/es.d.ts.map +1 -1
  124. package/lib/typescript/commonjs/locale/translations/fr.d.ts.map +1 -1
  125. package/lib/typescript/commonjs/locale/translations/hi.d.ts.map +1 -1
  126. package/lib/typescript/commonjs/locale/translations/id.d.ts.map +1 -1
  127. package/lib/typescript/commonjs/locale/translations/it.d.ts.map +1 -1
  128. package/lib/typescript/commonjs/locale/translations/ja.d.ts.map +1 -1
  129. package/lib/typescript/commonjs/locale/translations/pt.d.ts.map +1 -1
  130. package/lib/typescript/commonjs/locale/translations/ru.d.ts.map +1 -1
  131. package/lib/typescript/commonjs/locale/translations/tr.d.ts.map +1 -1
  132. package/lib/typescript/commonjs/locale/translations/types.d.ts +0 -6
  133. package/lib/typescript/commonjs/locale/translations/types.d.ts.map +1 -1
  134. package/lib/typescript/commonjs/locale/translations/zh.d.ts.map +1 -1
  135. package/lib/typescript/commonjs/subtle-hover/SubtleHover.d.ts +4 -1
  136. package/lib/typescript/commonjs/subtle-hover/SubtleHover.d.ts.map +1 -1
  137. package/lib/typescript/commonjs/subtle-hover/index.d.ts +1 -0
  138. package/lib/typescript/commonjs/subtle-hover/index.d.ts.map +1 -1
  139. package/lib/typescript/commonjs/subtle-hover/types.d.ts +6 -0
  140. package/lib/typescript/commonjs/subtle-hover/types.d.ts.map +1 -1
  141. package/lib/typescript/commonjs/subtle-hover/use-press-highlight.d.ts +42 -0
  142. package/lib/typescript/commonjs/subtle-hover/use-press-highlight.d.ts.map +1 -0
  143. package/lib/typescript/module/icons/TEMPLATE.d.ts +1 -1
  144. package/lib/typescript/module/icons/TEMPLATE.d.ts.map +1 -1
  145. package/lib/typescript/module/icons/glyph-svg.d.ts +17 -0
  146. package/lib/typescript/module/icons/glyph-svg.d.ts.map +1 -0
  147. package/lib/typescript/module/icons/glyph.d.ts +11 -0
  148. package/lib/typescript/module/icons/glyph.d.ts.map +1 -0
  149. package/lib/typescript/module/icons/glyph.native.d.ts +20 -0
  150. package/lib/typescript/module/icons/glyph.native.d.ts.map +1 -0
  151. package/lib/typescript/module/index.d.ts +0 -9
  152. package/lib/typescript/module/index.d.ts.map +1 -1
  153. package/lib/typescript/module/index.web.d.ts +0 -9
  154. package/lib/typescript/module/index.web.d.ts.map +1 -1
  155. package/lib/typescript/module/locale/translations/ar.d.ts.map +1 -1
  156. package/lib/typescript/module/locale/translations/bn.d.ts.map +1 -1
  157. package/lib/typescript/module/locale/translations/ca.d.ts.map +1 -1
  158. package/lib/typescript/module/locale/translations/de.d.ts.map +1 -1
  159. package/lib/typescript/module/locale/translations/es.d.ts.map +1 -1
  160. package/lib/typescript/module/locale/translations/fr.d.ts.map +1 -1
  161. package/lib/typescript/module/locale/translations/hi.d.ts.map +1 -1
  162. package/lib/typescript/module/locale/translations/id.d.ts.map +1 -1
  163. package/lib/typescript/module/locale/translations/it.d.ts.map +1 -1
  164. package/lib/typescript/module/locale/translations/ja.d.ts.map +1 -1
  165. package/lib/typescript/module/locale/translations/pt.d.ts.map +1 -1
  166. package/lib/typescript/module/locale/translations/ru.d.ts.map +1 -1
  167. package/lib/typescript/module/locale/translations/tr.d.ts.map +1 -1
  168. package/lib/typescript/module/locale/translations/types.d.ts +0 -6
  169. package/lib/typescript/module/locale/translations/types.d.ts.map +1 -1
  170. package/lib/typescript/module/locale/translations/zh.d.ts.map +1 -1
  171. package/lib/typescript/module/subtle-hover/SubtleHover.d.ts +4 -1
  172. package/lib/typescript/module/subtle-hover/SubtleHover.d.ts.map +1 -1
  173. package/lib/typescript/module/subtle-hover/index.d.ts +1 -0
  174. package/lib/typescript/module/subtle-hover/index.d.ts.map +1 -1
  175. package/lib/typescript/module/subtle-hover/types.d.ts +6 -0
  176. package/lib/typescript/module/subtle-hover/types.d.ts.map +1 -1
  177. package/lib/typescript/module/subtle-hover/use-press-highlight.d.ts +42 -0
  178. package/lib/typescript/module/subtle-hover/use-press-highlight.d.ts.map +1 -0
  179. package/package.json +1 -52
  180. package/src/__tests__/support/public-part-classifications.json +0 -5
  181. package/src/icons/TEMPLATE.tsx +28 -49
  182. package/src/icons/glyph-svg.tsx +54 -0
  183. package/src/icons/glyph.native.tsx +138 -0
  184. package/src/icons/glyph.tsx +15 -0
  185. package/src/index.ts +0 -62
  186. package/src/index.web.ts +0 -62
  187. package/src/locale/translations/ar.ts +0 -36
  188. package/src/locale/translations/bn.ts +0 -36
  189. package/src/locale/translations/ca.ts +0 -36
  190. package/src/locale/translations/de.ts +0 -36
  191. package/src/locale/translations/es.ts +0 -36
  192. package/src/locale/translations/fr.ts +0 -36
  193. package/src/locale/translations/hi.ts +0 -36
  194. package/src/locale/translations/id.ts +0 -36
  195. package/src/locale/translations/it.ts +0 -36
  196. package/src/locale/translations/ja.ts +0 -36
  197. package/src/locale/translations/pt.ts +0 -36
  198. package/src/locale/translations/ru.ts +0 -36
  199. package/src/locale/translations/tr.ts +0 -36
  200. package/src/locale/translations/types.ts +0 -6
  201. package/src/locale/translations/zh.ts +0 -36
  202. package/src/subtle-hover/SubtleHover.tsx +33 -2
  203. package/src/subtle-hover/index.ts +5 -0
  204. package/src/subtle-hover/types.ts +6 -0
  205. package/src/subtle-hover/use-press-highlight.ts +93 -0
  206. package/docs/checkout-summary.mdx +0 -94
  207. package/docs/order-confirmation.mdx +0 -66
  208. package/docs/vendor-card.mdx +0 -83
  209. package/lib/commonjs/checkout-summary/CheckoutConfirm.js +0 -243
  210. package/lib/commonjs/checkout-summary/CheckoutConfirm.js.map +0 -1
  211. package/lib/commonjs/checkout-summary/CheckoutSummary.js +0 -432
  212. package/lib/commonjs/checkout-summary/CheckoutSummary.js.map +0 -1
  213. package/lib/commonjs/checkout-summary/CheckoutSummaryRow.js +0 -277
  214. package/lib/commonjs/checkout-summary/CheckoutSummaryRow.js.map +0 -1
  215. package/lib/commonjs/checkout-summary/constants.js +0 -66
  216. package/lib/commonjs/checkout-summary/constants.js.map +0 -1
  217. package/lib/commonjs/checkout-summary/index.js +0 -95
  218. package/lib/commonjs/checkout-summary/index.js.map +0 -1
  219. package/lib/commonjs/checkout-summary/messages.js +0 -23
  220. package/lib/commonjs/checkout-summary/messages.js.map +0 -1
  221. package/lib/commonjs/checkout-summary/shared.js +0 -43
  222. package/lib/commonjs/checkout-summary/shared.js.map +0 -1
  223. package/lib/commonjs/checkout-summary/types.js +0 -6
  224. package/lib/commonjs/checkout-summary/types.js.map +0 -1
  225. package/lib/commonjs/order-confirmation/OrderConfirmation.js +0 -305
  226. package/lib/commonjs/order-confirmation/OrderConfirmation.js.map +0 -1
  227. package/lib/commonjs/order-confirmation/constants.js +0 -26
  228. package/lib/commonjs/order-confirmation/constants.js.map +0 -1
  229. package/lib/commonjs/order-confirmation/index.js +0 -38
  230. package/lib/commonjs/order-confirmation/index.js.map +0 -1
  231. package/lib/commonjs/order-confirmation/messages.js +0 -18
  232. package/lib/commonjs/order-confirmation/messages.js.map +0 -1
  233. package/lib/commonjs/order-confirmation/types.js +0 -6
  234. package/lib/commonjs/order-confirmation/types.js.map +0 -1
  235. package/lib/commonjs/vendor-card/VendorCard.js +0 -1051
  236. package/lib/commonjs/vendor-card/VendorCard.js.map +0 -1
  237. package/lib/commonjs/vendor-card/constants.js +0 -54
  238. package/lib/commonjs/vendor-card/constants.js.map +0 -1
  239. package/lib/commonjs/vendor-card/index.js +0 -69
  240. package/lib/commonjs/vendor-card/index.js.map +0 -1
  241. package/lib/commonjs/vendor-card/message-helpers.js +0 -23
  242. package/lib/commonjs/vendor-card/message-helpers.js.map +0 -1
  243. package/lib/commonjs/vendor-card/messages.js +0 -32
  244. package/lib/commonjs/vendor-card/messages.js.map +0 -1
  245. package/lib/commonjs/vendor-card/shared.js +0 -116
  246. package/lib/commonjs/vendor-card/shared.js.map +0 -1
  247. package/lib/commonjs/vendor-card/types.js +0 -6
  248. package/lib/commonjs/vendor-card/types.js.map +0 -1
  249. package/lib/module/checkout-summary/CheckoutConfirm.js +0 -237
  250. package/lib/module/checkout-summary/CheckoutConfirm.js.map +0 -1
  251. package/lib/module/checkout-summary/CheckoutSummary.js +0 -426
  252. package/lib/module/checkout-summary/CheckoutSummary.js.map +0 -1
  253. package/lib/module/checkout-summary/CheckoutSummaryRow.js +0 -273
  254. package/lib/module/checkout-summary/CheckoutSummaryRow.js.map +0 -1
  255. package/lib/module/checkout-summary/constants.js +0 -63
  256. package/lib/module/checkout-summary/constants.js.map +0 -1
  257. package/lib/module/checkout-summary/index.js +0 -8
  258. package/lib/module/checkout-summary/index.js.map +0 -1
  259. package/lib/module/checkout-summary/messages.js +0 -20
  260. package/lib/module/checkout-summary/messages.js.map +0 -1
  261. package/lib/module/checkout-summary/shared.js +0 -36
  262. package/lib/module/checkout-summary/shared.js.map +0 -1
  263. package/lib/module/checkout-summary/types.js +0 -4
  264. package/lib/module/checkout-summary/types.js.map +0 -1
  265. package/lib/module/order-confirmation/OrderConfirmation.js +0 -299
  266. package/lib/module/order-confirmation/OrderConfirmation.js.map +0 -1
  267. package/lib/module/order-confirmation/constants.js +0 -23
  268. package/lib/module/order-confirmation/constants.js.map +0 -1
  269. package/lib/module/order-confirmation/index.js +0 -5
  270. package/lib/module/order-confirmation/index.js.map +0 -1
  271. package/lib/module/order-confirmation/messages.js +0 -15
  272. package/lib/module/order-confirmation/messages.js.map +0 -1
  273. package/lib/module/order-confirmation/types.js +0 -4
  274. package/lib/module/order-confirmation/types.js.map +0 -1
  275. package/lib/module/vendor-card/VendorCard.js +0 -1046
  276. package/lib/module/vendor-card/VendorCard.js.map +0 -1
  277. package/lib/module/vendor-card/constants.js +0 -50
  278. package/lib/module/vendor-card/constants.js.map +0 -1
  279. package/lib/module/vendor-card/index.js +0 -6
  280. package/lib/module/vendor-card/index.js.map +0 -1
  281. package/lib/module/vendor-card/message-helpers.js +0 -18
  282. package/lib/module/vendor-card/message-helpers.js.map +0 -1
  283. package/lib/module/vendor-card/messages.js +0 -29
  284. package/lib/module/vendor-card/messages.js.map +0 -1
  285. package/lib/module/vendor-card/shared.js +0 -107
  286. package/lib/module/vendor-card/shared.js.map +0 -1
  287. package/lib/module/vendor-card/types.js +0 -4
  288. package/lib/module/vendor-card/types.js.map +0 -1
  289. package/lib/typescript/commonjs/checkout-summary/CheckoutConfirm.d.ts +0 -40
  290. package/lib/typescript/commonjs/checkout-summary/CheckoutConfirm.d.ts.map +0 -1
  291. package/lib/typescript/commonjs/checkout-summary/CheckoutSummary.d.ts +0 -36
  292. package/lib/typescript/commonjs/checkout-summary/CheckoutSummary.d.ts.map +0 -1
  293. package/lib/typescript/commonjs/checkout-summary/CheckoutSummaryRow.d.ts +0 -29
  294. package/lib/typescript/commonjs/checkout-summary/CheckoutSummaryRow.d.ts.map +0 -1
  295. package/lib/typescript/commonjs/checkout-summary/constants.d.ts +0 -39
  296. package/lib/typescript/commonjs/checkout-summary/constants.d.ts.map +0 -1
  297. package/lib/typescript/commonjs/checkout-summary/index.d.ts +0 -8
  298. package/lib/typescript/commonjs/checkout-summary/index.d.ts.map +0 -1
  299. package/lib/typescript/commonjs/checkout-summary/messages.d.ts +0 -23
  300. package/lib/typescript/commonjs/checkout-summary/messages.d.ts.map +0 -1
  301. package/lib/typescript/commonjs/checkout-summary/shared.d.ts +0 -27
  302. package/lib/typescript/commonjs/checkout-summary/shared.d.ts.map +0 -1
  303. package/lib/typescript/commonjs/checkout-summary/types.d.ts +0 -147
  304. package/lib/typescript/commonjs/checkout-summary/types.d.ts.map +0 -1
  305. package/lib/typescript/commonjs/order-confirmation/OrderConfirmation.d.ts +0 -40
  306. package/lib/typescript/commonjs/order-confirmation/OrderConfirmation.d.ts.map +0 -1
  307. package/lib/typescript/commonjs/order-confirmation/constants.d.ts +0 -17
  308. package/lib/typescript/commonjs/order-confirmation/constants.d.ts.map +0 -1
  309. package/lib/typescript/commonjs/order-confirmation/index.d.ts +0 -4
  310. package/lib/typescript/commonjs/order-confirmation/index.d.ts.map +0 -1
  311. package/lib/typescript/commonjs/order-confirmation/messages.d.ts +0 -12
  312. package/lib/typescript/commonjs/order-confirmation/messages.d.ts.map +0 -1
  313. package/lib/typescript/commonjs/order-confirmation/types.d.ts +0 -88
  314. package/lib/typescript/commonjs/order-confirmation/types.d.ts.map +0 -1
  315. package/lib/typescript/commonjs/vendor-card/VendorCard.d.ts +0 -6
  316. package/lib/typescript/commonjs/vendor-card/VendorCard.d.ts.map +0 -1
  317. package/lib/typescript/commonjs/vendor-card/constants.d.ts +0 -30
  318. package/lib/typescript/commonjs/vendor-card/constants.d.ts.map +0 -1
  319. package/lib/typescript/commonjs/vendor-card/index.d.ts +0 -5
  320. package/lib/typescript/commonjs/vendor-card/index.d.ts.map +0 -1
  321. package/lib/typescript/commonjs/vendor-card/message-helpers.d.ts +0 -13
  322. package/lib/typescript/commonjs/vendor-card/message-helpers.d.ts.map +0 -1
  323. package/lib/typescript/commonjs/vendor-card/messages.d.ts +0 -22
  324. package/lib/typescript/commonjs/vendor-card/messages.d.ts.map +0 -1
  325. package/lib/typescript/commonjs/vendor-card/shared.d.ts +0 -24
  326. package/lib/typescript/commonjs/vendor-card/shared.d.ts.map +0 -1
  327. package/lib/typescript/commonjs/vendor-card/types.d.ts +0 -111
  328. package/lib/typescript/commonjs/vendor-card/types.d.ts.map +0 -1
  329. package/lib/typescript/module/checkout-summary/CheckoutConfirm.d.ts +0 -40
  330. package/lib/typescript/module/checkout-summary/CheckoutConfirm.d.ts.map +0 -1
  331. package/lib/typescript/module/checkout-summary/CheckoutSummary.d.ts +0 -36
  332. package/lib/typescript/module/checkout-summary/CheckoutSummary.d.ts.map +0 -1
  333. package/lib/typescript/module/checkout-summary/CheckoutSummaryRow.d.ts +0 -29
  334. package/lib/typescript/module/checkout-summary/CheckoutSummaryRow.d.ts.map +0 -1
  335. package/lib/typescript/module/checkout-summary/constants.d.ts +0 -39
  336. package/lib/typescript/module/checkout-summary/constants.d.ts.map +0 -1
  337. package/lib/typescript/module/checkout-summary/index.d.ts +0 -8
  338. package/lib/typescript/module/checkout-summary/index.d.ts.map +0 -1
  339. package/lib/typescript/module/checkout-summary/messages.d.ts +0 -23
  340. package/lib/typescript/module/checkout-summary/messages.d.ts.map +0 -1
  341. package/lib/typescript/module/checkout-summary/shared.d.ts +0 -27
  342. package/lib/typescript/module/checkout-summary/shared.d.ts.map +0 -1
  343. package/lib/typescript/module/checkout-summary/types.d.ts +0 -147
  344. package/lib/typescript/module/checkout-summary/types.d.ts.map +0 -1
  345. package/lib/typescript/module/order-confirmation/OrderConfirmation.d.ts +0 -40
  346. package/lib/typescript/module/order-confirmation/OrderConfirmation.d.ts.map +0 -1
  347. package/lib/typescript/module/order-confirmation/constants.d.ts +0 -17
  348. package/lib/typescript/module/order-confirmation/constants.d.ts.map +0 -1
  349. package/lib/typescript/module/order-confirmation/index.d.ts +0 -4
  350. package/lib/typescript/module/order-confirmation/index.d.ts.map +0 -1
  351. package/lib/typescript/module/order-confirmation/messages.d.ts +0 -12
  352. package/lib/typescript/module/order-confirmation/messages.d.ts.map +0 -1
  353. package/lib/typescript/module/order-confirmation/types.d.ts +0 -88
  354. package/lib/typescript/module/order-confirmation/types.d.ts.map +0 -1
  355. package/lib/typescript/module/vendor-card/VendorCard.d.ts +0 -6
  356. package/lib/typescript/module/vendor-card/VendorCard.d.ts.map +0 -1
  357. package/lib/typescript/module/vendor-card/constants.d.ts +0 -30
  358. package/lib/typescript/module/vendor-card/constants.d.ts.map +0 -1
  359. package/lib/typescript/module/vendor-card/index.d.ts +0 -5
  360. package/lib/typescript/module/vendor-card/index.d.ts.map +0 -1
  361. package/lib/typescript/module/vendor-card/message-helpers.d.ts +0 -13
  362. package/lib/typescript/module/vendor-card/message-helpers.d.ts.map +0 -1
  363. package/lib/typescript/module/vendor-card/messages.d.ts +0 -22
  364. package/lib/typescript/module/vendor-card/messages.d.ts.map +0 -1
  365. package/lib/typescript/module/vendor-card/shared.d.ts +0 -24
  366. package/lib/typescript/module/vendor-card/shared.d.ts.map +0 -1
  367. package/lib/typescript/module/vendor-card/types.d.ts +0 -111
  368. package/lib/typescript/module/vendor-card/types.d.ts.map +0 -1
  369. package/src/checkout-summary/CheckoutConfirm.tsx +0 -119
  370. package/src/checkout-summary/CheckoutSummary.tsx +0 -221
  371. package/src/checkout-summary/CheckoutSummaryRow.tsx +0 -172
  372. package/src/checkout-summary/constants.ts +0 -64
  373. package/src/checkout-summary/index.ts +0 -22
  374. package/src/checkout-summary/messages.ts +0 -33
  375. package/src/checkout-summary/shared.ts +0 -40
  376. package/src/checkout-summary/types.ts +0 -152
  377. package/src/order-confirmation/OrderConfirmation.tsx +0 -197
  378. package/src/order-confirmation/constants.ts +0 -20
  379. package/src/order-confirmation/index.ts +0 -12
  380. package/src/order-confirmation/messages.ts +0 -18
  381. package/src/order-confirmation/types.ts +0 -98
  382. package/src/vendor-card/VendorCard.tsx +0 -509
  383. package/src/vendor-card/constants.ts +0 -58
  384. package/src/vendor-card/index.ts +0 -15
  385. package/src/vendor-card/message-helpers.ts +0 -20
  386. package/src/vendor-card/messages.ts +0 -36
  387. package/src/vendor-card/shared.ts +0 -136
  388. package/src/vendor-card/types.ts +0 -115
@@ -1,22 +0,0 @@
1
- import { type MessageCatalog } from '../locale/messages.js';
2
- import type { VendorAvailability, VendorFactKey } from './types.js';
3
- /**
4
- * Every fixed string the vendor card draws or announces, in each Bloom
5
- * language. A caller's `factLabels`, `availabilityLabel`, `newLabel` and
6
- * `accessibilityLabel` still win over any entry here.
7
- */
8
- export interface VendorCardMessages {
9
- /** The word said before each reading in the card's accessible name. */
10
- facts: Record<VendorFactKey, string>;
11
- /** The status pill. `open` draws none. */
12
- availability: Record<Exclude<VendorAvailability, 'open'>, string>;
13
- /** An unrated vendor's mark. */
14
- new: string;
15
- /**
16
- * The rating in the card's accessible name: "Rated 4.8 out of 5, 214
17
- * reviews". `reviews` is the app's count, a number or pre-formatted text.
18
- */
19
- rated: (value: string, reviews?: number | string) => string;
20
- }
21
- export declare const VENDOR_CARD_MESSAGES: MessageCatalog<VendorCardMessages>;
22
- //# sourceMappingURL=messages.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"messages.d.ts","sourceRoot":"","sources":["../../../../src/vendor-card/messages.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkB,KAAK,cAAc,EAAE,MAAM,uBAAoB,CAAC;AACzE,OAAO,KAAK,EAAE,kBAAkB,EAAE,aAAa,EAAE,MAAM,YAAS,CAAC;AAGjE;;;;GAIG;AACH,MAAM,WAAW,kBAAkB;IACjC,uEAAuE;IACvE,KAAK,EAAE,MAAM,CAAC,aAAa,EAAE,MAAM,CAAC,CAAC;IACrC,0CAA0C;IAC1C,YAAY,EAAE,MAAM,CAAC,OAAO,CAAC,kBAAkB,EAAE,MAAM,CAAC,EAAE,MAAM,CAAC,CAAC;IAClE,gCAAgC;IAChC,GAAG,EAAE,MAAM,CAAC;IACZ;;;OAGG;IACH,KAAK,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,KAAK,MAAM,CAAC;CAC7D;AAED,eAAO,MAAM,oBAAoB,EAAE,cAAc,CAAC,kBAAkB,CAYhE,CAAC"}
@@ -1,24 +0,0 @@
1
- import type { ListingFact } from '../listing-card/types.js';
2
- import { type VendorCardMessages } from './messages.js';
3
- import type { VendorAvailability, VendorCardDensity, VendorCardProps } from './types.js';
4
- /** The status pill's label, or `null` for a vendor that is taking orders. */
5
- export declare function availabilityLabelFor(availability: VendorAvailability | undefined, override?: string, messages?: VendorCardMessages): string | null;
6
- /**
7
- * The readings the fact row draws, in {@link VENDOR_FACT_ORDER}, skipping the
8
- * ones the app did not give. Each carries the glyph it is drawn with and the
9
- * words it is ANNOUNCED with, which are not the same string: "€1.90" beside a
10
- * bike reads as a fee to an eye and as a price to a screen reader.
11
- */
12
- export declare function vendorFacts(props: Pick<VendorCardProps, 'deliveryTime' | 'deliveryFee' | 'distance' | 'minimumOrder' | 'factLabels'>, messages?: VendorCardMessages): ListingFact[];
13
- /** The cuisines actually drawn: the first few, de-duplicated, in the order given. */
14
- export declare function vendorCuisines(cuisines: ReadonlyArray<string> | undefined, density: VendorCardDensity): string[];
15
- /**
16
- * The whole card as one sentence, in the order it is read on screen. EVERY
17
- * cuisine is in it, including the ones the clipped row dropped — the row drops
18
- * pills because it ran out of width, which is not a reason to withhold them
19
- * from someone who is listening rather than looking.
20
- */
21
- export declare function composeVendorName(props: VendorCardProps, messages?: VendorCardMessages): string;
22
- export declare const VENDOR_CARD_STYLE_ID = "bloom-vendor-card-web-css";
23
- export declare const VENDOR_CARD_CSS = "\n[data-bloom-vendor-card-link] {\n outline: none;\n text-decoration: none;\n color: inherit;\n}\n[data-bloom-vendor-card-link]:focus-visible {\n outline: 2px solid var(--bloom-vendor-card-ring, currentColor);\n outline-offset: 4px;\n border-radius: 20px;\n}\n";
24
- //# sourceMappingURL=shared.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"shared.d.ts","sourceRoot":"","sources":["../../../../src/vendor-card/shared.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,0BAAuB,CAAC;AAGzD,OAAO,EAAwB,KAAK,kBAAkB,EAAE,MAAM,eAAY,CAAC;AAC3E,OAAO,KAAK,EACV,kBAAkB,EAClB,iBAAiB,EACjB,eAAe,EAEhB,MAAM,YAAS,CAAC;AAEjB,6EAA6E;AAC7E,wBAAgB,oBAAoB,CAClC,YAAY,EAAE,kBAAkB,GAAG,SAAS,EAC5C,QAAQ,CAAC,EAAE,MAAM,EACjB,QAAQ,GAAE,kBAA4C,GACrD,MAAM,GAAG,IAAI,CAGf;AAED;;;;;GAKG;AACH,wBAAgB,WAAW,CACzB,KAAK,EAAE,IAAI,CACT,eAAe,EACf,cAAc,GAAG,aAAa,GAAG,UAAU,GAAG,cAAc,GAAG,YAAY,CAC5E,EACD,QAAQ,GAAE,kBAA4C,GACrD,WAAW,EAAE,CAmBf;AAED,qFAAqF;AACrF,wBAAgB,cAAc,CAC5B,QAAQ,EAAE,aAAa,CAAC,MAAM,CAAC,GAAG,SAAS,EAC3C,OAAO,EAAE,iBAAiB,GACzB,MAAM,EAAE,CAMV;AAED;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAC/B,KAAK,EAAE,eAAe,EACtB,QAAQ,GAAE,kBAA4C,GACrD,MAAM,CAoBR;AAYD,eAAO,MAAM,oBAAoB,8BAA8B,CAAC;AAIhE,eAAO,MAAM,eAAe,+QAW3B,CAAC"}
@@ -1,111 +0,0 @@
1
- import type { StyleProp, ViewStyle } from 'react-native';
2
- import type { AccentTone } from '../theme/accent-colors.js';
3
- /**
4
- * Whether you can order from this vendor right now.
5
- *
6
- * `open` draws nothing at all. `paused` is a vendor that is open but has
7
- * stopped taking orders for a while (a kitchen that is under water); `closed`
8
- * is outside its hours. Both wash the cover toward the page and draw a status
9
- * pill, because the difference the reader acts on is "not now", and the two
10
- * words are what say which kind of "not now" it is.
11
- */
12
- export type VendorAvailability = 'open' | 'paused' | 'closed';
13
- /**
14
- * `comfortable` is the wide card that sits in a shelf of vendors; `compact` is
15
- * the dense row a search result is drawn as. ONE component, because the DATA is
16
- * the same and a screen that switches at a breakpoint must not switch
17
- * components.
18
- */
19
- export type VendorCardDensity = 'comfortable' | 'compact';
20
- /**
21
- * The four readings a vendor card can carry, in the order it draws them. Each
22
- * arrives PRE-FORMATTED — "25–35 min", "€1.90", "Free", "1.2 km", "€12" — and
23
- * nothing here parses, converts or adds up any of them.
24
- */
25
- export type VendorFactKey = 'deliveryTime' | 'deliveryFee' | 'distance' | 'minimumOrder';
26
- export interface VendorCardProps {
27
- /** The vendor's name. One line, truncated. */
28
- name: string;
29
- /**
30
- * The cover: an absolute URL, or an id the app's `ImageResolver` turns into
31
- * one (resolved with `photoVariant`). One picture — a vendor is not a gallery.
32
- */
33
- photo?: string;
34
- /** The `ImageResolver` rendition for a photo id (e.g. `'medium'`). Ignored for URLs. */
35
- photoVariant?: string;
36
- /**
37
- * What the vendor cooks or sells — "Japanese", "Sushi", "Poke". Drawn as a
38
- * clipped row of pills under the name; the ones that do not fit drop out
39
- * whole rather than being cut in half, and the card's accessible name still
40
- * carries every one of them.
41
- */
42
- cuisines?: ReadonlyArray<string>;
43
- /**
44
- * The rating on a 5 scale, drawn by Bloom's `Rating` right of the name.
45
- * `undefined` draws nothing; `null` or `''` draws the "New" label.
46
- */
47
- rating?: number | string | null;
48
- /** The review count, drawn after the rating ("(128)"). */
49
- reviewCount?: number | string;
50
- /** The "New" label of an unrated vendor (`"New"` in English). */
51
- newLabel?: string;
52
- /** Pre-formatted — "25–35 min". */
53
- deliveryTime?: string;
54
- /** Pre-formatted — "€1.90", "Free". */
55
- deliveryFee?: string;
56
- /** Pre-formatted — "1.2 km". */
57
- distance?: string;
58
- /** Pre-formatted — "€12". */
59
- minimumOrder?: string;
60
- /**
61
- * The WORD said before each reading in the card's accessible name —
62
- * "Delivery time 25–35 min". Defaults follow the locale ("Delivery time",
63
- * "Delivery", "Distance", "Minimum order" in English); a bare "25–35 min" beside a glyph
64
- * means nothing read aloud, and the glyph is not announced.
65
- */
66
- factLabels?: Partial<Record<VendorFactKey, string>>;
67
- /** The promotion, pre-formatted and short — "2 for 1", "−20% today". */
68
- promo?: string;
69
- /** The promo mark's tone. Default `success`, the tone `price-breakdown` gives money coming back. */
70
- promoTone?: AccentTone;
71
- /** Default `open`. */
72
- availability?: VendorAvailability;
73
- /** Replaces the localised status label ("Paused", "Closed" in English). */
74
- availabilityLabel?: string;
75
- /**
76
- * When the vendor takes orders again, PRE-FORMATTED by the app — "Opens at
77
- * 19:00", "Opens tomorrow at 12:00". Drawn under the name while the vendor is
78
- * not open, and ignored while it is: a line that said when an open shop opens
79
- * is noise.
80
- */
81
- opensAt?: string;
82
- /** Whether the vendor is saved. Omit `onFavoriteChange` too to hide the heart. */
83
- favorite?: boolean;
84
- /** Called with the next saved state. The heart is drawn only when this is given. */
85
- onFavoriteChange?: (favorite: boolean) => void;
86
- /** Names of the heart, passed to `FavoriteButton`. */
87
- saveLabel?: string;
88
- removeLabel?: string;
89
- /** Called when the card is pressed. */
90
- onPress?: () => void;
91
- /**
92
- * The vendor's URL. On web the card is a real `<a href>` (open in a new tab,
93
- * copy link); with `onPress` too the default navigation is prevented so a
94
- * router can take it. On native the card opens it with `Linking` when there is
95
- * no `onPress`.
96
- */
97
- href?: string;
98
- /** Draws a skeleton in the same geometry instead of the vendor. */
99
- loading?: boolean;
100
- /** Default `comfortable`. */
101
- density?: VendorCardDensity;
102
- /**
103
- * Replaces the composed accessible name ("Fig & Ember, Closed, Japanese,
104
- * Sushi, Rated 4.8 out of 5, 214 reviews, Delivery time 25–35 min" in
105
- * English), which follows the locale.
106
- */
107
- accessibilityLabel?: string;
108
- style?: StyleProp<ViewStyle>;
109
- testID?: string;
110
- }
111
- //# sourceMappingURL=types.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/vendor-card/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEzD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,2BAAwB,CAAC;AAEzD;;;;;;;;GAQG;AACH,MAAM,MAAM,kBAAkB,GAAG,MAAM,GAAG,QAAQ,GAAG,QAAQ,CAAC;AAE9D;;;;;GAKG;AACH,MAAM,MAAM,iBAAiB,GAAG,aAAa,GAAG,SAAS,CAAC;AAE1D;;;;GAIG;AACH,MAAM,MAAM,aAAa,GAAG,cAAc,GAAG,aAAa,GAAG,UAAU,GAAG,cAAc,CAAC;AAEzF,MAAM,WAAW,eAAe;IAC9B,8CAA8C;IAC9C,IAAI,EAAE,MAAM,CAAC;IACb;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,wFAAwF;IACxF,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB;;;;;OAKG;IACH,QAAQ,CAAC,EAAE,aAAa,CAAC,MAAM,CAAC,CAAC;IACjC;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAAC;IAChC,0DAA0D;IAC1D,WAAW,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAC9B,iEAAiE;IACjE,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,mCAAmC;IACnC,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,uCAAuC;IACvC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,gCAAgC;IAChC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,6BAA6B;IAC7B,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB;;;;;OAKG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,aAAa,EAAE,MAAM,CAAC,CAAC,CAAC;IACpD,wEAAwE;IACxE,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,oGAAoG;IACpG,SAAS,CAAC,EAAE,UAAU,CAAC;IACvB,sBAAsB;IACtB,YAAY,CAAC,EAAE,kBAAkB,CAAC;IAClC,2EAA2E;IAC3E,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B;;;;;OAKG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,kFAAkF;IAClF,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,oFAAoF;IACpF,gBAAgB,CAAC,EAAE,CAAC,QAAQ,EAAE,OAAO,KAAK,IAAI,CAAC;IAC/C,sDAAsD;IACtD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,uCAAuC;IACvC,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB;;;;;OAKG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,mEAAmE;IACnE,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,6BAA6B;IAC7B,OAAO,CAAC,EAAE,iBAAiB,CAAC;IAC5B;;;;OAIG;IACH,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAC7B,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB"}
@@ -1,119 +0,0 @@
1
- import React, { memo, useCallback, useEffect, useRef, useState } from 'react';
2
- import { View } from 'react-native';
3
-
4
- import { ActionCardNote } from '../booking/ActionCard';
5
- import { Button } from '../button';
6
- import { useMessages } from '../locale/messages';
7
- import { CHECKOUT_SUMMARY_MESSAGES } from './messages';
8
- import { checkoutConfirmLabel } from './shared';
9
- import type { CheckoutConfirmProps } from './types';
10
-
11
- /**
12
- * The press that places the order: the words, the amount it commits to, the
13
- * terms under it, and the state where it must not fire twice.
14
- *
15
- * button `Button` primary large, full width, "Place order · €24.80"
16
- * second `secondaryAmount` ("≈ 12,00 €"), 8 under the button, the same
17
- * centred secondary line as the terms — the button carries ONE
18
- * amount, the one the charge is made in
19
- * terms 12 under it; the centred secondary line every Bloom action card
20
- * draws under its primary (`ActionCardNote`)
21
- * footer 16 under the terms
22
- *
23
- * ## Why the amount is ON the button
24
- *
25
- * The number a press commits to and the press are one decision. A total
26
- * elsewhere on the screen and a button reading "Place order" are two, and the
27
- * gap between them is where a reader confirms a figure they last saw before a
28
- * tip picker changed it.
29
- *
30
- * ## Why there are TWO guards against a double order
31
- *
32
- * `busy` is the app's: while the order is in flight the button spins and every
33
- * press is dropped. It is not enough on its own — a press calls `onConfirm`,
34
- * the app sets its state, and `busy` only reaches this component on the NEXT
35
- * commit; the second tap of a double-tap lands inside that window and places a
36
- * second order. So the component also latches on its own press, synchronously,
37
- * in a ref: state would not do, because two presses in one tick both read the
38
- * same render's value.
39
- *
40
- * The latch clears on the first commit where `busy` is false again — so an app
41
- * that never sets `busy` (a confirm that navigates away, a demo) gets exactly
42
- * one press per tick and is never wedged, and an app that does keeps the button
43
- * inert for the whole flight.
44
- */
45
- function CheckoutConfirmComponent({
46
- label: labelProp,
47
- amount,
48
- secondaryAmount,
49
- terms,
50
- onConfirm,
51
- disabled = false,
52
- busy = false,
53
- busyLabel: busyLabelProp,
54
- footer,
55
- style,
56
- testID,
57
- }: CheckoutConfirmProps) {
58
- const { messages } = useMessages(CHECKOUT_SUMMARY_MESSAGES);
59
- const label = labelProp ?? messages.placeOrder;
60
- const busyLabel = busyLabelProp ?? messages.placingOrder;
61
- const latch = useRef(false);
62
- const [latched, setLatched] = useState(false);
63
-
64
- const handlePress = useCallback(() => {
65
- if (disabled || busy || latch.current) return;
66
- latch.current = true;
67
- setLatched(true);
68
- onConfirm?.();
69
- }, [disabled, busy, onConfirm]);
70
-
71
- useEffect(() => {
72
- if (!latched || busy) return;
73
- latch.current = false;
74
- setLatched(false);
75
- }, [latched, busy]);
76
-
77
- const id = (part: string) => (testID ? `${testID}-${part}` : undefined);
78
- const words = checkoutConfirmLabel(label, amount);
79
-
80
- return (
81
- <View testID={testID} style={style}>
82
- <Button
83
- size="lg"
84
- fullWidth
85
- onPress={handlePress}
86
- disabled={disabled}
87
- loading={busy}
88
- // The name is the STATE while it is busy: a spinner draws no words, and
89
- // a button still announcing "Place order · €24.80" while the order is
90
- // being placed invites the press this component exists to refuse.
91
- accessibilityLabel={busy ? busyLabel : words}
92
- style={{ alignSelf: 'stretch' }}
93
- testID={id('button')}
94
- tone="accent"
95
- appearance="solid"
96
- >
97
- {words}
98
- </Button>
99
- {secondaryAmount ? (
100
- <ActionCardNote style={{ marginTop: 8 }} testID={id('secondary-amount')}>
101
- {secondaryAmount}
102
- </ActionCardNote>
103
- ) : null}
104
- {terms != null ? (
105
- <ActionCardNote style={{ marginTop: 12 }} testID={id('terms')}>
106
- {terms}
107
- </ActionCardNote>
108
- ) : null}
109
- {footer != null ? (
110
- <View style={{ marginTop: 16, alignItems: 'center' }} testID={id('footer')}>
111
- {footer}
112
- </View>
113
- ) : null}
114
- </View>
115
- );
116
- }
117
-
118
- export const CheckoutConfirm = memo(CheckoutConfirmComponent);
119
- CheckoutConfirm.displayName = 'CheckoutConfirm';
@@ -1,221 +0,0 @@
1
- import React, { memo, type ReactNode } from 'react';
2
- import { View } from 'react-native';
3
-
4
- import { AddressRow } from '../address';
5
- import { Divider } from '../divider';
6
- import { useMessages } from '../locale/messages';
7
- import { PriceSummary } from '../price-breakdown';
8
- import {
9
- SurfaceLevelProvider,
10
- surfaceFillVars,
11
- useSurfaceLevel,
12
- useSurfaceLevelValue,
13
- type SurfaceLevel,
14
- } from '../styles/surface-levels';
15
- import { useTheme } from '../theme/use-theme';
16
- import { Text } from '../typography';
17
- import { CheckoutConfirm } from './CheckoutConfirm';
18
- import { CheckoutSummaryRow } from './CheckoutSummaryRow';
19
- import {
20
- CHECKOUT_GROUP_RADIUS,
21
- CHECKOUT_PRICE_PADDING,
22
- CHECKOUT_ROW_ICON,
23
- CHECKOUT_SECTION_GAP,
24
- } from './constants';
25
- import { CHECKOUT_SUMMARY_MESSAGES } from './messages';
26
- import { checkoutRowName } from './shared';
27
- import type { CheckoutSummaryLine, CheckoutSummaryProps } from './types';
28
-
29
- /** The style that takes `Item`'s own chrome back off a row nested inside a row. */
30
- const NESTED_ROW_STYLE = {
31
- // The LONGHANDS `Item` itself writes, on both axes. `Item`'s base uses
32
- // `paddingVertical` for the vertical pair and `paddingLeft`/`paddingRight`
33
- // for the horizontal one; overriding a shorthand with longhands (or the other
34
- // way round) is honoured by Yoga and silently dropped by react-native-web,
35
- // whose atomic sheet ranks `padding-block` above `padding-top` whatever the
36
- // array's order — so the reset would have worked on native only.
37
- paddingVertical: 0,
38
- paddingLeft: 0,
39
- paddingRight: 0,
40
- minHeight: 0,
41
- } as const;
42
-
43
- /**
44
- * Review and confirm: where it goes, when, how it is paid, what it costs, and
45
- * the note to the seller — each shown as its chosen value, each opening the
46
- * thing that changes it.
47
- *
48
- * group one surface rung above whatever it was dropped on, radius 16, a
49
- * hairline, with 1px rules between rows
50
- * rows `CheckoutSummaryRow`, in the order a buyer checks them
51
- * totals `price-breakdown`'s `PriceSummary`, inside the group under a rule,
52
- * 16 all round
53
- * confirm `CheckoutConfirm`, 20 under the group and OUTSIDE it: the group is
54
- * a list of decisions and the button is the consequence
55
- *
56
- * ## What this family does not own
57
- *
58
- * The totals are `PriceSummary` and nothing else — no second breakdown, no
59
- * arithmetic, and every amount is a string the app formatted. The address row
60
- * is `address`'s own `AddressRow`. Tracking, afterwards, is `order-status`.
61
- * The payment row is a SLOT: the payment-method row is its own family, and a
62
- * placeholder drawn here would be a second spelling of it.
63
- *
64
- * ## Why the address row nests
65
- *
66
- * `AddressRow` is `Item` with an address's slots filled in — the tile, the
67
- * badge beside the title, the name joined from the row's own text. Reaching for
68
- * it here rather than redrawing two lines is the whole point; it goes INSIDE
69
- * the summary row's value column with `leading={null}` (the row already drew
70
- * the gutter, which is the case `AddressRow` documents) and with `Item`'s
71
- * padding reset, so there is one row's chrome rather than two.
72
- */
73
- function CheckoutSummaryComponent({
74
- title: titleProp,
75
- address,
76
- delivery,
77
- payment,
78
- note,
79
- extras,
80
- price,
81
- confirm,
82
- children,
83
- accessibilityLabel,
84
- style,
85
- testID,
86
- }: CheckoutSummaryProps) {
87
- const { messages } = useMessages(CHECKOUT_SUMMARY_MESSAGES);
88
- // `null` turns the heading off, so only `undefined` takes the default.
89
- const title = titleProp === undefined ? messages.title : titleProp;
90
- const theme = useTheme();
91
- const level = useSurfaceLevelValue();
92
- const own = useSurfaceLevel(1);
93
- const id = (part: string) => (testID ? `${testID}-${part}` : undefined);
94
-
95
- const line = (
96
- row: CheckoutSummaryLine,
97
- fallbackIcon: CheckoutSummaryLine['icon'],
98
- key: string,
99
- ) => (
100
- <CheckoutSummaryRow
101
- key={row.id ?? key}
102
- label={row.label}
103
- icon={row.icon ?? fallbackIcon}
104
- value={row.value}
105
- placeholder={row.placeholder}
106
- detail={row.detail}
107
- badge={row.badge}
108
- onPress={row.onPress}
109
- disabled={row.disabled}
110
- accessibilityHint={row.accessibilityHint}
111
- accessibilityLabel={row.accessibilityLabel}
112
- testID={row.testID ?? id(key)}
113
- />
114
- );
115
-
116
- const rows: ReactNode[] = [];
117
- if (address) {
118
- const label = address.label ?? messages.deliverTo;
119
- rows.push(
120
- <CheckoutSummaryRow
121
- key="address"
122
- label={label}
123
- icon={address.icon ?? CHECKOUT_ROW_ICON.address}
124
- onPress={address.onPress}
125
- disabled={address.disabled}
126
- accessibilityHint={address.accessibilityHint}
127
- accessibilityLabel={checkoutRowName(
128
- label,
129
- [address.title, address.subtitle].filter(Boolean).join(', '),
130
- )}
131
- testID={address.testID ?? id('address')}
132
- content={
133
- <AddressRow
134
- title={address.title}
135
- subtitle={address.subtitle}
136
- kind={address.kind}
137
- badge={address.badge}
138
- leading={null}
139
- style={NESTED_ROW_STYLE}
140
- testID={id('address-row')}
141
- />
142
- }
143
- />,
144
- );
145
- }
146
- if (delivery) rows.push(line(delivery, CHECKOUT_ROW_ICON.delivery, 'delivery'));
147
- if (payment != null) rows.push(<View key="payment">{payment}</View>);
148
- if (note) rows.push(line(note, CHECKOUT_ROW_ICON.note, 'note'));
149
- if (extras) {
150
- extras.forEach((row, index) => rows.push(line(row, undefined, `extra-${index}`)));
151
- }
152
-
153
- // One rung above the ambient surface, and PUBLISHED, so the rows inside
154
- // resolve their tiles off the group's real fill rather than off the page's.
155
- const raised = Math.min(3, level + 1) as SurfaceLevel;
156
-
157
- return (
158
- <View testID={testID} style={style}>
159
- {title != null ? (
160
- <Text
161
- variant="title-3-semibold"
162
- role="heading"
163
- aria-level={2}
164
- testID={id('title')}
165
- style={{ color: theme.colors.text, marginBottom: 12 }}
166
- >
167
- {title}
168
- </Text>
169
- ) : null}
170
-
171
- <View
172
- collapsable={false}
173
- role="group"
174
- accessibilityLabel={accessibilityLabel ?? title ?? messages.orderSummary}
175
- testID={id('group')}
176
- style={[
177
- {
178
- borderRadius: CHECKOUT_GROUP_RADIUS,
179
- borderWidth: 1,
180
- borderColor: own.border,
181
- backgroundColor: own.background,
182
- overflow: 'hidden',
183
- },
184
- surfaceFillVars(own.background),
185
- ]}
186
- >
187
- <SurfaceLevelProvider level={raised} fill={own.background}>
188
- {rows.map((row, index) => (
189
- <React.Fragment key={index}>
190
- {index > 0 ? <Divider color={own.border} /> : null}
191
- {row}
192
- </React.Fragment>
193
- ))}
194
- {price ? (
195
- <>
196
- {rows.length > 0 ? <Divider color={own.border} /> : null}
197
- <View style={{ padding: CHECKOUT_PRICE_PADDING }}>
198
- <PriceSummary {...price} testID={price.testID ?? id('price')} />
199
- </View>
200
- </>
201
- ) : null}
202
- </SurfaceLevelProvider>
203
- </View>
204
-
205
- {children != null ? (
206
- <View style={{ marginTop: CHECKOUT_SECTION_GAP }}>{children}</View>
207
- ) : null}
208
-
209
- {confirm ? (
210
- <CheckoutConfirm
211
- {...confirm}
212
- style={[{ marginTop: CHECKOUT_SECTION_GAP }, confirm.style]}
213
- testID={confirm.testID ?? id('confirm')}
214
- />
215
- ) : null}
216
- </View>
217
- );
218
- }
219
-
220
- export const CheckoutSummary = memo(CheckoutSummaryComponent);
221
- CheckoutSummary.displayName = 'CheckoutSummary';