@latte-macchiat-io/latte-vanilla-components 0.0.556 → 0.0.558
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/components/Actions/stories.tsx +44 -10
- package/src/components/Box/Alert/stories.tsx +44 -14
- package/src/components/Box/stories.tsx +75 -33
- package/src/components/Box/styles.css.ts +3 -0
- package/src/components/Button/stories.tsx +64 -9
- package/src/components/Button/theme.ts +6 -6
- package/src/components/Carousel/stories.tsx +49 -9
- package/src/components/Columns/stories.tsx +95 -11
- package/src/components/ConsentCookie/stories.tsx +33 -9
- package/src/components/Footer/stories.tsx +50 -8
- package/src/components/Form/Select/stories.tsx +42 -36
- package/src/components/Form/TextField/stories.tsx +38 -41
- package/src/components/Header/stories.tsx +44 -9
- package/src/components/Heading/stories.tsx +36 -12
- package/src/components/Icon/stories.tsx +64 -9
- package/src/components/List/stories.tsx +48 -15
- package/src/components/Logo/stories.tsx +24 -6
- package/src/components/Modal/stories.tsx +50 -8
- package/src/components/Nav/stories.tsx +20 -11
- package/src/components/NavLegal/stories.tsx +19 -7
- package/src/components/NavSocial/stories.tsx +46 -8
- package/src/components/Paragraph/stories.tsx +43 -10
- package/src/components/Spacer/stories.tsx +32 -8
- package/src/components/Video/stories.tsx +31 -11
|
@@ -1,26 +1,50 @@
|
|
|
1
1
|
import type { Meta, StoryObj } from '@storybook/react-vite';
|
|
2
|
+
import React from 'react';
|
|
2
3
|
|
|
3
4
|
import { ConsentCookie } from '.';
|
|
4
5
|
|
|
5
|
-
// More on how to set up stories at: https://storybook.js.org/docs/writing-stories#default-export
|
|
6
6
|
const meta: Meta<typeof ConsentCookie> = {
|
|
7
7
|
title: '7. Interactive / ConsentCookie',
|
|
8
8
|
component: ConsentCookie,
|
|
9
9
|
parameters: {
|
|
10
|
-
|
|
11
|
-
layout: 'centered',
|
|
10
|
+
layout: 'fullscreen',
|
|
12
11
|
},
|
|
13
|
-
// This component will have an automatically generated Autodocs entry: https://storybook.js.org/docs/writing-docs/autodocs
|
|
14
12
|
tags: ['autodocs'],
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
13
|
+
argTypes: {
|
|
14
|
+
cookieName: { control: 'text' },
|
|
15
|
+
cookieExpirationDays: { control: 'number' },
|
|
16
|
+
enableGoogleAnalytics: { control: 'boolean' },
|
|
17
|
+
},
|
|
18
18
|
};
|
|
19
19
|
|
|
20
20
|
export default meta;
|
|
21
21
|
type Story = StoryObj<typeof meta>;
|
|
22
22
|
|
|
23
|
-
// More on writing stories with args: https://storybook.js.org/docs/writing-stories/args
|
|
24
23
|
export const Default: Story = {
|
|
25
|
-
args: {
|
|
24
|
+
args: {
|
|
25
|
+
cookieName: 'latte-consent',
|
|
26
|
+
children: (
|
|
27
|
+
<p>Nous utilisons des cookies pour améliorer votre expérience de navigation. Acceptez-vous l'utilisation de cookies ?</p>
|
|
28
|
+
),
|
|
29
|
+
},
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
export const WithGoogleAnalytics: Story = {
|
|
33
|
+
args: {
|
|
34
|
+
cookieName: 'latte-consent-ga',
|
|
35
|
+
enableGoogleAnalytics: true,
|
|
36
|
+
children: (
|
|
37
|
+
<p>Nous utilisons des cookies analytiques (Google Analytics) pour comprendre comment vous utilisez notre site.</p>
|
|
38
|
+
),
|
|
39
|
+
},
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
export const LongerExpiration: Story = {
|
|
43
|
+
args: {
|
|
44
|
+
cookieName: 'latte-consent-long',
|
|
45
|
+
cookieExpirationDays: 365,
|
|
46
|
+
children: (
|
|
47
|
+
<p>En continuant à naviguer sur ce site, vous acceptez notre politique de cookies.</p>
|
|
48
|
+
),
|
|
49
|
+
},
|
|
26
50
|
};
|
|
@@ -1,26 +1,68 @@
|
|
|
1
1
|
import type { Meta, StoryObj } from '@storybook/react-vite';
|
|
2
|
+
import React from 'react';
|
|
2
3
|
|
|
3
4
|
import { Footer } from './index';
|
|
4
5
|
|
|
5
|
-
// More on how to set up stories at: https://storybook.js.org/docs/writing-stories#default-export
|
|
6
6
|
const meta: Meta<typeof Footer> = {
|
|
7
7
|
title: '1. Layout/Footer',
|
|
8
8
|
component: Footer,
|
|
9
9
|
parameters: {
|
|
10
|
-
|
|
11
|
-
layout: 'centered',
|
|
10
|
+
layout: 'fullscreen',
|
|
12
11
|
},
|
|
13
|
-
// This component will have an automatically generated Autodocs entry: https://storybook.js.org/docs/writing-docs/autodocs
|
|
14
12
|
tags: ['autodocs'],
|
|
15
|
-
// More on argTypes: https://storybook.js.org/docs/api/argtypes
|
|
16
13
|
argTypes: {},
|
|
17
|
-
// Use `fn` to spy on the onClick arg, which will appear in the actions panel once invoked: https://storybook.js.org/docs/essentials/actions#action-args
|
|
18
14
|
};
|
|
19
15
|
|
|
20
16
|
export default meta;
|
|
21
17
|
type Story = StoryObj<typeof meta>;
|
|
22
18
|
|
|
23
|
-
// More on writing stories with args: https://storybook.js.org/docs/writing-stories/args
|
|
24
19
|
export const Default: Story = {
|
|
25
|
-
args: {
|
|
20
|
+
args: {
|
|
21
|
+
children: <p style={{ textAlign: 'center' }}>© 2024 Latte Macchiat.io — Tous droits réservés</p>,
|
|
22
|
+
},
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
export const WithLinks: Story = {
|
|
26
|
+
args: {
|
|
27
|
+
children: (
|
|
28
|
+
<div style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'center', flexWrap: 'wrap', gap: '1rem' }}>
|
|
29
|
+
<p>© 2024 Latte Macchiat.io</p>
|
|
30
|
+
<nav style={{ display: 'flex', gap: '1rem' }}>
|
|
31
|
+
<a href="#">Mentions légales</a>
|
|
32
|
+
<a href="#">Confidentialité</a>
|
|
33
|
+
<a href="#">CGU</a>
|
|
34
|
+
</nav>
|
|
35
|
+
</div>
|
|
36
|
+
),
|
|
37
|
+
},
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
export const WithColumns: Story = {
|
|
41
|
+
args: {
|
|
42
|
+
children: (
|
|
43
|
+
<div style={{ display: 'grid', gridTemplateColumns: 'repeat(3, 1fr)', gap: '2rem' }}>
|
|
44
|
+
<div>
|
|
45
|
+
<strong>À propos</strong>
|
|
46
|
+
<ul style={{ listStyle: 'none', padding: 0, marginTop: '0.5rem' }}>
|
|
47
|
+
<li><a href="#">Notre équipe</a></li>
|
|
48
|
+
<li><a href="#">Notre histoire</a></li>
|
|
49
|
+
</ul>
|
|
50
|
+
</div>
|
|
51
|
+
<div>
|
|
52
|
+
<strong>Services</strong>
|
|
53
|
+
<ul style={{ listStyle: 'none', padding: 0, marginTop: '0.5rem' }}>
|
|
54
|
+
<li><a href="#">Développement</a></li>
|
|
55
|
+
<li><a href="#">Design</a></li>
|
|
56
|
+
</ul>
|
|
57
|
+
</div>
|
|
58
|
+
<div>
|
|
59
|
+
<strong>Contact</strong>
|
|
60
|
+
<ul style={{ listStyle: 'none', padding: 0, marginTop: '0.5rem' }}>
|
|
61
|
+
<li><a href="#">Email</a></li>
|
|
62
|
+
<li><a href="#">Téléphone</a></li>
|
|
63
|
+
</ul>
|
|
64
|
+
</div>
|
|
65
|
+
</div>
|
|
66
|
+
),
|
|
67
|
+
},
|
|
26
68
|
};
|
|
@@ -2,7 +2,6 @@ import type { Meta, StoryObj } from '@storybook/react-vite';
|
|
|
2
2
|
|
|
3
3
|
import { Select } from '.';
|
|
4
4
|
|
|
5
|
-
// More on how to set up stories at: https://storybook.js.org/docs/writing-stories#default-export
|
|
6
5
|
const meta: Meta<typeof Select> = {
|
|
7
6
|
title: '5. Forms / Select',
|
|
8
7
|
component: Select,
|
|
@@ -10,7 +9,10 @@ const meta: Meta<typeof Select> = {
|
|
|
10
9
|
layout: 'centered',
|
|
11
10
|
},
|
|
12
11
|
tags: ['autodocs'],
|
|
13
|
-
argTypes: {
|
|
12
|
+
argTypes: {
|
|
13
|
+
labelPosition: { control: 'select', options: ['top', 'side'] },
|
|
14
|
+
required: { control: 'boolean' },
|
|
15
|
+
},
|
|
14
16
|
decorators: [
|
|
15
17
|
(Story) => (
|
|
16
18
|
<div style={{ minWidth: '320px', maxWidth: '500px', width: '100%' }}>
|
|
@@ -23,60 +25,64 @@ const meta: Meta<typeof Select> = {
|
|
|
23
25
|
export default meta;
|
|
24
26
|
type Story = StoryObj<typeof meta>;
|
|
25
27
|
|
|
26
|
-
|
|
28
|
+
const countryOptions = [
|
|
29
|
+
{ value: '', label: 'Sélectionnez un pays', disabled: true },
|
|
30
|
+
{ value: 'fr', label: 'France', disabled: false },
|
|
31
|
+
{ value: 'be', label: 'Belgique', disabled: false },
|
|
32
|
+
{ value: 'ch', label: 'Suisse', disabled: false },
|
|
33
|
+
{ value: 'ca', label: 'Canada', disabled: false },
|
|
34
|
+
];
|
|
35
|
+
|
|
27
36
|
export const Default: Story = {
|
|
28
|
-
args: {
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
37
|
+
args: { name: 'country', label: 'Pays', options: countryOptions },
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
export const LabelPositionTop: Story = {
|
|
41
|
+
args: { name: 'country', label: 'Pays', labelPosition: 'top', options: countryOptions },
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
export const LabelPositionSide: Story = {
|
|
45
|
+
args: { name: 'country', label: 'Pays', labelPosition: 'side', options: countryOptions },
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
export const Required: Story = {
|
|
49
|
+
args: { name: 'country', label: 'Pays', required: true, options: countryOptions },
|
|
39
50
|
};
|
|
40
51
|
|
|
41
52
|
export const WithError: Story = {
|
|
42
53
|
args: {
|
|
43
|
-
name: 'payment
|
|
44
|
-
label: '
|
|
54
|
+
name: 'payment',
|
|
55
|
+
label: 'Mode de paiement',
|
|
45
56
|
options: [
|
|
46
|
-
{ value: '', label: '
|
|
47
|
-
{ value: '
|
|
48
|
-
{ value: 'debit', label: 'Debit Card', disabled: false },
|
|
57
|
+
{ value: '', label: 'Choisir un mode', disabled: true },
|
|
58
|
+
{ value: 'card', label: 'Carte bancaire', disabled: false },
|
|
49
59
|
{ value: 'paypal', label: 'PayPal', disabled: false },
|
|
50
60
|
],
|
|
51
|
-
errors: '
|
|
61
|
+
errors: 'Veuillez sélectionner un mode de paiement',
|
|
52
62
|
},
|
|
53
63
|
};
|
|
54
64
|
|
|
55
65
|
export const WithMultipleErrors: Story = {
|
|
56
66
|
args: {
|
|
57
|
-
name: '
|
|
58
|
-
label: '
|
|
67
|
+
name: 'plan',
|
|
68
|
+
label: 'Forfait',
|
|
59
69
|
options: [
|
|
60
|
-
{ value: '', label: '
|
|
61
|
-
{ value: 'free', label: '
|
|
62
|
-
{ value: 'pro', label: 'Pro
|
|
63
|
-
{ value: 'enterprise', label: 'Enterprise - $49.99/mo', disabled: false },
|
|
70
|
+
{ value: '', label: 'Choisir un forfait', disabled: true },
|
|
71
|
+
{ value: 'free', label: 'Gratuit', disabled: false },
|
|
72
|
+
{ value: 'pro', label: 'Pro', disabled: false },
|
|
64
73
|
],
|
|
65
|
-
errors: ['
|
|
74
|
+
errors: ['Ce champ est requis', 'Votre forfait actuel a expiré'],
|
|
66
75
|
},
|
|
67
76
|
};
|
|
68
77
|
|
|
69
|
-
export const
|
|
78
|
+
export const WithDisabledOption: Story = {
|
|
70
79
|
args: {
|
|
71
|
-
name: '
|
|
72
|
-
label: '
|
|
73
|
-
required: true,
|
|
80
|
+
name: 'plan',
|
|
81
|
+
label: 'Forfait',
|
|
74
82
|
options: [
|
|
75
|
-
{ value: '', label: '
|
|
76
|
-
{ value: '
|
|
77
|
-
{ value: '
|
|
78
|
-
{ value: 'fr', label: 'Français', disabled: false },
|
|
79
|
-
{ value: 'de', label: 'Deutsch', disabled: false },
|
|
83
|
+
{ value: 'free', label: 'Gratuit', disabled: false },
|
|
84
|
+
{ value: 'pro', label: 'Pro', disabled: false },
|
|
85
|
+
{ value: 'enterprise', label: 'Enterprise (bientôt disponible)', disabled: true },
|
|
80
86
|
],
|
|
81
87
|
},
|
|
82
88
|
};
|
|
@@ -2,7 +2,6 @@ import type { Meta, StoryObj } from '@storybook/react-vite';
|
|
|
2
2
|
|
|
3
3
|
import { TextField } from '.';
|
|
4
4
|
|
|
5
|
-
// More on how to set up stories at: https://storybook.js.org/docs/writing-stories#default-export
|
|
6
5
|
const meta: Meta<typeof TextField> = {
|
|
7
6
|
title: '5. Forms / TextField',
|
|
8
7
|
component: TextField,
|
|
@@ -10,7 +9,10 @@ const meta: Meta<typeof TextField> = {
|
|
|
10
9
|
layout: 'centered',
|
|
11
10
|
},
|
|
12
11
|
tags: ['autodocs'],
|
|
13
|
-
argTypes: {
|
|
12
|
+
argTypes: {
|
|
13
|
+
type: { control: 'select', options: ['text', 'email', 'password', 'number', 'tel', 'url', 'search', 'textarea'] },
|
|
14
|
+
required: { control: 'boolean' },
|
|
15
|
+
},
|
|
14
16
|
decorators: [
|
|
15
17
|
(Story) => (
|
|
16
18
|
<div style={{ minWidth: '320px', maxWidth: '500px', width: '100%' }}>
|
|
@@ -23,60 +25,55 @@ const meta: Meta<typeof TextField> = {
|
|
|
23
25
|
export default meta;
|
|
24
26
|
type Story = StoryObj<typeof meta>;
|
|
25
27
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
args: {
|
|
29
|
-
name: 'username',
|
|
30
|
-
label: 'Username',
|
|
31
|
-
type: 'text',
|
|
32
|
-
placeholder: 'Enter your username',
|
|
33
|
-
},
|
|
28
|
+
export const Text: Story = {
|
|
29
|
+
args: { name: 'username', label: "Nom d'utilisateur", type: 'text', placeholder: 'Jean Dupont' },
|
|
34
30
|
};
|
|
35
31
|
|
|
36
|
-
export const
|
|
37
|
-
args: {
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
32
|
+
export const Email: Story = {
|
|
33
|
+
args: { name: 'email', label: 'Adresse email', type: 'email', placeholder: 'jean@exemple.fr', required: true },
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
export const Password: Story = {
|
|
37
|
+
args: { name: 'password', label: 'Mot de passe', type: 'password', placeholder: '••••••••' },
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
export const Number: Story = {
|
|
41
|
+
args: { name: 'age', label: 'Âge', type: 'number', placeholder: '25' },
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
export const Tel: Story = {
|
|
45
|
+
args: { name: 'phone', label: 'Téléphone', type: 'tel', placeholder: '+33 6 00 00 00 00' },
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
export const Url: Story = {
|
|
49
|
+
args: { name: 'website', label: 'Site web', type: 'url', placeholder: 'https://exemple.fr' },
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
export const Search: Story = {
|
|
53
|
+
args: { name: 'search', label: 'Rechercher', type: 'search', placeholder: 'Rechercher...' },
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
export const Textarea: Story = {
|
|
57
|
+
args: { name: 'message', label: 'Message', type: 'textarea', rows: 5, placeholder: 'Écrivez votre message...' },
|
|
44
58
|
};
|
|
45
59
|
|
|
46
60
|
export const WithError: Story = {
|
|
47
|
-
args: {
|
|
48
|
-
name: 'password',
|
|
49
|
-
label: 'Password',
|
|
50
|
-
type: 'password',
|
|
51
|
-
errors: 'Password is required',
|
|
52
|
-
},
|
|
61
|
+
args: { name: 'email', label: 'Email', type: 'email', errors: 'Ce champ est requis' },
|
|
53
62
|
};
|
|
54
63
|
|
|
55
64
|
export const WithMultipleErrors: Story = {
|
|
56
65
|
args: {
|
|
57
66
|
name: 'password',
|
|
58
|
-
label: '
|
|
67
|
+
label: 'Mot de passe',
|
|
59
68
|
type: 'password',
|
|
60
|
-
errors: ['
|
|
69
|
+
errors: ['Le mot de passe est requis', 'Minimum 8 caractères', 'Doit contenir un chiffre'],
|
|
61
70
|
},
|
|
62
71
|
};
|
|
63
72
|
|
|
64
|
-
export const
|
|
65
|
-
args: {
|
|
66
|
-
name: 'bio',
|
|
67
|
-
label: 'Biography',
|
|
68
|
-
type: 'textarea',
|
|
69
|
-
rows: 5,
|
|
70
|
-
placeholder: 'Tell us about yourself...',
|
|
71
|
-
},
|
|
73
|
+
export const Required: Story = {
|
|
74
|
+
args: { name: 'name', label: 'Nom complet', type: 'text', required: true, placeholder: 'Jean Dupont' },
|
|
72
75
|
};
|
|
73
76
|
|
|
74
77
|
export const TextareaWithError: Story = {
|
|
75
|
-
args: {
|
|
76
|
-
name: 'comments',
|
|
77
|
-
label: 'Comments',
|
|
78
|
-
type: 'textarea',
|
|
79
|
-
rows: 4,
|
|
80
|
-
errors: 'Please provide your feedback',
|
|
81
|
-
},
|
|
78
|
+
args: { name: 'bio', label: 'Biographie', type: 'textarea', rows: 4, errors: 'Ce champ est requis' },
|
|
82
79
|
};
|
|
@@ -1,26 +1,61 @@
|
|
|
1
1
|
import type { Meta, StoryObj } from '@storybook/react-vite';
|
|
2
|
+
import React from 'react';
|
|
2
3
|
|
|
3
4
|
import { Header } from './index';
|
|
4
5
|
|
|
5
|
-
// More on how to set up stories at: https://storybook.js.org/docs/writing-stories#default-export
|
|
6
6
|
const meta: Meta<typeof Header> = {
|
|
7
7
|
title: '1. Layout/Header',
|
|
8
8
|
component: Header,
|
|
9
9
|
parameters: {
|
|
10
|
-
|
|
11
|
-
layout: 'centered',
|
|
10
|
+
layout: 'fullscreen',
|
|
12
11
|
},
|
|
13
|
-
// This component will have an automatically generated Autodocs entry: https://storybook.js.org/docs/writing-docs/autodocs
|
|
14
12
|
tags: ['autodocs'],
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
13
|
+
argTypes: {
|
|
14
|
+
isFixed: { control: 'boolean' },
|
|
15
|
+
toggleNavVisibility: { control: 'select', options: ['show', 'hide', 'mobileOnly'] },
|
|
16
|
+
},
|
|
18
17
|
};
|
|
19
18
|
|
|
20
19
|
export default meta;
|
|
21
20
|
type Story = StoryObj<typeof meta>;
|
|
22
21
|
|
|
23
|
-
|
|
22
|
+
const logo = (
|
|
23
|
+
<div style={{ padding: '1rem', fontWeight: 700, fontSize: '1.25rem' }}>Logo</div>
|
|
24
|
+
);
|
|
25
|
+
|
|
24
26
|
export const Default: Story = {
|
|
25
|
-
args: {},
|
|
27
|
+
args: { children: logo },
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
export const WithToggleNav: Story = {
|
|
31
|
+
args: { children: logo, toggleNavVisibility: 'show' },
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
export const ToggleNavHidden: Story = {
|
|
35
|
+
args: { children: logo, toggleNavVisibility: 'hide' },
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
export const ToggleNavMobileOnly: Story = {
|
|
39
|
+
args: { children: logo, toggleNavVisibility: 'mobileOnly' },
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
export const Fixed: Story = {
|
|
43
|
+
args: { children: logo, isFixed: true },
|
|
44
|
+
parameters: { layout: 'padded' },
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
export const WithNavContent: Story = {
|
|
48
|
+
args: {
|
|
49
|
+
toggleNavVisibility: 'mobileOnly',
|
|
50
|
+
children: (
|
|
51
|
+
<div style={{ display: 'flex', alignItems: 'center', justifyContent: 'space-between', width: '100%', padding: '0.5rem 1rem' }}>
|
|
52
|
+
<div style={{ fontWeight: 700, fontSize: '1.25rem' }}>Logo</div>
|
|
53
|
+
<nav style={{ display: 'flex', gap: '1.5rem' }}>
|
|
54
|
+
<a href="#">Accueil</a>
|
|
55
|
+
<a href="#">À propos</a>
|
|
56
|
+
<a href="#">Contact</a>
|
|
57
|
+
</nav>
|
|
58
|
+
</div>
|
|
59
|
+
),
|
|
60
|
+
},
|
|
26
61
|
};
|
|
@@ -1,29 +1,53 @@
|
|
|
1
1
|
import type { Meta, StoryObj } from '@storybook/react-vite';
|
|
2
|
-
import React from 'react';
|
|
3
2
|
|
|
4
3
|
import { Heading } from '.';
|
|
5
4
|
|
|
6
|
-
// More on how to set up stories at: https://storybook.js.org/docs/writing-stories#default-export
|
|
7
5
|
const meta: Meta<typeof Heading> = {
|
|
8
6
|
title: '2. Content / Heading',
|
|
9
7
|
component: Heading,
|
|
10
8
|
parameters: {
|
|
11
|
-
// Optional parameter to center the component in the Canvas. More info: https://storybook.js.org/docs/configure/story-layout
|
|
12
9
|
layout: 'centered',
|
|
13
10
|
},
|
|
14
|
-
// This component will have an automatically generated Autodocs entry: https://storybook.js.org/docs/writing-docs/autodocs
|
|
15
11
|
tags: ['autodocs'],
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
12
|
+
argTypes: {
|
|
13
|
+
as: { control: 'select', options: ['h1', 'h2', 'h3', 'h4', 'h5', 'h6'] },
|
|
14
|
+
size: { control: 'select', options: ['xxl', 'xl', 'lg', 'md', 'sm', 'xs'] },
|
|
15
|
+
},
|
|
19
16
|
};
|
|
20
17
|
|
|
21
18
|
export default meta;
|
|
22
19
|
type Story = StoryObj<typeof meta>;
|
|
23
20
|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
21
|
+
export const H1: Story = {
|
|
22
|
+
args: { as: 'h1', children: 'Heading H1 — XXL' },
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
export const H2: Story = {
|
|
26
|
+
args: { as: 'h2', children: 'Heading H2 — XL' },
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
export const H3: Story = {
|
|
30
|
+
args: { as: 'h3', children: 'Heading H3 — LG' },
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
export const H4: Story = {
|
|
34
|
+
args: { as: 'h4', children: 'Heading H4 — MD' },
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
export const H5: Story = {
|
|
38
|
+
args: { as: 'h5', children: 'Heading H5 — SM' },
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
export const H6: Story = {
|
|
42
|
+
args: { as: 'h6', children: 'Heading H6 — XS' },
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
export const H1SizeXS: Story = {
|
|
46
|
+
name: 'H1 with custom size XS',
|
|
47
|
+
args: { as: 'h1', size: 'xs', children: 'H1 tag, XS size' },
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
export const H6SizeXXL: Story = {
|
|
51
|
+
name: 'H6 with custom size XXL',
|
|
52
|
+
args: { as: 'h6', size: 'xxl', children: 'H6 tag, XXL size' },
|
|
29
53
|
};
|
|
@@ -1,26 +1,81 @@
|
|
|
1
1
|
import type { Meta, StoryObj } from '@storybook/react-vite';
|
|
2
|
+
import React from 'react';
|
|
2
3
|
|
|
3
4
|
import { Icon } from '.';
|
|
4
5
|
|
|
5
|
-
// More on how to set up stories at: https://storybook.js.org/docs/writing-stories#default-export
|
|
6
6
|
const meta: Meta<typeof Icon> = {
|
|
7
7
|
title: '4. Media / Icon',
|
|
8
8
|
component: Icon,
|
|
9
9
|
parameters: {
|
|
10
|
-
// Optional parameter to center the component in the Canvas. More info: https://storybook.js.org/docs/configure/story-layout
|
|
11
10
|
layout: 'centered',
|
|
12
11
|
},
|
|
13
|
-
// This component will have an automatically generated Autodocs entry: https://storybook.js.org/docs/writing-docs/autodocs
|
|
14
12
|
tags: ['autodocs'],
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
13
|
+
argTypes: {
|
|
14
|
+
icon: {
|
|
15
|
+
control: 'select',
|
|
16
|
+
options: [
|
|
17
|
+
'caret', 'close', 'arrowBack', 'arrowForward',
|
|
18
|
+
'warning', 'info', 'success', 'danger',
|
|
19
|
+
'play', 'pause', 'volumeMute', 'volumeUp',
|
|
20
|
+
'socialFacebook', 'socialInstagram', 'socialPinterest',
|
|
21
|
+
'socialLinkedIn', 'socialSpotify', 'socialTiktok', 'socialX', 'socialYoutube',
|
|
22
|
+
],
|
|
23
|
+
},
|
|
24
|
+
size: { control: 'number' },
|
|
25
|
+
color: { control: 'color' },
|
|
26
|
+
},
|
|
18
27
|
};
|
|
19
28
|
|
|
20
29
|
export default meta;
|
|
21
30
|
type Story = StoryObj<typeof meta>;
|
|
22
31
|
|
|
23
|
-
|
|
24
|
-
export const
|
|
25
|
-
|
|
32
|
+
export const Caret: Story = { args: { icon: 'caret', size: 24 } };
|
|
33
|
+
export const Close: Story = { args: { icon: 'close', size: 24 } };
|
|
34
|
+
export const ArrowBack: Story = { args: { icon: 'arrowBack', size: 24 } };
|
|
35
|
+
export const ArrowForward: Story = { args: { icon: 'arrowForward', size: 24 } };
|
|
36
|
+
export const Warning: Story = { args: { icon: 'warning', size: 24 } };
|
|
37
|
+
export const Info: Story = { args: { icon: 'info', size: 24 } };
|
|
38
|
+
export const Success: Story = { args: { icon: 'success', size: 24 } };
|
|
39
|
+
export const Danger: Story = { args: { icon: 'danger', size: 24 } };
|
|
40
|
+
export const Play: Story = { args: { icon: 'play', size: 24 } };
|
|
41
|
+
export const Pause: Story = { args: { icon: 'pause', size: 24 } };
|
|
42
|
+
export const VolumeMute: Story = { args: { icon: 'volumeMute', size: 24 } };
|
|
43
|
+
export const VolumeUp: Story = { args: { icon: 'volumeUp', size: 24 } };
|
|
44
|
+
|
|
45
|
+
export const SocialFacebook: Story = { args: { icon: 'socialFacebook', size: 24 } };
|
|
46
|
+
export const SocialInstagram: Story = { args: { icon: 'socialInstagram', size: 24 } };
|
|
47
|
+
export const SocialPinterest: Story = { args: { icon: 'socialPinterest', size: 24 } };
|
|
48
|
+
export const SocialLinkedIn: Story = { args: { icon: 'socialLinkedIn', size: 24 } };
|
|
49
|
+
export const SocialTiktok: Story = { args: { icon: 'socialTiktok', size: 24 } };
|
|
50
|
+
export const SocialX: Story = { args: { icon: 'socialX', size: 24 } };
|
|
51
|
+
export const SocialYoutube: Story = { args: { icon: 'socialYoutube', size: 24 } };
|
|
52
|
+
|
|
53
|
+
export const SizeSmall: Story = { args: { icon: 'info', size: 16 } };
|
|
54
|
+
export const SizeMedium: Story = { args: { icon: 'info', size: 24 } };
|
|
55
|
+
export const SizeLarge: Story = { args: { icon: 'info', size: 48 } };
|
|
56
|
+
|
|
57
|
+
export const AllIcons: Story = {
|
|
58
|
+
render: () => (
|
|
59
|
+
<div style={{ display: 'flex', flexWrap: 'wrap', gap: '16px', alignItems: 'center' }}>
|
|
60
|
+
{(['caret', 'close', 'arrowBack', 'arrowForward', 'warning', 'info', 'success', 'danger', 'play', 'pause', 'volumeMute', 'volumeUp'] as const).map((name) => (
|
|
61
|
+
<div key={name} style={{ display: 'flex', flexDirection: 'column', alignItems: 'center', gap: '4px' }}>
|
|
62
|
+
<Icon icon={name} size={24} />
|
|
63
|
+
<span style={{ fontSize: '11px' }}>{name}</span>
|
|
64
|
+
</div>
|
|
65
|
+
))}
|
|
66
|
+
</div>
|
|
67
|
+
),
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
export const AllSocialIcons: Story = {
|
|
71
|
+
render: () => (
|
|
72
|
+
<div style={{ display: 'flex', flexWrap: 'wrap', gap: '16px', alignItems: 'center' }}>
|
|
73
|
+
{(['socialFacebook', 'socialInstagram', 'socialPinterest', 'socialLinkedIn', 'socialTiktok', 'socialX', 'socialYoutube'] as const).map((name) => (
|
|
74
|
+
<div key={name} style={{ display: 'flex', flexDirection: 'column', alignItems: 'center', gap: '4px' }}>
|
|
75
|
+
<Icon icon={name} size={24} />
|
|
76
|
+
<span style={{ fontSize: '11px' }}>{name.replace('social', '')}</span>
|
|
77
|
+
</div>
|
|
78
|
+
))}
|
|
79
|
+
</div>
|
|
80
|
+
),
|
|
26
81
|
};
|