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,114 +0,0 @@
|
|
|
1
|
-
import React from 'react'
|
|
2
|
-
import classNames from 'classnames'
|
|
3
|
-
|
|
4
|
-
export interface Props {
|
|
5
|
-
id?: string
|
|
6
|
-
className?: string
|
|
7
|
-
sm?: number
|
|
8
|
-
md?: number
|
|
9
|
-
lg?: number
|
|
10
|
-
xl?: number
|
|
11
|
-
children?: any
|
|
12
|
-
}
|
|
13
|
-
const Column: React.FC<Props> = ({
|
|
14
|
-
id,
|
|
15
|
-
className,
|
|
16
|
-
sm = 1,
|
|
17
|
-
md = 1,
|
|
18
|
-
lg = 1,
|
|
19
|
-
xl = 1,
|
|
20
|
-
children
|
|
21
|
-
}: Props): JSX.Element => {
|
|
22
|
-
const widthOptions = [
|
|
23
|
-
{ 1: 'w-1/12' },
|
|
24
|
-
{ 2: 'w-2/12' },
|
|
25
|
-
{ 3: 'w-3/12' },
|
|
26
|
-
{ 4: 'w-4/12' },
|
|
27
|
-
{ 5: 'w-5/12' },
|
|
28
|
-
{ 6: 'w-6/12' },
|
|
29
|
-
{ 7: 'w-7/12' },
|
|
30
|
-
{ 8: 'w-8/12' },
|
|
31
|
-
{ 9: 'w-9/12' },
|
|
32
|
-
{ 10: 'w-10/12' },
|
|
33
|
-
{ 11: 'w-11/12' },
|
|
34
|
-
{ 12: 'w-full' }
|
|
35
|
-
]
|
|
36
|
-
|
|
37
|
-
const mdWidthOptions = [
|
|
38
|
-
{ 1: 'md:w-1/12' },
|
|
39
|
-
{ 2: 'md:w-2/12' },
|
|
40
|
-
{ 3: 'md:w-3/12' },
|
|
41
|
-
{ 4: 'md:w-4/12' },
|
|
42
|
-
{ 5: 'md:w-5/12' },
|
|
43
|
-
{ 6: 'md:w-6/12' },
|
|
44
|
-
{ 7: 'md:w-7/12' },
|
|
45
|
-
{ 8: 'md:w-8/12' },
|
|
46
|
-
{ 9: 'md:w-9/12' },
|
|
47
|
-
{ 10: 'md:w-10/12' },
|
|
48
|
-
{ 11: 'md:w-11/12' },
|
|
49
|
-
{ 12: 'md:w-full' }
|
|
50
|
-
]
|
|
51
|
-
|
|
52
|
-
const lgWidthOptions = [
|
|
53
|
-
{ 1: 'lg:w-1/12' },
|
|
54
|
-
{ 2: 'lg:w-2/12' },
|
|
55
|
-
{ 3: 'lg:w-3/12' },
|
|
56
|
-
{ 4: 'lg:w-4/12' },
|
|
57
|
-
{ 5: 'lg:w-5/12' },
|
|
58
|
-
{ 6: 'lg:w-6/12' },
|
|
59
|
-
{ 7: 'lg:w-7/12' },
|
|
60
|
-
{ 8: 'lg:w-8/12' },
|
|
61
|
-
{ 9: 'lg:w-9/12' },
|
|
62
|
-
{ 10: 'lg:w-10/12' },
|
|
63
|
-
{ 11: 'lg:w-11/12' },
|
|
64
|
-
{ 12: 'lg:w-full' }
|
|
65
|
-
]
|
|
66
|
-
|
|
67
|
-
const xlWidthOptions = [
|
|
68
|
-
{ 1: 'xl:w-1/12' },
|
|
69
|
-
{ 2: 'xl:w-2/12' },
|
|
70
|
-
{ 3: 'xl:w-3/12' },
|
|
71
|
-
{ 4: 'xl:w-4/12' },
|
|
72
|
-
{ 5: 'xl:w-5/12' },
|
|
73
|
-
{ 6: 'xl:w-6/12' },
|
|
74
|
-
{ 7: 'xl:w-7/12' },
|
|
75
|
-
{ 8: 'xl:w-8/12' },
|
|
76
|
-
{ 9: 'xl:w-9/12' },
|
|
77
|
-
{ 10: 'xl:w-10/12' },
|
|
78
|
-
{ 11: 'xl:w-11/12' },
|
|
79
|
-
{ 12: 'xl:w-full' }
|
|
80
|
-
]
|
|
81
|
-
|
|
82
|
-
const calculateWidth = (screen: any, size: number): string => {
|
|
83
|
-
switch (screen) {
|
|
84
|
-
case 'sm':
|
|
85
|
-
return Object.values(widthOptions[size - 1]).toString()
|
|
86
|
-
case 'md':
|
|
87
|
-
return Object.values(mdWidthOptions[size - 1]).toString()
|
|
88
|
-
case 'lg':
|
|
89
|
-
return Object.values(lgWidthOptions[size - 1]).toString()
|
|
90
|
-
case 'xl':
|
|
91
|
-
return Object.values(xlWidthOptions[size - 1]).toString()
|
|
92
|
-
default:
|
|
93
|
-
return Object.values(widthOptions[size - 1]).toString()
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
const classList = classNames({
|
|
98
|
-
[calculateWidth('sm', sm)]: sm,
|
|
99
|
-
[calculateWidth('md', md)]: md,
|
|
100
|
-
[calculateWidth('lg', lg)]: lg,
|
|
101
|
-
[calculateWidth('xl', xl)]: xl
|
|
102
|
-
}, className, 'h-full')
|
|
103
|
-
|
|
104
|
-
return (
|
|
105
|
-
<div
|
|
106
|
-
id={id}
|
|
107
|
-
className={classList}
|
|
108
|
-
>
|
|
109
|
-
{children}
|
|
110
|
-
</div>
|
|
111
|
-
)
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
export default Column
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import React from 'react'
|
|
2
|
-
import Container from './index'
|
|
3
|
-
import { idAndClassName } from '@utils/controls'
|
|
4
|
-
import { ComponentStory, ComponentMeta } from '@storybook/react'
|
|
5
|
-
|
|
6
|
-
const componentMeta: ComponentMeta<typeof Container> = {
|
|
7
|
-
title: 'Trepur Components/Rupert Bennett/Atoms/Container',
|
|
8
|
-
component: Container,
|
|
9
|
-
argTypes: {
|
|
10
|
-
...idAndClassName,
|
|
11
|
-
maxWidth: {
|
|
12
|
-
type: { name: 'number', required: false },
|
|
13
|
-
description: 'The number of pixles for the component to span',
|
|
14
|
-
control: { type: 'number', min: 1, step: 1 },
|
|
15
|
-
defaultValue: '1200'
|
|
16
|
-
},
|
|
17
|
-
children: {
|
|
18
|
-
type: { name: 'other', value: 'string | React.ReactNode' },
|
|
19
|
-
description: 'The child elements to show in the component',
|
|
20
|
-
table: {
|
|
21
|
-
type: {
|
|
22
|
-
summary: 'Array'
|
|
23
|
-
},
|
|
24
|
-
defaultValue: { summary: 'undefined' }
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
},
|
|
28
|
-
args: {
|
|
29
|
-
className: 'border',
|
|
30
|
-
children: <p>This is a centered container with a max width</p>
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
const Template: ComponentStory<typeof Container> = (args) => <Container {...args} />
|
|
35
|
-
|
|
36
|
-
export const _Container = Template.bind({})
|
|
37
|
-
|
|
38
|
-
export default componentMeta
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import React from 'react'
|
|
2
|
-
import classNames from 'classnames'
|
|
3
|
-
|
|
4
|
-
export interface Props {
|
|
5
|
-
id?: string
|
|
6
|
-
className?: string
|
|
7
|
-
maxWidth?: number
|
|
8
|
-
children?: any
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
const Container = ({
|
|
12
|
-
id,
|
|
13
|
-
className,
|
|
14
|
-
maxWidth = 1200,
|
|
15
|
-
children
|
|
16
|
-
}: Props): JSX.Element => {
|
|
17
|
-
const classList = classNames(className, 'mx-auto')
|
|
18
|
-
|
|
19
|
-
return (
|
|
20
|
-
<div
|
|
21
|
-
id={id}
|
|
22
|
-
className={classList}
|
|
23
|
-
style={{ maxWidth: `${maxWidth}px` }}
|
|
24
|
-
>
|
|
25
|
-
{children}
|
|
26
|
-
</div>
|
|
27
|
-
)
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
export default Container
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
import React from 'react'
|
|
2
|
-
import FooterBar from './index'
|
|
3
|
-
import { idAndClassName } from '@utils/controls'
|
|
4
|
-
import { ComponentStory, ComponentMeta } from '@storybook/react'
|
|
5
|
-
import { action } from '@storybook/addon-actions'
|
|
6
|
-
|
|
7
|
-
const componentMeta: ComponentMeta<typeof FooterBar> = {
|
|
8
|
-
title: 'Trepur Components/Rupert Bennett/Organisms/Footer Bar',
|
|
9
|
-
component: FooterBar,
|
|
10
|
-
parameters: {},
|
|
11
|
-
argTypes: {
|
|
12
|
-
...idAndClassName,
|
|
13
|
-
text: {
|
|
14
|
-
type: { name: 'string', required: false },
|
|
15
|
-
description: 'The text to show on the component',
|
|
16
|
-
table: {
|
|
17
|
-
type: { summary: 'default' }
|
|
18
|
-
},
|
|
19
|
-
defaultValue: { summary: 'undefined' }
|
|
20
|
-
},
|
|
21
|
-
buttonProps: {
|
|
22
|
-
type: { name: 'other', value: 'object' },
|
|
23
|
-
description: 'The props to pass to the button to display on the component',
|
|
24
|
-
table: {
|
|
25
|
-
type: {
|
|
26
|
-
summary: 'object'
|
|
27
|
-
},
|
|
28
|
-
defaultValue: { summary: 'undefined' }
|
|
29
|
-
}
|
|
30
|
-
},
|
|
31
|
-
theme: {
|
|
32
|
-
type: { name: 'string', required: false },
|
|
33
|
-
options: ['dark', 'light'],
|
|
34
|
-
description: 'The variant of button to render',
|
|
35
|
-
table: {
|
|
36
|
-
type: { summary: 'light' },
|
|
37
|
-
defaultValue: { summary: 'light' }
|
|
38
|
-
},
|
|
39
|
-
defaultValue: 'light',
|
|
40
|
-
control: { type: 'radio' }
|
|
41
|
-
}
|
|
42
|
-
},
|
|
43
|
-
args: {
|
|
44
|
-
text: 'RupertBennett.com Copyright 2022 All rights reserved',
|
|
45
|
-
theme: 'dark',
|
|
46
|
-
buttonProps: {
|
|
47
|
-
children: 'Admin Panel',
|
|
48
|
-
onClick: action('button clicked')
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
const Template: ComponentStory<typeof FooterBar> = (args) => <FooterBar {...args} />
|
|
54
|
-
|
|
55
|
-
export const _FooterBar = Template.bind({})
|
|
56
|
-
|
|
57
|
-
export default componentMeta
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import React from 'react'
|
|
2
|
-
import classNames from 'classnames'
|
|
3
|
-
import Button, { Props as buttonProps } from '@components/Button'
|
|
4
|
-
|
|
5
|
-
export interface Props {
|
|
6
|
-
id?: string
|
|
7
|
-
className?: string
|
|
8
|
-
buttonProps?: buttonProps
|
|
9
|
-
text?: string
|
|
10
|
-
theme?: 'light' | 'dark'
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
const Nav = ({
|
|
14
|
-
id,
|
|
15
|
-
className,
|
|
16
|
-
text,
|
|
17
|
-
buttonProps,
|
|
18
|
-
theme
|
|
19
|
-
}: Props): JSX.Element => {
|
|
20
|
-
const colours = theme === 'dark' ? 'bg-primary text-white' : 'bg-white text-primary'
|
|
21
|
-
const classList = classNames(className, colours, 'block md:flex flex-wrap justify-between items-center h-auto')
|
|
22
|
-
const textClasses = 'text-center pt-8 pb-4 md:pb-0 md:my-8 md:pt-0 md:pl-16'
|
|
23
|
-
const buttonClasses = 'text-center pb-8 pt-4 md:pb-0 md:pt-0 md:pr-16'
|
|
24
|
-
|
|
25
|
-
return (
|
|
26
|
-
<div id={id} className={classList}>
|
|
27
|
-
<div className={textClasses}>
|
|
28
|
-
{text}
|
|
29
|
-
</div>
|
|
30
|
-
<div className={buttonClasses}>
|
|
31
|
-
<Button
|
|
32
|
-
variant={theme === 'dark' ? 'primary' : 'secondary'}
|
|
33
|
-
rounded
|
|
34
|
-
href={buttonProps?.href}
|
|
35
|
-
onClick={buttonProps?.onClick}
|
|
36
|
-
>
|
|
37
|
-
{buttonProps?.children}
|
|
38
|
-
</Button>
|
|
39
|
-
</div>
|
|
40
|
-
</div>
|
|
41
|
-
)
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
export default Nav
|
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
import React from 'react'
|
|
2
|
-
import { idAndClassName } from '@utils/controls'
|
|
3
|
-
import Form from './index'
|
|
4
|
-
import { ComponentStory, ComponentMeta } from '@storybook/react'
|
|
5
|
-
|
|
6
|
-
const componentMeta: ComponentMeta<typeof Form> = {
|
|
7
|
-
title: 'Trepur Components/Rupert Bennett/Organisms/Form',
|
|
8
|
-
component: Form,
|
|
9
|
-
parameters: {},
|
|
10
|
-
argTypes: {
|
|
11
|
-
...idAndClassName,
|
|
12
|
-
title: {
|
|
13
|
-
type: { name: 'string', required: false },
|
|
14
|
-
description: 'The title to display on the component',
|
|
15
|
-
table: {
|
|
16
|
-
type: { summary: 'string' },
|
|
17
|
-
defaultValue: { summary: 'undefined' }
|
|
18
|
-
}
|
|
19
|
-
},
|
|
20
|
-
titleClasses: {
|
|
21
|
-
type: { name: 'string', required: false },
|
|
22
|
-
description: 'The class names to pass to the title of the component',
|
|
23
|
-
table: {
|
|
24
|
-
type: { summary: 'string' },
|
|
25
|
-
defaultValue: { summary: 'undefined' }
|
|
26
|
-
}
|
|
27
|
-
},
|
|
28
|
-
onSubmit: {
|
|
29
|
-
type: { name: 'function', required: false },
|
|
30
|
-
description: 'The action to perform when submitting the component',
|
|
31
|
-
action: 'onClick',
|
|
32
|
-
table: {
|
|
33
|
-
type: {
|
|
34
|
-
summary: 'function'
|
|
35
|
-
},
|
|
36
|
-
defaultValue: { summary: 'undefined' }
|
|
37
|
-
}
|
|
38
|
-
},
|
|
39
|
-
ref: {
|
|
40
|
-
type: { name: 'other', value: 'RefObject<TouchableOpacity>' },
|
|
41
|
-
description: 'An ref for highlighting the current element',
|
|
42
|
-
table: {
|
|
43
|
-
type: {
|
|
44
|
-
summary: 'object'
|
|
45
|
-
},
|
|
46
|
-
defaultValue: { summary: 'undefined' }
|
|
47
|
-
}
|
|
48
|
-
},
|
|
49
|
-
components: {
|
|
50
|
-
description: 'An array of component objects to pass to the component',
|
|
51
|
-
control: 'array',
|
|
52
|
-
table: {
|
|
53
|
-
type: {
|
|
54
|
-
summary: 'array'
|
|
55
|
-
},
|
|
56
|
-
defaultValue: { summary: 'undefined' }
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
},
|
|
60
|
-
args: {
|
|
61
|
-
title: 'This is a title',
|
|
62
|
-
components: [
|
|
63
|
-
{
|
|
64
|
-
htmlType: 'Input',
|
|
65
|
-
label: 'This is a label',
|
|
66
|
-
placeholder: 'This is a placeholder',
|
|
67
|
-
children: 'Submit'
|
|
68
|
-
},
|
|
69
|
-
{
|
|
70
|
-
htmlType: 'Input',
|
|
71
|
-
label: 'This is a label',
|
|
72
|
-
placeholder: 'This is a placeholder',
|
|
73
|
-
children: 'Submit'
|
|
74
|
-
},
|
|
75
|
-
{
|
|
76
|
-
htmlType: 'Input',
|
|
77
|
-
label: 'This is a label',
|
|
78
|
-
placeholder: 'This is a placeholder',
|
|
79
|
-
children: 'Submit'
|
|
80
|
-
},
|
|
81
|
-
{
|
|
82
|
-
htmlType: 'Button',
|
|
83
|
-
children: 'Submit'
|
|
84
|
-
}
|
|
85
|
-
]
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
const Template: ComponentStory<typeof Form> = (args) => <Form {...args} />
|
|
90
|
-
|
|
91
|
-
export const _Form = Template.bind({})
|
|
92
|
-
|
|
93
|
-
export default componentMeta
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
import React from 'react'
|
|
2
|
-
import Button, { Props as buttonProps } from '@components/Button'
|
|
3
|
-
import Input, { Props as inputProps } from '@components/Input'
|
|
4
|
-
|
|
5
|
-
export interface Props {
|
|
6
|
-
id?: string
|
|
7
|
-
className?: string
|
|
8
|
-
title?: string
|
|
9
|
-
titleClasses?: string
|
|
10
|
-
onSubmit?: () => void
|
|
11
|
-
ref?: string
|
|
12
|
-
components?: Array<inputProps & buttonProps & { htmlType: string }>
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
const Form = ({
|
|
16
|
-
id,
|
|
17
|
-
className,
|
|
18
|
-
title,
|
|
19
|
-
titleClasses,
|
|
20
|
-
onSubmit,
|
|
21
|
-
ref,
|
|
22
|
-
components
|
|
23
|
-
}: Props): JSX.Element => {
|
|
24
|
-
return (
|
|
25
|
-
<>
|
|
26
|
-
<h1 className={titleClasses}>{title}</h1>
|
|
27
|
-
<form id={id} ref={ref} className={className} onSubmit={onSubmit}>
|
|
28
|
-
{components?.map((component, i) => {
|
|
29
|
-
if (component?.htmlType === 'Input') {
|
|
30
|
-
return (
|
|
31
|
-
<Input
|
|
32
|
-
key={`input_${i + 0}`}
|
|
33
|
-
className={component?.className}
|
|
34
|
-
label={component?.label}
|
|
35
|
-
placeholder={component?.placeholder}
|
|
36
|
-
type={component?.type}
|
|
37
|
-
name={component?.name}
|
|
38
|
-
/>
|
|
39
|
-
)
|
|
40
|
-
} else if (component.htmlType === 'Button') {
|
|
41
|
-
return (
|
|
42
|
-
<Button
|
|
43
|
-
key={`button_${i + 0}`}
|
|
44
|
-
type={component?.type}
|
|
45
|
-
onClick={component?.onClick}
|
|
46
|
-
className={component?.className}
|
|
47
|
-
>
|
|
48
|
-
{component?.children}
|
|
49
|
-
</Button>
|
|
50
|
-
)
|
|
51
|
-
} else return <></>
|
|
52
|
-
})}
|
|
53
|
-
</form>
|
|
54
|
-
</>
|
|
55
|
-
)
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
export default Form
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import React from 'react'
|
|
2
|
-
import FyreCard from './index'
|
|
3
|
-
import { idAndClassName } from '@utils/controls'
|
|
4
|
-
import { ComponentStory, ComponentMeta } from '@storybook/react'
|
|
5
|
-
|
|
6
|
-
const componentMeta: ComponentMeta<typeof FyreCard> = {
|
|
7
|
-
title: 'Trepur Components/Other/Organisms/Fyre Card',
|
|
8
|
-
component: FyreCard,
|
|
9
|
-
parameters: {},
|
|
10
|
-
argTypes: {
|
|
11
|
-
...idAndClassName,
|
|
12
|
-
image: {
|
|
13
|
-
description: '',
|
|
14
|
-
control: 'text',
|
|
15
|
-
table: {
|
|
16
|
-
category: ''
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
},
|
|
20
|
-
args: {
|
|
21
|
-
image: 'https://picsum.photos/500/300'
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
const Template: ComponentStory<typeof FyreCard> = (args) => <FyreCard {...args} />
|
|
26
|
-
|
|
27
|
-
export const _FyreCard = Template.bind({})
|
|
28
|
-
|
|
29
|
-
export default componentMeta
|
|
@@ -1,46 +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
|
-
imageClass?: string
|
|
10
|
-
altText?: string
|
|
11
|
-
bordered?: string
|
|
12
|
-
buttonProps?: buttonProps
|
|
13
|
-
}
|
|
14
|
-
const FyreCard = ({
|
|
15
|
-
id,
|
|
16
|
-
className,
|
|
17
|
-
image,
|
|
18
|
-
imageClass,
|
|
19
|
-
altText,
|
|
20
|
-
bordered,
|
|
21
|
-
buttonProps
|
|
22
|
-
}: Props): JSX.Element => {
|
|
23
|
-
const classList = classNames({
|
|
24
|
-
'border border-grey border-opacity-100': bordered
|
|
25
|
-
}, className, 'flex flex-col')
|
|
26
|
-
const imageClassList = classNames(imageClass, 'w-full')
|
|
27
|
-
|
|
28
|
-
return (
|
|
29
|
-
<div
|
|
30
|
-
key={id}
|
|
31
|
-
id={id}
|
|
32
|
-
className={classList}
|
|
33
|
-
>
|
|
34
|
-
<div className='card-content flex flex-1 flex-col'>
|
|
35
|
-
<div>
|
|
36
|
-
<img className={imageClassList} src={image} alt={altText} />
|
|
37
|
-
</div>
|
|
38
|
-
<div className='flex justify-end'>
|
|
39
|
-
<Button {...buttonProps}>{buttonProps?.children}</Button>
|
|
40
|
-
</div>
|
|
41
|
-
</div>
|
|
42
|
-
</div>
|
|
43
|
-
)
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
export default FyreCard
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import React from 'react'
|
|
2
|
-
import Greeting from './index'
|
|
3
|
-
import { ComponentStory, ComponentMeta } from '@storybook/react'
|
|
4
|
-
import { idAndClassName } from '@utils/controls'
|
|
5
|
-
|
|
6
|
-
const componentMeta: ComponentMeta<typeof Greeting> = {
|
|
7
|
-
title: 'Trepur Components/Rupert Bennett/Atoms/Greeting',
|
|
8
|
-
component: Greeting,
|
|
9
|
-
argTypes: {
|
|
10
|
-
...idAndClassName,
|
|
11
|
-
morningMessage: {
|
|
12
|
-
type: { name: 'string', required: false },
|
|
13
|
-
description: 'Defines the morning message for the greeting component',
|
|
14
|
-
table: {
|
|
15
|
-
type: { summary: 'string' }
|
|
16
|
-
}
|
|
17
|
-
},
|
|
18
|
-
afternoonMessage: {
|
|
19
|
-
type: { name: 'string', required: false },
|
|
20
|
-
description: 'Defines the afternoon message for the greeting component',
|
|
21
|
-
table: {
|
|
22
|
-
type: { summary: 'string' }
|
|
23
|
-
}
|
|
24
|
-
},
|
|
25
|
-
eveningMessage: {
|
|
26
|
-
type: { name: 'string', required: false },
|
|
27
|
-
description: 'Defines the evening message for the greeting component',
|
|
28
|
-
table: {
|
|
29
|
-
type: { summary: 'string' }
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
},
|
|
33
|
-
args: {
|
|
34
|
-
morningMessage: 'What a beautiful morning it is today'
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
const Template: ComponentStory<typeof Greeting> = (args) => <Greeting {...args} />
|
|
39
|
-
|
|
40
|
-
export const _Greeting = Template.bind({})
|
|
41
|
-
|
|
42
|
-
export default componentMeta
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import React from 'react'
|
|
2
|
-
import classNames from 'classnames'
|
|
3
|
-
|
|
4
|
-
export interface Props {
|
|
5
|
-
id?: string
|
|
6
|
-
className?: string
|
|
7
|
-
morningMessage?: string
|
|
8
|
-
afternoonMessage?: string
|
|
9
|
-
eveningMessage?: string
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
const Greeting = ({
|
|
13
|
-
id,
|
|
14
|
-
className,
|
|
15
|
-
morningMessage = 'Good morning',
|
|
16
|
-
afternoonMessage = 'Good afternoon',
|
|
17
|
-
eveningMessage = 'Good evening'
|
|
18
|
-
}: Props): JSX.Element => {
|
|
19
|
-
const today = new Date()
|
|
20
|
-
const hours = `0${today.getHours().toString()}`.slice(-2)
|
|
21
|
-
const minutes = `0${today.getMinutes().toString()}`.slice(-2)
|
|
22
|
-
const seconds = `0${today.getSeconds().toString()}`.slice(-2)
|
|
23
|
-
const time = parseInt(`${hours}${minutes}${seconds}`)
|
|
24
|
-
|
|
25
|
-
let message
|
|
26
|
-
if (time < 120000) {
|
|
27
|
-
message = morningMessage
|
|
28
|
-
} else if (time > 115959 && time < 170000) {
|
|
29
|
-
message = afternoonMessage
|
|
30
|
-
} else if (time > 165959) {
|
|
31
|
-
message = eveningMessage
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
const classList = classNames(className)
|
|
35
|
-
|
|
36
|
-
return (
|
|
37
|
-
<p
|
|
38
|
-
id={id}
|
|
39
|
-
className={classList}
|
|
40
|
-
>
|
|
41
|
-
{message}
|
|
42
|
-
</p>
|
|
43
|
-
)
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
export default Greeting
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
import React from 'react'
|
|
2
|
-
import { ComponentStory, ComponentMeta } from '@storybook/react'
|
|
3
|
-
import HamburgerIcon from './index'
|
|
4
|
-
|
|
5
|
-
const componentMeta: ComponentMeta<typeof HamburgerIcon> = {
|
|
6
|
-
title: 'Trepur Components/Rupert Bennett/Atoms/Hamburger Icon',
|
|
7
|
-
component: HamburgerIcon,
|
|
8
|
-
parameters: {
|
|
9
|
-
docs: {
|
|
10
|
-
description: {
|
|
11
|
-
component: 'An icon component'
|
|
12
|
-
}
|
|
13
|
-
},
|
|
14
|
-
layout: 'padded'
|
|
15
|
-
},
|
|
16
|
-
argTypes: {
|
|
17
|
-
id: {
|
|
18
|
-
type: { name: 'string', required: false },
|
|
19
|
-
description: 'HTML id attribute',
|
|
20
|
-
table: { type: { summary: 'string' } }
|
|
21
|
-
},
|
|
22
|
-
className: {
|
|
23
|
-
type: { name: 'string', required: false },
|
|
24
|
-
description: 'Used to pass any additional classes to the component',
|
|
25
|
-
table: { type: { summary: 'string' } }
|
|
26
|
-
},
|
|
27
|
-
opened: {
|
|
28
|
-
type: { name: 'boolean', required: false },
|
|
29
|
-
description: 'If this component is disabled and can not be interacted',
|
|
30
|
-
table: {
|
|
31
|
-
type: { summary: 'boolean' },
|
|
32
|
-
defaultValue: { summary: 'boolean' }
|
|
33
|
-
}
|
|
34
|
-
},
|
|
35
|
-
onClick: {
|
|
36
|
-
type: { name: 'function', required: false },
|
|
37
|
-
description: 'Function to be called when the button is clicked',
|
|
38
|
-
table: { type: { summary: 'function' } }
|
|
39
|
-
}
|
|
40
|
-
},
|
|
41
|
-
args: {
|
|
42
|
-
opened: false
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
const Template: ComponentStory<typeof HamburgerIcon> = (args) => <HamburgerIcon {...args} />
|
|
47
|
-
|
|
48
|
-
export const _HamburgerIcon = Template.bind({})
|
|
49
|
-
|
|
50
|
-
export default componentMeta
|