Skip to content

Commit 0f0f844

Browse files
Component button (#23)
2 parents 076955e + 07fcc4b commit 0f0f844

File tree

14 files changed

+1179
-3869
lines changed

14 files changed

+1179
-3869
lines changed

.storybook/preview-head.html

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<style>
2+
@font-face {
3+
font-family: 'roboto';
4+
src: url('/fonts/roboto-regular.woff2?#iefix') format('woff2'),
5+
url('/fonts/roboto-regular.woff') format('woff'),
6+
url('/fonts/roboto-regular.ttf') format('truetype');
7+
font-weight: normal;
8+
font-style: normal;
9+
}
10+
html body *{
11+
font-family: roboto, sans-serif;
12+
}
13+
</style>

package-lock.json

Lines changed: 804 additions & 3793 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
"dependencies": {
2727
"vite-plugin-css-injected-by-js": "^3.4.0",
2828
"@vitejs/plugin-vue": "^5.0.4",
29+
"@fortawesome/fontawesome-free": "^6.6.0",
2930
"@tsconfig/node20": "^20.1.2",
3031
"@vue/tsconfig": "^0.5.1",
3132
"vue": "^3.4.21"

public/fonts/roboto-regular.ttf

44.3 KB
Binary file not shown.

public/fonts/roboto-regular.woff

24.5 KB
Binary file not shown.

public/fonts/roboto-regular.woff2

18.6 KB
Binary file not shown.

src/assets/base.css

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,13 +67,13 @@ body {
6767
background-color 0.5s;
6868
line-height: 1.6;
6969
font-family:
70+
Roboto,
71+
Oxygen,
72+
Ubuntu,
7073
Inter,
7174
-apple-system,
7275
BlinkMacSystemFont,
7376
'Segoe UI',
74-
Roboto,
75-
Oxygen,
76-
Ubuntu,
7777
Cantarell,
7878
'Fira Sans',
7979
'Droid Sans',

src/assets/main.css

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
@import './base.css';
2+
@import '../tokens/colors.css';
23

34
#app {
45
max-width: 1280px;

src/main.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import Button from '@/stories/Button.vue'
22
import Header from '@/stories/Header.vue'
3+
import '@fortawesome/fontawesome-free/css/all.min.css'
34

45
export {Button, Header}

src/stories/Button.stories.ts

Lines changed: 27 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,18 @@ const meta = {
1010
tags: ['autodocs'],
1111
argTypes: {
1212
size: { control: 'select', options: ['small', 'medium', 'large'] },
13-
backgroundColor: { control: 'color' },
13+
variant: { options: ['contained', 'outlined', 'subtle'] },
14+
type: { options: ['primary', 'destructive'] },
15+
label: {
16+
options: ['Sans icone', 'Icone droite', 'Icone gauche'],
17+
mapping: {
18+
'Sans icone': { text: 'Button' },
19+
'Icone droite': { text: 'Button', icon: { name: 'fa fa-smile', position: 'right' } },
20+
'Icone gauche': { text: 'Button', icon: { name: 'fa fa-smile', position: 'left' } },
21+
},
22+
}
1423
},
1524
args: {
16-
primary: false,
1725
// 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
1826
onClick: fn(),
1927
},
@@ -28,28 +36,38 @@ type Story = StoryObj<typeof meta>;
2836
*/
2937
export const Primary: Story = {
3038
args: {
31-
primary: true,
32-
label: 'Button',
39+
type: 'primary',
40+
label: {
41+
text: 'Button'
42+
},
3343
},
3444
};
3545

36-
export const Secondary: Story = {
46+
export const Destructive: Story = {
3747
args: {
38-
primary: false,
39-
label: 'Button',
48+
type: 'destructive',
49+
label: {
50+
text: 'Button'
51+
},
4052
},
4153
};
4254

55+
4356
export const Large: Story = {
4457
args: {
45-
label: 'Button',
58+
label: {
59+
text: 'Button'
60+
},
4661
size: 'large',
4762
},
4863
};
4964

5065
export const Small: Story = {
5166
args: {
52-
label: 'Button',
67+
label: {
68+
text: 'Button'
69+
},
5370
size: 'small',
5471
},
5572
};
73+

0 commit comments

Comments
 (0)