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

Drawer scroll list #255

Draft
wants to merge 52 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
52 commits
Select commit Hold shift + click to select a range
13dacf9
✨ new page for drawer voorbeeld added
scar055 Oct 25, 2023
34396bd
🎨 de drawer acrodion list gemaakt
scar055 Oct 26, 2023
7aac0d8
💄 added css file
scar055 Oct 26, 2023
5c76a51
💄 css file added
scar055 Oct 26, 2023
62de437
💄 class added
scar055 Oct 26, 2023
1016df9
💄 add sticky header styling
scar055 Oct 26, 2023
de210bc
🚚 moved css to styles map
scar055 Oct 26, 2023
24d766b
💄 add new erfgoed file
scar055 Oct 26, 2023
7c49d57
🚚 erfgoed naar mapje ergoed verplaast en renamed
scar055 Oct 30, 2023
0256a6e
🎨 css link changed to styles map | Co-authored-by: savitris <savitris…
scar055 Oct 30, 2023
2da9516
💄 add list with items | Co-authored-by: savitris <[email protected]
scar055 Oct 30, 2023
cf9e3d1
🔥 made list shorter | Co-authored-by: savitris <[email protected]
scar055 Oct 30, 2023
1a57848
✨ add image
scar055 Oct 30, 2023
a2da055
💄 second drawer added
scar055 Oct 30, 2023
c73cafb
✨ href to other drawer linked
scar055 Oct 30, 2023
5c90ba2
🚚 class renamed
scar055 Oct 31, 2023
9777e94
♻️ pageheader to header changed
scar055 Oct 31, 2023
44c611f
♻️ changed button link to link
scar055 Oct 31, 2023
136f018
♻️ unorderd list and unorderd list item to ul and li changed
scar055 Oct 31, 2023
22d3aaa
💄 list style deleted
scar055 Oct 31, 2023
79218e8
🔥 deleted import heading5 Co-authored-by: savitris <[email protected]
scar055 Oct 31, 2023
d73b951
♻️ duitsebommen werper naar goede werkende image veranderd Co-authore…
scar055 Oct 31, 2023
61bb8ad
✨ added new svgs
scar055 Oct 31, 2023
a682d8d
🚚 renamed class
scar055 Oct 31, 2023
4fd427c
💄 second drawer styled
scar055 Oct 31, 2023
50b50ec
💄 added cross to first drawer
scar055 Oct 31, 2023
a6fb981
💄 css geschreven zodat de id die start lijn 16 het dan die style heeft
scar055 Oct 31, 2023
adc6492
💄 2e drawer gemaakt
scar055 Oct 31, 2023
e252400
💄 spacing for list and items
scar055 Oct 31, 2023
66b9e7d
🎨 put data form link in an array
scar055 Oct 31, 2023
7a2ce48
✨ button added to open the first drawer
scar055 Nov 1, 2023
e8afced
✨ close button for drawer added
scar055 Nov 1, 2023
a913c3b
✨ close all function added for drawers
scar055 Nov 1, 2023
93d6db6
🚚 changed draweropen to erf open
scar055 Nov 1, 2023
6e09e2c
✨ close erfopen function added
scar055 Nov 1, 2023
b4fc0b3
💄 removed id check for block style
scar055 Nov 1, 2023
5255d4f
✨ de data word nu ingeladen per id
scar055 Nov 2, 2023
e401718
🎨 add forgotten class name
savitris Nov 3, 2023
4fb9ea1
🔥 removed unused component import
savitris Nov 3, 2023
b1bd8b1
⬆️ updated library for Drawer component import
savitris Nov 3, 2023
0aefeff
♻️ Replaced Document with Page component
savitris Nov 3, 2023
0a0be41
🎨 Added BEM classes for clarity
savitris Nov 3, 2023
b59e94a
🎨 Added missing class
savitris Nov 3, 2023
87bbd37
💄 Replaced closing icon with Kruisje
savitris Nov 3, 2023
3a0987d
💄 Fixed layout of drawer header
savitris Nov 3, 2023
bc1d9a0
💄 adding styling
savitris Nov 3, 2023
4d42a02
💄 fixed image rendering
savitris Nov 3, 2023
ce1d79c
🔥 remove unused images
savitris Nov 6, 2023
255576c
🚚 moved image to public map
scar055 Nov 7, 2023
168c3d9
✨ new image to public added
scar055 Nov 7, 2023
2c07a42
🎨 changed scr that link is in array in image
scar055 Nov 7, 2023
ca2c68e
🎨 aria-labels added
scar055 Nov 7, 2023
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
2 changes: 1 addition & 1 deletion packages/next-templates/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"@nl-design-system-unstable/voorbeeld-design-tokens": "1.0.0-alpha.96",
"@svgr/webpack": "8.1.0",
"@utrecht/component-library-css": "1.0.0-alpha.597",
"@utrecht/component-library-react": "1.0.0-alpha.406",
"@utrecht/component-library-react": "1.0.0-alpha.413",
"@utrecht/design-tokens": "1.0.0-alpha.590",
"@utrecht/web-component-library-react": "1.0.0-alpha.596",
"@utrecht/web-component-library-stencil": "1.0.0-alpha.596",
Expand Down
Binary file removed packages/next-templates/public/business_corgi.jpeg
Binary file not shown.
Binary file added packages/next-templates/public/duitsebommer.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added packages/next-templates/public/werf.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
166 changes: 166 additions & 0 deletions packages/next-templates/src/app/drawer-scroll-list/erfgoed/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,166 @@
'use client';
import { Article, Button, DataList, Drawer, Heading3, Link, Page, Paragraph } from '@utrecht/component-library-react';
import '../styles/drawer-scroll-list.css';
import Image from 'next/image';
import BackArrow from '../pijltje-rechts.svg';
import Kruisje from '../kruisje.svg';
import { useState } from 'react';

const linkData = [
{ id: 'duitse_bommenwerper', href: '#voorbeeld--button-drawer', content: 'Duitse bommenwerper' },
{ id: 'werf', href: '#voorbeeld--button-drawer2', content: 'Werk aan de werf' },
{ id: 'vredebrug', href: '#', content: 'Bouw en sloop van kasteel Vredenburg' },
{ id: 'cecilianklooster', href: '#', content: 'Ceciliaklooster' },
{ id: 'middeleeuse-stadsmuur', href: '#', content: 'Middeleeuwse stadsmuur' },
{ id: 'rijmvliet', href: '#', content: 'Oude tempel in Rijnvliet?' },
{ id: 'dorp-aan-rivier', href: '#', content: 'Dorp aan de rivier' },
{ id: 'romeinse-wachttoren', href: '#', content: 'Romeinse wachttorens' },
{ id: 'blauwkapel', href: '#', content: 'Kerkje van Blauwkapel' },
{ id: 'utrechtse-werven', href: '#', content: 'De Utrechtse werven' },
{ id: 'domplein', href: '#', content: 'Domplein' },
{ id: 'haardkuil-steentijd', href: '#', content: 'Haardkuil uit de oude steentijd' },
{ id: 'janskerkhof', href: '#', content: 'Janskerkhof' },
{ id: 'sterrenburg', href: '#', content: 'Bijlhouwerstoren en Sterrenburg' },
{ id: 'natuur', href: '#', content: 'Natuur op de forten' },
{ id: 'buurtoren', href: '#', content: 'Buurtoren' },
{ id: 'plompetorengracht', href: '#', content: 'Rondom de Plompetorengracht' },
{ id: 'herderplein', href: '#', content: 'Herderplein in buurt Halve Maan' },
{ id: 'kamp', href: '#', content: 'Rondom de Nieuwe Kamp' },
{ id: 'kanunniken', href: '#', content: 'Kanunniken te paard?' },
{ id: 'paulusabdij', href: '#', content: 'Paulusabdij' },
];

const drawerData = [
[
{
title: 'Duitse Bommenwerper',
info: 'Utrechtse archeologen onderzochten in 2010 een neergestorte Duitse bommenwerper. Lees was ze ontdekte overhet vliegtuig.',
linkHref: 'https://erfgoed.utrecht.nl/verhalen/duitse-bommenwerper/',
period: 'Moderne tijd',
theme: 'Archeologie',
tags: 'Oorlog en verdediging',
href: '/duitsebommer.jpg',
},
],
[
{
title: 'Werk aan de werf',
info: 'Utrecht staat bekend om zijn werven en werfkelders. De eigenaren van de grachtenpanden moesten deze vroeger onderhouden. In de 20e eeuw raakten de werven in verval. Toen nam de gemeente Utrecht het eigendom van de werfmuren en kades over. Verschillende restauratierondes volgden.',
linkHref: 'https://erfgoed.utrecht.nl/verhalen/werk-aan-de-werf/',
period: 'Moderne tijd',
theme: 'Gebouwen',
tags: 'Woningbouw',
href: '/werf.jpg',
},
],
];

export default function Home() {
const [open, setOpen] = useState(false);
const [erfopen, setErfopen] = useState(false);
const [place, setPlace] = useState(0);

function addOpen() {
setOpen(true);
}

function closeOpen() {
setOpen(false);
}

function closeAll() {
setOpen(false);
setErfopen(false);
}

function openErfOpen(data: string) {
setErfopen(true);
setPlace(itemSelection(data));
}

function closeErfOpen() {
setErfopen(false);
}

function itemSelection(id: string) {
if (id !== undefined) {
return linkData.findIndex((obj) => obj.id === id);
} else {
setErfopen(false);
return 0;
}
}
return (
<Page>
<Button onClick={addOpen}>open drawer</Button>
<Drawer className="voorbeeld-drawer voorbeeld-drawer--erfgoed-drawer" open={open}>
<header aria-label="header-list-erfgoed" className="voorbeeld-drawer__header voorbeeld-drawer__header--sticky">
<Heading3>Erfgoed</Heading3>
<Button aria-label="sluit" onClick={closeOpen}>
<Kruisje />
</Button>
</header>

<div className="voorbeeld-drawer__body">
<ul className="voorbeeld--unorderedlist-lijst">
{linkData.map(({ id, href, content }) => (
<li>
<Link onClick={() => openErfOpen(id)} id={id} href={href}>
{content}
</Link>
</li>
))}
</ul>
</div>
</Drawer>

<Drawer className="voorbeeld-drawer voorbeeld-drawer--button-drawer" open={erfopen}>
<header aria-label="header-erfgoed" className="voorbeeld-drawer__header voorbeeld-drawer__header--sticky">
<Button onClick={closeErfOpen} className="voorbeeld-drawer__button-back" aria-label="terug">
<BackArrow />
</Button>
<Button onClick={closeAll} className="voorbeeld-drawer__button-close" aria-label="sluit">
<Kruisje />
</Button>
</header>
{drawerData[place].map(({ title, info, linkHref, period, theme, tags, href }) => (
<Article>
<div className="voorbeeld-drawer__image">
<Image
alt="Duitse Bommenwerper in de lucht tijdens de tweede wereldoorlog"
src={href}
width={1080}
height={419}
/>
</div>
<div className="voorbeeld-drawer__body voorbeeld-drawer__body--details">
<Heading3>{title}</Heading3>
<Paragraph>{info}</Paragraph>
<div>
<Link className="links" href={linkHref}>
Lees het verhaal op de site
</Link>
</div>
<div className="voorbeeld-drawer__datalist">
<DataList>
<div>
<dt>Period</dt>
<dd>{period}</dd>
</div>
<div>
<dt>Thema</dt>
<dd>{theme}</dd>
</div>
<div>
<dt>Tags</dt>
<dd>{tags}</dd>
</div>
</DataList>
</div>
</div>
</Article>
))}
</Drawer>
</Page>
);
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
106 changes: 106 additions & 0 deletions packages/next-templates/src/app/drawer-scroll-list/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
'use client';
import {
AccordionProvider,
Button,
Checkbox,
Document,
Drawer,
FormField,
FormLabel,
Heading3,
} from '@utrecht/component-library-react';
import './styles/drawer-scroll-list.css';

import Kruisje from './kruisje.svg';

const period = [
{ label: 'Late middeleeuwen', value: 'Late middeleeuwen' },
{ label: 'Moderne tijd', value: 'Moderne tijd' },
{ label: 'Prehistorie', value: 'Prehistorie' },
{ label: 'Romeinse tijd', value: 'Romeinse tijd' },
{ label: 'Vroege middeleeuwen', value: 'Vroege middeleeuwen' },
{ label: 'Vroegmoderne tijd', value: 'Vroegmoderne tijd' },
];

const theme = [
{ label: '3D-reconstructies en animaties', value: '3D-reconstruction' },
{ label: 'Archeologie', value: 'Archeologie' },
{ label: 'Gebouwen', value: 'Gebouwen' },
{ label: 'Oorlog en verdediging', value: 'Oorlog en verdediging' },
{ label: 'Stedenbouw en groen', value: 'Stedenbouw en groen' },
{ label: 'Werelderfgoed', value: 'Werelderfgoed' },
];

const tags = [
{ label: 'Handel ambacht en industrie', value: 'Handel ambacht en industrie' },
{ label: 'Landbouw veeteelt en visserij', value: 'Landbouw veeteelt en visserij' },
{ label: 'Maritiem erfgoed', value: 'Maritiem erfgoed' },
{ label: 'Moreelse route', value: 'Moreelse route' },
{ label: 'Nieuwe hollandse waterlinie', value: 'Nieuwe hollandse waterlinie' },
{ label: 'Oorlog en verdediging', value: 'Oorlog en verdediging' },
{ label: 'Parken', value: 'Parken' },
{ label: 'Religieus erfgoed', value: 'Religieus erfgoed' },
{ label: 'Romeinse limes', value: 'Romeinse limes' },
{ label: 'Woningbouw', value: 'Woningbouw' },
];

export default function Home() {
return (
<Document>
<Drawer className="voorbeeld-drawer" open>
<header className="voorbeeld-drawer__header voorbeeld-drawer__header--sticky">
<Heading3>Verfijn resultaten</Heading3>
<Button className="voorbeeld-drawer__button-close" aria-label="sluit">
<Kruisje />
</Button>
</header>
<AccordionProvider
sections={[
{
body: (
<div>
{period.map(({ label, value }) => (
<FormField>
<Checkbox value={value} />
<FormLabel>{label}</FormLabel>
</FormField>
))}
</div>
),
expanded: true,
label: 'periode',
},
{
body: (
<div>
{theme.map(({ label, value }) => (
<FormField>
<Checkbox value={value} />
<FormLabel>{label}</FormLabel>
</FormField>
))}
</div>
),
expanded: true,
label: 'Thema',
},
{
body: (
<div>
{tags.map(({ label, value }) => (
<FormField>
<Checkbox value={value} />
<FormLabel>{label}</FormLabel>
</FormField>
))}
</div>
),
expanded: true,
label: 'Tags',
},
]}
/>
</Drawer>
</Document>
);
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
:root {
/* How do we get this from the design system? */
--utrecht-drawer-max-inline-size: 400px;
}

.voorbeeld-theme {
background: skyblue;
}

.voorbeeld-drawer {
inline-size: 100%;
max-inline-size: 400px;
/* this is where general styling goes for the drawer, like a shadow on the whole thing */
}

.voorbeeld-drawer--erfgoed-drawer {
/* this is the exceptions for the Erfgoed drawer */
}

.voorbeeld-drawer__header {
display: flex;
justify-content: space-between;
background-color: white;
border-bottom: 1px solid grey;
padding: 2em;
}

.voorbeeld-drawer__header :is(h2, h3, h4, h5, h6) {
align-self: center;
}

.voorbeeld-drawer__header--sticky {
position: sticky;
top: 0;
}

.voorbeeld--unorderedlist-lijst {
list-style: none;
padding: 0;
margin: 0;
}
/*
.voorbeeld--unorderedlist-lijst li {
margin-block: 12px;
} */

.voorbeeld--unorderedlist-lijst a {
border-bottom: 1px solid grey;

padding: 12px 2em;
display: block;
}

.voorbeeld-drawer__button-update {
/* */
}

.voorbeeld-drawer__button-close {
/* */
}

.voorbeeld-drawer__image img {
width: 100%;
height: auto;
}

.voorbeeld-drawer__body {
/* */
}

.voorbeeld-drawer__body--details {
padding: 2em;
}

.voorbeeld-drawer__datalist {
/* */
}

/* to hide all the unclickable links */
a[href="#"] {
display: none;
/* opacity: 0.3; */
}

.utrecht-button {
background-color: #ffb8ff;
}

.utrecht-page {
padding: 2em;
}

.utrecht-data-list {
margin-top: 2em;
}

.utrecht-data-list dt {
font-weight: bold;
}

.utrecht-data-list dd {
margin-left: 0;
}
Loading
Loading