storybook components tree

This commit is contained in:
Tykayn 2025-10-14 10:28:09 +02:00 committed by tykayn
parent 2f9f4527e8
commit 45b92e145c
41 changed files with 490 additions and 689 deletions

View file

@ -1,16 +1,13 @@
import type { StorybookConfig } from '@storybook/angular';
const config: StorybookConfig = {
"stories": [
"../src/**/*.mdx",
"../src/**/*.stories.@(js|jsx|mjs|ts|tsx)"
],
"addons": [
"@storybook/addon-docs"
],
"framework": {
"name": "@storybook/angular",
"options": {}
}
stories: ['../src/**/*.stories.ts'],
addons: [],
framework: {
name: '@storybook/angular',
options: {},
},
staticDirs: ['../src/assets', '../public'],
};
export default config;

View file

@ -0,0 +1,23 @@
<style>
@font-face { font-family: 'Barlow'; src: url('/assets/fonts/Barlow/Barlow-Thin.ttf') format('truetype'); font-weight: 100; font-style: normal; }
@font-face { font-family: 'Barlow'; src: url('/assets/fonts/Barlow/Barlow-ThinItalic.ttf') format('truetype'); font-weight: 100; font-style: italic; }
@font-face { font-family: 'Barlow'; src: url('/assets/fonts/Barlow/Barlow-ExtraLight.ttf') format('truetype'); font-weight: 200; font-style: normal; }
@font-face { font-family: 'Barlow'; src: url('/assets/fonts/Barlow/Barlow-ExtraLightItalic.ttf') format('truetype'); font-weight: 200; font-style: italic; }
@font-face { font-family: 'Barlow'; src: url('/assets/fonts/Barlow/Barlow-Light.ttf') format('truetype'); font-weight: 300; font-style: normal; }
@font-face { font-family: 'Barlow'; src: url('/assets/fonts/Barlow/Barlow-LightItalic.ttf') format('truetype'); font-weight: 300; font-style: italic; }
@font-face { font-family: 'Barlow'; src: url('/assets/fonts/Barlow/Barlow-Regular.ttf') format('truetype'); font-weight: 400; font-style: normal; }
@font-face { font-family: 'Barlow'; src: url('/assets/fonts/Barlow/Barlow-Italic.ttf') format('truetype'); font-weight: 400; font-style: italic; }
@font-face { font-family: 'Barlow'; src: url('/assets/fonts/Barlow/Barlow-Medium.ttf') format('truetype'); font-weight: 500; font-style: normal; }
@font-face { font-family: 'Barlow'; src: url('/assets/fonts/Barlow/Barlow-MediumItalic.ttf') format('truetype'); font-weight: 500; font-style: italic; }
@font-face { font-family: 'Barlow'; src: url('/assets/fonts/Barlow/Barlow-SemiBold.ttf') format('truetype'); font-weight: 600; font-style: normal; }
@font-face { font-family: 'Barlow'; src: url('/assets/fonts/Barlow/Barlow-SemiBoldItalic.ttf') format('truetype'); font-weight: 600; font-style: italic; }
@font-face { font-family: 'Barlow'; src: url('/assets/fonts/Barlow/Barlow-Bold.ttf') format('truetype'); font-weight: 700; font-style: normal; }
@font-face { font-family: 'Barlow'; src: url('/assets/fonts/Barlow/Barlow-BoldItalic.ttf') format('truetype'); font-weight: 700; font-style: italic; }
@font-face { font-family: 'Barlow'; src: url('/assets/fonts/Barlow/Barlow-ExtraBold.ttf') format('truetype'); font-weight: 800; font-style: normal; }
@font-face { font-family: 'Barlow'; src: url('/assets/fonts/Barlow/Barlow-ExtraBoldItalic.ttf') format('truetype'); font-weight: 800; font-style: italic; }
@font-face { font-family: 'Barlow'; src: url('/assets/fonts/Barlow/Barlow-Black.ttf') format('truetype'); font-weight: 900; font-style: normal; }
@font-face { font-family: 'Barlow'; src: url('/assets/fonts/Barlow/Barlow-BlackItalic.ttf') format('truetype'); font-weight: 900; font-style: italic; }
:root, body { font-family: 'Barlow', system-ui, -apple-system, Segoe UI, Roboto, 'Helvetica Neue', Arial, 'Noto Sans', 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji'; }
</style>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/remixicon@3.5.0/fonts/remixicon.css" />

View file

@ -73,7 +73,6 @@
font-style: italic;
}
// Semi Bold (600)
@font-face {
font-family: 'Barlow';
src: url('fonts/Barlow/Barlow-SemiBold.ttf') format('truetype');
@ -87,8 +86,6 @@
font-weight: 600;
font-style: italic;
}
// Bold (700)
@font-face {
font-family: 'Barlow';
src: url('fonts/Barlow/Barlow-Bold.ttf') format('truetype');
@ -103,7 +100,7 @@
font-style: italic;
}
// Extra Bold (800)
@font-face {
font-family: 'Barlow';
src: url('fonts/Barlow/Barlow-ExtraBold.ttf') format('truetype');
@ -118,7 +115,7 @@
font-style: italic;
}
// Black (900)
@font-face {
font-family: 'Barlow';
src: url('fonts/Barlow/Barlow-Black.ttf') format('truetype');

31
sb/src/preview.ts Normal file
View file

@ -0,0 +1,31 @@
import type { Preview } from '@storybook/angular';
const preview: Preview = {
parameters: {
options: {
storySort: (a, b) => {
const order = ['Foundations', 'Components', 'Patterns'];
const getGroup = (title) => {
const top = title.split('/')[0];
const idx = order.indexOf(top);
return idx === -1 ? order.length : idx;
};
const titleA = a[1].title || '';
const titleB = b[1].title || '';
const groupA = getGroup(titleA);
const groupB = getGroup(titleB);
if (groupA !== groupB) return groupA - groupB;
return titleA.localeCompare(titleB);
},
},
},
};
export default preview;

View file

@ -1,364 +0,0 @@
import { Meta } from "@storybook/addon-docs/blocks";
import Github from "./assets/github.svg";
import Discord from "./assets/discord.svg";
import Youtube from "./assets/youtube.svg";
import Tutorials from "./assets/tutorials.svg";
import Styling from "./assets/styling.png";
import Context from "./assets/context.png";
import Assets from "./assets/assets.png";
import Docs from "./assets/docs.png";
import Share from "./assets/share.png";
import FigmaPlugin from "./assets/figma-plugin.png";
import Testing from "./assets/testing.png";
import Accessibility from "./assets/accessibility.png";
import Theming from "./assets/theming.png";
import AddonLibrary from "./assets/addon-library.png";
export const RightArrow = () => <svg
viewBox="0 0 14 14"
width="8px"
height="14px"
style={{
marginLeft: '4px',
display: 'inline-block',
shapeRendering: 'inherit',
verticalAlign: 'middle',
fill: 'currentColor',
'path fill': 'currentColor'
}}
>
<path d="m11.1 7.35-5.5 5.5a.5.5 0 0 1-.7-.7L10.04 7 4.9 1.85a.5.5 0 1 1 .7-.7l5.5 5.5c.2.2.2.5 0 .7Z" />
</svg>
<Meta title="Configure your project" />
<div className="sb-container">
<div className='sb-section-title'>
# Configure your project
Because Storybook works separately from your app, you'll need to configure it for your specific stack and setup. Below, explore guides for configuring Storybook with popular frameworks and tools. If you get stuck, learn how you can ask for help from our community.
</div>
<div className="sb-section">
<div className="sb-section-item">
<img
src={Styling}
alt="A wall of logos representing different styling technologies"
/>
<h4 className="sb-section-item-heading">Add styling and CSS</h4>
<p className="sb-section-item-paragraph">Like with web applications, there are many ways to include CSS within Storybook. Learn more about setting up styling within Storybook.</p>
<a
href="https://storybook.js.org/docs/configure/styling-and-css/?renderer=angular&ref=configure"
target="_blank"
>Learn more<RightArrow /></a>
</div>
<div className="sb-section-item">
<img
src={Context}
alt="An abstraction representing the composition of data for a component"
/>
<h4 className="sb-section-item-heading">Provide context and mocking</h4>
<p className="sb-section-item-paragraph">Often when a story doesn't render, it's because your component is expecting a specific environment or context (like a theme provider) to be available.</p>
<a
href="https://storybook.js.org/docs/writing-stories/decorators/?renderer=angular&ref=configure#context-for-mocking"
target="_blank"
>Learn more<RightArrow /></a>
</div>
<div className="sb-section-item">
<img src={Assets} alt="A representation of typography and image assets" />
<div>
<h4 className="sb-section-item-heading">Load assets and resources</h4>
<p className="sb-section-item-paragraph">To link static files (like fonts) to your projects and stories, use the
`staticDirs` configuration option to specify folders to load when
starting Storybook.</p>
<a
href="https://storybook.js.org/docs/configure/images-and-assets/?renderer=angular&ref=configure"
target="_blank"
>Learn more<RightArrow /></a>
</div>
</div>
</div>
</div>
<div className="sb-container">
<div className='sb-section-title'>
# Do more with Storybook
Now that you know the basics, let's explore other parts of Storybook that will improve your experience. This list is just to get you started. You can customise Storybook in many ways to fit your needs.
</div>
<div className="sb-section">
<div className="sb-features-grid">
<div className="sb-grid-item">
<img src={Docs} alt="A screenshot showing the autodocs tag being set, pointing a docs page being generated" />
<h4 className="sb-section-item-heading">Autodocs</h4>
<p className="sb-section-item-paragraph">Auto-generate living,
interactive reference documentation from your components and stories.</p>
<a
href="https://storybook.js.org/docs/writing-docs/autodocs/?renderer=angular&ref=configure"
target="_blank"
>Learn more<RightArrow /></a>
</div>
<div className="sb-grid-item">
<img src={Share} alt="A browser window showing a Storybook being published to a chromatic.com URL" />
<h4 className="sb-section-item-heading">Publish to Chromatic</h4>
<p className="sb-section-item-paragraph">Publish your Storybook to review and collaborate with your entire team.</p>
<a
href="https://storybook.js.org/docs/sharing/publish-storybook/?renderer=angular&ref=configure#publish-storybook-with-chromatic"
target="_blank"
>Learn more<RightArrow /></a>
</div>
<div className="sb-grid-item">
<img src={FigmaPlugin} alt="Windows showing the Storybook plugin in Figma" />
<h4 className="sb-section-item-heading">Figma Plugin</h4>
<p className="sb-section-item-paragraph">Embed your stories into Figma to cross-reference the design and live
implementation in one place.</p>
<a
href="https://storybook.js.org/docs/sharing/design-integrations/?renderer=angular&ref=configure#embed-storybook-in-figma-with-the-plugin"
target="_blank"
>Learn more<RightArrow /></a>
</div>
<div className="sb-grid-item">
<img src={Testing} alt="Screenshot of tests passing and failing" />
<h4 className="sb-section-item-heading">Testing</h4>
<p className="sb-section-item-paragraph">Use stories to test a component in all its variations, no matter how
complex.</p>
<a
href="https://storybook.js.org/docs/writing-tests/?renderer=angular&ref=configure"
target="_blank"
>Learn more<RightArrow /></a>
</div>
<div className="sb-grid-item">
<img src={Accessibility} alt="Screenshot of accessibility tests passing and failing" />
<h4 className="sb-section-item-heading">Accessibility</h4>
<p className="sb-section-item-paragraph">Automatically test your components for a11y issues as you develop.</p>
<a
href="https://storybook.js.org/docs/writing-tests/accessibility-testing/?renderer=angular&ref=configure"
target="_blank"
>Learn more<RightArrow /></a>
</div>
<div className="sb-grid-item">
<img src={Theming} alt="Screenshot of Storybook in light and dark mode" />
<h4 className="sb-section-item-heading">Theming</h4>
<p className="sb-section-item-paragraph">Theme Storybook's UI to personalize it to your project.</p>
<a
href="https://storybook.js.org/docs/configure/theming/?renderer=angular&ref=configure"
target="_blank"
>Learn more<RightArrow /></a>
</div>
</div>
</div>
</div>
<div className='sb-addon'>
<div className='sb-addon-text'>
<h4>Addons</h4>
<p className="sb-section-item-paragraph">Integrate your tools with Storybook to connect workflows.</p>
<a
href="https://storybook.js.org/addons/?ref=configure"
target="_blank"
>Discover all addons<RightArrow /></a>
</div>
<div className='sb-addon-img'>
<img src={AddonLibrary} alt="Integrate your tools with Storybook to connect workflows." />
</div>
</div>
<div className="sb-section sb-socials">
<div className="sb-section-item">
<img src={Github} alt="Github logo" className="sb-explore-image"/>
Join our contributors building the future of UI development.
<a
href="https://github.com/storybookjs/storybook"
target="_blank"
>Star on GitHub<RightArrow /></a>
</div>
<div className="sb-section-item">
<img src={Discord} alt="Discord logo" className="sb-explore-image"/>
<div>
Get support and chat with frontend developers.
<a
href="https://discord.gg/storybook"
target="_blank"
>Join Discord server<RightArrow /></a>
</div>
</div>
<div className="sb-section-item">
<img src={Youtube} alt="Youtube logo" className="sb-explore-image"/>
<div>
Watch tutorials, feature previews and interviews.
<a
href="https://www.youtube.com/@chromaticui"
target="_blank"
>Watch on YouTube<RightArrow /></a>
</div>
</div>
<div className="sb-section-item">
<img src={Tutorials} alt="A book" className="sb-explore-image"/>
<p>Follow guided walkthroughs on for key workflows.</p>
<a
href="https://storybook.js.org/tutorials/?ref=configure"
target="_blank"
>Discover tutorials<RightArrow /></a>
</div>
</div>
<style>
{`
.sb-container {
margin-bottom: 48px;
}
.sb-section {
width: 100%;
display: flex;
flex-direction: row;
gap: 20px;
}
img {
object-fit: cover;
}
.sb-section-title {
margin-bottom: 32px;
}
.sb-section a:not(h1 a, h2 a, h3 a) {
font-size: 14px;
}
.sb-section-item, .sb-grid-item {
flex: 1;
display: flex;
flex-direction: column;
}
.sb-section-item-heading {
padding-top: 20px !important;
padding-bottom: 5px !important;
margin: 0 !important;
}
.sb-section-item-paragraph {
margin: 0;
padding-bottom: 10px;
}
.sb-chevron {
margin-left: 5px;
}
.sb-features-grid {
display: grid;
grid-template-columns: repeat(2, 1fr);
grid-gap: 32px 20px;
}
.sb-socials {
display: grid;
grid-template-columns: repeat(4, 1fr);
}
.sb-socials p {
margin-bottom: 10px;
}
.sb-explore-image {
max-height: 32px;
align-self: flex-start;
}
.sb-addon {
width: 100%;
display: flex;
align-items: center;
position: relative;
background-color: #EEF3F8;
border-radius: 5px;
border: 1px solid rgba(0, 0, 0, 0.05);
background: #EEF3F8;
height: 180px;
margin-bottom: 48px;
overflow: hidden;
}
.sb-addon-text {
padding-left: 48px;
max-width: 240px;
}
.sb-addon-text h4 {
padding-top: 0px;
}
.sb-addon-img {
position: absolute;
left: 345px;
top: 0;
height: 100%;
width: 200%;
overflow: hidden;
}
.sb-addon-img img {
width: 650px;
transform: rotate(-15deg);
margin-left: 40px;
margin-top: -72px;
box-shadow: 0 0 1px rgba(255, 255, 255, 0);
backface-visibility: hidden;
}
@media screen and (max-width: 800px) {
.sb-addon-img {
left: 300px;
}
}
@media screen and (max-width: 600px) {
.sb-section {
flex-direction: column;
}
.sb-features-grid {
grid-template-columns: repeat(1, 1fr);
}
.sb-socials {
grid-template-columns: repeat(2, 1fr);
}
.sb-addon {
height: 280px;
align-items: flex-start;
padding-top: 32px;
overflow: hidden;
}
.sb-addon-text {
padding-left: 24px;
}
.sb-addon-img {
right: 0;
left: 0;
top: 130px;
bottom: 0;
overflow: hidden;
height: auto;
width: 124%;
}
.sb-addon-img img {
width: 1200px;
transform: rotate(-12deg);
margin-left: 0;
margin-top: 48px;
margin-bottom: -40px;
margin-left: -24px;
}
}
`}
</style>

View file

@ -1,48 +0,0 @@
import { CommonModule } from '@angular/common';
import { Component, Input, Output, EventEmitter } from '@angular/core';
@Component({
selector: 'storybook-button',
standalone: true,
imports: [CommonModule],
template: ` <button
type="button"
(click)="onClick.emit($event)"
[ngClass]="classes"
[ngStyle]="{ 'background-color': backgroundColor }"
>
{{ label }}
</button>`,
styleUrls: ['./button.css'],
})
export class ButtonComponent {
/** Is this the principal call to action on the page? */
@Input()
primary = false;
/** What background color to use */
@Input()
backgroundColor?: string;
/** How large should the button be? */
@Input()
size: 'small' | 'medium' | 'large' = 'medium';
/**
* Button contents
*
* @required
*/
@Input()
label = 'Button';
/** Optional click handler */
@Output()
onClick = new EventEmitter<Event>();
public get classes(): string[] {
const mode = this.primary ? 'storybook-button--primary' : 'storybook-button--secondary';
return ['storybook-button', `storybook-button--${this.size}`, mode];
}
}

View file

@ -0,0 +1,14 @@
import type { Meta, StoryObj } from '@storybook/angular';
import { Badges } from '../../app/composants/badges/badges';
const meta: Meta<Badges> = {
title: 'Components/Composants/Badges',
component: Badges,
};
export default meta;
type Story = StoryObj<Badges>;
export const Default: Story = { render: () => ({}) };

View file

@ -0,0 +1,16 @@
import type { Meta, StoryObj } from '@storybook/angular';
import { Boutons } from '../../app/composants/boutons/boutons';
const meta: Meta<Boutons> = {
title: 'Components/Composants/Boutons',
component: Boutons,
};
export default meta;
type Story = StoryObj<Boutons>;
export const Default: Story = {
render: () => ({})
};

View file

@ -0,0 +1,14 @@
import type { Meta, StoryObj } from '@storybook/angular';
import { Checkboxes } from '../../app/composants/checkboxes/checkboxes';
const meta: Meta<Checkboxes> = {
title: 'Components/Composants/Checkboxes',
component: Checkboxes,
};
export default meta;
type Story = StoryObj<Checkboxes>;
export const Default: Story = { render: () => ({}) };

View file

@ -0,0 +1,14 @@
import type { Meta, StoryObj } from '@storybook/angular';
import { Dropdown } from '../../app/composants/dropdown/dropdown';
const meta: Meta<Dropdown> = {
title: 'Components/Composants/Dropdown',
component: Dropdown,
};
export default meta;
type Story = StoryObj<Dropdown>;
export const Default: Story = { render: () => ({}) };

View file

@ -0,0 +1,14 @@
import type { Meta, StoryObj } from '@storybook/angular';
import { Infobulles } from '../../app/composants/infobulles/infobulles';
const meta: Meta<Infobulles> = {
title: 'Components/Composants/Infobulles',
component: Infobulles,
};
export default meta;
type Story = StoryObj<Infobulles>;
export const Default: Story = { render: () => ({}) };

View file

@ -0,0 +1,14 @@
import type { Meta, StoryObj } from '@storybook/angular';
import { Inputs } from '../../app/composants/inputs/inputs';
const meta: Meta<Inputs> = {
title: 'Components/Composants/Inputs',
component: Inputs,
};
export default meta;
type Story = StoryObj<Inputs>;
export const Default: Story = { render: () => ({}) };

View file

@ -0,0 +1,14 @@
import type { Meta, StoryObj } from '@storybook/angular';
import { Radio } from '../../app/composants/radio/radio';
const meta: Meta<Radio> = {
title: 'Components/Composants/Radio',
component: Radio,
};
export default meta;
type Story = StoryObj<Radio>;
export const Default: Story = { render: () => ({}) };

View file

@ -0,0 +1,14 @@
import type { Meta, StoryObj } from '@storybook/angular';
import { Steppers } from '../../app/composants/steppers/steppers';
const meta: Meta<Steppers> = {
title: 'Components/Composants/Steppers',
component: Steppers,
};
export default meta;
type Story = StoryObj<Steppers>;
export const Default: Story = { render: () => ({}) };

View file

@ -0,0 +1,14 @@
import type { Meta, StoryObj } from '@storybook/angular';
import { Tabulations } from '../../app/composants/tabulations/tabulations';
const meta: Meta<Tabulations> = {
title: 'Components/Composants/Tabulations',
component: Tabulations,
};
export default meta;
type Story = StoryObj<Tabulations>;
export const Default: Story = { render: () => ({}) };

View file

@ -0,0 +1,14 @@
import type { Meta, StoryObj } from '@storybook/angular';
import { TagsChips } from '../../app/composants/tags-chips/tags-chips';
const meta: Meta<TagsChips> = {
title: 'Components/Composants/Tags Chips',
component: TagsChips,
};
export default meta;
type Story = StoryObj<TagsChips>;
export const Default: Story = { render: () => ({}) };

View file

@ -0,0 +1,14 @@
import type { Meta, StoryObj } from '@storybook/angular';
import { Textarea } from '../../app/composants/textarea/textarea';
const meta: Meta<Textarea> = {
title: 'Components/Composants/Textarea',
component: Textarea,
};
export default meta;
type Story = StoryObj<Textarea>;
export const Default: Story = { render: () => ({}) };

View file

@ -0,0 +1,14 @@
import type { Meta, StoryObj } from '@storybook/angular';
import { ToggleSwitch } from '../../app/composants/toggle-switch/toggle-switch';
const meta: Meta<ToggleSwitch> = {
title: 'Components/Composants/Toggle Switch',
component: ToggleSwitch,
};
export default meta;
type Story = StoryObj<ToggleSwitch>;
export const Default: Story = { render: () => ({}) };

View file

@ -0,0 +1,14 @@
import type { Meta, StoryObj } from '@storybook/angular';
import { Charte } from '../../app/foundations/charte/charte';
const meta: Meta<Charte> = {
title: 'Foundations/Charte',
component: Charte,
};
export default meta;
type Story = StoryObj<Charte>;
export const Default: Story = { render: () => ({}) };

View file

@ -0,0 +1,16 @@
import type { Meta, StoryObj } from '@storybook/angular';
import { Couleurs } from '../../app/foundations/couleurs/couleurs';
const meta: Meta<Couleurs> = {
title: 'Foundations/Couleurs',
component: Couleurs,
};
export default meta;
type Story = StoryObj<Couleurs>;
export const Default: Story = {
render: () => ({})
};

View file

@ -0,0 +1,14 @@
import type { Meta, StoryObj } from '@storybook/angular';
import { Effets } from '../../app/foundations/effets/effets';
const meta: Meta<Effets> = {
title: 'Foundations/Effets',
component: Effets,
};
export default meta;
type Story = StoryObj<Effets>;
export const Default: Story = { render: () => ({}) };

View file

@ -0,0 +1,14 @@
import type { Meta, StoryObj } from '@storybook/angular';
import { Icones } from '../../app/foundations/icones/icones';
const meta: Meta<Icones> = {
title: 'Foundations/Icones',
component: Icones,
};
export default meta;
type Story = StoryObj<Icones>;
export const Default: Story = { render: () => ({}) };

View file

@ -0,0 +1,14 @@
import type { Meta, StoryObj } from '@storybook/angular';
import { Layout } from '../../app/foundations/layout/layout';
const meta: Meta<Layout> = {
title: 'Foundations/Layout',
component: Layout,
};
export default meta;
type Story = StoryObj<Layout>;
export const Default: Story = { render: () => ({}) };

View file

@ -0,0 +1,14 @@
import type { Meta, StoryObj } from '@storybook/angular';
import { Radius } from '../../app/foundations/radius/radius';
const meta: Meta<Radius> = {
title: 'Foundations/Radius',
component: Radius,
};
export default meta;
type Story = StoryObj<Radius>;
export const Default: Story = { render: () => ({}) };

View file

@ -0,0 +1,14 @@
import type { Meta, StoryObj } from '@storybook/angular';
import { Strokes } from '../../app/foundations/strokes/strokes';
const meta: Meta<Strokes> = {
title: 'Foundations/Strokes',
component: Strokes,
};
export default meta;
type Story = StoryObj<Strokes>;
export const Default: Story = { render: () => ({}) };

View file

@ -0,0 +1,14 @@
import type { Meta, StoryObj } from '@storybook/angular';
import { Typographies } from '../../app/foundations/typographies/typographies';
const meta: Meta<Typographies> = {
title: 'Foundations/Typographies',
component: Typographies,
};
export default meta;
type Story = StoryObj<Typographies>;
export const Default: Story = { render: () => ({}) };

View file

@ -1,76 +0,0 @@
import { Component, Input, Output, EventEmitter } from '@angular/core';
import { CommonModule } from '@angular/common';
import { ButtonComponent } from './button.component';
import type { User } from './user';
@Component({
selector: 'storybook-header',
standalone: true,
imports: [CommonModule, ButtonComponent],
template: `<header>
<div class="storybook-header">
<div>
<svg width="32" height="32" viewBox="0 0 32 32" xmlns="http://www.w3.org/2000/svg">
<g fill="none" fillRule="evenodd">
<path
d="M10 0h12a10 10 0 0110 10v12a10 10 0 01-10 10H10A10 10 0 010 22V10A10 10 0 0110 0z"
fill="#FFF"
/>
<path
d="M5.3 10.6l10.4 6v11.1l-10.4-6v-11zm11.4-6.2l9.7 5.5-9.7 5.6V4.4z"
fill="#555AB9"
/>
<path d="M27.2 10.6v11.2l-10.5 6V16.5l10.5-6zM15.7 4.4v11L6 10l9.7-5.5z" fill="#91BAF8" />
</g>
</svg>
<h1>Acme</h1>
</div>
<div>
<div *ngIf="user">
<span class="welcome">
Welcome, <b>{{ user.name }}</b
>!
</span>
<storybook-button
*ngIf="user"
size="small"
(onClick)="onLogout.emit($event)"
label="Log out"
></storybook-button>
</div>
<div *ngIf="!user">
<storybook-button
*ngIf="!user"
size="small"
class="margin-left"
(onClick)="onLogin.emit($event)"
label="Log in"
></storybook-button>
<storybook-button
*ngIf="!user"
size="small"
[primary]="true"
class="margin-left"
(onClick)="onCreateAccount.emit($event)"
label="Sign up"
></storybook-button>
</div>
</div>
</div>
</header>`,
styleUrls: ['./header.css'],
})
export class HeaderComponent {
@Input()
user: User | null = null;
@Output()
onLogin = new EventEmitter<Event>();
@Output()
onLogout = new EventEmitter<Event>();
@Output()
onCreateAccount = new EventEmitter<Event>();
}

View file

@ -1,82 +0,0 @@
import { Component } from '@angular/core';
import { CommonModule } from '@angular/common';
import { HeaderComponent } from './header.component';
import type { User } from './user';
@Component({
selector: 'storybook-page',
standalone: true,
imports: [CommonModule, HeaderComponent],
template: `<article>
<storybook-header
[user]="user"
(onLogout)="doLogout()"
(onLogin)="doLogin()"
(onCreateAccount)="doCreateAccount()"
></storybook-header>
<section class="storybook-page">
<h2>Pages in Storybook</h2>
<p>
We recommend building UIs with a
<a href="https://componentdriven.org" target="_blank" rel="noopener noreferrer">
<strong>component-driven</strong>
</a>
process starting with atomic components and ending with pages.
</p>
<p>
Render pages with mock data. This makes it easy to build and review page states without
needing to navigate to them in your app. Here are some handy patterns for managing page data
in Storybook:
</p>
<ul>
<li>
Use a higher-level connected component. Storybook helps you compose such data from the
"args" of child component stories
</li>
<li>
Assemble data in the page component from your services. You can mock these services out
using Storybook.
</li>
</ul>
<p>
Get a guided tutorial on component-driven development at
<a href="https://storybook.js.org/tutorials/" target="_blank" rel="noopener noreferrer">
Storybook tutorials
</a>
. Read more in the
<a href="https://storybook.js.org/docs" target="_blank" rel="noopener noreferrer"> docs </a>
.
</p>
<div class="tip-wrapper">
<span class="tip">Tip</span> Adjust the width of the canvas with the
<svg width="10" height="10" viewBox="0 0 12 12" xmlns="http://www.w3.org/2000/svg">
<g fill="none" fillRule="evenodd">
<path
d="M1.5 5.2h4.8c.3 0 .5.2.5.4v5.1c-.1.2-.3.3-.4.3H1.4a.5.5 0 01-.5-.4V5.7c0-.3.2-.5.5-.5zm0-2.1h6.9c.3 0 .5.2.5.4v7a.5.5 0 01-1 0V4H1.5a.5.5 0 010-1zm0-2.1h9c.3 0 .5.2.5.4v9.1a.5.5 0 01-1 0V2H1.5a.5.5 0 010-1zm4.3 5.2H2V10h3.8V6.2z"
id="a"
fill="#999"
/>
</g>
</svg>
Viewports addon in the toolbar
</div>
</section>
</article>`,
styleUrls: ['./page.css'],
})
export class PageComponent {
user: User | null = null;
doLogout() {
this.user = null;
}
doLogin() {
this.user = { name: 'Jane Doe' };
}
doCreateAccount() {
this.user = { name: 'Jane Doe' };
}
}

View file

@ -1,68 +0,0 @@
.storybook-page {
margin: 0 auto;
padding: 48px 20px;
max-width: 600px;
color: #333;
font-size: 14px;
line-height: 24px;
font-family: 'Nunito Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;
}
.storybook-page h2 {
display: inline-block;
vertical-align: top;
margin: 0 0 4px;
font-weight: 700;
font-size: 32px;
line-height: 1;
}
.storybook-page p {
margin: 1em 0;
}
.storybook-page a {
color: inherit;
}
.storybook-page ul {
margin: 1em 0;
padding-left: 30px;
}
.storybook-page li {
margin-bottom: 8px;
}
.storybook-page .tip {
display: inline-block;
vertical-align: top;
margin-right: 10px;
border-radius: 1em;
background: #e7fdd8;
padding: 4px 12px;
color: #357a14;
font-weight: 700;
font-size: 11px;
line-height: 12px;
}
.storybook-page .tip-wrapper {
margin-top: 40px;
margin-bottom: 40px;
font-size: 13px;
line-height: 20px;
}
.storybook-page .tip-wrapper svg {
display: inline-block;
vertical-align: top;
margin-top: 3px;
margin-right: 4px;
width: 12px;
height: 12px;
}
.storybook-page .tip-wrapper svg path {
fill: #1ea7fd;
}

View file

@ -1,32 +0,0 @@
import type { Meta, StoryObj } from '@storybook/angular';
import { expect, userEvent, within } from 'storybook/test';
import { PageComponent } from './page.component';
const meta: Meta<PageComponent> = {
title: 'Example/Page',
component: PageComponent,
parameters: {
// More on how to position stories at: https://storybook.js.org/docs/configure/story-layout
layout: 'fullscreen',
},
};
export default meta;
type Story = StoryObj<PageComponent>;
export const LoggedOut: Story = {};
// More on component testing: https://storybook.js.org/docs/writing-tests/interaction-testing
export const LoggedIn: Story = {
play: async ({ canvasElement }) => {
const canvas = within(canvasElement);
const loginButton = canvas.getByRole('button', { name: /Log in/i });
await expect(loginButton).toBeInTheDocument();
await userEvent.click(loginButton);
await expect(loginButton).not.toBeInTheDocument();
const logoutButton = canvas.getByRole('button', { name: /Log out/i });
await expect(logoutButton).toBeInTheDocument();
},
};

View file

@ -0,0 +1,16 @@
import type { Meta, StoryObj } from '@storybook/angular';
import { Breadcrumb } from '../../app/patterns/breadcrumb/breadcrumb';
const meta: Meta<Breadcrumb> = {
title: 'Patterns/Breadcrumb',
component: Breadcrumb,
};
export default meta;
type Story = StoryObj<Breadcrumb>;
export const Default: Story = {
render: () => ({})
};

View file

@ -0,0 +1,14 @@
import type { Meta, StoryObj } from '@storybook/angular';
import { ChatMessage } from '../../app/patterns/chat-message/chat-message';
const meta: Meta<ChatMessage> = {
title: 'Patterns/Chat Message',
component: ChatMessage,
};
export default meta;
type Story = StoryObj<ChatMessage>;
export const Default: Story = { render: () => ({}) };

View file

@ -0,0 +1,14 @@
import type { Meta, StoryObj } from '@storybook/angular';
import { ErrorMessage } from '../../app/patterns/error-message/error-message';
const meta: Meta<ErrorMessage> = {
title: 'Patterns/Error Message',
component: ErrorMessage,
};
export default meta;
type Story = StoryObj<ErrorMessage>;
export const Default: Story = { render: () => ({}) };

View file

@ -0,0 +1,14 @@
import type { Meta, StoryObj } from '@storybook/angular';
import { Fileuploader } from '../../app/patterns/fileuploader/fileuploader';
const meta: Meta<Fileuploader> = {
title: 'Patterns/File Uploader',
component: Fileuploader,
};
export default meta;
type Story = StoryObj<Fileuploader>;
export const Default: Story = { render: () => ({}) };

View file

@ -0,0 +1,14 @@
import type { Meta, StoryObj } from '@storybook/angular';
import { Footer } from '../../app/patterns/footer/footer';
const meta: Meta<Footer> = {
title: 'Patterns/Footer',
component: Footer,
};
export default meta;
type Story = StoryObj<Footer>;
export const Default: Story = { render: () => ({}) };

View file

@ -0,0 +1,14 @@
import type { Meta, StoryObj } from '@storybook/angular';
import { Header } from '../../app/patterns/header/header';
const meta: Meta<Header> = {
title: 'Patterns/Header',
component: Header,
};
export default meta;
type Story = StoryObj<Header>;
export const Default: Story = { render: () => ({}) };

View file

@ -0,0 +1,14 @@
import type { Meta, StoryObj } from '@storybook/angular';
import { Navbar } from '../../app/patterns/navbar/navbar';
const meta: Meta<Navbar> = {
title: 'Patterns/Navbar',
component: Navbar,
};
export default meta;
type Story = StoryObj<Navbar>;
export const Default: Story = { render: () => ({}) };

View file

@ -0,0 +1,14 @@
import type { Meta, StoryObj } from '@storybook/angular';
import { Pagination } from '../../app/patterns/pagination/pagination';
const meta: Meta<Pagination> = {
title: 'Patterns/Pagination',
component: Pagination,
};
export default meta;
type Story = StoryObj<Pagination>;
export const Default: Story = { render: () => ({}) };

View file

@ -0,0 +1,14 @@
import type { Meta, StoryObj } from '@storybook/angular';
import { Rgpd } from '../../app/patterns/rgpd/rgpd';
const meta: Meta<Rgpd> = {
title: 'Patterns/RGPD',
component: Rgpd,
};
export default meta;
type Story = StoryObj<Rgpd>;
export const Default: Story = { render: () => ({}) };

View file

@ -0,0 +1,14 @@
import type { Meta, StoryObj } from '@storybook/angular';
import { Table } from '../../app/patterns/table/table';
const meta: Meta<Table> = {
title: 'Patterns/Table',
component: Table,
};
export default meta;
type Story = StoryObj<Table>;
export const Default: Story = { render: () => ({}) };

View file

@ -1,3 +0,0 @@
export interface User {
name: string;
}