-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
7 changed files
with
197 additions
and
42 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"@navikt/ds-css": patch | ||
--- | ||
|
||
- Button: Fikset outline-bug i tertiary-variant ved `:active`-state |
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,6 @@ | ||
--- | ||
"@navikt/ds-css": minor | ||
"@navikt/ds-react": minor | ||
--- | ||
|
||
- Alert: La til `closeButton`-prop |
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
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
53 changes: 53 additions & 0 deletions
53
aksel.nav.no/website/pages/eksempler/alert/med-lukkeknapp.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,53 @@ | ||
import { Alert, AlertProps } from "@navikt/ds-react"; | ||
import { withDsExample } from "components/website-modules/examples/withDsExample"; | ||
import React from "react"; | ||
|
||
const AlertWithCloseButton = ({ | ||
children, | ||
variant, | ||
}: { | ||
children?: React.ReactNode; | ||
variant: AlertProps["variant"]; | ||
}) => { | ||
const [show, setShow] = React.useState(true); | ||
|
||
return ( | ||
show && ( | ||
<Alert variant={variant} closeButton onClose={() => setShow(false)}> | ||
{children || "Content"} | ||
</Alert> | ||
) | ||
); | ||
}; | ||
|
||
const Example = () => { | ||
return ( | ||
<div className="grid gap-4"> | ||
<AlertWithCloseButton variant="info"> | ||
Hvis du er mellom 62 og 67 år når du søker, må du som hovedregel ha hatt | ||
en pensjonsgivende inntekt som tilsvarer x G, året før du fikk nedsatt | ||
arbeidsevnen. | ||
</AlertWithCloseButton> | ||
<AlertWithCloseButton variant="success"> | ||
Søknad er sendt inn! | ||
</AlertWithCloseButton> | ||
<AlertWithCloseButton variant="warning"> | ||
Du må være registrert hos NAV for å bruke aktivitetsplanen. | ||
</AlertWithCloseButton> | ||
<AlertWithCloseButton variant="error"> | ||
Noe gikk galt! Prøv igjen om noen minutter. | ||
</AlertWithCloseButton> | ||
</div> | ||
); | ||
}; | ||
|
||
export default withDsExample(Example); | ||
|
||
/* Storybook story */ | ||
export const Demo = { | ||
render: Example, | ||
}; | ||
|
||
export const args = { | ||
index: 1, | ||
}; |