diff --git a/src/components/__snapshots__/ManageCookies.spec.tsx.snap b/src/components/__snapshots__/ManageCookies.spec.tsx.snap
index 03718ead7..a4a205911 100644
--- a/src/components/__snapshots__/ManageCookies.spec.tsx.snap
+++ b/src/components/__snapshots__/ManageCookies.spec.tsx.snap
@@ -2,7 +2,7 @@
exports[`ManageCookies when CookieYes loads renders button 1`] = `
@@ -11,7 +11,7 @@ exports[`ManageCookies when CookieYes loads renders button 1`] = `
exports[`ManageCookies when CookieYes loads renders button in wrapper 1`] = `
@@ -20,7 +20,7 @@ exports[`ManageCookies when CookieYes loads renders button in wrapper 1`] = `
exports[`ManageCookies when CookieYes loads renders button with className 1`] = `
@@ -28,7 +28,7 @@ exports[`ManageCookies when CookieYes loads renders button with className 1`] =
exports[`ManageCookies when CookieYes loads renders button with content and correct class 1`] = `
@@ -36,7 +36,7 @@ exports[`ManageCookies when CookieYes loads renders button with content and corr
exports[`ManageCookies with CookieYes already loaded renders button 1`] = `
@@ -45,7 +45,7 @@ exports[`ManageCookies with CookieYes already loaded renders button 1`] = `
exports[`ManageCookies with CookieYes already loaded renders button in wrapper 1`] = `
@@ -54,7 +54,7 @@ exports[`ManageCookies with CookieYes already loaded renders button in wrapper 1
exports[`ManageCookies with CookieYes already loaded renders button with content and correct class 1`] = `
diff --git a/src/components/forms/uncontrolled/index.tsx b/src/components/forms/uncontrolled/index.tsx
index 80e053531..e53da9c4d 100644
--- a/src/components/forms/uncontrolled/index.tsx
+++ b/src/components/forms/uncontrolled/index.tsx
@@ -7,7 +7,10 @@ export * from './inputs';
/*
* form element
*/
-const FormElement = styled.form`
+type FormProps = React.ComponentPropsWithoutRef<'form'>;
+export const Form = styled(({children, ...props}: FormProps) =>
)`
margin: 5px;
> *:not(:first-child) {
margin-top: 2rem;
@@ -17,10 +20,6 @@ const FormElement = styled.form`
border-bottom: 1px solid #ccc;
}
`;
-type FormProps = React.ComponentPropsWithoutRef<'form'>;
-export const Form = ({children, ...props}: FormProps) =>
- {children}
-;
export const FormSection = styled.div`
> *:not(:first-child) {
@@ -28,21 +27,29 @@ export const FormSection = styled.div`
}
`;
-const MessagesElement = styled.div`
- font-weight: bold;
-`;
type MessagesProps = {
state: FetchState
;
+ className?: string;
};
-export const Messages = ({state}: MessagesProps) => stateHasError(state)
- ? {state.error}
+export const Messages = styled(({state}: MessagesProps) => stateHasError(state)
+ ? {state.error}
: null
-;
+)`
+ font-weight: bold;
+`;
/*
* form buttons
*/
-const ButtonsElement = styled.div`
+type ButtonsProps = {
+ state: FetchState;
+ onCancel?: () => void;
+ className?: string;
+};
+export const Buttons = styled((props: ButtonsProps) =>
+ {'onCancel' in props ? Cancel : null}
+
+
)`
display: flex;
flex-direction: row;
justify-content: space-between;
@@ -50,23 +57,15 @@ const ButtonsElement = styled.div`
margin-top: 3rem;
}
`;
-type ButtonsProps = {
- state: FetchState;
- onCancel?: () => void;
-};
-export const Buttons = (props: ButtonsProps) =>
- {'onCancel' in props ? Cancel : null}
-
-;
// submit button
-const SubmitElement = styled.input`
-`;
type SubmitButtonProps = React.ComponentPropsWithoutRef<'input'>;
-export const Submit = ({...props}: SubmitButtonProps) => ;
+export const Submit = styled(({...props}: SubmitButtonProps) =>
+
+)`
+`;
// cancel button
-const CancelElement = styled.button`
-`;
type CancelButtonProps = React.ComponentPropsWithoutRef<'button'>;
-export const Cancel = ({...props}: CancelButtonProps) => ;
+export const Cancel = styled(({...props}: CancelButtonProps) => )`
+`;
diff --git a/src/theme/buttons.ts b/src/theme/buttons.ts
index f8c259088..767140783 100644
--- a/src/theme/buttons.ts
+++ b/src/theme/buttons.ts
@@ -8,6 +8,8 @@ interface ButtonStyleSet {
backgroundActive: string;
backgroundHover: string;
color: string;
+ outline: string;
+ shadow: string;
fontWeight?: number;
}
@@ -20,6 +22,8 @@ const buttonStyleSets = asButtonStyleSetTypes({
backgroundActive: "#b03808",
backgroundHover: "#be3c08",
color: palette.white,
+ outline: palette.white,
+ shadow: palette.black,
},
light: {
background: palette.white,
@@ -27,12 +31,16 @@ const buttonStyleSets = asButtonStyleSetTypes({
backgroundHover: palette.white,
color: palette.neutralDarker,
fontWeight: 400,
+ outline: palette.white,
+ shadow: palette.black,
},
secondary: {
background: palette.darkGray,
backgroundActive: "#4c4c4c",
backgroundHover: "#646464",
color: palette.white,
+ outline: palette.white,
+ shadow: palette.black,
},
} as const);
@@ -51,5 +59,10 @@ export const applyButtonVariantStyles = (variant: ButtonVariant) => {
background: ${set.backgroundActive};
}
}
+
+ &:focus {
+ outline: solid ${set.outline};
+ box-shadow: inset 0 0 0 0.3rem ${set.shadow};
+ }
`;
};