diff --git a/.changeset/clean-boats-float.md b/.changeset/clean-boats-float.md new file mode 100644 index 00000000000..8f586c5d48e --- /dev/null +++ b/.changeset/clean-boats-float.md @@ -0,0 +1,5 @@ +--- +"@utrecht/web-component-library-stencil": minor +--- + +Add Top Task Navigation and Top Task Link web components. diff --git a/packages/storybook-web-component/package.json b/packages/storybook-web-component/package.json index 6e42437bd05..f3606059cab 100644 --- a/packages/storybook-web-component/package.json +++ b/packages/storybook-web-component/package.json @@ -108,6 +108,8 @@ "@utrecht/table-css": "workspace:*", "@utrecht/textarea-css": "workspace:*", "@utrecht/textbox-css": "workspace:*", + "@utrecht/top-task-nav-css": "workspace:*", + "@utrecht/top-task-link-css": "workspace:*", "@utrecht/url-data-css": "workspace:*", "@utrecht/web-component-library-angular": "workspace:*", "@utrecht/web-component-library-react": "workspace:*", diff --git a/packages/storybook-web-component/src/TopTaskNav.stories.tsx b/packages/storybook-web-component/src/TopTaskNav.stories.tsx new file mode 100644 index 00000000000..163e915a0a6 --- /dev/null +++ b/packages/storybook-web-component/src/TopTaskNav.stories.tsx @@ -0,0 +1,83 @@ +/* @license CC0-1.0 */ + +import type { Meta, StoryObj } from '@storybook/react'; +import tokens from '@utrecht/design-tokens/dist/index.json'; +import tokensDefinition from '@utrecht/top-task-link-css/src/tokens.json'; +import readme from '@utrecht/top-task-nav-css/README.md?raw'; +import { + UtrechtIconAfvalScheiden, + UtrechtIconMeldingKlacht, + UtrechtIconNummerbord, + UtrechtIconRijbewijs, + UtrechtIconVerhuizen, + UtrechtIconWerken, + UtrechtTopTaskLink, + UtrechtTopTaskNav, +} from '@utrecht/web-component-library-react'; +import React from 'react'; +import { designTokenStory } from './design-token-story'; + +const meta = { + title: 'Web Component/Top Task Navigation', + id: 'web-component-top-task-nav', + component: UtrechtTopTaskNav, + argTypes: { + children: { + description: 'Content of the Top Task Navigation', + }, + }, + args: { + children: [], + }, + tags: ['autodocs'], + parameters: { + status: { + type: 'WORK IN PROGRESS', + }, + tokensPrefix: 'utrecht-top-task-link', + tokens, + tokensDefinition, + docs: { + description: { + component: readme, + }, + }, + }, +} satisfies Meta; + +export default meta; + +type Story = StoryObj; + +export const Default: Story = { + args: { + children: [ + + + Paspoort of ID-kaart aanvragen + , + + + Melding/klacht openbare ruimte doorgeven + , + + + Verhuizing doorgeven + , + + + Werken bij de gemeente + , + + + Parkeren: kentekenwijziging doorgeven + , + + + Afval + , + ], + }, +}; + +export const DesignTokens = designTokenStory(meta); diff --git a/packages/web-component-library-stencil/package.json b/packages/web-component-library-stencil/package.json index c63d64dacb8..3fadebf9cd9 100644 --- a/packages/web-component-library-stencil/package.json +++ b/packages/web-component-library-stencil/package.json @@ -113,6 +113,8 @@ "@utrecht/table-css": "workspace:*", "@utrecht/textarea-css": "workspace:*", "@utrecht/textbox-css": "workspace:*", + "@utrecht/top-task-link-css": "workspace:*", + "@utrecht/top-task-nav-css": "workspace:*", "@utrecht/unordered-list-css": "workspace:*", "@utrecht/url-data-css": "workspace:*", "chokidar-cli": "3.0.0", diff --git a/packages/web-component-library-stencil/src/components.d.ts b/packages/web-component-library-stencil/src/components.d.ts index f9d725bc425..012f131103d 100644 --- a/packages/web-component-library-stencil/src/components.d.ts +++ b/packages/web-component-library-stencil/src/components.d.ts @@ -794,6 +794,13 @@ export namespace Components { "type": string; "value": string; } + interface UtrechtTopTaskLink { + "external"?: boolean; + "href": string; + "target"?: string; + } + interface UtrechtTopTaskNav { + } interface UtrechtUrlData { } } @@ -2763,6 +2770,18 @@ declare global { prototype: HTMLUtrechtTextboxElement; new (): HTMLUtrechtTextboxElement; }; + interface HTMLUtrechtTopTaskLinkElement extends Components.UtrechtTopTaskLink, HTMLStencilElement { + } + var HTMLUtrechtTopTaskLinkElement: { + prototype: HTMLUtrechtTopTaskLinkElement; + new (): HTMLUtrechtTopTaskLinkElement; + }; + interface HTMLUtrechtTopTaskNavElement extends Components.UtrechtTopTaskNav, HTMLStencilElement { + } + var HTMLUtrechtTopTaskNavElement: { + prototype: HTMLUtrechtTopTaskNavElement; + new (): HTMLUtrechtTopTaskNavElement; + }; interface HTMLUtrechtUrlDataElement extends Components.UtrechtUrlData, HTMLStencilElement { } var HTMLUtrechtUrlDataElement: { @@ -3068,6 +3087,8 @@ declare global { "utrecht-table-row": HTMLUtrechtTableRowElement; "utrecht-textarea": HTMLUtrechtTextareaElement; "utrecht-textbox": HTMLUtrechtTextboxElement; + "utrecht-top-task-link": HTMLUtrechtTopTaskLinkElement; + "utrecht-top-task-nav": HTMLUtrechtTopTaskNavElement; "utrecht-url-data": HTMLUtrechtUrlDataElement; } } @@ -3888,6 +3909,13 @@ declare namespace LocalJSX { "type"?: string; "value"?: string; } + interface UtrechtTopTaskLink { + "external"?: boolean; + "href"?: string; + "target"?: string; + } + interface UtrechtTopTaskNav { + } interface UtrechtUrlData { } interface IntrinsicElements { @@ -4189,6 +4217,8 @@ declare namespace LocalJSX { "utrecht-table-row": UtrechtTableRow; "utrecht-textarea": UtrechtTextarea; "utrecht-textbox": UtrechtTextbox; + "utrecht-top-task-link": UtrechtTopTaskLink; + "utrecht-top-task-nav": UtrechtTopTaskNav; "utrecht-url-data": UtrechtUrlData; } } @@ -4529,6 +4559,8 @@ declare module "@stencil/core" { "utrecht-table-row": LocalJSX.UtrechtTableRow & JSXBase.HTMLAttributes; "utrecht-textarea": LocalJSX.UtrechtTextarea & JSXBase.HTMLAttributes; "utrecht-textbox": LocalJSX.UtrechtTextbox & JSXBase.HTMLAttributes; + "utrecht-top-task-link": LocalJSX.UtrechtTopTaskLink & JSXBase.HTMLAttributes; + "utrecht-top-task-nav": LocalJSX.UtrechtTopTaskNav & JSXBase.HTMLAttributes; "utrecht-url-data": LocalJSX.UtrechtUrlData & JSXBase.HTMLAttributes; } } diff --git a/packages/web-component-library-stencil/src/components/top-task-link.scss b/packages/web-component-library-stencil/src/components/top-task-link.scss new file mode 100644 index 00000000000..26049b10893 --- /dev/null +++ b/packages/web-component-library-stencil/src/components/top-task-link.scss @@ -0,0 +1,15 @@ +/** + * @license EUPL-1.2 + * Copyright (c) 2020-2024 Frameless B.V. + * Copyright (c) 2021-2024 Gemeente Utrecht + */ + +@import "~@utrecht/top-task-link-css/src"; + +:host { + display: block; +} + +:host([hidden]) { + display: none !important; +} diff --git a/packages/web-component-library-stencil/src/components/top-task-link.tsx b/packages/web-component-library-stencil/src/components/top-task-link.tsx new file mode 100644 index 00000000000..d1e667caf97 --- /dev/null +++ b/packages/web-component-library-stencil/src/components/top-task-link.tsx @@ -0,0 +1,35 @@ +/** + * @license EUPL-1.2 + * Copyright (c) 2020-2024 Frameless B.V. + * Copyright (c) 2021-2024 Gemeente Utrecht + */ + +import { Component, h, Prop } from '@stencil/core'; + +@Component({ + tag: 'utrecht-top-task-link', + styleUrl: 'top-task-link.scss', + shadow: true, +}) +export class TopTaskLink { + @Prop() external?: boolean; + @Prop() href: string; + @Prop() target?: string; + render() { + return ( + + + + + + + + + ); + } +} diff --git a/packages/web-component-library-stencil/src/components/top-task-nav.scss b/packages/web-component-library-stencil/src/components/top-task-nav.scss new file mode 100644 index 00000000000..8c3937f8852 --- /dev/null +++ b/packages/web-component-library-stencil/src/components/top-task-nav.scss @@ -0,0 +1,15 @@ +/** + * @license EUPL-1.2 + * Copyright (c) 2020-2024 Frameless B.V. + * Copyright (c) 2021-2024 Gemeente Utrecht + */ + +@import "~@utrecht/top-task-nav-css/src"; + +:host { + display: block; +} + +:host([hidden]) { + display: none !important; +} diff --git a/packages/web-component-library-stencil/src/components/top-task-nav.tsx b/packages/web-component-library-stencil/src/components/top-task-nav.tsx new file mode 100644 index 00000000000..7505c2dd0cb --- /dev/null +++ b/packages/web-component-library-stencil/src/components/top-task-nav.tsx @@ -0,0 +1,24 @@ +/** + * @license EUPL-1.2 + * Copyright (c) 2020-2024 Frameless B.V. + * Copyright (c) 2021-2024 Gemeente Utrecht + */ + +import { Component, h } from '@stencil/core'; + +@Component({ + tag: 'utrecht-top-task-nav', + styleUrl: 'top-task-nav.scss', + shadow: true, +}) +export class TopTaskNav { + render() { + // TODO: Add accessible name for navigation landmark, + // using `aria-labelledby` and a heading. + return ( + + ); + } +} diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 259f1f4e11d..3e486550bb0 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -6610,6 +6610,12 @@ importers: '@utrecht/textbox-css': specifier: workspace:* version: link:../../components/textbox + '@utrecht/top-task-link-css': + specifier: workspace:* + version: link:../../components/toptask-link + '@utrecht/top-task-nav-css': + specifier: workspace:* + version: link:../../components/toptask-nav '@utrecht/url-data-css': specifier: workspace:* version: link:../../components/url-data @@ -7093,6 +7099,12 @@ importers: '@utrecht/textbox-css': specifier: workspace:* version: link:../../components/textbox + '@utrecht/top-task-link-css': + specifier: workspace:* + version: link:../../components/toptask-link + '@utrecht/top-task-nav-css': + specifier: workspace:* + version: link:../../components/toptask-nav '@utrecht/unordered-list-css': specifier: workspace:* version: link:../../components/unordered-list