trepur_components 2.3.9 → 2.3.11

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 (284) hide show
  1. package/lib/_virtual/react.js +4 -0
  2. package/lib/components/Accordion/Accordion.stories.d.ts +47 -0
  3. package/lib/components/Accordion/const.d.ts +31 -0
  4. package/lib/components/Accordion/index.d.ts +5 -0
  5. package/lib/components/Accordion/index.js +9 -0
  6. package/lib/components/AlertBar/AlertBar.stories.d.ts +25 -0
  7. package/lib/components/AlertBar/index.d.ts +15 -0
  8. package/lib/components/AlertBar/index.js +66 -0
  9. package/lib/components/Avatar/Avatar.stories.d.ts +10 -0
  10. package/lib/components/Avatar/index.d.ts +3 -0
  11. package/lib/components/Breadcrumbs/Breadcrumbs.stories.d.ts +18 -0
  12. package/lib/components/Breadcrumbs/index.d.ts +15 -0
  13. package/lib/components/Breadcrumbs/index.js +49 -0
  14. package/lib/components/Button/Button.stories.d.ts +24 -0
  15. package/lib/components/Button/index.d.ts +14 -0
  16. package/lib/components/Button/index.js +43 -0
  17. package/lib/components/Calendar/Calendar.stories.d.ts +11 -0
  18. package/lib/components/Calendar/index.d.ts +14 -0
  19. package/lib/components/Calendar/index.js +49 -0
  20. package/lib/components/Calendar/style.css.js +1 -0
  21. package/lib/components/Card/Card.stories.d.ts +11 -0
  22. package/lib/components/Card/index.d.ts +2 -0
  23. package/lib/components/Card/index.js +25 -0
  24. package/lib/components/Carousel/Carousel.stories.d.ts +23 -0
  25. package/lib/components/Carousel/index.d.ts +70 -0
  26. package/lib/components/Carousel/index.js +159 -0
  27. package/lib/components/Carousel/utils.d.ts +1 -0
  28. package/lib/components/Carousel/utils.js +38 -0
  29. package/lib/components/CarouselThumbnail/CarouselThumbnail.stories.d.ts +22 -0
  30. package/lib/components/CarouselThumbnail/const.d.ts +1 -0
  31. package/lib/components/CarouselThumbnail/const.js +20 -0
  32. package/lib/components/CarouselThumbnail/index.d.ts +51 -0
  33. package/lib/components/CarouselThumbnail/index.js +74 -0
  34. package/lib/components/CarouselThumbnail/utils.d.ts +2 -0
  35. package/lib/components/CarouselThumbnail/utils.js +65 -0
  36. package/lib/components/Checkbox/Checkbox.stories.d.ts +17 -0
  37. package/lib/components/Checkbox/index.d.ts +11 -0
  38. package/lib/components/Checkbox/index.js +28 -0
  39. package/lib/components/Collapsible/Collapsible.stories.d.ts +57 -0
  40. package/lib/components/Collapsible/index.d.ts +19 -0
  41. package/lib/components/Collapsible/index.js +87 -0
  42. package/lib/components/Counter/Counter.stories.d.ts +17 -0
  43. package/lib/components/Counter/index.d.ts +14 -0
  44. package/lib/components/Counter/index.js +49 -0
  45. package/lib/components/DetailUpdater/DetailUpdater.stories.d.ts +20 -0
  46. package/lib/components/DetailUpdater/index.d.ts +18 -0
  47. package/lib/components/DetailUpdater/index.js +63 -0
  48. package/lib/components/Dialog/Dialog.stories.d.ts +15 -0
  49. package/lib/components/Dialog/index.d.ts +12 -0
  50. package/lib/components/Dialog/index.js +16 -0
  51. package/lib/components/Dropdown/Dropdown.stories.d.ts +17 -0
  52. package/lib/components/Dropdown/index.d.ts +13 -0
  53. package/lib/components/Dropdown/index.js +66 -0
  54. package/lib/components/Dropdown/utils.d.ts +1 -0
  55. package/lib/components/Dropdown/utils.js +14 -0
  56. package/lib/components/FileUploader/FilePreview.d.ts +8 -0
  57. package/lib/components/FileUploader/FileUploader.stories.d.ts +52 -0
  58. package/lib/components/FileUploader/index.d.ts +15 -0
  59. package/lib/components/Footer/Footer.stories.d.ts +19 -0
  60. package/lib/components/Footer/index.d.ts +16 -0
  61. package/lib/components/Footer/index.js +36 -0
  62. package/lib/components/FooterNav/FooterNav.stories.d.ts +22 -0
  63. package/lib/components/FooterNav/index.d.ts +15 -0
  64. package/lib/components/FooterNav/index.js +38 -0
  65. package/lib/components/Form/Form.stories.d.ts +117 -0
  66. package/lib/components/Form/index.d.ts +13 -0
  67. package/lib/components/Form/index.js +17 -0
  68. package/lib/components/Gallery/Gallery.stories.d.ts +16 -0
  69. package/lib/components/Gallery/index.d.ts +7 -0
  70. package/lib/components/Greeting/Greeting.stories.d.ts +13 -0
  71. package/lib/components/Greeting/index.d.ts +7 -0
  72. package/lib/components/Greeting/index.js +20 -0
  73. package/lib/components/HamburgerIcon/HamburgerIcon.stories.d.ts +10 -0
  74. package/lib/components/HamburgerIcon/index.d.ts +2 -0
  75. package/lib/components/HamburgerIcon/index.js +78 -0
  76. package/lib/components/Icon/Icon.stories.d.ts +16 -0
  77. package/lib/components/Icon/index.d.ts +10 -0
  78. package/lib/components/Icon/index.js +23 -0
  79. package/lib/components/Image/Image.stories.d.ts +13 -0
  80. package/lib/components/Image/index.d.ts +5 -0
  81. package/lib/components/Image/index.js +17 -0
  82. package/lib/components/ImageCard/ImageCard.stories.d.ts +19 -0
  83. package/lib/components/ImageCard/index.d.ts +11 -0
  84. package/lib/components/ImageCard/index.js +32 -0
  85. package/lib/components/Input/Input.stories.d.ts +22 -0
  86. package/lib/components/Input/index.d.ts +33 -0
  87. package/lib/components/Input/index.js +83 -0
  88. package/lib/components/MenuButton/MenuButton.stories.d.ts +76 -0
  89. package/lib/components/MenuButton/index.d.ts +14 -0
  90. package/lib/components/MenuButton/index.js +56 -0
  91. package/lib/components/Modal/Modal.stories.d.ts +67 -0
  92. package/lib/components/Modal/index.d.ts +10 -0
  93. package/lib/components/Modal/index.js +45 -0
  94. package/lib/components/Nav/Nav.stories.d.ts +31 -0
  95. package/lib/components/Nav/index.d.ts +20 -0
  96. package/lib/components/Nav/index.js +81 -0
  97. package/lib/components/NavItem/NavItem.stories.d.ts +17 -0
  98. package/lib/components/NavItem/index.d.ts +8 -0
  99. package/lib/components/NavItem/index.js +31 -0
  100. package/lib/components/Pill/Pill.stories.d.ts +22 -0
  101. package/lib/components/Pill/index.d.ts +17 -0
  102. package/lib/components/Pill/index.js +30 -0
  103. package/lib/components/Search/Search.stories.d.ts +86 -0
  104. package/lib/components/Search/index.d.ts +12 -0
  105. package/lib/components/Search/index.js +42 -0
  106. package/lib/components/Select/Select.stories.d.ts +56 -0
  107. package/lib/components/Select/index.d.ts +11 -0
  108. package/lib/components/Select/index.js +68 -0
  109. package/lib/components/Showcase/Showcase.stories.d.ts +55 -0
  110. package/lib/components/Showcase/index.d.ts +15 -0
  111. package/lib/components/SideNav/SideNav.stories.d.ts +80 -0
  112. package/lib/components/SideNav/index.d.ts +12 -0
  113. package/lib/components/SocialButton/SocialButton.stories.d.ts +130 -0
  114. package/lib/components/SocialButton/index.d.ts +12 -0
  115. package/lib/components/SplitCard/SplitCard.stories.d.ts +21 -0
  116. package/lib/components/SplitCard/index.d.ts +14 -0
  117. package/lib/components/Stars/Star.stories.d.ts +14 -0
  118. package/lib/components/Stars/index.d.ts +8 -0
  119. package/lib/components/Stars/index.js +22 -0
  120. package/lib/components/Testimonial/Testimonial.stories.d.ts +21 -0
  121. package/lib/components/Testimonial/index.d.ts +13 -0
  122. package/lib/components/Testimonial/index.js +42 -0
  123. package/lib/components/TextArea/TextArea.stories.d.ts +21 -0
  124. package/lib/components/TextArea/index.d.ts +33 -0
  125. package/lib/components/TextArea/index.js +76 -0
  126. package/lib/components/Timeline/Timeline.stories.d.ts +21 -0
  127. package/lib/components/Timeline/index.d.ts +11 -0
  128. package/lib/components/Timeline/index.js +31 -0
  129. package/lib/components/Tubestops/Tubestops.stories.d.ts +19 -0
  130. package/lib/components/Tubestops/index.d.ts +15 -0
  131. package/lib/components/Tubestops/index.js +77 -0
  132. package/lib/components/Video/Video.stories.d.ts +23 -0
  133. package/lib/components/Video/index.d.ts +18 -0
  134. package/lib/components/Video/index.js +32 -0
  135. package/{src/components/index.ts → lib/components/index.d.ts} +35 -71
  136. package/lib/documentation/assets/index.d.ts +3 -0
  137. package/lib/documentation/typography/Fonts/Fonts.d.ts +2 -0
  138. package/lib/documentation/typography/Fonts/Fonts.stories.d.ts +10 -0
  139. package/lib/index.js +72 -0
  140. package/lib/node_modules/keen-slider/keen-slider.min.css.js +1 -0
  141. package/lib/node_modules/keen-slider/react.js +591 -0
  142. package/lib/style.css +1 -0
  143. package/lib/styles/global.css +19 -0
  144. package/{src → lib}/styles/themes/local.css +9 -1
  145. package/lib/styles/themes/penrithmrt.css +101 -0
  146. package/{tailwind → lib/tailwind}/colors.ts +12 -1
  147. package/lib/utils/controls.d.ts +36 -0
  148. package/lib/utils/matchMedia.d.ts +2 -0
  149. package/lib/utils/screens.d.ts +7 -0
  150. package/package.json +4 -1
  151. package/.eslintrc.cjs +0 -72
  152. package/.husky/pre-commit +0 -4
  153. package/.prettierignore +0 -10
  154. package/.prettierrc.json +0 -22
  155. package/postcss.config.js +0 -8
  156. package/src/components/Accordion/Accordion.stories.tsx +0 -39
  157. package/src/components/Accordion/const.tsx +0 -34
  158. package/src/components/Accordion/index.tsx +0 -22
  159. package/src/components/AlertBar/AlertBar.stories.tsx +0 -89
  160. package/src/components/AlertBar/index.tsx +0 -82
  161. package/src/components/Avatar/Avatar.stories.tsx +0 -14
  162. package/src/components/Avatar/index.tsx +0 -492
  163. package/src/components/Breadcrumbs/Breadcrumbs.stories.tsx +0 -29
  164. package/src/components/Breadcrumbs/index.tsx +0 -89
  165. package/src/components/Button/Button.stories.tsx +0 -24
  166. package/src/components/Button/index.tsx +0 -59
  167. package/src/components/Calendar/Calendar.stories.tsx +0 -21
  168. package/src/components/Calendar/index.tsx +0 -92
  169. package/src/components/Calendar/style.css +0 -233
  170. package/src/components/Card/Card.stories.tsx +0 -14
  171. package/src/components/Card/index.tsx +0 -39
  172. package/src/components/Carousel/Carousel.stories.tsx +0 -44
  173. package/src/components/Carousel/index.tsx +0 -301
  174. package/src/components/Carousel/utils.ts +0 -53
  175. package/src/components/CarouselThumbnail/CarouselThumbnail.stories.tsx +0 -29
  176. package/src/components/CarouselThumbnail/const.ts +0 -17
  177. package/src/components/CarouselThumbnail/index.tsx +0 -169
  178. package/src/components/CarouselThumbnail/utils.ts +0 -87
  179. package/src/components/Checkbox/Checkbox.mdx +0 -33
  180. package/src/components/Checkbox/Checkbox.stories.tsx +0 -27
  181. package/src/components/Checkbox/index.tsx +0 -44
  182. package/src/components/Collapsible/Collapsible.stories.tsx +0 -67
  183. package/src/components/Collapsible/index.tsx +0 -169
  184. package/src/components/Counter/Counter.stories.tsx +0 -20
  185. package/src/components/Counter/index.tsx +0 -98
  186. package/src/components/DetailUpdater/DetailUpdater.stories.tsx +0 -37
  187. package/src/components/DetailUpdater/index.tsx +0 -107
  188. package/src/components/Dialog/Dialog.stories.tsx +0 -65
  189. package/src/components/Dialog/index.tsx +0 -29
  190. package/src/components/Dropdown/Dropdown.stories.tsx +0 -22
  191. package/src/components/Dropdown/index.tsx +0 -117
  192. package/src/components/Dropdown/utils.ts +0 -15
  193. package/src/components/FileUploader/FilePreview.tsx +0 -45
  194. package/src/components/FileUploader/FileUploader.stories.tsx +0 -28
  195. package/src/components/FileUploader/index.tsx +0 -177
  196. package/src/components/Footer/Footer.stories.tsx +0 -47
  197. package/src/components/Footer/index.tsx +0 -96
  198. package/src/components/FooterNav/FooterNav.stories.tsx +0 -32
  199. package/src/components/FooterNav/index.tsx +0 -75
  200. package/src/components/Form/Form.stories.tsx +0 -86
  201. package/src/components/Form/index.tsx +0 -41
  202. package/src/components/Gallery/Gallery.stories.tsx +0 -39
  203. package/src/components/Gallery/index.tsx +0 -31
  204. package/src/components/Greeting/Greeting.stories.tsx +0 -16
  205. package/src/components/Greeting/index.tsx +0 -49
  206. package/src/components/HamburgerIcon/HamburgerIcon.stories.tsx +0 -14
  207. package/src/components/HamburgerIcon/index.tsx +0 -75
  208. package/src/components/Icon/Icon.stories.tsx +0 -41
  209. package/src/components/Icon/index.tsx +0 -33
  210. package/src/components/Image/Image.stories.tsx +0 -17
  211. package/src/components/Image/index.tsx +0 -25
  212. package/src/components/ImageCard/ImageCard.stories.tsx +0 -29
  213. package/src/components/ImageCard/index.tsx +0 -75
  214. package/src/components/Input/Input.stories.tsx +0 -25
  215. package/src/components/Input/index.tsx +0 -139
  216. package/src/components/MenuButton/MenuButton.stories.tsx +0 -46
  217. package/src/components/MenuButton/index.tsx +0 -66
  218. package/src/components/Modal/Modal.stories.tsx +0 -82
  219. package/src/components/Modal/index.tsx +0 -71
  220. package/src/components/Nav/Nav.stories.tsx +0 -80
  221. package/src/components/Nav/index.tsx +0 -171
  222. package/src/components/NavItem/NavItem.stories.tsx +0 -17
  223. package/src/components/NavItem/index.tsx +0 -39
  224. package/src/components/Pill/Pill.stories.tsx +0 -51
  225. package/src/components/Pill/index.tsx +0 -69
  226. package/src/components/Search/Search.stories.tsx +0 -63
  227. package/src/components/Search/index.tsx +0 -64
  228. package/src/components/Select/Select.stories.tsx +0 -55
  229. package/src/components/Select/index.tsx +0 -97
  230. package/src/components/Showcase/Showcase.stories.tsx +0 -31
  231. package/src/components/Showcase/index.tsx +0 -62
  232. package/src/components/SideNav/SideNav.stories.tsx +0 -50
  233. package/src/components/SideNav/index.tsx +0 -39
  234. package/src/components/SocialButton/SocialButton.stories.tsx +0 -88
  235. package/src/components/SocialButton/index.tsx +0 -63
  236. package/src/components/SplitCard/SplitCard.stories.tsx +0 -34
  237. package/src/components/SplitCard/index.tsx +0 -132
  238. package/src/components/Stars/Star.stories.tsx +0 -18
  239. package/src/components/Stars/index.tsx +0 -38
  240. package/src/components/Testimonial/Testimonial.stories.tsx +0 -37
  241. package/src/components/Testimonial/index.tsx +0 -123
  242. package/src/components/TextArea/TextArea.stories.tsx +0 -24
  243. package/src/components/TextArea/index.tsx +0 -133
  244. package/src/components/Timeline/Timeline.stories.tsx +0 -45
  245. package/src/components/Timeline/index.tsx +0 -65
  246. package/src/components/Tubestops/Tubestops.stories.tsx +0 -22
  247. package/src/components/Tubestops/index.tsx +0 -132
  248. package/src/components/Video/Video.stories.tsx +0 -58
  249. package/src/components/Video/assets/example.mp4 +0 -0
  250. package/src/components/Video/assets/example.ogv +0 -0
  251. package/src/components/Video/assets/example.webm +0 -0
  252. package/src/components/Video/index.tsx +0 -92
  253. package/src/custom.d.ts +0 -14
  254. package/src/documentation/Colours.mdx +0 -192
  255. package/src/documentation/Introduction.mdx +0 -13
  256. package/src/documentation/assets/index.ts +0 -3
  257. package/src/documentation/assets/trepurComponentsLogo.svg +0 -32
  258. package/src/documentation/typography/Fonts/Fonts.stories.tsx +0 -14
  259. package/src/documentation/typography/Fonts/Fonts.tsx +0 -73
  260. package/src/fonts/Sora/OFL.txt +0 -93
  261. package/src/fonts/Sora/README.txt +0 -70
  262. package/src/fonts/Sora/Sora-VariableFont_wght.ttf +0 -0
  263. package/src/fonts/Sora/static/Sora-Bold.ttf +0 -0
  264. package/src/fonts/Sora/static/Sora-ExtraBold.ttf +0 -0
  265. package/src/fonts/Sora/static/Sora-ExtraLight.ttf +0 -0
  266. package/src/fonts/Sora/static/Sora-Light.ttf +0 -0
  267. package/src/fonts/Sora/static/Sora-Medium.ttf +0 -0
  268. package/src/fonts/Sora/static/Sora-Regular.ttf +0 -0
  269. package/src/fonts/Sora/static/Sora-SemiBold.ttf +0 -0
  270. package/src/fonts/Sora/static/Sora-Thin.ttf +0 -0
  271. package/src/styles/global.css +0 -75
  272. package/src/styles/themes/test.css +0 -28
  273. package/src/utils/controls.ts +0 -44
  274. package/src/utils/matchMedia.ts +0 -9
  275. package/src/utils/screens.ts +0 -7
  276. package/tailwind.config.ts +0 -13
  277. package/tsconfig.json +0 -49
  278. package/tsconfig.node.json +0 -12
  279. package/vite.config.mjs +0 -64
  280. /package/{src/index.ts → lib/index.d.ts} +0 -0
  281. /package/{tailwind → lib/tailwind}/boxShadow.ts +0 -0
  282. /package/{tailwind → lib/tailwind}/container.ts +0 -0
  283. /package/{tailwind → lib/tailwind}/preset.ts +0 -0
  284. /package/{tailwind → lib/tailwind}/spacing.ts +0 -0
@@ -1,39 +0,0 @@
1
- import { forwardRef, HTMLAttributes } from 'react';
2
-
3
- import clsx from 'clsx';
4
-
5
- const NavItemComponent = forwardRef<
6
- HTMLAnchorElement,
7
- HTMLAttributes<HTMLAnchorElement> & { href: string }
8
- >(({ children, className, href, ...props }, ref) => {
9
- return (
10
- <a
11
- href={href}
12
- ref={ref}
13
- className={clsx(
14
- 'mx-auto h-8 py-0 text-white after:block after:scale-x-0 after:border-b-4 after:transition-all after:duration-300 after:ease-in-out hover:cursor-pointer hover:after:scale-x-100',
15
- className,
16
- )}
17
- {...props}
18
- >
19
- {children}
20
- </a>
21
- );
22
- });
23
-
24
- const NavItemLabel = forwardRef<
25
- HTMLParagraphElement,
26
- HTMLAttributes<HTMLParagraphElement>
27
- >(({ className, ...props }, ref) => (
28
- <p className="text-xl font-normal tracking-wider" ref={ref} {...props} />
29
- ));
30
-
31
- NavItemComponent.displayName = 'NavItem';
32
-
33
- NavItemLabel.displayName = 'NavItem.Label';
34
-
35
- const NavItem = Object.assign(NavItemComponent, {
36
- Label: NavItemLabel,
37
- });
38
-
39
- export { NavItem };
@@ -1,51 +0,0 @@
1
- import { Pill } from './';
2
- import { faHeart } from '@fortawesome/fontawesome-free-solid';
3
- import { Meta, StoryObj } from '@storybook/react';
4
-
5
- const meta = {
6
- title: 'V2Components/Pill',
7
- component: Pill,
8
- args: {
9
- children: [
10
- <Pill.Icon icon={faHeart} />,
11
- <Pill.Label>This is a pill</Pill.Label>,
12
- ],
13
- },
14
- } satisfies Meta<typeof Pill>;
15
- export default meta;
16
-
17
- type Story = StoryObj<typeof Pill>;
18
-
19
- export const Default: Story = {};
20
-
21
- export const Error: Story = {
22
- ...Default,
23
- args: {
24
- ...Default.args,
25
- variant: 'error',
26
- },
27
- };
28
-
29
- export const Warning: Story = {
30
- ...Default,
31
- args: {
32
- ...Default.args,
33
- variant: 'warning',
34
- },
35
- };
36
-
37
- export const Success: Story = {
38
- ...Default,
39
- args: {
40
- ...Default.args,
41
- variant: 'success',
42
- },
43
- };
44
-
45
- export const Info: Story = {
46
- ...Default,
47
- args: {
48
- ...Default.args,
49
- variant: 'info',
50
- },
51
- };
@@ -1,69 +0,0 @@
1
- import { ComponentPropsWithoutRef, forwardRef, HTMLAttributes } from 'react';
2
-
3
- import clsx from 'clsx';
4
-
5
- import { Icon } from '..';
6
-
7
- // Enhanced version of `Pick` that works with union types and retains whether a property is optional (Pick does not)
8
- // See https://github.com/microsoft/TypeScript/issues/28483#issuecomment-438084079
9
- export type PickU<T, K extends keyof T> = T extends any
10
- ? { [P in K]: T[P] }
11
- : never;
12
-
13
- export type PillVariant = 'default' | 'warning' | 'error' | 'info' | 'success';
14
-
15
- export interface PillProps {
16
- variant?: PillVariant;
17
- loading?: boolean;
18
- }
19
-
20
- const PillComponent = forwardRef<
21
- HTMLDivElement,
22
- HTMLAttributes<HTMLDivElement> & PillProps
23
- >(({ children, variant = 'default' }, ref) => {
24
- return (
25
- <div
26
- ref={ref}
27
- className={clsx(
28
- 'inline-grid grid-flow-col items-center gap-1 rounded-full border px-2 py-0.5',
29
- {
30
- '': variant === 'default',
31
- 'border-error-default bg-error-light text-error-default':
32
- variant === 'error',
33
- 'border-info-default bg-info-light text-info-default':
34
- variant === 'info',
35
- 'border-success-default bg-success-light text-success-default':
36
- variant === 'success',
37
- 'border-warning-default bg-warning-light text-warning-default':
38
- variant === 'warning',
39
- },
40
- )}
41
- >
42
- {children}
43
- </div>
44
- );
45
- });
46
-
47
- const PillLabel = forwardRef<
48
- HTMLParagraphElement,
49
- HTMLAttributes<HTMLParagraphElement>
50
- >(({ className, ...props }, ref) => (
51
- <p className={clsx('text-xs', className)} ref={ref} {...props} />
52
- ));
53
-
54
- const PillIcon = forwardRef<
55
- SVGSVGElement,
56
- PickU<ComponentPropsWithoutRef<typeof Icon>, 'icon'>
57
- >(({ icon }, ref) => <Icon size="xs" ref={ref} icon={icon} />);
58
-
59
- PillComponent.displayName = 'Pill';
60
- PillIcon.displayName = 'Pill.Icon';
61
-
62
- PillLabel.displayName = 'Chip.Label';
63
-
64
- const Pill = Object.assign(PillComponent, {
65
- Icon: PillIcon,
66
- Label: PillLabel,
67
- });
68
-
69
- export { Pill };
@@ -1,63 +0,0 @@
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 Search>;
62
-
63
- export const Default: Story = {};
@@ -1,64 +0,0 @@
1
- import { type ChangeEventHandler } from 'react';
2
-
3
- import { Icon, IconProps } from '@components/Icon';
4
- import classNames from 'classnames';
5
-
6
- export interface Props {
7
- id?: string;
8
- className?: string;
9
- onChange?: (val: string | number) => void;
10
- placeholder?: string;
11
- text?: string;
12
- leftIconProps?: IconProps;
13
- rightIconProps?: IconProps;
14
- }
15
-
16
- export const Search = ({
17
- id,
18
- className,
19
- onChange,
20
- placeholder,
21
- text,
22
- leftIconProps,
23
- rightIconProps,
24
- }: Props) => {
25
- const classList = classNames(className, 'flex');
26
-
27
- const inputClasses = classNames(
28
- {
29
- 'pl-9': leftIconProps !== undefined,
30
- 'pl-2': leftIconProps === undefined,
31
- },
32
- 'w-full rounded-md border-2 py-2 pr-9',
33
- );
34
-
35
- const onChangeFunc: ChangeEventHandler<HTMLInputElement> | undefined =
36
- onChange != null
37
- ? (e: any) => {
38
- onChange(e.target.value);
39
- }
40
- : undefined;
41
-
42
- return (
43
- <div id={id} className={classList}>
44
- <div>
45
- {text !== undefined && (
46
- <h2 className="font-base-lg py-2 pr-4">{text}</h2>
47
- )}
48
- </div>
49
- <div>
50
- <div className="relative flex w-full">
51
- {leftIconProps !== undefined && <Icon {...leftIconProps} />}
52
- <input
53
- className={inputClasses}
54
- onChange={onChangeFunc}
55
- placeholder={placeholder}
56
- type="text"
57
- name="search"
58
- />
59
- {rightIconProps !== undefined && <Icon {...rightIconProps} />}
60
- </div>
61
- </div>
62
- </div>
63
- );
64
- };
@@ -1,55 +0,0 @@
1
- import { Select } from './';
2
- import { Meta, StoryObj } from '@storybook/react';
3
- import { idAndClassName } from '@utils/controls';
4
-
5
- const meta = {
6
- title: 'Components/Select',
7
- component: Select,
8
- parameters: {},
9
- argTypes: {
10
- ...idAndClassName,
11
-
12
- label: {
13
- description: '',
14
- control: 'text',
15
- table: {
16
- category: '',
17
- },
18
- },
19
- },
20
- args: {
21
- label: 'This is a label',
22
- options: [
23
- 'Option 1',
24
- 'Option 2',
25
- 'Option 3',
26
- 'Option 4',
27
- 'Option 1',
28
- 'Option 2',
29
- 'Option 3',
30
- 'Option 4',
31
- 'Option 1',
32
- 'Option 2',
33
- 'Option 3',
34
- 'Option 4',
35
- 'Option 1',
36
- 'Option 2',
37
- 'Option 3',
38
- 'Option 4',
39
- 'Option 1',
40
- 'Option 2',
41
- 'Option 3',
42
- 'Option 4',
43
- 'Option 1',
44
- 'Option 2',
45
- 'Option 3',
46
- 'Option 4',
47
- ],
48
- },
49
- };
50
-
51
- export default meta;
52
-
53
- type Story = StoryObj<typeof Select>;
54
-
55
- export const Default: Story = {};
@@ -1,97 +0,0 @@
1
- import { useState } from 'react';
2
-
3
- import { Icon } from '@components/Icon';
4
- import { faChevronDown } from '@fortawesome/fontawesome-free-solid';
5
- import classNames from 'classnames';
6
-
7
- export interface SelectProps {
8
- id?: string;
9
- className?: string;
10
- options: string[];
11
- label: string;
12
- value?: string;
13
- onClick?: any;
14
- fullWidth?: boolean;
15
- required?: boolean;
16
- }
17
-
18
- export const Select = ({
19
- id,
20
- className,
21
- options,
22
- value,
23
- label,
24
- onClick,
25
- required = false,
26
- fullWidth = false,
27
- }: SelectProps) => {
28
- const [showDropDown, setShowDropDown] = useState(false);
29
- const [activeValue, setActiveValue] = useState(
30
- value !== undefined ? value : options?.[0],
31
- );
32
-
33
- const handleOptionClick = (e: any): void => {
34
- onClick(e.target.textContent);
35
- setActiveValue(e.target.textContent);
36
- setShowDropDown(false);
37
- };
38
-
39
- const fullWidthClasses = classNames({
40
- 'w-full': fullWidth,
41
- 'sm:w-72': !fullWidth,
42
- });
43
-
44
- const headerClassList = classNames(
45
- fullWidthClasses,
46
- className,
47
- 'w-full rounded-xl bg-white shadow drop-shadow flex cursor-pointer flex-row justify-between px-4',
48
- );
49
-
50
- const dropdownClassList = classNames(
51
- fullWidthClasses,
52
- 'absolute w-full bg-white mt-2 rounded-2xl py-4 shadow-xl border border-lightest-grey h-64 overflow-scroll',
53
- );
54
- const dropdownItemClassList =
55
- 'bg-white text-ink hover:bg-lightest-grey hover:cursor-pointer px-4 py-2';
56
-
57
- return (
58
- <>
59
- <div
60
- id={id}
61
- className={headerClassList}
62
- onClick={() => {
63
- setShowDropDown(!showDropDown);
64
- }}
65
- >
66
- <div className="flex flex-col">
67
- <div className="absolute mt-2 flex bg-white text-xs font-thin">
68
- <p>{label}</p>
69
- {required && <p className="font-semiBold text-error">&nbsp;*</p>}
70
- </div>
71
- <p className="border-ink text-ink flex justify-between rounded-xl bg-white pb-1 pt-6">
72
- {activeValue}
73
- </p>
74
- </div>
75
- <Icon colour="ink" icon={faChevronDown} />
76
- </div>
77
- {showDropDown && (
78
- <div className={classNames('relative z-20', fullWidthClasses)}>
79
- <ul className={dropdownClassList}>
80
- {options?.map((option: string, i) => (
81
- <li
82
- key={`key_${i}`}
83
- className={dropdownItemClassList}
84
- value={option}
85
- onClick={(e) => {
86
- handleOptionClick(e);
87
- }}
88
- >
89
- {option}
90
- </li>
91
- ))}
92
- </ul>
93
- </div>
94
- )}
95
- </>
96
- );
97
- };
@@ -1,31 +0,0 @@
1
- import { faChevronDown } from '@fortawesome/fontawesome-free-solid';
2
- import { action } from '@storybook/addon-actions';
3
- import { Meta, StoryObj } from '@storybook/react';
4
- import { idAndClassName } from '@utils/controls';
5
-
6
- import { Showcase } from '.';
7
-
8
- const meta = {
9
- title: 'Components/Showcase',
10
- component: Showcase,
11
- argTypes: {
12
- ...idAndClassName,
13
- },
14
- args: {
15
- title: 'This is a title',
16
- subTitle: 'This is a subtitle',
17
- description: 'This is a description',
18
- bgColour: 'white',
19
- size: 'large',
20
- iconProps: {
21
- icon: faChevronDown,
22
- onClick: action('Icon click'),
23
- },
24
- },
25
- };
26
-
27
- export default meta;
28
-
29
- type Story = StoryObj<typeof Showcase>;
30
-
31
- export const Default: Story = {};
@@ -1,62 +0,0 @@
1
- import { Avatar } from '@components/Avatar';
2
- import { Icon, IconProps } from '@components/Icon';
3
- import { Colours } from '@utils/controls';
4
- import classNames from 'classnames';
5
-
6
- export interface Props {
7
- id: string;
8
- className?: string;
9
- title: string;
10
- subTitle: string;
11
- description: string;
12
- bgColour?: Colours;
13
- image: string;
14
- size?: 'small' | 'medium' | 'large';
15
- iconProps?: IconProps;
16
- }
17
-
18
- export const Showcase = ({
19
- id,
20
- className,
21
- title,
22
- subTitle,
23
- description,
24
- bgColour,
25
- size = 'large',
26
- iconProps,
27
- }: Props) => {
28
- const classList = className;
29
-
30
- const containerSize = classNames(
31
- {
32
- 'h-56': size === 'small',
33
- 'h-96': size === 'medium',
34
- 'min-h-[calc(100vh-176px)]': size === 'large',
35
- },
36
- 'flex flex-wrap text-center md:flex-nowrap md:text-left',
37
- );
38
-
39
- return (
40
- <div>
41
- <div className={containerSize}>
42
- <div className="m-auto w-full md:w-2/3 md:pl-16 md:pr-4 lg:pl-32 lg:pr-8 xl:pl-64">
43
- <h2 className="md:text-xxl text-lg font-bold leading-tight text-primary">
44
- {title}
45
- </h2>
46
- <h2 className="md:text-xxl text-lg font-bold leading-tight text-black">
47
- {subTitle}
48
- </h2>
49
- <p className="md:text-md pt-4 text-sm text-black">{description}</p>
50
- </div>
51
- <div className="m-auto flex w-full justify-center md:w-1/3 md:pb-20">
52
- <Avatar />
53
- </div>
54
- </div>
55
- {iconProps?.icon && (
56
- <div className="flex justify-center">
57
- <Icon {...iconProps} size="2x" icon={iconProps.icon} />
58
- </div>
59
- )}
60
- </div>
61
- );
62
- };
@@ -1,50 +0,0 @@
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 SideNav>;
49
-
50
- export const Default: Story = {};
@@ -1,39 +0,0 @@
1
- import { type Colours } from '@utils/controls';
2
- import classNames from 'classnames';
3
-
4
- export interface Props {
5
- id: string;
6
- className: string;
7
- children: any;
8
- getNavStatus: (asSideBar: boolean, open: boolean) => void;
9
- bgColour?: Colours;
10
- showNav?: boolean;
11
- leftExpand?: boolean;
12
- }
13
-
14
- export const SideNav = ({
15
- id,
16
- className,
17
- children,
18
- bgColour = 'primary',
19
- showNav = false,
20
- leftExpand = true,
21
- }: Props) => {
22
- const sideNavClasses = classNames(
23
- {
24
- 'w-0': !showNav,
25
- 'w-full sm:w-1/3': showNav,
26
- 'left-0': leftExpand,
27
- 'right-0': !leftExpand,
28
- },
29
-
30
- className,
31
- 'absolute z-50 h-full overflow-hidden duration-700',
32
- );
33
-
34
- return (
35
- <div id={id} className={sideNavClasses}>
36
- {children}
37
- </div>
38
- );
39
- };