oddsgate-ds 1.0.74 → 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/package.json +2 -1
- package/src/components/atoms/Counter/Counter.theme.ts +9 -3
- 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 +14 -1
- package/src/components/organisms/Tabs/Tabs.theme.ts +12 -4
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
|
`;
|
|
@@ -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,6 +11,7 @@ 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()
|
|
@@ -22,6 +23,18 @@ const Tabs = ({ id, title, menu, vertical, className, style }: ITabs) => {
|
|
|
22
23
|
// }, 350)
|
|
23
24
|
}
|
|
24
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
|
+
|
|
25
38
|
return (
|
|
26
39
|
<StyledTabs id={id} vertical={vertical} className={className} style={style}>
|
|
27
40
|
<div>
|
|
@@ -46,7 +59,7 @@ const Tabs = ({ id, title, menu, vertical, className, style }: ITabs) => {
|
|
|
46
59
|
</StyledTabsMenu>
|
|
47
60
|
</div>
|
|
48
61
|
{menu && (
|
|
49
|
-
<div
|
|
62
|
+
<div ref={tabsContent as any}>
|
|
50
63
|
{menu.map((item, index) => {
|
|
51
64
|
return (
|
|
52
65
|
<StyledTabsContent
|
|
@@ -32,11 +32,17 @@ export const StyledTabsLinks = styled.a<ITabsItem>`
|
|
|
32
32
|
`}
|
|
33
33
|
`
|
|
34
34
|
|
|
35
|
-
|
|
36
35
|
export const StyledTabsContent = styled.div<ITabsItem>`
|
|
37
|
-
|
|
36
|
+
position: absolute;
|
|
37
|
+
top: 0;
|
|
38
|
+
left: 0%;
|
|
39
|
+
display: flex;
|
|
38
40
|
flex-flow: row wrap;
|
|
39
41
|
|
|
42
|
+
opacity: 0;
|
|
43
|
+
visibility: hidden;
|
|
44
|
+
pointer-events: none;
|
|
45
|
+
|
|
40
46
|
background-color: ${colors.primary50};
|
|
41
47
|
border-radius: 48px 0;
|
|
42
48
|
padding: 36px;
|
|
@@ -63,7 +69,9 @@ export const StyledTabsContent = styled.div<ITabsItem>`
|
|
|
63
69
|
}
|
|
64
70
|
|
|
65
71
|
${({ $active }) => $active && `
|
|
66
|
-
|
|
72
|
+
opacity: 1;
|
|
73
|
+
visibility: visible;
|
|
74
|
+
pointer-events: auto;
|
|
67
75
|
`}
|
|
68
76
|
|
|
69
77
|
`
|
|
@@ -71,7 +79,6 @@ export const StyledTabsContent = styled.div<ITabsItem>`
|
|
|
71
79
|
export const StyledTabs = styled.div<ITabs>`
|
|
72
80
|
position: relative;
|
|
73
81
|
display: flex;
|
|
74
|
-
align-items: center;
|
|
75
82
|
flex-flow: column;
|
|
76
83
|
gap: 16px;
|
|
77
84
|
|
|
@@ -89,6 +96,7 @@ export const StyledTabs = styled.div<ITabs>`
|
|
|
89
96
|
flex-grow: 1;
|
|
90
97
|
}
|
|
91
98
|
&:last-child{
|
|
99
|
+
position:relative;
|
|
92
100
|
width: 40%;
|
|
93
101
|
flex-shrink: 1;
|
|
94
102
|
}
|