-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'develop' of https://github.com/Amsterdam/design-system …
…into feature/DES-486-MegaMenu
- Loading branch information
Showing
35 changed files
with
519 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,6 +3,34 @@ | |
All notable changes to this project will be documented in this file. | ||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. | ||
|
||
## [0.3.0](https://github.com/Amsterdam/design-system/compare/@amsterdam/[email protected]...@amsterdam/[email protected]) (2023-12-22) | ||
|
||
### ⚠ BREAKING CHANGES | ||
|
||
* Replace `fullWidth` prop on `Grid.Cell` with an `"all"` value on `span` (#963) | ||
* Rename ‘Highlight’ component to ‘Spotlight’ (#929) | ||
* Update line heights and text levels (#898) | ||
|
||
### Features | ||
|
||
* Add Header Component ([#807](https://github.com/Amsterdam/design-system/issues/807)) ([34abcd0](https://github.com/Amsterdam/design-system/commit/34abcd07a849fda94fd46bf995b540e20928c2bf)) | ||
* Add Search Field component ([#892](https://github.com/Amsterdam/design-system/issues/892)) ([dd1a437](https://github.com/Amsterdam/design-system/commit/dd1a437d46c4ac7d43d64f7c1acadecc377e7928)) | ||
* Add Skip link component ([#988](https://github.com/Amsterdam/design-system/issues/988)) ([82323b5](https://github.com/Amsterdam/design-system/commit/82323b594c7fba99819cf6873227ca3dcd084315)) | ||
* Add text input component ([#912](https://github.com/Amsterdam/design-system/issues/912)) ([d4401cc](https://github.com/Amsterdam/design-system/commit/d4401ccf9d41d5c8a48ec32d63cdaabec549d5f2)) | ||
* Introduce ‘Mark’ component ([#933](https://github.com/Amsterdam/design-system/issues/933)) ([d399454](https://github.com/Amsterdam/design-system/commit/d399454ed729a595cab902c83e54d61e3c2aaf71)) | ||
* Introduce ‘Overlap’ component for hero image with search field ([#932](https://github.com/Amsterdam/design-system/issues/932)) ([1b2e87d](https://github.com/Amsterdam/design-system/commit/1b2e87db032d1500e301c2027596a5c908d59c8c)) | ||
* Rename ‘Highlight’ component to ‘Spotlight’ ([#929](https://github.com/Amsterdam/design-system/issues/929)) ([9993d8d](https://github.com/Amsterdam/design-system/commit/9993d8dd4ff17ec5e686295d711cc7688f7ce28c)) | ||
* Replace `fullWidth` prop on `Grid.Cell` with an `"all"` value on `span` ([#963](https://github.com/Amsterdam/design-system/issues/963)) ([b6a8b34](https://github.com/Amsterdam/design-system/commit/b6a8b3450af823f5c033f290783f013e6f20b205)) | ||
* Update line heights and text levels ([#898](https://github.com/Amsterdam/design-system/issues/898)) ([82356bb](https://github.com/Amsterdam/design-system/commit/82356bbf11c389c0f29146ca5f715d5b7459a634)) | ||
|
||
### Bug Fixes | ||
|
||
* Adjust size of breadcrumb separator and allow natural text wrapping ([#913](https://github.com/Amsterdam/design-system/issues/913)) ([caba940](https://github.com/Amsterdam/design-system/commit/caba94024c5aedf9092a5afbbf625d921fd124b5)) | ||
* Improve examples and documentation for cards ([#936](https://github.com/Amsterdam/design-system/issues/936)) ([0f91370](https://github.com/Amsterdam/design-system/commit/0f913702de12cb7b9ca50e8f9da4899c3d934320)) | ||
* Merge grid cell files into grid files and directories ([#815](https://github.com/Amsterdam/design-system/issues/815)) ([f4b4ec5](https://github.com/Amsterdam/design-system/commit/f4b4ec5de92d283ee2ef083075297a64b3dfd1cb)) | ||
* Resolve malformed outline and remove excessive whitespace on dialog ([#937](https://github.com/Amsterdam/design-system/issues/937)) ([1fc264a](https://github.com/Amsterdam/design-system/commit/1fc264ac577edaa92e37d4c7e81427dd75b6dbe7)) | ||
* Use rems for checkbox underline ([#944](https://github.com/Amsterdam/design-system/issues/944)) ([8622326](https://github.com/Amsterdam/design-system/commit/8622326b8686856c44ad03856bac886ee4e5632b)) | ||
|
||
## [0.2.0](https://github.com/Amsterdam/design-system/compare/@amsterdam/[email protected]...@amsterdam/[email protected]) (2023-12-01) | ||
|
||
### ⚠ BREAKING CHANGES | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# Overlap | ||
|
||
Toont twee of meer componenten over elkaar heen. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
/** | ||
* @license EUPL-1.2+ | ||
* Copyright (c) 2023 Gemeente Amsterdam | ||
*/ | ||
|
||
.amsterdam-overlap { | ||
display: grid; | ||
|
||
> * { | ||
grid-area: 1 / -1; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# Skip Link | ||
|
||
Gebruik een Skip Link om makkelijk met het toetsenbord naar de belangrijkste inhoud te navigeren. | ||
Met een Skip Link kun je terugkerende navigatieblokken (zoals het hoofdmenu of het kruimelpad) overslaan. | ||
|
||
De Skip Link staat boven de header. | ||
De link is verborgen totdat deze met de tab-toets geactiveerd wordt. | ||
Als de link getoond wordt, duwt deze de hele pagina omlaag. | ||
|
||
## Richtlijnen | ||
|
||
### Zo gebruiken | ||
|
||
- Plaats de Skip Link als eerste element in `<body>`, tenzij je een cookie-banner hebt. | ||
Plaats de Skip Link dan direct na de cookie-banner. | ||
- Gebruik de Skip Link om naar de belangrijkste inhoud te navigeren. | ||
Op een artikelpagina is dat bijvoorbeeld de titel van het artikel, op een zoekpagina is dat het zoekveld. | ||
- Voor complexe pagina's met meerdere secties kun je meer dan 1 Skip Link gebruiken. | ||
In de meeste gevallen is dit niet nodig. | ||
|
||
### Dit vermijden | ||
|
||
- Skip Links zijn niet nodig op een simpele pagina waar alleen tekst staat en weinig navigatie. | ||
Het doel van een Skip Link is om terugkerende navigatieblokken over te slaan. | ||
Als die blokken er niet zijn, is een Skip Link niet nodig. | ||
- Plaats de Skip Link niet in een `nav` regio, of in de Header. | ||
|
||
## Relevante WCAG eisen | ||
|
||
- Voor dit component gelden dezelfde WCAG eisen als voor [het link component](https://amsterdam.github.io/design-system/?path=/docs/react_navigation-link--docs). | ||
- [WCAG 2.4.1](https://www.w3.org/TR/WCAG22/#bypass-blocks): gebruik een Skip Link op elke pagina die begint met een terugkerend navigatieblok. | ||
- [WCAG 3.2.3](https://www.w3.org/TR/WCAG22/#consistent-navigation): een Skip Link staat op elke pagina op dezelfde plek. | ||
- [WCAG 3.2.4](https://www.w3.org/TR/WCAG22/#consistent-identification): een Skip Link heeft dezelfde labels op alle pagina's. Bijvoorbeeld niet: "Navigatie overslaan" op een gedeelte van de site, en "Naar de inhoud" op andere pagina's. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
/** | ||
* @license EUPL-1.2+ | ||
* Copyright (c) 2023 Gemeente Amsterdam | ||
*/ | ||
|
||
.amsterdam-skip-link { | ||
background-color: var(--amsterdam-skip-link-background-color); | ||
color: var(--amsterdam-skip-link-color); | ||
display: block; | ||
font-family: var(--amsterdam-skip-link-font-family); | ||
font-size: var(--amsterdam-skip-link-font-size); | ||
font-weight: var(--amsterdam-skip-link-font-weight); | ||
line-height: var(--amsterdam-skip-link-line-height); | ||
outline-offset: var(--amsterdam-skip-link-outline-offset); | ||
padding-block: 0.5rem; | ||
padding-inline: 1rem; | ||
text-align: center; | ||
text-decoration: none; | ||
|
||
&:hover { | ||
background-color: var(--amsterdam-skip-link-hover-background-color); | ||
} | ||
|
||
.amsterdam-theme--compact & { | ||
font-size: var(--amsterdam-skip-link-compact-font-size); | ||
line-height: var(--amsterdam-skip-link-compact-line-height); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,6 +3,33 @@ | |
All notable changes to this project will be documented in this file. | ||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. | ||
|
||
## [0.3.0](https://github.com/Amsterdam/design-system/compare/@amsterdam/[email protected]...@amsterdam/[email protected]) (2023-12-22) | ||
|
||
### ⚠ BREAKING CHANGES | ||
|
||
* Replace `fullWidth` prop on `Grid.Cell` with an `"all"` value on `span` (#963) | ||
* Rename ‘Highlight’ component to ‘Spotlight’ (#929) | ||
* Update line heights and text levels (#898) | ||
|
||
### Features | ||
|
||
* Add Header Component ([#807](https://github.com/Amsterdam/design-system/issues/807)) ([34abcd0](https://github.com/Amsterdam/design-system/commit/34abcd07a849fda94fd46bf995b540e20928c2bf)) | ||
* Add Search Field component ([#892](https://github.com/Amsterdam/design-system/issues/892)) ([dd1a437](https://github.com/Amsterdam/design-system/commit/dd1a437d46c4ac7d43d64f7c1acadecc377e7928)) | ||
* Add Skip link component ([#988](https://github.com/Amsterdam/design-system/issues/988)) ([82323b5](https://github.com/Amsterdam/design-system/commit/82323b594c7fba99819cf6873227ca3dcd084315)) | ||
* Add text input component ([#912](https://github.com/Amsterdam/design-system/issues/912)) ([d4401cc](https://github.com/Amsterdam/design-system/commit/d4401ccf9d41d5c8a48ec32d63cdaabec549d5f2)) | ||
* Allow ‘Grid Cell’ to render a custom HTML element ([#968](https://github.com/Amsterdam/design-system/issues/968)) ([1b9cda7](https://github.com/Amsterdam/design-system/commit/1b9cda7ce57abd45166f48c18c919769bff033fe)) | ||
* Introduce ‘Mark’ component ([#933](https://github.com/Amsterdam/design-system/issues/933)) ([d399454](https://github.com/Amsterdam/design-system/commit/d399454ed729a595cab902c83e54d61e3c2aaf71)) | ||
* Introduce ‘Overlap’ component for hero image with search field ([#932](https://github.com/Amsterdam/design-system/issues/932)) ([1b2e87d](https://github.com/Amsterdam/design-system/commit/1b2e87db032d1500e301c2027596a5c908d59c8c)) | ||
* Rename ‘Highlight’ component to ‘Spotlight’ ([#929](https://github.com/Amsterdam/design-system/issues/929)) ([9993d8d](https://github.com/Amsterdam/design-system/commit/9993d8dd4ff17ec5e686295d711cc7688f7ce28c)) | ||
* Replace `fullWidth` prop on `Grid.Cell` with an `"all"` value on `span` ([#963](https://github.com/Amsterdam/design-system/issues/963)) ([b6a8b34](https://github.com/Amsterdam/design-system/commit/b6a8b3450af823f5c033f290783f013e6f20b205)) | ||
* Update line heights and text levels ([#898](https://github.com/Amsterdam/design-system/issues/898)) ([82356bb](https://github.com/Amsterdam/design-system/commit/82356bbf11c389c0f29146ca5f715d5b7459a634)) | ||
|
||
### Bug Fixes | ||
|
||
* Clean up redundant subcomponent types ([#894](https://github.com/Amsterdam/design-system/issues/894)) ([0c4bbc1](https://github.com/Amsterdam/design-system/commit/0c4bbc1404f66d3d70441812de9949b77060a951)) | ||
* Merge grid cell files into grid files and directories ([#815](https://github.com/Amsterdam/design-system/issues/815)) ([f4b4ec5](https://github.com/Amsterdam/design-system/commit/f4b4ec5de92d283ee2ef083075297a64b3dfd1cb)) | ||
* Remove unused prop type in TextInput ([#990](https://github.com/Amsterdam/design-system/issues/990)) ([f150e16](https://github.com/Amsterdam/design-system/commit/f150e16c1953791ec7c6d6891e2cd5cb43c26ffa)) | ||
|
||
## [0.2.0](https://github.com/Amsterdam/design-system/compare/@amsterdam/[email protected]...@amsterdam/[email protected]) (2023-12-01) | ||
|
||
### ⚠ BREAKING CHANGES | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1 @@ | ||
export { Image } from './Image' | ||
export type { ImageProps } from './Image' | ||
export { Image, type ImageProps } from './Image' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
import { render, screen } from '@testing-library/react' | ||
import { createRef } from 'react' | ||
import { Overlap } from './Overlap' | ||
import '@testing-library/jest-dom' | ||
|
||
describe('Overlap', () => { | ||
it('renders', () => { | ||
const { container } = render(<Overlap />) | ||
const component = container.querySelector(':only-child') | ||
expect(component).toBeInTheDocument() | ||
expect(component).toBeVisible() | ||
}) | ||
|
||
it('renders a design system BEM class name', () => { | ||
const { container } = render(<Overlap />) | ||
const component = container.querySelector(':only-child') | ||
expect(component).toHaveClass('amsterdam-overlap') | ||
}) | ||
|
||
it('renders an additional class name', () => { | ||
const { container } = render(<Overlap className="extra" />) | ||
const component = container.querySelector(':only-child') | ||
expect(component).toHaveClass('amsterdam-overlap extra') | ||
}) | ||
|
||
it('supports ForwardRef in React', () => { | ||
const ref = createRef<HTMLImageElement>() | ||
const { container } = render(<Overlap ref={ref} />) | ||
const component = container.querySelector(':only-child') | ||
expect(ref.current).toBe(component) | ||
}) | ||
|
||
it('renders children', () => { | ||
render( | ||
<Overlap> | ||
<p>Test Child</p> | ||
</Overlap>, | ||
) | ||
const testChild = screen.getByText('Test Child') | ||
expect(testChild).toBeTruthy() | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
/** | ||
* @license EUPL-1.2+ | ||
* Copyright (c) 2023 Gemeente Amsterdam | ||
*/ | ||
|
||
import clsx from 'clsx' | ||
import { type ForwardedRef, forwardRef, type HTMLAttributes, type PropsWithChildren } from 'react' | ||
|
||
export const Overlap = forwardRef( | ||
( | ||
{ children, className, ...restProps }: PropsWithChildren<HTMLAttributes<HTMLDivElement>>, | ||
ref: ForwardedRef<HTMLDivElement>, | ||
) => ( | ||
<div {...restProps} ref={ref} className={clsx('amsterdam-overlap', className)}> | ||
{children} | ||
</div> | ||
), | ||
) | ||
|
||
Overlap.displayName = 'Overlap' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# React Overlap component | ||
|
||
[Overlap documentation](../../../css/src/overlap/README.md) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export { Overlap } from './Overlap' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# React Skip Link component | ||
|
||
[Skip Link documentation](../../../css/src/skip-link/README.md) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
import { render, screen } from '@testing-library/react' | ||
import { createRef } from 'react' | ||
import { SkipLink } from './SkipLink' | ||
import '@testing-library/jest-dom' | ||
|
||
describe('Skip Link', () => { | ||
it('renders', () => { | ||
render(<SkipLink href="/" />) | ||
|
||
const component = screen.getByRole('link') | ||
|
||
expect(component).toBeInTheDocument() | ||
expect(component).toBeVisible() | ||
}) | ||
|
||
it('renders a design system BEM class name', () => { | ||
render(<SkipLink href="/" />) | ||
|
||
const component = screen.getByRole('link') | ||
|
||
expect(component).toHaveClass('amsterdam-skip-link') | ||
}) | ||
|
||
it('renders an additional class name', () => { | ||
render(<SkipLink href="/" className="extra" />) | ||
|
||
const component = screen.getByRole('link') | ||
|
||
expect(component).toHaveClass('amsterdam-skip-link extra') | ||
}) | ||
|
||
it('supports ForwardRef in React', () => { | ||
const ref = createRef<HTMLAnchorElement>() | ||
|
||
render(<SkipLink href="/" ref={ref} />) | ||
|
||
const component = screen.getByRole('link') | ||
|
||
expect(ref.current).toBe(component) | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
/** | ||
* @license EUPL-1.2+ | ||
* Copyright (c) 2023 Gemeente Amsterdam | ||
*/ | ||
|
||
import clsx from 'clsx' | ||
import { forwardRef } from 'react' | ||
import type { AnchorHTMLAttributes, ForwardedRef, PropsWithChildren } from 'react' | ||
|
||
export interface SkipLinkProps extends PropsWithChildren<AnchorHTMLAttributes<HTMLAnchorElement>> {} | ||
|
||
export const SkipLink = forwardRef( | ||
({ children, className, ...restProps }: SkipLinkProps, ref: ForwardedRef<HTMLAnchorElement>) => ( | ||
<a {...restProps} ref={ref} className={clsx('amsterdam-skip-link', 'amsterdam-visually-hidden', className)}> | ||
{children} | ||
</a> | ||
), | ||
) | ||
|
||
SkipLink.displayName = 'SkipLink' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
export { SkipLink } from './SkipLink' | ||
export type { SkipLinkProps } from './SkipLink' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.