oddsgate-ds 1.0.123 → 1.0.125

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 (30) hide show
  1. package/dist/cjs/index.js +1 -1
  2. package/dist/cjs/index.js.map +1 -1
  3. package/dist/cjs/types/components/atoms/CardMarquee/CardMarquee.component.d.ts +4 -0
  4. package/dist/cjs/types/components/atoms/CardMarquee/CardMarquee.interface.d.ts +13 -0
  5. package/dist/cjs/types/components/atoms/CardMarquee/CardMarquee.theme.d.ts +3 -0
  6. package/dist/cjs/types/components/atoms/CardMarquee/index.d.ts +1 -0
  7. package/dist/cjs/types/components/atoms/Marquee/Marquee.component.d.ts +1 -1
  8. package/dist/cjs/types/components/atoms/Marquee/Marquee.interface.d.ts +5 -11
  9. package/dist/cjs/types/index.d.ts +1 -0
  10. package/dist/esm/index.js +5 -5
  11. package/dist/esm/index.js.map +1 -1
  12. package/dist/esm/types/components/atoms/CardMarquee/CardMarquee.component.d.ts +4 -0
  13. package/dist/esm/types/components/atoms/CardMarquee/CardMarquee.interface.d.ts +13 -0
  14. package/dist/esm/types/components/atoms/CardMarquee/CardMarquee.theme.d.ts +3 -0
  15. package/dist/esm/types/components/atoms/CardMarquee/index.d.ts +1 -0
  16. package/dist/esm/types/components/atoms/Marquee/Marquee.component.d.ts +1 -1
  17. package/dist/esm/types/components/atoms/Marquee/Marquee.interface.d.ts +5 -11
  18. package/dist/esm/types/index.d.ts +1 -0
  19. package/dist/types.d.ts +12 -3
  20. package/package.json +1 -1
  21. package/src/components/atoms/CardMarquee/CardMarquee.component.tsx +24 -0
  22. package/src/components/atoms/CardMarquee/CardMarquee.interface.ts +15 -0
  23. package/src/components/atoms/CardMarquee/CardMarquee.stories.tsx +21 -0
  24. package/src/components/atoms/CardMarquee/CardMarquee.theme.ts +48 -0
  25. package/src/components/atoms/CardMarquee/index.ts +1 -0
  26. package/src/components/atoms/Marquee/Marquee.component.tsx +7 -12
  27. package/src/components/atoms/Marquee/Marquee.interface.ts +5 -12
  28. package/src/components/atoms/Marquee/Marquee.stories.tsx +2 -3
  29. package/src/components/atoms/Marquee/Marquee.theme.ts +27 -35
  30. package/src/index.ts +1 -0
@@ -0,0 +1,4 @@
1
+ import { ICardMarquee } from './CardMarquee.interface';
2
+ import React from 'react';
3
+ declare const CardMarquee: ({ direction, speed, repeatContent, gap, children, }: ICardMarquee) => React.JSX.Element;
4
+ export default CardMarquee;
@@ -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: ({ direction, speed, repeatContent, gap, children, }: IMarquee) => React.JSX.Element;
3
+ declare const Marquee: ({ text, className, onClick, ...props }: IMarquee) => React.JSX.Element;
4
4
  export default Marquee;
@@ -1,13 +1,7 @@
1
- /// <reference types="react" />
2
- import { CSSProperties } from "styled-components";
3
- export type Direction = 'left' | 'right' | 'up' | 'down';
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
- children: React.ReactNode;
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 IMarquee {
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 Marquee: ({ direction, speed, repeatContent, gap, children, }: IMarquee) => React__default.JSX.Element;
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "oddsgate-ds",
3
- "version": "1.0.123",
3
+ "version": "1.0.125",
4
4
  "description": "Miew theme component library",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.js",
@@ -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 direction={direction} duration={speed} gap={gap}>
9
+ <StyledMarquee className={cn(className)} onClick={onClick} {...props}>
17
10
  <div>
18
- {content}
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 "styled-components";
1
+ import { CSSProperties } from 'react';
2
2
 
3
- export type Direction = 'left' | 'right' | 'up' | 'down';
4
-
5
- export interface IMarquee {
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
- children: React.ReactNode;
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
- gap: "1rem",
19
- children: <Heading>People • Sustainability • Efficiency • Innovation</Heading>
18
+ text: 'People • Sustainability • Efficiency • Innovation'
20
19
  }
21
20
  }
@@ -1,48 +1,40 @@
1
- import { Direction, IMarquee } from './Marquee.interface';
2
1
  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
- };
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
- height: 100%;
27
- overflow: hidden;
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.primary50};
19
+
20
+ padding: 8px 0;
28
21
 
29
- &>div{
22
+ & > div{
23
+ position: relative;
30
24
  display: flex;
31
- ${({ gap }) => css`gap: ${gap}`};
25
+ width: fit-content;
32
26
  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
- `};
27
+ transform: translate3d(var(--move-initial), 0, 0);
28
+ animation: marquee 15s linear infinite;
29
+ }
40
30
 
41
- animation-play-state: running; // Ensures the animation is running by default
31
+ @keyframes marquee {
32
+ 0% {
33
+ transform: translate3d(var(--move-initial), 0, 0);
34
+ }
42
35
 
43
- &:hover {
44
- animation-play-state: paused; // Pauses the animation when hovered
36
+ 100% {
37
+ transform: translate3d(var(--move-final), 0, 0);
45
38
  }
46
39
  }
47
-
48
40
  `;
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'