trepur_components 1.0.2 → 1.0.4
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/src/lib/components/Accordion/index.js +3 -1
- package/dist/src/lib/components/Accordion/index.js.map +1 -1
- package/dist/src/lib/components/Accordion/style.module.css +4 -0
- package/dist/src/lib/components/Accordion/style.module.css.map +1 -0
- package/dist/src/lib/components/Carousel/index.d.ts +0 -1
- package/dist/src/lib/components/Carousel/index.js +1 -1
- package/dist/src/lib/components/Carousel/index.js.map +1 -1
- package/dist/src/lib/components/ImageLinkList/index.d.ts +1 -1
- package/dist/src/lib/components/Nav/index.d.ts +1 -1
- package/dist/src/lib/components/Nav/index.js +2 -2
- package/dist/src/lib/components/Nav/index.js.map +1 -1
- package/dist/src/lib/components/SocialBlock/index.js +2 -2
- package/dist/src/lib/components/SocialBlock/index.js.map +1 -1
- package/dist/{components → src/lib/components}/Timeline/index.css +2 -0
- package/dist/src/lib/components/Timeline/index.css.map +1 -0
- package/dist/{components → src/lib/components}/Tubestops/index.css +35 -30
- package/dist/src/lib/components/Tubestops/index.css.map +1 -0
- package/dist/src/lib/typography/index.d.ts +1 -3
- package/dist/src/lib/typography/index.js +1 -1
- package/dist/src/lib/typography/index.js.map +1 -1
- package/package.json +13 -6
- package/dist/components/Accordion/Accordion.stories.tsx +0 -88
- package/dist/components/Accordion/index.tsx +0 -31
- package/dist/components/AlertBar/AlertBar.stories.tsx +0 -105
- package/dist/components/AlertBar/index.tsx +0 -127
- package/dist/components/Breadcrumbs/Breadcrumbs.stories.tsx +0 -60
- package/dist/components/Breadcrumbs/index.tsx +0 -55
- package/dist/components/BreadcrumbsBordered/BreadcrumbsBordered.stories.tsx +0 -52
- package/dist/components/BreadcrumbsBordered/index.tsx +0 -44
- package/dist/components/BreadcrumbsItem/BreadcrumbsItem.stories.tsx +0 -54
- package/dist/components/BreadcrumbsItem/index.tsx +0 -151
- package/dist/components/Button/button.stories.tsx +0 -148
- package/dist/components/Button/index.tsx +0 -91
- package/dist/components/Card/Card.stories.tsx +0 -150
- package/dist/components/Card/index.tsx +0 -162
- package/dist/components/CardWithTopImage/CardWithTopImage.stories.tsx +0 -48
- package/dist/components/CardWithTopImage/index.tsx +0 -40
- package/dist/components/Carousel/Carousel.stories.tsx +0 -369
- package/dist/components/Carousel/index.tsx +0 -267
- package/dist/components/ChevronCard/ChevronCard.stories.tsx +0 -21
- package/dist/components/ChevronCard/index.tsx +0 -39
- package/dist/components/Collapsible/Collapsible.stories.tsx +0 -70
- package/dist/components/Collapsible/index.tsx +0 -124
- package/dist/components/Column/Column.stories.tsx +0 -82
- package/dist/components/Column/index.tsx +0 -114
- package/dist/components/Container/Container.stories.tsx +0 -38
- package/dist/components/Container/index.tsx +0 -30
- package/dist/components/FooterBar/FooterBar.stories.tsx +0 -57
- package/dist/components/FooterBar/index.tsx +0 -44
- package/dist/components/Form/Form.stories.tsx +0 -93
- package/dist/components/Form/index.tsx +0 -58
- package/dist/components/FyreCard/FyreCard.stories.tsx +0 -29
- package/dist/components/FyreCard/index.tsx +0 -46
- package/dist/components/Greeting/Greeting.stories.tsx +0 -42
- package/dist/components/Greeting/index.tsx +0 -46
- package/dist/components/HamburgerIcon/HamburgerIcon.stories.tsx +0 -50
- package/dist/components/HamburgerIcon/index.tsx +0 -65
- package/dist/components/Icon/Icon.stories.tsx +0 -102
- package/dist/components/Icon/index.tsx +0 -112
- package/dist/components/Image/Image.stories.tsx +0 -88
- package/dist/components/Image/index.tsx +0 -113
- package/dist/components/ImageLink/ImageLink.stories.tsx +0 -60
- package/dist/components/ImageLink/index.tsx +0 -62
- package/dist/components/ImageLinkList/ImageLinkList.stories.tsx +0 -34
- package/dist/components/ImageLinkList/index.tsx +0 -33
- package/dist/components/InformationIcon/InformationIcon.stories.tsx +0 -86
- package/dist/components/InformationIcon/index.tsx +0 -84
- package/dist/components/Input/Input.stories.tsx +0 -99
- package/dist/components/Input/index.tsx +0 -126
- package/dist/components/Jumbotron/Jumbotron.stories.tsx +0 -22
- package/dist/components/Jumbotron/index.tsx +0 -25
- package/dist/components/Nav/Nav.stories.tsx +0 -155
- package/dist/components/Nav/index.tsx +0 -180
- package/dist/components/NavItem/NavItem.stories.tsx +0 -89
- package/dist/components/NavItem/index.tsx +0 -65
- package/dist/components/NewsCard/NewsCard.stories.tsx +0 -71
- package/dist/components/NewsCard/index.tsx +0 -48
- package/dist/components/Profile/Profile.stories.tsx +0 -50
- package/dist/components/Profile/index.tsx +0 -87
- package/dist/components/Row/Row.stories.tsx +0 -51
- package/dist/components/Row/index.tsx +0 -24
- package/dist/components/Search/Search.stories.tsx +0 -58
- package/dist/components/Search/index.tsx +0 -58
- package/dist/components/SocialBlock/SocialBlock.stories.tsx +0 -114
- package/dist/components/SocialBlock/index.tsx +0 -161
- package/dist/components/StarRating/StarRating.stories.tsx +0 -23
- package/dist/components/StarRating/index.tsx +0 -71
- package/dist/components/Testimonial/Testimonial.stories.tsx +0 -110
- package/dist/components/Testimonial/index.tsx +0 -50
- package/dist/components/TextAndTitle/TextAndTitle.stories.tsx +0 -65
- package/dist/components/TextAndTitle/index.tsx +0 -257
- package/dist/components/TextArea/TextArea.stories.tsx +0 -67
- package/dist/components/TextArea/index.tsx +0 -97
- package/dist/components/Timeline/Timeline.stories.tsx +0 -100
- package/dist/components/Timeline/index.tsx +0 -315
- package/dist/components/Tubestops/Tubestops.stories.tsx +0 -66
- package/dist/components/Tubestops/index.tsx +0 -77
- package/dist/components/UserIcon/UserIcon.stories.tsx +0 -67
- package/dist/components/UserIcon/index.tsx +0 -42
- package/dist/components/Video/Video.stories.tsx +0 -23
- package/dist/components/Video/index.tsx +0 -49
- package/dist/fonts/Sora/OFL.txt +0 -93
- package/dist/fonts/Sora/README.txt +0 -70
- 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 +0 -272
- package/dist/src/lib/components/Accordion/Accordion.stories.d.ts +0 -6
- package/dist/src/lib/components/Accordion/Accordion.stories.js +0 -80
- package/dist/src/lib/components/Accordion/Accordion.stories.js.map +0 -1
- package/dist/src/lib/components/AlertBar/AlertBar.stories.d.ts +0 -6
- package/dist/src/lib/components/AlertBar/AlertBar.stories.js +0 -91
- package/dist/src/lib/components/AlertBar/AlertBar.stories.js.map +0 -1
- package/dist/src/lib/components/Breadcrumbs/Breadcrumbs.stories.d.ts +0 -6
- package/dist/src/lib/components/Breadcrumbs/Breadcrumbs.stories.js +0 -56
- package/dist/src/lib/components/Breadcrumbs/Breadcrumbs.stories.js.map +0 -1
- package/dist/src/lib/components/BreadcrumbsBordered/BreadcrumbsBordered.stories.d.ts +0 -6
- package/dist/src/lib/components/BreadcrumbsBordered/BreadcrumbsBordered.stories.js +0 -45
- package/dist/src/lib/components/BreadcrumbsBordered/BreadcrumbsBordered.stories.js.map +0 -1
- package/dist/src/lib/components/BreadcrumbsItem/BreadcrumbsItem.stories.d.ts +0 -6
- package/dist/src/lib/components/BreadcrumbsItem/BreadcrumbsItem.stories.js +0 -50
- package/dist/src/lib/components/BreadcrumbsItem/BreadcrumbsItem.stories.js.map +0 -1
- package/dist/src/lib/components/Button/button.stories.d.ts +0 -6
- package/dist/src/lib/components/Button/button.stories.js +0 -132
- package/dist/src/lib/components/Button/button.stories.js.map +0 -1
- package/dist/src/lib/components/Card/Card.stories.d.ts +0 -8
- package/dist/src/lib/components/Card/Card.stories.js +0 -124
- package/dist/src/lib/components/Card/Card.stories.js.map +0 -1
- package/dist/src/lib/components/CardWithTopImage/CardWithTopImage.stories.d.ts +0 -6
- package/dist/src/lib/components/CardWithTopImage/CardWithTopImage.stories.js +0 -40
- package/dist/src/lib/components/CardWithTopImage/CardWithTopImage.stories.js.map +0 -1
- package/dist/src/lib/components/Carousel/Carousel.stories.d.ts +0 -6
- package/dist/src/lib/components/Carousel/Carousel.stories.js +0 -297
- package/dist/src/lib/components/Carousel/Carousel.stories.js.map +0 -1
- package/dist/src/lib/components/ChevronCard/ChevronCard.stories.d.ts +0 -6
- package/dist/src/lib/components/ChevronCard/ChevronCard.stories.js +0 -14
- package/dist/src/lib/components/ChevronCard/ChevronCard.stories.js.map +0 -1
- package/dist/src/lib/components/Collapsible/Collapsible.stories.d.ts +0 -6
- package/dist/src/lib/components/Collapsible/Collapsible.stories.js +0 -66
- package/dist/src/lib/components/Collapsible/Collapsible.stories.js.map +0 -1
- package/dist/src/lib/components/Column/Column.stories.d.ts +0 -6
- package/dist/src/lib/components/Column/Column.stories.js +0 -64
- package/dist/src/lib/components/Column/Column.stories.js.map +0 -1
- package/dist/src/lib/components/Container/Container.stories.d.ts +0 -6
- package/dist/src/lib/components/Container/Container.stories.js +0 -30
- package/dist/src/lib/components/Container/Container.stories.js.map +0 -1
- package/dist/src/lib/components/FooterBar/footerBar.stories.d.ts +0 -6
- package/dist/src/lib/components/FooterBar/footerBar.stories.js +0 -48
- package/dist/src/lib/components/FooterBar/footerBar.stories.js.map +0 -1
- package/dist/src/lib/components/Form/Form.stories.d.ts +0 -6
- package/dist/src/lib/components/Form/Form.stories.js +0 -82
- package/dist/src/lib/components/Form/Form.stories.js.map +0 -1
- package/dist/src/lib/components/FyreCard/FyreCard.stories.d.ts +0 -6
- package/dist/src/lib/components/FyreCard/FyreCard.stories.js +0 -22
- package/dist/src/lib/components/FyreCard/FyreCard.stories.js.map +0 -1
- package/dist/src/lib/components/Greeting/Greeting.stories.d.ts +0 -6
- package/dist/src/lib/components/Greeting/Greeting.stories.js +0 -33
- package/dist/src/lib/components/Greeting/Greeting.stories.js.map +0 -1
- package/dist/src/lib/components/HamburgerIcon/HamburgerIcon.stories.d.ts +0 -6
- package/dist/src/lib/components/HamburgerIcon/HamburgerIcon.stories.js +0 -46
- package/dist/src/lib/components/HamburgerIcon/HamburgerIcon.stories.js.map +0 -1
- package/dist/src/lib/components/Icon/Icon.stories.d.ts +0 -6
- package/dist/src/lib/components/Icon/Icon.stories.js +0 -87
- package/dist/src/lib/components/Icon/Icon.stories.js.map +0 -1
- package/dist/src/lib/components/Image/Image.stories.d.ts +0 -6
- package/dist/src/lib/components/Image/Image.stories.js +0 -73
- package/dist/src/lib/components/Image/Image.stories.js.map +0 -1
- package/dist/src/lib/components/ImageLink/ImageLink.stories.d.ts +0 -9
- package/dist/src/lib/components/ImageLink/ImageLink.stories.js +0 -50
- package/dist/src/lib/components/ImageLink/ImageLink.stories.js.map +0 -1
- package/dist/src/lib/components/ImageLinkList/ImageLinkList.stories.d.ts +0 -6
- package/dist/src/lib/components/ImageLinkList/ImageLinkList.stories.js +0 -27
- package/dist/src/lib/components/ImageLinkList/ImageLinkList.stories.js.map +0 -1
- package/dist/src/lib/components/InformationIcon/InformationIcon.stories.d.ts +0 -6
- package/dist/src/lib/components/InformationIcon/InformationIcon.stories.js +0 -73
- package/dist/src/lib/components/InformationIcon/InformationIcon.stories.js.map +0 -1
- package/dist/src/lib/components/Input/Input.stories.d.ts +0 -6
- package/dist/src/lib/components/Input/Input.stories.js +0 -95
- package/dist/src/lib/components/Input/Input.stories.js.map +0 -1
- package/dist/src/lib/components/Jumbotron/Jumbotron.stories.d.ts +0 -6
- package/dist/src/lib/components/Jumbotron/Jumbotron.stories.js +0 -16
- package/dist/src/lib/components/Jumbotron/Jumbotron.stories.js.map +0 -1
- package/dist/src/lib/components/Nav/Nav.stories.d.ts +0 -6
- package/dist/src/lib/components/Nav/Nav.stories.js +0 -134
- package/dist/src/lib/components/Nav/Nav.stories.js.map +0 -1
- package/dist/src/lib/components/NavItem/NavItem.stories.d.ts +0 -6
- package/dist/src/lib/components/NavItem/NavItem.stories.js +0 -75
- package/dist/src/lib/components/NavItem/NavItem.stories.js.map +0 -1
- package/dist/src/lib/components/NewsCard/NewsCard.stories.d.ts +0 -6
- package/dist/src/lib/components/NewsCard/NewsCard.stories.js +0 -60
- package/dist/src/lib/components/NewsCard/NewsCard.stories.js.map +0 -1
- package/dist/src/lib/components/Profile/Profile.stories.d.ts +0 -6
- package/dist/src/lib/components/Profile/Profile.stories.js +0 -41
- package/dist/src/lib/components/Profile/Profile.stories.js.map +0 -1
- package/dist/src/lib/components/Row/Row.stories.d.ts +0 -6
- package/dist/src/lib/components/Row/Row.stories.js +0 -37
- package/dist/src/lib/components/Row/Row.stories.js.map +0 -1
- package/dist/src/lib/components/Search/Search.stories.d.ts +0 -6
- package/dist/src/lib/components/Search/Search.stories.js +0 -48
- package/dist/src/lib/components/Search/Search.stories.js.map +0 -1
- package/dist/src/lib/components/SocialBlock/SocialBlock.stories.d.ts +0 -6
- package/dist/src/lib/components/SocialBlock/SocialBlock.stories.js +0 -58
- package/dist/src/lib/components/SocialBlock/SocialBlock.stories.js.map +0 -1
- package/dist/src/lib/components/StarRating/StarRating.stories.d.ts +0 -6
- package/dist/src/lib/components/StarRating/StarRating.stories.js +0 -17
- package/dist/src/lib/components/StarRating/StarRating.stories.js.map +0 -1
- package/dist/src/lib/components/Testimonial/Testimonial.stories.d.ts +0 -6
- package/dist/src/lib/components/Testimonial/Testimonial.stories.js +0 -95
- package/dist/src/lib/components/Testimonial/Testimonial.stories.js.map +0 -1
- package/dist/src/lib/components/TextAndTitle/TextAndTitle.stories.d.ts +0 -6
- package/dist/src/lib/components/TextAndTitle/TextAndTitle.stories.js +0 -63
- package/dist/src/lib/components/TextAndTitle/TextAndTitle.stories.js.map +0 -1
- package/dist/src/lib/components/TextArea/TextArea.stories.d.ts +0 -6
- package/dist/src/lib/components/TextArea/TextArea.stories.js +0 -63
- package/dist/src/lib/components/TextArea/TextArea.stories.js.map +0 -1
- package/dist/src/lib/components/Timeline/Timeline.stories.d.ts +0 -6
- package/dist/src/lib/components/Timeline/Timeline.stories.js +0 -87
- package/dist/src/lib/components/Timeline/Timeline.stories.js.map +0 -1
- package/dist/src/lib/components/Tubestops/Tubestops.stories.d.ts +0 -6
- package/dist/src/lib/components/Tubestops/Tubestops.stories.js +0 -62
- package/dist/src/lib/components/Tubestops/Tubestops.stories.js.map +0 -1
- package/dist/src/lib/components/UserIcon/UserIcon.stories.d.ts +0 -6
- package/dist/src/lib/components/UserIcon/UserIcon.stories.js +0 -63
- package/dist/src/lib/components/UserIcon/UserIcon.stories.js.map +0 -1
- package/dist/src/lib/components/Video/Video.stories.d.ts +0 -6
- package/dist/src/lib/components/Video/Video.stories.js +0 -17
- package/dist/src/lib/components/Video/Video.stories.js.map +0 -1
- package/dist/src/lib/typography/Fonts.stories.d.ts +0 -6
- package/dist/src/lib/typography/Fonts.stories.js +0 -12
- package/dist/src/lib/typography/Fonts.stories.js.map +0 -1
- package/dist/styles/base.css +0 -73
|
@@ -1,113 +0,0 @@
|
|
|
1
|
-
import React, { useState } from 'react'
|
|
2
|
-
import classNames from 'classnames'
|
|
3
|
-
|
|
4
|
-
export interface Props {
|
|
5
|
-
id?: string
|
|
6
|
-
className?: string
|
|
7
|
-
image?: string
|
|
8
|
-
altText?: string
|
|
9
|
-
title?: string
|
|
10
|
-
rounded?: boolean
|
|
11
|
-
roundedFull?: boolean
|
|
12
|
-
height?: number
|
|
13
|
-
width?: number
|
|
14
|
-
overlayText?: string
|
|
15
|
-
centerAligned?: boolean
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
const Image = ({
|
|
19
|
-
id,
|
|
20
|
-
className,
|
|
21
|
-
image,
|
|
22
|
-
altText,
|
|
23
|
-
title,
|
|
24
|
-
rounded = false,
|
|
25
|
-
roundedFull = false,
|
|
26
|
-
height = 8,
|
|
27
|
-
width = 8,
|
|
28
|
-
overlayText,
|
|
29
|
-
centerAligned = false
|
|
30
|
-
}: Props): JSX.Element => {
|
|
31
|
-
const [isHovering, setIsHovering] = useState(false)
|
|
32
|
-
const opacity = classNames({
|
|
33
|
-
'opacity-80': isHovering,
|
|
34
|
-
'opacity-0': !isHovering
|
|
35
|
-
})
|
|
36
|
-
|
|
37
|
-
const widthClassList = classNames({
|
|
38
|
-
'w-6': width === 1,
|
|
39
|
-
'w-10': width === 2,
|
|
40
|
-
'w-14': width === 3,
|
|
41
|
-
'w-16': width === 4,
|
|
42
|
-
'w-20': width === 5,
|
|
43
|
-
'w-24': width === 6,
|
|
44
|
-
'w-28': width === 7,
|
|
45
|
-
'w-32': width === 8,
|
|
46
|
-
'w-36': width === 9,
|
|
47
|
-
'w-40': width === 10,
|
|
48
|
-
'w-44': width === 11,
|
|
49
|
-
'w-full': (width === undefined) || (![1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11].includes(width))
|
|
50
|
-
})
|
|
51
|
-
|
|
52
|
-
const heightClassList = classNames({
|
|
53
|
-
'h-6': height === 1,
|
|
54
|
-
'h-10': height === 2,
|
|
55
|
-
'h-14': height === 3,
|
|
56
|
-
'h-16': height === 4,
|
|
57
|
-
'h-20': height === 5,
|
|
58
|
-
'h-24': height === 6,
|
|
59
|
-
'h-28': height === 7,
|
|
60
|
-
'h-32': height === 8,
|
|
61
|
-
'h-36': height === 9,
|
|
62
|
-
'h-40': height === 10,
|
|
63
|
-
'h-44': height === 11,
|
|
64
|
-
'h-full': (height === undefined) || (![1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11].includes(height))
|
|
65
|
-
})
|
|
66
|
-
|
|
67
|
-
const imageClassList = classNames({
|
|
68
|
-
'rounded-2xl': rounded,
|
|
69
|
-
'rounded-full': roundedFull,
|
|
70
|
-
'mx-auto': centerAligned
|
|
71
|
-
}, className, widthClassList, heightClassList)
|
|
72
|
-
|
|
73
|
-
const overlayClassList = classNames(
|
|
74
|
-
widthClassList,
|
|
75
|
-
heightClassList,
|
|
76
|
-
opacity,
|
|
77
|
-
'absolute z-10 transition-opacity duration-700 bg-white'
|
|
78
|
-
)
|
|
79
|
-
|
|
80
|
-
const overlayTextWrapperClassList = classNames(
|
|
81
|
-
widthClassList,
|
|
82
|
-
heightClassList,
|
|
83
|
-
opacity,
|
|
84
|
-
'flex absolute z-20 transition-opacity duration-700'
|
|
85
|
-
)
|
|
86
|
-
|
|
87
|
-
const overlayTextClassList = 'm-auto text-center text-primary'
|
|
88
|
-
|
|
89
|
-
return (
|
|
90
|
-
<>
|
|
91
|
-
{overlayText !== undefined &&
|
|
92
|
-
<>
|
|
93
|
-
<div className={overlayClassList} />
|
|
94
|
-
<div
|
|
95
|
-
className={overlayTextWrapperClassList}
|
|
96
|
-
onMouseEnter={() => setIsHovering(true)}
|
|
97
|
-
onMouseLeave={() => setIsHovering(false)}
|
|
98
|
-
>
|
|
99
|
-
<p className={overlayTextClassList}>{overlayText}</p>
|
|
100
|
-
</div>
|
|
101
|
-
</>}
|
|
102
|
-
<img
|
|
103
|
-
id={id}
|
|
104
|
-
className={imageClassList}
|
|
105
|
-
src={image}
|
|
106
|
-
{...(altText !== undefined && { alt: altText })}
|
|
107
|
-
{...(title !== undefined && { title })}
|
|
108
|
-
/>
|
|
109
|
-
</>
|
|
110
|
-
)
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
export default Image
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
import React from 'react'
|
|
2
|
-
import { idAndClassName } from '@utils/controls'
|
|
3
|
-
import Column from '@components/Column'
|
|
4
|
-
import ImageLink from './index'
|
|
5
|
-
import { ComponentStory, ComponentMeta } from '@storybook/react'
|
|
6
|
-
|
|
7
|
-
const componentMeta: ComponentMeta<typeof ImageLink> = {
|
|
8
|
-
title: 'Trepur Components/Other/Organisms/Image Link',
|
|
9
|
-
component: ImageLink,
|
|
10
|
-
parameters: {},
|
|
11
|
-
argTypes: {
|
|
12
|
-
...idAndClassName,
|
|
13
|
-
title: {
|
|
14
|
-
description: '',
|
|
15
|
-
control: 'text',
|
|
16
|
-
table: {
|
|
17
|
-
category: ''
|
|
18
|
-
}
|
|
19
|
-
},
|
|
20
|
-
image: {
|
|
21
|
-
description: '',
|
|
22
|
-
control: 'text',
|
|
23
|
-
table: {
|
|
24
|
-
category: ''
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
},
|
|
28
|
-
args: {
|
|
29
|
-
image: 'https://picsum.photos/400/400',
|
|
30
|
-
link: '/'
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
const Template: ComponentStory<typeof ImageLink> = (args) => <Column sm={3} md={3}><ImageLink {...args} /></Column>
|
|
35
|
-
|
|
36
|
-
export const _ImageLink = Template.bind({})
|
|
37
|
-
_ImageLink.args = {}
|
|
38
|
-
|
|
39
|
-
export const _ImageLinkWithTitle = Template.bind({})
|
|
40
|
-
_ImageLinkWithTitle.args = {
|
|
41
|
-
title: 'Title'
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
export const _ImageLinkWithButton = Template.bind({})
|
|
45
|
-
_ImageLinkWithButton.args = {
|
|
46
|
-
buttonProps: {
|
|
47
|
-
children: 'Button 1'
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
export const _ImageLinkRounded = Template.bind({})
|
|
52
|
-
_ImageLinkRounded.args = {
|
|
53
|
-
title: 'Title',
|
|
54
|
-
buttonProps: {
|
|
55
|
-
children: 'Button 1'
|
|
56
|
-
},
|
|
57
|
-
rounded: true
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
export default componentMeta
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
import React from 'react'
|
|
2
|
-
import Button, { Props as buttonProps } from '@components/Button'
|
|
3
|
-
import classNames from 'classnames'
|
|
4
|
-
|
|
5
|
-
export interface Props {
|
|
6
|
-
id?: string
|
|
7
|
-
className?: string
|
|
8
|
-
image?: string
|
|
9
|
-
altText?: string
|
|
10
|
-
title?: string
|
|
11
|
-
link?: string
|
|
12
|
-
rounded?: boolean
|
|
13
|
-
openInNewTab?: boolean
|
|
14
|
-
buttonProps?: buttonProps
|
|
15
|
-
}
|
|
16
|
-
const ImageLink = ({
|
|
17
|
-
id,
|
|
18
|
-
className,
|
|
19
|
-
image,
|
|
20
|
-
altText,
|
|
21
|
-
title,
|
|
22
|
-
link,
|
|
23
|
-
rounded,
|
|
24
|
-
openInNewTab,
|
|
25
|
-
buttonProps
|
|
26
|
-
}: Props): JSX.Element => {
|
|
27
|
-
const classList = classNames(className, 'cursor-pointer lg:mx-3 md:mx-1 mx-1 lg:mb-5 md:mb-2 mb-2 hover:opacity-50 overflow-hidden text-center')
|
|
28
|
-
|
|
29
|
-
const roundedClass = classNames({
|
|
30
|
-
'rounded-full': rounded
|
|
31
|
-
})
|
|
32
|
-
|
|
33
|
-
return (
|
|
34
|
-
<a
|
|
35
|
-
id={id}
|
|
36
|
-
href={link}
|
|
37
|
-
{...(openInNewTab !== false && { target: 'blank' })}
|
|
38
|
-
>
|
|
39
|
-
<div className={roundedClass + ' ' + classList + ' relative overflow-hidden'}>
|
|
40
|
-
<img
|
|
41
|
-
src={image}
|
|
42
|
-
alt={altText}
|
|
43
|
-
className='object-cover w-full h-full'
|
|
44
|
-
/>
|
|
45
|
-
{title !== undefined &&
|
|
46
|
-
<h1
|
|
47
|
-
className='absolute bg-black text-white py-2 mt-4 top-0 inset-x-0 text-center'
|
|
48
|
-
>
|
|
49
|
-
{title}
|
|
50
|
-
</h1>}
|
|
51
|
-
{buttonProps?.children !== undefined &&
|
|
52
|
-
<Button
|
|
53
|
-
className='absolute mx-8 mb-4 bottom-0 inset-x-0 text-center'
|
|
54
|
-
>
|
|
55
|
-
{buttonProps.children}
|
|
56
|
-
</Button>}
|
|
57
|
-
</div>
|
|
58
|
-
</a>
|
|
59
|
-
)
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
export default ImageLink
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import React from 'react'
|
|
2
|
-
import { idAndClassName } from '@utils/controls'
|
|
3
|
-
import ImageLinkList, { Props as imageLinkListProps } from './index'
|
|
4
|
-
import { ComponentStory, ComponentMeta } from '@storybook/react'
|
|
5
|
-
|
|
6
|
-
const getLinks = (): any => {
|
|
7
|
-
return new Array(16).fill(null).map(() => {
|
|
8
|
-
return {
|
|
9
|
-
image: 'https://picsum.photos/400/400',
|
|
10
|
-
title: 'Hi',
|
|
11
|
-
buttonProps: {
|
|
12
|
-
children: <p>button</p>
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
})
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
const componentMeta: ComponentMeta<typeof ImageLinkList> = {
|
|
19
|
-
title: 'Trepur Components/Other/Organisms/Image Link List',
|
|
20
|
-
component: ImageLinkList,
|
|
21
|
-
parameters: {},
|
|
22
|
-
argTypes: {
|
|
23
|
-
...idAndClassName
|
|
24
|
-
},
|
|
25
|
-
args: {
|
|
26
|
-
items: getLinks()
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
const Template: ComponentStory<typeof ImageLinkList> = (args) => <ImageLinkList {...args} />
|
|
31
|
-
|
|
32
|
-
export const _ImageLinkList = Template.bind({})
|
|
33
|
-
|
|
34
|
-
export default componentMeta
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import React from 'react'
|
|
2
|
-
import ImageLink, { Props as imageLinkProps } from '../ImageLink/index'
|
|
3
|
-
import classNames from 'classnames'
|
|
4
|
-
|
|
5
|
-
export interface Props {
|
|
6
|
-
id?: string
|
|
7
|
-
className?: string
|
|
8
|
-
items?: Array<imageLinkProps>
|
|
9
|
-
}
|
|
10
|
-
const ImageLinkList = ({
|
|
11
|
-
id,
|
|
12
|
-
className,
|
|
13
|
-
items
|
|
14
|
-
}: Props): JSX.Element => {
|
|
15
|
-
const classList = classNames(className, 'grid md:grid-cols-4 sm:grid-cols-2')
|
|
16
|
-
|
|
17
|
-
return (
|
|
18
|
-
<div id={id} className={classList}>
|
|
19
|
-
{items?.map((item, i: number) => {
|
|
20
|
-
return (
|
|
21
|
-
<ImageLink
|
|
22
|
-
key={`image_link_${i + 0}`}
|
|
23
|
-
altText='image'
|
|
24
|
-
image={item.image}
|
|
25
|
-
title={item.title}
|
|
26
|
-
/>
|
|
27
|
-
)
|
|
28
|
-
})}
|
|
29
|
-
</div>
|
|
30
|
-
)
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
export default ImageLinkList
|
|
@@ -1,86 +0,0 @@
|
|
|
1
|
-
import React from 'react'
|
|
2
|
-
import InformationIcon from './index'
|
|
3
|
-
import { ComponentStory, ComponentMeta } from '@storybook/react'
|
|
4
|
-
import { idAndClassName } from '@utils/controls'
|
|
5
|
-
|
|
6
|
-
const componentMeta: ComponentMeta<typeof InformationIcon> = {
|
|
7
|
-
title: 'Trepur Components/Rupert Bennett/Atoms/Information Icon',
|
|
8
|
-
component: InformationIcon,
|
|
9
|
-
argTypes: {
|
|
10
|
-
...idAndClassName,
|
|
11
|
-
text: {
|
|
12
|
-
type: { name: 'string', required: false },
|
|
13
|
-
description: 'The text to display on the component',
|
|
14
|
-
table: {
|
|
15
|
-
type: { summary: 'string' }
|
|
16
|
-
}
|
|
17
|
-
},
|
|
18
|
-
number: {
|
|
19
|
-
type: { name: 'number', required: false },
|
|
20
|
-
description: 'The number to display on the component',
|
|
21
|
-
table: {
|
|
22
|
-
type: { summary: 'number' }
|
|
23
|
-
}
|
|
24
|
-
},
|
|
25
|
-
bordered: {
|
|
26
|
-
type: { name: 'boolean', required: false },
|
|
27
|
-
description: 'Applies a border to the component',
|
|
28
|
-
table: {
|
|
29
|
-
type: { summary: 'boolean' }
|
|
30
|
-
},
|
|
31
|
-
defaultValue: 'false'
|
|
32
|
-
},
|
|
33
|
-
rounded: {
|
|
34
|
-
type: { name: 'boolean', required: false },
|
|
35
|
-
description: 'Enabled rounded corners on the component',
|
|
36
|
-
table: {
|
|
37
|
-
type: { summary: 'boolean' }
|
|
38
|
-
},
|
|
39
|
-
defaultValue: 'false'
|
|
40
|
-
},
|
|
41
|
-
withAnimation: {
|
|
42
|
-
type: { name: 'boolean', required: false },
|
|
43
|
-
description: 'Enabled the counter animation on the component',
|
|
44
|
-
table: {
|
|
45
|
-
type: { summary: 'boolean' }
|
|
46
|
-
},
|
|
47
|
-
defaultValue: 'false'
|
|
48
|
-
},
|
|
49
|
-
iconProps: {
|
|
50
|
-
type: { name: 'string', required: false },
|
|
51
|
-
description: 'The props to pass to the icon to display on the component',
|
|
52
|
-
table: {
|
|
53
|
-
type: { summary: 'string' }
|
|
54
|
-
}
|
|
55
|
-
},
|
|
56
|
-
theme: {
|
|
57
|
-
type: { name: 'string', required: false },
|
|
58
|
-
options: ['dark', 'light'],
|
|
59
|
-
description: 'The variant of component to render',
|
|
60
|
-
table: { type: { summary: 'light' }, defaultValue: { summary: 'light' } },
|
|
61
|
-
defaultValue: 'light',
|
|
62
|
-
control: { type: 'radio' }
|
|
63
|
-
}
|
|
64
|
-
},
|
|
65
|
-
args: {
|
|
66
|
-
text: 'Projects Completed',
|
|
67
|
-
number: 21,
|
|
68
|
-
bordered: true,
|
|
69
|
-
rounded: true,
|
|
70
|
-
withAnimation: true,
|
|
71
|
-
theme: 'dark',
|
|
72
|
-
iconProps: {
|
|
73
|
-
type: 'heart',
|
|
74
|
-
size: 2,
|
|
75
|
-
className: 'mr-4 mb-8',
|
|
76
|
-
colour: 'white',
|
|
77
|
-
bgColour: 'primary'
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
const Template: ComponentStory<typeof InformationIcon> = (args) => <InformationIcon {...args} />
|
|
83
|
-
|
|
84
|
-
export const _InformationIcon = Template.bind({})
|
|
85
|
-
|
|
86
|
-
export default componentMeta
|
|
@@ -1,84 +0,0 @@
|
|
|
1
|
-
import React, { useEffect, useRef } from 'react'
|
|
2
|
-
import Icon, { Props as iconProps } from '@components/Icon'
|
|
3
|
-
import classNames from 'classnames'
|
|
4
|
-
|
|
5
|
-
export interface Props {
|
|
6
|
-
id: string
|
|
7
|
-
className?: string
|
|
8
|
-
text?: string
|
|
9
|
-
number: number
|
|
10
|
-
bordered?: boolean
|
|
11
|
-
rounded?: boolean
|
|
12
|
-
withAnimation?: boolean
|
|
13
|
-
iconProps?: iconProps
|
|
14
|
-
theme?: 'dark' | 'light'
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
const InformationIcon = ({
|
|
18
|
-
id,
|
|
19
|
-
className,
|
|
20
|
-
text,
|
|
21
|
-
number,
|
|
22
|
-
bordered = false,
|
|
23
|
-
rounded = false,
|
|
24
|
-
withAnimation = false,
|
|
25
|
-
iconProps,
|
|
26
|
-
theme = 'light'
|
|
27
|
-
}: Props): JSX.Element => {
|
|
28
|
-
const colours = theme === 'dark' ? 'placeholder-white bg-primary text-white' : 'placeholder-primary bg-white text-primary'
|
|
29
|
-
const loaded = useRef(false)
|
|
30
|
-
|
|
31
|
-
useEffect(() => {
|
|
32
|
-
const element = document.getElementById(`${id}_number`)
|
|
33
|
-
const observer = new IntersectionObserver((entries, observer) => {
|
|
34
|
-
entries.forEach(entry => {
|
|
35
|
-
if (entry.intersectionRatio >= 0.1 && !loaded.current) {
|
|
36
|
-
loaded.current = true
|
|
37
|
-
counterAnimation(
|
|
38
|
-
document.getElementById(`${id}_number`), 0, number, 3000)
|
|
39
|
-
}
|
|
40
|
-
})
|
|
41
|
-
}, { threshold: 1 })
|
|
42
|
-
;(element != null) && withAnimation && observer.observe(element)
|
|
43
|
-
}, [])
|
|
44
|
-
|
|
45
|
-
const wrapperClasses = 'h-96 flex items-center text-center ease-out duration-300'
|
|
46
|
-
|
|
47
|
-
const classList = classNames({
|
|
48
|
-
border: bordered,
|
|
49
|
-
'rounded-2xl': rounded
|
|
50
|
-
},
|
|
51
|
-
className,
|
|
52
|
-
colours,
|
|
53
|
-
'flex flex-col justify-center w-full h-full items-center ease-out duration-300 text-md lg:text-md hover:text-lg')
|
|
54
|
-
|
|
55
|
-
const counterAnimation = (obj: any, start: number, end: number, duration: number): void => {
|
|
56
|
-
let startTimestamp: number
|
|
57
|
-
const step = (timestamp: number): void => {
|
|
58
|
-
startTimestamp = timestamp
|
|
59
|
-
const progress = Math.min((timestamp - startTimestamp) / duration, 1)
|
|
60
|
-
obj.innerHTML = Math.floor(progress * (end - start) + start)
|
|
61
|
-
if (progress < 1) {
|
|
62
|
-
window.requestAnimationFrame(step)
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
window.requestAnimationFrame(step)
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
return (
|
|
69
|
-
<div
|
|
70
|
-
id={id}
|
|
71
|
-
className={wrapperClasses}
|
|
72
|
-
>
|
|
73
|
-
<div className={classList}>
|
|
74
|
-
{(iconProps != null) &&
|
|
75
|
-
<Icon {...iconProps} />}
|
|
76
|
-
{number !== undefined &&
|
|
77
|
-
<p>{number}</p>}
|
|
78
|
-
<p>{text}</p>
|
|
79
|
-
</div>
|
|
80
|
-
</div>
|
|
81
|
-
)
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
export default InformationIcon
|
|
@@ -1,99 +0,0 @@
|
|
|
1
|
-
import React from 'react'
|
|
2
|
-
import Input from './index'
|
|
3
|
-
import { ComponentStory, ComponentMeta } from '@storybook/react'
|
|
4
|
-
|
|
5
|
-
const componentMeta: ComponentMeta<typeof Input> = {
|
|
6
|
-
title: 'Trepur Components/Rupert Bennett/Atoms/Input',
|
|
7
|
-
component: Input,
|
|
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
|
-
label: {
|
|
27
|
-
description: '',
|
|
28
|
-
control: 'text',
|
|
29
|
-
table: {
|
|
30
|
-
category: ''
|
|
31
|
-
}
|
|
32
|
-
},
|
|
33
|
-
placeholder: {
|
|
34
|
-
description: '',
|
|
35
|
-
control: 'text',
|
|
36
|
-
table: {
|
|
37
|
-
category: ''
|
|
38
|
-
}
|
|
39
|
-
},
|
|
40
|
-
bold: {
|
|
41
|
-
description: '',
|
|
42
|
-
control: 'boolean',
|
|
43
|
-
table: {
|
|
44
|
-
category: ''
|
|
45
|
-
}
|
|
46
|
-
},
|
|
47
|
-
required: {
|
|
48
|
-
description: '',
|
|
49
|
-
control: 'boolean',
|
|
50
|
-
table: {
|
|
51
|
-
category: ''
|
|
52
|
-
}
|
|
53
|
-
},
|
|
54
|
-
hasValidation: {
|
|
55
|
-
description: '',
|
|
56
|
-
control: 'boolean',
|
|
57
|
-
table: {
|
|
58
|
-
category: ''
|
|
59
|
-
}
|
|
60
|
-
},
|
|
61
|
-
errors: {
|
|
62
|
-
description: '',
|
|
63
|
-
control: 'array',
|
|
64
|
-
table: {
|
|
65
|
-
category: ''
|
|
66
|
-
}
|
|
67
|
-
},
|
|
68
|
-
value: {
|
|
69
|
-
description: 'The default value of the input',
|
|
70
|
-
control: 'text',
|
|
71
|
-
table: {
|
|
72
|
-
category: ''
|
|
73
|
-
}
|
|
74
|
-
},
|
|
75
|
-
theme: {
|
|
76
|
-
type: { name: 'string', required: false },
|
|
77
|
-
options: ['dark', 'light'],
|
|
78
|
-
description: 'The variant of button to render',
|
|
79
|
-
table: { type: { summary: 'dark' }, defaultValue: { summary: 'dark' } },
|
|
80
|
-
defaultValue: 'dark',
|
|
81
|
-
control: { type: 'radio' }
|
|
82
|
-
}
|
|
83
|
-
},
|
|
84
|
-
args: {
|
|
85
|
-
label: 'This is a label',
|
|
86
|
-
placeholder: 'This is a placeholder',
|
|
87
|
-
errors: [
|
|
88
|
-
'This is an error',
|
|
89
|
-
'This is another error',
|
|
90
|
-
'This is a third error'
|
|
91
|
-
]
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
const Template: ComponentStory<typeof Input> = (args) => <Input {...args} />
|
|
96
|
-
|
|
97
|
-
export const _Input = Template.bind({})
|
|
98
|
-
|
|
99
|
-
export default componentMeta
|
|
@@ -1,126 +0,0 @@
|
|
|
1
|
-
import React from 'react'
|
|
2
|
-
import classNames from 'classnames'
|
|
3
|
-
|
|
4
|
-
export interface Props {
|
|
5
|
-
id?: string
|
|
6
|
-
className?: string
|
|
7
|
-
labelClasses?: string
|
|
8
|
-
inputClasses?: string
|
|
9
|
-
autoComplete?: string
|
|
10
|
-
disabled?: boolean
|
|
11
|
-
formId?: string
|
|
12
|
-
height?: string
|
|
13
|
-
maxLength?: number
|
|
14
|
-
minLength?: number
|
|
15
|
-
pattern?: string
|
|
16
|
-
required?: boolean
|
|
17
|
-
readOnly?: boolean
|
|
18
|
-
label?: string
|
|
19
|
-
type?: string
|
|
20
|
-
name?: string
|
|
21
|
-
placeholder?: string
|
|
22
|
-
hasValidation?: boolean
|
|
23
|
-
bold?: boolean
|
|
24
|
-
autoFocus?: boolean
|
|
25
|
-
onChange?: (e: any) => void
|
|
26
|
-
onBlur?: () => void
|
|
27
|
-
onFocus?: () => void
|
|
28
|
-
errors?: string[]
|
|
29
|
-
value?: string
|
|
30
|
-
theme?: 'dark' | 'light'
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
const Input = ({
|
|
34
|
-
id,
|
|
35
|
-
className,
|
|
36
|
-
labelClasses,
|
|
37
|
-
inputClasses,
|
|
38
|
-
autoComplete,
|
|
39
|
-
disabled,
|
|
40
|
-
formId,
|
|
41
|
-
height,
|
|
42
|
-
maxLength,
|
|
43
|
-
minLength,
|
|
44
|
-
pattern,
|
|
45
|
-
required,
|
|
46
|
-
readOnly,
|
|
47
|
-
autoFocus,
|
|
48
|
-
label,
|
|
49
|
-
type,
|
|
50
|
-
name,
|
|
51
|
-
placeholder,
|
|
52
|
-
bold,
|
|
53
|
-
onChange,
|
|
54
|
-
onBlur,
|
|
55
|
-
onFocus,
|
|
56
|
-
hasValidation,
|
|
57
|
-
errors,
|
|
58
|
-
value,
|
|
59
|
-
theme
|
|
60
|
-
}: Props): JSX.Element => {
|
|
61
|
-
const colours = theme === 'dark' ? 'placeholder-white bg-primary text-white' : 'placeholder-primary bg-white text-primary'
|
|
62
|
-
const classList = classNames(className, colours, 'flex flex-col')
|
|
63
|
-
|
|
64
|
-
const labelClassList = classNames({
|
|
65
|
-
'font-bold': bold
|
|
66
|
-
}, labelClasses, 'w-auto pb-2')
|
|
67
|
-
|
|
68
|
-
const inputClassList = classNames({
|
|
69
|
-
}, inputClasses, colours, 'border px-2 py-2 mb-2 rounded-md')
|
|
70
|
-
|
|
71
|
-
const newId = id !== undefined ? `-${id}` : ''
|
|
72
|
-
return (
|
|
73
|
-
<div
|
|
74
|
-
id={id}
|
|
75
|
-
className={classList}
|
|
76
|
-
>
|
|
77
|
-
{label !== undefined &&
|
|
78
|
-
<label
|
|
79
|
-
id={`label${newId}`}
|
|
80
|
-
className={labelClassList}
|
|
81
|
-
htmlFor={`input${newId}`}
|
|
82
|
-
>
|
|
83
|
-
<p>
|
|
84
|
-
{label}
|
|
85
|
-
{required === true &&
|
|
86
|
-
<span className='text-red'>*</span>}
|
|
87
|
-
</p>
|
|
88
|
-
</label>}
|
|
89
|
-
<input
|
|
90
|
-
id={`input${newId}`}
|
|
91
|
-
className={inputClassList}
|
|
92
|
-
autoComplete={autoComplete}
|
|
93
|
-
disabled={disabled}
|
|
94
|
-
form={formId}
|
|
95
|
-
height={height}
|
|
96
|
-
maxLength={maxLength}
|
|
97
|
-
minLength={minLength}
|
|
98
|
-
pattern={pattern}
|
|
99
|
-
required={required}
|
|
100
|
-
readOnly={readOnly}
|
|
101
|
-
type={type}
|
|
102
|
-
name={name}
|
|
103
|
-
value={value}
|
|
104
|
-
placeholder={placeholder}
|
|
105
|
-
onChange={onChange}
|
|
106
|
-
onBlur={onBlur}
|
|
107
|
-
onFocus={onFocus}
|
|
108
|
-
/>
|
|
109
|
-
{hasValidation === true &&
|
|
110
|
-
<div id={`errors${newId}`}>
|
|
111
|
-
{errors?.map((error, i) => {
|
|
112
|
-
return (
|
|
113
|
-
<p
|
|
114
|
-
key={`error_msg_${i + 0}`}
|
|
115
|
-
className='text-red text-sm'
|
|
116
|
-
>
|
|
117
|
-
{error}
|
|
118
|
-
</p>
|
|
119
|
-
)
|
|
120
|
-
})}
|
|
121
|
-
</div>}
|
|
122
|
-
</div>
|
|
123
|
-
)
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
export default Input
|