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

feat: input component: adds searchbox, textarea and textinput components #40

Merged
merged 29 commits into from
Apr 6, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
db3526c
Initial commit of input components
dkilgore-eightfold Mar 25, 2022
b332b8e
Merge branch 'main' into dkilgore/input-component
dkilgore-eightfold Mar 28, 2022
5ba8493
Optimizes Input, fixes missing d.ts files for prod build.
dkilgore-eightfold Mar 29, 2022
7bf2170
Updates close button SVG, adds color spec'd in Figma
dkilgore-eightfold Mar 29, 2022
4603f61
Merge branch 'main' into dkilgore/input-component
dkilgore-eightfold Mar 29, 2022
70ca8d1
chore(release): 0.0.1
dkilgore-eightfold Mar 29, 2022
5db83d6
Merge branch 'main' into dkilgore/input-component
dkilgore-eightfold Mar 29, 2022
cbb51e8
Merge branch 'main' into dkilgore/input-component
dkilgore-eightfold Mar 29, 2022
149b0ee
fix: search box: make button semantic to forms, update scss
dkilgore-eightfold Mar 29, 2022
b1325ef
fix: input component: breaks textarea and input into separate components
dkilgore-eightfold Mar 29, 2022
9746499
fix: adds missing file: adds untracked textinput to project
dkilgore-eightfold Mar 30, 2022
3c57608
Merge branch 'main' into dkilgore/input-component
dkilgore-eightfold Mar 30, 2022
54930e4
Merge branch 'main' into dkilgore/input-component
dkilgore-eightfold Mar 31, 2022
3445913
feat: input component: adds html escape
dkilgore-eightfold Apr 1, 2022
bd656c0
Merge branch 'main' into dkilgore/input-component
dkilgore-eightfold Apr 1, 2022
d8d7f51
chore: scss: updates type definitions
dkilgore-eightfold Apr 1, 2022
5a85a0f
Merge branch 'main' into dylankilgore/input-component
dkilgore-eightfold Apr 5, 2022
dd26d00
feat: input component: adds searchbox, textarea and textinput components
dkilgore-eightfold Apr 5, 2022
0711a9d
chore: webpack: reverts local change
dkilgore-eightfold Apr 5, 2022
a7893aa
fix: hooks: update to match current project architecture
dkilgore-eightfold Apr 5, 2022
402e329
chore: type defs: remove gitignore defs
dkilgore-eightfold Apr 5, 2022
e18ec86
chore: styles: remove unreferenced variable
dkilgore-eightfold Apr 5, 2022
947e355
Merge branch 'main' into dylankilgore/input-component
dkilgore-eightfold Apr 6, 2022
cbc66a8
fix: pr feedback: use css vars plus optimize nullchecks, hook and int…
dkilgore-eightfold Apr 6, 2022
ca1745f
chore: code coverage: adds input unit tests
dkilgore-eightfold Apr 6, 2022
07afbca
chore: input component: adds typing and optimizes null check
dkilgore-eightfold Apr 6, 2022
ee58ca8
chore: input component: adds typing
dkilgore-eightfold Apr 6, 2022
b259504
feat: input component: ensure the clear text button hides when value …
dkilgore-eightfold Apr 6, 2022
8f94e03
feat: input component: ensures type change is committed
dkilgore-eightfold Apr 6, 2022
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
8 changes: 7 additions & 1 deletion src/components/Button/BaseButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ export const BaseButton: FC<InternalButtonProps> = ({
disruptive = false,
htmlType,
icon,
iconColor,
id,
onClick,
primaryColor,
Expand Down Expand Up @@ -95,7 +96,12 @@ export const BaseButton: FC<InternalButtonProps> = ({
};

const getButtonIcon = (icon: IconName): JSX.Element => (
<Icon className={styles.icon} path={icon} size={getButtonIconSize()} />
<Icon
className={styles.icon}
color={iconColor}
path={icon}
size={getButtonIconSize()}
/>
);

const buttonStyles = (): CSSVariables => {
Expand Down
4 changes: 4 additions & 0 deletions src/components/Button/Button.types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,10 @@ export interface ButtonProps {
* The button icon.
*/
icon?: IconName;
/**
* The button icon color.
*/
iconColor?: string;
/**
* The button id.
*/
Expand Down
2 changes: 2 additions & 0 deletions src/components/Button/DefaultButton/DefaultButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ export const DefaultButton: FC<ButtonProps> = ({
disabled = false,
htmlType,
icon,
iconColor,
onClick,
primaryColor,
text,
Expand All @@ -34,6 +35,7 @@ export const DefaultButton: FC<ButtonProps> = ({
disabled={disabled}
htmlType={htmlType}
icon={icon}
iconColor={iconColor}
onClick={onClick}
primaryColor={primaryColor}
size={size}
Expand Down
2 changes: 2 additions & 0 deletions src/components/Button/PrimaryButton/PrimaryButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ export const PrimaryButton: FC<ButtonProps> = ({
disruptive = false,
htmlType,
icon,
iconColor,
onClick,
primaryColor,
size = ButtonSize.Flex,
Expand All @@ -37,6 +38,7 @@ export const PrimaryButton: FC<ButtonProps> = ({
disruptive={disruptive}
htmlType={htmlType}
icon={icon}
iconColor={iconColor}
onClick={onClick}
primaryColor={primaryColor}
size={size}
Expand Down
2 changes: 2 additions & 0 deletions src/components/Button/SecondaryButton/SecondaryButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ export const SecondaryButton: FC<ButtonProps> = ({
disruptive = false,
htmlType,
icon,
iconColor,
onClick,
primaryColor,
text,
Expand All @@ -37,6 +38,7 @@ export const SecondaryButton: FC<ButtonProps> = ({
disruptive={disruptive}
htmlType={htmlType}
icon={icon}
iconColor={iconColor}
onClick={onClick}
primaryColor={primaryColor}
size={size}
Expand Down
5 changes: 2 additions & 3 deletions src/components/Button/button.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,8 @@
}

&:focus-visible {
box-sizing: border-box;
padding: $space-xs $space-s;
border-width: rem(4px);
outline: rem(2px) solid var(--primary-color-80);
outline-offset: rem(-2px);
}
}

Expand Down
1 change: 1 addition & 0 deletions src/components/Icon/mdi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -293,6 +293,7 @@ export enum IconName {
mdiReplyAll = 'M13,9V5L6,12L13,19V14.9C18,14.9 21.5,16.5 24,20C23,15 20,10 13,9M7,8V5L0,12L7,19V16L3,12L7,8Z',
mdiReplyAllOutline = 'M11,9.8V10.7L12.7,10.9C15.3,11.3 17.2,12.3 18.6,13.6C16.9,13.1 15.1,12.8 13,12.8H11V14.1L8.8,12L11,9.8M13,5L6,12L13,19V14.9C18,14.9 21.5,16.5 24,20C23,15 20,10 13,9M7,8V5L0,12L7,19V16L3,12',
mdiReplyOutline = 'M8,9.8V10.7L9.7,11C12.3,11.4 14.2,12.4 15.6,13.7C13.9,13.2 12.1,12.9 10,12.9H8V14.2L5.8,12L8,9.8M10,5L3,12L10,19V14.9C15,14.9 18.5,16.5 21,20C20,15 17,10 10,9',
mdiResizeBottomRight = 'M22,22H20V20H22V22M22,18H20V16H22V18M18,22H16V20H18V22M18,18H16V16H18V18M14,22H12V20H14V22M22,14H20V12H22V14Z',
mdiRoad = 'M11,16H13V20H11M11,10H13V14H11M11,4H13V8H11M4,22H20V2H4V22Z',
mdiRoadVariant = 'M18.1,4.8C18,4.3 17.6,4 17.1,4H13L13.2,7H10.8L11,4H6.8C6.3,4 5.9,4.4 5.8,4.8L3.1,18.8C3,19.4 3.5,20 4.1,20H10L10.3,15H13.7L14,20H19.8C20.4,20 20.9,19.4 20.8,18.8L18.1,4.8M10.4,13L10.6,9H13.2L13.4,13H10.4Z',
mdiRocket = 'M20 22L16.14 20.45C16.84 18.92 17.34 17.34 17.65 15.73L20 22M7.86 20.45L4 22L6.35 15.73C6.66 17.34 7.16 18.92 7.86 20.45M12 2C12 2 17 4 17 12C17 15.1 16.25 17.75 15.33 19.83C15 20.55 14.29 21 13.5 21H10.5C9.71 21 9 20.55 8.67 19.83C7.76 17.75 7 15.1 7 12C7 4 12 2 12 2M12 12C13.1 12 14 11.1 14 10C14 8.9 13.1 8 12 8C10.9 8 10 8.9 10 10C10 11.1 10.9 12 12 12Z',
Expand Down
Loading