diff --git a/.changeset/strong-bulldogs-jam.md b/.changeset/strong-bulldogs-jam.md new file mode 100644 index 0000000000..81c49e1454 --- /dev/null +++ b/.changeset/strong-bulldogs-jam.md @@ -0,0 +1,6 @@ +--- +"@navikt/ds-react": patch +"@navikt/ds-css": patch +--- + +List: Changed List.Item to BodyLong, changed Item spacing from 1rem to 0.5rem. diff --git a/@navikt/core/css/list.css b/@navikt/core/css/list.css index d4f04e2c5b..f2848746cc 100644 --- a/@navikt/core/css/list.css +++ b/@navikt/core/css/list.css @@ -15,15 +15,7 @@ } .navds-list li { - margin-block-end: var(--a-spacing-4); -} - -.navds-list--small li { - margin-block-end: var(--a-spacing-3); -} - -.navds-list--nested li { - margin-block-end: var(--a-spacing-3); + margin-block-end: var(--a-spacing-2); } .navds-list:last-child > ul > li:last-child, @@ -50,25 +42,25 @@ .navds-list .navds-list__item-marker--bullet { display: flex; align-items: center; - height: var(--a-font-line-height-large); + height: var(--a-font-line-height-xlarge); grid-column: 1 / 2; color: var(--ac-list-marker-ul-color, var(--ac-list-marker-color, var(--a-icon-default))); } .navds-list--small .navds-list__item-marker--bullet { - height: var(--a-font-line-height-medium); + height: var(--a-font-line-height-large); } .navds-list__item-marker--icon { color: var(--ac-list-marker-icon-color, var(--ac-list-marker-color, var(--a-icon-default))); display: flex; align-items: center; - height: var(--a-font-line-height-large); + height: var(--a-font-line-height-xlarge); padding-block-end: 1px; } .navds-list--small .navds-list__item-marker--icon { - height: var(--a-font-line-height-medium); + height: var(--a-font-line-height-large); } .navds-list__item-marker--icon svg { @@ -93,10 +85,10 @@ font-weight: var(--a-font-weight-bold); font-size: var(--a-font-size-large); color: var(--ac-list-marker-ol-color, var(--ac-list-marker-color, var(--a-icon-default))); - line-height: var(--a-font-line-height-large); + line-height: var(--a-font-line-height-xlarge); } .navds-list--small ol li::marker { font-size: var(--a-font-size-small); - line-height: var(--a-font-line-height-medium); + line-height: var(--a-font-line-height-large); } diff --git a/@navikt/core/react/src/list/ListItem.tsx b/@navikt/core/react/src/list/ListItem.tsx index 775fc35cdd..bd62b8a90d 100644 --- a/@navikt/core/react/src/list/ListItem.tsx +++ b/@navikt/core/react/src/list/ListItem.tsx @@ -1,6 +1,6 @@ import cl from "clsx"; import React, { forwardRef, useContext } from "react"; -import { BodyShort, Label } from "../typography"; +import { BodyLong } from "../typography"; import { ListContext } from "./context"; import { ListItemProps } from "./types"; @@ -45,14 +45,14 @@ export const ListItem = forwardRef( )} - + {title && ( - + )} {children} - + ); }, diff --git a/@navikt/core/react/src/list/list.stories.tsx b/@navikt/core/react/src/list/list.stories.tsx index 79ab54f410..8b268f4ef0 100644 --- a/@navikt/core/react/src/list/list.stories.tsx +++ b/@navikt/core/react/src/list/list.stories.tsx @@ -7,6 +7,7 @@ import { RecycleIcon, } from "@navikt/aksel-icons"; import { VStack } from "../layout/stack"; +import { BodyLong } from "../typography"; import List from "./List"; export default { @@ -29,8 +30,17 @@ export const Default = { Beskrivelse på punktet i lista. Prøv å hold den kort og konsis. - - Beskrivelse på punktet i lista. Prøv å hold den kort og konsis. + + Lorem ipsum, dolor sit amet consectetur adipisicing elit. Iusto fugiat + atque accusantium iure sunt, ipsum voluptas, impedit harum, minus + rerum recusandae. Consequuntur sint distinctio nulla reprehenderit eum + suscipit quae libero. + + + Lorem ipsum, dolor sit amet consectetur adipisicing elit. Iusto fugiat + atque accusantium iure sunt, ipsum voluptas, impedit harum, minus + rerum recusandae. Consequuntur sint distinctio nulla reprehenderit eum + suscipit quae libero. ); @@ -284,6 +294,69 @@ export const Nested = { }, }; +export const Spacing = { + render: () => { + return ( + <> +

Medium

+ + Lorem ipsum dolor sit amet consectetur adipisicing elit. Sit minus + aliquid, veniam quibusdam saepe autem quia odio? Tenetur dicta + voluptates iste maiores perspiciatis? Sapiente in possimus iusto + numquam? Esse, voluptatibus. + + + + Lorem ipsum, dolor sit amet consectetur adipisicing elit. Iusto + fugiat atque accusantium iure sunt, ipsum voluptas, impedit harum, + minus rerum recusandae. Consequuntur sint distinctio nulla + reprehenderit eum suscipit quae libero. + + + Lorem ipsum, dolor sit amet consectetur adipisicing elit. Iusto + fugiat atque accusantium iure sunt, ipsum voluptas, impedit harum, + minus rerum recusandae. Consequuntur sint distinctio nulla + reprehenderit eum suscipit quae libero. + + + + Lorem ipsum dolor sit amet consectetur adipisicing elit. Sit minus + aliquid, veniam quibusdam saepe autem quia odio? Tenetur dicta + voluptates iste maiores perspiciatis? Sapiente in possimus iusto + numquam? Esse, voluptatibus. + +

Small

+ + Lorem ipsum dolor sit amet consectetur adipisicing elit. Sit minus + aliquid, veniam quibusdam saepe autem quia odio? Tenetur dicta + voluptates iste maiores perspiciatis? Sapiente in possimus iusto + numquam? Esse, voluptatibus. + + + + Lorem ipsum, dolor sit amet consectetur adipisicing elit. Iusto + fugiat atque accusantium iure sunt, ipsum voluptas, impedit harum, + minus rerum recusandae. Consequuntur sint distinctio nulla + reprehenderit eum suscipit quae libero. + + + Lorem ipsum, dolor sit amet consectetur adipisicing elit. Iusto + fugiat atque accusantium iure sunt, ipsum voluptas, impedit harum, + minus rerum recusandae. Consequuntur sint distinctio nulla + reprehenderit eum suscipit quae libero. + + + + Lorem ipsum dolor sit amet consectetur adipisicing elit. Sit minus + aliquid, veniam quibusdam saepe autem quia odio? Tenetur dicta + voluptates iste maiores perspiciatis? Sapiente in possimus iusto + numquam? Esse, voluptatibus. + + + ); + }, +}; + export const Chromatic: Story = { render: () => ( @@ -319,6 +392,10 @@ export const Chromatic: Story = {

Nested

+
+

Spacing

+ +
), parameters: {