oddsgate-ds 1.0.21 → 1.0.22
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 +3 -3
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/types/components/organisms/Tabs/Tabs.component.d.ts +4 -0
- package/dist/cjs/types/components/organisms/Tabs/Tabs.interface.d.ts +16 -0
- package/dist/cjs/types/components/organisms/Tabs/Tabs.stories.d.ts +5 -0
- package/dist/cjs/types/components/organisms/Tabs/Tabs.theme.d.ts +6 -0
- package/dist/cjs/types/components/organisms/Tabs/index.d.ts +1 -0
- package/dist/cjs/types/helpers/useInterval.d.ts +1 -0
- package/dist/cjs/types/index.d.ts +1 -0
- package/dist/cjs/types/styles/variables.d.ts +2 -2
- package/dist/esm/index.js +3 -3
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/types/components/organisms/Tabs/Tabs.component.d.ts +4 -0
- package/dist/esm/types/components/organisms/Tabs/Tabs.interface.d.ts +16 -0
- package/dist/esm/types/components/organisms/Tabs/Tabs.stories.d.ts +5 -0
- package/dist/esm/types/components/organisms/Tabs/Tabs.theme.d.ts +6 -0
- package/dist/esm/types/components/organisms/Tabs/index.d.ts +1 -0
- package/dist/esm/types/helpers/useInterval.d.ts +1 -0
- package/dist/esm/types/index.d.ts +1 -0
- package/dist/esm/types/styles/variables.d.ts +2 -2
- package/dist/types.d.ts +21 -3
- package/package.json +1 -1
- package/src/components/atoms/Button/Button.theme.ts +1 -1
- package/src/components/atoms/Counter/Counter.component.tsx +15 -16
- package/src/components/atoms/Counter/Counter.theme.ts +1 -1
- package/src/components/atoms/FormField/CheckRadioField/CheckRadioField.theme.ts +8 -0
- package/src/components/atoms/FormField/FormField.theme.tsx +0 -23
- package/src/components/atoms/SocialLinks/SocialLinks.theme.ts +14 -0
- package/src/components/organisms/Tabs/Tabs.component.tsx +62 -0
- package/src/components/organisms/Tabs/Tabs.interface.ts +17 -0
- package/src/components/organisms/Tabs/Tabs.stories.tsx +115 -0
- package/src/components/organisms/Tabs/Tabs.theme.ts +70 -0
- package/src/components/organisms/Tabs/index.ts +1 -0
- package/src/helpers/useInterval.ts +25 -0
- package/src/index.ts +1 -0
- package/src/styles/variables.ts +3 -3
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { CSSProperties } from 'react';
|
|
2
|
+
export interface ITabs {
|
|
3
|
+
id?: string;
|
|
4
|
+
title?: string;
|
|
5
|
+
menu?: ITabsItem[];
|
|
6
|
+
vertical?: boolean;
|
|
7
|
+
className?: string;
|
|
8
|
+
style?: CSSProperties;
|
|
9
|
+
}
|
|
10
|
+
export interface ITabsItem {
|
|
11
|
+
id?: string;
|
|
12
|
+
label?: string;
|
|
13
|
+
$active?: boolean;
|
|
14
|
+
content?: React.ReactNode;
|
|
15
|
+
onClick?: (event?: React.MouseEvent<HTMLElement>) => void;
|
|
16
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { StoryObj } from '@storybook/react';
|
|
2
|
+
import { ITabs } from './Tabs.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<ITabs>;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { ITabs, ITabsItem } from './Tabs.interface';
|
|
3
|
+
export declare const StyledTabsMenu: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLUListElement>, HTMLUListElement>, ITabs>> & string;
|
|
4
|
+
export declare const StyledTabsLinks: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").AnchorHTMLAttributes<HTMLAnchorElement>, HTMLAnchorElement>, ITabsItem>> & string;
|
|
5
|
+
export declare const StyledTabsContent: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, ITabs>> & string;
|
|
6
|
+
export declare const StyledTabs: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, ITabs>> & string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './Tabs.component';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const useInterval: (callback: any, delay: any) => void;
|
|
@@ -38,6 +38,7 @@ export { default as LogosCard } from './components/molecules/LogosCard';
|
|
|
38
38
|
export { default as ProjectCard } from './components/molecules/ProjectCard';
|
|
39
39
|
export { default as Slider } from './components/organisms/Slider';
|
|
40
40
|
export { default as Cover } from './components/organisms/Cover';
|
|
41
|
+
export { default as Tabs } from './components/organisms/Tabs';
|
|
41
42
|
export { default as CircularSlider } from './components/organisms/CircularSlider';
|
|
42
43
|
export { iconsList } from './helpers/getIcons';
|
|
43
44
|
export { default as GlobalStyles } from './styles/Global';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export declare const pxToRem: (size: number) => string;
|
|
2
|
-
export declare const fontName = "
|
|
3
|
-
export declare const alternativeFont = "
|
|
2
|
+
export declare const fontName = "MD Nichrome";
|
|
3
|
+
export declare const alternativeFont = "Red Hat Display";
|
|
4
4
|
export declare const gutter: string;
|
|
5
5
|
export declare const desktop_width = "1360";
|
|
6
6
|
export declare const tablet_width = "768";
|
package/dist/types.d.ts
CHANGED
|
@@ -4,8 +4,8 @@ import { spaces as spaces$1 } from '@/styles/variables';
|
|
|
4
4
|
import * as styled_components from 'styled-components';
|
|
5
5
|
|
|
6
6
|
declare const pxToRem: (size: number) => string;
|
|
7
|
-
declare const fontName = "
|
|
8
|
-
declare const alternativeFont = "
|
|
7
|
+
declare const fontName = "MD Nichrome";
|
|
8
|
+
declare const alternativeFont = "Red Hat Display";
|
|
9
9
|
declare const gutter: string;
|
|
10
10
|
declare const desktop_width = "1360";
|
|
11
11
|
declare const tablet_width = "768";
|
|
@@ -553,6 +553,24 @@ type ICover = {
|
|
|
553
553
|
|
|
554
554
|
declare const Cover: ({ minHeight, contentPosition, imageElement, overlayOpacity, overlayColor, style, className, children }: ICover) => React__default.JSX.Element;
|
|
555
555
|
|
|
556
|
+
interface ITabs {
|
|
557
|
+
id?: string;
|
|
558
|
+
title?: string;
|
|
559
|
+
menu?: ITabsItem[];
|
|
560
|
+
vertical?: boolean;
|
|
561
|
+
className?: string;
|
|
562
|
+
style?: CSSProperties;
|
|
563
|
+
}
|
|
564
|
+
interface ITabsItem {
|
|
565
|
+
id?: string;
|
|
566
|
+
label?: string;
|
|
567
|
+
$active?: boolean;
|
|
568
|
+
content?: React.ReactNode;
|
|
569
|
+
onClick?: (event?: React.MouseEvent<HTMLElement>) => void;
|
|
570
|
+
}
|
|
571
|
+
|
|
572
|
+
declare const Tabs: ({ id, title, menu, vertical, className, style }: ITabs) => React__default.JSX.Element;
|
|
573
|
+
|
|
556
574
|
type ICircularSlider = {
|
|
557
575
|
id?: string;
|
|
558
576
|
className?: string;
|
|
@@ -572,4 +590,4 @@ declare const GlobalStyles: React$1.NamedExoticComponent<styled_components.Execu
|
|
|
572
590
|
|
|
573
591
|
declare function clickOutSideToClose(ref: React.RefObject<HTMLDivElement>, closeFunction: () => void): void;
|
|
574
592
|
|
|
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 };
|
|
593
|
+
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, Tabs, TeamCard, Video, VideoEmbed, clickOutSideToClose, iconsList, variables };
|
package/package.json
CHANGED
|
@@ -5,7 +5,6 @@ import { IButtonSC } from './Button.interface';
|
|
|
5
5
|
import { fontSize } from '@/styles/utilities';
|
|
6
6
|
|
|
7
7
|
export const StyledButton = styled.a<IButtonSC>`
|
|
8
|
-
font-family: var(--font-nichrome) !important;
|
|
9
8
|
display: inline-flex;
|
|
10
9
|
vertical-align: middle;
|
|
11
10
|
justify-content: center;
|
|
@@ -14,6 +13,7 @@ export const StyledButton = styled.a<IButtonSC>`
|
|
|
14
13
|
border: 0;
|
|
15
14
|
outline: 0;
|
|
16
15
|
background-color: transparent;
|
|
16
|
+
font-weight: 700;
|
|
17
17
|
|
|
18
18
|
margin-right: ${spaces[3]};
|
|
19
19
|
|
|
@@ -3,6 +3,7 @@ import React, { useCallback, useEffect, useRef, useState } from 'react'
|
|
|
3
3
|
import Heading from '../Heading/Heading.component'
|
|
4
4
|
import { ICounter } from './Counter.interface'
|
|
5
5
|
import { StyledCounter } from '@/components/atoms/Counter/Counter.theme'
|
|
6
|
+
import { useInterval } from '@/helpers/useInterval'
|
|
6
7
|
|
|
7
8
|
const Counter = ({
|
|
8
9
|
title,
|
|
@@ -14,31 +15,29 @@ const Counter = ({
|
|
|
14
15
|
}: ICounter) => {
|
|
15
16
|
if (!number) return <></>;
|
|
16
17
|
|
|
17
|
-
const
|
|
18
|
-
let timeout;
|
|
18
|
+
const [counterValue, setCounterValue] = useState<number>(0);
|
|
19
19
|
|
|
20
|
-
|
|
20
|
+
const speed = 50;
|
|
21
|
+
const increment = Math.trunc(number / speed) < 1 ? 1 : Math.trunc(number / speed);
|
|
21
22
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
counterValue = number;
|
|
32
|
-
clearTimeout(timeout);
|
|
23
|
+
useInterval(() => {
|
|
24
|
+
if (counterValue != number) {
|
|
25
|
+
if (counterValue > number) {
|
|
26
|
+
setCounterValue(number)
|
|
27
|
+
} else {
|
|
28
|
+
setCounterValue(counterValue + increment);
|
|
29
|
+
}
|
|
30
|
+
} else {
|
|
31
|
+
return true;
|
|
33
32
|
}
|
|
34
|
-
},
|
|
33
|
+
}, speed);
|
|
35
34
|
|
|
36
35
|
return (
|
|
37
36
|
<StyledCounter
|
|
38
37
|
className={className}
|
|
39
38
|
style={style}
|
|
40
39
|
>
|
|
41
|
-
<Heading tag="span" size="h1" className='d-flex align-items-center color-primary50'>
|
|
40
|
+
<Heading tag="span" size="h1" className='d-flex align-items-center color-primary50 fw-bold'>
|
|
42
41
|
{prefix && prefix}
|
|
43
42
|
<span>{counterValue}</span>
|
|
44
43
|
{suffix && suffix}
|
|
@@ -33,7 +33,6 @@ export const StyledFieldContainer = styled.div<IFormField>`
|
|
|
33
33
|
|
|
34
34
|
label {
|
|
35
35
|
display: block;
|
|
36
|
-
font-family: var(--font-nichrome) !important;
|
|
37
36
|
}
|
|
38
37
|
|
|
39
38
|
&:has(select) {
|
|
@@ -60,7 +59,6 @@ export const StyledFieldContainer = styled.div<IFormField>`
|
|
|
60
59
|
input,
|
|
61
60
|
textarea,
|
|
62
61
|
select {
|
|
63
|
-
font-family: var(--font-nichrome) !important;
|
|
64
62
|
${fontSize('h4')};
|
|
65
63
|
font-weight: 700;
|
|
66
64
|
text-transform:uppercase;
|
|
@@ -99,27 +97,6 @@ export const StyledFieldContainer = styled.div<IFormField>`
|
|
|
99
97
|
input[type="search"]::-webkit-search-results-decoration {
|
|
100
98
|
-webkit-appearance: none;
|
|
101
99
|
}
|
|
102
|
-
|
|
103
|
-
.style-dark & {
|
|
104
|
-
&:has(select) {
|
|
105
|
-
& > div {
|
|
106
|
-
&::after {
|
|
107
|
-
background-image: url("data:image/svg+xml,%3Csvg width='16' height='16' viewBox='0 0 16 16' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M7.33333 9.24435L11.016 5.33398L12 6.3788L7.33333 11.334L2.66667 6.3788L3.65065 5.33398L7.33333 9.24435Z' fill='%23fff'/%3E%3C/svg%3E%0A");
|
|
108
|
-
}
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
i {
|
|
113
|
-
color: ${colors.white};
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
& input,
|
|
117
|
-
& textarea,
|
|
118
|
-
& select {
|
|
119
|
-
color: ${colors.white};
|
|
120
|
-
border-color: ${colors.white};
|
|
121
|
-
}
|
|
122
|
-
}
|
|
123
100
|
`
|
|
124
101
|
: `
|
|
125
102
|
& > div{
|
|
@@ -40,6 +40,7 @@ export const StyledSocialLinks = styled.ul<ISocialLinks>`
|
|
|
40
40
|
background-color: ${colors.primary50};
|
|
41
41
|
}
|
|
42
42
|
`;
|
|
43
|
+
|
|
43
44
|
case "dark":
|
|
44
45
|
return css`
|
|
45
46
|
& li a{
|
|
@@ -47,6 +48,19 @@ export const StyledSocialLinks = styled.ul<ISocialLinks>`
|
|
|
47
48
|
background-color: ${colors.secondary50};
|
|
48
49
|
}
|
|
49
50
|
`;
|
|
51
|
+
|
|
52
|
+
case "text":
|
|
53
|
+
return css`
|
|
54
|
+
& li a{
|
|
55
|
+
width: auto;
|
|
56
|
+
height: auto;
|
|
57
|
+
border-radius: 0%;
|
|
58
|
+
|
|
59
|
+
& span{
|
|
60
|
+
font-weight: 700;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
`;
|
|
50
64
|
}
|
|
51
65
|
}}
|
|
52
66
|
`;
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import React, { useRef, useState } from 'react'
|
|
2
|
+
import {
|
|
3
|
+
StyledTabs,
|
|
4
|
+
StyledTabsContent,
|
|
5
|
+
StyledTabsLinks,
|
|
6
|
+
StyledTabsMenu
|
|
7
|
+
} from './Tabs.theme'
|
|
8
|
+
|
|
9
|
+
import Heading from '@/components/atoms/Heading/Heading.component'
|
|
10
|
+
import { ITabs } from './Tabs.interface'
|
|
11
|
+
import Icon from '@/components/atoms/Icon/Icon.component'
|
|
12
|
+
|
|
13
|
+
const Tabs = ({ id, title, menu, vertical, className, style }: ITabs) => {
|
|
14
|
+
const [active, setActive] = useState(0)
|
|
15
|
+
|
|
16
|
+
return (
|
|
17
|
+
<StyledTabs id={id} vertical={vertical} className={className} style={style}>
|
|
18
|
+
<div>
|
|
19
|
+
{title && <Heading tag="h3" size="h1" className='text-uppercase mb-4'>{title}</Heading>}
|
|
20
|
+
<StyledTabsMenu>
|
|
21
|
+
{menu &&
|
|
22
|
+
menu.map((item, index) => {
|
|
23
|
+
return (
|
|
24
|
+
<li key={`tab-${item.id}`}>
|
|
25
|
+
<StyledTabsLinks
|
|
26
|
+
$active={index === active}
|
|
27
|
+
className='h3 fw-bold'
|
|
28
|
+
onClick={() => {
|
|
29
|
+
if (item?.onClick) item?.onClick()
|
|
30
|
+
|
|
31
|
+
setActive(index)
|
|
32
|
+
}}
|
|
33
|
+
>
|
|
34
|
+
<span>{item.label}</span>
|
|
35
|
+
</StyledTabsLinks>
|
|
36
|
+
</li>
|
|
37
|
+
)
|
|
38
|
+
})}
|
|
39
|
+
</StyledTabsMenu>
|
|
40
|
+
</div>
|
|
41
|
+
{menu && (
|
|
42
|
+
<div>
|
|
43
|
+
{menu.map((item, index) => {
|
|
44
|
+
return (
|
|
45
|
+
<StyledTabsContent
|
|
46
|
+
key={`tab-content-${item.id}`}
|
|
47
|
+
className='h4'
|
|
48
|
+
style={
|
|
49
|
+
active === index ? { display: 'block' } : { display: 'none' }
|
|
50
|
+
}
|
|
51
|
+
>
|
|
52
|
+
{item.content}
|
|
53
|
+
</StyledTabsContent>
|
|
54
|
+
)
|
|
55
|
+
})}
|
|
56
|
+
</div>
|
|
57
|
+
)}
|
|
58
|
+
</StyledTabs>
|
|
59
|
+
)
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
export default Tabs
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { CSSProperties } from 'react';
|
|
2
|
+
|
|
3
|
+
export interface ITabs {
|
|
4
|
+
id?: string
|
|
5
|
+
title?: string
|
|
6
|
+
menu?: ITabsItem[]
|
|
7
|
+
vertical?: boolean
|
|
8
|
+
className?: string
|
|
9
|
+
style?: CSSProperties
|
|
10
|
+
}
|
|
11
|
+
export interface ITabsItem {
|
|
12
|
+
id?: string
|
|
13
|
+
label?: string
|
|
14
|
+
$active?: boolean
|
|
15
|
+
content?: React.ReactNode
|
|
16
|
+
onClick?: (event?: React.MouseEvent<HTMLElement>) => void
|
|
17
|
+
}
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react'
|
|
2
|
+
|
|
3
|
+
import { ITabs } from './Tabs.interface'
|
|
4
|
+
import React from 'react'
|
|
5
|
+
import RichText from '@/components/atoms/RichText'
|
|
6
|
+
import Tabs from './Tabs.component'
|
|
7
|
+
|
|
8
|
+
// More on default export: https://storybook.js.org/docs/react/writing-stories/introduction#default-export
|
|
9
|
+
export default {
|
|
10
|
+
title: 'Components/Tabs',
|
|
11
|
+
component: Tabs
|
|
12
|
+
} as Meta
|
|
13
|
+
|
|
14
|
+
export const Simple: StoryObj<ITabs> = {
|
|
15
|
+
render: args => <Tabs {...args}></Tabs>,
|
|
16
|
+
args: {
|
|
17
|
+
title: "Lorem ipsum dolor sit amet",
|
|
18
|
+
vertical: true,
|
|
19
|
+
menu: [
|
|
20
|
+
{
|
|
21
|
+
id: 'lorem-1',
|
|
22
|
+
label: 'Lorem 1',
|
|
23
|
+
content: (
|
|
24
|
+
<RichText style={{ color: 'var(--color-gray50)' }}>
|
|
25
|
+
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do
|
|
26
|
+
eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim
|
|
27
|
+
ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut
|
|
28
|
+
aliquip ex ea commodo consequat. Duis aute irure dolor in
|
|
29
|
+
reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla
|
|
30
|
+
pariatur. Excepteur sint occaecat cupidatat non proident, sunt in
|
|
31
|
+
culpa qui officia deserunt mollit anim id est laborum.
|
|
32
|
+
</RichText>
|
|
33
|
+
),
|
|
34
|
+
onClick: () =>{
|
|
35
|
+
alert("Tab clicked")
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
id: 'lorem-2',
|
|
40
|
+
label: 'Lorem 2',
|
|
41
|
+
content: (
|
|
42
|
+
<RichText style={{ color: 'var(--color-gray50)' }}>
|
|
43
|
+
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do
|
|
44
|
+
eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim
|
|
45
|
+
ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut
|
|
46
|
+
aliquip ex ea commodo consequat. Duis aute irure dolor in
|
|
47
|
+
reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla
|
|
48
|
+
pariatur. Excepteur sint occaecat cupidatat non proident, sunt in
|
|
49
|
+
culpa qui officia deserunt mollit anim id est laborum.
|
|
50
|
+
</RichText>
|
|
51
|
+
)
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
id: 'lorem-3',
|
|
55
|
+
label: 'Lorem 3',
|
|
56
|
+
content: (
|
|
57
|
+
<RichText style={{ color: 'var(--color-gray50)' }}>
|
|
58
|
+
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do
|
|
59
|
+
eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim
|
|
60
|
+
ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut
|
|
61
|
+
aliquip ex ea commodo consequat. Duis aute irure dolor in
|
|
62
|
+
reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla
|
|
63
|
+
pariatur. Excepteur sint occaecat cupidatat non proident, sunt in
|
|
64
|
+
culpa qui officia deserunt mollit anim id est laborum.
|
|
65
|
+
</RichText>
|
|
66
|
+
)
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
id: 'lorem-4',
|
|
70
|
+
label: 'Lorem 4',
|
|
71
|
+
content: (
|
|
72
|
+
<RichText style={{ color: 'var(--color-gray50)' }}>
|
|
73
|
+
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do
|
|
74
|
+
eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim
|
|
75
|
+
ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut
|
|
76
|
+
aliquip ex ea commodo consequat. Duis aute irure dolor in
|
|
77
|
+
reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla
|
|
78
|
+
pariatur. Excepteur sint occaecat cupidatat non proident, sunt in
|
|
79
|
+
culpa qui officia deserunt mollit anim id est laborum.
|
|
80
|
+
</RichText>
|
|
81
|
+
)
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
id: 'lorem-5',
|
|
85
|
+
label: 'Lorem 5',
|
|
86
|
+
content: (
|
|
87
|
+
<RichText style={{ color: 'var(--color-gray50)' }}>
|
|
88
|
+
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do
|
|
89
|
+
eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim
|
|
90
|
+
ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut
|
|
91
|
+
aliquip ex ea commodo consequat. Duis aute irure dolor in
|
|
92
|
+
reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla
|
|
93
|
+
pariatur. Excepteur sint occaecat cupidatat non proident, sunt in
|
|
94
|
+
culpa qui officia deserunt mollit anim id est laborum.
|
|
95
|
+
</RichText>
|
|
96
|
+
)
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
id: 'lorem-6',
|
|
100
|
+
label: 'Lorem 6',
|
|
101
|
+
content: (
|
|
102
|
+
<RichText style={{ color: 'var(--color-gray50)' }}>
|
|
103
|
+
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do
|
|
104
|
+
eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim
|
|
105
|
+
ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut
|
|
106
|
+
aliquip ex ea commodo consequat. Duis aute irure dolor in
|
|
107
|
+
reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla
|
|
108
|
+
pariatur. Excepteur sint occaecat cupidatat non proident, sunt in
|
|
109
|
+
culpa qui officia deserunt mollit anim id est laborum.
|
|
110
|
+
</RichText>
|
|
111
|
+
)
|
|
112
|
+
}
|
|
113
|
+
],
|
|
114
|
+
}
|
|
115
|
+
}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { ITabs, ITabsItem } from './Tabs.interface';
|
|
2
|
+
import { colors, responsiveMedia } from '@/styles/variables';
|
|
3
|
+
import styled, { css } from 'styled-components';
|
|
4
|
+
|
|
5
|
+
export const StyledTabsMenu = styled.ul<ITabs>`
|
|
6
|
+
display: inline-flex;
|
|
7
|
+
flex-flow: column;
|
|
8
|
+
|
|
9
|
+
gap: 16px;
|
|
10
|
+
list-style: none;
|
|
11
|
+
padding: 0;
|
|
12
|
+
|
|
13
|
+
@media only screen and (min-width: ${responsiveMedia}) {
|
|
14
|
+
flex-flow: row wrap;
|
|
15
|
+
align-items: center;
|
|
16
|
+
justify-content: center;
|
|
17
|
+
}
|
|
18
|
+
`
|
|
19
|
+
|
|
20
|
+
export const StyledTabsLinks = styled.a<ITabsItem>`
|
|
21
|
+
display: inline-flex;
|
|
22
|
+
align-items: center;
|
|
23
|
+
justify-content: space-between;
|
|
24
|
+
width: 100%;
|
|
25
|
+
color: ${colors.white};
|
|
26
|
+
background-color: ${colors.third10};
|
|
27
|
+
padding: 8px 12px;
|
|
28
|
+
border-radius: 50px;
|
|
29
|
+
transition: all 0.3s linear;
|
|
30
|
+
cursor: pointer;
|
|
31
|
+
|
|
32
|
+
&:hover{
|
|
33
|
+
background-color: ${colors.primary50};
|
|
34
|
+
}
|
|
35
|
+
`
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
export const StyledTabsContent = styled.div<ITabs>`
|
|
39
|
+
display: none;
|
|
40
|
+
|
|
41
|
+
background-color: ${colors.primary50};
|
|
42
|
+
border-radius: 48px 0;
|
|
43
|
+
padding: 36px;
|
|
44
|
+
`
|
|
45
|
+
|
|
46
|
+
export const StyledTabs = styled.div<ITabs>`
|
|
47
|
+
position: relative;
|
|
48
|
+
display: flex;
|
|
49
|
+
align-items: center;
|
|
50
|
+
flex-flow: column;
|
|
51
|
+
gap: 16px;
|
|
52
|
+
|
|
53
|
+
${({ vertical }) => vertical && `
|
|
54
|
+
@media only screen and (max-width: ${responsiveMedia}) {
|
|
55
|
+
flex-flow: row;
|
|
56
|
+
|
|
57
|
+
& > div{
|
|
58
|
+
&:first-child{
|
|
59
|
+
width: 60%;
|
|
60
|
+
flex-grow: 1;
|
|
61
|
+
}
|
|
62
|
+
&:last-child{
|
|
63
|
+
width: 40%;
|
|
64
|
+
flex-shrink: 1;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
`}
|
|
69
|
+
`;
|
|
70
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './Tabs.component'
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { useEffect, useRef } from "react";
|
|
2
|
+
|
|
3
|
+
export const useInterval = (callback, delay) => {
|
|
4
|
+
const savedCallback = useRef();
|
|
5
|
+
let id
|
|
6
|
+
|
|
7
|
+
useEffect(() => {
|
|
8
|
+
savedCallback.current = callback;
|
|
9
|
+
});
|
|
10
|
+
|
|
11
|
+
useEffect(() => {
|
|
12
|
+
function tick() {
|
|
13
|
+
if (savedCallback && savedCallback.current) {
|
|
14
|
+
const result = (savedCallback as unknown as any).current();
|
|
15
|
+
if (result === true) {// if callback returs true, clear timeout;
|
|
16
|
+
clearInterval(id);
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
id = setInterval(tick, delay);
|
|
22
|
+
|
|
23
|
+
return () => clearInterval(id);
|
|
24
|
+
}, [delay]);
|
|
25
|
+
}
|
package/src/index.ts
CHANGED
|
@@ -45,6 +45,7 @@ export { default as ProjectCard } from './components/molecules/ProjectCard'
|
|
|
45
45
|
// //organisms
|
|
46
46
|
export { default as Slider } from './components/organisms/Slider'
|
|
47
47
|
export { default as Cover } from './components/organisms/Cover'
|
|
48
|
+
export { default as Tabs } from './components/organisms/Tabs'
|
|
48
49
|
export { default as CircularSlider } from './components/organisms/CircularSlider'
|
|
49
50
|
|
|
50
51
|
export { iconsList } from './helpers/getIcons'
|
package/src/styles/variables.ts
CHANGED
|
@@ -2,8 +2,8 @@ export const pxToRem = (size: number) => {
|
|
|
2
2
|
return (size / 16) * 1 + 'rem'
|
|
3
3
|
}
|
|
4
4
|
|
|
5
|
-
export const fontName = "
|
|
6
|
-
export const alternativeFont = "
|
|
5
|
+
export const fontName = "MD Nichrome"
|
|
6
|
+
export const alternativeFont = "Red Hat Display";
|
|
7
7
|
|
|
8
8
|
export const gutter = pxToRem(8); //needs to be in this file
|
|
9
9
|
|
|
@@ -132,7 +132,7 @@ export const typography = <Record<string, Record<string, unknown>>>{
|
|
|
132
132
|
export const radius = <Record<string, string>>{
|
|
133
133
|
sm: '6px',
|
|
134
134
|
md: '10px',
|
|
135
|
-
lg: '
|
|
135
|
+
lg: '48px',
|
|
136
136
|
rounded: '100px',
|
|
137
137
|
}
|
|
138
138
|
export const shadows = <Record<string, string>>{
|