oddsgate-ds 1.0.122 → 1.0.124
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 +1 -1
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/types/components/atoms/CardMarquee/CardMarquee.component.d.ts +4 -0
- package/dist/cjs/types/components/atoms/CardMarquee/CardMarquee.interface.d.ts +13 -0
- package/dist/cjs/types/components/atoms/CardMarquee/CardMarquee.theme.d.ts +3 -0
- package/dist/cjs/types/components/atoms/CardMarquee/index.d.ts +1 -0
- package/dist/cjs/types/components/atoms/Marquee/Marquee.component.d.ts +1 -1
- package/dist/cjs/types/components/atoms/Marquee/Marquee.interface.d.ts +5 -11
- package/dist/cjs/types/index.d.ts +1 -0
- package/dist/esm/index.js +5 -5
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/types/components/atoms/CardMarquee/CardMarquee.component.d.ts +4 -0
- package/dist/esm/types/components/atoms/CardMarquee/CardMarquee.interface.d.ts +13 -0
- package/dist/esm/types/components/atoms/CardMarquee/CardMarquee.theme.d.ts +3 -0
- package/dist/esm/types/components/atoms/CardMarquee/index.d.ts +1 -0
- package/dist/esm/types/components/atoms/Marquee/Marquee.component.d.ts +1 -1
- package/dist/esm/types/components/atoms/Marquee/Marquee.interface.d.ts +5 -11
- package/dist/esm/types/index.d.ts +1 -0
- package/dist/types.d.ts +12 -3
- package/package.json +1 -1
- package/src/components/atoms/CardMarquee/CardMarquee.component.tsx +24 -0
- package/src/components/atoms/CardMarquee/CardMarquee.interface.ts +15 -0
- package/src/components/atoms/CardMarquee/CardMarquee.stories.tsx +21 -0
- package/src/components/atoms/CardMarquee/CardMarquee.theme.ts +48 -0
- package/src/components/atoms/CardMarquee/index.ts +1 -0
- package/src/components/atoms/Marquee/Marquee.component.tsx +7 -12
- package/src/components/atoms/Marquee/Marquee.interface.ts +5 -12
- package/src/components/atoms/Marquee/Marquee.stories.tsx +2 -3
- package/src/components/atoms/Marquee/Marquee.theme.ts +29 -35
- package/src/components/organisms/ProductsSlider/ProductsSlider.component.tsx +2 -2
- package/src/components/organisms/ProductsSlider/ProductsSlider.theme.ts +4 -1
- package/src/index.ts +1 -0
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { CSSProperties } from "styled-components";
|
|
3
|
+
export type Direction = 'left' | 'right' | 'up' | 'down';
|
|
4
|
+
export interface ICardMarquee {
|
|
5
|
+
direction?: Direction;
|
|
6
|
+
repeatContent?: number;
|
|
7
|
+
duration?: number;
|
|
8
|
+
speed?: number;
|
|
9
|
+
gap?: string;
|
|
10
|
+
className?: string;
|
|
11
|
+
style?: CSSProperties;
|
|
12
|
+
children: React.ReactNode;
|
|
13
|
+
}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { ICardMarquee } from './CardMarquee.interface';
|
|
3
|
+
export declare const StyledCardMarquee: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, ICardMarquee>> & string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './CardMarquee.component';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { IMarquee } from './Marquee.interface';
|
|
2
2
|
import React from 'react';
|
|
3
|
-
declare const Marquee: ({
|
|
3
|
+
declare const Marquee: ({ text, className, onClick, ...props }: IMarquee) => React.JSX.Element;
|
|
4
4
|
export default Marquee;
|
|
@@ -1,13 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
export interface IMarquee {
|
|
5
|
-
direction?: Direction;
|
|
6
|
-
repeatContent?: number;
|
|
7
|
-
duration?: number;
|
|
8
|
-
speed?: number;
|
|
9
|
-
gap?: string;
|
|
1
|
+
import { CSSProperties } from 'react';
|
|
2
|
+
export type IMarquee = {
|
|
3
|
+
text?: string;
|
|
10
4
|
className?: string;
|
|
11
5
|
style?: CSSProperties;
|
|
12
|
-
|
|
13
|
-
}
|
|
6
|
+
onClick?: () => void;
|
|
7
|
+
};
|
|
@@ -22,6 +22,7 @@ export { default as Counter } from './components/atoms/Counter';
|
|
|
22
22
|
export { default as ScrollingNav } from './components/atoms/ScrollingNav';
|
|
23
23
|
export { default as SocialLinks } from './components/atoms/SocialLinks';
|
|
24
24
|
export { default as Marquee } from './components/atoms/Marquee';
|
|
25
|
+
export { default as CardMarquee } from './components/atoms/CardMarquee';
|
|
25
26
|
export { default as PortalComponent } from './components/common/PortalComponent';
|
|
26
27
|
export { Accordion as Accordion } from './components/molecules/Accordion';
|
|
27
28
|
export { AccordionItem as AccordionItem } from './components/molecules/Accordion';
|
package/dist/types.d.ts
CHANGED
|
@@ -376,8 +376,17 @@ type ISocialLinks = {
|
|
|
376
376
|
|
|
377
377
|
declare const SocialLinks: ({ variant, socials, className, style, ...props }: ISocialLinks) => React__default.JSX.Element;
|
|
378
378
|
|
|
379
|
+
type IMarquee = {
|
|
380
|
+
text?: string;
|
|
381
|
+
className?: string;
|
|
382
|
+
style?: CSSProperties;
|
|
383
|
+
onClick?: () => void;
|
|
384
|
+
};
|
|
385
|
+
|
|
386
|
+
declare const Marquee: ({ text, className, onClick, ...props }: IMarquee) => React__default.JSX.Element;
|
|
387
|
+
|
|
379
388
|
type Direction = 'left' | 'right' | 'up' | 'down';
|
|
380
|
-
interface
|
|
389
|
+
interface ICardMarquee {
|
|
381
390
|
direction?: Direction;
|
|
382
391
|
repeatContent?: number;
|
|
383
392
|
duration?: number;
|
|
@@ -388,7 +397,7 @@ interface IMarquee {
|
|
|
388
397
|
children: React.ReactNode;
|
|
389
398
|
}
|
|
390
399
|
|
|
391
|
-
declare const
|
|
400
|
+
declare const CardMarquee: ({ direction, speed, repeatContent, gap, children, }: ICardMarquee) => React__default.JSX.Element;
|
|
392
401
|
|
|
393
402
|
type PortalComponentProps = {
|
|
394
403
|
wrapperId: string;
|
|
@@ -667,4 +676,4 @@ declare function useMediaMatch(query?: string): boolean;
|
|
|
667
676
|
|
|
668
677
|
declare const debounce: (callback: any, wait: number) => (...args: any) => void;
|
|
669
678
|
|
|
670
|
-
export { Accordion, AccordionItem, BlogCard, Button, CareersCard, CheckRadioField, Chip, CircularSlider, CloseButton, Column, Counter, Cover, Dropdown, DropdownItem, EmptyState, EventsCard, Flex, FormField, GlobalStyles, Heading, Icon, IconBox, IconTitle, ImageWrapper, LicenseCard, Loader, LogosCard, Marquee, Modal, NewsCard, OffCanvas, PortalComponent, ProductCard, ProductsSlider, Quote, RichText, Row, ScrollingNav, Separator, ShareModal, Slider, SocialLinks, Spacer, Tabs, TeamCard, Video, VideoEmbed, clickOutSideToClose, debounce, iconsList, isTouchDevice, useMediaMatch, variables };
|
|
679
|
+
export { Accordion, AccordionItem, BlogCard, Button, CardMarquee, CareersCard, CheckRadioField, Chip, CircularSlider, CloseButton, Column, Counter, Cover, Dropdown, DropdownItem, EmptyState, EventsCard, Flex, FormField, GlobalStyles, Heading, Icon, IconBox, IconTitle, ImageWrapper, LicenseCard, Loader, LogosCard, Marquee, Modal, NewsCard, OffCanvas, PortalComponent, ProductCard, ProductsSlider, Quote, RichText, Row, ScrollingNav, Separator, ShareModal, Slider, SocialLinks, Spacer, Tabs, TeamCard, Video, VideoEmbed, clickOutSideToClose, debounce, iconsList, isTouchDevice, useMediaMatch, variables };
|
package/package.json
CHANGED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { ICardMarquee } from './CardMarquee.interface'
|
|
2
|
+
import React from 'react'
|
|
3
|
+
import { StyledCardMarquee } from './CardMarquee.theme'
|
|
4
|
+
|
|
5
|
+
const CardMarquee = ({
|
|
6
|
+
direction = 'left',
|
|
7
|
+
speed = 20,
|
|
8
|
+
repeatContent = 5,
|
|
9
|
+
gap = '0px',
|
|
10
|
+
children,
|
|
11
|
+
}: ICardMarquee) => {
|
|
12
|
+
// To ensure continuous flow, duplicate the children multiple times based on the content size and container.
|
|
13
|
+
const content = Array.from({ length: repeatContent }, () => children);
|
|
14
|
+
|
|
15
|
+
return (
|
|
16
|
+
<StyledCardMarquee direction={direction} duration={speed} gap={gap}>
|
|
17
|
+
<div>
|
|
18
|
+
{content}
|
|
19
|
+
</div>
|
|
20
|
+
</StyledCardMarquee>
|
|
21
|
+
)
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export default CardMarquee
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { CSSProperties } from "styled-components";
|
|
2
|
+
|
|
3
|
+
export type Direction = 'left' | 'right' | 'up' | 'down';
|
|
4
|
+
|
|
5
|
+
export interface ICardMarquee {
|
|
6
|
+
direction?: Direction;
|
|
7
|
+
repeatContent?: number;
|
|
8
|
+
duration?: number;
|
|
9
|
+
speed?: number;
|
|
10
|
+
gap?: string;
|
|
11
|
+
className?: string;
|
|
12
|
+
style?: CSSProperties
|
|
13
|
+
children: React.ReactNode;
|
|
14
|
+
}
|
|
15
|
+
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react'
|
|
2
|
+
|
|
3
|
+
import CardMarquee from './CardMarquee.component'
|
|
4
|
+
import Heading from '@/components/atoms/Heading/Heading.component'
|
|
5
|
+
import { ICardMarquee } from './CardMarquee.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/CardMarquee',
|
|
11
|
+
component: CardMarquee,
|
|
12
|
+
argTypes: {}
|
|
13
|
+
} as Meta
|
|
14
|
+
|
|
15
|
+
export const Simple: StoryObj<ICardMarquee> = {
|
|
16
|
+
render: args => <CardMarquee {...args} />,
|
|
17
|
+
args: {
|
|
18
|
+
gap: "1rem",
|
|
19
|
+
children: <Heading>People • Sustainability • Efficiency • Innovation</Heading>
|
|
20
|
+
}
|
|
21
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { Direction, ICardMarquee } from './CardMarquee.interface';
|
|
2
|
+
import { colors, radius } from '@/styles/variables';
|
|
3
|
+
import styled, { css, keyframes } from 'styled-components';
|
|
4
|
+
|
|
5
|
+
const getAnimation = (direction?: Direction) => {
|
|
6
|
+
switch (direction) {
|
|
7
|
+
case 'up':
|
|
8
|
+
case 'down':
|
|
9
|
+
return keyframes`
|
|
10
|
+
from { transform: translateY(0); }
|
|
11
|
+
to { transform: translateY(-100%); }
|
|
12
|
+
`;
|
|
13
|
+
case 'left':
|
|
14
|
+
case 'right':
|
|
15
|
+
return keyframes`
|
|
16
|
+
from { transform: translateX(0); }
|
|
17
|
+
to { transform: translateX(-100%); }
|
|
18
|
+
`;
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
export const StyledCardMarquee = styled.div<ICardMarquee>`
|
|
23
|
+
display: flex;
|
|
24
|
+
position: relative;
|
|
25
|
+
width: 100%;
|
|
26
|
+
height: 100%;
|
|
27
|
+
overflow: hidden;
|
|
28
|
+
|
|
29
|
+
&>div{
|
|
30
|
+
display: flex;
|
|
31
|
+
${({ gap }) => css`gap: ${gap}`};
|
|
32
|
+
white-space: nowrap;
|
|
33
|
+
width: ${({ direction }) => (direction === 'left' || direction === 'right' ? '200%' : 'auto')};
|
|
34
|
+
height: ${({ direction }) => (direction === 'up' || direction === 'down' ? '200%' : 'auto')};
|
|
35
|
+
flex-direction: ${({ direction }) => (direction === 'up' || direction === 'down' ? 'column' : 'row')};
|
|
36
|
+
|
|
37
|
+
animation: ${({ direction, duration }) => css`
|
|
38
|
+
${getAnimation(direction)} ${duration}s linear infinite
|
|
39
|
+
`};
|
|
40
|
+
|
|
41
|
+
animation-play-state: running; // Ensures the animation is running by default
|
|
42
|
+
|
|
43
|
+
&:hover {
|
|
44
|
+
animation-play-state: paused; // Pauses the animation when hovered
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
`;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './CardMarquee.component'
|
|
@@ -1,21 +1,16 @@
|
|
|
1
|
+
import Heading from '../Heading/Heading.component'
|
|
1
2
|
import { IMarquee } from './Marquee.interface'
|
|
2
3
|
import React from 'react'
|
|
3
4
|
import { StyledMarquee } from './Marquee.theme'
|
|
5
|
+
import cn from 'classnames'
|
|
4
6
|
|
|
5
|
-
const Marquee = ({
|
|
6
|
-
direction = 'left',
|
|
7
|
-
speed = 20,
|
|
8
|
-
repeatContent = 5,
|
|
9
|
-
gap = '0px',
|
|
10
|
-
children,
|
|
11
|
-
}: IMarquee) => {
|
|
12
|
-
// To ensure continuous flow, duplicate the children multiple times based on the content size and container.
|
|
13
|
-
const content = Array.from({ length: repeatContent }, () => children);
|
|
14
|
-
|
|
7
|
+
const Marquee = ({ text, className, onClick, ...props }: IMarquee) => {
|
|
15
8
|
return (
|
|
16
|
-
<StyledMarquee
|
|
9
|
+
<StyledMarquee className={cn(className)} onClick={onClick} {...props}>
|
|
17
10
|
<div>
|
|
18
|
-
|
|
11
|
+
<Heading size="display" tag="span" className='fw-bold text-uppercase'>
|
|
12
|
+
{text} {text} {text}
|
|
13
|
+
</Heading>
|
|
19
14
|
</div>
|
|
20
15
|
</StyledMarquee>
|
|
21
16
|
)
|
|
@@ -1,15 +1,8 @@
|
|
|
1
|
-
import { CSSProperties } from
|
|
1
|
+
import { CSSProperties } from 'react';
|
|
2
2
|
|
|
3
|
-
export type
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
direction?: Direction;
|
|
7
|
-
repeatContent?: number;
|
|
8
|
-
duration?: number;
|
|
9
|
-
speed?: number;
|
|
10
|
-
gap?: string;
|
|
11
|
-
className?: string;
|
|
3
|
+
export type IMarquee = {
|
|
4
|
+
text?: string
|
|
5
|
+
className?: string,
|
|
12
6
|
style?: CSSProperties
|
|
13
|
-
|
|
7
|
+
onClick?: () => void
|
|
14
8
|
}
|
|
15
|
-
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import type { Meta, StoryObj } from '@storybook/react'
|
|
2
2
|
|
|
3
|
-
import Heading from '@/components/atoms/Heading/Heading.component'
|
|
4
3
|
import { IMarquee } from './Marquee.interface'
|
|
5
4
|
import Marquee from './Marquee.component'
|
|
6
5
|
import React from 'react'
|
|
@@ -9,13 +8,13 @@ import React from 'react'
|
|
|
9
8
|
export default {
|
|
10
9
|
title: 'Components/Marquee',
|
|
11
10
|
component: Marquee,
|
|
11
|
+
tags: ['autodocs'],
|
|
12
12
|
argTypes: {}
|
|
13
13
|
} as Meta
|
|
14
14
|
|
|
15
15
|
export const Simple: StoryObj<IMarquee> = {
|
|
16
16
|
render: args => <Marquee {...args} />,
|
|
17
17
|
args: {
|
|
18
|
-
|
|
19
|
-
children: <Heading>People • Sustainability • Efficiency • Innovation</Heading>
|
|
18
|
+
text: 'People • Sustainability • Efficiency • Innovation'
|
|
20
19
|
}
|
|
21
20
|
}
|
|
@@ -1,48 +1,42 @@
|
|
|
1
|
-
import { Direction, IMarquee } from './Marquee.interface';
|
|
2
1
|
import { colors, radius } from '@/styles/variables';
|
|
3
|
-
import styled, { css
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
switch (direction) {
|
|
7
|
-
case 'up':
|
|
8
|
-
case 'down':
|
|
9
|
-
return keyframes`
|
|
10
|
-
from { transform: translateY(0); }
|
|
11
|
-
to { transform: translateY(-100%); }
|
|
12
|
-
`;
|
|
13
|
-
case 'left':
|
|
14
|
-
case 'right':
|
|
15
|
-
return keyframes`
|
|
16
|
-
from { transform: translateX(0); }
|
|
17
|
-
to { transform: translateX(-100%); }
|
|
18
|
-
`;
|
|
19
|
-
}
|
|
20
|
-
};
|
|
2
|
+
import styled, { css } from 'styled-components';
|
|
3
|
+
|
|
4
|
+
import { IMarquee } from './Marquee.interface';
|
|
21
5
|
|
|
22
6
|
export const StyledMarquee = styled.div<IMarquee>`
|
|
23
|
-
display: flex;
|
|
24
7
|
position: relative;
|
|
8
|
+
top: 0;
|
|
9
|
+
left: 0;
|
|
25
10
|
width: 100%;
|
|
26
|
-
|
|
27
|
-
|
|
11
|
+
contain: paint;
|
|
12
|
+
pointer-events: none;
|
|
13
|
+
|
|
14
|
+
--offset: 20vw;
|
|
15
|
+
--move-initial: calc(-25% + var(--offset));
|
|
16
|
+
--move-final: calc(-50% + var(--offset));
|
|
17
|
+
|
|
18
|
+
color: ${colors.white};
|
|
19
|
+
background-color: ${colors.primary70};
|
|
20
|
+
border-radius: ${radius.md};
|
|
21
|
+
|
|
22
|
+
padding: 8px 0;
|
|
28
23
|
|
|
29
|
-
|
|
24
|
+
& > div{
|
|
25
|
+
position: relative;
|
|
30
26
|
display: flex;
|
|
31
|
-
|
|
27
|
+
width: fit-content;
|
|
32
28
|
white-space: nowrap;
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
animation: ${({ direction, duration }) => css`
|
|
38
|
-
${getAnimation(direction)} ${duration}s linear infinite
|
|
39
|
-
`};
|
|
29
|
+
transform: translate3d(var(--move-initial), 0, 0);
|
|
30
|
+
animation: marquee 5s linear infinite;
|
|
31
|
+
}
|
|
40
32
|
|
|
41
|
-
|
|
33
|
+
@keyframes marquee {
|
|
34
|
+
0% {
|
|
35
|
+
transform: translate3d(var(--move-initial), 0, 0);
|
|
36
|
+
}
|
|
42
37
|
|
|
43
|
-
|
|
44
|
-
|
|
38
|
+
100% {
|
|
39
|
+
transform: translate3d(var(--move-final), 0, 0);
|
|
45
40
|
}
|
|
46
41
|
}
|
|
47
|
-
|
|
48
42
|
`;
|
|
@@ -72,7 +72,7 @@ const ProductsSlider = ({
|
|
|
72
72
|
|
|
73
73
|
wrapper.current.style.width = 2 * radius + 'px';
|
|
74
74
|
// wrapper.current.style.height = 2 * radius + 'px';
|
|
75
|
-
wrapper.current.style.height = '
|
|
75
|
+
wrapper.current.style.height = '880px';
|
|
76
76
|
|
|
77
77
|
let r = 2 * radius * (1 - slideSize);
|
|
78
78
|
slidesHolder.current.style.width = r + 'px'
|
|
@@ -200,7 +200,7 @@ const ProductsSlider = ({
|
|
|
200
200
|
</StyledProductsSliderSlides>
|
|
201
201
|
</StyledProductsSliderWrapper>
|
|
202
202
|
{!isMobile && (
|
|
203
|
-
<StyledProductsSliderContent ref={contentHolder as any}
|
|
203
|
+
<StyledProductsSliderContent ref={contentHolder as any}>
|
|
204
204
|
<Heading tag="h5" size="h5">
|
|
205
205
|
<strong>{activeElement?.title}</strong>
|
|
206
206
|
<br />
|
|
@@ -64,11 +64,14 @@ export const StyledProductsSliderSlide = styled.div<IProductsSlider>`
|
|
|
64
64
|
|
|
65
65
|
|
|
66
66
|
export const StyledProductsSliderContent = styled.div<IProductsSlider>`
|
|
67
|
+
position: absolute;
|
|
68
|
+
bottom: 0%;
|
|
69
|
+
left: 50%;
|
|
67
70
|
max-width: 50rem;
|
|
68
71
|
background: ${colors.third10};
|
|
69
72
|
border-radius: ${radius.md};
|
|
70
73
|
padding: 2rem;
|
|
71
74
|
margin: auto;
|
|
72
|
-
transform:
|
|
75
|
+
transform: translateX(-50%);
|
|
73
76
|
`;
|
|
74
77
|
|
package/src/index.ts
CHANGED
|
@@ -24,6 +24,7 @@ export { default as Counter } from './components/atoms/Counter'
|
|
|
24
24
|
export { default as ScrollingNav } from './components/atoms/ScrollingNav'
|
|
25
25
|
export { default as SocialLinks } from './components/atoms/SocialLinks'
|
|
26
26
|
export { default as Marquee } from './components/atoms/Marquee'
|
|
27
|
+
export { default as CardMarquee } from './components/atoms/CardMarquee'
|
|
27
28
|
|
|
28
29
|
//common
|
|
29
30
|
export { default as PortalComponent } from './components/common/PortalComponent'
|