From 4d0456fb3ecbd65ed362b51034dde076caa5b091 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Aliz=C3=A9=20Debray?=
<33580481+alizedebray@users.noreply.github.com>
Date: Thu, 4 Jan 2024 10:03:47 +0100
Subject: [PATCH] chore(internet-header,docs): improve and document the
internet header main slot (#2280)
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Co-authored-by: Philipp Gfeller <1659006+gfellerph@users.noreply.github.com>
Co-authored-by: Loïc Fürhoff <12294151+imagoiq@users.noreply.github.com>
---
.changeset/clean-dodos-joke.md | 5 +
.changeset/many-pets-divide.md | 5 +
.../components/header/header.stories.ts | 14 ++-
.../header-custom-content.docs.mdx | 12 +++
.../header-custom-content.stories.ts | 8 ++
.../cypress/e2e/main-slot.cy.ts | 101 ++++++++++++++++++
.../post-internet-header.scss | 10 +-
.../post-internet-header.tsx | 10 +-
.../post-main-navigation.scss | 1 +
pnpm-lock.yaml | 30 +++---
10 files changed, 174 insertions(+), 22 deletions(-)
create mode 100644 .changeset/clean-dodos-joke.md
create mode 100644 .changeset/many-pets-divide.md
create mode 100644 packages/documentation/src/stories/components/internet-header/components/header/overrides-stories/header-custom-content.docs.mdx
create mode 100644 packages/documentation/src/stories/components/internet-header/components/header/overrides-stories/header-custom-content.stories.ts
create mode 100644 packages/internet-header/cypress/e2e/main-slot.cy.ts
diff --git a/.changeset/clean-dodos-joke.md b/.changeset/clean-dodos-joke.md
new file mode 100644
index 0000000000..822a6c8ec1
--- /dev/null
+++ b/.changeset/clean-dodos-joke.md
@@ -0,0 +1,5 @@
+---
+'@swisspost/internet-header': patch
+---
+
+Improve the main navigation slot placement and styling.
diff --git a/.changeset/many-pets-divide.md b/.changeset/many-pets-divide.md
new file mode 100644
index 0000000000..ee561400cc
--- /dev/null
+++ b/.changeset/many-pets-divide.md
@@ -0,0 +1,5 @@
+---
+'@swisspost/design-system-documentation': minor
+---
+
+Add a page on how to add custom content to the internet header main navigation.
diff --git a/packages/documentation/src/stories/components/internet-header/components/header/header.stories.ts b/packages/documentation/src/stories/components/internet-header/components/header/header.stories.ts
index 9ba76acfbf..acd9b41ba6 100644
--- a/packages/documentation/src/stories/components/internet-header/components/header/header.stories.ts
+++ b/packages/documentation/src/stories/components/internet-header/components/header/header.stories.ts
@@ -1,8 +1,7 @@
import { Args, Meta, StoryObj } from '@storybook/web-components';
import { BADGE } from '../../../../../../.storybook/constants';
import { html } from 'lit';
-import { spread } from '@open-wc/lit-helpers';
-import { getAttributes } from '../../../../../utils';
+import { spreadArgs } from '../../../../../utils';
import customConfig from './config/custom-config';
import osFlyoutOverrides from './config/os-flyout-overrides';
import languageSwitchOverrides from './config/language-switch-overrides';
@@ -172,10 +171,9 @@ const meta: Meta = {
],
};
-function render(args: Args) {
- const attributes = getAttributes(args, arg => arg !== null && arg !== undefined);
+function render({ innerHMTL, ...args }: Args) {
return html`
-
Hello, User!
`, + }, +}; diff --git a/packages/documentation/src/stories/components/internet-header/components/header/overrides-stories/header-custom-content.docs.mdx b/packages/documentation/src/stories/components/internet-header/components/header/overrides-stories/header-custom-content.docs.mdx new file mode 100644 index 0000000000..3d820b1ba3 --- /dev/null +++ b/packages/documentation/src/stories/components/internet-header/components/header/overrides-stories/header-custom-content.docs.mdx @@ -0,0 +1,12 @@ +import { Meta, Canvas, Controls } from '@storybook/blocks'; +import * as HeaderStories from './header-custom-content.stories'; +import '../header.scss'; + + + +When you need to add your own content to the main navigation.
+