generated from nl-design-system/example
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into fix/card-nested-anchors
- Loading branch information
Showing
28 changed files
with
1,119 additions
and
107 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
89 changes: 89 additions & 0 deletions
89
packages/storybook/src/web-components/accordion.stories.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
import { AccordionWebComponent } from '@rijkshuisstijl-community/web-components'; | ||
import type { Meta, StoryObj } from '@storybook/web-components'; | ||
import readme from '@utrecht/components/accordion/README.md?raw'; | ||
import { mergeMarkdown } from '../../helpers/merge-markdown'; | ||
|
||
AccordionWebComponent.define(); | ||
|
||
const meta = { | ||
title: 'Web Components/Accordion', | ||
id: 'rhc-accordion-web', | ||
component: 'rhc-accordion', | ||
argTypes: { | ||
appearance: { | ||
description: 'Appearance of the component', | ||
type: { name: 'string' }, | ||
control: { type: 'select' }, | ||
options: ['default', 'utrecht'], | ||
}, | ||
heading: { | ||
type: { name: 'string' }, | ||
control: 'text', | ||
description: 'Heading for the accordion, also needs a headingLevel', | ||
}, | ||
headingLevel: { | ||
name: 'Heading Level', | ||
type: { name: 'string' }, | ||
control: 'select', | ||
options: [1, 2, 3, 4, 5, 6], | ||
description: 'Heading level for the accordion, also needs a heading text', | ||
}, | ||
icon: { | ||
name: 'icon', | ||
description: 'Icon at the start', | ||
control: { type: 'select' }, | ||
options: ['default', 'delta-omlaag'], | ||
mapping: { | ||
default: '', | ||
}, | ||
}, | ||
sections: { | ||
control: 'object', | ||
description: 'Array of sections in the accordion', | ||
}, | ||
}, | ||
args: { | ||
icon: 'default', | ||
heading: '', | ||
}, | ||
tags: ['autodocs'], | ||
parameters: { | ||
tokensPrefix: 'utrecht-accordion', | ||
status: { | ||
type: 'STABLE', | ||
}, | ||
docs: { | ||
description: { | ||
// TODO: restructure this, but not until readme is correctly structurized in the Utrecht documentation source | ||
component: mergeMarkdown([readme]), | ||
}, | ||
}, | ||
// TODO: add Figma, GitHub and NL DesignSystem links | ||
componentOrigin: | ||
'Dit component is overgenomen van de Gemeente Utrecht, met styling van de Rijkshuisstijl Community.', | ||
}, | ||
} as Meta<typeof AccordionWebComponent>; | ||
|
||
export default meta; | ||
|
||
export const Default = { | ||
args: { | ||
sections: JSON.stringify([ | ||
{ | ||
label: 'Lorem ipsum 1', | ||
body: `Lorem ipsum dolor sit amet.`, | ||
expanded: true, | ||
}, | ||
{ | ||
label: 'Lorem ipsum 2', | ||
body: `Lorem ipsum dolor sit amet.`, | ||
expanded: false, | ||
}, | ||
{ | ||
label: 'Lorem ipsum 3', | ||
body: `Lorem ipsum dolor sit amet.`, | ||
expanded: false, | ||
}, | ||
]), | ||
}, | ||
} as StoryObj<typeof meta>; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,121 @@ | ||
import { HeroWebComponent } from '@rijkshuisstijl-community/web-components'; | ||
import type { Meta, StoryObj } from '@storybook/web-components'; | ||
|
||
HeroWebComponent.define(); | ||
|
||
const meta = { | ||
title: 'Web Components/Hero', | ||
id: 'rhc-hero-web', | ||
component: 'rhc-hero', | ||
argTypes: { | ||
aspectRatio: { | ||
name: 'Aspect Ratio', | ||
type: { name: 'string' }, | ||
control: 'select', | ||
options: ['16 / 9', '1 / 1', '4 / 3'], | ||
table: { | ||
category: 'Attributes', | ||
defaultValue: { summary: '16 / 9' }, | ||
}, | ||
}, | ||
heading: { | ||
name: 'Heading Text', | ||
type: { name: 'string' }, | ||
control: 'text', | ||
table: { | ||
category: 'Attributes', | ||
}, | ||
}, | ||
heroMessage: { | ||
name: 'Show Hero Message', | ||
type: { name: 'string' }, | ||
control: 'select', | ||
options: ['true', 'false'], | ||
table: { | ||
category: 'Attributes', | ||
defaultValue: { summary: 'false' }, | ||
}, | ||
}, | ||
imageAlt: { | ||
name: 'Image Alt Text', | ||
type: { name: 'string' }, | ||
control: 'text', | ||
table: { | ||
category: 'Attributes', | ||
}, | ||
}, | ||
subHeading: { | ||
name: 'Sub Heading Text', | ||
type: { name: 'string' }, | ||
control: 'text', | ||
table: { | ||
category: 'Attributes', | ||
}, | ||
}, | ||
textAlign: { | ||
name: 'Text Alignment', | ||
type: { name: 'string' }, | ||
control: 'select', | ||
options: ['start', 'end'], | ||
table: { | ||
category: 'Attributes', | ||
defaultValue: { summary: 'start' }, | ||
}, | ||
}, | ||
borderRadiusCorner: { | ||
name: 'Border Radius Corner', | ||
type: { name: 'string' }, | ||
control: 'select', | ||
options: ['start-start', 'start-end', 'end-start', 'end-end'], | ||
table: { | ||
category: 'Attributes', | ||
defaultValue: { summary: 'null' }, | ||
}, | ||
}, | ||
headingLevel: { | ||
name: 'Heading Level', | ||
type: { name: 'string' }, | ||
control: 'select', | ||
options: [1, 2, 3, 4, 5, 6], | ||
table: { | ||
category: 'Attributes', | ||
defaultValue: { summary: '3' }, | ||
}, | ||
}, | ||
imageSrc: { | ||
name: 'Image Source URL', | ||
type: { name: 'string' }, | ||
control: 'text', | ||
table: { | ||
category: 'Attributes', | ||
}, | ||
}, | ||
}, | ||
args: { | ||
aspectRatio: '16 / 9', | ||
heading: 'heading text', | ||
heroMessage: 'true', | ||
imageAlt: 'image alt text', | ||
subHeading: 'sub heading text', | ||
textAlign: 'start', | ||
borderRadiusCorner: 'start-start', | ||
headingLevel: 3, | ||
imageSrc: | ||
'https://raw.githubusercontent.com/nl-design-system/rijkshuisstijl-community/main/proprietary/assets/src/placeholder.jpg', | ||
}, | ||
tags: ['autodocs'], | ||
parameters: { | ||
status: { | ||
type: 'UNSTABLE', | ||
}, | ||
docs: { | ||
description: { | ||
component: 'Hero', | ||
}, | ||
}, | ||
}, | ||
} as Meta<typeof HeroWebComponent>; | ||
|
||
export default meta; | ||
|
||
export const Default = {} as StoryObj<typeof meta>; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<!doctype html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
<title>Web Component Test</title> | ||
<script type="module" src="./dist/index.mjs"></script> | ||
<script type="module"> | ||
import { HeroWebComponent } from './dist/index.mjs'; | ||
HeroWebComponent.define(); | ||
</script> | ||
<link rel="stylesheet" href="node_modules/@rijkshuisstijl-community/design-tokens/dist/index.css" /> | ||
</head> | ||
<body class="rhc-theme"> | ||
<rhc-hero heading="heading wc" /> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
{ | ||
"name": "@rijkshuisstijl-community/web-components", | ||
"version": "1.0.1-alpha.1", | ||
"author": "Community for NL Design System", | ||
"description": "Generic web components bundle based on the NL Design System architecture", | ||
"license": "EUPL-1.2", | ||
"keywords": [ | ||
"nl-design-system" | ||
], | ||
"private": false, | ||
"publishConfig": { | ||
"access": "public", | ||
"registry": "https://registry.npmjs.org/" | ||
}, | ||
"main": "dist/index.mjs", | ||
"module": "dist/index.mjs", | ||
"types": "dist/index.d.ts", | ||
"unpkg": "dist/yyyy/yyyy.esm.js", | ||
"files": [ | ||
"dist/" | ||
], | ||
"repository": { | ||
"type": "git+ssh", | ||
"url": "[email protected]:nl-design-system/rijkshuisstijl-community.git", | ||
"directory": "packages/web-components" | ||
}, | ||
"scripts": { | ||
"prebuild": "npm run clean", | ||
"build": "vite build", | ||
"clean": "rimraf dist/", | ||
"start": "vite" | ||
}, | ||
"devDependencies": { | ||
"@rijkshuisstijl-community/components-css": "workspace:*", | ||
"@rijkshuisstijl-community/components-react": "workspace:*", | ||
"@rijkshuisstijl-community/design-tokens": "workspace:*", | ||
"@types/react": "19.0.1", | ||
"@types/react-dom": "19.0.1", | ||
"@utrecht/component-library-css": "7.0.0", | ||
"@vitejs/plugin-react": "4.3.4", | ||
"rimraf": "6.0.1", | ||
"tslib": "2.8.1", | ||
"typescript": "5.7.2", | ||
"vite": "6.0.3", | ||
"vite-plugin-dts": "4.3.0", | ||
"vite-plugin-static-copy": "2.2.0" | ||
}, | ||
"dependencies": { | ||
"react": "19.0.0", | ||
"react-dom": "19.0.0" | ||
} | ||
} |
Oops, something went wrong.