diff --git a/apps/backoffice/src/app/login/page.tsx b/apps/backoffice/src/app/login/page.tsx index a78a20c..cbdc657 100644 --- a/apps/backoffice/src/app/login/page.tsx +++ b/apps/backoffice/src/app/login/page.tsx @@ -1,9 +1,6 @@ import { FC, ReactElement } from 'react'; -import { - Input, - Button, - PasswordInput, -} from '@imphnen-frontend-service/ui/atoms'; +import { Button, PasswordInput } from '@imphnen-frontend-service/ui/atoms'; +import { InputForm } from '@imphnen-frontend-service/ui/molecules'; export const Components: FC = (): ReactElement => { return ( @@ -13,10 +10,12 @@ export const Components: FC = (): ReactElement => {

Welcome to IMPHNEN Backoffice

-
-
Email
- -
+
Password
diff --git a/libs/ui/src/molecules/index.ts b/libs/ui/src/molecules/index.ts index cb0ff5c..14dcfcb 100644 --- a/libs/ui/src/molecules/index.ts +++ b/libs/ui/src/molecules/index.ts @@ -1 +1 @@ -export {}; +export * from './input-form'; diff --git a/libs/ui/src/molecules/input-form/index.ts b/libs/ui/src/molecules/input-form/index.ts new file mode 100644 index 0000000..14dcfcb --- /dev/null +++ b/libs/ui/src/molecules/input-form/index.ts @@ -0,0 +1 @@ +export * from './input-form'; diff --git a/libs/ui/src/molecules/input-form/input-form.stories.tsx b/libs/ui/src/molecules/input-form/input-form.stories.tsx new file mode 100644 index 0000000..e74538c --- /dev/null +++ b/libs/ui/src/molecules/input-form/input-form.stories.tsx @@ -0,0 +1,51 @@ +import type { Meta, StoryObj } from '@storybook/react'; +import { InputForm } from './input-form'; + +const meta = { + title: 'Molecules/InputForm', + component: InputForm, + parameters: { + layout: 'centered', + }, + tags: ['autodocs'], +} satisfies Meta; + +export default meta; +type Story = StoryObj; + +export const Default: Story = { + args: { + label: 'Email', + placeholder: 'Enter your email', + type: 'email', + size: 'md', + }, +}; + +export const WithError: Story = { + args: { + label: 'Username', + placeholder: 'Enter your username', + type: 'text', + size: 'md', + error: 'This field is required', + }, +}; + +export const Large: Story = { + args: { + label: 'Full Name', + placeholder: 'Enter your full name', + type: 'text', + size: 'lg', + }, +}; + +export const Small: Story = { + args: { + label: 'Phone', + placeholder: 'Enter your phone number', + type: 'text', + size: 'sm', + }, +}; diff --git a/libs/ui/src/molecules/input-form/input-form.tsx b/libs/ui/src/molecules/input-form/input-form.tsx new file mode 100644 index 0000000..26d080e --- /dev/null +++ b/libs/ui/src/molecules/input-form/input-form.tsx @@ -0,0 +1,44 @@ +import { + DetailedHTMLProps, + FC, + InputHTMLAttributes, + ReactElement, +} from 'react'; +import { Input } from '../../atoms'; + +type TInputType = 'text' | 'email'; +type TInputSize = 'sm' | 'md' | 'lg'; + +type TInputFormProps = Omit< + DetailedHTMLProps, HTMLInputElement>, + 'size' | 'type' +> & { + label: string; + type?: TInputType; + size?: TInputSize; + error?: string; +}; + +export const InputForm: FC = ({ + label, + placeholder, + type = 'text', + size = 'md', + error, + ...rest +}): ReactElement => { + return ( +
+
{label}
+ +
+ ); +}; + +export default InputForm; diff --git a/libs/ui/src/organisms/modals-gacha/modals-gacha.spec.tsx b/libs/ui/src/organisms/modals-gacha/modals-gacha.spec.tsx deleted file mode 100644 index e69de29..0000000 diff --git a/libs/ui/src/organisms/modals-gacha/modals-gacha.stories.tsx b/libs/ui/src/organisms/modals-gacha/modals-gacha.stories.tsx deleted file mode 100644 index e69de29..0000000