oddsgate-ds 1.0.20 → 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 +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/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 +3 -0
- package/dist/cjs/types/styles/variables.d.ts +2 -2
- 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/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 +3 -0
- package/dist/esm/types/styles/variables.d.ts +2 -2
- package/dist/types.d.ts +41 -3
- package/package.json +1 -1
- package/src/components/atoms/Button/Button.theme.ts +1 -1
- package/src/components/atoms/Counter/Counter.component.tsx +50 -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/CheckRadioField/CheckRadioField.theme.ts +8 -0
- package/src/components/atoms/FormField/FormField.theme.tsx +1 -23
- package/src/components/atoms/SocialLinks/SocialLinks.theme.ts +14 -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/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 +3 -0
- package/src/styles/variables.ts +13 -13
|
@@ -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
|
@@ -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,10 +40,12 @@ 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'
|
|
45
47
|
export { default as Cover } from './components/organisms/Cover'
|
|
48
|
+
export { default as Tabs } from './components/organisms/Tabs'
|
|
46
49
|
export { default as CircularSlider } from './components/organisms/CircularSlider'
|
|
47
50
|
|
|
48
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
|
|
|
@@ -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
|
};
|
|
@@ -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>>{
|