trepur_components 1.0.2 → 1.0.3
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/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/FooterBar/{footerBar.stories.d.ts → FooterBar.stories.d.ts} +0 -0
- package/dist/src/lib/components/FooterBar/{footerBar.stories.js → FooterBar.stories.js} +1 -1
- package/dist/src/lib/components/FooterBar/{footerBar.stories.js.map → FooterBar.stories.js.map} +1 -1
- package/dist/src/lib/components/Nav/index.js +2 -2
- package/dist/src/lib/components/Nav/index.js.map +1 -1
- package/package.json +1 -1
- 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.css +0 -133
- package/dist/components/Timeline/index.tsx +0 -315
- package/dist/components/Tubestops/Tubestops.stories.tsx +0 -66
- package/dist/components/Tubestops/index.css +0 -92
- 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/styles/base.css +0 -73
|
@@ -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
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import React from 'react'
|
|
2
|
-
import { idAndClassName } from '@utils/controls'
|
|
3
|
-
import Jumbotron from './index'
|
|
4
|
-
import { ComponentStory, ComponentMeta } from '@storybook/react'
|
|
5
|
-
|
|
6
|
-
const componentMeta: ComponentMeta<typeof Jumbotron> = {
|
|
7
|
-
title: 'Trepur Components/Rupert Bennett/Organisms/Jumbotron',
|
|
8
|
-
component: Jumbotron,
|
|
9
|
-
parameters: {},
|
|
10
|
-
argTypes: {
|
|
11
|
-
...idAndClassName
|
|
12
|
-
},
|
|
13
|
-
args: {
|
|
14
|
-
image: 'https://picsum.photos/1500/400'
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
const Template: ComponentStory<typeof Jumbotron> = (args) => <Jumbotron {...args} />
|
|
19
|
-
|
|
20
|
-
export const _Jumbotron = Template.bind({})
|
|
21
|
-
|
|
22
|
-
export default componentMeta
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import React 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
|
-
}
|
|
10
|
-
const Jumbotron = ({
|
|
11
|
-
id,
|
|
12
|
-
className,
|
|
13
|
-
image,
|
|
14
|
-
altText
|
|
15
|
-
}: Props): JSX.Element => {
|
|
16
|
-
const classList = classNames(className)
|
|
17
|
-
|
|
18
|
-
return (
|
|
19
|
-
<div id={id} className={classList}>
|
|
20
|
-
<img className='w-full object-cover' src={image} alt={altText} />
|
|
21
|
-
</div>
|
|
22
|
-
)
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
export default Jumbotron
|
|
@@ -1,155 +0,0 @@
|
|
|
1
|
-
import React from 'react'
|
|
2
|
-
import Nav from './index'
|
|
3
|
-
import { idAndClassName } from '@utils/controls'
|
|
4
|
-
import { ComponentStory, ComponentMeta } from '@storybook/react'
|
|
5
|
-
import logoDarkTheme from '@assets/images/primary-logo-bold.png'
|
|
6
|
-
import logoImage from '@assets/images/secondary-logo-bold.png'
|
|
7
|
-
|
|
8
|
-
const navLinks = [
|
|
9
|
-
{ title: 'Home', href: '/', isActive: true },
|
|
10
|
-
{ title: 'Resume', href: '/', isActive: false },
|
|
11
|
-
{ title: 'Contact Me', href: '/', isActive: false }
|
|
12
|
-
]
|
|
13
|
-
|
|
14
|
-
const componentMeta: ComponentMeta<typeof Nav> = {
|
|
15
|
-
title: 'Trepur Components/Rupert Bennett/Organisms/Nav',
|
|
16
|
-
component: Nav,
|
|
17
|
-
parameters: {
|
|
18
|
-
backgrounds: {
|
|
19
|
-
default: 'grey',
|
|
20
|
-
values: [
|
|
21
|
-
{
|
|
22
|
-
name: 'grey',
|
|
23
|
-
value: '#f3f3f3'
|
|
24
|
-
}
|
|
25
|
-
]
|
|
26
|
-
}
|
|
27
|
-
},
|
|
28
|
-
argTypes: {
|
|
29
|
-
...idAndClassName,
|
|
30
|
-
navLinks: {
|
|
31
|
-
description: 'An array of nav links to display in the component',
|
|
32
|
-
table: {
|
|
33
|
-
type: { summary: 'array' }
|
|
34
|
-
}
|
|
35
|
-
},
|
|
36
|
-
asSideBar: {
|
|
37
|
-
type: { name: 'boolean', required: false },
|
|
38
|
-
description: 'Sets the expanding mechanism to work as a side bar on mobile',
|
|
39
|
-
table: {
|
|
40
|
-
type: { summary: 'boolean' }
|
|
41
|
-
}
|
|
42
|
-
},
|
|
43
|
-
dropdownNavHeight: {
|
|
44
|
-
type: { name: 'string', required: false },
|
|
45
|
-
description: 'The distance in which the dropdown should come on mobile',
|
|
46
|
-
table: {
|
|
47
|
-
type: { summary: 'string' }
|
|
48
|
-
}
|
|
49
|
-
},
|
|
50
|
-
logo: {
|
|
51
|
-
type: { name: 'string', required: false },
|
|
52
|
-
description: 'The logo to display on the component',
|
|
53
|
-
table: {
|
|
54
|
-
type: { summary: 'string' }
|
|
55
|
-
}
|
|
56
|
-
},
|
|
57
|
-
logoDarkTheme: {
|
|
58
|
-
type: { name: 'string', required: false },
|
|
59
|
-
description: 'An optional dark them logo for dark mode',
|
|
60
|
-
table: {
|
|
61
|
-
type: { summary: 'string' }
|
|
62
|
-
}
|
|
63
|
-
},
|
|
64
|
-
mobileLogo: {
|
|
65
|
-
type: { name: 'string', required: false },
|
|
66
|
-
description: 'An optional mobile logo for mobile devices',
|
|
67
|
-
table: {
|
|
68
|
-
type: { summary: 'string' }
|
|
69
|
-
}
|
|
70
|
-
},
|
|
71
|
-
mobileLogoDarkTheme: {
|
|
72
|
-
type: { name: 'string', required: false },
|
|
73
|
-
description: 'An optional dark them mobile logo for mobile dark mode',
|
|
74
|
-
table: {
|
|
75
|
-
type: { summary: 'string' }
|
|
76
|
-
}
|
|
77
|
-
},
|
|
78
|
-
logoLink: {
|
|
79
|
-
type: { name: 'string', required: false },
|
|
80
|
-
description: 'The link to navigate to when clicking on the logo',
|
|
81
|
-
table: {
|
|
82
|
-
type: { summary: 'string' }
|
|
83
|
-
}
|
|
84
|
-
},
|
|
85
|
-
mobileClasses: {
|
|
86
|
-
type: { name: 'string', required: false },
|
|
87
|
-
description: '',
|
|
88
|
-
table: {
|
|
89
|
-
type: { summary: 'string' }
|
|
90
|
-
}
|
|
91
|
-
},
|
|
92
|
-
fixedTop: {
|
|
93
|
-
type: { name: 'boolean', required: false },
|
|
94
|
-
description: 'Sets the header to fix at the top when true',
|
|
95
|
-
table: {
|
|
96
|
-
type: { summary: 'boolean' }
|
|
97
|
-
}
|
|
98
|
-
},
|
|
99
|
-
getNavStatus: {
|
|
100
|
-
type: { name: 'boolean', required: false },
|
|
101
|
-
description: 'Returns the status of the header, opened or closed in mobile',
|
|
102
|
-
table: {
|
|
103
|
-
type: { summary: 'function' }
|
|
104
|
-
}
|
|
105
|
-
},
|
|
106
|
-
theme: {
|
|
107
|
-
type: { name: 'string', required: false },
|
|
108
|
-
options: ['dark', 'light'],
|
|
109
|
-
description: 'The them to render the component in',
|
|
110
|
-
table: {
|
|
111
|
-
type: { summary: 'dark' },
|
|
112
|
-
defaultValue: { summary: 'dark' }
|
|
113
|
-
},
|
|
114
|
-
defaultValue: 'dark',
|
|
115
|
-
control: { type: 'radio' }
|
|
116
|
-
},
|
|
117
|
-
text: {
|
|
118
|
-
type: { name: 'string', required: false },
|
|
119
|
-
description: 'Text to display on the component',
|
|
120
|
-
table: {
|
|
121
|
-
type: { summary: 'string' }
|
|
122
|
-
}
|
|
123
|
-
},
|
|
124
|
-
textLink: {
|
|
125
|
-
type: { name: 'string', required: false },
|
|
126
|
-
description: 'A link to navigate to when clicking on the text in the component',
|
|
127
|
-
control: 'string',
|
|
128
|
-
table: {
|
|
129
|
-
category: ''
|
|
130
|
-
}
|
|
131
|
-
}
|
|
132
|
-
},
|
|
133
|
-
args: {
|
|
134
|
-
logoLink: '/',
|
|
135
|
-
navLinks,
|
|
136
|
-
asSideBar: true,
|
|
137
|
-
dropdownNavHeight: '80',
|
|
138
|
-
logo: logoImage,
|
|
139
|
-
logoDarkTheme,
|
|
140
|
-
mobileLogo: logoImage,
|
|
141
|
-
mobileLogoDarkTheme: logoDarkTheme,
|
|
142
|
-
fixedTop: true,
|
|
143
|
-
theme: 'dark',
|
|
144
|
-
text: 'rupertbennett.com',
|
|
145
|
-
getNavStatus: (status) => {
|
|
146
|
-
console.log(status ? 'open' : 'closed')
|
|
147
|
-
}
|
|
148
|
-
}
|
|
149
|
-
}
|
|
150
|
-
|
|
151
|
-
const Template: ComponentStory<typeof Nav> = (args) => <Nav {...args} />
|
|
152
|
-
|
|
153
|
-
export const _Nav = Template.bind({})
|
|
154
|
-
|
|
155
|
-
export default componentMeta
|