-
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.
Feature/combobox error message (#2182)
Co-authored-by: Ken <[email protected]>
- Loading branch information
Showing
7 changed files
with
100 additions
and
9 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-react": patch | ||
--- | ||
|
||
Add support for error messages to combobox |
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
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
36 changes: 36 additions & 0 deletions
36
aksel.nav.no/website/pages/eksempler/combobox/with-error.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,36 @@ | ||
import { UNSAFE_Combobox } from "@navikt/ds-react"; | ||
import { withDsExample } from "components/website-modules/examples/withDsExample"; | ||
|
||
const initialOptions = [ | ||
"banana", | ||
"apple", | ||
"tangerine", | ||
"pear", | ||
"grape", | ||
"kiwi", | ||
"mango", | ||
"passion fruit", | ||
"pineapple", | ||
"strawberry", | ||
"watermelon", | ||
"grape fruit", | ||
]; | ||
|
||
export const Example = () => { | ||
return ( | ||
<div> | ||
<UNSAFE_Combobox | ||
label="Hva er din favorittfrukt?" | ||
options={initialOptions} | ||
error="Du må velge en favorittfrukt." | ||
/> | ||
</div> | ||
); | ||
}; | ||
|
||
export default withDsExample(Example, "static"); | ||
|
||
export const args = { | ||
index: 0, | ||
desc: "Ved Single Select velger brukeren kun ett valg fra nedtrekkslisten.", | ||
}; |