@asteby/storefront-react 0.25.0 → 0.26.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 (48) hide show
  1. package/README.md +35 -2
  2. package/dist/account-server.cjs +128 -19
  3. package/dist/account-server.cjs.map +1 -1
  4. package/dist/account-server.d.cts +67 -4
  5. package/dist/account-server.d.ts +67 -4
  6. package/dist/account-server.js +125 -20
  7. package/dist/account-server.js.map +1 -1
  8. package/dist/account.cjs +252 -7
  9. package/dist/account.cjs.map +1 -1
  10. package/dist/account.css +91 -0
  11. package/dist/account.d.cts +130 -6
  12. package/dist/account.d.ts +130 -6
  13. package/dist/account.js +247 -8
  14. package/dist/account.js.map +1 -1
  15. package/dist/checkout.cjs +162 -8
  16. package/dist/checkout.cjs.map +1 -1
  17. package/dist/checkout.d.cts +104 -4
  18. package/dist/checkout.d.ts +104 -4
  19. package/dist/checkout.js +158 -10
  20. package/dist/checkout.js.map +1 -1
  21. package/dist/chunk-Z4C4LKXF.js +25 -0
  22. package/dist/chunk-Z4C4LKXF.js.map +1 -0
  23. package/dist/fit-key-B9sYQVwG.d.cts +49 -0
  24. package/dist/fit-key-B9sYQVwG.d.ts +49 -0
  25. package/dist/fitment.cjs +54 -9
  26. package/dist/fitment.cjs.map +1 -1
  27. package/dist/fitment.d.cts +20 -2
  28. package/dist/fitment.d.ts +20 -2
  29. package/dist/fitment.js +54 -10
  30. package/dist/fitment.js.map +1 -1
  31. package/dist/settings-types-jxFQFFqP.d.cts +77 -0
  32. package/dist/settings-types-jxFQFFqP.d.ts +77 -0
  33. package/dist/subjects-server.cjs +248 -0
  34. package/dist/subjects-server.cjs.map +1 -0
  35. package/dist/subjects-server.d.cts +130 -0
  36. package/dist/subjects-server.d.ts +130 -0
  37. package/dist/subjects-server.js +217 -0
  38. package/dist/subjects-server.js.map +1 -0
  39. package/dist/subjects.cjs +501 -0
  40. package/dist/subjects.cjs.map +1 -0
  41. package/dist/subjects.css +166 -0
  42. package/dist/subjects.d.cts +178 -0
  43. package/dist/subjects.d.ts +178 -0
  44. package/dist/subjects.js +465 -0
  45. package/dist/subjects.js.map +1 -0
  46. package/package.json +23 -2
  47. package/dist/types-D7pVK0GK.d.cts +0 -39
  48. package/dist/types-D7pVK0GK.d.ts +0 -39
package/dist/account.css CHANGED
@@ -259,6 +259,97 @@
259
259
  border-top: 1px solid var(--sf-account-line, color-mix(in srgb, currentColor 14%, transparent));
260
260
  }
261
261
 
262
+ /*
263
+ * Account settings (<SessionsList> and the other sections of the settings page). Optional and neutral.
264
+ * Variables: --sf-account-gap, --sf-account-muted, --sf-account-line, --sf-account-radius (same as the order screens).
265
+ */
266
+ [data-sf-sessions] {
267
+ display: grid;
268
+ gap: var(--sf-account-gap, 1rem);
269
+ }
270
+ [data-sf-sessions-list] {
271
+ display: grid;
272
+ gap: 0.75rem;
273
+ margin: 0;
274
+ padding: 0;
275
+ list-style: none;
276
+ }
277
+ [data-sf-session] {
278
+ display: grid;
279
+ gap: 0.25rem;
280
+ padding: 0.875rem 1rem;
281
+ border: 1px solid var(--sf-account-line, color-mix(in srgb, currentColor 16%, transparent));
282
+ border-radius: var(--sf-account-radius, 0.75rem);
283
+ }
284
+ [data-sf-session-device],
285
+ [data-sf-session-meta] {
286
+ margin: 0;
287
+ }
288
+ [data-sf-session-meta] {
289
+ color: var(--sf-account-muted, color-mix(in srgb, currentColor 72%, transparent));
290
+ }
291
+ [data-sf-session-current] {
292
+ font-weight: 600;
293
+ }
294
+ [data-sf-session-revoke],
295
+ [data-sf-session-revoke-others] {
296
+ min-height: 44px;
297
+ justify-self: start;
298
+ }
299
+ [data-sf-sessions-error],
300
+ [data-sf-sessions-degraded] {
301
+ margin: 0;
302
+ }
303
+ [data-sf-sessions-error] {
304
+ color: var(--sf-field-error, #b42318);
305
+ }
306
+ @media (prefers-reduced-motion: no-preference) {
307
+ [data-sf-session] {
308
+ transition: border-color 0.15s ease;
309
+ }
310
+ }
311
+
312
+ /* Language and notification preferences (<LanguagePreference>, <NotificationPreferences>). */
313
+ [data-sf-lang] form,
314
+ [data-sf-notif] form {
315
+ display: grid;
316
+ gap: var(--sf-account-gap, 1rem);
317
+ }
318
+ [data-sf-lang-select] {
319
+ min-height: 44px;
320
+ }
321
+ [data-sf-notif-table] {
322
+ width: 100%;
323
+ border-collapse: collapse;
324
+ }
325
+ [data-sf-notif-table] th,
326
+ [data-sf-notif-table] td {
327
+ padding: 0.5rem 0.25rem;
328
+ text-align: center;
329
+ }
330
+ [data-sf-notif-table] tbody th {
331
+ text-align: start;
332
+ font-weight: 500;
333
+ }
334
+ [data-sf-notif-table] input[type='checkbox'] {
335
+ width: 1.5rem;
336
+ height: 1.5rem;
337
+ }
338
+ [data-sf-notif-required] {
339
+ margin: 0;
340
+ color: var(--sf-account-muted, color-mix(in srgb, currentColor 72%, transparent));
341
+ }
342
+ [data-sf-lang-submit],
343
+ [data-sf-notif-submit] {
344
+ min-height: 44px;
345
+ justify-self: start;
346
+ }
347
+ [data-sf-lang-error],
348
+ [data-sf-notif-error] {
349
+ margin: 0;
350
+ color: var(--sf-field-error, #b42318);
351
+ }
352
+
262
353
  /* Paquetería sobre el nombre del envío (el texto lo escribe `shipment.carrier`). */
263
354
  [data-sf-shipment-eyebrow] {
264
355
  display: block;
@@ -1,9 +1,9 @@
1
1
  import * as react from 'react';
2
2
  import { ComponentType, ReactNode, MouseEvent } from 'react';
3
- import { CustomerCapabilities, Order, NextAction, OrderProgress as OrderProgress$1, OrderLine, Shipment, ShipmentMap, InvoiceDoc, InvoiceSummary, InvoiceFileKind, PendingPayment, PaymentInfo, Refund, StorefrontClient, Connection, Money } from '@asteby/storefront';
3
+ import { CustomerCapabilities, Order, NextAction, OrderProgress as OrderProgress$1, OrderLine, Shipment, ShipmentMap, InvoiceDoc, InvoiceSummary, InvoiceFileKind, PendingPayment, PaymentInfo, Refund, StorefrontClient, Connection, Money, CustomerSessionInfo, CustomerPreferences } from '@asteby/storefront';
4
4
  import { a as CheckoutFieldClassNames } from './fields-vnMUi2HB.cjs';
5
- import { A as AuthActionData, c as AuthStep, a as AuthErrorCode } from './types-D7pVK0GK.cjs';
6
- export { b as AuthIntent } from './types-D7pVK0GK.cjs';
5
+ import { a as AuthActionData, d as AuthStep, b as AuthErrorCode, A as AccountSettingsActionData } from './settings-types-jxFQFFqP.cjs';
6
+ export { c as AuthIntent, S as SettingsErrorCode, e as SettingsIntent } from './settings-types-jxFQFFqP.cjs';
7
7
  import { a as ProductPreviewClassNames, e as ProductThumbImage } from './product-preview-DRtLWGLS.cjs';
8
8
  export { P as ProductPreview, b as ProductPreviewProps, c as ProductThumb, f as ProductThumbProps, g as ProductThumbStack, h as ProductThumbStackProps, p as productInitials } from './product-preview-DRtLWGLS.cjs';
9
9
  import './components-B5XhSH-m.cjs';
@@ -137,7 +137,7 @@ declare function PostPurchaseAccountPrompt({ email, capabilities, data, next, pe
137
137
  * never as a raw code.
138
138
  */
139
139
 
140
- declare const ES: {
140
+ declare const ES$1: {
141
141
  readonly 'order.number': "Pedido {number}";
142
142
  readonly 'order.placed': "Realizado el {date}";
143
143
  readonly 'order.total': "Total";
@@ -308,7 +308,7 @@ declare const ES: {
308
308
  readonly 'section.retry': "Reintentar";
309
309
  readonly 'section.loading': "Cargando";
310
310
  };
311
- type AccountMessageKey = keyof typeof ES;
311
+ type AccountMessageKey = keyof typeof ES$1;
312
312
  type AccountMessages = Record<AccountMessageKey, string>;
313
313
  /** Messages for a locale (`es*` default, `en*`), with optional per-key overrides. */
314
314
  declare function accountMessages(locale?: string | null, overrides?: Partial<AccountMessages> | null): AccountMessages;
@@ -657,4 +657,128 @@ declare function barcodeGeometry(value: string, opts?: {
657
657
  height?: number;
658
658
  }): BarcodeGeometry | null;
659
659
 
660
- export { AccountAuth, type AccountAuthClassNames, type AccountAuthMessages, type AccountAuthProps, type AccountAuthView, type AccountFormProps, type AccountMessageKey, type AccountMessages, type AccountStatus, type AccountTextProps, AuthActionData, AuthErrorCode, AuthStep, Barcode, type BarcodeGeometry, type BarcodeProps, InvoiceList, type InvoiceListClassNames, type InvoiceListProps, NextActionBar, type NextActionBarClassNames, type NextActionBarProps, OrderCard, type OrderCardClassNames, type OrderCardProps, OrderLines, type OrderLinesClassNames, type OrderLinesProps, OrderList, type OrderListClassNames, type OrderListProps, OrderProductsStack, OrderProgress, type OrderProgressClassNames, type OrderProgressProps, OrderStatusBadge, type OrderStatusBadgeProps, type OrderTone, type PaymentLabelOptions, type PaymentMethodKey, PaymentSummary, type PaymentSummaryProps, PendingPaymentCard, type PendingPaymentCardClassNames, type PendingPaymentCardProps, PendingPaymentList, type PendingPaymentListProps, PostPurchaseAccountPrompt, type PostPurchaseAccountPromptClassNames, type PostPurchaseAccountPromptMessages, type PostPurchaseAccountPromptProps, RefundList, type RefundListClassNames, type RefundListProps, ShipmentCard, type ShipmentCardClassNames, type ShipmentCardProps, type ShipmentMapSlotProps, type UseConnectionResult, type UseCustomerOrderOptions, type UseCustomerOrderResult, type UseCustomerOrdersOptions, type UsePendingPaymentsOptions, type VoucherView, accountAuthMessages, accountMessages, barcodeGeometry, barcodeValue, code128Modules, enumText, lineImage, paymentLabel, paymentMethodKey, postPurchaseAccountPromptMessages, stageTone, useCustomerOrder, useCustomerOrders, usePendingPayments, voucherOf };
660
+ /**
661
+ * Texts of the account settings screens (`SessionsList`, and the other sections). Spanish (es-MX) by default,
662
+ * English with `en*`, anything with `messages`. Server errors are codes (`SettingsErrorCode`); the words are here.
663
+ */
664
+
665
+ declare const ES: {
666
+ 'settings.saved': string;
667
+ 'settings.error.session_expired': string;
668
+ 'settings.error.invalid_credential': string;
669
+ 'settings.error.reauth_required': string;
670
+ 'settings.error.rate_limited': string;
671
+ 'settings.error.rate_limited_in': string;
672
+ 'settings.error.validation': string;
673
+ 'settings.error.blocked_orders': string;
674
+ 'settings.error.blocked_pending_payments': string;
675
+ 'settings.error.unsupported': string;
676
+ 'settings.error.unavailable': string;
677
+ 'lang.title': string;
678
+ 'lang.label': string;
679
+ 'lang.default': string;
680
+ 'lang.save': string;
681
+ 'notif.title': string;
682
+ 'notif.intro': string;
683
+ 'notif.event.order_updates': string;
684
+ 'notif.event.shipping': string;
685
+ 'notif.event.restock': string;
686
+ 'notif.event.unknown': string;
687
+ 'notif.channel.email': string;
688
+ 'notif.channel.whatsapp': string;
689
+ 'notif.channel.unknown': string;
690
+ 'notif.required': string;
691
+ 'notif.save': string;
692
+ 'notif.matrixLabel': string;
693
+ 'sessions.title': string;
694
+ 'sessions.intro': string;
695
+ 'sessions.current': string;
696
+ 'sessions.lastUsed': string;
697
+ 'sessions.signedIn': string;
698
+ 'sessions.method.email': string;
699
+ 'sessions.method.phone': string;
700
+ 'sessions.method.password': string;
701
+ 'sessions.method.unknown': string;
702
+ 'sessions.revoke': string;
703
+ 'sessions.revokeLabel': string;
704
+ 'sessions.revokeOthers': string;
705
+ 'sessions.revoked': string;
706
+ 'sessions.revokedOthers': string;
707
+ 'sessions.none': string;
708
+ 'sessions.error': string;
709
+ 'sessions.loading': string;
710
+ 'sessions.listLabel': string;
711
+ };
712
+ type SettingsMessageKey = keyof typeof ES;
713
+ type SettingsMessages = Record<SettingsMessageKey, string>;
714
+ /** Messages for a locale (`es*` default, `en*`), with optional per-key overrides. */
715
+ declare function settingsMessages(locale?: string | null, overrides?: Partial<SettingsMessages> | null): SettingsMessages;
716
+ /** The text of an open enum (`<group>.<value>`), else `<group>.unknown`. Never the raw value. */
717
+ declare function settingsEnumText(m: SettingsMessages, group: string, value: unknown): string;
718
+
719
+ type SettingsTextProps = {
720
+ /** BCP 47; defaults to the provider's, then `es-MX`. */
721
+ locale?: string;
722
+ /** Per-key text overrides (a store's own words). */
723
+ messages?: Partial<SettingsMessages>;
724
+ /** IANA time zone for dates. Pass the store's own to get the same text on server and browser. */
725
+ timeZone?: string;
726
+ };
727
+
728
+ type SessionsListClassNames = Partial<Record<'root' | 'title' | 'intro' | 'list' | 'item' | 'device' | 'badge' | 'meta' | 'revoke' | 'revokeOthers' | 'notice' | 'error' | 'empty', string>>;
729
+ type SessionsListProps = SettingsTextProps & {
730
+ /** From `loadAccountSessions`. `null` = could not be loaded (the section degrades). */
731
+ sessions: CustomerSessionInfo[] | null;
732
+ /** What the settings action returned (`useActionData()`); drives the confirmation and the errors. */
733
+ data?: AccountSettingsActionData | null;
734
+ /** A submit is in flight: disables the buttons. */
735
+ pending?: boolean;
736
+ /** Form component, e.g. React Router's `Form`. Default: the HTML `<form>`. */
737
+ form?: 'form' | ComponentType<AccountFormProps>;
738
+ /** `action` of the forms: the route that mounts `createAccountSettingsAction`. Default: the current URL. */
739
+ action?: string;
740
+ /** Heading level of the title (default 3). */
741
+ headingLevel?: 2 | 3 | 4;
742
+ classNames?: SessionsListClassNames;
743
+ /** Extra content under the list. */
744
+ children?: ReactNode;
745
+ };
746
+ declare function SessionsList({ sessions, data, pending, form: FormTag, action, headingLevel, classNames: cx, children, ...text }: SessionsListProps): react.JSX.Element;
747
+
748
+ /** The optional events the server accepts (anything else is refused by it). */
749
+ declare const NOTIFICATION_EVENTS: readonly ["order_updates", "shipping", "restock"];
750
+ type SectionProps = SettingsTextProps & {
751
+ data?: AccountSettingsActionData | null;
752
+ pending?: boolean;
753
+ /** Form component, e.g. React Router's `Form`. Default: the HTML `<form>`. */
754
+ form?: 'form' | ComponentType<AccountFormProps>;
755
+ /** `action` of the form: the route that mounts `createAccountSettingsAction`. Default: the current URL. */
756
+ action?: string;
757
+ headingLevel?: 2 | 3 | 4;
758
+ children?: ReactNode;
759
+ };
760
+ type LanguagePreferenceClassNames = Partial<Record<'root' | 'title' | 'form' | 'label' | 'select' | 'submit' | 'notice' | 'error', string>>;
761
+ type LanguagePreferenceProps = SectionProps & {
762
+ /** The languages the store offers (`shop.locales`), as BCP 47 tags or `{ value, label }`. Fewer than two renders nothing. */
763
+ locales: ReadonlyArray<string | {
764
+ value: string;
765
+ label?: string;
766
+ }> | null | undefined;
767
+ /** The buyer's current language (`customer.locale`); `null` = the store's own. */
768
+ value?: string | null;
769
+ classNames?: LanguagePreferenceClassNames;
770
+ };
771
+ declare function LanguagePreference({ locales, value, data, pending, form: FormTag, action, headingLevel, classNames: cx, children, ...text }: LanguagePreferenceProps): react.JSX.Element | null;
772
+ type NotificationPreferencesClassNames = Partial<Record<'root' | 'title' | 'intro' | 'form' | 'table' | 'row' | 'event' | 'channel' | 'check' | 'required' | 'submit' | 'notice' | 'error', string>>;
773
+ type NotificationPreferencesProps = SectionProps & {
774
+ /** `capabilities.notifications.channels`: the channels the store can deliver on. Empty or absent renders nothing. */
775
+ channels: ReadonlyArray<string> | null | undefined;
776
+ /** `customer.preferences`. A choice never made counts as on (what the store sends today). */
777
+ preferences?: CustomerPreferences | null;
778
+ /** Events to offer (default: all the optional ones). */
779
+ events?: ReadonlyArray<string>;
780
+ classNames?: NotificationPreferencesClassNames;
781
+ };
782
+ declare function NotificationPreferences({ channels, preferences, events, data, pending, form: FormTag, action, headingLevel, classNames: cx, children, ...text }: NotificationPreferencesProps): react.JSX.Element | null;
783
+
784
+ export { AccountAuth, type AccountAuthClassNames, type AccountAuthMessages, type AccountAuthProps, type AccountAuthView, type AccountFormProps, type AccountMessageKey, type AccountMessages, AccountSettingsActionData, type AccountStatus, type AccountTextProps, AuthActionData, AuthErrorCode, AuthStep, Barcode, type BarcodeGeometry, type BarcodeProps, InvoiceList, type InvoiceListClassNames, type InvoiceListProps, LanguagePreference, type LanguagePreferenceClassNames, type LanguagePreferenceProps, NOTIFICATION_EVENTS, NextActionBar, type NextActionBarClassNames, type NextActionBarProps, NotificationPreferences, type NotificationPreferencesClassNames, type NotificationPreferencesProps, OrderCard, type OrderCardClassNames, type OrderCardProps, OrderLines, type OrderLinesClassNames, type OrderLinesProps, OrderList, type OrderListClassNames, type OrderListProps, OrderProductsStack, OrderProgress, type OrderProgressClassNames, type OrderProgressProps, OrderStatusBadge, type OrderStatusBadgeProps, type OrderTone, type PaymentLabelOptions, type PaymentMethodKey, PaymentSummary, type PaymentSummaryProps, PendingPaymentCard, type PendingPaymentCardClassNames, type PendingPaymentCardProps, PendingPaymentList, type PendingPaymentListProps, PostPurchaseAccountPrompt, type PostPurchaseAccountPromptClassNames, type PostPurchaseAccountPromptMessages, type PostPurchaseAccountPromptProps, RefundList, type RefundListClassNames, type RefundListProps, SessionsList, type SessionsListClassNames, type SessionsListProps, type SettingsMessageKey, type SettingsMessages, type SettingsTextProps, ShipmentCard, type ShipmentCardClassNames, type ShipmentCardProps, type ShipmentMapSlotProps, type UseConnectionResult, type UseCustomerOrderOptions, type UseCustomerOrderResult, type UseCustomerOrdersOptions, type UsePendingPaymentsOptions, type VoucherView, accountAuthMessages, accountMessages, barcodeGeometry, barcodeValue, code128Modules, enumText, lineImage, paymentLabel, paymentMethodKey, postPurchaseAccountPromptMessages, settingsEnumText, settingsMessages, stageTone, useCustomerOrder, useCustomerOrders, usePendingPayments, voucherOf };
package/dist/account.d.ts CHANGED
@@ -1,9 +1,9 @@
1
1
  import * as react from 'react';
2
2
  import { ComponentType, ReactNode, MouseEvent } from 'react';
3
- import { CustomerCapabilities, Order, NextAction, OrderProgress as OrderProgress$1, OrderLine, Shipment, ShipmentMap, InvoiceDoc, InvoiceSummary, InvoiceFileKind, PendingPayment, PaymentInfo, Refund, StorefrontClient, Connection, Money } from '@asteby/storefront';
3
+ import { CustomerCapabilities, Order, NextAction, OrderProgress as OrderProgress$1, OrderLine, Shipment, ShipmentMap, InvoiceDoc, InvoiceSummary, InvoiceFileKind, PendingPayment, PaymentInfo, Refund, StorefrontClient, Connection, Money, CustomerSessionInfo, CustomerPreferences } from '@asteby/storefront';
4
4
  import { a as CheckoutFieldClassNames } from './fields-vnMUi2HB.js';
5
- import { A as AuthActionData, c as AuthStep, a as AuthErrorCode } from './types-D7pVK0GK.js';
6
- export { b as AuthIntent } from './types-D7pVK0GK.js';
5
+ import { a as AuthActionData, d as AuthStep, b as AuthErrorCode, A as AccountSettingsActionData } from './settings-types-jxFQFFqP.js';
6
+ export { c as AuthIntent, S as SettingsErrorCode, e as SettingsIntent } from './settings-types-jxFQFFqP.js';
7
7
  import { a as ProductPreviewClassNames, e as ProductThumbImage } from './product-preview-DaICr4f2.js';
8
8
  export { P as ProductPreview, b as ProductPreviewProps, c as ProductThumb, f as ProductThumbProps, g as ProductThumbStack, h as ProductThumbStackProps, p as productInitials } from './product-preview-DaICr4f2.js';
9
9
  import './components-B5XhSH-m.js';
@@ -137,7 +137,7 @@ declare function PostPurchaseAccountPrompt({ email, capabilities, data, next, pe
137
137
  * never as a raw code.
138
138
  */
139
139
 
140
- declare const ES: {
140
+ declare const ES$1: {
141
141
  readonly 'order.number': "Pedido {number}";
142
142
  readonly 'order.placed': "Realizado el {date}";
143
143
  readonly 'order.total': "Total";
@@ -308,7 +308,7 @@ declare const ES: {
308
308
  readonly 'section.retry': "Reintentar";
309
309
  readonly 'section.loading': "Cargando";
310
310
  };
311
- type AccountMessageKey = keyof typeof ES;
311
+ type AccountMessageKey = keyof typeof ES$1;
312
312
  type AccountMessages = Record<AccountMessageKey, string>;
313
313
  /** Messages for a locale (`es*` default, `en*`), with optional per-key overrides. */
314
314
  declare function accountMessages(locale?: string | null, overrides?: Partial<AccountMessages> | null): AccountMessages;
@@ -657,4 +657,128 @@ declare function barcodeGeometry(value: string, opts?: {
657
657
  height?: number;
658
658
  }): BarcodeGeometry | null;
659
659
 
660
- export { AccountAuth, type AccountAuthClassNames, type AccountAuthMessages, type AccountAuthProps, type AccountAuthView, type AccountFormProps, type AccountMessageKey, type AccountMessages, type AccountStatus, type AccountTextProps, AuthActionData, AuthErrorCode, AuthStep, Barcode, type BarcodeGeometry, type BarcodeProps, InvoiceList, type InvoiceListClassNames, type InvoiceListProps, NextActionBar, type NextActionBarClassNames, type NextActionBarProps, OrderCard, type OrderCardClassNames, type OrderCardProps, OrderLines, type OrderLinesClassNames, type OrderLinesProps, OrderList, type OrderListClassNames, type OrderListProps, OrderProductsStack, OrderProgress, type OrderProgressClassNames, type OrderProgressProps, OrderStatusBadge, type OrderStatusBadgeProps, type OrderTone, type PaymentLabelOptions, type PaymentMethodKey, PaymentSummary, type PaymentSummaryProps, PendingPaymentCard, type PendingPaymentCardClassNames, type PendingPaymentCardProps, PendingPaymentList, type PendingPaymentListProps, PostPurchaseAccountPrompt, type PostPurchaseAccountPromptClassNames, type PostPurchaseAccountPromptMessages, type PostPurchaseAccountPromptProps, RefundList, type RefundListClassNames, type RefundListProps, ShipmentCard, type ShipmentCardClassNames, type ShipmentCardProps, type ShipmentMapSlotProps, type UseConnectionResult, type UseCustomerOrderOptions, type UseCustomerOrderResult, type UseCustomerOrdersOptions, type UsePendingPaymentsOptions, type VoucherView, accountAuthMessages, accountMessages, barcodeGeometry, barcodeValue, code128Modules, enumText, lineImage, paymentLabel, paymentMethodKey, postPurchaseAccountPromptMessages, stageTone, useCustomerOrder, useCustomerOrders, usePendingPayments, voucherOf };
660
+ /**
661
+ * Texts of the account settings screens (`SessionsList`, and the other sections). Spanish (es-MX) by default,
662
+ * English with `en*`, anything with `messages`. Server errors are codes (`SettingsErrorCode`); the words are here.
663
+ */
664
+
665
+ declare const ES: {
666
+ 'settings.saved': string;
667
+ 'settings.error.session_expired': string;
668
+ 'settings.error.invalid_credential': string;
669
+ 'settings.error.reauth_required': string;
670
+ 'settings.error.rate_limited': string;
671
+ 'settings.error.rate_limited_in': string;
672
+ 'settings.error.validation': string;
673
+ 'settings.error.blocked_orders': string;
674
+ 'settings.error.blocked_pending_payments': string;
675
+ 'settings.error.unsupported': string;
676
+ 'settings.error.unavailable': string;
677
+ 'lang.title': string;
678
+ 'lang.label': string;
679
+ 'lang.default': string;
680
+ 'lang.save': string;
681
+ 'notif.title': string;
682
+ 'notif.intro': string;
683
+ 'notif.event.order_updates': string;
684
+ 'notif.event.shipping': string;
685
+ 'notif.event.restock': string;
686
+ 'notif.event.unknown': string;
687
+ 'notif.channel.email': string;
688
+ 'notif.channel.whatsapp': string;
689
+ 'notif.channel.unknown': string;
690
+ 'notif.required': string;
691
+ 'notif.save': string;
692
+ 'notif.matrixLabel': string;
693
+ 'sessions.title': string;
694
+ 'sessions.intro': string;
695
+ 'sessions.current': string;
696
+ 'sessions.lastUsed': string;
697
+ 'sessions.signedIn': string;
698
+ 'sessions.method.email': string;
699
+ 'sessions.method.phone': string;
700
+ 'sessions.method.password': string;
701
+ 'sessions.method.unknown': string;
702
+ 'sessions.revoke': string;
703
+ 'sessions.revokeLabel': string;
704
+ 'sessions.revokeOthers': string;
705
+ 'sessions.revoked': string;
706
+ 'sessions.revokedOthers': string;
707
+ 'sessions.none': string;
708
+ 'sessions.error': string;
709
+ 'sessions.loading': string;
710
+ 'sessions.listLabel': string;
711
+ };
712
+ type SettingsMessageKey = keyof typeof ES;
713
+ type SettingsMessages = Record<SettingsMessageKey, string>;
714
+ /** Messages for a locale (`es*` default, `en*`), with optional per-key overrides. */
715
+ declare function settingsMessages(locale?: string | null, overrides?: Partial<SettingsMessages> | null): SettingsMessages;
716
+ /** The text of an open enum (`<group>.<value>`), else `<group>.unknown`. Never the raw value. */
717
+ declare function settingsEnumText(m: SettingsMessages, group: string, value: unknown): string;
718
+
719
+ type SettingsTextProps = {
720
+ /** BCP 47; defaults to the provider's, then `es-MX`. */
721
+ locale?: string;
722
+ /** Per-key text overrides (a store's own words). */
723
+ messages?: Partial<SettingsMessages>;
724
+ /** IANA time zone for dates. Pass the store's own to get the same text on server and browser. */
725
+ timeZone?: string;
726
+ };
727
+
728
+ type SessionsListClassNames = Partial<Record<'root' | 'title' | 'intro' | 'list' | 'item' | 'device' | 'badge' | 'meta' | 'revoke' | 'revokeOthers' | 'notice' | 'error' | 'empty', string>>;
729
+ type SessionsListProps = SettingsTextProps & {
730
+ /** From `loadAccountSessions`. `null` = could not be loaded (the section degrades). */
731
+ sessions: CustomerSessionInfo[] | null;
732
+ /** What the settings action returned (`useActionData()`); drives the confirmation and the errors. */
733
+ data?: AccountSettingsActionData | null;
734
+ /** A submit is in flight: disables the buttons. */
735
+ pending?: boolean;
736
+ /** Form component, e.g. React Router's `Form`. Default: the HTML `<form>`. */
737
+ form?: 'form' | ComponentType<AccountFormProps>;
738
+ /** `action` of the forms: the route that mounts `createAccountSettingsAction`. Default: the current URL. */
739
+ action?: string;
740
+ /** Heading level of the title (default 3). */
741
+ headingLevel?: 2 | 3 | 4;
742
+ classNames?: SessionsListClassNames;
743
+ /** Extra content under the list. */
744
+ children?: ReactNode;
745
+ };
746
+ declare function SessionsList({ sessions, data, pending, form: FormTag, action, headingLevel, classNames: cx, children, ...text }: SessionsListProps): react.JSX.Element;
747
+
748
+ /** The optional events the server accepts (anything else is refused by it). */
749
+ declare const NOTIFICATION_EVENTS: readonly ["order_updates", "shipping", "restock"];
750
+ type SectionProps = SettingsTextProps & {
751
+ data?: AccountSettingsActionData | null;
752
+ pending?: boolean;
753
+ /** Form component, e.g. React Router's `Form`. Default: the HTML `<form>`. */
754
+ form?: 'form' | ComponentType<AccountFormProps>;
755
+ /** `action` of the form: the route that mounts `createAccountSettingsAction`. Default: the current URL. */
756
+ action?: string;
757
+ headingLevel?: 2 | 3 | 4;
758
+ children?: ReactNode;
759
+ };
760
+ type LanguagePreferenceClassNames = Partial<Record<'root' | 'title' | 'form' | 'label' | 'select' | 'submit' | 'notice' | 'error', string>>;
761
+ type LanguagePreferenceProps = SectionProps & {
762
+ /** The languages the store offers (`shop.locales`), as BCP 47 tags or `{ value, label }`. Fewer than two renders nothing. */
763
+ locales: ReadonlyArray<string | {
764
+ value: string;
765
+ label?: string;
766
+ }> | null | undefined;
767
+ /** The buyer's current language (`customer.locale`); `null` = the store's own. */
768
+ value?: string | null;
769
+ classNames?: LanguagePreferenceClassNames;
770
+ };
771
+ declare function LanguagePreference({ locales, value, data, pending, form: FormTag, action, headingLevel, classNames: cx, children, ...text }: LanguagePreferenceProps): react.JSX.Element | null;
772
+ type NotificationPreferencesClassNames = Partial<Record<'root' | 'title' | 'intro' | 'form' | 'table' | 'row' | 'event' | 'channel' | 'check' | 'required' | 'submit' | 'notice' | 'error', string>>;
773
+ type NotificationPreferencesProps = SectionProps & {
774
+ /** `capabilities.notifications.channels`: the channels the store can deliver on. Empty or absent renders nothing. */
775
+ channels: ReadonlyArray<string> | null | undefined;
776
+ /** `customer.preferences`. A choice never made counts as on (what the store sends today). */
777
+ preferences?: CustomerPreferences | null;
778
+ /** Events to offer (default: all the optional ones). */
779
+ events?: ReadonlyArray<string>;
780
+ classNames?: NotificationPreferencesClassNames;
781
+ };
782
+ declare function NotificationPreferences({ channels, preferences, events, data, pending, form: FormTag, action, headingLevel, classNames: cx, children, ...text }: NotificationPreferencesProps): react.JSX.Element | null;
783
+
784
+ export { AccountAuth, type AccountAuthClassNames, type AccountAuthMessages, type AccountAuthProps, type AccountAuthView, type AccountFormProps, type AccountMessageKey, type AccountMessages, AccountSettingsActionData, type AccountStatus, type AccountTextProps, AuthActionData, AuthErrorCode, AuthStep, Barcode, type BarcodeGeometry, type BarcodeProps, InvoiceList, type InvoiceListClassNames, type InvoiceListProps, LanguagePreference, type LanguagePreferenceClassNames, type LanguagePreferenceProps, NOTIFICATION_EVENTS, NextActionBar, type NextActionBarClassNames, type NextActionBarProps, NotificationPreferences, type NotificationPreferencesClassNames, type NotificationPreferencesProps, OrderCard, type OrderCardClassNames, type OrderCardProps, OrderLines, type OrderLinesClassNames, type OrderLinesProps, OrderList, type OrderListClassNames, type OrderListProps, OrderProductsStack, OrderProgress, type OrderProgressClassNames, type OrderProgressProps, OrderStatusBadge, type OrderStatusBadgeProps, type OrderTone, type PaymentLabelOptions, type PaymentMethodKey, PaymentSummary, type PaymentSummaryProps, PendingPaymentCard, type PendingPaymentCardClassNames, type PendingPaymentCardProps, PendingPaymentList, type PendingPaymentListProps, PostPurchaseAccountPrompt, type PostPurchaseAccountPromptClassNames, type PostPurchaseAccountPromptMessages, type PostPurchaseAccountPromptProps, RefundList, type RefundListClassNames, type RefundListProps, SessionsList, type SessionsListClassNames, type SessionsListProps, type SettingsMessageKey, type SettingsMessages, type SettingsTextProps, ShipmentCard, type ShipmentCardClassNames, type ShipmentCardProps, type ShipmentMapSlotProps, type UseConnectionResult, type UseCustomerOrderOptions, type UseCustomerOrderResult, type UseCustomerOrdersOptions, type UsePendingPaymentsOptions, type VoucherView, accountAuthMessages, accountMessages, barcodeGeometry, barcodeValue, code128Modules, enumText, lineImage, paymentLabel, paymentMethodKey, postPurchaseAccountPromptMessages, settingsEnumText, settingsMessages, stageTone, useCustomerOrder, useCustomerOrders, usePendingPayments, voucherOf };