@zappie/foundations 0.5.0 → 0.6.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.
- package/CHANGELOG.md +17 -0
- package/README.md +5 -6
- package/dist/engine-D2iRshfW.d.ts +61 -0
- package/dist/index.d.ts +2 -2
- package/dist/overlay/engine.d.ts +3 -53
- package/dist/version.js +1 -1
- package/package.json +2 -6
- package/dist/account/parts.d.ts +0 -163
- package/dist/account/parts.js +0 -271
- package/dist/account/parts.js.map +0 -6
- package/dist/slot-CHfqzPTd.d.ts +0 -13
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,22 @@
|
|
|
1
1
|
# @zappie/foundations
|
|
2
2
|
|
|
3
|
+
## 0.6.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 9893d0c: Breaking: the site account client is removed. It was deprecated in the previous release because the shopper's Zappie account lives on the accounts portal and the API no longer serves its routes. Both packages take a minor bump because they are below 1.0.
|
|
8
|
+
|
|
9
|
+
`@zappie/sdk/account` no longer exports `createAccount`, `AccountClient`, `ScopeRequiredError`, `NotFoundError` or the account types. `@zappie/sdk/testing` no longer exports `mockAccountFetch`, `accountFixtures`, `MockAccountFixtures` or `MockAccountOptions`. The `@zappie/foundations/account` entry is removed with every part in it.
|
|
10
|
+
|
|
11
|
+
To link to the shopper's account, add `ZappieAccountLink` from `@zappie/foundations`, or build the address with `useZappieAccountUrl()`, `zappieAccountUrl(page)` or `accountsUrl()` from `@zappie/sdk/account`. These stay as they are.
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- Updated dependencies [9893d0c]
|
|
16
|
+
- Updated dependencies [546e44c]
|
|
17
|
+
- Updated dependencies [490c672]
|
|
18
|
+
- @zappie/sdk@0.6.0
|
|
19
|
+
|
|
3
20
|
## 0.5.0
|
|
4
21
|
|
|
5
22
|
### Minor Changes
|
package/README.md
CHANGED
|
@@ -31,12 +31,11 @@ Want ready-made, styled components instead? Copy them into your project from the
|
|
|
31
31
|
|
|
32
32
|
## Entry points
|
|
33
33
|
|
|
34
|
-
| Import | For
|
|
35
|
-
| ------------------------------- |
|
|
36
|
-
| `@zappie/foundations` | Every part
|
|
37
|
-
| `@zappie/foundations/
|
|
38
|
-
| `@zappie/foundations/
|
|
39
|
-
| `@zappie/foundations/rich-text` | Sanitising and parsing merchant rich text before you render it |
|
|
34
|
+
| Import | For |
|
|
35
|
+
| ------------------------------- | --------------------------------------------------------------- |
|
|
36
|
+
| `@zappie/foundations` | Every part |
|
|
37
|
+
| `@zappie/foundations/next` | Keeping overlays in step with Back and Forward in a Next.js app |
|
|
38
|
+
| `@zappie/foundations/rich-text` | Sanitising and parsing merchant rich text before you render it |
|
|
40
39
|
|
|
41
40
|
## Docs
|
|
42
41
|
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
import { AllHTMLAttributes, ReactNode, Ref } from 'react';
|
|
3
|
+
import { Dialog } from '@base-ui/react/dialog';
|
|
4
|
+
|
|
5
|
+
type PartOwnedAttributes = "children" | "defaultValue" | "value";
|
|
6
|
+
/**
|
|
7
|
+
* HTML attributes shared by foundation parts, with optional render-function children.
|
|
8
|
+
* Set asChild to merge the part props and ref into a single child element.
|
|
9
|
+
*/
|
|
10
|
+
type PartProps<S = Record<string, never>> = Omit<AllHTMLAttributes<HTMLElement>, PartOwnedAttributes> & {
|
|
11
|
+
asChild?: boolean;
|
|
12
|
+
children?: ReactNode | ((state: S) => ReactNode);
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
type Presentation = "dialog" | "drawer" | "sheet";
|
|
16
|
+
type SwipeDirection = "up" | "down" | "left" | "right";
|
|
17
|
+
type SurfaceProps = {
|
|
18
|
+
open: boolean;
|
|
19
|
+
presentation: Presentation;
|
|
20
|
+
swipeDirection: SwipeDirection;
|
|
21
|
+
/** Ids the trigger points at; caller-supplied ids win. */
|
|
22
|
+
contentId: string;
|
|
23
|
+
titleId?: string | undefined;
|
|
24
|
+
trigger: {
|
|
25
|
+
current: HTMLElement | null;
|
|
26
|
+
};
|
|
27
|
+
onOpen: () => void;
|
|
28
|
+
onClose: () => void;
|
|
29
|
+
onEscape?: ((event: KeyboardEvent) => void) | undefined;
|
|
30
|
+
onInteractOutside?: ((event: Event) => void) | undefined;
|
|
31
|
+
forceMount?: true | undefined;
|
|
32
|
+
container?: HTMLElement | null | undefined;
|
|
33
|
+
state: unknown;
|
|
34
|
+
contentProps: PartProps<never>;
|
|
35
|
+
contentRef: Ref<HTMLElement>;
|
|
36
|
+
};
|
|
37
|
+
type Parts = {
|
|
38
|
+
Title: typeof Dialog.Title;
|
|
39
|
+
Close: typeof Dialog.Close;
|
|
40
|
+
};
|
|
41
|
+
declare function useEngineParts(): Parts;
|
|
42
|
+
declare function Surface(props: SurfaceProps & {
|
|
43
|
+
children?: ReactNode;
|
|
44
|
+
}): react.JSX.Element;
|
|
45
|
+
declare const EngineTitle: react.ForwardRefExoticComponent<Omit<react.AllHTMLAttributes<HTMLElement>, PartOwnedAttributes> & {
|
|
46
|
+
asChild?: boolean;
|
|
47
|
+
children?: ReactNode | ((state: unknown) => ReactNode);
|
|
48
|
+
} & {
|
|
49
|
+
id?: string | undefined;
|
|
50
|
+
state: unknown;
|
|
51
|
+
} & react.RefAttributes<HTMLElement>>;
|
|
52
|
+
declare const EngineClose: react.ForwardRefExoticComponent<Omit<react.AllHTMLAttributes<HTMLElement>, PartOwnedAttributes> & {
|
|
53
|
+
asChild?: boolean;
|
|
54
|
+
children?: ReactNode | ((state: unknown) => ReactNode);
|
|
55
|
+
} & {
|
|
56
|
+
id?: string | undefined;
|
|
57
|
+
state: unknown;
|
|
58
|
+
} & react.RefAttributes<HTMLElement>>;
|
|
59
|
+
|
|
60
|
+
export { EngineClose as E, EngineTitle as c, Surface as d, useEngineParts as u };
|
|
61
|
+
export type { PartOwnedAttributes as P, SwipeDirection as S, PartProps as a, Presentation as b, SurfaceProps as e };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { P as PartOwnedAttributes, a as PartProps } from './
|
|
1
|
+
import { P as PartOwnedAttributes, a as PartProps } from './engine-D2iRshfW.js';
|
|
2
|
+
import { Presentation, SwipeDirection } from './overlay/engine.js';
|
|
2
3
|
import * as react from 'react';
|
|
3
4
|
import { HTMLAttributes, ReactNode, ComponentType, ReactElement, KeyboardEvent as KeyboardEvent$1, ImgHTMLAttributes, ChangeEvent, ClipboardEvent } from 'react';
|
|
4
5
|
import { ZappieEnvironment } from '@zappie/sdk/services';
|
|
5
6
|
import * as _zappie_sdk from '@zappie/sdk';
|
|
6
7
|
import { Branch as Branch$1, CartLine, CartLineInput, CartIssue, CartFix, Quote, DeliveryAddress, MenuSchedule, CartFulfilment, OptionGroup as OptionGroup$1, Item, Money as Money$1, Choice as Choice$1, MoneyFormatOptions, PaymentMethodKind, Category, Menu, Store, OpeningTime } from '@zappie/sdk';
|
|
7
8
|
import { useCart } from '@zappie/sdk/react';
|
|
8
|
-
import { Presentation, SwipeDirection } from './overlay/engine.js';
|
|
9
9
|
import { C as CloseOptions, O as OverlayQuery } from './history-BlytQinP.js';
|
|
10
10
|
import '@base-ui/react/dialog';
|
|
11
11
|
|
package/dist/overlay/engine.d.ts
CHANGED
|
@@ -1,53 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import { ReactNode, Ref } from 'react';
|
|
5
|
-
import { Dialog } from '@base-ui/react/dialog';
|
|
6
|
-
|
|
7
|
-
type Presentation = "dialog" | "drawer" | "sheet";
|
|
8
|
-
type SwipeDirection = "up" | "down" | "left" | "right";
|
|
9
|
-
type SurfaceProps = {
|
|
10
|
-
open: boolean;
|
|
11
|
-
presentation: Presentation;
|
|
12
|
-
swipeDirection: SwipeDirection;
|
|
13
|
-
/** Ids the trigger points at; caller-supplied ids win. */
|
|
14
|
-
contentId: string;
|
|
15
|
-
titleId?: string | undefined;
|
|
16
|
-
trigger: {
|
|
17
|
-
current: HTMLElement | null;
|
|
18
|
-
};
|
|
19
|
-
onOpen: () => void;
|
|
20
|
-
onClose: () => void;
|
|
21
|
-
onEscape?: ((event: KeyboardEvent) => void) | undefined;
|
|
22
|
-
onInteractOutside?: ((event: Event) => void) | undefined;
|
|
23
|
-
forceMount?: true | undefined;
|
|
24
|
-
container?: HTMLElement | null | undefined;
|
|
25
|
-
state: unknown;
|
|
26
|
-
contentProps: PartProps<never>;
|
|
27
|
-
contentRef: Ref<HTMLElement>;
|
|
28
|
-
};
|
|
29
|
-
type Parts = {
|
|
30
|
-
Title: typeof Dialog.Title;
|
|
31
|
-
Close: typeof Dialog.Close;
|
|
32
|
-
};
|
|
33
|
-
declare function useEngineParts(): Parts;
|
|
34
|
-
declare function Surface(props: SurfaceProps & {
|
|
35
|
-
children?: ReactNode;
|
|
36
|
-
}): react.JSX.Element;
|
|
37
|
-
declare const EngineTitle: react.ForwardRefExoticComponent<Omit<react.AllHTMLAttributes<HTMLElement>, PartOwnedAttributes> & {
|
|
38
|
-
asChild?: boolean;
|
|
39
|
-
children?: ReactNode | ((state: unknown) => ReactNode);
|
|
40
|
-
} & {
|
|
41
|
-
id?: string | undefined;
|
|
42
|
-
state: unknown;
|
|
43
|
-
} & react.RefAttributes<HTMLElement>>;
|
|
44
|
-
declare const EngineClose: react.ForwardRefExoticComponent<Omit<react.AllHTMLAttributes<HTMLElement>, PartOwnedAttributes> & {
|
|
45
|
-
asChild?: boolean;
|
|
46
|
-
children?: ReactNode | ((state: unknown) => ReactNode);
|
|
47
|
-
} & {
|
|
48
|
-
id?: string | undefined;
|
|
49
|
-
state: unknown;
|
|
50
|
-
} & react.RefAttributes<HTMLElement>>;
|
|
51
|
-
|
|
52
|
-
export { EngineClose, EngineTitle, Surface, useEngineParts };
|
|
53
|
-
export type { Presentation, SurfaceProps, SwipeDirection };
|
|
1
|
+
export { E as EngineClose, c as EngineTitle, b as Presentation, d as Surface, e as SurfaceProps, S as SwipeDirection, u as useEngineParts } from '../engine-D2iRshfW.js';
|
|
2
|
+
import 'react';
|
|
3
|
+
import '@base-ui/react/dialog';
|
package/dist/version.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zappie/foundations",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.6.0",
|
|
4
4
|
"description": "UI-less React primitives for Zappie storefronts: behaviour, state and accessibility without styles.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -9,10 +9,6 @@
|
|
|
9
9
|
"types": "./dist/index.d.ts",
|
|
10
10
|
"import": "./dist/index.js"
|
|
11
11
|
},
|
|
12
|
-
"./account": {
|
|
13
|
-
"types": "./dist/account/parts.d.ts",
|
|
14
|
-
"import": "./dist/account/parts.js"
|
|
15
|
-
},
|
|
16
12
|
"./next": {
|
|
17
13
|
"types": "./dist/next.d.ts",
|
|
18
14
|
"import": "./dist/next.js"
|
|
@@ -37,7 +33,7 @@
|
|
|
37
33
|
"dependencies": {
|
|
38
34
|
"@base-ui/react": "^1.9.0",
|
|
39
35
|
"@googlemaps/markerclusterer": "^2.6.2",
|
|
40
|
-
"@zappie/sdk": "^0.
|
|
36
|
+
"@zappie/sdk": "^0.6.0"
|
|
41
37
|
},
|
|
42
38
|
"peerDependencies": {
|
|
43
39
|
"react": "^18.2.0 || ^19.0.0",
|
package/dist/account/parts.d.ts
DELETED
|
@@ -1,163 +0,0 @@
|
|
|
1
|
-
import { P as PartOwnedAttributes } from '../slot-CHfqzPTd.js';
|
|
2
|
-
import { PartProps } from '../index.js';
|
|
3
|
-
import * as react from 'react';
|
|
4
|
-
import { SavedCard, AccountClient, CustomerPayment, PaymentReceipt, AccountScope, Wallet } from '@zappie/sdk/account';
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* Where an account read stands. `scope_required` means the shopper's sign-in doesn't cover it yet,
|
|
8
|
-
* and `not_found` that the card or payment isn't theirs.
|
|
9
|
-
*
|
|
10
|
-
* @deprecated The shopper's Zappie account lives on the accounts portal, so this is removed in the next minor release. Link to the portal with accountsUrl, or add ZappieAccountLink from @zappie/foundations.
|
|
11
|
-
*/
|
|
12
|
-
type AccountReadStatus = "loading" | "ready" | "error" | "scope_required" | "not_found";
|
|
13
|
-
/**
|
|
14
|
-
* An account read's status, its data once it has loaded, the error behind a failed read and a retry.
|
|
15
|
-
*
|
|
16
|
-
* @deprecated The shopper's Zappie account lives on the accounts portal, so this is removed in the next minor release. Link to the portal with accountsUrl, or add ZappieAccountLink from @zappie/foundations.
|
|
17
|
-
*/
|
|
18
|
-
type AccountReadState<T> = {
|
|
19
|
-
status: AccountReadStatus;
|
|
20
|
-
data: T | undefined;
|
|
21
|
-
error: unknown;
|
|
22
|
-
retry: () => void;
|
|
23
|
-
};
|
|
24
|
-
/**
|
|
25
|
-
* The scope a ScopeRequiredError names, or undefined for any other value.
|
|
26
|
-
*
|
|
27
|
-
* @deprecated The shopper's Zappie account lives on the accounts portal, so this is removed in the next minor release. Link to the portal with accountsUrl, or add ZappieAccountLink from @zappie/foundations.
|
|
28
|
-
*/
|
|
29
|
-
declare function missingScope(error: unknown): AccountScope | undefined;
|
|
30
|
-
/**
|
|
31
|
-
* Load the shopper's Zappie wallet and expose its balances, one per currency with naira first,
|
|
32
|
-
* to your render function. The element's `data-state` is the read's status.
|
|
33
|
-
*
|
|
34
|
-
* @deprecated The shopper's Zappie account lives on the accounts portal, so this is removed in the next minor release. Link to the portal with accountsUrl, or add ZappieAccountLink from @zappie/foundations.
|
|
35
|
-
*/
|
|
36
|
-
declare const Wallets: react.ForwardRefExoticComponent<Omit<react.AllHTMLAttributes<HTMLElement>, PartOwnedAttributes> & {
|
|
37
|
-
asChild?: boolean;
|
|
38
|
-
children?: react.ReactNode | ((state: AccountReadState<Wallet[]>) => react.ReactNode);
|
|
39
|
-
} & {
|
|
40
|
-
account: Pick<AccountClient, "wallets">;
|
|
41
|
-
} & react.RefAttributes<HTMLElement>>;
|
|
42
|
-
/**
|
|
43
|
-
* The saved cards read, and a remove that drops a card from the list once the API removes it.
|
|
44
|
-
*
|
|
45
|
-
* @deprecated The shopper's Zappie account lives on the accounts portal, so this is removed in the next minor release. Link to the portal with accountsUrl, or add ZappieAccountLink from @zappie/foundations.
|
|
46
|
-
*/
|
|
47
|
-
type CardsState = AccountReadState<SavedCard[]> & {
|
|
48
|
-
remove: (id: string) => Promise<void>;
|
|
49
|
-
};
|
|
50
|
-
/**
|
|
51
|
-
* Load the shopper's saved cards and expose them to your render function with `remove`.
|
|
52
|
-
* Pair `remove` with RemoveCard so the shopper confirms first.
|
|
53
|
-
*
|
|
54
|
-
* @deprecated The shopper's Zappie account lives on the accounts portal, so this is removed in the next minor release. Link to the portal with accountsUrl, or add ZappieAccountLink from @zappie/foundations.
|
|
55
|
-
*/
|
|
56
|
-
declare const Cards: react.ForwardRefExoticComponent<Omit<react.AllHTMLAttributes<HTMLElement>, PartOwnedAttributes> & {
|
|
57
|
-
asChild?: boolean;
|
|
58
|
-
children?: react.ReactNode | ((state: CardsState) => react.ReactNode);
|
|
59
|
-
} & {
|
|
60
|
-
account: Pick<AccountClient, "cards" | "removeCard">;
|
|
61
|
-
} & react.RefAttributes<HTMLElement>>;
|
|
62
|
-
/**
|
|
63
|
-
* Whether the confirmation is open, the removal is running, and the error from a failed removal.
|
|
64
|
-
*
|
|
65
|
-
* @deprecated The shopper's Zappie account lives on the accounts portal, so this is removed in the next minor release. Link to the portal with accountsUrl, or add ZappieAccountLink from @zappie/foundations.
|
|
66
|
-
*/
|
|
67
|
-
type RemoveCardState = {
|
|
68
|
-
open: boolean;
|
|
69
|
-
pending: boolean;
|
|
70
|
-
error: unknown;
|
|
71
|
-
};
|
|
72
|
-
declare function RemoveRoot({ onRemove, onRemoved, ...props }: PartProps<RemoveCardState> & {
|
|
73
|
-
/** Removes the card, such as `() => cards.remove(card.id)`. */
|
|
74
|
-
onRemove: () => Promise<void>;
|
|
75
|
-
onRemoved?: () => void;
|
|
76
|
-
}): react.JSX.Element;
|
|
77
|
-
/**
|
|
78
|
-
* A two-step card removal. Trigger opens the confirmation and Confirm takes focus. Confirm and
|
|
79
|
-
* Cancel render only while it is open, and Confirm runs `onRemove` once. A failed removal keeps it
|
|
80
|
-
* open with the error. Cancel returns focus to Trigger.
|
|
81
|
-
*
|
|
82
|
-
* @deprecated The shopper's Zappie account lives on the accounts portal, so this is removed in the next minor release. Link to the portal with accountsUrl, or add ZappieAccountLink from @zappie/foundations.
|
|
83
|
-
*/
|
|
84
|
-
declare const RemoveCard: {
|
|
85
|
-
Root: typeof RemoveRoot;
|
|
86
|
-
Trigger: react.ForwardRefExoticComponent<Omit<react.AllHTMLAttributes<HTMLElement>, PartOwnedAttributes> & {
|
|
87
|
-
asChild?: boolean;
|
|
88
|
-
children?: react.ReactNode | ((state: RemoveCardState) => react.ReactNode);
|
|
89
|
-
} & react.RefAttributes<HTMLElement>>;
|
|
90
|
-
Confirm: react.ForwardRefExoticComponent<Omit<react.AllHTMLAttributes<HTMLElement>, PartOwnedAttributes> & {
|
|
91
|
-
asChild?: boolean;
|
|
92
|
-
children?: react.ReactNode | ((state: RemoveCardState) => react.ReactNode);
|
|
93
|
-
} & react.RefAttributes<HTMLElement>>;
|
|
94
|
-
Cancel: react.ForwardRefExoticComponent<Omit<react.AllHTMLAttributes<HTMLElement>, PartOwnedAttributes> & {
|
|
95
|
-
asChild?: boolean;
|
|
96
|
-
children?: react.ReactNode | ((state: RemoveCardState) => react.ReactNode);
|
|
97
|
-
} & react.RefAttributes<HTMLElement>>;
|
|
98
|
-
};
|
|
99
|
-
/**
|
|
100
|
-
* The payments read so far, newest first, and the next page.
|
|
101
|
-
*
|
|
102
|
-
* @deprecated The shopper's Zappie account lives on the accounts portal, so this is removed in the next minor release. Link to the portal with accountsUrl, or add ZappieAccountLink from @zappie/foundations.
|
|
103
|
-
*/
|
|
104
|
-
type PaymentsState = AccountReadState<CustomerPayment[]> & {
|
|
105
|
-
hasMore: boolean;
|
|
106
|
-
loadingMore: boolean;
|
|
107
|
-
loadMore: () => void;
|
|
108
|
-
};
|
|
109
|
-
/**
|
|
110
|
-
* Load the shopper's payments at this business, newest first, and expose them to your render
|
|
111
|
-
* function. `loadMore` appends the next page while `hasMore` is true.
|
|
112
|
-
*
|
|
113
|
-
* @deprecated The shopper's Zappie account lives on the accounts portal, so this is removed in the next minor release. Link to the portal with accountsUrl, or add ZappieAccountLink from @zappie/foundations.
|
|
114
|
-
*/
|
|
115
|
-
declare const Payments: react.ForwardRefExoticComponent<Omit<react.AllHTMLAttributes<HTMLElement>, PartOwnedAttributes> & {
|
|
116
|
-
asChild?: boolean;
|
|
117
|
-
children?: react.ReactNode | ((state: PaymentsState) => react.ReactNode);
|
|
118
|
-
} & {
|
|
119
|
-
account: Pick<AccountClient, "payments">;
|
|
120
|
-
/** Payments a page, from 1 to 50. Defaults to the API's 20. */
|
|
121
|
-
limit?: number;
|
|
122
|
-
} & react.RefAttributes<HTMLElement>>;
|
|
123
|
-
/**
|
|
124
|
-
* The receipt read, and print, which opens the browser's print dialog.
|
|
125
|
-
*
|
|
126
|
-
* @deprecated The shopper's Zappie account lives on the accounts portal, so this is removed in the next minor release. Link to the portal with accountsUrl, or add ZappieAccountLink from @zappie/foundations.
|
|
127
|
-
*/
|
|
128
|
-
type ReceiptState = AccountReadState<PaymentReceipt> & {
|
|
129
|
-
print: () => void;
|
|
130
|
-
};
|
|
131
|
-
/**
|
|
132
|
-
* Load one payment's receipt and expose it to your render function with `print`. A payment that
|
|
133
|
-
* isn't the shopper's, or isn't at this business, reads as `not_found`.
|
|
134
|
-
*
|
|
135
|
-
* @deprecated The shopper's Zappie account lives on the accounts portal, so this is removed in the next minor release. Link to the portal with accountsUrl, or add ZappieAccountLink from @zappie/foundations.
|
|
136
|
-
*/
|
|
137
|
-
declare const Receipt: react.ForwardRefExoticComponent<Omit<react.AllHTMLAttributes<HTMLElement>, PartOwnedAttributes> & {
|
|
138
|
-
asChild?: boolean;
|
|
139
|
-
children?: react.ReactNode | ((state: ReceiptState) => react.ReactNode);
|
|
140
|
-
} & {
|
|
141
|
-
account: Pick<AccountClient, "payment">;
|
|
142
|
-
paymentId: string;
|
|
143
|
-
} & react.RefAttributes<HTMLElement>>;
|
|
144
|
-
/**
|
|
145
|
-
* Offer to sign in again when an account read failed for a scope the shopper's sign-in doesn't
|
|
146
|
-
* cover. It renders nothing for any other error. Its default label is "Sign in again to see this".
|
|
147
|
-
*
|
|
148
|
-
* @deprecated The shopper's Zappie account lives on the accounts portal, so this is removed in the next minor release. Link to the portal with accountsUrl, or add ZappieAccountLink from @zappie/foundations.
|
|
149
|
-
*/
|
|
150
|
-
declare const ScopeMissing: react.ForwardRefExoticComponent<Omit<react.AllHTMLAttributes<HTMLElement>, PartOwnedAttributes> & {
|
|
151
|
-
asChild?: boolean;
|
|
152
|
-
children?: react.ReactNode | ((state: {
|
|
153
|
-
scope: AccountScope;
|
|
154
|
-
}) => react.ReactNode);
|
|
155
|
-
} & {
|
|
156
|
-
/** The read's error, such as a part's `error` state. */
|
|
157
|
-
error: unknown;
|
|
158
|
-
/** Starts sign-in, such as `() => customer.signIn()`. */
|
|
159
|
-
signIn: () => void;
|
|
160
|
-
} & react.RefAttributes<HTMLElement>>;
|
|
161
|
-
|
|
162
|
-
export { Cards, Payments, Receipt, RemoveCard, ScopeMissing, Wallets, missingScope };
|
|
163
|
-
export type { AccountReadState, AccountReadStatus, CardsState, PaymentsState, ReceiptState, RemoveCardState };
|
package/dist/account/parts.js
DELETED
|
@@ -1,271 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
|
|
3
|
-
// src/account/parts.tsx
|
|
4
|
-
import {
|
|
5
|
-
createContext,
|
|
6
|
-
forwardRef,
|
|
7
|
-
useCallback,
|
|
8
|
-
useContext,
|
|
9
|
-
useEffect,
|
|
10
|
-
useRef,
|
|
11
|
-
useState
|
|
12
|
-
} from "react";
|
|
13
|
-
import { composeRefs, part } from "../internal/slot.js";
|
|
14
|
-
import { jsx } from "react/jsx-runtime";
|
|
15
|
-
function missingScope(error) {
|
|
16
|
-
const value = error;
|
|
17
|
-
return value?.apiCode === "scope_required" ? value.scope : void 0;
|
|
18
|
-
}
|
|
19
|
-
var statusOf = (error) => missingScope(error) ? "scope_required" : error?.status === 404 ? "not_found" : "error";
|
|
20
|
-
function useRead(load, key) {
|
|
21
|
-
const [state, setState] = useState({ status: "loading", data: void 0 });
|
|
22
|
-
const [attempt, setAttempt] = useState(0);
|
|
23
|
-
const latest = useRef(load);
|
|
24
|
-
latest.current = load;
|
|
25
|
-
useEffect(() => {
|
|
26
|
-
let live = true;
|
|
27
|
-
setState((current) => ({ status: "loading", data: current.data }));
|
|
28
|
-
latest.current().then(
|
|
29
|
-
(data) => {
|
|
30
|
-
if (live) {
|
|
31
|
-
setState({ status: "ready", data });
|
|
32
|
-
}
|
|
33
|
-
},
|
|
34
|
-
(error) => {
|
|
35
|
-
if (live) {
|
|
36
|
-
setState({ status: statusOf(error), data: void 0, error });
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
);
|
|
40
|
-
return () => {
|
|
41
|
-
live = false;
|
|
42
|
-
};
|
|
43
|
-
}, [key, attempt]);
|
|
44
|
-
return {
|
|
45
|
-
status: state.status,
|
|
46
|
-
data: state.data,
|
|
47
|
-
error: state.error,
|
|
48
|
-
retry: useCallback(() => setAttempt((value) => value + 1), []),
|
|
49
|
-
set: useCallback((data) => setState({ status: "ready", data }), [])
|
|
50
|
-
};
|
|
51
|
-
}
|
|
52
|
-
var readAttributes = (status) => ({
|
|
53
|
-
"data-state": status,
|
|
54
|
-
"aria-busy": status === "loading" || void 0
|
|
55
|
-
});
|
|
56
|
-
var Wallets = forwardRef(function Wallets2({ account, ...props }, ref) {
|
|
57
|
-
const { set: _set, ...state } = useRead(() => account.wallets(), account);
|
|
58
|
-
return part("div", props, state, readAttributes(state.status), ref);
|
|
59
|
-
});
|
|
60
|
-
var Cards = forwardRef(function Cards2({ account, ...props }, ref) {
|
|
61
|
-
const { set, ...read } = useRead(() => account.cards(), account);
|
|
62
|
-
const cards = useRef(read.data);
|
|
63
|
-
cards.current = read.data;
|
|
64
|
-
const remove = useCallback(
|
|
65
|
-
async (id) => {
|
|
66
|
-
await account.removeCard(id);
|
|
67
|
-
set((cards.current ?? []).filter((card) => card.id !== id));
|
|
68
|
-
},
|
|
69
|
-
[account, set]
|
|
70
|
-
);
|
|
71
|
-
const state = { ...read, remove };
|
|
72
|
-
return part("div", props, state, readAttributes(state.status), ref);
|
|
73
|
-
});
|
|
74
|
-
var RemoveContext = createContext(null);
|
|
75
|
-
var useRemove = (name) => {
|
|
76
|
-
const context = useContext(RemoveContext);
|
|
77
|
-
if (!context) {
|
|
78
|
-
throw new Error(`RemoveCard.${name} requires RemoveCard.Root`);
|
|
79
|
-
}
|
|
80
|
-
return context;
|
|
81
|
-
};
|
|
82
|
-
function RemoveRoot({
|
|
83
|
-
onRemove,
|
|
84
|
-
onRemoved,
|
|
85
|
-
...props
|
|
86
|
-
}) {
|
|
87
|
-
const [state, setState] = useState({
|
|
88
|
-
open: false,
|
|
89
|
-
pending: false,
|
|
90
|
-
error: void 0
|
|
91
|
-
});
|
|
92
|
-
const live = useRef(true);
|
|
93
|
-
useEffect(() => {
|
|
94
|
-
live.current = true;
|
|
95
|
-
return () => {
|
|
96
|
-
live.current = false;
|
|
97
|
-
};
|
|
98
|
-
}, []);
|
|
99
|
-
const trigger = useRef(null);
|
|
100
|
-
const wasOpen = useRef(false);
|
|
101
|
-
useEffect(() => {
|
|
102
|
-
if (wasOpen.current && !state.open) {
|
|
103
|
-
trigger.current?.focus();
|
|
104
|
-
}
|
|
105
|
-
wasOpen.current = state.open;
|
|
106
|
-
}, [state.open]);
|
|
107
|
-
const value = {
|
|
108
|
-
state,
|
|
109
|
-
trigger,
|
|
110
|
-
setOpen: (open) => setState(
|
|
111
|
-
(current) => current.pending ? current : { open, pending: false, error: void 0 }
|
|
112
|
-
),
|
|
113
|
-
confirm: () => {
|
|
114
|
-
if (state.pending) {
|
|
115
|
-
return;
|
|
116
|
-
}
|
|
117
|
-
setState({ open: true, pending: true, error: void 0 });
|
|
118
|
-
onRemove().then(
|
|
119
|
-
() => {
|
|
120
|
-
if (live.current) {
|
|
121
|
-
setState({ open: false, pending: false, error: void 0 });
|
|
122
|
-
}
|
|
123
|
-
onRemoved?.();
|
|
124
|
-
},
|
|
125
|
-
(error) => {
|
|
126
|
-
if (live.current) {
|
|
127
|
-
setState({ open: true, pending: false, error });
|
|
128
|
-
}
|
|
129
|
-
}
|
|
130
|
-
);
|
|
131
|
-
}
|
|
132
|
-
};
|
|
133
|
-
return /* @__PURE__ */ jsx(RemoveContext.Provider, { value, children: part("div", props, state, {
|
|
134
|
-
role: "group",
|
|
135
|
-
"data-state": state.open ? "open" : "closed"
|
|
136
|
-
}) });
|
|
137
|
-
}
|
|
138
|
-
var RemoveTrigger = forwardRef(
|
|
139
|
-
function RemoveTrigger2(props, ref) {
|
|
140
|
-
const { state, setOpen, trigger } = useRemove("Trigger");
|
|
141
|
-
return part(
|
|
142
|
-
"button",
|
|
143
|
-
props,
|
|
144
|
-
state,
|
|
145
|
-
{
|
|
146
|
-
type: "button",
|
|
147
|
-
"aria-expanded": state.open,
|
|
148
|
-
onClick: () => setOpen(true)
|
|
149
|
-
},
|
|
150
|
-
composeRefs(ref, trigger)
|
|
151
|
-
);
|
|
152
|
-
}
|
|
153
|
-
);
|
|
154
|
-
var RemoveConfirm = forwardRef(
|
|
155
|
-
function RemoveConfirm2(props, ref) {
|
|
156
|
-
const { state, confirm } = useRemove("Confirm");
|
|
157
|
-
const own = useRef(null);
|
|
158
|
-
useEffect(() => {
|
|
159
|
-
if (state.open) {
|
|
160
|
-
own.current?.focus();
|
|
161
|
-
}
|
|
162
|
-
}, [state.open]);
|
|
163
|
-
if (!state.open) {
|
|
164
|
-
return null;
|
|
165
|
-
}
|
|
166
|
-
return part(
|
|
167
|
-
"button",
|
|
168
|
-
props,
|
|
169
|
-
state,
|
|
170
|
-
{
|
|
171
|
-
type: "button",
|
|
172
|
-
"aria-disabled": state.pending || void 0,
|
|
173
|
-
"aria-busy": state.pending || void 0,
|
|
174
|
-
onClick: confirm
|
|
175
|
-
},
|
|
176
|
-
composeRefs(ref, own)
|
|
177
|
-
);
|
|
178
|
-
}
|
|
179
|
-
);
|
|
180
|
-
var RemoveCancel = forwardRef(
|
|
181
|
-
function RemoveCancel2(props, ref) {
|
|
182
|
-
const { state, setOpen } = useRemove("Cancel");
|
|
183
|
-
if (!state.open) {
|
|
184
|
-
return null;
|
|
185
|
-
}
|
|
186
|
-
return part(
|
|
187
|
-
"button",
|
|
188
|
-
props,
|
|
189
|
-
state,
|
|
190
|
-
{
|
|
191
|
-
type: "button",
|
|
192
|
-
"aria-disabled": state.pending || void 0,
|
|
193
|
-
onClick: () => setOpen(false)
|
|
194
|
-
},
|
|
195
|
-
ref
|
|
196
|
-
);
|
|
197
|
-
}
|
|
198
|
-
);
|
|
199
|
-
var RemoveCard = {
|
|
200
|
-
Root: RemoveRoot,
|
|
201
|
-
Trigger: RemoveTrigger,
|
|
202
|
-
Confirm: RemoveConfirm,
|
|
203
|
-
Cancel: RemoveCancel
|
|
204
|
-
};
|
|
205
|
-
var Payments = forwardRef(function Payments2({ account, limit, ...props }, ref) {
|
|
206
|
-
const page = (cursor) => account.payments({
|
|
207
|
-
...limit !== void 0 ? { limit } : {},
|
|
208
|
-
...cursor !== void 0 ? { cursor } : {}
|
|
209
|
-
});
|
|
210
|
-
const [more, setMore] = useState({ payments: [], cursor: null, loading: false });
|
|
211
|
-
const { set: _set, ...read } = useRead(async () => {
|
|
212
|
-
const first = await page();
|
|
213
|
-
setMore({ payments: [], cursor: first.next_cursor, loading: false });
|
|
214
|
-
return first.payments;
|
|
215
|
-
}, account);
|
|
216
|
-
const loadMore = () => {
|
|
217
|
-
const cursor = more.cursor;
|
|
218
|
-
if (cursor === null || more.loading) {
|
|
219
|
-
return;
|
|
220
|
-
}
|
|
221
|
-
setMore((current) => ({ ...current, loading: true }));
|
|
222
|
-
page(cursor).then(
|
|
223
|
-
(next) => setMore((current) => ({
|
|
224
|
-
payments: [...current.payments, ...next.payments],
|
|
225
|
-
cursor: next.next_cursor,
|
|
226
|
-
loading: false
|
|
227
|
-
})),
|
|
228
|
-
(error) => setMore((current) => ({ ...current, loading: false, error }))
|
|
229
|
-
);
|
|
230
|
-
};
|
|
231
|
-
const state = {
|
|
232
|
-
...read,
|
|
233
|
-
data: read.data && [...read.data, ...more.payments],
|
|
234
|
-
error: read.error ?? more.error,
|
|
235
|
-
hasMore: more.cursor !== null,
|
|
236
|
-
loadingMore: more.loading,
|
|
237
|
-
loadMore
|
|
238
|
-
};
|
|
239
|
-
return part("div", props, state, readAttributes(state.status), ref);
|
|
240
|
-
});
|
|
241
|
-
var Receipt = forwardRef(function Receipt2({ account, paymentId, ...props }, ref) {
|
|
242
|
-
const { set: _set, ...read } = useRead(
|
|
243
|
-
() => account.payment(paymentId),
|
|
244
|
-
`${paymentId}`
|
|
245
|
-
);
|
|
246
|
-
const state = { ...read, print: () => window.print() };
|
|
247
|
-
return part("div", props, state, readAttributes(state.status), ref);
|
|
248
|
-
});
|
|
249
|
-
var ScopeMissing = forwardRef(function ScopeMissing2({ error, signIn, ...props }, ref) {
|
|
250
|
-
const scope = missingScope(error);
|
|
251
|
-
if (!scope) {
|
|
252
|
-
return null;
|
|
253
|
-
}
|
|
254
|
-
return part(
|
|
255
|
-
"button",
|
|
256
|
-
{ ...props, children: props.children ?? "Sign in again to see this" },
|
|
257
|
-
{ scope },
|
|
258
|
-
{ type: "button", "data-scope": scope, onClick: signIn },
|
|
259
|
-
ref
|
|
260
|
-
);
|
|
261
|
-
});
|
|
262
|
-
export {
|
|
263
|
-
Cards,
|
|
264
|
-
Payments,
|
|
265
|
-
Receipt,
|
|
266
|
-
RemoveCard,
|
|
267
|
-
ScopeMissing,
|
|
268
|
-
Wallets,
|
|
269
|
-
missingScope
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AQ;AAAA,IAClD,OAAO,KAAK,SAAS,KAAK;AAAA,IAC1B,SAAS,KAAK,WAAW;AAAA,IACzB,aAAa,KAAK;AAAA,IAClB;AAAA,EACF;AACA,SAAO,KAAK,OAAO,OAAO,OAAO,eAAe,MAAM,MAAM,GAAG,GAAG;AACpE,CAAC;AAiBM,IAAM,UAAU,WAMrB,SAASC,SAAQ,EAAE,SAAS,WAAW,GAAG,MAAM,GAAG,KAAK;AACxD,QAAM,EAAE,KAAK,MAAM,GAAG,KAAK,IAAI;AAAA,IAC7B,MAAM,QAAQ,QAAQ,SAAS;AAAA,IAC/B,GAAG,SAAS;AAAA,EACd;AACA,QAAM,QAAQ,EAAE,GAAG,MAAM,OAAO,MAAM,OAAO,MAAM,EAAE;AACrD,SAAO,KAAK,OAAO,OAAO,OAAO,eAAe,MAAM,MAAM,GAAG,GAAG;AACpE,CAAC;AAQM,IAAM,eAAe,WAQ1B,SAASC,cAAa,EAAE,OAAO,QAAQ,GAAG,MAAM,GAAG,KAAK;AACxD,QAAM,QAAQ,aAAa,KAAK;AAChC,MAAI,CAAC,OAAO;AACV,WAAO;AAAA,EACT;AACA,SAAO;AAAA,IACL;AAAA,IACA,EAAE,GAAG,OAAO,UAAU,MAAM,YAAY,4BAA4B;AAAA,IACpE,EAAE,MAAM;AAAA,IACR,EAAE,MAAM,UAAU,cAAc,OAAO,SAAS,OAAO;AAAA,IACvD;AAAA,EACF;AACF,CAAC;",
|
|
5
|
-
"names": ["Wallets", "Cards", "RemoveTrigger", "RemoveConfirm", "RemoveCancel", "Payments", "Receipt", "ScopeMissing"]
|
|
6
|
-
}
|
package/dist/slot-CHfqzPTd.d.ts
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { AllHTMLAttributes, ReactNode } from 'react';
|
|
2
|
-
|
|
3
|
-
type PartOwnedAttributes = "children" | "defaultValue" | "value";
|
|
4
|
-
/**
|
|
5
|
-
* HTML attributes shared by foundation parts, with optional render-function children.
|
|
6
|
-
* Set asChild to merge the part props and ref into a single child element.
|
|
7
|
-
*/
|
|
8
|
-
type PartProps<S = Record<string, never>> = Omit<AllHTMLAttributes<HTMLElement>, PartOwnedAttributes> & {
|
|
9
|
-
asChild?: boolean;
|
|
10
|
-
children?: ReactNode | ((state: S) => ReactNode);
|
|
11
|
-
};
|
|
12
|
-
|
|
13
|
-
export type { PartOwnedAttributes as P, PartProps as a };
|