@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.
@@ -3,32 +3,65 @@ import React from 'react';
3
3
 
4
4
  import { List } from '.';
5
5
 
6
- // More on how to set up stories at: https://storybook.js.org/docs/writing-stories#default-export
7
6
  const meta: Meta<typeof List> = {
8
7
  title: '1. Layout/List',
9
8
  component: List,
10
9
  parameters: {
11
- // Optional parameter to center the component in the Canvas. More info: https://storybook.js.org/docs/configure/story-layout
12
10
  layout: 'centered',
13
11
  },
14
- // This component will have an automatically generated Autodocs entry: https://storybook.js.org/docs/writing-docs/autodocs
15
12
  tags: ['autodocs'],
16
- // More on argTypes: https://storybook.js.org/docs/api/argtypes
17
- argTypes: {},
18
- // 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
13
+ argTypes: {
14
+ withBullets: { control: 'boolean' },
15
+ maxLength: { control: 'number' },
16
+ },
17
+ decorators: [
18
+ (Story) => (
19
+ <div style={{ width: '600px', maxWidth: '100%' }}>
20
+ <Story />
21
+ </div>
22
+ ),
23
+ ],
19
24
  };
20
25
 
21
26
  export default meta;
22
27
  type Story = StoryObj<typeof meta>;
23
28
 
24
- // More on writing stories with args: https://storybook.js.org/docs/writing-stories/args
29
+ const shortItems = (
30
+ <>
31
+ <li>First item</li>
32
+ <li>Second item</li>
33
+ <li>Third item</li>
34
+ <li>Fourth item</li>
35
+ </>
36
+ );
37
+
38
+ const manyItems = (
39
+ <>
40
+ {Array.from({ length: 12 }, (_, i) => (
41
+ <li key={i}>List item {i + 1}</li>
42
+ ))}
43
+ </>
44
+ );
45
+
25
46
  export const Default: Story = {
26
- args: {
27
- children: (
28
- <>
29
- <li>hello</li>
30
- <li>hello</li>
31
- </>
32
- ),
33
- },
47
+ args: { children: shortItems },
48
+ };
49
+
50
+ export const WithBullets: Story = {
51
+ args: { withBullets: true, children: shortItems },
52
+ };
53
+
54
+ export const ManyItems: Story = {
55
+ name: 'Many items (2 columns)',
56
+ args: { children: manyItems },
57
+ };
58
+
59
+ export const ManyItemsWithBullets: Story = {
60
+ name: 'Many items with bullets (2 columns)',
61
+ args: { withBullets: true, children: manyItems },
62
+ };
63
+
64
+ export const CustomMaxLength: Story = {
65
+ name: 'Custom maxLength = 3 (forces 2 columns earlier)',
66
+ args: { maxLength: 3, children: shortItems },
34
67
  };
@@ -1,26 +1,44 @@
1
1
  import type { Meta, StoryObj } from '@storybook/react-vite';
2
+ import React from 'react';
2
3
 
3
4
  import { Logo } 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 Logo> = {
7
7
  title: '4. Media / Logo',
8
8
  component: Logo,
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
- // 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
20
  args: {},
26
21
  };
22
+
23
+ export const WithText: Story = {
24
+ args: {
25
+ children: <span style={{ fontWeight: 700, fontSize: '1.5rem' }}>Latte Macchiat.io</span>,
26
+ },
27
+ };
28
+
29
+ export const WithImage: Story = {
30
+ args: {
31
+ children: <img src="https://placehold.co/120x40" alt="Logo" style={{ display: 'block' }} />,
32
+ },
33
+ };
34
+
35
+ export const WithTextAndTagline: Story = {
36
+ args: {
37
+ children: (
38
+ <div>
39
+ <span style={{ fontWeight: 700, fontSize: '1.25rem', display: 'block' }}>Latte Macchiat.io</span>
40
+ <span style={{ fontSize: '0.75rem', opacity: 0.7 }}>Artisan web components</span>
41
+ </div>
42
+ ),
43
+ },
44
+ };
@@ -3,27 +3,69 @@ import React from 'react';
3
3
 
4
4
  import { Modal } from '.';
5
5
 
6
- // More on how to set up stories at: https://storybook.js.org/docs/writing-stories#default-export
7
6
  const meta: Meta<typeof Modal> = {
8
7
  title: '7. Interactive / Modal',
9
8
  component: Modal,
10
9
  parameters: {
11
- // Optional parameter to center the component in the Canvas. More info: https://storybook.js.org/docs/configure/story-layout
12
10
  layout: 'centered',
13
11
  },
14
- // This component will have an automatically generated Autodocs entry: https://storybook.js.org/docs/writing-docs/autodocs
15
12
  tags: ['autodocs'],
16
- // More on argTypes: https://storybook.js.org/docs/api/argtypes
17
- argTypes: {},
18
- // 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
13
+ argTypes: {
14
+ size: { control: 'select', options: ['sm', 'md', 'lg'] },
15
+ align: { control: 'select', options: ['left', 'center', 'right'] },
16
+ withCloseButton: { control: 'boolean' },
17
+ },
19
18
  };
20
19
 
21
20
  export default meta;
22
21
  type Story = StoryObj<typeof meta>;
23
22
 
24
- // More on writing stories with args: https://storybook.js.org/docs/writing-stories/args
23
+ const content = (
24
+ <div>
25
+ <h3 style={{ marginTop: 0 }}>Modal title</h3>
26
+ <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</p>
27
+ </div>
28
+ );
29
+
25
30
  export const Default: Story = {
31
+ args: { triggerLabel: 'Open modal', size: 'md', align: 'center', children: content },
32
+ };
33
+
34
+ export const SizeSmall: Story = {
35
+ args: { triggerLabel: 'Open small modal', size: 'sm', children: content },
36
+ };
37
+
38
+ export const SizeMedium: Story = {
39
+ args: { triggerLabel: 'Open medium modal', size: 'md', children: content },
40
+ };
41
+
42
+ export const SizeLarge: Story = {
43
+ args: { triggerLabel: 'Open large modal', size: 'lg', children: content },
44
+ };
45
+
46
+ export const WithCloseButton: Story = {
47
+ args: { triggerLabel: 'Open modal', withCloseButton: true, children: content },
48
+ };
49
+
50
+ export const AlignLeft: Story = {
51
+ args: { triggerLabel: 'Open modal (left)', align: 'left', children: content },
52
+ };
53
+
54
+ export const AlignRight: Story = {
55
+ args: { triggerLabel: 'Open modal (right)', align: 'right', children: content },
56
+ };
57
+
58
+ export const WithFunctionChildren: Story = {
59
+ name: 'With close callback',
26
60
  args: {
27
- children: <div>Hellooooo</div>,
61
+ triggerLabel: 'Open modal',
62
+ withCloseButton: false,
63
+ children: ({ closeModal }: { closeModal: () => void }) => (
64
+ <div>
65
+ <h3 style={{ marginTop: 0 }}>Controlled modal</h3>
66
+ <p>This modal controls its own close button.</p>
67
+ <button onClick={closeModal} style={{ marginTop: '1rem' }}>Close</button>
68
+ </div>
69
+ ),
28
70
  },
29
71
  };
@@ -1,28 +1,37 @@
1
1
  import type { Meta, StoryObj } from '@storybook/react-vite';
2
+ import React from 'react';
2
3
 
3
4
  import { Nav } 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 Nav> = {
7
7
  title: '6. Nav / Main',
8
8
  component: Nav,
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
- // More on argTypes: https://storybook.js.org/docs/api/argtypes
16
- 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
13
+ argTypes: {
14
+ direction: { control: 'select', options: ['row', 'column'] },
15
+ },
18
16
  };
19
17
 
20
18
  export default meta;
21
19
  type Story = StoryObj<typeof meta>;
22
20
 
23
- // More on writing stories with args: https://storybook.js.org/docs/writing-stories/args
24
- export const Default: Story = {
25
- args: {
26
- children: '',
27
- },
21
+ const links = (
22
+ <>
23
+ <a href="#">Accueil</a>
24
+ <a href="#">À propos</a>
25
+ <a href="#">Services</a>
26
+ <a href="#">Blog</a>
27
+ <a href="#">Contact</a>
28
+ </>
29
+ );
30
+
31
+ export const Row: Story = {
32
+ args: { direction: 'row', children: links },
33
+ };
34
+
35
+ export const Column: Story = {
36
+ args: { direction: 'column', children: links },
28
37
  };
@@ -1,28 +1,40 @@
1
1
  import type { Meta, StoryObj } from '@storybook/react-vite';
2
+ import React from 'react';
2
3
 
3
4
  import { NavLegal } 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 NavLegal> = {
7
7
  title: '6. Nav / Legal',
8
8
  component: NavLegal,
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
- // 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
20
  args: {
26
- children: '',
21
+ children: (
22
+ <>
23
+ <a href="#">Mentions légales</a>
24
+ <a href="#">Politique de confidentialité</a>
25
+ <a href="#">CGU</a>
26
+ </>
27
+ ),
28
+ },
29
+ };
30
+
31
+ export const MinimalLinks: Story = {
32
+ args: {
33
+ children: (
34
+ <>
35
+ <a href="#">Mentions légales</a>
36
+ <a href="#">Cookies</a>
37
+ </>
38
+ ),
27
39
  },
28
40
  };
@@ -2,27 +2,65 @@ import type { Meta, StoryObj } from '@storybook/react-vite';
2
2
 
3
3
  import { NavSocial } from './index';
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 NavSocial> = {
7
6
  title: '6. Nav / Social',
8
7
  component: NavSocial,
9
8
  parameters: {
10
- // Optional parameter to center the component in the Canvas. More info: https://storybook.js.org/docs/configure/story-layout
11
9
  layout: 'centered',
12
10
  },
13
- // This component will have an automatically generated Autodocs entry: https://storybook.js.org/docs/writing-docs/autodocs
14
11
  tags: ['autodocs'],
15
- // More on argTypes: https://storybook.js.org/docs/api/argtypes
16
- 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
12
+ argTypes: {
13
+ size: { control: 'number' },
14
+ },
18
15
  };
19
16
 
20
17
  export default meta;
21
18
  type Story = StoryObj<typeof meta>;
22
19
 
23
- // More on writing stories with args: https://storybook.js.org/docs/writing-stories/args
24
20
  export const Default: Story = {
25
21
  args: {
26
- children: '',
22
+ size: 24,
23
+ navSocial: [
24
+ { name: 'instagram', link: '#' },
25
+ { name: 'facebook', link: '#' },
26
+ { name: 'linkedIn', link: '#' },
27
+ ],
28
+ },
29
+ };
30
+
31
+ export const SmallIcons: Story = {
32
+ args: {
33
+ size: 16,
34
+ navSocial: [
35
+ { name: 'instagram', link: '#' },
36
+ { name: 'facebook', link: '#' },
37
+ { name: 'linkedIn', link: '#' },
38
+ ],
39
+ },
40
+ };
41
+
42
+ export const LargeIcons: Story = {
43
+ args: {
44
+ size: 32,
45
+ navSocial: [
46
+ { name: 'instagram', link: '#' },
47
+ { name: 'facebook', link: '#' },
48
+ { name: 'linkedIn', link: '#' },
49
+ ],
50
+ },
51
+ };
52
+
53
+ export const AllPlatforms: Story = {
54
+ args: {
55
+ size: 24,
56
+ navSocial: [
57
+ { name: 'instagram', link: '#' },
58
+ { name: 'facebook', link: '#' },
59
+ { name: 'linkedIn', link: '#' },
60
+ { name: 'X', link: '#' },
61
+ { name: 'youtube', link: '#' },
62
+ { name: 'tiktok', link: '#' },
63
+ { name: 'pinterest', link: '#' },
64
+ ],
27
65
  },
28
66
  };
@@ -3,27 +3,60 @@ import React from 'react';
3
3
 
4
4
  import { Paragraph } from '.';
5
5
 
6
- // More on how to set up stories at: https://storybook.js.org/docs/writing-stories#default-export
7
6
  const meta: Meta<typeof Paragraph> = {
8
7
  title: '2. Content / Paragraph',
9
8
  component: Paragraph,
10
9
  parameters: {
11
- // Optional parameter to center the component in the Canvas. More info: https://storybook.js.org/docs/configure/story-layout
12
10
  layout: 'centered',
13
11
  },
14
- // This component will have an automatically generated Autodocs entry: https://storybook.js.org/docs/writing-docs/autodocs
15
12
  tags: ['autodocs'],
16
- // More on argTypes: https://storybook.js.org/docs/api/argtypes
17
- argTypes: {},
18
- // 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
13
+ argTypes: {
14
+ size: { control: 'select', options: ['full', 'lg', 'md', 'sm'] },
15
+ align: { control: 'select', options: ['left', 'center', 'right'] },
16
+ },
17
+ decorators: [
18
+ (Story) => (
19
+ <div style={{ width: '800px', maxWidth: '100%' }}>
20
+ <Story />
21
+ </div>
22
+ ),
23
+ ],
19
24
  };
20
25
 
21
26
  export default meta;
22
27
  type Story = StoryObj<typeof meta>;
23
28
 
24
- // More on writing stories with args: https://storybook.js.org/docs/writing-stories/args
29
+ const text = (
30
+ <p>
31
+ Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim
32
+ veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
33
+ </p>
34
+ );
35
+
25
36
  export const Default: Story = {
26
- args: {
27
- children: <>Lorem ispum</>,
28
- },
37
+ args: { size: 'full', align: 'left', children: text },
38
+ };
39
+
40
+ export const SizeLarge: Story = {
41
+ args: { size: 'lg', children: text },
42
+ };
43
+
44
+ export const SizeMedium: Story = {
45
+ args: { size: 'md', children: text },
46
+ };
47
+
48
+ export const SizeSmall: Story = {
49
+ args: { size: 'sm', children: text },
50
+ };
51
+
52
+ export const AlignCenter: Story = {
53
+ args: { align: 'center', children: text },
54
+ };
55
+
56
+ export const AlignRight: Story = {
57
+ args: { align: 'right', children: text },
58
+ };
59
+
60
+ export const SmallAlignCenter: Story = {
61
+ args: { size: 'sm', align: 'center', children: text },
29
62
  };
@@ -1,26 +1,50 @@
1
1
  import type { Meta, StoryObj } from '@storybook/react-vite';
2
+ import React from 'react';
2
3
 
3
4
  import { Spacer } 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 Spacer> = {
7
7
  title: '1. Layout/Spacer',
8
8
  component: Spacer,
9
9
  parameters: {
10
- // Optional parameter to center the component in the Canvas. More info: https://storybook.js.org/docs/configure/story-layout
11
- layout: 'centered',
10
+ layout: 'padded',
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
14
+ decorators: [
15
+ (Story) => (
16
+ <div style={{ width: '500px' }}>
17
+ <Story />
18
+ </div>
19
+ ),
20
+ ],
18
21
  };
19
22
 
20
23
  export default meta;
21
24
  type Story = StoryObj<typeof meta>;
22
25
 
23
- // More on writing stories with args: https://storybook.js.org/docs/writing-stories/args
26
+ const block = (label: string) => (
27
+ <div style={{ padding: '1rem', background: '#e5e7eb', borderRadius: '4px', textAlign: 'center' }}>{label}</div>
28
+ );
29
+
24
30
  export const Default: Story = {
25
- args: {},
31
+ render: () => (
32
+ <div>
33
+ {block('Block A')}
34
+ <Spacer />
35
+ {block('Block B')}
36
+ </div>
37
+ ),
38
+ };
39
+
40
+ export const BetweenSections: Story = {
41
+ render: () => (
42
+ <div>
43
+ {block('Section 1')}
44
+ <Spacer />
45
+ {block('Section 2')}
46
+ <Spacer />
47
+ {block('Section 3')}
48
+ </div>
49
+ ),
26
50
  };
@@ -2,27 +2,47 @@ import type { Meta, StoryObj } from '@storybook/react-vite';
2
2
 
3
3
  import { Video } 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 Video> = {
7
6
  title: '4. Media / Video',
8
7
  component: Video,
9
8
  parameters: {
10
- // Optional parameter to center the component in the Canvas. More info: https://storybook.js.org/docs/configure/story-layout
11
- layout: 'centered',
9
+ layout: 'padded',
12
10
  },
13
- // This component will have an automatically generated Autodocs entry: https://storybook.js.org/docs/writing-docs/autodocs
14
11
  tags: ['autodocs'],
15
- // More on argTypes: https://storybook.js.org/docs/api/argtypes
16
- 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
12
+ argTypes: {
13
+ size: { control: 'select', options: ['fullWidth', 'fullScreen'] },
14
+ isAutoPlay: { control: 'boolean' },
15
+ startMuted: { control: 'boolean' },
16
+ showControls: { control: 'boolean' },
17
+ hidePlayButton: { control: 'boolean' },
18
+ },
18
19
  };
19
20
 
20
21
  export default meta;
21
22
  type Story = StoryObj<typeof meta>;
22
23
 
23
- // More on writing stories with args: https://storybook.js.org/docs/writing-stories/args
24
+ const sampleVideo = 'https://www.w3schools.com/html/mov_bbb.mp4';
25
+
24
26
  export const Default: Story = {
25
- args: {
26
- children: '',
27
- },
27
+ args: { video: sampleVideo },
28
+ };
29
+
30
+ export const WithControls: Story = {
31
+ args: { video: sampleVideo, showControls: true },
32
+ };
33
+
34
+ export const Autoplay: Story = {
35
+ args: { video: sampleVideo, isAutoPlay: true, startMuted: true },
36
+ };
37
+
38
+ export const StartMuted: Story = {
39
+ args: { video: sampleVideo, startMuted: true },
40
+ };
41
+
42
+ export const HidePlayButton: Story = {
43
+ args: { video: sampleVideo, hidePlayButton: true, showControls: true },
44
+ };
45
+
46
+ export const AllControls: Story = {
47
+ args: { video: sampleVideo, showControls: true, startMuted: true },
28
48
  };