oddsgate-ds 1.0.112 → 1.0.113

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.
Files changed (33) hide show
  1. package/dist/cjs/index.js +3 -3
  2. package/dist/cjs/index.js.map +1 -1
  3. package/dist/cjs/types/components/molecules/ProductCard/ProductCard.component.d.ts +1 -1
  4. package/dist/cjs/types/components/molecules/ProductCard/ProductCard.interface.d.ts +1 -0
  5. package/dist/cjs/types/components/organisms/CircularSliderTeste/CircularSliderTeste.component.d.ts +4 -0
  6. package/dist/cjs/types/components/organisms/CircularSliderTeste/CircularSliderTeste.interface.d.ts +12 -0
  7. package/dist/cjs/types/components/organisms/CircularSliderTeste/CircularSliderTeste.theme.d.ts +7 -0
  8. package/dist/cjs/types/components/organisms/CircularSliderTeste/index.d.ts +1 -0
  9. package/dist/esm/index.js +3 -3
  10. package/dist/esm/index.js.map +1 -1
  11. package/dist/esm/types/components/molecules/ProductCard/ProductCard.component.d.ts +1 -1
  12. package/dist/esm/types/components/molecules/ProductCard/ProductCard.interface.d.ts +1 -0
  13. package/dist/esm/types/components/organisms/CircularSliderTeste/CircularSliderTeste.component.d.ts +4 -0
  14. package/dist/esm/types/components/organisms/CircularSliderTeste/CircularSliderTeste.interface.d.ts +12 -0
  15. package/dist/esm/types/components/organisms/CircularSliderTeste/CircularSliderTeste.theme.d.ts +7 -0
  16. package/dist/esm/types/components/organisms/CircularSliderTeste/index.d.ts +1 -0
  17. package/dist/types.d.ts +2 -1
  18. package/package.json +1 -1
  19. package/src/components/atoms/FormField/FormField.theme.tsx +2 -0
  20. package/src/components/atoms/RichText/RichText.theme.ts +2 -0
  21. package/src/components/molecules/BlogCard/BlogCard.component.tsx +2 -2
  22. package/src/components/molecules/BlogCard/BlogCard.theme.ts +3 -1
  23. package/src/components/molecules/NewsCard/NewsCard.component.tsx +8 -7
  24. package/src/components/molecules/NewsCard/NewsCard.theme.ts +7 -3
  25. package/src/components/molecules/ProductCard/ProductCard.component.tsx +5 -2
  26. package/src/components/molecules/ProductCard/ProductCard.interface.ts +1 -0
  27. package/src/components/organisms/CircularSlider/CircularSlider.component.tsx +5 -3
  28. package/src/components/organisms/CircularSlider/CircularSlider.theme.ts +7 -1
  29. package/src/components/organisms/CircularSliderTeste/CircularSliderTeste.component.tsx +190 -0
  30. package/src/components/organisms/CircularSliderTeste/CircularSliderTeste.interface.ts +13 -0
  31. package/src/components/organisms/CircularSliderTeste/CircularSliderTeste.stories.tsx +134 -0
  32. package/src/components/organisms/CircularSliderTeste/CircularSliderTeste.theme.ts +65 -0
  33. package/src/components/organisms/CircularSliderTeste/index.ts +1 -0
@@ -1,4 +1,4 @@
1
1
  import { IProductCard } from './ProductCard.interface';
2
2
  import React from 'react';
3
- declare const ProductCard: ({ title, imageElement, description, className, style, ...props }: IProductCard) => React.JSX.Element;
3
+ declare const ProductCard: ({ title, imageElement, linkElement, description, className, style, ...props }: IProductCard) => React.JSX.Element;
4
4
  export default ProductCard;
@@ -3,4 +3,5 @@ import { ICard } from '../Card/Card.interface';
3
3
  export interface IProductCard extends ICard {
4
4
  title?: string;
5
5
  description?: string | React.ReactElement;
6
+ linkElement?: React.ReactElement;
6
7
  }
@@ -0,0 +1,4 @@
1
+ import React from 'react';
2
+ import { ICircularSliderTeste } from './CircularSliderTeste.interface';
3
+ declare const CircularSliderTeste: ({ cta, content, style, className, }: ICircularSliderTeste) => React.JSX.Element;
4
+ export default CircularSliderTeste;
@@ -0,0 +1,12 @@
1
+ import { CSSProperties } from 'react';
2
+ export type ICircularSliderTeste = {
3
+ id?: string;
4
+ className?: string;
5
+ style?: CSSProperties;
6
+ content?: {
7
+ name?: string;
8
+ role?: string;
9
+ img?: React.ReactNode;
10
+ }[];
11
+ cta?: React.ReactNode;
12
+ };
@@ -0,0 +1,7 @@
1
+ /// <reference types="react" />
2
+ import { ICircularSliderTeste } from './CircularSliderTeste.interface';
3
+ export declare const StyledCircularSliderTeste: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, ICircularSliderTeste>> & string;
4
+ export declare const StyledCircularSliderTesteWrapper: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, ICircularSliderTeste>> & string;
5
+ export declare const StyledCircularSliderTesteSlides: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, ICircularSliderTeste>> & string;
6
+ export declare const StyledCircularSliderTesteSlide: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, ICircularSliderTeste>> & string;
7
+ export declare const StyledCircularSliderTesteContent: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, ICircularSliderTeste>> & string;
@@ -0,0 +1 @@
1
+ export { default } from './CircularSliderTeste.component';
package/dist/types.d.ts CHANGED
@@ -528,9 +528,10 @@ declare const LogosCard: ({ imageElement, title, className, style, ...props }: I
528
528
  interface IProductCard extends ICard {
529
529
  title?: string;
530
530
  description?: string | React.ReactElement;
531
+ linkElement?: React.ReactElement;
531
532
  }
532
533
 
533
- declare const ProductCard: ({ title, imageElement, description, className, style, ...props }: IProductCard) => React__default.JSX.Element;
534
+ declare const ProductCard: ({ title, imageElement, linkElement, description, className, style, ...props }: IProductCard) => React__default.JSX.Element;
534
535
 
535
536
  interface ILicenseCard extends ICard {
536
537
  title?: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "oddsgate-ds",
3
- "version": "1.0.112",
3
+ "version": "1.0.113",
4
4
  "description": "Miew theme component library",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.js",
@@ -122,9 +122,11 @@ export const StyledFieldContainer = styled.div<IFormField>`
122
122
 
123
123
  ::placeholder {
124
124
  color: rbga(${colors.third10}, 0.2);
125
+ font-weight:700;
125
126
  }
126
127
 
127
128
  ::-ms-input-placeholder { /* Edge 12 -18 */
128
129
  color: rbga(${colors.third10}, 0.2);
130
+ font-weight:700;
129
131
  }
130
132
  `
@@ -5,6 +5,8 @@ import { IRichText } from './RichText.interface';
5
5
  import { fontSize } from '@/styles/utilities';
6
6
 
7
7
  export const StyledRichText = styled.div<IRichText>`
8
+ display: block;
9
+
8
10
  & p {
9
11
  margin: 0;
10
12
  }
@@ -28,14 +28,14 @@ const BlogCard = ({
28
28
  </>
29
29
  }
30
30
  >
31
- <Heading tag={'h3'} size={'h4'} className={'fw-bold textEllipsis mt-4'}>
31
+ <Heading tag={'h3'} size={'h4'} className={'fw-bold textEllipsis'}>
32
32
  {title}
33
33
  </Heading>
34
34
  <Heading tag={'span'} size={'captions'} className={'textEllipsis mt-3'}>
35
35
  {description}
36
36
  </Heading>
37
37
  {date && (
38
- <RichText tag={'span'} className="fw-bold mt-4">
38
+ <RichText tag={'span'} className="d-block fw-bold mt-4">
39
39
  {date}
40
40
  </RichText>
41
41
  )}
@@ -27,7 +27,9 @@ export const StyledBlogCard = styled(Card) <IBlogCard>`
27
27
  }
28
28
 
29
29
  & figcaption{
30
-
30
+ h3{
31
+ line-height: 1.1;
32
+ }
31
33
  }
32
34
 
33
35
  &:hover{
@@ -21,17 +21,18 @@ const NewsCard = ({
21
21
  $variant={variant}
22
22
  imageElement={
23
23
  <>
24
- {category && <Chip variant='light' className='font-epilogue'>{category}</Chip>}
25
24
  <ImageWrapper aspectRatioHeight={63}>{imageElement}</ImageWrapper>
26
25
  </>
27
26
  }
28
27
  >
29
- <Heading tag={'h3'} size={variant === "featured" ? "h3" : 'h4'} className={'fw-bold textEllipsis mt-4'}>
30
- {title}
31
- </Heading>
32
- <Heading tag={'span'} size={'captions'} className={'textEllipsis mt-3'}>
33
- {description}
34
- </Heading>
28
+ <div>
29
+ <Heading tag={'h3'} size={variant === "featured" ? "h3" : 'h4'} className={'fw-bold textEllipsis'}>
30
+ {title}
31
+ </Heading>
32
+ <Heading tag={'span'} size={'captions'} className={'textEllipsis mt-3'}>
33
+ {description}
34
+ </Heading>
35
+ </div>
35
36
  {date && (
36
37
  <Heading tag={'span'} size={variant === "featured" ? "h5" : 'texts'} className={'fw-bold mt-4'}>
37
38
  {date}
@@ -4,7 +4,6 @@ import styled, { css } from 'styled-components';
4
4
  import Card from '../Card/Card.component';
5
5
  import { INewsCard } from './NewsCard.interface';
6
6
  import { StyledChip } from '@/components/atoms/Chip/Chip.theme';
7
- import { variables } from '@/index';
8
7
 
9
8
  export const StyledNewsCard = styled(Card) <INewsCard>`
10
9
  padding: 1rem;
@@ -42,7 +41,8 @@ export const StyledNewsCard = styled(Card) <INewsCard>`
42
41
  @media only screen and (min-width: ${responsiveMedia}) {
43
42
 
44
43
  display: flex;
45
- align-items:center;
44
+ align-items:stretch;
45
+ justify-content: space-between;
46
46
  flex-flow: row-reverse;
47
47
 
48
48
  ${StyledChip}{
@@ -55,7 +55,11 @@ export const StyledNewsCard = styled(Card) <INewsCard>`
55
55
  width: 45%;
56
56
  }
57
57
  & figcaption{
58
- width: 55%;
58
+ display: flex;
59
+ flex-flow: column;
60
+ justify-content: space-between;
61
+
62
+ width: 45%;
59
63
  padding:1.6rem;
60
64
  }
61
65
  }
@@ -9,6 +9,7 @@ import RichText from '@/components/atoms/RichText/RichText.component'
9
9
  const ProductCard = ({
10
10
  title,
11
11
  imageElement,
12
+ linkElement,
12
13
  description,
13
14
  className,
14
15
  style,
@@ -25,10 +26,10 @@ const ProductCard = ({
25
26
  let firstRowTitle;
26
27
  let secondRowTitle;
27
28
 
28
- if(parts.length>1){
29
+ if (parts.length > 1) {
29
30
  firstRowTitle = parts.slice(0, half).join(" ")
30
31
  secondRowTitle = parts.slice(half, parts?.length).join(" ")
31
- }else{
32
+ } else {
32
33
  firstRowTitle = title;
33
34
  }
34
35
 
@@ -45,6 +46,8 @@ const ProductCard = ({
45
46
  </Heading>
46
47
  </StyledProductCardWrapper>
47
48
  {description && <RichText tag='p' className='color-secondary50 mt-6'>{description}</RichText>}
49
+
50
+ {linkElement}
48
51
  </StyledProductCard>
49
52
  )
50
53
  }
@@ -3,4 +3,5 @@ import { ICard } from '../Card/Card.interface';
3
3
  export interface IProductCard extends ICard {
4
4
  title?: string
5
5
  description?: string | React.ReactElement
6
+ linkElement?: React.ReactElement
6
7
  }
@@ -25,6 +25,7 @@ const CircularSlider = ({
25
25
  });
26
26
  const slider = useRef<HTMLDivElement>();
27
27
  const wrapper = useRef<HTMLDivElement>();
28
+ const svg = useRef<HTMLDivElement>();
28
29
  const slidesHolder = useRef<HTMLDivElement>();
29
30
  const contentHolder = useRef<HTMLDivElement>();
30
31
 
@@ -80,9 +81,9 @@ const CircularSlider = ({
80
81
 
81
82
  slidesSize = Math.min(2 * radius * slideSize, stepAngle * radius * (1 - slideSize) - 50);
82
83
 
83
- if(!isMobile){
84
+ if (!isMobile) {
84
85
  slidesHolder.current.style.marginTop = radius * slideSize + 'px';
85
- }else{
86
+ } else {
86
87
  wrapper.current.style.marginTop = -(r - slidesSize) + 'px';
87
88
  }
88
89
 
@@ -147,6 +148,7 @@ const CircularSlider = ({
147
148
  currentAngle = direction === "-" ? (currentAngle + newAngle) : (currentAngle - newAngle);
148
149
  currentSlide = newSlide;
149
150
 
151
+ if (svg?.current) svg.current.style.transform = 'translate(-50%, -50%) rotate( ' + currentAngle * 4 + 'deg )';
150
152
  slidesHolder.current.style.transform = 'rotate( ' + currentAngle + 'deg )';
151
153
  addStyle();
152
154
  }
@@ -174,7 +176,7 @@ const CircularSlider = ({
174
176
 
175
177
  return (
176
178
  <StyledCircularSlider ref={slider as any} className={className} style={style}>
177
- <svg viewBox="0 0 907 906" fill="none" xmlns="http://www.w3.org/2000/svg">
179
+ <svg ref={svg as any} viewBox="0 0 907 906" fill="none" xmlns="http://www.w3.org/2000/svg">
178
180
  <path d="M887.551 584.892L904.187 504.729L531.591 461.981C531.824 459.769 532.012 457.775 531.984 455.735L906.794 468.208L902.047 386.545L531.043 441.754C530.798 439.669 530.336 437.54 529.829 435.627L895.322 350.347L869.628 272.699L525.63 422.1C524.69 420.097 523.922 418.356 522.981 416.353L853.852 239.821L808.868 171.277L515.038 404.535C513.792 402.92 512.328 401.26 510.82 399.817L784.811 143.459L723.799 88.9898L500.604 390.24C498.834 388.969 497.28 387.742 495.465 386.688L693.744 68.2895L620.714 31.439L483.014 380.262C481.154 379.424 479.032 378.757 477.127 378.136L585.693 19.4255L505.53 2.78951L462.783 375.385C460.571 375.152 458.576 374.964 456.537 374.993L469.01 0.182176L387.347 4.92974L442.556 375.933C440.471 376.179 438.342 376.641 436.429 377.148L351.149 11.6549L273.501 37.3486L422.902 381.346C420.899 382.286 419.158 383.055 417.155 383.995L240.361 53.2959L171.817 98.2799L405.12 391.893C403.505 393.14 401.846 394.603 400.403 396.112L144.261 122.166L89.7918 183.178L391.042 406.373C389.77 408.143 388.544 409.696 387.49 411.511L69.2632 213.494L32.4127 286.524L381.235 424.224C380.397 426.084 379.731 428.206 379.11 430.111L20.2275 321.283L3.59147 401.446L376.187 444.194C375.954 446.405 375.766 448.4 375.795 450.44L0.984138 437.967L5.73169 519.63L376.735 464.42C376.981 466.505 377.443 468.635 377.95 470.548L12.4569 555.828L38.1505 633.476L382.148 484.075C383.088 486.078 383.857 487.819 384.797 489.822L54.0979 666.616L99.0819 735.16L392.695 501.857C393.942 503.471 395.405 505.131 396.914 506.574L122.968 762.715L183.98 817.185L407.175 515.935C408.945 517.206 410.498 518.432 412.313 519.487L214.034 837.885L287.064 874.736L424.765 525.913C426.625 526.751 428.746 527.417 430.651 528.038L322.085 886.749L402.248 903.385L444.996 530.789C447.207 531.022 449.202 531.21 451.242 531.182L438.769 905.992L520.432 901.245L465.222 530.241C467.307 529.996 469.437 529.534 471.35 529.027L556.629 894.52L634.278 868.826L484.876 524.828C486.88 523.888 488.621 523.12 490.624 522.179L667.156 853.05L735.7 808.066L502.442 514.236C504.056 512.99 505.716 511.526 507.159 510.018L763.517 784.009L817.987 722.997L516.737 499.802C518.008 498.032 519.234 496.478 520.289 494.663L838.687 692.942L875.538 619.912L526.715 482.212C527.553 480.352 528.219 478.23 528.84 476.325L887.551 584.892Z" fill="#FC3151" />
179
181
  </svg>
180
182
  <StyledCircularSliderWrapper ref={wrapper as any}>
@@ -12,7 +12,7 @@ export const StyledCircularSlider = styled.div<ICircularSlider>`
12
12
  position:absolute;
13
13
  top:50%;
14
14
  left:0;
15
- width:66.666%;
15
+ width:55%;
16
16
  height:auto;
17
17
  transform: translate(-50%, -50%)
18
18
  }
@@ -21,8 +21,14 @@ export const StyledCircularSlider = styled.div<ICircularSlider>`
21
21
  min-height: 100dvh;
22
22
  & > svg{
23
23
  display: block;
24
+ transition: all 0.8s ease-in-out;
24
25
  }
25
26
  }
27
+
28
+ @keyframes spin {
29
+ 0% { transform: rotate(0deg); }
30
+ 100% { transform: rotate(80deg); }
31
+ }
26
32
  `;
27
33
 
28
34
  export const StyledCircularSliderWrapper = styled.div<ICircularSlider>`
@@ -0,0 +1,190 @@
1
+ import React, { useEffect, useRef, useState } from 'react'
2
+ import {
3
+ StyledCircularSliderTeste,
4
+ StyledCircularSliderTesteContent,
5
+ StyledCircularSliderTesteSlide,
6
+ StyledCircularSliderTesteSlides,
7
+ StyledCircularSliderTesteWrapper
8
+ } from './CircularSliderTeste.theme'
9
+
10
+ import Heading from '@/components/atoms/Heading/Heading.component';
11
+ import { ICircularSliderTeste } from './CircularSliderTeste.interface'
12
+ import { debounce } from '@/helpers/events';
13
+ import useMediaMatch from '@/helpers/useMediaMatch';
14
+
15
+ const CircularSliderTeste = ({
16
+ cta,
17
+ content,
18
+ style,
19
+ className,
20
+ }: ICircularSliderTeste) => {
21
+
22
+ const [slideContent, setSlideContent] = useState({
23
+ name: content && content[0].name,
24
+ role: content && content[0].role,
25
+ });
26
+ const slider = useRef<HTMLDivElement>();
27
+ const wrapper = useRef<HTMLDivElement>();
28
+ const slidesHolder = useRef<HTMLDivElement>();
29
+ const contentHolder = useRef<HTMLDivElement>();
30
+
31
+ //force 12 items
32
+ if (content && content.length < 12) {
33
+ let counter = 0;
34
+ for (let i = content.length; i <= 12; i++) {
35
+ content[i] = content[counter];
36
+ counter++;
37
+ }
38
+ }
39
+
40
+ useEffect(() => {
41
+ if (!slidesHolder.current) return //bail out;
42
+
43
+ const animationDuration = 600;
44
+
45
+ const slides = Array.prototype.slice.call(slidesHolder?.current?.children);
46
+
47
+ let slidesSize = 0;
48
+
49
+ let currentAngle = -180;
50
+
51
+ const stepAngle = 2 * Math.PI / slidesHolder?.current?.children.length;
52
+ // const stepAngle = 0.52;
53
+
54
+ let currentSlide = 0;
55
+
56
+ slidesHolder.current.style.transitionDuration = animationDuration + 'ms';
57
+ const slidesRepositioning = (r) => {
58
+ for (let i = 0; i < slides.length; i++) {
59
+
60
+ let x = r * Math.cos(stepAngle * i - Math.PI / 2),
61
+ y = r * Math.sin(stepAngle * i - Math.PI / 2);
62
+
63
+ slides[i].style.transform = 'translate( ' + x + 'px, ' + y + 'px ) rotate( ' + ((stepAngle * 180 / Math.PI * i) + 4) + 'deg )';
64
+ // slides[i].style.transform = 'translate( ' + x + 'px, ' + y + 'px )';
65
+ };
66
+ }
67
+ const setSize = (radius: number) => {
68
+ if (!wrapper.current || !slidesHolder.current) return //bail out;
69
+
70
+ const slideSize = 0.15;
71
+
72
+ wrapper.current.style.width = 2 * radius + 'px';
73
+ wrapper.current.style.height = 2 * radius + 'px';
74
+
75
+ let r = 2 * radius * (1 - slideSize);
76
+ slidesHolder.current.style.width = r*2 + 'px';
77
+ slidesHolder.current.style.height = r/2 + 'px';
78
+ slidesRepositioning(r / 2);
79
+
80
+ slidesSize = Math.min(2 * radius * slideSize, stepAngle * radius * (1 - slideSize) - 50);
81
+
82
+ for (let i = 0; i < slides.length; i++) {
83
+ slides[i].style.width = slides[i].style.height = slidesSize + 'px';
84
+ };
85
+
86
+ }
87
+
88
+ const sliderResize = debounce(() => {
89
+ const sliderSize = 1;
90
+
91
+ let radius,
92
+ w = slider?.current ? slider?.current?.getBoundingClientRect().width : 0,
93
+ h = slider?.current ? slider?.current.getBoundingClientRect().height : 0;
94
+
95
+ 2 * h <= w ? radius = h * sliderSize : radius = (w / 2) * sliderSize;
96
+
97
+ setSize(Math.round(radius));
98
+ }, 250)
99
+
100
+ const addStyle = () => {
101
+ setTimeout(() => {
102
+ contentHolder?.current?.classList.add('active');
103
+ slides[currentSlide].classList.add('active');
104
+ }, 400);
105
+ };
106
+ const removeStyle = () => {
107
+ contentHolder?.current?.classList.remove('active');
108
+ const prevElement = slides[currentSlide];
109
+ setTimeout(() => {
110
+ content && setSlideContent(content[currentSlide] as any)
111
+ prevElement.classList.remove('active');
112
+ }, 400);
113
+ };
114
+
115
+ const rotateSlider = (e) => {
116
+ const newSlide = slides.indexOf(e.target);
117
+
118
+ if (currentSlide === newSlide || !slidesHolder?.current) return;
119
+
120
+ removeStyle();
121
+
122
+ let multiplier = 0;
123
+ let direction = "";
124
+
125
+ if (currentSlide === 0 && newSlide === (slides.length - 1)) {
126
+ multiplier = -1;
127
+ direction = "-";
128
+ } else if (currentSlide === (slides.length - 1) && newSlide === 0) {
129
+ multiplier = 1;
130
+ direction = "+";
131
+ } else {
132
+ multiplier = newSlide - currentSlide
133
+ direction = currentSlide < newSlide ? "+" : "-";
134
+ }
135
+
136
+ const newAngle = Math.abs((stepAngle * 180 / Math.PI) * multiplier);
137
+
138
+
139
+ currentAngle = direction === "-" ? (currentAngle + newAngle) : (currentAngle - newAngle);
140
+ currentSlide = newSlide;
141
+
142
+ slidesHolder.current.style.transform = 'rotate( ' + currentAngle + 'deg )';
143
+ addStyle();
144
+ }
145
+
146
+ sliderResize();
147
+ addStyle();
148
+
149
+
150
+ for (let i = 0; i < slides.length; i++) {
151
+ slides[i].addEventListener('click', rotateSlider, { passive: true });
152
+ };
153
+
154
+ window.addEventListener('resize', sliderResize)
155
+
156
+ return () => {
157
+ for (let i = 0; i < slides.length; i++) {
158
+ slides[i].removeEventListener('click', rotateSlider);
159
+ };
160
+
161
+ window.removeEventListener('resize', sliderResize)
162
+ }
163
+ }, [])
164
+
165
+ if (!content) return <></>
166
+
167
+ return (
168
+ <StyledCircularSliderTeste ref={slider as any} className={className} style={style}>
169
+ <StyledCircularSliderTesteWrapper ref={wrapper as any}>
170
+ <StyledCircularSliderTesteSlides ref={slidesHolder as any}>
171
+ {content?.map((item, index) => {
172
+ return (
173
+ <StyledCircularSliderTesteSlide key={`slide-${index}`}>{item.img}</StyledCircularSliderTesteSlide>
174
+ )
175
+ })}
176
+ </StyledCircularSliderTesteSlides>
177
+ </StyledCircularSliderTesteWrapper>
178
+ <StyledCircularSliderTesteContent ref={contentHolder as any}>
179
+ <div className='mb-4'>
180
+ <Heading tag="span" size="h2" className='color-primary50 fw-bold'>{slideContent?.name}</Heading>
181
+ <Heading tag="span" size="h4" className='color-secondary50'>{slideContent?.role}</Heading>
182
+ </div>
183
+ {cta}
184
+ </StyledCircularSliderTesteContent>
185
+ </StyledCircularSliderTeste>
186
+
187
+ )
188
+ }
189
+
190
+ export default CircularSliderTeste
@@ -0,0 +1,13 @@
1
+ import { CSSProperties } from 'react';
2
+
3
+ export type ICircularSliderTeste = {
4
+ id?: string;
5
+ className?: string;
6
+ style?: CSSProperties;
7
+ content?: {
8
+ name?: string,
9
+ role?: string,
10
+ img?: React.ReactNode
11
+ }[],
12
+ cta?: React.ReactNode
13
+ }
@@ -0,0 +1,134 @@
1
+ import type { Meta, StoryObj } from '@storybook/react'
2
+
3
+ import Button from '@/components/atoms/Button/Button.component'
4
+ import CircularSliderTeste from './CircularSliderTeste.component'
5
+ import { ICircularSliderTeste } from './CircularSliderTeste.interface'
6
+ import React from 'react'
7
+
8
+ // More on default export: https://storybook.js.org/docs/react/writing-stories/introduction#default-export
9
+ export default {
10
+ title: 'Components/CircularSliderTeste',
11
+ component: CircularSliderTeste,
12
+ tags: ['autodocs']
13
+ } as Meta
14
+
15
+ const image = (
16
+ <img
17
+ width="100%"
18
+ height="100%"
19
+ sizes="100vw"
20
+ decoding="async"
21
+ src="/assets/placeholder.png"
22
+ alt="Empty state"
23
+ />
24
+ )
25
+
26
+ export const Simple: StoryObj<ICircularSliderTeste> = {
27
+ render: args => <div style={{ width: "100%", height: "200dvh" }}><CircularSliderTeste {...args}></CircularSliderTeste></div>,
28
+ args: {
29
+ cta: <Button variant={'secondary'}>Join the Team</Button>,
30
+ content: [
31
+ {
32
+ name: 'My name 1',
33
+ role: 'My role',
34
+ img: image
35
+ },
36
+ {
37
+ name: 'My name 2',
38
+ role: 'My role',
39
+ img: image
40
+ },
41
+ {
42
+ name: 'My name 3',
43
+ role: 'My role',
44
+ img: image
45
+ },
46
+ {
47
+ name: 'My name 4',
48
+ role: 'My role',
49
+ img: image
50
+ },
51
+ {
52
+ name: 'My name 5',
53
+ role: 'My role',
54
+ img: image
55
+ },
56
+ {
57
+ name: 'My name 6',
58
+ role: 'My role',
59
+ img: image
60
+ },
61
+ {
62
+ name: 'My name 7',
63
+ role: 'My role',
64
+ img: image
65
+ },
66
+ {
67
+ name: 'My name 9',
68
+ role: 'My role',
69
+ img: image
70
+ },
71
+ {
72
+ name: 'My name 9',
73
+ role: 'My role',
74
+ img: image
75
+ },
76
+ {
77
+ name: 'My name 10',
78
+ role: 'My role',
79
+ img: image
80
+ },
81
+ {
82
+ name: 'My name 11',
83
+ role: 'My role',
84
+ img: image
85
+ },
86
+ {
87
+ name: 'My name 1§2',
88
+ role: 'My role',
89
+ img: image
90
+ },
91
+ {
92
+ name: 'My name 13',
93
+ role: 'My role',
94
+ img: image
95
+ },
96
+ {
97
+ name: 'My name 14',
98
+ role: 'My role',
99
+ img: image
100
+ },
101
+ {
102
+ name: 'My name 15',
103
+ role: 'My role',
104
+ img: image
105
+ },
106
+ {
107
+ name: 'My name 16',
108
+ role: 'My role',
109
+ img: image
110
+ },
111
+ {
112
+ name: 'My name 17',
113
+ role: 'My role',
114
+ img: image
115
+ },
116
+ {
117
+ name: 'My name 19',
118
+ role: 'My role',
119
+ img: image
120
+ },
121
+ {
122
+ name: 'My name 19',
123
+ role: 'My role',
124
+ img: image
125
+ },
126
+ {
127
+ name: 'My name 20',
128
+ role: 'My role',
129
+ img: image
130
+ }
131
+ ],
132
+ className: "h-100",
133
+ }
134
+ }