Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HLM-5156 making check box more customizable and adding custom color for button #61

Merged
merged 4 commits into from
May 17, 2024
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions react/ui-components/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ yarn storybook
# Changelog

```bash
0.0.1-beta.19 making CheckBox more customizable and adding custom color for Button
0.0.1-beta.18 updated dropdown option labels
0.0.1-beta.17 updated toast info varinat css and category option css
0.0.1-beta.16 added erroe boundary atom
Expand Down
2 changes: 1 addition & 1 deletion react/ui-components/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@egovernments/digit-ui-components",
"version": "0.0.1-beta.18",
"version": "0.0.1-beta.19",
"license": "MIT",
"main": "dist/index.js",
"module": "dist/index.modern.js",
Expand Down
12 changes: 7 additions & 5 deletions react/ui-components/src/atoms/Button.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,13 @@ const Button = (props) => {
//To render the icon
const IconRender = () => {
const iconFill =
props?.variation === "primary"
? "#FFFFFF"
: props?.isDisabled
? "#C5C5C5"
: "#C84C0E";
props.iconFill?
props.iconFill:
props?.variation === "primary"
? "#FFFFFF"
: props?.isDisabled
? "#C5C5C5"
: "#C84C0E";
const iconReq = props?.icon;
let width, height;

Expand Down
16 changes: 8 additions & 8 deletions react/ui-components/src/atoms/CheckBox.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@ const CheckBox = ({
<div
className={`digit-checkbox-container ${
!isLabelFirst ? "checkboxFirst" : "labelFirst"
} ${disabled ? "disabled" : " "}`}
} ${disabled ? "disabled" : " "} ${props.mainClassName}`}
>
{isLabelFirst ? (
<p className="label" style={{ maxWidth: "100%", width: "auto" ,marginRight:"0rem"}}>
<p className={`label ${labelClassName} `} style={{ maxWidth: "100%", width: "auto" ,marginRight:"0rem"}} onClick={props.onLabelClick}>
{customLabelMarkup ? (
<>
<span>{t("COMMON_CERTIFY_ONE")}</span>
Expand All @@ -47,27 +47,27 @@ const CheckBox = ({
)}
</p>
) : null}
<div style={{ cursor: "pointer", display: "flex", position: "relative" }}>
<div style={{ cursor: "pointer", display: "flex", position: "relative" }} className={props.inputWrapperClassName}>
<input
type="checkbox"
className={`input ${userType === "employee" ? "input-emp" : ""}`}
className={`input ${userType === "employee" ? "input-emp" : ""} ${props.inputClassName} `}
onChange={onChange}
value={value || label}
{...props}
ref={inputRef}
disabled={disabled}
checked={checked}
/>
/>
<p
className={`digit-custom-checkbox ${
userType === "employee" ? "digit-custom-checkbox-emp" : ""
}`}
} ${props.inputIconClassname} `}
>
<SVG.Check fill={disabled ? "#C5C5C5" : "#C84C0E"} />
<SVG.Check fill={props.iconFill || (disabled ? "#C5C5C5" : "#C84C0E")} />
</p>
</div>
{!isLabelFirst ? (
<p className="label" style={{ maxWidth: "100%", width: "100%",marginRight:"0rem" }}>
<p className={`label ${props.labelClassName} `} style={{ maxWidth: "100%", width: "100%",marginRight:"0rem" }} onClick={props.onLabelClick}>
{customLabelMarkup ? (
<>
<span>{t("COMMON_CERTIFY_ONE")}</span>
Expand Down