trepur_components 1.0.1 → 1.0.2
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/components/Accordion/Accordion.stories.tsx +88 -0
- package/dist/components/Accordion/index.tsx +31 -0
- package/dist/components/AlertBar/AlertBar.stories.tsx +105 -0
- package/dist/components/AlertBar/index.tsx +127 -0
- package/dist/components/Breadcrumbs/Breadcrumbs.stories.tsx +60 -0
- package/dist/components/Breadcrumbs/index.tsx +55 -0
- package/dist/components/BreadcrumbsBordered/BreadcrumbsBordered.stories.tsx +52 -0
- package/dist/components/BreadcrumbsBordered/index.tsx +44 -0
- package/dist/components/BreadcrumbsItem/BreadcrumbsItem.stories.tsx +54 -0
- package/dist/components/BreadcrumbsItem/index.tsx +151 -0
- package/dist/components/Button/button.stories.tsx +148 -0
- package/dist/components/Button/index.tsx +91 -0
- package/dist/components/Card/Card.stories.tsx +150 -0
- package/dist/components/Card/index.tsx +162 -0
- package/dist/components/CardWithTopImage/CardWithTopImage.stories.tsx +48 -0
- package/dist/components/CardWithTopImage/index.tsx +40 -0
- package/dist/components/Carousel/Carousel.stories.tsx +369 -0
- package/dist/components/Carousel/index.tsx +267 -0
- package/dist/components/ChevronCard/ChevronCard.stories.tsx +21 -0
- package/dist/components/ChevronCard/index.tsx +39 -0
- package/dist/components/Collapsible/Collapsible.stories.tsx +70 -0
- package/dist/components/Collapsible/index.tsx +124 -0
- package/dist/components/Column/Column.stories.tsx +82 -0
- package/dist/components/Column/index.tsx +114 -0
- package/dist/components/Container/Container.stories.tsx +38 -0
- package/dist/components/Container/index.tsx +30 -0
- package/dist/components/FooterBar/FooterBar.stories.tsx +57 -0
- package/dist/components/FooterBar/index.tsx +44 -0
- package/dist/components/Form/Form.stories.tsx +93 -0
- package/dist/components/Form/index.tsx +58 -0
- package/dist/components/FyreCard/FyreCard.stories.tsx +29 -0
- package/dist/components/FyreCard/index.tsx +46 -0
- package/dist/components/Greeting/Greeting.stories.tsx +42 -0
- package/dist/components/Greeting/index.tsx +46 -0
- package/dist/components/HamburgerIcon/HamburgerIcon.stories.tsx +50 -0
- package/dist/components/HamburgerIcon/index.tsx +65 -0
- package/dist/components/Icon/Icon.stories.tsx +102 -0
- package/dist/components/Icon/index.tsx +112 -0
- package/dist/components/Image/Image.stories.tsx +88 -0
- package/dist/components/Image/index.tsx +113 -0
- package/dist/components/ImageLink/ImageLink.stories.tsx +60 -0
- package/dist/components/ImageLink/index.tsx +62 -0
- package/dist/components/ImageLinkList/ImageLinkList.stories.tsx +34 -0
- package/dist/components/ImageLinkList/index.tsx +33 -0
- package/dist/components/InformationIcon/InformationIcon.stories.tsx +86 -0
- package/dist/components/InformationIcon/index.tsx +84 -0
- package/dist/components/Input/Input.stories.tsx +99 -0
- package/dist/components/Input/index.tsx +126 -0
- package/dist/components/Jumbotron/Jumbotron.stories.tsx +22 -0
- package/dist/components/Jumbotron/index.tsx +25 -0
- package/dist/components/Nav/Nav.stories.tsx +155 -0
- package/dist/components/Nav/index.tsx +180 -0
- package/dist/components/NavItem/NavItem.stories.tsx +89 -0
- package/dist/components/NavItem/index.tsx +65 -0
- package/dist/components/NewsCard/NewsCard.stories.tsx +71 -0
- package/dist/components/NewsCard/index.tsx +48 -0
- package/dist/components/Profile/Profile.stories.tsx +50 -0
- package/dist/components/Profile/index.tsx +87 -0
- package/dist/components/Row/Row.stories.tsx +51 -0
- package/dist/components/Row/index.tsx +24 -0
- package/dist/components/Search/Search.stories.tsx +58 -0
- package/dist/components/Search/index.tsx +58 -0
- package/dist/components/SocialBlock/SocialBlock.stories.tsx +114 -0
- package/dist/components/SocialBlock/index.tsx +161 -0
- package/dist/components/StarRating/StarRating.stories.tsx +23 -0
- package/dist/components/StarRating/index.tsx +71 -0
- package/dist/components/Testimonial/Testimonial.stories.tsx +110 -0
- package/dist/components/Testimonial/index.tsx +50 -0
- package/dist/components/TextAndTitle/TextAndTitle.stories.tsx +65 -0
- package/dist/components/TextAndTitle/index.tsx +257 -0
- package/dist/components/TextArea/TextArea.stories.tsx +67 -0
- package/dist/components/TextArea/index.tsx +97 -0
- package/dist/components/Timeline/Timeline.stories.tsx +100 -0
- package/dist/components/Timeline/index.css +133 -0
- package/dist/components/Timeline/index.tsx +315 -0
- package/dist/components/Tubestops/Tubestops.stories.tsx +66 -0
- package/dist/components/Tubestops/index.css +92 -0
- package/dist/components/Tubestops/index.tsx +77 -0
- package/dist/components/UserIcon/UserIcon.stories.tsx +67 -0
- package/dist/components/UserIcon/index.tsx +42 -0
- package/dist/components/Video/Video.stories.tsx +23 -0
- package/dist/components/Video/index.tsx +49 -0
- package/dist/fonts/Sora/OFL.txt +93 -0
- package/dist/fonts/Sora/README.txt +70 -0
- package/dist/fonts/Sora/Sora-VariableFont_wght.ttf +0 -0
- package/dist/fonts/Sora/static/Sora-Bold.ttf +0 -0
- package/dist/fonts/Sora/static/Sora-ExtraBold.ttf +0 -0
- package/dist/fonts/Sora/static/Sora-ExtraLight.ttf +0 -0
- package/dist/fonts/Sora/static/Sora-Light.ttf +0 -0
- package/dist/fonts/Sora/static/Sora-Medium.ttf +0 -0
- package/dist/fonts/Sora/static/Sora-Regular.ttf +0 -0
- package/dist/fonts/Sora/static/Sora-SemiBold.ttf +0 -0
- package/dist/fonts/Sora/static/Sora-Thin.ttf +0 -0
- package/dist/index.js +272 -0
- package/dist/styles/base.css +73 -0
- package/package.json +1 -1
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
/* Vertical */
|
|
2
|
+
/* #circle.vertical:before {
|
|
3
|
+
position: absolute;
|
|
4
|
+
display: block;
|
|
5
|
+
border-left: 1px solid #31a3dd;
|
|
6
|
+
content: "";
|
|
7
|
+
height: 50%;
|
|
8
|
+
top: 0%;
|
|
9
|
+
left: 49.9%;
|
|
10
|
+
z-index: -1;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
#circle.vertical:after {
|
|
14
|
+
position: absolute;
|
|
15
|
+
display: block;
|
|
16
|
+
border-left: 1px solid #31a3dd;
|
|
17
|
+
content: "";
|
|
18
|
+
height: 50%;
|
|
19
|
+
bottom: 0%;
|
|
20
|
+
left: 49.9%;
|
|
21
|
+
z-index: -1;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
#first-circle.vertical:after {
|
|
25
|
+
position: absolute;
|
|
26
|
+
display: block;
|
|
27
|
+
border-left: 1px solid #31a3dd;
|
|
28
|
+
content: "";
|
|
29
|
+
height: 50%;
|
|
30
|
+
bottom: 0%;
|
|
31
|
+
left: 49.9%;
|
|
32
|
+
z-index: -1;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
#last-circle.vertical:before {
|
|
36
|
+
position: absolute;
|
|
37
|
+
display: block;
|
|
38
|
+
border-left: 1px solid #31a3dd;
|
|
39
|
+
content: "";
|
|
40
|
+
height: 50%;
|
|
41
|
+
top: 0%;
|
|
42
|
+
left: 49.9%;
|
|
43
|
+
z-index: -1;
|
|
44
|
+
} */
|
|
45
|
+
|
|
46
|
+
/* V - collapse*/
|
|
47
|
+
/* #circle.vertical.collapse:before {
|
|
48
|
+
position: absolute;
|
|
49
|
+
display: block;
|
|
50
|
+
border-left: 1px solid #31a3dd;
|
|
51
|
+
content: "";
|
|
52
|
+
height: 50%;
|
|
53
|
+
top: 0%;
|
|
54
|
+
left: 8.2%;
|
|
55
|
+
z-index: -1;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
#circle.vertical.collapse:after {
|
|
59
|
+
position: absolute;
|
|
60
|
+
display: block;
|
|
61
|
+
border-left: 1px solid #31a3dd;
|
|
62
|
+
content: "";
|
|
63
|
+
height: 50%;
|
|
64
|
+
bottom: 0%;
|
|
65
|
+
left: 8.2%;
|
|
66
|
+
z-index: -1;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
#first-circle.vertical.collapse:after {
|
|
70
|
+
position: absolute;
|
|
71
|
+
display: block;
|
|
72
|
+
border-left: 1px solid #31a3dd;
|
|
73
|
+
content: "";
|
|
74
|
+
height: 50%;
|
|
75
|
+
bottom: 0%;
|
|
76
|
+
left: 8.2%;
|
|
77
|
+
z-index: -1;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
#last-circle.vertical.collapse:before {
|
|
81
|
+
position: absolute;
|
|
82
|
+
display: block;
|
|
83
|
+
border-left: 1px solid #31a3dd;
|
|
84
|
+
content: "";
|
|
85
|
+
height: 50%;
|
|
86
|
+
top: 0%;
|
|
87
|
+
left: 8.2%;
|
|
88
|
+
z-index: -1;
|
|
89
|
+
} */
|
|
90
|
+
/* Horizontal */
|
|
91
|
+
/* #circle.horizontal:before {
|
|
92
|
+
position: absolute;
|
|
93
|
+
display: block;
|
|
94
|
+
border-top: 1px solid #31a3dd;
|
|
95
|
+
content: "";
|
|
96
|
+
width: 70%;
|
|
97
|
+
top: 50%;
|
|
98
|
+
left: -8%;
|
|
99
|
+
z-index: -1;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
#circle.horizontal:after {
|
|
103
|
+
position: absolute;
|
|
104
|
+
display: block;
|
|
105
|
+
border-top: 1px solid #31a3dd;
|
|
106
|
+
content: "";
|
|
107
|
+
width: 70%;
|
|
108
|
+
top: 50%;
|
|
109
|
+
right: -12%;
|
|
110
|
+
z-index: -1;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
#first-circle.horizontal:after {
|
|
114
|
+
position: absolute;
|
|
115
|
+
display: block;
|
|
116
|
+
border-top: 1px solid #31a3dd;
|
|
117
|
+
content: "";
|
|
118
|
+
width: 60%;
|
|
119
|
+
top: 50%;
|
|
120
|
+
right: -12%;
|
|
121
|
+
z-index: -1;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
#last-circle.horizontal:before {
|
|
125
|
+
position: absolute;
|
|
126
|
+
display: block;
|
|
127
|
+
border-top: 1px solid #31a3dd;
|
|
128
|
+
content: "";
|
|
129
|
+
width: 55%;
|
|
130
|
+
top: 50%;
|
|
131
|
+
left: -8%;
|
|
132
|
+
z-index: -1;
|
|
133
|
+
} */
|
|
@@ -0,0 +1,315 @@
|
|
|
1
|
+
import React, { CSSProperties } from 'react'
|
|
2
|
+
import classNames from 'classnames'
|
|
3
|
+
import Image from '@components/Image'
|
|
4
|
+
import Column from '@components/Column'
|
|
5
|
+
import Row from '@components/Row'
|
|
6
|
+
|
|
7
|
+
export interface Props {
|
|
8
|
+
id?: string
|
|
9
|
+
className?: string
|
|
10
|
+
isHorizontal?: boolean
|
|
11
|
+
items?: object[]
|
|
12
|
+
reverse?: boolean
|
|
13
|
+
textCenter?: boolean
|
|
14
|
+
useImages?: boolean
|
|
15
|
+
horizontalComponentClasses?: string
|
|
16
|
+
isSm?: boolean
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
const Timeline = ({
|
|
20
|
+
id,
|
|
21
|
+
className,
|
|
22
|
+
isHorizontal = false,
|
|
23
|
+
items,
|
|
24
|
+
reverse = false,
|
|
25
|
+
textCenter,
|
|
26
|
+
useImages = true,
|
|
27
|
+
horizontalComponentClasses,
|
|
28
|
+
isSm = false
|
|
29
|
+
}: Props): JSX.Element => {
|
|
30
|
+
const classList = classNames(className, 'w-full list-none overflow-x-auto pb-4')
|
|
31
|
+
const ulClasses = classNames({
|
|
32
|
+
'flex-row none-reverse justify-between': !reverse && isHorizontal,
|
|
33
|
+
'flex-col none-reverse': !reverse && !isHorizontal,
|
|
34
|
+
'flex-row reverse justify-between': reverse && isHorizontal,
|
|
35
|
+
'flex-col reverse': reverse && !isHorizontal
|
|
36
|
+
}, className, 'timeline status-flow relative list-none pl-0 flex')
|
|
37
|
+
|
|
38
|
+
const liClasses = classNames({
|
|
39
|
+
'text-center': textCenter,
|
|
40
|
+
'items-center flex-col justify-between': !reverse && isHorizontal,
|
|
41
|
+
'flex-row none-reverse': !reverse && !isHorizontal,
|
|
42
|
+
'items-center flex-col-reverse': reverse && isHorizontal,
|
|
43
|
+
'flex-row-reverse': reverse && !isHorizontal
|
|
44
|
+
}, 'status-flow-item relative flex flex-auto flex-row leading-tight')
|
|
45
|
+
|
|
46
|
+
const circle = classNames({
|
|
47
|
+
'horizontal collapse': isHorizontal && isSm,
|
|
48
|
+
horizontal: isHorizontal && !isSm,
|
|
49
|
+
vertical: !isHorizontal
|
|
50
|
+
}, 'w-4 h-4 my-16 text-center mx-auto rounded-full border bg-black')
|
|
51
|
+
|
|
52
|
+
const circleVerticalBefore: CSSProperties = {
|
|
53
|
+
position: 'absolute',
|
|
54
|
+
display: 'block',
|
|
55
|
+
borderLeft: '1px solid',
|
|
56
|
+
borderColor: 'text-primary',
|
|
57
|
+
content: '""',
|
|
58
|
+
height: '50%',
|
|
59
|
+
top: '0%',
|
|
60
|
+
left: '49.9%',
|
|
61
|
+
zIndex: '-1'
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
const circleVerticalCollapseBefore: CSSProperties = {
|
|
65
|
+
position: 'absolute',
|
|
66
|
+
display: 'block',
|
|
67
|
+
borderLeft: '1px solid',
|
|
68
|
+
borderColor: 'text-primary',
|
|
69
|
+
content: '""',
|
|
70
|
+
height: '50%',
|
|
71
|
+
top: '0%',
|
|
72
|
+
left: '8.2%',
|
|
73
|
+
zIndex: '-1'
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
const lastCircleVerticalBefore: CSSProperties = {
|
|
77
|
+
position: 'absolute',
|
|
78
|
+
display: 'block',
|
|
79
|
+
borderLeft: '1px solid',
|
|
80
|
+
borderColor: 'text-primary',
|
|
81
|
+
content: '""',
|
|
82
|
+
height: '50%',
|
|
83
|
+
top: '0%',
|
|
84
|
+
left: '49.9%',
|
|
85
|
+
zIndex: '-1'
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
const lastCircleVerticalCollapseBefore: CSSProperties = {
|
|
89
|
+
position: 'absolute',
|
|
90
|
+
display: 'block',
|
|
91
|
+
borderLeft: '1px solid',
|
|
92
|
+
borderColor: 'text-primary',
|
|
93
|
+
content: '""',
|
|
94
|
+
height: '50%',
|
|
95
|
+
top: '0%',
|
|
96
|
+
left: '8.2%',
|
|
97
|
+
zIndex: '-1'
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
const circleVerticalAfter: CSSProperties = {
|
|
101
|
+
position: 'absolute',
|
|
102
|
+
display: 'block',
|
|
103
|
+
borderLeft: '1px solid',
|
|
104
|
+
borderColor: 'text-primary',
|
|
105
|
+
content: '""',
|
|
106
|
+
height: '50%',
|
|
107
|
+
bottom: '0%',
|
|
108
|
+
left: '49.9%',
|
|
109
|
+
zIndex: '-1'
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
const firstCircleVerticalAfter: CSSProperties = {
|
|
113
|
+
position: 'absolute',
|
|
114
|
+
display: 'block',
|
|
115
|
+
borderLeft: '1px solid',
|
|
116
|
+
borderColor: 'text-primary',
|
|
117
|
+
content: '""',
|
|
118
|
+
height: '50%',
|
|
119
|
+
bottom: '0%',
|
|
120
|
+
left: '49.9%',
|
|
121
|
+
zIndex: '-1'
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
const circleVerticalCollapseAfter: CSSProperties = {
|
|
125
|
+
position: 'absolute',
|
|
126
|
+
display: 'block',
|
|
127
|
+
borderLeft: '1px solid',
|
|
128
|
+
borderColor: 'text-primary',
|
|
129
|
+
content: '""',
|
|
130
|
+
height: '50%',
|
|
131
|
+
bottom: '0%',
|
|
132
|
+
left: '8.2%',
|
|
133
|
+
zIndex: '-1'
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
const firstCircleVerticalCollapseAfter: CSSProperties = {
|
|
137
|
+
position: 'absolute',
|
|
138
|
+
display: 'block',
|
|
139
|
+
borderLeft: '1px solid',
|
|
140
|
+
borderColor: 'text-primary',
|
|
141
|
+
content: '""',
|
|
142
|
+
height: '50%',
|
|
143
|
+
bottom: '0%',
|
|
144
|
+
left: '8.2%',
|
|
145
|
+
zIndex: '-1'
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
return (
|
|
149
|
+
<Column
|
|
150
|
+
sm={12}
|
|
151
|
+
md={12}
|
|
152
|
+
lg={12}
|
|
153
|
+
xl={12}
|
|
154
|
+
id={id}
|
|
155
|
+
className={classList}
|
|
156
|
+
>
|
|
157
|
+
<div className={ulClasses}>
|
|
158
|
+
{items?.map((item: any, i: number) => {
|
|
159
|
+
let before
|
|
160
|
+
if (i % 2 === 0) { before = true } else { before = false }
|
|
161
|
+
|
|
162
|
+
let circlePos
|
|
163
|
+
if (items.length - 1 > 0) {
|
|
164
|
+
if (i === 0) circlePos = 'first-circle'
|
|
165
|
+
else if (i === items.length - 1) circlePos = 'last-circle'
|
|
166
|
+
else circlePos = 'circle'
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
let verticalCircleStylesBefore
|
|
170
|
+
if (circlePos === 'circle' && isSm) {
|
|
171
|
+
verticalCircleStylesBefore = circleVerticalCollapseBefore
|
|
172
|
+
} else if (circlePos === 'circle' && !isSm) {
|
|
173
|
+
verticalCircleStylesBefore = circleVerticalBefore
|
|
174
|
+
} else if (circlePos === 'last-circle' && isSm) {
|
|
175
|
+
verticalCircleStylesBefore = lastCircleVerticalCollapseBefore
|
|
176
|
+
} else if (circlePos === 'last-circle' && !isSm) {
|
|
177
|
+
verticalCircleStylesBefore = lastCircleVerticalBefore
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
let verticalCircleStylesAfter
|
|
181
|
+
if (circlePos === 'circle' && isSm) {
|
|
182
|
+
verticalCircleStylesAfter = circleVerticalCollapseAfter
|
|
183
|
+
} else if (circlePos === 'circle' && !isSm) {
|
|
184
|
+
verticalCircleStylesAfter = circleVerticalAfter
|
|
185
|
+
} else if (circlePos === 'first-circle' && isSm) {
|
|
186
|
+
verticalCircleStylesAfter = firstCircleVerticalCollapseAfter
|
|
187
|
+
} else if (circlePos === 'first-circle' && !isSm) {
|
|
188
|
+
verticalCircleStylesAfter = firstCircleVerticalAfter
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
let horizontalCircleStylesBefore
|
|
192
|
+
// if (circlePos === 'circle' && isSm){
|
|
193
|
+
// horizontalCircleStylesBefore = circleHorizontalCollapseBefore
|
|
194
|
+
// } else if (circlePos === 'circle' && !isSm){
|
|
195
|
+
// horizontalCircleStylesBefore = circleHorizontalBefore
|
|
196
|
+
// } else if (circlePos === 'first-circle' && isSm){
|
|
197
|
+
// horizontalCircleStylesBefore = firstCircleHorizontalCollapseBefore
|
|
198
|
+
// } else if (circlePos === 'first-circle' && !isSm){
|
|
199
|
+
// horizontalCircleStylesBefore = firstCircleHorizontalBefore
|
|
200
|
+
// }
|
|
201
|
+
|
|
202
|
+
let horizontalCircleStylesAfter
|
|
203
|
+
// if (circlePos === 'circle' && isSm){
|
|
204
|
+
// horizontalCircleStylesAfter = circleHorizontalCollapseAfter
|
|
205
|
+
// } else if (circlePos === 'circle' && !isSm){
|
|
206
|
+
// horizontalCircleStylesAfter = circleHorizontalAfter
|
|
207
|
+
// } else if (circlePos === 'first-circle' && isSm){
|
|
208
|
+
// horizontalCircleStylesAfter = firstCircleHorizontalCollapseAfter
|
|
209
|
+
// } else if (circlePos === 'first-circle' && !isSm){
|
|
210
|
+
// horizontalCircleStylesAfter = firstCircleHorizontalAfter
|
|
211
|
+
// }
|
|
212
|
+
|
|
213
|
+
const horizonalComponentClassList = classNames(horizontalComponentClasses, 'pt-12')
|
|
214
|
+
if (isHorizontal) {
|
|
215
|
+
return (
|
|
216
|
+
<Column
|
|
217
|
+
key={`horizontal_col_${i + 0}`}
|
|
218
|
+
id='timeline-item'
|
|
219
|
+
className={`${liClasses} py-4 mb-8`}
|
|
220
|
+
>
|
|
221
|
+
<Row className={horizontalComponentClasses}>
|
|
222
|
+
{before && item.component}
|
|
223
|
+
</Row>
|
|
224
|
+
<Row>
|
|
225
|
+
{useImages
|
|
226
|
+
? (
|
|
227
|
+
<div
|
|
228
|
+
id={circlePos}
|
|
229
|
+
className={isHorizontal ? 'horizontal py-0 my-0' : 'vertical'}
|
|
230
|
+
>
|
|
231
|
+
<span style={horizontalCircleStylesBefore} />
|
|
232
|
+
<Image {...item.centerImageProps} />
|
|
233
|
+
<span style={horizontalCircleStylesAfter} />
|
|
234
|
+
</div>
|
|
235
|
+
)
|
|
236
|
+
: (
|
|
237
|
+
<p id={circlePos} className={circle} />
|
|
238
|
+
)}
|
|
239
|
+
</Row>
|
|
240
|
+
<Row className={horizonalComponentClassList}>
|
|
241
|
+
{!before && item.component}
|
|
242
|
+
</Row>
|
|
243
|
+
</Column>
|
|
244
|
+
)
|
|
245
|
+
} else {
|
|
246
|
+
return (
|
|
247
|
+
<Row
|
|
248
|
+
key={`vertical_row_${i + 0}`}
|
|
249
|
+
id='timeline-item'
|
|
250
|
+
className={`${liClasses} py-4`}
|
|
251
|
+
>
|
|
252
|
+
{!isSm &&
|
|
253
|
+
<Column
|
|
254
|
+
sm={5}
|
|
255
|
+
md={5}
|
|
256
|
+
lg={5}
|
|
257
|
+
xl={5}
|
|
258
|
+
className='text-center my-auto'
|
|
259
|
+
>
|
|
260
|
+
{before && item.component}
|
|
261
|
+
</Column>}
|
|
262
|
+
<Column
|
|
263
|
+
sm={2}
|
|
264
|
+
md={2}
|
|
265
|
+
lg={2}
|
|
266
|
+
xl={2}
|
|
267
|
+
id='circle-wrapper'
|
|
268
|
+
className='my-auto'
|
|
269
|
+
>
|
|
270
|
+
{useImages
|
|
271
|
+
? (
|
|
272
|
+
<div
|
|
273
|
+
id={circlePos}
|
|
274
|
+
className={isSm ? 'vertical' : 'vertical'}
|
|
275
|
+
>
|
|
276
|
+
<span style={verticalCircleStylesBefore} />
|
|
277
|
+
<Image {...item.centerImageProps} />
|
|
278
|
+
<span style={verticalCircleStylesAfter} />
|
|
279
|
+
</div>
|
|
280
|
+
)
|
|
281
|
+
: (
|
|
282
|
+
<p id={circlePos} className={circle} />
|
|
283
|
+
)}
|
|
284
|
+
</Column>
|
|
285
|
+
{/* TODO: combine below - issue with sm div */}
|
|
286
|
+
{isSm &&
|
|
287
|
+
<Column
|
|
288
|
+
sm={10}
|
|
289
|
+
md={10}
|
|
290
|
+
lg={10}
|
|
291
|
+
xl={10}
|
|
292
|
+
className='text-center my-auto'
|
|
293
|
+
>
|
|
294
|
+
{item.component}
|
|
295
|
+
</Column>}
|
|
296
|
+
{!isSm &&
|
|
297
|
+
<Column
|
|
298
|
+
sm={5}
|
|
299
|
+
md={5}
|
|
300
|
+
lg={5}
|
|
301
|
+
xl={5}
|
|
302
|
+
className='text-center my-auto'
|
|
303
|
+
>
|
|
304
|
+
{!before && item.component}
|
|
305
|
+
</Column>}
|
|
306
|
+
</Row>
|
|
307
|
+
)
|
|
308
|
+
}
|
|
309
|
+
})}
|
|
310
|
+
</div>
|
|
311
|
+
</Column>
|
|
312
|
+
)
|
|
313
|
+
}
|
|
314
|
+
|
|
315
|
+
export default Timeline
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import Tubestops from './index'
|
|
3
|
+
import { ComponentStory, ComponentMeta } from '@storybook/react'
|
|
4
|
+
|
|
5
|
+
const componentMeta: ComponentMeta<typeof Tubestops> = {
|
|
6
|
+
title: 'Trepur Components/Other/Atoms/Tubestops',
|
|
7
|
+
component: Tubestops,
|
|
8
|
+
parameters: {},
|
|
9
|
+
argTypes: {
|
|
10
|
+
id: {
|
|
11
|
+
description: 'Defines the id of the component',
|
|
12
|
+
table: {
|
|
13
|
+
category: '',
|
|
14
|
+
type: { summary: 'string' },
|
|
15
|
+
defaultValue: { summary: 'undefined' }
|
|
16
|
+
}
|
|
17
|
+
},
|
|
18
|
+
className: {
|
|
19
|
+
description: 'Defines any additional classes for the components',
|
|
20
|
+
table: {
|
|
21
|
+
category: '',
|
|
22
|
+
type: { summary: 'string' },
|
|
23
|
+
defaultValue: { summary: 'undefined' }
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
isHorizontal: {
|
|
27
|
+
description: '',
|
|
28
|
+
table: {
|
|
29
|
+
category: ''
|
|
30
|
+
}
|
|
31
|
+
},
|
|
32
|
+
items: {
|
|
33
|
+
description: '',
|
|
34
|
+
table: {
|
|
35
|
+
category: ''
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
},
|
|
39
|
+
args: {
|
|
40
|
+
isHorizontal: false,
|
|
41
|
+
reverse: false,
|
|
42
|
+
items: [
|
|
43
|
+
{
|
|
44
|
+
title: 'This is a title',
|
|
45
|
+
subtitle: 'This is a subtitle'
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
title: 'This is a title',
|
|
49
|
+
subtitle: 'This is a subtitle'
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
title: 'This is a title',
|
|
53
|
+
subtitle: 'This is a subtitle'
|
|
54
|
+
}
|
|
55
|
+
],
|
|
56
|
+
textCenter: true,
|
|
57
|
+
id: '',
|
|
58
|
+
className: ''
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
const Template: ComponentStory<typeof Tubestops> = (args) => <Tubestops {...args} />
|
|
63
|
+
|
|
64
|
+
export const _Tubestops = Template.bind({})
|
|
65
|
+
|
|
66
|
+
export default componentMeta
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
/* Vertical */
|
|
2
|
+
.tubestop.flex-col.none-reverse .status-flow-item:not(:first-child):before {
|
|
3
|
+
@apply absolute;
|
|
4
|
+
@apply block;
|
|
5
|
+
|
|
6
|
+
content: "";
|
|
7
|
+
width: 1px;
|
|
8
|
+
height: 100%;
|
|
9
|
+
left: 7px;
|
|
10
|
+
top: -100%;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.tubestop.flex-col.none-reverse .status-flow-item:not(:last-child):after {
|
|
14
|
+
@apply absolute;
|
|
15
|
+
@apply block;
|
|
16
|
+
|
|
17
|
+
content: "";
|
|
18
|
+
width: 1px;
|
|
19
|
+
height: 100%;
|
|
20
|
+
left: 7px;
|
|
21
|
+
top: 40%;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
/* reverse */
|
|
25
|
+
.tubestop.flex-col.reverse .status-flow-item:not(:first-child):before {
|
|
26
|
+
@apply absolute;
|
|
27
|
+
@apply block;
|
|
28
|
+
|
|
29
|
+
content: "";
|
|
30
|
+
width: 1px;
|
|
31
|
+
height: 100%;
|
|
32
|
+
right: 7px;
|
|
33
|
+
top: -100%;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.tubestop.flex-col.reverse .status-flow-item:not(:last-child):after {
|
|
37
|
+
@apply absolute;
|
|
38
|
+
@apply block;
|
|
39
|
+
|
|
40
|
+
content: "";
|
|
41
|
+
width: 1px;
|
|
42
|
+
height: 100%;
|
|
43
|
+
right: 7px;
|
|
44
|
+
top: 40%;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/* Horizontal */
|
|
48
|
+
.tubestop.flex-row.none-reverse .status-flow-item:not(:first-child):after {
|
|
49
|
+
@apply absolute;
|
|
50
|
+
@apply block;
|
|
51
|
+
|
|
52
|
+
content: "";
|
|
53
|
+
width: 100%;
|
|
54
|
+
height: 1px;
|
|
55
|
+
left: -50%;
|
|
56
|
+
bottom: 7px;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
.tubestop.flex-row-reverse.none-reverse
|
|
60
|
+
.status-flow-item:not(:first-child):after {
|
|
61
|
+
@apply absolute;
|
|
62
|
+
@apply block;
|
|
63
|
+
|
|
64
|
+
content: "";
|
|
65
|
+
width: 100%;
|
|
66
|
+
height: 1px;
|
|
67
|
+
right: -50%;
|
|
68
|
+
top: 7px;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
/*reverse*/
|
|
72
|
+
.tubestop.flex-row.reverse .status-flow-item:not(:first-child):after {
|
|
73
|
+
@apply absolute;
|
|
74
|
+
@apply block;
|
|
75
|
+
|
|
76
|
+
content: "";
|
|
77
|
+
width: 100%;
|
|
78
|
+
height: 1px;
|
|
79
|
+
left: -50%;
|
|
80
|
+
bottom: 7px;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
.tubestop.flex-row.reverse .status-flow-item:not(:first-child):after {
|
|
84
|
+
@apply absolute;
|
|
85
|
+
@apply block;
|
|
86
|
+
|
|
87
|
+
content: "";
|
|
88
|
+
width: 100%;
|
|
89
|
+
height: 1px;
|
|
90
|
+
right: -50%;
|
|
91
|
+
top: 7px;
|
|
92
|
+
}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import classNames from 'classnames'
|
|
3
|
+
import './index.css'
|
|
4
|
+
|
|
5
|
+
export interface Props extends Partial<Pick<HTMLElement, 'className' | 'id'>> {
|
|
6
|
+
isHorizontal?: boolean
|
|
7
|
+
items?: Array<{ title: string, subtitle: string }>
|
|
8
|
+
reverse?: boolean
|
|
9
|
+
textCenter?: boolean
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
const Tubestops: React.FC<Props> = ({
|
|
13
|
+
id,
|
|
14
|
+
className,
|
|
15
|
+
isHorizontal = false,
|
|
16
|
+
items = [],
|
|
17
|
+
reverse = false,
|
|
18
|
+
textCenter = false
|
|
19
|
+
}) => {
|
|
20
|
+
const circle = 'w-4 h-4 rounded-full bg-black z-10'
|
|
21
|
+
const classList = classNames(className, 'w-full list-none')
|
|
22
|
+
|
|
23
|
+
const liClasses = classNames({
|
|
24
|
+
'text-center': textCenter,
|
|
25
|
+
'items-center flex-col-reverse justify-between': !reverse && isHorizontal,
|
|
26
|
+
'flex-row none-reverse': !reverse && !isHorizontal,
|
|
27
|
+
'items-center flex-col': reverse && isHorizontal,
|
|
28
|
+
'flex-row-reverse': reverse && !isHorizontal
|
|
29
|
+
}, 'mb-0 status-flow-item relative flex flex-auto flex-row leading-tight')
|
|
30
|
+
|
|
31
|
+
const ulClasses = classNames({
|
|
32
|
+
'flex-row none-reverse justify-between': !reverse && isHorizontal,
|
|
33
|
+
'flex-col none-reverse': !reverse && !isHorizontal,
|
|
34
|
+
'flex-row reverse justify-between': reverse && isHorizontal,
|
|
35
|
+
'flex-col reverse': reverse && !isHorizontal
|
|
36
|
+
}, 'tubestop status-flow relative list-none pl-0 flex')
|
|
37
|
+
|
|
38
|
+
const padding = classNames({
|
|
39
|
+
'pb-2': !reverse && isHorizontal,
|
|
40
|
+
'pl-4': !reverse && !isHorizontal,
|
|
41
|
+
'pt-2': reverse && isHorizontal,
|
|
42
|
+
'pr-4': reverse && !isHorizontal
|
|
43
|
+
})
|
|
44
|
+
|
|
45
|
+
return (
|
|
46
|
+
<div
|
|
47
|
+
id={id}
|
|
48
|
+
className={classList}
|
|
49
|
+
>
|
|
50
|
+
<ul className={ulClasses}>
|
|
51
|
+
{items?.map((item: { title: string, subtitle: string }, i: number) => {
|
|
52
|
+
const a = isHorizontal
|
|
53
|
+
? i === 0
|
|
54
|
+
? ''
|
|
55
|
+
: ''
|
|
56
|
+
: i === 0
|
|
57
|
+
? ''
|
|
58
|
+
: 'my-12'
|
|
59
|
+
return (
|
|
60
|
+
<li
|
|
61
|
+
key={`tubestop_${i + 0}`}
|
|
62
|
+
className={`${liClasses} ${a}`}
|
|
63
|
+
>
|
|
64
|
+
<span className={circle} />
|
|
65
|
+
<div className={padding}>
|
|
66
|
+
<p>{`${item?.title}${i.toString()}`}</p>
|
|
67
|
+
<p><small>{item?.subtitle}</small></p>
|
|
68
|
+
</div>
|
|
69
|
+
</li>
|
|
70
|
+
)
|
|
71
|
+
})}
|
|
72
|
+
</ul>
|
|
73
|
+
</div>
|
|
74
|
+
)
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
export default Tubestops
|