Skip to content

Commit

Permalink
wip: update
Browse files Browse the repository at this point in the history
  • Loading branch information
ElaBosak233 committed Oct 28, 2024
1 parent b9d9783 commit 04d1509
Show file tree
Hide file tree
Showing 23 changed files with 94 additions and 277 deletions.
4 changes: 2 additions & 2 deletions src/components/core/Button/Button.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ $text-color: var(--text-color);

&:not(:disabled, [data-loading="true"], [data-disabled="true"]) {
&:hover {
filter: brightness(1.125);
filter: brightness(1.2);
}

&:active {
Expand All @@ -57,7 +57,7 @@ $text-color: var(--text-color);

&:focus {
outline: none;
filter: brightness(1.125);
filter: brightness(1.2);
}
}

Expand Down
76 changes: 38 additions & 38 deletions src/components/core/Card/Card.module.scss
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
.radio-button{
--card-border-color:var(--_card-border-color,#57bbd4);
--card-bg-color:var(--_card-bg-color,#45d3ff);
--_card-text-color:var(--_card-text-color,#ffffff);
width: 292px;
border: solid transparent;
border-radius: var(--card-border-radius,12px);
border-width: 1px 0px 4px 0px;
cursor: pointer;
display: inline-flex;
outline: 0;
position: relative;
touch-action: manipulation;
transform: translateZ(0);
transition: all 0.2s ease;
-webkit-user-select: none;
-moz-user-select: none;
user-select: none;
&:before{
.radio-button {
--card-border-color: var(--_card-border-color, #57bbd4);
--card-bg-color: var(--_card-bg-color, #45d3ff);
--_card-text-color: var(--_card-text-color, #ffffff);
width: 292px;
border: solid transparent;
border-radius: var(--card-border-radius, 12px);
border-width: 1px 0px 4px 0px;
cursor: pointer;
display: inline-flex;
outline: 0;
position: relative;
touch-action: manipulation;
transform: translateZ(0);
transition: all 0.2s ease;
-webkit-user-select: none;
-moz-user-select: none;
user-select: none;
&:before {
background-color: var(--card-bg-color);
border: 2px solid var(--card-border-color);
border-radius: var(--card-border-radius,12px);
border-radius: var(--card-border-radius, 12px);
border-width: 2px 2px 4px 2px;
bottom: -2px;
box-shadow: 0 2px 0 var(--card-border-color);
Expand All @@ -32,17 +32,17 @@
transition: all 0.2s ease;
}
&:hover:not(:active):not(.selected):not(.pressed):before {
filter: brightness(1.125);
}
&.pressed:not(.selected):not(.active),
filter: brightness(1.2);
}
&.pressed:not(.selected):not(.active),
&:active:not(.pressed) {
transform: translateY(4px) translateZ(0);
}
&.pressed:not(.selected):not(.active):before,
&.pressed:not(.selected):not(.active):before,
&:active:not(.pressed):before {
box-shadow: none;
}
&.selected{
&.selected {
transform: translateY(4px) translateZ(0);
--card-border-color: transparent;
}
Expand All @@ -51,17 +51,17 @@
color: rgb(24, 153, 214);
}
.icon {
height: 40px;
margin-right: 16px;
margin-left: 16px;
width: 40px;
}
height: 40px;
margin-right: 16px;
margin-left: 16px;
width: 40px;
}
.proficiency-text {
color: var(--_card-text-color);
font-size: 17px;
font-weight: 700;
line-height: 24px;
}
color: var(--_card-text-color);
font-size: 17px;
font-weight: 700;
line-height: 24px;
}
.flex-container {
align-items: center;
display: flex;
Expand Down Expand Up @@ -123,16 +123,16 @@
// .radio-button:hover:not(:active):not(.selected):not(.pressed):before {
// background-color: #4eedff;
// }
// .radio-button.pressed:not(.selected):not(.active),
// .radio-button.pressed:not(.selected):not(.active),
// .radio-button:active:not(.pressed) {
// transform: translateY(2px) translateZ(0);
// }
// .radio-button.selected,
// .radio-button.selected,
// .radio-button:active:not(.pressed) {
// --border-color: rgb(63,133,167);
// color: rgb(24, 153, 214);
// }
// .radio-button.pressed:not(.selected):not(.active):before,
// .radio-button.pressed:not(.selected):not(.active):before,
// .radio-button:active:not(.pressed):before {
// box-shadow: none;
// }
Expand Down
12 changes: 4 additions & 8 deletions src/components/core/Checkbox/Checkbox.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -21,19 +21,15 @@ $bg-color: var(--bg-color);
position: relative;
height: 24px;
width: 24px;
background-color: transparent;
border: 2px solid #e5e5e5;
background-color: #ffffff0d;
border: 2px solid $bg-color;
border-radius: 8px;
transition: all 0.2s ease;
transition: all 200ms ease-in-out;

color: #ffffff;

@include mixins.dark {
border-color: #37464f;
}

&:hover {
border-color: $bg-color;
filter: brightness(1.2);
}

&:after {
Expand Down
9 changes: 4 additions & 5 deletions src/components/core/DatetimeInput/DatetimeInput.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
import { DateTime } from "luxon";
import { InputWrapper, InputWrapperProps } from "../InputWrapper";
import { InputBase, InputBaseProps } from "../InputBase";
import styles from "./DatetimeInput.module.scss";
import React, { useState, useRef, useEffect, forwardRef } from "react";

export interface DatetimeInputProps
extends Omit<InputWrapperProps, "onChange"> {
export interface DatetimeInputProps extends Omit<InputBaseProps, "onChange"> {
icon?: React.ReactNode;
value?: DateTime;
onChange?: (value: DateTime) => void;
Expand Down Expand Up @@ -200,7 +199,7 @@ export const DatetimeInput = forwardRef<HTMLInputElement, DatetimeInputProps>(
};

return (
<InputWrapper
<InputBase
className={styles["root"]}
label={label}
ref={ref}
Expand All @@ -216,7 +215,7 @@ export const DatetimeInput = forwardRef<HTMLInputElement, DatetimeInputProps>(
onFocus={handleFocus}
onClick={handleFocus}
/>
</InputWrapper>
</InputBase>
);
}
);
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,13 @@ $border-color: var(--border-color);
background-color: $bg-color;
}

&[data-variant="outlined"] {
background-color: #ffffff0d;
}

&:focus,
&:hover {
filter: brightness(1.125);
filter: brightness(1.2);
}
}
}
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import React, { ComponentProps, forwardRef } from "react";
import useThemeColor from "@/hooks/useThemeColor";
import styles from "./InputWrapper.module.scss";
import styles from "./InputBase.module.scss";

export interface InputWrapperProps extends ComponentProps<"div"> {
export interface InputBaseProps extends ComponentProps<"div"> {
width?: string;
color?: string;
variant?: "outlined" | "solid";
Expand All @@ -15,7 +15,7 @@ export interface InputWrapperProps extends ComponentProps<"div"> {
children?: React.ReactNode;
}

export const InputWrapper = forwardRef<HTMLDivElement, InputWrapperProps>(
export const InputBase = forwardRef<HTMLDivElement, InputBaseProps>(
(props, ref) => {
const {
width = "fit-content",
Expand Down
3 changes: 3 additions & 0 deletions src/components/core/InputBase/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export { InputBase } from "./InputBase";

export type { InputBaseProps } from "./InputBase";
3 changes: 0 additions & 3 deletions src/components/core/InputWrapper/index.ts

This file was deleted.

27 changes: 9 additions & 18 deletions src/components/core/Switch/Switch.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -11,28 +11,20 @@ $bg-color: var(--bg-color);
position: relative;
width: 45px;
height: 24px;
background-color: #e9ecef;
background-color: $bg-color;
border-radius: 17px;
cursor: pointer;
transition: all 0.3s ease;
border: 2px solid #e5e5e5;

@include mixins.dark {
border-color: #37464f;
background-color: rgba(32, 47, 54, 0.5);
}
border: 2px solid $bg-color;

&:hover {
border-color: $bg-color;
filter: brightness(1.2);
}

&.checked {
background-color: $bg-color;
border-color: $bg-color;
}

&.checked .handle {
transform: translateY(-50%) translateX(20px);
&[data-checked="true"] {
.handle {
transform: translateY(-50%) translateX(20px);
}
}
}

Expand All @@ -41,12 +33,11 @@ $bg-color: var(--bg-color);
content: "";
height: 15px;
width: 15px;
left: 3px;
left: 4px;
top: 50%;
background-color: #fff;
background-color: #ffffff;
border-radius: 50%;
transition: 0.3s;

transform: translateY(-50%);
}

Expand Down
6 changes: 3 additions & 3 deletions src/components/core/Switch/Switch.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ export function Switch(props: SwitchProps) {
} as CSSProperties;

return (
<div className={styles["root"]}>
<div className={styles["root"]} style={variables}>
<div
className={`${styles["switch"]} ${checked ? styles["checked"] : ""}`}
style={variables}
className={styles["switch"]}
data-checked={checked}
onClick={() => onChange(!checked)}
>
<div className={styles["handle"]}></div>
Expand Down
2 changes: 1 addition & 1 deletion src/components/core/TextInput/TextInput.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ $border-color: var(--border-color);

&:focus,
&:hover {
filter: brightness(1.125);
filter: brightness(1.2);
}

&:focus-within {
Expand Down
8 changes: 4 additions & 4 deletions src/components/core/TextInput/TextInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ import CloseCircleBold from "~icons/solar/close-circle-bold";
import EyeBold from "~icons/solar/eye-bold";
import EyeCloseBold from "~icons/solar/eye-closed-bold";
import styles from "./TextInput.module.scss";
import { InputWrapper, InputWrapperProps } from "../InputWrapper";
import { InputBase, InputBaseProps } from "../InputBase";

export interface TextInputProps extends Omit<InputWrapperProps, "onChange"> {
export interface TextInputProps extends Omit<InputBaseProps, "onChange"> {
clearable?: boolean;
password?: boolean;
invalid?: boolean;
Expand Down Expand Up @@ -58,7 +58,7 @@ export function TextInput(props: TextInputProps) {
} as React.CSSProperties;

return (
<InputWrapper
<InputBase
width={width}
color={color}
variant={variant}
Expand Down Expand Up @@ -89,6 +89,6 @@ export function TextInput(props: TextInputProps) {
{isPasswordVisible ? <EyeBold /> : <EyeCloseBold />}
</div>
)}
</InputWrapper>
</InputBase>
);
}
4 changes: 3 additions & 1 deletion src/components/core/Textarea/Textarea.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,16 @@ $border-color: var(--border-color);
}

&[data-variant="outlined"] {
background-color: #ffffff0d;

.icon {
color: $border-color;
}
}

&:focus,
&:hover {
filter: brightness(1.125);
filter: brightness(1.2);
}

&:focus-within {
Expand Down
8 changes: 4 additions & 4 deletions src/components/core/Textarea/Textarea.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { InputWrapper, InputWrapperProps } from "../InputWrapper";
import { InputBase, InputBaseProps } from "../InputBase";
import styles from "./Textarea.module.scss";

export interface TextareaProps extends Omit<InputWrapperProps, "onChange"> {
export interface TextareaProps extends Omit<InputBaseProps, "onChange"> {
width?: string;
value?: string;
onChange?: (value: string) => void;
Expand All @@ -16,12 +16,12 @@ export function Textarea(props: TextareaProps) {
} as React.CSSProperties;

return (
<InputWrapper className={styles["root"]} style={variables}>
<InputBase className={styles["root"]} style={variables}>
{icon && <div className={styles["icon"]}>{icon}</div>}
<textarea
value={value}
onChange={(e) => onChange?.(e.target.value)}
/>
</InputWrapper>
</InputBase>
);
}
2 changes: 1 addition & 1 deletion src/components/core/Typography/Typography.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
color: var(--color-primary);

&:hover {
filter: brightness(1.125);
filter: brightness(1.2);
text-decoration: underline;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ $icon-color: var(--icon-color);

&[data-active="true"],
&:hover {
filter: brightness(1.125);
filter: brightness(1.2);
background-color: #1111113d;
}

Expand Down
Loading

0 comments on commit 04d1509

Please sign in to comment.