@indietabletop/appkit 6.1.5 → 7.0.0-0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/AppConfig/AppConfig.d.ts +29 -0
- package/dist/AuthCard/AuthCard.d.ts +10 -0
- package/dist/AuthCard/AuthCard.stories.d.ts +34 -0
- package/dist/AuthCard/style.css.d.ts +23 -0
- package/dist/DialogTrigger/index.d.ts +13 -0
- package/dist/DocumentTitle/DocumentTitle.d.ts +3 -0
- package/dist/EnumMapper.d.ts +25 -0
- package/dist/ExternalLink.d.ts +3 -0
- package/dist/FullscreenDismissBlocker.d.ts +5 -0
- package/{lib/HistoryState.ts → dist/HistoryState.d.ts} +2 -5
- package/dist/IndieTabletopClubLogo.d.ts +7 -0
- package/dist/IndieTabletopClubSymbol.d.ts +7 -0
- package/dist/InfoPage/index.d.ts +8 -0
- package/dist/InfoPage/pages.d.ts +2 -0
- package/dist/InfoPage/style.css.d.ts +5 -0
- package/dist/Letterhead/index.d.ts +19 -0
- package/dist/Letterhead/stories.d.ts +13 -0
- package/dist/Letterhead/style.css.d.ts +46 -0
- package/dist/LetterheadForm/LetterheadReadonlyTextField.stories.d.ts +17 -0
- package/dist/LetterheadForm/LetterheadSubmitError.stories.d.ts +11 -0
- package/dist/LetterheadForm/LetterheadTextField.stories.d.ts +336 -0
- package/dist/LetterheadForm/index.d.ts +44 -0
- package/dist/LetterheadForm/style.css.d.ts +8 -0
- package/dist/LoadingIndicator.d.ts +3 -0
- package/dist/MiddotSeparated/MiddotSeparated.d.ts +8 -0
- package/dist/MiddotSeparated/MiddotSeparated.stories.d.ts +586 -0
- package/dist/MiddotSeparated/style.css.d.ts +1 -0
- package/dist/ModalDialog/index.d.ts +12 -0
- package/dist/ModalDialog/style.css.d.ts +58 -0
- package/dist/ModernIDB/Cursor.d.ts +56 -0
- package/dist/ModernIDB/ModernIDB.d.ts +66 -0
- package/dist/ModernIDB/ModernIDBError.d.ts +3 -0
- package/dist/ModernIDB/ObjectStore.d.ts +112 -0
- package/dist/ModernIDB/ObjectStoreIndex.d.ts +53 -0
- package/dist/ModernIDB/Transaction.d.ts +16 -0
- package/dist/ModernIDB/VersionChangeManager.d.ts +30 -0
- package/dist/ModernIDB/bindings/factory.d.ts +12 -0
- package/dist/ModernIDB/bindings/index.d.ts +2 -0
- package/{lib/ModernIDB/bindings/types.ts → dist/ModernIDB/bindings/types.d.ts} +13 -32
- package/dist/ModernIDB/bindings/utils.d.ts +2 -0
- package/dist/ModernIDB/index.d.ts +10 -0
- package/dist/ModernIDB/types.d.ts +88 -0
- package/dist/ModernIDB/utils.d.ts +4 -0
- package/dist/QRCode/QRCode.d.ts +7 -0
- package/dist/QRCode/QRCode.stories.d.ts +33 -0
- package/dist/QRCode/style.css.d.ts +4 -0
- package/dist/ReleaseInfo/index.d.ts +5 -0
- package/dist/RulesetResolver.d.ts +87 -0
- package/dist/SafariCheck/SafariCheck.d.ts +23 -0
- package/dist/SafariCheck/SafariCheck.stories.d.ts +73 -0
- package/dist/SafariCheck/style.css.d.ts +17 -0
- package/dist/ServiceWorkerHandler.d.ts +11 -0
- package/dist/ShareButton/ShareButton.d.ts +57 -0
- package/dist/ShareButton/ShareButton.stories.d.ts +1577 -0
- package/dist/ShareButton/test.css.d.ts +1 -0
- package/dist/SubscribeCard/LetterheadInfoCard.d.ts +2 -0
- package/dist/SubscribeCard/SubscribeByEmailCard.d.ts +24 -0
- package/dist/SubscribeCard/SubscribeByEmailCard.stories.d.ts +10 -0
- package/dist/SubscribeCard/SubscribeByPledgeCard.d.ts +36 -0
- package/dist/SubscribeCard/SubscribeByPledgeCard.stories.d.ts +65 -0
- package/dist/SubscribeCard/style.css.d.ts +4 -0
- package/dist/account/AccountIssueView.d.ts +3 -0
- package/dist/account/AlreadyLoggedInView.d.ts +5 -0
- package/dist/account/CurrentUserFetcher.d.ts +20 -0
- package/dist/account/CurrentUserFetcher.stories.d.ts +136 -0
- package/dist/account/FailureFallbackView.d.ts +1 -0
- package/dist/account/JoinCard.d.ts +14 -0
- package/dist/account/JoinCard.stories.d.ts +143 -0
- package/dist/account/LoadingView.d.ts +1 -0
- package/dist/account/LoginCard.d.ts +39 -0
- package/dist/account/LoginCard.stories.d.ts +217 -0
- package/dist/account/LoginView.d.ts +10 -0
- package/dist/account/NoConnectionView.d.ts +4 -0
- package/dist/account/PasswordResetCard.d.ts +15 -0
- package/dist/account/PasswordResetCard.stories.d.ts +128 -0
- package/dist/account/UserMismatchView.d.ts +6 -0
- package/dist/account/VerifyPage.d.ts +13 -0
- package/dist/account/style.css.d.ts +10 -0
- package/{lib/account/types.ts → dist/account/types.d.ts} +3 -6
- package/dist/account/useFetchCurrentUser.d.ts +28 -0
- package/dist/account/useRedirectPath.d.ts +6 -0
- package/dist/animations.css.d.ts +3 -0
- package/dist/append-copy-to-text.d.ts +10 -0
- package/dist/append-copy-to-text.test.d.ts +1 -0
- package/dist/appkit.css +1 -0
- package/dist/appkit.js +10692 -0
- package/dist/async-op.d.ts +101 -0
- package/dist/atomic.css.d.ts +6 -0
- package/{lib/caught-value.ts → dist/caught-value.d.ts} +1 -11
- package/{lib/class-names.ts → dist/class-names.d.ts} +6 -17
- package/dist/client.d.ts +424 -0
- package/dist/common.css.d.ts +5 -0
- package/dist/copyrightRange.d.ts +1 -0
- package/dist/copyrightRange.test.d.ts +1 -0
- package/dist/createSafeStorage.d.ts +34 -0
- package/dist/failureMessages.d.ts +20 -0
- package/dist/failureMessages.test.d.ts +1 -0
- package/dist/form/FormSubmitButton.d.ts +17 -0
- package/dist/form/SubmitErrorAlert.d.ts +5 -0
- package/dist/form/style.css.d.ts +3 -0
- package/dist/globals.css.d.ts +0 -0
- package/dist/groupBy.d.ts +1 -0
- package/dist/groupBy.test.d.ts +1 -0
- package/dist/hrefs.d.ts +32 -0
- package/dist/hrefs.test.d.ts +1 -0
- package/dist/idToDate.d.ts +5 -0
- package/dist/idToDate.test.d.ts +1 -0
- package/dist/ids.d.ts +1 -0
- package/dist/ids.test.d.ts +1 -0
- package/dist/index.d.ts +64 -0
- package/dist/internal.css.d.ts +2 -0
- package/dist/mailto.d.ts +8 -0
- package/dist/mailto.test.d.ts +1 -0
- package/dist/media.d.ts +39 -0
- package/dist/random.d.ts +3 -0
- package/dist/result/swr.d.ts +4 -0
- package/{lib/sleep.ts → dist/sleep.d.ts} +1 -3
- package/dist/store/index.d.ts +237 -0
- package/dist/store/store.d.ts +144 -0
- package/dist/store/types.d.ts +49 -0
- package/dist/store/utils.d.ts +10 -0
- package/dist/storybook/decorators.d.ts +3 -0
- package/dist/structs.d.ts +1 -0
- package/{lib/typeguards.ts → dist/typeguards.d.ts} +1 -3
- package/dist/typeguards.test.d.ts +1 -0
- package/{lib/types.ts → dist/types.d.ts} +12 -23
- package/dist/unique.d.ts +10 -0
- package/dist/unique.test.d.ts +1 -0
- package/dist/use-async-op.d.ts +6 -0
- package/dist/use-document-background-color.d.ts +4 -0
- package/dist/use-form.d.ts +29 -0
- package/dist/use-is-installed.d.ts +8 -0
- package/dist/use-media-query.d.ts +1 -0
- package/dist/use-reverting-state.d.ts +5 -0
- package/dist/use-scroll-restoration.d.ts +25 -0
- package/dist/useEnsureValue.d.ts +6 -0
- package/dist/useInvokeClient.d.ts +25 -0
- package/dist/useIsVisible.d.ts +4 -0
- package/dist/utm.d.ts +58 -0
- package/dist/utm.test.d.ts +1 -0
- package/dist/validations.d.ts +3 -0
- package/dist/vars.css.d.ts +10 -0
- package/package.json +12 -5
- package/lib/AppConfig/AppConfig.tsx +0 -61
- package/lib/AuthCard/AuthCard.stories.ts +0 -34
- package/lib/AuthCard/AuthCard.tsx +0 -64
- package/lib/AuthCard/style.css.ts +0 -49
- package/lib/DialogTrigger/index.tsx +0 -36
- package/lib/DocumentTitle/DocumentTitle.tsx +0 -10
- package/lib/EnumMapper.ts +0 -50
- package/lib/ExternalLink.tsx +0 -10
- package/lib/FullscreenDismissBlocker.tsx +0 -23
- package/lib/IndieTabletopClubLogo.tsx +0 -44
- package/lib/IndieTabletopClubSymbol.tsx +0 -37
- package/lib/InfoPage/index.tsx +0 -46
- package/lib/InfoPage/pages.tsx +0 -36
- package/lib/InfoPage/style.css.ts +0 -36
- package/lib/Letterhead/index.tsx +0 -85
- package/lib/Letterhead/stories.tsx +0 -41
- package/lib/Letterhead/style.css.ts +0 -152
- package/lib/LetterheadForm/LetterheadReadonlyTextField.stories.tsx +0 -17
- package/lib/LetterheadForm/LetterheadSubmitError.stories.tsx +0 -19
- package/lib/LetterheadForm/LetterheadTextField.stories.tsx +0 -19
- package/lib/LetterheadForm/index.tsx +0 -137
- package/lib/LetterheadForm/style.css.ts +0 -89
- package/lib/LoadingIndicator.tsx +0 -40
- package/lib/MiddotSeparated/MiddotSeparated.stories.ts +0 -26
- package/lib/MiddotSeparated/MiddotSeparated.tsx +0 -24
- package/lib/MiddotSeparated/style.css.ts +0 -10
- package/lib/ModalDialog/index.tsx +0 -28
- package/lib/ModalDialog/style.css.ts +0 -88
- package/lib/ModernIDB/Cursor.ts +0 -91
- package/lib/ModernIDB/ModernIDB.ts +0 -337
- package/lib/ModernIDB/ModernIDBError.ts +0 -9
- package/lib/ModernIDB/ObjectStore.ts +0 -195
- package/lib/ModernIDB/ObjectStoreIndex.ts +0 -102
- package/lib/ModernIDB/README.md +0 -9
- package/lib/ModernIDB/Transaction.ts +0 -40
- package/lib/ModernIDB/VersionChangeManager.ts +0 -57
- package/lib/ModernIDB/bindings/factory.tsx +0 -165
- package/lib/ModernIDB/bindings/index.ts +0 -2
- package/lib/ModernIDB/bindings/utils.tsx +0 -32
- package/lib/ModernIDB/index.ts +0 -10
- package/lib/ModernIDB/types.ts +0 -120
- package/lib/ModernIDB/utils.ts +0 -51
- package/lib/QRCode/QRCode.stories.tsx +0 -41
- package/lib/QRCode/QRCode.tsx +0 -54
- package/lib/QRCode/style.css.ts +0 -23
- package/lib/ReleaseInfo/index.tsx +0 -29
- package/lib/RulesetResolver.ts +0 -214
- package/lib/SafariCheck/SafariCheck.stories.tsx +0 -99
- package/lib/SafariCheck/SafariCheck.tsx +0 -273
- package/lib/SafariCheck/addToDock.svg +0 -13
- package/lib/SafariCheck/addToHomeScreen.svg +0 -12
- package/lib/SafariCheck/safari.svg +0 -32
- package/lib/SafariCheck/shareIcon.svg +0 -11
- package/lib/SafariCheck/style.css.ts +0 -106
- package/lib/ServiceWorkerHandler.tsx +0 -53
- package/lib/ShareButton/ShareButton.stories.tsx +0 -58
- package/lib/ShareButton/ShareButton.tsx +0 -153
- package/lib/ShareButton/test.css.ts +0 -3
- package/lib/SubscribeCard/LetterheadInfoCard.tsx +0 -23
- package/lib/SubscribeCard/SubscribeByEmailCard.stories.tsx +0 -69
- package/lib/SubscribeCard/SubscribeByEmailCard.tsx +0 -183
- package/lib/SubscribeCard/SubscribeByPledgeCard.stories.tsx +0 -133
- package/lib/SubscribeCard/SubscribeByPledgeCard.tsx +0 -127
- package/lib/SubscribeCard/style.css.ts +0 -14
- package/lib/account/AccountIssueView.tsx +0 -44
- package/lib/account/AlreadyLoggedInView.tsx +0 -47
- package/lib/account/CurrentUserFetcher.stories.tsx +0 -292
- package/lib/account/CurrentUserFetcher.tsx +0 -118
- package/lib/account/FailureFallbackView.tsx +0 -36
- package/lib/account/JoinCard.stories.tsx +0 -257
- package/lib/account/JoinCard.tsx +0 -301
- package/lib/account/LoadingView.tsx +0 -14
- package/lib/account/LoginCard.stories.tsx +0 -288
- package/lib/account/LoginCard.tsx +0 -100
- package/lib/account/LoginView.tsx +0 -151
- package/lib/account/NoConnectionView.tsx +0 -34
- package/lib/account/PasswordResetCard.stories.tsx +0 -242
- package/lib/account/PasswordResetCard.tsx +0 -296
- package/lib/account/UserMismatchView.tsx +0 -62
- package/lib/account/VerifyPage.tsx +0 -195
- package/lib/account/style.css.ts +0 -57
- package/lib/account/useFetchCurrentUser.tsx +0 -63
- package/lib/account/useRedirectPath.ts +0 -21
- package/lib/animations.css.ts +0 -17
- package/lib/append-copy-to-text.ts +0 -35
- package/lib/async-op.ts +0 -286
- package/lib/atomic.css.ts +0 -11
- package/lib/client.ts +0 -662
- package/lib/common.css.ts +0 -48
- package/lib/copyrightRange.ts +0 -10
- package/lib/createSafeStorage.ts +0 -91
- package/lib/failureMessages.ts +0 -108
- package/lib/form/FormSubmitButton.tsx +0 -58
- package/lib/form/SubmitErrorAlert.tsx +0 -21
- package/lib/form/style.css.ts +0 -9
- package/lib/globals.css.ts +0 -62
- package/lib/groupBy.ts +0 -25
- package/lib/hrefs.ts +0 -48
- package/lib/idToDate.ts +0 -8
- package/lib/ids.ts +0 -6
- package/lib/index.ts +0 -71
- package/lib/internal.css.ts +0 -10
- package/lib/mailto.ts +0 -40
- package/lib/media.ts +0 -50
- package/lib/random.ts +0 -19
- package/lib/result/swr.ts +0 -18
- package/lib/store/index.tsx +0 -241
- package/lib/store/store.ts +0 -479
- package/lib/store/types.ts +0 -45
- package/lib/store/utils.ts +0 -54
- package/lib/storybook/decorators.tsx +0 -10
- package/lib/structs.ts +0 -3
- package/lib/unique.ts +0 -24
- package/lib/use-async-op.ts +0 -16
- package/lib/use-document-background-color.ts +0 -16
- package/lib/use-form.ts +0 -78
- package/lib/use-is-installed.ts +0 -17
- package/lib/use-media-query.ts +0 -21
- package/lib/use-reverting-state.ts +0 -32
- package/lib/use-scroll-restoration.ts +0 -99
- package/lib/useEnsureValue.ts +0 -31
- package/lib/useInvokeClient.ts +0 -54
- package/lib/useIsVisible.ts +0 -27
- package/lib/utm.ts +0 -92
- package/lib/validations.ts +0 -25
- package/lib/vars.css.ts +0 -13
|
@@ -0,0 +1,217 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The majority case where no user is stored locally, proactive user session
|
|
3
|
+
* check returns 401, and subsequently correct credentials are provided.
|
|
4
|
+
*/
|
|
5
|
+
export declare const Default: import('@storybook/react').ReactStory<import('@storybook/react').ReactTypes & import('@storybook/addon-docs').DocsTypes & {
|
|
6
|
+
csf4: true;
|
|
7
|
+
} & {
|
|
8
|
+
args: {
|
|
9
|
+
description: import('react').ReactNode;
|
|
10
|
+
defaultValues?: import('./types.ts').DefaultFormValues | undefined;
|
|
11
|
+
onLogin?: import('./types.ts').AuthEventHandler | undefined;
|
|
12
|
+
};
|
|
13
|
+
}, {
|
|
14
|
+
parameters: {
|
|
15
|
+
msw: {
|
|
16
|
+
handlers: {
|
|
17
|
+
getCurrentUser: import('msw').HttpHandler;
|
|
18
|
+
createNewSession: import('msw').HttpHandler;
|
|
19
|
+
};
|
|
20
|
+
};
|
|
21
|
+
};
|
|
22
|
+
}>;
|
|
23
|
+
/**
|
|
24
|
+
* Similar to the default case, but invalid credentials are provided to when
|
|
25
|
+
* attempting to create a new session.
|
|
26
|
+
*/
|
|
27
|
+
export declare const InvalidCredentialsOnSubmit: import('@storybook/react').ReactStory<import('@storybook/react').ReactTypes & import('@storybook/addon-docs').DocsTypes & {
|
|
28
|
+
csf4: true;
|
|
29
|
+
} & {
|
|
30
|
+
args: {
|
|
31
|
+
description: import('react').ReactNode;
|
|
32
|
+
defaultValues?: import('./types.ts').DefaultFormValues | undefined;
|
|
33
|
+
onLogin?: import('./types.ts').AuthEventHandler | undefined;
|
|
34
|
+
};
|
|
35
|
+
}, {
|
|
36
|
+
parameters: {
|
|
37
|
+
msw: {
|
|
38
|
+
handlers: {
|
|
39
|
+
getCurrentUser: import('msw').HttpHandler;
|
|
40
|
+
createNewSession: import('msw').HttpHandler;
|
|
41
|
+
};
|
|
42
|
+
};
|
|
43
|
+
};
|
|
44
|
+
}>;
|
|
45
|
+
/**
|
|
46
|
+
* Similar to the default case, but when credentials are provided, an account
|
|
47
|
+
* email is used that is not currently in the database.
|
|
48
|
+
*/
|
|
49
|
+
export declare const UserNotFoundOnSubmit: import('@storybook/react').ReactStory<import('@storybook/react').ReactTypes & import('@storybook/addon-docs').DocsTypes & {
|
|
50
|
+
csf4: true;
|
|
51
|
+
} & {
|
|
52
|
+
args: {
|
|
53
|
+
description: import('react').ReactNode;
|
|
54
|
+
defaultValues?: import('./types.ts').DefaultFormValues | undefined;
|
|
55
|
+
onLogin?: import('./types.ts').AuthEventHandler | undefined;
|
|
56
|
+
};
|
|
57
|
+
}, {
|
|
58
|
+
parameters: {
|
|
59
|
+
msw: {
|
|
60
|
+
handlers: {
|
|
61
|
+
getCurrentUser: import('msw').HttpHandler;
|
|
62
|
+
createNewSession: import('msw').HttpHandler;
|
|
63
|
+
};
|
|
64
|
+
};
|
|
65
|
+
};
|
|
66
|
+
}>;
|
|
67
|
+
/**
|
|
68
|
+
* Similar to the default case, but the session creation call returns an error
|
|
69
|
+
* that doesn't have a specific meaning in the context of the login page.
|
|
70
|
+
*/
|
|
71
|
+
export declare const UnknownFailureOnSubmit: import('@storybook/react').ReactStory<import('@storybook/react').ReactTypes & import('@storybook/addon-docs').DocsTypes & {
|
|
72
|
+
csf4: true;
|
|
73
|
+
} & {
|
|
74
|
+
args: {
|
|
75
|
+
description: import('react').ReactNode;
|
|
76
|
+
defaultValues?: import('./types.ts').DefaultFormValues | undefined;
|
|
77
|
+
onLogin?: import('./types.ts').AuthEventHandler | undefined;
|
|
78
|
+
};
|
|
79
|
+
}, {
|
|
80
|
+
parameters: {
|
|
81
|
+
msw: {
|
|
82
|
+
handlers: {
|
|
83
|
+
getCurrentUser: import('msw').HttpHandler;
|
|
84
|
+
createNewSession: import('msw').HttpHandler;
|
|
85
|
+
};
|
|
86
|
+
};
|
|
87
|
+
};
|
|
88
|
+
}>;
|
|
89
|
+
/**
|
|
90
|
+
* A case when user is stored locally, but their server session has expired.
|
|
91
|
+
*/
|
|
92
|
+
export declare const ReauthenticateSession: import('@storybook/react').ReactStory<import('@storybook/react').ReactTypes & import('@storybook/addon-docs').DocsTypes & {
|
|
93
|
+
csf4: true;
|
|
94
|
+
} & {
|
|
95
|
+
args: {
|
|
96
|
+
description: import('react').ReactNode;
|
|
97
|
+
defaultValues?: import('./types.ts').DefaultFormValues | undefined;
|
|
98
|
+
onLogin?: import('./types.ts').AuthEventHandler | undefined;
|
|
99
|
+
};
|
|
100
|
+
}, {
|
|
101
|
+
parameters: {
|
|
102
|
+
msw: {
|
|
103
|
+
handlers: {
|
|
104
|
+
getCurrentUser: import('msw').HttpHandler;
|
|
105
|
+
createNewSession: import('msw').HttpHandler;
|
|
106
|
+
};
|
|
107
|
+
};
|
|
108
|
+
};
|
|
109
|
+
}>;
|
|
110
|
+
/**
|
|
111
|
+
* The user is already stored in the app, and proactive user-session check
|
|
112
|
+
* returns the same user (based on ID).
|
|
113
|
+
*
|
|
114
|
+
* The user is directed to app without any further steps.
|
|
115
|
+
*/
|
|
116
|
+
export declare const AlreadyLoggedIn: import('@storybook/react').ReactStory<import('@storybook/react').ReactTypes & import('@storybook/addon-docs').DocsTypes & {
|
|
117
|
+
csf4: true;
|
|
118
|
+
} & {
|
|
119
|
+
args: {
|
|
120
|
+
description: import('react').ReactNode;
|
|
121
|
+
defaultValues?: import('./types.ts').DefaultFormValues | undefined;
|
|
122
|
+
onLogin?: import('./types.ts').AuthEventHandler | undefined;
|
|
123
|
+
};
|
|
124
|
+
}, {
|
|
125
|
+
parameters: {
|
|
126
|
+
msw: {
|
|
127
|
+
handlers: {
|
|
128
|
+
getCurrentUser: import('msw').HttpHandler;
|
|
129
|
+
};
|
|
130
|
+
};
|
|
131
|
+
};
|
|
132
|
+
}>;
|
|
133
|
+
/**
|
|
134
|
+
* A user is provided, and proactive user session check returns a different
|
|
135
|
+
* user. This can happen when different users log into separate apps with
|
|
136
|
+
* different credentials.
|
|
137
|
+
*/
|
|
138
|
+
export declare const UserMismatch: import('@storybook/react').ReactStory<import('@storybook/react').ReactTypes & import('@storybook/addon-docs').DocsTypes & {
|
|
139
|
+
csf4: true;
|
|
140
|
+
} & {
|
|
141
|
+
args: {
|
|
142
|
+
description: import('react').ReactNode;
|
|
143
|
+
defaultValues?: import('./types.ts').DefaultFormValues | undefined;
|
|
144
|
+
onLogin?: import('./types.ts').AuthEventHandler | undefined;
|
|
145
|
+
};
|
|
146
|
+
}, {
|
|
147
|
+
parameters: {
|
|
148
|
+
msw: {
|
|
149
|
+
handlers: {
|
|
150
|
+
getCurrentUser: import('msw').HttpHandler;
|
|
151
|
+
};
|
|
152
|
+
};
|
|
153
|
+
};
|
|
154
|
+
}>;
|
|
155
|
+
/**
|
|
156
|
+
* During the proactive user session check, the user is reportd as not found.
|
|
157
|
+
* This means that the tokens are still valid, but the user DB entity is gone.
|
|
158
|
+
* This can happen if a user closed their account.
|
|
159
|
+
*/
|
|
160
|
+
export declare const UserNotFound: import('@storybook/react').ReactStory<import('@storybook/react').ReactTypes & import('@storybook/addon-docs').DocsTypes & {
|
|
161
|
+
csf4: true;
|
|
162
|
+
} & {
|
|
163
|
+
args: {
|
|
164
|
+
description: import('react').ReactNode;
|
|
165
|
+
defaultValues?: import('./types.ts').DefaultFormValues | undefined;
|
|
166
|
+
onLogin?: import('./types.ts').AuthEventHandler | undefined;
|
|
167
|
+
};
|
|
168
|
+
}, {
|
|
169
|
+
parameters: {
|
|
170
|
+
msw: {
|
|
171
|
+
handlers: {
|
|
172
|
+
getCurrentUser: import('msw').HttpHandler;
|
|
173
|
+
};
|
|
174
|
+
};
|
|
175
|
+
};
|
|
176
|
+
}>;
|
|
177
|
+
/**
|
|
178
|
+
* The proactive user session check has failed due to connection issues.
|
|
179
|
+
*/
|
|
180
|
+
export declare const NoConnection: import('@storybook/react').ReactStory<import('@storybook/react').ReactTypes & import('@storybook/addon-docs').DocsTypes & {
|
|
181
|
+
csf4: true;
|
|
182
|
+
} & {
|
|
183
|
+
args: {
|
|
184
|
+
description: import('react').ReactNode;
|
|
185
|
+
defaultValues?: import('./types.ts').DefaultFormValues | undefined;
|
|
186
|
+
onLogin?: import('./types.ts').AuthEventHandler | undefined;
|
|
187
|
+
};
|
|
188
|
+
}, {
|
|
189
|
+
parameters: {
|
|
190
|
+
msw: {
|
|
191
|
+
handlers: {
|
|
192
|
+
getCurrentUser: import('msw').HttpHandler;
|
|
193
|
+
};
|
|
194
|
+
};
|
|
195
|
+
};
|
|
196
|
+
}>;
|
|
197
|
+
/**
|
|
198
|
+
* The proactive user session check has failed due to an error that doesn't
|
|
199
|
+
* carry any special meaning.
|
|
200
|
+
*/
|
|
201
|
+
export declare const UnknownFailure: import('@storybook/react').ReactStory<import('@storybook/react').ReactTypes & import('@storybook/addon-docs').DocsTypes & {
|
|
202
|
+
csf4: true;
|
|
203
|
+
} & {
|
|
204
|
+
args: {
|
|
205
|
+
description: import('react').ReactNode;
|
|
206
|
+
defaultValues?: import('./types.ts').DefaultFormValues | undefined;
|
|
207
|
+
onLogin?: import('./types.ts').AuthEventHandler | undefined;
|
|
208
|
+
};
|
|
209
|
+
}, {
|
|
210
|
+
parameters: {
|
|
211
|
+
msw: {
|
|
212
|
+
handlers: {
|
|
213
|
+
getCurrentUser: import('msw').HttpHandler;
|
|
214
|
+
};
|
|
215
|
+
};
|
|
216
|
+
};
|
|
217
|
+
}>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { CurrentUser } from '../types.ts';
|
|
3
|
+
import { AuthEventHandler, DefaultFormValues } from './types.ts';
|
|
4
|
+
export declare function LoginView(props: {
|
|
5
|
+
defaultValues?: DefaultFormValues;
|
|
6
|
+
onLogin?: AuthEventHandler;
|
|
7
|
+
currentUser: CurrentUser | null;
|
|
8
|
+
description: ReactNode;
|
|
9
|
+
reload: () => void;
|
|
10
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { DefaultFormValues } from './types.ts';
|
|
2
|
+
export type PasswordResetCardProps = {
|
|
3
|
+
/**
|
|
4
|
+
* Default values for the initial request password reset step.
|
|
5
|
+
*
|
|
6
|
+
* You might want to provide a value for history state or query param, so that
|
|
7
|
+
* if a user jumps between login and password reset, their email address
|
|
8
|
+
* is maintained between the two locations.
|
|
9
|
+
*/
|
|
10
|
+
defaultValues?: DefaultFormValues;
|
|
11
|
+
};
|
|
12
|
+
/**
|
|
13
|
+
* Allows the user to reset their password.
|
|
14
|
+
*/
|
|
15
|
+
export declare function PasswordResetCard(props: PasswordResetCardProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The default case in which all steps of the flow succeed.
|
|
3
|
+
*/
|
|
4
|
+
export declare const Success: import('@storybook/react').ReactStory<import('@storybook/react').ReactTypes & import('@storybook/addon-docs').DocsTypes & {
|
|
5
|
+
csf4: true;
|
|
6
|
+
} & {
|
|
7
|
+
args: {
|
|
8
|
+
defaultValues?: import('./types.ts').DefaultFormValues | undefined;
|
|
9
|
+
};
|
|
10
|
+
}, {}>;
|
|
11
|
+
/**
|
|
12
|
+
* In this case, the initial step fails because the email address was not
|
|
13
|
+
* found in our database.
|
|
14
|
+
*/
|
|
15
|
+
export declare const UserNotFoundOnRequestCode: import('@storybook/react').ReactStory<import('@storybook/react').ReactTypes & import('@storybook/addon-docs').DocsTypes & {
|
|
16
|
+
csf4: true;
|
|
17
|
+
} & {
|
|
18
|
+
args: {
|
|
19
|
+
defaultValues?: import('./types.ts').DefaultFormValues | undefined;
|
|
20
|
+
};
|
|
21
|
+
}, {
|
|
22
|
+
parameters: {
|
|
23
|
+
msw: {
|
|
24
|
+
handlers: {
|
|
25
|
+
request: import('msw').HttpHandler;
|
|
26
|
+
};
|
|
27
|
+
};
|
|
28
|
+
};
|
|
29
|
+
}>;
|
|
30
|
+
/**
|
|
31
|
+
* In this case, the initial step fails for a reason that doesn't have any
|
|
32
|
+
* special handling in this location. E.g. network error, server error, etc.
|
|
33
|
+
*/
|
|
34
|
+
export declare const UnknownFailureOnRequestCode: import('@storybook/react').ReactStory<import('@storybook/react').ReactTypes & import('@storybook/addon-docs').DocsTypes & {
|
|
35
|
+
csf4: true;
|
|
36
|
+
} & {
|
|
37
|
+
args: {
|
|
38
|
+
defaultValues?: import('./types.ts').DefaultFormValues | undefined;
|
|
39
|
+
};
|
|
40
|
+
}, {
|
|
41
|
+
parameters: {
|
|
42
|
+
msw: {
|
|
43
|
+
handlers: {
|
|
44
|
+
request: import('msw').HttpHandler;
|
|
45
|
+
};
|
|
46
|
+
};
|
|
47
|
+
};
|
|
48
|
+
}>;
|
|
49
|
+
/**
|
|
50
|
+
* In this case, the check code step fails because the token has expired,
|
|
51
|
+
* or is incorrect.
|
|
52
|
+
*/
|
|
53
|
+
export declare const NotFoundOrExpiredOnCheckCode: import('@storybook/react').ReactStory<import('@storybook/react').ReactTypes & import('@storybook/addon-docs').DocsTypes & {
|
|
54
|
+
csf4: true;
|
|
55
|
+
} & {
|
|
56
|
+
args: {
|
|
57
|
+
defaultValues?: import('./types.ts').DefaultFormValues | undefined;
|
|
58
|
+
};
|
|
59
|
+
}, {
|
|
60
|
+
parameters: {
|
|
61
|
+
msw: {
|
|
62
|
+
handlers: {
|
|
63
|
+
check: import('msw').HttpHandler;
|
|
64
|
+
};
|
|
65
|
+
};
|
|
66
|
+
};
|
|
67
|
+
}>;
|
|
68
|
+
/**
|
|
69
|
+
* In this case, the check step fails for a reason that doesn't have any
|
|
70
|
+
* special handling in this location. E.g. network error, server error, etc.
|
|
71
|
+
*/
|
|
72
|
+
export declare const UnknownFailureOnCheckCode: import('@storybook/react').ReactStory<import('@storybook/react').ReactTypes & import('@storybook/addon-docs').DocsTypes & {
|
|
73
|
+
csf4: true;
|
|
74
|
+
} & {
|
|
75
|
+
args: {
|
|
76
|
+
defaultValues?: import('./types.ts').DefaultFormValues | undefined;
|
|
77
|
+
};
|
|
78
|
+
}, {
|
|
79
|
+
parameters: {
|
|
80
|
+
msw: {
|
|
81
|
+
handlers: {
|
|
82
|
+
check: import('msw').HttpHandler;
|
|
83
|
+
};
|
|
84
|
+
};
|
|
85
|
+
};
|
|
86
|
+
}>;
|
|
87
|
+
/**
|
|
88
|
+
* In this case, the final set password step fails because the token has
|
|
89
|
+
* expired.
|
|
90
|
+
*
|
|
91
|
+
* Note that technically the token could also be incorrect/not found, but
|
|
92
|
+
* because the user has gotten through the check step, that would require
|
|
93
|
+
* some very strange set of circumstances.
|
|
94
|
+
*/
|
|
95
|
+
export declare const NotFoundOrExpiredOnSetPassword: import('@storybook/react').ReactStory<import('@storybook/react').ReactTypes & import('@storybook/addon-docs').DocsTypes & {
|
|
96
|
+
csf4: true;
|
|
97
|
+
} & {
|
|
98
|
+
args: {
|
|
99
|
+
defaultValues?: import('./types.ts').DefaultFormValues | undefined;
|
|
100
|
+
};
|
|
101
|
+
}, {
|
|
102
|
+
parameters: {
|
|
103
|
+
msw: {
|
|
104
|
+
handlers: {
|
|
105
|
+
set: import('msw').HttpHandler;
|
|
106
|
+
};
|
|
107
|
+
};
|
|
108
|
+
};
|
|
109
|
+
}>;
|
|
110
|
+
/**
|
|
111
|
+
* In this case, the set password step fails for a reason that doesn't have any
|
|
112
|
+
* special handling in this location. E.g. network error, server error, etc.
|
|
113
|
+
*/
|
|
114
|
+
export declare const UnknownFailureOnSetPassword: import('@storybook/react').ReactStory<import('@storybook/react').ReactTypes & import('@storybook/addon-docs').DocsTypes & {
|
|
115
|
+
csf4: true;
|
|
116
|
+
} & {
|
|
117
|
+
args: {
|
|
118
|
+
defaultValues?: import('./types.ts').DefaultFormValues | undefined;
|
|
119
|
+
};
|
|
120
|
+
}, {
|
|
121
|
+
parameters: {
|
|
122
|
+
msw: {
|
|
123
|
+
handlers: {
|
|
124
|
+
set: import('msw').HttpHandler;
|
|
125
|
+
};
|
|
126
|
+
};
|
|
127
|
+
};
|
|
128
|
+
}>;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { CurrentUser } from '../types.ts';
|
|
2
|
+
import { AuthEventHandler } from './types.ts';
|
|
3
|
+
export declare function VerifyAccountView(props: {
|
|
4
|
+
currentUser: CurrentUser;
|
|
5
|
+
reload: () => void;
|
|
6
|
+
/**
|
|
7
|
+
* If provided, will cause the success step to render a close dialog button
|
|
8
|
+
* instead of "Go to Dashboard" button.
|
|
9
|
+
*
|
|
10
|
+
* This is useful if this view is used within a modal dialog context.
|
|
11
|
+
*/
|
|
12
|
+
onClose?: AuthEventHandler;
|
|
13
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,11 +1,8 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
1
|
+
import { CurrentUser } from '../types.ts';
|
|
3
2
|
export type AuthEventHandler = () => Promise<void> | void;
|
|
4
|
-
|
|
5
3
|
export type ClientLogoutHandler = (options: {
|
|
6
|
-
|
|
4
|
+
serverUser: CurrentUser;
|
|
7
5
|
}) => Promise<void> | void;
|
|
8
|
-
|
|
9
6
|
export type DefaultFormValues = {
|
|
10
|
-
|
|
7
|
+
email?: string;
|
|
11
8
|
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { Failure, Pending, Success } from '../async-op.ts';
|
|
2
|
+
import { FailurePayload } from '../types.ts';
|
|
3
|
+
export declare function useFetchCurrentUser(options?: {
|
|
4
|
+
/**
|
|
5
|
+
* Optionally disable immediate fetch action.
|
|
6
|
+
*
|
|
7
|
+
* @default true
|
|
8
|
+
*/
|
|
9
|
+
performFetch?: boolean;
|
|
10
|
+
/**
|
|
11
|
+
* Fetch new data every time the window is focused.
|
|
12
|
+
*
|
|
13
|
+
* Note that `performFetch` has to be enabled for this option to have an
|
|
14
|
+
* effect — we are not revalidating when there is no fetch to do!
|
|
15
|
+
*
|
|
16
|
+
* @default false
|
|
17
|
+
*/
|
|
18
|
+
revalidateOnFocus?: boolean;
|
|
19
|
+
}): {
|
|
20
|
+
result: Pending | Failure<FailurePayload> | Success<{
|
|
21
|
+
id: string;
|
|
22
|
+
email: string;
|
|
23
|
+
isVerified: boolean;
|
|
24
|
+
prefersScrollbarVisibility?: "ALWAYS" | undefined;
|
|
25
|
+
}>;
|
|
26
|
+
latestAttemptTs: number;
|
|
27
|
+
reload: () => void;
|
|
28
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Appends " (Copy)" to the end of the input string if it doesn't already end
|
|
3
|
+
* with " (Copy)", otherwise it appends a number after "Copy", incrementing it
|
|
4
|
+
* if necessary.
|
|
5
|
+
*/
|
|
6
|
+
export declare function appendCopyToText(input: string): string;
|
|
7
|
+
/**
|
|
8
|
+
* Works like {@link appendCopyToText}, but ignores empty strings.
|
|
9
|
+
*/
|
|
10
|
+
export declare function maybeAppendCopyToText(input: string): string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/appkit.css
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
:root{--bksdto0: #ececec;--bksdto1: hsl(0 0% 50%);--bksdto2: #e7e8e8;--bksdto3: #f6f7f7;--bksdto4: #d6446e}:root{--bksdto5: 100}._1xw2g3s0{position:fixed;inset:0;z-index:var(--bksdto5);margin:auto;overflow:auto;opacity:0;background-color:#fff}._1xw2g3s1{transition:transform .2s,opacity .2s;transform:translateY(5rem);inline-size:100%;block-size:100%}._1xw2g3s1[data-enter]{opacity:1;transform:translateY(0)}._1xw2g3s1[data-leave]{opacity:0;transform:translateY(5rem)}._1xw2g3s2{transition:transform .2s,opacity .2s;transform:scale(1.1);inline-size:min(24rem,90svw);block-size:fit-content;border-radius:1rem}._1xw2g3s2[data-enter]{opacity:1;transform:scale(1)}._1xw2g3s2[data-leave]{opacity:0;transform:scale(.9)}._1xw2g3s3{background-color:#000;opacity:0;transition:opacity .2s}._1xw2g3s3[data-enter]{opacity:.4}@media(min-width:50em){._1xw2g3s1{transition:transform .2s,opacity .2s;transform:scale(1.1);block-size:fit-content;max-inline-size:40rem;max-block-size:90%;border-radius:1rem}._1xw2g3s1[data-enter]{opacity:1;transform:scale(1)}._1xw2g3s1[data-leave]{opacity:0;transform:scale(.9)}}.zuzez50{inline-size:2.5rem;block-size:2.5rem;margin:0rem auto .75rem}.zuzez51{font-family:manofa,sans-serif;font-feature-settings:"ss01";letter-spacing:-.01em}.zuzez52{font-family:minion-pro,serif}.zuzez53{background-color:#fff}.zuzez54{display:inline;text-decoration:underline;text-decoration-color:hsl(from currentcolor h s l / .3);text-underline-offset:.15em}@media(min-width:50em){.zuzez50{margin-block:-1rem 1.5rem}}@media(hover:hover)and (pointer:fine){.zuzez54{transition:text-decoration-color .2s}.zuzez54:hover{text-decoration-color:hsl(from currentcolor h s l / 1)}}@keyframes m15b5u0{0%{opacity:0}to{opacity:1}}@keyframes m15b5u1{0%{transform:translateY(100%)}to{transform:translateY(0)}}@keyframes m15b5u2{0%{transform:translateY(0)}20%{transform:translateY(-20%)}50%{transform:translateY(0)}}.b8zmms1{fill:currentcolor;opacity:.8;animation:m15b5u2 2s var(--b8zmms0) infinite}._1vaiehn0{text-align:start}._1vaiehn1{text-align:center}._1vaiehn2{text-align:end}._1onnux03{--_1onnux04: 1.25rem;--_1onnux05: 3rem}._1onnux06{background-color:#fff;padding:calc(var(--_1onnux04) / 2) var(--_1onnux04) var(--_1onnux04);border-radius:1rem;margin-inline:auto;max-inline-size:36rem;transition:height .2s;height:calc-size(auto)}._1onnux0a{margin-block-end:.5rem;margin-inline:auto;display:block;inline-size:2.5rem;block-size:2.5rem}._1onnux0b{font-weight:400;font-size:1.5rem;margin-block-end:1rem;line-height:1.2}._1onnux0f{margin-block-end:min(calc(var(--_1onnux04) / 2),1.5rem)}._1onnux0g{line-height:1.5}._1onnux0g+._1onnux0g{margin-top:.5lh}._1onnux0h{font-size:.875rem}._1onnux0i{font-size:1rem}._1onnux0m{letter-spacing:0;text-transform:uppercase;background-color:#000;color:#fff;width:100%;border:none;border-radius:.5rem;padding:1rem 1.5rem;font-size:.875rem;text-align:center}._1onnux0n{margin-block-start:calc(var(--_1onnux05) - .5rem)}._1onnux0o{text-align:center;margin-block-start:var(--_1onnux05);padding-block-start:2rem;border-block-start:1px solid #ececec}._1onnux0p{margin:0 auto 1.125rem}._1onnux0q{margin:0 auto;max-inline-size:25rem}@media(min-width:28em){._1onnux06{--_1onnux04: clamp(1.5rem, 8%, 4rem)}}@media(hover:hover)and (pointer:fine){._1onnux0m{transition:box-shadow .4s}._1onnux0m:hover{box-shadow:inset 0 0 0 2px #ffffff80}}._13vjtz70:empty{display:none}.lk2mmi0{border-radius:.5rem;border:1px solid var(--bksdto0)}.lk2mmi1{display:block}.lk2mmi2{display:block;text-transform:uppercase;font-size:.75rem;font-weight:600;margin-bottom:.5rem;text-align:start}.lk2mmi3{display:block;width:100%;font-size:1rem;line-height:1.25rem;padding:1rem 0 1rem 1rem;text-align:start}.lk2mmi3:read-only{background-color:#0000000d}.lk2mmi3::-ms-clear{display:none}.lk2mmi3::-ms-reveal{display:none}.lk2mmi4{text-align:start}.lk2mmi5{color:var(--bksdto4);font-size:.875rem;margin-top:.5rem;text-align:start}.lk2mmi5:empty{display:none}.lk2mmi6{color:var(--bksdto1);font-size:.875rem;margin-top:.5rem;text-align:start}.lk2mmi5:not(:empty)+.lk2mmi6{display:none}.lk2mmi7{padding:1rem;color:var(--bksdto4);background-color:var(--bksdto3);border-radius:.75rem;text-align:start}.lk2mmi8{margin-block-end:3rem}._1os01700{background-color:#fff}._1os01701{background-color:#fafafa;border-radius:.5rem}._1os01702{padding:1rem 1.5rem;text-align:start;inline-size:100%;border-radius:inherit}._1os01703{font-weight:600;font-size:1.125rem}._1os01704{margin-inline:1.5rem;background-color:#e2e2e2;block-size:1px}._1os01705{display:flex;justify-content:center;align-items:center;height:12rem}@media(min-width:28em){._1os01700{background-color:transparent;padding:clamp(1rem,5vw,5rem)}}@media(hover:hover)and (pointer:fine){._1os01702{transition:.2s background-color}._1os01702:hover{background-color:hsl(from #fafafa h s calc(l - 3))}}._4t8bcm0+._4t8bcm0:before{content:" · ";opacity:.6}._53r2z10{display:flex;flex-direction:column;gap:.75rem;background-color:#fff;padding:1.5rem;border-radius:.5rem;color:#000}._53r2z11{text-align:center}._53r2z12{text-align:start}._53r2z13{max-inline-size:11rem}._53r2z14{margin-inline:auto}._53r2z15{margin-inline:0}._53r2z16{border-block-start:1px solid hsl(0 0% 0% / .1);padding-block-start:.75rem}@layer appkit;._11bly911{inline-size:100%;block-size:auto;border-radius:inherit}@layer appkit{._11bly910{display:flex;align-items:center;justify-content:center;background-color:#fff;border-radius:.5rem;max-inline-size:12rem;aspect-ratio:1}}._1u5uin30{display:flex;align-items:center;justify-items:center;flex-direction:column;block-size:100%}._1u5uin31{background-color:#fff;border-radius:1rem;max-width:38rem;padding:clamp(1rem,5vw,3rem);margin:auto}._1u5uin32{max-width:4rem;margin-inline:auto;margin-block-end:1rem;aspect-ratio:1}._1u5uin33{margin-block-end:clamp(1.5rem,4cqw,2rem)}._1u5uin34{display:grid;gap:.5rem;grid-template-columns:repeat(auto-fill,minmax(12rem,1fr));margin-block:1.5rem}._1u5uin35{text-align:center;margin-block:2rem 3rem}._1u5uin36{max-inline-size:16rem;margin:auto}._1u5uin37{margin-inline:auto}._1u5uin38{font-style:italic;color:#00000080;animation:m15b5u0 .3s .15s both;margin-block-start:.5rem;text-align:center}._1u5uin39{text-align:center;margin-block-end:.5rem}._1u5uin3a{aspect-ratio:1;border-radius:20%;box-shadow:0 .125rem .25rem #0003;width:3rem;height:auto;margin-inline:auto;margin-block-end:1rem}._1u5uin3b{padding:2rem;text-align:center}._1u5uin3c{font-size:1.25rem}._1u5uin3d{margin-block-start:.5rem}._1u5uin3e{margin-block:2rem;border-block-start:1px solid hsl(0 0% 0% / .1);text-align:left}._1u5uin3f{border-block-end:1px solid hsl(0 0% 0% / .1);list-style:decimal;list-style-position:inside;padding-block:.75rem}._1u5uin3g{display:inline-block;position:relative;inline-size:1.25rem;top:.125em}.gpdazw0{max-inline-size:20rem;margin-inline:auto}.gpdazw1{margin-block-start:2.5rem;display:flex;flex-direction:column;gap:1rem}
|