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.
@@ -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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "oddsgate-ds",
3
- "version": "1.0.224",
3
+ "version": "1.0.226",
4
4
  "description": "Miew theme component library",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.js",
@@ -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
- & i {
37
- display: none !important;
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
- color: ${colors.secondary50};
58
- background-color: ${colors.third50};
59
+ color: ${colors.secondary50};
60
+ background-color: ${colors.third50};
59
61
  `
60
62
  : props.$mode === 'light'
61
- ? css`
62
- color: ${colors.primary50};
63
- background-color: ${colors.secondary50};
64
- `
65
- : css`
66
- color: ${colors.secondary50};
67
- background-color: ${colors.primary50};
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
- opacity: 0;
78
- transform: scale(0) translateX(-4px) translateY(-50%);
79
- }
80
-
81
- &:hover {
82
- & span {
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
- color: ${colors.gray50} !important;
180
- border: 1px solid transparent;
188
+ color: ${colors.gray50} !important;
189
+ border: 1px solid transparent;
181
190
 
182
- pointer-events: none;
183
- user-select: none;
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
  }
@@ -15,7 +15,7 @@ export const Default = () => {
15
15
 
16
16
  return (
17
17
  <CategoryIndex
18
- categories={[...categories]}
18
+ categories={categories.map(cat => ({ name: cat, slug: cat }))}
19
19
  selectedCategory={selected}
20
20
  onChange={setSelected}
21
21
  />
@@ -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}66` : ''};
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
  `
@@ -76,9 +76,10 @@ export const Glossary: React.FC<GlossaryProps> = ({
76
76
  <Icon
77
77
  icon="icon-arrowDown"
78
78
  className="ml-12"
79
- style={{ width: '14px' }}
79
+ style={{ fontSize: '12px' }}
80
80
  />
81
81
  }
82
+ iconAnimation={false}
82
83
  >
83
84
  {backToTopButton}
84
85
  </Button>
@@ -23,7 +23,7 @@ export const StyledNoResultsContainer = styled.div`
23
23
  margin-top: 96px;
24
24
  margin-bottom: 120px;
25
25
  @media (max-width: ${responsiveMedia}) {
26
- margin-top: 64x;
26
+ margin-top: 64px;
27
27
  margin-bottom: 80px;
28
28
  }
29
29
  `