Skip to content

Commit

Permalink
Merge pull request #1090 from City-of-Helsinki/release-2.17.0
Browse files Browse the repository at this point in the history
Release 2.17.0
  • Loading branch information
timwessman authored Aug 18, 2023
2 parents 96ecf62 + bad1244 commit 68798c0
Show file tree
Hide file tree
Showing 452 changed files with 34,518 additions and 4,758 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/development.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
id: nvmrc

- name: setup node ${{ steps.nvmrc.outputs.NODE_VERSION }}
uses: actions/setup-node@v3
uses: actions/setup-node@v3.7.0
with:
node-version: '${{ steps.nvmrc.outputs.NODE_VERSION }}'
registry-url: 'https://registry.npmjs.org'
Expand Down Expand Up @@ -52,7 +52,7 @@ jobs:

- name: Store storybook as artifact
if: ${{ !(contains(github.head_ref, 'hotfix') || contains(github.ref, 'hotfix')) }}
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
name: storybook-${{ github.sha }}
path: |
Expand All @@ -75,7 +75,7 @@ jobs:

steps:
- name: download storybook
uses: actions/download-artifact@v2
uses: actions/download-artifact@v3
with:
name: storybook-${{ github.sha }}

Expand All @@ -93,7 +93,7 @@ jobs:
run: ./node_modules/.bin/loki test --requireReference --verboseRenderer --reactUri file:./storybook-static --storiesFilter ${{ matrix.loki_test_group }} ${{ matrix.loki_configuration }}

- name: upload reference and actual images with ${{ matrix.loki_configuration }} and ${{ matrix.loki_test_group }} in case of failure
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
name: loki_images_${{ matrix.loki_configuration }}_${{ steps.sanitize_artifact_name.outputs.value }}
path: .loki/difference/*.*
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/gh-pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
id: nvmrc

- name: setup node ${{ steps.nvmrc.outputs.NODE_VERSION }}
uses: actions/setup-node@v3
uses: actions/setup-node@v3.7.0
with:
node-version: '${{ steps.nvmrc.outputs.NODE_VERSION }}'
registry-url: 'https://registry.npmjs.org'
Expand Down
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v16.19.1
v18.16.0
31 changes: 31 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,37 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [2.17.0] - Aug, 18, 2023

### React

#### Added
- [Highlight] New component for quotes and text highlights

### Core

#### Added
- [Highlight] New component for quotes and text highlights

### Documentation

#### Added
- [Highlight] Documentation for new Highlight component
- Document tokens for focus colours

#### Changed
- Improved docs for creating new react components
- Updated contributing guide

#### Fixed
- Updated package dependencies

### Design kit

#### Added
- Figma API icon library export script


## [2.16.0] - June, 28, 2023

### React
Expand Down
32 changes: 26 additions & 6 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,29 +6,49 @@ Contributions are open even if you don't have a finished solution yet. HDS team

Send pull requests to `development` branch. Right now all pull requests are welcome. If you do not feel that the PR is anywhere near ready, consider opening a draft pull request. Allowing edits for maintainers is also recommended.

1. Set up your local development environment by following the steps in [DEVELOPMENT.md](/DEVELOPMENT.md). Use short and descriptive commit messages e.g. "Add rotate property for Koros component".
1. [Fork the repository](https://github.com/City-of-Helsinki/helsinki-design-system/fork). Select yourself as the owner and press Create fork.

2. Create a new branch with prefix `hds-<Ticket number>` if you have a ticket number, otherwise just use prefix `feature/` or `fix/` whichever is more approriate. When submitting large changes split them into light and coherent parts. This sometimes requires sending in multiple PRs.
2. Set up your local development environment by following the steps in [DEVELOPMENT.md](/DEVELOPMENT.md), disregarding the cloning part.

3. Create a new branch with prefix `hds-<Ticket number>` if you have a ticket number, otherwise just use prefix `feature/` or `fix/` whichever is more approriate. When submitting large changes split them into light and coherent parts. This sometimes requires sending in multiple PRs. Remember to use short and descriptive commit messages e.g. "Add rotate property for Koros component".

* Feature – If you intend to change the public API or introduce a new feature.

* Fix – If you intend to make a code change to solve a production issue.

3. If you’ve added code that should be tested, add tests! Ensure the test suite passes and Jest snapshot tests are updated by running the following command. Also commit the updated snapshot tests. HDS support includes responsive design so testing on different screen sizes on real devices, simulators, or browser tools is encouraged.
4. When developing for the `hds-react` package: if you’ve added code that should be tested, add tests! HDS tests are usually simple rendering and functionality checks. Avoid excessive amount of mocking for simplicity's sake and testing for implementation details, i.e. don't test whether function `hideComponent` was called but rather that the component is not visible. This way there are no false negatives when the code is refactored by changing the function name for example, or false positives when the function breaks and doesn't hide the component.

Ensure the test suite and regression tests pass. Remember commit the updated snapshot tests and loki reference images. HDS support includes responsive design so testing on different screen sizes on real devices, simulators, or browser tools is encouraged.

Run snapshot tests:
```bash
yarn test
```

Update jest snapshots:
```bash
yarn test -- -u
```

4. Lint your code. Tip: Lint runs automatically when you build.
Run loki tests:
```bash
yarn run visual-test
```

Update loki tests:
```bash
yarn run update-reference-images
```

5. Lint your code. Tip: Lint runs automatically when you build.

```bash
yarn test:lint
```

5. Make a Pull Request on the [HDS Github website](https://github.com/City-of-Helsinki/helsinki-design-system/pulls). If you have a ticket number name the PR e.g. "HDS-1377: number input accessibility fix" so it will automatically link to the ticket. Please be sure to check the open PRs in case somebody is already working on a similar issue. Also to prevent overlapping work notify HDS team by Slack at #designsystem or via email [email protected].
6. Make a Pull Request on the [HDS Github website](https://github.com/City-of-Helsinki/helsinki-design-system/pulls). If you have a ticket number name the PR e.g. "HDS-1377: number input accessibility fix" so it will automatically link to the ticket. Please be sure to check the open PRs in case somebody is already working on a similar issue. Also to prevent overlapping work notify HDS team by Slack at #designsystem or via email [email protected].

6. HDS team will review the PR and either add it to the release queue, request changes to it or close it with an explanation. PRs are reviewed with the following quality criteria:
7. HDS team will review the PR and either add it to the release queue, request changes to it or close it with an explanation. PRs are reviewed with the following quality criteria:

* Accessibility

Expand Down
7 changes: 5 additions & 2 deletions packages/core/.storybook/main.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
module.exports = {
core: {
builder: 'webpack5',
},
stories: ['../src/**/*.stories.@(js|mdx)'],
addons: [
'@storybook/addon-docs',
'@storybook/addon-a11y',
'@storybook/addon-backgrounds',
'@storybook/addon-viewport',
'@storybook/addon-storysource',
'@storybook/addon-storysource'
],
staticDirs: ['../src/fonts'],
staticDirs: ['../src/fonts']
};
6 changes: 4 additions & 2 deletions packages/core/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "hds-core",
"version": "2.16.0",
"version": "2.17.0",
"description": "Core styles for the Helsinki Design System",
"homepage": "https://github.com/City-of-Helsinki/helsinki-design-system#readme",
"license": "MIT",
Expand All @@ -25,10 +25,12 @@
"@storybook/addon-storysource": "^6.4.19",
"@storybook/addon-viewport": "6.4.18",
"@storybook/addons": "6.4.18",
"@storybook/builder-webpack5": "^6.5.16",
"@storybook/html": "6.4.18",
"@storybook/manager-webpack5": "^6.5.16",
"copyfiles": "2.2.0",
"cssnano": "4.1.10",
"hds-design-tokens": "2.16.0",
"hds-design-tokens": "2.17.0",
"normalize.css": "8.0.1",
"postcss": "8.2.15",
"postcss-cli": "8.3.1",
Expand Down
1 change: 1 addition & 0 deletions packages/core/src/components/all.css
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
@import url("./error-summary/error-summary.css");
@import url("./fieldset/fieldset.css");
@import url("./hero/hero.css");
@import url("./highlight/highlight.css");
@import url("./koros/koros.css");
@import url("./link/link.css");
@import url("./loading-spinner/loading-spinner.css");
Expand Down
10 changes: 3 additions & 7 deletions packages/core/src/components/checkbox/checkbox.css
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
@svg-load icon url("../../svg/ui/check.svg");
@svg-load minusicon url("../../svg/ui/minus.svg");
@svg-load erroricon url("../../svg/ui/alert-circle-fill.svg");

.hds-checkbox {
--size: 24px;

Expand Down Expand Up @@ -59,7 +55,7 @@
.hds-checkbox .hds-checkbox__input:before {
background-color: var(--icon-color-unselected);
height: var(--size);
mask-image: svg-inline(icon);
mask-image: url("data:image/svg+xml;charset=utf-8,%3Csvg role='img' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E %3Cg fill='none' fill-rule='evenodd'%3E %3Crect width='24' height='24'/%3E %3Cpolygon fill='currentColor' points='21 7 10 18 4.5 12.5 6 11 10 15 19.5 5.5'/%3E %3C/g%3E %3C/svg%3E");
mask-position: center;
mask-repeat: no-repeat;
mask-size: calc(var(--size) * var(--icon-scale));
Expand Down Expand Up @@ -155,7 +151,7 @@
content: '';
height: var(--icon-size);
left: 0;
mask-image: svg-inline(erroricon);
mask-image: url("data:image/svg+xml;charset=utf-8,%3Csvg role='img' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E %3Cg fill='none' fill-rule='evenodd'%3E %3Crect width='24' height='24'/%3E %3Cpath fill='currentColor' d='M12,3 C16.9705627,3 21,7.02943725 21,12 C21,16.9705627 16.9705627,21 12,21 C7.02943725,21 3,16.9705627 3,12 C3,7.02943725 7.02943725,3 12,3 Z M13,16 L13,18 L11,18 L11,16 L13,16 Z M13,6 L13,14 L11,14 L11,6 L13,6 Z'/%3E %3C/g%3E %3C/svg%3E");
pointer-events: none;
position: absolute;
top: 0;
Expand All @@ -173,7 +169,7 @@
/* checkbox icon - indeterminated */
.hds-checkbox .hds-checkbox__input:not(:checked):indeterminate:before {
background-color: var(--icon-color-selected);
mask-image: svg-inline(minusicon);
mask-image: url("data:image/svg+xml;charset=utf-8,%3Csvg role='img' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cpath d='M0 0h24v24H0z'/%3E%3Cpath fill='currentColor' d='M6 11h12v2H6z'/%3E%3C/g%3E%3C/svg%3E");
transform: scale(1);
}

Expand Down
60 changes: 60 additions & 0 deletions packages/core/src/components/highlight/highlight.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
.hds-highlight {
--accent-line-color: var(--color-bus);
--text-color: var(--color-black-90);
--size-width-s: 264px;
--size-width-m: 536px;
--size-width-l: 680px;
--width: var(--size-width-m);
--margin: var(--spacing-m) 0;

border-left: 8px solid var(--accent-line-color);
color: var(--text-color);
display: flex;
flex-direction: column;
justify-content: center;
margin: var(--margin);
max-width: 100%;
padding: 0;
padding-left: var(--spacing-s);
row-gap: var(--spacing-m);
width: var(--width);
}

.hds-blockquote {
margin: 0;
padding: 0;
}

.hds-highlight__text {
color: var(--text-color);
font-size: var(--fontsize-heading-m);
line-height: var(--lineheight-m);
margin: 0;
padding: 0;
}

.hds-highlight--small {
--margin: var(--spacing-s) 0;
--width: var(--size-width-s);
}

.hds-highlight--large {
--margin: var(--spacing-l) 0;
--width: var(--size-width-l);
}

.hds-highlight--large .hds-highlight__text {
font-size: var(--fontsize-heading-l);
line-height: var(--lineheight-l);
}

.hds-highlight__quote:before,
.hds-highlight__quote:after {
content: '"';
display: inline;
}

.hds-highlight__reference {
font-size: var(--fontsize-heading-xs);
line-height: var(--lineheight-m);
}
78 changes: 78 additions & 0 deletions packages/core/src/components/highlight/highlight.stories.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
import './highlight.css';

export default {
title: 'Components/Highlight',
};

const highlightText = 'You may select an highlight from the article to be displayed here. Select an excerpt that you want the user to pay attention to.';
const quoteText = 'Add an interesting quote here';
const quoteReference = 'First name Last name. Title.';
const customColor = '#00005e';

export const DefaultHighlight = () => `
<figure class="hds-highlight">
<blockquote class="hds-blockquote">
<p class="hds-highlight__text">${highlightText}</p>
</blockquote class="hds-blockquote">
</figure>
`;

export const HighlightLarge = () => `
<figure class="hds-highlight hds-highlight--large">
<blockquote class="hds-blockquote">
<p class="hds-highlight__text">${highlightText}</p>
</blockquote class="hds-blockquote">
</figure>
`;

export const HighlightSmall = () => `
<figure class="hds-highlight hds-highlight--small">
<blockquote class="hds-blockquote">
<p class="hds-highlight__text">${highlightText}</p>
</blockquote class="hds-blockquote">
</figure>
`;

export const HighlightCustomStyles = () => `
<figure class="hds-highlight" style="--accent-line-color:${customColor};--text-color:${customColor}">
<blockquote class="hds-blockquote">
<p class="hds-highlight__text">${highlightText}</p>
</blockquote class="hds-blockquote">
</figure>
`;

export const DefaultQuote = () => `
<figure class="hds-highlight">
<blockquote class="hds-blockquote">
<p class="hds-highlight__text hds-highlight__quote">${quoteText}</p>
</blockquote class="hds-blockquote">
<figcaption class="hds-highlight__reference">&#8212${quoteReference}</figcaption>
</figure>
`;

export const QuoteLarge = () => `
<figure class="hds-highlight hds-highlight--large">
<blockquote class="hds-blockquote">
<p class="hds-highlight__text hds-highlight__quote">${quoteText}</p>
</blockquote class="hds-blockquote">
<figcaption class="hds-highlight__reference">&#8212${quoteReference}</figcaption>
</figure>
`;

export const QuoteSmall = () => `
<figure class="hds-highlight hds-highlight--small">
<blockquote class="hds-blockquote">
<p class="hds-highlight__text hds-highlight--small hds-highlight__quote">${quoteText}</p>
</blockquote class="hds-blockquote">
<figcaption class="hds-highlight__reference">&#8212${quoteReference}</figcaption>
</figure>
`;

export const QuoteCustomStyles = () => `
<figure class="hds-highlight" style="--accent-line-color:${customColor};--text-color:${customColor}">
<blockquote class="hds-blockquote">
<p class="hds-highlight__text hds-highlight__quote">${quoteText}</p>
</blockquote class="hds-blockquote">
<figcaption class="hds-highlight__reference">&#8212${quoteReference}</figcaption>
</figure>
`;
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
@svg-load icon url("../../svg/ui/alert-circle-fill.svg");

.hds-selection-group {
--spacing-col: 1.25rem;
--spacing-row: var(--spacing-s);
Expand Down Expand Up @@ -76,8 +74,8 @@
content: '';
height: var(--icon-size);
left: 0;
-webkit-mask-image: svg-inline(icon);
mask-image: svg-inline(icon);
-webkit-mask-image: url("data:image/svg+xml;charset=utf-8,%3Csvg role='img' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E %3Cg fill='none' fill-rule='evenodd'%3E %3Crect width='24' height='24'/%3E %3Cpath fill='currentColor' d='M12,3 C16.9705627,3 21,7.02943725 21,12 C21,16.9705627 16.9705627,21 12,21 C7.02943725,21 3,16.9705627 3,12 C3,7.02943725 7.02943725,3 12,3 Z M13,16 L13,18 L11,18 L11,16 L13,16 Z M13,6 L13,14 L11,14 L11,6 L13,6 Z'/%3E %3C/g%3E %3C/svg%3E");
mask-image: url("data:image/svg+xml;charset=utf-8,%3Csvg role='img' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E %3Cg fill='none' fill-rule='evenodd'%3E %3Crect width='24' height='24'/%3E %3Cpath fill='currentColor' d='M12,3 C16.9705627,3 21,7.02943725 21,12 C21,16.9705627 16.9705627,21 12,21 C7.02943725,21 3,16.9705627 3,12 C3,7.02943725 7.02943725,3 12,3 Z M13,16 L13,18 L11,18 L11,16 L13,16 Z M13,6 L13,14 L11,14 L11,6 L13,6 Z'/%3E %3C/g%3E %3C/svg%3E");
pointer-events: none;
position: absolute;
top: 0;
Expand Down
Loading

0 comments on commit 68798c0

Please sign in to comment.