@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.
- package/NOTICE +28 -0
- package/android/src/main/java/so/oxy/bloom/BloomPackage.kt +3 -1
- package/android/src/main/java/so/oxy/bloom/icons/BloomIcon.kt +251 -0
- package/android/src/main/java/so/oxy/bloom/icons/IconPathParser.java +660 -0
- package/docs/adoption-matrix.mdx +1 -4
- package/docs/bloom-language-codemod.mdx +6 -2
- package/docs/bloom-language-modifiers.mdx +21 -5
- package/docs/bloom-language-nodes.mdx +3 -58
- package/docs/bloom-language.mdx +15 -36
- package/docs/empty-state.mdx +2 -3
- package/docs/icons.mdx +29 -1
- package/docs/public-parts.mdx +2 -7
- package/docs/task-catalog.json +1 -1
- package/docs/task-catalog.mdx +1 -1
- package/lib/commonjs/icons/TEMPLATE.js +25 -160
- package/lib/commonjs/icons/TEMPLATE.js.map +1 -1
- package/lib/commonjs/icons/glyph-svg.js +47 -0
- package/lib/commonjs/icons/glyph-svg.js.map +1 -0
- package/lib/commonjs/icons/glyph.js +29 -0
- package/lib/commonjs/icons/glyph.js.map +1 -0
- package/lib/commonjs/icons/glyph.native.js +112 -0
- package/lib/commonjs/icons/glyph.native.js.map +1 -0
- package/lib/commonjs/index.js +279 -485
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/index.web.js +279 -485
- package/lib/commonjs/index.web.js.map +1 -1
- package/lib/commonjs/locale/translations/ar.js +0 -39
- package/lib/commonjs/locale/translations/ar.js.map +1 -1
- package/lib/commonjs/locale/translations/bn.js +0 -34
- package/lib/commonjs/locale/translations/bn.js.map +1 -1
- package/lib/commonjs/locale/translations/ca.js +0 -35
- package/lib/commonjs/locale/translations/ca.js.map +1 -1
- package/lib/commonjs/locale/translations/de.js +0 -35
- package/lib/commonjs/locale/translations/de.js.map +1 -1
- package/lib/commonjs/locale/translations/es.js +0 -35
- package/lib/commonjs/locale/translations/es.js.map +1 -1
- package/lib/commonjs/locale/translations/fr.js +0 -35
- package/lib/commonjs/locale/translations/fr.js.map +1 -1
- package/lib/commonjs/locale/translations/hi.js +0 -35
- package/lib/commonjs/locale/translations/hi.js.map +1 -1
- package/lib/commonjs/locale/translations/id.js +0 -34
- package/lib/commonjs/locale/translations/id.js.map +1 -1
- package/lib/commonjs/locale/translations/it.js +0 -35
- package/lib/commonjs/locale/translations/it.js.map +1 -1
- package/lib/commonjs/locale/translations/ja.js +0 -34
- package/lib/commonjs/locale/translations/ja.js.map +1 -1
- package/lib/commonjs/locale/translations/pt.js +0 -35
- package/lib/commonjs/locale/translations/pt.js.map +1 -1
- package/lib/commonjs/locale/translations/ru.js +0 -37
- package/lib/commonjs/locale/translations/ru.js.map +1 -1
- package/lib/commonjs/locale/translations/tr.js +0 -34
- package/lib/commonjs/locale/translations/tr.js.map +1 -1
- package/lib/commonjs/locale/translations/zh.js +0 -34
- package/lib/commonjs/locale/translations/zh.js.map +1 -1
- package/lib/module/icons/TEMPLATE.js +25 -158
- package/lib/module/icons/TEMPLATE.js.map +1 -1
- package/lib/module/icons/glyph-svg.js +41 -0
- package/lib/module/icons/glyph-svg.js.map +1 -0
- package/lib/module/icons/glyph.js +25 -0
- package/lib/module/icons/glyph.js.map +1 -0
- package/lib/module/icons/glyph.native.js +108 -0
- package/lib/module/icons/glyph.native.js.map +1 -0
- package/lib/module/index.js +0 -14
- package/lib/module/index.js.map +1 -1
- package/lib/module/index.web.js +0 -14
- package/lib/module/index.web.js.map +1 -1
- package/lib/module/locale/translations/ar.js +0 -39
- package/lib/module/locale/translations/ar.js.map +1 -1
- package/lib/module/locale/translations/bn.js +0 -34
- package/lib/module/locale/translations/bn.js.map +1 -1
- package/lib/module/locale/translations/ca.js +0 -35
- package/lib/module/locale/translations/ca.js.map +1 -1
- package/lib/module/locale/translations/de.js +0 -35
- package/lib/module/locale/translations/de.js.map +1 -1
- package/lib/module/locale/translations/es.js +0 -35
- package/lib/module/locale/translations/es.js.map +1 -1
- package/lib/module/locale/translations/fr.js +0 -35
- package/lib/module/locale/translations/fr.js.map +1 -1
- package/lib/module/locale/translations/hi.js +0 -35
- package/lib/module/locale/translations/hi.js.map +1 -1
- package/lib/module/locale/translations/id.js +0 -34
- package/lib/module/locale/translations/id.js.map +1 -1
- package/lib/module/locale/translations/it.js +0 -35
- package/lib/module/locale/translations/it.js.map +1 -1
- package/lib/module/locale/translations/ja.js +0 -34
- package/lib/module/locale/translations/ja.js.map +1 -1
- package/lib/module/locale/translations/pt.js +0 -35
- package/lib/module/locale/translations/pt.js.map +1 -1
- package/lib/module/locale/translations/ru.js +0 -37
- package/lib/module/locale/translations/ru.js.map +1 -1
- package/lib/module/locale/translations/tr.js +0 -34
- package/lib/module/locale/translations/tr.js.map +1 -1
- package/lib/module/locale/translations/zh.js +0 -34
- package/lib/module/locale/translations/zh.js.map +1 -1
- package/lib/typescript/commonjs/icons/TEMPLATE.d.ts +1 -1
- package/lib/typescript/commonjs/icons/TEMPLATE.d.ts.map +1 -1
- package/lib/typescript/commonjs/icons/glyph-svg.d.ts +17 -0
- package/lib/typescript/commonjs/icons/glyph-svg.d.ts.map +1 -0
- package/lib/typescript/commonjs/icons/glyph.d.ts +11 -0
- package/lib/typescript/commonjs/icons/glyph.d.ts.map +1 -0
- package/lib/typescript/commonjs/icons/glyph.native.d.ts +20 -0
- package/lib/typescript/commonjs/icons/glyph.native.d.ts.map +1 -0
- package/lib/typescript/commonjs/index.d.ts +0 -9
- package/lib/typescript/commonjs/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/index.web.d.ts +0 -9
- package/lib/typescript/commonjs/index.web.d.ts.map +1 -1
- package/lib/typescript/commonjs/locale/translations/ar.d.ts.map +1 -1
- package/lib/typescript/commonjs/locale/translations/bn.d.ts.map +1 -1
- package/lib/typescript/commonjs/locale/translations/ca.d.ts.map +1 -1
- package/lib/typescript/commonjs/locale/translations/de.d.ts.map +1 -1
- package/lib/typescript/commonjs/locale/translations/es.d.ts.map +1 -1
- package/lib/typescript/commonjs/locale/translations/fr.d.ts.map +1 -1
- package/lib/typescript/commonjs/locale/translations/hi.d.ts.map +1 -1
- package/lib/typescript/commonjs/locale/translations/id.d.ts.map +1 -1
- package/lib/typescript/commonjs/locale/translations/it.d.ts.map +1 -1
- package/lib/typescript/commonjs/locale/translations/ja.d.ts.map +1 -1
- package/lib/typescript/commonjs/locale/translations/pt.d.ts.map +1 -1
- package/lib/typescript/commonjs/locale/translations/ru.d.ts.map +1 -1
- package/lib/typescript/commonjs/locale/translations/tr.d.ts.map +1 -1
- package/lib/typescript/commonjs/locale/translations/types.d.ts +0 -6
- package/lib/typescript/commonjs/locale/translations/types.d.ts.map +1 -1
- package/lib/typescript/commonjs/locale/translations/zh.d.ts.map +1 -1
- package/lib/typescript/module/icons/TEMPLATE.d.ts +1 -1
- package/lib/typescript/module/icons/TEMPLATE.d.ts.map +1 -1
- package/lib/typescript/module/icons/glyph-svg.d.ts +17 -0
- package/lib/typescript/module/icons/glyph-svg.d.ts.map +1 -0
- package/lib/typescript/module/icons/glyph.d.ts +11 -0
- package/lib/typescript/module/icons/glyph.d.ts.map +1 -0
- package/lib/typescript/module/icons/glyph.native.d.ts +20 -0
- package/lib/typescript/module/icons/glyph.native.d.ts.map +1 -0
- package/lib/typescript/module/index.d.ts +0 -9
- package/lib/typescript/module/index.d.ts.map +1 -1
- package/lib/typescript/module/index.web.d.ts +0 -9
- package/lib/typescript/module/index.web.d.ts.map +1 -1
- package/lib/typescript/module/locale/translations/ar.d.ts.map +1 -1
- package/lib/typescript/module/locale/translations/bn.d.ts.map +1 -1
- package/lib/typescript/module/locale/translations/ca.d.ts.map +1 -1
- package/lib/typescript/module/locale/translations/de.d.ts.map +1 -1
- package/lib/typescript/module/locale/translations/es.d.ts.map +1 -1
- package/lib/typescript/module/locale/translations/fr.d.ts.map +1 -1
- package/lib/typescript/module/locale/translations/hi.d.ts.map +1 -1
- package/lib/typescript/module/locale/translations/id.d.ts.map +1 -1
- package/lib/typescript/module/locale/translations/it.d.ts.map +1 -1
- package/lib/typescript/module/locale/translations/ja.d.ts.map +1 -1
- package/lib/typescript/module/locale/translations/pt.d.ts.map +1 -1
- package/lib/typescript/module/locale/translations/ru.d.ts.map +1 -1
- package/lib/typescript/module/locale/translations/tr.d.ts.map +1 -1
- package/lib/typescript/module/locale/translations/types.d.ts +0 -6
- package/lib/typescript/module/locale/translations/types.d.ts.map +1 -1
- package/lib/typescript/module/locale/translations/zh.d.ts.map +1 -1
- package/package.json +1 -52
- package/src/__tests__/support/public-part-classifications.json +0 -5
- package/src/icons/TEMPLATE.tsx +28 -49
- package/src/icons/glyph-svg.tsx +54 -0
- package/src/icons/glyph.native.tsx +138 -0
- package/src/icons/glyph.tsx +15 -0
- package/src/index.ts +0 -62
- package/src/index.web.ts +0 -62
- package/src/locale/translations/ar.ts +0 -36
- package/src/locale/translations/bn.ts +0 -36
- package/src/locale/translations/ca.ts +0 -36
- package/src/locale/translations/de.ts +0 -36
- package/src/locale/translations/es.ts +0 -36
- package/src/locale/translations/fr.ts +0 -36
- package/src/locale/translations/hi.ts +0 -36
- package/src/locale/translations/id.ts +0 -36
- package/src/locale/translations/it.ts +0 -36
- package/src/locale/translations/ja.ts +0 -36
- package/src/locale/translations/pt.ts +0 -36
- package/src/locale/translations/ru.ts +0 -36
- package/src/locale/translations/tr.ts +0 -36
- package/src/locale/translations/types.ts +0 -6
- package/src/locale/translations/zh.ts +0 -36
- package/docs/checkout-summary.mdx +0 -94
- package/docs/order-confirmation.mdx +0 -66
- package/docs/vendor-card.mdx +0 -83
- package/lib/commonjs/checkout-summary/CheckoutConfirm.js +0 -243
- package/lib/commonjs/checkout-summary/CheckoutConfirm.js.map +0 -1
- package/lib/commonjs/checkout-summary/CheckoutSummary.js +0 -432
- package/lib/commonjs/checkout-summary/CheckoutSummary.js.map +0 -1
- package/lib/commonjs/checkout-summary/CheckoutSummaryRow.js +0 -277
- package/lib/commonjs/checkout-summary/CheckoutSummaryRow.js.map +0 -1
- package/lib/commonjs/checkout-summary/constants.js +0 -66
- package/lib/commonjs/checkout-summary/constants.js.map +0 -1
- package/lib/commonjs/checkout-summary/index.js +0 -95
- package/lib/commonjs/checkout-summary/index.js.map +0 -1
- package/lib/commonjs/checkout-summary/messages.js +0 -23
- package/lib/commonjs/checkout-summary/messages.js.map +0 -1
- package/lib/commonjs/checkout-summary/shared.js +0 -43
- package/lib/commonjs/checkout-summary/shared.js.map +0 -1
- package/lib/commonjs/checkout-summary/types.js +0 -6
- package/lib/commonjs/checkout-summary/types.js.map +0 -1
- package/lib/commonjs/order-confirmation/OrderConfirmation.js +0 -305
- package/lib/commonjs/order-confirmation/OrderConfirmation.js.map +0 -1
- package/lib/commonjs/order-confirmation/constants.js +0 -26
- package/lib/commonjs/order-confirmation/constants.js.map +0 -1
- package/lib/commonjs/order-confirmation/index.js +0 -38
- package/lib/commonjs/order-confirmation/index.js.map +0 -1
- package/lib/commonjs/order-confirmation/messages.js +0 -18
- package/lib/commonjs/order-confirmation/messages.js.map +0 -1
- package/lib/commonjs/order-confirmation/types.js +0 -6
- package/lib/commonjs/order-confirmation/types.js.map +0 -1
- package/lib/commonjs/vendor-card/VendorCard.js +0 -1051
- package/lib/commonjs/vendor-card/VendorCard.js.map +0 -1
- package/lib/commonjs/vendor-card/constants.js +0 -54
- package/lib/commonjs/vendor-card/constants.js.map +0 -1
- package/lib/commonjs/vendor-card/index.js +0 -69
- package/lib/commonjs/vendor-card/index.js.map +0 -1
- package/lib/commonjs/vendor-card/message-helpers.js +0 -23
- package/lib/commonjs/vendor-card/message-helpers.js.map +0 -1
- package/lib/commonjs/vendor-card/messages.js +0 -32
- package/lib/commonjs/vendor-card/messages.js.map +0 -1
- package/lib/commonjs/vendor-card/shared.js +0 -116
- package/lib/commonjs/vendor-card/shared.js.map +0 -1
- package/lib/commonjs/vendor-card/types.js +0 -6
- package/lib/commonjs/vendor-card/types.js.map +0 -1
- package/lib/module/checkout-summary/CheckoutConfirm.js +0 -237
- package/lib/module/checkout-summary/CheckoutConfirm.js.map +0 -1
- package/lib/module/checkout-summary/CheckoutSummary.js +0 -426
- package/lib/module/checkout-summary/CheckoutSummary.js.map +0 -1
- package/lib/module/checkout-summary/CheckoutSummaryRow.js +0 -273
- package/lib/module/checkout-summary/CheckoutSummaryRow.js.map +0 -1
- package/lib/module/checkout-summary/constants.js +0 -63
- package/lib/module/checkout-summary/constants.js.map +0 -1
- package/lib/module/checkout-summary/index.js +0 -8
- package/lib/module/checkout-summary/index.js.map +0 -1
- package/lib/module/checkout-summary/messages.js +0 -20
- package/lib/module/checkout-summary/messages.js.map +0 -1
- package/lib/module/checkout-summary/shared.js +0 -36
- package/lib/module/checkout-summary/shared.js.map +0 -1
- package/lib/module/checkout-summary/types.js +0 -4
- package/lib/module/checkout-summary/types.js.map +0 -1
- package/lib/module/order-confirmation/OrderConfirmation.js +0 -299
- package/lib/module/order-confirmation/OrderConfirmation.js.map +0 -1
- package/lib/module/order-confirmation/constants.js +0 -23
- package/lib/module/order-confirmation/constants.js.map +0 -1
- package/lib/module/order-confirmation/index.js +0 -5
- package/lib/module/order-confirmation/index.js.map +0 -1
- package/lib/module/order-confirmation/messages.js +0 -15
- package/lib/module/order-confirmation/messages.js.map +0 -1
- package/lib/module/order-confirmation/types.js +0 -4
- package/lib/module/order-confirmation/types.js.map +0 -1
- package/lib/module/vendor-card/VendorCard.js +0 -1046
- package/lib/module/vendor-card/VendorCard.js.map +0 -1
- package/lib/module/vendor-card/constants.js +0 -50
- package/lib/module/vendor-card/constants.js.map +0 -1
- package/lib/module/vendor-card/index.js +0 -6
- package/lib/module/vendor-card/index.js.map +0 -1
- package/lib/module/vendor-card/message-helpers.js +0 -18
- package/lib/module/vendor-card/message-helpers.js.map +0 -1
- package/lib/module/vendor-card/messages.js +0 -29
- package/lib/module/vendor-card/messages.js.map +0 -1
- package/lib/module/vendor-card/shared.js +0 -107
- package/lib/module/vendor-card/shared.js.map +0 -1
- package/lib/module/vendor-card/types.js +0 -4
- package/lib/module/vendor-card/types.js.map +0 -1
- package/lib/typescript/commonjs/checkout-summary/CheckoutConfirm.d.ts +0 -40
- package/lib/typescript/commonjs/checkout-summary/CheckoutConfirm.d.ts.map +0 -1
- package/lib/typescript/commonjs/checkout-summary/CheckoutSummary.d.ts +0 -36
- package/lib/typescript/commonjs/checkout-summary/CheckoutSummary.d.ts.map +0 -1
- package/lib/typescript/commonjs/checkout-summary/CheckoutSummaryRow.d.ts +0 -29
- package/lib/typescript/commonjs/checkout-summary/CheckoutSummaryRow.d.ts.map +0 -1
- package/lib/typescript/commonjs/checkout-summary/constants.d.ts +0 -39
- package/lib/typescript/commonjs/checkout-summary/constants.d.ts.map +0 -1
- package/lib/typescript/commonjs/checkout-summary/index.d.ts +0 -8
- package/lib/typescript/commonjs/checkout-summary/index.d.ts.map +0 -1
- package/lib/typescript/commonjs/checkout-summary/messages.d.ts +0 -23
- package/lib/typescript/commonjs/checkout-summary/messages.d.ts.map +0 -1
- package/lib/typescript/commonjs/checkout-summary/shared.d.ts +0 -27
- package/lib/typescript/commonjs/checkout-summary/shared.d.ts.map +0 -1
- package/lib/typescript/commonjs/checkout-summary/types.d.ts +0 -147
- package/lib/typescript/commonjs/checkout-summary/types.d.ts.map +0 -1
- package/lib/typescript/commonjs/order-confirmation/OrderConfirmation.d.ts +0 -40
- package/lib/typescript/commonjs/order-confirmation/OrderConfirmation.d.ts.map +0 -1
- package/lib/typescript/commonjs/order-confirmation/constants.d.ts +0 -17
- package/lib/typescript/commonjs/order-confirmation/constants.d.ts.map +0 -1
- package/lib/typescript/commonjs/order-confirmation/index.d.ts +0 -4
- package/lib/typescript/commonjs/order-confirmation/index.d.ts.map +0 -1
- package/lib/typescript/commonjs/order-confirmation/messages.d.ts +0 -12
- package/lib/typescript/commonjs/order-confirmation/messages.d.ts.map +0 -1
- package/lib/typescript/commonjs/order-confirmation/types.d.ts +0 -88
- package/lib/typescript/commonjs/order-confirmation/types.d.ts.map +0 -1
- package/lib/typescript/commonjs/vendor-card/VendorCard.d.ts +0 -6
- package/lib/typescript/commonjs/vendor-card/VendorCard.d.ts.map +0 -1
- package/lib/typescript/commonjs/vendor-card/constants.d.ts +0 -30
- package/lib/typescript/commonjs/vendor-card/constants.d.ts.map +0 -1
- package/lib/typescript/commonjs/vendor-card/index.d.ts +0 -5
- package/lib/typescript/commonjs/vendor-card/index.d.ts.map +0 -1
- package/lib/typescript/commonjs/vendor-card/message-helpers.d.ts +0 -13
- package/lib/typescript/commonjs/vendor-card/message-helpers.d.ts.map +0 -1
- package/lib/typescript/commonjs/vendor-card/messages.d.ts +0 -22
- package/lib/typescript/commonjs/vendor-card/messages.d.ts.map +0 -1
- package/lib/typescript/commonjs/vendor-card/shared.d.ts +0 -24
- package/lib/typescript/commonjs/vendor-card/shared.d.ts.map +0 -1
- package/lib/typescript/commonjs/vendor-card/types.d.ts +0 -111
- package/lib/typescript/commonjs/vendor-card/types.d.ts.map +0 -1
- package/lib/typescript/module/checkout-summary/CheckoutConfirm.d.ts +0 -40
- package/lib/typescript/module/checkout-summary/CheckoutConfirm.d.ts.map +0 -1
- package/lib/typescript/module/checkout-summary/CheckoutSummary.d.ts +0 -36
- package/lib/typescript/module/checkout-summary/CheckoutSummary.d.ts.map +0 -1
- package/lib/typescript/module/checkout-summary/CheckoutSummaryRow.d.ts +0 -29
- package/lib/typescript/module/checkout-summary/CheckoutSummaryRow.d.ts.map +0 -1
- package/lib/typescript/module/checkout-summary/constants.d.ts +0 -39
- package/lib/typescript/module/checkout-summary/constants.d.ts.map +0 -1
- package/lib/typescript/module/checkout-summary/index.d.ts +0 -8
- package/lib/typescript/module/checkout-summary/index.d.ts.map +0 -1
- package/lib/typescript/module/checkout-summary/messages.d.ts +0 -23
- package/lib/typescript/module/checkout-summary/messages.d.ts.map +0 -1
- package/lib/typescript/module/checkout-summary/shared.d.ts +0 -27
- package/lib/typescript/module/checkout-summary/shared.d.ts.map +0 -1
- package/lib/typescript/module/checkout-summary/types.d.ts +0 -147
- package/lib/typescript/module/checkout-summary/types.d.ts.map +0 -1
- package/lib/typescript/module/order-confirmation/OrderConfirmation.d.ts +0 -40
- package/lib/typescript/module/order-confirmation/OrderConfirmation.d.ts.map +0 -1
- package/lib/typescript/module/order-confirmation/constants.d.ts +0 -17
- package/lib/typescript/module/order-confirmation/constants.d.ts.map +0 -1
- package/lib/typescript/module/order-confirmation/index.d.ts +0 -4
- package/lib/typescript/module/order-confirmation/index.d.ts.map +0 -1
- package/lib/typescript/module/order-confirmation/messages.d.ts +0 -12
- package/lib/typescript/module/order-confirmation/messages.d.ts.map +0 -1
- package/lib/typescript/module/order-confirmation/types.d.ts +0 -88
- package/lib/typescript/module/order-confirmation/types.d.ts.map +0 -1
- package/lib/typescript/module/vendor-card/VendorCard.d.ts +0 -6
- package/lib/typescript/module/vendor-card/VendorCard.d.ts.map +0 -1
- package/lib/typescript/module/vendor-card/constants.d.ts +0 -30
- package/lib/typescript/module/vendor-card/constants.d.ts.map +0 -1
- package/lib/typescript/module/vendor-card/index.d.ts +0 -5
- package/lib/typescript/module/vendor-card/index.d.ts.map +0 -1
- package/lib/typescript/module/vendor-card/message-helpers.d.ts +0 -13
- package/lib/typescript/module/vendor-card/message-helpers.d.ts.map +0 -1
- package/lib/typescript/module/vendor-card/messages.d.ts +0 -22
- package/lib/typescript/module/vendor-card/messages.d.ts.map +0 -1
- package/lib/typescript/module/vendor-card/shared.d.ts +0 -24
- package/lib/typescript/module/vendor-card/shared.d.ts.map +0 -1
- package/lib/typescript/module/vendor-card/types.d.ts +0 -111
- package/lib/typescript/module/vendor-card/types.d.ts.map +0 -1
- package/src/checkout-summary/CheckoutConfirm.tsx +0 -119
- package/src/checkout-summary/CheckoutSummary.tsx +0 -221
- package/src/checkout-summary/CheckoutSummaryRow.tsx +0 -172
- package/src/checkout-summary/constants.ts +0 -64
- package/src/checkout-summary/index.ts +0 -22
- package/src/checkout-summary/messages.ts +0 -33
- package/src/checkout-summary/shared.ts +0 -40
- package/src/checkout-summary/types.ts +0 -152
- package/src/order-confirmation/OrderConfirmation.tsx +0 -197
- package/src/order-confirmation/constants.ts +0 -20
- package/src/order-confirmation/index.ts +0 -12
- package/src/order-confirmation/messages.ts +0 -18
- package/src/order-confirmation/types.ts +0 -98
- package/src/vendor-card/VendorCard.tsx +0 -509
- package/src/vendor-card/constants.ts +0 -58
- package/src/vendor-card/index.ts +0 -15
- package/src/vendor-card/message-helpers.ts +0 -20
- package/src/vendor-card/messages.ts +0 -36
- package/src/vendor-card/shared.ts +0 -136
- 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';
|