Skip to content

Commit

Permalink
Radio- og checkbox-panel skal bruke aksels design tokens
Browse files Browse the repository at this point in the history
  • Loading branch information
charliemidtlyng committed Dec 14, 2023
1 parent 35049a4 commit e3b17a9
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 10 deletions.
17 changes: 12 additions & 5 deletions src/components/panel/CheckboxPanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@ import React, { PropsWithChildren } from 'react';
import { Checkbox } from '@navikt/ds-react';
import classnames from 'classnames';
import styled from 'styled-components';
import {
ABlue100,
ABlue500,
ABorderActionSelected,
ABorderDefault,
AShadowMedium,
} from '@navikt/ds-tokens/dist/tokens';

interface Properties extends React.InputHTMLAttributes<HTMLInputElement> {
name?: string | undefined;
Expand All @@ -14,7 +21,7 @@ const StyledCheckbox = styled(Checkbox)`
&.checkbox-panel {
width: 100%;
background-color: #fff;
border: 1px solid #6a6a6a;
border: 1px solid ${ABorderDefault};
border-radius: 0.25rem;
display: block;
position: relative;
Expand All @@ -24,18 +31,18 @@ const StyledCheckbox = styled(Checkbox)`
font-weight: 400;
&.active {
background-color: #cce1ff;
background-color: ${ABlue100};
border: 1px solid transparent;
}
&:hover {
border: 1px solid #0067c5;
box-shadow: #a0a0a0 0 2px 1px 0;
border: 1px solid ${ABlue500};
box-shadow: ${AShadowMedium};
cursor: pointer;
}
&:focus-visible {
outline: rgba(0, 52, 125, 1) solid 1px;
outline: ${ABorderActionSelected} solid 1px;
}
.navds-checkbox__label {
Expand Down
17 changes: 12 additions & 5 deletions src/components/panel/RadioPanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@ import React, { PropsWithChildren } from 'react';
import { Radio } from '@navikt/ds-react';
import classnames from 'classnames';
import styled from 'styled-components';
import {
ABlue100,
ABlue500,
ABorderActionSelected,
ABorderDefault,
AShadowMedium,
} from '@navikt/ds-tokens/dist/tokens';

interface Properties extends React.InputHTMLAttributes<HTMLInputElement> {
name?: string | undefined;
Expand All @@ -14,7 +21,7 @@ const StyledRadio = styled(Radio)`
&.radio-panel {
width: 100%;
background-color: #fff;
border: 1px solid #6a6a6a;
border: 1px solid ${ABorderDefault};
border-radius: 0.25rem;
display: block;
position: relative;
Expand All @@ -24,18 +31,18 @@ const StyledRadio = styled(Radio)`
font-weight: 400;
&.active {
background-color: #cce1ff;
background-color: ${ABlue100};
border: 1px solid transparent;
}
&:hover {
border: 1px solid #0067c5;
box-shadow: #a0a0a0 0 2px 1px 0;
border: 1px solid ${ABlue500};
box-shadow: ${AShadowMedium};
cursor: pointer;
}
&:focus-visible {
outline: rgba(0, 52, 125, 1) solid 1px;
outline: ${ABorderActionSelected} solid 1px;
}
.navds-radio__label {
Expand Down

0 comments on commit e3b17a9

Please sign in to comment.