w-design-system 0.0.3 → 0.0.4
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 +4 -1
- package/.storybook/main.ts +0 -19
- package/.storybook/preview.ts +0 -14
- package/public/favicon.ico +0 -0
- package/public/index.html +0 -43
- package/public/logo192.png +0 -0
- package/public/logo512.png +0 -0
- package/public/manifest.json +0 -25
- package/public/robots.txt +0 -3
- package/src/assets/icon/alert.svg +0 -3
- package/src/assets/icon/close.svg +0 -10
- package/src/assets/icon/comment.svg +0 -10
- package/src/assets/icon/doc-check.svg +0 -10
- package/src/assets/icon/image.svg +0 -3
- package/src/assets/icon/index.ts +0 -6
- package/src/assets/icon/svg.d.ts +0 -1
- package/src/components/Banner/index.tsx +0 -47
- package/src/components/Banner/stories.tsx +0 -31
- package/src/components/Banner/styles.ts +0 -58
- package/src/components/Button/index.tsx +0 -31
- package/src/components/Button/stories.tsx +0 -98
- package/src/components/Button/styles.ts +0 -198
- package/src/components/Button/test.tsx +0 -44
- package/src/components/ButtonRadiusIcon/index.tsx +0 -22
- package/src/components/ButtonRadiusIcon/stories.tsx +0 -47
- package/src/components/ButtonRadiusIcon/styles.ts +0 -139
- package/src/components/ButtonRound/index.tsx +0 -25
- package/src/components/ButtonRound/stories.tsx +0 -50
- package/src/components/ButtonRound/styles.ts +0 -136
- package/src/components/IconWrapper/index.tsx +0 -43
- package/src/components/Modal/index.tsx +0 -30
- package/src/components/Modal/stories.tsx +0 -53
- package/src/components/Modal/styles.ts +0 -51
- package/src/components/Paragraph/index.tsx +0 -42
- package/src/components/Paragraph/stories.tsx +0 -107
- package/src/components/Tabs/index.tsx +0 -24
- package/src/components/Tabs/stories.tsx +0 -74
- package/src/components/Tabs/styles.ts +0 -23
- package/src/components/Themes/index.ts +0 -99
- package/src/components/Title/index.tsx +0 -33
- package/src/components/Title/stories.tsx +0 -68
- package/src/components/Types/index.ts +0 -45
- package/src/index.ts +0 -10
- package/src/prettier.config.js +0 -11
- package/src/react-app-env.d.ts +0 -1
- package/src/reportWebVitals.ts +0 -16
- package/src/setupTests.ts +0 -5
- package/src/src/globalStyles.ts +0 -11
- package/src/stories/Button.stories.ts +0 -52
- package/src/stories/Button.tsx +0 -42
- package/src/stories/Configure.mdx +0 -364
- package/src/stories/Header.stories.ts +0 -33
- package/src/stories/Header.tsx +0 -56
- package/src/stories/Page.stories.ts +0 -32
- package/src/stories/Page.tsx +0 -73
- package/src/stories/assets/accessibility.png +0 -0
- package/src/stories/assets/accessibility.svg +0 -1
- package/src/stories/assets/addon-library.png +0 -0
- package/src/stories/assets/assets.png +0 -0
- package/src/stories/assets/avif-test-image.avif +0 -0
- package/src/stories/assets/context.png +0 -0
- package/src/stories/assets/discord.svg +0 -1
- package/src/stories/assets/docs.png +0 -0
- package/src/stories/assets/figma-plugin.png +0 -0
- package/src/stories/assets/github.svg +0 -1
- package/src/stories/assets/share.png +0 -0
- package/src/stories/assets/styling.png +0 -0
- package/src/stories/assets/testing.png +0 -0
- package/src/stories/assets/theming.png +0 -0
- package/src/stories/assets/tutorials.svg +0 -1
- package/src/stories/assets/youtube.svg +0 -1
- package/src/stories/button.css +0 -30
- package/src/stories/header.css +0 -32
- package/src/stories/page.css +0 -69
- package/src/utils/constanst.ts +0 -2
- package/tsconfig.json +0 -38
- package/webpack.config.js +0 -12
|
@@ -1,107 +0,0 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from '@storybook/react'
|
|
2
|
-
import { Paragraph } from './index'
|
|
3
|
-
|
|
4
|
-
const meta: Meta<typeof Paragraph> = {
|
|
5
|
-
title: 'Components/Paragraph',
|
|
6
|
-
component: Paragraph,
|
|
7
|
-
parameters: {
|
|
8
|
-
layout: 'centered',
|
|
9
|
-
},
|
|
10
|
-
tags: ['autodocs'],
|
|
11
|
-
argTypes: {
|
|
12
|
-
size: {
|
|
13
|
-
control: { type: 'select', options: ['x-small', 'small', 'medium', 'large'] },
|
|
14
|
-
description: 'Select the size of the paragraph',
|
|
15
|
-
},
|
|
16
|
-
weight: {
|
|
17
|
-
control: { type: 'select', options: [400, 600, 700, 800] },
|
|
18
|
-
description: 'Select the font weight of the paragraph',
|
|
19
|
-
},
|
|
20
|
-
as: {
|
|
21
|
-
control: { type: 'select', options: ['span', 'div', 'label', 'p'] },
|
|
22
|
-
description: 'Select the HTML element to render',
|
|
23
|
-
},
|
|
24
|
-
color: {
|
|
25
|
-
control: 'color', // Adicionando o controle de cor
|
|
26
|
-
description: 'Select the color of the text',
|
|
27
|
-
},
|
|
28
|
-
children: {
|
|
29
|
-
control: 'text',
|
|
30
|
-
description: 'Content of the paragraph',
|
|
31
|
-
},
|
|
32
|
-
},
|
|
33
|
-
} satisfies Meta<typeof Paragraph>
|
|
34
|
-
|
|
35
|
-
export default meta
|
|
36
|
-
type Story = StoryObj<typeof meta>
|
|
37
|
-
|
|
38
|
-
// Define different stories for the Paragraph component
|
|
39
|
-
|
|
40
|
-
export const XSmall: Story = {
|
|
41
|
-
args: {
|
|
42
|
-
size: 'x-small',
|
|
43
|
-
color: '#000000', // Definindo a cor para XSmall
|
|
44
|
-
children: 'This is an X-small paragraph.',
|
|
45
|
-
},
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
export const Small: Story = {
|
|
49
|
-
args: {
|
|
50
|
-
size: 'small',
|
|
51
|
-
weight: 600,
|
|
52
|
-
color: '#333333', // Definindo a cor para Small
|
|
53
|
-
children: 'This is a small paragraph with weight 600.',
|
|
54
|
-
},
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
export const Medium: Story = {
|
|
58
|
-
args: {
|
|
59
|
-
size: 'medium',
|
|
60
|
-
weight: 700,
|
|
61
|
-
color: '#666666', // Definindo a cor para Medium
|
|
62
|
-
children: 'This is a medium paragraph with weight 700.',
|
|
63
|
-
},
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
export const Large: Story = {
|
|
67
|
-
args: {
|
|
68
|
-
size: 'large',
|
|
69
|
-
color: '#999999', // Definindo a cor para Large
|
|
70
|
-
children: 'This is a large paragraph.',
|
|
71
|
-
},
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
export const CustomElement: Story = {
|
|
75
|
-
args: {
|
|
76
|
-
size: 'medium',
|
|
77
|
-
as: 'label',
|
|
78
|
-
color: '#CC0000', // Definindo a cor para CustomElement
|
|
79
|
-
children: 'This is a medium paragraph rendered as a label.',
|
|
80
|
-
},
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
export const AllSizes: Story = {
|
|
84
|
-
args: {
|
|
85
|
-
size: 'medium',
|
|
86
|
-
color: '#000000',
|
|
87
|
-
children: 'This paragraph can be adjusted to any size using the controls.',
|
|
88
|
-
},
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
export const AllWeights: Story = {
|
|
92
|
-
args: {
|
|
93
|
-
size: 'medium',
|
|
94
|
-
weight: 400,
|
|
95
|
-
color: '#000000',
|
|
96
|
-
children: 'This paragraph weight can be adjusted to 400, 600, 700, or 800.',
|
|
97
|
-
},
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
export const AllElements: Story = {
|
|
101
|
-
args: {
|
|
102
|
-
size: 'medium',
|
|
103
|
-
as: 'div',
|
|
104
|
-
color: '#000000',
|
|
105
|
-
children: 'This paragraph can be rendered as different HTML elements.',
|
|
106
|
-
},
|
|
107
|
-
}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import React, { useState } from 'react'
|
|
2
|
-
import { TabsTypes } from '../Types'
|
|
3
|
-
import { TabsContainerStyled, TabStyled } from './styles'
|
|
4
|
-
|
|
5
|
-
export const Tabs: React.FC<TabsTypes> = ({ tabs, defaultActiveTab, onTabChange }) => {
|
|
6
|
-
const [activeTab, setActiveTab] = useState(defaultActiveTab || tabs[0])
|
|
7
|
-
|
|
8
|
-
const handleTabClick = (tab: string) => {
|
|
9
|
-
setActiveTab(tab)
|
|
10
|
-
if (onTabChange) {
|
|
11
|
-
onTabChange(tab)
|
|
12
|
-
}
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
return (
|
|
16
|
-
<TabsContainerStyled>
|
|
17
|
-
{tabs.map(tab => (
|
|
18
|
-
<TabStyled key={tab} active={tab === activeTab} onClick={() => handleTabClick(tab)}>
|
|
19
|
-
{tab}
|
|
20
|
-
</TabStyled>
|
|
21
|
-
))}
|
|
22
|
-
</TabsContainerStyled>
|
|
23
|
-
)
|
|
24
|
-
}
|
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
import React from 'react'
|
|
2
|
-
import { Meta, StoryObj } from '@storybook/react'
|
|
3
|
-
import { Paragraph } from '../Paragraph'
|
|
4
|
-
import { Tabs } from './index'
|
|
5
|
-
import { useState } from 'react'
|
|
6
|
-
|
|
7
|
-
const meta: Meta<typeof Tabs> = {
|
|
8
|
-
title: 'Components/Tabs',
|
|
9
|
-
component: Tabs,
|
|
10
|
-
} satisfies Meta<typeof Tabs>
|
|
11
|
-
|
|
12
|
-
export default meta
|
|
13
|
-
|
|
14
|
-
type Story = StoryObj<typeof Tabs>
|
|
15
|
-
|
|
16
|
-
export const Playground: Story = {
|
|
17
|
-
render: () => {
|
|
18
|
-
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
19
|
-
const [activeTab, setActiveTab] = useState('Tab 1')
|
|
20
|
-
const handleTabChange = (activeTab: string) => {
|
|
21
|
-
setActiveTab(activeTab)
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
return (
|
|
25
|
-
<div style={{ background: '#e0dede', padding: '50px', height: '100vh' }}>
|
|
26
|
-
<Tabs tabs={['Tab 1', 'Tab 2', 'Tab 3']} defaultActiveTab="Tab 1" onTabChange={handleTabChange} />
|
|
27
|
-
<div style={{ background: 'white', padding: '50px 20px', borderRadius: '8px', marginTop: '-5px' }}>
|
|
28
|
-
{activeTab === 'Tab 1' && (
|
|
29
|
-
<>
|
|
30
|
-
<Paragraph size={'medium'} weight={800}>
|
|
31
|
-
Tab 1
|
|
32
|
-
</Paragraph>
|
|
33
|
-
<Paragraph>
|
|
34
|
-
Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the
|
|
35
|
-
industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and
|
|
36
|
-
scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap
|
|
37
|
-
into electronic
|
|
38
|
-
</Paragraph>
|
|
39
|
-
</>
|
|
40
|
-
)}
|
|
41
|
-
{activeTab === 'Tab 2' && (
|
|
42
|
-
<>
|
|
43
|
-
<Paragraph size={'medium'} weight={800}>
|
|
44
|
-
Tab 2
|
|
45
|
-
</Paragraph>
|
|
46
|
-
<Paragraph>
|
|
47
|
-
Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the
|
|
48
|
-
industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and
|
|
49
|
-
scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap
|
|
50
|
-
into electronic Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum
|
|
51
|
-
has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley
|
|
52
|
-
of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also
|
|
53
|
-
the leap into electronic
|
|
54
|
-
</Paragraph>
|
|
55
|
-
</>
|
|
56
|
-
)}
|
|
57
|
-
{activeTab === 'Tab 3' && (
|
|
58
|
-
<>
|
|
59
|
-
<Paragraph size={'medium'} weight={800}>
|
|
60
|
-
Tab 3
|
|
61
|
-
</Paragraph>
|
|
62
|
-
<Paragraph>
|
|
63
|
-
Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the
|
|
64
|
-
industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and
|
|
65
|
-
scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap
|
|
66
|
-
into electronic
|
|
67
|
-
</Paragraph>
|
|
68
|
-
</>
|
|
69
|
-
)}
|
|
70
|
-
</div>
|
|
71
|
-
</div>
|
|
72
|
-
)
|
|
73
|
-
},
|
|
74
|
-
}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import styled from 'styled-components'
|
|
2
|
-
|
|
3
|
-
export const TabsContainerStyled = styled.div`
|
|
4
|
-
display: flex;
|
|
5
|
-
align-items: flex-end;
|
|
6
|
-
`
|
|
7
|
-
|
|
8
|
-
export const TabStyled = styled.div<{ active: boolean }>`
|
|
9
|
-
padding: 8px 16px;
|
|
10
|
-
cursor: pointer;
|
|
11
|
-
border-radius: 24px 24px 0 0;
|
|
12
|
-
background: white;
|
|
13
|
-
opacity: ${props => (props.active ? 1 : 0.8)};
|
|
14
|
-
height: ${props => (props.active ? '45px' : '40px')};
|
|
15
|
-
min-width: 95px;
|
|
16
|
-
display: inline-flex;
|
|
17
|
-
justify-content: center;
|
|
18
|
-
align-items: center;
|
|
19
|
-
font-family: 'Nunito Sans', sans-serif;
|
|
20
|
-
font-weight: ${props => (props.active ? 'bold' : 'normal')};
|
|
21
|
-
color: ${props => (props.active ? 'var(--PrimaryColor, #000)' : 'var(--SecondaryColor, #666)')};
|
|
22
|
-
transition: opacity 0.3s;
|
|
23
|
-
`
|
|
@@ -1,99 +0,0 @@
|
|
|
1
|
-
const cyan = {
|
|
2
|
-
cyan50: '#001640',
|
|
3
|
-
cyan40: '#1A3D7F',
|
|
4
|
-
cyan30: '#025FDE',
|
|
5
|
-
cyan20: '#217EFD',
|
|
6
|
-
cyan10: '#EEF5FF',
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
const shades = {
|
|
10
|
-
shade50: '#333333',
|
|
11
|
-
shade40: '#666666',
|
|
12
|
-
shade30: '#999999',
|
|
13
|
-
shade20: '#EEEEEE',
|
|
14
|
-
shade10: '#EFF1F3',
|
|
15
|
-
shade05: '#FAFAFA',
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
const red = {
|
|
19
|
-
red40: '#981010',
|
|
20
|
-
red30: '#B41313',
|
|
21
|
-
red20: '#F3D9D9',
|
|
22
|
-
red10: '#F9EDED',
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
const honey = {
|
|
26
|
-
honey40: '#F77202',
|
|
27
|
-
honey30: '#F77202',
|
|
28
|
-
honey20: '#FCCEA7',
|
|
29
|
-
honey10: '#FDE3CC',
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
const yellow = {
|
|
33
|
-
yellow30: '#D08007',
|
|
34
|
-
yellow20: '#EFD3A8',
|
|
35
|
-
yellow10: '#FAF2E6',
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
const mint = {
|
|
39
|
-
mint40: '#059D2F',
|
|
40
|
-
mint30: '#06B737',
|
|
41
|
-
mint20: '#D7EFDE',
|
|
42
|
-
mint10: '#EBF8EF',
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
const white = '#FFFFFF'
|
|
46
|
-
const black = '#333333'
|
|
47
|
-
const transparent = 'transparent'
|
|
48
|
-
|
|
49
|
-
export const spacing = {
|
|
50
|
-
space1: '4px',
|
|
51
|
-
space2: '8px',
|
|
52
|
-
space3: '16px',
|
|
53
|
-
space4: '24px',
|
|
54
|
-
space5: '32px',
|
|
55
|
-
space6: '40px',
|
|
56
|
-
space7: '48px',
|
|
57
|
-
space8: '56px',
|
|
58
|
-
space9: '64px',
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
const zIndex = {
|
|
62
|
-
z1: 1,
|
|
63
|
-
z2: 2,
|
|
64
|
-
z3: 3,
|
|
65
|
-
z4: 4,
|
|
66
|
-
z5: 5,
|
|
67
|
-
z6: 6,
|
|
68
|
-
z7: 7,
|
|
69
|
-
z8: 8,
|
|
70
|
-
z9: 9,
|
|
71
|
-
full: 10000,
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
export const theme = {
|
|
75
|
-
zIndex,
|
|
76
|
-
spacing,
|
|
77
|
-
colors: {
|
|
78
|
-
...yellow,
|
|
79
|
-
...shades,
|
|
80
|
-
...red,
|
|
81
|
-
...honey,
|
|
82
|
-
...mint,
|
|
83
|
-
...cyan,
|
|
84
|
-
white,
|
|
85
|
-
black,
|
|
86
|
-
transparent,
|
|
87
|
-
},
|
|
88
|
-
fonts: ['Nunito Sans', 'Helvetica Neue', 'Helvetica', 'Arial', 'sans-serif'],
|
|
89
|
-
title: {
|
|
90
|
-
medium: '24px',
|
|
91
|
-
large: '34px',
|
|
92
|
-
},
|
|
93
|
-
paragraph: {
|
|
94
|
-
'x-small': '12px',
|
|
95
|
-
small: '14px',
|
|
96
|
-
medium: '16px',
|
|
97
|
-
large: '18px',
|
|
98
|
-
},
|
|
99
|
-
}
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import React from 'react'
|
|
2
|
-
import styled from 'styled-components'
|
|
3
|
-
import { theme } from '../Themes'
|
|
4
|
-
|
|
5
|
-
interface ParagraphProps {
|
|
6
|
-
size: 'medium' | 'large'
|
|
7
|
-
bold?: boolean
|
|
8
|
-
as?: 'h1' | 'h2' | 'h3'
|
|
9
|
-
color?: string // Adicionando a propriedade color
|
|
10
|
-
children: React.ReactNode
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
const sizes = {
|
|
14
|
-
...theme.title,
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
const TitleStyled = styled.p<ParagraphProps>`
|
|
18
|
-
margin: 0;
|
|
19
|
-
padding: 0;
|
|
20
|
-
font-size: ${props => sizes[props.size]};
|
|
21
|
-
font-weight: ${props => (props.bold ? 800 : 400)};
|
|
22
|
-
line-height: 130%;
|
|
23
|
-
font-family: 'Nunito Sans', sans-serif;
|
|
24
|
-
color: ${props => props.color || 'inherit'}; // Aplicando a cor
|
|
25
|
-
`
|
|
26
|
-
|
|
27
|
-
export const Title: React.FC<ParagraphProps> = ({ size = 'medium', bold, as = 'h2', color, children }) => {
|
|
28
|
-
return (
|
|
29
|
-
<TitleStyled as={as} size={size} bold={bold} color={color}>
|
|
30
|
-
{children}
|
|
31
|
-
</TitleStyled>
|
|
32
|
-
)
|
|
33
|
-
}
|
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from '@storybook/react'
|
|
2
|
-
import { theme } from '../Themes'
|
|
3
|
-
import { Title } from './index'
|
|
4
|
-
|
|
5
|
-
const sizes = theme.title
|
|
6
|
-
|
|
7
|
-
const meta: Meta<typeof Title> = {
|
|
8
|
-
title: 'Components/Title',
|
|
9
|
-
component: Title,
|
|
10
|
-
parameters: {
|
|
11
|
-
layout: 'centered',
|
|
12
|
-
},
|
|
13
|
-
argTypes: {
|
|
14
|
-
size: {
|
|
15
|
-
control: { type: 'select', options: ['medium', 'large'] },
|
|
16
|
-
description: 'Font size of the title',
|
|
17
|
-
},
|
|
18
|
-
bold: {
|
|
19
|
-
control: 'boolean',
|
|
20
|
-
description: 'Apply bold font weight',
|
|
21
|
-
},
|
|
22
|
-
as: {
|
|
23
|
-
control: { type: 'select', options: ['h1', 'h2', 'h3'] },
|
|
24
|
-
description: 'HTML element to render',
|
|
25
|
-
},
|
|
26
|
-
color: {
|
|
27
|
-
control: 'color',
|
|
28
|
-
description: 'Font color of the title',
|
|
29
|
-
},
|
|
30
|
-
children: {
|
|
31
|
-
control: 'text',
|
|
32
|
-
description: 'Content of the title',
|
|
33
|
-
},
|
|
34
|
-
},
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
export default meta
|
|
38
|
-
type Story = StoryObj<typeof meta>
|
|
39
|
-
|
|
40
|
-
export const LargeBoldTitle: Story = {
|
|
41
|
-
args: {
|
|
42
|
-
size: 'large',
|
|
43
|
-
bold: true,
|
|
44
|
-
as: 'h1',
|
|
45
|
-
color: '#1A3D7F', // Example color
|
|
46
|
-
children: 'Large Bold Title',
|
|
47
|
-
},
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
export const MediumTitle: Story = {
|
|
51
|
-
args: {
|
|
52
|
-
size: 'medium',
|
|
53
|
-
bold: false,
|
|
54
|
-
as: 'h2',
|
|
55
|
-
color: '#025FDE', // Example color
|
|
56
|
-
children: 'Medium Title',
|
|
57
|
-
},
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
export const CustomColorTitle: Story = {
|
|
61
|
-
args: {
|
|
62
|
-
size: 'large',
|
|
63
|
-
bold: true,
|
|
64
|
-
as: 'h3',
|
|
65
|
-
color: '#FF5733', // Custom color
|
|
66
|
-
children: 'Custom Color Title',
|
|
67
|
-
},
|
|
68
|
-
}
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import { ButtonHTMLAttributes, HTMLAttributes, ReactNode } from 'react'
|
|
2
|
-
|
|
3
|
-
type ColorsVariant = 'primary' | 'secondary' | 'success' | 'danger' | 'gray' | 'warning' | 'yellow'
|
|
4
|
-
type ColorsVariantBanner = 'notice' | 'success' | 'danger' | 'warning'
|
|
5
|
-
export interface ButtonTypes extends ButtonHTMLAttributes<HTMLButtonElement> {
|
|
6
|
-
variant?: ColorsVariant
|
|
7
|
-
icon?: string
|
|
8
|
-
radius?: boolean
|
|
9
|
-
outline?: boolean
|
|
10
|
-
halfLeft?: boolean
|
|
11
|
-
halfRight?: boolean
|
|
12
|
-
fullWidth?: boolean
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
export interface ButtonRadiusIconTypes extends ButtonHTMLAttributes<HTMLButtonElement> {
|
|
16
|
-
variant?: ColorsVariant
|
|
17
|
-
icon?: string
|
|
18
|
-
subTitle?: string
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
export interface ButtonRoundTypes extends ButtonHTMLAttributes<HTMLButtonElement> {
|
|
22
|
-
variant?: ColorsVariant
|
|
23
|
-
icon?: string
|
|
24
|
-
outline?: boolean
|
|
25
|
-
badge?: number
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
export interface BannerTypes extends HTMLAttributes<HTMLDivElement> {
|
|
29
|
-
variant?: ColorsVariantBanner
|
|
30
|
-
title?: string
|
|
31
|
-
subTitle?: string
|
|
32
|
-
onClick?: () => void
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
export interface ModalTypes extends HTMLAttributes<HTMLDivElement> {
|
|
36
|
-
children: ReactNode
|
|
37
|
-
onClose: () => void
|
|
38
|
-
footer?: ReactNode | ReactNode[]
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
export interface TabsTypes extends HTMLAttributes<HTMLDivElement> {
|
|
42
|
-
tabs: string[]
|
|
43
|
-
defaultActiveTab?: string
|
|
44
|
-
onTabChange?: (activeTab: string) => void
|
|
45
|
-
}
|
package/src/index.ts
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
export { Banner } from './components/Banner/index'
|
|
2
|
-
export { Button } from './components/Button/index'
|
|
3
|
-
export { ButtonRadiusIcon } from './components/ButtonRadiusIcon/index'
|
|
4
|
-
export { ButtonRound } from './components/ButtonRound/index'
|
|
5
|
-
export { IconWrapper } from './components/IconWrapper/index'
|
|
6
|
-
export { Modal } from './components/Modal/index'
|
|
7
|
-
export { Paragraph } from './components/Paragraph/index'
|
|
8
|
-
export { Tabs } from './components/Tabs/index'
|
|
9
|
-
export { theme } from './components/Themes/index'
|
|
10
|
-
export { Title } from './components/Title/index'
|
package/src/prettier.config.js
DELETED
package/src/react-app-env.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
/// <reference types="react-scripts" />
|
package/src/reportWebVitals.ts
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { ReportHandler } from 'web-vitals'
|
|
2
|
-
|
|
3
|
-
const reportWebVitals = (onPerfEntry?: ReportHandler) => {
|
|
4
|
-
if (onPerfEntry && onPerfEntry instanceof Function) {
|
|
5
|
-
// @ts-ignore
|
|
6
|
-
import('web-vitals').then(({ getCLS, getFID, getFCP, getLCP, getTTFB }) => {
|
|
7
|
-
getCLS(onPerfEntry)
|
|
8
|
-
getFID(onPerfEntry)
|
|
9
|
-
getFCP(onPerfEntry)
|
|
10
|
-
getLCP(onPerfEntry)
|
|
11
|
-
getTTFB(onPerfEntry)
|
|
12
|
-
})
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
export default reportWebVitals
|
package/src/setupTests.ts
DELETED
package/src/src/globalStyles.ts
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { createGlobalStyle } from 'styled-components';
|
|
2
|
-
|
|
3
|
-
const GlobalStyle = createGlobalStyle`
|
|
4
|
-
@import url('https://fonts.googleapis.com/css2?family=Nunito+Sans:wght@400;700&display=swap');
|
|
5
|
-
|
|
6
|
-
body {
|
|
7
|
-
font-family: 'Nunito Sans', sans-serif;
|
|
8
|
-
}
|
|
9
|
-
`;
|
|
10
|
-
|
|
11
|
-
export default GlobalStyle;
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
|
-
import { fn } from '@storybook/test';
|
|
3
|
-
import { Button } from './Button';
|
|
4
|
-
|
|
5
|
-
// More on how to set up stories at: https://storybook.js.org/docs/writing-stories#default-export
|
|
6
|
-
const meta = {
|
|
7
|
-
title: 'Example/Button',
|
|
8
|
-
component: Button,
|
|
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',
|
|
12
|
-
},
|
|
13
|
-
// This component will have an automatically generated Autodocs entry: https://storybook.js.org/docs/writing-docs/autodocs
|
|
14
|
-
tags: ['autodocs'],
|
|
15
|
-
// More on argTypes: https://storybook.js.org/docs/api/argtypes
|
|
16
|
-
argTypes: {
|
|
17
|
-
backgroundColor: { control: 'color' },
|
|
18
|
-
},
|
|
19
|
-
// 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
|
|
20
|
-
args: { onClick: fn() },
|
|
21
|
-
} satisfies Meta<typeof Button>;
|
|
22
|
-
|
|
23
|
-
export default meta;
|
|
24
|
-
type Story = StoryObj<typeof meta>;
|
|
25
|
-
|
|
26
|
-
// More on writing stories with args: https://storybook.js.org/docs/writing-stories/args
|
|
27
|
-
export const Primary: Story = {
|
|
28
|
-
args: {
|
|
29
|
-
primary: true,
|
|
30
|
-
label: 'Button',
|
|
31
|
-
},
|
|
32
|
-
};
|
|
33
|
-
|
|
34
|
-
export const Secondary: Story = {
|
|
35
|
-
args: {
|
|
36
|
-
label: 'Button',
|
|
37
|
-
},
|
|
38
|
-
};
|
|
39
|
-
|
|
40
|
-
export const Large: Story = {
|
|
41
|
-
args: {
|
|
42
|
-
size: 'large',
|
|
43
|
-
label: 'Button',
|
|
44
|
-
},
|
|
45
|
-
};
|
|
46
|
-
|
|
47
|
-
export const Small: Story = {
|
|
48
|
-
args: {
|
|
49
|
-
size: 'small',
|
|
50
|
-
label: 'Button',
|
|
51
|
-
},
|
|
52
|
-
};
|
package/src/stories/Button.tsx
DELETED
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import React from 'react'
|
|
2
|
-
import './button.css'
|
|
3
|
-
|
|
4
|
-
export interface ButtonTypes {
|
|
5
|
-
/**
|
|
6
|
-
* Is this the principal call to action on the page?
|
|
7
|
-
*/
|
|
8
|
-
primary?: boolean
|
|
9
|
-
/**
|
|
10
|
-
* What background color to use
|
|
11
|
-
*/
|
|
12
|
-
backgroundColor?: string
|
|
13
|
-
/**
|
|
14
|
-
* How large should the button be?
|
|
15
|
-
*/
|
|
16
|
-
size?: 'small' | 'medium' | 'large'
|
|
17
|
-
/**
|
|
18
|
-
* Button contents
|
|
19
|
-
*/
|
|
20
|
-
label: string
|
|
21
|
-
/**
|
|
22
|
-
* Optional click handler
|
|
23
|
-
*/
|
|
24
|
-
onClick?: () => void
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
/**
|
|
28
|
-
* Primary UI component for user interaction
|
|
29
|
-
*/
|
|
30
|
-
export const Button = ({ primary = false, size = 'medium', backgroundColor, label, ...props }: ButtonTypes) => {
|
|
31
|
-
const mode = primary ? 'storybook-button--primary' : 'storybook-button--secondary'
|
|
32
|
-
return (
|
|
33
|
-
<button
|
|
34
|
-
type="button"
|
|
35
|
-
className={['storybook-button', `storybook-button--${size}`, mode].join(' ')}
|
|
36
|
-
style={{ backgroundColor }}
|
|
37
|
-
{...props}
|
|
38
|
-
>
|
|
39
|
-
{label}
|
|
40
|
-
</button>
|
|
41
|
-
)
|
|
42
|
-
}
|