Skip to content

Commit

Permalink
Merge branch 'next-release' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
mucahit committed Oct 26, 2021
2 parents 20e5480 + 6d1a91f commit 9e3ced4
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 7 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@hipo/react-ui-toolkit",
"version": "1.0.0-alpha.4.1.0",
"version": "1.0.0-alpha.4.1.1",
"description": "React based UI toolkit.",
"main": "dist/index.js",
"scripts": {
Expand Down
7 changes: 4 additions & 3 deletions src/form/input/checkbox/CheckboxInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ export interface CheckboxInputProps {
) => void;
isSelected: boolean;
isDisabled?: boolean;
customIcon?: React.ReactNode;
customClassName?: string;
testid?: string;
}
Expand All @@ -25,6 +26,7 @@ function CheckboxInput({
customClassName,
isSelected,
isDisabled,
customIcon,
testid
}: CheckboxInputProps) {
const {
Expand All @@ -35,6 +37,7 @@ function CheckboxInput({
"checkbox-input-label--is-selected": isSelected,
"checkbox-input-label--is-disabled": isDisabled
});
const icon = customIcon || <CheckIcon />;

return (
<label data-testid={testid} htmlFor={htmlFor} className={containerClassName}>
Expand All @@ -49,9 +52,7 @@ function CheckboxInput({
disabled={isDisabled}
/>

<span className={"checkbox-input-label__icon"}>
<CheckIcon />
</span>
<span className={"checkbox-input-label__icon"}>{icon}</span>

{content}
</label>
Expand Down
4 changes: 1 addition & 3 deletions src/form/input/checkbox/_checkbox-input.scss
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,9 @@

position: relative;

display: flex;
display: inline-flex;
align-items: center;

margin-bottom: 10px;

cursor: pointer;
user-select: none;

Expand Down
4 changes: 4 additions & 0 deletions stories/2-CheckboxInput.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ storiesOf("Checkbox", module).add("Checkbox", () => {
}}
/>

<br />

<CheckboxInput
onSelect={() =>
setState({...state, termsAndConditions: !state.termsAndConditions})
Expand All @@ -46,6 +48,8 @@ storiesOf("Checkbox", module).add("Checkbox", () => {
}}
/>

<br />

<CheckboxInput
onSelect={() => setState({...state, privacyPolicy: !state.privacyPolicy})}
isSelected={state.privacyPolicy}
Expand Down

0 comments on commit 9e3ced4

Please sign in to comment.