From b1a17d537e1adb1f9014d49f18520c1041357b61 Mon Sep 17 00:00:00 2001 From: Maxime Lalo Date: Fri, 19 Jul 2024 16:32:40 +0200 Subject: [PATCH] :sparkles: New inputs --- .../DesignSystem/Form/BaseField.tsx | 2 +- .../NewTextAreaField/classes.module.scss | 94 ---------- .../Form/NewFields/NewTextAreaField/index.tsx | 46 ----- .../NewTextField/classes.module.scss | 112 ------------ .../Form/NewFields/NewTextField/index.tsx | 63 ------- .../Form/TextField/classes.module.scss | 168 ++++++++++-------- .../DesignSystem/Form/TextField/index.tsx | 49 ++--- .../Form/TextareaField/classes.module.scss | 123 ++++++++----- .../DesignSystem/Form/TextareaField/index.tsx | 48 +++-- .../DesignSystem/Typography/index.tsx | 1 + .../Components/Layouts/DesignSystem/index.tsx | 14 +- .../Layouts/Folder/CreateFolder/index.tsx | 2 +- 12 files changed, 227 insertions(+), 495 deletions(-) delete mode 100644 src/front/Components/DesignSystem/Form/NewFields/NewTextAreaField/classes.module.scss delete mode 100644 src/front/Components/DesignSystem/Form/NewFields/NewTextAreaField/index.tsx delete mode 100644 src/front/Components/DesignSystem/Form/NewFields/NewTextField/classes.module.scss delete mode 100644 src/front/Components/DesignSystem/Form/NewFields/NewTextField/index.tsx diff --git a/src/front/Components/DesignSystem/Form/BaseField.tsx b/src/front/Components/DesignSystem/Form/BaseField.tsx index 2982bc93..3fe14388 100644 --- a/src/front/Components/DesignSystem/Form/BaseField.tsx +++ b/src/front/Components/DesignSystem/Form/BaseField.tsx @@ -108,7 +108,7 @@ export default abstract class BaseField

{ errors.push( - + {value} , ); diff --git a/src/front/Components/DesignSystem/Form/NewFields/NewTextAreaField/classes.module.scss b/src/front/Components/DesignSystem/Form/NewFields/NewTextAreaField/classes.module.scss deleted file mode 100644 index 0a699277..00000000 --- a/src/front/Components/DesignSystem/Form/NewFields/NewTextAreaField/classes.module.scss +++ /dev/null @@ -1,94 +0,0 @@ -@import "@Themes/constants.scss"; - -.root { - position: relative; - - &[data-is-disabled="true"] { - opacity: var(--opacity-disabled, 0.3); - .input-container { - cursor: not-allowed; - border: 1px solid var(--input-main-border-default, #d7dce0); - &::placeholder { - background: var(--input-background, #fff); - } - - &:hover { - border: 1px solid var(--input-main-border-default, #d7dce0); - } - - .input { - cursor: not-allowed; - } - } - } - - .label { - padding: 0px var(--spacing-2, 16px); - } - - .input-container { - display: flex; - padding: var(--spacing-2, 16px) var(--spacing-sm, 8px); - align-items: center; - gap: var(--spacing-2, 16px); - - border-radius: var(--input-radius, 0px); - border: 1px solid var(--input-main-border-default, #d7dce0); - background: var(--input-background, #fff); - - &:hover { - border: 1px solid var(--input-main-border-hovered, #b4bec5); - } - - &:not([data-value=""]) { - border: 1px solid var(--input-main-border-filled, #6d7e8a); - .input { - font-weight: var(--font-text-weight-semibold, 600); - } - } - - &[data-is-errored="true"] { - border: 1px solid var(--input-error, #dc2625); - } - - &:focus, - &:focus-within, - &:focus-visible { - border: 1px solid var(--input-main-border-focused, #005bcb); - .input { - font-weight: var(--font-text-weight-semibold, 600); - } - } - - .input { - display: flex; - padding: 0px var(--spacing-2, 16px); - - align-items: center; - gap: 8px; - - flex: 1 0 0; - border: none; - height: 94px; - &::placeholder { - color: var(--input-placeholder-empty, #6d7e8a); - /* text/md/regular */ - font-family: var(--font-text-family, Poppins); - font-size: 16px; - font-style: normal; - font-weight: var(--font-text-weight-regular, 400); - line-height: normal; - letter-spacing: 0.08px; - } - - color: var(--input-placeholder-filled, #24282e); - /* text/md/semibold */ - font-family: var(--font-text-family, Poppins); - font-size: 16px; - font-style: normal; - font-weight: var(--font-text-weight-semibold, 600); - line-height: normal; - letter-spacing: 0.08px; - } - } -} diff --git a/src/front/Components/DesignSystem/Form/NewFields/NewTextAreaField/index.tsx b/src/front/Components/DesignSystem/Form/NewFields/NewTextAreaField/index.tsx deleted file mode 100644 index 0c030865..00000000 --- a/src/front/Components/DesignSystem/Form/NewFields/NewTextAreaField/index.tsx +++ /dev/null @@ -1,46 +0,0 @@ -import React from "react"; -import Typography, { ETypo, ETypoColor } from "@Front/Components/DesignSystem/Typography"; -import { ReactNode } from "react"; -import BaseField, { IProps as IBaseFieldProps } from "../../BaseField"; -import classes from "./classes.module.scss"; -import classnames from "classnames"; - -export type IProps = IBaseFieldProps & {}; - -export default class NewTextAreaField extends BaseField { - constructor(props: IProps) { - super(props); - this.state = this.getDefaultState(); - } - - public override render(): ReactNode { - const value = this.state.value ?? ""; - console.log(this.hasError()); - return ( - -

-