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,70 +0,0 @@
1
- import React from 'react'
2
- import Collapsible from './index'
3
- import { ComponentStory, ComponentMeta } from '@storybook/react'
4
-
5
- const componentMeta: ComponentMeta<typeof Collapsible> = {
6
- title: 'Trepur Components/Other/Atoms/Collapsible',
7
- component: Collapsible,
8
- parameters: {},
9
- argTypes: {
10
- title: {
11
- description: '',
12
- control: 'text',
13
- table: {
14
- category: ''
15
- }
16
- },
17
- subtitle: {
18
- description: '',
19
- control: 'text',
20
- table: {
21
- category: ''
22
- }
23
- },
24
- borderTop: {
25
- description: '',
26
- control: 'boolean',
27
- table: {
28
- category: ''
29
- }
30
- },
31
- borderBottom: {
32
- description: '',
33
- control: 'boolean',
34
- table: {
35
- category: ''
36
- }
37
- },
38
- showBottomLine: {
39
- description: '',
40
- control: 'boolean',
41
- table: {
42
- category: ''
43
- }
44
- },
45
- children: {
46
- description: '',
47
- control: 'array',
48
- table: {
49
- category: ''
50
- }
51
- }
52
- },
53
- args: {
54
- title: 'This is a title',
55
- subtitle: 'This is a subtitle',
56
- showBottomLine: true,
57
- iconProps: {
58
- type: 'heart',
59
- colour: 'white',
60
- bgColour: 'primary'
61
- },
62
- children: <p>Lorem ipsum, dolor sit amet consectetur adipisicing elit. Error, unde perferendis quibusdam eos repellendus vero rerum sunt reiciendis velit autem odio, fuga molestiae perspiciatis dolor voluptatum mollitia quos ipsa! Doloribus? Lorem ipsum, dolor sit amet consectetur adipisicing elit. Reiciendis ducimus, dolorum tempore unde earum aspernatur placeat magnam, alias neque, blanditiis esse tenetur dignissimos in optio nihil libero cum cupiditate debitis?</p>
63
- }
64
- }
65
-
66
- const Template: ComponentStory<typeof Collapsible> = (args) => <Collapsible {...args} />
67
-
68
- export const _Collapsible = Template.bind({})
69
-
70
- export default componentMeta
@@ -1,124 +0,0 @@
1
- import React, { useState, useEffect } 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
- title?: string
9
- subtitle?: string
10
- boldTitle?: boolean
11
- borderTop?: boolean
12
- borderBottom?: boolean
13
- showBottomLine?: boolean
14
- iconProps?: iconProps
15
- children?: string | JSX.Element
16
- }
17
-
18
- const Collapsible = ({
19
- id,
20
- className,
21
- title,
22
- subtitle,
23
- boldTitle,
24
- borderTop,
25
- borderBottom,
26
- showBottomLine,
27
- iconProps,
28
- children
29
- }: Props): JSX.Element => {
30
- const [expanded, setExpanded] = useState(false)
31
-
32
- useEffect(() => {
33
- const coll = document.getElementsByClassName('collapsible')
34
- let i: number
35
-
36
- for (i = 0; i < coll.length; i++) {
37
- coll[i].addEventListener('click', function (this: any, err: any) {
38
- const content = this.nextElementSibling
39
-
40
- const scrollHeight: string = content.scrollHeight.toString()
41
- if (content.style.maxHeight === '0px') {
42
- content.style.maxHeight = `${scrollHeight}px`
43
- } else {
44
- content.style.maxHeight = '0px'
45
- }
46
- })
47
- }
48
- })
49
-
50
- const headingClassList = classNames({
51
- 'border-b': borderBottom,
52
- 'border-t': borderTop
53
- }, 'w-auto flex text-center collapsible')
54
-
55
- const classList = classNames(className, 'bg-primary text-white hover:bg-white hover:text-primary transition-opactiy duration-300')
56
-
57
- const padding = classNames({
58
- 'pt-7': title !== undefined && subtitle !== undefined,
59
- 'pt-4': title !== undefined && subtitle === undefined
60
- })
61
-
62
- const textSubstitutePadding = classNames({
63
- 'pb-4': title === undefined && subtitle === undefined
64
- })
65
-
66
- const contentWrapperClassList = classNames({
67
- 'max-h-max my-2': expanded,
68
- 'max-h-0': !expanded
69
- }, 'w-auto overflow-hidden px-4 bg-white text-primary')
70
-
71
- const childrenClassList = classNames(padding, 'w-full pr-8 text-right')
72
-
73
- const expandItem = (e: any): void => {
74
- const content = e.currentTarget.nextElementSibling
75
- const scrollHeight: string = content.scrollHeight.toString()
76
- if (!expanded) {
77
- content.style.maxHeight = `${scrollHeight}px`
78
- } else {
79
- content.style.maxHeight = '0px'
80
- }
81
- setExpanded(!expanded)
82
- }
83
-
84
- return (
85
- <div
86
- id={id}
87
- className={classList}
88
- >
89
- <div
90
- onClick={e => expandItem(e)}
91
- className={headingClassList}
92
- >
93
- {(iconProps !== undefined) &&
94
- <div
95
- className={`pl-4 text-left ${padding} ${textSubstitutePadding}`}
96
- >
97
- <Icon {...iconProps} />
98
- </div>}
99
- {(title !== undefined || subtitle !== undefined) &&
100
- <div className='w-full pl-4 py-4 text-left'>
101
- {title !== undefined && <h4>{title}</h4>}
102
- {subtitle !== undefined && <h5><small>{subtitle}</small></h5>}
103
- </div>}
104
- {children !== undefined &&
105
- <div className={childrenClassList}>
106
- <Icon
107
- type={expanded ? 'chevron-up' : 'chevron-down'}
108
- colour='white'
109
- bgColour='primary'
110
- />
111
- </div>}
112
- </div>
113
- {children !== undefined &&
114
- <div
115
- className={contentWrapperClassList}
116
- style={{ transition: 'max-height 0.2s ease-out' }}
117
- >
118
- {children}
119
- </div>}
120
- </div>
121
- )
122
- }
123
-
124
- export default Collapsible
@@ -1,82 +0,0 @@
1
- import React from 'react'
2
- import Column from './index'
3
- import { idAndClassName } from '@utils/controls'
4
- import CardWithTopImage from '@components/CardWithTopImage'
5
- import logo from '@assets/images/primary-logo.png'
6
- import { ComponentStory, ComponentMeta } from '@storybook/react'
7
-
8
- const cardChild = (
9
- <CardWithTopImage
10
- id='cardwithtopimage'
11
- imageProps={{
12
- image: logo,
13
- roundedFull: true
14
- }}
15
- >
16
- <p>This is some text</p>
17
- <p>This is some more text</p>
18
- <p>This is a bit more text</p>
19
- <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>
20
- </CardWithTopImage>
21
- )
22
-
23
- const componentMeta: ComponentMeta<typeof Column> = {
24
- title: 'Trepur Components/Rupert Bennett/Atoms/Column',
25
- component: Column,
26
- parameters: {},
27
- argTypes: {
28
- ...idAndClassName,
29
- sm: {
30
- type: { name: 'number', required: false },
31
- description: 'The number of sections out of 12 that the component should span on sm screens',
32
- table: {
33
- type: { summary: 'number' }
34
- }
35
- },
36
- md: {
37
- type: { name: 'number', required: false },
38
- description: 'The number of sections out of 12 that the component should span on md screens',
39
- table: {
40
- type: { summary: 'number' }
41
- }
42
- },
43
- lg: {
44
- type: { name: 'number', required: false },
45
- description: 'The number of sections out of 12 that the component should span on lg screens',
46
- table: {
47
- type: { summary: 'number' }
48
- }
49
- },
50
- xl: {
51
- type: { name: 'number', required: false },
52
- description: 'The number of sections out of 12 that the component should span on xl screens',
53
- table: {
54
- type: { summary: 'number' }
55
- }
56
- },
57
- children: {
58
- type: { name: 'other', value: 'string | React.ReactNode' },
59
- description: 'The child elements to show in the component',
60
- table: {
61
- type: {
62
- summary: 'Array'
63
- },
64
- defaultValue: { summary: 'undefined' }
65
- }
66
- }
67
- },
68
- args: {
69
- sm: 12,
70
- md: 8,
71
- lg: 4,
72
- xl: 2,
73
- className: 'bg-facebook md:bg-twitter lg-whatsapp xl:bg-linkedin border',
74
- children: cardChild
75
- }
76
- }
77
-
78
- const Template: ComponentStory<typeof Column> = (args) => <Column {...args} />
79
-
80
- export const _Column = Template.bind({})
81
-
82
- export default componentMeta
@@ -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