Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/template intropage #2876

Merged
merged 56 commits into from
May 21, 2024
Merged
Show file tree
Hide file tree
Changes from 47 commits
Commits
Show all changes
56 commits
Select commit Hold shift + click to select a range
669ea81
Init intropage. Just with header and guidepanel in first commit. The …
it-vegard Apr 16, 2024
1e64565
Add "what can i apply to here" content, as well as prepare the page f…
it-vegard Apr 16, 2024
ef13e53
Add "this is how you apply"-section
it-vegard Apr 16, 2024
2985c47
Add confirmation checkbox and "start application" button
it-vegard Apr 16, 2024
766f893
Add "extra information" accordion
it-vegard Apr 16, 2024
0f992cb
Add language selector and switch to simple decorator
it-vegard Apr 16, 2024
e27b5ed
Correct icon and placement for "start application" button
it-vegard Apr 16, 2024
39e61d9
Proper pictogram in FormHeader and bleed outside of the main column.
it-vegard Apr 16, 2024
f53641d
Make Intropage header responsive, moving pictogram to the right on mo…
it-vegard Apr 17, 2024
1917779
Add IntroPage story to regular Storybook, so it is exposed through Ch…
it-vegard Apr 23, 2024
373c280
Temporarily add ApplicationPictogram in same folder as template to ma…
it-vegard Apr 23, 2024
2f4dd3f
Simplify/extract code for decorator
it-vegard Apr 23, 2024
d0c2d3b
updated texts according to Figma
it-vegard Apr 30, 2024
e6cc611
Center align title and form id with pictogram, to better support not …
it-vegard May 7, 2024
72f84a4
Update intro page standard template
it-vegard May 8, 2024
ddd3c89
Merge branch 'main' into feature/template-intropage
it-vegard May 8, 2024
8b4d78e
Update Stack direction type to support reverse order
it-vegard May 8, 2024
32752eb
Add examples for alert and alternative applications. Need to clean up…
it-vegard May 8, 2024
95606a4
Update Aksel examples for intropage
it-vegard May 10, 2024
fe4557d
Rename folder for intropage examples
it-vegard May 10, 2024
ca6ea8a
Use BodyLong instead of BodyShort
it-vegard May 10, 2024
ec7ac24
Add specific examples for intropage
it-vegard May 10, 2024
2534d6b
Style fixes: add gutters to content (like header) and make sure a lon…
it-vegard May 13, 2024
c7f8e51
Update aksel.nav.no/website/pages/templates/soknad-introside/intro-me…
it-vegard May 13, 2024
7242a93
Hide pictogram on the smallest screens, and keep it on the right side…
it-vegard May 13, 2024
eecd4d8
Correct heading level
it-vegard May 13, 2024
fbdc77f
All the content should be inside main
it-vegard May 13, 2024
0246efb
Replace <Box> without any props with regular div's
it-vegard May 13, 2024
67d9c19
Replace "flex: 1" from heading-stack in every layout with flexShrink:…
it-vegard May 13, 2024
288fedc
Hide SVG's from screen readers
it-vegard May 13, 2024
e3867c3
Missing <Show>-element
it-vegard May 13, 2024
30e1632
Keep pictogram on the right until the screen is at least of size "lg"
it-vegard May 13, 2024
f8bfb81
Change the data-aksel-template attribute to allow proper tracking of …
it-vegard May 13, 2024
88a9a4b
Changed texts after feedback from Sjur
it-vegard May 14, 2024
4c0aae7
Legg til meta.json for changelog i form-introside-mappen
it-vegard May 15, 2024
e436c8f
Merge branch 'main' into feature/template-intropage
it-vegard May 15, 2024
47898b5
Use standard padding between content and footer, but increase it to s…
it-vegard May 15, 2024
1f2660d
Remove template from Chromatic. May add templates to Chromatic-build …
it-vegard May 15, 2024
a6aacd5
Merge branch 'main' into feature/template-intropage
it-vegard May 15, 2024
189ba19
Remove unused util for decorator
it-vegard May 15, 2024
fb5f587
Inline decorator-kode in all form intropage templates. Otherwise, the…
it-vegard May 15, 2024
92a5e5e
Inline application pictogram in form intropage templates, so it can b…
it-vegard May 15, 2024
49c87d8
Merge branch 'main' into feature/template-intropage
it-vegard May 15, 2024
5430b35
Remove spacing from BodyLong inside of Accordion
it-vegard May 15, 2024
545a61f
Update aksel.nav.no/website/pages/templates/soknad-introside/intro-me…
it-vegard May 15, 2024
a4e315a
Removed duplicate word
it-vegard May 15, 2024
2a2556c
Added changeset for ds-react and ds-css changes
it-vegard May 15, 2024
e00078d
Update aksel.nav.no/website/pages/templates/soknad-introside-alderspe…
it-vegard May 15, 2024
c28a0dc
Fix alignment and placement in form header
it-vegard May 15, 2024
5ccee65
Move template tracking id further into the code, so it is not exclude…
it-vegard May 15, 2024
4e5125b
Title and other props are unnecessary on ApplicationPictogram, since …
it-vegard May 15, 2024
63eea81
Remove title from single examples (only in folder), since it is not u…
it-vegard May 15, 2024
22fc85a
Align pictogram to the top of the title
it-vegard May 21, 2024
e55e552
Reduce gap between sections from 3rem to 2rem
it-vegard May 21, 2024
8001b34
Merge branch 'main' into feature/template-intropage
it-vegard May 21, 2024
9f4d374
Align pictogram to the top of the title for the rest of the templates
it-vegard May 21, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/breezy-squids-rescue.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@navikt/ds-css": patch
---

Increased padding size for contentBlockPadding on the Page primitive to 4 rem to reflect docs/Figma
5 changes: 5 additions & 0 deletions .changeset/three-shrimps-float.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@navikt/ds-react": patch
---

Added options row-reverse and column-reverse to direction prop on Stack. Should only be used with caution.
2 changes: 1 addition & 1 deletion @navikt/core/css/primitives/page.css
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
}

.navds-page__content--padding {
padding-block-end: var(--a-spacing-8);
padding-block-end: var(--a-spacing-16);
}

.navds-pageblock--text {
Expand Down
4 changes: 3 additions & 1 deletion @navikt/core/react/src/layout/stack/Stack.tsx
it-vegard marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,9 @@ export interface StackProps extends HTMLAttributes<HTMLDivElement> {
* direction='row'
* direction={{xs: 'row', sm: 'column'}}
*/
direction?: ResponsiveProp<"row" | "column">;
direction?: ResponsiveProp<
"row" | "column" | "row-reverse" | "column-reverse"
>;
}

export const Stack: OverridableComponent<StackProps, HTMLDivElement> =
Expand Down
it-vegard marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,314 @@
import { useEffect } from "react";
import { ArrowRightIcon } from "@navikt/aksel-icons";
import {
Accordion,
Bleed,
BodyLong,
BodyShort,
Box,
Button,
Checkbox,
GuidePanel,
Heading,
Link,
List,
Page,
Show,
Stack,
VStack,
} from "@navikt/ds-react";

function Example() {
useDekorator();

return (
<Page data-aksel-template="form-intropage-v1" footer={<Footer />}>
it-vegard marked this conversation as resolved.
Show resolved Hide resolved
<Header />
<VStack as="main" gap="8">
<Page.Block width="text" gutters>
<Bleed marginInline={{ lg: "24" }}>
<Stack
align="center"
gap="6"
direction={{ xs: "row-reverse", lg: "row" }}
justify="start"
wrap={false}
>
<Show above="sm">
<ApplicationPictogram title="Application" />
</Show>
<VStack gap="1">
<BodyShort size="small">NAV 10-07.03 (om relevant)</BodyShort>
<Heading level="1" size="large">
SΓΈknad om arbeidsavklaringspenger (AAP)
</Heading>
</VStack>
</Stack>
</Bleed>
</Page.Block>
<Page.Block width="text" gutters>
<VStack gap="12">
<GuidePanel poster>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ikke lagt merke til tidligere, men skjermelsere leser opp "NAV veileder illustrasjon" nΓ₯r de mΓΈter pΓ₯ guidepanel. BΓΈr illustrasjonen vΓ¦re aria-hidden? (Trengs ikke fikses i denne PR-en hvis det ikke er en Γ₯penbar forbedring)

<Heading level="2" size="medium" spacing>
Hei, Luke Skywalker!
</Heading>
<BodyLong spacing>
Jeg er her for Γ₯ veilede deg gjennom sΓΈknaden. Svarene dine
lagres underveis, slik at du trygt kan gΓ₯ tilbake og endre dem.
</BodyLong>
<BodyLong spacing>
Arbeidsavklaringspenger forkortes ofte med β€œAAP”.
</BodyLong>
<BodyLong>
AAP skal sikre deg inntekt nΓ₯r du pΓ₯ grunn av sykdom eller skade
har behov for Γ₯ fΓ₯ avklart mulighetene dine til Γ₯ jobbe.{" "}
<Link href="#">
Les mer om AAP, hvem som kan sΓΈke og hva du kan fΓ₯ pΓ₯ nav.no
</Link>
.
</BodyLong>
</GuidePanel>
<div>
<Heading level="2" size="large" spacing>
FΓΈr du sΓΈker
</Heading>
<List>
<List.Item>
Vanligvis kan du tidligst fΓ₯ AAP fra den dagen du sΓΈker.
</List.Item>
<List.Item>
Du kan sΓΈke om AAP selv om du ikke har mottatt sykepenger.
</List.Item>
</List>
</div>
<div>
<Accordion>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Accordion leser opp "vis mer" fΓΈr tittel hver gang pΓ₯ grunn av chevron. BΓΈr denne ogsΓ₯ skjules? Skjermlesere fΓ₯r opp "expandable button" og "collapses/expanded" uansett πŸ€” (Trengs ikke fikses i denne PR-en hvis det ikke er en Γ₯penbar forbedring)

<Accordion.Item>
<Accordion.Header>
Informasjon vi henter om deg
</Accordion.Header>
<Accordion.Content>
<BodyLong>
Her skal det sΓ₯ informasjon om hvor vi vil hente
opplysninger om sΓΈkeren og hva slags opplysninger vi
henter.
it-vegard marked this conversation as resolved.
Show resolved Hide resolved
</BodyLong>
</Accordion.Content>
</Accordion.Item>
<Accordion.Item>
<Accordion.Header>
Hvordan vi behandler personopplysninger
</Accordion.Header>
<Accordion.Content>
<BodyLong>
Her skal det stΓ₯ informasjon om hvordan vi behandler
personopplysningene til sΓΈkeren.
</BodyLong>
</Accordion.Content>
</Accordion.Item>
<Accordion.Item>
<Accordion.Header>Automatisk saksbehandling</Accordion.Header>
<Accordion.Content>
<BodyLong>
Her skal det stΓ₯ informasjon om hva automatisk behandling
er, hva det betyr for sΓΈkeren og informasjon om sΓΈkerens
rettigheter ved automatisk avslag.
</BodyLong>
</Accordion.Content>
</Accordion.Item>
<Accordion.Item>
<Accordion.Header>Vi lagrer svar underveis</Accordion.Header>
<Accordion.Content>
<BodyLong>
Her skal det stΓ₯ informasjon om hvordan denne sΓΈknaden
mellomlagrer informasjonen til sΓΈkeren og hvor lenge
informasjonen lagres. Vi skal informere om mellomlagring
ved bΓ₯de automatisk lagring og ved samtykke til lagring
med lagre-knapp.
</BodyLong>
</Accordion.Content>
</Accordion.Item>
</Accordion>
</div>
<div>
<BodyLong>
Det er viktig at du gir oss riktige opplysninger slik at vi kan
behandle saken din.{" "}
<Link href="#gi-riktige-opplysninger">
Les mer om viktigheten av Γ₯ gi riktige opplysninger.
</Link>
</BodyLong>
<Box paddingBlock="4 8">
<Checkbox>
Jeg vil svare sΓ₯ godt jeg kan pΓ₯ spΓΈrsmΓ₯lene i sΓΈknaden.
</Checkbox>
</Box>
<Button
variant="primary"
icon={<ArrowRightIcon aria-hidden />}
iconPosition="right"
>
Start sΓΈknad
</Button>
</div>
</VStack>
</Page.Block>
</VStack>
<Env />
</Page>
);
}

function Header() {
return <div id="decorator-header" />;
}

function Footer() {
return <div id="decorator-footer" />;
}

const MILJO_URL = "https://www.nav.no/dekoratoren";

function Env() {
return (
<div
id="decorator-env"
data-src={`${MILJO_URL}/env?context=privatperson&simple=true&availableLanguages=[{"locale":"nb","url":"https://www.nav.no/person/kontakt-oss"},{"locale":"en","url":"https://www.nav.no/person/kontakt-oss/en/"}]`}
/>
);
}

/**
* OBS: Dette er ikke anbefalt metode for Γ₯ laste dekoratΓΈr!
* Se `nav-dekoratoren`-dokumentasjon for riktig implementasjon
* @see https://github.com/navikt/nav-dekoratoren
*/
function useDekorator() {
useEffect(() => {
const script = document.createElement("script");
script.src = `${MILJO_URL}/client.js`;
script.async = true;
document.body.appendChild(script);

const styles = document.createElement("link");
styles.href = `${MILJO_URL}/css/client.css`;
styles.rel = "stylesheet";
document.head.appendChild(styles);

return () => {
document.body.removeChild(script);
document.head.removeChild(styles);
};
}, []);
}

const ApplicationPictogram = ({ title, ...props }) => (
<svg
xmlns="http://www.w3.org/2000/svg"
width="72"
height="72"
viewBox="0 0 72 72"
fill="none"
style={{ flexShrink: 0 }}
aria-hidden
{...props}
>
<title>{title}</title>
<rect x="23.25" y="22.5" width="26.25" height="9" fill="#CCE2F0" />
<rect x="23.25" y="36.75" width="26.25" height="9" fill="#CCE2F0" />
<circle cx="36.75" cy="34.5" r="21" fill="#CCE2F0" />
<path
d="M23.7672 5.508L30.1202 11.8434M1.5 33.75H34.5M26.4706 2.81211L10.5882 18.6506L9 26.5699L16.9412 24.986L32.8235 9.14751C34.5778 7.39804 34.5778 4.56158 32.8235 2.81211C31.0692 1.06263 28.2249 1.06263 26.4706 2.81211Z"
stroke="#23262A"
strokeWidth="2.25"
strokeLinecap="round"
strokeLinejoin="round"
/>
<path
d="M56.25 44.25L63.75 44.25"
stroke="#262626"
strokeWidth="2.25"
strokeLinecap="round"
strokeLinejoin="round"
/>
<path
d="M56.25 52.5L63.75 52.5"
stroke="#262626"
strokeWidth="2.25"
strokeLinecap="round"
strokeLinejoin="round"
/>
<path
d="M56.25 60.75L63.75 60.75"
stroke="#262626"
strokeWidth="2.25"
strokeLinecap="round"
strokeLinejoin="round"
/>
<path
d="M48 52.5L51 52.5"
stroke="#262626"
strokeWidth="2.25"
strokeLinecap="round"
strokeLinejoin="round"
/>
<path
d="M48 52.5L51 52.5"
stroke="#262626"
strokeWidth="2.25"
strokeLinecap="round"
strokeLinejoin="round"
/>
<path
d="M48 44.25L51 44.25"
stroke="#262626"
strokeWidth="2.25"
strokeLinecap="round"
strokeLinejoin="round"
/>
<path
d="M48 44.25L51 44.25"
stroke="#262626"
strokeWidth="2.25"
strokeLinecap="round"
strokeLinejoin="round"
/>
<path
d="M48 60.75L51 60.75"
stroke="#262626"
strokeWidth="2.25"
strokeLinecap="round"
strokeLinejoin="round"
/>
<path
d="M48 60.75L51 60.75"
stroke="#262626"
strokeWidth="2.25"
strokeLinecap="round"
strokeLinejoin="round"
/>
<rect
x="41.25"
y="33"
width="29.25"
height="37.5"
stroke="#262626"
strokeWidth="2.25"
strokeLinecap="round"
strokeLinejoin="round"
/>
</svg>
);

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

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

export const args = {
index: 1,
title: "Introside AAP",
it-vegard marked this conversation as resolved.
Show resolved Hide resolved
};
Loading
Loading