@oxy.so/bloom 23.6.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 (356) 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 +21 -5
  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/module/icons/TEMPLATE.js +25 -158
  56. package/lib/module/icons/TEMPLATE.js.map +1 -1
  57. package/lib/module/icons/glyph-svg.js +41 -0
  58. package/lib/module/icons/glyph-svg.js.map +1 -0
  59. package/lib/module/icons/glyph.js +25 -0
  60. package/lib/module/icons/glyph.js.map +1 -0
  61. package/lib/module/icons/glyph.native.js +108 -0
  62. package/lib/module/icons/glyph.native.js.map +1 -0
  63. package/lib/module/index.js +0 -14
  64. package/lib/module/index.js.map +1 -1
  65. package/lib/module/index.web.js +0 -14
  66. package/lib/module/index.web.js.map +1 -1
  67. package/lib/module/locale/translations/ar.js +0 -39
  68. package/lib/module/locale/translations/ar.js.map +1 -1
  69. package/lib/module/locale/translations/bn.js +0 -34
  70. package/lib/module/locale/translations/bn.js.map +1 -1
  71. package/lib/module/locale/translations/ca.js +0 -35
  72. package/lib/module/locale/translations/ca.js.map +1 -1
  73. package/lib/module/locale/translations/de.js +0 -35
  74. package/lib/module/locale/translations/de.js.map +1 -1
  75. package/lib/module/locale/translations/es.js +0 -35
  76. package/lib/module/locale/translations/es.js.map +1 -1
  77. package/lib/module/locale/translations/fr.js +0 -35
  78. package/lib/module/locale/translations/fr.js.map +1 -1
  79. package/lib/module/locale/translations/hi.js +0 -35
  80. package/lib/module/locale/translations/hi.js.map +1 -1
  81. package/lib/module/locale/translations/id.js +0 -34
  82. package/lib/module/locale/translations/id.js.map +1 -1
  83. package/lib/module/locale/translations/it.js +0 -35
  84. package/lib/module/locale/translations/it.js.map +1 -1
  85. package/lib/module/locale/translations/ja.js +0 -34
  86. package/lib/module/locale/translations/ja.js.map +1 -1
  87. package/lib/module/locale/translations/pt.js +0 -35
  88. package/lib/module/locale/translations/pt.js.map +1 -1
  89. package/lib/module/locale/translations/ru.js +0 -37
  90. package/lib/module/locale/translations/ru.js.map +1 -1
  91. package/lib/module/locale/translations/tr.js +0 -34
  92. package/lib/module/locale/translations/tr.js.map +1 -1
  93. package/lib/module/locale/translations/zh.js +0 -34
  94. package/lib/module/locale/translations/zh.js.map +1 -1
  95. package/lib/typescript/commonjs/icons/TEMPLATE.d.ts +1 -1
  96. package/lib/typescript/commonjs/icons/TEMPLATE.d.ts.map +1 -1
  97. package/lib/typescript/commonjs/icons/glyph-svg.d.ts +17 -0
  98. package/lib/typescript/commonjs/icons/glyph-svg.d.ts.map +1 -0
  99. package/lib/typescript/commonjs/icons/glyph.d.ts +11 -0
  100. package/lib/typescript/commonjs/icons/glyph.d.ts.map +1 -0
  101. package/lib/typescript/commonjs/icons/glyph.native.d.ts +20 -0
  102. package/lib/typescript/commonjs/icons/glyph.native.d.ts.map +1 -0
  103. package/lib/typescript/commonjs/index.d.ts +0 -9
  104. package/lib/typescript/commonjs/index.d.ts.map +1 -1
  105. package/lib/typescript/commonjs/index.web.d.ts +0 -9
  106. package/lib/typescript/commonjs/index.web.d.ts.map +1 -1
  107. package/lib/typescript/commonjs/locale/translations/ar.d.ts.map +1 -1
  108. package/lib/typescript/commonjs/locale/translations/bn.d.ts.map +1 -1
  109. package/lib/typescript/commonjs/locale/translations/ca.d.ts.map +1 -1
  110. package/lib/typescript/commonjs/locale/translations/de.d.ts.map +1 -1
  111. package/lib/typescript/commonjs/locale/translations/es.d.ts.map +1 -1
  112. package/lib/typescript/commonjs/locale/translations/fr.d.ts.map +1 -1
  113. package/lib/typescript/commonjs/locale/translations/hi.d.ts.map +1 -1
  114. package/lib/typescript/commonjs/locale/translations/id.d.ts.map +1 -1
  115. package/lib/typescript/commonjs/locale/translations/it.d.ts.map +1 -1
  116. package/lib/typescript/commonjs/locale/translations/ja.d.ts.map +1 -1
  117. package/lib/typescript/commonjs/locale/translations/pt.d.ts.map +1 -1
  118. package/lib/typescript/commonjs/locale/translations/ru.d.ts.map +1 -1
  119. package/lib/typescript/commonjs/locale/translations/tr.d.ts.map +1 -1
  120. package/lib/typescript/commonjs/locale/translations/types.d.ts +0 -6
  121. package/lib/typescript/commonjs/locale/translations/types.d.ts.map +1 -1
  122. package/lib/typescript/commonjs/locale/translations/zh.d.ts.map +1 -1
  123. package/lib/typescript/module/icons/TEMPLATE.d.ts +1 -1
  124. package/lib/typescript/module/icons/TEMPLATE.d.ts.map +1 -1
  125. package/lib/typescript/module/icons/glyph-svg.d.ts +17 -0
  126. package/lib/typescript/module/icons/glyph-svg.d.ts.map +1 -0
  127. package/lib/typescript/module/icons/glyph.d.ts +11 -0
  128. package/lib/typescript/module/icons/glyph.d.ts.map +1 -0
  129. package/lib/typescript/module/icons/glyph.native.d.ts +20 -0
  130. package/lib/typescript/module/icons/glyph.native.d.ts.map +1 -0
  131. package/lib/typescript/module/index.d.ts +0 -9
  132. package/lib/typescript/module/index.d.ts.map +1 -1
  133. package/lib/typescript/module/index.web.d.ts +0 -9
  134. package/lib/typescript/module/index.web.d.ts.map +1 -1
  135. package/lib/typescript/module/locale/translations/ar.d.ts.map +1 -1
  136. package/lib/typescript/module/locale/translations/bn.d.ts.map +1 -1
  137. package/lib/typescript/module/locale/translations/ca.d.ts.map +1 -1
  138. package/lib/typescript/module/locale/translations/de.d.ts.map +1 -1
  139. package/lib/typescript/module/locale/translations/es.d.ts.map +1 -1
  140. package/lib/typescript/module/locale/translations/fr.d.ts.map +1 -1
  141. package/lib/typescript/module/locale/translations/hi.d.ts.map +1 -1
  142. package/lib/typescript/module/locale/translations/id.d.ts.map +1 -1
  143. package/lib/typescript/module/locale/translations/it.d.ts.map +1 -1
  144. package/lib/typescript/module/locale/translations/ja.d.ts.map +1 -1
  145. package/lib/typescript/module/locale/translations/pt.d.ts.map +1 -1
  146. package/lib/typescript/module/locale/translations/ru.d.ts.map +1 -1
  147. package/lib/typescript/module/locale/translations/tr.d.ts.map +1 -1
  148. package/lib/typescript/module/locale/translations/types.d.ts +0 -6
  149. package/lib/typescript/module/locale/translations/types.d.ts.map +1 -1
  150. package/lib/typescript/module/locale/translations/zh.d.ts.map +1 -1
  151. package/package.json +1 -52
  152. package/src/__tests__/support/public-part-classifications.json +0 -5
  153. package/src/icons/TEMPLATE.tsx +28 -49
  154. package/src/icons/glyph-svg.tsx +54 -0
  155. package/src/icons/glyph.native.tsx +138 -0
  156. package/src/icons/glyph.tsx +15 -0
  157. package/src/index.ts +0 -62
  158. package/src/index.web.ts +0 -62
  159. package/src/locale/translations/ar.ts +0 -36
  160. package/src/locale/translations/bn.ts +0 -36
  161. package/src/locale/translations/ca.ts +0 -36
  162. package/src/locale/translations/de.ts +0 -36
  163. package/src/locale/translations/es.ts +0 -36
  164. package/src/locale/translations/fr.ts +0 -36
  165. package/src/locale/translations/hi.ts +0 -36
  166. package/src/locale/translations/id.ts +0 -36
  167. package/src/locale/translations/it.ts +0 -36
  168. package/src/locale/translations/ja.ts +0 -36
  169. package/src/locale/translations/pt.ts +0 -36
  170. package/src/locale/translations/ru.ts +0 -36
  171. package/src/locale/translations/tr.ts +0 -36
  172. package/src/locale/translations/types.ts +0 -6
  173. package/src/locale/translations/zh.ts +0 -36
  174. package/docs/checkout-summary.mdx +0 -94
  175. package/docs/order-confirmation.mdx +0 -66
  176. package/docs/vendor-card.mdx +0 -83
  177. package/lib/commonjs/checkout-summary/CheckoutConfirm.js +0 -243
  178. package/lib/commonjs/checkout-summary/CheckoutConfirm.js.map +0 -1
  179. package/lib/commonjs/checkout-summary/CheckoutSummary.js +0 -432
  180. package/lib/commonjs/checkout-summary/CheckoutSummary.js.map +0 -1
  181. package/lib/commonjs/checkout-summary/CheckoutSummaryRow.js +0 -277
  182. package/lib/commonjs/checkout-summary/CheckoutSummaryRow.js.map +0 -1
  183. package/lib/commonjs/checkout-summary/constants.js +0 -66
  184. package/lib/commonjs/checkout-summary/constants.js.map +0 -1
  185. package/lib/commonjs/checkout-summary/index.js +0 -95
  186. package/lib/commonjs/checkout-summary/index.js.map +0 -1
  187. package/lib/commonjs/checkout-summary/messages.js +0 -23
  188. package/lib/commonjs/checkout-summary/messages.js.map +0 -1
  189. package/lib/commonjs/checkout-summary/shared.js +0 -43
  190. package/lib/commonjs/checkout-summary/shared.js.map +0 -1
  191. package/lib/commonjs/checkout-summary/types.js +0 -6
  192. package/lib/commonjs/checkout-summary/types.js.map +0 -1
  193. package/lib/commonjs/order-confirmation/OrderConfirmation.js +0 -305
  194. package/lib/commonjs/order-confirmation/OrderConfirmation.js.map +0 -1
  195. package/lib/commonjs/order-confirmation/constants.js +0 -26
  196. package/lib/commonjs/order-confirmation/constants.js.map +0 -1
  197. package/lib/commonjs/order-confirmation/index.js +0 -38
  198. package/lib/commonjs/order-confirmation/index.js.map +0 -1
  199. package/lib/commonjs/order-confirmation/messages.js +0 -18
  200. package/lib/commonjs/order-confirmation/messages.js.map +0 -1
  201. package/lib/commonjs/order-confirmation/types.js +0 -6
  202. package/lib/commonjs/order-confirmation/types.js.map +0 -1
  203. package/lib/commonjs/vendor-card/VendorCard.js +0 -1051
  204. package/lib/commonjs/vendor-card/VendorCard.js.map +0 -1
  205. package/lib/commonjs/vendor-card/constants.js +0 -54
  206. package/lib/commonjs/vendor-card/constants.js.map +0 -1
  207. package/lib/commonjs/vendor-card/index.js +0 -69
  208. package/lib/commonjs/vendor-card/index.js.map +0 -1
  209. package/lib/commonjs/vendor-card/message-helpers.js +0 -23
  210. package/lib/commonjs/vendor-card/message-helpers.js.map +0 -1
  211. package/lib/commonjs/vendor-card/messages.js +0 -32
  212. package/lib/commonjs/vendor-card/messages.js.map +0 -1
  213. package/lib/commonjs/vendor-card/shared.js +0 -116
  214. package/lib/commonjs/vendor-card/shared.js.map +0 -1
  215. package/lib/commonjs/vendor-card/types.js +0 -6
  216. package/lib/commonjs/vendor-card/types.js.map +0 -1
  217. package/lib/module/checkout-summary/CheckoutConfirm.js +0 -237
  218. package/lib/module/checkout-summary/CheckoutConfirm.js.map +0 -1
  219. package/lib/module/checkout-summary/CheckoutSummary.js +0 -426
  220. package/lib/module/checkout-summary/CheckoutSummary.js.map +0 -1
  221. package/lib/module/checkout-summary/CheckoutSummaryRow.js +0 -273
  222. package/lib/module/checkout-summary/CheckoutSummaryRow.js.map +0 -1
  223. package/lib/module/checkout-summary/constants.js +0 -63
  224. package/lib/module/checkout-summary/constants.js.map +0 -1
  225. package/lib/module/checkout-summary/index.js +0 -8
  226. package/lib/module/checkout-summary/index.js.map +0 -1
  227. package/lib/module/checkout-summary/messages.js +0 -20
  228. package/lib/module/checkout-summary/messages.js.map +0 -1
  229. package/lib/module/checkout-summary/shared.js +0 -36
  230. package/lib/module/checkout-summary/shared.js.map +0 -1
  231. package/lib/module/checkout-summary/types.js +0 -4
  232. package/lib/module/checkout-summary/types.js.map +0 -1
  233. package/lib/module/order-confirmation/OrderConfirmation.js +0 -299
  234. package/lib/module/order-confirmation/OrderConfirmation.js.map +0 -1
  235. package/lib/module/order-confirmation/constants.js +0 -23
  236. package/lib/module/order-confirmation/constants.js.map +0 -1
  237. package/lib/module/order-confirmation/index.js +0 -5
  238. package/lib/module/order-confirmation/index.js.map +0 -1
  239. package/lib/module/order-confirmation/messages.js +0 -15
  240. package/lib/module/order-confirmation/messages.js.map +0 -1
  241. package/lib/module/order-confirmation/types.js +0 -4
  242. package/lib/module/order-confirmation/types.js.map +0 -1
  243. package/lib/module/vendor-card/VendorCard.js +0 -1046
  244. package/lib/module/vendor-card/VendorCard.js.map +0 -1
  245. package/lib/module/vendor-card/constants.js +0 -50
  246. package/lib/module/vendor-card/constants.js.map +0 -1
  247. package/lib/module/vendor-card/index.js +0 -6
  248. package/lib/module/vendor-card/index.js.map +0 -1
  249. package/lib/module/vendor-card/message-helpers.js +0 -18
  250. package/lib/module/vendor-card/message-helpers.js.map +0 -1
  251. package/lib/module/vendor-card/messages.js +0 -29
  252. package/lib/module/vendor-card/messages.js.map +0 -1
  253. package/lib/module/vendor-card/shared.js +0 -107
  254. package/lib/module/vendor-card/shared.js.map +0 -1
  255. package/lib/module/vendor-card/types.js +0 -4
  256. package/lib/module/vendor-card/types.js.map +0 -1
  257. package/lib/typescript/commonjs/checkout-summary/CheckoutConfirm.d.ts +0 -40
  258. package/lib/typescript/commonjs/checkout-summary/CheckoutConfirm.d.ts.map +0 -1
  259. package/lib/typescript/commonjs/checkout-summary/CheckoutSummary.d.ts +0 -36
  260. package/lib/typescript/commonjs/checkout-summary/CheckoutSummary.d.ts.map +0 -1
  261. package/lib/typescript/commonjs/checkout-summary/CheckoutSummaryRow.d.ts +0 -29
  262. package/lib/typescript/commonjs/checkout-summary/CheckoutSummaryRow.d.ts.map +0 -1
  263. package/lib/typescript/commonjs/checkout-summary/constants.d.ts +0 -39
  264. package/lib/typescript/commonjs/checkout-summary/constants.d.ts.map +0 -1
  265. package/lib/typescript/commonjs/checkout-summary/index.d.ts +0 -8
  266. package/lib/typescript/commonjs/checkout-summary/index.d.ts.map +0 -1
  267. package/lib/typescript/commonjs/checkout-summary/messages.d.ts +0 -23
  268. package/lib/typescript/commonjs/checkout-summary/messages.d.ts.map +0 -1
  269. package/lib/typescript/commonjs/checkout-summary/shared.d.ts +0 -27
  270. package/lib/typescript/commonjs/checkout-summary/shared.d.ts.map +0 -1
  271. package/lib/typescript/commonjs/checkout-summary/types.d.ts +0 -147
  272. package/lib/typescript/commonjs/checkout-summary/types.d.ts.map +0 -1
  273. package/lib/typescript/commonjs/order-confirmation/OrderConfirmation.d.ts +0 -40
  274. package/lib/typescript/commonjs/order-confirmation/OrderConfirmation.d.ts.map +0 -1
  275. package/lib/typescript/commonjs/order-confirmation/constants.d.ts +0 -17
  276. package/lib/typescript/commonjs/order-confirmation/constants.d.ts.map +0 -1
  277. package/lib/typescript/commonjs/order-confirmation/index.d.ts +0 -4
  278. package/lib/typescript/commonjs/order-confirmation/index.d.ts.map +0 -1
  279. package/lib/typescript/commonjs/order-confirmation/messages.d.ts +0 -12
  280. package/lib/typescript/commonjs/order-confirmation/messages.d.ts.map +0 -1
  281. package/lib/typescript/commonjs/order-confirmation/types.d.ts +0 -88
  282. package/lib/typescript/commonjs/order-confirmation/types.d.ts.map +0 -1
  283. package/lib/typescript/commonjs/vendor-card/VendorCard.d.ts +0 -6
  284. package/lib/typescript/commonjs/vendor-card/VendorCard.d.ts.map +0 -1
  285. package/lib/typescript/commonjs/vendor-card/constants.d.ts +0 -30
  286. package/lib/typescript/commonjs/vendor-card/constants.d.ts.map +0 -1
  287. package/lib/typescript/commonjs/vendor-card/index.d.ts +0 -5
  288. package/lib/typescript/commonjs/vendor-card/index.d.ts.map +0 -1
  289. package/lib/typescript/commonjs/vendor-card/message-helpers.d.ts +0 -13
  290. package/lib/typescript/commonjs/vendor-card/message-helpers.d.ts.map +0 -1
  291. package/lib/typescript/commonjs/vendor-card/messages.d.ts +0 -22
  292. package/lib/typescript/commonjs/vendor-card/messages.d.ts.map +0 -1
  293. package/lib/typescript/commonjs/vendor-card/shared.d.ts +0 -24
  294. package/lib/typescript/commonjs/vendor-card/shared.d.ts.map +0 -1
  295. package/lib/typescript/commonjs/vendor-card/types.d.ts +0 -111
  296. package/lib/typescript/commonjs/vendor-card/types.d.ts.map +0 -1
  297. package/lib/typescript/module/checkout-summary/CheckoutConfirm.d.ts +0 -40
  298. package/lib/typescript/module/checkout-summary/CheckoutConfirm.d.ts.map +0 -1
  299. package/lib/typescript/module/checkout-summary/CheckoutSummary.d.ts +0 -36
  300. package/lib/typescript/module/checkout-summary/CheckoutSummary.d.ts.map +0 -1
  301. package/lib/typescript/module/checkout-summary/CheckoutSummaryRow.d.ts +0 -29
  302. package/lib/typescript/module/checkout-summary/CheckoutSummaryRow.d.ts.map +0 -1
  303. package/lib/typescript/module/checkout-summary/constants.d.ts +0 -39
  304. package/lib/typescript/module/checkout-summary/constants.d.ts.map +0 -1
  305. package/lib/typescript/module/checkout-summary/index.d.ts +0 -8
  306. package/lib/typescript/module/checkout-summary/index.d.ts.map +0 -1
  307. package/lib/typescript/module/checkout-summary/messages.d.ts +0 -23
  308. package/lib/typescript/module/checkout-summary/messages.d.ts.map +0 -1
  309. package/lib/typescript/module/checkout-summary/shared.d.ts +0 -27
  310. package/lib/typescript/module/checkout-summary/shared.d.ts.map +0 -1
  311. package/lib/typescript/module/checkout-summary/types.d.ts +0 -147
  312. package/lib/typescript/module/checkout-summary/types.d.ts.map +0 -1
  313. package/lib/typescript/module/order-confirmation/OrderConfirmation.d.ts +0 -40
  314. package/lib/typescript/module/order-confirmation/OrderConfirmation.d.ts.map +0 -1
  315. package/lib/typescript/module/order-confirmation/constants.d.ts +0 -17
  316. package/lib/typescript/module/order-confirmation/constants.d.ts.map +0 -1
  317. package/lib/typescript/module/order-confirmation/index.d.ts +0 -4
  318. package/lib/typescript/module/order-confirmation/index.d.ts.map +0 -1
  319. package/lib/typescript/module/order-confirmation/messages.d.ts +0 -12
  320. package/lib/typescript/module/order-confirmation/messages.d.ts.map +0 -1
  321. package/lib/typescript/module/order-confirmation/types.d.ts +0 -88
  322. package/lib/typescript/module/order-confirmation/types.d.ts.map +0 -1
  323. package/lib/typescript/module/vendor-card/VendorCard.d.ts +0 -6
  324. package/lib/typescript/module/vendor-card/VendorCard.d.ts.map +0 -1
  325. package/lib/typescript/module/vendor-card/constants.d.ts +0 -30
  326. package/lib/typescript/module/vendor-card/constants.d.ts.map +0 -1
  327. package/lib/typescript/module/vendor-card/index.d.ts +0 -5
  328. package/lib/typescript/module/vendor-card/index.d.ts.map +0 -1
  329. package/lib/typescript/module/vendor-card/message-helpers.d.ts +0 -13
  330. package/lib/typescript/module/vendor-card/message-helpers.d.ts.map +0 -1
  331. package/lib/typescript/module/vendor-card/messages.d.ts +0 -22
  332. package/lib/typescript/module/vendor-card/messages.d.ts.map +0 -1
  333. package/lib/typescript/module/vendor-card/shared.d.ts +0 -24
  334. package/lib/typescript/module/vendor-card/shared.d.ts.map +0 -1
  335. package/lib/typescript/module/vendor-card/types.d.ts +0 -111
  336. package/lib/typescript/module/vendor-card/types.d.ts.map +0 -1
  337. package/src/checkout-summary/CheckoutConfirm.tsx +0 -119
  338. package/src/checkout-summary/CheckoutSummary.tsx +0 -221
  339. package/src/checkout-summary/CheckoutSummaryRow.tsx +0 -172
  340. package/src/checkout-summary/constants.ts +0 -64
  341. package/src/checkout-summary/index.ts +0 -22
  342. package/src/checkout-summary/messages.ts +0 -33
  343. package/src/checkout-summary/shared.ts +0 -40
  344. package/src/checkout-summary/types.ts +0 -152
  345. package/src/order-confirmation/OrderConfirmation.tsx +0 -197
  346. package/src/order-confirmation/constants.ts +0 -20
  347. package/src/order-confirmation/index.ts +0 -12
  348. package/src/order-confirmation/messages.ts +0 -18
  349. package/src/order-confirmation/types.ts +0 -98
  350. package/src/vendor-card/VendorCard.tsx +0 -509
  351. package/src/vendor-card/constants.ts +0 -58
  352. package/src/vendor-card/index.ts +0 -15
  353. package/src/vendor-card/message-helpers.ts +0 -20
  354. package/src/vendor-card/messages.ts +0 -36
  355. package/src/vendor-card/shared.ts +0 -136
  356. package/src/vendor-card/types.ts +0 -115
@@ -1,172 +0,0 @@
1
- import { memo, useMemo } from 'react';
2
- import { View } from 'react-native';
3
-
4
- import { RiArrowRightSLine } from '../icons/remix/RiArrowRightSLine';
5
- import { Item } from '../item';
6
- import { useMessages } from '../locale/messages';
7
- import { useSurfaceFill } from '../styles/surface-levels';
8
- import { useTheme } from '../theme/use-theme';
9
- import { Text } from '../typography';
10
- import {
11
- CHECKOUT_ROW_CHEVRON,
12
- CHECKOUT_ROW_GLYPH,
13
- CHECKOUT_ROW_TEXT_GAP,
14
- CHECKOUT_ROW_TILE,
15
- } from './constants';
16
- import { CHECKOUT_SUMMARY_MESSAGES } from './messages';
17
- import { checkoutRowName, resolveCheckoutPaint } from './shared';
18
- import type { CheckoutSummaryRowProps } from './types';
19
-
20
- /**
21
- * One decision, as a row: what it is, what was chosen, and the press that
22
- * changes it.
23
- *
24
- * tile 40 round, one surface step off the group behind the row, with a
25
- * 20 glyph in the secondary rung — `address`'s own geometry, so a
26
- * summary and an address list line up
27
- * label caption-2-bold uppercase secondary; the row is read label-first
28
- * because every row in the group is a different QUESTION
29
- * value body-medium, up to two lines, falling back to the placeholder
30
- * detail body-2-regular secondary
31
- * chevron 20, tertiary, decorative — the whole row is the button
32
- *
33
- * It is `Item` with those slots filled in: the press target, the hover and
34
- * press paint, the density rungs, the disabled opacity and the a11y role are
35
- * `Item`'s job, and this family owns no second copy of any of them.
36
- *
37
- * The label/value pair is a CAPTION OVER A VALUE rather than a title with the
38
- * value on the right, which is the other row Bloom draws (`GroupedSectionItem`).
39
- * The difference is the length: a settings value is a word, and a checkout
40
- * value is an address, a window and a card number — none of which fits in the
41
- * right half of a 390 row without truncating the thing the reader came to
42
- * check.
43
- */
44
- function CheckoutSummaryRowComponent({
45
- label,
46
- icon: Icon,
47
- leading,
48
- value,
49
- placeholder: placeholderProp,
50
- detail,
51
- badge,
52
- content,
53
- onPress,
54
- disabled = false,
55
- accessibilityHint,
56
- accessibilityLabel,
57
- style,
58
- testID,
59
- }: CheckoutSummaryRowProps) {
60
- const { messages } = useMessages(CHECKOUT_SUMMARY_MESSAGES);
61
- const placeholder = placeholderProp ?? messages.notChosen;
62
- const theme = useTheme();
63
- const surface = useSurfaceFill();
64
- const paint = useMemo(() => resolveCheckoutPaint(theme, surface), [theme, surface]);
65
- const id = (part: string) => (testID ? `${testID}-${part}` : undefined);
66
- const chosen = value != null && value !== '';
67
- const shown = chosen ? value : placeholder;
68
-
69
- // `leading` is read for PRESENCE, not truthiness: `leading={null}` is a row
70
- // that draws no media, for a group that already has a gutter of its own —
71
- // and `??` would have quietly given it the tile instead.
72
- const media =
73
- leading !== undefined ? (
74
- leading
75
- ) : Icon ? (
76
- <View
77
- testID={id('tile')}
78
- style={{
79
- width: CHECKOUT_ROW_TILE,
80
- height: CHECKOUT_ROW_TILE,
81
- borderRadius: CHECKOUT_ROW_TILE / 2,
82
- alignItems: 'center',
83
- justifyContent: 'center',
84
- backgroundColor: paint.tile,
85
- }}
86
- >
87
- <Icon width={CHECKOUT_ROW_GLYPH} height={CHECKOUT_ROW_GLYPH} fill={paint.textSecondary} />
88
- </View>
89
- ) : null;
90
-
91
- const body = (
92
- // `flex: 1` + `minWidth: 0`: `Item` gives `children` no column of its own,
93
- // and a one-line Text is `nowrap` on web, so without the floor the row's
94
- // min-content width becomes the whole value string and the page scrolls
95
- // sideways instead of the value truncating.
96
- <View style={{ flex: 1, minWidth: 0, gap: CHECKOUT_ROW_TEXT_GAP }}>
97
- <Text
98
- variant="caption-2-bold"
99
- numberOfLines={1}
100
- testID={id('label')}
101
- style={{ color: paint.textSecondary, textTransform: 'uppercase' }}
102
- >
103
- {label}
104
- </Text>
105
- {content !== undefined ? (
106
- content
107
- ) : (
108
- <>
109
- <View style={{ flexDirection: 'row', alignItems: 'center', gap: 6, minWidth: 0 }}>
110
- <Text
111
- variant="body-medium"
112
- numberOfLines={2}
113
- testID={id('value')}
114
- style={{
115
- flexShrink: 1,
116
- minWidth: 0,
117
- color: chosen ? paint.text : paint.textTertiary,
118
- }}
119
- >
120
- {shown}
121
- </Text>
122
- {badge}
123
- </View>
124
- {detail ? (
125
- <Text
126
- variant="body-2-regular"
127
- numberOfLines={2}
128
- testID={id('detail')}
129
- style={{ color: paint.textSecondary }}
130
- >
131
- {detail}
132
- </Text>
133
- ) : null}
134
- </>
135
- )}
136
- </View>
137
- );
138
-
139
- return (
140
- <Item
141
- leading={media}
142
- trailing={
143
- onPress ? (
144
- <RiArrowRightSLine
145
- width={CHECKOUT_ROW_CHEVRON}
146
- height={CHECKOUT_ROW_CHEVRON}
147
- fill={paint.textTertiary}
148
- />
149
- ) : null
150
- }
151
- onPress={onPress}
152
- disabled={disabled}
153
- accessibilityLabel={
154
- accessibilityLabel ?? checkoutRowName(label, chosen ? value : placeholder)
155
- }
156
- // NATIVE ONLY, and knowingly: react-native-web has no `accessibilityHint`
157
- // — no mapping at all, not a wrong one — so on web the affordance is the
158
- // `button` role plus the chevron and this says nothing. Recorded in
159
- // `docs/checkout-summary.mdx` and pinned in `CheckoutSummary.test.tsx`
160
- // rather than swapped for an `aria-describedby` that native would then
161
- // announce twice.
162
- accessibilityHint={onPress ? (accessibilityHint ?? messages.opensPicker) : accessibilityHint}
163
- style={style}
164
- testID={testID}
165
- >
166
- {body}
167
- </Item>
168
- );
169
- }
170
-
171
- export const CheckoutSummaryRow = memo(CheckoutSummaryRowComponent);
172
- CheckoutSummaryRow.displayName = 'CheckoutSummaryRow';
@@ -1,64 +0,0 @@
1
- import { RiBankCardLine } from '../icons/remix/RiBankCardLine';
2
- import { RiChat3Line } from '../icons/remix/RiChat3Line';
3
- import { RiMapPin2Line } from '../icons/remix/RiMapPin2Line';
4
- import { RiTimeLine } from '../icons/remix/RiTimeLine';
5
- import type { BloomIconComponent } from '../icons/icon-component';
6
- import { CHECKOUT_SUMMARY_MESSAGES } from './messages';
7
-
8
- /**
9
- * The default glyph for each of the four rows a buyer checks. A caller that
10
- * wants a different one passes `icon`; these exist so the common summary reads
11
- * correctly with four strings and four handlers.
12
- */
13
- export const CHECKOUT_ROW_ICON: Record<
14
- 'address' | 'delivery' | 'payment' | 'note',
15
- BloomIconComponent
16
- > = {
17
- address: RiMapPin2Line,
18
- delivery: RiTimeLine,
19
- payment: RiBankCardLine,
20
- note: RiChat3Line,
21
- };
22
-
23
- // The English words below stay exported; the components speak
24
- // `CHECKOUT_SUMMARY_MESSAGES` in the resolved locale.
25
-
26
- /** Drawn in place of the value while nothing is chosen. */
27
- export const CHECKOUT_ROW_PLACEHOLDER = CHECKOUT_SUMMARY_MESSAGES.en.notChosen;
28
-
29
- /** The row's hint: what pressing it opens. */
30
- export const CHECKOUT_ROW_HINT = CHECKOUT_SUMMARY_MESSAGES.en.opensPicker;
31
-
32
- /** The default words on the confirm control. */
33
- export const CHECKOUT_CONFIRM_LABEL = CHECKOUT_SUMMARY_MESSAGES.en.placeOrder;
34
- export const CHECKOUT_CONFIRM_BUSY_LABEL = CHECKOUT_SUMMARY_MESSAGES.en.placingOrder;
35
-
36
- /**
37
- * The separator between the confirm label and the amount. A MIDDLE DOT rather
38
- * than a hyphen: "Place order - €24.80" reads as a subtraction at a glance in
39
- * a row that is otherwise full of money.
40
- */
41
- export const CHECKOUT_AMOUNT_SEPARATOR = ' · ';
42
-
43
- /**
44
- * The tile a row's glyph sits in. 40 is `address`'s own comfortable rung
45
- * (`ADDRESS_GEOMETRY`), which is what lines a summary row up with an `Avatar`
46
- * at `lg` — a summary that mixes a place and a courier must not step sideways
47
- * at the avatar.
48
- */
49
- export const CHECKOUT_ROW_TILE = 40;
50
- export const CHECKOUT_ROW_GLYPH = 20;
51
- /** The trailing chevron. */
52
- export const CHECKOUT_ROW_CHEVRON = 20;
53
-
54
- /** Between the label and the value, and between the value and the detail. */
55
- export const CHECKOUT_ROW_TEXT_GAP = 2;
56
-
57
- /** The group's corner, matching every other card-sized surface in the library. */
58
- export const CHECKOUT_GROUP_RADIUS = 16;
59
-
60
- /** Between the group, the children, the totals and the confirm control. */
61
- export const CHECKOUT_SECTION_GAP = 20;
62
-
63
- /** Inside the group's own padding, around the totals. */
64
- export const CHECKOUT_PRICE_PADDING = 16;
@@ -1,22 +0,0 @@
1
- export { CheckoutConfirm } from './CheckoutConfirm';
2
- export { CheckoutSummary } from './CheckoutSummary';
3
- export { CheckoutSummaryRow } from './CheckoutSummaryRow';
4
- export {
5
- CHECKOUT_AMOUNT_SEPARATOR,
6
- CHECKOUT_CONFIRM_BUSY_LABEL,
7
- CHECKOUT_CONFIRM_LABEL,
8
- CHECKOUT_GROUP_RADIUS,
9
- CHECKOUT_ROW_HINT,
10
- CHECKOUT_ROW_ICON,
11
- CHECKOUT_ROW_PLACEHOLDER,
12
- CHECKOUT_ROW_TILE,
13
- } from './constants';
14
- export { checkoutConfirmLabel, checkoutRowName, resolveCheckoutPaint } from './shared';
15
- export type { CheckoutSummaryPaint } from './shared';
16
- export type {
17
- CheckoutAddressSummary,
18
- CheckoutConfirmProps,
19
- CheckoutSummaryLine,
20
- CheckoutSummaryProps,
21
- CheckoutSummaryRowProps,
22
- } from './types';
@@ -1,33 +0,0 @@
1
- import { defineMessages, type MessageCatalog } from '../locale/messages';
2
-
3
- /**
4
- * Every fixed string the checkout summary draws or announces, in each Bloom
5
- * language. A caller's `title`, `label`, `placeholder`, `busyLabel`,
6
- * `accessibilityHint` and `accessibilityLabel` still win.
7
- */
8
- export interface CheckoutSummaryMessages {
9
- /** The heading above the rows. */
10
- title: string;
11
- /** Names the group when the heading is turned off. */
12
- orderSummary: string;
13
- /** The address row's label. */
14
- deliverTo: string;
15
- /** Drawn in place of a row's value while nothing is chosen. */
16
- notChosen: string;
17
- /** A pressable row's hint: what pressing it opens. */
18
- opensPicker: string;
19
- /** The confirm button, and what it announces while busy. */
20
- placeOrder: string;
21
- placingOrder: string;
22
- }
23
-
24
- export const CHECKOUT_SUMMARY_MESSAGES: MessageCatalog<CheckoutSummaryMessages> =
25
- defineMessages<CheckoutSummaryMessages>('CHECKOUT_SUMMARY_MESSAGES', {
26
- title: 'Review your order',
27
- orderSummary: 'Order summary',
28
- deliverTo: 'Deliver to',
29
- notChosen: 'Not chosen yet',
30
- opensPicker: 'Opens the picker',
31
- placeOrder: 'Place order',
32
- placingOrder: 'Placing your order',
33
- });
@@ -1,40 +0,0 @@
1
- /**
2
- * What a checkout summary paints, read RELATIVE to the surface it was dropped
3
- * on (`styles/surface-levels.ts`): the review is a page on a phone, a column
4
- * beside a basket on a desktop, and a sheet over a menu — three different
5
- * fills, and a tile colour picked by eye vanishes on one of them.
6
- *
7
- * Pure, so `CheckoutSummary.test.tsx` can walk presets and modes without
8
- * rendering.
9
- */
10
- import { surfaceFillOn, surfaceTextOn, type SurfaceTextPaint } from '../styles/surface-levels';
11
- import type { Theme } from '../theme/types';
12
- import { CHECKOUT_AMOUNT_SEPARATOR } from './constants';
13
-
14
- export interface CheckoutSummaryPaint extends SurfaceTextPaint {
15
- /** The round tile a row's glyph sits in — one step off the group's own fill. */
16
- tile: string;
17
- }
18
-
19
- export function resolveCheckoutPaint(theme: Theme, surface: string): CheckoutSummaryPaint {
20
- return {
21
- ...surfaceTextOn(theme, surface),
22
- tile: surfaceFillOn(theme, surface),
23
- };
24
- }
25
-
26
- /**
27
- * The row's announced name: the label, then whatever the row is showing.
28
- *
29
- * Deliberately "Delivery window: Today, 17:00 – 19:00" and not "Change
30
- * delivery window" — a reader moving through the summary wants the DECISIONS
31
- * read back, and what the press does belongs in the hint.
32
- */
33
- export function checkoutRowName(label: string, value: string | undefined): string {
34
- return value && value !== '' ? `${label}: ${value}` : label;
35
- }
36
-
37
- /** "Place order" + "€24.80" → "Place order · €24.80". */
38
- export function checkoutConfirmLabel(label: string, amount: string | undefined): string {
39
- return amount && amount !== '' ? `${label}${CHECKOUT_AMOUNT_SEPARATOR}${amount}` : label;
40
- }
@@ -1,152 +0,0 @@
1
- import type { ReactNode } from 'react';
2
- import type { StyleProp, ViewStyle } from 'react-native';
3
-
4
- import type { AddressKind } from '../address';
5
- import type { BloomIconComponent } from '../icons/icon-component';
6
- import type { PriceSummaryProps } from '../price-breakdown';
7
-
8
- /**
9
- * ONE row of the review: what was chosen, and the thing that changes it.
10
- *
11
- * The row is the summary AND the trigger. A label with a "Change" button beside
12
- * it gives a reader two targets for one decision and a screen reader two stops
13
- * that do not mention each other; here the whole row is the button, its name is
14
- * "<label>: <value>", and the chevron is decoration.
15
- */
16
- export interface CheckoutSummaryLine {
17
- /** Stable key. Defaults to the index. */
18
- id?: string;
19
- /** What the row is FOR — "Delivery window", "Note for the shop". */
20
- label: string;
21
- /** The glyph in the leading tile. */
22
- icon?: BloomIconComponent;
23
- /**
24
- * The chosen value, PRE-FORMATTED — "Today, 17:00 – 19:00", "€24.80". This
25
- * family formats no dates and no money.
26
- */
27
- value?: string;
28
- /** Drawn in place of the value while nothing is chosen. Default `"Not chosen yet"`. */
29
- placeholder?: string;
30
- /** A quieter third line — "Standard delivery", "Leave at the door". */
31
- detail?: string;
32
- /** A node beside the value — a `Badge` ("Free"), a `Chip`. */
33
- badge?: ReactNode;
34
- /** Opens whatever changes this row. Without it the row is a static summary. */
35
- onPress?: () => void;
36
- disabled?: boolean;
37
- /**
38
- * What pressing the row does, announced as the row's hint. Default
39
- * `"Opens the picker"`; it is a HINT and not part of the name, so a reader
40
- * scanning the summary hears the values rather than "Change" five times.
41
- */
42
- accessibilityHint?: string;
43
- /** Defaults to `"<label>: <value>"`. */
44
- accessibilityLabel?: string;
45
- testID?: string;
46
- }
47
-
48
- export interface CheckoutSummaryRowProps extends CheckoutSummaryLine {
49
- /**
50
- * Replaces the value/detail column — an `AddressRow`, a two-line receipt, a
51
- * row of chips. The label and the chevron stay.
52
- */
53
- content?: ReactNode;
54
- /**
55
- * An arbitrary leading node instead of the glyph tile. Read for PRESENCE:
56
- * `leading={null}` draws no media at all.
57
- */
58
- leading?: ReactNode;
59
- style?: StyleProp<ViewStyle>;
60
- }
61
-
62
- /** The "where it goes" row, drawn with `address`'s own `AddressRow`. */
63
- export interface CheckoutAddressSummary {
64
- /** Default `"Deliver to"`. */
65
- label?: string;
66
- /** The line the place is recognised by — "Home", "Carrer de l’Om 14". */
67
- title: string;
68
- /** The rest of it — "Carrer de l’Om 14, 2nd floor". */
69
- subtitle?: string;
70
- /** Chooses the glyph in the row's tile. Default `place`. */
71
- kind?: AddressKind;
72
- /** The glyph, overriding whatever `kind` would have chosen. */
73
- icon?: BloomIconComponent;
74
- /** A node after the title — a `Badge` ("Default"). */
75
- badge?: ReactNode;
76
- /** Opens the address picker. */
77
- onPress?: () => void;
78
- disabled?: boolean;
79
- accessibilityHint?: string;
80
- testID?: string;
81
- }
82
-
83
- export interface CheckoutConfirmProps {
84
- /** Default `"Place order"`. */
85
- label?: string;
86
- /**
87
- * The amount the press commits to, PRE-FORMATTED, drawn on the button after
88
- * the label. It is on the BUTTON rather than beside it because the number a
89
- * press commits to and the press are one decision.
90
- */
91
- amount?: string;
92
- /**
93
- * A second, PRE-FORMATTED rendering of `amount` — the buyer's currency beside
94
- * the shop's, `"≈ 12,00 €"` — drawn de-emphasised, centred under the button.
95
- * Named like `PriceLine.secondaryAmount`; drawn as given, nothing converts.
96
- */
97
- secondaryAmount?: string;
98
- /**
99
- * The terms line under the button — a string, or a node with links in it.
100
- * `null` draws none.
101
- */
102
- terms?: ReactNode;
103
- /** Called at most once per busy cycle. */
104
- onConfirm?: () => void;
105
- disabled?: boolean;
106
- /**
107
- * The order is being placed: spinner, and every further press is dropped.
108
- *
109
- * The component ALSO latches on its own press, because the app's `busy`
110
- * arrives a render later and the second tap of a double-tap lands inside that
111
- * window. The latch clears when `busy` goes back to `false`.
112
- */
113
- busy?: boolean;
114
- /** Announced while busy, in place of the button's own name. Default `"Placing your order"`. */
115
- busyLabel?: string;
116
- /** Under the terms line — "Cancel", a help link. */
117
- footer?: ReactNode;
118
- style?: StyleProp<ViewStyle>;
119
- testID?: string;
120
- }
121
-
122
- export interface CheckoutSummaryProps {
123
- /** The heading above the rows. `null` draws none. */
124
- title?: string | null;
125
- /** Where it goes. */
126
- address?: CheckoutAddressSummary;
127
- /** When it comes. */
128
- delivery?: CheckoutSummaryLine;
129
- /**
130
- * How it is paid — a SLOT, because the payment-method row is its own family.
131
- * Anything that renders as a row goes here; `CheckoutSummaryRow` is exported
132
- * so an app with no payment family yet can draw one in the same register.
133
- */
134
- payment?: ReactNode;
135
- /** The note to the seller. */
136
- note?: CheckoutSummaryLine;
137
- /** Anything else this order needs a decision about, appended after the note. */
138
- extras?: readonly CheckoutSummaryLine[];
139
- /**
140
- * What it costs — `price-breakdown`'s `PriceSummary`, passed through. There
141
- * is no second breakdown in this family and no arithmetic anywhere.
142
- */
143
- price?: PriceSummaryProps;
144
- /** The confirm control under the totals. */
145
- confirm?: CheckoutConfirmProps;
146
- /** Between the rows and the totals — a promo field, a tip picker. */
147
- children?: ReactNode;
148
- /** Names the summary. Default the title, then `"Order summary"`. */
149
- accessibilityLabel?: string;
150
- style?: StyleProp<ViewStyle>;
151
- testID?: string;
152
- }
@@ -1,197 +0,0 @@
1
- import React, { memo, useMemo } from 'react';
2
- import { View } from 'react-native';
3
-
4
- import { AddressRow } from '../address';
5
- import { Chip } from '../chip';
6
- import { EmptyState } from '../empty-state';
7
- import { IconCircle } from '../icon-circle';
8
- import { RiCheckLine } from '../icons/remix/RiCheckLine';
9
- import { FactList } from '../listing-actions/parts';
10
- import { OrderStatusBar } from '../order-status';
11
- import { surfaceTextOn, useSurfaceFill } from '../styles/surface-levels';
12
- import { resolveAccentColors } from '../theme/accent-colors';
13
- import { useTheme } from '../theme/use-theme';
14
- import { Text } from '../typography';
15
- import { useMessages } from '../locale/messages';
16
- import { ORDER_CONFIRMATION_GAP, ORDER_CONFIRMATION_MARK } from './constants';
17
- import { ORDER_CONFIRMATION_MESSAGES } from './messages';
18
- import type { OrderConfirmationProps } from './types';
19
-
20
- /**
21
- * A row nested inside this surface takes its own chrome off: `Item`'s
22
- * `paddingLeft`/`paddingRight`, in the LONGHANDS it writes, so the reset is
23
- * honoured by react-native-web's atomic sheet as well as by Yoga.
24
- */
25
- const FLUSH_ROW = { paddingLeft: 0, paddingRight: 0 } as const;
26
-
27
- /**
28
- * It is placed: what happened, which order it was, where it is going, what it
29
- * cost, and the two things you do next.
30
- *
31
- * mark a check on a success-tinted disc, 56. STATIC: `AnimatedCheck`
32
- * draws itself on only when a caller kicks it through its ref, and
33
- * a mark that is invisible until someone calls a method — or under
34
- * reduce-motion — is not a mark. An app that wants the draw-on
35
- * passes `<AnimatedCheck>` (and its `play()`) as `mark`.
36
- * title the "done" register — `EmptyState`'s own heading and line, which
37
- * is the same block `auth-card` and every finished flow draw
38
- * reference the order number as an outlined `Chip`, under its caption; it is
39
- * a chip because it is the one string a reader will read back to
40
- * someone on the phone, and a chip is the library's token
41
- * status `order-status`'s `OrderStatusBar` — the ONE tracking strip in the
42
- * library, drawn here rather than copied
43
- * address `address`'s `AddressRow`, flush with the block's edges
44
- * facts the label/value box Bloom's action cards already draw
45
- * items a slot: an order line is a dish, a parcel or a seat, and each has
46
- * a row family of its own
47
- * actions track it, get help
48
- *
49
- * ## It IS an `EmptyState`
50
- *
51
- * Not "looks like one": a mark, a heading, a line of explanation, a block of
52
- * content and up to two actions is exactly that family's shape, and a "done"
53
- * screen is the same object as a "nothing here" screen with a different reason
54
- * for existing. Building it a second time is how two centred columns with
55
- * different paddings ship in one library.
56
- *
57
- * ## It computes nothing
58
- *
59
- * Every amount, every time and every reading is a string the app formatted.
60
- */
61
- function OrderConfirmationComponent({
62
- title: titleProp,
63
- description,
64
- mark,
65
- markSize = ORDER_CONFIRMATION_MARK,
66
- reference,
67
- referenceLabel: referenceLabelProp,
68
- status,
69
- address,
70
- facts,
71
- items,
72
- itemsLabel: itemsLabelProp,
73
- action,
74
- secondaryAction,
75
- footer,
76
- variant = 'comfortable',
77
- accessibilityLabel,
78
- style,
79
- testID,
80
- }: OrderConfirmationProps) {
81
- const { messages } = useMessages(ORDER_CONFIRMATION_MESSAGES);
82
- const title = titleProp ?? messages.title;
83
- const referenceLabel = referenceLabelProp ?? messages.referenceLabel;
84
- const itemsLabel = itemsLabelProp ?? messages.itemsLabel;
85
- const theme = useTheme();
86
- const surface = useSurfaceFill();
87
- const paint = useMemo(() => surfaceTextOn(theme, surface), [theme, surface]);
88
- const success = useMemo(() => resolveAccentColors(theme.colors, 'success', 'subtle'), [theme]);
89
- const id = (part: string) => (testID ? `${testID}-${part}` : undefined);
90
-
91
- const keyFacts = useMemo(
92
- () =>
93
- (facts ?? []).map((fact) => ({
94
- key: fact.id ?? fact.label,
95
- label: fact.label,
96
- value: fact.value,
97
- })),
98
- [facts],
99
- );
100
-
101
- const caption = (text: string, part: string) => (
102
- <Text
103
- variant="caption-2-bold"
104
- testID={id(part)}
105
- style={{ color: paint.textSecondary, textTransform: 'uppercase' }}
106
- >
107
- {text}
108
- </Text>
109
- );
110
-
111
- const hasBody =
112
- reference != null || status != null || address != null || keyFacts.length > 0 || items != null;
113
-
114
- return (
115
- <EmptyState
116
- variant={variant}
117
- // The mark is read for PRESENCE: `mark={null}` draws none, which is what
118
- // a surface that already carries a brand header wants.
119
- illustration={
120
- mark !== undefined ? (
121
- mark
122
- ) : (
123
- // The disc and the glyph are a resolved PAIR (`resolveAccentColors`),
124
- // never one token with alpha appended — `IconCircle`'s own primary
125
- // pair overridden together, which is the one way its docs allow.
126
- <IconCircle
127
- icon={RiCheckLine}
128
- size="xl"
129
- style={{ width: markSize, height: markSize, backgroundColor: success.background }}
130
- iconStyle={{ color: success.foreground }}
131
- />
132
- )
133
- }
134
- title={title}
135
- description={description}
136
- action={action}
137
- secondaryAction={secondaryAction}
138
- footer={footer}
139
- accessibilityLabel={
140
- accessibilityLabel ??
141
- [title, reference ? `${referenceLabel} ${reference}` : undefined, description]
142
- .filter(Boolean)
143
- .join('. ')
144
- }
145
- style={style}
146
- testID={testID}
147
- >
148
- {hasBody ? (
149
- <View style={{ gap: ORDER_CONFIRMATION_GAP }}>
150
- {reference != null ? (
151
- <View style={{ alignItems: 'center', gap: 6 }}>
152
- {caption(referenceLabel, 'reference-label')}
153
- <Chip
154
- variant="outlined"
155
- size="lg"
156
- // `Chip` pins itself to `alignSelf: 'flex-start'`, so a centred
157
- // parent does not centre it — it has to say so itself.
158
- style={{ alignSelf: 'center' }}
159
- accessibilityLabel={`${referenceLabel} ${reference}`}
160
- testID={id('reference')}
161
- >
162
- {reference}
163
- </Chip>
164
- </View>
165
- ) : null}
166
-
167
- {status ? <OrderStatusBar {...status} testID={status.testID ?? id('status')} /> : null}
168
-
169
- {address ? (
170
- <AddressRow
171
- title={address.title}
172
- subtitle={address.subtitle}
173
- kind={address.kind}
174
- icon={address.icon}
175
- badge={address.badge}
176
- meta={address.meta}
177
- style={FLUSH_ROW}
178
- testID={address.testID ?? id('address')}
179
- />
180
- ) : null}
181
-
182
- {keyFacts.length > 0 ? <FactList facts={keyFacts} testID={id('facts')} /> : null}
183
-
184
- {items != null ? (
185
- <View style={{ gap: 8 }}>
186
- {caption(itemsLabel, 'items-label')}
187
- <View testID={id('items')}>{items}</View>
188
- </View>
189
- ) : null}
190
- </View>
191
- ) : null}
192
- </EmptyState>
193
- );
194
- }
195
-
196
- export const OrderConfirmation = memo(OrderConfirmationComponent);
197
- OrderConfirmation.displayName = 'OrderConfirmation';