w-design-system 0.0.83 → 0.0.85
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/.storybook/main.ts +8 -5
- package/.storybook/preview.ts +4 -13
- package/dist/components/Banner/index.d.ts +1 -1
- package/dist/components/Banner/styles.d.ts +1 -1
- package/dist/components/Button/index.d.ts +1 -1
- package/dist/components/Button/styles.d.ts +2 -2
- package/dist/components/Button/test.d.ts +0 -1
- package/dist/components/ButtonRadiusIcon/index.d.ts +1 -1
- package/dist/components/ButtonRadiusIcon/styles.d.ts +1 -1
- package/dist/components/ButtonRound/index.d.ts +1 -1
- package/dist/components/ButtonRound/styles.d.ts +1 -1
- package/dist/components/CardStories/index.d.ts +1 -1
- package/dist/components/CardStories/index.d.ts.map +1 -1
- package/dist/components/CardStories/stories.d.ts +2 -2
- package/dist/components/CountryStateSelector/index.d.ts +1 -2
- package/dist/components/DatePicker/index.d.ts +2 -7
- package/dist/components/DatePicker/index.d.ts.map +1 -1
- package/dist/components/DateRangePicker/index.d.ts +1 -1
- package/dist/components/DateRangePicker/index.d.ts.map +1 -1
- package/dist/components/DateRangePicker/styles.d.ts +7 -7
- package/dist/components/EmptyState/index.d.ts +1 -1
- package/dist/components/EmptyState/index.d.ts.map +1 -1
- package/dist/components/EmptyState/stories.d.ts +1 -1
- package/dist/components/EmptyState/styles.d.ts +1 -1
- package/dist/components/IconWrapper/index.d.ts +1 -1
- package/dist/components/Input/index.d.ts +1 -1
- package/dist/components/Input/index.d.ts.map +1 -1
- package/dist/components/Input/styles.d.ts +6 -6
- package/dist/components/InputTag/index.d.ts +1 -1
- package/dist/components/InputTag/index.d.ts.map +1 -1
- package/dist/components/InputTag/styles.d.ts +6 -6
- package/dist/components/Loading/index.d.ts +1 -1
- package/dist/components/Loading/stories.d.ts +1 -1
- package/dist/components/Modal/index.d.ts +1 -1
- package/dist/components/Modal/styles.d.ts +2 -2
- package/dist/components/MultiSelect/index.d.ts +1 -1
- package/dist/components/MultiSelect/index.d.ts.map +1 -1
- package/dist/components/Paginate/index.d.ts +1 -1
- package/dist/components/Paginate/index.d.ts.map +1 -1
- package/dist/components/Paginate/styles.d.ts +1 -1
- package/dist/components/Paragraph/index.d.ts +1 -1
- package/dist/components/Paragraph/stories.d.ts +1 -1
- package/dist/components/PortalSelect/index.d.ts +1 -1
- package/dist/components/PortalSelect/styles.d.ts +1 -1
- package/dist/components/Select/index.d.ts +1 -1
- package/dist/components/Select/index.d.ts.map +1 -1
- package/dist/components/Select/styles.d.ts +9 -9
- package/dist/components/Sidebar/SidebarGroup/index.d.ts +1 -2
- package/dist/components/Sidebar/SidebarGroup/index.d.ts.map +1 -1
- package/dist/components/Sidebar/SidebarGroup/styles.d.ts +3 -3
- package/dist/components/Sidebar/SidebarItem/index.d.ts +1 -1
- package/dist/components/Sidebar/SidebarItem/index.d.ts.map +1 -1
- package/dist/components/Sidebar/SidebarItem/styles.d.ts +2 -2
- package/dist/components/Sidebar/SidebarLogo/index.d.ts +1 -1
- package/dist/components/Sidebar/SidebarLogo/index.d.ts.map +1 -1
- package/dist/components/Sidebar/SidebarLogo/styles.d.ts +1 -1
- package/dist/components/Sidebar/index.d.ts +1 -1
- package/dist/components/Sidebar/index.d.ts.map +1 -1
- package/dist/components/Sidebar/styles.d.ts +4 -4
- package/dist/components/Table/index.d.ts +1 -1
- package/dist/components/Table/stories.d.ts +1 -1
- package/dist/components/Tabs/index.d.ts +1 -1
- package/dist/components/Tabs/styles.d.ts +2 -2
- package/dist/components/Title/index.d.ts +1 -1
- package/dist/components/Title/stories.d.ts +1 -1
- package/dist/favicon.ico +0 -0
- package/dist/index.html +43 -0
- package/dist/logo192.png +0 -0
- package/dist/logo512.png +0 -0
- package/dist/manifest.json +25 -0
- package/dist/robots.txt +3 -0
- package/dist/setupTests.d.ts +0 -1
- package/dist/src/globalStyles.d.ts +1 -1
- package/dist/stories/Button.d.ts +1 -2
- package/dist/stories/Button.d.ts.map +1 -1
- package/dist/stories/Button.stories.d.ts +3 -3
- package/dist/stories/Header.d.ts +1 -2
- package/dist/stories/Header.d.ts.map +1 -1
- package/dist/stories/Header.stories.d.ts +5 -5
- package/dist/stories/Page.d.ts +1 -2
- package/dist/stories/Page.stories.d.ts +2 -2
- package/dist/w-design-system.es.js +4656 -0
- package/dist/w-design-system.umd.js +1412 -0
- package/eslint.config.ts +21 -0
- package/package.json +28 -45
- package/prettier.config.js +11 -0
- package/src/components/Input/index.tsx +3 -6
- package/src/components/InputTag/index.tsx +3 -5
- package/src/components/Select/styles.ts +1 -1
- package/tsconfig.json +5 -18
- package/vite.config.ts +31 -0
- package/.babelrc +0 -8
- package/dist/assets/icon/index.js +0 -41
- package/dist/assets/icon/index.js.map +0 -1
- package/dist/components/Banner/index.js +0 -44
- package/dist/components/Banner/index.js.map +0 -1
- package/dist/components/Banner/stories.js +0 -25
- package/dist/components/Banner/stories.js.map +0 -1
- package/dist/components/Banner/styles.js +0 -56
- package/dist/components/Banner/styles.js.map +0 -1
- package/dist/components/Button/index.js +0 -66
- package/dist/components/Button/index.js.map +0 -1
- package/dist/components/Button/stories.js +0 -88
- package/dist/components/Button/stories.js.map +0 -1
- package/dist/components/Button/styles.js +0 -217
- package/dist/components/Button/styles.js.map +0 -1
- package/dist/components/Button/test.js +0 -33
- package/dist/components/Button/test.js.map +0 -1
- package/dist/components/ButtonRadiusIcon/index.js +0 -25
- package/dist/components/ButtonRadiusIcon/index.js.map +0 -1
- package/dist/components/ButtonRadiusIcon/stories.js +0 -42
- package/dist/components/ButtonRadiusIcon/stories.js.map +0 -1
- package/dist/components/ButtonRadiusIcon/styles.js +0 -150
- package/dist/components/ButtonRadiusIcon/styles.js.map +0 -1
- package/dist/components/ButtonRound/index.js +0 -21
- package/dist/components/ButtonRound/index.js.map +0 -1
- package/dist/components/ButtonRound/stories.js +0 -43
- package/dist/components/ButtonRound/stories.js.map +0 -1
- package/dist/components/ButtonRound/styles.js +0 -134
- package/dist/components/ButtonRound/styles.js.map +0 -1
- package/dist/components/CardStories/index.js +0 -43
- package/dist/components/CardStories/index.js.map +0 -1
- package/dist/components/CardStories/stories.js +0 -35
- package/dist/components/CardStories/stories.js.map +0 -1
- package/dist/components/CountryStateSelector/index.js +0 -106
- package/dist/components/CountryStateSelector/index.js.map +0 -1
- package/dist/components/CountryStateSelector/stories.js +0 -46
- package/dist/components/CountryStateSelector/stories.js.map +0 -1
- package/dist/components/DatePicker/index.js +0 -22
- package/dist/components/DatePicker/index.js.map +0 -1
- package/dist/components/DatePicker/stories.js +0 -61
- package/dist/components/DatePicker/stories.js.map +0 -1
- package/dist/components/DateRangePicker/index.js +0 -187
- package/dist/components/DateRangePicker/index.js.map +0 -1
- package/dist/components/DateRangePicker/stories.js +0 -65
- package/dist/components/DateRangePicker/stories.js.map +0 -1
- package/dist/components/DateRangePicker/styles.js +0 -122
- package/dist/components/DateRangePicker/styles.js.map +0 -1
- package/dist/components/EmptyState/index.js +0 -14
- package/dist/components/EmptyState/index.js.map +0 -1
- package/dist/components/EmptyState/stories.js +0 -31
- package/dist/components/EmptyState/stories.js.map +0 -1
- package/dist/components/EmptyState/styles.js +0 -29
- package/dist/components/EmptyState/styles.js.map +0 -1
- package/dist/components/IconWrapper/index.js +0 -34
- package/dist/components/IconWrapper/index.js.map +0 -1
- package/dist/components/Input/index.js +0 -91
- package/dist/components/Input/index.js.map +0 -1
- package/dist/components/Input/stories.js +0 -55
- package/dist/components/Input/stories.js.map +0 -1
- package/dist/components/Input/styles.js +0 -86
- package/dist/components/Input/styles.js.map +0 -1
- package/dist/components/InputTag/index.js +0 -124
- package/dist/components/InputTag/index.js.map +0 -1
- package/dist/components/InputTag/stories.js +0 -25
- package/dist/components/InputTag/stories.js.map +0 -1
- package/dist/components/InputTag/styles.js +0 -146
- package/dist/components/InputTag/styles.js.map +0 -1
- package/dist/components/Loading/index.js +0 -50
- package/dist/components/Loading/index.js.map +0 -1
- package/dist/components/Loading/stories.js +0 -46
- package/dist/components/Loading/stories.js.map +0 -1
- package/dist/components/Modal/index.js +0 -31
- package/dist/components/Modal/index.js.map +0 -1
- package/dist/components/Modal/stories.js +0 -24
- package/dist/components/Modal/stories.js.map +0 -1
- package/dist/components/Modal/styles.js +0 -48
- package/dist/components/Modal/styles.js.map +0 -1
- package/dist/components/MultiSelect/index.js +0 -284
- package/dist/components/MultiSelect/index.js.map +0 -1
- package/dist/components/MultiSelect/stories.js +0 -39
- package/dist/components/MultiSelect/stories.js.map +0 -1
- package/dist/components/MultiSelect/styles.d.ts +0 -14
- package/dist/components/MultiSelect/styles.d.ts.map +0 -1
- package/dist/components/MultiSelect/styles.js +0 -66
- package/dist/components/MultiSelect/styles.js.map +0 -1
- package/dist/components/Paginate/index.js +0 -63
- package/dist/components/Paginate/index.js.map +0 -1
- package/dist/components/Paginate/stories.js +0 -44
- package/dist/components/Paginate/stories.js.map +0 -1
- package/dist/components/Paginate/styles.js +0 -64
- package/dist/components/Paginate/styles.js.map +0 -1
- package/dist/components/Paragraph/index.js +0 -51
- package/dist/components/Paragraph/index.js.map +0 -1
- package/dist/components/Paragraph/stories.js +0 -113
- package/dist/components/Paragraph/stories.js.map +0 -1
- package/dist/components/PortalSelect/index.js +0 -141
- package/dist/components/PortalSelect/index.js.map +0 -1
- package/dist/components/PortalSelect/stories.js +0 -82
- package/dist/components/PortalSelect/stories.js.map +0 -1
- package/dist/components/PortalSelect/styles.js +0 -9
- package/dist/components/PortalSelect/styles.js.map +0 -1
- package/dist/components/Select/index.js +0 -260
- package/dist/components/Select/index.js.map +0 -1
- package/dist/components/Select/stories.js +0 -40
- package/dist/components/Select/stories.js.map +0 -1
- package/dist/components/Select/styles.js +0 -90
- package/dist/components/Select/styles.js.map +0 -1
- package/dist/components/Sidebar/SidebarGroup/index.js +0 -42
- package/dist/components/Sidebar/SidebarGroup/index.js.map +0 -1
- package/dist/components/Sidebar/SidebarGroup/styles.js +0 -68
- package/dist/components/Sidebar/SidebarGroup/styles.js.map +0 -1
- package/dist/components/Sidebar/SidebarItem/index.js +0 -26
- package/dist/components/Sidebar/SidebarItem/index.js.map +0 -1
- package/dist/components/Sidebar/SidebarItem/styles.js +0 -64
- package/dist/components/Sidebar/SidebarItem/styles.js.map +0 -1
- package/dist/components/Sidebar/SidebarLogo/index.js +0 -12
- package/dist/components/Sidebar/SidebarLogo/index.js.map +0 -1
- package/dist/components/Sidebar/SidebarLogo/styles.js +0 -48
- package/dist/components/Sidebar/SidebarLogo/styles.js.map +0 -1
- package/dist/components/Sidebar/index.js +0 -45
- package/dist/components/Sidebar/index.js.map +0 -1
- package/dist/components/Sidebar/stories.js +0 -94
- package/dist/components/Sidebar/stories.js.map +0 -1
- package/dist/components/Sidebar/styles.js +0 -73
- package/dist/components/Sidebar/styles.js.map +0 -1
- package/dist/components/Table/index.js +0 -95
- package/dist/components/Table/index.js.map +0 -1
- package/dist/components/Table/stories.js +0 -163
- package/dist/components/Table/stories.js.map +0 -1
- package/dist/components/Table/styles.js +0 -2
- package/dist/components/Table/styles.js.map +0 -1
- package/dist/components/Tabs/index.js +0 -13
- package/dist/components/Tabs/index.js.map +0 -1
- package/dist/components/Tabs/stories.js +0 -31
- package/dist/components/Tabs/stories.js.map +0 -1
- package/dist/components/Tabs/styles.js +0 -22
- package/dist/components/Tabs/styles.js.map +0 -1
- package/dist/components/Themes/index.js +0 -88
- package/dist/components/Themes/index.js.map +0 -1
- package/dist/components/Title/index.js +0 -17
- package/dist/components/Title/index.js.map +0 -1
- package/dist/components/Title/stories.js +0 -61
- package/dist/components/Title/stories.js.map +0 -1
- package/dist/components/Types/index.js +0 -2
- package/dist/components/Types/index.js.map +0 -1
- package/dist/components/index.js +0 -16
- package/dist/components/index.js.map +0 -1
- package/dist/index.js +0 -25
- package/dist/index.js.map +0 -1
- package/dist/prettier.config.js +0 -13
- package/dist/prettier.config.js.map +0 -1
- package/dist/reportWebVitals.d.ts +0 -4
- package/dist/reportWebVitals.d.ts.map +0 -1
- package/dist/reportWebVitals.js +0 -14
- package/dist/reportWebVitals.js.map +0 -1
- package/dist/setupTests.js +0 -6
- package/dist/setupTests.js.map +0 -1
- package/dist/src/globalStyles.js +0 -15
- package/dist/src/globalStyles.js.map +0 -1
- package/dist/stories/Button.js +0 -22
- package/dist/stories/Button.js.map +0 -1
- package/dist/stories/Button.stories.js +0 -45
- package/dist/stories/Button.stories.js.map +0 -1
- package/dist/stories/Header.js +0 -21
- package/dist/stories/Header.js.map +0 -1
- package/dist/stories/Header.stories.js +0 -27
- package/dist/stories/Header.stories.js.map +0 -1
- package/dist/stories/Page.js +0 -38
- package/dist/stories/Page.js.map +0 -1
- package/dist/stories/Page.stories.js +0 -34
- package/dist/stories/Page.stories.js.map +0 -1
- package/dist/utils/constanst.js +0 -3
- package/dist/utils/constanst.js.map +0 -1
- package/src/reportWebVitals.ts +0 -16
|
@@ -1,217 +0,0 @@
|
|
|
1
|
-
import styled, { css, keyframes } from 'styled-components';
|
|
2
|
-
import { theme } from '../Themes';
|
|
3
|
-
const { colors } = theme;
|
|
4
|
-
// Animação de rotação
|
|
5
|
-
const spinAnimation = keyframes `
|
|
6
|
-
0% { transform: rotate(0deg); }
|
|
7
|
-
100% { transform: rotate(360deg); }
|
|
8
|
-
`;
|
|
9
|
-
const buttonRadiusWrapperIconStyles = (color) => css `
|
|
10
|
-
.buttonRadiusWrapperIcon {
|
|
11
|
-
margin-top: 4px;
|
|
12
|
-
svg {
|
|
13
|
-
fill: ${color};
|
|
14
|
-
path {
|
|
15
|
-
fill: ${color};
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
`;
|
|
20
|
-
const colorScheme = {
|
|
21
|
-
primary: css `
|
|
22
|
-
background: ${colors.cyan50};
|
|
23
|
-
&:hover {
|
|
24
|
-
background-color: ${colors.cyan40};
|
|
25
|
-
}
|
|
26
|
-
&:active {
|
|
27
|
-
background-color: ${colors.cyan50};
|
|
28
|
-
}
|
|
29
|
-
`,
|
|
30
|
-
secondary: css `
|
|
31
|
-
background: ${colors.cyan30};
|
|
32
|
-
&:hover {
|
|
33
|
-
background-color: ${colors.cyan40};
|
|
34
|
-
}
|
|
35
|
-
&:active {
|
|
36
|
-
background-color: ${colors.cyan30};
|
|
37
|
-
}
|
|
38
|
-
`,
|
|
39
|
-
danger: css `
|
|
40
|
-
background: ${colors.red40};
|
|
41
|
-
&:hover {
|
|
42
|
-
background-color: ${colors.red30};
|
|
43
|
-
}
|
|
44
|
-
&:active {
|
|
45
|
-
background-color: ${colors.red40};
|
|
46
|
-
}
|
|
47
|
-
`,
|
|
48
|
-
warning: css `
|
|
49
|
-
background: ${colors.honey10};
|
|
50
|
-
color: ${colors.honey30};
|
|
51
|
-
&:hover {
|
|
52
|
-
background-color: ${colors.honey20};
|
|
53
|
-
}
|
|
54
|
-
&:active {
|
|
55
|
-
background-color: ${colors.honey10};
|
|
56
|
-
}
|
|
57
|
-
${buttonRadiusWrapperIconStyles(colors.honey30)};
|
|
58
|
-
`,
|
|
59
|
-
success: css `
|
|
60
|
-
background: ${colors.mint40};
|
|
61
|
-
&:hover {
|
|
62
|
-
background-color: ${colors.mint30};
|
|
63
|
-
}
|
|
64
|
-
&:active {
|
|
65
|
-
background-color: ${colors.mint40};
|
|
66
|
-
}
|
|
67
|
-
`,
|
|
68
|
-
gray: css `
|
|
69
|
-
background: ${colors.shade10};
|
|
70
|
-
color: ${colors.shade40};
|
|
71
|
-
&:hover {
|
|
72
|
-
background-color: ${colors.shade20};
|
|
73
|
-
}
|
|
74
|
-
&:active {
|
|
75
|
-
background-color: ${colors.shade10};
|
|
76
|
-
}
|
|
77
|
-
${buttonRadiusWrapperIconStyles(colors.shade40)};
|
|
78
|
-
`,
|
|
79
|
-
yellow: css `
|
|
80
|
-
background: ${colors.yellow10};
|
|
81
|
-
color: ${colors.yellow30};
|
|
82
|
-
&:hover {
|
|
83
|
-
background-color: ${colors.yellow20};
|
|
84
|
-
}
|
|
85
|
-
&:active {
|
|
86
|
-
background-color: ${colors.yellow10};
|
|
87
|
-
}
|
|
88
|
-
${buttonRadiusWrapperIconStyles(colors.yellow30)};
|
|
89
|
-
`,
|
|
90
|
-
};
|
|
91
|
-
const colorSchemeOutilne = {
|
|
92
|
-
primary: css `
|
|
93
|
-
color: ${colors.cyan50};
|
|
94
|
-
border: 2px solid ${colors.cyan50};
|
|
95
|
-
&:hover {
|
|
96
|
-
background-color: ${colors.cyan10};
|
|
97
|
-
}
|
|
98
|
-
&:active {
|
|
99
|
-
background-color: ${colors.cyan10};
|
|
100
|
-
}
|
|
101
|
-
${buttonRadiusWrapperIconStyles(colors.cyan50)};
|
|
102
|
-
`,
|
|
103
|
-
secondary: css `
|
|
104
|
-
color: ${colors.cyan40};
|
|
105
|
-
border: 2px solid ${colors.cyan40};
|
|
106
|
-
&:hover {
|
|
107
|
-
background-color: ${colors.cyan10};
|
|
108
|
-
}
|
|
109
|
-
&:active {
|
|
110
|
-
background-color: ${colors.cyan10};
|
|
111
|
-
}
|
|
112
|
-
${buttonRadiusWrapperIconStyles(colors.cyan40)};
|
|
113
|
-
`,
|
|
114
|
-
danger: css `
|
|
115
|
-
color: ${colors.red40};
|
|
116
|
-
border: 2px solid ${colors.red40};
|
|
117
|
-
&:hover {
|
|
118
|
-
background-color: ${colors.red10};
|
|
119
|
-
}
|
|
120
|
-
&:active {
|
|
121
|
-
background-color: ${colors.red10};
|
|
122
|
-
}
|
|
123
|
-
${buttonRadiusWrapperIconStyles(colors.red40)};
|
|
124
|
-
`,
|
|
125
|
-
warning: css `
|
|
126
|
-
color: ${colors.honey40};
|
|
127
|
-
border: 2px solid ${colors.honey40};
|
|
128
|
-
&:hover {
|
|
129
|
-
background-color: ${colors.honey10};
|
|
130
|
-
}
|
|
131
|
-
&:active {
|
|
132
|
-
background-color: ${colors.honey10};
|
|
133
|
-
}
|
|
134
|
-
${buttonRadiusWrapperIconStyles(colors.honey40)};
|
|
135
|
-
`,
|
|
136
|
-
success: css `
|
|
137
|
-
color: ${colors.mint40};
|
|
138
|
-
border: 2px solid ${colors.mint40};
|
|
139
|
-
&:hover {
|
|
140
|
-
background-color: ${colors.mint10};
|
|
141
|
-
}
|
|
142
|
-
&:active {
|
|
143
|
-
background-color: ${colors.mint10};
|
|
144
|
-
}
|
|
145
|
-
${buttonRadiusWrapperIconStyles(colors.mint40)};
|
|
146
|
-
`,
|
|
147
|
-
gray: css `
|
|
148
|
-
color: ${colors.shade40};
|
|
149
|
-
border: 2px solid ${colors.shade40};
|
|
150
|
-
&:hover {
|
|
151
|
-
background-color: ${colors.shade20};
|
|
152
|
-
}
|
|
153
|
-
&:active {
|
|
154
|
-
background-color: ${colors.shade10};
|
|
155
|
-
}
|
|
156
|
-
${buttonRadiusWrapperIconStyles(colors.shade40)};
|
|
157
|
-
`,
|
|
158
|
-
yellow: css `
|
|
159
|
-
color: ${colors.yellow30};
|
|
160
|
-
border: 2px solid ${colors.yellow30};
|
|
161
|
-
&:hover {
|
|
162
|
-
background-color: ${colors.yellow10};
|
|
163
|
-
}
|
|
164
|
-
&:active {
|
|
165
|
-
background-color: ${colors.yellow10};
|
|
166
|
-
}
|
|
167
|
-
${buttonRadiusWrapperIconStyles(colors.yellow30)};
|
|
168
|
-
`,
|
|
169
|
-
};
|
|
170
|
-
const sizeScheme = {
|
|
171
|
-
small: css `
|
|
172
|
-
padding: 6px 12px;
|
|
173
|
-
font-size: 12px;
|
|
174
|
-
`,
|
|
175
|
-
medium: css `
|
|
176
|
-
padding: 8px 16px;
|
|
177
|
-
font-size: 14px;
|
|
178
|
-
`,
|
|
179
|
-
large: css `
|
|
180
|
-
padding: 12px 24px;
|
|
181
|
-
font-size: 16px;
|
|
182
|
-
`,
|
|
183
|
-
};
|
|
184
|
-
export const LoadingImage = styled.img `
|
|
185
|
-
width: ${({ size }) => (size === 'small' ? '20px' : size === 'medium' ? '24px' : '24px')};
|
|
186
|
-
height: ${({ size }) => (size === 'small' ? '20px' : size === 'medium' ? '24px' : '24px')};
|
|
187
|
-
animation: ${spinAnimation} 2s linear infinite;
|
|
188
|
-
`;
|
|
189
|
-
export const ButtonStyled = styled.button `
|
|
190
|
-
display: inline-flex;
|
|
191
|
-
align-items: center;
|
|
192
|
-
justify-content: center;
|
|
193
|
-
box-sizing: border-box;
|
|
194
|
-
height: 48px;
|
|
195
|
-
width: ${({ fullWidth }) => (fullWidth ? '100%' : 'auto')};
|
|
196
|
-
font-weight: 600;
|
|
197
|
-
line-height: 140%;
|
|
198
|
-
border: none;
|
|
199
|
-
border-radius: ${({ radius }) => (radius ? '24px' : '5px')};
|
|
200
|
-
font-family: 'Nunito Sans', sans-serif;
|
|
201
|
-
transition:
|
|
202
|
-
background-color 0.3s,
|
|
203
|
-
opacity 0.3s;
|
|
204
|
-
color: white;
|
|
205
|
-
gap: 12px;
|
|
206
|
-
cursor: ${({ disabled }) => (disabled ? 'not-allowed' : 'pointer')};
|
|
207
|
-
opacity: ${({ disabled }) => (disabled ? 0.5 : 1)};
|
|
208
|
-
${({ variant = 'primary', outline }) => (!outline ? colorScheme[variant] : colorSchemeOutilne[variant])};
|
|
209
|
-
${({ size = 'medium' }) => sizeScheme[size]};
|
|
210
|
-
background: ${({ outline }) => outline && 'white'};
|
|
211
|
-
border-radius: ${({ halfLeft, halfRight, radius }) => !halfLeft && !halfRight ? (radius ? '24px' : '5px') : halfLeft ? '24px 0 0 24px' : '0 24px 24px 0'};
|
|
212
|
-
|
|
213
|
-
.buttonRadiusWrapperIcon {
|
|
214
|
-
margin-top: 4px;
|
|
215
|
-
}
|
|
216
|
-
`;
|
|
217
|
-
//# sourceMappingURL=styles.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"styles.js","sourceRoot":"","sources":["../../../src/components/Button/styles.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAA;AAC1D,OAAO,EAAE,KAAK,EAAE,MAAM,WAAW,CAAA;AAGjC,MAAM,EAAE,MAAM,EAAE,GAAG,KAAK,CAAA;AAExB,sBAAsB;AACt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CAAC;IAC/C,CAAC,EAAE,OAAO,GAAG,SAAS,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,kBAAkB,CAAC,OAAO,CAAC,CAAC;IACrG,CAAC,EAAE,IAAI,GAAG,QAAQ,EAAE,EAAE,EAAE,CAAC,UAAU,CAAC,IAAI,CAAC;gBAC7B,CAAC,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC,OAAO,IAAI,OAAO;mBAChC,CAAC,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,EAAE,EAAE,EAAE,CACnD,CAAC,QAAQ,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,eAAe;;;;;CAKrG,CAAA"}
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { render, screen, fireEvent } from '@testing-library/react';
|
|
3
|
-
import '@testing-library/jest-dom';
|
|
4
|
-
import { Button } from './index';
|
|
5
|
-
describe('Button Component', () => {
|
|
6
|
-
test('renders button with primary variant', () => {
|
|
7
|
-
render(React.createElement(Button, { variant: "primary" }, "Primary Button"));
|
|
8
|
-
const button = screen.getByText('Primary Button');
|
|
9
|
-
expect(button).toBeInTheDocument();
|
|
10
|
-
expect(button).toHaveStyle(`background-color: #1A3D7F`);
|
|
11
|
-
});
|
|
12
|
-
test('renders button with secondary variant', () => {
|
|
13
|
-
render(React.createElement(Button, { variant: "secondary" }, "Secondary Button"));
|
|
14
|
-
const button = screen.getByText('Secondary Button');
|
|
15
|
-
expect(button).toBeInTheDocument();
|
|
16
|
-
expect(button).toHaveStyle(`background-color: #217EFD`);
|
|
17
|
-
});
|
|
18
|
-
test('button responds to click event', () => {
|
|
19
|
-
const handleClick = jest.fn();
|
|
20
|
-
render(React.createElement(Button, { variant: "primary", onClick: handleClick }, "Clickable Button"));
|
|
21
|
-
const button = screen.getByText('Clickable Button');
|
|
22
|
-
fireEvent.click(button);
|
|
23
|
-
expect(handleClick).toHaveBeenCalledTimes(1);
|
|
24
|
-
});
|
|
25
|
-
test('button is disabled when the disabled prop is true', () => {
|
|
26
|
-
render(React.createElement(Button, { variant: "primary", disabled: true }, "Disabled Button"));
|
|
27
|
-
const button = screen.getByText('Disabled Button');
|
|
28
|
-
expect(button).toBeInTheDocument();
|
|
29
|
-
expect(button).toHaveStyle(`opacity: 0.5`);
|
|
30
|
-
expect(button).toHaveStyle(`cursor: not-allowed`);
|
|
31
|
-
});
|
|
32
|
-
});
|
|
33
|
-
//# sourceMappingURL=test.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"test.js","sourceRoot":"","sources":["../../../src/components/Button/test.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAA;AAClE,OAAO,2BAA2B,CAAA;AAClC,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAA;AAEhC,QAAQ,CAAC,kBAAkB,EAAE,GAAG,EAAE;IAChC,IAAI,CAAC,qCAAqC,EAAE,GAAG,EAAE;QAC/C,MAAM,CAAC,oBAAC,MAAM,IAAC,OAAO,EAAC,SAAS,qBAAwB,CAAC,CAAA;QACzD,MAAM,MAAM,GAAG,MAAM,CAAC,SAAS,CAAC,gBAAgB,CAAC,CAAA;QACjD,MAAM,CAAC,MAAM,CAAC,CAAC,iBAAiB,EAAE,CAAA;QAClC,MAAM,CAAC,MAAM,CAAC,CAAC,WAAW,CAAC,2BAA2B,CAAC,CAAA;IACzD,CAAC,CAAC,CAAA;IAEF,IAAI,CAAC,uCAAuC,EAAE,GAAG,EAAE;QACjD,M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|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4
|
-
t[p] = s[p];
|
|
5
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
6
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
8
|
-
t[p[i]] = s[p[i]];
|
|
9
|
-
}
|
|
10
|
-
return t;
|
|
11
|
-
};
|
|
12
|
-
import React from 'react';
|
|
13
|
-
import { IconWrapper } from '../IconWrapper';
|
|
14
|
-
import { ButtonStyled } from './styles';
|
|
15
|
-
export const ButtonRadiusIcon = (_a) => {
|
|
16
|
-
var { variant = 'primary', children, disabled = false, icon, subTitle, size } = _a, props = __rest(_a, ["variant", "children", "disabled", "icon", "subTitle", "size"]);
|
|
17
|
-
return (React.createElement(ButtonStyled, Object.assign({ variant: variant, disabled: disabled, subTitle: subTitle }, props, { size: size }),
|
|
18
|
-
React.createElement("span", { className: 'buttonRadiusIconContainer' },
|
|
19
|
-
children,
|
|
20
|
-
" ",
|
|
21
|
-
subTitle && React.createElement("p", { className: 'buttonRadiusIconTitle' }, subTitle)),
|
|
22
|
-
React.createElement("span", { className: 'buttonRadiusIconWrapperIcon' },
|
|
23
|
-
React.createElement(IconWrapper, { src: icon || '', color: 'white', className: 'buttonRadiusWrapperIcon', width: size !== 'large' ? '20px' : '24px', height: size !== 'large' ? '20px' : '24px' }))));
|
|
24
|
-
};
|
|
25
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/ButtonRadiusIcon/index.tsx"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAA;AAC5C,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAA;AAGvC,MAAM,CAAC,MAAM,gBAAgB,GAAoC,CAAC,EAQjE,EAAE,EAAE;QAR6D,EAChE,OAAO,GAAG,SAAS,EACnB,QAAQ,EACR,QAAQ,GAAG,KAAK,EAChB,IAAI,EACJ,QAAQ,EACR,IAAI,OAEL,EADI,KAAK,cAPwD,+DAQjE,CADS;IACJ,OAAA,CACJ,oBAAC,YAAY,kBAAC,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE,QAAQ,IAAM,KAAK,IAAE,IAAI,EAAE,IAAI;QAC3F,8BAAM,SAAS,EAAE,2BAA2B;YACzC,QAAQ;;YAAG,QAAQ,IAAI,2BAAG,SAAS,EAAE,uBAAuB,IAAG,QAAQ,CAAK,CACxE;QACP,8BAAM,SAAS,EAAE,6BAA6B;YAC5C,oBAAC,WAAW,IACV,GAAG,EAAE,IAAI,IAAI,EAAE,EACf,KAAK,EAAE,OAAO,EACd,SAAS,EAAE,yBAAyB,EACpC,KAAK,EAAE,IAAI,KAAK,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,EACzC,MAAM,EAAE,IAAI,KAAK,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,GAC1C,CACG,CACM,CAChB,CAAA;CAAA,CAAA"}
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import exampleIcon from '../../assets/icon/image.svg';
|
|
2
|
-
import { ButtonRadiusIcon } from './index';
|
|
3
|
-
import { VARIANTS_TYPES } from '../../utils/constanst'; // Update this path to your actual icon
|
|
4
|
-
const meta = {
|
|
5
|
-
title: 'Components/ButtonRadiusIcon',
|
|
6
|
-
component: ButtonRadiusIcon,
|
|
7
|
-
tags: ['autodocs'],
|
|
8
|
-
argTypes: {
|
|
9
|
-
variant: {
|
|
10
|
-
control: {
|
|
11
|
-
type: 'select',
|
|
12
|
-
options: VARIANTS_TYPES,
|
|
13
|
-
},
|
|
14
|
-
},
|
|
15
|
-
disabled: {
|
|
16
|
-
control: 'boolean',
|
|
17
|
-
},
|
|
18
|
-
icon: {
|
|
19
|
-
control: 'text',
|
|
20
|
-
},
|
|
21
|
-
onClick: { action: 'clicked' },
|
|
22
|
-
},
|
|
23
|
-
};
|
|
24
|
-
export default meta;
|
|
25
|
-
export const Playground = {
|
|
26
|
-
args: {
|
|
27
|
-
variant: 'primary',
|
|
28
|
-
children: 'Primary Button',
|
|
29
|
-
disabled: false,
|
|
30
|
-
icon: exampleIcon,
|
|
31
|
-
},
|
|
32
|
-
};
|
|
33
|
-
export const PlaygroundTitlePrimary = {
|
|
34
|
-
args: {
|
|
35
|
-
variant: 'secondary',
|
|
36
|
-
children: 'Button:',
|
|
37
|
-
disabled: false,
|
|
38
|
-
icon: exampleIcon,
|
|
39
|
-
subTitle: 'subTitle',
|
|
40
|
-
},
|
|
41
|
-
};
|
|
42
|
-
//# sourceMappingURL=stories.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"stories.js","sourceRoot":"","sources":["../../../src/components/ButtonRadiusIcon/stories.tsx"],"names":[],"mappings":"AACA,OAAO,WAAW,MAAM,6BAA6B,CAAA;AACrD,OAAO,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAA;AAC1C,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAA,CAAC,uCAAuC;AAE9F,MAAM,IAAI,GAAkC;IAC1C,KAAK,EAAE,6BAA6B;IACpC,SAAS,EAAE,gBAAgB;IAC3B,IAAI,EAAE,CAAC,UAAU,CAAC;IAClB,QAAQ,EAAE;QACR,OAAO,EAAE;YACP,OAAO,EAAE;gBACP,IAAI,EAAE,QAAQ;gBACd,OAAO,EAAE,cAAc;aACxB;SACF;QACD,QAAQ,EAAE;YACR,OAAO,EAAE,SAAS;SACnB;QACD,IAAI,EAAE;YACJ,OAAO,EAAE,MAAM;SAChB;QACD,OAAO,EAAE,EAAE,MAAM,EAAE,SAAS,EAAE;KAC/B;CACF,CAAA;AAED,eAAe,IAAI,CAAA;AAGnB,MAAM,CAAC,MAAM,UAAU,GAAU;IAC/B,IAAI,EAAE;QACJ,OAAO,EAAE,SAAS;QAClB,QAAQ,EAAE,gBAAgB;QAC1B,QAAQ,EAAE,KAAK;QACf,IAAI,EAAE,WAAW;KAClB;CACF,CAAA;AAED,MAAM,CAAC,MAAM,sBAAsB,GAAU;IAC3C,IAAI,EAAE;QACJ,OAAO,EAAE,WAAW;QACpB,QAAQ,EAAE,SAAS;QACnB,QAAQ,EAAE,KAAK;QACf,IAAI,EAAE,WAAW;QACjB,QAAQ,EAAE,UAAU;KACrB;CACF,CAAA"}
|
|
@@ -1,150 +0,0 @@
|
|
|
1
|
-
import styled, { css } from 'styled-components';
|
|
2
|
-
import { theme } from '../Themes';
|
|
3
|
-
const { colors } = theme;
|
|
4
|
-
const buttonRadiusWrapperIconStyles = (color) => css `
|
|
5
|
-
.buttonRadiusIconWrapperIcon {
|
|
6
|
-
background: ${color};
|
|
7
|
-
width: 56px;
|
|
8
|
-
height: 100%;
|
|
9
|
-
overflow: hidden;
|
|
10
|
-
}
|
|
11
|
-
`;
|
|
12
|
-
const colorScheme = {
|
|
13
|
-
primary: css `
|
|
14
|
-
background: ${colors.cyan10};
|
|
15
|
-
color: ${colors.cyan50};
|
|
16
|
-
&:hover {
|
|
17
|
-
background-color: ${colors.cyan10};
|
|
18
|
-
}
|
|
19
|
-
&:active {
|
|
20
|
-
background-color: ${colors.cyan10};
|
|
21
|
-
}
|
|
22
|
-
${buttonRadiusWrapperIconStyles(colors.cyan50)};
|
|
23
|
-
`,
|
|
24
|
-
secondary: css `
|
|
25
|
-
background: ${colors.cyan10};
|
|
26
|
-
color: ${colors.cyan30};
|
|
27
|
-
&:hover {
|
|
28
|
-
background-color: ${colors.cyan10};
|
|
29
|
-
opacity: 0.9;
|
|
30
|
-
}
|
|
31
|
-
&:active {
|
|
32
|
-
background-color: ${colors.cyan10};
|
|
33
|
-
opacity: 1;
|
|
34
|
-
}
|
|
35
|
-
${buttonRadiusWrapperIconStyles(colors.cyan30)};
|
|
36
|
-
`,
|
|
37
|
-
danger: css `
|
|
38
|
-
background: ${colors.red10};
|
|
39
|
-
color: ${colors.red40};
|
|
40
|
-
&:hover {
|
|
41
|
-
background-color: ${colors.red20};
|
|
42
|
-
}
|
|
43
|
-
&:active {
|
|
44
|
-
background-color: ${colors.red10};
|
|
45
|
-
}
|
|
46
|
-
${buttonRadiusWrapperIconStyles(colors.red40)};
|
|
47
|
-
`,
|
|
48
|
-
warning: css `
|
|
49
|
-
background: ${colors.honey10};
|
|
50
|
-
color: ${colors.honey30};
|
|
51
|
-
&:hover {
|
|
52
|
-
background-color: ${colors.honey20};
|
|
53
|
-
}
|
|
54
|
-
&:active {
|
|
55
|
-
background-color: ${colors.honey10};
|
|
56
|
-
}
|
|
57
|
-
${buttonRadiusWrapperIconStyles(colors.honey30)};
|
|
58
|
-
`,
|
|
59
|
-
success: css `
|
|
60
|
-
background: ${colors.mint10};
|
|
61
|
-
color: ${colors.mint40};
|
|
62
|
-
&:hover {
|
|
63
|
-
background-color: ${colors.mint20};
|
|
64
|
-
}
|
|
65
|
-
&:active {
|
|
66
|
-
background-color: ${colors.mint10};
|
|
67
|
-
}
|
|
68
|
-
${buttonRadiusWrapperIconStyles(colors.mint40)};
|
|
69
|
-
`,
|
|
70
|
-
gray: css `
|
|
71
|
-
background: ${colors.shade10};
|
|
72
|
-
color: ${colors.shade40};
|
|
73
|
-
&:hover {
|
|
74
|
-
background-color: ${colors.shade20};
|
|
75
|
-
}
|
|
76
|
-
&:active {
|
|
77
|
-
background-color: ${colors.shade10};
|
|
78
|
-
}
|
|
79
|
-
${buttonRadiusWrapperIconStyles(colors.shade40)};
|
|
80
|
-
`,
|
|
81
|
-
yellow: css `
|
|
82
|
-
background: ${colors.yellow10};
|
|
83
|
-
color: ${colors.yellow30};
|
|
84
|
-
&:hover {
|
|
85
|
-
background-color: ${colors.yellow20};
|
|
86
|
-
opacity: 0.9;
|
|
87
|
-
}
|
|
88
|
-
&:active {
|
|
89
|
-
background-color: ${colors.yellow10};
|
|
90
|
-
opacity: 1;
|
|
91
|
-
}
|
|
92
|
-
${buttonRadiusWrapperIconStyles(colors.yellow30)};
|
|
93
|
-
`,
|
|
94
|
-
};
|
|
95
|
-
const sizeScheme = {
|
|
96
|
-
small: css `
|
|
97
|
-
font-size: 12px;
|
|
98
|
-
height: 40px;
|
|
99
|
-
`,
|
|
100
|
-
medium: css `
|
|
101
|
-
font-size: 14px;
|
|
102
|
-
height: 48px;
|
|
103
|
-
`,
|
|
104
|
-
large: css `
|
|
105
|
-
font-size: 16px;
|
|
106
|
-
height: 48px;
|
|
107
|
-
`,
|
|
108
|
-
};
|
|
109
|
-
export const ButtonStyled = styled.button `
|
|
110
|
-
display: inline-flex;
|
|
111
|
-
box-sizing: border-box;
|
|
112
|
-
|
|
113
|
-
padding: 0;
|
|
114
|
-
margin: 0;
|
|
115
|
-
justify-content: space-between;
|
|
116
|
-
font-style: normal;
|
|
117
|
-
font-weight: 600;
|
|
118
|
-
line-height: 140%;
|
|
119
|
-
border: none;
|
|
120
|
-
border-radius: 24px;
|
|
121
|
-
overflow: hidden;
|
|
122
|
-
font-family: 'Nunito Sans', sans-serif;
|
|
123
|
-
transition:
|
|
124
|
-
background-color 0.3s,
|
|
125
|
-
opacity 0.3s;
|
|
126
|
-
color: white;
|
|
127
|
-
|
|
128
|
-
cursor: ${({ disabled }) => (disabled ? 'not-allowed' : 'pointer')};
|
|
129
|
-
opacity: ${({ disabled }) => (disabled ? 0.5 : 1)};
|
|
130
|
-
${({ variant = 'primary' }) => colorScheme[variant]};
|
|
131
|
-
${({ size = 'medium' }) => sizeScheme[size]};
|
|
132
|
-
|
|
133
|
-
.buttonRadiusIconContainer {
|
|
134
|
-
display: flex;
|
|
135
|
-
justify-content: center;
|
|
136
|
-
align-items: center;
|
|
137
|
-
padding: 0 24px;
|
|
138
|
-
gap: 6px;
|
|
139
|
-
height: 100%;
|
|
140
|
-
}
|
|
141
|
-
.buttonRadiusIconTitle {
|
|
142
|
-
color: ${colors.shade40};
|
|
143
|
-
font-weight: 400;
|
|
144
|
-
}
|
|
145
|
-
|
|
146
|
-
.buttonRadiusWrapperIcon {
|
|
147
|
-
margin-top: 2px;
|
|
148
|
-
}
|
|
149
|
-
`;
|
|
150
|
-
//# sourceMappingURL=styles.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"styles.js","sourceRoot":"","sources":["../../../src/components/ButtonRadiusIcon/styles.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAA;AAC/C,OAAO,EAAE,KAAK,EAAE,MAAM,WAAW,CAAA;AAGjC,MAAM,EAAE,MAAM,EAAE,GAAG,KAAK,CAAA;AACxB,MAAM,6BAA6B,GAAG,CAAC,KAAa,EAAE,EAAE,CAAC,GAAG,CAAA;;kBAE1C,KAAK;;;;;CAKtB,CAAA;AACD,MAAM,WAAW,GAAG;IAClB,OAAO,EAAE,GAAG,CAAA;kBACI,MAAM,CAAC,MAAM;aAClB,MAAM,CAAC,MAAM;;0BAEA,MAAM,CAAC,MAAM;;;0BAGb,MAAM,CAAC,MAAM;;MAEjC,6BAA6B,CAAC,MAAM,CAAC,MAAM,CAAC;GAC/C;IACD,SAAS,EAAE,GAAG,CAAA;kBACE,MAAM,CAAC,MAAM;aAClB,MAAM,CAAC,MAAM;;0BAEA,MAAM,CAAC,MAAM;;;;0BAIb,MAAM,CAAC,MAAM;;;MAGjC,6BAA6B,CAAC,MAAM,CAAC,MAAM,CAAC;GAC/C;IACD,MAAM,EAAE,GAAG,CAAA;kBACK,MAAM,CAAC,KAAK;aACjB,MAAM,CAAC,KAAK;;0BAEC,MAAM,CAAC,KAAK;;;0BAGZ,MAAM,CAAC,KAAK;;MAEhC,6BAA6B,CAAC,MAAM,CAAC,KAAK,CAAC;GAC9C;IACD,OAAO,EAAE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G,SAAS,EAAE,EAAE,EAAE,CAAC,WAAW,CAAC,OAAO,CAAC;IACjD,CAAC,EAAE,IAAI,GAAG,QAAQ,EAAE,EAAE,EAAE,CAAC,UAAU,CAAC,IAAI,CAAC;;;;;;;;;;;aAWhC,MAAM,CAAC,OAAO;;;;;;;CAO1B,CAAA"}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
|
-
var t = {};
|
|
3
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4
|
-
t[p] = s[p];
|
|
5
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
6
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
8
|
-
t[p[i]] = s[p[i]];
|
|
9
|
-
}
|
|
10
|
-
return t;
|
|
11
|
-
};
|
|
12
|
-
import React from 'react';
|
|
13
|
-
import { IconWrapper } from '../IconWrapper';
|
|
14
|
-
import { ButtonStyled } from './styles';
|
|
15
|
-
export const ButtonRound = (_a) => {
|
|
16
|
-
var { variant = 'primary', children, disabled = false, icon, outline, badge, size = 'medium' } = _a, props = __rest(_a, ["variant", "children", "disabled", "icon", "outline", "badge", "size"]);
|
|
17
|
-
return (React.createElement(ButtonStyled, Object.assign({ variant: variant, disabled: disabled, outline: outline, badge: badge, size: size }, props),
|
|
18
|
-
badge && size === 'medium' && React.createElement("span", { className: 'buttonRoundBadge' }, badge),
|
|
19
|
-
React.createElement(IconWrapper, { src: icon || '', color: 'white', width: size === 'small' ? '16px' : '20px', height: size === 'small' ? '16px' : '20px', className: 'buttonRadiusWrapperIcon' })));
|
|
20
|
-
};
|
|
21
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/ButtonRound/index.tsx"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAA;AAC5C,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAA;AAGvC,MAAM,CAAC,MAAM,WAAW,GAA+B,CAAC,EASvD,EAAE,EAAE;QATmD,EACtD,OAAO,GAAG,SAAS,EACnB,QAAQ,EACR,QAAQ,GAAG,KAAK,EAChB,IAAI,EACJ,OAAO,EACP,KAAK,EACL,IAAI,GAAG,QAAQ,OAEhB,EADI,KAAK,cAR8C,uEASvD,CADS;IACJ,OAAA,CACJ,oBAAC,YAAY,kBAAC,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,IAAM,KAAK;QACtG,KAAK,IAAI,IAAI,KAAK,QAAQ,IAAI,8BAAM,SAAS,EAAE,kBAAkB,IAAG,KAAK,CAAQ;QAClF,oBAAC,WAAW,IACV,GAAG,EAAE,IAAI,IAAI,EAAE,EACf,KAAK,EAAE,OAAO,EACd,KAAK,EAAE,IAAI,KAAK,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,EACzC,MAAM,EAAE,IAAI,KAAK,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,EAC1C,SAAS,EAAE,yBAAyB,GACpC,CACW,CAChB,CAAA;CAAA,CAAA"}
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import exampleIcon from '../../assets/icon/image.svg';
|
|
2
|
-
import { VARIANTS_TYPES } from '../../utils/constanst';
|
|
3
|
-
import { ButtonRound } from './index';
|
|
4
|
-
const meta = {
|
|
5
|
-
title: 'Components/ButtonRound',
|
|
6
|
-
component: ButtonRound,
|
|
7
|
-
tags: ['autodocs'],
|
|
8
|
-
argTypes: {
|
|
9
|
-
variant: {
|
|
10
|
-
control: {
|
|
11
|
-
type: 'select',
|
|
12
|
-
options: VARIANTS_TYPES,
|
|
13
|
-
},
|
|
14
|
-
},
|
|
15
|
-
disabled: {
|
|
16
|
-
control: 'boolean',
|
|
17
|
-
},
|
|
18
|
-
icon: {
|
|
19
|
-
control: 'object',
|
|
20
|
-
options: [exampleIcon],
|
|
21
|
-
description: exampleIcon,
|
|
22
|
-
},
|
|
23
|
-
onClick: { action: 'clicked' },
|
|
24
|
-
},
|
|
25
|
-
};
|
|
26
|
-
export default meta;
|
|
27
|
-
export const Playground = {
|
|
28
|
-
args: {
|
|
29
|
-
variant: 'primary',
|
|
30
|
-
children: 'ButtonPlayground',
|
|
31
|
-
disabled: false,
|
|
32
|
-
icon: exampleIcon,
|
|
33
|
-
},
|
|
34
|
-
};
|
|
35
|
-
export const ButtonBadge = {
|
|
36
|
-
args: {
|
|
37
|
-
variant: 'primary',
|
|
38
|
-
children: 'ButtonPlayground',
|
|
39
|
-
disabled: false,
|
|
40
|
-
icon: exampleIcon,
|
|
41
|
-
},
|
|
42
|
-
};
|
|
43
|
-
//# sourceMappingURL=stories.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"stories.js","sourceRoot":"","sources":["../../../src/components/ButtonRound/stories.tsx"],"names":[],"mappings":"AACA,OAAO,WAAW,MAAM,6BAA6B,CAAA;AAErD,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAA;AACtD,OAAO,EAAE,WAAW,EAAE,MAAM,SAAS,CAAA;AAErC,MAAM,IAAI,GAA6B;IACrC,KAAK,EAAE,wBAAwB;IAC/B,SAAS,EAAE,WAAW;IACtB,IAAI,EAAE,CAAC,UAAU,CAAC;IAClB,QAAQ,EAAE;QACR,OAAO,EAAE;YACP,OAAO,EAAE;gBACP,IAAI,EAAE,QAAQ;gBACd,OAAO,EAAE,cAAc;aACxB;SACF;QACD,QAAQ,EAAE;YACR,OAAO,EAAE,SAAS;SACnB;QACD,IAAI,EAAE;YACJ,OAAO,EAAE,QAAQ;YACjB,OAAO,EAAE,CAAC,WAAW,CAAC;YACtB,WAAW,EAAE,WAAW;SACzB;QAED,OAAO,EAAE,EAAE,MAAM,EAAE,SAAS,EAAE;KAC/B;CACiC,CAAA;AAEpC,eAAe,IAAI,CAAA;AAGnB,MAAM,CAAC,MAAM,UAAU,GAAU;IAC/B,IAAI,EAAE;QACJ,OAAO,EAAE,SAAS;QAClB,QAAQ,EAAE,kBAAkB;QAC5B,QAAQ,EAAE,KAAK;QACf,IAAI,EAAE,WAAW;KAClB;CACF,CAAA;AAED,MAAM,CAAC,MAAM,WAAW,GAAU;IAChC,IAAI,EAAE;QACJ,OAAO,EAAE,SAAS;QAClB,QAAQ,EAAE,kBAAkB;QAC5B,QAAQ,EAAE,KAAK;QACf,IAAI,EAAE,WAAW;KAClB;CACF,CAAA"}
|