oddsgate-ds 1.0.73 → 1.0.75
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 +4 -4
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/types/components/organisms/Tabs/Tabs.theme.d.ts +1 -1
- package/dist/esm/index.js +5 -5
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/types/components/organisms/Tabs/Tabs.theme.d.ts +1 -1
- package/package.json +2 -1
- package/src/components/atoms/Counter/Counter.theme.ts +9 -3
- package/src/components/atoms/ScrollingNav/ScrollingNav.theme.ts +3 -0
- package/src/components/molecules/Accordion/Accordion.theme.ts +6 -2
- package/src/components/molecules/BlogCard/BlogCard.theme.ts +1 -1
- package/src/components/molecules/NewsCard/NewsCard.theme.ts +1 -1
- package/src/components/organisms/CircularSlider/CircularSlider.component.tsx +6 -4
- package/src/components/organisms/CircularSlider/CircularSlider.theme.ts +2 -2
- package/src/components/organisms/Tabs/Tabs.component.tsx +22 -5
- package/src/components/organisms/Tabs/Tabs.theme.ts +19 -21
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
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("
|
|
3
|
+
export declare const StyledTabsMenu: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("../../atoms/ScrollingNav/ScrollingNav.interface").IScrollingNav, ITabs>> & string & Omit<({ align, children, className, ...props }: import("../../atoms/ScrollingNav/ScrollingNav.interface").IScrollingNav) => import("react").JSX.Element, keyof import("react").Component<any, {}, any>>;
|
|
4
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
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>, ITabsItem>> & string;
|
|
6
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;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "oddsgate-ds",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.75",
|
|
4
4
|
"description": "Miew theme component library",
|
|
5
5
|
"main": "dist/cjs/index.js",
|
|
6
6
|
"module": "dist/esm/index.js",
|
|
@@ -14,6 +14,7 @@
|
|
|
14
14
|
"./package.json": "./package.json"
|
|
15
15
|
},
|
|
16
16
|
"scripts": {
|
|
17
|
+
"publish": "yarn bump-version && yarn build && npm publish",
|
|
17
18
|
"build": "npm run clean && rollup -c --bundleConfigAsCjs",
|
|
18
19
|
"storybook": "storybook dev -p 6006",
|
|
19
20
|
"build-storybook": "storybook build",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
+
import { colors, responsiveMedia } from '@/styles/variables';
|
|
1
2
|
import styled, { css } from 'styled-components';
|
|
2
3
|
|
|
3
4
|
import { ICounter } from './Counter.interface';
|
|
4
|
-
import { colors } from '@/styles/variables';
|
|
5
5
|
|
|
6
6
|
export const StyledCounter = styled.div<ICounter>`
|
|
7
7
|
display: inline-flex;
|
|
@@ -10,12 +10,18 @@ export const StyledCounter = styled.div<ICounter>`
|
|
|
10
10
|
justify-content: center;
|
|
11
11
|
align-items: center;
|
|
12
12
|
|
|
13
|
-
min-width:
|
|
14
|
-
min-height:
|
|
13
|
+
min-width: 10rem;
|
|
14
|
+
min-height: 10rem;
|
|
15
15
|
|
|
16
16
|
padding: 8px 22px;
|
|
17
17
|
border-radius: 100%;
|
|
18
18
|
text-align: center;
|
|
19
|
+
margin: 12px;
|
|
19
20
|
|
|
20
21
|
background-color: ${colors.third10};
|
|
22
|
+
|
|
23
|
+
@media only screen and (min-width: ${responsiveMedia}) {
|
|
24
|
+
min-width: 20rem;
|
|
25
|
+
min-height: 20rem;
|
|
26
|
+
}
|
|
21
27
|
`;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { IAccordion, IAccordionItem } from './Accordion.interface';
|
|
2
|
-
import { colors, easeOutExpo } from '@/styles/variables';
|
|
2
|
+
import { colors, easeOutExpo, responsiveMedia } from '@/styles/variables';
|
|
3
3
|
import styled, { css } from 'styled-components';
|
|
4
4
|
|
|
5
5
|
export const StyledAccordionTitle = styled.span<IAccordionItem>`
|
|
@@ -34,6 +34,7 @@ export const StyledAccordionTitle = styled.span<IAccordionItem>`
|
|
|
34
34
|
|
|
35
35
|
transition: all 0.6s ${easeOutExpo};
|
|
36
36
|
}
|
|
37
|
+
|
|
37
38
|
`
|
|
38
39
|
|
|
39
40
|
export const StyledAccordionContent = styled.div<IAccordionItem>`
|
|
@@ -41,12 +42,15 @@ export const StyledAccordionContent = styled.div<IAccordionItem>`
|
|
|
41
42
|
display: grid;
|
|
42
43
|
grid-template-rows: 0fr;
|
|
43
44
|
overflow: hidden;
|
|
44
|
-
padding-right: 6rem;
|
|
45
45
|
transition: all 0.5s linear;
|
|
46
46
|
|
|
47
47
|
${({ active }) => active && `
|
|
48
48
|
grid-template-rows: 1fr;
|
|
49
49
|
`}
|
|
50
|
+
|
|
51
|
+
@media only screen and (max-width: ${responsiveMedia}) {
|
|
52
|
+
padding-right: 6rem;
|
|
53
|
+
}
|
|
50
54
|
`
|
|
51
55
|
|
|
52
56
|
export const StyledAccordionItem = styled.li<IAccordionItem>`
|
|
@@ -31,8 +31,6 @@ const CircularSlider = ({
|
|
|
31
31
|
const sliderSize = isMobile ? 2.6 : 1;
|
|
32
32
|
const slideSize = isMobile ? 0.12 : 0.15;
|
|
33
33
|
|
|
34
|
-
console.log(isMobile);
|
|
35
|
-
|
|
36
34
|
//force 12 items
|
|
37
35
|
if (content && content.length < 12) {
|
|
38
36
|
let counter = 0;
|
|
@@ -108,9 +106,10 @@ const CircularSlider = ({
|
|
|
108
106
|
};
|
|
109
107
|
const removeStyle = () => {
|
|
110
108
|
contentHolder?.current?.classList.remove('active');
|
|
109
|
+
const prevElement = slides[currentSlide];
|
|
111
110
|
setTimeout(() => {
|
|
112
111
|
content && setSlideContent(content[currentSlide] as any)
|
|
113
|
-
|
|
112
|
+
prevElement.classList.remove('active');
|
|
114
113
|
}, 400);
|
|
115
114
|
};
|
|
116
115
|
|
|
@@ -127,7 +126,10 @@ const CircularSlider = ({
|
|
|
127
126
|
if (currentSlide === 0 && newSlide === (slides.length - 1)) {
|
|
128
127
|
multiplier = -1;
|
|
129
128
|
direction = "-";
|
|
130
|
-
} else {
|
|
129
|
+
} else if(currentSlide === (slides.length - 1) && newSlide === 0) {
|
|
130
|
+
multiplier = 1;
|
|
131
|
+
direction = "+";
|
|
132
|
+
}else{
|
|
131
133
|
multiplier = newSlide - currentSlide
|
|
132
134
|
direction = currentSlide < newSlide ? "+" : "-";
|
|
133
135
|
}
|
|
@@ -31,13 +31,13 @@ export const StyledCircularSliderWrapper = styled.div<ICircularSlider>`
|
|
|
31
31
|
justify-content: center;
|
|
32
32
|
margin: 0 auto;
|
|
33
33
|
margin-right: 0;
|
|
34
|
-
top: 50%;
|
|
34
|
+
/* top: 50%;
|
|
35
35
|
transform: translate(23%, -50%);
|
|
36
36
|
|
|
37
37
|
@media only screen and (min-width: ${responsiveMedia}) {
|
|
38
38
|
transform: translate(65%, -50%);
|
|
39
39
|
|
|
40
|
-
}
|
|
40
|
+
} */
|
|
41
41
|
`;
|
|
42
42
|
|
|
43
43
|
export const StyledCircularSliderSlides = styled.div<ICircularSlider>`
|
|
@@ -11,22 +11,39 @@ import { ITabs } from './Tabs.interface'
|
|
|
11
11
|
|
|
12
12
|
const Tabs = ({ id, title, menu, vertical, className, style }: ITabs) => {
|
|
13
13
|
const [active, setActive] = useState(0)
|
|
14
|
+
const tabsContent = useRef<HTMLDivElement>();
|
|
14
15
|
|
|
15
16
|
const setActiveEl = (item, index) => {
|
|
16
17
|
if (item?.onClick) item?.onClick()
|
|
17
18
|
|
|
18
|
-
setActive(index)
|
|
19
|
+
setActive(index);
|
|
20
|
+
|
|
21
|
+
// setTimeout(() => {
|
|
22
|
+
// document.querySelector(`.tabs-menu`).style.height = "auto";
|
|
23
|
+
// }, 350)
|
|
19
24
|
}
|
|
20
25
|
|
|
26
|
+
const setTabsHeight = () => {
|
|
27
|
+
if (!tabsContent.current) return;
|
|
28
|
+
|
|
29
|
+
const heights: number[] = [];
|
|
30
|
+
Array.from(tabsContent?.current?.children).map((child: any) => {
|
|
31
|
+
heights.push(child?.offsetHeight as number)
|
|
32
|
+
})
|
|
33
|
+
tabsContent.current.style.height = `${Math.max(...heights)}px`;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
setTabsHeight();
|
|
37
|
+
|
|
21
38
|
return (
|
|
22
39
|
<StyledTabs id={id} vertical={vertical} className={className} style={style}>
|
|
23
40
|
<div>
|
|
24
41
|
{title && <Heading tag="h3" size="h1" className='text-uppercase mb-4'>{title}</Heading>}
|
|
25
|
-
<StyledTabsMenu>
|
|
42
|
+
<StyledTabsMenu align='left'>
|
|
26
43
|
{menu &&
|
|
27
44
|
menu.map((item, index) => {
|
|
28
45
|
return (
|
|
29
|
-
<
|
|
46
|
+
<div key={`tab-${item.id}`}>
|
|
30
47
|
<StyledTabsLinks
|
|
31
48
|
$active={index === active}
|
|
32
49
|
className='h3 fw-bold'
|
|
@@ -36,13 +53,13 @@ const Tabs = ({ id, title, menu, vertical, className, style }: ITabs) => {
|
|
|
36
53
|
>
|
|
37
54
|
<span>{item.label}</span>
|
|
38
55
|
</StyledTabsLinks>
|
|
39
|
-
</
|
|
56
|
+
</div>
|
|
40
57
|
)
|
|
41
58
|
})}
|
|
42
59
|
</StyledTabsMenu>
|
|
43
60
|
</div>
|
|
44
61
|
{menu && (
|
|
45
|
-
<div>
|
|
62
|
+
<div ref={tabsContent as any}>
|
|
46
63
|
{menu.map((item, index) => {
|
|
47
64
|
return (
|
|
48
65
|
<StyledTabsContent
|
|
@@ -2,16 +2,10 @@ import { ITabs, ITabsItem } from './Tabs.interface';
|
|
|
2
2
|
import { colors, responsiveMedia } from '@/styles/variables';
|
|
3
3
|
import styled, { css, keyframes } from 'styled-components';
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
display: inline-flex;
|
|
7
|
-
flex-flow: column;
|
|
8
|
-
|
|
9
|
-
gap: 16px;
|
|
10
|
-
list-style: none;
|
|
11
|
-
padding: 0;
|
|
5
|
+
import ScrollingNav from '@/components/atoms/ScrollingNav/ScrollingNav.component';
|
|
12
6
|
|
|
7
|
+
export const StyledTabsMenu = styled(ScrollingNav) <ITabs>`
|
|
13
8
|
@media only screen and (min-width: ${responsiveMedia}) {
|
|
14
|
-
flex-flow: row wrap;
|
|
15
9
|
align-items: center;
|
|
16
10
|
justify-content: center;
|
|
17
11
|
}
|
|
@@ -38,18 +32,21 @@ export const StyledTabsLinks = styled.a<ITabsItem>`
|
|
|
38
32
|
`}
|
|
39
33
|
`
|
|
40
34
|
|
|
41
|
-
|
|
42
35
|
export const StyledTabsContent = styled.div<ITabsItem>`
|
|
43
|
-
|
|
36
|
+
position: absolute;
|
|
37
|
+
top: 0;
|
|
38
|
+
left: 0%;
|
|
39
|
+
display: flex;
|
|
44
40
|
flex-flow: row wrap;
|
|
45
41
|
|
|
42
|
+
opacity: 0;
|
|
43
|
+
visibility: hidden;
|
|
44
|
+
pointer-events: none;
|
|
45
|
+
|
|
46
46
|
background-color: ${colors.primary50};
|
|
47
47
|
border-radius: 48px 0;
|
|
48
48
|
padding: 36px;
|
|
49
49
|
|
|
50
|
-
opacity: 0;
|
|
51
|
-
transform: translateY(40px);
|
|
52
|
-
|
|
53
50
|
@media only screen and (min-width: ${responsiveMedia}) {
|
|
54
51
|
min-height: 40rem;
|
|
55
52
|
}
|
|
@@ -71,14 +68,10 @@ export const StyledTabsContent = styled.div<ITabsItem>`
|
|
|
71
68
|
}
|
|
72
69
|
}
|
|
73
70
|
|
|
74
|
-
@keyframes fadeIn{
|
|
75
|
-
from { display: none; }
|
|
76
|
-
to { transform: translateY(0px); opacity: 1;}
|
|
77
|
-
}
|
|
78
|
-
|
|
79
71
|
${({ $active }) => $active && `
|
|
80
|
-
|
|
81
|
-
|
|
72
|
+
opacity: 1;
|
|
73
|
+
visibility: visible;
|
|
74
|
+
pointer-events: auto;
|
|
82
75
|
`}
|
|
83
76
|
|
|
84
77
|
`
|
|
@@ -86,10 +79,13 @@ export const StyledTabsContent = styled.div<ITabsItem>`
|
|
|
86
79
|
export const StyledTabs = styled.div<ITabs>`
|
|
87
80
|
position: relative;
|
|
88
81
|
display: flex;
|
|
89
|
-
align-items: center;
|
|
90
82
|
flex-flow: column;
|
|
91
83
|
gap: 16px;
|
|
92
84
|
|
|
85
|
+
& > div{
|
|
86
|
+
width: 100%;
|
|
87
|
+
}
|
|
88
|
+
|
|
93
89
|
${({ vertical }) => vertical && `
|
|
94
90
|
@media only screen and (min-width: ${responsiveMedia}) {
|
|
95
91
|
flex-flow: row;
|
|
@@ -100,12 +96,14 @@ export const StyledTabs = styled.div<ITabs>`
|
|
|
100
96
|
flex-grow: 1;
|
|
101
97
|
}
|
|
102
98
|
&:last-child{
|
|
99
|
+
position:relative;
|
|
103
100
|
width: 40%;
|
|
104
101
|
flex-shrink: 1;
|
|
105
102
|
}
|
|
106
103
|
}
|
|
107
104
|
|
|
108
105
|
${StyledTabsMenu}{
|
|
106
|
+
display: inline-flex;
|
|
109
107
|
flex-flow: column;
|
|
110
108
|
align-items: stretch;
|
|
111
109
|
justify-content: flex-start;
|