-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
262 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,99 @@ | ||
/* Base button styles */ | ||
.button { | ||
display: flex; | ||
align-items: center; | ||
justify-content: center; | ||
gap: 8px; | ||
padding: 8px 16px; | ||
border-radius: 8px; | ||
font-size: 14px; | ||
font-weight: 500; | ||
cursor: pointer; | ||
transition: transform 0.15s ease-in-out; | ||
} | ||
|
||
.button:hover:not(.disabled) { | ||
transform: scale(1.05); | ||
} | ||
|
||
.button.disabled { | ||
cursor: not-allowed; | ||
opacity: 0.5; | ||
} | ||
|
||
/* Variant-specific styles */ | ||
.button.solid { | ||
box-shadow: 0px 4px 6px rgba(0, 0, 0, 0.1); | ||
} | ||
|
||
.button.outline { | ||
background-color: transparent; | ||
border-width: 1px; | ||
} | ||
|
||
.button.text { | ||
background-color: transparent; | ||
border: none; | ||
padding: 0; | ||
} | ||
|
||
/* Color-specific styles */ | ||
.button.primary { | ||
--bg-color: #194bf0; | ||
--text-color: #ffffff; | ||
--border-color: #194bf0; | ||
} | ||
|
||
.button.secondary { | ||
--bg-color: #fdb713; | ||
--text-color: #0c0c0c; | ||
--border-color: #fdb713; | ||
} | ||
|
||
.button.black { | ||
--bg-color: #0c0c0c; | ||
--text-color: #ffffff; | ||
--border-color: #0c0c0c; | ||
} | ||
|
||
.button.white { | ||
--bg-color: #ffffff; | ||
--text-color: #0c0c0c; | ||
--border-color: #ffffff; | ||
} | ||
|
||
.button.solid { | ||
background-color: var(--bg-color); | ||
color: var(--text-color); | ||
border: none; | ||
} | ||
|
||
.button.outline { | ||
border: 1px solid var(--border-color); | ||
color: var(--border-color); | ||
} | ||
|
||
.button.text { | ||
color: var(--border-color); | ||
} | ||
|
||
/* Disabled color */ | ||
.button.disabled.solid { | ||
background-color: #e0e0e0; | ||
color: #9e9e9e; | ||
} | ||
|
||
.button.disabled.outline, | ||
.button.disabled.text { | ||
color: #9e9e9e; | ||
border-color: #e0e0e0; | ||
} | ||
|
||
/* Icon and text alignment */ | ||
.button-icon { | ||
display: inline-block; | ||
} | ||
|
||
.button-text { | ||
display: inline-block; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import React from "react"; | ||
import "./Button.css"; | ||
|
||
const Button = ({ | ||
text = "متن دکمه", | ||
icon = null, | ||
variant = "solid", // solid, outline, text | ||
color = "primary", // primary, secondary, black, white | ||
disabled = false, | ||
onClick = () => {}, | ||
}) => { | ||
return ( | ||
<button | ||
onClick={onClick} | ||
className={`button ${variant} ${color} ${disabled ? "disabled" : ""}`} | ||
disabled={disabled} | ||
> | ||
{icon && <span className="button-icon">{icon}</span>} | ||
<span className="button-text">{text}</span> | ||
</button> | ||
); | ||
}; | ||
|
||
export default Button; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.