Skip to content

Commit

Permalink
Merge branch 'main' into 4248-language-switch-improvement
Browse files Browse the repository at this point in the history
  • Loading branch information
leagrdv committed Dec 20, 2024
2 parents f5054b1 + ede92e4 commit a538ccc
Show file tree
Hide file tree
Showing 117 changed files with 848 additions and 709 deletions.
5 changes: 5 additions & 0 deletions .changeset/big-maps-pay.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@swisspost/design-system-documentation': patch
---

Updated header documentation by specifying `post-logo` slot explicitly.
5 changes: 5 additions & 0 deletions .changeset/early-baboons-cross.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@swisspost/design-system-components': patch
---

Added a `type="button"` attribute to the `post-close-button` to prevent it from submitting forms.
5 changes: 5 additions & 0 deletions .changeset/early-knives-own.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@swisspost/design-system-components': patch
---

Removed auto slotting from `post-togglebutton` component to enable more flexible usage.
5 changes: 5 additions & 0 deletions .changeset/flat-badgers-fly.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@swisspost/design-system-styles': patch
---

Fixed alignment of ´form-switch´ label.
5 changes: 5 additions & 0 deletions .changeset/four-jokes-tease.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@swisspost/design-system-styles': patch
---

Added hover styles in high contrast mode for the css components `Button`, `Chip`, `Form Search` and `Button Close`.
7 changes: 7 additions & 0 deletions .changeset/fresh-files-crash.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
'@swisspost/design-system-documentation': patch
'@swisspost/design-system-components': patch
'@swisspost/design-system-styles': patch
---

Removed all usage of deprecated utility sizing classes.
5 changes: 5 additions & 0 deletions .changeset/fresh-schools-peel.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@swisspost/design-system-styles': patch
---

Added styles for text links and icon-buttons for Composible Footer in HCM.
6 changes: 6 additions & 0 deletions .changeset/good-spoons-tie.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'@swisspost/design-system-nextjs-integration': patch
'@swisspost/design-system-documentation': patch
---

Aligned `width` and `height` percentage classes, after utility update.
5 changes: 5 additions & 0 deletions .changeset/metal-geese-swim.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@swisspost/design-system-styles': patch
---

Fixed colors of validation icon in HCM on form elements.
5 changes: 5 additions & 0 deletions .changeset/nice-beans-impress.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@swisspost/design-system-components': patch
---

Removed auto slotting from `post-logo` component to enable more flexible usage.
5 changes: 5 additions & 0 deletions .changeset/olive-squids-enjoy.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@swisspost/design-system-styles': patch
---

Fixed card control checkboxes' text color in HCM.
5 changes: 5 additions & 0 deletions .changeset/real-phones-scream.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@swisspost/design-system-components': patch
---

Modified header megadropdown to close when focus is moved outside.
5 changes: 5 additions & 0 deletions .changeset/smooth-spoons-matter.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@swisspost/design-system-documentation': patch
---

Updated header documentation by specifying `post-togglebutton` slot explicitly.
5 changes: 5 additions & 0 deletions .changeset/stale-guests-love.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@swisspost/design-system-styles': major
---

Removed deprecated utility sizing and line-height classes as well as `responsive-size`, `generate-utility-class` and all `bezel-*` mixins.
5 changes: 5 additions & 0 deletions .changeset/warm-walls-stare.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@swisspost/design-system-styles': patch
---

Refactored icon declarations to comply with Angular 18's new build system requirements.
5 changes: 5 additions & 0 deletions .changeset/wicked-scissors-buy.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@swisspost/design-system-components': patch
---

Removed focus from collapsible when in collapsed state.
4 changes: 4 additions & 0 deletions packages/components/cypress/fixtures/post-popover.test.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Document</title>
<link
href="../../node_modules/@swisspost/design-system-styles/post-external.css"
rel="stylesheet"
/>
<script src="../../dist/post-components/post-components.esm.js" type="module"></script>
</head>
<body>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@
@use '@swisspost/design-system-styles/components/form-check';
@use '@swisspost/design-system-styles/components/checkbox';
@use '@swisspost/design-system-styles/components/radio-button';
@use '@swisspost/design-system-styles/tokens/utilities';
@use '@swisspost/design-system-styles/functions/tokens';

tokens.$default-map: utilities.$post-spacing;

/*
* There are a whole bunch of !important statements in this file.
Expand All @@ -22,7 +26,7 @@
:host-context(fieldset) {
&:host(:not(:last-child)) {
.card-control {
margin-bottom: post.$size-regular;
margin-bottom: tokens.get('utility-gap-16');
}
}
}
Expand All @@ -38,18 +42,18 @@
display: grid;
grid-template: 'input label icon' 'input content content' / min-content auto min-content;
align-items: center;
gap: 0 post.$size-mini;
gap: 0 tokens.get('utility-gap-8');
margin: 0;
padding: post.$size-regular;
padding: tokens.get('utility-gap-12');
background-color: var(--post-card-control-bg);
border: post.$size-line solid var(--post-card-control-border-color);
border: tokens.get('utility-gap-2') solid var(--post-card-control-border-color);
border-radius: post.$border-radius;
color: var(--post-card-control-color) !important;
cursor: pointer;

.card-control--input {
grid-area: input;
margin: post.$size-micro 0;
margin: tokens.get('utility-gap-4') 0;
background-color: var(--post-card-control-input-bg) !important;
border-color: var(--post-card-control-input-border-color) !important;
color: var(--post-card-control-input-border-color) !important;
Expand Down Expand Up @@ -79,7 +83,7 @@

.card-control--label {
grid-area: label;
margin: post.$size-micro 0;
margin: tokens.get('utility-gap-4') 0;
padding: 0 !important;
color: inherit !important;
pointer-events: none;
Expand All @@ -101,8 +105,8 @@

.card-control--icon {
grid-area: icon;
width: post.$size-big;
height: post.$size-big;
width: tokens.get('utility-gap-32');
height: tokens.get('utility-gap-32');
pointer-events: none;

> slot {
Expand Down Expand Up @@ -195,11 +199,11 @@
--post-card-control-input-border-color: FieldText;
--post-card-control-input-bg: Field;

outline: post.$size-line solid Field;
outline-offset: post.$size-line * -2;
outline: tokens.get('utility-gap-2') solid Field;
outline-offset: calc(tokens.get('utility-gap-2') * -2);

.card-control--input {
outline: post.$size-line solid Field;
outline: tokens.get('utility-gap-2') solid Field;

// selector needed to override the .form-check styles
&[type] {
Expand Down Expand Up @@ -264,7 +268,7 @@
display: block;
content: '';
position: absolute;
inset: post.$size-line;
inset: tokens.get('utility-gap-2');
background-color: SelectedItem;
z-index: 1;
}
Expand Down Expand Up @@ -296,8 +300,8 @@
display: block;
content: '';
position: absolute;
inset: post.$size-line;
border-radius: post.$size-line * 0.5;
inset: tokens.get('utility-gap-2');
border-radius: calc(tokens.get('utility-gap-2') * 0.5);
background-color: SelectedItem;
}

Expand All @@ -306,7 +310,7 @@
}

.card-control--input {
outline: post.$size-line solid Field;
outline: tokens.get('utility-gap-2') solid Field;
}
}
}
Expand Down Expand Up @@ -432,7 +436,7 @@

:host([data-context*='fieldset']:not(:last-child)) {
.card-control {
margin-bottom: post.$size-regular;
margin-bottom: tokens.get('utility-gap-16');
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export class PostClosebutton {
render() {
return (
<Host data-version={version}>
<button class="btn btn-icon-close">
<button class="btn btn-icon-close" type="button">
<post-icon aria-hidden="true" name="closex"></post-icon>
<span class="visually-hidden">
<slot></slot>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ export class PostCollapsible {

render() {
return (
<Host data-version={version}>
<Host data-version={version} tabindex={this.collapsed ? -1 : undefined}>
<slot />
</Host>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,10 @@ slot[name='post-logo'] {
z-index: 1;
inset-block-start: var(--global-header-height);
padding-inline: var(--post-core-dimension-8) var(--post-core-dimension-16);

&.title-header-mobile-extended {
border-bottom: 1px solid var(--post-core-color-sandgrey-012);
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,12 @@ export class PostHeader {
</div>
</div>
</div>
<div class="title-header d-flex space-between align-center">
<div
class={
'title-header d-flex space-between align-center ' +
(this.mobileMenuExtended ? 'title-header-mobile-extended' : '')
}
>
<slot name="title"></slot>
<div class="global-sub">
<slot name="local-controls"></slot>
Expand Down
2 changes: 1 addition & 1 deletion packages/components/src/components/post-logo/post-logo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export class PostLogo {
const LogoTag = logoLink ? 'a' : 'span';

return (
<Host data-version={version} slot="post-logo">
<Host data-version={version}>
<LogoTag class="logo" {...(logoLink ? { href: logoLink } : {})}>
<span class="description">
<slot onSlotchange={() => this.checkDescription()}></slot>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ post-popovercontainer {
left: 0;
width: 100%;
height: auto;
border-top: unset;

&.slide-in {
animation: slide-in;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,14 @@ export class PostMegadropdown {
this.popoverRef.hide();
}

private handleFocusout(event: FocusEvent) {
const relatedTarget = event.relatedTarget as HTMLElement;
const megadropdown= this.popoverRef.querySelector('.megadropdown');
if (!megadropdown.contains(relatedTarget)) {
this.hide();
}
}

render() {
return (
<Host>
Expand All @@ -89,7 +97,7 @@ export class PostMegadropdown {
edge-gap="0"
ref={el => (this.popoverRef = el)}
>
<div class="megadropdown">
<div class="megadropdown" onFocusout={e => this.handleFocusout(e)}>
<div onClick={() => this.handleBackButtonClick()} class="back-button">
<slot name="back-button"></slot>
</div>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
@use '@swisspost/design-system-styles/core' as post;
@use '@swisspost/design-system-styles/tokens/utilities';
@use '@swisspost/design-system-styles/functions/tokens';

:host {
display: inline-block;
Expand All @@ -8,7 +10,7 @@
display: flex;
flex-wrap: wrap;
overflow: hidden;
margin: 0 (-(post.$size-micro));
margin: 0 calc(tokens.get('utility-gap-4', utilities.$post-spacing) * -1);
border-radius: post.$border-radius;

.star {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ export class PostTogglebutton {
render() {
return (
<Host
slot="post-togglebutton"
data-version={version}
role="button"
tabindex="0"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,15 @@
@use '@swisspost/design-system-styles/variables/color';
@use '@swisspost/design-system-styles/functions/color' as color-fn;
@use '@swisspost/design-system-styles/variables/spacing';
@use '@swisspost/design-system-styles/tokens/utilities';
@use '@swisspost/design-system-styles/functions/tokens';

tokens.$default-map: utilities.$post-spacing;

post-popovercontainer {
padding: spacing.$size-micro spacing.$size-mini;
max-width: 2 * spacing.$size-bigger-giant - spacing.$size-mini;
min-height: spacing.$size-regular;
padding: tokens.get('utility-gap-4') tokens.get('utility-gap-8');
max-width: calc(2 * tokens.get('utility-gap-112') - tokens.get('utility-gap-8'));
min-height: tokens.get('utility-gap-16');

// Creates a safe space around the popovercontainer for save pointer crossing between trigger and tooltip
&[arrow] {
Expand Down
4 changes: 2 additions & 2 deletions packages/components/src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<body style="min-height: 200vh">
<post-header>
<!-- Logo -->
<post-logo>Homepage</post-logo>
<post-logo slot="post-logo">Homepage</post-logo>

<!-- Meta navigation -->
<ul class="list-inline" slot="meta-navigation">
Expand All @@ -27,7 +27,7 @@
</ul>

<!-- Menu button for mobile -->
<post-togglebutton>
<post-togglebutton slot="post-togglebutton">
<span class="visually-hidden-sm">Menu</span>
<post-icon aria-hidden="true" name="burger" data-showWhen="untoggled"></post-icon>
<post-icon aria-hidden="true" name="closex" data-showWhen="toggled"></post-icon>
Expand Down
1 change: 1 addition & 0 deletions packages/components/src/utils/get-focusable-children.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ const focusDisablingSelector = `:where(${[
'[popover]:not(:popover-open) *',
'details:not([open]) > *:not(details > summary:first-of-type)',
'details:not([open]) > *:not(details > summary:first-of-type) *',
'[tabindex^="-"]',
].join(',')})`;

export const getFocusableChildren = (element: Element): NodeListOf<HTMLElement> => {
Expand Down
Loading

0 comments on commit a538ccc

Please sign in to comment.