Skip to content

Commit

Permalink
Merge branch 'release/v8' into 3359-fix-card-control-colors
Browse files Browse the repository at this point in the history
  • Loading branch information
leagrdv authored Dec 19, 2024
2 parents 3fce199 + ea6e622 commit 5a78687
Show file tree
Hide file tree
Showing 84 changed files with 4,119 additions and 2,548 deletions.
6 changes: 6 additions & 0 deletions .changeset/2024-12-15-update-icons.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'@swisspost/design-system-icons': minor
---

Added icons number 2634, 2635, 2636, 2637, 2638, 2639, 2640 and 2641.

5 changes: 0 additions & 5 deletions .changeset/chilly-seals-serve.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/poor-beers-retire.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/strong-rabbits-ring.md

This file was deleted.

5 changes: 5 additions & 0 deletions .changeset/violet-ears-punch.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@swisspost/design-system-styles': patch
---

Added missing spinner size class.
1 change: 0 additions & 1 deletion .github/actions/deploy-to-netlify/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ runs:
- name: Install netlify-cli
shell: bash
run: pnpm i -g netlify-cli@16

- name: Deploy preview environment to netlify
id: netlify_deploy
shell: bash
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/deploy-demo.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@ name: Deploy Demo App Preview to Netlify
on:
workflow_run:
workflows: ['Build Demo App']
types:
- completed
types: [completed]

jobs:
deploy:
Expand All @@ -21,6 +20,8 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: ${{ github.event.workflow_run.head_branch }}

- name: Setup
uses: ./.github/actions/setup-pnpm
Expand Down
16 changes: 16 additions & 0 deletions packages/components-angular/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,21 @@
# @swisspost/design-system-components-angular-workspace

## 1.1.17

### Patch Changes

- Updated dependencies:
- @swisspost/design-system-styles@8.6.2
- @swisspost/design-system-components@8.6.2

## 1.1.16

### Patch Changes

- Updated dependencies:
- @swisspost/design-system-components@8.6.1
- @swisspost/design-system-styles@8.6.1

## 1.1.15

### Patch Changes
Expand Down
6 changes: 3 additions & 3 deletions packages/components-angular/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@swisspost/design-system-components-angular-workspace",
"version": "1.1.15",
"version": "1.1.17",
"scripts": {
"start": "ng serve --port 9210",
"build": "ng build components",
Expand All @@ -18,8 +18,8 @@
"@angular/platform-browser": "18.1.3",
"@angular/platform-browser-dynamic": "18.1.3",
"@angular/router": "18.1.3",
"@swisspost/design-system-components": "workspace:8.6.0",
"@swisspost/design-system-styles": "workspace:8.6.0",
"@swisspost/design-system-components": "workspace:8.6.2",
"@swisspost/design-system-styles": "workspace:8.6.2",
"rxjs": "7.8.1",
"tslib": "2.6.3",
"zone.js": "0.14.8"
Expand Down
14 changes: 14 additions & 0 deletions packages/components-angular/projects/components/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,19 @@
# @swisspost/design-system-components-angular

## 8.6.2

### Patch Changes

- Updated dependencies:
- @swisspost/design-system-components@8.6.2

## 8.6.1

### Patch Changes

- Updated dependencies:
- @swisspost/design-system-components@8.6.1

## 8.6.0

### Patch Changes
Expand Down
4 changes: 2 additions & 2 deletions packages/components-angular/projects/components/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@swisspost/design-system-components-angular",
"version": "8.6.0",
"version": "8.6.2",
"description": "Swiss Post Design System - Angular Wrapper Components",
"author": "Swiss Post <[email protected]>",
"license": "Apache-2.0",
Expand All @@ -19,7 +19,7 @@
},
"dependencies": {
"tslib": "2.6.3",
"@swisspost/design-system-components": "workspace:8.6.0"
"@swisspost/design-system-components": "workspace:8.6.2"
},
"peerDependencies": {
"@angular/common": "^16.0.0 || ^17.0.0 || ^18.0.0",
Expand Down
14 changes: 14 additions & 0 deletions packages/components-react/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,19 @@
# @swisspost/design-system-components-react

## 8.6.2

### Patch Changes

- Updated dependencies:
- @swisspost/design-system-components@8.6.2

## 8.6.1

### Patch Changes

- Updated dependencies:
- @swisspost/design-system-components@8.6.1

## 8.6.0

### Patch Changes
Expand Down
4 changes: 2 additions & 2 deletions packages/components-react/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@swisspost/design-system-components-react",
"version": "8.6.0",
"version": "8.6.2",
"license": "Apache-2.0",
"main": "dist/index.js",
"types": "dist/index.d.ts",
Expand All @@ -20,7 +20,7 @@
"lint": "eslint src/**/*.ts"
},
"dependencies": {
"@swisspost/design-system-components": "workspace:8.6.0"
"@swisspost/design-system-components": "workspace:8.6.2"
},
"devDependencies": {
"@types/node": "20.14.14",
Expand Down
20 changes: 20 additions & 0 deletions packages/components/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,25 @@
# @swisspost/design-system-components

## 8.6.2

### Patch Changes

- Made `post-icon` component use base tag href to define location of icons folder. (by [@leagrdv](https://github.com/leagrdv) with [#4128](https://github.com/swisspost/design-system/pull/4128))
- Updated dependencies:
- @swisspost/design-system-styles@8.6.2

## 8.6.1

### Patch Changes

- Fixed bug in console upon exiting tooltip. (by [@leagrdv](https://github.com/leagrdv) with [#4014](https://github.com/swisspost/design-system/pull/4014))

- Fixed bug that showed delayed tooltip even after blur event. (by [@leagrdv](https://github.com/leagrdv) with [#4103](https://github.com/swisspost/design-system/pull/4103))

- Removed strikethrough style on disabled elements. (by [@leagrdv](https://github.com/leagrdv) with [#4095](https://github.com/swisspost/design-system/pull/4095))
- Updated dependencies:
- @swisspost/design-system-styles@8.6.1

## 8.6.0

### Patch Changes
Expand Down
6 changes: 3 additions & 3 deletions packages/components/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@swisspost/design-system-components",
"version": "8.6.0",
"version": "8.6.2",
"description": "A collection of web components built with Stencil JS for the Swiss Post Design System.",
"license": "Apache-2.0",
"main": "dist/index.cjs.js",
Expand All @@ -26,7 +26,7 @@
"scripts": {
"dev": "stencil build --dev --port 9200 --serve --watch --docs --docs-readme",
"start": "stencil build --dev --watch --docs --docs-readme",
"build": "stencil build --docs-readme",
"build": "pnpm clean && stencil build --docs-readme",
"clean": "rimraf www dist loader loaders",
"test": "pnpm run unit",
"unit": "stencil test --spec",
Expand All @@ -40,7 +40,7 @@
"dependencies": {
"@floating-ui/dom": "1.6.8",
"@oddbird/popover-polyfill": "0.3.7",
"@swisspost/design-system-styles": "workspace:8.6.0",
"@swisspost/design-system-styles": "workspace:8.6.2",
"ally.js": "1.4.1",
"long-press-event": "2.5.0"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,6 @@
--post-card-control-input-bg: transparent;

border-style: dashed;
text-decoration: line-through;
cursor: default;

.card-control--input {
Expand Down
3 changes: 2 additions & 1 deletion packages/components/src/components/post-icon/post-icon.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,8 @@ export class PostIcon {
.querySelector('meta[name="design-system-settings"][data-post-icon-base]')
?.getAttribute('data-post-icon-base') ?? null;

const fileBase = `${this.base ?? metaBase ?? CDN_URL}/`.replace(/\/\/$/, '/');
const baseHref = document.getElementsByTagName('base')[0]?.href;
const fileBase = `${this.base ?? metaBase ?? baseHref ?? CDN_URL}/`.replace(/\/\/$/, '/');
const fileName = `${this.name}.svg`;
const filePath = `${fileBase}${fileName}`;

Expand Down
43 changes: 30 additions & 13 deletions packages/components/src/components/post-tooltip/post-tooltip.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { version } from '@root/package.json';
import isFocusable from 'ally.js/is/focusable';
import 'long-press-event';
import { getAttributeObserver } from '@/utils/attribute-observer';
import { checkEmptyOrType, timeout } from '@/utils';
import { checkEmptyOrType } from '@/utils';

const OPEN_DELAY = 650; // matches HTML title delay

Expand All @@ -19,6 +19,8 @@ let tooltipInstances = 0;
let hideTooltipTimeout: number = null;
const tooltipTargetAttribute = 'data-tooltip-target';
const tooltipTargetAttributeSelector = `[${tooltipTargetAttribute}]`;
let globalCurrentTarget: HTMLElement;
let tooltipTimeout = null;

/**
* Global event listener to show tooltips. This is globalized so that triggers that are rendered
Expand All @@ -34,7 +36,11 @@ const globalInterestHandler = (e: PointerEvent | FocusEvent) => {
const targetElement = (e.target as HTMLElement).closest(
tooltipTargetAttributeSelector,
) as HTMLElement;
if (!targetElement || !('getAttribute' in targetElement)) return;
globalCurrentTarget = targetElement;
if (!targetElement || !('getAttribute' in targetElement)) {
clearTimeout(tooltipTimeout);
return;
}
const tooltipTarget = targetElement.getAttribute(tooltipTargetAttribute);
if (!tooltipTarget || tooltipTarget === '') return;
const tooltip = document.getElementById(tooltipTarget) as HTMLPostTooltipElement;
Expand Down Expand Up @@ -199,19 +205,30 @@ export class PostTooltip {
*/
@Method()
async show(target: HTMLElement, triggeredByFocus = false) {
if (this.delayed) await timeout(OPEN_DELAY);

// Determine if the tooltip was opened by a focus event
this.wasOpenedByFocus = triggeredByFocus;

// Disable pointer events if triggered by focus, otherwise enable them
if (this.wasOpenedByFocus) {
this.host.style.pointerEvents = 'none';
const showTooltip = () => {
// If focus or pointer event is not on the button anymore, don't show the tooltip
if (globalCurrentTarget !== target) return;

// Determine if the tooltip was opened by a focus event
this.wasOpenedByFocus = triggeredByFocus;

// Disable pointer events if triggered by focus, otherwise enable them
if (this.wasOpenedByFocus) {
this.host.style.pointerEvents = 'none';
} else {
this.host.style.pointerEvents = 'auto';
}

this.popoverRef.show(target);
};

if (this.delayed) {
tooltipTimeout = setTimeout(() => {
showTooltip();
}, OPEN_DELAY);
} else {
this.host.style.pointerEvents = 'auto';
showTooltip();
}

this.popoverRef.show(target);
}

/**
Expand Down
21 changes: 21 additions & 0 deletions packages/demo/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,26 @@
# @swisspost/design-system-demo

## 8.0.10

### Patch Changes

- Updated dependencies:
- @swisspost/design-system-styles@8.6.2
- @swisspost/design-system-intranet-header@8.6.2
- @swisspost/design-system-migrations@8.6.2

## 8.0.9

### Patch Changes

- Updated the avatar url, used to load a users profile picture form the intranet backend.
! The required input value has recently changed !
Due to the technical conversion of the intranet backend from Sitecore to Sharepoint, the value required for the property to display a user image has changed. Previously the user ID was required, now this property expects the user-specific e-mail address. (by [@oliverschuerch](https://github.com/oliverschuerch) with [#4117](https://github.com/swisspost/design-system/pull/4117))
- Updated dependencies:
- @swisspost/design-system-intranet-header@8.6.1
- @swisspost/design-system-styles@8.6.1
- @swisspost/design-system-migrations@8.6.1

## 8.0.8

### Patch Changes
Expand Down
8 changes: 4 additions & 4 deletions packages/demo/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@swisspost/design-system-demo",
"version": "8.0.8",
"version": "8.0.10",
"description": "Pattern documentation, code snippets and implementation guidelines for the Design System Styles.",
"author": "Swiss Post <[email protected]>",
"license": "Apache-2.0",
Expand All @@ -25,9 +25,9 @@
"@ng-bootstrap/ng-bootstrap": "17.0.0",
"@popperjs/core": "2.11.8",
"@swimlane/ngx-datatable": "20.1.0",
"@swisspost/design-system-intranet-header": "workspace:8.6.0",
"@swisspost/design-system-migrations": "workspace:8.6.0",
"@swisspost/design-system-styles": "workspace:8.6.0",
"@swisspost/design-system-intranet-header": "workspace:8.6.2",
"@swisspost/design-system-migrations": "workspace:8.6.2",
"@swisspost/design-system-styles": "workspace:8.6.2",
"bootstrap": "5.3.3",
"core-js": "3.37.1",
"highlight.js": "11.10.0",
Expand Down
5 changes: 5 additions & 0 deletions packages/demo/src/app/app-routing.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ import { LayoutContainerComponent } from './layout-container/layout-container.co
import { IntranetHeaderDemoRegularComponent } from './intranet-layout/components/intranet-header-demo-regular/intranet-header-demo-regular.component';
import { IntranetHeaderDemoBigSidebarComponent } from './intranet-layout/components/intranet-header-demo-big-sidebar/intranet-header-demo-big-sidebar.component';
import { IntranetHeaderDemoSmallSidebarComponent } from './intranet-layout/components/intranet-header-demo-small-sidebar/intranet-header-demo-small-sidebar.component';
import { IntranetHeaderDemoCondensedComponent } from './intranet-layout/components/intranet-header-demo-condensed/intranet-header-demo-condensed.component';
/* tslint:enable:max-line-length */

const routes: Routes = [
Expand Down Expand Up @@ -166,6 +167,10 @@ const routes: Routes = [
path: 'intranet-layout-sidebar-small-sidebar',
component: IntranetHeaderDemoSmallSidebarComponent,
},
{
path: 'intranet-layout-condensed',
component: IntranetHeaderDemoCondensedComponent,
},
],
},
];
Expand Down
Loading

0 comments on commit 5a78687

Please sign in to comment.