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

feat(template-pages): added root, page-body and page-layout components to template pages #1096

Merged
merged 6 commits into from
Jan 9, 2025
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
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
3 changes: 3 additions & 0 deletions apps/rhc-templates/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@
"@utrecht/component-library-css": "7.0.0",
"@utrecht/component-library-react": "7.3.7",
"@utrecht/components": "7.4.0",
"@utrecht/page-body-react": "1.0.3",
Rerbun marked this conversation as resolved.
Show resolved Hide resolved
"@utrecht/page-layout-react": "1.0.3",
"@utrecht/root-react": "1.0.3",
"@utrecht/web-component-library-react": "3.0.0",
"eslint": "9.15.0",
"eslint-config-next": "15.0.4",
Expand Down
13 changes: 8 additions & 5 deletions apps/rhc-templates/src/app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,20 @@ import '@rijkshuisstijl-community/design-tokens/dist/index.css';
import '@rijkshuisstijl-community/components-css/dist/index.css';
import '@rijkshuisstijl-community/font/src/index.mjs';
import '@rijkshuisstijl-community/storybook/src/templates/globals.css';
import { PageBody } from '@utrecht/page-body-react';
import { PageLayout } from '@utrecht/page-layout-react';
import { Root } from '@utrecht/root-react';
import Head from 'next/head';

export default function RootLayout({ children }: PropsWithChildren<{}>) {
return (
<html lang="nl">
<Root>
<Head>
Rerbun marked this conversation as resolved.
Show resolved Hide resolved
<title>Rijkshuisstijl demo - Index</title>
</Head>
<body>
<div className="rhc-theme">{children}</div>
</body>
</html>
<PageBody className="rhc-theme">
<PageLayout>{children}</PageLayout>
</PageBody>
</Root>
);
}
15 changes: 14 additions & 1 deletion packages/storybook/config/preview.tsx
Rerbun marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ import { defineCustomElements } from '@rijkshuisstijl-community/web-components-s
import { withThemeByClassName } from '@storybook/addon-themes';
import { Controls, Description, Primary, Stories, useOf } from '@storybook/blocks';
import { Preview } from '@storybook/react';
import { PageBody } from '@utrecht/page-body-react';
import { PageLayout } from '@utrecht/page-layout-react';
import { Root } from '@utrecht/root-react';
import { defineCustomElements as defineUtrechtCustomElements } from '@utrecht/web-component-library-stencil/loader/index';
import { Fragment } from 'react';

Expand All @@ -30,7 +33,17 @@ const preview: Preview = {
},
defaultTheme: 'RijkshuisstijlCommunity',
}),
(Story: any) => Story(),
(Story, options) => {
return options.parameters['isPage'] ? (
<Root Component="div">
<PageBody>
<PageLayout>{Story()}</PageLayout>
</PageBody>
</Root>
) : (
Story()
);
},
],
parameters: {
previewTabs: {
Expand Down
3 changes: 3 additions & 0 deletions packages/storybook/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,9 @@
"@types/twig": "1.12.16",
"@utrecht/component-library-react": "8.0.4",
"@utrecht/components": "7.4.0",
"@utrecht/page-body-react": "1.0.3",
"@utrecht/page-layout-react": "1.0.3",
"@utrecht/root-react": "1.0.3",
"@utrecht/web-component-library-react": "3.0.2",
"@utrecht/web-component-library-stencil": "3.0.1",
"@whitespace/storybook-addon-html": "6.1.1",
Expand Down
3 changes: 3 additions & 0 deletions packages/storybook/src/community/page-header.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ const meta = {
component: mergeMarkdown([readme]),
},
},
// TODO: add Figma, GitHub and NL DesignSystem links
componentOrigin:
'Dit component is overgenomen van de Gemeente Utrecht, voor dit component zijn (nog) geen specifieke design tokens gedefinieerd.',
},
} satisfies Meta<typeof PageHeader>;

Expand Down
1 change: 1 addition & 0 deletions packages/storybook/src/templates/collage.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ const meta: Meta = {
status: {
type: 'UNSTABLE',
},
isPage: true,
Rerbun marked this conversation as resolved.
Show resolved Hide resolved
},
};
export default meta;
Expand Down
30 changes: 14 additions & 16 deletions packages/storybook/src/templates/collage/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,22 +42,20 @@ import { IconArrowRight, IconCalendarEvent } from '@tabler/icons-react/dist/esm/
export default function Collage() {
return (
<>
<div className="rhc-templates-background-color-white">
<PageHeader>
<Logo organisation="Rijkshuisstijl Community">
<Icon className={'dutch-map'} icon={'nederland-map'} />
</Logo>
</PageHeader>
</div>
<NavBar
items={[
{ id: '1', href: '/', label: 'Rich Text' },
{ id: '2', href: '/form', label: 'Form' },
{ id: '3', href: '/details', label: 'Details' },
{ id: '4', href: '/collage', label: 'Collage' },
{ id: '5', href: '/mijn-omgeving', label: 'Mijn Omgeving' },
]}
></NavBar>
<PageHeader>
<Logo organisation="Rijkshuisstijl Community">
<Icon className={'dutch-map'} icon={'nederland-map'} />
</Logo>
<NavBar
items={[
{ id: '1', href: '/', label: 'Rich Text' },
{ id: '2', href: '/form', label: 'Form' },
{ id: '3', href: '/details', label: 'Details' },
{ id: '4', href: '/collage', label: 'Collage' },
{ id: '5', href: '/mijn-omgeving', label: 'Mijn Omgeving' },
]}
></NavBar>
</PageHeader>
<main className="rhc-templates-page">
Rerbun marked this conversation as resolved.
Show resolved Hide resolved
<div className="rhc-templates-background-color-white">
<div className="rhc-templates-main-content">
Expand Down
1 change: 1 addition & 0 deletions packages/storybook/src/templates/details.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ const meta: Meta = {
status: {
type: 'UNSTABLE',
},
isPage: true,
},
};
export default meta;
Expand Down
30 changes: 14 additions & 16 deletions packages/storybook/src/templates/details/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,22 +20,20 @@ import { ColumnLayout } from '@utrecht/component-library-react';
export default function Details() {
return (
<>
<div className="rhc-templates-background-color-white">
<PageHeader>
<Logo organisation="Rijkshuisstijl Community">
<Icon className={'dutch-map'} icon={'nederland-map'} />
</Logo>
</PageHeader>
</div>
<NavBar
items={[
{ id: '1', href: '/', label: 'Rich Text' },
{ id: '2', href: '/form', label: 'Form' },
{ id: '3', href: '/details', label: 'Details' },
{ id: '4', href: '/collage', label: 'Collage' },
{ id: '5', href: '/mijn-omgeving', label: 'Mijn Omgeving' },
]}
></NavBar>
<PageHeader>
<Logo organisation="Rijkshuisstijl Community">
<Icon className={'dutch-map'} icon={'nederland-map'} />
</Logo>
<NavBar
items={[
{ id: '1', href: '/', label: 'Rich Text' },
{ id: '2', href: '/form', label: 'Form' },
{ id: '3', href: '/details', label: 'Details' },
{ id: '4', href: '/collage', label: 'Collage' },
{ id: '5', href: '/mijn-omgeving', label: 'Mijn Omgeving' },
]}
></NavBar>
</PageHeader>
<div className="rhc-templates-page">
Rerbun marked this conversation as resolved.
Show resolved Hide resolved
<Hero
className="rhc-hero-details-template"
Expand Down
1 change: 1 addition & 0 deletions packages/storybook/src/templates/form.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ const meta: Meta = {
status: {
type: 'UNSTABLE',
},
isPage: true,
},
};
export default meta;
Expand Down
32 changes: 15 additions & 17 deletions packages/storybook/src/templates/form/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,23 +27,21 @@ import {
export default function Form() {
return (
<>
<div className="rhc-templates-background-color-white">
<PageHeader>
<Logo organisation="Rijkshuisstijl Community">
<Icon className={'dutch-map'} icon={'nederland-map'} />
</Logo>
</PageHeader>
</div>
<NavBar
aria-label="navbar-label"
items={[
{ id: '1', href: '/', label: 'Rich Text' },
{ id: '2', href: '/form', label: 'Form' },
{ id: '3', href: '/details', label: 'Details' },
{ id: '4', href: '/collage', label: 'Collage' },
{ id: '5', href: '/mijn-omgeving', label: 'Mijn Omgeving' },
]}
></NavBar>
<PageHeader>
<Logo organisation="Rijkshuisstijl Community">
<Icon className={'dutch-map'} icon={'nederland-map'} />
</Logo>
<NavBar
aria-label="navbar-label"
items={[
{ id: '1', href: '/', label: 'Rich Text' },
{ id: '2', href: '/form', label: 'Form' },
{ id: '3', href: '/details', label: 'Details' },
{ id: '4', href: '/collage', label: 'Collage' },
{ id: '5', href: '/mijn-omgeving', label: 'Mijn Omgeving' },
]}
></NavBar>
</PageHeader>
<main className="rhc-templates-page">
<div className="rhc-templates-background-color-white rhc-templates-main-content">
<PageContent className="rhc-templates-page-content rhc-templates-background-color-white">
Expand Down
1 change: 1 addition & 0 deletions packages/storybook/src/templates/mijn-omgeving.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ const meta = {
status: {
type: 'UNSTABLE',
},
isPage: true,
},
} satisfies Meta<typeof MijnOmgeving>;

Expand Down
30 changes: 14 additions & 16 deletions packages/storybook/src/templates/mijn-omgeving/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,22 +25,20 @@ import {
export default function MijnOmgeving() {
return (
<>
<div className="">
<PageHeader>
<Logo organisation="Rijkshuisstijl Community">
<Icon className={'dutch-map'} icon={'nederland-map'} />
</Logo>
</PageHeader>
</div>
<NavBar
items={[
{ id: '1', href: '/', label: 'Rich Text' },
{ id: '2', href: '/form', label: 'Form' },
{ id: '3', href: '/details', label: 'Details' },
{ id: '4', href: '/collage', label: 'Collage' },
{ id: '5', href: '/mijn-omgeving', label: 'Mijn Omgeving' },
]}
></NavBar>
<PageHeader>
<Logo organisation="Rijkshuisstijl Community">
<Icon className={'dutch-map'} icon={'nederland-map'} />
</Logo>
<NavBar
items={[
{ id: '1', href: '/', label: 'Rich Text' },
{ id: '2', href: '/form', label: 'Form' },
{ id: '3', href: '/details', label: 'Details' },
{ id: '4', href: '/collage', label: 'Collage' },
{ id: '5', href: '/mijn-omgeving', label: 'Mijn Omgeving' },
]}
></NavBar>
</PageHeader>
<main className="rhc-templates-page rhc-templates-background-color-white">
<PageContent className="rhc-templates-page-container">
<SideNav className={'rhc-side-nav'}>
Expand Down
1 change: 1 addition & 0 deletions packages/storybook/src/templates/rich-text.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ const meta: Meta = {
status: {
type: 'UNSTABLE',
},
isPage: true,
},
};
export default meta;
Expand Down
30 changes: 14 additions & 16 deletions packages/storybook/src/templates/rich-text/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,22 +36,20 @@ import {
export default function Page() {
return (
<>
<div className="rhc-templates-background-color-white">
<PageHeader>
<Logo organisation="Rijkshuisstijl Community">
<Icon className={'dutch-map'} icon={'nederland-map'} />
</Logo>
</PageHeader>
</div>
<NavBar
items={[
{ id: '1', href: '/', label: 'Rich Text' },
{ id: '2', href: '/form', label: 'Form' },
{ id: '3', href: '/details', label: 'Details' },
{ id: '4', href: '/collage', label: 'Collage' },
{ id: '5', href: '/mijn-omgeving', label: 'Mijn Omgeving' },
]}
></NavBar>
<PageHeader>
<Logo organisation="Rijkshuisstijl Community">
<Icon className={'dutch-map'} icon={'nederland-map'} />
</Logo>
<NavBar
items={[
{ id: '1', href: '/', label: 'Rich Text' },
{ id: '2', href: '/form', label: 'Form' },
{ id: '3', href: '/details', label: 'Details' },
{ id: '4', href: '/collage', label: 'Collage' },
{ id: '5', href: '/mijn-omgeving', label: 'Mijn Omgeving' },
]}
></NavBar>
</PageHeader>
<main className="rhc-templates-page">
<div className="rhc-templates-main-content">
<PageContent className="rhc-templates-page-content rhc-templates-background-color-white">
Expand Down
Loading
Loading