From d5009733164d4347382e9d72a3055d61b50a6969 Mon Sep 17 00:00:00 2001 From: Maxime Lalo Date: Mon, 17 Apr 2023 16:49:00 +0200 Subject: [PATCH] :sparkles: Page almost done --- .../Elements/InputField/classes.module.scss | 43 +++++++++++-------- .../Form/Elements/InputField/index.tsx | 4 +- .../DesignSystem/RadioBox/index.tsx | 2 +- .../Typography/classes.module.scss | 4 ++ .../DesignSystem/Typography/index.tsx | 10 ++++- .../DefaultDoubleSidePage/classes.module.scss | 4 ++ .../DefaultDoubleSidePage/index.tsx | 2 +- .../Folder/CreateFolder/classes.module.scss | 26 +++++++++++ .../Layouts/Folder/CreateFolder/index.tsx | 37 ++++++++++++++++ 9 files changed, 110 insertions(+), 22 deletions(-) diff --git a/src/front/Components/DesignSystem/Form/Elements/InputField/classes.module.scss b/src/front/Components/DesignSystem/Form/Elements/InputField/classes.module.scss index a5d17db0..dc8f366a 100644 --- a/src/front/Components/DesignSystem/Form/Elements/InputField/classes.module.scss +++ b/src/front/Components/DesignSystem/Form/Elements/InputField/classes.module.scss @@ -26,31 +26,27 @@ border: 1px solid $grey-medium; &:focus { - ~.fake-placeholder { + ~ .fake-placeholder { transform: translateY(-35px); - transition: transform 0.3s ease-in-out; } } - &:not([value=""]) { - ~.fake-placeholder { + &:not([data-value=""]) { + ~ .fake-placeholder { transform: translateY(-35px); - transition: transform; } } &[type="number"] { &:focus { - ~.fake-placeholder { + ~ .fake-placeholder { transform: translateY(-35px); - transition: transform 0.3s ease-in-out; } } - &:not([value=""]) { - ~.fake-placeholder { + &:not([data-value=""]) { + ~ .fake-placeholder { transform: translateY(-35px); - transition: transform; } } @@ -75,14 +71,13 @@ } } - &:not([value=""]) { - ~.fake-placeholder { + &:not([data-value=""]) { + ~ .fake-placeholder { transform: translateY(-35px); - transition: transform 0.3s ease-in-out; } } - ~.fake-placeholder { + ~ .fake-placeholder { z-index: 2; top: 35%; margin-left: 8px; @@ -90,6 +85,7 @@ pointer-events: none; position: absolute; background: $white; + transition: transform 0.3s ease-in-out; } } } @@ -106,7 +102,7 @@ height: 70px; border: 1px solid $grey-medium; - ~.fake-placeholder { + ~ .fake-placeholder { z-index: 2; top: -12px; margin-left: 8px; @@ -114,6 +110,19 @@ pointer-events: none; position: absolute; background: $white; - // transform: translateY(-35px); + transform: translateY(35px); + transition: transform 0.3s ease-in-out; } -} \ No newline at end of file + + &:focus { + ~ .fake-placeholder { + transform: translateY(0px); + } + } + + &:not([data-value=""]) { + ~ .fake-placeholder { + transform: translateY(0px); + } + } +} diff --git a/src/front/Components/DesignSystem/Form/Elements/InputField/index.tsx b/src/front/Components/DesignSystem/Form/Elements/InputField/index.tsx index 9071adff..76e79771 100644 --- a/src/front/Components/DesignSystem/Form/Elements/InputField/index.tsx +++ b/src/front/Components/DesignSystem/Form/Elements/InputField/index.tsx @@ -40,7 +40,7 @@ export default class InputField extends BaseField { required={this.props.required} ref={this.props.fieldRef} rows={4} - value={value} + data-value={value} onChange={this.onChange} data-has-validation-errors={this.state.errors.length > 0} className={ @@ -61,7 +61,7 @@ export default class InputField extends BaseField { pattern={pattern} onChange={this.onChange} onBlur={this.onBlur} - value={value} + data-value={value} data-has-validation-errors={this.state.errors.length > 0} className={ this.props.className ? [classes["input"], classes[this.props.className]].join(" ") : classes["input"] diff --git a/src/front/Components/DesignSystem/RadioBox/index.tsx b/src/front/Components/DesignSystem/RadioBox/index.tsx index 8119888b..2e13a657 100644 --- a/src/front/Components/DesignSystem/RadioBox/index.tsx +++ b/src/front/Components/DesignSystem/RadioBox/index.tsx @@ -14,7 +14,7 @@ type IProps = { export default class RadioBox extends React.Component { public override render(): JSX.Element { return ( - +