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
@@ -1,15 +1,15 @@
1
- import { jsx as o } from "react/jsx-runtime";
2
- import e from "classnames";
3
- const t = ({
4
- id: a,
5
- className: c,
6
- items: r
7
- }) => /* @__PURE__ */ o("div", { id: a, className: e(c, "theme-local"), children: r == null ? void 0 : r.map((l, d) => (
1
+ import { jsx as r } from "react/jsx-runtime";
2
+ import n from "classnames";
3
+ const d = ({
4
+ id: c,
5
+ className: a,
6
+ items: o
7
+ }) => /* @__PURE__ */ r("div", { id: c, className: n(a, "theme-local"), children: o == null ? void 0 : o.map((e, l) => (
8
8
  // <Collapsible key={`collapsible_item_${i}`} {...item}>
9
9
  // {item.children}
10
10
  // </Collapsible>
11
- /* @__PURE__ */ o("div", {})
12
- )) });
11
+ /* @__PURE__ */ r("div", {})
12
+ )) }), m = d;
13
13
  export {
14
- t as default
14
+ m as default
15
15
  };
@@ -1,7 +1,7 @@
1
- import { jsx as r } from "react/jsx-runtime";
1
+ import { jsx as e } from "react/jsx-runtime";
2
2
  import { useState as d } from "react";
3
3
  import t from "classnames";
4
- const x = ({
4
+ const f = ({
5
5
  id: a,
6
6
  className: o,
7
7
  type: s = "warning",
@@ -10,9 +10,9 @@ const x = ({
10
10
  // rightIconProps,
11
11
  textCenter: n = !1,
12
12
  isDismissable: l = !1,
13
- onDismissClick: f
13
+ onDismissClick: g
14
14
  }) => {
15
- const [e, g] = d({
15
+ const [r, h] = d({
16
16
  state: "open",
17
17
  display: !0
18
18
  }), c = t({
@@ -21,9 +21,9 @@ const x = ({
21
21
  "bg-error": s === "error",
22
22
  "bg-info-light": s === "info"
23
23
  }), p = t({
24
- "opacity-100": e.state === "open",
25
- "opacity-0": e.state === "closed",
26
- hidden: !e.display
24
+ "opacity-100": r.state === "open",
25
+ "opacity-0": r.state === "closed",
26
+ hidden: !r.display
27
27
  }), u = t(
28
28
  o,
29
29
  c,
@@ -42,8 +42,8 @@ const x = ({
42
42
  "hover:cursor-pointer": l
43
43
  },
44
44
  "absolute right-0 pr-8 pt-3"
45
- ), /* @__PURE__ */ r("div", { id: a, className: u, children: /* @__PURE__ */ r("h3", { className: m, children: i }) });
46
- };
45
+ ), /* @__PURE__ */ e("div", { id: a, className: u, children: /* @__PURE__ */ e("h3", { className: m, children: i }) });
46
+ }, B = f;
47
47
  export {
48
- x as default
48
+ B as default
49
49
  };
@@ -0,0 +1,4 @@
1
+ import { default as AlertBar } from './AlertBar';
2
+ import { default as Accordion } from './Accordion';
3
+
4
+ export { Accordion, AlertBar, };
package/lib/index.js CHANGED
@@ -1,12 +1,6 @@
1
1
  import { default as a } from "./components/Accordion/index.js";
2
2
  import { default as t } from "./components/AlertBar/index.js";
3
- import { default as f } from "./archive/Breadcrumbs/index.js";
4
- import { default as s } from "./archive/BreadcrumbsBordered/index.js";
5
- import { default as l } from "./archive/BreadcrumbsItem/index.js";
6
3
  export {
7
4
  a as Accordion,
8
- t as AlertBar,
9
- f as Breadcrumbs,
10
- s as BreadcrumbsBordered,
11
- l as BreadcrumbsItem
5
+ t as AlertBar
12
6
  };
@@ -3,6 +3,7 @@
3
3
  @tailwind base;
4
4
  @tailwind components;
5
5
 
6
+
6
7
  .theme-local {
7
8
  --color-primary: #0036a0;
8
9
  --color-secondary: #e2e2e2;
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "trepur_components",
3
+ "version": "2.3.5",
3
4
  "description": "component lib",
4
5
  "author": "trepur_ttenneb",
5
- "version": "2.3.3",
6
6
  "private": false,
7
7
  "keywords": [
8
8
  "react",
@@ -10,10 +10,11 @@
10
10
  "ui"
11
11
  ],
12
12
  "license": "UNLICENSED",
13
- "main": "lib/index.js",
14
- "module": "dist/index.js",
15
- "files": [
16
- "lib/**/*"
13
+ ".": {
14
+ "import": "./lib/index.js"
15
+ },
16
+ "sideEffects": [
17
+ "*.css"
17
18
  ],
18
19
  "types": "lib/index.d.ts",
19
20
  "type": "module",
@@ -22,9 +23,6 @@
22
23
  "build-css": "tailwindcss -i ./src/styles/base.css -o ./lib/styles/base.css --minify",
23
24
  "build-storybook": "npm run storybook-css && storybook build -o ./storybook-build --quiet",
24
25
  "storybook-css": "tailwindcss -i ./.storybook/tailwind/style.css -o ./.storybook/tailwind/preview.css --minify",
25
- "compile:ts": "tsc && tsc-alias -p tsconfig.json",
26
- "compile:css": "postcss src/**/**/**/*.css --base . --dir dist -m --verbose",
27
- "compile": "rm -rf dist && npm run prettier:fix && npm run lint:fix && npm run compile:ts && npm run compile:css",
28
26
  "storybook": "storybook dev -p 6006",
29
27
  "lint": "eslint src --ext .tsx",
30
28
  "lint:fix": "npm run lint -- --fix",
@@ -0,0 +1,8 @@
1
+ const config = {
2
+ plugins: {
3
+ tailwindcss: {},
4
+ autoprefixer: {},
5
+ },
6
+ };
7
+
8
+ export default config;
@@ -0,0 +1,116 @@
1
+ import { Meta, StoryObj } from '@storybook/react';
2
+ import { idAndClassName } from '@utils/controls';
3
+
4
+ import Accordion from '.';
5
+
6
+ const propItems = [
7
+ {
8
+ preText: 'This is some text',
9
+ title: 'This is a title',
10
+ subtitle: 'This is a subtitle',
11
+ imageProps: {
12
+ src: 'https://picsum.photos/100/100',
13
+ },
14
+ children: (
15
+ <p>
16
+ Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam semper
17
+ in neque in venenatis. Mauris scelerisque orci magna, et ultricies nulla
18
+ lobortis ac. Aliquam vitae faucibus nisl. Nunc in tellus libero. Donec
19
+ ut augue consequat, convallis risus in, pulvinar nibh. Duis mi nibh,
20
+ posuere molestie pharetra cursus, viverra ut dolor. Vivamus eget arcu
21
+ dui. Donec ullamcorper ornare justo sed feugiat. Curabitur aliquam
22
+ lectus sed quam pharetra scelerisque. Integer vitae eleifend dolor. Duis
23
+ luctus metus ipsum, et commodo magna bibendum quis. Quisque gravida leo
24
+ sodales quam feugiat, id vulputate arcu pulvinar. Duis dictum gravida
25
+ risus, et bibendum nunc condimentum eu.
26
+ </p>
27
+ ),
28
+ },
29
+ {
30
+ preText:
31
+ 'Lorem, ipsum dolor sit amet consectetur adipisicing elit. Repellendus nihil, molestias amet sed, corrupti debitis odit doloribus perspiciatis est, quasi illum culpa iusto. Molestias, ducimus. Provident, quibusdam fuga. Voluptatem, saepe.',
32
+ title: 'This is a title',
33
+ imageProps: {
34
+ src: 'https://picsum.photos/101/100',
35
+ },
36
+ children: (
37
+ <p>
38
+ Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam semper
39
+ in neque in venenatis. Mauris scelerisque orci magna, et ultricies nulla
40
+ lobortis ac. Aliquam vitae faucibus nisl. Nunc in tellus libero. Donec
41
+ ut augue consequat, convallis risus in, pulvinar nibh. Duis mi nibh,
42
+ posuere molestie pharetra cursus, viverra ut dolor. Vivamus eget arcu
43
+ dui. Donec ullamcorper ornare justo sed feugiat. Curabitur aliquam
44
+ lectus sed quam pharetra scelerisque. Integer vitae eleifend dolor. Duis
45
+ luctus metus ipsum, et commodo magna bibendum quis. Quisque gravida leo
46
+ sodales quam feugiat, id vulputate arcu pulvinar. Duis dictum gravida
47
+ risus, et bibendum nunc condimentum eu.
48
+ </p>
49
+ ),
50
+ },
51
+ {
52
+ subtitle: 'This is a subtitle',
53
+ imageProps: {
54
+ src: 'https://picsum.photos/100/101',
55
+ },
56
+ children: (
57
+ <p>
58
+ Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam semper
59
+ in neque in venenatis. Mauris scelerisque orci magna, et ultricies nulla
60
+ lobortis ac. Aliquam vitae faucibus nisl. Nunc in tellus libero. Donec
61
+ ut augue consequat, convallis risus in, pulvinar nibh. Duis mi nibh,
62
+ posuere molestie pharetra cursus, viverra ut dolor. Vivamus eget arcu
63
+ dui. Donec ullamcorper ornare justo sed feugiat. Curabitur aliquam
64
+ lectus sed quam pharetra scelerisque. Integer vitae eleifend dolor. Duis
65
+ luctus metus ipsum, et commodo magna bibendum quis. Quisque gravida leo
66
+ sodales quam feugiat, id vulputate arcu pulvinar. Duis dictum gravida
67
+ risus, et bibendum nunc condimentum eu.
68
+ </p>
69
+ ),
70
+ },
71
+ {
72
+ imageProps: {
73
+ src: 'https://picsum.photos/102/100',
74
+ },
75
+ children: (
76
+ <p>
77
+ Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam semper
78
+ in neque in venenatis. Mauris scelerisque orci magna, et ultricies nulla
79
+ lobortis ac. Aliquam vitae faucibus nisl. Nunc in tellus libero. Donec
80
+ ut augue consequat, convallis risus in, pulvinar nibh. Duis mi nibh,
81
+ posuere molestie pharetra cursus, viverra ut dolor. Vivamus eget arcu
82
+ dui. Donec ullamcorper ornare justo sed feugiat. Curabitur aliquam
83
+ lectus sed quam pharetra scelerisque. Integer vitae eleifend dolor. Duis
84
+ luctus metus ipsum, et commodo magna bibendum quis. Quisque gravida leo
85
+ sodales quam feugiat, id vulputate arcu pulvinar. Duis dictum gravida
86
+ risus, et bibendum nunc condimentum eu.
87
+ </p>
88
+ ),
89
+ },
90
+ ];
91
+
92
+ const meta = {
93
+ title: 'Components/Accordion',
94
+ component: Accordion,
95
+ argTypes: {
96
+ ...idAndClassName,
97
+ items: {
98
+ description: 'An array of collapsible props',
99
+ control: { type: 'array', default: undefined },
100
+ table: {
101
+ category: 'Accordion',
102
+ type: { summary: 'array' },
103
+ defaultValue: { summary: 'undefined' },
104
+ },
105
+ },
106
+ },
107
+ args: {
108
+ items: propItems,
109
+ },
110
+ } satisfies Meta<typeof Accordion>;
111
+
112
+ export default meta;
113
+
114
+ type Story = StoryObj<typeof meta>;
115
+
116
+ export const Default: Story = {};
@@ -0,0 +1,30 @@
1
+ import React from 'react';
2
+ // import Collapsible from '@components/Collapsible';
3
+ import classNames from 'classnames';
4
+
5
+ export interface Props {
6
+ id?: string;
7
+ className?: string;
8
+ items: any;
9
+ }
10
+
11
+ const Accordion: React.FC<Props> = ({
12
+ id,
13
+ className,
14
+ items,
15
+ }: Props): JSX.Element => {
16
+ return (
17
+ <div id={id} className={classNames(className, 'theme-local')}>
18
+ {items?.map((item: any, i: number) => {
19
+ return (
20
+ // <Collapsible key={`collapsible_item_${i}`} {...item}>
21
+ // {item.children}
22
+ // </Collapsible>
23
+ <div></div>
24
+ );
25
+ })}
26
+ </div>
27
+ );
28
+ };
29
+
30
+ export default Accordion;
@@ -0,0 +1,95 @@
1
+ import { Meta, StoryObj } from '@storybook/react';
2
+ import { idAndClassName } from '@utils/controls';
3
+
4
+ import AlertBar from '.';
5
+
6
+ const meta = {
7
+ title: 'Components/Alert Bar',
8
+ component: AlertBar,
9
+ argTypes: {
10
+ ...idAndClassName,
11
+ type: {
12
+ type: { name: 'string', required: false },
13
+ options: ['success', 'warning', 'error', 'info'],
14
+ description: 'The type of alert to render',
15
+ table: {
16
+ type: { summary: 'warning' },
17
+ defaultValue: { summary: 'warning' },
18
+ },
19
+ defaultValue: 'warning',
20
+ control: { type: 'radio' },
21
+ },
22
+ text: {
23
+ type: { name: 'string', required: false },
24
+ description: 'The text to display in the component',
25
+ table: {
26
+ type: { summary: 'string' },
27
+ defaultValue: { summary: 'undefined' },
28
+ },
29
+ },
30
+
31
+ leftIconProps: {
32
+ description: 'The icon props for the icon to display aligned to the left',
33
+ table: {
34
+ category: '',
35
+ type: { summary: 'string' },
36
+ defaultValue: { summary: 'undefined' },
37
+ },
38
+ },
39
+ rightIconProps: {
40
+ description:
41
+ 'The icon props for the icon to display aligned to the right',
42
+ table: {
43
+ category: '',
44
+ type: { summary: 'string' },
45
+ defaultValue: { summary: 'undefined' },
46
+ },
47
+ },
48
+ textCenter: {
49
+ type: { name: 'boolean', required: false },
50
+ description: 'Aligns the text in the center of the component',
51
+ table: {
52
+ type: { summary: 'boolean' },
53
+ defaultValue: { summary: 'false' },
54
+ },
55
+ defaultValue: 'false',
56
+ },
57
+ isDismissable: {
58
+ type: { name: 'boolean', required: false },
59
+ description: 'Enables the component to be closed when set to true',
60
+ table: {
61
+ type: { summary: 'boolean' },
62
+ defaultValue: { summary: 'false' },
63
+ },
64
+ defaultValue: 'false',
65
+ },
66
+ onDismissClick: {
67
+ type: { name: 'function', required: false },
68
+ description: 'The action to perform when the component is closed',
69
+ action: 'onClick',
70
+ table: {
71
+ type: {
72
+ summary: 'function',
73
+ },
74
+ defaultValue: { summary: 'undefined' },
75
+ },
76
+ },
77
+ },
78
+ args: {
79
+ text: 'This is an alert bar message',
80
+ leftIconProps: {
81
+ type: 'heart',
82
+ colour: 'white',
83
+ hollow: true,
84
+ },
85
+ rightIconProps: {
86
+ type: 'heart',
87
+ colour: 'white',
88
+ },
89
+ },
90
+ };
91
+ export default meta;
92
+
93
+ type Story = StoryObj<typeof meta>;
94
+
95
+ export const Default: Story = {};
@@ -0,0 +1,115 @@
1
+ import { MouseEventHandler, useState } from 'react';
2
+
3
+ // import Icon, { type Props as iconProps } from '@components/Icon';
4
+ import classNames from 'classnames';
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
+ onDismissClick?: MouseEventHandler;
16
+ }
17
+
18
+ const AlertBar = ({
19
+ id,
20
+ className,
21
+ type = 'warning',
22
+ text,
23
+ // leftIconProps,
24
+ // rightIconProps,
25
+ textCenter = false,
26
+ isDismissable = false,
27
+ onDismissClick,
28
+ }: Props): JSX.Element => {
29
+ const [alertBarStatus, setAlertBarStatus] = useState({
30
+ state: 'open',
31
+ display: true,
32
+ });
33
+
34
+ // const iconLeft = leftIconProps != null && <Icon {...leftIconProps} />;
35
+
36
+ // const iconRight = rightIconProps != null && <Icon {...rightIconProps} />;
37
+
38
+ const bgColor = classNames({
39
+ 'bg-success': type === 'success',
40
+ 'bg-warning': type === 'warning',
41
+ 'bg-error': type === 'error',
42
+ 'bg-info-light': type === 'info',
43
+ });
44
+
45
+ const alertBarState = classNames({
46
+ 'opacity-100': alertBarStatus.state === 'open',
47
+ 'opacity-0': alertBarStatus.state === 'closed',
48
+ hidden: !alertBarStatus.display,
49
+ });
50
+
51
+ const classList = classNames(
52
+ className,
53
+ bgColor,
54
+ alertBarState,
55
+ 'flex py-2 text-white duration-700 theme-local w-parent transition-opactiy',
56
+ );
57
+
58
+ const textClassList = classNames(
59
+ {
60
+ 'text-center': textCenter,
61
+ // 'pl-20': !textCenter && leftIconProps !== null,
62
+ // 'pl-4': !textCenter && leftIconProps === null,
63
+ },
64
+ 'w-full py-3',
65
+ );
66
+
67
+ const rightIconClasses = classNames(
68
+ {
69
+ 'hover:cursor-pointer': isDismissable,
70
+ },
71
+ 'absolute right-0 pr-8 pt-3',
72
+ );
73
+
74
+ const closeAlertBar = (e: any): void => {
75
+ setAlertBarStatus({
76
+ state: 'closed',
77
+ display: alertBarStatus.display,
78
+ });
79
+ setTimeout(() => {
80
+ setAlertBarStatus({
81
+ state: 'closed',
82
+ display: false,
83
+ });
84
+ }, 700);
85
+ if (onDismissClick != null) {
86
+ onDismissClick(e);
87
+ }
88
+ };
89
+
90
+ // const dismissIcon = <Icon type="multiply" colour="white" />;
91
+
92
+ return (
93
+ <div id={id} className={classList}>
94
+ {/* {leftIconProps != null && (
95
+ <span className='absolute pl-8 pt-3'>{iconLeft}</span>
96
+ )} */}
97
+ <h3 className={textClassList}>{text}</h3>
98
+ {/* {isDismissable && (
99
+ <a
100
+ className={rightIconClasses}
101
+ onClick={(e) => {
102
+ closeAlertBar(e);
103
+ }}
104
+ >
105
+ <span>{dismissIcon}</span>
106
+ </a>
107
+ )} */}
108
+ {/* {iconRight != null && !isDismissable && (
109
+ <span className={rightIconClasses}>{iconRight}</span>
110
+ )} */}
111
+ </div>
112
+ );
113
+ };
114
+
115
+ export default AlertBar;
@@ -0,0 +1,19 @@
1
+ import { Meta, StoryObj } from '@storybook/react';
2
+ import { idAndClassName } from '@utils/controls';
3
+
4
+ import Avatar from '.';
5
+
6
+ const meta = {
7
+ title: 'Components/Avatar',
8
+ component: Avatar,
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 = {};