@vrobots/storybook 0.2.1 → 0.2.3
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/package.json
CHANGED
|
@@ -7,6 +7,7 @@ export interface ILoginProps extends CardRootProps {
|
|
|
7
7
|
title?: string;
|
|
8
8
|
description?: string;
|
|
9
9
|
onLogin: (credentials: ILoginCredentials) => void;
|
|
10
|
+
children?: React.ReactNode;
|
|
10
11
|
}
|
|
11
|
-
declare const Login: ({ title, description, onLogin, ...props }: ILoginProps) => import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
declare const Login: ({ title, description, onLogin, children, ...props }: ILoginProps) => import("react/jsx-runtime").JSX.Element;
|
|
12
13
|
export default Login;
|
|
@@ -2,7 +2,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import { Box, Button, Card, Field, Input, Stack } from "@chakra-ui/react";
|
|
3
3
|
import { useForm } from "react-hook-form";
|
|
4
4
|
import { PasswordInput } from "../ui/password-input";
|
|
5
|
-
const Login = ({ title, description, onLogin, ...props }) => {
|
|
5
|
+
const Login = ({ title, description, onLogin, children = null, ...props }) => {
|
|
6
6
|
const { register, handleSubmit, formState: { errors }, } = useForm();
|
|
7
7
|
return (_jsx(Card.Root, { ...props, children: _jsxs(Card.Body, { children: [_jsx(Card.Title, { children: title || "Login" }), !!description && _jsx(Card.Description, { children: description }), _jsxs(Box, { as: "form", onSubmit: handleSubmit((data) => onLogin(data)), mt: 4, children: [_jsxs(Stack, { gap: "4", children: [_jsxs(Field.Root, { invalid: !!errors.emailAddress, required: true, children: [_jsx(Field.Label, { children: "Email Address" }), _jsx(Input, { ...register("emailAddress", {
|
|
8
8
|
required: "Please enter your email address",
|
|
@@ -12,6 +12,6 @@ const Login = ({ title, description, onLogin, ...props }) => {
|
|
|
12
12
|
}
|
|
13
13
|
}), autoFocus: true }), _jsx(Field.ErrorText, { children: errors.emailAddress?.message })] }), _jsxs(Field.Root, { invalid: !!errors.password, children: [_jsx(Field.Label, { children: "Password" }), _jsx(PasswordInput, { ...register("password", {
|
|
14
14
|
required: "Please enter your password",
|
|
15
|
-
}) }), _jsx(Field.ErrorText, { children: errors.password?.message })] })] }), _jsx(Button, { type: "submit", width: "full", mt: 6, children: "Login" })] })] }) }));
|
|
15
|
+
}) }), _jsx(Field.ErrorText, { children: errors.password?.message })] })] }), children, _jsx(Button, { type: "submit", width: "full", mt: 6, children: "Login" })] })] }) }));
|
|
16
16
|
};
|
|
17
17
|
export default Login;
|
|
@@ -3,7 +3,7 @@ export * from "./SecondFactorAuth";
|
|
|
3
3
|
export * from "./FileUploader";
|
|
4
4
|
declare const Form: {
|
|
5
5
|
(): null;
|
|
6
|
-
Login: ({ title, description, onLogin, ...props }: import("./Login").ILoginProps) => import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
Login: ({ title, description, onLogin, children, ...props }: import("./Login").ILoginProps) => import("react/jsx-runtime").JSX.Element;
|
|
7
7
|
SecondFactorAuth: ({ title, description, onSecondFactorAuth, onResendAuthCode, ...props }: import("./SecondFactorAuth").ISecondFactorAuthProps) => import("react/jsx-runtime").JSX.Element;
|
|
8
8
|
FileUploader: ({ title, description, buttonLabel, helperText, accept, multiple, onFilesSelected, uploadPercentages, children, ...props }: import("./FileUploader").IFileUploaderProps) => import("react/jsx-runtime").JSX.Element;
|
|
9
9
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { StoryObj } from '@storybook/react-vite';
|
|
2
2
|
declare const meta: {
|
|
3
3
|
title: string;
|
|
4
|
-
component: ({ title, description, onLogin, ...props }: import("../components").ILoginProps) => import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
component: ({ title, description, onLogin, children, ...props }: import("../components").ILoginProps) => import("react/jsx-runtime").JSX.Element;
|
|
5
5
|
tags: string[];
|
|
6
6
|
parameters: {
|
|
7
7
|
layout: string;
|