Skip to content

feat: add support for link.column-gap token #2485 #2797

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 35 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 34 commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
6e72e4d
feat: add support for link.column-gap token in link
Apr 11, 2025
ec5e709
feat: add `slot="icon"` and `slot="label"` support to `utrecht-link` …
Apr 11, 2025
e28c6fe
docs: add icon before after stories in link css storybook
Apr 11, 2025
6035199
docs: add icon and label for react link component
Apr 11, 2025
d04312e
chore: correct packages for token changeset
Apr 15, 2025
6581e3a
feat: add class `utrecht-link-button__label` to match extended `utrec…
Apr 15, 2025
b8135e5
feat: add class `utrecht-link-button__label` to match extended `utrec…
Apr 15, 2025
15825a0
feat: add tests for link with icon and label support
Apr 15, 2025
328f5a5
feat: add icon and label for react button-link component
Apr 15, 2025
6b3675d
feat: add icon and label for react link-button component
Apr 15, 2025
af9fa0c
feat: add `slot="icon"` and `slot="label"` support to `utrecht-button…
Apr 15, 2025
7dcf9a1
feat: add `slot="icon"` and `slot="label"` support to `utrecht-link-b…
Apr 15, 2025
6db48d0
refactor: consistent rendering of elements in the button/link/button-…
Apr 17, 2025
2046a70
docs: add link gap changeset should be minor
Apr 24, 2025
6fd8dc6
docs: icon in link in css storybook
Apr 25, 2025
be27b1a
docs: icon in button in css storybook
Apr 25, 2025
3478ded
docs: icon in button-link in css storybook
Apr 25, 2025
871d589
docs: icon in link-button in css storybook
Apr 25, 2025
990b4b1
feat: create missing link-button in angular based on link and button …
Apr 25, 2025
d77b496
docs: improve button-link angular story based on existing link and bu…
Apr 25, 2025
5e741a5
docs: add changeset for link-button angular component
Apr 25, 2025
a09f5f0
docs: icon in link-button in react storybook
Apr 25, 2025
e6106a4
docs: icon in link in react storybook
Apr 25, 2025
f254308
docs: icon in button-link in react storybook
Apr 25, 2025
ba94d93
docs: icon in button in react storybook
Apr 25, 2025
a419d95
docs: icon in button in web component storybook
Apr 25, 2025
ab6532d
docs: icon in button-link in web component storybook
Apr 25, 2025
eaf6fa3
docs: icon in link in web component storybook
Apr 25, 2025
750f706
docs: icon in link-button in web component storybook
Apr 25, 2025
7e23df1
refactor: remove not functioning optional element based on slot
Jun 10, 2025
7367be2
refactor: remove not functioning optional element based on slot
Jun 10, 2025
a80d399
fix: run prettier --write
Jun 10, 2025
785d8e2
chore: fix typo
Robbert Jun 16, 2025
a8c148f
refactor: use `createElement` instead of `cloneElement`
Robbert Jun 16, 2025
4611cb2
chore: update changeset from major to minor
Robbert Jun 16, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .changeset/add-button-link-label-class.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"@utrecht/component-library-css": minor
"@utrecht/button-link-css": minor
---

Add optional class `utrecht-button-link__label` to match extended optional class `utrecht-button__label`
5 changes: 5 additions & 0 deletions .changeset/add-button-link-label-react.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@utrecht/component-library-react": minor
---

Add an optional `label` and `icon` property to React `ButtonLink` component, to support better styling of icons.
7 changes: 7 additions & 0 deletions .changeset/add-button-link-slots.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
"@utrecht/web-component-library-angular": minor
"@utrecht/web-component-library-stencil": minor
"@utrecht/web-component-library-vue": minor
---

Add `slot="icon"` and `slot="label"` support to `utrecht-button-link` web component.
6 changes: 6 additions & 0 deletions .changeset/add-link-button-label-class.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"@utrecht/component-library-css": minor
"@utrecht/link-button-css": minor
---

Add optional class `utrecht-link-button__label` to match extended optional class `utrecht-link__label`
5 changes: 5 additions & 0 deletions .changeset/add-link-button-label-react.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@utrecht/component-library-react": minor
---

Add an optional `label` and `icon` property to React `LinkButton` component, to support better styling of icons.
7 changes: 7 additions & 0 deletions .changeset/add-link-button-slots.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
"@utrecht/web-component-library-angular": minor
"@utrecht/web-component-library-stencil": minor
"@utrecht/web-component-library-vue": minor
---

Add `slot="icon"` and `slot="label"` support to `utrecht-link-button` web component.
8 changes: 8 additions & 0 deletions .changeset/add-link-gap.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
"@utrecht/design-tokens": minor
"@utrecht/component-library-css": minor
"@utrecht/link-css": minor
"@utrecht/button-link-css": minor
---

Add design token `utrecht.link.column-gap`
6 changes: 6 additions & 0 deletions .changeset/add-link-label-css.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"@utrecht/component-library-css": minor
"@utrecht/link-css": minor
---

Add an optional element class `utrecht-link__label` to support other inline styling without a gap
6 changes: 6 additions & 0 deletions .changeset/add-link-label-react.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"@utrecht/component-library-react": minor
"@utrecht/link-react": minor
---

Add an optional `label` and `icon` property to React `Link` component, to support better styling of icons.
8 changes: 8 additions & 0 deletions .changeset/add-link-slots.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
"@utrecht/web-component-library-angular": minor
"@utrecht/web-component-library-react": minor
"@utrecht/web-component-library-stencil": minor
"@utrecht/web-component-library-vue": minor
---

Add `slot="icon"` and `slot="label"` support to `utrecht-link` web component.
9 changes: 9 additions & 0 deletions .changeset/consistent-l-b-slots.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
"@utrecht/component-library-angular": minor
"@utrecht/web-component-library-angular": minor
"@utrecht/web-component-library-react": minor
"@utrecht/web-component-library-stencil": minor
"@utrecht/web-component-library-vue": minor
---

Align slot behavior across `button`, `link`, `button-link` and `link-button` in Angular components, React components and web components: the `__label` element is always rendered and wraps both the `label` slot and the default slot.
5 changes: 5 additions & 0 deletions .changeset/yellow-meals-invite.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@utrecht/component-library-angular": major
---

Add `link-button` Angular component.
4 changes: 4 additions & 0 deletions components/button-link/src/_mixin.scss
Original file line number Diff line number Diff line change
Expand Up @@ -48,3 +48,7 @@
@include utrecht-button-link--active;
}
}

@mixin utrecht-button-link__label {
@include utrecht-button__label;
}
4 changes: 4 additions & 0 deletions components/button-link/src/index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@
@include utrecht-button-link--html-a;
}

.utrecht-button-link__label {
@include utrecht-button-link__label;
}

@include utrecht-button-appearance("utrecht-button-link", "primary-action");
@include utrecht-button-appearance("utrecht-button-link", "secondary-action");
@include utrecht-button-appearance("utrecht-button-link", "subtle");
4 changes: 4 additions & 0 deletions components/link-button/src/_mixin.scss
Original file line number Diff line number Diff line change
Expand Up @@ -83,3 +83,7 @@
padding-inline-end: 0;
padding-inline-start: 0;
}

@mixin utrecht-link-button__label {
@include utrecht-link__label;
}
4 changes: 4 additions & 0 deletions components/link-button/src/index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -57,3 +57,7 @@
@extend .utrecht-link-button--active;
}
}

.utrecht-link-button__label {
@include utrecht-link-button__label;
}
12 changes: 10 additions & 2 deletions components/link/src/_mixin.scss
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,11 @@ however browsers don't seem to have implemented great looking supixel tweening y
@mixin utrecht-link {
--utrecht-icon-size: var(--utrecht-link-icon-size, 1em);

align-items: center;
color: var(--_utrecht-link-state-color, var(--utrecht-link-color, var(--_utrecht-link-forced-colors-color)));
column-gap: var(--utrecht-link-column-gap);
display: inline-flex;
justify-content: center;
}

@mixin utrecht-link--any-link {
Expand Down Expand Up @@ -142,7 +146,7 @@ however browsers don't seem to have implemented great looking supixel tweening y

/*
* The following tokens are deprecated, but we keep them for backwards compatibility for now:
*
*
* `--utrecht-link-focus-text-decoration`
* `--utrecht-link-focus-text-decoration-thickness`
*/
Expand Down Expand Up @@ -198,7 +202,7 @@ however browsers don't seem to have implemented great looking supixel tweening y

/**
* Link for elements such as `<img>` or `<article>`, that are not inline elements or plain text.
*
*
* Changing `display: inline` to `inline-block` ensures the focus outline is rendered around the entire box.
*/
@mixin utrecht-link--box-content {
Expand Down Expand Up @@ -231,3 +235,7 @@ however browsers don't seem to have implemented great looking supixel tweening y
@include utrecht-link--focus-visible;
}
}

/* stylelint-disable-next-line block-no-empty */
@mixin utrecht-link__label {
}
4 changes: 4 additions & 0 deletions components/link/src/index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,10 @@
@include utrecht-link--placeholder;
}

.utrecht-link__label {
@include utrecht-link__label;
}

/**
* Simulate forced-colors mode.
*/
Expand Down
9 changes: 9 additions & 0 deletions components/link/src/tokens.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,15 @@
},
"type": "color"
},
"column-gap": {
"$extensions": {
"nl.nldesignsystem.css.property": {
"syntax": "<length>",
"inherits": true
}
},
"type": "spacing"
},
"text-decoration": {
"$extensions": {
"nl.nldesignsystem.css.property": {
Expand Down
1 change: 1 addition & 0 deletions packages/component-library-angular/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@
"@utrecht/heading-6-css": "workspace:*",
"@utrecht/html-content-css": "workspace:*",
"@utrecht/link-css": "workspace:*",
"@utrecht/link-button-css": "workspace:*",
"@utrecht/ordered-list-css": "workspace:*",
"@utrecht/page-content-css": "workspace:*",
"@utrecht/page-footer-css": "workspace:*",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ChangeDetectionStrategy, Component, Input, ViewEncapsulation } from '@angular/core';
import { ChangeDetectionStrategy, Component, ContentChild, ElementRef, Input, ViewEncapsulation } from '@angular/core';

export type AppearanceType = 'primary-action-button' | 'secondary-action-button' | 'subtle-button';

Expand All @@ -21,5 +21,5 @@ export type AppearanceType = 'primary-action-button' | 'secondary-action-button'
export class UtrechtButtonLinkAttr {
@Input() appearance?: AppearanceType;
@Input() external = false;
constructor() {}
@ContentChild('[slot=label]', { static: false }) labelSlot?: ElementRef;
}
Original file line number Diff line number Diff line change
@@ -1 +1,6 @@
<ng-content></ng-content>
<ng-content select="[slot=icon]"></ng-content>

<span class="utrecht-button-link__label">
<ng-content select="[slot=label]"></ng-content>
<ng-content></ng-content>
</span>
18 changes: 15 additions & 3 deletions packages/component-library-angular/src/button/component.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
import { ChangeDetectionStrategy, Component, Input, ViewEncapsulation } from '@angular/core';
import {
AfterContentInit,
ChangeDetectionStrategy,
Component,
ContentChild,
ElementRef,
Input,
ViewEncapsulation,
} from '@angular/core';

@Component({
selector:
Expand Down Expand Up @@ -26,9 +34,13 @@ import { ChangeDetectionStrategy, Component, Input, ViewEncapsulation } from '@a
'[class.utrecht-button]': 'true',
},
})
export class UtrechtButtonAttr {
export class UtrechtButtonAttr implements AfterContentInit {
@Input() busy = false;
@Input() pressed? = undefined;
@Input() appearance?: string;
constructor() {}
@ContentChild('[slot=label]', { static: false }) labelSlot?: ElementRef;
hasLabel = false;
ngAfterContentInit() {
this.hasLabel = !!this.labelSlot;
}
}
6 changes: 6 additions & 0 deletions packages/component-library-angular/src/button/index.html
Original file line number Diff line number Diff line change
@@ -1 +1,7 @@
<ng-content select="[slot=icon]"></ng-content>

<span class="utrecht-button__label" *ngIf="hasLabel">
<ng-content select="[slot=label]"></ng-content>
</span>

<ng-content></ng-content>
1 change: 1 addition & 0 deletions packages/component-library-angular/src/components.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ export * from './heading-5/component';
export * from './heading-6/component';
export * from './html-content/component';
export * from './link/component';
export * from './link-button/component';
export * from './ordered-list/component';
export * from './ordered-list/item.component';
export * from './page-content/component';
Expand Down
Loading