This commit is contained in:
Hugo Lextrait 2023-04-17 16:50:26 +02:00
commit 7d5f367435
18 changed files with 234 additions and 81 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 191 KiB

View File

@ -15,11 +15,11 @@ type IProps = {
variant?: EButtonVariant; variant?: EButtonVariant;
fullwidth?: "true" | "false"; fullwidth?: "true" | "false";
icon?: string; icon?: string;
iconStyle?: CSSProperties; iconstyle?: CSSProperties;
disabled?: boolean; disabled?: boolean;
type?: "button" | "submit"; type?: "button" | "submit";
isloading?: string; isloading?: string;
iconPosition?: "left" | "right"; iconposition?: "left" | "right";
}; };
export default function Button(props: IProps) { export default function Button(props: IProps) {
@ -29,11 +29,11 @@ export default function Button(props: IProps) {
type = "button", type = "button",
isloading = "false", isloading = "false",
fullwidth = "false", fullwidth = "false",
iconPosition = "right", iconposition = "right",
onClick, onClick,
children, children,
icon, icon,
iconStyle, iconstyle,
} = props; } = props;
const attributes = { ...props, variant, disabled, type, isloading, fullwidth }; const attributes = { ...props, variant, disabled, type, isloading, fullwidth };
@ -42,9 +42,9 @@ export default function Button(props: IProps) {
delete attributes.iconPosition; delete attributes.iconPosition;
return ( return (
<button {...attributes} onClick={onClick} className={classes["root"]} type={type}> <button {...attributes} onClick={onClick} className={classes["root"]} type={type}>
{icon && iconPosition === "left" && <Image src={icon} style={iconStyle} alt={"button icon"} />} {icon && iconposition === "left" && <Image src={icon} style={iconstyle} alt={"button icon"} />}
{children} {children}
{icon && iconPosition === "right" && <Image src={icon} style={iconStyle} alt={"button icon"} />} {icon && iconposition === "right" && <Image src={icon} style={iconstyle} alt={"button icon"} />}
</button> </button>
); );
} }

View File

@ -1,7 +1,7 @@
@import "@Themes/constants.scss"; @import "@Themes/constants.scss";
.root { .root {
background-color: $grey-soft; background-color: var(--grey-soft);
padding: 24px; padding: 24px;
width: 100%; width: 100%;
display: flex; display: flex;

View File

@ -26,31 +26,27 @@
border: 1px solid $grey-medium; border: 1px solid $grey-medium;
&:focus { &:focus {
~.fake-placeholder { ~ .fake-placeholder {
transform: translateY(-35px); transform: translateY(-35px);
transition: transform 0.3s ease-in-out;
} }
} }
&:not([value=""]) { &:not([data-value=""]) {
~.fake-placeholder { ~ .fake-placeholder {
transform: translateY(-35px); transform: translateY(-35px);
transition: transform;
} }
} }
&[type="number"] { &[type="number"] {
&:focus { &:focus {
~.fake-placeholder { ~ .fake-placeholder {
transform: translateY(-35px); transform: translateY(-35px);
transition: transform 0.3s ease-in-out;
} }
} }
&:not([value=""]) { &:not([data-value=""]) {
~.fake-placeholder { ~ .fake-placeholder {
transform: translateY(-35px); transform: translateY(-35px);
transition: transform;
} }
} }
@ -75,14 +71,13 @@
} }
} }
&:not([value=""]) { &:not([data-value=""]) {
~.fake-placeholder { ~ .fake-placeholder {
transform: translateY(-35px); transform: translateY(-35px);
transition: transform 0.3s ease-in-out;
} }
} }
~.fake-placeholder { ~ .fake-placeholder {
z-index: 2; z-index: 2;
top: 35%; top: 35%;
margin-left: 8px; margin-left: 8px;
@ -90,6 +85,7 @@
pointer-events: none; pointer-events: none;
position: absolute; position: absolute;
background: $white; background: $white;
transition: transform 0.3s ease-in-out;
} }
} }
} }
@ -106,7 +102,7 @@
height: 70px; height: 70px;
border: 1px solid $grey-medium; border: 1px solid $grey-medium;
~.fake-placeholder { ~ .fake-placeholder {
z-index: 2; z-index: 2;
top: -12px; top: -12px;
margin-left: 8px; margin-left: 8px;
@ -114,6 +110,19 @@
pointer-events: none; pointer-events: none;
position: absolute; position: absolute;
background: $white; background: $white;
// transform: translateY(-35px); transform: translateY(35px);
transition: transform 0.3s ease-in-out;
} }
}
&:focus {
~ .fake-placeholder {
transform: translateY(0px);
}
}
&:not([data-value=""]) {
~ .fake-placeholder {
transform: translateY(0px);
}
}
}

View File

@ -40,7 +40,7 @@ export default class InputField extends BaseField<IProps> {
required={this.props.required} required={this.props.required}
ref={this.props.fieldRef} ref={this.props.fieldRef}
rows={4} rows={4}
value={value} data-value={value}
onChange={this.onChange} onChange={this.onChange}
data-has-validation-errors={this.state.errors.length > 0} data-has-validation-errors={this.state.errors.length > 0}
className={ className={
@ -61,7 +61,7 @@ export default class InputField extends BaseField<IProps> {
pattern={pattern} pattern={pattern}
onChange={this.onChange} onChange={this.onChange}
onBlur={this.onBlur} onBlur={this.onBlur}
value={value} data-value={value}
data-has-validation-errors={this.state.errors.length > 0} data-has-validation-errors={this.state.errors.length > 0}
className={ className={
this.props.className ? [classes["input"], classes[this.props.className]].join(" ") : classes["input"] this.props.className ? [classes["input"], classes[this.props.className]].join(" ") : classes["input"]

View File

@ -14,7 +14,7 @@ type IProps = {
export default class RadioBox extends React.Component<IProps> { export default class RadioBox extends React.Component<IProps> {
public override render(): JSX.Element { public override render(): JSX.Element {
return ( return (
<Typography typo={ITypo.P_ERR_16} color={ITypoColor.BLACK}> <Typography typo={ITypo.P_ERR_18} color={ITypoColor.BLACK}>
<label className={classes["root"]}> <label className={classes["root"]}>
<input type="radio" name={this.props.name} defaultChecked={this.props.defaultChecked} onChange={this.props.onChange} /> <input type="radio" name={this.props.name} defaultChecked={this.props.defaultChecked} onChange={this.props.onChange} />
{this.props.children} {this.props.children}

View File

@ -125,4 +125,8 @@
&.black { &.black {
color: $black; color: $black;
} }
&.purple-flash {
color: var(--purple-flash);
}
} }

View File

@ -6,6 +6,7 @@ type IProps = {
typo: ITypo; typo: ITypo;
children: React.ReactNode; children: React.ReactNode;
color?: ITypoColor; color?: ITypoColor;
className?: string;
}; };
type IState = {}; type IState = {};
@ -33,12 +34,19 @@ export enum ITypoColor {
RE_HOVER = "re-hover", RE_HOVER = "re-hover",
GREY = "grey", GREY = "grey",
BLACK = "black", BLACK = "black",
PURPLE_FLASH = "purple-flash",
} }
export default class Typography extends React.Component<IProps, IState> { export default class Typography extends React.Component<IProps, IState> {
public override render(): JSX.Element { public override render(): JSX.Element {
return ( return (
<div className={classNames(classes["root"], classes[this.props.typo], classes[this.props.color ?? ""])}> <div
className={classNames(
classes["root"],
classes[this.props.typo],
classes[this.props.color ?? ""],
this.props.className ?? "",
)}>
{this.props.children} {this.props.children}
</div> </div>
); );

View File

@ -5,7 +5,7 @@
align-items: center; align-items: center;
justify-content: space-between; justify-content: space-between;
padding: 24px; padding: 24px;
background-color: $grey-soft; background-color: var(--grey-soft);
width: 100%; width: 100%;
.content { .content {

View File

@ -0,0 +1,28 @@
import Link from "next/link";
import React from "react";
import Button, { EButtonVariant } from "@Front/Components/DesignSystem/Button";
import ChevronIcon from "@Assets/icons/chevron.svg";
type IProps = {
url: string;
};
type IState = {};
export default class BackArrow extends React.Component<IProps, IState> {
public constructor(props: IProps) {
super(props);
}
public override render(): JSX.Element {
return (
<Link href={this.props.url}>
<Button
icon={ChevronIcon}
iconposition={"left"}
iconstyle={{ transform: "rotate(180deg)", width: "22px", height: "22px" }}
variant={EButtonVariant.LINE}>
Retour
</Button>
</Link>
);
}
}

View File

@ -7,32 +7,40 @@
.content { .content {
display: flex; display: flex;
align-items: center;
height: calc(100vh - 83px); height: calc(100vh - 83px);
width: 100%;
.side-left {
max-height: 100vh;
overflow: auto;
}
.sides { .sides {
width: 100%; width: 50%;
height: 100%;
display: flex;
align-items: center;
justify-content: center;
&.image-container { &.image-container {
display: flex;
align-items: center;
justify-content: center;
@media (max-width: $screen-m) { @media (max-width: $screen-m) {
display: none; display: none;
} }
background: var(--grey-soft);
.image {
height: 100%;
object-fit: contain;
}
} }
.side-content { &.background-image-container {
max-width: 530px; display: flex;
} align-items: center;
justify-content: center;
.image { .background-image {
height: 100%; height: 100%;
width: 100%; width: 100%;
object-fit: cover; object-fit: cover;
}
} }
} }
} }
} }

View File

@ -13,12 +13,15 @@ type IProps = {
*/ */
scrollTop: number | null; scrollTop: number | null;
image: StaticImageData; image: StaticImageData;
type: "background" | "image";
}; };
type IState = {}; type IState = {};
export default class DefaultDoubleSidePage extends React.Component<IProps, IState> { export default class DefaultDoubleSidePage extends React.Component<IProps, IState> {
public static defaultProps = { public static defaultProps = {
scrollTop: 0, scrollTop: 0,
type: "background",
}; };
public override render(): JSX.Element { public override render(): JSX.Element {
@ -26,12 +29,17 @@ export default class DefaultDoubleSidePage extends React.Component<IProps, IStat
<div className={classes["root"]}> <div className={classes["root"]}>
<Header isUserConnected={false} /> <Header isUserConnected={false} />
<div className={classes["content"]}> <div className={classes["content"]}>
<div className={classes["sides"]}> <div className={classNames(classes["sides"], classes["side-left"])}>{this.props.children}</div>
<div className={classes["side-content"]}>{this.props.children}</div> {this.props.type === "image" && (
</div> <div className={classNames(classes["sides"], classes["image-container"])}>
<div className={classNames(classes["sides"], classes["image-container"])}> <Image alt={"right side image"} src={this.props.image} className={classes["image"]} />
<Image alt={"right side image"} src={this.props.image} className={classes["image"]} /> </div>
</div> )}
{this.props.type === "background" && (
<div className={classNames(classes["sides"], classes["background-image-container"])}>
<Image alt={"right side image"} src={this.props.image} className={classes["background-image"]} />
</div>
)}
</div> </div>
<Version /> <Version />
</div> </div>

View File

@ -9,9 +9,8 @@ import { ActionMeta, MultiValue } from "react-select";
import { IOption } from "@Front/Components/DesignSystem/Select"; import { IOption } from "@Front/Components/DesignSystem/Select";
import InputField from "@Front/Components/DesignSystem/Form/Elements/InputField"; import InputField from "@Front/Components/DesignSystem/Form/Elements/InputField";
import Form from "@Front/Components/DesignSystem/Form"; import Form from "@Front/Components/DesignSystem/Form";
import ChevonIcon from "@Assets/icons/chevron.svg";
import Link from "next/link";
import { useRouter } from "next/router"; import { useRouter } from "next/router";
import BackArrow from "@Front/Components/Elements/BackArrow";
type IProps = { type IProps = {
selectedFolderUid: string; selectedFolderUid: string;
@ -45,15 +44,7 @@ class AddClientToFolderClass extends BasePage<IProps, IState> {
return ( return (
<DefaultNotaryDashboard title={"Ajouter client(s)"} onSelectedFolder={this.onSelectedFolder}> <DefaultNotaryDashboard title={"Ajouter client(s)"} onSelectedFolder={this.onSelectedFolder}>
<div className={classes["root"]}> <div className={classes["root"]}>
<Link href={"/dossier/".concat(this.props.selectedFolderUid)}> <BackArrow url={"/dossier/".concat(this.props.selectedFolderUid)} />
<Button
icon={ChevonIcon}
iconPosition={"left"}
iconStyle={{ transform: "rotate(180deg)", width: "22px", height: "22px" }}
variant={EButtonVariant.LINE}>
Retour
</Button>
</Link>
<Typography typo={ITypo.H1Bis}>Associer un ou plusieurs client(s)</Typography> <Typography typo={ITypo.H1Bis}>Associer un ou plusieurs client(s)</Typography>
<Form> <Form>
<div className={classes["radiobox-container"]}> <div className={classes["radiobox-container"]}>

View File

@ -0,0 +1,29 @@
.root {
margin: 64px 0 0 64px;
width: 530px;
.title {
margin-top: 24px;
}
.subtitle {
margin-top: 32px;
}
.form-container {
margin-top: 16px;
display: flex;
flex-direction: column;
gap: 24px;
}
.access-container {
margin-top: 16px;
.radio-container {
margin-top: 16px;
display: flex;
flex-direction: column;
gap: 16px;
}
}
}

View File

@ -0,0 +1,63 @@
import BasePage from "../../Base";
import Typography, { ITypo, ITypoColor } from "@Front/Components/DesignSystem/Typography";
import classes from "./classes.module.scss";
import DefaultDoubleSidePage from "@Front/Components/LayoutTemplates/DefaultDoubleSidePage";
import RightImage from "@Front/Assets/images/create-folder/right-image.png";
import BackArrow from "@Front/Components/Elements/BackArrow";
import Form from "@Front/Components/DesignSystem/Form";
import InputField from "@Front/Components/DesignSystem/Form/Elements/InputField";
import Select from "@Front/Components/DesignSystem/Select";
import RadioBox from "@Front/Components/DesignSystem/RadioBox";
type IProps = {};
type IState = {};
export default class CreateFolder extends BasePage<IProps, IState> {
public constructor(props: IProps) {
super(props);
}
// TODO: Message if the user has not created any folder yet
public override render(): JSX.Element {
return (
<DefaultDoubleSidePage title={"Dossier"} image={RightImage} type="image">
<div className={classes["root"]}>
<BackArrow url="/" />
<Typography typo={ITypo.H1} color={ITypoColor.BLACK} className={classes["title"]}>
Créer un dossier
</Typography>
<Typography typo={ITypo.H3} color={ITypoColor.PURPLE_FLASH} className={classes["subtitle"]}>
Informations dossier
</Typography>
<Form>
<div className={classes["form-container"]}>
<InputField name="folder_number" fakeplaceholder="Numéro de dossier" type="number" />
<InputField name="entitled" fakeplaceholder="Intitulé" />
<Select
options={[
{ label: "Divorce", value: "divorce" },
{ label: "Succession", value: "succession" },
{ label: "Vente immobilière", value: "vente_immobiliere" },
]}
onChange={() => {}}
placeholder={"Type dacte"}
/>
<InputField name="personal_note" fakeplaceholder="Note personnelle" textarea />
</div>
<div className={classes["access-container"]}>
<Typography typo={ITypo.H3} color={ITypoColor.PURPLE_FLASH}>
Accès au dossier
</Typography>
<div className={classes["radio-container"]}>
<RadioBox name="file_access" defaultChecked>
Sélectionner tout l'office
</RadioBox>
<RadioBox name="file_access">Sélectionner certains collaborateurs</RadioBox>
</div>
</div>
</Form>
</div>
</DefaultDoubleSidePage>
);
}
public override async componentDidMount() {}
}

View File

@ -9,26 +9,26 @@
--colormerdum: blue; --colormerdum: blue;
--green-flash: $green-flash; --green-flash: #{$green-flash};
--blue-flash: $blue-flash; --blue-flash: #{$blue-flash};
--turquoise-flash: $turquoise-flash; --turquoise-flash: #{$turquoise-flash};
--purple-flash: $purple-flash; --purple-flash: #{$purple-flash};
--purple-hover: $purple-hover; --purple-hover: #{$purple-hover};
--orange-flash: $orange-flash; --orange-flash: #{$orange-flash};
--red-flash: $red-flash; --red-flash: #{$red-flash};
--re-hover: $re-hover; --re-hover: #{$re-hover};
--pink-flash: $pink-flash; --pink-flash: #{$pink-flash};
--pink-hover: $pink-hover; --pink-hover: #{$pink-hover};
--green-soft: $green-soft; --green-soft: #{$green-soft};
--blue-soft: $blue-soft; --blue-soft: #{$blue-soft};
--turquoise-soft: $turquoise-soft; --turquoise-soft: #{$turquoise-soft};
--purple-soft: $purple-soft; --purple-soft: #{$purple-soft};
--orange-soft: $orange-soft; --orange-soft: #{$orange-soft};
--red-soft: $red-soft; --red-soft: #{$red-soft};
--pink-soft: $pink-soft; --pink-soft: #{$pink-soft};
--grey: $grey; --grey: #{$grey};
--grey-medium: $grey-medium; --grey-medium: #{$grey-medium};
--grey-soft: $grey-soft; --grey-soft: #{$grey-soft};
} }

View File

@ -0,0 +1,5 @@
import CreateFolder from "@Front/Components/Layouts/Folder/CreateFolder";
export default function Route() {
return <CreateFolder />;
}