Skip to content

Commit

Permalink
chore(documentation): add package design-system-tokens on start page … (
Browse files Browse the repository at this point in the history
#3997)

Note, that the GUID in
packages/documentation/src/stories/getting-started/packages/tokens/tokens.stories.ts
is randomly generated. I'm not sure if this correct, but as far as I
understand that's where it's defined.

---------

Co-authored-by: Philipp Gfeller <[email protected]>
  • Loading branch information
tom-tschiller and gfellerph authored Dec 4, 2024
1 parent 15c3a33 commit e10f039
Show file tree
Hide file tree
Showing 6 changed files with 56 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/rotten-bats-look.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@swisspost/design-system-documentation': minor
---

Added tokens package icon to the home page
1 change: 1 addition & 0 deletions packages/documentation/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
"@swisspost/design-system-components-react": "workspace:9.0.0-next.7",
"@swisspost/design-system-icons": "workspace:9.0.0-next.7",
"@swisspost/design-system-styles": "workspace:9.0.0-next.7",
"@swisspost/design-system-tokens": "workspace:9.0.0-next.7",
"@swisspost/internet-header": "workspace:2.0.0-next.7",
"bootstrap": "5.3.3"
},
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
22 changes: 22 additions & 0 deletions packages/documentation/src/shared/packages.data.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
import { DEPENDENCIES, getVersion } from '@/utils/version';

import metaStyles from '@/stories/packages/styles/styles.stories';
import metaComponents from '@/stories/packages/components/components.stories';
import metaComponentsAngular from '@/stories/packages/components-angular/components-angular.stories';
import metaInternetHeader from '@/stories/packages/internet-header/internet-header.stories';
import metaIntranetHeader from '@/stories/packages/intranet-header/intranet-header.stories';
import metaIcons from '@/stories/packages/icons/package-icons.stories';
import metaTokens from '@/stories/packages/tokens/tokens.stories';
import { PackageType } from '@/../types';

interface IPackage {
Expand Down Expand Up @@ -145,6 +147,26 @@ export const packages: IPackage[] = [
},
version: `v${getVersion(DEPENDENCIES['@swisspost/design-system-icons'])}`,
},
{
name: 'Tokens',
docsStoryId: metaTokens.id,
type: PackageType.Assets,
link: {
github: {
href: 'https://github.com/swisspost/design-system/tree/main/packages/tokens',
ariaLabel: 'Source of Tokens package',
},
docs: {
href: generateDocsRelativeLink(metaTokens.id),
ariaLabel: 'Getting started with Tokens package',
},
},
img: {
src: '/assets/images/packages/tokens.svg',
alt: '',
},
version: `v${getVersion(DEPENDENCIES['@swisspost/design-system-tokens'])}`,
},
];

function generateDocsRelativeLink(storyId: string) {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import { StoryObj } from '@storybook/web-components';
import { MetaExtended } from '@root/types';

const meta: MetaExtended = {
id: 'c0af5a11-2b2f-427d-9cd3-cc323f49e56e',
title: 'Getting Started/Packages/Tokens',
parameters: {
badges: [],
},
};

export default meta;

type Story = StoryObj;

export const Default: Story = {};
3 changes: 3 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit e10f039

Please sign in to comment.