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,63 @@
1
+ import { Meta, StoryObj } from '@storybook/react';
2
+ import { idAndClassName } from '@utils/controls';
3
+
4
+ import Search from '.';
5
+
6
+ const meta = {
7
+ title: 'Components/Search',
8
+ component: Search,
9
+ parameters: {},
10
+ argTypes: {
11
+ ...idAndClassName,
12
+ leftIconProps: {
13
+ description:
14
+ 'An optional param to display an icon to the left of the search bar',
15
+ control: 'text',
16
+ table: {
17
+ category: '',
18
+ },
19
+ },
20
+ rightIconProps: {
21
+ description:
22
+ 'An optional param to display an icon to the right of the search bar',
23
+ control: 'text',
24
+ table: {
25
+ category: '',
26
+ },
27
+ },
28
+ placeholder: {
29
+ description:
30
+ 'An optional param to display a placeholder inside the search box',
31
+ control: 'text',
32
+ table: {
33
+ category: '',
34
+ },
35
+ },
36
+ text: {
37
+ description:
38
+ 'An optional param to display a label on the left of the search bar',
39
+ control: 'text',
40
+ table: {
41
+ category: '',
42
+ },
43
+ },
44
+ },
45
+ args: {
46
+ placeholder: 'search...',
47
+ leftIconProps: {
48
+ type: 'heart',
49
+ className: 'absolute mt-2 left-3 flex items-center',
50
+ bgColour: 'white',
51
+ },
52
+ rightIconProps: {
53
+ type: 'heart',
54
+ className: 'absolute mt-2 right-3 flex items-center',
55
+ bgColour: 'white',
56
+ },
57
+ },
58
+ };
59
+ export default meta;
60
+
61
+ type Story = StoryObj<typeof meta>;
62
+
63
+ export const Default: Story = {};
@@ -0,0 +1,68 @@
1
+ import React, { ChangeEventHandler } from 'react';
2
+
3
+ import Icon, { type Props as iconProps } from '@components/Icon';
4
+ import classNames from 'classnames';
5
+
6
+
7
+
8
+ export interface Props {
9
+ id?: string;
10
+ className?: string;
11
+ onChange?: (val: string | number) => void;
12
+ placeholder?: string;
13
+ text?: string;
14
+ leftIconProps?: iconProps;
15
+ rightIconProps?: iconProps;
16
+ }
17
+
18
+ const Search = ({
19
+ id,
20
+ className,
21
+ onChange,
22
+ placeholder,
23
+ text,
24
+ leftIconProps,
25
+ rightIconProps,
26
+ }: Props): JSX.Element => {
27
+ const classList = classNames(className, style.classList, 'theme-local');
28
+
29
+ const inputClasses = classNames(
30
+ {
31
+ [style.leftIcon]: leftIconProps !== undefined,
32
+ [style.noLeftIcon]: leftIconProps === undefined,
33
+ },
34
+ style.inputClassList,
35
+ );
36
+
37
+ const onChangeFunc: ChangeEventHandler<HTMLInputElement> | undefined =
38
+ onChange != null
39
+ ? (e: any) => {
40
+ onChange(e.target.value);
41
+ }
42
+ : undefined;
43
+
44
+ return (
45
+ <div id={id} className={classList}>
46
+ <div>
47
+ {text !== undefined && (
48
+ <h2 className={classNames(style.text, 'font-base-lg')}>{text}</h2>
49
+ )}
50
+ </div>
51
+ <div>
52
+ <div className={style.inputWrapper}>
53
+ {leftIconProps !== undefined && <Icon {...leftIconProps} />}
54
+ <input
55
+ className={inputClasses}
56
+ onChange={onChangeFunc}
57
+ placeholder={placeholder}
58
+ type="text"
59
+ name="search"
60
+ />
61
+ {rightIconProps !== undefined && <Icon {...rightIconProps} />}
62
+ </div>
63
+ </div>
64
+ </div>
65
+ );
66
+ };
67
+
68
+ export default Search;
@@ -0,0 +1,23 @@
1
+ .classList {
2
+ @apply flex;
3
+ }
4
+
5
+ .inputClassList {
6
+ @apply w-full rounded-md border-2 py-2 pr-9;
7
+ }
8
+
9
+ .leftIcon {
10
+ @apply pl-9;
11
+ }
12
+
13
+ .noLeftIcon {
14
+ @apply pl-2;
15
+ }
16
+
17
+ .text {
18
+ @apply py-2 pr-4;
19
+ }
20
+
21
+ .inputWrapper {
22
+ @apply relative flex w-full;
23
+ }
@@ -0,0 +1,56 @@
1
+ import { Meta, StoryObj } from '@storybook/react';
2
+ import { idAndClassName } from '@utils/controls';
3
+
4
+ import Select from '.';
5
+
6
+ const meta = {
7
+ title: 'Components/Select',
8
+ component: Select,
9
+ parameters: {},
10
+ argTypes: {
11
+ ...idAndClassName,
12
+
13
+ label: {
14
+ description: '',
15
+ control: 'text',
16
+ table: {
17
+ category: '',
18
+ },
19
+ },
20
+ },
21
+ args: {
22
+ label: 'This is a label',
23
+ options: [
24
+ 'Option 1',
25
+ 'Option 2',
26
+ 'Option 3',
27
+ 'Option 4',
28
+ 'Option 1',
29
+ 'Option 2',
30
+ 'Option 3',
31
+ 'Option 4',
32
+ 'Option 1',
33
+ 'Option 2',
34
+ 'Option 3',
35
+ 'Option 4',
36
+ 'Option 1',
37
+ 'Option 2',
38
+ 'Option 3',
39
+ 'Option 4',
40
+ 'Option 1',
41
+ 'Option 2',
42
+ 'Option 3',
43
+ 'Option 4',
44
+ 'Option 1',
45
+ 'Option 2',
46
+ 'Option 3',
47
+ 'Option 4',
48
+ ],
49
+ },
50
+ };
51
+
52
+ export default meta;
53
+
54
+ type Story = StoryObj<typeof meta>;
55
+
56
+ export const Default: Story = {};
@@ -0,0 +1,106 @@
1
+ import React, { useState } from 'react';
2
+
3
+ import Icon from '@components/Icon';
4
+ import classNames from 'classnames';
5
+
6
+
7
+
8
+ interface Props {
9
+ id?: string;
10
+ className?: string;
11
+ options: string[];
12
+ label: string;
13
+ value?: string;
14
+ onClick?: any;
15
+ fullWidth?: boolean;
16
+ required?: boolean;
17
+ }
18
+
19
+ const Select: React.FC<Props> = ({
20
+ id,
21
+ className,
22
+ options,
23
+ value,
24
+ label,
25
+ onClick,
26
+ required = false,
27
+ fullWidth = false,
28
+ }) => {
29
+ const [showDropDown, setShowDropDown] = useState(false);
30
+ const [activeValue, setActiveValue] = useState(
31
+ value !== undefined ? value : options?.[0],
32
+ );
33
+
34
+ const handleOptionClick = (e: any): void => {
35
+ onClick(e.target.textContent);
36
+ setActiveValue(e.target.textContent);
37
+ setShowDropDown(false);
38
+ };
39
+
40
+ const fullWidthClasses = classNames({
41
+ [style.fullWidth]: fullWidth,
42
+ [style.notFullWidth]: !fullWidth,
43
+ });
44
+
45
+ const headerClassList = classNames(
46
+ fullWidthClasses,
47
+ style.classList,
48
+ className,
49
+ 'theme-local',
50
+ );
51
+
52
+ const dropdownClassList = classNames(
53
+ fullWidthClasses,
54
+ style.optionList,
55
+ 'theme-local',
56
+ );
57
+ const dropdownItemClassList = classNames(style.option, 'theme-local');
58
+
59
+ return (
60
+ <>
61
+ <div
62
+ id={id}
63
+ className={headerClassList}
64
+ onClick={() => {
65
+ setShowDropDown(!showDropDown);
66
+ }}
67
+ >
68
+ <div className={style.labelContainer}>
69
+ <div className={style.labelWrapper}>
70
+ <p className={style.label}>{label}</p>
71
+ {required && <p className={style.required}>&nbsp;*</p>}
72
+ </div>
73
+ <p className={style.value}>{activeValue}</p>
74
+ </div>
75
+ <Icon
76
+ className={style.icon}
77
+ bgColour="white"
78
+ colour="ink"
79
+ hoverBgColour="white"
80
+ hoverColour="ink"
81
+ type="chevron-down"
82
+ />
83
+ </div>
84
+ {showDropDown && (
85
+ <div className={classNames(style.dropdownWrapper, fullWidthClasses)}>
86
+ <ul className={dropdownClassList}>
87
+ {options?.map((option: string, i) => (
88
+ <li
89
+ key={`key_${i}`}
90
+ className={dropdownItemClassList}
91
+ value={option}
92
+ onClick={(e) => {
93
+ handleOptionClick(e);
94
+ }}
95
+ >
96
+ {option}
97
+ </li>
98
+ ))}
99
+ </ul>
100
+ </div>
101
+ )}
102
+ </>
103
+ );
104
+ };
105
+
106
+ export default Select;
@@ -0,0 +1,52 @@
1
+ .classList {
2
+ @apply w-full rounded-xl bg-white;
3
+ @apply shadow drop-shadow;
4
+ @apply flex cursor-pointer flex-row justify-between px-4;
5
+ }
6
+
7
+ .fullWidth {
8
+ @apply w-full;
9
+ }
10
+
11
+ .notFullWidth {
12
+ @apply sm:w-72;
13
+ }
14
+
15
+ .labelContainer {
16
+ @apply flex flex-col;
17
+ }
18
+
19
+ .labelWrapper {
20
+ @apply absolute mt-2 flex bg-white text-xs font-thin;
21
+ }
22
+
23
+ .required {
24
+ @apply font-semiBold text-error;
25
+ }
26
+
27
+ .value {
28
+ @apply rounded-xl border-ink bg-white pb-1 pt-6 text-ink;
29
+ @apply flex justify-between;
30
+ }
31
+
32
+ .icon {
33
+ @apply my-auto;
34
+ }
35
+
36
+ .dropdownWrapper {
37
+ @apply relative z-20;
38
+ }
39
+
40
+ .optionList {
41
+ @apply absolute w-full bg-white;
42
+ @apply mt-2 rounded-2xl py-4;
43
+ @apply shadow-xl;
44
+ @apply border border-lightest-grey;
45
+ @apply h-64 overflow-scroll;
46
+ }
47
+
48
+ .option {
49
+ @apply bg-white text-ink hover:bg-lightest-grey;
50
+ @apply hover:cursor-pointer;
51
+ @apply px-4 py-2;
52
+ }
@@ -0,0 +1,30 @@
1
+ import { action } from '@storybook/addon-actions';
2
+ import { Meta, StoryObj } from '@storybook/react';
3
+ import { idAndClassName } from '@utils/controls';
4
+
5
+ import Showcase from '.';
6
+
7
+ const meta = {
8
+ title: 'Components/Showcase',
9
+ component: Showcase,
10
+ argTypes: {
11
+ ...idAndClassName,
12
+ },
13
+ args: {
14
+ title: 'This is a title',
15
+ subTitle: 'This is a subtitle',
16
+ description: 'This is a description',
17
+ bgColour: 'white',
18
+ size: 'large',
19
+ iconProps: {
20
+ type: 'chevron-down',
21
+ onClick: action('Icon click'),
22
+ },
23
+ },
24
+ };
25
+
26
+ export default meta;
27
+
28
+ type Story = StoryObj<typeof meta>;
29
+
30
+ export const Default: Story = {};
@@ -0,0 +1,75 @@
1
+ import React from 'react';
2
+
3
+ import Avatar from '@components/Avatar';
4
+ import ComponentWrapper from '@components/ComponentWrapper';
5
+ import Container from '@components/Container';
6
+ import Icon, { type Props as iconProps } from '@components/Icon';
7
+ import { type Colours } from '@utils/controls';
8
+ import classNames from 'classnames';
9
+
10
+
11
+
12
+ export interface Props {
13
+ id: string;
14
+ className?: string;
15
+ title: string;
16
+ subTitle: string;
17
+ description: string;
18
+ bgColour?: Colours;
19
+ image: string;
20
+
21
+ size?: 'small' | 'medium' | 'large';
22
+ iconProps?: iconProps;
23
+ }
24
+
25
+ const Showcase: React.FC<Props> = ({
26
+ id,
27
+ className,
28
+ title,
29
+ subTitle,
30
+ description,
31
+ bgColour,
32
+ size = 'large',
33
+
34
+ iconProps,
35
+ }: Props): JSX.Element => {
36
+ const classList = classNames(className, 'theme-local');
37
+
38
+ const containerSize = classNames(
39
+ {
40
+ [style.smallContainer]: size === 'small',
41
+ [style.mediumContainer]: size === 'medium',
42
+ [style.largeContainer]: size === 'large',
43
+ },
44
+ style.container,
45
+ );
46
+
47
+ return (
48
+ <ComponentWrapper id={id} className={classList} bgColour={bgColour}>
49
+ <Container className={containerSize}>
50
+ <div className={style.textWrapper}>
51
+ <h2 className={style.title}>{title}</h2>
52
+ <h2 className={style.subTitle}>{subTitle}</h2>
53
+ <p className={style.description}>{description}</p>
54
+ </div>
55
+ <div className={style.avatarWrapper}>
56
+ <Avatar />
57
+ </div>
58
+ </Container>
59
+ {iconProps?.type !== undefined && (
60
+ <div className={style.iconWrapper}>
61
+ <Icon
62
+ className={style.icon}
63
+ size={2}
64
+ rounded
65
+ {...iconProps}
66
+ type={iconProps.type}
67
+ onClick={iconProps.onClick}
68
+ />
69
+ </div>
70
+ )}
71
+ </ComponentWrapper>
72
+ );
73
+ };
74
+
75
+ export default Showcase;
@@ -0,0 +1,47 @@
1
+ .container {
2
+ @apply flex flex-wrap text-center md:flex-nowrap md:text-left;
3
+ }
4
+
5
+ .smallContainer {
6
+ @apply h-56;
7
+ }
8
+
9
+ .mediumContainer {
10
+ @apply h-96;
11
+ }
12
+
13
+ .largeContainer {
14
+ @apply min-h-[calc(100vh-176px)];
15
+ }
16
+
17
+ .textWrapper {
18
+ @apply m-auto w-full md:w-2/3 md:pl-16 md:pr-4 lg:pl-32 lg:pr-8 xl:pl-64;
19
+ }
20
+
21
+ .title {
22
+ @apply text-lg font-bold leading-tight text-primary md:text-xxl;
23
+ }
24
+
25
+ .subTitle {
26
+ @apply text-lg font-bold leading-tight text-black md:text-xxl;
27
+ }
28
+
29
+ .description {
30
+ @apply pt-4 text-sm text-black md:text-md;
31
+ }
32
+
33
+ .avatarWrapper {
34
+ @apply m-auto flex w-full justify-center md:w-1/3 md:pb-20;
35
+ }
36
+
37
+ .avatar {
38
+ @apply max-h-96 md:m-auto md:w-full;
39
+ }
40
+
41
+ .iconWrapper {
42
+ @apply w-full;
43
+ }
44
+
45
+ .icon {
46
+ @apply mx-auto hover:scale-125 hover:cursor-pointer;
47
+ }
@@ -0,0 +1,50 @@
1
+ import { Meta, StoryObj } from '@storybook/react';
2
+ import { idAndClassName } from '@utils/controls';
3
+
4
+ import SideNav from '.';
5
+
6
+ const meta = {
7
+ title: 'Components/SideNav',
8
+ component: SideNav,
9
+ parameters: {
10
+ backgrounds: {
11
+ default: 'grey',
12
+ values: [
13
+ {
14
+ name: 'grey',
15
+ value: '#f3f3f3',
16
+ },
17
+ ],
18
+ },
19
+ },
20
+ argTypes: {
21
+ ...idAndClassName,
22
+
23
+ navLinks: {
24
+ description: 'An array of nav links to display in the component',
25
+ table: {
26
+ type: { summary: 'array' },
27
+ },
28
+ },
29
+ bgColour: {
30
+ type: { name: 'string', required: false },
31
+ options: ['primary', 'secondary', 'white', 'black', 'gold'],
32
+ description: 'The background colour of the component',
33
+ table: {
34
+ type: { summary: 'string' },
35
+ },
36
+ defaultValue: 'primary',
37
+ control: 'select',
38
+ },
39
+ },
40
+ args: {
41
+ children: <p>dfghj</p>,
42
+ showNav: true,
43
+ },
44
+ };
45
+
46
+ export default meta;
47
+
48
+ type Story = StoryObj<typeof meta>;
49
+
50
+ export const Default: Story = {};
@@ -0,0 +1,46 @@
1
+ import React from 'react';
2
+
3
+ import { type Colours } from '@utils/controls';
4
+ import classNames from 'classnames';
5
+
6
+
7
+
8
+ export interface Props {
9
+ id: string;
10
+ className: string;
11
+ children: any;
12
+ getNavStatus: (asSideBar: boolean, open: boolean) => void;
13
+ bgColour?: Colours;
14
+ showNav?: boolean;
15
+ leftExpand?: boolean;
16
+ }
17
+
18
+ const SideNav = ({
19
+ id,
20
+ className,
21
+ children,
22
+ bgColour = 'primary',
23
+ showNav = false,
24
+ leftExpand = true,
25
+ }: Props): JSX.Element => {
26
+ const sideNavClasses = classNames(
27
+ {
28
+ [style.sideBarCollapsed]: !showNav,
29
+ [style.sideBarExpanded]: showNav,
30
+ [style.leftExpand]: leftExpand,
31
+ [style.rightExpand]: !leftExpand,
32
+ },
33
+ style[bgColour],
34
+ style.sideNavClassList,
35
+ className,
36
+ 'theme-local',
37
+ );
38
+
39
+ return (
40
+ <div id={id} className={sideNavClasses}>
41
+ {children}
42
+ </div>
43
+ );
44
+ };
45
+
46
+ export default SideNav;
@@ -0,0 +1,43 @@
1
+ .primary {
2
+ @apply bg-primary text-white;
3
+ }
4
+
5
+ .secondary {
6
+ @apply bg-secondary text-white;
7
+ }
8
+
9
+ .white {
10
+ @apply bg-white text-black;
11
+ }
12
+
13
+ .black {
14
+ @apply bg-black text-white;
15
+ }
16
+
17
+ .sideNavClassList {
18
+ @apply absolute z-50 h-full overflow-hidden duration-700;
19
+ }
20
+
21
+ .leftExpand {
22
+ @apply left-0;
23
+ }
24
+
25
+ .rightExpand {
26
+ @apply right-0;
27
+ }
28
+
29
+ .mobileSideBarMenu {
30
+ @apply space-y-1 pb-3 pt-2;
31
+ }
32
+
33
+ .mobileSideBarMenuNavItems {
34
+ @apply pl-8 pt-4;
35
+ }
36
+
37
+ .sideBarCollapsed {
38
+ @apply w-0;
39
+ }
40
+
41
+ .sideBarExpanded {
42
+ @apply w-full sm:w-1/3;
43
+ }