@opexa/portal-components 0.0.137 → 0.0.139
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/Disclaimer/Disclaimer.d.ts +2 -4
- package/dist/components/Disclaimer/Disclaimer.js +1 -1
- package/dist/components/Disclaimer/DisclaimerV1.d.ts +4 -2
- package/dist/components/Disclaimer/DisclaimerV1.js +2 -1
- package/dist/components/SignIn/MobileNumberSignIn.js +1 -7
- package/dist/components/SignIn/NameAndPasswordSignIn.js +1 -7
- package/dist/components/SignUp/SignUpForm.js +28 -19
- package/package.json +2 -2
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import type { ImageProps } from 'next/image';
|
|
2
2
|
import type { ReactNode } from 'react';
|
|
3
|
-
type
|
|
4
|
-
|
|
5
|
-
logo: ImageProps['src'];
|
|
6
|
-
} | {
|
|
3
|
+
import { type DisclaimerV1Props } from './DisclaimerV1';
|
|
4
|
+
type DisclaimerProps = DisclaimerV1Props | {
|
|
7
5
|
version: 'v2';
|
|
8
6
|
logo: ImageProps['src'];
|
|
9
7
|
siteName: string;
|
|
@@ -6,5 +6,5 @@ export function Disclaimer(props) {
|
|
|
6
6
|
if (props.version === 'v2') {
|
|
7
7
|
return (_jsx(DisclaimerV2, { logo: props.logo, siteName: props.siteName, responsibleGamingContent: props.responsibleGamingContent, termsOfUseContent: props.termsOfUseContent, responsibleGamingLogo: props.responsibleGamingLogo }));
|
|
8
8
|
}
|
|
9
|
-
return _jsx(DisclaimerV1, {
|
|
9
|
+
return _jsx(DisclaimerV1, { ...props });
|
|
10
10
|
}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import type { ImageProps } from 'next/image';
|
|
2
|
-
export interface
|
|
2
|
+
export interface DisclaimerV1Props {
|
|
3
|
+
version?: 'v1';
|
|
3
4
|
logo: ImageProps['src'];
|
|
5
|
+
termsAndConditionsUrl?: string;
|
|
4
6
|
}
|
|
5
|
-
export declare function DisclaimerV1(props:
|
|
7
|
+
export declare function DisclaimerV1(props: DisclaimerV1Props): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
3
|
import Image from 'next/image';
|
|
4
|
+
import Link from 'next/link';
|
|
4
5
|
import { useRef } from 'react';
|
|
5
6
|
import pagcorLogo from '../../images/pagcor.png';
|
|
6
7
|
import responsibleGamingLogo from '../../images/responsible-gaming.png';
|
|
@@ -11,5 +12,5 @@ import { useDisclaimer } from './useDisclaimer.js';
|
|
|
11
12
|
export function DisclaimerV1(props) {
|
|
12
13
|
const disclaimer = useDisclaimer();
|
|
13
14
|
const acceptTriggerRef = useRef(null);
|
|
14
|
-
return (_jsx(Dialog.Root, { open: disclaimer.open, lazyMount: true, unmountOnExit: true, closeOnEscape: false, closeOnInteractOutside: false, initialFocusEl: () => acceptTriggerRef.current, children: _jsxs(Portal, { children: [_jsx(Dialog.Backdrop, { className: "!z-[calc(var(--z-dialog)+1)]" }), _jsx(Dialog.Positioner, { className: "!z-[calc(var(--z-dialog)+2)]", children: _jsxs(Dialog.Content, { className: "flex h-full w-full flex-col items-start p-3xl lg:mx-auto lg:h-auto lg:w-[400px] lg:rounded-xl", children: [_jsx(Image, { src: props.logo, alt: "", width: 200, height: 100, className: "mx-auto h-auto w-[120px]", draggable: false }), _jsxs("div", { className: "w-full grow", children: [_jsx(Dialog.Title, { className: "mt-3xl text-center text-lg font-semibold", children: "Age Verification" }), _jsxs(Dialog.Description, { className: "text-text-tertiary-600 mt-xs text-center text-sm", children: ["By entering this website I acknowledge and confirm I am 21 years of age and I agree with the", ' ', _jsx(
|
|
15
|
+
return (_jsx(Dialog.Root, { open: disclaimer.open, lazyMount: true, unmountOnExit: true, closeOnEscape: false, closeOnInteractOutside: false, initialFocusEl: () => acceptTriggerRef.current, children: _jsxs(Portal, { children: [_jsx(Dialog.Backdrop, { className: "!z-[calc(var(--z-dialog)+1)]" }), _jsx(Dialog.Positioner, { className: "!z-[calc(var(--z-dialog)+2)]", children: _jsxs(Dialog.Content, { className: "flex h-full w-full flex-col items-start p-3xl lg:mx-auto lg:h-auto lg:w-[400px] lg:rounded-xl", children: [_jsx(Image, { src: props.logo, alt: "", width: 200, height: 100, className: "mx-auto h-auto w-[120px]", draggable: false }), _jsxs("div", { className: "w-full grow", children: [_jsx(Dialog.Title, { className: "mt-3xl text-center text-lg font-semibold", children: "Age Verification" }), _jsxs(Dialog.Description, { className: "text-text-tertiary-600 mt-xs text-center text-sm", children: ["By entering this website I acknowledge and confirm I am 21 years of age and I agree with the", ' ', _jsx(Link, { href: props.termsAndConditionsUrl ?? '/terms-and-conditions', target: "_blank", rel: "noopener noreferrer", className: "text-brand-400 whitespace-nowrap underline underline-offset-2", prefetch: false, children: "Terms and Conditions." })] }), _jsxs("div", { className: "mt-5 flex items-center justify-center gap-3xl", children: [_jsx(Image, { src: pagcorLogo, alt: "", height: 75, width: 88, className: "h-[88px] w-auto shrink-0", draggable: false }), _jsx(Image, { src: responsibleGamingLogo, alt: "", height: 62, width: 186, className: "h-[62px] w-auto shrink-0", draggable: false })] })] }), _jsx(Button, { ref: acceptTriggerRef, type: "button", className: "mt-4xl", onClick: disclaimer.close, children: "Accept" })] }) })] }) }));
|
|
15
16
|
}
|
|
@@ -15,8 +15,6 @@ import { useSignInMutation } from '../../client/hooks/useSignInMutation.js';
|
|
|
15
15
|
import { toaster } from '../../client/utils/toaster.js';
|
|
16
16
|
import { ArrowLeftIcon } from '../../icons/ArrowLeftIcon.js';
|
|
17
17
|
import { CheckIcon } from '../../icons/CheckIcon.js';
|
|
18
|
-
import { FacebookIcon } from '../../icons/FacebookIcon.js';
|
|
19
|
-
import { GoogleIcon } from '../../icons/GoogleIcon.js';
|
|
20
18
|
import { Button } from '../../ui/Button/index.js';
|
|
21
19
|
import { Checkbox } from '../../ui/Checkbox/index.js';
|
|
22
20
|
import { Field } from '../../ui/Field/index.js';
|
|
@@ -106,11 +104,7 @@ export function MobileNumberSignIn() {
|
|
|
106
104
|
}, children: [_jsx(Checkbox.Control, { children: _jsx(Checkbox.Indicator, { asChild: true, children: _jsx(CheckIcon, {}) }) }), _jsxs(Checkbox.Label, { children: ["I am at least 21 years of age and I accept the", ' ', _jsx(Link, { href: signInProps.termsAndConditionsUrl ??
|
|
107
105
|
'/terms-and-conditions', onClick: () => {
|
|
108
106
|
dialog.setOpen(false);
|
|
109
|
-
}, className: "text-brand-400 whitespace-nowrap underline underline-offset-2", children: "Terms and Conditions." })] }), _jsx(Checkbox.HiddenInput, {})] }), _jsx(Field.ErrorText, { className: "ml-6 text-xs", children: o.fieldState.error?.message })] })) })] }), _jsxs("div", { className: "mt-6 flex items-center gap-
|
|
110
|
-
dialog.setOpen(false);
|
|
111
|
-
}, className: "border-border-primary bg-bg-primary text-text-secondary-700", children: [_jsx(GoogleIcon, { className: "size-6" }), "Continue with Google"] }), _jsxs(Button, { variant: "outline", colorScheme: "gray", onClick: () => {
|
|
112
|
-
dialog.setOpen(false);
|
|
113
|
-
}, className: "border-border-primary bg-bg-primary text-text-secondary-700 mt-lg", children: [_jsx(FacebookIcon, { className: "size-6" }), "Continue with Facebook"] })] }), _jsxs("div", { className: "mt-6 flex w-full items-center justify-center gap-xs text-sm", children: [_jsx("span", { className: "text-text-tertiary-600", children: "Don't have an account?" }), _jsx("button", { type: "submit", className: "text-button-tertiary-fg font-semibold", onClick: () => {
|
|
107
|
+
}, className: "text-brand-400 whitespace-nowrap underline underline-offset-2", children: "Terms and Conditions." })] }), _jsx(Checkbox.HiddenInput, {})] }), _jsx(Field.ErrorText, { className: "ml-6 text-xs", children: o.fieldState.error?.message })] })) })] }), _jsxs("div", { className: "mt-6 flex w-full items-center justify-center gap-xs text-sm", children: [_jsx("span", { className: "text-text-tertiary-600", children: "Don't have an account?" }), _jsx("button", { type: "submit", className: "text-button-tertiary-fg font-semibold", onClick: () => {
|
|
114
108
|
dialog.setOpen(false);
|
|
115
109
|
globalStore.signUp.setOpen(true);
|
|
116
110
|
}, children: "Sign up" })] })] })), context.step === 2 && (_jsxs(_Fragment, { children: [_jsx("h2", { className: "mt-xl text-center text-lg font-semibold", children: "Check your Phone" }), _jsxs("p", { className: "text-text-secondary-700 mt-xs text-center text-sm", children: ["We\u2019ve sent a verification code to your mobile number", ' ', _jsx("span", { className: "font-semibold", children: mobileNumberParser.format(step1Form.getValues('mobileNumber')) }), ' ', "via text"] }), _jsxs("form", { ref: form2Ref, className: "mt-5", onSubmit: step2Form.handleSubmit(async ({ verificationCode }) => {
|
|
@@ -13,8 +13,6 @@ import { SECRET_QUESTIONS, SECRET_QUESTIONS_MAP } from '../../constants/index.js
|
|
|
13
13
|
import { CheckIcon } from '../../icons/CheckIcon.js';
|
|
14
14
|
import { EyeIcon } from '../../icons/EyeIcon.js';
|
|
15
15
|
import { EyeOffIcon } from '../../icons/EyeOffIcon.js';
|
|
16
|
-
import { FacebookIcon } from '../../icons/FacebookIcon.js';
|
|
17
|
-
import { GoogleIcon } from '../../icons/GoogleIcon.js';
|
|
18
16
|
import { Button } from '../../ui/Button/index.js';
|
|
19
17
|
import { Checkbox } from '../../ui/Checkbox/index.js';
|
|
20
18
|
import { Field } from '../../ui/Field/index.js';
|
|
@@ -129,11 +127,7 @@ export function NameAndPasswordSignIn() {
|
|
|
129
127
|
}, children: [_jsx(Checkbox.Control, { children: _jsx(Checkbox.Indicator, { asChild: true, children: _jsx(CheckIcon, {}) }) }), _jsxs(Checkbox.Label, { children: ["I am at least 21 years of age and I accept the", ' ', _jsx(Link, { href: signInProps.termsAndConditionsUrl ??
|
|
130
128
|
'/terms-and-conditions', onClick: () => {
|
|
131
129
|
dialog.setOpen(false);
|
|
132
|
-
}, className: "text-brand-400 whitespace-nowrap underline underline-offset-2", children: "Terms and Conditions." })] }), _jsx(Checkbox.HiddenInput, {})] }), _jsx(Field.ErrorText, { className: "ml-6 text-xs", children: o.fieldState.error?.message })] })) })] }), _jsxs("div", { className: "mt-6 flex items-center gap-
|
|
133
|
-
dialog.setOpen(false);
|
|
134
|
-
}, className: "border-border-primary bg-bg-primary text-text-secondary-700", children: [_jsx(GoogleIcon, { className: "size-6" }), "Continue with Google"] }), _jsxs(Button, { variant: "outline", colorScheme: "gray", onClick: () => {
|
|
135
|
-
dialog.setOpen(false);
|
|
136
|
-
}, className: "border-border-primary bg-bg-primary text-text-secondary-700 mt-lg", children: [_jsx(FacebookIcon, { className: "size-6" }), "Continue with Facebook"] })] }), _jsxs("div", { className: "mt-6 flex w-full items-center justify-center gap-xs text-sm", children: [_jsx("span", { className: "text-text-tertiary-600", children: "Don't have an account?" }), _jsx("button", { type: "submit", className: "text-button-tertiary-fg font-semibold", onClick: () => {
|
|
130
|
+
}, className: "text-brand-400 whitespace-nowrap underline underline-offset-2", children: "Terms and Conditions." })] }), _jsx(Checkbox.HiddenInput, {})] }), _jsx(Field.ErrorText, { className: "ml-6 text-xs", children: o.fieldState.error?.message })] })) })] }), _jsxs("div", { className: "mt-6 flex w-full items-center justify-center gap-xs text-sm", children: [_jsx("span", { className: "text-text-tertiary-600", children: "Don't have an account?" }), _jsx("button", { type: "submit", className: "text-button-tertiary-fg font-semibold", onClick: () => {
|
|
137
131
|
dialog.setOpen(false);
|
|
138
132
|
globalStore.signUp.setOpen(true);
|
|
139
133
|
}, children: "Sign up" })] })] }));
|
|
@@ -12,6 +12,7 @@ import { useRef, useState } from 'react';
|
|
|
12
12
|
import { Controller, useForm } from 'react-hook-form';
|
|
13
13
|
import { z } from 'zod';
|
|
14
14
|
import { useShallow } from 'zustand/shallow';
|
|
15
|
+
import { useControllableState } from '../../client/hooks/useControllableState.js';
|
|
15
16
|
import { useCooldown } from '../../client/hooks/useCooldown.js';
|
|
16
17
|
import { useGlobalStore } from '../../client/hooks/useGlobalStore.js';
|
|
17
18
|
import { useLocaleInfo } from '../../client/hooks/useLocaleInfo.js';
|
|
@@ -28,8 +29,6 @@ import { CheckIcon } from '../../icons/CheckIcon.js';
|
|
|
28
29
|
import { ChevronDownIcon } from '../../icons/ChevronDownIcon.js';
|
|
29
30
|
import { ChevronLeftIcon } from '../../icons/ChevronLeftIcon.js';
|
|
30
31
|
import { ChevronRightIcon } from '../../icons/ChevronRightIcon.js';
|
|
31
|
-
import { FacebookIcon } from '../../icons/FacebookIcon.js';
|
|
32
|
-
import { GoogleIcon } from '../../icons/GoogleIcon.js';
|
|
33
32
|
import { ObjectType } from '../../services/ObjectType.js';
|
|
34
33
|
import { Button } from '../../ui/Button/index.js';
|
|
35
34
|
import { Checkbox } from '../../ui/Checkbox/index.js';
|
|
@@ -149,18 +148,17 @@ export function SignUpForm() {
|
|
|
149
148
|
}
|
|
150
149
|
}), children: [_jsxs(Field.Root, { invalid: !!step1Form.formState.errors.mobileNumber, children: [_jsx(Field.Label, { children: "Mobile Number" }), _jsxs("div", { className: "relative", children: [_jsxs("div", { className: "absolute left-3.5 top-1/2 flex shrink-0 -translate-y-1/2 items-center gap-md", children: [_jsx(localeInfo.country.flag, { className: "size-5" }), _jsx("span", { className: "text-text-placeholder", children: localeInfo.mobileNumber.areaCode })] }), _jsx(Field.Input, { style: {
|
|
151
150
|
paddingLeft: `calc(2.75rem + ${localeInfo.mobileNumber.areaCode.length}ch)`,
|
|
152
|
-
}, ...step1Form.register('mobileNumber') })] }), _jsx(Field.ErrorText, { children: step1Form.formState.errors.mobileNumber?.message })] }), _jsxs(Field.Root, { invalid: !!step1Form.formState.errors.realName, className: "mt-xl", children: [_jsx(Field.Label, { children: "Real Name" }), _jsx(Field.Input, { placeholder: "Enter your real name", ...step1Form.register('realName') }), _jsx(Field.ErrorText, { children: step1Form.formState.errors.realName?.message })] }), _jsxs(Field.Root, { invalid: !!step1Form.formState.errors.birthDay, className: "mt-xl", children: [
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
} }), _jsx(DatePicker.Trigger, { children: _jsx(CalendarIcon, {}) })] }), _jsx(DatePicker.Positioner, { children: _jsx(DatePicker.Content, { children: _jsx(DatePicker.View, { view: "day", children: _jsx(DatePicker.Context, { children: (api) => (_jsxs(_Fragment, { children: [_jsxs(DatePicker.ViewControl, { children: [_jsx(DatePicker.PrevTrigger, { children: _jsx(ChevronLeftIcon, {}) }), _jsx(DatePicker.ViewTrigger, { children: _jsx(DatePicker.RangeText, {}) }), _jsx(DatePicker.NextTrigger, { children: _jsx(ChevronRightIcon, {}) })] }), _jsxs(DatePicker.Table, { children: [_jsx(DatePicker.TableHead, { children: _jsx(DatePicker.TableRow, { children: api.weekDays.map((weekDay, id) => (_jsx(DatePicker.TableHeader, { children: weekDay.short.substring(0, 2) }, id))) }) }), _jsx(DatePicker.TableBody, { children: api.weeks.map((week, id) => (_jsx(DatePicker.TableRow, { children: week.map((day, id) => (_jsx(DatePicker.TableCell, { value: day, children: _jsx(DatePicker.TableCellTrigger, { children: day.day }) }, id))) }, id))) })] })] })) }) }) }) })] }), _jsx(Field.ErrorText, { children: step1Form.formState.errors.birthDay?.message })] }), _jsxs(Field.Root, { invalid: !!step1Form.formState.errors.branchCode, className: "mt-xl", children: [_jsxs(Select.Root, { value: [branchCode], onValueChange: (details) => {
|
|
151
|
+
}, ...step1Form.register('mobileNumber') })] }), _jsx(Field.ErrorText, { children: step1Form.formState.errors.mobileNumber?.message })] }), _jsxs(Field.Root, { invalid: !!step1Form.formState.errors.realName, className: "mt-xl", children: [_jsx(Field.Label, { children: "Real Name" }), _jsx(Field.Input, { placeholder: "Enter your real name", ...step1Form.register('realName') }), _jsx(Field.ErrorText, { children: step1Form.formState.errors.realName?.message })] }), _jsxs(Field.Root, { invalid: !!step1Form.formState.errors.birthDay, className: "mt-xl", children: [_jsx(DateOfBirthField, { value: birthDay, onChange: (value) => {
|
|
152
|
+
if (!value)
|
|
153
|
+
return;
|
|
154
|
+
step1Form.setValue('birthDay', value, {
|
|
155
|
+
shouldDirty: true,
|
|
156
|
+
shouldTouch: true,
|
|
157
|
+
shouldValidate: true,
|
|
158
|
+
});
|
|
159
|
+
}, onBlur: () => {
|
|
160
|
+
step1Form.trigger('birthDay');
|
|
161
|
+
} }), _jsx(Field.ErrorText, { children: step1Form.formState.errors.birthDay?.message })] }), _jsxs(Field.Root, { invalid: !!step1Form.formState.errors.branchCode, className: "mt-xl", children: [_jsxs(Select.Root, { value: [branchCode], onValueChange: (details) => {
|
|
164
162
|
step1Form.setValue('branchCode', details.value.at(0) ?? BRANCH_CODES[0].code, {
|
|
165
163
|
shouldDirty: true,
|
|
166
164
|
shouldTouch: true,
|
|
@@ -174,11 +172,7 @@ export function SignUpForm() {
|
|
|
174
172
|
}, children: [_jsx(Checkbox.Control, { children: _jsx(Checkbox.Indicator, { asChild: true, children: _jsx(CheckIcon, {}) }) }), _jsxs(Checkbox.Label, { children: ["I am at least 21 years of age and I accept the", ' ', _jsx(Link, { href: signUpProps.termsAndConditionsUrl ??
|
|
175
173
|
'/terms-and-conditions', onClick: () => {
|
|
176
174
|
dialog.setOpen(false);
|
|
177
|
-
}, className: "text-brand-400 whitespace-nowrap underline underline-offset-2", children: "Terms and Conditions." })] }), ' ', _jsx(Checkbox.HiddenInput, {})] }), _jsx(Field.ErrorText, { className: "ml-6 text-xs", children: o.fieldState.error?.message })] })) }), _jsx(Button, { type: "submit", className: "mt-3xl", disabled: step1Form.formState.isSubmitting, children: "Create Account" })] }), _jsxs("div", { className: "mt-6 flex items-center gap-
|
|
178
|
-
dialog.setOpen(false);
|
|
179
|
-
}, className: "border-border-primary bg-bg-primary text-text-secondary-700", children: [_jsx(GoogleIcon, { className: "size-6" }), "Sign in with Google"] }), _jsxs(Button, { variant: "outline", colorScheme: "gray", onClick: () => {
|
|
180
|
-
dialog.setOpen(false);
|
|
181
|
-
}, className: "border-border-primary bg-bg-primary text-text-secondary-700 mt-lg", children: [_jsx(FacebookIcon, { className: "size-6" }), "Sign in with Facebook"] })] }), _jsxs("div", { className: "mt-6 flex w-full items-center justify-center gap-xs text-sm", children: [_jsx("span", { className: "text-text-tertiary-600", children: "Already have an account?" }), _jsx("button", { type: "submit", className: "text-button-tertiary-fg font-semibold", onClick: () => {
|
|
175
|
+
}, className: "text-brand-400 whitespace-nowrap underline underline-offset-2", children: "Terms and Conditions." })] }), ' ', _jsx(Checkbox.HiddenInput, {})] }), _jsx(Field.ErrorText, { className: "ml-6 text-xs", children: o.fieldState.error?.message })] })) }), _jsx(Button, { type: "submit", className: "mt-3xl", disabled: step1Form.formState.isSubmitting, children: "Create Account" })] }), _jsxs("div", { className: "mt-6 flex w-full items-center justify-center gap-xs text-sm", children: [_jsx("span", { className: "text-text-tertiary-600", children: "Already have an account?" }), _jsx("button", { type: "submit", className: "text-button-tertiary-fg font-semibold", onClick: () => {
|
|
182
176
|
dialog.setOpen(false);
|
|
183
177
|
signInStore.setOpen(true);
|
|
184
178
|
}, children: "Log In" })] })] })), step === 2 && (_jsxs(_Fragment, { children: [_jsx("h2", { className: "mt-xl text-center text-lg font-semibold", children: "Check your Phone" }), _jsxs("p", { className: "text-text-secondary-700 mt-xs text-center text-sm", children: ["We\u2019ve sent a verification code to your mobile number", ' ', _jsx("span", { className: "font-semibold", children: mobileNumberParser.format(step1Form.getValues('mobileNumber')) }), ' ', "via text"] }), _jsxs("form", { ref: form2Ref, className: "mt-5", onSubmit: step2Form.handleSubmit(async ({ verificationCode }) => {
|
|
@@ -255,3 +249,18 @@ export function SignUpForm() {
|
|
|
255
249
|
}, children: [_jsx(ArrowLeftIcon, { className: "size-5" }), "Back"] })] })] }))] }));
|
|
256
250
|
}
|
|
257
251
|
const DEVICE_TIMEZONE = Intl.DateTimeFormat().resolvedOptions().timeZone;
|
|
252
|
+
function DateOfBirthField(props) {
|
|
253
|
+
const [value, setValue] = useControllableState({
|
|
254
|
+
value: props.value,
|
|
255
|
+
defaultValue: props.defaultValue ?? null,
|
|
256
|
+
onChange: props.onChange,
|
|
257
|
+
});
|
|
258
|
+
return (_jsxs(DatePicker.Root, { size: "md", variant: "outline", placeholder: "MM/DD/YYYY", lazyMount: true, unmountOnExit: true, fixedWeeks: true, selectionMode: "single", value: value ? [parseDate(value)] : [], onValueChange: (details) => {
|
|
259
|
+
const value = details.value.at(0)?.toDate(DEVICE_TIMEZONE);
|
|
260
|
+
setValue(value ?? null);
|
|
261
|
+
}, children: [_jsx(DatePicker.Label, { children: "Date of Birth" }), _jsxs(DatePicker.Control, { children: [_jsx(DatePicker.Input, { onBlur: props.onBlur, onFocus: props.onFocus }), _jsx(DatePicker.Trigger, { children: _jsx(CalendarIcon, {}) })] }), _jsx(DatePicker.Positioner, { children: _jsxs(DatePicker.Content, { children: [_jsx(DatePicker.View, { view: "day", children: _jsx(DatePicker.Context, { children: (api) => (_jsxs(_Fragment, { children: [_jsxs(DatePicker.ViewControl, { children: [_jsx(DatePicker.PrevTrigger, { children: _jsx(ChevronLeftIcon, {}) }), _jsx(DatePicker.ViewTrigger, { children: _jsx(DatePicker.RangeText, {}) }), _jsx(DatePicker.NextTrigger, { children: _jsx(ChevronRightIcon, {}) })] }), _jsxs(DatePicker.Table, { children: [_jsx(DatePicker.TableHead, { children: _jsx(DatePicker.TableRow, { children: api.weekDays.map((weekDay, id) => (_jsx(DatePicker.TableHeader, { children: weekDay.short.substring(0, 2) }, id))) }) }), _jsx(DatePicker.TableBody, { children: api.weeks.map((week, id) => (_jsx(DatePicker.TableRow, { children: week.map((day, id) => (_jsx(DatePicker.TableCell, { value: day, children: _jsx(DatePicker.TableCellTrigger, { children: day.day }) }, id))) }, id))) })] })] })) }) }), _jsx(DatePicker.View, { view: "month", children: _jsx(DatePicker.Context, { children: (datePicker) => (_jsxs(_Fragment, { children: [_jsxs(DatePicker.ViewControl, { children: [_jsx(DatePicker.PrevTrigger, { children: _jsx(ChevronLeftIcon, {}) }), _jsx(DatePicker.ViewTrigger, { children: _jsx(DatePicker.RangeText, {}) }), _jsx(DatePicker.NextTrigger, { children: _jsx(ChevronRightIcon, {}) })] }), _jsx(DatePicker.Table, { children: _jsx(DatePicker.TableBody, { children: datePicker
|
|
262
|
+
.getMonthsGrid({ columns: 4, format: 'short' })
|
|
263
|
+
.map((months, id) => (_jsx(DatePicker.TableRow, { children: months.map((month, id) => (_jsx(DatePicker.TableCell, { value: month.value, children: _jsx(DatePicker.TableCellTrigger, { className: "w-[4.425rem]", children: month.label }) }, id))) }, id))) }) })] })) }) }), _jsx(DatePicker.View, { view: "year", children: _jsx(DatePicker.Context, { children: (datePicker) => (_jsxs(_Fragment, { children: [_jsxs(DatePicker.ViewControl, { children: [_jsx(DatePicker.PrevTrigger, { children: _jsx(ChevronLeftIcon, {}) }), _jsx(DatePicker.ViewTrigger, { children: _jsx(DatePicker.RangeText, {}) }), _jsx(DatePicker.NextTrigger, { children: _jsx(ChevronRightIcon, {}) })] }), _jsx(DatePicker.Table, { children: _jsx(DatePicker.TableBody, { children: datePicker
|
|
264
|
+
.getYearsGrid({ columns: 4 })
|
|
265
|
+
.map((years, id) => (_jsx(DatePicker.TableRow, { children: years.map((year, id) => (_jsx(DatePicker.TableCell, { value: year.value, children: _jsx(DatePicker.TableCellTrigger, { className: "w-[4.425rem]", children: year.label }) }, id))) }, id))) }) })] })) }) })] }) })] }));
|
|
266
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@opexa/portal-components",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.139",
|
|
4
4
|
"exports": {
|
|
5
5
|
"./ui/*": {
|
|
6
6
|
"types": "./dist/ui/*/index.d.ts",
|
|
@@ -77,7 +77,7 @@
|
|
|
77
77
|
"release": "release-it"
|
|
78
78
|
},
|
|
79
79
|
"dependencies": {
|
|
80
|
-
"@ark-ui/react": "^5.14.
|
|
80
|
+
"@ark-ui/react": "^5.14.2",
|
|
81
81
|
"@date-fns/tz": "^1.2.0",
|
|
82
82
|
"@next/third-parties": "^15.3.4",
|
|
83
83
|
"@tailwindcss/typography": "^0.5.16",
|