([2, 4]);
+ return (
+
+
+ {options.map((c, y) => (
+
+ setSelected(
+ selected.includes(y)
+ ? selected.filter((x) => x !== y)
+ : [...selected, y]
+ )
+ }
+ key={y}
+ >
+ {c}
+
+ ))}
+
+
+ {options.map((c, y) => (
+
+ setSelected(
+ selected.includes(y)
+ ? selected.filter((x) => x !== y)
+ : [...selected, y]
+ )
+ }
+ key={y}
+ >
+ {c}
+
+ ))}
+
+
+ );
+};
+
+export const ToggleNoCheckmark = () => {
+ const [selected, setSelected] = useState(2);
return (
-
- {options.map((c, y) => (
-
- setSelected(
- selected.includes(y)
- ? selected.filter((x) => x !== y)
- : [...selected, y]
- )
- }
- key={y}
- >
- {c}
-
- ))}
-
+
+
+ {options.map((c, y) => (
+ setSelected(y)}
+ key={y}
+ >
+ {c}
+
+ ))}
+
+
+ {options.map((c, y) => (
+ setSelected(y)}
+ key={y}
+ >
+ {c}
+
+ ))}
+
+
);
};
@@ -108,7 +161,7 @@ export const Removable = () => {
};
export const Regular = () => {
- const [selected, setSelected] = useState([]);
+ const [selected, setSelected] = useState([2]);
return (
diff --git a/aksel.nav.no/website/pages/eksempler/chips/default.tsx b/aksel.nav.no/website/pages/eksempler/chips/default.tsx
deleted file mode 100644
index fce2d15fe9..0000000000
--- a/aksel.nav.no/website/pages/eksempler/chips/default.tsx
+++ /dev/null
@@ -1,57 +0,0 @@
-import { Chips } from "@navikt/ds-react";
-import { withDsExample } from "components/website-modules/examples/withDsExample";
-import { useState } from "react";
-
-const Example = () => {
- const options = ["Norsk", "Dansk", "Svensk", "Tysk", "Spansk"];
-
- const [selected, setSelected] = useState(["Dansk", "Svensk"]);
- const [filter, setFilter] = useState(options);
-
- return (
-
-
- {options.map((c) => (
-
- setSelected(
- selected.includes(c)
- ? selected.filter((x) => x !== c)
- : [...selected, c]
- )
- }
- >
- {c}
-
- ))}
-
-
- {filter.map((c) => (
-
- setFilter((x) =>
- x.length === 1 ? options : x.filter((y) => y !== c)
- )
- }
- >
- {c}
-
- ))}
-
-
- );
-};
-
-export default withDsExample(Example);
-
-/* Storybook story */
-export const Demo = {
- render: Example,
-};
-
-export const args = {
- index: 0,
-};
diff --git a/aksel.nav.no/website/pages/eksempler/chips/removable-neutral.tsx b/aksel.nav.no/website/pages/eksempler/chips/removable-neutral.tsx
new file mode 100644
index 0000000000..9442333786
--- /dev/null
+++ b/aksel.nav.no/website/pages/eksempler/chips/removable-neutral.tsx
@@ -0,0 +1,47 @@
+import { Chips } from "@navikt/ds-react";
+import { withDsExample } from "components/website-modules/examples/withDsExample";
+import { useState } from "react";
+
+const Example = () => {
+ const options = [
+ "Lillehammer",
+ "Nittedal",
+ "Enebakk",
+ "Hamar",
+ "Skedsmo",
+ "Arendal",
+ "Gjøvik",
+ "Vennesla",
+ ];
+
+ const [filter, setFilter] = useState(options);
+
+ return (
+
+ {filter.map((c) => (
+
+ setFilter((x) =>
+ x.length === 1 ? options : x.filter((y) => y !== c)
+ )
+ }
+ >
+ {c}
+
+ ))}
+
+ );
+};
+
+export default withDsExample(Example);
+
+/* Storybook story */
+export const Demo = {
+ render: Example,
+};
+
+export const args = {
+ index: 5,
+};
diff --git a/aksel.nav.no/website/pages/eksempler/chips/removable.tsx b/aksel.nav.no/website/pages/eksempler/chips/removable.tsx
index 34d34b2738..874925bb34 100644
--- a/aksel.nav.no/website/pages/eksempler/chips/removable.tsx
+++ b/aksel.nav.no/website/pages/eksempler/chips/removable.tsx
@@ -3,7 +3,16 @@ import { withDsExample } from "components/website-modules/examples/withDsExample
import { useState } from "react";
const Example = () => {
- const options = ["Norsk", "Dansk", "Svensk", "Tysk", "Spansk"];
+ const options = [
+ "Lillehammer",
+ "Nittedal",
+ "Enebakk",
+ "Hamar",
+ "Skedsmo",
+ "Arendal",
+ "Gjøvik",
+ "Vennesla",
+ ];
const [filter, setFilter] = useState(options);
@@ -12,6 +21,7 @@ const Example = () => {
{filter.map((c) => (
setFilter((x) =>
x.length === 1 ? options : x.filter((y) => y !== c)
@@ -33,5 +43,5 @@ export const Demo = {
};
export const args = {
- index: 2,
+ index: 4,
};
diff --git a/aksel.nav.no/website/pages/eksempler/chips/small.tsx b/aksel.nav.no/website/pages/eksempler/chips/small.tsx
index d567817c1d..b6af75d9f0 100644
--- a/aksel.nav.no/website/pages/eksempler/chips/small.tsx
+++ b/aksel.nav.no/website/pages/eksempler/chips/small.tsx
@@ -3,9 +3,18 @@ import { withDsExample } from "components/website-modules/examples/withDsExample
import { useState } from "react";
const Example = () => {
- const options = ["Norsk", "Dansk", "Svensk", "Tysk", "Spansk"];
+ const options = [
+ "Lillehammer",
+ "Nittedal",
+ "Enebakk",
+ "Hamar",
+ "Skedsmo",
+ "Arendal",
+ "Gjøvik",
+ "Vennesla",
+ ];
- const [selected, setSelected] = useState(["Dansk", "Svensk"]);
+ const [selected, setSelected] = useState(["Arendal", "Nittedal"]);
const [filter, setFilter] = useState(options);
return (
@@ -53,5 +62,5 @@ export const Demo = {
};
export const args = {
- index: 3,
+ index: 6,
};
diff --git a/aksel.nav.no/website/pages/eksempler/chips/toggle-neutral.tsx b/aksel.nav.no/website/pages/eksempler/chips/toggle-neutral.tsx
new file mode 100644
index 0000000000..e43eab9a2a
--- /dev/null
+++ b/aksel.nav.no/website/pages/eksempler/chips/toggle-neutral.tsx
@@ -0,0 +1,50 @@
+import { Chips } from "@navikt/ds-react";
+import { withDsExample } from "components/website-modules/examples/withDsExample";
+import { useState } from "react";
+
+const Example = () => {
+ const options = [
+ "Lillehammer",
+ "Nittedal",
+ "Enebakk",
+ "Hamar",
+ "Skedsmo",
+ "Arendal",
+ "Gjøvik",
+ "Vennesla",
+ ];
+
+ const [selected, setSelected] = useState(["Gjøvik", "Hamar"]);
+
+ return (
+
+ {options.map((c) => (
+
+ setSelected(
+ selected.includes(c)
+ ? selected.filter((x) => x !== c)
+ : [...selected, c]
+ )
+ }
+ >
+ {c}
+
+ ))}
+
+ );
+};
+
+export default withDsExample(Example);
+
+/* Storybook story */
+export const Demo = {
+ render: Example,
+};
+
+export const args = {
+ index: 2,
+};
diff --git a/aksel.nav.no/website/pages/eksempler/chips/toggle-no-checkmark.tsx b/aksel.nav.no/website/pages/eksempler/chips/toggle-no-checkmark.tsx
new file mode 100644
index 0000000000..8371b4d0dd
--- /dev/null
+++ b/aksel.nav.no/website/pages/eksempler/chips/toggle-no-checkmark.tsx
@@ -0,0 +1,44 @@
+import { Chips } from "@navikt/ds-react";
+import { withDsExample } from "components/website-modules/examples/withDsExample";
+import { useState } from "react";
+
+const Example = () => {
+ const options = [
+ "Lillehammer",
+ "Nittedal",
+ "Enebakk",
+ "Hamar",
+ "Skedsmo",
+ "Arendal",
+ "Gjøvik",
+ "Vennesla",
+ ];
+
+ const [selected, setSelected] = useState(3);
+
+ return (
+
+ {options.map((c, y) => (
+ setSelected(y)}
+ >
+ {c}
+
+ ))}
+
+ );
+};
+
+export default withDsExample(Example);
+
+/* Storybook story */
+export const Demo = {
+ render: Example,
+};
+
+export const args = {
+ index: 3,
+};
diff --git a/aksel.nav.no/website/pages/eksempler/chips/toggle.tsx b/aksel.nav.no/website/pages/eksempler/chips/toggle.tsx
index b01c5aed8d..8efc388736 100644
--- a/aksel.nav.no/website/pages/eksempler/chips/toggle.tsx
+++ b/aksel.nav.no/website/pages/eksempler/chips/toggle.tsx
@@ -3,9 +3,18 @@ import { withDsExample } from "components/website-modules/examples/withDsExample
import { useState } from "react";
const Example = () => {
- const options = ["Norsk", "Dansk", "Svensk", "Tysk", "Spansk"];
+ const options = [
+ "Lillehammer",
+ "Nittedal",
+ "Enebakk",
+ "Hamar",
+ "Skedsmo",
+ "Arendal",
+ "Gjøvik",
+ "Vennesla",
+ ];
- const [selected, setSelected] = useState(["Dansk", "Svensk"]);
+ const [selected, setSelected] = useState(["Nittedal", "Arendal"]);
return (