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,127 +0,0 @@
1
- import React, { useState } from 'react'
2
- import Icon, { Props as iconProps } from '@components/Icon'
3
- import classNames from 'classnames'
4
- import { getTheme } from '@utils/theme'
5
-
6
- export interface Props {
7
- id?: string
8
- className?: string
9
- type?: 'success' | 'warning' | 'error' | 'info'
10
- text?: string
11
- leftIconProps?: iconProps
12
- rightIconProps?: iconProps
13
- textCenter?: boolean
14
- isDismissable?: boolean
15
- theme?: 'light' | 'dark'
16
- onDismissClick?: React.MouseEventHandler
17
- }
18
-
19
- const AlertBar = ({
20
- id,
21
- className,
22
- type = 'warning',
23
- text,
24
- theme = 'light',
25
- leftIconProps,
26
- rightIconProps,
27
- textCenter = false,
28
- isDismissable = false,
29
- onDismissClick
30
- }: Props): JSX.Element => {
31
- const themeToUse: string = getTheme()
32
- const [alertBarStatus, setAlertBarStatus] = useState({
33
- state: 'open',
34
- display: true
35
- })
36
-
37
- const bgColor = classNames({
38
- 'bg-rupertbennett-success': type === 'success' && themeToUse === 'rupertbennett',
39
- 'bg-rupertbennett-warning': type === 'warning' && themeToUse === 'rupertbennett',
40
- 'bg-rupertbennett-error': type === 'error' && themeToUse === 'rupertbennett',
41
- 'bg-rupertbennett-info-light': type === 'info' && themeToUse === 'rupertbennett',
42
- 'bg-bootson-success': type === 'success' && themeToUse === 'bootson',
43
- 'bg-bootson-warning': type === 'warning' && themeToUse === 'bootson',
44
- 'bg-bootson-error': type === 'error' && themeToUse === 'bootson',
45
- 'bg-bootson-info-light': type === 'info' && themeToUse === 'bootson'
46
- })
47
-
48
- const alertBarState = classNames({
49
- 'opacity-100': alertBarStatus.state === 'open',
50
- 'opacity-0': alertBarStatus.state === 'closed',
51
- hidden: !alertBarStatus.display
52
- })
53
-
54
- const classList = classNames(
55
- className,
56
- bgColor,
57
- alertBarState,
58
- 'text-white w-parent flex py-2 transition-opactiy duration-700'
59
- )
60
-
61
- const textClassList = classNames({
62
- 'text-center': textCenter,
63
- 'pl-4': !textCenter
64
- }, 'w-full py-3')
65
-
66
- const rightIconClasses = classNames({
67
- 'hover:cursor-pointer': isDismissable
68
- }, 'px-8 pt-3')
69
-
70
- const leftIconClasses = 'pt-3 pl-8'
71
-
72
- const closeAlertBar = (e: any): void => {
73
- setAlertBarStatus({
74
- state: 'closed',
75
- display: alertBarStatus.display
76
- })
77
- setTimeout(() => setAlertBarStatus({
78
- state: 'closed',
79
- display: false
80
- }), 700)
81
- if (onDismissClick != null) {
82
- onDismissClick(e)
83
- }
84
- }
85
-
86
- const dismissIcon = (
87
- <Icon
88
- type='multiply'
89
- colour='white'
90
- />
91
- )
92
-
93
- const iconLeft = (leftIconProps != null) &&
94
- <Icon
95
- {...leftIconProps}
96
- />
97
-
98
- const iconRight = (rightIconProps != null) &&
99
- <Icon
100
- {...rightIconProps}
101
- />
102
-
103
- return (
104
- <div
105
- id={id}
106
- className={classList}
107
- >
108
- {(leftIconProps != null) &&
109
- <span className={leftIconClasses}>
110
- {iconLeft}
111
- </span>}
112
- <h3 className={textClassList}>{text}</h3>
113
- {isDismissable &&
114
- <a className={rightIconClasses} onClick={(e) => closeAlertBar(e)}>
115
- <span>
116
- {dismissIcon}
117
- </span>
118
- </a>}
119
- {(iconRight != null) && !isDismissable &&
120
- <span className={rightIconClasses}>
121
- {iconRight}
122
- </span>}
123
- </div>
124
- )
125
- }
126
-
127
- export default AlertBar
@@ -1,60 +0,0 @@
1
- import React from 'react'
2
- import Breadcrumbs from './index'
3
- import { ComponentStory, ComponentMeta } from '@storybook/react'
4
-
5
- const componentMeta: ComponentMeta<typeof Breadcrumbs> = {
6
- title: 'Trepur Components/Other/Atoms/Breadcrumbs',
7
- component: Breadcrumbs,
8
- argTypes: {
9
- id: {
10
- description: 'Defines the id of the component',
11
- table: {
12
- category: '',
13
- type: { summary: 'string' },
14
- defaultValue: { summary: 'undefined' }
15
- }
16
- },
17
- className: {
18
- description: 'Defines any additional classes for the components',
19
- table: {
20
- category: '',
21
- type: { summary: 'string' },
22
- defaultValue: { summary: 'undefined' }
23
- }
24
- },
25
- links: {
26
- description: 'An array of items to be displayed in the component',
27
- table: {
28
- category: '',
29
- type: { summary: 'array' },
30
- defaultValue: { summary: 'undefined' }
31
- }
32
- }
33
- },
34
- args: {
35
- links: [
36
- {
37
- href: '/',
38
- name: 'link 1'
39
- },
40
- {
41
- href: '/',
42
- name: 'link 2'
43
- },
44
- {
45
- href: '/',
46
- name: 'link 3'
47
- },
48
- {
49
- href: '/',
50
- name: 'link 4'
51
- }
52
- ]
53
- }
54
- }
55
-
56
- const Template: ComponentStory<typeof Breadcrumbs> = (args) => <Breadcrumbs {...args} />
57
-
58
- export const _Breadcrumbs = Template.bind({})
59
-
60
- export default componentMeta
@@ -1,55 +0,0 @@
1
- import React from 'react'
2
- import classNames from 'classnames'
3
-
4
- export interface Props {
5
- id?: string
6
- className?: string
7
- links?: Array<{ name: string, href: string }>
8
- }
9
-
10
- const Breadcrumbs = ({
11
- id,
12
- className,
13
- links
14
- }: Props): JSX.Element => {
15
- const linksLength = (links != null)
16
- ? Object.keys(links).length
17
- : 0
18
-
19
- const classList = classNames(className, 'flex py-2 px-8')
20
-
21
- return (
22
- <ul id={id} className={classList}>
23
- {links?.map((link, i) => {
24
- return (
25
- <div key={`breadcrumb_${i + 1}`} className='flex'>
26
- <li className='h-8'>
27
- {i + 1 >= linksLength
28
- ? (
29
- <p className='px-1 py-1'>
30
- {link.name}
31
- </p>
32
- )
33
- : (
34
- <p className='px-1 py-1'>
35
- <a
36
- className='text-facebook hover:underline'
37
- href={link.href}
38
- >
39
- {link.name}
40
- </a>
41
- </p>
42
- )}
43
- </li>
44
- {i + 1 < linksLength &&
45
- <li className='h-8'>
46
- <p className='py-1'>&nbsp; &#62; &nbsp;</p>
47
- </li>}
48
- </div>
49
- )
50
- })}
51
- </ul>
52
- )
53
- }
54
-
55
- export default Breadcrumbs
@@ -1,52 +0,0 @@
1
- import React from 'react'
2
- import { idAndClassName } from '@utils/controls'
3
- import BreadcrumbsBordered from './index'
4
- import { ComponentStory, ComponentMeta } from '@storybook/react'
5
-
6
- const componentMeta: ComponentMeta<typeof BreadcrumbsBordered> = {
7
- title: 'Trepur Components/Other/Organisms/Breadcrumbs',
8
- component: BreadcrumbsBordered,
9
- parameters: {},
10
- argTypes: {
11
- ...idAndClassName,
12
- links: {
13
- description: 'An array of objects to be displayed in the component',
14
- control: { type: 'array', default: undefined },
15
- table: {
16
- category: '',
17
- type: { summary: 'array' },
18
- defaultValue: { summary: 'undefined' }
19
- }
20
- }
21
- },
22
- args: {
23
- links: [
24
- {
25
- link: '/',
26
- name: 'link 1'
27
- },
28
- {
29
- link: '/',
30
- name: 'link 2'
31
- },
32
- {
33
- link: '/',
34
- name: 'link 3'
35
- },
36
- {
37
- link: '/',
38
- name: 'link 4'
39
- },
40
- {
41
- link: '/',
42
- name: 'link 5'
43
- }
44
- ]
45
- }
46
- }
47
-
48
- const Template: ComponentStory<typeof BreadcrumbsBordered> = (args) => <BreadcrumbsBordered {...args} />
49
-
50
- export const _BreadcrumbsBordered = Template.bind({})
51
-
52
- export default componentMeta
@@ -1,44 +0,0 @@
1
- import React from 'react'
2
- import BreadcrumbsItem, { Props as breadcrumbsItemProps } from '@components/BreadcrumbsItem/index'
3
- import classNames from 'classnames'
4
-
5
- export interface Props {
6
- id?: string
7
- className?: string
8
- links?: breadcrumbsItemProps[]
9
- }
10
-
11
- const Breadcrumbs: React.FC<Props> = ({
12
- id,
13
- className,
14
- links
15
- }) => {
16
- const linksLength = links?.length !== undefined ? links.length : 0
17
- const classList = classNames(className, 'flex')
18
-
19
- return (
20
- <ul id={id} className={classList}>
21
- {links?.map((link: breadcrumbsItemProps, i: number) => {
22
- const margin = i === 0 ? ' mr-3' : ' mx-3'
23
- const first = i === 0
24
-
25
- let bType = 'standard'
26
- if (linksLength >= 1 && i + 1 < linksLength) {
27
- bType = 'link'
28
- }
29
- return (
30
- <BreadcrumbsItem
31
- key={`breadcrumb_item_${i + 0}`}
32
- className={margin}
33
- name={link.name}
34
- link={link.link}
35
- type={bType}
36
- firstItem={first}
37
- />
38
- )
39
- })}
40
- </ul>
41
- )
42
- }
43
-
44
- export default Breadcrumbs
@@ -1,54 +0,0 @@
1
- import React from 'react'
2
- import BreadcrumbsItem from './index'
3
- import { ComponentStory, ComponentMeta } from '@storybook/react'
4
-
5
- const componentMeta: ComponentMeta<typeof BreadcrumbsItem> = {
6
- title: 'Trepur Components/Other/Atoms/Breadcrumbs Item',
7
- component: BreadcrumbsItem,
8
- parameters: {},
9
- argTypes: {
10
- id: {
11
- description: 'Defines the id of the component',
12
- table: {
13
- category: '',
14
- type: { summary: 'string' },
15
- defaultValue: { summary: 'undefined' }
16
- }
17
- },
18
- className: {
19
- description: 'Defines any additional classes for the components',
20
- table: {
21
- category: '',
22
- type: { summary: 'string' },
23
- defaultValue: { summary: 'undefined' }
24
- }
25
- },
26
- name: {
27
- description: 'Specifies the name for the key attribute',
28
- table: {
29
- category: '',
30
- type: { summary: 'string' },
31
- defaultValue: { summary: 'undefined' }
32
- }
33
- },
34
- type: {
35
- description: 'Specifies the type of breadcrumbs to display ie link',
36
- table: {
37
- category: '',
38
- type: { summary: 'string' },
39
- defaultValue: { summary: 'undefined' }
40
- }
41
- }
42
- },
43
- args: {
44
- name: 'Link 1',
45
- href: '/',
46
- firstItem: false
47
- }
48
- }
49
-
50
- const Template: ComponentStory<typeof BreadcrumbsItem> = (args) => <BreadcrumbsItem {...args} />
51
-
52
- export const _BreadcrumbsItem = Template.bind({})
53
-
54
- export default componentMeta
@@ -1,151 +0,0 @@
1
- import React, { useState } from 'react'
2
- import classNames from 'classnames'
3
-
4
- export interface Props {
5
- id?: string
6
- className?: string
7
- name: string
8
- link: string
9
- type?: string
10
- firstItem?: boolean
11
- href?: string
12
- }
13
-
14
- const BreadcrumbsItem = ({
15
- id,
16
- className,
17
- name,
18
- link,
19
- href,
20
- type,
21
- firstItem
22
- }: Props): JSX.Element => {
23
- const [isHovering, setIsHovering] = useState(false)
24
- const topArrowClasses = 'top-0'
25
- const bottomArrowClasses = 'bottom-0'
26
- const textClassList = 'text-center pt-1'
27
- const liClassList = 'list-none'
28
-
29
- const classList = classNames(className, 'item')
30
-
31
- const itemClassList = classNames({
32
- 'hover:underline': type === 'link',
33
- 'mb-0': isHovering
34
- }, 'bc-item relative px-4 h-8')
35
-
36
- const backArrowsClasses = 'absolute w-0 h-0 bg-transparent border-l-transparent'
37
- const frontArrowClasses = 'absolute top-0 w-0 h-0 border-t'
38
-
39
- const frontArrow = (
40
- <span
41
- style={{
42
- borderTop: '17px solid transparent',
43
- borderBottom: '15px solid transparent',
44
- borderLeft: '16px solid',
45
- right: '-16px'
46
- }}
47
- className={frontArrowClasses}
48
- />
49
- )
50
-
51
- const backArrows = (
52
- <>
53
- <span
54
- style={{
55
- borderTop: '17px solid',
56
- borderBottom: '18px solid transparent',
57
- borderLeft: '17px solid transparent',
58
- left: '-17px',
59
- // '-webkit-transform': 'scaleY(-1)',
60
- transform: 'scaleY(-1)'
61
- }}
62
- className={`${backArrowsClasses} ${bottomArrowClasses}`}
63
- />
64
- <span
65
- style={{
66
- borderTop: '18px solid',
67
- borderBottom: '17px solid transparent',
68
- borderLeft: '17px solid transparent',
69
- left: '-17px'
70
- }}
71
- className={`${backArrowsClasses} ${topArrowClasses}`}
72
- />
73
- </>
74
- )
75
-
76
- const renderWithFrontArrow = (
77
- <div className={itemClassList}>
78
- <p className={textClassList}>
79
- {name}
80
- {frontArrow}
81
- </p>
82
- </div>
83
- )
84
-
85
- const renderWithBackArrows = (
86
- <div className={itemClassList}>
87
- <p className={textClassList}>
88
- {backArrows}
89
- {name}
90
- {frontArrow}
91
- </p>
92
- </div>
93
- )
94
-
95
- return (
96
- <div
97
- id={id}
98
- className={classList}
99
- >
100
- {type === 'link'
101
- ? (
102
- firstItem === true
103
- ? (
104
- <a
105
- onMouseOver={() => setIsHovering(true)}
106
- onMouseOut={() => setIsHovering(false)}
107
- href={href}
108
- >
109
- <li className={liClassList}>
110
- {renderWithFrontArrow}
111
- </li>
112
- </a>
113
- )
114
- : (
115
- <a
116
- onMouseOver={() => setIsHovering(true)}
117
- onMouseOut={() => setIsHovering(false)}
118
- href={href}
119
- >
120
- <li className={liClassList}>
121
- {renderWithBackArrows}
122
- </li>
123
- </a>
124
- )
125
- )
126
- : (
127
- firstItem === true
128
- ? (
129
- <li
130
- className={liClassList}
131
- onMouseOver={() => setIsHovering(true)}
132
- onMouseOut={() => setIsHovering(false)}
133
- >
134
- {renderWithFrontArrow}
135
- </li>
136
- )
137
- : (
138
- <li
139
- className={liClassList}
140
- onMouseOver={() => setIsHovering(true)}
141
- onMouseOut={() => setIsHovering(false)}
142
- >
143
- {renderWithBackArrows}
144
- </li>
145
- )
146
- )}
147
- </div>
148
- )
149
- }
150
-
151
- export default BreadcrumbsItem
@@ -1,148 +0,0 @@
1
- import React from 'react'
2
- import Button from './index'
3
- import { action } from '@storybook/addon-actions'
4
- import { idAndClassName } from '@utils/controls'
5
- import { ComponentStory, ComponentMeta } from '@storybook/react'
6
-
7
- const componentMeta: ComponentMeta<typeof Button> = {
8
- title: 'Trepur Components/Rupert Bennett/Atoms/Button',
9
- component: Button,
10
- parameters: {
11
- docs: {
12
- description: {
13
- component: 'A Button which can either be internal, external or social as well as a standard design or a slide design.'
14
- }
15
- }
16
- },
17
- argTypes: {
18
- ...idAndClassName,
19
- onClick: {
20
- type: { name: 'function', required: false },
21
- description: 'The action to perform when clicking on the component',
22
- action: 'onClick',
23
- table: {
24
- type: {
25
- summary: 'function'
26
- },
27
- defaultValue: { summary: 'undefined' }
28
- }
29
- },
30
- hoverText: {
31
- type: {
32
- name: 'string',
33
- required: false
34
- },
35
- description: 'The text to display when hovering on the component',
36
- table: {
37
- type: {
38
- summary: 'string'
39
- },
40
- defaultValue: {
41
- summary: 'undefined'
42
- }
43
- }
44
- },
45
- variant: {
46
- type: {
47
- name: 'string', required: false
48
- },
49
- options: ['primary', 'secondary'],
50
- description: 'The variant of button to render',
51
- table: {
52
- type: {
53
- summary: 'primary'
54
- },
55
- defaultValue: {
56
- summary: 'primary'
57
- }
58
- },
59
- defaultValue: 'primary',
60
- control: {
61
- type: 'radio'
62
- }
63
- },
64
- type: {
65
- type: {
66
- name: 'string',
67
- required: false
68
- },
69
- options: ['default', 'social', 'icon'],
70
- description: 'The type of button to render',
71
- table: {
72
- type: {
73
- summary: 'default'
74
- },
75
- defaultValue: {
76
- summary: 'default'
77
- }
78
- },
79
- defaultValue: 'default',
80
- control: { type: 'radio' }
81
- },
82
- href: {
83
- type: { name: 'string', required: false },
84
- description: 'The link attached to the component',
85
- table: {
86
- type: {
87
- summary: 'default'
88
- },
89
- defaultValue: {
90
- summary: 'undefined'
91
- }
92
- }
93
- },
94
- rounded: {
95
- type: {
96
- name: 'boolean',
97
- required: false
98
- },
99
- description: 'rounds the borders when true',
100
- defaultValue: 'true'
101
- },
102
- disabled: {
103
- type: {
104
- name: 'boolean',
105
- required: false
106
- },
107
- description: 'Can the carousel be dragged or not'
108
- },
109
- isLoading: {
110
- type: {
111
- name: 'boolean',
112
- required: false
113
- },
114
- table: {
115
- defaultValue: {
116
- summary: 'false'
117
- }
118
- },
119
- description: 'Toggles the loading state of the compnent'
120
- },
121
- openInNewTab: {
122
- type: { name: 'boolean', required: false },
123
- description: 'Opens the link in a new tab when set to true',
124
- defaultValue: 'false'
125
- },
126
- children: {
127
- type: { name: 'other', value: 'string | React.ReactNode' },
128
- description: 'The child elements to show in the component',
129
- table: {
130
- type: {
131
- summary: 'Array'
132
- },
133
- defaultValue: { summary: 'undefined' }
134
- }
135
- }
136
- },
137
- args: {
138
- children: 'This is a button',
139
- rounded: true,
140
- onClick: action('button clicked')
141
- }
142
- }
143
-
144
- const Template: ComponentStory<typeof Button> = (args) => <Button {...args} />
145
-
146
- export const _Button = Template.bind({})
147
-
148
- export default componentMeta