From 45b92e145c3af469916f21b8165b335c00aa8d2f Mon Sep 17 00:00:00 2001 From: Tykayn Date: Tue, 14 Oct 2025 10:28:09 +0200 Subject: [PATCH] storybook components tree --- sb/.storybook/main.ts | 19 +- sb/.storybook/preview-head.html | 23 ++ sb/src/preview-head.html | 7 +- sb/src/preview.ts | 31 ++ sb/src/stories/Configure.mdx | 364 ------------------ sb/src/stories/button.component.ts | 48 --- sb/src/stories/composants/badges.stories.ts | 14 + sb/src/stories/composants/boutons.stories.ts | 16 + .../stories/composants/checkboxes.stories.ts | 14 + sb/src/stories/composants/dropdown.stories.ts | 14 + .../stories/composants/infobulles.stories.ts | 14 + sb/src/stories/composants/inputs.stories.ts | 14 + sb/src/stories/composants/radio.stories.ts | 14 + sb/src/stories/composants/steppers.stories.ts | 14 + .../stories/composants/tabulations.stories.ts | 14 + .../stories/composants/tags-chips.stories.ts | 14 + sb/src/stories/composants/textarea.stories.ts | 14 + .../composants/toggle-switch.stories.ts | 14 + sb/src/stories/foundations/charte.stories.ts | 14 + .../stories/foundations/couleurs.stories.ts | 16 + sb/src/stories/foundations/effets.stories.ts | 14 + sb/src/stories/foundations/icones.stories.ts | 14 + sb/src/stories/foundations/layout.stories.ts | 14 + sb/src/stories/foundations/radius.stories.ts | 14 + sb/src/stories/foundations/strokes.stories.ts | 14 + .../foundations/typographies.stories.ts | 14 + sb/src/stories/header.component.ts | 76 ---- sb/src/stories/page.component.ts | 82 ---- sb/src/stories/page.css | 68 ---- sb/src/stories/page.stories.ts | 32 -- sb/src/stories/patterns/breadcrumb.stories.ts | 16 + .../stories/patterns/chat-message.stories.ts | 14 + .../stories/patterns/error-message.stories.ts | 14 + .../stories/patterns/fileuploader.stories.ts | 14 + sb/src/stories/patterns/footer.stories.ts | 14 + sb/src/stories/patterns/header.stories.ts | 14 + sb/src/stories/patterns/navbar.stories.ts | 14 + sb/src/stories/patterns/pagination.stories.ts | 14 + sb/src/stories/patterns/rgpd.stories.ts | 14 + sb/src/stories/patterns/table.stories.ts | 14 + sb/src/stories/user.ts | 3 - 41 files changed, 490 insertions(+), 689 deletions(-) create mode 100644 sb/.storybook/preview-head.html create mode 100644 sb/src/preview.ts delete mode 100644 sb/src/stories/Configure.mdx delete mode 100644 sb/src/stories/button.component.ts create mode 100644 sb/src/stories/composants/badges.stories.ts create mode 100644 sb/src/stories/composants/boutons.stories.ts create mode 100644 sb/src/stories/composants/checkboxes.stories.ts create mode 100644 sb/src/stories/composants/dropdown.stories.ts create mode 100644 sb/src/stories/composants/infobulles.stories.ts create mode 100644 sb/src/stories/composants/inputs.stories.ts create mode 100644 sb/src/stories/composants/radio.stories.ts create mode 100644 sb/src/stories/composants/steppers.stories.ts create mode 100644 sb/src/stories/composants/tabulations.stories.ts create mode 100644 sb/src/stories/composants/tags-chips.stories.ts create mode 100644 sb/src/stories/composants/textarea.stories.ts create mode 100644 sb/src/stories/composants/toggle-switch.stories.ts create mode 100644 sb/src/stories/foundations/charte.stories.ts create mode 100644 sb/src/stories/foundations/couleurs.stories.ts create mode 100644 sb/src/stories/foundations/effets.stories.ts create mode 100644 sb/src/stories/foundations/icones.stories.ts create mode 100644 sb/src/stories/foundations/layout.stories.ts create mode 100644 sb/src/stories/foundations/radius.stories.ts create mode 100644 sb/src/stories/foundations/strokes.stories.ts create mode 100644 sb/src/stories/foundations/typographies.stories.ts delete mode 100644 sb/src/stories/header.component.ts delete mode 100644 sb/src/stories/page.component.ts delete mode 100644 sb/src/stories/page.css delete mode 100644 sb/src/stories/page.stories.ts create mode 100644 sb/src/stories/patterns/breadcrumb.stories.ts create mode 100644 sb/src/stories/patterns/chat-message.stories.ts create mode 100644 sb/src/stories/patterns/error-message.stories.ts create mode 100644 sb/src/stories/patterns/fileuploader.stories.ts create mode 100644 sb/src/stories/patterns/footer.stories.ts create mode 100644 sb/src/stories/patterns/header.stories.ts create mode 100644 sb/src/stories/patterns/navbar.stories.ts create mode 100644 sb/src/stories/patterns/pagination.stories.ts create mode 100644 sb/src/stories/patterns/rgpd.stories.ts create mode 100644 sb/src/stories/patterns/table.stories.ts delete mode 100644 sb/src/stories/user.ts diff --git a/sb/.storybook/main.ts b/sb/.storybook/main.ts index 08ad439..58db1cb 100644 --- a/sb/.storybook/main.ts +++ b/sb/.storybook/main.ts @@ -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; \ No newline at end of file diff --git a/sb/.storybook/preview-head.html b/sb/.storybook/preview-head.html new file mode 100644 index 0000000..9ce1bb2 --- /dev/null +++ b/sb/.storybook/preview-head.html @@ -0,0 +1,23 @@ + + + diff --git a/sb/src/preview-head.html b/sb/src/preview-head.html index 0218fde..d7edda9 100644 --- a/sb/src/preview-head.html +++ b/sb/src/preview-head.html @@ -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'); diff --git a/sb/src/preview.ts b/sb/src/preview.ts new file mode 100644 index 0000000..378f975 --- /dev/null +++ b/sb/src/preview.ts @@ -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; + + + diff --git a/sb/src/stories/Configure.mdx b/sb/src/stories/Configure.mdx deleted file mode 100644 index 384fafa..0000000 --- a/sb/src/stories/Configure.mdx +++ /dev/null @@ -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 = () => - - - - - -
-
- # 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. -
-
-
- A wall of logos representing different styling technologies -

Add styling and CSS

-

Like with web applications, there are many ways to include CSS within Storybook. Learn more about setting up styling within Storybook.

- Learn more -
-
- An abstraction representing the composition of data for a component -

Provide context and mocking

-

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.

- Learn more -
-
- A representation of typography and image assets -
-

Load assets and resources

-

To link static files (like fonts) to your projects and stories, use the - `staticDirs` configuration option to specify folders to load when - starting Storybook.

- Learn more -
-
-
-
-
-
- # 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. -
- -
-
-
- A screenshot showing the autodocs tag being set, pointing a docs page being generated -

Autodocs

-

Auto-generate living, - interactive reference documentation from your components and stories.

- Learn more -
-
- A browser window showing a Storybook being published to a chromatic.com URL -

Publish to Chromatic

-

Publish your Storybook to review and collaborate with your entire team.

- Learn more -
-
- Windows showing the Storybook plugin in Figma -

Figma Plugin

-

Embed your stories into Figma to cross-reference the design and live - implementation in one place.

- Learn more -
-
- Screenshot of tests passing and failing -

Testing

-

Use stories to test a component in all its variations, no matter how - complex.

- Learn more -
-
- Screenshot of accessibility tests passing and failing -

Accessibility

-

Automatically test your components for a11y issues as you develop.

- Learn more -
-
- Screenshot of Storybook in light and dark mode -

Theming

-

Theme Storybook's UI to personalize it to your project.

- Learn more -
-
-
-
-
-
-

Addons

-

Integrate your tools with Storybook to connect workflows.

- Discover all addons -
-
- Integrate your tools with Storybook to connect workflows. -
-
- -
-
- Github logo - Join our contributors building the future of UI development. - - Star on GitHub -
-
- Discord logo -
- Get support and chat with frontend developers. - - Join Discord server -
-
-
- Youtube logo -
- Watch tutorials, feature previews and interviews. - - Watch on YouTube -
-
-
- A book -

Follow guided walkthroughs on for key workflows.

- - Discover tutorials -
-
- - diff --git a/sb/src/stories/button.component.ts b/sb/src/stories/button.component.ts deleted file mode 100644 index a1cdf6a..0000000 --- a/sb/src/stories/button.component.ts +++ /dev/null @@ -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: ` `, - 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(); - - public get classes(): string[] { - const mode = this.primary ? 'storybook-button--primary' : 'storybook-button--secondary'; - - return ['storybook-button', `storybook-button--${this.size}`, mode]; - } -} diff --git a/sb/src/stories/composants/badges.stories.ts b/sb/src/stories/composants/badges.stories.ts new file mode 100644 index 0000000..7814ccb --- /dev/null +++ b/sb/src/stories/composants/badges.stories.ts @@ -0,0 +1,14 @@ +import type { Meta, StoryObj } from '@storybook/angular'; +import { Badges } from '../../app/composants/badges/badges'; + +const meta: Meta = { + title: 'Components/Composants/Badges', + component: Badges, +}; + +export default meta; +type Story = StoryObj; + +export const Default: Story = { render: () => ({}) }; + + diff --git a/sb/src/stories/composants/boutons.stories.ts b/sb/src/stories/composants/boutons.stories.ts new file mode 100644 index 0000000..fbd5586 --- /dev/null +++ b/sb/src/stories/composants/boutons.stories.ts @@ -0,0 +1,16 @@ +import type { Meta, StoryObj } from '@storybook/angular'; +import { Boutons } from '../../app/composants/boutons/boutons'; + +const meta: Meta = { + title: 'Components/Composants/Boutons', + component: Boutons, +}; + +export default meta; +type Story = StoryObj; + +export const Default: Story = { + render: () => ({}) +}; + + diff --git a/sb/src/stories/composants/checkboxes.stories.ts b/sb/src/stories/composants/checkboxes.stories.ts new file mode 100644 index 0000000..abb5378 --- /dev/null +++ b/sb/src/stories/composants/checkboxes.stories.ts @@ -0,0 +1,14 @@ +import type { Meta, StoryObj } from '@storybook/angular'; +import { Checkboxes } from '../../app/composants/checkboxes/checkboxes'; + +const meta: Meta = { + title: 'Components/Composants/Checkboxes', + component: Checkboxes, +}; + +export default meta; +type Story = StoryObj; + +export const Default: Story = { render: () => ({}) }; + + diff --git a/sb/src/stories/composants/dropdown.stories.ts b/sb/src/stories/composants/dropdown.stories.ts new file mode 100644 index 0000000..ab563ed --- /dev/null +++ b/sb/src/stories/composants/dropdown.stories.ts @@ -0,0 +1,14 @@ +import type { Meta, StoryObj } from '@storybook/angular'; +import { Dropdown } from '../../app/composants/dropdown/dropdown'; + +const meta: Meta = { + title: 'Components/Composants/Dropdown', + component: Dropdown, +}; + +export default meta; +type Story = StoryObj; + +export const Default: Story = { render: () => ({}) }; + + diff --git a/sb/src/stories/composants/infobulles.stories.ts b/sb/src/stories/composants/infobulles.stories.ts new file mode 100644 index 0000000..d74b8c1 --- /dev/null +++ b/sb/src/stories/composants/infobulles.stories.ts @@ -0,0 +1,14 @@ +import type { Meta, StoryObj } from '@storybook/angular'; +import { Infobulles } from '../../app/composants/infobulles/infobulles'; + +const meta: Meta = { + title: 'Components/Composants/Infobulles', + component: Infobulles, +}; + +export default meta; +type Story = StoryObj; + +export const Default: Story = { render: () => ({}) }; + + diff --git a/sb/src/stories/composants/inputs.stories.ts b/sb/src/stories/composants/inputs.stories.ts new file mode 100644 index 0000000..9997bc7 --- /dev/null +++ b/sb/src/stories/composants/inputs.stories.ts @@ -0,0 +1,14 @@ +import type { Meta, StoryObj } from '@storybook/angular'; +import { Inputs } from '../../app/composants/inputs/inputs'; + +const meta: Meta = { + title: 'Components/Composants/Inputs', + component: Inputs, +}; + +export default meta; +type Story = StoryObj; + +export const Default: Story = { render: () => ({}) }; + + diff --git a/sb/src/stories/composants/radio.stories.ts b/sb/src/stories/composants/radio.stories.ts new file mode 100644 index 0000000..e96955b --- /dev/null +++ b/sb/src/stories/composants/radio.stories.ts @@ -0,0 +1,14 @@ +import type { Meta, StoryObj } from '@storybook/angular'; +import { Radio } from '../../app/composants/radio/radio'; + +const meta: Meta = { + title: 'Components/Composants/Radio', + component: Radio, +}; + +export default meta; +type Story = StoryObj; + +export const Default: Story = { render: () => ({}) }; + + diff --git a/sb/src/stories/composants/steppers.stories.ts b/sb/src/stories/composants/steppers.stories.ts new file mode 100644 index 0000000..090b79b --- /dev/null +++ b/sb/src/stories/composants/steppers.stories.ts @@ -0,0 +1,14 @@ +import type { Meta, StoryObj } from '@storybook/angular'; +import { Steppers } from '../../app/composants/steppers/steppers'; + +const meta: Meta = { + title: 'Components/Composants/Steppers', + component: Steppers, +}; + +export default meta; +type Story = StoryObj; + +export const Default: Story = { render: () => ({}) }; + + diff --git a/sb/src/stories/composants/tabulations.stories.ts b/sb/src/stories/composants/tabulations.stories.ts new file mode 100644 index 0000000..71a7a00 --- /dev/null +++ b/sb/src/stories/composants/tabulations.stories.ts @@ -0,0 +1,14 @@ +import type { Meta, StoryObj } from '@storybook/angular'; +import { Tabulations } from '../../app/composants/tabulations/tabulations'; + +const meta: Meta = { + title: 'Components/Composants/Tabulations', + component: Tabulations, +}; + +export default meta; +type Story = StoryObj; + +export const Default: Story = { render: () => ({}) }; + + diff --git a/sb/src/stories/composants/tags-chips.stories.ts b/sb/src/stories/composants/tags-chips.stories.ts new file mode 100644 index 0000000..21feb80 --- /dev/null +++ b/sb/src/stories/composants/tags-chips.stories.ts @@ -0,0 +1,14 @@ +import type { Meta, StoryObj } from '@storybook/angular'; +import { TagsChips } from '../../app/composants/tags-chips/tags-chips'; + +const meta: Meta = { + title: 'Components/Composants/Tags Chips', + component: TagsChips, +}; + +export default meta; +type Story = StoryObj; + +export const Default: Story = { render: () => ({}) }; + + diff --git a/sb/src/stories/composants/textarea.stories.ts b/sb/src/stories/composants/textarea.stories.ts new file mode 100644 index 0000000..5e99f18 --- /dev/null +++ b/sb/src/stories/composants/textarea.stories.ts @@ -0,0 +1,14 @@ +import type { Meta, StoryObj } from '@storybook/angular'; +import { Textarea } from '../../app/composants/textarea/textarea'; + +const meta: Meta