@shoppexio/storefront-react 0.1.4 → 0.1.5

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/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.1.5
4
+
5
+ - `loadShopPage()` returns `error` for a failed request or render and `missing`
6
+ only for a 404 or a nameless page. Needs Storefront SDK 1.0.87 for the
7
+ status; with an older SDK every failure is `error`.
8
+ - `usePagedShopReviews({ product })` and `loadShopReviewsPage()`: reviews one
9
+ page at a time with the API's summary, optionally for one product (catalog
10
+ `id`). A filtered answer must echo the filter, or it is refused.
11
+ `loadLatestWrittenReviews()` takes `{ product }` too. `ShopReview.automated`.
12
+ - Account: a warranty claim over 2,000 characters is refused with a message
13
+ naming the limit; the account root sets `dir="rtl"` for right-to-left locales.
14
+
3
15
  ## 0.1.4
4
16
 
5
17
  - Catalog cards are sold out when no option can be ordered, including a
package/README.md CHANGED
@@ -164,7 +164,7 @@ Most themes never need this.
164
164
  | Product | The product page model: variants, rating, pricing, quantity bounds, badges, videos | `buildProductDetail()`, `calculateLinePricing()`, `badgesForProductPage()` |
165
165
  | Cart | Cart state, quotes, coupons, checkout hand-off | `<CartProvider>`, `useCart()`, `buildCartView()`, `buildCartTotals()` |
166
166
  | Checkout fields | Per-product fields a buyer fills before checkout | `resolveCheckoutFields()`, `readCheckoutNeedsDetails()` |
167
- | Reviews, pages, menus, contact | SDK-backed hooks | `useShopReviews()`, `loadShopPage()`, `useNavigationLinks()`, `submitContactTicket()` |
167
+ | Reviews, pages, menus, contact | SDK-backed hooks | `usePagedShopReviews()`, `loadLatestWrittenReviews()`, `loadShopPage()`, `useNavigationLinks()`, `submitContactTicket()` |
168
168
  | Merchant HTML | Sanitizing and flattening merchant rich text | `sanitizeMerchantHtml()`, `flattenMerchantHtmlToText()` |
169
169
  | Account routing | Mounting the account and its lazy chunk | `ACCOUNT_PATH`, `ACCOUNT_PATH_ALIAS`, `accountRouteMessage()`, `ACCOUNT_STOREFRONT_ROUTES`, `ACCOUNT_ARTIFACT_CAPABILITIES` |
170
170
 
package/dist/account.js CHANGED
@@ -299,7 +299,8 @@ var ar_default = {
299
299
  warrantyClaimSend: "\u0625\u0631\u0633\u0627\u0644 \u0627\u0644\u0637\u0644\u0628",
300
300
  warrantyClaimSending: "\u062C\u0627\u0631\u064D \u0627\u0644\u0625\u0631\u0633\u0627\u0644\u2026",
301
301
  warrantyClaimDone: "\u0648\u0635\u0644 \u0637\u0644\u0628\u0643 \u0625\u0644\u0649 \u0627\u0644\u0645\u062A\u062C\u0631. \u0633\u064A\u0631\u062F\u0651\u0648\u0646 \u0639\u0628\u0631 \u0627\u0644\u0628\u0631\u064A\u062F \u0627\u0644\u0625\u0644\u0643\u062A\u0631\u0648\u0646\u064A.",
302
- warrantyClaimFailed: "\u062A\u0639\u0630\u0651\u0631 \u0625\u0631\u0633\u0627\u0644 \u0637\u0644\u0628\u0643."
302
+ warrantyClaimFailed: "\u062A\u0639\u0630\u0651\u0631 \u0625\u0631\u0633\u0627\u0644 \u0637\u0644\u0628\u0643.",
303
+ warrantyClaimTooLong: "\u0644\u0627 \u064A\u0645\u0643\u0646 \u0623\u0646 \u064A\u062A\u062C\u0627\u0648\u0632 \u0637\u0644\u0628\u0643 {max} \u062D\u0631\u0641."
303
304
  },
304
305
  downloads: {
305
306
  loading: "\u062C\u0627\u0631\u064D \u062A\u062D\u0645\u064A\u0644 \u062A\u0646\u0632\u064A\u0644\u0627\u062A\u0643",
@@ -764,7 +765,8 @@ var de_default = {
764
765
  warrantyClaimSend: "Fall senden",
765
766
  warrantyClaimSending: "Wird gesendet\u2026",
766
767
  warrantyClaimDone: "Der Shop hat deinen Fall erhalten. Die Antwort kommt per E-Mail.",
767
- warrantyClaimFailed: "Dein Fall konnte nicht gesendet werden."
768
+ warrantyClaimFailed: "Dein Fall konnte nicht gesendet werden.",
769
+ warrantyClaimTooLong: "Dein Fall darf h\xF6chstens {max} Zeichen lang sein."
768
770
  },
769
771
  downloads: {
770
772
  loading: "Deine Downloads werden geladen",
@@ -1229,7 +1231,8 @@ var en_default = {
1229
1231
  warrantyClaimSend: "Send claim",
1230
1232
  warrantyClaimSending: "Sending\u2026",
1231
1233
  warrantyClaimDone: "The store has your claim. They reply by email.",
1232
- warrantyClaimFailed: "Your claim could not be sent."
1234
+ warrantyClaimFailed: "Your claim could not be sent.",
1235
+ warrantyClaimTooLong: "Your claim can be at most {max} characters."
1233
1236
  },
1234
1237
  downloads: {
1235
1238
  loading: "Loading your downloads",
@@ -1694,7 +1697,8 @@ var es_default = {
1694
1697
  warrantyClaimSend: "Enviar reclamaci\xF3n",
1695
1698
  warrantyClaimSending: "Enviando\u2026",
1696
1699
  warrantyClaimDone: "La tienda ha recibido tu reclamaci\xF3n. Te responder\xE1n por correo.",
1697
- warrantyClaimFailed: "No se ha podido enviar tu reclamaci\xF3n."
1700
+ warrantyClaimFailed: "No se ha podido enviar tu reclamaci\xF3n.",
1701
+ warrantyClaimTooLong: "Tu reclamaci\xF3n no puede superar los {max} caracteres."
1698
1702
  },
1699
1703
  downloads: {
1700
1704
  loading: "Cargando tus descargas",
@@ -2159,7 +2163,8 @@ var fi_default = {
2159
2163
  warrantyClaimSend: "L\xE4het\xE4 vaatimus",
2160
2164
  warrantyClaimSending: "L\xE4hetet\xE4\xE4n\u2026",
2161
2165
  warrantyClaimDone: "Kauppa sai vaatimuksesi. He vastaavat s\xE4hk\xF6postitse.",
2162
- warrantyClaimFailed: "Vaatimustasi ei voitu l\xE4hett\xE4\xE4."
2166
+ warrantyClaimFailed: "Vaatimustasi ei voitu l\xE4hett\xE4\xE4.",
2167
+ warrantyClaimTooLong: "Vaatimuksessa saa olla enint\xE4\xE4n {max} merkki\xE4."
2163
2168
  },
2164
2169
  downloads: {
2165
2170
  loading: "Ladataan latauksiasi",
@@ -2624,7 +2629,8 @@ var fr_default = {
2624
2629
  warrantyClaimSend: "Envoyer la demande",
2625
2630
  warrantyClaimSending: "Envoi en cours\u2026",
2626
2631
  warrantyClaimDone: "La boutique a bien re\xE7u votre demande. Elle r\xE9pond par e-mail.",
2627
- warrantyClaimFailed: "Votre demande n'a pas pu \xEAtre envoy\xE9e."
2632
+ warrantyClaimFailed: "Votre demande n'a pas pu \xEAtre envoy\xE9e.",
2633
+ warrantyClaimTooLong: "Votre demande ne peut pas d\xE9passer {max} caract\xE8res."
2628
2634
  },
2629
2635
  downloads: {
2630
2636
  loading: "Chargement de vos t\xE9l\xE9chargements",
@@ -3089,7 +3095,8 @@ var hi_default = {
3089
3095
  warrantyClaimSend: "\u0926\u093E\u0935\u093E \u092D\u0947\u091C\u0947\u0902",
3090
3096
  warrantyClaimSending: "\u092D\u0947\u091C\u093E \u091C\u093E \u0930\u0939\u093E \u0939\u0948\u2026",
3091
3097
  warrantyClaimDone: "\u0938\u094D\u091F\u094B\u0930 \u0915\u094B \u0906\u092A\u0915\u093E \u0926\u093E\u0935\u093E \u092E\u093F\u0932 \u0917\u092F\u093E\u0964 \u091C\u0935\u093E\u092C \u0908\u092E\u0947\u0932 \u0938\u0947 \u0906\u090F\u0917\u093E\u0964",
3092
- warrantyClaimFailed: "\u0906\u092A\u0915\u093E \u0926\u093E\u0935\u093E \u0928\u0939\u0940\u0902 \u092D\u0947\u091C\u093E \u091C\u093E \u0938\u0915\u093E\u0964"
3098
+ warrantyClaimFailed: "\u0906\u092A\u0915\u093E \u0926\u093E\u0935\u093E \u0928\u0939\u0940\u0902 \u092D\u0947\u091C\u093E \u091C\u093E \u0938\u0915\u093E\u0964",
3099
+ warrantyClaimTooLong: "\u0906\u092A\u0915\u093E \u0926\u093E\u0935\u093E {max} \u0935\u0930\u094D\u0923\u094B\u0902 \u0938\u0947 \u0905\u0927\u093F\u0915 \u0928\u0939\u0940\u0902 \u0939\u094B \u0938\u0915\u0924\u093E\u0964"
3093
3100
  },
3094
3101
  downloads: {
3095
3102
  loading: "\u0906\u092A\u0915\u0947 \u0921\u093E\u0909\u0928\u0932\u094B\u0921 \u0932\u094B\u0921 \u0939\u094B \u0930\u0939\u0947 \u0939\u0948\u0902",
@@ -3554,7 +3561,8 @@ var it_default = {
3554
3561
  warrantyClaimSend: "Invia richiesta",
3555
3562
  warrantyClaimSending: "Invio in corso\u2026",
3556
3563
  warrantyClaimDone: "Il negozio ha ricevuto la tua richiesta. Ti rispondono via e-mail.",
3557
- warrantyClaimFailed: "Non \xE8 stato possibile inviare la richiesta."
3564
+ warrantyClaimFailed: "Non \xE8 stato possibile inviare la richiesta.",
3565
+ warrantyClaimTooLong: "La richiesta non pu\xF2 superare i {max} caratteri."
3558
3566
  },
3559
3567
  downloads: {
3560
3568
  loading: "Caricamento dei tuoi download",
@@ -4019,7 +4027,8 @@ var lt_default = {
4019
4027
  warrantyClaimSend: "Si\u0173sti pra\u0161ym\u0105",
4020
4028
  warrantyClaimSending: "Siun\u010Diama\u2026",
4021
4029
  warrantyClaimDone: "Parduotuv\u0117 gavo j\u016Bs\u0173 pra\u0161ym\u0105. Atsakymas ateis el. pa\u0161tu.",
4022
- warrantyClaimFailed: "J\u016Bs\u0173 pra\u0161ymo i\u0161si\u0173sti nepavyko."
4030
+ warrantyClaimFailed: "J\u016Bs\u0173 pra\u0161ymo i\u0161si\u0173sti nepavyko.",
4031
+ warrantyClaimTooLong: "Pra\u0161ymas negali vir\u0161yti {max} simboli\u0173."
4023
4032
  },
4024
4033
  downloads: {
4025
4034
  loading: "\u012Ekeliami j\u016Bs\u0173 atsisiuntimai",
@@ -4484,7 +4493,8 @@ var nl_default = {
4484
4493
  warrantyClaimSend: "Melding versturen",
4485
4494
  warrantyClaimSending: "Versturen\u2026",
4486
4495
  warrantyClaimDone: "De winkel heeft je melding ontvangen. Ze antwoorden per e-mail.",
4487
- warrantyClaimFailed: "Je melding kon niet worden verstuurd."
4496
+ warrantyClaimFailed: "Je melding kon niet worden verstuurd.",
4497
+ warrantyClaimTooLong: "Je melding mag maximaal {max} tekens bevatten."
4488
4498
  },
4489
4499
  downloads: {
4490
4500
  loading: "Je downloads worden geladen",
@@ -4949,7 +4959,8 @@ var pl_default = {
4949
4959
  warrantyClaimSend: "Wy\u015Blij zg\u0142oszenie",
4950
4960
  warrantyClaimSending: "Wysy\u0142anie\u2026",
4951
4961
  warrantyClaimDone: "Sklep otrzyma\u0142 Twoje zg\u0142oszenie. Odpowied\u017A przyjdzie e-mailem.",
4952
- warrantyClaimFailed: "Nie uda\u0142o si\u0119 wys\u0142a\u0107 zg\u0142oszenia."
4962
+ warrantyClaimFailed: "Nie uda\u0142o si\u0119 wys\u0142a\u0107 zg\u0142oszenia.",
4963
+ warrantyClaimTooLong: "Zg\u0142oszenie mo\u017Ce mie\u0107 najwy\u017Cej {max} znak\xF3w."
4953
4964
  },
4954
4965
  downloads: {
4955
4966
  loading: "Wczytujemy Twoje pliki",
@@ -5414,7 +5425,8 @@ var pt_default = {
5414
5425
  warrantyClaimSend: "Enviar pedido",
5415
5426
  warrantyClaimSending: "A enviar\u2026",
5416
5427
  warrantyClaimDone: "A loja recebeu o teu pedido. Respondem por e-mail.",
5417
- warrantyClaimFailed: "N\xE3o foi poss\xEDvel enviar o teu pedido."
5428
+ warrantyClaimFailed: "N\xE3o foi poss\xEDvel enviar o teu pedido.",
5429
+ warrantyClaimTooLong: "O teu pedido n\xE3o pode ter mais de {max} caracteres."
5418
5430
  },
5419
5431
  downloads: {
5420
5432
  loading: "A carregar as tuas transfer\xEAncias",
@@ -5879,7 +5891,8 @@ var ru_default = {
5879
5891
  warrantyClaimSend: "\u041E\u0442\u043F\u0440\u0430\u0432\u0438\u0442\u044C \u043E\u0431\u0440\u0430\u0449\u0435\u043D\u0438\u0435",
5880
5892
  warrantyClaimSending: "\u041E\u0442\u043F\u0440\u0430\u0432\u043B\u044F\u0435\u043C\u2026",
5881
5893
  warrantyClaimDone: "\u041C\u0430\u0433\u0430\u0437\u0438\u043D \u043F\u043E\u043B\u0443\u0447\u0438\u043B \u0432\u0430\u0448\u0435 \u043E\u0431\u0440\u0430\u0449\u0435\u043D\u0438\u0435. \u041E\u0442\u0432\u0435\u0442 \u043F\u0440\u0438\u0434\u0451\u0442 \u043D\u0430 \u043F\u043E\u0447\u0442\u0443.",
5882
- warrantyClaimFailed: "\u041D\u0435 \u0443\u0434\u0430\u043B\u043E\u0441\u044C \u043E\u0442\u043F\u0440\u0430\u0432\u0438\u0442\u044C \u043E\u0431\u0440\u0430\u0449\u0435\u043D\u0438\u0435."
5894
+ warrantyClaimFailed: "\u041D\u0435 \u0443\u0434\u0430\u043B\u043E\u0441\u044C \u043E\u0442\u043F\u0440\u0430\u0432\u0438\u0442\u044C \u043E\u0431\u0440\u0430\u0449\u0435\u043D\u0438\u0435.",
5895
+ warrantyClaimTooLong: "\u041E\u0431\u0440\u0430\u0449\u0435\u043D\u0438\u0435 \u043D\u0435 \u0434\u043E\u043B\u0436\u043D\u043E \u043F\u0440\u0435\u0432\u044B\u0448\u0430\u0442\u044C {max} \u0441\u0438\u043C\u0432\u043E\u043B\u043E\u0432."
5883
5896
  },
5884
5897
  downloads: {
5885
5898
  loading: "\u0417\u0430\u0433\u0440\u0443\u0436\u0430\u0435\u043C \u0432\u0430\u0448\u0438 \u0444\u0430\u0439\u043B\u044B",
@@ -6344,7 +6357,8 @@ var tr_default = {
6344
6357
  warrantyClaimSend: "Talebi g\xF6nder",
6345
6358
  warrantyClaimSending: "G\xF6nderiliyor\u2026",
6346
6359
  warrantyClaimDone: "Ma\u011Faza talebinizi ald\u0131. E-posta ile yan\u0131t verirler.",
6347
- warrantyClaimFailed: "Talebiniz g\xF6nderilemedi."
6360
+ warrantyClaimFailed: "Talebiniz g\xF6nderilemedi.",
6361
+ warrantyClaimTooLong: "Talebiniz en fazla {max} karakter olabilir."
6348
6362
  },
6349
6363
  downloads: {
6350
6364
  loading: "\u0130ndirmeleriniz y\xFCkleniyor",
@@ -6809,7 +6823,8 @@ var uk_default = {
6809
6823
  warrantyClaimSend: "\u041D\u0430\u0434\u0456\u0441\u043B\u0430\u0442\u0438 \u0437\u0432\u0435\u0440\u043D\u0435\u043D\u043D\u044F",
6810
6824
  warrantyClaimSending: "\u041D\u0430\u0434\u0441\u0438\u043B\u0430\u0454\u043C\u043E\u2026",
6811
6825
  warrantyClaimDone: "\u041C\u0430\u0433\u0430\u0437\u0438\u043D \u043E\u0442\u0440\u0438\u043C\u0430\u0432 \u0432\u0430\u0448\u0435 \u0437\u0432\u0435\u0440\u043D\u0435\u043D\u043D\u044F. \u0412\u0456\u0434\u043F\u043E\u0432\u0456\u0434\u044C \u043D\u0430\u0434\u0456\u0439\u0434\u0435 \u043D\u0430 \u043F\u043E\u0448\u0442\u0443.",
6812
- warrantyClaimFailed: "\u041D\u0435 \u0432\u0434\u0430\u043B\u043E\u0441\u044F \u043D\u0430\u0434\u0456\u0441\u043B\u0430\u0442\u0438 \u0437\u0432\u0435\u0440\u043D\u0435\u043D\u043D\u044F."
6826
+ warrantyClaimFailed: "\u041D\u0435 \u0432\u0434\u0430\u043B\u043E\u0441\u044F \u043D\u0430\u0434\u0456\u0441\u043B\u0430\u0442\u0438 \u0437\u0432\u0435\u0440\u043D\u0435\u043D\u043D\u044F.",
6827
+ warrantyClaimTooLong: "\u0417\u0432\u0435\u0440\u043D\u0435\u043D\u043D\u044F \u043D\u0435 \u043C\u0430\u0454 \u043F\u0435\u0440\u0435\u0432\u0438\u0449\u0443\u0432\u0430\u0442\u0438 {max} \u0441\u0438\u043C\u0432\u043E\u043B\u0456\u0432."
6813
6828
  },
6814
6829
  downloads: {
6815
6830
  loading: "\u0417\u0430\u0432\u0430\u043D\u0442\u0430\u0436\u0443\u0454\u043C\u043E \u0432\u0430\u0448\u0456 \u0444\u0430\u0439\u043B\u0438",
@@ -7274,7 +7289,8 @@ var zh_default = {
7274
7289
  warrantyClaimSend: "\u63D0\u4EA4\u7533\u8BF7",
7275
7290
  warrantyClaimSending: "\u63D0\u4EA4\u4E2D\u2026",
7276
7291
  warrantyClaimDone: "\u5546\u5E97\u5DF2\u6536\u5230\u4F60\u7684\u7533\u8BF7\uFF0C\u4ED6\u4EEC\u4F1A\u901A\u8FC7\u90AE\u4EF6\u56DE\u590D\u3002",
7277
- warrantyClaimFailed: "\u7533\u8BF7\u63D0\u4EA4\u5931\u8D25\u3002"
7292
+ warrantyClaimFailed: "\u7533\u8BF7\u63D0\u4EA4\u5931\u8D25\u3002",
7293
+ warrantyClaimTooLong: "\u7533\u8BF7\u5185\u5BB9\u4E0D\u80FD\u8D85\u8FC7 {max} \u4E2A\u5B57\u7B26\u3002"
7278
7294
  },
7279
7295
  downloads: {
7280
7296
  loading: "\u6B63\u5728\u52A0\u8F7D\u4F60\u7684\u4E0B\u8F7D\u5185\u5BB9",
@@ -7617,6 +7633,7 @@ var MESSAGE_CATALOGS = {
7617
7633
  zh: zh_default
7618
7634
  };
7619
7635
  var EN_MESSAGES = MESSAGE_CATALOGS.en;
7636
+ var RTL_LOCALES = /* @__PURE__ */ new Set(["ar"]);
7620
7637
  function isSupportedLocale(value) {
7621
7638
  return SUPPORTED_LOCALES.includes(value);
7622
7639
  }
@@ -7624,6 +7641,9 @@ function resolveLocale(lang) {
7624
7641
  const base = (lang ?? "").trim().toLowerCase().split(/[-_]/)[0] ?? "";
7625
7642
  return isSupportedLocale(base) ? base : DEFAULT_LOCALE;
7626
7643
  }
7644
+ function isRightToLeft(locale) {
7645
+ return RTL_LOCALES.has(locale);
7646
+ }
7627
7647
  function messageAt(catalog, key) {
7628
7648
  let value = catalog;
7629
7649
  for (const segment of key.split(".")) {
@@ -9060,6 +9080,9 @@ function canClaimWarranty(warranty, now = /* @__PURE__ */ new Date()) {
9060
9080
  return expires !== null && expires > now.getTime();
9061
9081
  }
9062
9082
  var WARRANTY_CLAIM_MESSAGE_MAX = 2e3;
9083
+ function isWarrantyClaimTooLong(input) {
9084
+ return input.trim().length > WARRANTY_CLAIM_MESSAGE_MAX;
9085
+ }
9063
9086
  function warrantyClaimMessage(input) {
9064
9087
  const message = input.trim();
9065
9088
  return message.length === 0 ? void 0 : message;
@@ -9351,6 +9374,10 @@ function WarrantyRow({
9351
9374
  const claimKey = warrantyClaimKey(warranty.claim_status);
9352
9375
  const fieldId = `warranty-claim-${warranty.uniqid}`;
9353
9376
  const send = async () => {
9377
+ if (isWarrantyClaimTooLong(message)) {
9378
+ setError(t("orders.warrantyClaimTooLong", { max: WARRANTY_CLAIM_MESSAGE_MAX }));
9379
+ return;
9380
+ }
9354
9381
  setSending(true);
9355
9382
  setError(null);
9356
9383
  const response = await callCustomerApi((sdk) => sdk.claimWarranty(
@@ -9402,7 +9429,7 @@ function WarrantyRow({
9402
9429
  rows: 3,
9403
9430
  value: message,
9404
9431
  disabled: sending,
9405
- maxLength: WARRANTY_CLAIM_MESSAGE_MAX,
9432
+ "aria-invalid": error !== null || void 0,
9406
9433
  onChange: (event) => {
9407
9434
  setMessage(event.target.value);
9408
9435
  setError(null);
@@ -12567,47 +12594,55 @@ function AccountPage({ frame: Frame, notFound }) {
12567
12594
  };
12568
12595
  if (canonical !== null) return /* @__PURE__ */ jsx15(Navigate, { to: `${canonical}${remainingSearch(search)}`, replace: true });
12569
12596
  if (view.kind === "unknown-tab") return /* @__PURE__ */ jsx15(Fragment3, { children: notFound });
12570
- return /* @__PURE__ */ jsx15(Frame, { children: /* @__PURE__ */ jsxs14("section", { className: "sx-account sxa:space-y-8 sxa:py-6 sxa:md:py-8", "data-sx-account-session": session.status, children: [
12571
- /* @__PURE__ */ jsxs14("div", { className: "sx-account-header sxa:flex sxa:flex-wrap sxa:items-end sxa:justify-between sxa:gap-4", children: [
12572
- /* @__PURE__ */ jsx15("h1", { className: "sx-account-title sxa:font-heading sxa:text-h1", children: t("account.title") }),
12573
- session.status === "signed-in" ? /* @__PURE__ */ jsxs14(
12574
- "button",
12575
- {
12576
- type: "button",
12577
- onClick: () => void signOut(),
12578
- disabled: signingOut,
12579
- "aria-busy": signingOut || void 0,
12580
- className: "sx-account-signout sx-account-button sxa:card-button sxa:card-button--add sxa:disabled:cursor-not-allowed sxa:disabled:opacity-50",
12581
- children: [
12582
- signingOut ? /* @__PURE__ */ jsx15(BusySpinner, { className: "sxa:mr-1.5 sxa:h-3.5 sxa:w-3.5" }) : null,
12583
- signingOut ? t("account.signingOut") : t("account.signOut")
12584
- ]
12585
- }
12586
- ) : null
12587
- ] }),
12588
- session.status === "checking" ? /* @__PURE__ */ jsx15(AccountRowsSkeleton, { rows: 3, label: t("account.checkingSession") }) : null,
12589
- session.status === "signed-out" ? /* @__PURE__ */ jsx15(
12590
- AccountLogin,
12591
- {
12592
- prefill,
12593
- onSignedIn: () => {
12594
- setPrefill(spendSignInPrefill());
12595
- setSession({ status: "signed-in" });
12596
- }
12597
- }
12598
- ) : null,
12599
- session.status === "unknown" ? /* @__PURE__ */ jsx15("div", { className: "sxa:mx-auto sxa:w-full sxa:max-w-md", children: /* @__PURE__ */ jsx15(
12600
- AccountError,
12601
- {
12602
- message: session.message,
12603
- onRetry: () => {
12604
- setSession({ status: "checking" });
12605
- setProbeToken((token) => token + 1);
12606
- }
12607
- }
12608
- ) }) : null,
12609
- session.status === "signed-in" ? /* @__PURE__ */ jsx15(SignedInAccount, { view, signOutError }) : null
12610
- ] }) });
12597
+ return /* @__PURE__ */ jsx15(Frame, { children: /* @__PURE__ */ jsxs14(
12598
+ "section",
12599
+ {
12600
+ className: "sx-account sxa:space-y-8 sxa:py-6 sxa:md:py-8",
12601
+ dir: isRightToLeft(getActiveLocale()) ? "rtl" : "ltr",
12602
+ "data-sx-account-session": session.status,
12603
+ children: [
12604
+ /* @__PURE__ */ jsxs14("div", { className: "sx-account-header sxa:flex sxa:flex-wrap sxa:items-end sxa:justify-between sxa:gap-4", children: [
12605
+ /* @__PURE__ */ jsx15("h1", { className: "sx-account-title sxa:font-heading sxa:text-h1", children: t("account.title") }),
12606
+ session.status === "signed-in" ? /* @__PURE__ */ jsxs14(
12607
+ "button",
12608
+ {
12609
+ type: "button",
12610
+ onClick: () => void signOut(),
12611
+ disabled: signingOut,
12612
+ "aria-busy": signingOut || void 0,
12613
+ className: "sx-account-signout sx-account-button sxa:card-button sxa:card-button--add sxa:disabled:cursor-not-allowed sxa:disabled:opacity-50",
12614
+ children: [
12615
+ signingOut ? /* @__PURE__ */ jsx15(BusySpinner, { className: "sxa:mr-1.5 sxa:h-3.5 sxa:w-3.5" }) : null,
12616
+ signingOut ? t("account.signingOut") : t("account.signOut")
12617
+ ]
12618
+ }
12619
+ ) : null
12620
+ ] }),
12621
+ session.status === "checking" ? /* @__PURE__ */ jsx15(AccountRowsSkeleton, { rows: 3, label: t("account.checkingSession") }) : null,
12622
+ session.status === "signed-out" ? /* @__PURE__ */ jsx15(
12623
+ AccountLogin,
12624
+ {
12625
+ prefill,
12626
+ onSignedIn: () => {
12627
+ setPrefill(spendSignInPrefill());
12628
+ setSession({ status: "signed-in" });
12629
+ }
12630
+ }
12631
+ ) : null,
12632
+ session.status === "unknown" ? /* @__PURE__ */ jsx15("div", { className: "sxa:mx-auto sxa:w-full sxa:max-w-md", children: /* @__PURE__ */ jsx15(
12633
+ AccountError,
12634
+ {
12635
+ message: session.message,
12636
+ onRetry: () => {
12637
+ setSession({ status: "checking" });
12638
+ setProbeToken((token) => token + 1);
12639
+ }
12640
+ }
12641
+ ) }) : null,
12642
+ session.status === "signed-in" ? /* @__PURE__ */ jsx15(SignedInAccount, { view, signOutError }) : null
12643
+ ]
12644
+ }
12645
+ ) });
12611
12646
  }
12612
12647
  function SignedInAccount({
12613
12648
  view,