Skip to content

Commit

Permalink
(HDS-1833) Link changes
Browse files Browse the repository at this point in the history
  • Loading branch information
mrTuomoK committed Apr 29, 2024
1 parent 3168b8c commit cbdbdd2
Show file tree
Hide file tree
Showing 40 changed files with 156 additions and 135 deletions.
4 changes: 3 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- [Component] What are the breaking changes?
- [Tag] Rewritten Tag component
- [Button] Renewed Button component with theming support
- [Accordion] Changed size prop to use AccordionSize enum (AccordionSize.Small, AccordionSize.Medium and AccordionSize.Large) or without usin Typescript ("small", "medium" and "large"). Also theming has changed variables.
- [Accordion] Changed size prop to use AccordionSize enum (AccordionSize.Small, AccordionSize.Medium and AccordionSize.Large) or without using Typescript ("small", "medium" and "large"). Also theming has changed variables.
- [Link] iconLeft prop is renamed to iconStart, size prop is now enum (LinkSize.Small, .Medium and .Large). Aria-label is now native so ariaLabel prop is now obsolete -> use aria-label.

#### Added

Expand All @@ -37,6 +38,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- [Component] What are the breaking changes?
- [Tag] Rewritten Tag component
- [Button] Renewed Button component with theming support
- [Link] Renamed hds-icon-left class to hds-icon-start

#### Added

Expand Down
6 changes: 3 additions & 3 deletions packages/core/src/components/link/link.css
Original file line number Diff line number Diff line change
Expand Up @@ -73,17 +73,17 @@
margin-left: var(--spacing-s);
}

.hds-link--small .hds-icon-left {
.hds-link--small .hds-icon-start {
margin-right: 4px;
vertical-align: text-top;
}

.hds-link--medium .hds-icon-left {
.hds-link--medium .hds-icon-start {
margin-right: 8px;
vertical-align: sub;
}

.hds-link--large .hds-icon-left {
.hds-link--large .hds-icon-start {
margin-right: 16px;
vertical-align: middle;
}
2 changes: 1 addition & 1 deletion packages/core/src/components/link/link.stories.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ export const standaloneLink = () => `

export const withCustomIcon = () => `
<a href="https://hds.hel.fi" class="hds-link hds-link--medium" aria-label="Document link. Opens in external domain">
<span class="hds-icon-left"><i class="hds-icon hds-icon--document hds-icon--size-s" aria-hidden="true"></i></span>Document link
<span class="hds-icon-start"><i class="hds-icon hds-icon--document hds-icon--size-s" aria-hidden="true"></i></span>Document link
</a>
`
withCustomIcon.storyName = 'With a custom icon';
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ exports[`<Breadcrumb /> spec renders the component 1`] = `
class="listItem"
>
<a
class="link linkM link"
class="link link-medium link"
href="/"
>
Home
Expand Down Expand Up @@ -43,7 +43,7 @@ exports[`<Breadcrumb /> spec renders the component 1`] = `
class="listItem"
>
<a
class="link linkM link"
class="link link-medium link"
href="/level1"
>
Level 1
Expand Down Expand Up @@ -73,7 +73,7 @@ exports[`<Breadcrumb /> spec renders the component 1`] = `
class="listItem"
>
<a
class="link linkM link"
class="link link-medium link"
href="/level2"
>
Level 2
Expand Down Expand Up @@ -103,7 +103,7 @@ exports[`<Breadcrumb /> spec renders the component 1`] = `
class="listItem"
>
<a
class="link linkM link"
class="link link-medium link"
href="/level3"
>
Level 3
Expand Down Expand Up @@ -164,7 +164,7 @@ exports[`<Breadcrumb /> spec renders the component 1`] = `
</svg>
</span>
<a
class="link linkM link"
class="link link-medium link"
href="/level3"
>
Level 3
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ exports[`<Footer /> spec renders the component 1`] = `
class="logoWrapper"
>
<a
class="link linkM item"
class="link link-medium item"
tabindex="0"
>
<img
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ exports[`<Footer.Base /> spec renders the component 1`] = `
class="logoWrapper"
>
<a
class="link linkM item"
class="link link-medium item"
tabindex="0"
>
<img
Expand All @@ -83,7 +83,7 @@ exports[`<Footer.Base /> spec renders the component 1`] = `
|
</span>
<a
class="link linkM item base"
class="link link-medium item base"
>
<span>
Link 1
Expand All @@ -96,7 +96,7 @@ exports[`<Footer.Base /> spec renders the component 1`] = `
|
</span>
<a
class="link linkM item base"
class="link link-medium item base"
>
<span>
Link 2
Expand All @@ -109,7 +109,7 @@ exports[`<Footer.Base /> spec renders the component 1`] = `
|
</span>
<a
class="link linkM item base"
class="link link-medium item base"
>
<span>
Link 3
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
exports[`<Link /> spec renders the base variant 1`] = `
<DocumentFragment>
<a
class="link linkM item base"
class="link link-medium item base"
>
<span>
Link
Expand Down Expand Up @@ -62,7 +62,7 @@ exports[`<Link /> spec renders the component 1`] = `
Bar
</h2>
<a
class="link linkM item"
class="link link-medium item"
>
<span>
Link
Expand All @@ -77,7 +77,7 @@ exports[`<Link /> spec renders the component 1`] = `
exports[`<Link /> spec renders the navigation variant 1`] = `
<DocumentFragment>
<a
class="link linkM item navigation"
class="link link-medium item navigation"
>
<span>
Link
Expand All @@ -89,7 +89,7 @@ exports[`<Link /> spec renders the navigation variant 1`] = `
exports[`<Link /> spec renders the utility variant 1`] = `
<DocumentFragment>
<a
class="link linkM item utility"
class="link link-medium item utility"
>
<span>
Link
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,21 +53,21 @@ exports[`<Footer.Navigation /> spec renders the component 1`] = `
class="navigation"
>
<a
class="link linkM item navigation"
class="link link-medium item navigation"
>
<span>
Link 1
</span>
</a>
<a
class="link linkM item navigation"
class="link link-medium item navigation"
>
<span>
Link 2
</span>
</a>
<a
class="link linkM item navigation"
class="link link-medium item navigation"
>
<span>
Link 3
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,21 +53,21 @@ exports[`<Footer.NavigationGroup /> spec renders the navigation groups 1`] = `
class="navigation"
>
<a
class="link linkM item navigation"
class="link link-medium item navigation"
>
<span>
Link 1
</span>
</a>
<a
class="link linkM item navigation"
class="link link-medium item navigation"
>
<span>
Link 2
</span>
</a>
<a
class="link linkM item navigation"
class="link link-medium item navigation"
>
<span>
Link 3
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,23 +60,23 @@ exports[`<Footer.Utilities /> spec renders the component 1`] = `
class="links widerLinks"
>
<a
class="link linkM item utility"
class="link link-medium item utility"
href="https://hel.fi/helsinki/fi/kaupunki-ja-hallinto/osallistu-ja-vaikuta/ota-yhteytta/ota-yhteytta"
>
<span>
Yhteystiedot
</span>
</a>
<a
class="link linkM item utility"
class="link link-medium item utility"
href="https://hel.fi/helsinki/fi/kaupunki-ja-hallinto/osallistu-ja-vaikuta/palaute/anna-palautetta"
>
<span>
Anna ja lue palautetta
</span>
</a>
<a
class="link linkM item utility"
class="link link-medium item utility"
href="https://hel.fi/kanslia/neuvonta-fi"
>
<span>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,15 +72,15 @@ exports[`<Footer.UtilityGroup /> spec renders the utility groups 1`] = `
Main Page
</a>
<a
class="link linkM item utility"
class="link link-medium item utility"
href="https://google.com"
>
<span>
Sub page
</span>
</a>
<a
class="link linkM item utility"
class="link link-medium item utility"
href="https://google.com"
>
<span>
Expand All @@ -101,8 +101,8 @@ exports[`<Footer.UtilityGroup /> spec renders the utility groups 1`] = `
Social media
</span>
<a
aria-label="Helsingin kaupungin Facebook-tili"
class="link linkM item utility"
aria-label="Helsingin kaupungin Facebook-tili."
class="link link-medium item utility"
href="https://facebook.com/helsinginkaupunki/"
title="Helsingin kaupungin Facebook-tili"
>
Expand All @@ -126,8 +126,8 @@ exports[`<Footer.UtilityGroup /> spec renders the utility groups 1`] = `
</span>
</a>
<a
aria-label="Helsingin kaupungin Facebook-tili"
class="link linkM item utility"
aria-label="Helsingin kaupungin Facebook-tili."
class="link link-medium item utility"
href="https://facebook.com/helsinginkaupunki/"
title="Helsingin kaupungin Facebook-tili"
>
Expand Down
Loading

0 comments on commit cbdbdd2

Please sign in to comment.