@shophost/react 2.0.36 → 2.0.37

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.
@@ -0,0 +1,2 @@
1
+ declare const AccountHomePage: () => import("react/jsx-runtime").JSX.Element;
2
+ export { AccountHomePage };
@@ -1,2 +1,3 @@
1
+ import { AccountHomePage } from './account-home-page';
1
2
  declare const AccountPages: () => import("react/jsx-runtime").JSX.Element;
2
- export { AccountPages };
3
+ export { AccountHomePage, AccountPages };
@@ -1,2 +1,2 @@
1
- declare const OrdersListPage: () => import("react/jsx-runtime").JSX.Element;
1
+ declare const OrdersListPage: () => import("react/jsx-runtime").JSX.Element | null;
2
2
  export { OrdersListPage };
@@ -0,0 +1,2 @@
1
+ declare const ReservationsListPage: () => import("react/jsx-runtime").JSX.Element | null;
2
+ export { ReservationsListPage };
@@ -0,0 +1,51 @@
1
+ import { Order, Reservation } from '../../../../../../client/src/index.ts';
2
+ import { LucideIcon } from 'lucide-react';
3
+ import { default as React } from 'react';
4
+ type Tone = "danger" | "info" | "neutral" | "success" | "warning";
5
+ declare const formatAccountDate: (value: Date | string | null | undefined, fallback?: string, pattern?: string) => string;
6
+ declare const formatOrderStatus: (status?: Order["status"]) => "Accepted" | "Preparing" | "On the way" | "Completed" | "Cancelled" | "Pending";
7
+ declare const getOrderTone: (status?: Order["status"]) => Tone;
8
+ declare const getReservationStatus: (reservation: Reservation) => "Cancelled" | "Pending" | "Confirmed";
9
+ declare const getReservationTone: (reservation: Reservation) => Tone;
10
+ declare const getInitials: (name?: string | null) => string;
11
+ interface AccountPageShellProps {
12
+ actions?: React.ReactNode;
13
+ children: React.ReactNode;
14
+ description?: React.ReactNode;
15
+ eyebrow?: React.ReactNode;
16
+ title: React.ReactNode;
17
+ }
18
+ declare const AccountPageShell: ({ actions, children, description, eyebrow, title, }: AccountPageShellProps) => import("react/jsx-runtime").JSX.Element;
19
+ interface AccountSectionCardProps {
20
+ action?: React.ReactNode;
21
+ children: React.ReactNode;
22
+ className?: string;
23
+ description?: React.ReactNode;
24
+ title: React.ReactNode;
25
+ }
26
+ declare const AccountSectionCard: ({ action, children, className, description, title, }: AccountSectionCardProps) => import("react/jsx-runtime").JSX.Element;
27
+ interface AccountStatusPillProps {
28
+ children: React.ReactNode;
29
+ className?: string;
30
+ tone?: Tone;
31
+ }
32
+ declare const AccountStatusPill: ({ children, className, tone, }: AccountStatusPillProps) => import("react/jsx-runtime").JSX.Element;
33
+ interface AccountEmptyStateProps {
34
+ actionHref?: string;
35
+ actionLabel?: string;
36
+ description: string;
37
+ icon: LucideIcon;
38
+ title: string;
39
+ }
40
+ declare const AccountEmptyState: ({ actionHref, actionLabel, description, icon: Icon, title, }: AccountEmptyStateProps) => import("react/jsx-runtime").JSX.Element;
41
+ interface AccountPageSkeletonProps {
42
+ description?: string;
43
+ title: string;
44
+ }
45
+ declare const AccountPageSkeleton: ({ description, title, }: AccountPageSkeletonProps) => import("react/jsx-runtime").JSX.Element;
46
+ interface AccountInlineLinkProps {
47
+ href: string;
48
+ label: string;
49
+ }
50
+ declare const AccountInlineLink: ({ href, label }: AccountInlineLinkProps) => import("react/jsx-runtime").JSX.Element;
51
+ export { AccountEmptyState, AccountInlineLink, AccountPageShell, AccountPageSkeleton, AccountSectionCard, AccountStatusPill, formatAccountDate, formatOrderStatus, getInitials, getOrderTone, getReservationStatus, getReservationTone, };
@@ -6,7 +6,7 @@ export { CartDrawer } from './components/cart/cart-drawer';
6
6
  export { CartDrawerItem } from './components/cart/cart-drawer-item';
7
7
  export { CustomerDetailsPage } from './components/pages/checkout-pages/customer-details-page';
8
8
  export { ShippingAndPaymentPage } from './components/pages/checkout-pages/shipping-and-payment-page';
9
- export { AccountPages } from './components/pages/account-pages';
9
+ export { AccountHomePage, AccountPages, } from './components/pages/account-pages';
10
10
  export { CheckoutPages } from './components/pages/checkout-pages';
11
11
  export { ModifiersDialog } from './components/modifiers/modifiers-dialog';
12
12
  export * from './components';
@@ -7,6 +7,7 @@ interface OrganizationContextType {
7
7
  error: string | Error | null;
8
8
  }
9
9
  interface OrganizationProviderProps {
10
+ initialOrganization?: Organization | null;
10
11
  organizationId: string;
11
12
  children: React.ReactNode;
12
13
  }
@@ -1,4 +1,4 @@
1
- import { Locale } from '../../../../client/src/index.ts';
1
+ import { Locale, Organization } from '../../../../client/src/index.ts';
2
2
  import { default as React } from 'react';
3
3
  export interface ShophostProviderProps {
4
4
  /**
@@ -13,6 +13,10 @@ export interface ShophostProviderProps {
13
13
  * Locale for translations
14
14
  */
15
15
  locale?: Locale;
16
+ /**
17
+ * Organization data available during initial render
18
+ */
19
+ initialOrganization?: Organization | null;
16
20
  /**
17
21
  * Custom modifiers modal component
18
22
  */
package/storefront.cjs CHANGED
@@ -1,2 +1,2 @@
1
1
  "use client";
2
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./admin-client.cjs");exports.APIProvider=o.APIProvider,exports.AccountPages=o.AccountPages,exports.Badge=o.Badge,exports.Button=o.Button,exports.CartDrawer=o.CartDrawer,exports.CartDrawerItem=o.CartDrawerItem,exports.CartItems=o.CartItems,exports.CartPanel=o.CartPanel,exports.CartProvider=o.CartProvider,exports.CheckoutPages=o.CheckoutPages,exports.Command=o.Command,exports.CommandBar=o.CommandBar,exports.CommandBarBar=o.CommandBarBar,exports.CommandBarCommand=o.CommandBarCommand,exports.CommandBarSeperator=o.CommandBarSeperator,exports.CommandBarValue=o.CommandBarValue,exports.CommandDialog=o.CommandDialog,exports.CommandEmpty=o.CommandEmpty,exports.CommandGroup=o.CommandGroup,exports.CommandInput=o.CommandInput,exports.CommandItem=o.CommandItem,exports.CommandList=o.CommandList,exports.CommandSeparator=o.CommandSeparator,exports.CommandShortcut=o.CommandShortcut,exports.CountryInput=o.CountryInput,exports.CustomerDetailsPage=o.CustomerDetailsPage,exports.Dialog=o.Dialog,exports.DialogClose=o.DialogClose,exports.DialogContent=o.DialogContent,exports.DialogDescription=o.DialogDescription,exports.DialogFooter=o.DialogFooter,exports.DialogHeader=o.DialogHeader,exports.DialogTitle=o.DialogTitle,exports.DialogTrigger=o.DialogTrigger,exports.Divider=o.Divider,exports.EmailInput=o.EmailInput,exports.ImageUploadInput=o.ImageUploadInput,exports.Input=o.Input,exports.InputGroup=o.InputGroup,exports.Label=o.Label,exports.LocationInput=o.LocationInput,exports.ModifierContainer=o.ModifierContainer,exports.ModifiersDialog=o.ModifiersDialog,exports.ModifiersGroup=o.ModifiersGroup,exports.ModifiersModal=o.ModifiersModal,exports.ModifiersOption=o.ModifiersOption,exports.PhoneNumberInput=o.PhoneNumberInput,exports.Popover=o.Popover,exports.PopoverAnchor=o.PopoverAnchor,exports.PopoverClose=o.PopoverClose,exports.PopoverContent=o.PopoverContent,exports.PopoverTrigger=o.PopoverTrigger,exports.QuantityControl=o.QuantityControl,exports.RadioCardGroup=o.RadioCardGroup,exports.RadioCardGroupIndicator=o.RadioCardGroupIndicator,exports.RadioCardItem=o.RadioCardItem,exports.SelectInput=o.SelectInput,exports.ShippingAndPaymentPage=o.ShippingAndPaymentPage,exports.ShophostProvider=o.ShophostProvider,exports.SliderOver=o.SliderOver,exports.Switch=o.Switch,exports.TextInput=o.TextInput,exports.TimeInput=o.TimeInput,exports.badgeVariants=o.badgeVariants,exports.buttonVariants=o.buttonVariants,exports.calculateCartTotal=o.calculateCartTotal,exports.findCartItem=o.findCartItem,exports.formatPrice=o.formatPrice,exports.getFieldError=o.getFieldError,exports.getFormattedModifiers=o.getFormattedModifiers,exports.mockProducts=o.mockProducts,exports.productRequiresModifiers=o.productRequiresModifiers,exports.useAPI=o.useAPI,exports.useCart=o.useCart,exports.useCartContext=o.useCartContext,exports.useLocalization=o.useLocalization,exports.useModifierSelection=o.useModifierSelection,exports.useModifiers=o.useModifiers,exports.useMultipleProductDetails=o.useMultipleProductDetails,exports.useOrganization=o.useOrganization,exports.useProductDetails=o.useProductDetails;
2
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./admin-client.cjs");exports.APIProvider=o.APIProvider,exports.AccountHomePage=o.AccountHomePage,exports.AccountPages=o.AccountPages,exports.Badge=o.Badge,exports.Button=o.Button,exports.CartDrawer=o.CartDrawer,exports.CartDrawerItem=o.CartDrawerItem,exports.CartItems=o.CartItems,exports.CartPanel=o.CartPanel,exports.CartProvider=o.CartProvider,exports.CheckoutPages=o.CheckoutPages,exports.Command=o.Command,exports.CommandBar=o.CommandBar,exports.CommandBarBar=o.CommandBarBar,exports.CommandBarCommand=o.CommandBarCommand,exports.CommandBarSeperator=o.CommandBarSeperator,exports.CommandBarValue=o.CommandBarValue,exports.CommandDialog=o.CommandDialog,exports.CommandEmpty=o.CommandEmpty,exports.CommandGroup=o.CommandGroup,exports.CommandInput=o.CommandInput,exports.CommandItem=o.CommandItem,exports.CommandList=o.CommandList,exports.CommandSeparator=o.CommandSeparator,exports.CommandShortcut=o.CommandShortcut,exports.CountryInput=o.CountryInput,exports.CustomerDetailsPage=o.CustomerDetailsPage,exports.Dialog=o.Dialog,exports.DialogClose=o.DialogClose,exports.DialogContent=o.DialogContent,exports.DialogDescription=o.DialogDescription,exports.DialogFooter=o.DialogFooter,exports.DialogHeader=o.DialogHeader,exports.DialogTitle=o.DialogTitle,exports.DialogTrigger=o.DialogTrigger,exports.Divider=o.Divider,exports.EmailInput=o.EmailInput,exports.ImageUploadInput=o.ImageUploadInput,exports.Input=o.Input,exports.InputGroup=o.InputGroup,exports.Label=o.Label,exports.LocationInput=o.LocationInput,exports.ModifierContainer=o.ModifierContainer,exports.ModifiersDialog=o.ModifiersDialog,exports.ModifiersGroup=o.ModifiersGroup,exports.ModifiersModal=o.ModifiersModal,exports.ModifiersOption=o.ModifiersOption,exports.PhoneNumberInput=o.PhoneNumberInput,exports.Popover=o.Popover,exports.PopoverAnchor=o.PopoverAnchor,exports.PopoverClose=o.PopoverClose,exports.PopoverContent=o.PopoverContent,exports.PopoverTrigger=o.PopoverTrigger,exports.QuantityControl=o.QuantityControl,exports.RadioCardGroup=o.RadioCardGroup,exports.RadioCardGroupIndicator=o.RadioCardGroupIndicator,exports.RadioCardItem=o.RadioCardItem,exports.SelectInput=o.SelectInput,exports.ShippingAndPaymentPage=o.ShippingAndPaymentPage,exports.ShophostProvider=o.ShophostProvider,exports.SliderOver=o.SliderOver,exports.Switch=o.Switch,exports.TextInput=o.TextInput,exports.TimeInput=o.TimeInput,exports.badgeVariants=o.badgeVariants,exports.buttonVariants=o.buttonVariants,exports.calculateCartTotal=o.calculateCartTotal,exports.findCartItem=o.findCartItem,exports.formatPrice=o.formatPrice,exports.getFieldError=o.getFieldError,exports.getFormattedModifiers=o.getFormattedModifiers,exports.mockProducts=o.mockProducts,exports.productRequiresModifiers=o.productRequiresModifiers,exports.useAPI=o.useAPI,exports.useCart=o.useCart,exports.useCartContext=o.useCartContext,exports.useLocalization=o.useLocalization,exports.useModifierSelection=o.useModifierSelection,exports.useModifiers=o.useModifiers,exports.useMultipleProductDetails=o.useMultipleProductDetails,exports.useOrganization=o.useOrganization,exports.useProductDetails=o.useProductDetails;
package/storefront.mjs CHANGED
@@ -1,84 +1,85 @@
1
1
  "use client";
2
- import { G as o, l as e, au as r, J as t, i, j as n, f as d, h as m, C as u, m as C, $ as l, am as p, an as g, ao as P, ap as c, aq as I, a0 as D, a3 as f, a4 as v, a1 as M, a5 as h, a2 as S, a7 as B, a6 as T, R as G, k as b, a8 as w, a9 as y, aa as A, ab as L, ac as R, ad as k, ae as x, af as F, aw as O, O as V, W as q, L as z, _ as E, Y as j, N as H, n as N, M as Q, o as U, q as J, p as K, P as W, ag as X, ah as Y, ai as Z, aj as _, ak as $, Q as aa, ar as sa, as as oa, at as ea, T as ra, S as ta, F as ia, al as na, U as da, V as ma, X as ua, av as Ca, K as la, w as pa, z as ga, x as Pa, Z as ca, y as Ia, D as Da, B as fa, H as va, d as Ma, u as ha, v as Sa, t as Ba, e as Ta, s as Ga, I as ba, r as wa } from "./admin-client.js";
2
+ import { H as o, l as e, m as r, av as t, K as i, i as n, j as d, f as m, h as u, C, n as l, a0 as p, an as g, ao as c, ap as P, aq as I, ar as D, a1 as f, a4 as v, a5 as M, a2 as h, a6 as S, a3 as B, a8 as T, a7 as A, T as G, k as b, a9 as w, aa as x, ab as y, ac as L, ad as R, ae as k, af as F, ag as O, ax as V, R as q, X as z, N as E, $ as H, Z as j, O as N, o as Q, M as U, p as J, r as K, q as W, P as X, ah as Y, ai as Z, aj as _, ak as $, al as aa, Q as sa, as as oa, at as ea, au as ra, U as ta, S as ia, G as na, am as da, V as ma, W as ua, Y as Ca, aw as la, L as pa, x as ga, B as ca, y as Pa, _ as Ia, z as Da, F as fa, D as va, I as Ma, d as ha, u as Sa, w as Ba, v as Ta, e as Aa, t as Ga, J as ba, s as wa } from "./admin-client.js";
3
3
  export {
4
4
  o as APIProvider,
5
- e as AccountPages,
6
- r as Badge,
7
- t as Button,
8
- i as CartDrawer,
9
- n as CartDrawerItem,
10
- d as CartItems,
11
- m as CartPanel,
12
- u as CartProvider,
13
- C as CheckoutPages,
14
- l as Command,
15
- p as CommandBar,
16
- g as CommandBarBar,
5
+ e as AccountHomePage,
6
+ r as AccountPages,
7
+ t as Badge,
8
+ i as Button,
9
+ n as CartDrawer,
10
+ d as CartDrawerItem,
11
+ m as CartItems,
12
+ u as CartPanel,
13
+ C as CartProvider,
14
+ l as CheckoutPages,
15
+ p as Command,
16
+ g as CommandBar,
17
+ c as CommandBarBar,
17
18
  P as CommandBarCommand,
18
- c as CommandBarSeperator,
19
- I as CommandBarValue,
20
- D as CommandDialog,
21
- f as CommandEmpty,
22
- v as CommandGroup,
23
- M as CommandInput,
24
- h as CommandItem,
25
- S as CommandList,
26
- B as CommandSeparator,
27
- T as CommandShortcut,
19
+ I as CommandBarSeperator,
20
+ D as CommandBarValue,
21
+ f as CommandDialog,
22
+ v as CommandEmpty,
23
+ M as CommandGroup,
24
+ h as CommandInput,
25
+ S as CommandItem,
26
+ B as CommandList,
27
+ T as CommandSeparator,
28
+ A as CommandShortcut,
28
29
  G as CountryInput,
29
30
  b as CustomerDetailsPage,
30
31
  w as Dialog,
31
- y as DialogClose,
32
- A as DialogContent,
32
+ x as DialogClose,
33
+ y as DialogContent,
33
34
  L as DialogDescription,
34
35
  R as DialogFooter,
35
36
  k as DialogHeader,
36
- x as DialogTitle,
37
- F as DialogTrigger,
38
- O as Divider,
39
- V as EmailInput,
40
- q as ImageUploadInput,
41
- z as Input,
42
- E as InputGroup,
37
+ F as DialogTitle,
38
+ O as DialogTrigger,
39
+ V as Divider,
40
+ q as EmailInput,
41
+ z as ImageUploadInput,
42
+ E as Input,
43
+ H as InputGroup,
43
44
  j as Label,
44
- H as LocationInput,
45
- N as ModifierContainer,
46
- Q as ModifiersDialog,
47
- U as ModifiersGroup,
48
- J as ModifiersModal,
49
- K as ModifiersOption,
50
- W as PhoneNumberInput,
51
- X as Popover,
52
- Y as PopoverAnchor,
53
- Z as PopoverClose,
54
- _ as PopoverContent,
55
- $ as PopoverTrigger,
56
- aa as QuantityControl,
57
- sa as RadioCardGroup,
58
- oa as RadioCardGroupIndicator,
59
- ea as RadioCardItem,
60
- ra as SelectInput,
61
- ta as ShippingAndPaymentPage,
62
- ia as ShophostProvider,
63
- na as SliderOver,
64
- da as Switch,
65
- ma as TextInput,
66
- ua as TimeInput,
67
- Ca as badgeVariants,
68
- la as buttonVariants,
69
- pa as calculateCartTotal,
70
- ga as findCartItem,
45
+ N as LocationInput,
46
+ Q as ModifierContainer,
47
+ U as ModifiersDialog,
48
+ J as ModifiersGroup,
49
+ K as ModifiersModal,
50
+ W as ModifiersOption,
51
+ X as PhoneNumberInput,
52
+ Y as Popover,
53
+ Z as PopoverAnchor,
54
+ _ as PopoverClose,
55
+ $ as PopoverContent,
56
+ aa as PopoverTrigger,
57
+ sa as QuantityControl,
58
+ oa as RadioCardGroup,
59
+ ea as RadioCardGroupIndicator,
60
+ ra as RadioCardItem,
61
+ ta as SelectInput,
62
+ ia as ShippingAndPaymentPage,
63
+ na as ShophostProvider,
64
+ da as SliderOver,
65
+ ma as Switch,
66
+ ua as TextInput,
67
+ Ca as TimeInput,
68
+ la as badgeVariants,
69
+ pa as buttonVariants,
70
+ ga as calculateCartTotal,
71
+ ca as findCartItem,
71
72
  Pa as formatPrice,
72
- ca as getFieldError,
73
- Ia as getFormattedModifiers,
74
- Da as mockProducts,
75
- fa as productRequiresModifiers,
76
- va as useAPI,
77
- Ma as useCart,
78
- ha as useCartContext,
79
- Sa as useLocalization,
80
- Ba as useModifierSelection,
81
- Ta as useModifiers,
73
+ Ia as getFieldError,
74
+ Da as getFormattedModifiers,
75
+ fa as mockProducts,
76
+ va as productRequiresModifiers,
77
+ Ma as useAPI,
78
+ ha as useCart,
79
+ Sa as useCartContext,
80
+ Ba as useLocalization,
81
+ Ta as useModifierSelection,
82
+ Aa as useModifiers,
82
83
  Ga as useMultipleProductDetails,
83
84
  ba as useOrganization,
84
85
  wa as useProductDetails