trepur_components 2.3.3 → 2.3.5

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 (254) hide show
  1. package/.eslintrc.cjs +43 -0
  2. package/.husky/pre-commit +4 -0
  3. package/.prettierrc.json +22 -0
  4. package/archive/Breadcrumbs/Breadcrumbs.stories.tsx +46 -0
  5. package/archive/Breadcrumbs/index.tsx +42 -0
  6. package/archive/BreadcrumbsBordered/BreadcrumbsBordered.stories.tsx +52 -0
  7. package/archive/BreadcrumbsBordered/index.tsx +44 -0
  8. package/archive/BreadcrumbsItem/BreadcrumbsItem.stories.tsx +40 -0
  9. package/archive/BreadcrumbsItem/index.tsx +149 -0
  10. package/archive/Button/Button.stories.tsx +150 -0
  11. package/archive/Button/index.tsx +111 -0
  12. package/archive/Button/style.module.css +76 -0
  13. package/archive/Calendar/Calendar.stories.tsx +82 -0
  14. package/archive/Calendar/index.tsx +76 -0
  15. package/archive/Calendar/style.css +233 -0
  16. package/archive/Card/Card.stories.tsx +75 -0
  17. package/archive/Card/index.tsx +102 -0
  18. package/archive/Card/style.module.css +75 -0
  19. package/archive/CardWithTopImage/CardWithTopImage.stories.tsx +50 -0
  20. package/archive/CardWithTopImage/index.tsx +39 -0
  21. package/archive/CardWithTopImage/style.module.css +11 -0
  22. package/archive/Carousel/Carousel.stories.tsx +451 -0
  23. package/archive/Carousel/index.tsx +388 -0
  24. package/archive/Carousel/style.module.css +99 -0
  25. package/archive/CarouselThumbnail/CarouselThumbnail.stories.tsx +350 -0
  26. package/archive/CarouselThumbnail/index.tsx +302 -0
  27. package/archive/CarouselThumbnail/style.module.css +67 -0
  28. package/archive/Checkbox/Checkbox.mdx +33 -0
  29. package/archive/Checkbox/Checkbox.stories.tsx +34 -0
  30. package/archive/Checkbox/index.tsx +51 -0
  31. package/archive/Checkbox/style.module.css +15 -0
  32. package/archive/Collapsible/Collapsible.stories.tsx +67 -0
  33. package/archive/Collapsible/index.tsx +116 -0
  34. package/archive/Collapsible/style.module.css +47 -0
  35. package/archive/Column/Column.stories.tsx +89 -0
  36. package/archive/Column/index.tsx +119 -0
  37. package/archive/Column/style.module.css +151 -0
  38. package/archive/ComponentWrapper/ComponentWrapper.stories.tsx +40 -0
  39. package/archive/ComponentWrapper/index.tsx +55 -0
  40. package/archive/ComponentWrapper/style.module.css +40 -0
  41. package/archive/Container/Container.stories.tsx +40 -0
  42. package/archive/Container/index.tsx +24 -0
  43. package/archive/Container/style.module.css +4 -0
  44. package/archive/Counter/Counter.stories.tsx +19 -0
  45. package/archive/Counter/index.tsx +66 -0
  46. package/archive/Counter/style.module.css +19 -0
  47. package/archive/DetailUpdater/DetailUpdater.stories.tsx +96 -0
  48. package/archive/DetailUpdater/index.tsx +112 -0
  49. package/archive/DetailUpdater/style.module.css +31 -0
  50. package/archive/Dialog/Dialog.stories.tsx +131 -0
  51. package/archive/Dialog/index.tsx +91 -0
  52. package/archive/Dialog/style.module.css +44 -0
  53. package/archive/DropdownMenu/DropdownMenu.stories.tsx +59 -0
  54. package/archive/DropdownMenu/index.tsx +51 -0
  55. package/archive/DropdownMenu/style.module.css +38 -0
  56. package/archive/DynamicTextSection/DynamicTextSection.stories.tsx +74 -0
  57. package/archive/DynamicTextSection/index.tsx +36 -0
  58. package/archive/DynamicTextSection/style.module.css +0 -0
  59. package/archive/FileUploader/FilePreview.tsx +48 -0
  60. package/archive/FileUploader/FileUploader.stories.tsx +28 -0
  61. package/archive/FileUploader/index.tsx +135 -0
  62. package/archive/FileUploader/style.module.css +54 -0
  63. package/archive/FilterItem/FilterItem.stories.tsx +33 -0
  64. package/archive/FilterItem/index.tsx +101 -0
  65. package/archive/FilterItem/style.module.css +27 -0
  66. package/archive/Footer/Footer.stories.tsx +59 -0
  67. package/archive/Footer/index.tsx +50 -0
  68. package/archive/Footer/style.module.css +19 -0
  69. package/archive/FooterNav/FooterNav.stories.tsx +125 -0
  70. package/archive/FooterNav/index.tsx +57 -0
  71. package/archive/FooterNav/style.module.css +32 -0
  72. package/archive/FooterNavItem/FooterNavItem.stories.tsx +53 -0
  73. package/archive/FooterNavItem/index.tsx +80 -0
  74. package/archive/FooterNavItem/style.module.css +139 -0
  75. package/archive/Form/Form.stories.tsx +86 -0
  76. package/archive/Form/index.tsx +61 -0
  77. package/archive/Form/style.module.css +0 -0
  78. package/archive/FyreCard/FyreCard.stories.tsx +31 -0
  79. package/archive/FyreCard/index.tsx +52 -0
  80. package/archive/FyreCard/style.module.css +19 -0
  81. package/archive/Greeting/Greeting.stories.tsx +41 -0
  82. package/archive/Greeting/index.tsx +32 -0
  83. package/archive/HamburgerIcon/HamburgerIcon.stories.tsx +32 -0
  84. package/archive/HamburgerIcon/index.tsx +103 -0
  85. package/archive/HamburgerIcon/style.module.css +85 -0
  86. package/archive/HorizontalLine/HorizontalLine.stories.tsx +54 -0
  87. package/archive/HorizontalLine/index.tsx +40 -0
  88. package/archive/HorizontalLine/style.module.css +55 -0
  89. package/archive/Icon/Icon.stories.tsx +164 -0
  90. package/archive/Icon/index.tsx +115 -0
  91. package/archive/Icon/style.module.css +253 -0
  92. package/archive/IconCard/IconCard.stories.tsx +46 -0
  93. package/archive/IconCard/index.tsx +57 -0
  94. package/archive/IconCard/style.module.css +18 -0
  95. package/archive/Image/Image.stories.tsx +87 -0
  96. package/archive/Image/index.tsx +132 -0
  97. package/archive/Image/style.module.css +109 -0
  98. package/archive/ImageInfo/ImageInfo.stories.tsx +39 -0
  99. package/archive/ImageInfo/index.tsx +95 -0
  100. package/archive/ImageInfo/style.module.css +47 -0
  101. package/archive/ImageLink/ImageLink.stories.tsx +37 -0
  102. package/archive/ImageLink/index.tsx +49 -0
  103. package/archive/ImageLink/style.module.css +23 -0
  104. package/archive/ImageLinkList/ImageLinkList.stories.tsx +34 -0
  105. package/archive/ImageLinkList/index.tsx +33 -0
  106. package/archive/ImageLinkList/style.module.css +3 -0
  107. package/archive/InformationIcon/InformationIcon.stories.tsx +83 -0
  108. package/archive/InformationIcon/index.tsx +128 -0
  109. package/archive/InformationIcon/style.module.css +71 -0
  110. package/archive/InformationIconBlock/InformationIconBlock.stories.tsx +32 -0
  111. package/archive/InformationIconBlock/index.tsx +63 -0
  112. package/archive/InformationIconBlock/style.module.css +7 -0
  113. package/archive/Input/Input.stories.tsx +84 -0
  114. package/archive/Input/index.tsx +131 -0
  115. package/archive/Input/style.module.css +60 -0
  116. package/archive/Jumbotron/Jumbotron.stories.tsx +21 -0
  117. package/archive/Jumbotron/index.tsx +31 -0
  118. package/archive/Jumbotron/style.module.css +8 -0
  119. package/archive/MenuButton/MenuButton.stories.tsx +46 -0
  120. package/archive/MenuButton/index.tsx +82 -0
  121. package/archive/MenuButton/style.module.css +45 -0
  122. package/archive/Modal/Modal.stories.tsx +86 -0
  123. package/archive/Modal/index.tsx +74 -0
  124. package/archive/Modal/style.module.css +35 -0
  125. package/archive/NavItem/NavItem.stories.tsx +90 -0
  126. package/archive/NavItem/index.tsx +65 -0
  127. package/archive/NavItem/style.module.css +71 -0
  128. package/archive/NavOld/NavOld.stories.tsx +193 -0
  129. package/archive/NavOld/StickyNav.tsx +191 -0
  130. package/archive/NavOld/index.tsx +273 -0
  131. package/archive/NavOld/style.module.css +156 -0
  132. package/archive/NavTwo/Dropdown.tsx +35 -0
  133. package/archive/NavTwo/Nav.stories.tsx +38 -0
  134. package/archive/NavTwo/Sidebar.tsx +34 -0
  135. package/archive/NavTwo/StickyNav.tsx +34 -0
  136. package/archive/NavTwo/index.tsx +45 -0
  137. package/archive/NavTwo/style.module.css +35 -0
  138. package/archive/NewsCard/NewsCard.stories.tsx +72 -0
  139. package/archive/NewsCard/index.tsx +57 -0
  140. package/archive/NewsCard/style.module.css +15 -0
  141. package/archive/Pill/Pill.stories.tsx +44 -0
  142. package/archive/Pill/index.tsx +64 -0
  143. package/archive/Pill/style.module.css +32 -0
  144. package/archive/ProductCard/ProductCard.stories.tsx +61 -0
  145. package/archive/ProductCard/index.tsx +111 -0
  146. package/archive/ProductCard/style.module.css +53 -0
  147. package/archive/ProductCardV2/ProductCardV2.stories.tsx +50 -0
  148. package/archive/ProductCardV2/index.tsx +119 -0
  149. package/archive/ProductCardV2/style.module.css +59 -0
  150. package/archive/Proficiencies/Proficiencies.stories.tsx +50 -0
  151. package/archive/Proficiencies/index.tsx +63 -0
  152. package/archive/Proficiencies/style.module.css +31 -0
  153. package/archive/Profile/Profile.stories.tsx +49 -0
  154. package/archive/Profile/index.tsx +103 -0
  155. package/archive/Profile/style.module.css +47 -0
  156. package/archive/Row/Row.stories.tsx +53 -0
  157. package/archive/Row/index.tsx +23 -0
  158. package/archive/Row/style.module.css +3 -0
  159. package/archive/Search/Search.stories.tsx +63 -0
  160. package/archive/Search/index.tsx +68 -0
  161. package/archive/Search/style.module.css +23 -0
  162. package/archive/Select/Select.stories.tsx +56 -0
  163. package/archive/Select/index.tsx +106 -0
  164. package/archive/Select/style.module.css +52 -0
  165. package/archive/Showcase/Showcase.stories.tsx +30 -0
  166. package/archive/Showcase/index.tsx +75 -0
  167. package/archive/Showcase/style.module.css +47 -0
  168. package/archive/SideNav/SideNav.stories.tsx +50 -0
  169. package/archive/SideNav/index.tsx +46 -0
  170. package/archive/SideNav/style.module.css +43 -0
  171. package/archive/SocialBlock/SocialBlock.stories.tsx +58 -0
  172. package/archive/SocialBlock/index.tsx +63 -0
  173. package/archive/SocialButton/SocialButton.stories.tsx +88 -0
  174. package/archive/SocialButton/index.tsx +71 -0
  175. package/archive/SocialButton/style.module.css +77 -0
  176. package/archive/StarRating/StarRating.stories.tsx +23 -0
  177. package/archive/StarRating/index.tsx +71 -0
  178. package/archive/Testimonial/Testimonial.stories.tsx +110 -0
  179. package/archive/Testimonial/index.tsx +61 -0
  180. package/archive/Testimonial/style.module.css +27 -0
  181. package/archive/TextAndTitle/TextAndTitle.stories.tsx +70 -0
  182. package/archive/TextAndTitle/index.tsx +123 -0
  183. package/archive/TextAndTitle/style.module.css +75 -0
  184. package/archive/TextArea/TextArea.stories.tsx +55 -0
  185. package/archive/TextArea/index.tsx +125 -0
  186. package/archive/TextArea/style.module.css +60 -0
  187. package/archive/Timeline/Timeline.stories.tsx +92 -0
  188. package/archive/Timeline/index.tsx +254 -0
  189. package/archive/Timeline/style.module.css +134 -0
  190. package/archive/TimelineV2/TimelineV2.stories.tsx +95 -0
  191. package/archive/TimelineV2/index.tsx +70 -0
  192. package/archive/TimelineV2/style.module.css +28 -0
  193. package/archive/Tubestops/Tubestops.stories.tsx +42 -0
  194. package/archive/Tubestops/index.tsx +58 -0
  195. package/archive/Tubestops/style.module.css +54 -0
  196. package/archive/UserIcon/UserIcon.stories.tsx +52 -0
  197. package/archive/UserIcon/index.tsx +46 -0
  198. package/archive/UserIcon/style.module.css +19 -0
  199. package/archive/Video/Video.stories.tsx +23 -0
  200. package/archive/Video/index.tsx +47 -0
  201. package/archive/fonts/Sora/OFL.txt +93 -0
  202. package/archive/fonts/Sora/README.txt +70 -0
  203. package/archive/fonts/Sora/Sora-VariableFont_wght.ttf +0 -0
  204. package/archive/fonts/Sora/static/Sora-Bold.ttf +0 -0
  205. package/archive/fonts/Sora/static/Sora-ExtraBold.ttf +0 -0
  206. package/archive/fonts/Sora/static/Sora-ExtraLight.ttf +0 -0
  207. package/archive/fonts/Sora/static/Sora-Light.ttf +0 -0
  208. package/archive/fonts/Sora/static/Sora-Medium.ttf +0 -0
  209. package/archive/fonts/Sora/static/Sora-Regular.ttf +0 -0
  210. package/archive/fonts/Sora/static/Sora-SemiBold.ttf +0 -0
  211. package/archive/fonts/Sora/static/Sora-Thin.ttf +0 -0
  212. package/archive/theme.ts +39 -0
  213. package/archive/typography/Fonts/Fonts.stories.tsx +14 -0
  214. package/archive/typography/Fonts/Fonts.tsx +181 -0
  215. package/lib/components/Accordion/index.js +10 -10
  216. package/lib/components/AlertBar/index.js +10 -10
  217. package/lib/components/index.d.ts +4 -0
  218. package/lib/index.js +1 -7
  219. package/lib/styles/base.css +1 -0
  220. package/package.json +6 -8
  221. package/postcss.config.js +8 -0
  222. package/src/components/Accordion/Accordion.stories.tsx +116 -0
  223. package/src/components/Accordion/index.tsx +30 -0
  224. package/src/components/AlertBar/AlertBar.stories.tsx +95 -0
  225. package/src/components/AlertBar/index.tsx +115 -0
  226. package/src/components/Avatar/Avatar.stories.tsx +19 -0
  227. package/src/components/Avatar/index.tsx +495 -0
  228. package/src/components/index.ts +119 -0
  229. package/src/documentation/Colours.mdx +192 -0
  230. package/src/documentation/Introduction.mdx +9 -0
  231. package/src/index.ts +1 -0
  232. package/src/styles/base.css +117 -0
  233. package/src/utils/controls.ts +44 -0
  234. package/src/utils/matchMedia.ts +9 -0
  235. package/src/utils/screens.ts +7 -0
  236. package/svg.d.ts +4 -0
  237. package/tailwind.config.ts +81 -0
  238. package/tsconfig.json +43 -0
  239. package/tsconfig.node.json +12 -0
  240. package/vite.config.mjs +64 -0
  241. package/lib/archive/Breadcrumbs/index.js +0 -12
  242. package/lib/archive/BreadcrumbsBordered/index.js +0 -25
  243. package/lib/archive/BreadcrumbsItem/index.js +0 -117
  244. package/lib/src/components/index.d.ts +0 -7
  245. /package/lib/{src/components → components}/Accordion/Accordion.stories.d.ts +0 -0
  246. /package/lib/{src/components → components}/Accordion/index.d.ts +0 -0
  247. /package/lib/{src/components → components}/AlertBar/AlertBar.stories.d.ts +0 -0
  248. /package/lib/{src/components → components}/AlertBar/index.d.ts +0 -0
  249. /package/lib/{src/components → components}/Avatar/Avatar.stories.d.ts +0 -0
  250. /package/lib/{src/components → components}/Avatar/index.d.ts +0 -0
  251. /package/lib/{src/index.d.ts → index.d.ts} +0 -0
  252. /package/lib/{src/utils → utils}/controls.d.ts +0 -0
  253. /package/lib/{src/utils → utils}/matchMedia.d.ts +0 -0
  254. /package/lib/{src/utils → utils}/screens.d.ts +0 -0
@@ -0,0 +1,151 @@
1
+ .classList {
2
+ @apply h-full;
3
+ }
4
+
5
+ .size1 {
6
+ @apply w-1/12;
7
+ }
8
+ .size2 {
9
+ @apply w-2/12;
10
+ }
11
+ .size3 {
12
+ @apply w-3/12;
13
+ }
14
+ .size4 {
15
+ @apply w-4/12;
16
+ }
17
+ .size5 {
18
+ @apply w-5/12;
19
+ }
20
+ .size6 {
21
+ @apply w-6/12;
22
+ }
23
+ .size7 {
24
+ @apply w-7/12;
25
+ }
26
+ .size8 {
27
+ @apply w-8/12;
28
+ }
29
+ .size9 {
30
+ @apply w-9/12;
31
+ }
32
+ .size10 {
33
+ @apply w-10/12;
34
+ }
35
+ .size11 {
36
+ @apply w-11/12;
37
+ }
38
+ .size12 {
39
+ @apply w-full;
40
+ }
41
+
42
+ .mdSize1 {
43
+ @apply md:w-1/12;
44
+ }
45
+ .mdSize2 {
46
+ @apply md:w-2/12;
47
+ }
48
+ .mdSize3 {
49
+ @apply md:w-3/12;
50
+ }
51
+ .mdSize4 {
52
+ @apply md:w-4/12;
53
+ }
54
+ .mdSize5 {
55
+ @apply md:w-5/12;
56
+ }
57
+ .mdSize6 {
58
+ @apply md:w-6/12;
59
+ }
60
+ .mdSize7 {
61
+ @apply md:w-7/12;
62
+ }
63
+ .mdSize8 {
64
+ @apply md:w-8/12;
65
+ }
66
+ .mdSize9 {
67
+ @apply md:w-9/12;
68
+ }
69
+ .mdSize10 {
70
+ @apply md:w-10/12;
71
+ }
72
+ .mdSize11 {
73
+ @apply md:w-11/12;
74
+ }
75
+ .mdSize12 {
76
+ @apply md:w-full;
77
+ }
78
+
79
+ .lgSize1 {
80
+ @apply lg:w-1/12;
81
+ }
82
+ .lgSize2 {
83
+ @apply lg:w-2/12;
84
+ }
85
+ .lgSize3 {
86
+ @apply lg:w-3/12;
87
+ }
88
+ .lgSize4 {
89
+ @apply lg:w-4/12;
90
+ }
91
+ .lgSize5 {
92
+ @apply lg:w-5/12;
93
+ }
94
+ .lgSize6 {
95
+ @apply lg:w-6/12;
96
+ }
97
+ .lgSize7 {
98
+ @apply lg:w-7/12;
99
+ }
100
+ .lgSize8 {
101
+ @apply lg:w-8/12;
102
+ }
103
+ .lgSize9 {
104
+ @apply lg:w-9/12;
105
+ }
106
+ .lgSize10 {
107
+ @apply lg:w-10/12;
108
+ }
109
+ .lgSize11 {
110
+ @apply lg:w-11/12;
111
+ }
112
+ .lgSize12 {
113
+ @apply lg:w-full;
114
+ }
115
+
116
+ .xlSize1 {
117
+ @apply xl:w-1/12;
118
+ }
119
+ .xlSize2 {
120
+ @apply xl:w-2/12;
121
+ }
122
+ .xlSize3 {
123
+ @apply xl:w-3/12;
124
+ }
125
+ .xlSize4 {
126
+ @apply xl:w-4/12;
127
+ }
128
+ .xlSize5 {
129
+ @apply xl:w-5/12;
130
+ }
131
+ .xlSize6 {
132
+ @apply xl:w-6/12;
133
+ }
134
+ .xlSize7 {
135
+ @apply xl:w-7/12;
136
+ }
137
+ .xlSize8 {
138
+ @apply xl:w-8/12;
139
+ }
140
+ .xlSize9 {
141
+ @apply xl:w-9/12;
142
+ }
143
+ .xlSize10 {
144
+ @apply xl:w-10/12;
145
+ }
146
+ .xlSize11 {
147
+ @apply xl:w-11/12;
148
+ }
149
+ .xlSize12 {
150
+ @apply xl:w-full;
151
+ }
@@ -0,0 +1,40 @@
1
+ import { Meta, StoryObj } from '@storybook/react';
2
+ import { idAndClassName } from '@utils/controls';
3
+
4
+ import ComponentWrapper from '.';
5
+
6
+ const meta = {
7
+ title: 'Components/ComponentWrapper',
8
+ component: ComponentWrapper,
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
+ title: 'This is a title',
30
+ description:
31
+ 'Lorem ipsum dolor sit amet consectetur adipisicing elit. Corporis blanditiis cupiditate officiis aperiam culpa unde vitae quaerat, incidunt aliquam ut qui alias accusamus aspernatur in ad voluptatibus itaque, quibusdam distinctio.',
32
+ children: <p>This is a centered ComponentWrapper with a max width</p>,
33
+ },
34
+ };
35
+
36
+ export default meta;
37
+
38
+ type Story = StoryObj<typeof meta>;
39
+
40
+ export const Default: Story = {};
@@ -0,0 +1,55 @@
1
+ import React, { type CSSProperties } from 'react';
2
+
3
+ import Container from '@components/Container';
4
+ import { type Colours } from '@utils/controls';
5
+ import classNames from 'classnames';
6
+
7
+
8
+
9
+ export interface Props {
10
+ id?: string;
11
+ className?: string;
12
+ title?: string;
13
+ description?: string;
14
+ bgColour?: Colours;
15
+ children?: any;
16
+ styles?: CSSProperties;
17
+ withContainerPadding?: boolean;
18
+ }
19
+
20
+ const ComponentWrapper = ({
21
+ id,
22
+ className,
23
+ title,
24
+ description,
25
+ bgColour = 'grey',
26
+ children,
27
+ styles,
28
+ withContainerPadding = true,
29
+ }: Props): JSX.Element => {
30
+ const classList = classNames(
31
+ className,
32
+ style.classList,
33
+ style[bgColour],
34
+ 'theme-local',
35
+ );
36
+ const containerClasses = classNames({
37
+ [style.containerPadding]: withContainerPadding,
38
+ });
39
+
40
+ return (
41
+ <div id={id} className={classList} style={styles}>
42
+ <Container withPadding className={containerClasses}>
43
+ <div className={style.heading}>
44
+ {title !== undefined && <h2 className={style.title}>{title}</h2>}
45
+ {description !== undefined && (
46
+ <p className={style.description}>{description}</p>
47
+ )}
48
+ </div>
49
+ {children}
50
+ </Container>
51
+ </div>
52
+ );
53
+ };
54
+
55
+ export default ComponentWrapper;
@@ -0,0 +1,40 @@
1
+ .classList {
2
+ @apply mx-auto w-full;
3
+ scroll-margin-top: 80px;
4
+ }
5
+
6
+ .containerPadding {
7
+ @apply py-8;
8
+ }
9
+
10
+ .heading {
11
+ @apply pt-0;
12
+ }
13
+
14
+ .title {
15
+ @apply pb-2 text-lg font-regular;
16
+ }
17
+
18
+ .description {
19
+ @apply pb-8 text-md font-light;
20
+ }
21
+
22
+ .primary {
23
+ @apply bg-primary text-white;
24
+ }
25
+
26
+ .secondary {
27
+ @apply bg-secondary text-white;
28
+ }
29
+
30
+ .white {
31
+ @apply bg-white text-black;
32
+ }
33
+
34
+ .grey {
35
+ @apply bg-lightest-grey text-black;
36
+ }
37
+
38
+ .black {
39
+ @apply bg-black text-white;
40
+ }
@@ -0,0 +1,40 @@
1
+ import { Meta, StoryObj } from '@storybook/react';
2
+ import { idAndClassName } from '@utils/controls';
3
+
4
+ import Container from '.';
5
+
6
+ const meta = {
7
+ title: 'Components/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
+ children: (
30
+ <div className="w-full border">
31
+ <p className="my-20 text-center">This is a container</p>
32
+ </div>
33
+ ),
34
+ },
35
+ };
36
+ export default meta;
37
+
38
+ type Story = StoryObj<typeof meta>;
39
+
40
+ export const Default: Story = {};
@@ -0,0 +1,24 @@
1
+ import React from 'react';
2
+
3
+ import classNames from 'classnames';
4
+
5
+
6
+
7
+ export interface Props {
8
+ id?: string;
9
+ className?: string;
10
+ withPadding?: boolean;
11
+ children?: any;
12
+ }
13
+
14
+ const Container = ({ id, className, children }: Props): JSX.Element => {
15
+ const classList = classNames(className, style.classList, 'theme-local');
16
+
17
+ return (
18
+ <div id={id} className={classList}>
19
+ {children}
20
+ </div>
21
+ );
22
+ };
23
+
24
+ export default Container;
@@ -0,0 +1,4 @@
1
+ .classList {
2
+ @apply px-6 md:px-10 lg:px-20;
3
+ max-width: 2520px;
4
+ }
@@ -0,0 +1,19 @@
1
+ import { Meta, StoryObj } from '@storybook/react';
2
+ import { idAndClassName } from '@utils/controls';
3
+
4
+ import Counter from '.';
5
+
6
+ const meta = {
7
+ title: 'Components/Counter',
8
+ component: Counter,
9
+ argTypes: {
10
+ ...idAndClassName,
11
+ },
12
+ args: {},
13
+ };
14
+
15
+ export default meta;
16
+
17
+ type Story = StoryObj<typeof meta>;
18
+
19
+ export const Default: Story = {};
@@ -0,0 +1,66 @@
1
+ import React, { useState } from 'react';
2
+
3
+ import Icon from '@components/Icon';
4
+ import classNames from 'classnames';
5
+
6
+
7
+
8
+ export interface Props {
9
+ id?: string;
10
+ count?: number;
11
+
12
+ onClick?: (count: number) => void;
13
+ }
14
+
15
+ const Counter: React.FC<Props> = ({
16
+ id,
17
+ count = 0,
18
+ onClick,
19
+ }: Props): JSX.Element => {
20
+ const [currentCount, setCurrentCount] = useState(
21
+ count !== undefined ? count : 0,
22
+ );
23
+
24
+ const handleMinusClick = (e: any): void => {
25
+ e.stopPropagation();
26
+ const newCount = currentCount - 1;
27
+ if (currentCount === 0) {
28
+ return;
29
+ }
30
+ setCurrentCount(newCount);
31
+ onClick?.(newCount);
32
+ };
33
+
34
+ const handlePlusClick = (e: any): void => {
35
+ e.stopPropagation();
36
+ const newCount = currentCount + 1;
37
+ setCurrentCount(newCount);
38
+ onClick?.(newCount);
39
+ };
40
+
41
+ return (
42
+ <div id={id} className={classNames(style.container, 'theme-local')}>
43
+ <div className={style.innerContainer}>
44
+ <div className={style.minusIconWrapper}>
45
+ <Icon
46
+ type="chevron-left"
47
+ onClick={(e: any) => {
48
+ handleMinusClick(e);
49
+ }}
50
+ />
51
+ </div>
52
+ <div className={style.count}>{currentCount}</div>
53
+ <div className={style.plusIconWrapper}>
54
+ <Icon
55
+ type="chevron-right"
56
+ onClick={(e: any) => {
57
+ handlePlusClick(e);
58
+ }}
59
+ />
60
+ </div>
61
+ </div>
62
+ </div>
63
+ );
64
+ };
65
+
66
+ export default Counter;
@@ -0,0 +1,19 @@
1
+ .container {
2
+ @apply z-10 inline-block rounded-lg border bg-white p-1;
3
+ }
4
+
5
+ .innerContainer {
6
+ @apply flex;
7
+ }
8
+
9
+ .count {
10
+ @apply w-auto overflow-hidden text-center;
11
+ }
12
+
13
+ .minusIconWrapper {
14
+ @apply my-auto cursor-pointer;
15
+ }
16
+
17
+ .plusIconWrapper {
18
+ @apply my-auto cursor-pointer;
19
+ }
@@ -0,0 +1,96 @@
1
+ import Input from '@components/Input';
2
+ import { action } from '@storybook/addon-actions';
3
+ import { Meta, StoryObj } from '@storybook/react';
4
+ import { idAndClassName } from '@utils/controls';
5
+
6
+ import DetailUpdater from '.';
7
+
8
+ const meta = {
9
+ title: 'Components/Detail Updater',
10
+ component: DetailUpdater,
11
+ parameters: {},
12
+ argTypes: {
13
+ ...idAndClassName,
14
+
15
+ title: {
16
+ description: '',
17
+ control: 'text',
18
+ table: {
19
+ category: '',
20
+ },
21
+ },
22
+ description: {
23
+ description: '',
24
+ control: 'text',
25
+ table: {
26
+ category: '',
27
+ },
28
+ },
29
+ expandText: {
30
+ description: '',
31
+ control: 'boolean',
32
+ table: {
33
+ category: '',
34
+ },
35
+ },
36
+ collapseText: {
37
+ description: '',
38
+ control: 'boolean',
39
+ table: {
40
+ category: '',
41
+ },
42
+ },
43
+ ctaText: {
44
+ description: '',
45
+ control: 'boolean',
46
+ table: {
47
+ category: '',
48
+ },
49
+ },
50
+ onClick: {
51
+ description: '',
52
+ control: 'array',
53
+ table: {
54
+ category: '',
55
+ },
56
+ },
57
+ fields: {
58
+ description: 'The default value of the input',
59
+ control: 'text',
60
+ table: {
61
+ category: '',
62
+ },
63
+ },
64
+ },
65
+ args: {
66
+ title: 'Legal Name',
67
+ description: 'This is a description to let you know what to do',
68
+ expandText: 'Edit',
69
+ collapseText: 'Cancel',
70
+ ctaText: 'Save',
71
+ onClick: (fieldValues) => {
72
+ action('Submitted')(fieldValues);
73
+ },
74
+ onChange: (value) => {
75
+ action('Updated')(value);
76
+ },
77
+ children: (
78
+ <Input
79
+ withValidation
80
+ bgColour="white"
81
+ label="Title"
82
+ placeholder="Insert title here"
83
+ className="mb-4"
84
+ fullWidth={true}
85
+ required={true}
86
+ // onChange={(e) => setTitle(e.target.value)}
87
+ />
88
+ ),
89
+ },
90
+ };
91
+
92
+ export default meta;
93
+
94
+ type Story = StoryObj<typeof meta>;
95
+
96
+ export const Default: Story = {};
@@ -0,0 +1,112 @@
1
+ import React, { useState } from 'react';
2
+
3
+ import Button from '@components/Button';
4
+ import classNames from 'classnames';
5
+ import 'keen-slider/keen-slider.min.css';
6
+
7
+
8
+
9
+ export interface Props {
10
+ id?: string;
11
+ className?: string;
12
+ title: string;
13
+ description?: string;
14
+ expandText: string;
15
+ collapseText: string;
16
+ ctaText: string;
17
+ onClick?: (fieldValues: any) => void;
18
+ onChange?: (fieldValues: any) => void;
19
+
20
+ children: React.ReactNode;
21
+ onSubmit?: () => void;
22
+ onCancel?: () => void;
23
+ value?: string;
24
+ }
25
+
26
+ const DetailUpdater: React.FC<Props> = ({
27
+ id,
28
+ className,
29
+ title,
30
+ description,
31
+ expandText,
32
+ collapseText,
33
+ ctaText,
34
+ onClick,
35
+ onChange,
36
+ children,
37
+ onSubmit,
38
+ onCancel,
39
+ value,
40
+ }) => {
41
+ const [expanded, setExpanded] = useState(false);
42
+ const classList = classNames(className, style.classList, 'theme-local');
43
+
44
+ const handleSubmit = (): void => {
45
+ onSubmit?.();
46
+ setExpanded(false);
47
+ };
48
+ // const handleChange = (e: any): void => {
49
+ // const value = e.target.value
50
+ // const id = e.target.id
51
+
52
+ // const newFieldValues = fieldValues.map((fieldValue) => {
53
+ // return fieldValue.id !== id.split('-')[1]
54
+ // ? fieldValue
55
+ // : { ...fieldValue, value }
56
+ // })
57
+
58
+ // onChange?.(newFieldValues)
59
+
60
+ // setFieldValues(newFieldValues)
61
+ // }
62
+
63
+ // const handleSubmit = (): void => {
64
+ // onClick?.(fieldValues)
65
+ // setState(false)
66
+ // }
67
+
68
+ return (
69
+ <div id={id} className={classList}>
70
+ {!expanded && (
71
+ <div className={style.class}>
72
+ <div className={style.wrapper}>
73
+ <p className={style.title}>{title}</p>
74
+ <p
75
+ className={style.expandText}
76
+ onClick={() => {
77
+ setExpanded(true);
78
+ }}
79
+ >
80
+ {expandText}
81
+ </p>
82
+ </div>
83
+ <p className={style.value}>{value !== undefined ? value : '-'}</p>
84
+ </div>
85
+ )}
86
+ {expanded && (
87
+ <div className={style.class}>
88
+ <div className={style.wrapper}>
89
+ <p className={style.title}>{title}</p>
90
+ <p
91
+ className={style.expandText}
92
+ onClick={() => {
93
+ onCancel?.();
94
+ setExpanded(false);
95
+ }}
96
+ >
97
+ {collapseText}
98
+ </p>
99
+ </div>
100
+ <p className={style.description}>{description}</p>
101
+ <div className={style.inputWrapper}>{children}</div>
102
+ <Button variant="secondary" onClick={handleSubmit}>
103
+ {ctaText}
104
+ </Button>
105
+ </div>
106
+ )}
107
+ <hr className={style.hr} />
108
+ </div>
109
+ );
110
+ };
111
+
112
+ export default DetailUpdater;
@@ -0,0 +1,31 @@
1
+ .class {
2
+ @apply mx-4 py-6;
3
+ }
4
+
5
+ .wrapper {
6
+ @apply flex justify-between;
7
+ }
8
+
9
+ .title {
10
+ @apply font-semiBold text-ink;
11
+ }
12
+
13
+ .value {
14
+ @apply text-ink;
15
+ }
16
+
17
+ .description {
18
+ @apply text-light-grey;
19
+ }
20
+
21
+ .expandText {
22
+ @apply cursor-pointer font-semiBold text-ink underline;
23
+ }
24
+
25
+ .inputWrapper {
26
+ @apply grid w-full grid-cols-1 gap-0 py-4 md:grid-cols-2 md:gap-4 lg:w-2/3;
27
+ }
28
+
29
+ .hr {
30
+ @apply text-lightest-grey shadow;
31
+ }