oddsgate-ds 1.0.31 → 1.0.33

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 { IChip } from './Chip.interface';
2
2
  import React from 'react';
3
- declare const Chip: ({ variant, hover, className, style, children, ...props }: IChip) => React.JSX.Element;
3
+ declare const Chip: ({ variant, hover, active, className, style, children, onClick, ...props }: IChip) => React.JSX.Element;
4
4
  export default Chip;
@@ -3,7 +3,11 @@ export interface IChip {
3
3
  variant?: string;
4
4
  $variant?: string;
5
5
  hover?: boolean;
6
+ $hover?: boolean;
7
+ active?: boolean;
8
+ $active?: boolean;
6
9
  className?: string;
7
10
  style?: CSSProperties;
8
11
  children?: React.ReactNode;
12
+ onClick?: (event?: React.MouseEvent<HTMLElement>) => void;
9
13
  }
@@ -4,3 +4,4 @@ declare const _default: import("@storybook/types").ComponentAnnotations<import("
4
4
  export default _default;
5
5
  export declare const Dark: StoryObj<IChip>;
6
6
  export declare const Light: StoryObj<IChip>;
7
+ export declare const Active: StoryObj<IChip>;
package/dist/types.d.ts CHANGED
@@ -204,12 +204,16 @@ interface IChip {
204
204
  variant?: string;
205
205
  $variant?: string;
206
206
  hover?: boolean;
207
+ $hover?: boolean;
208
+ active?: boolean;
209
+ $active?: boolean;
207
210
  className?: string;
208
211
  style?: CSSProperties;
209
212
  children?: React.ReactNode;
213
+ onClick?: (event?: React.MouseEvent<HTMLElement>) => void;
210
214
  }
211
215
 
212
- declare const Chip: ({ variant, hover, className, style, children, ...props }: IChip) => React__default.JSX.Element;
216
+ declare const Chip: ({ variant, hover, active, className, style, children, onClick, ...props }: IChip) => React__default.JSX.Element;
213
217
 
214
218
  type IQuote = {
215
219
  id?: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "oddsgate-ds",
3
- "version": "1.0.31",
3
+ "version": "1.0.33",
4
4
  "description": "Miew theme component library",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.js",
@@ -39,10 +39,18 @@ const Button = ({
39
39
  className={className}
40
40
  {...props}
41
41
  >
42
- {/* {leftIcon} */}
43
- {children && <span>{children}</span>}
44
- <Icon icon={"icon-arrow-right"} />
45
- {/* {rightIcon} */}
42
+ {variant === "primary" ? (
43
+ <>
44
+ {children && <span>{children}</span>}
45
+ <Icon icon={"icon-arrow-right"} />
46
+ </>
47
+ ) : (
48
+ <>
49
+ {leftIcon}
50
+ {children && <span>{children}</span>}
51
+ {rightIcon}
52
+ </>
53
+ )}
46
54
  </StyledButton>
47
55
  )
48
56
  }
@@ -6,17 +6,21 @@ import cn from 'classnames'
6
6
  const Chip = ({
7
7
  variant,
8
8
  hover,
9
+ active,
9
10
  className,
10
11
  style,
11
12
  children,
13
+ onClick,
12
14
  ...props
13
15
  }: IChip) => {
14
16
  return (
15
17
  <StyledChip
16
18
  $variant={variant}
17
- hover={hover}
18
- className={cn('captions', className)}
19
+ $hover={hover}
20
+ $active={active}
21
+ className={cn('captions fw-bold', className)}
19
22
  style={style}
23
+ onClick={onClick}
20
24
  >
21
25
  {children}
22
26
  </StyledChip>
@@ -4,7 +4,11 @@ export interface IChip {
4
4
  variant?: string;
5
5
  $variant?: string;
6
6
  hover?: boolean,
7
+ $hover?: boolean,
8
+ active?: boolean,
9
+ $active?: boolean,
7
10
  className?: string,
8
11
  style?: CSSProperties
9
12
  children?: React.ReactNode
13
+ onClick?: (event?: React.MouseEvent<HTMLElement>) => void
10
14
  }
@@ -32,3 +32,11 @@ export const Light: StoryObj<IChip> = {
32
32
  hover: true
33
33
  }
34
34
  }
35
+
36
+ export const Active: StoryObj<IChip> = {
37
+ render: args => <Chip {...args}>Category name</Chip>,
38
+ args: {
39
+ variant: 'light',
40
+ active: true
41
+ }
42
+ }
@@ -15,32 +15,42 @@ export const StyledChip = styled.div<IChip>`
15
15
  switch (props.$variant) {
16
16
  case "dark": default:
17
17
  return css`
18
- color: ${colors.white};
19
- border: 1px solid ${colors.white};
18
+ color: ${colors.secondary50};
19
+ background-color: ${colors.third50};
20
20
 
21
- ${props.hover && `
21
+ ${props.$hover && !props.$active && `
22
22
  &:hover{
23
- color: ${colors.black};
24
- background-color: ${colors.white};
23
+ color: ${colors.secondary50};
24
+ background-color: ${colors.primary50};
25
25
  }
26
26
  `}
27
+
28
+ ${props.$active && `
29
+ color: ${colors.secondary50};
30
+ background-color: ${colors.primary50};
31
+ `}
27
32
  `;
28
33
  case "light":
29
34
  return css`
30
- color: ${colors.black};
31
- border: 1px solid ${colors.black};
35
+ color: ${colors.secondary50};
36
+ background-color: ${colors.primary50};
32
37
 
33
- ${props.hover && `
38
+ ${props.$hover && !props.$active && `
34
39
  &:hover{
35
- color: ${colors.white};
36
- background-color: ${colors.black};
40
+ color: ${colors.secondary50};
41
+ background-color: ${colors.third50};
37
42
  }
38
43
  `}
44
+
45
+ ${props.$active && `
46
+ color: ${colors.secondary50};
47
+ background-color: ${colors.third50};
48
+ `}
39
49
  `;
40
50
  }
41
51
  }}
42
52
 
43
- ${({ hover }) => hover && `
53
+ ${({ $hover }) => $hover && `
44
54
  transition: all 0.3s linear;
45
55
  cursor:pointer;
46
56
  `}
@@ -9,84 +9,43 @@ export const StyledLoader = styled.div<ILoader>`
9
9
 
10
10
  & > div {
11
11
  position: relative;
12
- width: 5rem;
12
+ width: 15rem;
13
13
  height: 5rem;
14
14
 
15
15
  &::before,
16
16
  &::after {
17
17
  content: '';
18
18
  position: absolute;
19
- top: 0;
20
- left: 0;
19
+ top: 50%;
20
+ left: 50%;
21
21
 
22
- width: 100%;
23
- height: 100%;
22
+ width: 5rem;
23
+ height: 5rem;
24
24
 
25
25
  border-radius: 50%;
26
+ transform:translate(-50%,-50%);
26
27
  }
27
28
  &::before{
28
- border-style: solid solid dotted dotted;
29
-
30
- animation: rotation 2s linear infinite;
29
+ left:20%;
30
+ background:${colors.primary50};
31
+ animation:osc-l 2.5s ease infinite;
31
32
  }
32
33
  &::after {
33
- top:50%;
34
- left: 50%;
35
-
36
- max-width: 2rem;
37
- max-height: 2rem;
38
-
39
- margin-top: -1rem;
40
- margin-left: -1rem;
41
-
42
- border-style: solid solid dotted;
43
-
44
- animation: rotationBack 1s linear infinite;
45
- transform-origin: center center;
34
+ left:80%;
35
+ background:${colors.third10};
36
+ animation:osc-r 2.5s ease infinite;
46
37
  }
47
38
  }
48
39
 
49
- ${(props) => {
50
- switch (props.$variant) {
51
- case "dark": default:
52
- return css`
53
- & > div {
54
- &::before{
55
- border: 3px dotted ${colors.white};
56
- }
57
- &::after {
58
- border: 3px dotted ${colors.white};
59
- }
60
- }
61
- `;
62
- case "light":
63
- return css`
64
- & > div {
65
- &::before{
66
- border: 3px dotted ${colors.primary70};
67
- }
68
- &::after {
69
- border: 3px dotted ${colors.primary70};
70
- }
71
- }
72
- `;
73
- }
74
- }}
75
40
 
76
- @keyframes rotation {
77
- 0% {
78
- transform: rotate(0deg);
79
- }
80
- 100% {
81
- transform: rotate(360deg);
82
- }
41
+ @keyframes osc-l{
42
+ 0%{left:20%;}
43
+ 50%{left:50%;}
44
+ 100%{left:20%;}
83
45
  }
84
- @keyframes rotationBack {
85
- 0% {
86
- transform: rotate(0deg);
87
- }
88
- 100% {
89
- transform: rotate(-360deg);
90
- }
46
+ @keyframes osc-r{
47
+ 0%{left:80%;}
48
+ 50%{left:50%;}
49
+ 100%{left:80%;}
91
50
  }
92
51
  `;
@@ -27,7 +27,7 @@ export const StyledAccordionTitle = styled.span<IAccordionItem>`
27
27
 
28
28
  font-size: 1.2rem;
29
29
  color: ${colors.secondary50};
30
- background: ${colors.primary50};
30
+ background: ${colors.third10};
31
31
 
32
32
  transform: translateY(-50%);
33
33
  transform-origin: center;
@@ -60,10 +60,10 @@ export const StyledAccordionItem = styled.li<IAccordionItem>`
60
60
  transition: all 0.6s ${easeOutExpo};
61
61
 
62
62
  &:hover{
63
- color: ${colors.third10};
63
+ color: ${colors.primary50};
64
64
  & ${StyledAccordionTitle} {
65
65
  i{
66
- background: ${colors.third10};
66
+ background: ${colors.primary50};
67
67
  }
68
68
  }
69
69
  }
@@ -4,6 +4,7 @@ import { IBlogCard } from './BlogCard.interface'
4
4
  import Icon from '@/components/atoms/Icon/Icon.component'
5
5
  import ImageWrapper from '@/components/atoms/ImageWrapper'
6
6
  import React from 'react'
7
+ import RichText from '@/components/atoms/RichText/RichText.component'
7
8
  import { StyledBlogCard } from './BlogCard.theme'
8
9
 
9
10
  const BlogCard = ({
@@ -21,26 +22,22 @@ const BlogCard = ({
21
22
  <StyledBlogCard
22
23
  variant={variant}
23
24
  imageElement={
24
- <ImageWrapper aspectRatioHeight={63}>{imageElement}</ImageWrapper>
25
+ <>
26
+ {category && <Chip variant='light'>{category}</Chip>}
27
+ <ImageWrapper aspectRatioHeight={63}>{imageElement}</ImageWrapper>
28
+ </>
25
29
  }
26
30
  >
27
- <div className="w-100">
28
- {category && <Chip className="mb-3">{category}</Chip>}
29
- <div className="d-flex align-items-center justify-content-between">
30
- <Heading tag={'h3'} size={'h5'} className={'textEllipsis'}>
31
- {title}
32
- </Heading>
33
- <Icon icon="icon-forward-arrow"></Icon>
34
- </div>
31
+ <Heading tag={'h3'} size={'h4'} className={'fw-bold textEllipsis'}>
32
+ {title}
33
+ </Heading>
34
+ {date && (
35
+ <RichText tag={'p'} className="fw-bold text-uppercase mt-6">
36
+ {date}
37
+ </RichText>
38
+ )}
35
39
 
36
- {date && (
37
- <Heading tag={'span'} size={'captions'} className="mt-3">
38
- {date}
39
- </Heading>
40
- )}
41
-
42
- {linkElement}
43
- </div>
40
+ {linkElement}
44
41
  </StyledBlogCard>
45
42
  )
46
43
  }
@@ -1,10 +1,23 @@
1
+ import { colors, radius } from '@/styles/variables';
1
2
  import styled, { css } from 'styled-components';
2
3
 
3
4
  import Card from '../Card/Card.component';
4
5
  import { IBlogCard } from './BlogCard.interface';
5
- import { colors } from '@/styles/variables';
6
+ import { StyledChip } from '@/components/atoms/Chip/Chip.theme';
6
7
 
7
8
  export const StyledBlogCard = styled(Card) <IBlogCard>`
9
+ padding: 1rem;
10
+ background-color: ${colors.primary50};
11
+ border-radius: ${radius.sm};
12
+
13
+
14
+ ${StyledChip}{
15
+ position: absolute;
16
+ top: 2rem;
17
+ left: 2rem;
18
+ z-index: 10;
19
+ }
20
+
8
21
  & picture{
9
22
  &:before{
10
23
  content: '';
@@ -19,44 +32,13 @@ export const StyledBlogCard = styled(Card) <IBlogCard>`
19
32
  }
20
33
 
21
34
  & figcaption{
22
- position: absolute;
23
- top: 0;
24
- left: 0;
25
- width: 100%;
26
- height: 100%;
27
- display: flex;
28
- align-items: flex-end;
29
- padding: 1rem;
30
- color: ${colors.white};
31
- z-index: 2;
32
-
33
- & i{
34
- min-width: 3rem;
35
- height: 3rem;
36
- line-height: 3rem;
37
- font-size: 2.6rem;
38
-
39
- border-radius: 50px;
40
- color: ${colors.deepblue};
41
- background-color: ${colors.softgreen};
42
-
43
- transition: all 0.3s linear;
44
- transform: rotateZ(-45deg);
45
- transform-origin: center center;
46
- text-align: center;
47
-
48
- &::before{
49
- line-height: inherit;
50
- }
51
- }
35
+
52
36
  }
53
37
 
54
38
 
55
39
  &:hover{
56
40
  & figcaption{
57
- & i{
58
- transform: rotateZ(0);
59
- }
41
+
60
42
  }
61
43
  }
62
44
  `;
@@ -17,8 +17,8 @@ const CircularSlider = ({
17
17
  }: ICircularSlider) => {
18
18
 
19
19
  const [slideContent, setSlideContent] = useState({
20
- name: '',
21
- role: '',
20
+ name: content && content[0].name,
21
+ role: content && content[0].role,
22
22
  });
23
23
  const slider = useRef<HTMLDivElement>();
24
24
  const wrapper = useRef<HTMLDivElement>();
@@ -99,18 +99,15 @@ const CircularSlider = ({
99
99
  const addStyle = () => {
100
100
  setTimeout(() => {
101
101
  contentHolder?.current?.classList.add('active');
102
+ slides[currentSlide].classList.add('active');
102
103
  }, 400);
103
-
104
- content && setSlideContent(content[currentSlide] as any)
105
- slides[currentSlide].classList.add('active');
106
- slides[currentSlide].style.height = slides[currentSlide].style.width = slidesSize + 20 + 'px';
107
104
  };
108
105
  const removeStyle = () => {
109
106
  contentHolder?.current?.classList.remove('active');
110
-
111
- content && setSlideContent(content[currentSlide] as any)
112
- slides[currentSlide].classList.remove('active');
113
- slides[currentSlide].style.height = slides[currentSlide].style.width = slidesSize + 'px';
107
+ setTimeout(() => {
108
+ content && setSlideContent(content[currentSlide] as any)
109
+ slides[currentSlide].classList.remove('active');
110
+ }, 400);
114
111
  };
115
112
 
116
113
  const rotateSlider = (e) => {
@@ -120,16 +117,21 @@ const CircularSlider = ({
120
117
 
121
118
  removeStyle();
122
119
 
123
- const distanceUntilEnd = slides.length - newSlide;
124
- const distanteFromStart = currentSlide;
125
- const a = (distanteFromStart + distanceUntilEnd) > 0 ? (distanteFromStart + distanceUntilEnd) * -1 : (distanteFromStart + distanceUntilEnd);
120
+ let multiplier = 0;
121
+ let direction = "";
126
122
 
127
- // const multiplier = newSlide >= (slides.length / 2) ? a : newSlide - currentSlide;
128
- const multiplier = newSlide - currentSlide;
123
+ if (currentSlide === 0 && newSlide === (slides.length - 1)) {
124
+ multiplier = -1;
125
+ direction = "-";
126
+ } else {
127
+ multiplier = newSlide - currentSlide
128
+ direction = currentSlide < newSlide ? "+" : "-";
129
+ }
129
130
 
130
131
  const newAngle = Math.abs((stepAngle * 180 / Math.PI) * multiplier);
131
132
 
132
- currentSlide < newSlide ? currentAngle -= newAngle : currentAngle += newAngle;
133
+
134
+ currentAngle = direction === "-" ? (currentAngle + newAngle) : (currentAngle - newAngle);
133
135
  currentSlide = newSlide;
134
136
 
135
137
  slidesHolder.current.style.transform = 'rotate( ' + currentAngle + 'deg )';
@@ -47,7 +47,7 @@ export const StyledTabsContent = styled.div<ITabsItem>`
47
47
  border-radius: 48px 0;
48
48
  padding: 36px;
49
49
 
50
- min-height: 50rem;
50
+ min-height: 40rem;
51
51
 
52
52
  opacity: 0;
53
53
  transform: translateY(40px);
@@ -75,7 +75,7 @@ const GlobalStyles = createGlobalStyle`
75
75
  font-size: clamp(14px, calc(100vw / ${mobile_width} * 14), 16px); //reset font size for mobile
76
76
  line-height: 1;
77
77
 
78
- color: var(--color-gray90);
78
+ color: var(--color-secondary50);
79
79
  background: var(--color-white);
80
80
 
81
81
  @media only screen and (min-width: 580px) { //reset font size for tablet