@ecomiq/storefront 2.1.4 → 3.0.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 (310) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +150 -103
  3. package/dist/account-Dx4e3syi.js +258 -0
  4. package/dist/account-forms-AVk71ko7.js +39 -0
  5. package/dist/account-forms.d.ts +13 -0
  6. package/dist/account.d.ts +240 -0
  7. package/dist/address-defaults-BqjRhS82.js +14 -0
  8. package/dist/address-defaults.d.ts +11 -0
  9. package/dist/analytics/analytics-CG1Qagwl.js +148 -0
  10. package/dist/analytics/analytics.d.ts +1 -0
  11. package/dist/analytics/config-DJr-GRhs.js +62 -0
  12. package/dist/analytics/config.d.ts +22 -0
  13. package/dist/analytics/consent-B13rBpBs.js +57 -0
  14. package/dist/analytics/consent-banner-9QvRRy8v.js +239 -0
  15. package/dist/analytics/consent-banner.d.ts +20 -0
  16. package/dist/analytics/cookies-pLozllyB.js +100 -0
  17. package/dist/analytics/cookies.d.ts +6 -0
  18. package/dist/analytics/destinations-iECrlLIr.js +144 -0
  19. package/dist/analytics/events-Dt81tIp1.js +102 -0
  20. package/dist/analytics/events.d.ts +51 -0
  21. package/dist/analytics/tracker-p4yaoOyk.js +51 -0
  22. package/dist/api-cache-DsuIn5hX.js +159 -0
  23. package/dist/bank-accounts-DlEczQQ5.js +81 -0
  24. package/dist/bank-accounts.d.ts +4 -0
  25. package/dist/captcha-DAqaIx8m.js +117 -0
  26. package/dist/captcha.d.ts +34 -0
  27. package/dist/cart-D7DxZ2lD.js +30 -0
  28. package/dist/cart-actions-Bsub_FFG.js +116 -0
  29. package/dist/cart-actions.d.ts +15 -0
  30. package/dist/cart-drawer-B7PPsR69.js +22 -0
  31. package/dist/cart-drawer.d.ts +9 -0
  32. package/dist/cart-form-y9P1r_EX.js +81 -0
  33. package/dist/cart-form.d.ts +24 -0
  34. package/dist/cart-summary-ur2VWKr-.js +89 -0
  35. package/dist/cart-summary.d.ts +31 -0
  36. package/dist/cart.d.ts +4 -0
  37. package/dist/catalog-7gJ-l5hW.js +67 -0
  38. package/dist/catalog-hooks-B7ZP4wYY.js +312 -0
  39. package/dist/catalog-hooks.d.ts +111 -0
  40. package/dist/catalog.d.ts +5 -0
  41. package/dist/checkout-DVWSXANi.js +474 -0
  42. package/dist/checkout-form-CbOIdENC.js +131 -0
  43. package/dist/checkout-form.d.ts +20 -0
  44. package/dist/checkout.d.ts +86 -0
  45. package/dist/complaint-book-BvwLvfx0.js +117 -0
  46. package/dist/complaint-book.d.ts +62 -0
  47. package/dist/culqi-authentication-BGr20vAJ.js +204 -0
  48. package/dist/culqi-authentication.d.ts +15 -0
  49. package/dist/culqi-checkout-CTXpKgp_.js +55 -0
  50. package/dist/culqi-three-ds-HP3mfrvV.js +33 -0
  51. package/dist/culqi-three-ds.d.ts +29 -0
  52. package/dist/customer-avatar-CJXSDroK.js +12 -0
  53. package/dist/customer-avatar.d.ts +5 -0
  54. package/dist/customer-cookies-DHOgFAMV.js +45 -0
  55. package/dist/customer-csrf-C1oDX-Py.js +17 -0
  56. package/dist/customer-csrf.d.ts +3 -0
  57. package/dist/customer-document-fields-C1K-_DAD.js +70 -0
  58. package/dist/customer-document-fields.d.ts +9 -0
  59. package/dist/customer-login-form-C7AC6vXd.js +144 -0
  60. package/dist/customer-login-form.d.ts +17 -0
  61. package/dist/customer-registration-form-BEm_NEfP.js +93 -0
  62. package/dist/customer-registration-form.d.ts +8 -0
  63. package/dist/document-url-CGsAl5Tf.js +9 -0
  64. package/dist/documents-T1mzc_j8.js +38 -0
  65. package/dist/documents.d.ts +16 -0
  66. package/dist/entries/account.d.ts +11 -0
  67. package/dist/entries/account.js +10 -0
  68. package/dist/entries/analytics.d.ts +6 -0
  69. package/dist/entries/analytics.js +5 -0
  70. package/dist/entries/cart.d.ts +8 -0
  71. package/dist/entries/cart.js +7 -0
  72. package/dist/entries/checkout.d.ts +12 -0
  73. package/dist/entries/checkout.js +11 -0
  74. package/dist/entries/order.d.ts +11 -0
  75. package/dist/entries/order.js +11 -0
  76. package/dist/favicon-YpyhVJ9H.js +28 -0
  77. package/dist/favicon.d.ts +4 -0
  78. package/dist/form-BtQcbXlJ.js +18 -0
  79. package/dist/form-contracts-BNpHaTGJ.js +166 -0
  80. package/dist/form-contracts.d.ts +42 -0
  81. package/dist/form.d.ts +3 -0
  82. package/dist/hidden-CCWtOWKR.js +3 -0
  83. package/dist/hidden.d.ts +4 -0
  84. package/dist/index.d.ts +50 -0
  85. package/dist/index.js +50 -0
  86. package/dist/invoice-fields-BG0HjL6T.js +103 -0
  87. package/dist/invoice-fields.d.ts +39 -0
  88. package/dist/links-kFxBZfdb.js +96 -0
  89. package/dist/links.d.ts +21 -0
  90. package/dist/mercadopago-checkout-DC7RXa8k.js +27 -0
  91. package/dist/mercadopago-dialog-UTQev0MG.js +180 -0
  92. package/dist/mercadopago-dialog.d.ts +21 -0
  93. package/dist/money-DtGOtDri.js +32 -0
  94. package/dist/money.d.ts +1 -0
  95. package/dist/optimistic-cart-BveVOHuh.js +53 -0
  96. package/dist/optimistic-cart.d.ts +16 -0
  97. package/dist/order-display-DTt5WBbc.js +112 -0
  98. package/dist/order-display.d.ts +20 -0
  99. package/dist/order-draft-DxV1Uhm3.js +38 -0
  100. package/dist/order-draft.d.ts +16 -0
  101. package/dist/order-pages-Dm6l5m0m.js +38 -0
  102. package/dist/order-pages.d.ts +12 -0
  103. package/dist/order-payment-continuation-D_d5PGA4.js +212 -0
  104. package/dist/order-payment-continuation.d.ts +10 -0
  105. package/dist/order-payment-in-review-x4gdLFHZ.js +65 -0
  106. package/dist/order-payment-in-review.d.ts +5 -0
  107. package/dist/order-status-BJXLJwxq.js +162 -0
  108. package/dist/order-status.d.ts +89 -0
  109. package/dist/order-view-9IlBg5AF.js +62 -0
  110. package/dist/order-view.d.ts +12 -0
  111. package/dist/page-action-Ctkf4xC6.js +7 -0
  112. package/dist/page-seo-a5FJl8x5.js +262 -0
  113. package/dist/page-seo.d.ts +34 -0
  114. package/dist/pages-Ca_Gt6mq.js +150 -0
  115. package/dist/pages.d.ts +45 -0
  116. package/dist/payment-dialog-frame-B-Q_xQ94.js +57 -0
  117. package/dist/payment-logo-BoPaGJc_.js +46 -0
  118. package/dist/payment-logo-svgs-By9lDTLK.js +20 -0
  119. package/dist/payment-logo.d.ts +11 -0
  120. package/dist/payment-logos-BYvdwYyJ.js +23 -0
  121. package/dist/payment-methods-B8ocTgFZ.js +73 -0
  122. package/dist/payment-methods.d.ts +58 -0
  123. package/dist/payment-return-5cjypwIw.js +7 -0
  124. package/dist/place-CmW4hBWY.js +13 -0
  125. package/dist/place.d.ts +4 -0
  126. package/dist/preview-BiIBif3C.js +427 -0
  127. package/dist/preview-address-Cf0sJ-9p.js +21 -0
  128. package/dist/preview-cart-Dg2CVktS.js +376 -0
  129. package/dist/product-preview-BspMAecJ.js +51 -0
  130. package/dist/product-preview.d.ts +5 -0
  131. package/dist/product-variants-BNDHvs1y.js +46 -0
  132. package/dist/product-variants.d.ts +12 -0
  133. package/dist/public-pages-XtwlaLwt.js +194 -0
  134. package/dist/public-pages.d.ts +67 -0
  135. package/dist/registration-CpDcv8ql.js +91 -0
  136. package/dist/registration.d.ts +12 -0
  137. package/dist/request-security-CRsRMgwj.js +76 -0
  138. package/dist/rich-text-M-Ju8RL4.js +9 -0
  139. package/dist/rich-text.d.ts +5 -0
  140. package/dist/route-text-DcJw2SsK.js +9 -0
  141. package/dist/route-text.d.ts +4 -0
  142. package/dist/section-preview-CmsMl3yu.js +83 -0
  143. package/dist/section-preview.d.ts +12 -0
  144. package/dist/sections/account-addresses.d.ts +18 -0
  145. package/dist/sections/account-addresses.js +375 -0
  146. package/dist/sections/account-order.d.ts +12 -0
  147. package/dist/sections/account-order.js +592 -0
  148. package/dist/sections/account-orders.d.ts +8 -0
  149. package/dist/sections/account-orders.js +359 -0
  150. package/dist/sections/account-profile.d.ts +16 -0
  151. package/dist/sections/account-profile.js +123 -0
  152. package/dist/sections/checkout.d.ts +24 -0
  153. package/dist/sections/checkout.js +963 -0
  154. package/dist/sections/complaint-book.d.ts +8 -0
  155. package/dist/sections/complaint-book.js +538 -0
  156. package/dist/sections/design-system.d.ts +1 -0
  157. package/dist/sections/design-system.js +310 -0
  158. package/dist/sections/draft-invoice.d.ts +20 -0
  159. package/dist/sections/draft-invoice.js +158 -0
  160. package/dist/sections/order-tracking.d.ts +19 -0
  161. package/dist/sections/order-tracking.js +141 -0
  162. package/dist/sections-CNUMWTF_.js +77 -0
  163. package/dist/sections.d.ts +19 -0
  164. package/dist/seo-GpDRhAAA.js +78 -0
  165. package/dist/session-CKvmFJyg.js +379 -0
  166. package/dist/session.d.ts +24 -0
  167. package/dist/settings-B0NO2A6Y.js +78 -0
  168. package/dist/settings.d.ts +51 -0
  169. package/dist/source-marker-DhqSkW7n.js +4 -0
  170. package/dist/sources-B-3JFJfb.js +46 -0
  171. package/dist/sources.d.ts +7 -0
  172. package/dist/store-8Q-_LFrQ.js +152 -0
  173. package/dist/store-contact--hY6CoFb.js +19 -0
  174. package/dist/store-contact.d.ts +6 -0
  175. package/dist/store.d.ts +17 -0
  176. package/dist/storefront-language-DrMjVbmk.js +29 -0
  177. package/dist/storefront-language.d.ts +14 -0
  178. package/dist/storefront-text-D25ae1qf.js +11 -0
  179. package/dist/storefront-text-en-ljjjSS4q.js +1030 -0
  180. package/dist/storefront-text-pt-BtHaJLcp.js +1030 -0
  181. package/dist/storefront-text.d.ts +4 -0
  182. package/dist/stripe-dialog-Ev9s3Z62.js +396 -0
  183. package/dist/stripe-dialog.d.ts +30 -0
  184. package/dist/telemetry-HuZXWBPi.js +114 -0
  185. package/dist/telemetry.d.ts +10 -0
  186. package/dist/templates-CAqoNyTW.js +40 -0
  187. package/dist/templates.d.ts +15 -0
  188. package/dist/urls-CpGQPxvf.js +71 -0
  189. package/dist/urls.d.ts +18 -0
  190. package/dist/use-checkout-CZcxXJXi.js +42 -0
  191. package/dist/use-checkout-payment-9R-zacrJ.js +80 -0
  192. package/dist/use-checkout-payment.d.ts +18 -0
  193. package/dist/use-checkout.d.ts +36 -0
  194. package/dist/use-culqi-checkout-CrjLAipU.js +109 -0
  195. package/dist/use-order-payment-BKIz_IO0.js +45 -0
  196. package/dist/use-order-payment.d.ts +18 -0
  197. package/dist/use-payment-token-CErx-tN-.js +105 -0
  198. package/dist/vite-payment-logos-kziu7wKb.js +27 -0
  199. package/dist/vite-payment-logos.d.ts +24 -0
  200. package/dist/vite-public-assets-DW2fgtVb.js +209 -0
  201. package/dist/vite-public-assets.d.ts +29 -0
  202. package/dist/vite-sections-DTBr0-Kg.js +464 -0
  203. package/dist/vite-sections.d.ts +21 -0
  204. package/dist/vite-theme-ui-BMO-CDi3.js +41 -0
  205. package/dist/vite-theme-ui.d.ts +10 -0
  206. package/dist/vite.d.ts +36 -0
  207. package/dist/vite.js +127 -0
  208. package/dist/voucher-payment-CVFDZ1L8.js +66 -0
  209. package/dist/worker-CNi-gzCu.js +86 -0
  210. package/dist/worker.d.ts +27 -0
  211. package/package.json +100 -76
  212. package/src/sections/account-addresses.tsx +215 -0
  213. package/src/sections/account-order.tsx +424 -0
  214. package/src/sections/account-orders.tsx +259 -0
  215. package/src/sections/account-profile.tsx +70 -0
  216. package/src/sections/checkout.tsx +586 -0
  217. package/src/sections/complaint-book.tsx +325 -0
  218. package/src/sections/design-system.tsx +146 -0
  219. package/src/sections/draft-invoice.tsx +105 -0
  220. package/src/sections/order-tracking.tsx +81 -0
  221. package/src/vite-client.d.ts +4 -0
  222. package/bin/ecomiq.mjs +0 -179
  223. package/public/design-bridge.js +0 -318
  224. package/src/api-proxy.ts +0 -194
  225. package/src/auth/create-storefront-auth.ts +0 -94
  226. package/src/auth/ecomiq-oauth-password-client.ts +0 -26
  227. package/src/auth/ecomiq-oauth-password-constants.ts +0 -24
  228. package/src/auth/ecomiq-oauth-password-plugin.ts +0 -294
  229. package/src/auth/ecomiq-oauth-password-types.ts +0 -24
  230. package/src/auth/ecomiq-storefront-sign-in.ts +0 -44
  231. package/src/auth/env.ts +0 -7
  232. package/src/auth/secure-cookies.ts +0 -23
  233. package/src/auth/storefront-auth-base-url.ts +0 -117
  234. package/src/auth/storefront-auth.ts +0 -7
  235. package/src/cart-session.ts +0 -239
  236. package/src/client.ts +0 -48
  237. package/src/codegen.mjs +0 -801
  238. package/src/components/account/customer-addresses-panel.tsx +0 -678
  239. package/src/components/account/customer-order-detail-panel.tsx +0 -285
  240. package/src/components/account/customer-orders-panel.tsx +0 -192
  241. package/src/components/account/customer-profile-panel.tsx +0 -379
  242. package/src/components/checkout/cart-sync.ts +0 -143
  243. package/src/components/checkout/checkout-contact-section.tsx +0 -76
  244. package/src/components/checkout/checkout-external-update-banner.tsx +0 -15
  245. package/src/components/checkout/checkout-form-controls.tsx +0 -139
  246. package/src/components/checkout/checkout-line-items.tsx +0 -43
  247. package/src/components/checkout/checkout-order-summary.tsx +0 -165
  248. package/src/components/checkout/checkout-payment-section.tsx +0 -212
  249. package/src/components/checkout/checkout-session-view.tsx +0 -564
  250. package/src/components/checkout/checkout-shipping-address-section.tsx +0 -400
  251. package/src/components/checkout/checkout-shipping-section.tsx +0 -98
  252. package/src/components/checkout/checkout-states.tsx +0 -73
  253. package/src/components/checkout/checkout-step-card.tsx +0 -101
  254. package/src/components/checkout/checkout-steps.ts +0 -111
  255. package/src/components/checkout/form-schema.ts +0 -281
  256. package/src/components/checkout/format.ts +0 -15
  257. package/src/components/checkout/index.ts +0 -5
  258. package/src/components/checkout/map-customer-to-checkout.ts +0 -188
  259. package/src/components/checkout/types.ts +0 -41
  260. package/src/components/checkout/use-checkout-customer-prefill.ts +0 -409
  261. package/src/components/checkout/use-checkout-geo.ts +0 -50
  262. package/src/components/checkout/use-checkout-session.ts +0 -640
  263. package/src/components/hero.tsx +0 -291
  264. package/src/config.d.ts +0 -94
  265. package/src/config.mjs +0 -146
  266. package/src/format-money.ts +0 -31
  267. package/src/health.ts +0 -90
  268. package/src/hooks/index.ts +0 -9
  269. package/src/hooks/recently-viewed.ts +0 -125
  270. package/src/index.ts +0 -349
  271. package/src/link.tsx +0 -2
  272. package/src/pages/account/account-page-skeleton.tsx +0 -69
  273. package/src/pages/account/account-page-view.tsx +0 -270
  274. package/src/pages/account/account-shell.tsx +0 -101
  275. package/src/pages/account/parse-account-route.ts +0 -36
  276. package/src/pages/account.tsx +0 -16
  277. package/src/pages/api.$.ts +0 -20
  278. package/src/pages/api.auth.$.ts +0 -16
  279. package/src/pages/checkout.$checkoutId.tsx +0 -60
  280. package/src/pages/checkout.tsx +0 -31
  281. package/src/pages/pages.$pageSlug.tsx +0 -74
  282. package/src/pages/thank-you.tsx +0 -53
  283. package/src/providers/auth.tsx +0 -96
  284. package/src/providers/cart.tsx +0 -275
  285. package/src/providers/ecomiq.ts +0 -137
  286. package/src/providers/index.ts +0 -26
  287. package/src/proxy-api.ts +0 -20
  288. package/src/public-config.ts +0 -24
  289. package/src/review-submission.ts +0 -89
  290. package/src/runtime/context.ts +0 -2
  291. package/src/runtime/default-layout.tsx +0 -64
  292. package/src/runtime/head.ts +0 -149
  293. package/src/runtime/page.tsx +0 -143
  294. package/src/runtime/postcss-browser-stub.mjs +0 -5
  295. package/src/server-config-store.ts +0 -35
  296. package/src/server.ts +0 -286
  297. package/src/styles.css +0 -76
  298. package/src/ui/badge.tsx +0 -32
  299. package/src/ui/button.tsx +0 -31
  300. package/src/ui/card.tsx +0 -31
  301. package/src/ui/carousel.tsx +0 -218
  302. package/src/ui/cn.ts +0 -6
  303. package/src/ui/index.ts +0 -8
  304. package/src/ui/separator.tsx +0 -6
  305. package/src/ui/skeleton.tsx +0 -6
  306. package/src/ui/storefront-error.tsx +0 -49
  307. package/src/utils.ts +0 -36
  308. package/src/vite-inline.mjs +0 -263
  309. package/templates/__root.tsx +0 -83
  310. package/templates/router.tsx +0 -19
@@ -0,0 +1,359 @@
1
+ import { money } from "../money-DtGOtDri.js";
2
+ import { useStorefrontLocale, useStorefrontText } from "../storefront-language-DrMjVbmk.js";
3
+ import { PayButton, PaymentPreview, ReorderButton, useOrderHeadline, useOrderStepDetail } from "../order-display-DTt5WBbc.js";
4
+ import { mainPayment, orderStepLabel, orderStepOf } from "../order-view-9IlBg5AF.js";
5
+ import { orderFiltersQuery } from "../account-Dx4e3syi.js";
6
+ import { useOrderPages } from "../order-pages-Dm6l5m0m.js";
7
+ import { Form, Link, useLocation, useNavigate } from "react-router";
8
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
9
+ import { Button } from "@theme/ui/button";
10
+ import { Input } from "@theme/ui/input";
11
+ import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "@theme/ui/select";
12
+ // src/sections/account-orders.tsx
13
+ const catalog = {
14
+ name: "Mis pedidos",
15
+ description: "Pedidos del cliente con búsqueda, filtros, estado y pago."
16
+ };
17
+ const STATUSES = [
18
+ {
19
+ value: null,
20
+ label: "Todos"
21
+ },
22
+ {
23
+ value: "open",
24
+ label: "En curso"
25
+ },
26
+ {
27
+ value: "delivered",
28
+ label: "Entregados"
29
+ },
30
+ {
31
+ value: "cancelled",
32
+ label: "Cancelados"
33
+ }
34
+ ];
35
+ function Collage({ items }) {
36
+ const shown = items.slice(0, 4);
37
+ const hidden = items.length - shown.length;
38
+ const tile = (index) => {
39
+ if (shown.length === 1) return "col-span-2 row-span-2";
40
+ if (shown.length === 2) return "row-span-2";
41
+ if (shown.length === 3 && index === 0) return "row-span-2";
42
+ return "";
43
+ };
44
+ return /* @__PURE__ */ jsxs("div", {
45
+ className: "grid aspect-[5/4] grid-cols-2 grid-rows-2 gap-1 overflow-hidden rounded-md",
46
+ children: [shown.map((item, index) => /* @__PURE__ */ jsxs("span", {
47
+ className: `relative min-h-0 overflow-hidden bg-muted ${tile(index)}`,
48
+ children: [item.thumbnail ? /* @__PURE__ */ jsx("img", {
49
+ src: item.thumbnail,
50
+ alt: "",
51
+ loading: "lazy",
52
+ decoding: "async",
53
+ className: "size-full object-cover"
54
+ }) : null, hidden > 0 && index === shown.length - 1 ? /* @__PURE__ */ jsxs("span", {
55
+ className: "absolute inset-0 flex items-center justify-center bg-foreground/55 text-lg font-semibold text-background",
56
+ children: ["+", hidden + 1]
57
+ }) : null]
58
+ }, item.id)), shown.length === 0 ? /* @__PURE__ */ jsx("span", { className: "col-span-2 row-span-2 bg-muted" }) : null]
59
+ });
60
+ }
61
+ function Thumbnails({ items }) {
62
+ const shown = items.slice(0, 4);
63
+ const hidden = items.length - shown.length;
64
+ const size = items.length <= 2 ? "size-24 sm:size-28" : "size-16";
65
+ return /* @__PURE__ */ jsx("div", {
66
+ className: "flex gap-2",
67
+ children: shown.map((item, index) => /* @__PURE__ */ jsxs("span", {
68
+ className: `relative shrink-0 overflow-hidden rounded-md border bg-muted ${size}`,
69
+ children: [item.thumbnail ? /* @__PURE__ */ jsx("img", {
70
+ src: item.thumbnail,
71
+ alt: "",
72
+ loading: "lazy",
73
+ decoding: "async",
74
+ className: "size-full object-cover"
75
+ }) : null, hidden > 0 && index === shown.length - 1 ? /* @__PURE__ */ jsxs("span", {
76
+ className: "absolute inset-0 flex items-center justify-center bg-foreground/55 text-sm font-semibold text-background",
77
+ children: ["+", hidden + 1]
78
+ }) : null]
79
+ }, item.id))
80
+ });
81
+ }
82
+ function OrderCard({ order }) {
83
+ const storefrontTranslate = useStorefrontText();
84
+ const { locale } = useStorefrontLocale();
85
+ const stepDetail = useOrderStepDetail();
86
+ const step = orderStepOf(order);
87
+ const detail = stepDetail(step, order.items);
88
+ const payment = mainPayment(order.payments);
89
+ const units = order.items.reduce((sum, item) => sum + item.quantity, 0);
90
+ return /* @__PURE__ */ jsxs(Link, {
91
+ to: `/account/orders/${order.orderId}`,
92
+ className: "group flex h-full flex-col gap-4 rounded-lg border bg-card p-4 text-card-foreground",
93
+ children: [
94
+ /* @__PURE__ */ jsxs("div", {
95
+ className: "flex flex-col gap-0.5",
96
+ children: [/* @__PURE__ */ jsx("p", {
97
+ className: `font-heading text-xl ${step === "cancelled" ? "text-muted-foreground" : ""}`,
98
+ children: storefrontTranslate(orderStepLabel(step))
99
+ }), detail === null ? null : /* @__PURE__ */ jsx("p", {
100
+ className: "text-sm text-muted-foreground",
101
+ children: detail
102
+ })]
103
+ }),
104
+ /* @__PURE__ */ jsx(Collage, { items: order.items }),
105
+ /* @__PURE__ */ jsxs("div", {
106
+ className: "mt-auto grid grid-cols-[minmax(0,1fr)_auto] gap-x-4 gap-y-1 text-sm",
107
+ children: [
108
+ /* @__PURE__ */ jsx("p", {
109
+ className: "font-medium group-hover:underline",
110
+ children: storefrontTranslate("Pedido {value0}", { value0: order.orderNumber })
111
+ }),
112
+ /* @__PURE__ */ jsx("p", {
113
+ className: "text-right font-medium tabular-nums",
114
+ children: money(order.total, order.currencyCode, locale)
115
+ }),
116
+ /* @__PURE__ */ jsx("p", {
117
+ className: "text-muted-foreground",
118
+ children: units === 1 ? storefrontTranslate("1 producto") : storefrontTranslate("{value0} productos", { value0: units })
119
+ }),
120
+ payment ? /* @__PURE__ */ jsx(PaymentPreview, {
121
+ payment,
122
+ className: "justify-end text-muted-foreground"
123
+ }) : null
124
+ ]
125
+ })
126
+ ]
127
+ });
128
+ }
129
+ function OrderListCard({ order }) {
130
+ const storefrontTranslate = useStorefrontText();
131
+ const { locale } = useStorefrontLocale();
132
+ const headline = useOrderHeadline();
133
+ const payment = mainPayment(order.payments);
134
+ return /* @__PURE__ */ jsxs("div", {
135
+ className: "relative flex flex-col gap-4 rounded-lg border bg-card p-4 text-card-foreground transition-colors hover:border-foreground/30 sm:p-5",
136
+ children: [/* @__PURE__ */ jsx(Thumbnails, { items: order.items }), /* @__PURE__ */ jsxs("div", {
137
+ className: "flex flex-wrap items-end justify-between gap-x-4 gap-y-3",
138
+ children: [/* @__PURE__ */ jsxs("div", {
139
+ className: "flex min-w-0 flex-col gap-1",
140
+ children: [/* @__PURE__ */ jsx(Link, {
141
+ to: `/account/orders/${order.orderId}`,
142
+ className: `font-heading text-lg after:absolute after:inset-0 after:rounded-lg ${orderStepOf(order) === "cancelled" ? "text-muted-foreground" : ""}`,
143
+ children: headline(order)
144
+ }), /* @__PURE__ */ jsxs("p", {
145
+ className: "flex flex-wrap items-center gap-x-1.5 text-sm text-muted-foreground",
146
+ children: [
147
+ /* @__PURE__ */ jsx("span", { children: storefrontTranslate("Pedido {value0}", { value0: order.orderNumber }) }),
148
+ /* @__PURE__ */ jsx("span", {
149
+ "aria-hidden": "true",
150
+ children: "·"
151
+ }),
152
+ /* @__PURE__ */ jsx("span", { children: money(order.total, order.currencyCode, locale) }),
153
+ payment ? /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("span", {
154
+ "aria-hidden": "true",
155
+ children: "·"
156
+ }), /* @__PURE__ */ jsx(PaymentPreview, { payment })] }) : null
157
+ ]
158
+ })]
159
+ }), order.total - order.totalPaid > 0 && orderStepOf(order) !== "cancelled" ? /* @__PURE__ */ jsx(PayButton, {
160
+ path: `/account/orders/${order.orderId}`,
161
+ label: storefrontTranslate("Pagar"),
162
+ variant: "outline"
163
+ }) : /* @__PURE__ */ jsx(ReorderButton, {
164
+ items: order.items,
165
+ variant: "outline"
166
+ })]
167
+ })]
168
+ });
169
+ }
170
+ const VIEW_ICONS = {
171
+ list: "M4 6h16M4 12h16M4 18h16",
172
+ grid: "M4 4h7v7H4zM13 4h7v7h-7zM4 13h7v7H4zM13 13h7v7h-7z"
173
+ };
174
+ function AccountOrders({ loaderData }) {
175
+ const storefrontTranslate = useStorefrontText();
176
+ const { pathname } = useLocation();
177
+ const navigate = useNavigate();
178
+ const { orders, more } = useOrderPages(loaderData);
179
+ const { filters } = loaderData;
180
+ const filtered = filters.q !== "" || filters.status !== null;
181
+ const href = (next) => {
182
+ const query = orderFiltersQuery(next).toString();
183
+ return query === "" ? pathname : `${pathname}?${query}`;
184
+ };
185
+ if (orders.length === 0 && !filtered) return /* @__PURE__ */ jsxs("div", {
186
+ className: "flex flex-col items-start gap-4 rounded-lg border bg-card p-8 text-card-foreground md:p-10",
187
+ children: [
188
+ /* @__PURE__ */ jsx("h2", {
189
+ className: "text-2xl",
190
+ children: storefrontTranslate("Aún no tienes pedidos")
191
+ }),
192
+ /* @__PURE__ */ jsx("p", {
193
+ className: "text-sm text-muted-foreground",
194
+ children: storefrontTranslate("Cuando compres, verás aquí el estado de cada pedido.")
195
+ }),
196
+ /* @__PURE__ */ jsx(Link, {
197
+ to: "/products",
198
+ className: "text-sm font-medium underline underline-offset-4",
199
+ children: storefrontTranslate("Ver productos")
200
+ })
201
+ ]
202
+ });
203
+ return /* @__PURE__ */ jsxs("div", {
204
+ className: "@container flex flex-col gap-6",
205
+ children: [
206
+ /* @__PURE__ */ jsxs("div", {
207
+ className: "flex items-center justify-between gap-4",
208
+ children: [/* @__PURE__ */ jsx("h2", {
209
+ className: "text-3xl",
210
+ children: storefrontTranslate("Pedidos")
211
+ }), /* @__PURE__ */ jsx("div", {
212
+ className: "hidden gap-1 sm:flex",
213
+ role: "group",
214
+ "aria-label": storefrontTranslate("Vista"),
215
+ children: ["list", "grid"].map((view) => /* @__PURE__ */ jsx(Link, {
216
+ to: href({
217
+ ...filters,
218
+ view
219
+ }),
220
+ "aria-pressed": filters.view === view,
221
+ "aria-label": storefrontTranslate(view === "list" ? "Ver como lista" : "Ver como cuadrícula"),
222
+ className: `flex size-9 items-center justify-center rounded-md transition-colors ${filters.view === view ? "bg-muted text-foreground" : "text-muted-foreground hover:text-foreground"}`,
223
+ children: /* @__PURE__ */ jsx("svg", {
224
+ "aria-hidden": "true",
225
+ viewBox: "0 0 24 24",
226
+ fill: "none",
227
+ stroke: "currentColor",
228
+ strokeWidth: "1.8",
229
+ strokeLinecap: "round",
230
+ strokeLinejoin: "round",
231
+ className: "size-4",
232
+ children: /* @__PURE__ */ jsx("path", { d: VIEW_ICONS[view] })
233
+ })
234
+ }, view))
235
+ })]
236
+ }),
237
+ /* @__PURE__ */ jsxs("div", {
238
+ className: "flex flex-col gap-4",
239
+ children: [/* @__PURE__ */ jsxs(Form, {
240
+ method: "get",
241
+ action: pathname,
242
+ className: "flex gap-2",
243
+ role: "search",
244
+ children: [
245
+ /* @__PURE__ */ jsxs("div", {
246
+ className: "relative min-w-0 flex-1",
247
+ children: [/* @__PURE__ */ jsxs("svg", {
248
+ "aria-hidden": "true",
249
+ viewBox: "0 0 24 24",
250
+ fill: "none",
251
+ stroke: "currentColor",
252
+ strokeWidth: "1.8",
253
+ strokeLinecap: "round",
254
+ className: "pointer-events-none absolute left-3 top-1/2 size-4 -translate-y-1/2 text-muted-foreground",
255
+ children: [/* @__PURE__ */ jsx("circle", {
256
+ cx: "11",
257
+ cy: "11",
258
+ r: "7"
259
+ }), /* @__PURE__ */ jsx("path", { d: "m20 20-3.5-3.5" })]
260
+ }), /* @__PURE__ */ jsx(Input, {
261
+ type: "search",
262
+ name: "q",
263
+ defaultValue: filters.q,
264
+ placeholder: storefrontTranslate("Buscar"),
265
+ "aria-label": storefrontTranslate("Buscar pedidos"),
266
+ maxLength: 100,
267
+ className: "pl-9"
268
+ })]
269
+ }),
270
+ filters.status !== null ? /* @__PURE__ */ jsx("input", {
271
+ type: "hidden",
272
+ name: "status",
273
+ value: filters.status
274
+ }) : null,
275
+ filters.sort === "oldest" ? /* @__PURE__ */ jsx("input", {
276
+ type: "hidden",
277
+ name: "sort",
278
+ value: "oldest"
279
+ }) : null,
280
+ filters.view === "grid" ? /* @__PURE__ */ jsx("input", {
281
+ type: "hidden",
282
+ name: "view",
283
+ value: "grid"
284
+ }) : null,
285
+ /* @__PURE__ */ jsxs(Select, {
286
+ value: filters.sort,
287
+ onValueChange: (sort) => navigate(href({
288
+ ...filters,
289
+ sort: sort === "oldest" ? "oldest" : "newest"
290
+ })),
291
+ children: [/* @__PURE__ */ jsx(SelectTrigger, {
292
+ "aria-label": storefrontTranslate("Ordenar pedidos"),
293
+ className: "h-auto shrink-0 self-stretch data-[size=default]:h-auto",
294
+ children: /* @__PURE__ */ jsx(SelectValue, { children: storefrontTranslate(filters.sort === "oldest" ? "Más antiguos" : "Más recientes") })
295
+ }), /* @__PURE__ */ jsxs(SelectContent, { children: [/* @__PURE__ */ jsx(SelectItem, {
296
+ value: "newest",
297
+ children: storefrontTranslate("Más recientes")
298
+ }), /* @__PURE__ */ jsx(SelectItem, {
299
+ value: "oldest",
300
+ children: storefrontTranslate("Más antiguos")
301
+ })] })]
302
+ })
303
+ ]
304
+ }), /* @__PURE__ */ jsx("div", {
305
+ className: "border-b",
306
+ children: /* @__PURE__ */ jsx("nav", {
307
+ className: "-mb-px flex gap-6 overflow-x-auto",
308
+ "aria-label": storefrontTranslate("Filtrar pedidos"),
309
+ children: STATUSES.map((status) => {
310
+ const current = status.value === filters.status;
311
+ return /* @__PURE__ */ jsx(Link, {
312
+ to: href({
313
+ ...filters,
314
+ status: status.value
315
+ }),
316
+ "aria-current": current ? "page" : void 0,
317
+ className: `shrink-0 whitespace-nowrap border-b-2 pb-3 text-sm transition-colors ${current ? "border-foreground font-medium text-foreground" : "border-transparent text-muted-foreground hover:text-foreground"}`,
318
+ children: storefrontTranslate(status.label)
319
+ }, status.label);
320
+ })
321
+ })
322
+ })]
323
+ }),
324
+ orders.length === 0 ? /* @__PURE__ */ jsxs("div", {
325
+ className: "flex flex-col items-start gap-3 py-6",
326
+ children: [
327
+ /* @__PURE__ */ jsx("p", {
328
+ className: "font-heading text-xl",
329
+ children: storefrontTranslate("Ningún pedido coincide")
330
+ }),
331
+ /* @__PURE__ */ jsx("p", {
332
+ className: "text-sm text-muted-foreground",
333
+ children: storefrontTranslate("Prueba con otro número de pedido, producto o estado.")
334
+ }),
335
+ /* @__PURE__ */ jsx(Link, {
336
+ to: pathname,
337
+ className: "text-sm font-medium underline underline-offset-4",
338
+ children: storefrontTranslate("Quitar filtros")
339
+ })
340
+ ]
341
+ }) : filters.view === "grid" ? /* @__PURE__ */ jsx("ul", {
342
+ className: "grid gap-4 @lg:grid-cols-2",
343
+ children: orders.map((order) => /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsx(OrderCard, { order }) }, order.orderId))
344
+ }) : /* @__PURE__ */ jsx("ul", {
345
+ className: "flex flex-col gap-3",
346
+ children: orders.map((order) => /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsx(OrderListCard, { order }) }, order.orderId))
347
+ }),
348
+ more ? /* @__PURE__ */ jsx(Button, {
349
+ type: "button",
350
+ variant: "outline",
351
+ className: "self-center",
352
+ disabled: more.loading,
353
+ onClick: () => more.load(),
354
+ children: more.loading ? storefrontTranslate("Cargando…") : storefrontTranslate("Ver más pedidos")
355
+ }) : null
356
+ ]
357
+ });
358
+ }
359
+ export { AccountOrders, catalog };
@@ -0,0 +1,16 @@
1
+ import { ProfileActionData } from "../account.js";
2
+ import "../index.js";
3
+ import { SectionCatalog } from "../settings.js";
4
+ import "../entries/account.js";
5
+ import { CustomerMe } from "@ecomiq/core";
6
+ export declare const catalog: SectionCatalog;
7
+ export declare function AccountProfile({ loaderData, actionData }: {
8
+ loaderData: {
9
+ me: CustomerMe;
10
+ countries: {
11
+ code: string;
12
+ name: string;
13
+ }[];
14
+ };
15
+ actionData?: ProfileActionData;
16
+ }): import("react").JSX.Element;
@@ -0,0 +1,123 @@
1
+ import { useStorefrontText } from "../storefront-language-DrMjVbmk.js";
2
+ import { CustomerDocumentFields } from "../customer-document-fields-C1K-_DAD.js";
3
+ import { ProfileForm } from "../account-forms-AVk71ko7.js";
4
+ import { useNavigation } from "react-router";
5
+ import { jsx, jsxs } from "react/jsx-runtime";
6
+ import { Button } from "@theme/ui/button";
7
+ import { Input } from "@theme/ui/input";
8
+ // src/sections/account-profile.tsx
9
+ const catalog = {
10
+ name: "Mi perfil",
11
+ description: "Nombre, celular y documento del cliente."
12
+ };
13
+ function Labeled({ label, hint, className = "", children }) {
14
+ return /* @__PURE__ */ jsxs("label", {
15
+ className: `flex flex-col gap-1.5 text-sm ${className}`,
16
+ children: [
17
+ /* @__PURE__ */ jsx("span", {
18
+ className: "font-medium",
19
+ children: label
20
+ }),
21
+ children,
22
+ hint ? /* @__PURE__ */ jsx("span", {
23
+ className: "text-xs text-muted-foreground",
24
+ children: hint
25
+ }) : null
26
+ ]
27
+ });
28
+ }
29
+ function AccountProfile({ loaderData, actionData }) {
30
+ const storefrontTranslate = useStorefrontText();
31
+ const { me, countries } = loaderData;
32
+ const busy = useNavigation().state !== "idle";
33
+ return /* @__PURE__ */ jsxs("div", {
34
+ className: "flex flex-col gap-6",
35
+ children: [/* @__PURE__ */ jsx("h2", {
36
+ className: "text-3xl",
37
+ children: storefrontTranslate("Datos personales")
38
+ }), /* @__PURE__ */ jsxs(ProfileForm, {
39
+ className: "flex max-w-2xl flex-col gap-4",
40
+ children: [
41
+ actionData?.error ? /* @__PURE__ */ jsx("p", {
42
+ role: "alert",
43
+ className: "rounded-md bg-destructive/10 px-4 py-3 text-sm text-destructive",
44
+ children: storefrontTranslate(actionData.error)
45
+ }) : null,
46
+ actionData?.saved ? /* @__PURE__ */ jsx("p", {
47
+ role: "status",
48
+ className: "rounded-md bg-muted px-4 py-3 text-sm",
49
+ children: storefrontTranslate("Datos guardados.")
50
+ }) : null,
51
+ /* @__PURE__ */ jsxs("section", {
52
+ className: "flex flex-col gap-4 rounded-lg border bg-card p-5 text-card-foreground md:p-6",
53
+ children: [/* @__PURE__ */ jsx("h3", {
54
+ className: "font-heading text-lg",
55
+ children: storefrontTranslate("Tus datos")
56
+ }), /* @__PURE__ */ jsxs("div", {
57
+ className: "grid gap-4 sm:grid-cols-2",
58
+ children: [
59
+ /* @__PURE__ */ jsx(Labeled, {
60
+ label: storefrontTranslate("Nombre"),
61
+ children: /* @__PURE__ */ jsx(Input, {
62
+ name: "firstName",
63
+ autoComplete: "given-name",
64
+ defaultValue: me.firstName ?? "",
65
+ maxLength: 100
66
+ })
67
+ }),
68
+ /* @__PURE__ */ jsx(Labeled, {
69
+ label: storefrontTranslate("Apellido"),
70
+ children: /* @__PURE__ */ jsx(Input, {
71
+ name: "lastName",
72
+ autoComplete: "family-name",
73
+ defaultValue: me.lastName ?? "",
74
+ maxLength: 100
75
+ })
76
+ }),
77
+ /* @__PURE__ */ jsx(Labeled, {
78
+ label: storefrontTranslate("Celular"),
79
+ children: /* @__PURE__ */ jsx(Input, {
80
+ name: "phone",
81
+ type: "tel",
82
+ autoComplete: "tel",
83
+ defaultValue: me.phone ?? ""
84
+ })
85
+ }),
86
+ /* @__PURE__ */ jsxs("div", {
87
+ className: "flex flex-col gap-1.5 text-sm",
88
+ children: [
89
+ /* @__PURE__ */ jsx("span", {
90
+ className: "font-medium",
91
+ children: storefrontTranslate("Correo")
92
+ }),
93
+ /* @__PURE__ */ jsx("p", {
94
+ className: "flex h-10 items-center text-muted-foreground",
95
+ children: me.email ?? "—"
96
+ }),
97
+ /* @__PURE__ */ jsx("span", {
98
+ className: "text-xs text-muted-foreground",
99
+ children: storefrontTranslate("Escríbenos si necesitas cambiarlo.")
100
+ })
101
+ ]
102
+ })
103
+ ]
104
+ })]
105
+ }),
106
+ /* @__PURE__ */ jsx("section", {
107
+ className: "rounded-lg border bg-card p-5 text-card-foreground md:p-6",
108
+ children: /* @__PURE__ */ jsx(CustomerDocumentFields, {
109
+ customer: me,
110
+ countries
111
+ })
112
+ }),
113
+ /* @__PURE__ */ jsx(Button, {
114
+ type: "submit",
115
+ className: "w-fit",
116
+ disabled: busy,
117
+ children: busy ? storefrontTranslate("Guardando…") : storefrontTranslate("Guardar cambios")
118
+ })
119
+ ]
120
+ })]
121
+ });
122
+ }
123
+ export { AccountProfile, catalog };
@@ -0,0 +1,24 @@
1
+ import { CheckoutActionData, CheckoutData } from "../checkout.js";
2
+ import "../index.js";
3
+ import { SectionCatalog, SectionProps, SectionRoot } from "../settings.js";
4
+ import "../entries/checkout.js";
5
+ export declare const catalog: SectionCatalog;
6
+ export declare const settings: {
7
+ checkout: {
8
+ layout: "single" | "steps";
9
+ summary: "left" | "right";
10
+ main: string;
11
+ aside: string;
12
+ logo: "center" | "left";
13
+ secure: boolean;
14
+ marks: boolean;
15
+ encrypted: boolean;
16
+ fields: "filled" | "outline";
17
+ corners: "round" | "soft" | "square";
18
+ button: "fit" | "full";
19
+ };
20
+ };
21
+ export declare function Checkout({ data, result, ...root }: {
22
+ data: CheckoutData;
23
+ result?: CheckoutActionData;
24
+ } & SectionProps<typeof settings.checkout> & SectionRoot): import("react").JSX.Element;