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.
Files changed (237) hide show
  1. package/dist/src/lib/components/Accordion/index.js +3 -1
  2. package/dist/src/lib/components/Accordion/index.js.map +1 -1
  3. package/dist/src/lib/components/Accordion/style.module.css +4 -0
  4. package/dist/src/lib/components/Accordion/style.module.css.map +1 -0
  5. package/dist/src/lib/components/Carousel/index.d.ts +0 -1
  6. package/dist/src/lib/components/Carousel/index.js +1 -1
  7. package/dist/src/lib/components/Carousel/index.js.map +1 -1
  8. package/dist/src/lib/components/ImageLinkList/index.d.ts +1 -1
  9. package/dist/src/lib/components/Nav/index.d.ts +1 -1
  10. package/dist/src/lib/components/Nav/index.js +2 -2
  11. package/dist/src/lib/components/Nav/index.js.map +1 -1
  12. package/dist/src/lib/components/SocialBlock/index.js +2 -2
  13. package/dist/src/lib/components/SocialBlock/index.js.map +1 -1
  14. package/dist/{components → src/lib/components}/Timeline/index.css +2 -0
  15. package/dist/src/lib/components/Timeline/index.css.map +1 -0
  16. package/dist/{components → src/lib/components}/Tubestops/index.css +35 -30
  17. package/dist/src/lib/components/Tubestops/index.css.map +1 -0
  18. package/dist/src/lib/typography/index.d.ts +1 -3
  19. package/dist/src/lib/typography/index.js +1 -1
  20. package/dist/src/lib/typography/index.js.map +1 -1
  21. package/package.json +13 -6
  22. package/dist/components/Accordion/Accordion.stories.tsx +0 -88
  23. package/dist/components/Accordion/index.tsx +0 -31
  24. package/dist/components/AlertBar/AlertBar.stories.tsx +0 -105
  25. package/dist/components/AlertBar/index.tsx +0 -127
  26. package/dist/components/Breadcrumbs/Breadcrumbs.stories.tsx +0 -60
  27. package/dist/components/Breadcrumbs/index.tsx +0 -55
  28. package/dist/components/BreadcrumbsBordered/BreadcrumbsBordered.stories.tsx +0 -52
  29. package/dist/components/BreadcrumbsBordered/index.tsx +0 -44
  30. package/dist/components/BreadcrumbsItem/BreadcrumbsItem.stories.tsx +0 -54
  31. package/dist/components/BreadcrumbsItem/index.tsx +0 -151
  32. package/dist/components/Button/button.stories.tsx +0 -148
  33. package/dist/components/Button/index.tsx +0 -91
  34. package/dist/components/Card/Card.stories.tsx +0 -150
  35. package/dist/components/Card/index.tsx +0 -162
  36. package/dist/components/CardWithTopImage/CardWithTopImage.stories.tsx +0 -48
  37. package/dist/components/CardWithTopImage/index.tsx +0 -40
  38. package/dist/components/Carousel/Carousel.stories.tsx +0 -369
  39. package/dist/components/Carousel/index.tsx +0 -267
  40. package/dist/components/ChevronCard/ChevronCard.stories.tsx +0 -21
  41. package/dist/components/ChevronCard/index.tsx +0 -39
  42. package/dist/components/Collapsible/Collapsible.stories.tsx +0 -70
  43. package/dist/components/Collapsible/index.tsx +0 -124
  44. package/dist/components/Column/Column.stories.tsx +0 -82
  45. package/dist/components/Column/index.tsx +0 -114
  46. package/dist/components/Container/Container.stories.tsx +0 -38
  47. package/dist/components/Container/index.tsx +0 -30
  48. package/dist/components/FooterBar/FooterBar.stories.tsx +0 -57
  49. package/dist/components/FooterBar/index.tsx +0 -44
  50. package/dist/components/Form/Form.stories.tsx +0 -93
  51. package/dist/components/Form/index.tsx +0 -58
  52. package/dist/components/FyreCard/FyreCard.stories.tsx +0 -29
  53. package/dist/components/FyreCard/index.tsx +0 -46
  54. package/dist/components/Greeting/Greeting.stories.tsx +0 -42
  55. package/dist/components/Greeting/index.tsx +0 -46
  56. package/dist/components/HamburgerIcon/HamburgerIcon.stories.tsx +0 -50
  57. package/dist/components/HamburgerIcon/index.tsx +0 -65
  58. package/dist/components/Icon/Icon.stories.tsx +0 -102
  59. package/dist/components/Icon/index.tsx +0 -112
  60. package/dist/components/Image/Image.stories.tsx +0 -88
  61. package/dist/components/Image/index.tsx +0 -113
  62. package/dist/components/ImageLink/ImageLink.stories.tsx +0 -60
  63. package/dist/components/ImageLink/index.tsx +0 -62
  64. package/dist/components/ImageLinkList/ImageLinkList.stories.tsx +0 -34
  65. package/dist/components/ImageLinkList/index.tsx +0 -33
  66. package/dist/components/InformationIcon/InformationIcon.stories.tsx +0 -86
  67. package/dist/components/InformationIcon/index.tsx +0 -84
  68. package/dist/components/Input/Input.stories.tsx +0 -99
  69. package/dist/components/Input/index.tsx +0 -126
  70. package/dist/components/Jumbotron/Jumbotron.stories.tsx +0 -22
  71. package/dist/components/Jumbotron/index.tsx +0 -25
  72. package/dist/components/Nav/Nav.stories.tsx +0 -155
  73. package/dist/components/Nav/index.tsx +0 -180
  74. package/dist/components/NavItem/NavItem.stories.tsx +0 -89
  75. package/dist/components/NavItem/index.tsx +0 -65
  76. package/dist/components/NewsCard/NewsCard.stories.tsx +0 -71
  77. package/dist/components/NewsCard/index.tsx +0 -48
  78. package/dist/components/Profile/Profile.stories.tsx +0 -50
  79. package/dist/components/Profile/index.tsx +0 -87
  80. package/dist/components/Row/Row.stories.tsx +0 -51
  81. package/dist/components/Row/index.tsx +0 -24
  82. package/dist/components/Search/Search.stories.tsx +0 -58
  83. package/dist/components/Search/index.tsx +0 -58
  84. package/dist/components/SocialBlock/SocialBlock.stories.tsx +0 -114
  85. package/dist/components/SocialBlock/index.tsx +0 -161
  86. package/dist/components/StarRating/StarRating.stories.tsx +0 -23
  87. package/dist/components/StarRating/index.tsx +0 -71
  88. package/dist/components/Testimonial/Testimonial.stories.tsx +0 -110
  89. package/dist/components/Testimonial/index.tsx +0 -50
  90. package/dist/components/TextAndTitle/TextAndTitle.stories.tsx +0 -65
  91. package/dist/components/TextAndTitle/index.tsx +0 -257
  92. package/dist/components/TextArea/TextArea.stories.tsx +0 -67
  93. package/dist/components/TextArea/index.tsx +0 -97
  94. package/dist/components/Timeline/Timeline.stories.tsx +0 -100
  95. package/dist/components/Timeline/index.tsx +0 -315
  96. package/dist/components/Tubestops/Tubestops.stories.tsx +0 -66
  97. package/dist/components/Tubestops/index.tsx +0 -77
  98. package/dist/components/UserIcon/UserIcon.stories.tsx +0 -67
  99. package/dist/components/UserIcon/index.tsx +0 -42
  100. package/dist/components/Video/Video.stories.tsx +0 -23
  101. package/dist/components/Video/index.tsx +0 -49
  102. package/dist/fonts/Sora/OFL.txt +0 -93
  103. package/dist/fonts/Sora/README.txt +0 -70
  104. package/dist/fonts/Sora/Sora-VariableFont_wght.ttf +0 -0
  105. package/dist/fonts/Sora/static/Sora-Bold.ttf +0 -0
  106. package/dist/fonts/Sora/static/Sora-ExtraBold.ttf +0 -0
  107. package/dist/fonts/Sora/static/Sora-ExtraLight.ttf +0 -0
  108. package/dist/fonts/Sora/static/Sora-Light.ttf +0 -0
  109. package/dist/fonts/Sora/static/Sora-Medium.ttf +0 -0
  110. package/dist/fonts/Sora/static/Sora-Regular.ttf +0 -0
  111. package/dist/fonts/Sora/static/Sora-SemiBold.ttf +0 -0
  112. package/dist/fonts/Sora/static/Sora-Thin.ttf +0 -0
  113. package/dist/index.js +0 -272
  114. package/dist/src/lib/components/Accordion/Accordion.stories.d.ts +0 -6
  115. package/dist/src/lib/components/Accordion/Accordion.stories.js +0 -80
  116. package/dist/src/lib/components/Accordion/Accordion.stories.js.map +0 -1
  117. package/dist/src/lib/components/AlertBar/AlertBar.stories.d.ts +0 -6
  118. package/dist/src/lib/components/AlertBar/AlertBar.stories.js +0 -91
  119. package/dist/src/lib/components/AlertBar/AlertBar.stories.js.map +0 -1
  120. package/dist/src/lib/components/Breadcrumbs/Breadcrumbs.stories.d.ts +0 -6
  121. package/dist/src/lib/components/Breadcrumbs/Breadcrumbs.stories.js +0 -56
  122. package/dist/src/lib/components/Breadcrumbs/Breadcrumbs.stories.js.map +0 -1
  123. package/dist/src/lib/components/BreadcrumbsBordered/BreadcrumbsBordered.stories.d.ts +0 -6
  124. package/dist/src/lib/components/BreadcrumbsBordered/BreadcrumbsBordered.stories.js +0 -45
  125. package/dist/src/lib/components/BreadcrumbsBordered/BreadcrumbsBordered.stories.js.map +0 -1
  126. package/dist/src/lib/components/BreadcrumbsItem/BreadcrumbsItem.stories.d.ts +0 -6
  127. package/dist/src/lib/components/BreadcrumbsItem/BreadcrumbsItem.stories.js +0 -50
  128. package/dist/src/lib/components/BreadcrumbsItem/BreadcrumbsItem.stories.js.map +0 -1
  129. package/dist/src/lib/components/Button/button.stories.d.ts +0 -6
  130. package/dist/src/lib/components/Button/button.stories.js +0 -132
  131. package/dist/src/lib/components/Button/button.stories.js.map +0 -1
  132. package/dist/src/lib/components/Card/Card.stories.d.ts +0 -8
  133. package/dist/src/lib/components/Card/Card.stories.js +0 -124
  134. package/dist/src/lib/components/Card/Card.stories.js.map +0 -1
  135. package/dist/src/lib/components/CardWithTopImage/CardWithTopImage.stories.d.ts +0 -6
  136. package/dist/src/lib/components/CardWithTopImage/CardWithTopImage.stories.js +0 -40
  137. package/dist/src/lib/components/CardWithTopImage/CardWithTopImage.stories.js.map +0 -1
  138. package/dist/src/lib/components/Carousel/Carousel.stories.d.ts +0 -6
  139. package/dist/src/lib/components/Carousel/Carousel.stories.js +0 -297
  140. package/dist/src/lib/components/Carousel/Carousel.stories.js.map +0 -1
  141. package/dist/src/lib/components/ChevronCard/ChevronCard.stories.d.ts +0 -6
  142. package/dist/src/lib/components/ChevronCard/ChevronCard.stories.js +0 -14
  143. package/dist/src/lib/components/ChevronCard/ChevronCard.stories.js.map +0 -1
  144. package/dist/src/lib/components/Collapsible/Collapsible.stories.d.ts +0 -6
  145. package/dist/src/lib/components/Collapsible/Collapsible.stories.js +0 -66
  146. package/dist/src/lib/components/Collapsible/Collapsible.stories.js.map +0 -1
  147. package/dist/src/lib/components/Column/Column.stories.d.ts +0 -6
  148. package/dist/src/lib/components/Column/Column.stories.js +0 -64
  149. package/dist/src/lib/components/Column/Column.stories.js.map +0 -1
  150. package/dist/src/lib/components/Container/Container.stories.d.ts +0 -6
  151. package/dist/src/lib/components/Container/Container.stories.js +0 -30
  152. package/dist/src/lib/components/Container/Container.stories.js.map +0 -1
  153. package/dist/src/lib/components/FooterBar/footerBar.stories.d.ts +0 -6
  154. package/dist/src/lib/components/FooterBar/footerBar.stories.js +0 -48
  155. package/dist/src/lib/components/FooterBar/footerBar.stories.js.map +0 -1
  156. package/dist/src/lib/components/Form/Form.stories.d.ts +0 -6
  157. package/dist/src/lib/components/Form/Form.stories.js +0 -82
  158. package/dist/src/lib/components/Form/Form.stories.js.map +0 -1
  159. package/dist/src/lib/components/FyreCard/FyreCard.stories.d.ts +0 -6
  160. package/dist/src/lib/components/FyreCard/FyreCard.stories.js +0 -22
  161. package/dist/src/lib/components/FyreCard/FyreCard.stories.js.map +0 -1
  162. package/dist/src/lib/components/Greeting/Greeting.stories.d.ts +0 -6
  163. package/dist/src/lib/components/Greeting/Greeting.stories.js +0 -33
  164. package/dist/src/lib/components/Greeting/Greeting.stories.js.map +0 -1
  165. package/dist/src/lib/components/HamburgerIcon/HamburgerIcon.stories.d.ts +0 -6
  166. package/dist/src/lib/components/HamburgerIcon/HamburgerIcon.stories.js +0 -46
  167. package/dist/src/lib/components/HamburgerIcon/HamburgerIcon.stories.js.map +0 -1
  168. package/dist/src/lib/components/Icon/Icon.stories.d.ts +0 -6
  169. package/dist/src/lib/components/Icon/Icon.stories.js +0 -87
  170. package/dist/src/lib/components/Icon/Icon.stories.js.map +0 -1
  171. package/dist/src/lib/components/Image/Image.stories.d.ts +0 -6
  172. package/dist/src/lib/components/Image/Image.stories.js +0 -73
  173. package/dist/src/lib/components/Image/Image.stories.js.map +0 -1
  174. package/dist/src/lib/components/ImageLink/ImageLink.stories.d.ts +0 -9
  175. package/dist/src/lib/components/ImageLink/ImageLink.stories.js +0 -50
  176. package/dist/src/lib/components/ImageLink/ImageLink.stories.js.map +0 -1
  177. package/dist/src/lib/components/ImageLinkList/ImageLinkList.stories.d.ts +0 -6
  178. package/dist/src/lib/components/ImageLinkList/ImageLinkList.stories.js +0 -27
  179. package/dist/src/lib/components/ImageLinkList/ImageLinkList.stories.js.map +0 -1
  180. package/dist/src/lib/components/InformationIcon/InformationIcon.stories.d.ts +0 -6
  181. package/dist/src/lib/components/InformationIcon/InformationIcon.stories.js +0 -73
  182. package/dist/src/lib/components/InformationIcon/InformationIcon.stories.js.map +0 -1
  183. package/dist/src/lib/components/Input/Input.stories.d.ts +0 -6
  184. package/dist/src/lib/components/Input/Input.stories.js +0 -95
  185. package/dist/src/lib/components/Input/Input.stories.js.map +0 -1
  186. package/dist/src/lib/components/Jumbotron/Jumbotron.stories.d.ts +0 -6
  187. package/dist/src/lib/components/Jumbotron/Jumbotron.stories.js +0 -16
  188. package/dist/src/lib/components/Jumbotron/Jumbotron.stories.js.map +0 -1
  189. package/dist/src/lib/components/Nav/Nav.stories.d.ts +0 -6
  190. package/dist/src/lib/components/Nav/Nav.stories.js +0 -134
  191. package/dist/src/lib/components/Nav/Nav.stories.js.map +0 -1
  192. package/dist/src/lib/components/NavItem/NavItem.stories.d.ts +0 -6
  193. package/dist/src/lib/components/NavItem/NavItem.stories.js +0 -75
  194. package/dist/src/lib/components/NavItem/NavItem.stories.js.map +0 -1
  195. package/dist/src/lib/components/NewsCard/NewsCard.stories.d.ts +0 -6
  196. package/dist/src/lib/components/NewsCard/NewsCard.stories.js +0 -60
  197. package/dist/src/lib/components/NewsCard/NewsCard.stories.js.map +0 -1
  198. package/dist/src/lib/components/Profile/Profile.stories.d.ts +0 -6
  199. package/dist/src/lib/components/Profile/Profile.stories.js +0 -41
  200. package/dist/src/lib/components/Profile/Profile.stories.js.map +0 -1
  201. package/dist/src/lib/components/Row/Row.stories.d.ts +0 -6
  202. package/dist/src/lib/components/Row/Row.stories.js +0 -37
  203. package/dist/src/lib/components/Row/Row.stories.js.map +0 -1
  204. package/dist/src/lib/components/Search/Search.stories.d.ts +0 -6
  205. package/dist/src/lib/components/Search/Search.stories.js +0 -48
  206. package/dist/src/lib/components/Search/Search.stories.js.map +0 -1
  207. package/dist/src/lib/components/SocialBlock/SocialBlock.stories.d.ts +0 -6
  208. package/dist/src/lib/components/SocialBlock/SocialBlock.stories.js +0 -58
  209. package/dist/src/lib/components/SocialBlock/SocialBlock.stories.js.map +0 -1
  210. package/dist/src/lib/components/StarRating/StarRating.stories.d.ts +0 -6
  211. package/dist/src/lib/components/StarRating/StarRating.stories.js +0 -17
  212. package/dist/src/lib/components/StarRating/StarRating.stories.js.map +0 -1
  213. package/dist/src/lib/components/Testimonial/Testimonial.stories.d.ts +0 -6
  214. package/dist/src/lib/components/Testimonial/Testimonial.stories.js +0 -95
  215. package/dist/src/lib/components/Testimonial/Testimonial.stories.js.map +0 -1
  216. package/dist/src/lib/components/TextAndTitle/TextAndTitle.stories.d.ts +0 -6
  217. package/dist/src/lib/components/TextAndTitle/TextAndTitle.stories.js +0 -63
  218. package/dist/src/lib/components/TextAndTitle/TextAndTitle.stories.js.map +0 -1
  219. package/dist/src/lib/components/TextArea/TextArea.stories.d.ts +0 -6
  220. package/dist/src/lib/components/TextArea/TextArea.stories.js +0 -63
  221. package/dist/src/lib/components/TextArea/TextArea.stories.js.map +0 -1
  222. package/dist/src/lib/components/Timeline/Timeline.stories.d.ts +0 -6
  223. package/dist/src/lib/components/Timeline/Timeline.stories.js +0 -87
  224. package/dist/src/lib/components/Timeline/Timeline.stories.js.map +0 -1
  225. package/dist/src/lib/components/Tubestops/Tubestops.stories.d.ts +0 -6
  226. package/dist/src/lib/components/Tubestops/Tubestops.stories.js +0 -62
  227. package/dist/src/lib/components/Tubestops/Tubestops.stories.js.map +0 -1
  228. package/dist/src/lib/components/UserIcon/UserIcon.stories.d.ts +0 -6
  229. package/dist/src/lib/components/UserIcon/UserIcon.stories.js +0 -63
  230. package/dist/src/lib/components/UserIcon/UserIcon.stories.js.map +0 -1
  231. package/dist/src/lib/components/Video/Video.stories.d.ts +0 -6
  232. package/dist/src/lib/components/Video/Video.stories.js +0 -17
  233. package/dist/src/lib/components/Video/Video.stories.js.map +0 -1
  234. package/dist/src/lib/typography/Fonts.stories.d.ts +0 -6
  235. package/dist/src/lib/typography/Fonts.stories.js +0 -12
  236. package/dist/src/lib/typography/Fonts.stories.js.map +0 -1
  237. package/dist/styles/base.css +0 -73
@@ -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
@@ -1,65 +0,0 @@
1
- import React, { useState } from 'react'
2
- import classNames from 'classnames'
3
- import Button from '@components/Button'
4
-
5
- export interface Props extends Partial<Pick<HTMLElement, 'className' | 'id'>> {
6
- opened?: boolean
7
- onClick?: React.MouseEventHandler
8
- }
9
-
10
- const HamburgerIcon = ({
11
- id,
12
- className,
13
- onClick
14
- }: Props): JSX.Element => {
15
- const [opened, setOpened] = useState(false)
16
- const lineOneClassList = classNames({
17
- 'origin-top-left rotate-45 translate-x-1 -translate-y-0.5': opened
18
- }, 'origin-top-left transition-transform duration-200 ease-linear')
19
-
20
- const lineTwoClassList = classNames({
21
- 'opacity-0': opened
22
- }, 'opacity-100 transition-opacity duration-200 ease-linear')
23
-
24
- const lineThreeClassList = classNames({
25
- 'origin-bottom-left -rotate-45 translate-x-1 translate-y-px': opened
26
- }, 'origin-bottom-left transition-transform duration-200 ease-linear')
27
-
28
- const toggleOpened = (e: any): void => {
29
- setOpened(!opened)
30
- onClick?.(e)
31
- }
32
-
33
- return (
34
- <Button
35
- id={id}
36
- className={className}
37
- onClick={(e) => toggleOpened(e)}
38
- variant='primary'
39
- type='icon'
40
- >
41
- <svg
42
- className='mx-auto overflow-visible fill-white group-hover:fill-primary transition-backgroundColor duration-500 transform'
43
- width='24'
44
- height='24'
45
- viewBox='0 0 24 15'
46
- xmlns='http://www.w3.org/2000/svg'
47
- >
48
- <path
49
- className={lineOneClassList}
50
- d='M0 1.5C0 0.947715 0.447715 0.5 1 0.5H21C21.5523 0.5 22 0.947715 22 1.5C22 2.05228 21.5523 2.5 21 2.5H1C0.447716 2.5 0 2.05228 0 1.5Z'
51
- />
52
- <path
53
- className={lineTwoClassList}
54
- d='M0 7.5C0 6.94772 0.447715 6.5 1 6.5H21C21.5523 6.5 22 6.94772 22 7.5C22 8.05228 21.5523 8.5 21 8.5H1C0.447716 8.5 0 8.05228 0 7.5Z'
55
- />
56
- <path
57
- className={lineThreeClassList}
58
- d='M0 13.5C0 12.9477 0.447715 12.5 1 12.5H21C21.5523 12.5 22 12.9477 22 13.5C22 14.0523 21.5523 14.5 21 14.5H1C0.447716 14.5 0 14.0523 0 13.5Z'
59
- />
60
- </svg>
61
- </Button>
62
- )
63
- }
64
-
65
- export default HamburgerIcon
@@ -1,102 +0,0 @@
1
- import React from 'react'
2
- import Icon from './index'
3
- import { idAndClassName } from '@utils/controls'
4
- import { ComponentStory, ComponentMeta } from '@storybook/react'
5
-
6
- const componentMeta: ComponentMeta<typeof Icon> = {
7
- title: 'Trepur Components/Rupert Bennett/Atoms/Icon',
8
- component: Icon,
9
- argTypes: {
10
- ...idAndClassName,
11
- type: {
12
- options: ['heart', 'arrow-up', 'arrow-down', 'multiply', 'burger', 'bars'],
13
- type: { name: 'string', required: false },
14
- description: 'The name of the icon to display in the component',
15
- table: {
16
- type: { summary: 'string' }
17
- },
18
- control: 'select'
19
- },
20
- size: {
21
- type: { name: 'number', required: false },
22
- description: 'The size of the icon to show in the component',
23
- table: {
24
- type: { summary: 'number' }
25
- }
26
- },
27
- animation: {
28
- type: { name: 'string', required: false },
29
- options: ['none', 'pulse', 'spin', 'beat'],
30
- description: 'Type of annimation to apply to the component',
31
- table: {
32
- type: { summary: 'string' }
33
- },
34
- control: 'select'
35
- },
36
- reverseSpin: {
37
- type: { name: 'boolean', required: false },
38
- description: 'To reverse the animation on the component',
39
- table: {
40
- type: { summary: 'boolean' }
41
- },
42
- defaultValue: 'false'
43
- },
44
- hollow: {
45
- type: { name: 'boolean', required: false },
46
- description: 'To render a hollow version of the icon in component',
47
- table: {
48
- type: { summary: 'boolean' }
49
- },
50
- defaultValue: 'false'
51
- },
52
- colour: {
53
- type: { name: 'string', required: false },
54
- options: ['primary', 'secondary', 'white', 'black', 'gold'],
55
- description: 'The font colour of the component',
56
- table: {
57
- type: { summary: 'string' }
58
- },
59
- defaultValue: 'primary',
60
- control: 'select'
61
- },
62
- bgColour: {
63
- type: { name: 'string', required: false },
64
- options: ['primary', 'secondary', 'white', 'black', 'gold'],
65
- description: 'The background colour of the component',
66
- table: {
67
- type: { summary: 'string' }
68
- },
69
- defaultValue: 'secondary',
70
- control: 'select'
71
- },
72
- rounded: {
73
- type: { name: 'boolean', required: false },
74
- description: 'Sets the component to a circle shape',
75
- table: {
76
- type: { summary: 'boolean' }
77
- },
78
- defaultValue: 'false'
79
- },
80
- brand: {
81
- type: { name: 'boolean', required: false },
82
- description: 'Set to true if the icon type to render is a brand image',
83
- table: {
84
- type: { summary: 'boolean' }
85
- },
86
- defaultValue: 'false'
87
- }
88
- },
89
- args: {
90
- type: 'heart',
91
- size: 3,
92
- animation: 'none',
93
- hoverBgColour: 'primary',
94
- hoverColour: 'secondary'
95
- }
96
- }
97
-
98
- const Template: ComponentStory<typeof Icon> = (args) => <Icon {...args} />
99
-
100
- export const _Icon = Template.bind({})
101
-
102
- export default componentMeta
@@ -1,112 +0,0 @@
1
- import React from 'react'
2
- import classNames from 'classnames'
3
- import { Colours } from '@utils/controls'
4
-
5
- export interface Props {
6
- id?: string
7
- className?: string
8
- type: string
9
- size?: number
10
- animation?: 'pulse' | 'none'
11
- reverseSpin?: boolean
12
- hollow?: boolean
13
- colour?: Colours
14
- bgColour?: Colours
15
- hoverColour?: Colours
16
- hoverBgColour?: Colours
17
- rounded?: boolean
18
- brand?: boolean
19
- }
20
-
21
- const Icon = ({
22
- id,
23
- className,
24
- type,
25
- size = 1,
26
- animation = 'none',
27
- reverseSpin = false,
28
- hollow = false,
29
- colour = 'primary',
30
- bgColour = 'secondary',
31
- hoverColour = 'primary',
32
- hoverBgColour = 'secondary',
33
- rounded = false,
34
- brand = false
35
- }: Props): JSX.Element => {
36
- const fontColour: { [key in Colours]: string } = {
37
- primary: 'text-primary',
38
- secondary: 'text-secondary',
39
- white: 'text-white',
40
- black: 'text-black',
41
- gold: 'text-gold'
42
- }
43
-
44
- const backgroundColour: { [key in Colours]: string } = {
45
- primary: 'bg-primary',
46
- secondary: 'bg-secondary',
47
- white: 'bg-white',
48
- black: 'bg-black',
49
- gold: 'bg-gold'
50
- }
51
-
52
- const hoverFontColour: { [key in Colours]: string } = {
53
- primary: 'group-hover:text-primary',
54
- secondary: 'group-hover:text-secondary',
55
- white: 'group-hover:text-white',
56
- black: 'group-hover:text-black',
57
- gold: 'group-hover:text-gold'
58
- }
59
-
60
- const hoverBackgroundColour: { [key in Colours]: string } = {
61
- primary: 'group-hover:bg-primary',
62
- secondary: 'group-hover:bg-secondary',
63
- white: 'group-hover:bg-white',
64
- black: 'group-hover:bg-black',
65
- gold: 'group-hover:bg-gold'
66
- }
67
-
68
- const wrapperClassList = classNames({
69
- 'w-6 h-6': size === 1,
70
- 'w-10 h-10': size === 2,
71
- 'w-14 h-14': size === 3,
72
- 'w-20 h-20': size === 4,
73
- 'w-24 h-24': size === 5,
74
- 'w-28 h-28': size === 6,
75
- 'w-32 h-32': size === 7,
76
- 'w-36 h-36': size === 8,
77
- 'w-40 h-40': size === 9,
78
- 'w-44 h-44': size === 10,
79
- 'rounded-full': rounded
80
- },
81
- className,
82
- backgroundColour[bgColour],
83
- fontColour[colour],
84
- hoverBackgroundColour[hoverBgColour],
85
- hoverFontColour[hoverColour],
86
- 'flex transition-backgroundColor duration-500 transform'
87
- )
88
-
89
- const classList = classNames({
90
- 'fa-brands': brand,
91
- [`fa-${size}x`]: size,
92
- [`fa-${animation}`]: animation,
93
- 'fa-spin-reverse': reverseSpin,
94
- 'fa-regular': hollow
95
- }, `fa fa-${type} mx-auto my-auto`)
96
-
97
- return (
98
- <div
99
- id={id}
100
- className={wrapperClassList}
101
- >
102
- <span
103
- className={classList}
104
- role='img'
105
- aria-hidden='true'
106
- aria-label={type}
107
- />
108
- </div>
109
- )
110
- }
111
-
112
- export default Icon
@@ -1,88 +0,0 @@
1
- import React from 'react'
2
- import Image from '.'
3
- import { idAndClassName } from '@utils/controls'
4
- import { ComponentStory, ComponentMeta } from '@storybook/react'
5
- import logo from '@assets/images/primary-logo.png'
6
-
7
- const componentMeta: ComponentMeta<typeof Image> = {
8
- title: 'Trepur Components/Rupert Bennett/Atoms/Image',
9
- component: Image,
10
- argTypes: {
11
- ...idAndClassName,
12
- image: {
13
- type: { name: 'string', required: false },
14
- description: 'The image to display on the component',
15
- table: {
16
- type: { summary: 'default' }
17
- }
18
- },
19
- altText: {
20
- type: { name: 'string', required: false },
21
- description: 'The accessibility alt text for the image on the component',
22
- table: {
23
- type: { summary: 'default' }
24
- }
25
- },
26
- title: {
27
- type: { name: 'string', required: false },
28
- description: 'The accessibility title for the image on the component',
29
- table: {
30
- type: { summary: 'default' }
31
- }
32
- },
33
- rounded: {
34
- type: { name: 'boolean', required: false },
35
- description: 'Sets the corners of the component to rounded',
36
- table: {
37
- type: { summary: 'boolean' }
38
- }
39
- },
40
- roundedFull: {
41
- type: { name: 'boolean', required: false },
42
- description: 'Sets the component to a circle shape',
43
- table: {
44
- type: { summary: 'boolean' }
45
- }
46
- },
47
- height: {
48
- type: { name: 'number', required: false },
49
- description: 'Defines the height of the component',
50
- table: {
51
- type: { summary: 'number' }
52
- }
53
- },
54
- width: {
55
- type: { name: 'number', required: false },
56
- description: 'Defines the width of the component',
57
- table: {
58
- type: { summary: 'number' }
59
- }
60
- },
61
- overlayText: {
62
- type: { name: 'string', required: false },
63
- description: 'The text to show when hovering over the component',
64
- table: {
65
- type: { summary: 'default' }
66
- }
67
- },
68
- centerAligned: {
69
- type: { name: 'boolean', required: false },
70
- description: 'Sets the component to the center',
71
- table: {
72
- type: { summary: 'boolean' }
73
- }
74
- }
75
- },
76
- args: {
77
- image: logo,
78
- height: 8,
79
- width: 8,
80
- overlayText: 'logo'
81
- }
82
- }
83
-
84
- const Template: ComponentStory<typeof Image> = (args) => <Image {...args} />
85
-
86
- export const _Image = Template.bind({})
87
-
88
- export default componentMeta