@cartbase/storefront 0.1.2 → 0.2.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 (101) hide show
  1. package/README.md +3 -3
  2. package/package.json +231 -226
  3. package/src/api/auth.ts +1 -1
  4. package/src/api/consent.ts +2 -2
  5. package/src/api/regions.ts +1 -1
  6. package/src/cart-drawer/context.tsx +4 -4
  7. package/src/cart-drawer/cross-sell-carousel.tsx +1 -1
  8. package/src/cart-drawer/cross-sell-sidebar.tsx +1 -1
  9. package/src/cart-drawer/header.tsx +1 -1
  10. package/src/cart-drawer/item/index.tsx +2 -2
  11. package/src/cart-drawer/item/quantity.tsx +2 -2
  12. package/src/cart-drawer/item/upsell.tsx +3 -3
  13. package/src/cart-drawer/item/variant.tsx +2 -2
  14. package/src/cart-drawer/labels-bg.ts +1 -1
  15. package/src/cart-drawer/labels.ts +2 -2
  16. package/src/cart-drawer/summary-breakdown.tsx +2 -2
  17. package/src/cart-drawer/template.tsx +2 -2
  18. package/src/cart-drawer/tiered-progress.tsx +1 -1
  19. package/src/checkout/address-error-copy.ts +3 -3
  20. package/src/checkout/address-form.tsx +2 -2
  21. package/src/checkout/address-select.tsx +1 -1
  22. package/src/checkout/boxnow-locker-selector.tsx +3 -3
  23. package/src/checkout/checkout-client.tsx +2 -2
  24. package/src/checkout/company-details.tsx +1 -1
  25. package/src/checkout/compare-addresses.ts +1 -1
  26. package/src/checkout/discount-section.tsx +5 -5
  27. package/src/checkout/econt-office-selector.tsx +2 -2
  28. package/src/checkout/gift-card-section.tsx +2 -2
  29. package/src/checkout/labels-bg.ts +1 -1
  30. package/src/checkout/labels.ts +4 -4
  31. package/src/checkout/line-item-card.tsx +2 -2
  32. package/src/checkout/order-summary.tsx +7 -7
  33. package/src/checkout/payment-button.tsx +4 -4
  34. package/src/checkout/payment-error-copy.ts +6 -6
  35. package/src/checkout/payment-method-list.tsx +2 -2
  36. package/src/checkout/payment-wrapper.tsx +8 -11
  37. package/src/checkout/promotion-error-copy.ts +2 -2
  38. package/src/checkout/shipping-method-list.tsx +2 -2
  39. package/src/checkout/stripe-wrapper.tsx +1 -1
  40. package/src/checkout/use-checkout-orchestration.ts +16 -16
  41. package/src/common/cart-button-client.tsx +1 -1
  42. package/src/common/cart-button.tsx +1 -1
  43. package/src/common/country-select.tsx +2 -2
  44. package/src/common/delete-button.tsx +1 -1
  45. package/src/common/index.ts +1 -1
  46. package/src/common/language-select.tsx +2 -2
  47. package/src/common/localized-link.tsx +1 -1
  48. package/src/lib/cart-helpers.ts +2 -2
  49. package/src/lib/cookie-names.ts +41 -0
  50. package/src/lib/get-product-price.ts +3 -3
  51. package/src/lib/payment-constants.ts +2 -2
  52. package/src/lib/store-api-error.ts +1 -1
  53. package/src/order/index.ts +1 -1
  54. package/src/order/labels.ts +3 -3
  55. package/src/order/order-address-card.tsx +1 -1
  56. package/src/order/order-completed-template.tsx +3 -3
  57. package/src/order/order-confirmation-header.tsx +1 -1
  58. package/src/order/order-delivery-card.tsx +3 -3
  59. package/src/order/order-item.tsx +2 -2
  60. package/src/order/order-items-list.tsx +3 -3
  61. package/src/order/order-payment-card.tsx +2 -2
  62. package/src/order/order-timeline.tsx +2 -2
  63. package/src/order/order-totals.tsx +5 -5
  64. package/src/platform/identity.ts +18 -0
  65. package/src/platform/index.ts +8 -0
  66. package/src/platform/metadata.ts +26 -0
  67. package/src/platform/platform-init.tsx +46 -0
  68. package/src/products/image-gallery.tsx +1 -1
  69. package/src/products/mobile-actions.tsx +1 -1
  70. package/src/products/option-select.tsx +1 -1
  71. package/src/products/preview-price.tsx +1 -1
  72. package/src/products/product-actions.tsx +6 -6
  73. package/src/products/product-info.tsx +1 -1
  74. package/src/products/product-preview.tsx +1 -1
  75. package/src/products/product-price.tsx +2 -2
  76. package/src/products/product-tabs.tsx +1 -1
  77. package/src/products/purchase-options.tsx +1 -1
  78. package/src/products/related-products.tsx +3 -3
  79. package/src/products/variant-matching.ts +4 -4
  80. package/src/reviews-ui/labels.ts +1 -1
  81. package/src/reviews-ui/photo-upload.tsx +1 -1
  82. package/src/reviews-ui/review-list.tsx +1 -1
  83. package/src/reviews-ui/review-widget.tsx +1 -1
  84. package/src/reviews-ui/review-wizard.tsx +1 -1
  85. package/src/reviews-ui/wizard-state.ts +1 -1
  86. package/src/store/category-template.tsx +2 -2
  87. package/src/store/collection-template.tsx +2 -2
  88. package/src/store/labels.ts +2 -2
  89. package/src/store/paginated-products.tsx +1 -1
  90. package/src/store/search-params.ts +1 -1
  91. package/src/store/search-template.tsx +1 -1
  92. package/src/tracking/consent-banner.tsx +1 -1
  93. package/src/tracking/consent-init.tsx +1 -1
  94. package/src/tracking/consent.ts +6 -6
  95. package/src/tracking/fbq.ts +2 -2
  96. package/src/tracking/get-tracking-attribution.ts +1 -1
  97. package/src/tracking/get-tracking-config.ts +2 -2
  98. package/src/tracking/index.ts +2 -2
  99. package/src/tracking/meta-pixel.tsx +1 -1
  100. package/src/tracking/rybbit.tsx +1 -1
  101. package/src/tracking/types.ts +6 -6
package/README.md CHANGED
@@ -27,9 +27,9 @@ Three environment values wire it to your store (all in your Cartbase
27
27
  admin under **Settings**):
28
28
 
29
29
  ```bash
30
- NEXT_PUBLIC_BARTER_URL= # your store's API origin
31
- NEXT_PUBLIC_BARTER_CLIENT_ID= # your store's client id
32
- NEXT_PUBLIC_BARTER_PUBLISHABLE_KEY= # optional, channel-scoped catalogs
30
+ NEXT_PUBLIC_CARTBASE_URL= # your store's API origin
31
+ NEXT_PUBLIC_CARTBASE_CLIENT_ID= # your store's client id
32
+ NEXT_PUBLIC_CARTBASE_PUBLISHABLE_KEY= # optional, channel-scoped catalogs
33
33
  ```
34
34
 
35
35
  ## What's inside
package/package.json CHANGED
@@ -1,226 +1,231 @@
1
- {
2
- "name": "@cartbase/storefront",
3
- "version": "0.1.2",
4
- "description": "Storefront SDK + UI component library for Cartbase stores: typed API client, checkout orchestration, cart drawer, product/catalog components, tracking. Source-shipped TypeScript — add it to transpilePackages.",
5
- "license": "MIT",
6
- "repository": {
7
- "type": "git",
8
- "url": "git+https://github.com/1click-so/barter.git",
9
- "directory": "packages/storefront"
10
- },
11
- "type": "module",
12
- "sideEffects": false,
13
- "files": [
14
- "src",
15
- "README.md",
16
- "tailwind-preset.cjs"
17
- ],
18
- "exports": {
19
- ".": "./src/index.ts",
20
- "./api": "./src/api/index.ts",
21
- "./api/http": "./src/api/http.ts",
22
- "./api/types": "./src/api/types.ts",
23
- "./api/products": "./src/api/products.ts",
24
- "./api/collections": "./src/api/collections.ts",
25
- "./api/categories": "./src/api/categories.ts",
26
- "./api/regions": "./src/api/regions.ts",
27
- "./api/carts": "./src/api/carts.ts",
28
- "./api/gift-cards": "./src/api/gift-cards.ts",
29
- "./api/checkout": "./src/api/checkout.ts",
30
- "./api/orders": "./src/api/orders.ts",
31
- "./api/customers": "./src/api/customers.ts",
32
- "./api/auth": "./src/api/auth.ts",
33
- "./api/content": "./src/api/content.ts",
34
- "./api/menus": "./src/api/menus.ts",
35
- "./api/metaobjects": "./src/api/metaobjects.ts",
36
- "./api/reviews": "./src/api/reviews.ts",
37
- "./api/search": "./src/api/search.ts",
38
- "./api/integrations": "./src/api/integrations.ts",
39
- "./api/consent": "./src/api/consent.ts",
40
- "./api/redirects": "./src/api/redirects.ts",
41
- "./tailwind-preset": "./tailwind-preset.cjs",
42
- "./lib/utils": "./src/lib/utils.ts",
43
- "./lib/money": "./src/lib/money.ts",
44
- "./lib/cart-helpers": "./src/lib/cart-helpers.ts",
45
- "./lib/get-product-price": "./src/lib/get-product-price.ts",
46
- "./lib/get-percentage-diff": "./src/lib/get-percentage-diff.ts",
47
- "./lib/product": "./src/lib/product.ts",
48
- "./lib/sort-products": "./src/lib/sort-products.ts",
49
- "./lib/dual-price": "./src/lib/dual-price.tsx",
50
- "./lib/payment-constants": "./src/lib/payment-constants.ts",
51
- "./lib/store-api-error": "./src/lib/store-api-error.ts",
52
- "./lib/hooks/use-intersection": "./src/lib/hooks/use-intersection.ts",
53
- "./lib/hooks/use-toggle-state": "./src/lib/hooks/use-toggle-state.ts",
54
- "./primitives/field": "./src/primitives/field.tsx",
55
- "./primitives/select-field": "./src/primitives/select-field.tsx",
56
- "./primitives/ui/accordion": "./src/primitives/ui/accordion.tsx",
57
- "./primitives/ui/button": "./src/primitives/ui/button.tsx",
58
- "./primitives/ui/collapsible": "./src/primitives/ui/collapsible.tsx",
59
- "./primitives/ui/dialog": "./src/primitives/ui/dialog.tsx",
60
- "./primitives/ui/input": "./src/primitives/ui/input.tsx",
61
- "./primitives/ui/label": "./src/primitives/ui/label.tsx",
62
- "./primitives/ui/popover": "./src/primitives/ui/popover.tsx",
63
- "./primitives/ui/select": "./src/primitives/ui/select.tsx",
64
- "./primitives/ui/sheet": "./src/primitives/ui/sheet.tsx",
65
- "./primitives/ui/tabs": "./src/primitives/ui/tabs.tsx",
66
- "./tracking": "./src/tracking/index.ts",
67
- "./tracking/types": "./src/tracking/types.ts",
68
- "./tracking/consent": "./src/tracking/consent.ts",
69
- "./tracking/consent-init": "./src/tracking/consent-init.tsx",
70
- "./tracking/consent-banner": "./src/tracking/consent-banner.tsx",
71
- "./tracking/meta-pixel": "./src/tracking/meta-pixel.tsx",
72
- "./tracking/ga4": "./src/tracking/ga4.tsx",
73
- "./tracking/rybbit": "./src/tracking/rybbit.tsx",
74
- "./tracking/rybbit-events": "./src/tracking/rybbit-events.ts",
75
- "./tracking/fbq": "./src/tracking/fbq.ts",
76
- "./tracking/gtag": "./src/tracking/gtag.ts",
77
- "./tracking/attribution": "./src/tracking/attribution.ts",
78
- "./tracking/get-tracking-config": "./src/tracking/get-tracking-config.ts",
79
- "./tracking/get-tracking-attribution": "./src/tracking/get-tracking-attribution.ts",
80
- "./tracking/use-engagement-time": "./src/tracking/use-engagement-time.ts",
81
- "./checkout": "./src/checkout/index.ts",
82
- "./checkout/context": "./src/checkout/context.tsx",
83
- "./checkout/labels": "./src/checkout/labels.ts",
84
- "./checkout/labels-bg": "./src/checkout/labels-bg.ts",
85
- "./checkout/error-message": "./src/checkout/error-message.tsx",
86
- "./checkout/stripe-wrapper": "./src/checkout/stripe-wrapper.tsx",
87
- "./checkout/payment-wrapper": "./src/checkout/payment-wrapper.tsx",
88
- "./checkout/payment-button": "./src/checkout/payment-button.tsx",
89
- "./checkout/econt-office-selector": "./src/checkout/econt-office-selector.tsx",
90
- "./checkout/boxnow-locker-selector": "./src/checkout/boxnow-locker-selector.tsx",
91
- "./checkout/address-select": "./src/checkout/address-select.tsx",
92
- "./checkout/company-details": "./src/checkout/company-details.tsx",
93
- "./checkout/discount-section": "./src/checkout/discount-section.tsx",
94
- "./checkout/gift-card-section": "./src/checkout/gift-card-section.tsx",
95
- "./checkout/line-item-card": "./src/checkout/line-item-card.tsx",
96
- "./checkout/order-summary": "./src/checkout/order-summary.tsx",
97
- "./checkout/address-form": "./src/checkout/address-form.tsx",
98
- "./checkout/shipping-method-list": "./src/checkout/shipping-method-list.tsx",
99
- "./checkout/payment-method-list": "./src/checkout/payment-method-list.tsx",
100
- "./checkout/checkout-client": "./src/checkout/checkout-client.tsx",
101
- "./checkout/use-checkout-orchestration": "./src/checkout/use-checkout-orchestration.ts",
102
- "./checkout/payment-error-copy": "./src/checkout/payment-error-copy.ts",
103
- "./checkout/address-error-copy": "./src/checkout/address-error-copy.ts",
104
- "./checkout/promotion-error-copy": "./src/checkout/promotion-error-copy.ts",
105
- "./cart-drawer": "./src/cart-drawer/index.ts",
106
- "./cart-drawer/context": "./src/cart-drawer/context.tsx",
107
- "./cart-drawer/labels": "./src/cart-drawer/labels.ts",
108
- "./cart-drawer/labels-bg": "./src/cart-drawer/labels-bg.ts",
109
- "./cart-drawer/cart-drawer": "./src/cart-drawer/cart-drawer.tsx",
110
- "./cart-drawer/header": "./src/cart-drawer/header.tsx",
111
- "./cart-drawer/promo-banner": "./src/cart-drawer/promo-banner.tsx",
112
- "./cart-drawer/tiered-progress": "./src/cart-drawer/tiered-progress.tsx",
113
- "./cart-drawer/item": "./src/cart-drawer/item/index.tsx",
114
- "./cart-drawer/item/quantity": "./src/cart-drawer/item/quantity.tsx",
115
- "./cart-drawer/item/variant": "./src/cart-drawer/item/variant.tsx",
116
- "./cart-drawer/item/upsell": "./src/cart-drawer/item/upsell.tsx",
117
- "./cart-drawer/free-gift": "./src/cart-drawer/free-gift.tsx",
118
- "./cart-drawer/gift-wrap": "./src/cart-drawer/gift-wrap.tsx",
119
- "./cart-drawer/notes": "./src/cart-drawer/notes.tsx",
120
- "./cart-drawer/rewards-points": "./src/cart-drawer/rewards-points.tsx",
121
- "./cart-drawer/cross-sell-sidebar": "./src/cart-drawer/cross-sell-sidebar.tsx",
122
- "./cart-drawer/cross-sell-carousel": "./src/cart-drawer/cross-sell-carousel.tsx",
123
- "./cart-drawer/summary-breakdown": "./src/cart-drawer/summary-breakdown.tsx",
124
- "./cart-drawer/sticky-footer": "./src/cart-drawer/sticky-footer.tsx",
125
- "./cart-drawer/payment-badges": "./src/cart-drawer/payment-badges.tsx",
126
- "./cart-drawer/continue-shopping": "./src/cart-drawer/continue-shopping.tsx",
127
- "./cart-drawer/empty": "./src/cart-drawer/empty.tsx",
128
- "./cart-drawer/template": "./src/cart-drawer/template.tsx",
129
- "./products": "./src/products/index.ts",
130
- "./products/context": "./src/products/context.tsx",
131
- "./products/labels": "./src/products/labels.ts",
132
- "./products/labels-bg": "./src/products/labels-bg.ts",
133
- "./products/thumbnail": "./src/products/thumbnail.tsx",
134
- "./products/preview-price": "./src/products/preview-price.tsx",
135
- "./products/product-price": "./src/products/product-price.tsx",
136
- "./products/option-select": "./src/products/option-select.tsx",
137
- "./products/image-gallery": "./src/products/image-gallery.tsx",
138
- "./products/product-actions": "./src/products/product-actions.tsx",
139
- "./products/mobile-actions": "./src/products/mobile-actions.tsx",
140
- "./products/product-tabs": "./src/products/product-tabs.tsx",
141
- "./products/product-info": "./src/products/product-info.tsx",
142
- "./products/product-preview": "./src/products/product-preview.tsx",
143
- "./products/related-products": "./src/products/related-products.tsx",
144
- "./products/product-actions-wrapper": "./src/products/product-actions-wrapper.tsx",
145
- "./products/product-template": "./src/products/product-template.tsx",
146
- "./store": "./src/store/index.ts",
147
- "./store/labels": "./src/store/labels.ts",
148
- "./store/labels-bg": "./src/store/labels-bg.ts",
149
- "./store/pagination": "./src/store/pagination.tsx",
150
- "./store/sort-select": "./src/store/sort-select.tsx",
151
- "./store/paginated-products": "./src/store/paginated-products.tsx",
152
- "./store/skeleton-product-grid": "./src/store/skeleton-product-grid.tsx",
153
- "./store/store-template": "./src/store/store-template.tsx",
154
- "./store/collection-template": "./src/store/collection-template.tsx",
155
- "./store/category-template": "./src/store/category-template.tsx",
156
- "./store/search-template": "./src/store/search-template.tsx",
157
- "./order": "./src/order/index.ts",
158
- "./order/context": "./src/order/context.tsx",
159
- "./order/labels": "./src/order/labels.ts",
160
- "./order/labels-bg": "./src/order/labels-bg.ts",
161
- "./order/order-confirmation-header": "./src/order/order-confirmation-header.tsx",
162
- "./order/order-item": "./src/order/order-item.tsx",
163
- "./order/order-items-list": "./src/order/order-items-list.tsx",
164
- "./order/order-totals": "./src/order/order-totals.tsx",
165
- "./order/order-address-card": "./src/order/order-address-card.tsx",
166
- "./order/order-delivery-card": "./src/order/order-delivery-card.tsx",
167
- "./order/order-payment-card": "./src/order/order-payment-card.tsx",
168
- "./order/order-timeline": "./src/order/order-timeline.tsx",
169
- "./order/order-help-section": "./src/order/order-help-section.tsx",
170
- "./order/order-completed-template": "./src/order/order-completed-template.tsx",
171
- "./common": "./src/common/index.ts",
172
- "./common/localized-link": "./src/common/localized-link.tsx",
173
- "./common/cart-button": "./src/common/cart-button.tsx",
174
- "./common/cart-button-client": "./src/common/cart-button-client.tsx",
175
- "./common/delete-button": "./src/common/delete-button.tsx",
176
- "./common/country-select": "./src/common/country-select.tsx",
177
- "./common/language-select": "./src/common/language-select.tsx",
178
- "./common/skeleton": "./src/common/skeleton.tsx",
179
- "./reviews-ui": "./src/reviews-ui/index.ts"
180
- },
181
- "dependencies": {
182
- "@stripe/react-stripe-js": "^6.1.0",
183
- "@stripe/stripe-js": "^9.1.0",
184
- "@radix-ui/react-dropdown-menu": "^2.1.16",
185
- "@radix-ui/react-accordion": "^1.2.12",
186
- "@radix-ui/react-collapsible": "^1.1.12",
187
- "@radix-ui/react-dialog": "^1.1.15",
188
- "@radix-ui/react-label": "^2.1.8",
189
- "@radix-ui/react-popover": "^1.1.15",
190
- "@radix-ui/react-select": "^2.2.6",
191
- "@radix-ui/react-slot": "^1.2.4",
192
- "@radix-ui/react-tabs": "^1.1.13",
193
- "class-variance-authority": "^0.7.1",
194
- "clsx": "^2.1.1",
195
- "lucide-react": "^1.8.0",
196
- "tailwind-merge": "^3.5.0"
197
- },
198
- "scripts": {
199
- "typecheck": "tsc --noEmit"
200
- },
201
- "peerDependencies": {
202
- "next": "^16.0.0",
203
- "react": "^19.0.0",
204
- "react-dom": "^19.0.0"
205
- },
206
- "peerDependenciesMeta": {
207
- "next": {
208
- "optional": true
209
- },
210
- "react": {
211
- "optional": true
212
- },
213
- "react-dom": {
214
- "optional": true
215
- }
216
- },
217
- "devDependencies": {
218
- "@types/node": "^20",
219
- "@types/react": "^19",
220
- "@types/react-dom": "^19",
221
- "typescript": "^5"
222
- },
223
- "engines": {
224
- "node": ">=20"
225
- }
226
- }
1
+ {
2
+ "name": "@cartbase/storefront",
3
+ "version": "0.2.0",
4
+ "description": "Storefront SDK + UI component library for Cartbase stores: typed API client, checkout orchestration, cart drawer, product/catalog components, tracking. Source-shipped TypeScript — add it to transpilePackages.",
5
+ "license": "MIT",
6
+ "repository": {
7
+ "type": "git",
8
+ "url": "git+https://github.com/1click-so/barter.git",
9
+ "directory": "packages/storefront"
10
+ },
11
+ "type": "module",
12
+ "sideEffects": false,
13
+ "files": [
14
+ "src",
15
+ "README.md",
16
+ "tailwind-preset.cjs"
17
+ ],
18
+ "exports": {
19
+ ".": "./src/index.ts",
20
+ "./api": "./src/api/index.ts",
21
+ "./api/http": "./src/api/http.ts",
22
+ "./api/types": "./src/api/types.ts",
23
+ "./api/products": "./src/api/products.ts",
24
+ "./api/collections": "./src/api/collections.ts",
25
+ "./api/categories": "./src/api/categories.ts",
26
+ "./api/regions": "./src/api/regions.ts",
27
+ "./api/carts": "./src/api/carts.ts",
28
+ "./api/gift-cards": "./src/api/gift-cards.ts",
29
+ "./api/checkout": "./src/api/checkout.ts",
30
+ "./api/orders": "./src/api/orders.ts",
31
+ "./api/customers": "./src/api/customers.ts",
32
+ "./api/auth": "./src/api/auth.ts",
33
+ "./api/content": "./src/api/content.ts",
34
+ "./api/menus": "./src/api/menus.ts",
35
+ "./api/metaobjects": "./src/api/metaobjects.ts",
36
+ "./api/reviews": "./src/api/reviews.ts",
37
+ "./api/search": "./src/api/search.ts",
38
+ "./api/integrations": "./src/api/integrations.ts",
39
+ "./api/consent": "./src/api/consent.ts",
40
+ "./api/redirects": "./src/api/redirects.ts",
41
+ "./tailwind-preset": "./tailwind-preset.cjs",
42
+ "./lib/utils": "./src/lib/utils.ts",
43
+ "./lib/money": "./src/lib/money.ts",
44
+ "./lib/cart-helpers": "./src/lib/cart-helpers.ts",
45
+ "./lib/get-product-price": "./src/lib/get-product-price.ts",
46
+ "./lib/get-percentage-diff": "./src/lib/get-percentage-diff.ts",
47
+ "./lib/product": "./src/lib/product.ts",
48
+ "./lib/sort-products": "./src/lib/sort-products.ts",
49
+ "./lib/dual-price": "./src/lib/dual-price.tsx",
50
+ "./lib/payment-constants": "./src/lib/payment-constants.ts",
51
+ "./lib/store-api-error": "./src/lib/store-api-error.ts",
52
+ "./lib/hooks/use-intersection": "./src/lib/hooks/use-intersection.ts",
53
+ "./lib/hooks/use-toggle-state": "./src/lib/hooks/use-toggle-state.ts",
54
+ "./lib/cookie-names": "./src/lib/cookie-names.ts",
55
+ "./platform": "./src/platform/index.ts",
56
+ "./platform/identity": "./src/platform/identity.ts",
57
+ "./platform/metadata": "./src/platform/metadata.ts",
58
+ "./platform/platform-init": "./src/platform/platform-init.tsx",
59
+ "./primitives/field": "./src/primitives/field.tsx",
60
+ "./primitives/select-field": "./src/primitives/select-field.tsx",
61
+ "./primitives/ui/accordion": "./src/primitives/ui/accordion.tsx",
62
+ "./primitives/ui/button": "./src/primitives/ui/button.tsx",
63
+ "./primitives/ui/collapsible": "./src/primitives/ui/collapsible.tsx",
64
+ "./primitives/ui/dialog": "./src/primitives/ui/dialog.tsx",
65
+ "./primitives/ui/input": "./src/primitives/ui/input.tsx",
66
+ "./primitives/ui/label": "./src/primitives/ui/label.tsx",
67
+ "./primitives/ui/popover": "./src/primitives/ui/popover.tsx",
68
+ "./primitives/ui/select": "./src/primitives/ui/select.tsx",
69
+ "./primitives/ui/sheet": "./src/primitives/ui/sheet.tsx",
70
+ "./primitives/ui/tabs": "./src/primitives/ui/tabs.tsx",
71
+ "./tracking": "./src/tracking/index.ts",
72
+ "./tracking/types": "./src/tracking/types.ts",
73
+ "./tracking/consent": "./src/tracking/consent.ts",
74
+ "./tracking/consent-init": "./src/tracking/consent-init.tsx",
75
+ "./tracking/consent-banner": "./src/tracking/consent-banner.tsx",
76
+ "./tracking/meta-pixel": "./src/tracking/meta-pixel.tsx",
77
+ "./tracking/ga4": "./src/tracking/ga4.tsx",
78
+ "./tracking/rybbit": "./src/tracking/rybbit.tsx",
79
+ "./tracking/rybbit-events": "./src/tracking/rybbit-events.ts",
80
+ "./tracking/fbq": "./src/tracking/fbq.ts",
81
+ "./tracking/gtag": "./src/tracking/gtag.ts",
82
+ "./tracking/attribution": "./src/tracking/attribution.ts",
83
+ "./tracking/get-tracking-config": "./src/tracking/get-tracking-config.ts",
84
+ "./tracking/get-tracking-attribution": "./src/tracking/get-tracking-attribution.ts",
85
+ "./tracking/use-engagement-time": "./src/tracking/use-engagement-time.ts",
86
+ "./checkout": "./src/checkout/index.ts",
87
+ "./checkout/context": "./src/checkout/context.tsx",
88
+ "./checkout/labels": "./src/checkout/labels.ts",
89
+ "./checkout/labels-bg": "./src/checkout/labels-bg.ts",
90
+ "./checkout/error-message": "./src/checkout/error-message.tsx",
91
+ "./checkout/stripe-wrapper": "./src/checkout/stripe-wrapper.tsx",
92
+ "./checkout/payment-wrapper": "./src/checkout/payment-wrapper.tsx",
93
+ "./checkout/payment-button": "./src/checkout/payment-button.tsx",
94
+ "./checkout/econt-office-selector": "./src/checkout/econt-office-selector.tsx",
95
+ "./checkout/boxnow-locker-selector": "./src/checkout/boxnow-locker-selector.tsx",
96
+ "./checkout/address-select": "./src/checkout/address-select.tsx",
97
+ "./checkout/company-details": "./src/checkout/company-details.tsx",
98
+ "./checkout/discount-section": "./src/checkout/discount-section.tsx",
99
+ "./checkout/gift-card-section": "./src/checkout/gift-card-section.tsx",
100
+ "./checkout/line-item-card": "./src/checkout/line-item-card.tsx",
101
+ "./checkout/order-summary": "./src/checkout/order-summary.tsx",
102
+ "./checkout/address-form": "./src/checkout/address-form.tsx",
103
+ "./checkout/shipping-method-list": "./src/checkout/shipping-method-list.tsx",
104
+ "./checkout/payment-method-list": "./src/checkout/payment-method-list.tsx",
105
+ "./checkout/checkout-client": "./src/checkout/checkout-client.tsx",
106
+ "./checkout/use-checkout-orchestration": "./src/checkout/use-checkout-orchestration.ts",
107
+ "./checkout/payment-error-copy": "./src/checkout/payment-error-copy.ts",
108
+ "./checkout/address-error-copy": "./src/checkout/address-error-copy.ts",
109
+ "./checkout/promotion-error-copy": "./src/checkout/promotion-error-copy.ts",
110
+ "./cart-drawer": "./src/cart-drawer/index.ts",
111
+ "./cart-drawer/context": "./src/cart-drawer/context.tsx",
112
+ "./cart-drawer/labels": "./src/cart-drawer/labels.ts",
113
+ "./cart-drawer/labels-bg": "./src/cart-drawer/labels-bg.ts",
114
+ "./cart-drawer/cart-drawer": "./src/cart-drawer/cart-drawer.tsx",
115
+ "./cart-drawer/header": "./src/cart-drawer/header.tsx",
116
+ "./cart-drawer/promo-banner": "./src/cart-drawer/promo-banner.tsx",
117
+ "./cart-drawer/tiered-progress": "./src/cart-drawer/tiered-progress.tsx",
118
+ "./cart-drawer/item": "./src/cart-drawer/item/index.tsx",
119
+ "./cart-drawer/item/quantity": "./src/cart-drawer/item/quantity.tsx",
120
+ "./cart-drawer/item/variant": "./src/cart-drawer/item/variant.tsx",
121
+ "./cart-drawer/item/upsell": "./src/cart-drawer/item/upsell.tsx",
122
+ "./cart-drawer/free-gift": "./src/cart-drawer/free-gift.tsx",
123
+ "./cart-drawer/gift-wrap": "./src/cart-drawer/gift-wrap.tsx",
124
+ "./cart-drawer/notes": "./src/cart-drawer/notes.tsx",
125
+ "./cart-drawer/rewards-points": "./src/cart-drawer/rewards-points.tsx",
126
+ "./cart-drawer/cross-sell-sidebar": "./src/cart-drawer/cross-sell-sidebar.tsx",
127
+ "./cart-drawer/cross-sell-carousel": "./src/cart-drawer/cross-sell-carousel.tsx",
128
+ "./cart-drawer/summary-breakdown": "./src/cart-drawer/summary-breakdown.tsx",
129
+ "./cart-drawer/sticky-footer": "./src/cart-drawer/sticky-footer.tsx",
130
+ "./cart-drawer/payment-badges": "./src/cart-drawer/payment-badges.tsx",
131
+ "./cart-drawer/continue-shopping": "./src/cart-drawer/continue-shopping.tsx",
132
+ "./cart-drawer/empty": "./src/cart-drawer/empty.tsx",
133
+ "./cart-drawer/template": "./src/cart-drawer/template.tsx",
134
+ "./products": "./src/products/index.ts",
135
+ "./products/context": "./src/products/context.tsx",
136
+ "./products/labels": "./src/products/labels.ts",
137
+ "./products/labels-bg": "./src/products/labels-bg.ts",
138
+ "./products/thumbnail": "./src/products/thumbnail.tsx",
139
+ "./products/preview-price": "./src/products/preview-price.tsx",
140
+ "./products/product-price": "./src/products/product-price.tsx",
141
+ "./products/option-select": "./src/products/option-select.tsx",
142
+ "./products/image-gallery": "./src/products/image-gallery.tsx",
143
+ "./products/product-actions": "./src/products/product-actions.tsx",
144
+ "./products/mobile-actions": "./src/products/mobile-actions.tsx",
145
+ "./products/product-tabs": "./src/products/product-tabs.tsx",
146
+ "./products/product-info": "./src/products/product-info.tsx",
147
+ "./products/product-preview": "./src/products/product-preview.tsx",
148
+ "./products/related-products": "./src/products/related-products.tsx",
149
+ "./products/product-actions-wrapper": "./src/products/product-actions-wrapper.tsx",
150
+ "./products/product-template": "./src/products/product-template.tsx",
151
+ "./store": "./src/store/index.ts",
152
+ "./store/labels": "./src/store/labels.ts",
153
+ "./store/labels-bg": "./src/store/labels-bg.ts",
154
+ "./store/pagination": "./src/store/pagination.tsx",
155
+ "./store/sort-select": "./src/store/sort-select.tsx",
156
+ "./store/paginated-products": "./src/store/paginated-products.tsx",
157
+ "./store/skeleton-product-grid": "./src/store/skeleton-product-grid.tsx",
158
+ "./store/store-template": "./src/store/store-template.tsx",
159
+ "./store/collection-template": "./src/store/collection-template.tsx",
160
+ "./store/category-template": "./src/store/category-template.tsx",
161
+ "./store/search-template": "./src/store/search-template.tsx",
162
+ "./order": "./src/order/index.ts",
163
+ "./order/context": "./src/order/context.tsx",
164
+ "./order/labels": "./src/order/labels.ts",
165
+ "./order/labels-bg": "./src/order/labels-bg.ts",
166
+ "./order/order-confirmation-header": "./src/order/order-confirmation-header.tsx",
167
+ "./order/order-item": "./src/order/order-item.tsx",
168
+ "./order/order-items-list": "./src/order/order-items-list.tsx",
169
+ "./order/order-totals": "./src/order/order-totals.tsx",
170
+ "./order/order-address-card": "./src/order/order-address-card.tsx",
171
+ "./order/order-delivery-card": "./src/order/order-delivery-card.tsx",
172
+ "./order/order-payment-card": "./src/order/order-payment-card.tsx",
173
+ "./order/order-timeline": "./src/order/order-timeline.tsx",
174
+ "./order/order-help-section": "./src/order/order-help-section.tsx",
175
+ "./order/order-completed-template": "./src/order/order-completed-template.tsx",
176
+ "./common": "./src/common/index.ts",
177
+ "./common/localized-link": "./src/common/localized-link.tsx",
178
+ "./common/cart-button": "./src/common/cart-button.tsx",
179
+ "./common/cart-button-client": "./src/common/cart-button-client.tsx",
180
+ "./common/delete-button": "./src/common/delete-button.tsx",
181
+ "./common/country-select": "./src/common/country-select.tsx",
182
+ "./common/language-select": "./src/common/language-select.tsx",
183
+ "./common/skeleton": "./src/common/skeleton.tsx",
184
+ "./reviews-ui": "./src/reviews-ui/index.ts"
185
+ },
186
+ "dependencies": {
187
+ "@stripe/react-stripe-js": "^6.1.0",
188
+ "@stripe/stripe-js": "^9.1.0",
189
+ "@radix-ui/react-dropdown-menu": "^2.1.16",
190
+ "@radix-ui/react-accordion": "^1.2.12",
191
+ "@radix-ui/react-collapsible": "^1.1.12",
192
+ "@radix-ui/react-dialog": "^1.1.15",
193
+ "@radix-ui/react-label": "^2.1.8",
194
+ "@radix-ui/react-popover": "^1.1.15",
195
+ "@radix-ui/react-select": "^2.2.6",
196
+ "@radix-ui/react-slot": "^1.2.4",
197
+ "@radix-ui/react-tabs": "^1.1.13",
198
+ "class-variance-authority": "^0.7.1",
199
+ "clsx": "^2.1.1",
200
+ "lucide-react": "^1.8.0",
201
+ "tailwind-merge": "^3.5.0"
202
+ },
203
+ "scripts": {
204
+ "typecheck": "tsc --noEmit"
205
+ },
206
+ "peerDependencies": {
207
+ "next": "^16.0.0",
208
+ "react": "^19.0.0",
209
+ "react-dom": "^19.0.0"
210
+ },
211
+ "peerDependenciesMeta": {
212
+ "next": {
213
+ "optional": true
214
+ },
215
+ "react": {
216
+ "optional": true
217
+ },
218
+ "react-dom": {
219
+ "optional": true
220
+ }
221
+ },
222
+ "devDependencies": {
223
+ "@types/node": "^20",
224
+ "@types/react": "^19",
225
+ "@types/react-dom": "^19",
226
+ "typescript": "^5"
227
+ },
228
+ "engines": {
229
+ "node": ">=20"
230
+ }
231
+ }
package/src/api/auth.ts CHANGED
@@ -20,7 +20,7 @@
20
20
  *
21
21
  * Tokens expire (`expires_in` seconds / `expires_at` epoch-seconds): refresh
22
22
  * with the Supabase client (`supabase.auth.setSession({access_token,
23
- * refresh_token})` then `refreshSession()`) — the barter API does not proxy
23
+ * refresh_token})` then `refreshSession()`) — the Cartbase API does not proxy
24
24
  * token refresh. Password login (supabase.auth.signInWithPassword
25
25
  * client-side) yields an equivalent JWT and needs nothing from this module.
26
26
  *
@@ -10,7 +10,7 @@
10
10
  * fetch — resolve the config server-side (RSC) and inline it. Render the
11
11
  * built-in banner only when `enabled && mode === "builtin"`. In `external`
12
12
  * mode the merchant's CMP owns the UI and must write the same `_1c_consent`
13
- * cookie (or call `setConsent()`) — all barter-side tag gating works off
13
+ * cookie (or call `setConsent()`) — all Cartbase-side tag gating works off
14
14
  * that one seam. Choices persist 12 months.
15
15
  */
16
16
 
@@ -45,7 +45,7 @@ export interface ConsentCopy {
45
45
  */
46
46
  export interface ConsentConfig {
47
47
  enabled: boolean
48
- /** `builtin` = barter renders the banner; `external` = merchant CMP owns UI. */
48
+ /** `builtin` = Cartbase renders the banner; `external` = merchant CMP owns UI. */
49
49
  mode: "builtin" | "external"
50
50
  /** `modal` = blocking centered modal; `banner-bottom` = non-blocking bar. */
51
51
  layout: "modal" | "banner-bottom"
@@ -10,7 +10,7 @@ import type { StorefrontClient } from "./http"
10
10
  import type { IsoDateString, ListEnvelope, PaginationQuery } from "./types"
11
11
 
12
12
  /**
13
- * A store region (`barter_commerce.regions` row). NOTE: barter regions carry
13
+ * A store region (`barter_commerce.regions` row). NOTE: Cartbase regions carry
14
14
  * NO embedded `countries` array on the store surface (divergence from
15
15
  * Medusa's Store API — tax scoping is by `tax_regions` server-side).
16
16
  */
@@ -43,7 +43,7 @@ import { defaultCartDrawerLabels, type CartDrawerLabels } from "./labels"
43
43
  * snapshot never updated past the failed mutation. See
44
44
  * https://react.dev/reference/react/useOptimistic.
45
45
  *
46
- * Ported from `@1click/ui/src/cart-drawer/context.tsx` (v2.3.1). Barter
46
+ * Ported from `@1click/ui/src/cart-drawer/context.tsx` (v2.3.1). Cartbase
47
47
  * data seam: the Medusa server actions (`../data/cart`) are replaced by
48
48
  * `@cartbase/storefront/api/carts` calls made through a `StorefrontClient`
49
49
  * passed to the provider. Every mutation returns the FULL decorated cart
@@ -54,7 +54,7 @@ import { defaultCartDrawerLabels, type CartDrawerLabels } from "./labels"
54
54
  * is unit-agnostic and unchanged).
55
55
  *
56
56
  * The source's `logEvent` ops funnel (backend error log endpoint) has no
57
- * barter SDK equivalent yet — the same single-funnel discipline is kept
57
+ * Cartbase SDK equivalent yet — the same single-funnel discipline is kept
58
58
  * via the `onOptimisticError` prop: every failed optimistic mutation
59
59
  * (every PDP add, cross-sell add, drawer remove, drawer quantity change)
60
60
  * flows through it with per-action context. Wire it to the store's ops
@@ -158,7 +158,7 @@ type CartDrawerContextValue = {
158
158
  quantity?: number,
159
159
  display?: OptimisticAddDisplay
160
160
  ) => Promise<boolean>
161
- /** POST line-items/:id with `{quantity}` — barter contract: 0 deletes. */
161
+ /** POST line-items/:id with `{quantity}` — Cartbase contract: 0 deletes. */
162
162
  updateQuantity: (lineId: string, quantity: number) => Promise<boolean>
163
163
  removeItem: (lineId: string) => Promise<boolean>
164
164
  /** Re-read the decorated cart (totals/gift-card tender are live per read). */
@@ -503,7 +503,7 @@ export function CartDrawerProvider({
503
503
  return runOptimistic(
504
504
  { type: "update_quantity", lineId, quantity },
505
505
  async () => {
506
- // Barter contract: body is `{quantity}` only (metadata is NOT
506
+ // Cartbase contract: body is `{quantity}` only (metadata is NOT
507
507
  // accepted on update, only on add); quantity 0 deletes the line.
508
508
  const res = await sdkUpdateLineItem(client, id, lineId, { quantity })
509
509
  confirm(res.cart)
@@ -14,7 +14,7 @@ import { useCartDrawer } from "./context"
14
14
  * cross-sell zone below the line items on desktop.
15
15
  *
16
16
  * Ported from `@1click/ui/src/cart-drawer/cross-sell-carousel.tsx` (v2.3.1).
17
- * Barter data seam: same as the sidebar — feed from
17
+ * Cartbase data seam: same as the sidebar — feed from
18
18
  * `@cartbase/storefront/api/products` `listProducts` or `api/search`
19
19
  * `listRelatedProducts` via `toCrossSellProduct`
20
20
  * (`./cross-sell-sidebar`; the card shapes are identical), wire `onAdd`
@@ -12,7 +12,7 @@ import { useCartDrawer } from "./context"
12
12
  * drawer's left sidebar.
13
13
  *
14
14
  * Ported from `@1click/ui/src/cart-drawer/cross-sell-sidebar.tsx` (v2.3.1).
15
- * Barter data seam: source stores fed this from Medusa product fetches —
15
+ * Cartbase data seam: source stores fed this from Medusa product fetches —
16
16
  * feed it from `@cartbase/storefront/api/products` `listProducts` (curated
17
17
  * collection/tag) or `@cartbase/storefront/api/search` `listRelatedProducts`
18
18
  * (anchor-product complements), mapped through `toCrossSellProduct` below.