@opexa/portal-components 0.0.347 → 0.0.349
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/client/hooks/useUnlinkGoogleMutation.d.ts +1 -2
- package/dist/client/hooks/useUnlinkGoogleMutation.js +2 -2
- package/dist/components/AccountInfo/AccountInfo.js +28 -20
- package/dist/constants/GameProvider.d.ts +1 -1
- package/dist/constants/GameProvider.js +1 -0
- package/dist/icons/LinkBroken02Icon.d.ts +2 -0
- package/dist/icons/LinkBroken02Icon.js +4 -0
- package/dist/services/account.js +2 -2
- package/dist/ui/Badge/Badge.d.ts +12 -12
- package/dist/ui/Badge/badge.anatomy.d.ts +1 -1
- package/dist/ui/Badge/badge.recipe.d.ts +3 -3
- package/dist/ui/Carousel/Carousel.d.ts +45 -45
- package/dist/ui/Carousel/carousel.recipe.d.ts +5 -5
- package/dist/ui/Checkbox/Checkbox.d.ts +23 -23
- package/dist/ui/Checkbox/checkbox.recipe.d.ts +3 -3
- package/dist/ui/Clipboard/Clipboard.d.ts +18 -18
- package/dist/ui/Clipboard/clipboard.recipe.d.ts +3 -3
- package/dist/ui/Collapsible/Collapsible.d.ts +20 -20
- package/dist/ui/Collapsible/collapsible.recipe.d.ts +5 -5
- package/dist/ui/Combobox/Combobox.d.ts +42 -42
- package/dist/ui/Combobox/combobox.recipe.d.ts +3 -3
- package/dist/ui/DatePicker/DatePicker.d.ts +72 -72
- package/dist/ui/DatePicker/datePicker.recipe.d.ts +3 -3
- package/dist/ui/Menu/Menu.d.ts +144 -144
- package/dist/ui/Menu/menu.recipe.d.ts +8 -8
- package/dist/ui/PasswordInput/PasswordInput.d.ts +18 -18
- package/dist/ui/PasswordInput/passwordInput.recipe.d.ts +3 -3
- package/dist/ui/Popover/Popover.d.ts +55 -55
- package/dist/ui/Popover/popover.recipe.d.ts +5 -5
- package/dist/ui/Select/Select.d.ts +45 -45
- package/dist/ui/Select/select.recipe.d.ts +3 -3
- package/dist/ui/Tabs/Tabs.d.ts +15 -15
- package/dist/ui/Tabs/tabs.recipe.d.ts +3 -3
- package/package.json +1 -1
|
@@ -10,10 +10,10 @@ export const useUnlinkGoogleMutation = (config) => {
|
|
|
10
10
|
return useMutation({
|
|
11
11
|
...config,
|
|
12
12
|
mutationKey: getUnlinkGoogleMutationKey(),
|
|
13
|
-
mutationFn: async (
|
|
13
|
+
mutationFn: async (id) => {
|
|
14
14
|
const session = await getSession();
|
|
15
15
|
invariant(session.status === 'authenticated');
|
|
16
|
-
await unlinkGoogle(
|
|
16
|
+
await unlinkGoogle(id, {
|
|
17
17
|
headers: {
|
|
18
18
|
Authorization: `Bearer ${session.token}`,
|
|
19
19
|
},
|
|
@@ -20,11 +20,14 @@ import { toaster } from '../../client/utils/toaster.js';
|
|
|
20
20
|
import { AUTH_ENDPOINT, PLATFORM_CODE } from '../../constants/index.js';
|
|
21
21
|
import { FacebookIcon } from '../../icons/FacebookIcon.js';
|
|
22
22
|
import { GoogleIcon } from '../../icons/GoogleIcon.js';
|
|
23
|
+
import { LinkBroken02Icon } from '../../icons/LinkBroken02Icon.js';
|
|
24
|
+
import { XIcon } from '../../icons/XIcon.js';
|
|
23
25
|
import avatar from '../../images/placeholder-avatar.png';
|
|
24
26
|
import { Button } from '../../ui/Button/index.js';
|
|
27
|
+
import { Dialog } from '../../ui/Dialog/index.js';
|
|
25
28
|
import { Field } from '../../ui/Field/index.js';
|
|
26
29
|
import { IconButton } from '../../ui/IconButton/index.js';
|
|
27
|
-
import {
|
|
30
|
+
import { Portal } from '../../ui/Portal/index.js';
|
|
28
31
|
export function AccountInfo(props) {
|
|
29
32
|
return (_jsxs("div", { className: twMerge('space-y-3xl', props.className), children: [_jsx(ProfileInfo, {}), _jsx(ContactInfo, {}), _jsx(PersonalInfo, {}), _jsx(SSO, { google: props.googleSso, facebook: props.facebookSso })] }));
|
|
30
33
|
}
|
|
@@ -163,8 +166,6 @@ const LinkGoogleAccount = () => {
|
|
|
163
166
|
const account = accountQuery.data;
|
|
164
167
|
const sessionQuery = useSessionQuery();
|
|
165
168
|
const session = sessionQuery.data;
|
|
166
|
-
const unlinkGoogleAccountMutation = useUnlinkGoogleMutation();
|
|
167
|
-
const disclosure = useDisclosure();
|
|
168
169
|
const loginGoogle = useGoogleLogin({
|
|
169
170
|
flow: 'auth-code',
|
|
170
171
|
state: encodeURIComponent(`${window.location.origin},${PLATFORM_CODE},${session?.token}`),
|
|
@@ -174,21 +175,28 @@ const LinkGoogleAccount = () => {
|
|
|
174
175
|
});
|
|
175
176
|
if (!account)
|
|
176
177
|
return null;
|
|
177
|
-
return (_jsxs("div", { className: "flex items-center gap-sm", children: [_jsxs("div", { className: "flex grow items-center gap-sm", children: [_jsx(IconButton, { variant: "outline", colorScheme: "gray", children: _jsx(GoogleIcon, { className: "size-6" }) }),
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
title: 'Successfully Disconnected Google Account',
|
|
181
|
-
description: 'Your Google account has been disconnected. You can reconnect anytime from your account settings.',
|
|
182
|
-
});
|
|
183
|
-
ctx.setOpen(false);
|
|
184
|
-
},
|
|
185
|
-
onError: () => {
|
|
186
|
-
toaster.error({
|
|
187
|
-
title: 'Error',
|
|
188
|
-
description: 'An error occurred while disconnecting your Google account. Please try again later.',
|
|
189
|
-
});
|
|
190
|
-
},
|
|
191
|
-
}), children: "Disconnect" })] })), children: (ctx) => {
|
|
192
|
-
return (_jsx("button", { type: "button", onClick: () => ctx.setOpen(true), className: "font-semibold text-button-tertiary-error-fg text-sm", children: "Disconnect" }));
|
|
193
|
-
} })) : (_jsx(Button, { onClick: () => loginGoogle(), fullWidth: false, children: "Connect" }))] }));
|
|
178
|
+
return (_jsxs("div", { className: "flex items-center gap-sm", children: [_jsxs("div", { className: "flex grow items-center gap-sm", children: [_jsx(IconButton, { variant: "outline", colorScheme: "gray", children: _jsx(GoogleIcon, { className: "size-6" }) }), _jsxs("div", { children: [_jsx("p", { className: "font-medium text-sm leading-tight", children: "Google" }), _jsx("p", { className: twMerge('mt-xs text-xs leading-tight', account.googleId
|
|
179
|
+
? 'text-text-success-primary-600'
|
|
180
|
+
: 'text-text-secondary-700'), children: account.googleId ? 'Connected' : 'Not Connected' })] })] }), account.googleId ? (_jsx(UnlinkGoogleAccount, {})) : (_jsx(Button, { onClick: () => loginGoogle(), fullWidth: false, children: "Connect" }))] }));
|
|
194
181
|
};
|
|
182
|
+
function UnlinkGoogleAccount() {
|
|
183
|
+
const accountQuery = useAccountQuery();
|
|
184
|
+
const account = accountQuery.data;
|
|
185
|
+
const disclosure = useDisclosure();
|
|
186
|
+
const unlinkGoogleMutation = useUnlinkGoogleMutation({
|
|
187
|
+
onSuccess() {
|
|
188
|
+
disclosure.setOpen(false);
|
|
189
|
+
},
|
|
190
|
+
onError() {
|
|
191
|
+
toaster.error({
|
|
192
|
+
title: 'Error',
|
|
193
|
+
description: 'An error occurred while disconnecting your Google account. Please try again later.',
|
|
194
|
+
});
|
|
195
|
+
},
|
|
196
|
+
});
|
|
197
|
+
if (!account)
|
|
198
|
+
return null;
|
|
199
|
+
return (_jsxs(Dialog.Root, { open: disclosure.open, onOpenChange: (details) => disclosure.setOpen(details.open), lazyMount: true, unmountOnExit: true, closeOnEscape: false, closeOnInteractOutside: false, children: [_jsx(Dialog.Trigger, { className: "font-semibold text-button-tertiary-error-fg text-sm", children: "Disconnect" }), _jsxs(Portal, { children: [_jsx(Dialog.Backdrop, { className: "!z-[calc(var(--z-dialog)+1)]" }), _jsx(Dialog.Positioner, { className: "!z-[calc(var(--z-dialog)+2)] flex items-center justify-center", children: _jsxs(Dialog.Content, { className: "mx-auto min-h-auto max-w-[25rem] overflow-y-auto rounded-xl p-6", children: [_jsx(Dialog.CloseTrigger, { children: _jsx(XIcon, {}) }), _jsxs("div", { className: "flex flex-col ", children: [_jsx("div", { className: "mx-auto flex size-12 items-center justify-center rounded-full bg-bg-brand-secondary text-text-brand", children: _jsx(LinkBroken02Icon, {}) }), _jsx(Dialog.Title, { className: "mb-1 text-center font-semibold text-lg xl:mt-xl", children: "Disconnect Google Account" }), _jsx(Dialog.Description, { className: "text-center text-sm text-text-tertiary-600 leading-2xl", children: "Are you sure you want to disconnect your Google account? This may affect your ability to log in or sync data." })] }), _jsx(Dialog.Context, { children: (api) => (_jsxs("div", { className: "flex justify-between gap-2 pt-6", children: [_jsx(Button, { variant: "outline", disabled: unlinkGoogleMutation.isPending, onClick: () => api.setOpen(false), children: "Cancel" }), _jsx(Button, { variant: "solid", disabled: unlinkGoogleMutation.isPending, onClick: () => {
|
|
200
|
+
unlinkGoogleMutation.mutate(account.id);
|
|
201
|
+
}, children: "Disconnect" })] })) })] }) })] })] }));
|
|
202
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { GameProvider, GameProviderData } from '../types';
|
|
2
2
|
export declare const GAME_PROVIDER_DATA: Record<GameProvider, GameProviderData>;
|
|
3
3
|
export declare const GAME_PROVIDERS: GameProvider[];
|
|
4
|
-
export declare const LEGACY_GAME_PROVIDERS: ["JILI", "PGSOFT", "FACHAI", "BTI", "DG", "PLAYTECH", "E2E", "ONEAPI_EVOLUTION", "CQ9", "JDB", "HABANERO", "SPINIX", "JOKER", "HACKSAW", "JDBGTF", "JDBSPRIBE", "MICROGAMING", "RELAXGAMING", "EVOPLAY", "BOOONGO", "BGAMING", "KINGMAKER", "KINGMIDAS", "YELLOWBAT", "ETENGJUE", "SABA", "PRAGMATICPLAY", "SPRIBE", "EZUGI", "ALIZE", "BNG"];
|
|
4
|
+
export declare const LEGACY_GAME_PROVIDERS: ["JILI", "PGSOFT", "FACHAI", "BTI", "DG", "PLAYTECH", "E2E", "ONEAPI_EVOLUTION", "CQ9", "JDB", "HABANERO", "SPINIX", "JOKER", "HACKSAW", "JDBGTF", "JDBSPRIBE", "MICROGAMING", "RELAXGAMING", "EVOPLAY", "BOOONGO", "BGAMING", "KINGMAKER", "KINGMIDAS", "YELLOWBAT", "ETENGJUE", "SABA", "PRAGMATICPLAY", "SPRIBE", "EZUGI", "ALIZE", "BNG", "EVOLUTION"];
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
export function LinkBroken02Icon(props) {
|
|
3
|
+
return (_jsx("svg", { xmlns: "http://www.w3.org/2000/svg", width: "24", height: "24", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", ...props, children: _jsx("path", { d: "m8.5 15.5 7-7M9 4V2m6 18v2M4 9H2m18 6h2M4.914 4.914 3.5 3.5m15.586 15.586L20.5 20.5M12 17.657l-2.121 2.121a4 4 0 1 1-5.657-5.657L6.343 12m11.314 0 2.121-2.121a4 4 0 0 0-5.657-5.657L12 6.343" }) }));
|
|
4
|
+
}
|
package/dist/services/account.js
CHANGED
|
@@ -257,9 +257,9 @@ export const getGoogleClientId = cache(async (options) => {
|
|
|
257
257
|
const res = await graphqlRequest(ACCOUNT_GRAPHQL_ENDPOINT, GOOGLE_CLIENT_ID, undefined, options);
|
|
258
258
|
return res.googleClientId ?? null;
|
|
259
259
|
});
|
|
260
|
-
export const unlinkGoogle =
|
|
260
|
+
export const unlinkGoogle = async (id, options) => {
|
|
261
261
|
await graphqlRequest(ACCOUNT_GRAPHQL_ENDPOINT, UNLINK_GOOGLE, { input: { id } }, options);
|
|
262
|
-
}
|
|
262
|
+
};
|
|
263
263
|
export const generateSumsubVerificationToken = async (options) => {
|
|
264
264
|
const res = await graphqlRequest(ACCOUNT_GRAPHQL_ENDPOINT, GENERATE_SUMSUB_VERIFICATION_TOKEN, undefined, options);
|
|
265
265
|
return res.generateSumsubVerificationToken;
|
package/dist/ui/Badge/Badge.d.ts
CHANGED
|
@@ -37,7 +37,7 @@ export declare const Root: import("react").ComponentType<import("@ark-ui/react")
|
|
|
37
37
|
root: string;
|
|
38
38
|
};
|
|
39
39
|
};
|
|
40
|
-
}, Record<"label" | "root" | "
|
|
40
|
+
}, Record<"label" | "root" | "icon" | "indicator", string | string[]>, undefined, {
|
|
41
41
|
size: {
|
|
42
42
|
md: {
|
|
43
43
|
root: string;
|
|
@@ -72,7 +72,7 @@ export declare const Root: import("react").ComponentType<import("@ark-ui/react")
|
|
|
72
72
|
root: string;
|
|
73
73
|
};
|
|
74
74
|
};
|
|
75
|
-
}, Record<"label" | "root" | "
|
|
75
|
+
}, Record<"label" | "root" | "icon" | "indicator", string | string[]>, import("tailwind-variants").TVReturnType<{
|
|
76
76
|
size: {
|
|
77
77
|
md: {
|
|
78
78
|
root: string;
|
|
@@ -107,7 +107,7 @@ export declare const Root: import("react").ComponentType<import("@ark-ui/react")
|
|
|
107
107
|
root: string;
|
|
108
108
|
};
|
|
109
109
|
};
|
|
110
|
-
}, Record<"label" | "root" | "
|
|
110
|
+
}, Record<"label" | "root" | "icon" | "indicator", string | string[]>, undefined, unknown, unknown, undefined>>>>>;
|
|
111
111
|
interface BadgeLabelProps extends ComponentPropsWithRef<'span'> {
|
|
112
112
|
asChild?: boolean;
|
|
113
113
|
}
|
|
@@ -146,7 +146,7 @@ export declare const Label: import("react").ComponentType<import("@ark-ui/react"
|
|
|
146
146
|
root: string;
|
|
147
147
|
};
|
|
148
148
|
};
|
|
149
|
-
}, Record<"label" | "root" | "
|
|
149
|
+
}, Record<"label" | "root" | "icon" | "indicator", string | string[]>, undefined, {
|
|
150
150
|
size: {
|
|
151
151
|
md: {
|
|
152
152
|
root: string;
|
|
@@ -181,7 +181,7 @@ export declare const Label: import("react").ComponentType<import("@ark-ui/react"
|
|
|
181
181
|
root: string;
|
|
182
182
|
};
|
|
183
183
|
};
|
|
184
|
-
}, Record<"label" | "root" | "
|
|
184
|
+
}, Record<"label" | "root" | "icon" | "indicator", string | string[]>, import("tailwind-variants").TVReturnType<{
|
|
185
185
|
size: {
|
|
186
186
|
md: {
|
|
187
187
|
root: string;
|
|
@@ -216,7 +216,7 @@ export declare const Label: import("react").ComponentType<import("@ark-ui/react"
|
|
|
216
216
|
root: string;
|
|
217
217
|
};
|
|
218
218
|
};
|
|
219
|
-
}, Record<"label" | "root" | "
|
|
219
|
+
}, Record<"label" | "root" | "icon" | "indicator", string | string[]>, undefined, unknown, unknown, undefined>>>>>;
|
|
220
220
|
interface BadgeIndicatorProps extends ComponentPropsWithRef<'svg'> {
|
|
221
221
|
asChild?: boolean;
|
|
222
222
|
}
|
|
@@ -255,7 +255,7 @@ export declare const Indicator: import("react").ComponentType<import("@ark-ui/re
|
|
|
255
255
|
root: string;
|
|
256
256
|
};
|
|
257
257
|
};
|
|
258
|
-
}, Record<"label" | "root" | "
|
|
258
|
+
}, Record<"label" | "root" | "icon" | "indicator", string | string[]>, undefined, {
|
|
259
259
|
size: {
|
|
260
260
|
md: {
|
|
261
261
|
root: string;
|
|
@@ -290,7 +290,7 @@ export declare const Indicator: import("react").ComponentType<import("@ark-ui/re
|
|
|
290
290
|
root: string;
|
|
291
291
|
};
|
|
292
292
|
};
|
|
293
|
-
}, Record<"label" | "root" | "
|
|
293
|
+
}, Record<"label" | "root" | "icon" | "indicator", string | string[]>, import("tailwind-variants").TVReturnType<{
|
|
294
294
|
size: {
|
|
295
295
|
md: {
|
|
296
296
|
root: string;
|
|
@@ -325,7 +325,7 @@ export declare const Indicator: import("react").ComponentType<import("@ark-ui/re
|
|
|
325
325
|
root: string;
|
|
326
326
|
};
|
|
327
327
|
};
|
|
328
|
-
}, Record<"label" | "root" | "
|
|
328
|
+
}, Record<"label" | "root" | "icon" | "indicator", string | string[]>, undefined, unknown, unknown, undefined>>>>>;
|
|
329
329
|
interface BadgeIconProps extends ComponentPropsWithRef<'svg'> {
|
|
330
330
|
asChild?: boolean;
|
|
331
331
|
}
|
|
@@ -364,7 +364,7 @@ export declare const Icon: import("react").ComponentType<import("@ark-ui/react")
|
|
|
364
364
|
root: string;
|
|
365
365
|
};
|
|
366
366
|
};
|
|
367
|
-
}, Record<"label" | "root" | "
|
|
367
|
+
}, Record<"label" | "root" | "icon" | "indicator", string | string[]>, undefined, {
|
|
368
368
|
size: {
|
|
369
369
|
md: {
|
|
370
370
|
root: string;
|
|
@@ -399,7 +399,7 @@ export declare const Icon: import("react").ComponentType<import("@ark-ui/react")
|
|
|
399
399
|
root: string;
|
|
400
400
|
};
|
|
401
401
|
};
|
|
402
|
-
}, Record<"label" | "root" | "
|
|
402
|
+
}, Record<"label" | "root" | "icon" | "indicator", string | string[]>, import("tailwind-variants").TVReturnType<{
|
|
403
403
|
size: {
|
|
404
404
|
md: {
|
|
405
405
|
root: string;
|
|
@@ -434,5 +434,5 @@ export declare const Icon: import("react").ComponentType<import("@ark-ui/react")
|
|
|
434
434
|
root: string;
|
|
435
435
|
};
|
|
436
436
|
};
|
|
437
|
-
}, Record<"label" | "root" | "
|
|
437
|
+
}, Record<"label" | "root" | "icon" | "indicator", string | string[]>, undefined, unknown, unknown, undefined>>>>>;
|
|
438
438
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const badgeAnatomy: import("@ark-ui/react/anatomy").AnatomyInstance<"label" | "root" | "
|
|
1
|
+
export declare const badgeAnatomy: import("@ark-ui/react/anatomy").AnatomyInstance<"label" | "root" | "icon" | "indicator">;
|
|
@@ -33,7 +33,7 @@ export declare const badgeRecipe: import("tailwind-variants").TVReturnType<{
|
|
|
33
33
|
root: string;
|
|
34
34
|
};
|
|
35
35
|
};
|
|
36
|
-
}, Record<"label" | "root" | "
|
|
36
|
+
}, Record<"label" | "root" | "icon" | "indicator", string | string[]>, undefined, {
|
|
37
37
|
size: {
|
|
38
38
|
md: {
|
|
39
39
|
root: string;
|
|
@@ -68,7 +68,7 @@ export declare const badgeRecipe: import("tailwind-variants").TVReturnType<{
|
|
|
68
68
|
root: string;
|
|
69
69
|
};
|
|
70
70
|
};
|
|
71
|
-
}, Record<"label" | "root" | "
|
|
71
|
+
}, Record<"label" | "root" | "icon" | "indicator", string | string[]>, import("tailwind-variants").TVReturnType<{
|
|
72
72
|
size: {
|
|
73
73
|
md: {
|
|
74
74
|
root: string;
|
|
@@ -103,4 +103,4 @@ export declare const badgeRecipe: import("tailwind-variants").TVReturnType<{
|
|
|
103
103
|
root: string;
|
|
104
104
|
};
|
|
105
105
|
};
|
|
106
|
-
}, Record<"label" | "root" | "
|
|
106
|
+
}, Record<"label" | "root" | "icon" | "indicator", string | string[]>, undefined, unknown, unknown, undefined>>;
|