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,180 +0,0 @@
|
|
|
1
|
-
import React, { useState } from 'react'
|
|
2
|
-
import classNames from 'classnames'
|
|
3
|
-
import NavItem, { Props as navItemProps } from '@components/NavItem'
|
|
4
|
-
import HamburgerIcon from '@components/HamburgerIcon'
|
|
5
|
-
|
|
6
|
-
export interface Props {
|
|
7
|
-
id: string
|
|
8
|
-
className: string
|
|
9
|
-
navLinks: Array<navItemProps>
|
|
10
|
-
asSideBar: boolean
|
|
11
|
-
dropdownNavHeight: string
|
|
12
|
-
logo: string
|
|
13
|
-
logoDarkTheme: string
|
|
14
|
-
mobileLogo: string
|
|
15
|
-
mobileLogoDarkTheme: string
|
|
16
|
-
logoLink: string
|
|
17
|
-
mobileClasses: string
|
|
18
|
-
fixedTop: boolean
|
|
19
|
-
getNavStatus: (asSideBar: boolean, open: boolean) => void
|
|
20
|
-
theme: 'light' | 'dark'
|
|
21
|
-
text?: string
|
|
22
|
-
textLink?: string
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
const Nav = ({
|
|
26
|
-
id,
|
|
27
|
-
className,
|
|
28
|
-
navLinks,
|
|
29
|
-
asSideBar,
|
|
30
|
-
dropdownNavHeight,
|
|
31
|
-
logo,
|
|
32
|
-
logoDarkTheme,
|
|
33
|
-
mobileLogo,
|
|
34
|
-
mobileLogoDarkTheme,
|
|
35
|
-
logoLink,
|
|
36
|
-
fixedTop,
|
|
37
|
-
mobileClasses,
|
|
38
|
-
getNavStatus,
|
|
39
|
-
theme = 'dark',
|
|
40
|
-
text,
|
|
41
|
-
textLink
|
|
42
|
-
}: Props): JSX.Element => {
|
|
43
|
-
const [showSideNav, setShowSideNav] = useState(false)
|
|
44
|
-
const [showDropdownNav, setShowDropdownNav] = useState(false)
|
|
45
|
-
|
|
46
|
-
const colours = theme === 'dark' ? 'text-white bg-primary' : 'text-primary bg-white'
|
|
47
|
-
const textColour = theme === 'dark' ? 'text-white' : 'text-primary'
|
|
48
|
-
const navItemsClassList = 'flex justify-center my-auto px-4 lg:px-8'
|
|
49
|
-
const logoClassList = 'flex justify-center my-auto pl-16 lg:pl-24'
|
|
50
|
-
const emailClassList = 'flex justify-center my-auto pr-24'
|
|
51
|
-
const classList = classNames(className, colours, 'h-16')
|
|
52
|
-
|
|
53
|
-
const sideNavClasses = classNames({
|
|
54
|
-
'w-0': !showSideNav,
|
|
55
|
-
'w-full sm:w-1/3': showSideNav
|
|
56
|
-
}, colours, 'z-50 md:hidden mt-20 fixed overflow-hidden h-full duration-700')
|
|
57
|
-
|
|
58
|
-
const dropdownNavClasses = classNames({
|
|
59
|
-
'h-0': !showDropdownNav,
|
|
60
|
-
[`h-${dropdownNavHeight}`]: showDropdownNav
|
|
61
|
-
}, colours, 'z-50 md:hidden overflow-hidden pt-20')
|
|
62
|
-
|
|
63
|
-
const logoImageClassList = 'h-16 w-auto'
|
|
64
|
-
|
|
65
|
-
const mobileClassList = classNames({
|
|
66
|
-
'fixed w-full z-50 top-0 mt-0': fixedTop
|
|
67
|
-
}, colours, mobileClasses, 'flex items-center md:hidden py-2')
|
|
68
|
-
|
|
69
|
-
const desktopClassList = classNames({
|
|
70
|
-
'fixed w-full z-50 top-0 mt-0': fixedTop
|
|
71
|
-
}, 'w-full justify-between hidden md:flex items-center justify-between sm:items-stretch text-center flex bg-primary')
|
|
72
|
-
|
|
73
|
-
const toggleMenu = (): void => {
|
|
74
|
-
getNavStatus?.(asSideBar, true)
|
|
75
|
-
if (asSideBar) {
|
|
76
|
-
setShowSideNav(!showSideNav)
|
|
77
|
-
} else {
|
|
78
|
-
setShowDropdownNav(!showDropdownNav)
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
return (
|
|
83
|
-
<header id={id} className={classList}>
|
|
84
|
-
{/* mobile */}
|
|
85
|
-
<div
|
|
86
|
-
id='mobile-nav'
|
|
87
|
-
className={`${mobileClassList}`}
|
|
88
|
-
>
|
|
89
|
-
{/* Nav collapse icon */}
|
|
90
|
-
<div
|
|
91
|
-
id='nav-collapse-btn-wrapper'
|
|
92
|
-
className='absolute inset-y-0 left-8 top-5'
|
|
93
|
-
>
|
|
94
|
-
<HamburgerIcon onClick={toggleMenu} />
|
|
95
|
-
</div>
|
|
96
|
-
{/* Logo */}
|
|
97
|
-
<a id='logo-link' className='mx-auto' href={logoLink}>
|
|
98
|
-
<img className={logoImageClassList} src={theme === 'dark' ? mobileLogoDarkTheme : mobileLogo} alt='Logo' />
|
|
99
|
-
</a>
|
|
100
|
-
</div>
|
|
101
|
-
|
|
102
|
-
<div id='destop-nav' className={desktopClassList}>
|
|
103
|
-
<div className={logoClassList}>
|
|
104
|
-
<a id='logo-link' className='mx-auto' href={logoLink}>
|
|
105
|
-
<img className={logoImageClassList} src={theme === 'dark' ? logoDarkTheme : logo} alt='Logo' />
|
|
106
|
-
</a>
|
|
107
|
-
</div>
|
|
108
|
-
<div className={navItemsClassList}>
|
|
109
|
-
{navLinks?.map((navLink, i) => {
|
|
110
|
-
return (
|
|
111
|
-
<NavItem
|
|
112
|
-
key={`navItem_${i}`}
|
|
113
|
-
{...navLink}
|
|
114
|
-
className={i !== 0 ? 'pl-8' : ''}
|
|
115
|
-
bordered={false}
|
|
116
|
-
rounded={false}
|
|
117
|
-
underlineOnHover
|
|
118
|
-
variant={theme === 'dark' ? 'secondary' : 'primary'}
|
|
119
|
-
/>
|
|
120
|
-
)
|
|
121
|
-
})}
|
|
122
|
-
</div>
|
|
123
|
-
<div className={emailClassList}>
|
|
124
|
-
<a
|
|
125
|
-
className={`hidden lg:inline-block ${textColour}`}
|
|
126
|
-
href={textLink}
|
|
127
|
-
>
|
|
128
|
-
{text}
|
|
129
|
-
</a>
|
|
130
|
-
</div>
|
|
131
|
-
</div>
|
|
132
|
-
|
|
133
|
-
{/* Mobile Links */}
|
|
134
|
-
{/* Side Bar */}
|
|
135
|
-
{asSideBar
|
|
136
|
-
? (
|
|
137
|
-
<div className={sideNavClasses}>
|
|
138
|
-
{navLinks?.map((navLink, i) => {
|
|
139
|
-
return (
|
|
140
|
-
<NavItem
|
|
141
|
-
key={`navItem_${i}`}
|
|
142
|
-
{...navLink}
|
|
143
|
-
className='pl-8 pt-4'
|
|
144
|
-
bordered={false}
|
|
145
|
-
rounded={false}
|
|
146
|
-
underlineOnHover
|
|
147
|
-
variant={theme === 'dark' ? 'secondary' : 'primary'}
|
|
148
|
-
/>
|
|
149
|
-
)
|
|
150
|
-
})}
|
|
151
|
-
</div>
|
|
152
|
-
/* dropdown */
|
|
153
|
-
)
|
|
154
|
-
: (
|
|
155
|
-
<div
|
|
156
|
-
className={dropdownNavClasses}
|
|
157
|
-
id='mobile-menu'
|
|
158
|
-
>
|
|
159
|
-
<div className='pt-2 pb-3 space-y-1'>
|
|
160
|
-
{navLinks?.map((navLink, i) => {
|
|
161
|
-
return (
|
|
162
|
-
<NavItem
|
|
163
|
-
key={`navItem_${i}`}
|
|
164
|
-
{...navLink}
|
|
165
|
-
className='pl-8 pt-2'
|
|
166
|
-
bordered={false}
|
|
167
|
-
rounded={false}
|
|
168
|
-
underlineOnHover
|
|
169
|
-
variant={theme === 'dark' ? 'secondary' : 'primary'}
|
|
170
|
-
/>
|
|
171
|
-
)
|
|
172
|
-
})}
|
|
173
|
-
</div>
|
|
174
|
-
</div>
|
|
175
|
-
)}
|
|
176
|
-
</header>
|
|
177
|
-
)
|
|
178
|
-
}
|
|
179
|
-
|
|
180
|
-
export default Nav
|
|
@@ -1,89 +0,0 @@
|
|
|
1
|
-
import React from 'react'
|
|
2
|
-
import NavItem from './index'
|
|
3
|
-
import { action } from '@storybook/addon-actions'
|
|
4
|
-
import { ComponentStory, ComponentMeta } from '@storybook/react'
|
|
5
|
-
import { idAndClassName } from '@utils/controls'
|
|
6
|
-
|
|
7
|
-
const componentMeta: ComponentMeta<typeof NavItem> = {
|
|
8
|
-
title: 'Trepur Components/Rupert Bennett/Atoms/Nav Item',
|
|
9
|
-
component: NavItem,
|
|
10
|
-
parameters: {},
|
|
11
|
-
argTypes: {
|
|
12
|
-
...idAndClassName,
|
|
13
|
-
title: {
|
|
14
|
-
type: { name: 'string', required: false },
|
|
15
|
-
description: 'A title for the component',
|
|
16
|
-
table: {
|
|
17
|
-
type: { summary: 'string' }
|
|
18
|
-
}
|
|
19
|
-
},
|
|
20
|
-
href: {
|
|
21
|
-
type: { name: 'string', required: false },
|
|
22
|
-
description: 'A href for the component',
|
|
23
|
-
table: {
|
|
24
|
-
type: { summary: 'string' }
|
|
25
|
-
}
|
|
26
|
-
},
|
|
27
|
-
onClick: {
|
|
28
|
-
type: { name: 'function', required: false },
|
|
29
|
-
description: 'An on click handle to execute when clicking on the component',
|
|
30
|
-
table: {
|
|
31
|
-
type: { summary: 'function' }
|
|
32
|
-
}
|
|
33
|
-
},
|
|
34
|
-
bordered: {
|
|
35
|
-
type: { name: 'boolean', required: false },
|
|
36
|
-
description: 'Enables borders around the component',
|
|
37
|
-
table: {
|
|
38
|
-
type: { summary: 'boolean' }
|
|
39
|
-
},
|
|
40
|
-
defaultValue: false
|
|
41
|
-
},
|
|
42
|
-
rounded: {
|
|
43
|
-
type: { name: 'boolean', required: false },
|
|
44
|
-
description: 'Roundes the corners of the component',
|
|
45
|
-
table: {
|
|
46
|
-
type: { summary: 'boolean' }
|
|
47
|
-
},
|
|
48
|
-
defaultValue: true
|
|
49
|
-
},
|
|
50
|
-
underlineOnHover: {
|
|
51
|
-
type: { name: 'boolean', required: false },
|
|
52
|
-
description: 'Underlines the title when hovering over the component',
|
|
53
|
-
table: {
|
|
54
|
-
type: { summary: 'boolean' }
|
|
55
|
-
},
|
|
56
|
-
defaultValue: true
|
|
57
|
-
},
|
|
58
|
-
isActive: {
|
|
59
|
-
type: { name: 'boolean', required: false },
|
|
60
|
-
description: 'Set the active state to the component',
|
|
61
|
-
table: {
|
|
62
|
-
type: { summary: 'array' }
|
|
63
|
-
},
|
|
64
|
-
defaultValue: false
|
|
65
|
-
},
|
|
66
|
-
variant: {
|
|
67
|
-
type: { name: 'string', required: false },
|
|
68
|
-
options: ['primary', 'secondary'],
|
|
69
|
-
description: 'The varient of the component to render',
|
|
70
|
-
table: {
|
|
71
|
-
type: { summary: 'string' }
|
|
72
|
-
},
|
|
73
|
-
defaultValue: 'primary',
|
|
74
|
-
control: 'radio'
|
|
75
|
-
}
|
|
76
|
-
},
|
|
77
|
-
args: {
|
|
78
|
-
title: 'Home',
|
|
79
|
-
href: '/',
|
|
80
|
-
underlineOnHover: true,
|
|
81
|
-
onClick: action('button-click')
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
const Template: ComponentStory<typeof NavItem> = (args) => <NavItem {...args} />
|
|
86
|
-
|
|
87
|
-
export const _NavItem = Template.bind({})
|
|
88
|
-
|
|
89
|
-
export default componentMeta
|
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
import React from 'react'
|
|
2
|
-
import classNames from 'classnames'
|
|
3
|
-
|
|
4
|
-
export interface Props {
|
|
5
|
-
id?: string
|
|
6
|
-
className?: string
|
|
7
|
-
title: string
|
|
8
|
-
href?: string
|
|
9
|
-
onClick?: React.MouseEventHandler
|
|
10
|
-
bordered?: boolean
|
|
11
|
-
rounded?: boolean
|
|
12
|
-
underlineOnHover?: boolean
|
|
13
|
-
isActive?: boolean
|
|
14
|
-
variant?: 'primary' | 'secondary'
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
const NavItem = ({
|
|
18
|
-
id,
|
|
19
|
-
className,
|
|
20
|
-
title,
|
|
21
|
-
href,
|
|
22
|
-
onClick,
|
|
23
|
-
bordered = false,
|
|
24
|
-
rounded = true,
|
|
25
|
-
underlineOnHover = true,
|
|
26
|
-
isActive = false,
|
|
27
|
-
variant = 'primary'
|
|
28
|
-
}: Props): JSX.Element => {
|
|
29
|
-
const linkClassList = classNames({
|
|
30
|
-
'active before:w-full': isActive,
|
|
31
|
-
'border-2 px-2 py-2': bordered,
|
|
32
|
-
'rounded-md': rounded,
|
|
33
|
-
'before:w-full': isActive,
|
|
34
|
-
'before:w-0': !isActive,
|
|
35
|
-
'text-primary before:bg-primary': variant === 'primary',
|
|
36
|
-
'text-white before:bg-white': variant === 'secondary',
|
|
37
|
-
'relative before:absolute before:-bottom-1 before:left-0 hover:before:w-full focus:before:w-full before:h-1 before:transition-all ease-linear': underlineOnHover
|
|
38
|
-
}, 'text-center whitespace-nowrap')
|
|
39
|
-
|
|
40
|
-
const classList = classNames(className, 'w-auto list-none')
|
|
41
|
-
|
|
42
|
-
const anchorClassList = classNames({
|
|
43
|
-
'relative ease-linear': underlineOnHover,
|
|
44
|
-
[linkClassList]: true // TODO: remove this once css files are compilable
|
|
45
|
-
}, 'focus:outline-none')
|
|
46
|
-
|
|
47
|
-
return (
|
|
48
|
-
<div
|
|
49
|
-
id={id}
|
|
50
|
-
className={classList}
|
|
51
|
-
>
|
|
52
|
-
<a
|
|
53
|
-
href={href}
|
|
54
|
-
onClick={onClick}
|
|
55
|
-
className={anchorClassList}
|
|
56
|
-
>
|
|
57
|
-
<span className={linkClassList}>
|
|
58
|
-
{title}
|
|
59
|
-
</span>
|
|
60
|
-
</a>
|
|
61
|
-
</div>
|
|
62
|
-
)
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
export default NavItem
|
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
import React from 'react'
|
|
2
|
-
import { idAndClassName } from '@utils/controls'
|
|
3
|
-
import NewsCard from './index'
|
|
4
|
-
import { ComponentStory, ComponentMeta } from '@storybook/react'
|
|
5
|
-
|
|
6
|
-
const componentMeta: ComponentMeta<typeof NewsCard> = {
|
|
7
|
-
title: 'Trepur Components/Other/Organisms/News Card',
|
|
8
|
-
component: NewsCard,
|
|
9
|
-
parameters: {},
|
|
10
|
-
argTypes: {
|
|
11
|
-
...idAndClassName,
|
|
12
|
-
title: {
|
|
13
|
-
description: '',
|
|
14
|
-
control: 'text',
|
|
15
|
-
table: {
|
|
16
|
-
category: ''
|
|
17
|
-
}
|
|
18
|
-
},
|
|
19
|
-
content: {
|
|
20
|
-
description: '',
|
|
21
|
-
control: 'text',
|
|
22
|
-
table: {
|
|
23
|
-
category: ''
|
|
24
|
-
}
|
|
25
|
-
},
|
|
26
|
-
imageProps: {
|
|
27
|
-
type: { name: 'other', value: 'object' },
|
|
28
|
-
description: 'The props to pass to the image to display on the component',
|
|
29
|
-
table: {
|
|
30
|
-
type: {
|
|
31
|
-
summary: 'object'
|
|
32
|
-
},
|
|
33
|
-
defaultValue: { summary: 'undefined' }
|
|
34
|
-
}
|
|
35
|
-
},
|
|
36
|
-
buttonProps: {
|
|
37
|
-
description: '',
|
|
38
|
-
control: 'text',
|
|
39
|
-
table: {
|
|
40
|
-
category: ''
|
|
41
|
-
}
|
|
42
|
-
},
|
|
43
|
-
rounded: {
|
|
44
|
-
description: '',
|
|
45
|
-
control: 'text',
|
|
46
|
-
table: {
|
|
47
|
-
category: ''
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
},
|
|
51
|
-
args: {
|
|
52
|
-
title: 'This is a title',
|
|
53
|
-
content: 'This is some content that will only be displayed if the collapsible item is expanded and will dissappear when the collapsible item is collapsed.',
|
|
54
|
-
rounded: true,
|
|
55
|
-
imageProps: {
|
|
56
|
-
image: 'https://picsum.photos/400/200',
|
|
57
|
-
rounded: true
|
|
58
|
-
},
|
|
59
|
-
buttonProps: {
|
|
60
|
-
children: 'Button 1',
|
|
61
|
-
className: 'w-full',
|
|
62
|
-
href: '/'
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
const Template: ComponentStory<typeof NewsCard> = (args) => <NewsCard {...args} />
|
|
68
|
-
|
|
69
|
-
export const _NewsCard = Template.bind({})
|
|
70
|
-
|
|
71
|
-
export default componentMeta
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
import React from 'react'
|
|
2
|
-
import Button, { Props as buttonProps } from '@components/Button'
|
|
3
|
-
import Image, { Props as imageProps } from '@components/Image'
|
|
4
|
-
import classNames from 'classnames'
|
|
5
|
-
|
|
6
|
-
export interface Props {
|
|
7
|
-
id?: string
|
|
8
|
-
className?: string
|
|
9
|
-
title?: string
|
|
10
|
-
content?: string
|
|
11
|
-
imageProps?: imageProps
|
|
12
|
-
buttonProps?: buttonProps
|
|
13
|
-
rounded?: boolean
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
const NewsCard = ({
|
|
17
|
-
id,
|
|
18
|
-
className,
|
|
19
|
-
title,
|
|
20
|
-
content,
|
|
21
|
-
imageProps,
|
|
22
|
-
buttonProps,
|
|
23
|
-
rounded
|
|
24
|
-
}: Props): JSX.Element => {
|
|
25
|
-
const classList = classNames({
|
|
26
|
-
'rounded-lg': rounded
|
|
27
|
-
}, className, 'border flex p-2')
|
|
28
|
-
|
|
29
|
-
return (
|
|
30
|
-
<div id={id} className={classList}>
|
|
31
|
-
<div>
|
|
32
|
-
<Image {...imageProps} />
|
|
33
|
-
</div>
|
|
34
|
-
<div className='flex flex-col justify-between expandable w-auto text-center'>
|
|
35
|
-
<p>{title}</p>
|
|
36
|
-
<p>{content}</p>
|
|
37
|
-
{(buttonProps != null) &&
|
|
38
|
-
<div className='px-8'>
|
|
39
|
-
<Button {...buttonProps}>
|
|
40
|
-
{buttonProps.children}
|
|
41
|
-
</Button>
|
|
42
|
-
</div>}
|
|
43
|
-
</div>
|
|
44
|
-
</div>
|
|
45
|
-
)
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
export default NewsCard
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
import React from 'react'
|
|
2
|
-
import Profile from './index'
|
|
3
|
-
import userImage from '@assets/images/user.jpeg'
|
|
4
|
-
import { idAndClassName } from '@utils/controls'
|
|
5
|
-
import { ComponentStory, ComponentMeta } from '@storybook/react'
|
|
6
|
-
|
|
7
|
-
const componentMeta: ComponentMeta<typeof Profile> = {
|
|
8
|
-
title: 'Trepur Components/Other/Organisms/Profile',
|
|
9
|
-
component: Profile,
|
|
10
|
-
parameters: {},
|
|
11
|
-
argTypes: {
|
|
12
|
-
...idAndClassName,
|
|
13
|
-
imageProps: {
|
|
14
|
-
type: { name: 'other', value: 'object' },
|
|
15
|
-
description: 'The props to pass to the image to display on the component',
|
|
16
|
-
table: {
|
|
17
|
-
type: {
|
|
18
|
-
summary: 'object'
|
|
19
|
-
},
|
|
20
|
-
defaultValue: { summary: 'undefined' }
|
|
21
|
-
}
|
|
22
|
-
},
|
|
23
|
-
alignment: {
|
|
24
|
-
description: '',
|
|
25
|
-
control: 'select',
|
|
26
|
-
options: ['left', 'center', 'right'],
|
|
27
|
-
table: {
|
|
28
|
-
category: ''
|
|
29
|
-
}
|
|
30
|
-
},
|
|
31
|
-
profileLinks: {
|
|
32
|
-
description: '',
|
|
33
|
-
control: 'text',
|
|
34
|
-
table: {
|
|
35
|
-
category: ''
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
},
|
|
39
|
-
args: {
|
|
40
|
-
imageProps: {
|
|
41
|
-
image: userImage
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
const Template: ComponentStory<typeof Profile> = (args) => <Profile {...args} />
|
|
47
|
-
|
|
48
|
-
export const _Profile = Template.bind({})
|
|
49
|
-
|
|
50
|
-
export default componentMeta
|
|
@@ -1,87 +0,0 @@
|
|
|
1
|
-
import React, { useState } from 'react'
|
|
2
|
-
import Image, { Props as imageProps } from '@components/Image'
|
|
3
|
-
import classNames from 'classnames'
|
|
4
|
-
|
|
5
|
-
export interface Props {
|
|
6
|
-
id?: string
|
|
7
|
-
className?: string
|
|
8
|
-
profileLinks?: Array<{ name: string, link: string }>
|
|
9
|
-
alignment?: 'left' | 'right'
|
|
10
|
-
imageHeight?: number
|
|
11
|
-
imageWidth?: number
|
|
12
|
-
rounded?: boolean
|
|
13
|
-
bordered?: boolean
|
|
14
|
-
imageProps?: imageProps
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
const Profile = ({
|
|
18
|
-
id,
|
|
19
|
-
className,
|
|
20
|
-
profileLinks,
|
|
21
|
-
alignment,
|
|
22
|
-
imageHeight = 0,
|
|
23
|
-
imageWidth = 0,
|
|
24
|
-
rounded,
|
|
25
|
-
bordered,
|
|
26
|
-
imageProps
|
|
27
|
-
}: Props): JSX.Element => {
|
|
28
|
-
const [profileState, setProfileState] = useState(false)
|
|
29
|
-
|
|
30
|
-
const profileAlignment = classNames({
|
|
31
|
-
'float-right': alignment === 'right',
|
|
32
|
-
'float-left': alignment === 'left'
|
|
33
|
-
})
|
|
34
|
-
|
|
35
|
-
const dropdownAlignement = classNames({
|
|
36
|
-
'mt-16 -mr-16': alignment === 'right',
|
|
37
|
-
'mt-16 -ml-16': alignment === 'left'
|
|
38
|
-
})
|
|
39
|
-
|
|
40
|
-
const dropdownTextAlignement = classNames({
|
|
41
|
-
'text-center': alignment !== 'right' && alignment !== 'left'
|
|
42
|
-
})
|
|
43
|
-
|
|
44
|
-
const classList = classNames({
|
|
45
|
-
'rounded-full': rounded === true,
|
|
46
|
-
border: bordered === true
|
|
47
|
-
}, className, `h-${imageHeight} w-${imageWidth} object-cover`)
|
|
48
|
-
|
|
49
|
-
return (
|
|
50
|
-
<>
|
|
51
|
-
<div id={id} className={`text-center ${classList}`}>
|
|
52
|
-
<div className={`hidden sm:inline-flex inset-y-0 ${profileAlignment}`}>
|
|
53
|
-
<button
|
|
54
|
-
onClick={() => setProfileState(!profileState)}
|
|
55
|
-
type='button'
|
|
56
|
-
className='flex rounded-full'
|
|
57
|
-
>
|
|
58
|
-
<Image {...imageProps} />
|
|
59
|
-
</button>
|
|
60
|
-
</div>
|
|
61
|
-
</div>
|
|
62
|
-
{profileState &&
|
|
63
|
-
<div className={dropdownTextAlignement}>
|
|
64
|
-
<div className={`w-48 sm:inline-block shadow-lg
|
|
65
|
-
z-10 ${profileAlignment} ${dropdownAlignement}`}
|
|
66
|
-
>
|
|
67
|
-
{profileLinks?.map((link, i) => {
|
|
68
|
-
return (
|
|
69
|
-
<a
|
|
70
|
-
key={`profile_link_${i + 1}`}
|
|
71
|
-
href={link.link}
|
|
72
|
-
className='border-b font-bold block px-4 py-2 text-sm'
|
|
73
|
-
role='menuitem'
|
|
74
|
-
// tabindex="-1"
|
|
75
|
-
id={`user-menu-item-${i + 1}`}
|
|
76
|
-
>
|
|
77
|
-
{link.name}
|
|
78
|
-
</a>
|
|
79
|
-
)
|
|
80
|
-
})}
|
|
81
|
-
</div>
|
|
82
|
-
</div>}
|
|
83
|
-
</>
|
|
84
|
-
)
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
export default Profile
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
import React from 'react'
|
|
2
|
-
import Row from './index'
|
|
3
|
-
import CardWithTopImage from '@components/CardWithTopImage'
|
|
4
|
-
import logo from '@assets/images/primary-logo.png'
|
|
5
|
-
import { ComponentStory, ComponentMeta } from '@storybook/react'
|
|
6
|
-
import { idAndClassName } from '@utils/controls'
|
|
7
|
-
|
|
8
|
-
const cardChild = (
|
|
9
|
-
<CardWithTopImage
|
|
10
|
-
imageProps={{
|
|
11
|
-
image: logo,
|
|
12
|
-
rounded: true,
|
|
13
|
-
height: 4,
|
|
14
|
-
width: 4,
|
|
15
|
-
roundedFull: true
|
|
16
|
-
}}
|
|
17
|
-
className='w-1/3'
|
|
18
|
-
>
|
|
19
|
-
<p>This is some text</p>
|
|
20
|
-
<p>This is some more text</p>
|
|
21
|
-
<p>This is a bit more text</p>
|
|
22
|
-
<p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Dolorem odit ad sed, quam recusandae voluptatem provident eveniet beatae omnis vero minus unde facilis. Quia commodi quas odit iusto ut enim!</p>
|
|
23
|
-
</CardWithTopImage>
|
|
24
|
-
)
|
|
25
|
-
|
|
26
|
-
const componentMeta: ComponentMeta<typeof Row> = {
|
|
27
|
-
title: 'Trepur Components/Rupert Bennett/Atoms/Row',
|
|
28
|
-
component: Row,
|
|
29
|
-
argTypes: {
|
|
30
|
-
...idAndClassName,
|
|
31
|
-
children: {
|
|
32
|
-
type: { name: 'other', value: 'string | React.ReactNode' },
|
|
33
|
-
description: 'The child elements to show in the component',
|
|
34
|
-
table: {
|
|
35
|
-
type: {
|
|
36
|
-
summary: 'Array'
|
|
37
|
-
},
|
|
38
|
-
defaultValue: { summary: 'undefined' }
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
},
|
|
42
|
-
args: {
|
|
43
|
-
children: cardChild
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
const Template: ComponentStory<typeof Row> = (args) => <Row {...args} />
|
|
48
|
-
|
|
49
|
-
export const _Row = Template.bind({})
|
|
50
|
-
|
|
51
|
-
export default componentMeta
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import React from 'react'
|
|
2
|
-
import classNames from 'classnames'
|
|
3
|
-
|
|
4
|
-
export interface Props {
|
|
5
|
-
id?: string
|
|
6
|
-
className?: string
|
|
7
|
-
children: any
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
const Row = ({
|
|
11
|
-
id,
|
|
12
|
-
className,
|
|
13
|
-
children
|
|
14
|
-
}: Props): JSX.Element => {
|
|
15
|
-
const classList = classNames(className, 'flex flex-wrap')
|
|
16
|
-
|
|
17
|
-
return (
|
|
18
|
-
<div id={id} className={classList}>
|
|
19
|
-
{children}
|
|
20
|
-
</div>
|
|
21
|
-
)
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
export default Row
|