oddsgate-ds 1.0.20 → 1.0.21
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 +5 -5
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/types/components/atoms/Counter/Counter.component.d.ts +4 -0
- package/dist/cjs/types/components/atoms/Counter/Counter.interface.d.ts +9 -0
- package/dist/cjs/types/components/atoms/Counter/Counter.stories.d.ts +5 -0
- package/dist/cjs/types/components/atoms/Counter/Counter.theme.d.ts +3 -0
- package/dist/cjs/types/components/atoms/Counter/index.d.ts +1 -0
- package/dist/cjs/types/components/molecules/LogosCard/LogosCard.component.d.ts +4 -0
- package/dist/cjs/types/components/molecules/LogosCard/LogosCard.interface.d.ts +7 -0
- package/dist/cjs/types/components/molecules/LogosCard/LogosCard.stories.d.ts +5 -0
- package/dist/cjs/types/components/molecules/LogosCard/LogosCard.theme.d.ts +3 -0
- package/dist/cjs/types/components/molecules/LogosCard/index.d.ts +1 -0
- package/dist/cjs/types/index.d.ts +2 -0
- package/dist/esm/index.js +5 -5
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/types/components/atoms/Counter/Counter.component.d.ts +4 -0
- package/dist/esm/types/components/atoms/Counter/Counter.interface.d.ts +9 -0
- package/dist/esm/types/components/atoms/Counter/Counter.stories.d.ts +5 -0
- package/dist/esm/types/components/atoms/Counter/Counter.theme.d.ts +3 -0
- package/dist/esm/types/components/atoms/Counter/index.d.ts +1 -0
- package/dist/esm/types/components/molecules/LogosCard/LogosCard.component.d.ts +4 -0
- package/dist/esm/types/components/molecules/LogosCard/LogosCard.interface.d.ts +7 -0
- package/dist/esm/types/components/molecules/LogosCard/LogosCard.stories.d.ts +5 -0
- package/dist/esm/types/components/molecules/LogosCard/LogosCard.theme.d.ts +3 -0
- package/dist/esm/types/components/molecules/LogosCard/index.d.ts +1 -0
- package/dist/esm/types/index.d.ts +2 -0
- package/dist/types.d.ts +21 -1
- package/package.json +1 -1
- package/src/components/atoms/Counter/Counter.component.tsx +51 -0
- package/src/components/atoms/Counter/Counter.interface.ts +10 -0
- package/src/components/atoms/Counter/Counter.stories.tsx +26 -0
- package/src/components/atoms/Counter/Counter.theme.ts +21 -0
- package/src/components/atoms/Counter/index.ts +1 -0
- package/src/components/atoms/FormField/FormField.theme.tsx +1 -0
- package/src/components/molecules/LogosCard/LogosCard.component.tsx +14 -0
- package/src/components/molecules/LogosCard/LogosCard.interface.ts +8 -0
- package/src/components/molecules/LogosCard/LogosCard.stories.tsx +38 -0
- package/src/components/molecules/LogosCard/LogosCard.theme.ts +19 -0
- package/src/components/molecules/LogosCard/index.ts +1 -0
- package/src/index.ts +2 -0
- package/src/styles/variables.ts +10 -10
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { StoryObj } from '@storybook/react';
|
|
2
|
+
import { ICounter } from './Counter.interface';
|
|
3
|
+
declare const _default: import("@storybook/types").ComponentAnnotations<import("@storybook/react").ReactRenderer, import("@storybook/types").Args>;
|
|
4
|
+
export default _default;
|
|
5
|
+
export declare const Example: StoryObj<ICounter>;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { ICounter } from './Counter.interface';
|
|
3
|
+
export declare const StyledCounter: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, ICounter>> & string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './Counter.component';
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { StoryObj } from '@storybook/react';
|
|
2
|
+
import { ILogosCard } from './LogosCard.interface';
|
|
3
|
+
declare const _default: import("@storybook/types").ComponentAnnotations<import("@storybook/react").ReactRenderer, import("@storybook/types").Args>;
|
|
4
|
+
export default _default;
|
|
5
|
+
export declare const Simple: StoryObj<ILogosCard>;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { ILogosCard } from './LogosCard.interface';
|
|
3
|
+
export declare const StyledLogosCard: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, ILogosCard>> & string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from "./LogosCard.component";
|
|
@@ -18,6 +18,7 @@ export { default as CheckRadioField } from './components/atoms/FormField/CheckRa
|
|
|
18
18
|
export { default as Loader } from './components/atoms/Loader';
|
|
19
19
|
export { default as EmptyState } from './components/atoms/EmptyState';
|
|
20
20
|
export { default as CloseButton } from './components/atoms/CloseButton';
|
|
21
|
+
export { default as Counter } from './components/atoms/Counter';
|
|
21
22
|
export { default as ScrollingNav } from './components/atoms/ScrollingNav';
|
|
22
23
|
export { default as SocialLinks } from './components/atoms/SocialLinks';
|
|
23
24
|
export { default as Marquee } from './components/atoms/Marquee';
|
|
@@ -33,6 +34,7 @@ export { default as IconBox } from './components/molecules/IconBox';
|
|
|
33
34
|
export { default as IconTitle } from './components/molecules/IconTitle';
|
|
34
35
|
export { default as BlogCard } from './components/molecules/BlogCard';
|
|
35
36
|
export { default as TeamCard } from './components/molecules/TeamCard';
|
|
37
|
+
export { default as LogosCard } from './components/molecules/LogosCard';
|
|
36
38
|
export { default as ProjectCard } from './components/molecules/ProjectCard';
|
|
37
39
|
export { default as Slider } from './components/organisms/Slider';
|
|
38
40
|
export { default as Cover } from './components/organisms/Cover';
|
package/dist/types.d.ts
CHANGED
|
@@ -333,6 +333,17 @@ type ICloseButton = {
|
|
|
333
333
|
|
|
334
334
|
declare const CloseButton: ({ variant, className, onClick, ...props }: ICloseButton) => React__default.JSX.Element;
|
|
335
335
|
|
|
336
|
+
interface ICounter {
|
|
337
|
+
title?: string;
|
|
338
|
+
number?: number;
|
|
339
|
+
prefix?: string;
|
|
340
|
+
suffix?: string;
|
|
341
|
+
className?: string;
|
|
342
|
+
style?: CSSProperties;
|
|
343
|
+
}
|
|
344
|
+
|
|
345
|
+
declare const Counter: ({ title, number, prefix, suffix, className, style, }: ICounter) => React__default.JSX.Element;
|
|
346
|
+
|
|
336
347
|
interface IScrollingNav {
|
|
337
348
|
align?: string;
|
|
338
349
|
className?: string;
|
|
@@ -491,6 +502,15 @@ interface ITeamCard extends ICard {
|
|
|
491
502
|
|
|
492
503
|
declare const TeamCard: ({ title, imageElement, role, description, ...props }: ITeamCard) => React__default.JSX.Element;
|
|
493
504
|
|
|
505
|
+
interface ILogosCard {
|
|
506
|
+
imageElement?: React.ReactElement;
|
|
507
|
+
title?: string;
|
|
508
|
+
className?: string;
|
|
509
|
+
style?: CSSProperties;
|
|
510
|
+
}
|
|
511
|
+
|
|
512
|
+
declare const LogosCard: ({ imageElement, title, className, style, ...props }: ILogosCard) => React__default.JSX.Element;
|
|
513
|
+
|
|
494
514
|
interface IProjectCard extends ICard {
|
|
495
515
|
category?: string;
|
|
496
516
|
title?: string;
|
|
@@ -552,4 +572,4 @@ declare const GlobalStyles: React$1.NamedExoticComponent<styled_components.Execu
|
|
|
552
572
|
|
|
553
573
|
declare function clickOutSideToClose(ref: React.RefObject<HTMLDivElement>, closeFunction: () => void): void;
|
|
554
574
|
|
|
555
|
-
export { Accordion, AccordionItem, BlogCard, Button, CheckRadioField, Chip, CircularSlider, CloseButton, Column, Cover, Dropdown, DropdownItem, EmptyState, Flex, FormField, GlobalStyles, Heading, Icon, IconBox, IconTitle, ImageWrapper, Loader, Marquee, Modal, OffCanvas, PortalComponent, ProjectCard, Quote, RichText, Row, ScrollingNav, Separator, ShareModal, Slider, SocialLinks, Spacer, TeamCard, Video, VideoEmbed, clickOutSideToClose, iconsList, variables };
|
|
575
|
+
export { Accordion, AccordionItem, BlogCard, Button, CheckRadioField, Chip, CircularSlider, CloseButton, Column, Counter, Cover, Dropdown, DropdownItem, EmptyState, Flex, FormField, GlobalStyles, Heading, Icon, IconBox, IconTitle, ImageWrapper, Loader, LogosCard, Marquee, Modal, OffCanvas, PortalComponent, ProjectCard, Quote, RichText, Row, ScrollingNav, Separator, ShareModal, Slider, SocialLinks, Spacer, TeamCard, Video, VideoEmbed, clickOutSideToClose, iconsList, variables };
|
package/package.json
CHANGED
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import React, { useCallback, useEffect, useRef, useState } from 'react'
|
|
2
|
+
|
|
3
|
+
import Heading from '../Heading/Heading.component'
|
|
4
|
+
import { ICounter } from './Counter.interface'
|
|
5
|
+
import { StyledCounter } from '@/components/atoms/Counter/Counter.theme'
|
|
6
|
+
|
|
7
|
+
const Counter = ({
|
|
8
|
+
title,
|
|
9
|
+
number,
|
|
10
|
+
prefix,
|
|
11
|
+
suffix,
|
|
12
|
+
className,
|
|
13
|
+
style,
|
|
14
|
+
}: ICounter) => {
|
|
15
|
+
if (!number) return <></>;
|
|
16
|
+
|
|
17
|
+
const counter = useRef<HTMLDivElement>();
|
|
18
|
+
let timeout;
|
|
19
|
+
|
|
20
|
+
let counterValue = 0;
|
|
21
|
+
|
|
22
|
+
const speed = 200;
|
|
23
|
+
|
|
24
|
+
// const increment = Math.trunc(number / speed) < 1 ? 1 : Math.trunc(number / speed);
|
|
25
|
+
const increment = 2;
|
|
26
|
+
|
|
27
|
+
timeout = setInterval(() => {
|
|
28
|
+
counterValue = counterValue + increment;
|
|
29
|
+
|
|
30
|
+
if (counterValue > number) {
|
|
31
|
+
counterValue = number;
|
|
32
|
+
clearTimeout(timeout);
|
|
33
|
+
}
|
|
34
|
+
}, increment * 1000);
|
|
35
|
+
|
|
36
|
+
return (
|
|
37
|
+
<StyledCounter
|
|
38
|
+
className={className}
|
|
39
|
+
style={style}
|
|
40
|
+
>
|
|
41
|
+
<Heading tag="span" size="h1" className='d-flex align-items-center color-primary50'>
|
|
42
|
+
{prefix && prefix}
|
|
43
|
+
<span>{counterValue}</span>
|
|
44
|
+
{suffix && suffix}
|
|
45
|
+
</Heading>
|
|
46
|
+
{title && <Heading tag="span" size="h5" className='color-secondary50 fw-bold'>{title}</Heading>}
|
|
47
|
+
</StyledCounter>
|
|
48
|
+
)
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
export default Counter
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react'
|
|
2
|
+
|
|
3
|
+
import Counter from './Counter.component'
|
|
4
|
+
import { ICounter } from './Counter.interface'
|
|
5
|
+
import React from 'react'
|
|
6
|
+
|
|
7
|
+
// More on default export: https://storybook.js.org/docs/react/writing-stories/introduction#default-export
|
|
8
|
+
export default {
|
|
9
|
+
title: 'Components/Counter',
|
|
10
|
+
component: Counter,
|
|
11
|
+
tags: ['autodocs'],
|
|
12
|
+
// More on argTypes: https://storybook.js.org/docs/react/api/argtypes
|
|
13
|
+
argTypes: {}
|
|
14
|
+
} as Meta
|
|
15
|
+
|
|
16
|
+
export const Example: StoryObj<ICounter> = {
|
|
17
|
+
render: args => (
|
|
18
|
+
<Counter {...args}></Counter>
|
|
19
|
+
),
|
|
20
|
+
args: {
|
|
21
|
+
title: "lorem ipsum",
|
|
22
|
+
number: 30,
|
|
23
|
+
prefix: "+",
|
|
24
|
+
suffix: "%",
|
|
25
|
+
}
|
|
26
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import styled, { css } from 'styled-components';
|
|
2
|
+
|
|
3
|
+
import { ICounter } from './Counter.interface';
|
|
4
|
+
import { colors } from '@/styles/variables';
|
|
5
|
+
|
|
6
|
+
export const StyledCounter = styled.div<ICounter>`
|
|
7
|
+
display: inline-flex;
|
|
8
|
+
vertical-align: top;
|
|
9
|
+
flex-flow: column;
|
|
10
|
+
justify-content: center;
|
|
11
|
+
align-items: center;
|
|
12
|
+
|
|
13
|
+
min-width: 20rem;
|
|
14
|
+
min-height: 20rem;
|
|
15
|
+
|
|
16
|
+
padding: 8px 22px;
|
|
17
|
+
border-radius: 100%;
|
|
18
|
+
text-align: center;
|
|
19
|
+
|
|
20
|
+
background-color: ${colors.third50};
|
|
21
|
+
`;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './Counter.component'
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { ILogosCard } from './LogosCard.interface'
|
|
2
|
+
import ImageWrapper from '@/components/atoms/ImageWrapper/ImageWrapper.component'
|
|
3
|
+
import React from 'react'
|
|
4
|
+
import { StyledLogosCard } from './LogosCard.theme'
|
|
5
|
+
|
|
6
|
+
const LogosCard = ({ imageElement, title, className, style, ...props }: ILogosCard) => {
|
|
7
|
+
return (
|
|
8
|
+
<StyledLogosCard className={className} style={style}>
|
|
9
|
+
{imageElement}
|
|
10
|
+
</StyledLogosCard>
|
|
11
|
+
)
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export default LogosCard
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react'
|
|
2
|
+
|
|
3
|
+
import { ILogosCard } from './LogosCard.interface';
|
|
4
|
+
import LogosCard from './LogosCard.component';
|
|
5
|
+
import React from 'react';
|
|
6
|
+
|
|
7
|
+
// More on default export: https://storybook.js.org/docs/react/writing-stories/introduction#default-export
|
|
8
|
+
export default {
|
|
9
|
+
title: 'Components/LogosCard',
|
|
10
|
+
component: LogosCard
|
|
11
|
+
} as Meta
|
|
12
|
+
|
|
13
|
+
const image = (
|
|
14
|
+
<img
|
|
15
|
+
width="100%"
|
|
16
|
+
height="100%"
|
|
17
|
+
sizes="100vw"
|
|
18
|
+
decoding="async"
|
|
19
|
+
src="/assets/placeholder.png"
|
|
20
|
+
alt="Empty state"
|
|
21
|
+
/>
|
|
22
|
+
)
|
|
23
|
+
|
|
24
|
+
export const Simple: StoryObj<ILogosCard> = {
|
|
25
|
+
render: args => (
|
|
26
|
+
<>
|
|
27
|
+
<LogosCard {...args}></LogosCard>
|
|
28
|
+
<LogosCard {...args}></LogosCard>
|
|
29
|
+
<LogosCard {...args}></LogosCard>
|
|
30
|
+
<LogosCard {...args}></LogosCard>
|
|
31
|
+
<LogosCard {...args}></LogosCard>
|
|
32
|
+
</>
|
|
33
|
+
),
|
|
34
|
+
args: {
|
|
35
|
+
imageElement: image,
|
|
36
|
+
title: "Logo Teste",
|
|
37
|
+
}
|
|
38
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { colors, radius, shadows, spaces } from '@/styles/variables';
|
|
2
|
+
import styled, { css } from 'styled-components';
|
|
3
|
+
|
|
4
|
+
import { ILogosCard } from './LogosCard.interface';
|
|
5
|
+
|
|
6
|
+
export const StyledLogosCard = styled.div<ILogosCard>`
|
|
7
|
+
display: inline-flex;
|
|
8
|
+
vertical-align: middle;
|
|
9
|
+
width: 100%;
|
|
10
|
+
max-width: 160px;
|
|
11
|
+
|
|
12
|
+
overflow: hidden;
|
|
13
|
+
margin: ${spaces[2]} ${spaces[3]};
|
|
14
|
+
|
|
15
|
+
& img{
|
|
16
|
+
object-fit: contain;
|
|
17
|
+
aspect-ratio: 18/2;
|
|
18
|
+
}
|
|
19
|
+
`;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from "./LogosCard.component";
|
package/src/index.ts
CHANGED
|
@@ -20,6 +20,7 @@ export { default as CheckRadioField } from './components/atoms/FormField/CheckRa
|
|
|
20
20
|
export { default as Loader } from './components/atoms/Loader'
|
|
21
21
|
export { default as EmptyState } from './components/atoms/EmptyState'
|
|
22
22
|
export { default as CloseButton } from './components/atoms/CloseButton'
|
|
23
|
+
export { default as Counter } from './components/atoms/Counter'
|
|
23
24
|
export { default as ScrollingNav } from './components/atoms/ScrollingNav'
|
|
24
25
|
export { default as SocialLinks } from './components/atoms/SocialLinks'
|
|
25
26
|
export { default as Marquee } from './components/atoms/Marquee'
|
|
@@ -39,6 +40,7 @@ export { default as IconBox } from './components/molecules/IconBox'
|
|
|
39
40
|
export { default as IconTitle } from './components/molecules/IconTitle'
|
|
40
41
|
export { default as BlogCard } from './components/molecules/BlogCard'
|
|
41
42
|
export { default as TeamCard } from './components/molecules/TeamCard'
|
|
43
|
+
export { default as LogosCard } from './components/molecules/LogosCard'
|
|
42
44
|
export { default as ProjectCard } from './components/molecules/ProjectCard'
|
|
43
45
|
// //organisms
|
|
44
46
|
export { default as Slider } from './components/organisms/Slider'
|
package/src/styles/variables.ts
CHANGED
|
@@ -84,22 +84,22 @@ export const spacesNegative = <Record<string, string>>{
|
|
|
84
84
|
export const typography = <Record<string, Record<string, unknown>>>{
|
|
85
85
|
display: {
|
|
86
86
|
size: pxToRem(250),
|
|
87
|
-
sizeMob: pxToRem(
|
|
87
|
+
sizeMob: pxToRem(64),
|
|
88
88
|
height: 1.2,
|
|
89
89
|
},
|
|
90
90
|
h1: {
|
|
91
91
|
size: pxToRem(120),
|
|
92
|
-
sizeMob: pxToRem(
|
|
92
|
+
sizeMob: pxToRem(48),
|
|
93
93
|
height: 1.2,
|
|
94
94
|
},
|
|
95
95
|
h2: {
|
|
96
96
|
size: pxToRem(80),
|
|
97
|
-
sizeMob: pxToRem(
|
|
97
|
+
sizeMob: pxToRem(36),
|
|
98
98
|
height: 1.2,
|
|
99
99
|
},
|
|
100
100
|
h3: {
|
|
101
101
|
size: pxToRem(48),
|
|
102
|
-
sizeMob: pxToRem(
|
|
102
|
+
sizeMob: pxToRem(24),
|
|
103
103
|
height: 1.2,
|
|
104
104
|
},
|
|
105
105
|
h4: {
|
|
@@ -108,8 +108,8 @@ export const typography = <Record<string, Record<string, unknown>>>{
|
|
|
108
108
|
height: 1.2,
|
|
109
109
|
},
|
|
110
110
|
h5: {
|
|
111
|
-
size: pxToRem(
|
|
112
|
-
sizeMob: pxToRem(
|
|
111
|
+
size: pxToRem(24),
|
|
112
|
+
sizeMob: pxToRem(18),
|
|
113
113
|
height: 1.4,
|
|
114
114
|
},
|
|
115
115
|
h6: {
|
|
@@ -118,13 +118,13 @@ export const typography = <Record<string, Record<string, unknown>>>{
|
|
|
118
118
|
height: 1.4,
|
|
119
119
|
},
|
|
120
120
|
texts: {
|
|
121
|
-
size: "
|
|
122
|
-
sizeMob: "
|
|
121
|
+
size: "18px",
|
|
122
|
+
sizeMob: "16px",
|
|
123
123
|
height: 1.6,
|
|
124
124
|
},
|
|
125
125
|
captions: {
|
|
126
|
-
size: "
|
|
127
|
-
sizeMob: "
|
|
126
|
+
size: "16px",
|
|
127
|
+
sizeMob: "13px",
|
|
128
128
|
height: 1.2,
|
|
129
129
|
},
|
|
130
130
|
};
|