diff --git a/CHANGELOG.md b/CHANGELOG.md index bb1206f016..4251d421ba 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,65 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [3.5.0] - February, 6, 2024 + +### React + +#### Changed + +- [Hero] Add support for showing an arrow-icon in the bottom left corner with theming support +- Normalize is now removed from the `hds-core` package which React-package relies on. If it causes trouble, it can be included in projects separately. + +#### Fixed + +- [TextInput] Hide native password reveal icon (Edge browser) +- The way styles were imported was broken and could result in faulty styles + +### Core + +#### Changed + +- [Hero] Add support for showing an arrow-icon in the bottom left corner with theming support +- Normalize is now removed from the package, if it causes trouble, it can be included in projects separately. + +#### Fixed + +- [Text input] Hide native password reveal icon (Edge browser) + +### Documentation + +#### Added + +- [Hero] Added examples and code of the arrow-icon + +### Figma + +#### Added + +- [Hero] Added a visual arrow +- [Hero] Added a photographer information +- [Tag] Two new variants: Link (underlined) and Action (bordered) with interaction states +- [Icons] New icons in the Forms category: document-group, document-blank, document-blank-group, folder, folder-group & box + +#### Changed + +- [Hero] Variants named according to code implementation +- [Tag] Adjusted focus state offset to 2px + +#### Fixed + +- [Hero] Fixes for multiple variants e.g fonts, colours, paddings and improved Koro element usage and layout structure. + +#### Removed + +- [Tag] Removed state variants for informative tags +- [Hero] Removed the "new value" variant as it was unnecessary. + +### Icon kit + +#### Added: +- [Icons] New icons in the Forms category: document-group, document-blank, document-blank-group, folder, folder-group & box + ## [3.4.0] - January, 16, 2024 ### React diff --git a/packages/core/package.json b/packages/core/package.json index da2ed9aac5..d067316dd5 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -1,6 +1,6 @@ { "name": "hds-core", - "version": "3.4.0", + "version": "3.5.0", "description": "Core styles for the Helsinki Design System", "homepage": "https://github.com/City-of-Helsinki/helsinki-design-system#readme", "license": "MIT", @@ -30,8 +30,7 @@ "@storybook/manager-webpack5": "^6.5.16", "copyfiles": "2.2.0", "cssnano": "4.1.10", - "hds-design-tokens": "3.4.0", - "normalize.css": "8.0.1", + "hds-design-tokens": "3.5.0", "postcss": "8.2.15", "postcss-cli": "8.3.1", "postcss-import": "12.0.1", diff --git a/packages/core/src/base.css b/packages/core/src/base.css index 36b08b552d..347bf1b1bc 100644 --- a/packages/core/src/base.css +++ b/packages/core/src/base.css @@ -1,4 +1,11 @@ -@import url("normalize.css"); @import url("hds-design-tokens"); @import url("utils/animations.css"); @import url("utils/helpers.css"); + +/* + * Normalize.css rule + */ + +html { + -webkit-text-size-adjust: 100%; +} \ No newline at end of file diff --git a/packages/core/src/components/hero/hero.css b/packages/core/src/components/hero/hero.css index a8e874f6b8..29ca519548 100644 --- a/packages/core/src/components/hero/hero.css +++ b/packages/core/src/components/hero/hero.css @@ -1,23 +1,51 @@ .hds-hero { + --arrow-icon-color: var(--color); + --arrow-icon-size: 128px; --background-color: var(--color-white); --color: var(--color-black-90); - --image-position: bottom right; - --koros-color: var(--color-white); - --koros-height: 85px; --diagonal-koros-position: 45%; - --horizontal-padding-small: var(--spacing-layout-2-xs); - --horizontal-padding-medium: var(--spacing-layout-xs); --horizontal-padding-large: var(--spacing-layout-xs); + --horizontal-padding-medium: var(--spacing-layout-xs); + --horizontal-padding-small: var(--spacing-layout-2-xs); --horizontal-padding-x-large: var(--spacing-layout-xs); + --image-position: bottom right; + --koros-color: var(--color-white); + --koros-height: 85px; --padding-horizontal: var(--horizontal-padding-small); --padding-vertical: var(--spacing-xl); + --z-index: 1; background-color: var(--background-color); color: var(--color); display: flex; flex-direction: column; position: relative; - z-index: 1; + z-index: var(--z-index); +} + +.hds-hero__arrow-icon-container { + display: flex; + height: 0; + margin: 0 auto; + max-width: var(--container-width-xl); + overflow: visible; + position: relative; + width: 100%; + z-index: calc(var(--z-index) + 1); +} + +.hds-hero__arrow-icon-spacing-after { + margin-bottom: calc(var(--arrow-icon-size) / 2); +} + +.hds-hero--arrow-icon { + --icon-size: var(--arrow-icon-size) !important; + + color: var(--arrow-icon-color); + + /* the following is magic to calculate a proper margins (icon has empty space in it that is taken into account) */ + margin-left: calc(var(--padding-horizontal) - (var(--arrow-icon-size) / 4)); + margin-top: calc(0px - var(--arrow-icon-size) / (128 / 20) - var(--spacing-layout-xs)); } .hds-hero__title { @@ -210,6 +238,7 @@ .hds-hero { --padding-horizontal: var(--horizontal-padding-medium); --padding-vertical: var(--spacing-layout-m); + --arrow-icon-size: 164px; } .hds-hero--with-background__background, diff --git a/packages/core/src/components/hero/hero.stories.js b/packages/core/src/components/hero/hero.stories.js index 23b6586302..42e0ebee56 100644 --- a/packages/core/src/components/hero/hero.stories.js +++ b/packages/core/src/components/hero/hero.stories.js @@ -1,9 +1,16 @@ import './hero.css'; +import '../../icons/icon.css'; export default { title: 'Components/Hero', }; +const arrowIcon = ` +
+ +
+`; + const button = ` + +) +``` + +```html + +
+
+
+
+
+
+

Hero title

+

+ This is an introduction text. The length is circa two sentences. The suitable total length of the title + and introduction is around 230 characters, including spaces. The intro ends with a period. +

+ +
+
+
+
+
+
+
+
+ +
+
+
+
+
+ +
+
+
+ +
+
+
+``` + + + **Note:** Hero with diagonal Koros adjusts its contents based on browser width. Preview here might might not scale correcly. View Hero with diagonal Koros example in Storybook. ### Packages @@ -127,3 +226,4 @@ Note! You can find the full list of properties in the Hero title @@ -74,6 +77,7 @@ import { Hero } from 'hds-react'; -
+
@@ -113,6 +117,9 @@ import { Hero } from 'hds-react';
+
+ +
``` diff --git a/site/src/docs/components/hero/index.mdx b/site/src/docs/components/hero/index.mdx index fd49003cc0..66f050906a 100644 --- a/site/src/docs/components/hero/index.mdx +++ b/site/src/docs/components/hero/index.mdx @@ -28,9 +28,7 @@ export default ({ children, pageContext }) => - Call to action - + >Call to action @@ -51,6 +49,7 @@ export default ({ children, pageContext }) => HDS Koros documentation. - **Title and introduction (required):** The suitable total length of the title and introduction is circa 230 characters, including spaces. The intro ends with a period. - **CTA:** Buttons can also be added to the Hero component, and it is recommended to include, e.g. the most critical link of the page in the Hero component, if one is known. By default, use a button with a background colour (primary button style). On dark background colours, secondary button style can be used. +- **Arrow icon:** Hero can contain an arrow icon on the bottom left corner to indicate there's more content. The arrow slightly overlaps both the Hero and the following content. Can be used on all Hero variants and the color can be changed in Hero's theme. ### React subcomponents @@ -84,9 +83,7 @@ Use when you want to support the title's message with an image. Don't use an ima variant="secondary" role="link" style={{ '--background-color': '#000', '--color': '#fff', '--border-color': '#000' }} - > - Call to action - + >Call to action @@ -110,9 +107,7 @@ Use when you want to fill the background area with an image. Use an image that w variant="secondary" role="link" style={{ '--background-color': '#000', '--color': '#fff', '--border-color': '#000' }} - > - Call to action - + >Call to action @@ -138,9 +133,7 @@ Use when you want to create a dynamic Hero layout on your page. Ensure the image variant="secondary" role="link" style={{ '--background-color': '#000', '--color': '#fff', '--border-color': '#000' }} - > - Call to action - + >Call to action @@ -166,9 +159,7 @@ Use when you want to emphasize the title and introduction text content over the variant="secondary" role="link" style={{ '--background-color': '#000', '--color': '#fff', '--border-color': '#000' }} - > - Call to action - + >Call to action @@ -192,8 +183,31 @@ Use when you don't have a suitable image to support the title section's message variant="secondary" role="link" style={{ '--background-color': '#000', '--color': '#fff', '--border-color': '#000' }} - > - Call to action - + >Call to action + +#### Arrow icon + +Used to indicate there's more content to follow. + + + + Hero with an arrow icon + This is an introduction text. The length is circa two sentences. The suitable total length of the title and introduction is around 230 characters, including spaces. The intro ends with a period. + + + \ No newline at end of file diff --git a/yarn.lock b/yarn.lock index 0635912f3e..85f286e3d5 100644 --- a/yarn.lock +++ b/yarn.lock @@ -20591,11 +20591,6 @@ normalize-url@^8.0.0: resolved "https://registry.yarnpkg.com/normalize-url/-/normalize-url-8.0.0.tgz#593dbd284f743e8dcf6a5ddf8fadff149c82701a" integrity sha512-uVFpKhj5MheNBJRTiMZ9pE/7hD1QTeEvugSJW/OmLzAp78PB5O6adfMNTvmfKhXBkvCzC+rqifWcVYpGFwTjnw== -normalize.css@8.0.1: - version "8.0.1" - resolved "https://registry.yarnpkg.com/normalize.css/-/normalize.css-8.0.1.tgz#9b98a208738b9cc2634caacbc42d131c97487bf3" - integrity sha512-qizSNPO93t1YUuUhP22btGOo3chcvDFqFaj2TRybP0DMxkHOCTYwp3n34fel4a31ORXy4m1Xq0Gyqpb5m33qIg== - not@^0.1.0: version "0.1.0" resolved "https://registry.yarnpkg.com/not/-/not-0.1.0.tgz#c9691c1746c55dcfbe54cbd8bd4ff041bc2b519d"