Skip to content
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

chore(documentation): add react components package docs #4669

Merged
merged 4 commits into from
Feb 17, 2025
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
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
5 changes: 5 additions & 0 deletions .changeset/nasty-plants-shop.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@swisspost/design-system-components': patch
---

Added documentation for the `design-system-components-react` package
leagrdv marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
import { Meta, Source } from '@storybook/blocks';
import * as PackageStories from './components-react.stories';
import ReactAppModuleSample from './react-app-module.sample.ts?raw';
import changelog from '@/../../components-react/CHANGELOG.md?raw';
import PackageDocs from '@/shared/packages-docs-layout.mdx';

<Meta of={PackageStories} />

# @swisspost/design-system-components-react

[![npm version](https://badge.fury.io/js/@swisspost%2Fdesign-system-components-react.svg)](https://badge.fury.io/js/@swisspost%2Fdesign-system-components-react)

<div className="lead">The Design System React Components, ready for use in your React project.</div>

<PackageDocs changelog={changelog}>
## Dependencies

<div className="table-responsive table-fit-content text-start">
<table aria-describedby="dependencies" className="table">
<thead>
<tr>
<th scope="col">Version</th>
<th scope="col">React</th>
</tr>
</thead>

<tbody>
<tr>
<th scope="row">9.x</th>
<td>18.x</td>
</tr>
</tbody>
</table>

</div>

## Installation

<Source code={`npm install @swisspost/design-system-components-react`} language="bash" />

## Usage

Importing the components to your project.

<Source code={ReactAppModuleSample} language="typescript" />
</PackageDocs>
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: '13b9c7f1-993d-4348-a3b7-a7ceb92fd5c7',
title: 'Packages/Components for React',
parameters: {
badges: [],
},
leagrdv marked this conversation as resolved.
Show resolved Hide resolved
};

export default meta;

type Story = StoryObj;

export const Default: Story = {};
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
// app.tsx

import { PostComponent } from '@swisspost/design-system-components-react';

function App() {
return (
<>
<PostComponent>My component content</PostComponent>
</>
);
}
leagrdv marked this conversation as resolved.
Show resolved Hide resolved
Loading