oddsgate-ds 1.0.224 → 1.0.226
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/dist/cjs/index.js +4 -4
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/types/components/atoms/Button/Button.component.d.ts +1 -1
- package/dist/cjs/types/components/atoms/Button/Button.interface.d.ts +4 -0
- package/dist/esm/index.js +4 -4
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/types/components/atoms/Button/Button.component.d.ts +1 -1
- package/dist/esm/types/components/atoms/Button/Button.interface.d.ts +4 -0
- package/dist/types.d.ts +3 -1
- package/package.json +1 -1
- package/src/components/atoms/Button/Button.component.tsx +4 -0
- package/src/components/atoms/Button/Button.interface.ts +4 -0
- package/src/components/atoms/Button/Button.theme.ts +39 -30
- package/src/components/molecules/CategoriesWrapper/CategoriesWrapper.component.tsx +1 -1
- package/src/components/molecules/CategoriesWrapper/CategoriesWrapper.stories.tsx +8 -8
- package/src/components/molecules/CategoryIndex/CategoryIndex.stories.tsx +1 -1
- package/src/components/molecules/CategoryIndex/CategoryIndex.theme.ts +6 -1
- package/src/components/organisms/Glossary/Glossary.component.tsx +2 -1
- package/src/components/organisms/Glossary/Glossary.themes.ts +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { IButton } from './Button.interface';
|
|
2
2
|
import React from 'react';
|
|
3
|
-
declare const Button: ({ id, as, children, variant, mode, outlined, leftIcon, rightIcon, removeLabel, className, href, ariaLabel, rel, target, disabled, type, ...props }: IButton) => React.JSX.Element;
|
|
3
|
+
declare const Button: ({ id, as, children, variant, mode, outlined, leftIcon, rightIcon, removeLabel, className, href, ariaLabel, rel, target, disabled, type, iconAnimation, hideIconOnMobile, ...props }: IButton) => React.JSX.Element;
|
|
4
4
|
export default Button;
|
|
@@ -20,9 +20,13 @@ interface IButtonBase {
|
|
|
20
20
|
export interface IButtonSC extends IButtonBase {
|
|
21
21
|
$variant?: string;
|
|
22
22
|
$mode?: string;
|
|
23
|
+
$iconAnimation?: boolean;
|
|
24
|
+
$hideIconOnMobile?: boolean;
|
|
23
25
|
}
|
|
24
26
|
export interface IButton extends IButtonBase {
|
|
25
27
|
variant?: string;
|
|
26
28
|
mode?: string;
|
|
29
|
+
iconAnimation?: boolean;
|
|
30
|
+
hideIconOnMobile?: boolean;
|
|
27
31
|
}
|
|
28
32
|
export {};
|
package/dist/types.d.ts
CHANGED
|
@@ -156,9 +156,11 @@ interface IButtonBase {
|
|
|
156
156
|
interface IButton extends IButtonBase {
|
|
157
157
|
variant?: string;
|
|
158
158
|
mode?: string;
|
|
159
|
+
iconAnimation?: boolean;
|
|
160
|
+
hideIconOnMobile?: boolean;
|
|
159
161
|
}
|
|
160
162
|
|
|
161
|
-
declare const Button: ({ id, as, children, variant, mode, outlined, leftIcon, rightIcon, removeLabel, className, href, ariaLabel, rel, target, disabled, type, ...props }: IButton) => React__default.JSX.Element;
|
|
163
|
+
declare const Button: ({ id, as, children, variant, mode, outlined, leftIcon, rightIcon, removeLabel, className, href, ariaLabel, rel, target, disabled, type, iconAnimation, hideIconOnMobile, ...props }: IButton) => React__default.JSX.Element;
|
|
162
164
|
|
|
163
165
|
type ISpacer = {
|
|
164
166
|
id?: string;
|
package/package.json
CHANGED
|
@@ -20,6 +20,8 @@ const Button = ({
|
|
|
20
20
|
target,
|
|
21
21
|
disabled,
|
|
22
22
|
type,
|
|
23
|
+
iconAnimation=true,
|
|
24
|
+
hideIconOnMobile=true,
|
|
23
25
|
...props
|
|
24
26
|
}: IButton) => {
|
|
25
27
|
return (
|
|
@@ -37,6 +39,8 @@ const Button = ({
|
|
|
37
39
|
rel={href ? rel : undefined}
|
|
38
40
|
aria-label={href ? ariaLabel : undefined}
|
|
39
41
|
className={className}
|
|
42
|
+
$iconAnimation={iconAnimation}
|
|
43
|
+
$hideIconOnMobile={hideIconOnMobile}
|
|
40
44
|
{...props}
|
|
41
45
|
>
|
|
42
46
|
{variant === 'primary' || variant === 'secondary' ? (
|
|
@@ -21,9 +21,13 @@ interface IButtonBase {
|
|
|
21
21
|
export interface IButtonSC extends IButtonBase {
|
|
22
22
|
$variant?: string;
|
|
23
23
|
$mode?: string;
|
|
24
|
+
$iconAnimation?: boolean;
|
|
25
|
+
$hideIconOnMobile?: boolean;
|
|
24
26
|
}
|
|
25
27
|
export interface IButton extends IButtonBase {
|
|
26
28
|
variant?: string;
|
|
27
29
|
mode?: string;
|
|
30
|
+
iconAnimation?: boolean;
|
|
31
|
+
hideIconOnMobile?: boolean;
|
|
28
32
|
}
|
|
29
33
|
|
|
@@ -33,9 +33,11 @@ export const StyledButton = styled.a<IButtonSC>`
|
|
|
33
33
|
}
|
|
34
34
|
|
|
35
35
|
@media only screen and (max-width: ${responsiveMedia}) {
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
36
|
+
${props => props.$hideIconOnMobile && css`
|
|
37
|
+
& i {
|
|
38
|
+
display: none !important;
|
|
39
|
+
}
|
|
40
|
+
`}
|
|
39
41
|
span {
|
|
40
42
|
transform: unset !important;
|
|
41
43
|
}
|
|
@@ -54,38 +56,45 @@ export const StyledButton = styled.a<IButtonSC>`
|
|
|
54
56
|
|
|
55
57
|
${props.$mode === 'darkNewsletter'
|
|
56
58
|
? css`
|
|
57
|
-
|
|
58
|
-
|
|
59
|
+
color: ${colors.secondary50};
|
|
60
|
+
background-color: ${colors.third50};
|
|
59
61
|
`
|
|
60
62
|
: props.$mode === 'light'
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
63
|
+
? css`
|
|
64
|
+
color: ${colors.primary50};
|
|
65
|
+
background-color: ${colors.secondary50};
|
|
66
|
+
`
|
|
67
|
+
: css`
|
|
68
|
+
color: ${colors.secondary50};
|
|
69
|
+
background-color: ${colors.primary50};
|
|
70
|
+
`}
|
|
69
71
|
|
|
70
72
|
& span {
|
|
71
73
|
transition: all 0.3s ease;
|
|
72
74
|
}
|
|
73
75
|
& i {
|
|
74
|
-
position: absolute;
|
|
75
76
|
top: 50%;
|
|
76
77
|
right: 1.8rem;
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
transform: translateX(-1rem);
|
|
84
|
-
}
|
|
85
|
-
& i {
|
|
86
|
-
opacity: 1;
|
|
87
|
-
transform: scale(1) translateX(0) translateY(-50%);
|
|
78
|
+
${props.$iconAnimation &&
|
|
79
|
+
css`
|
|
80
|
+
position: absolute;
|
|
81
|
+
opacity: 0;
|
|
82
|
+
transform: scale(0) translateX(-4px) translateY(-50%);
|
|
83
|
+
`}
|
|
88
84
|
}
|
|
85
|
+
|
|
86
|
+
${props.$iconAnimation &&
|
|
87
|
+
css`
|
|
88
|
+
&:hover {
|
|
89
|
+
& span {
|
|
90
|
+
transform: translateX(-1rem);
|
|
91
|
+
}
|
|
92
|
+
& i {
|
|
93
|
+
opacity: 1;
|
|
94
|
+
transform: scale(1) translateX(0) translateY(-50%);
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
`}
|
|
89
98
|
}
|
|
90
99
|
|
|
91
100
|
@media only screen and (min-width: ${responsiveMedia}) {
|
|
@@ -176,10 +185,10 @@ export const StyledButton = styled.a<IButtonSC>`
|
|
|
176
185
|
${({ disabled }) =>
|
|
177
186
|
disabled &&
|
|
178
187
|
css`
|
|
179
|
-
|
|
180
|
-
|
|
188
|
+
color: ${colors.gray50} !important;
|
|
189
|
+
border: 1px solid transparent;
|
|
181
190
|
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
191
|
+
pointer-events: none;
|
|
192
|
+
user-select: none;
|
|
193
|
+
`}
|
|
185
194
|
`
|
|
@@ -25,7 +25,7 @@ const CategoriesWrapper: React.FC<CategoriesWrapperProps> = ({
|
|
|
25
25
|
{categoryItems.map((item, index) => (
|
|
26
26
|
<StyledCategoryItem key={index}>
|
|
27
27
|
<a href={item.slug}>
|
|
28
|
-
<Button variant="text">{item.title}</Button>
|
|
28
|
+
<Button variant="text" iconAnimation={false}>{item.title}</Button>
|
|
29
29
|
</a>
|
|
30
30
|
</StyledCategoryItem>
|
|
31
31
|
))}
|
|
@@ -14,14 +14,14 @@ export const Default: Story = {
|
|
|
14
14
|
args: {
|
|
15
15
|
category: 'A',
|
|
16
16
|
categoryItems: [
|
|
17
|
-
'Ace',
|
|
18
|
-
'Admin',
|
|
19
|
-
'AFK',
|
|
20
|
-
'Anti-eco',
|
|
21
|
-
'Aimbot',
|
|
22
|
-
'All-in',
|
|
23
|
-
'Armor',
|
|
24
|
-
'APM'
|
|
17
|
+
{ title: 'Ace', slug: 'ace' },
|
|
18
|
+
{ title: 'Admin', slug: 'admin' },
|
|
19
|
+
{ title: 'AFK', slug: 'afk' },
|
|
20
|
+
{ title: 'Anti-eco', slug: 'anti-eco' },
|
|
21
|
+
{ title: 'Aimbot', slug: 'aimbot' },
|
|
22
|
+
{ title: 'All-in', slug: 'all-in' },
|
|
23
|
+
{ title: 'Armor', slug: 'armor' },
|
|
24
|
+
{ title: 'APM', slug: 'apm' }
|
|
25
25
|
]
|
|
26
26
|
}
|
|
27
27
|
}
|
|
@@ -14,7 +14,7 @@ export const StyledGlossaryCategoryIndexItem = styled.div<ItemProps>`
|
|
|
14
14
|
cursor: pointer;
|
|
15
15
|
border-radius: 100%;
|
|
16
16
|
background-color: ${({ isSelected }) =>
|
|
17
|
-
isSelected ? `${colors.primary50}
|
|
17
|
+
isSelected ? `${colors.primary50}` : ''};
|
|
18
18
|
display: flex;
|
|
19
19
|
align-items: center;
|
|
20
20
|
justify-content: center;
|
|
@@ -27,4 +27,9 @@ export const StyledGlossaryCategoryIndexItem = styled.div<ItemProps>`
|
|
|
27
27
|
@media (max-width: ${responsiveMedia}) {
|
|
28
28
|
font-size: 20px;
|
|
29
29
|
}
|
|
30
|
+
&:hover {
|
|
31
|
+
background-color: ${({ isSelected }) =>
|
|
32
|
+
!isSelected ? `${colors.primary50}66` : ''};
|
|
33
|
+
}
|
|
34
|
+
|
|
30
35
|
`
|