Skip to content

Commit

Permalink
Justering av eksempler på Button (#2559)
Browse files Browse the repository at this point in the history
  • Loading branch information
HalvorHaugan authored Dec 14, 2023
1 parent f9276ba commit f278588
Show file tree
Hide file tree
Showing 8 changed files with 113 additions and 89 deletions.
48 changes: 48 additions & 0 deletions aksel.nav.no/website/pages/eksempler/button/action.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
import { Button, HStack, VStack } from "@navikt/ds-react";
import { withDsExample } from "@/web/examples/withDsExample";

const Example = () => {
return (
<VStack gap="6" align="center">
<HStack gap="2">
<Button variant="primary">Primary</Button>
<Button variant="secondary">Secondary</Button>
<Button variant="tertiary">Tertiary</Button>
</HStack>
<HStack gap="2">
<Button variant="primary" size="small">
Primary
</Button>
<Button variant="secondary" size="small">
Secondary
</Button>
<Button variant="tertiary" size="small">
Tertiary
</Button>
</HStack>
<HStack gap="2">
<Button variant="primary" size="xsmall">
Primary
</Button>
<Button variant="secondary" size="xsmall">
Secondary
</Button>
<Button variant="tertiary" size="xsmall">
Tertiary
</Button>
</HStack>
</VStack>
);
};

// EXAMPLES DO NOT INCLUDE CONTENT BELOW THIS LINE
export default withDsExample(Example);

/* Storybook story */
export const Demo = {
render: Example,
};

export const args = {
index: 0,
};
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
import { Button } from "@navikt/ds-react";
import { Button, VStack } from "@navikt/ds-react";
import { withDsExample } from "@/web/examples/withDsExample";

const Example = () => {
return (
<div className="flex flex-wrap gap-2">
<Button variant="primary">Primary</Button>
<Button variant="secondary">Secondary</Button>
<Button variant="tertiary">Tertiary</Button>
<VStack gap="6" align="center">
<Button variant="danger">Danger</Button>
</div>
<Button variant="danger" size="small">
Danger
</Button>
<Button variant="danger" size="xsmall">
Danger
</Button>
</VStack>
);
};

Expand All @@ -21,5 +24,5 @@ export const Demo = {
};

export const args = {
index: 0,
index: 2,
};
6 changes: 3 additions & 3 deletions aksel.nav.no/website/pages/eksempler/button/disabled.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { Button } from "@navikt/ds-react";
import { Button, HStack } from "@navikt/ds-react";
import { withDsExample } from "@/web/examples/withDsExample";

const Example = () => {
return (
<div className="flex flex-wrap gap-2">
<HStack gap="2">
<Button disabled variant="primary">
Primary
</Button>
Expand All @@ -16,7 +16,7 @@ const Example = () => {
<Button disabled variant="danger">
Danger
</Button>
</div>
</HStack>
);
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,24 @@ const Example = () => {
);
};

/*
import { Link as ReactRouterLink } from "react-router-dom";
const ReactRouterExample = () => (
<Button as={ReactRouterLink} to="#">
Lenke
</Button>
);
import { Link as RemixLink } from "@remix-run/react";
const RemixExample = () => (
<Button as={RemixLink} to="#">
Lenke
</Button>
);
*/

// EXAMPLES DO NOT INCLUDE CONTENT BELOW THIS LINE
export default withDsExample(Example);

Expand Down
8 changes: 4 additions & 4 deletions aksel.nav.no/website/pages/eksempler/button/icon.tsx
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
import { PencilIcon } from "@navikt/aksel-icons";
import { Button } from "@navikt/ds-react";
import { Button, HStack } from "@navikt/ds-react";
import { withDsExample } from "@/web/examples/withDsExample";

const Example = () => {
return (
<div className="flex flex-wrap gap-2">
<HStack gap="6">
<Button icon={<PencilIcon aria-hidden />}>Rediger</Button>
<Button icon={<PencilIcon aria-hidden />} />
<Button icon={<PencilIcon title="Rediger" />} />
<Button iconPosition="right" icon={<PencilIcon aria-hidden />}>
Rediger
</Button>
</div>
</HStack>
);
};

Expand Down
36 changes: 30 additions & 6 deletions aksel.nav.no/website/pages/eksempler/button/neutral.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,37 @@
import { Button } from "@navikt/ds-react";
import { Button, HStack, VStack } from "@navikt/ds-react";
import { withDsExample } from "@/web/examples/withDsExample";

const Example = () => {
return (
<div className="flex flex-wrap gap-2">
<Button variant="primary-neutral">Primary</Button>
<Button variant="secondary-neutral">Secondary</Button>
<Button variant="tertiary-neutral">Tertiary</Button>
</div>
<VStack gap="6" align="center">
<HStack gap="2">
<Button variant="primary-neutral">Primary</Button>
<Button variant="secondary-neutral">Secondary</Button>
<Button variant="tertiary-neutral">Tertiary</Button>
</HStack>
<HStack gap="2">
<Button variant="primary-neutral" size="small">
Primary
</Button>
<Button variant="secondary-neutral" size="small">
Secondary
</Button>
<Button variant="tertiary-neutral" size="small">
Tertiary
</Button>
</HStack>
<HStack gap="2">
<Button variant="primary-neutral" size="xsmall">
Primary
</Button>
<Button variant="secondary-neutral" size="xsmall">
Secondary
</Button>
<Button variant="tertiary-neutral" size="xsmall">
Tertiary
</Button>
</HStack>
</VStack>
);
};

Expand Down
34 changes: 0 additions & 34 deletions aksel.nav.no/website/pages/eksempler/button/small.tsx

This file was deleted.

35 changes: 0 additions & 35 deletions aksel.nav.no/website/pages/eksempler/button/xsmall.tsx

This file was deleted.

0 comments on commit f278588

Please sign in to comment.