From 425fcbedfad843816ae2aa0e0585a886ca63c3e5 Mon Sep 17 00:00:00 2001 From: Maxime Lalo Date: Fri, 19 Jul 2024 15:28:02 +0200 Subject: [PATCH 1/6] :bug: fixing font family in datefield --- .../Components/DesignSystem/Form/DateField/classes.module.scss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/front/Components/DesignSystem/Form/DateField/classes.module.scss b/src/front/Components/DesignSystem/Form/DateField/classes.module.scss index 8cfc21c9..8fad4077 100644 --- a/src/front/Components/DesignSystem/Form/DateField/classes.module.scss +++ b/src/front/Components/DesignSystem/Form/DateField/classes.module.scss @@ -13,7 +13,7 @@ width: 100%; height: 70px; border: 1px solid var(--color-neutral-200); - + font-family: var(--font-text-family); &:disabled { cursor: not-allowed; } From ada4dadc09c89d6ef7e1b44db36e0ec04b251b02 Mon Sep 17 00:00:00 2001 From: Maxime Lalo Date: Fri, 19 Jul 2024 15:28:44 +0200 Subject: [PATCH 2/6] :bug: Fixing header in update folder --- .../Components/Layouts/Folder/UpdateFolderMetadata/index.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/front/Components/Layouts/Folder/UpdateFolderMetadata/index.tsx b/src/front/Components/Layouts/Folder/UpdateFolderMetadata/index.tsx index 1c8dee00..45e65165 100644 --- a/src/front/Components/Layouts/Folder/UpdateFolderMetadata/index.tsx +++ b/src/front/Components/Layouts/Folder/UpdateFolderMetadata/index.tsx @@ -87,7 +87,7 @@ export default function UpdateFolderMetadata() { const defaultValue = openingDate.toISOString().split("T")[0]; return ( - +
From 0fb3069d8f390ba0a4133c57219e82f89c2e3d95 Mon Sep 17 00:00:00 2001 From: Maxime Lalo Date: Fri, 19 Jul 2024 15:51:39 +0200 Subject: [PATCH 3/6] :sparkles: Number picker done --- .../Elements/NumberPicker/classes.module.scss | 10 +++++++--- src/front/Components/Elements/NumberPicker/index.tsx | 4 ++-- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/src/front/Components/Elements/NumberPicker/classes.module.scss b/src/front/Components/Elements/NumberPicker/classes.module.scss index 0768ef30..04ead720 100644 --- a/src/front/Components/Elements/NumberPicker/classes.module.scss +++ b/src/front/Components/Elements/NumberPicker/classes.module.scss @@ -4,16 +4,20 @@ align-items: center; width: fit-content; border: 1px solid #e7e7e7; - padding: 24px; - + padding: var(--spacing-1-5, 12px) var(--spacing-md, 16px); + gap: var(--spacing-2, 16px); .button { border: none; background: none; + padding: 0; + height: 24px; + width: 24px; cursor: pointer; } .input { - width: 50px; + width: 40px; + height: 40px; text-align: center; border: none; } diff --git a/src/front/Components/Elements/NumberPicker/index.tsx b/src/front/Components/Elements/NumberPicker/index.tsx index 5bb08189..c69a3e34 100644 --- a/src/front/Components/Elements/NumberPicker/index.tsx +++ b/src/front/Components/Elements/NumberPicker/index.tsx @@ -35,11 +35,11 @@ export default function NumberPicker(props: IProps) { return (
); From 38a8931993a2ea2a94cd9dcc8fa0e87f0d2ef967 Mon Sep 17 00:00:00 2001 From: Maxime Lalo Date: Fri, 19 Jul 2024 16:19:29 +0200 Subject: [PATCH 4/6] :sparkles: New base text field --- .../DesignSystem/Form/BaseField.tsx | 1 + .../NewTextField/classes.module.scss | 112 ++++++++++++++++++ .../Form/NewFields/NewTextField/index.tsx | 63 ++++++++++ .../DesignSystem/Typography/index.tsx | 2 + .../Components/Layouts/DesignSystem/index.tsx | 10 ++ 5 files changed, 188 insertions(+) create mode 100644 src/front/Components/DesignSystem/Form/NewFields/NewTextField/classes.module.scss create 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 08be103f..2982bc93 100644 --- a/src/front/Components/DesignSystem/Form/BaseField.tsx +++ b/src/front/Components/DesignSystem/Form/BaseField.tsx @@ -15,6 +15,7 @@ export type IProps = { disableValidation?: boolean; validationError?: ValidationError; disabled?: boolean; + label?: string; }; type IState = { diff --git a/src/front/Components/DesignSystem/Form/NewFields/NewTextField/classes.module.scss b/src/front/Components/DesignSystem/Form/NewFields/NewTextField/classes.module.scss new file mode 100644 index 00000000..5a5d2ef1 --- /dev/null +++ b/src/front/Components/DesignSystem/Form/NewFields/NewTextField/classes.module.scss @@ -0,0 +1,112 @@ +@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; + + &::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; + } + + &[type="number"] { + &::-webkit-inner-spin-button, + &::-webkit-outer-spin-button { + -webkit-appearance: none; + margin: 0; + } + + /* For Chrome, Safari, and Opera */ + &::-webkit-inner-spin-button, + &::-webkit-outer-spin-button { + -webkit-appearance: none; + margin: 0; + } + + /* For IE 10+ */ + &::-ms-inner-spin-button, + &::-ms-outer-spin-button { + display: none; + } + } + } + } + + .copy-icon { + cursor: pointer; + height: 24px; + width: 24px; + } +} diff --git a/src/front/Components/DesignSystem/Form/NewFields/NewTextField/index.tsx b/src/front/Components/DesignSystem/Form/NewFields/NewTextField/index.tsx new file mode 100644 index 00000000..ab14094f --- /dev/null +++ b/src/front/Components/DesignSystem/Form/NewFields/NewTextField/index.tsx @@ -0,0 +1,63 @@ +import React from "react"; +import Typography, { ETypo, ETypoColor } from "@Front/Components/DesignSystem/Typography"; +import { ReactNode } from "react"; +import CopyIcon from "@Assets/Icons/copy.svg"; +import BaseField, { IProps as IBaseFieldProps } from "../../BaseField"; +import classes from "./classes.module.scss"; +import classnames from "classnames"; +import Image from "next/image"; + +export type IProps = IBaseFieldProps & { + canCopy?: boolean; + password?: boolean; +}; + +export default class NewTextField 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 ( + +
+ +
+ {this.hasError() &&
{this.renderErrors()}
} +
+ ); + } + + private onCopyClick = (): void => { + if (this.props.canCopy) { + navigator.clipboard.writeText(this.state.value ?? ""); + } + }; +} diff --git a/src/front/Components/DesignSystem/Typography/index.tsx b/src/front/Components/DesignSystem/Typography/index.tsx index 86dd26dc..44fa4c03 100644 --- a/src/front/Components/DesignSystem/Typography/index.tsx +++ b/src/front/Components/DesignSystem/Typography/index.tsx @@ -144,6 +144,8 @@ export enum ETypoColor { TABS_CONTRAST_DEFAULT = "--tabs-contrast-default", TABS_CONTRAST_ACTIVATED = "--tabs-contrast-actived", + + INPUT_LABEL = "--input-label", } export default function Typography(props: IProps) { diff --git a/src/front/Components/Layouts/DesignSystem/index.tsx b/src/front/Components/Layouts/DesignSystem/index.tsx index 599555c1..a9d86a3a 100644 --- a/src/front/Components/Layouts/DesignSystem/index.tsx +++ b/src/front/Components/Layouts/DesignSystem/index.tsx @@ -13,6 +13,8 @@ import classes from "./classes.module.scss"; import useOpenable from "@Front/Hooks/useOpenable"; import Modal from "@Front/Components/DesignSystem/Modal"; import IconButton, { EIconButtonVariant } from "@Front/Components/DesignSystem/IconButton"; +import NewTextField from "@Front/Components/DesignSystem/Form/NewFields/NewTextField"; +import Form from "@Front/Components/DesignSystem/Form"; export default function DesignSystem() { const { isOpen, open, close } = useOpenable(); @@ -64,6 +66,14 @@ export default function DesignSystem() {
+ Inputs +
+ + + + + + Modal Date: Fri, 19 Jul 2024 16:24:58 +0200 Subject: [PATCH 5/6] :sparkles: Textarea working --- .../NewTextAreaField/classes.module.scss | 94 +++++++++++++++++++ .../Form/NewFields/NewTextAreaField/index.tsx | 46 +++++++++ .../Layouts/DesignSystem/classes.module.scss | 5 + .../Components/Layouts/DesignSystem/index.tsx | 4 +- 4 files changed, 148 insertions(+), 1 deletion(-) create mode 100644 src/front/Components/DesignSystem/Form/NewFields/NewTextAreaField/classes.module.scss create mode 100644 src/front/Components/DesignSystem/Form/NewFields/NewTextAreaField/index.tsx diff --git a/src/front/Components/DesignSystem/Form/NewFields/NewTextAreaField/classes.module.scss b/src/front/Components/DesignSystem/Form/NewFields/NewTextAreaField/classes.module.scss new file mode 100644 index 00000000..0a699277 --- /dev/null +++ b/src/front/Components/DesignSystem/Form/NewFields/NewTextAreaField/classes.module.scss @@ -0,0 +1,94 @@ +@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 new file mode 100644 index 00000000..0c030865 --- /dev/null +++ b/src/front/Components/DesignSystem/Form/NewFields/NewTextAreaField/index.tsx @@ -0,0 +1,46 @@ +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 ( + +
+