-
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
11 changed files
with
166 additions
and
20 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
38 changes: 38 additions & 0 deletions
38
query-connector/src/app/query/designSystem/checkbox/Checkbox.tsx
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,38 @@ | ||
import { Checkbox as TrussCheckbox } from "@trussworks/react-uswds"; | ||
import classNames from "classnames"; | ||
import styles from "./checkbox.module.css"; | ||
|
||
type CheckboxProps = { | ||
id: string; | ||
label: string; | ||
className?: string; | ||
onClick?: () => void; | ||
}; | ||
|
||
/** | ||
* | ||
* @param root0 Checkbox styled according to our design system | ||
* @param root0.label The string labeled next to the checkbox | ||
* @param root0.id HTML id used to reference the checkbox | ||
* @param root0.className Optional styling classes | ||
* @param root0.onClick Event listener for checkbox click | ||
* @returns A checkbox styled according to our design system | ||
*/ | ||
const Checkbox: React.FC<CheckboxProps> = ({ | ||
label, | ||
id, | ||
className, | ||
onClick, | ||
}) => { | ||
return ( | ||
<TrussCheckbox | ||
label={label} | ||
id={id} | ||
name={id} | ||
className={classNames(styles.checkbox, className)} | ||
onClick={onClick} | ||
></TrussCheckbox> | ||
); | ||
}; | ||
|
||
export default Checkbox; |
3 changes: 3 additions & 0 deletions
3
query-connector/src/app/query/designSystem/checkbox/checkbox.module.css
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,3 @@ | ||
.checkbox > label::before { | ||
box-shadow: 0 0 0 1px #919191; | ||
} |
40 changes: 40 additions & 0 deletions
40
query-connector/src/app/query/designSystem/searchField/SearchField.tsx
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,40 @@ | ||
import { TextInput } from "@trussworks/react-uswds"; | ||
import { ChangeEvent } from "react"; | ||
import styles from "./searchField.module.scss"; | ||
import classNames from "classnames"; | ||
|
||
type SearchFieldProps = { | ||
id: string; | ||
placeholder?: string; | ||
onChange?: (e: ChangeEvent<HTMLInputElement>) => void; | ||
className?: string; | ||
}; | ||
/** | ||
* A search component bar styled according to our design system | ||
* @param root0 - params | ||
* @param root0.id - HTML id | ||
* @param root0.placeholder - String to label the search bar in the empty state. | ||
* Defaults to "Search" | ||
* @param root0.onChange - change event listener | ||
* @param root0.className - optional styling classes | ||
* @returns A search field component styled according to our design system | ||
*/ | ||
const SearchField: React.FC<SearchFieldProps> = ({ | ||
id, | ||
placeholder, | ||
onChange, | ||
className, | ||
}) => { | ||
return ( | ||
<TextInput | ||
placeholder={placeholder ?? "Search"} | ||
type="search" | ||
id={id} | ||
name={id} | ||
onChange={onChange} | ||
className={classNames(styles.searchField, className)} | ||
></TextInput> | ||
); | ||
}; | ||
|
||
export default SearchField; |
12 changes: 12 additions & 0 deletions
12
query-connector/src/app/query/designSystem/searchField/searchField.module.scss
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,12 @@ | ||
@use "../../../../styles/_variables" as *; | ||
|
||
.searchField { | ||
border-radius: 0.25rem; | ||
border: 1px solid $gray-500; | ||
height: 3%; | ||
padding: 0.75rem; | ||
padding-left: 2.4rem; | ||
background: url("../../../../styles/assets/search.svg") center / contain | ||
no-repeat; | ||
background-position: 12px 12px; | ||
} |
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
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,19 @@ | ||
export type ConditionIdToNameMap = { | ||
[conditionId: string]: string; | ||
}; | ||
|
||
export type CategoryToConditionArrayMap = { | ||
[categoryName: string]: ConditionIdToNameMap[]; | ||
}; | ||
export type ConditionDetails = { | ||
name: string; | ||
include: boolean; | ||
}; | ||
export type ConditionDetailsMap = { | ||
[conditionId: string]: ConditionDetails; | ||
}; | ||
|
||
export type CategoryNameToConditionDetailsMap = { | ||
[categoryName: string]: ConditionDetailsMap; | ||
}; | ||
|
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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