Skip to content

Commit 00b1234

Browse files
intial whats new component
1 parent 86b6f96 commit 00b1234

File tree

5 files changed

+709
-2
lines changed

5 files changed

+709
-2
lines changed
Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
<script lang="ts">
2+
// Define types for news items
3+
interface NewsItem {
4+
date: string;
5+
content: string;
6+
releaseNotesUrl?: string;
7+
releaseVersion?: string;
8+
componentLinks?: Array<{
9+
text: string;
10+
href: string;
11+
}>;
12+
}
13+
14+
// Define component props with types and default values
15+
let {
16+
title = "What's new",
17+
titleId = "whats-new",
18+
componentLinksIntroText = "This the first step to refresh the GOV.UK brand. It includes updates to the:",
19+
newsItems = [
20+
{
21+
date: "15 May 2025",
22+
content:
23+
"We released GOV.UK Frontend v5.10.1 with the correct colour for the dot in the refreshed GOV.UK logo, as well as small fixes to the implementation of the brand refresh.",
24+
releaseNotesUrl:
25+
"https://github.com/alphagov/govuk-frontend/releases/tag/v5.10.1",
26+
releaseVersion: "v5.10.1",
27+
},
28+
{
29+
date: "1 May 2025",
30+
content: "We released GOV.UK Frontend v5.10.0.",
31+
releaseNotesUrl:
32+
"https://github.com/alphagov/govuk-frontend/releases/tag/v5.10.0",
33+
releaseVersion: "v5.10.0",
34+
componentLinks: [
35+
{ text: "GOV.UK header component", href: "/components/header/" },
36+
{ text: "GOV.UK footer component", href: "/components/footer/" },
37+
{
38+
text: "Service navigation component",
39+
href: "/components/service-navigation/",
40+
},
41+
{
42+
text: "Cookie banner component",
43+
href: "/components/cookie-banner/",
44+
},
45+
],
46+
},
47+
] as NewsItem[],
48+
} = $props<{
49+
title?: string;
50+
titleId?: string;
51+
componentLinksIntroText?: string;
52+
newsItems?: NewsItem[];
53+
}>();
54+
</script>
55+
56+
<div class="app-whats-new">
57+
<div class="govuk-width-container">
58+
<div class="govuk-main-wrapper govuk-main-wrapper--l">
59+
<div class="govuk-grid-row">
60+
<div class="govuk-grid-column-two-thirds-from-desktop">
61+
<h2 id={titleId} class="govuk-heading-l">{title}</h2>
62+
63+
{#each newsItems as item, index}
64+
<p class="govuk-body">
65+
<strong>{item.date}:</strong>
66+
{item.content}
67+
</p>
68+
69+
{#if item.releaseNotesUrl && item.releaseVersion}
70+
<p class="govuk-body">
71+
Read the <a href={item.releaseNotesUrl} class="govuk-link"
72+
>release notes for {item.releaseVersion}</a
73+
> to see what's changed.
74+
</p>
75+
{/if}
76+
77+
{#if item.componentLinks && item.componentLinks.length > 0}
78+
<p class="govuk-body">
79+
{componentLinksIntroText}
80+
</p>
81+
<ul class="govuk-list govuk-list--bullet">
82+
{#each item.componentLinks as link}
83+
<li>
84+
<a href={link.href} class="govuk-link">{link.text}</a>
85+
</li>
86+
{/each}
87+
</ul>
88+
{/if}
89+
{/each}
90+
</div>
91+
</div>
92+
</div>
93+
</div>
94+
</div>
95+
96+
<style>
97+
.app-whats-new {
98+
border-bottom: 1px solid #b1b4b6;
99+
background-color: #f8f8f8;
100+
}
101+
</style>

src/routes/+page.svelte

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
import DividerLine from "$lib/package-wrapping/DividerLine.svelte";
33
import Masthead from "$lib/components/ui/Masthead.svelte";
44
import mastheadIllustration from "$lib/assets/images/masthead-illustration.svg";
5+
import WhatsNew from "$lib/components/ui/WhatsNew.svelte";
56
67
// Keep only playground wrappers for the homepage
78
const wrappersPlaygroundsObject = import.meta.glob(
@@ -48,6 +49,25 @@ TODO
4849
imageSrc={mastheadIllustration}
4950
imageAlt="MHCLG Svelte Component Library"
5051
/>
52+
<WhatsNew
53+
title="What's new"
54+
componentLinksIntroText="This initial alpha release includes foundational components for building government services."
55+
newsItems={[
56+
{
57+
date: "June 2025",
58+
content:
59+
"We launched the MHCLG Svelte Component Library alpha version. This library provides Svelte 5 implementations of GOV.UK Design System components, as well as other custom components, specifically tailored for data-rich digital products and services within the Ministry of Housing, Communities and Local Government and beyond.",
60+
releaseNotesUrl:
61+
"https://github.com/communitiesuk/oflog_svelte_component_library/releases/tag/v0.1.16",
62+
releaseVersion: "v0.1.16",
63+
},
64+
{
65+
date: "January 2025",
66+
content:
67+
"Development began on the component library infrastructure, establishing the foundation for reusable Svelte components that maintain GOV.UK Design System compliance while supporting advanced data visualisation needs.",
68+
},
69+
]}
70+
/>
5171

5272
<div class="govuk-width-container govuk-main-wrapper govuk-main-wrapper--l">
5373
<div class="flex flex-col gap-6">
@@ -79,15 +99,15 @@ TODO
7999
<DividerLine margin="1rem 0rem"></DividerLine>
80100
</div>
81101

82-
<div>
102+
<!-- <div>
83103
<h2 class="govuk-heading-l mb-6 mt-10">Playground</h2>
84104
<p class="govuk-body">
85105
The playground is a sandbox space where developers can test code and
86106
practice combining components.
87107
</p>
88108
<p class="govuk-body">All our playground examples are listed below.</p>
89109
</div>
90-
<DividerLine margin="1rem 0rem"></DividerLine>
110+
<DividerLine margin="1rem 0rem"></DividerLine> -->
91111
</div>
92112
</div>
93113
</div>

0 commit comments

Comments
 (0)