@opexa/portal-components 0.0.375 → 0.0.377
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/components/Bonuses/BonusesTrigger.d.ts +6 -2
- package/dist/components/Bonuses/BonusesTrigger.js +6 -2
- package/dist/components/KYC/KYCReminder.lazy.js +1 -1
- package/dist/components/Messages/MessagesTrigger.d.ts +8 -2
- package/dist/components/Messages/MessagesTrigger.js +6 -1
- package/package.json +1 -1
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import type { ComponentPropsWithRef } from 'react';
|
|
2
|
-
interface
|
|
2
|
+
export interface ClassNameEntries {
|
|
3
|
+
root?: string;
|
|
4
|
+
icon?: string;
|
|
5
|
+
}
|
|
6
|
+
export interface BonusesTriggerProps extends Omit<ComponentPropsWithRef<'a'>, 'className'> {
|
|
7
|
+
className?: string | ClassNameEntries;
|
|
3
8
|
}
|
|
4
9
|
export declare function BonusesTrigger({ children, className, ...props }: BonusesTriggerProps): import("react/jsx-runtime").JSX.Element;
|
|
5
|
-
export {};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { isString } from 'lodash-es';
|
|
3
4
|
import Link from 'next/link';
|
|
4
5
|
import { twMerge } from 'tailwind-merge';
|
|
5
6
|
import { useBonusesCountQuery } from '../../client/hooks/useBonusesCountQuery.js';
|
|
@@ -16,9 +17,12 @@ export function BonusesTrigger({ children, className, ...props }) {
|
|
|
16
17
|
const bonusesCount = bonusesCountQuery.data ?? 0;
|
|
17
18
|
const cashbackBonusesCount = cashbackBonusesCountQuery.data ?? 0;
|
|
18
19
|
const totalCount = bonusesCount + cashbackBonusesCount;
|
|
20
|
+
const classNames = isString(className)
|
|
21
|
+
? { root: className }
|
|
22
|
+
: (className ?? {});
|
|
19
23
|
return (_jsx(Link, { "aria-label": "View Rewards", "data-count": totalCount, ...props, href: props.href ?? '/rewards', className: iconButtonRecipe({
|
|
20
24
|
size: 'sm',
|
|
21
25
|
colorScheme: 'gray',
|
|
22
|
-
className: twMerge('relative',
|
|
23
|
-
}), children: children ?? (_jsxs(_Fragment, { children: [totalCount > 0 && (_jsx("div", { className: "-right-1.5 -top-1.5 absolute min-w-5 rounded-full border bg-brand-500 px-1.5 font-semibold text-2xs text-button-primary-fg leading-4.5", children: totalCount })), _jsx(Gift01Icon, {})] })) }));
|
|
26
|
+
className: twMerge('relative', classNames.root),
|
|
27
|
+
}), children: children ?? (_jsxs(_Fragment, { children: [totalCount > 0 && (_jsx("div", { className: "-right-1.5 -top-1.5 absolute min-w-5 rounded-full border bg-brand-500 px-1.5 font-semibold text-2xs text-button-primary-fg leading-4.5", children: totalCount })), _jsx(Gift01Icon, { className: classNames.icon })] })) }));
|
|
24
28
|
}
|
|
@@ -35,7 +35,7 @@ export function KYCReminder(props) {
|
|
|
35
35
|
session?.status === 'authenticated' &&
|
|
36
36
|
hasMissingData, onOpenChange: (details) => {
|
|
37
37
|
globalStore.kycReminder.setOpen(details.open);
|
|
38
|
-
}, closeOnEscape: false, closeOnInteractOutside: false, lazyMount: true, unmountOnExit: true, children: _jsxs(Portal, { children: [_jsx(Dialog.Backdrop, { className: "!z-[calc(var(--z-dialog)+3)]" }), _jsx(Dialog.Positioner, { className: "!z-[calc(var(--z-dialog)+4)] flex items-center justify-center", children: _jsxs(Dialog.Content, { className: "mx-auto h-fit max-w-[calc(100dvw-1rem)] overflow-y-auto rounded-lg bg-bg-primary-alt lg:max-w-[400px]", children: [_jsx(Dialog.CloseTrigger, { children: _jsx(XIcon, {}) }), _jsxs("div", { className: "p-3xl text-center", children: [_jsx("div", { className: "mx-auto w-fit rounded-full bg-bg-warning-secondary p-2", children: _jsx(FileCheck02Icon, { className: "text-[#FEDF89]" }) }), _jsx("h2", { className: "mt-4 text-lg
|
|
38
|
+
}, closeOnEscape: false, closeOnInteractOutside: false, lazyMount: true, unmountOnExit: true, children: _jsxs(Portal, { children: [_jsx(Dialog.Backdrop, { className: "!z-[calc(var(--z-dialog)+3)]" }), _jsx(Dialog.Positioner, { className: "!z-[calc(var(--z-dialog)+4)] flex items-center justify-center", children: _jsxs(Dialog.Content, { className: "mx-auto h-fit max-w-[calc(100dvw-1rem)] overflow-y-auto rounded-lg bg-bg-primary-alt lg:max-w-[400px]", children: [_jsx(Dialog.CloseTrigger, { children: _jsx(XIcon, {}) }), _jsxs("div", { className: "p-3xl text-center", children: [_jsx("div", { className: "mx-auto w-fit rounded-full bg-bg-warning-secondary p-2", children: _jsx(FileCheck02Icon, { className: "text-[#FEDF89]" }) }), _jsx("h2", { className: "mt-4 text-lg", children: "Personal Verification" }), _jsxs("p", { className: "mt-xs text-sm text-text-tertiary-600", children: ["All new users are required to complete identity verification to access the full range of ", props.siteName, " services, including withdrawals."] }), _jsx(Dialog.Context, { children: (api) => (_jsxs("div", { className: "mt-3xl space-y-lg", children: [_jsx(Button, { onClick: () => {
|
|
39
39
|
api.setOpen(false);
|
|
40
40
|
globalStore.kyc.setOpen(true);
|
|
41
41
|
}, children: "Verify Now" }), _jsx(Button, { type: "button", variant: "outline", fullWidth: true, onClick: () => api.setOpen(false), children: "Do it later" })] })) })] })] }) })] }) }));
|
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
import type { ComponentPropsWithRef } from 'react';
|
|
2
|
-
interface
|
|
3
|
-
|
|
2
|
+
export interface ClassNameEntries {
|
|
3
|
+
root?: string;
|
|
4
|
+
iconButtonRoot?: string;
|
|
5
|
+
iconButtonLogo?: string;
|
|
4
6
|
}
|
|
7
|
+
type MessagesTriggerProps = Omit<ComponentPropsWithRef<'button'>, 'className'> & {
|
|
8
|
+
asChild?: boolean;
|
|
9
|
+
className?: string | ClassNameEntries;
|
|
10
|
+
};
|
|
5
11
|
export declare function MessagesTrigger({ asChild, children, ...props }: MessagesTriggerProps): import("react/jsx-runtime").JSX.Element;
|
|
6
12
|
export {};
|
|
@@ -1,12 +1,17 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
3
|
import { ark } from '@ark-ui/react/factory';
|
|
4
|
+
import { isString } from 'lodash-es';
|
|
5
|
+
import { twMerge } from 'tailwind-merge';
|
|
4
6
|
import { useShallow } from 'zustand/shallow';
|
|
5
7
|
import { useGlobalStore } from '../../client/hooks/useGlobalStore.js';
|
|
6
8
|
import { useUnreadMessagesCountQuery } from '../../client/hooks/useUnreadMessagesCountQuery.js';
|
|
7
9
|
import { Bell01Icon } from '../../icons/Bell01Icon.js';
|
|
8
10
|
import { IconButton } from '../../ui/IconButton/index.js';
|
|
9
11
|
export function MessagesTrigger({ asChild, children, ...props }) {
|
|
12
|
+
const classNames = isString(props.className)
|
|
13
|
+
? { root: props.className }
|
|
14
|
+
: (props.className ?? {});
|
|
10
15
|
const globalStore = useGlobalStore(useShallow((ctx) => ({
|
|
11
16
|
messages: ctx.messages,
|
|
12
17
|
})));
|
|
@@ -17,5 +22,5 @@ export function MessagesTrigger({ asChild, children, ...props }) {
|
|
|
17
22
|
return (_jsx(ark.button, { type: "button", "aria-label": "Toggle messages panel", "data-state": globalStore.messages.open ? 'open' : 'closed', ...props, onClick: (e) => {
|
|
18
23
|
globalStore.messages.setOpen(!globalStore.messages.open);
|
|
19
24
|
return props.onClick?.(e);
|
|
20
|
-
}, asChild: !children ? true : asChild, children: children ?? (_jsxs(IconButton, { size: "sm", colorScheme: "gray", className:
|
|
25
|
+
}, asChild: !children ? true : asChild, className: classNames.root, children: children ?? (_jsxs(IconButton, { size: "sm", colorScheme: "gray", className: twMerge('relative', classNames.iconButtonRoot), children: [!!unreadMessagesCount && (_jsx("div", { className: "-right-1.5 -top-1.5 absolute rounded-full border bg-brand-500 px-1.5 font-semibold text-2xs text-button-primary-fg leading-4.5", children: unreadMessagesCount })), _jsx(Bell01Icon, { className: classNames.iconButtonLogo })] })) }));
|
|
21
26
|
}
|