Skip to content

Commit

Permalink
tweak spacing
Browse files Browse the repository at this point in the history
  • Loading branch information
fzhao99 committed Nov 27, 2024
1 parent 1f4d506 commit 73267e5
Show file tree
Hide file tree
Showing 7 changed files with 39 additions and 36 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,8 @@ const CustomizeQueryAccordionBody: React.FC<
<td className={styles.noBorderNoBackgroundNoPadding}>
<CustomizeQueryCheckbox
id={item.code}
label=""
checked={false}
onClick={() => {
checked={item.include}
onChange={() => {
toggleInclude(groupIndex, item.vsIndex, conceptIndex);
}}
/>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { Icon } from "@trussworks/react-uswds";
import styles from "./customizeQuery.module.css";
import { GroupedValueSet } from "./customizeQueryUtils";
import CustomizeQueryCheckbox from "./vanityCheckbox/CustomizeQueryCheckbox";

type CustomizeQueryAccordionProps = {
handleSelectAllChange: (groupIndex: string, checked: boolean) => void;
Expand Down Expand Up @@ -36,30 +37,15 @@ const CustomizeQueryAccordionHeader: React.FC<CustomizeQueryAccordionProps> = ({
<div
className={`${styles.accordionHeader} display-flex flex-no-wrap flex-align-start customize-query-header`}
>
<div
id="select-all"
className={`hide-checkbox-label ${styles.customizeQueryCheckbox}`}
onClick={(e) => {
e.stopPropagation();
handleSelectAllChange(groupIndex, selectedCount !== selectedTotal);
}}
>
{selectedCount === selectedTotal && (
<Icon.Check
className="usa-icon bg-base-lightest"
size={4}
color="#565C65"
aria-label="Checkmark icon indicating addition"
/>
)}
{selectedCount > 0 && selectedCount < selectedTotal && (
<Icon.Remove
className="usa-icon bg-base-lightest"
size={4}
color="#565C65"
aria-label="Minus icon indicating removal"
/>
)}
<div id="select-all">
<CustomizeQueryCheckbox
id={group.valueSetName}
checked={selectedCount === selectedTotal}
isHeader
onChange={() => {
handleSelectAllChange(groupIndex, selectedCount !== selectedTotal);
}}
/>
</div>
<div className={`${styles.accordionButtonTitle}`}>
{`${group.valueSetName}`}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,28 @@ import Checkbox, {
} from "../../../designSystem/checkbox/Checkbox";
import styles from "./checkbox.module.css";

const CustomizeQueryCheckbox: React.FC<CheckboxProps> = ({
type VanityCheckboxProps = CheckboxProps & {
isHeader?: boolean;
};
const CustomizeQueryCheckbox: React.FC<VanityCheckboxProps> = ({
id,
label,
checked,
onClick,
onChange,
className,
isHeader,
}) => {
return (
<Checkbox
id={id}
label={label}
checked={checked}
onClick={onClick}
className={classNames(className, styles.vanity)}
onChange={onChange}
className={classNames(
className,
styles.vanity,
isHeader ? styles.vanityHeader : "",
)}
/>
);
};
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
.vanity {
background: inherit;
margin: 0.5rem;
}

.vanity label {
margin-top: 0;
padding-left: 0;
}

Expand All @@ -12,13 +14,17 @@
background-color: #fff;
box-shadow: 0 0 0 1px #a9aeb1 !important;
border-radius: 0.25rem;
margin: 0.5rem;
margin: 0;
padding: 0 !important;
position: relative !important;
}

.vanity input:checked + label::before {
background-color: #fff !important;
background-image: url("checkmark.svg") !important;
background-image: url("bodyCheckmark.svg") !important;
background-size: cover !important;
}

.vanityHeader input:checked + label::before {
background-image: url("headerCheckbox.svg") !important;
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,11 @@ import styles from "./checkbox.module.css";

export type CheckboxProps = {
id: string;
label: string;
label?: string;
className?: string;
onClick?: () => void;
checked: boolean;
onChange?: () => void;
checked?: boolean;
};

/**
Expand All @@ -25,6 +26,7 @@ const Checkbox: React.FC<CheckboxProps> = ({
id,
className,
onClick,
onChange,
checked,
}) => {
return (
Expand All @@ -34,7 +36,8 @@ const Checkbox: React.FC<CheckboxProps> = ({
name={id}
className={classNames(styles.checkbox, className)}
onClick={onClick}
defaultChecked={checked}
onChange={onChange}
checked={checked}
></TrussCheckbox>
);
};
Expand Down

0 comments on commit 73267e5

Please sign in to comment.