Skip to content

Commit

Permalink
wip: update
Browse files Browse the repository at this point in the history
  • Loading branch information
ElaBosak233 committed Nov 4, 2024
1 parent daf46ad commit d2c7bc0
Show file tree
Hide file tree
Showing 31 changed files with 337 additions and 337 deletions.
4 changes: 2 additions & 2 deletions src/components/core/Avatar/Avatar.module.scss
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
$size: var(--size);
$border-color: var(--border-color);
$size: var(--avatar-size);
$border-color: var(--avatar-border-color);

.root {
display: flex;
Expand Down
4 changes: 2 additions & 2 deletions src/components/core/Avatar/Avatar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ export function Avatar(props: AvatarProps) {
const [imgErr, setImgErr] = useState<boolean>(false);

const variables = {
"--size": size,
"--border-color": baseColor,
"--avatar-size": size,
"--avatar-border-color": baseColor,
} as React.CSSProperties;

return (
Expand Down
6 changes: 3 additions & 3 deletions src/components/core/Badge/Badge.module.scss
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
$bg-color: var(--bg-color);
$border-color: var(--border-color);
$text-color: var(--text-color);
$bg-color: var(--badge-bg-color);
$border-color: var(--badge-border-color);
$text-color: var(--badge-text-color);

.root {
width: fit-content;
Expand Down
6 changes: 3 additions & 3 deletions src/components/core/Badge/Badge.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@ export function Badge(props: BadgeProps) {
};

const variables = {
"--bg-color": bgColor(),
"--border-color": borderColor(),
"--text-color": "#FFFFFF",
"--badge-bg-color": bgColor(),
"--badge-border-color": borderColor(),
"--badge-text-color": "#FFFFFF",
} as CSSProperties;

return (
Expand Down
23 changes: 13 additions & 10 deletions src/components/core/Button/Button.module.scss
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
@use "@/styles/mixins";

$width: var(--width);
$height: var(--height);
$bg-color: var(--bg-color);
$bg-secondary-color: var(--bg-secondary-color);
$text-color: var(--text-color);
$width: var(--button-width);
$height: var(--button-height);
$bg-color: var(--button-bg-color);
$text-color: var(--button-text-color);

.root {
width: $width;
Expand All @@ -31,12 +30,8 @@ $text-color: var(--text-color);
}

&[data-variant="outlined"] {
background-color: var(--color-light);
background-color: var(--bg-2-color);
border-color: $bg-color;

@include mixins.dark {
background-color: var(--color-dark);
}
}

&[data-variant="ghost"] {
Expand Down Expand Up @@ -74,8 +69,16 @@ $text-color: var(--text-color);
font-weight: 600;
line-height: 21.6px;
letter-spacing: 0.8px;

@include mixins.dark {
color: #ffffff;
}
}

.icon {
color: $text-color;

@include mixins.dark {
color: #ffffff;
}
}
9 changes: 4 additions & 5 deletions src/components/core/Button/Button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,10 @@ export const Button = forwardRef<HTMLButtonElement, ButtonProps>(
const baseColor = useThemeColor(color);

const variables = {
"--width": width,
"--height": height,
"--bg-color": baseColor,
"--bg-secondary-color": `${chroma.valid(baseColor) ? chroma(baseColor).darken(0.5) : baseColor}`,
"--text-color": variant === "solid" ? "#fff" : baseColor,
"--button-width": width,
"--button-height": height,
"--button-bg-color": baseColor,
"--button-text-color": variant === "solid" ? "#fff" : baseColor,
} as React.CSSProperties;

return (
Expand Down
4 changes: 2 additions & 2 deletions src/components/core/Checkbox/Checkbox.module.scss
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
@use "@/styles/mixins";

$bg-color: var(--bg-color);
$bg-color: var(--checkbox-bg-color);

.root {
display: flex;
Expand Down Expand Up @@ -31,7 +31,7 @@ $bg-color: var(--bg-color);
position: relative;
height: 24px;
width: 24px;
background-color: #ffffff0d;
background-color: var(--bg-2-color);
border: 2px solid $bg-color;
border-radius: 8px;
transition: all 200ms ease-in-out;
Expand Down
2 changes: 1 addition & 1 deletion src/components/core/Checkbox/Checkbox.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export function Checkbox(props: CheckboxProps) {
const baseColor = useThemeColor(color);

const variables = {
"--bg-color": baseColor,
"--checkbox-bg-color": baseColor,
} as CSSProperties;

return (
Expand Down
9 changes: 6 additions & 3 deletions src/components/core/DatetimeInput/DatetimeInput.module.scss
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
$bg-color: var(--bg-color);
$border-color: var(--border-color);
@use "@/styles/mixins";

.root {
display: flex;
Expand All @@ -13,7 +12,11 @@ $border-color: var(--border-color);

&[data-variant="outlined"] {
.icon {
color: $border-color;
color: var(--input-border-color);

@include mixins.dark {
color: #ffffff;
}
}
}
}
Expand Down
5 changes: 2 additions & 3 deletions src/components/core/DatetimePicker/DatetimePicker.module.scss
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
@use "@/styles/mixins";

$bg-color: var(--bg-color);
$border-color: var(--border-color);
$border-color: var(--dtp-border-color);

@keyframes scale-up {
0% {
Expand Down Expand Up @@ -46,7 +45,7 @@ $border-color: var(--border-color);
}

.wrapper {
background-color: $bg-color;
background-color: var(--bg-2-color);
border: 2.75px solid $border-color;
border-radius: 12px;
padding: 16px;
Expand Down
2 changes: 1 addition & 1 deletion src/components/core/DatetimePicker/DatetimePicker.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export function DatetimePicker(props: DatetimePickerProps) {
}, [selectedDateTime]);

const variables = {
"--border-color": useThemeColor("primary"),
"--dtp-border-color": useThemeColor("primary"),
} as CSSProperties;

const daysInMonth = selectedDateTime.daysInMonth || 31;
Expand Down
8 changes: 4 additions & 4 deletions src/components/core/InputBase/InputBase.module.scss
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
@use "@/styles/mixins";

$width: var(--width);
$bg-color: var(--bg-color);
$border-color: var(--border-color);
$width: var(--input-width);
$bg-color: var(--input-bg-color);
$border-color: var(--input-border-color);

.root {
width: $width;
Expand Down Expand Up @@ -60,7 +60,7 @@ $border-color: var(--border-color);
}

&[data-variant="outlined"] {
background-color: #ffffff0d;
background-color: var(--bg-2-color);
}

&:focus,
Expand Down
6 changes: 3 additions & 3 deletions src/components/core/InputBase/InputBase.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ export const InputBase = forwardRef<HTMLDivElement, InputBaseProps>(
const baseColor = useThemeColor(color);

const variables = {
"--width": width,
"--bg-color": baseColor,
"--border-color": baseColor,
"--input-width": width,
"--input-bg-color": baseColor,
"--input-border-color": baseColor,
} as React.CSSProperties;

return (
Expand Down
2 changes: 1 addition & 1 deletion src/components/core/Switch/Switch.module.scss
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
@use "@/styles/mixins";

$bg-color: var(--bg-color);
$bg-color: var(--switch-bg-color);

.root {
display: flex;
Expand Down
2 changes: 1 addition & 1 deletion src/components/core/Switch/Switch.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export function Switch(props: SwitchProps) {
const baseColor = useThemeColor(color);

const variables = {
"--bg-color": baseColor,
"--switch-bg-color": baseColor,
} as CSSProperties;

return (
Expand Down
31 changes: 22 additions & 9 deletions src/components/core/TextInput/TextInput.module.scss
Original file line number Diff line number Diff line change
@@ -1,19 +1,16 @@
@use "@/styles/mixins";

$bg-color: var(--bg-color);
$border-color: var(--border-color);

.root {
gap: 8px;

&[data-variant="solid"] {
background-color: $bg-color;
background-color: var(--input-bg-color);

.icon {
color: #ffffff;
}

input {
.input {
color: #ffffff;
caret-color: #ffffff;

Expand All @@ -33,7 +30,23 @@ $border-color: var(--border-color);

&[data-variant="outlined"] {
.icon {
color: $border-color;
color: var(--input-border-color);

@include mixins.dark {
color: #ffffff;
}
}

.toggle-button {
@include mixins.dark {
color: #ffffff;
}
}

.clear-button {
@include mixins.dark {
color: #ffffff;
}
}
}

Expand All @@ -59,7 +72,7 @@ $border-color: var(--border-color);
background: transparent;
border: none;
outline: none;
caret-color: $border-color;
caret-color: var(--input-border-color);
font-size: 16px;
line-height: 1.5;

Expand All @@ -85,7 +98,7 @@ $border-color: var(--border-color);
background: transparent;
border: none;
cursor: pointer;
color: $border-color;
color: var(--input-border-color);
transition: all 150ms ease-in-out;

&:hover {
Expand All @@ -106,7 +119,7 @@ $border-color: var(--border-color);
background: transparent;
border: none;
cursor: pointer;
color: $border-color;
color: var(--input-border-color);
transition: all 150ms ease-in-out;

&:hover {
Expand Down
7 changes: 0 additions & 7 deletions src/components/core/TextInput/TextInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,13 +50,6 @@ export function TextInput(props: TextInputProps) {
setIsPasswordVisible(!isPasswordVisible);
};

const baseColor = useThemeColor(color);

const variables = {
"--bg-color": baseColor,
"--border-color": baseColor,
} as React.CSSProperties;

return (
<InputBase
width={width}
Expand Down
11 changes: 3 additions & 8 deletions src/components/core/Textarea/Textarea.module.scss
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
$width: var(--width);
$border-color: var(--border-color);

.root {
width: $width;

&[data-variant="solid"] {
.icon {
color: #ffffff;
Expand All @@ -20,10 +15,10 @@ $border-color: var(--border-color);
}

&[data-variant="outlined"] {
background-color: #ffffff0d;
background-color: var(--bg-2-color);

.icon {
color: $border-color;
color: var(--input-border-color);
}
}

Expand All @@ -49,7 +44,7 @@ $border-color: var(--border-color);
background: transparent;
border: none;
outline: none;
caret-color: $border-color;
caret-color: var(--input-border-color);
font-size: 16px;
line-height: 1.5;

Expand Down
6 changes: 1 addition & 5 deletions src/components/core/Textarea/Textarea.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,8 @@ export interface TextareaProps extends Omit<InputBaseProps, "onChange"> {
export function Textarea(props: TextareaProps) {
const { width = "fit-content", value, onChange, icon, ...rest } = props;

const variables = {
"--width": width,
} as React.CSSProperties;

return (
<InputBase className={styles["root"]} style={variables}>
<InputBase className={styles["root"]} width={width}>
{icon && <div className={styles["icon"]}>{icon}</div>}
<textarea
className={styles["textarea"]}
Expand Down
4 changes: 2 additions & 2 deletions src/components/core/Toast/Toast.module.scss
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
@use "@/styles/mixins";

$bg-color: var(--bg-color);
$border-color: var(--border-color);
$bg-color: var(--toast-bg-color);
$border-color: var(--toast-border-color);

.root {
display: flex;
Expand Down
9 changes: 4 additions & 5 deletions src/components/core/Toast/Toast.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@ export function Toast(props: ToastProps) {
const baseColor = useThemeColor(color);

const variables = {
"--bg-color": chroma(baseColor).hex(),
"--grid-color": chroma(baseColor).darken(1).alpha(0.1).hex(),
"--text-color": chroma(baseColor).darken(1.75).hex(),
"--border-color": baseColor,
"--toast-bg-color": chroma(baseColor).hex(),
"--toast-grid-color": chroma(baseColor).darken(1).alpha(0.1).hex(),
"--toast-text-color": chroma(baseColor).darken(1.75).hex(),
"--toast-border-color": baseColor,
} as CSSProperties;

return (
Expand All @@ -43,7 +43,6 @@ export function Toast(props: ToastProps) {
<h2 className={styles["title"]}>{title}</h2>
<p className={styles["description"]}>{description}</p>
</div>
{/* <div ref={progressBarRef} className={styles["progress-bar"]}></div> */}
</div>
);
}
Loading

0 comments on commit d2c7bc0

Please sign in to comment.