@opexa/portal-components 0.0.656 → 0.0.658

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.
@@ -0,0 +1,5 @@
1
+ import { type ImageProps } from 'next/image';
2
+ export interface AgentSignInProps {
3
+ logo: ImageProps['src'];
4
+ }
5
+ export declare function AgentSignIn(props: AgentSignInProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,6 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import Image, {} from 'next/image';
3
+ import { AgentSignInForm } from './AgentSignInForm.js';
4
+ export function AgentSignIn(props) {
5
+ return (_jsx("div", { className: "flex min-h-dvh max-w-full justify-center py-[180px] pb-6 dark:[background:linear-gradient(180deg,#0E1C23_0%,#0B1116_100%)]", children: _jsxs("div", { className: "flex max-w-full flex-col items-center", children: [_jsx(Image, { src: props.logo, alt: "", width: 300, height: 75, priority: true, className: "mx-auto h-auto w-[18.438rem]" }), _jsx("h1", { className: "mt-14 font-semibold text-3xl", children: "Agent Console" }), _jsx("p", { className: "mt-3", children: "Welcome back! Please enter your details." }), _jsx("div", { className: "mt-14 w-[360px] max-w-full", children: _jsx(AgentSignInForm, {}) })] }) }));
6
+ }
@@ -0,0 +1 @@
1
+ export declare function AgentSignInForm(): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,28 @@
1
+ 'use client';
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import { zodResolver } from '@hookform/resolvers/zod';
4
+ import { useForm } from 'react-hook-form';
5
+ import { z } from 'zod';
6
+ import { EyeIcon } from '../../icons/EyeIcon.js';
7
+ import { EyeOffIcon } from '../../icons/EyeOffIcon.js';
8
+ import { Button } from '../../ui/Button/index.js';
9
+ import { Field } from '../../ui/Field/index.js';
10
+ import { PasswordInput } from '../../ui/PasswordInput/index.js';
11
+ const schema = z.object({
12
+ username: z.string().trim().min(1, 'Username is required'),
13
+ password: z.string().trim().min(1, 'Password is required'),
14
+ });
15
+ export function AgentSignInForm() {
16
+ const form = useForm({
17
+ resolver: zodResolver(schema),
18
+ shouldUnregister: true,
19
+ shouldFocusError: true,
20
+ defaultValues: {
21
+ username: '',
22
+ password: '',
23
+ },
24
+ });
25
+ return (_jsxs("form", { noValidate: true, onSubmit: form.handleSubmit(async (data) => {
26
+ console.log(data);
27
+ }), children: [_jsxs(Field.Root, { invalid: !!form.formState.errors.username, children: [_jsx(Field.Label, { children: "Username" }), _jsx(Field.Input, { placeholder: "Enter your username", ...form.register('username') }), _jsx(Field.ErrorText, { children: form.formState.errors.username?.message })] }), _jsxs(Field.Root, { invalid: !!form.formState.errors.password, className: "mt-5", children: [_jsxs(PasswordInput.Root, { children: [_jsx(PasswordInput.Label, { children: "Password" }), _jsxs(PasswordInput.Control, { children: [_jsx(PasswordInput.Input, { placeholder: "Enter your password", ...form.register('password') }), _jsx(PasswordInput.VisibilityTrigger, { children: _jsx(PasswordInput.Indicator, { fallback: _jsx(EyeOffIcon, {}), asChild: true, children: _jsx(EyeIcon, {}) }) })] })] }), _jsx(Field.ErrorText, { children: form.formState.errors.password?.message })] }), _jsx(Button, { type: "submit", disabled: form.formState.isSubmitting, className: "mt-14 w-full justify-center", children: "Login" })] }));
28
+ }
@@ -0,0 +1 @@
1
+ export * from './AgentSignIn';
@@ -0,0 +1 @@
1
+ export * from './AgentSignIn.js';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opexa/portal-components",
3
- "version": "0.0.656",
3
+ "version": "0.0.658",
4
4
  "exports": {
5
5
  "./ui/*": {
6
6
  "types": "./dist/ui/*/index.d.ts",