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.
- package/.eslintrc.cjs +43 -0
- package/.husky/pre-commit +4 -0
- package/.prettierrc.json +22 -0
- package/archive/Breadcrumbs/Breadcrumbs.stories.tsx +46 -0
- package/archive/Breadcrumbs/index.tsx +42 -0
- package/archive/BreadcrumbsBordered/BreadcrumbsBordered.stories.tsx +52 -0
- package/archive/BreadcrumbsBordered/index.tsx +44 -0
- package/archive/BreadcrumbsItem/BreadcrumbsItem.stories.tsx +40 -0
- package/archive/BreadcrumbsItem/index.tsx +149 -0
- package/archive/Button/Button.stories.tsx +150 -0
- package/archive/Button/index.tsx +111 -0
- package/archive/Button/style.module.css +76 -0
- package/archive/Calendar/Calendar.stories.tsx +82 -0
- package/archive/Calendar/index.tsx +76 -0
- package/archive/Calendar/style.css +233 -0
- package/archive/Card/Card.stories.tsx +75 -0
- package/archive/Card/index.tsx +102 -0
- package/archive/Card/style.module.css +75 -0
- package/archive/CardWithTopImage/CardWithTopImage.stories.tsx +50 -0
- package/archive/CardWithTopImage/index.tsx +39 -0
- package/archive/CardWithTopImage/style.module.css +11 -0
- package/archive/Carousel/Carousel.stories.tsx +451 -0
- package/archive/Carousel/index.tsx +388 -0
- package/archive/Carousel/style.module.css +99 -0
- package/archive/CarouselThumbnail/CarouselThumbnail.stories.tsx +350 -0
- package/archive/CarouselThumbnail/index.tsx +302 -0
- package/archive/CarouselThumbnail/style.module.css +67 -0
- package/archive/Checkbox/Checkbox.mdx +33 -0
- package/archive/Checkbox/Checkbox.stories.tsx +34 -0
- package/archive/Checkbox/index.tsx +51 -0
- package/archive/Checkbox/style.module.css +15 -0
- package/archive/Collapsible/Collapsible.stories.tsx +67 -0
- package/archive/Collapsible/index.tsx +116 -0
- package/archive/Collapsible/style.module.css +47 -0
- package/archive/Column/Column.stories.tsx +89 -0
- package/archive/Column/index.tsx +119 -0
- package/archive/Column/style.module.css +151 -0
- package/archive/ComponentWrapper/ComponentWrapper.stories.tsx +40 -0
- package/archive/ComponentWrapper/index.tsx +55 -0
- package/archive/ComponentWrapper/style.module.css +40 -0
- package/archive/Container/Container.stories.tsx +40 -0
- package/archive/Container/index.tsx +24 -0
- package/archive/Container/style.module.css +4 -0
- package/archive/Counter/Counter.stories.tsx +19 -0
- package/archive/Counter/index.tsx +66 -0
- package/archive/Counter/style.module.css +19 -0
- package/archive/DetailUpdater/DetailUpdater.stories.tsx +96 -0
- package/archive/DetailUpdater/index.tsx +112 -0
- package/archive/DetailUpdater/style.module.css +31 -0
- package/archive/Dialog/Dialog.stories.tsx +131 -0
- package/archive/Dialog/index.tsx +91 -0
- package/archive/Dialog/style.module.css +44 -0
- package/archive/DropdownMenu/DropdownMenu.stories.tsx +59 -0
- package/archive/DropdownMenu/index.tsx +51 -0
- package/archive/DropdownMenu/style.module.css +38 -0
- package/archive/DynamicTextSection/DynamicTextSection.stories.tsx +74 -0
- package/archive/DynamicTextSection/index.tsx +36 -0
- package/archive/DynamicTextSection/style.module.css +0 -0
- package/archive/FileUploader/FilePreview.tsx +48 -0
- package/archive/FileUploader/FileUploader.stories.tsx +28 -0
- package/archive/FileUploader/index.tsx +135 -0
- package/archive/FileUploader/style.module.css +54 -0
- package/archive/FilterItem/FilterItem.stories.tsx +33 -0
- package/archive/FilterItem/index.tsx +101 -0
- package/archive/FilterItem/style.module.css +27 -0
- package/archive/Footer/Footer.stories.tsx +59 -0
- package/archive/Footer/index.tsx +50 -0
- package/archive/Footer/style.module.css +19 -0
- package/archive/FooterNav/FooterNav.stories.tsx +125 -0
- package/archive/FooterNav/index.tsx +57 -0
- package/archive/FooterNav/style.module.css +32 -0
- package/archive/FooterNavItem/FooterNavItem.stories.tsx +53 -0
- package/archive/FooterNavItem/index.tsx +80 -0
- package/archive/FooterNavItem/style.module.css +139 -0
- package/archive/Form/Form.stories.tsx +86 -0
- package/archive/Form/index.tsx +61 -0
- package/archive/Form/style.module.css +0 -0
- package/archive/FyreCard/FyreCard.stories.tsx +31 -0
- package/archive/FyreCard/index.tsx +52 -0
- package/archive/FyreCard/style.module.css +19 -0
- package/archive/Greeting/Greeting.stories.tsx +41 -0
- package/archive/Greeting/index.tsx +32 -0
- package/archive/HamburgerIcon/HamburgerIcon.stories.tsx +32 -0
- package/archive/HamburgerIcon/index.tsx +103 -0
- package/archive/HamburgerIcon/style.module.css +85 -0
- package/archive/HorizontalLine/HorizontalLine.stories.tsx +54 -0
- package/archive/HorizontalLine/index.tsx +40 -0
- package/archive/HorizontalLine/style.module.css +55 -0
- package/archive/Icon/Icon.stories.tsx +164 -0
- package/archive/Icon/index.tsx +115 -0
- package/archive/Icon/style.module.css +253 -0
- package/archive/IconCard/IconCard.stories.tsx +46 -0
- package/archive/IconCard/index.tsx +57 -0
- package/archive/IconCard/style.module.css +18 -0
- package/archive/Image/Image.stories.tsx +87 -0
- package/archive/Image/index.tsx +132 -0
- package/archive/Image/style.module.css +109 -0
- package/archive/ImageInfo/ImageInfo.stories.tsx +39 -0
- package/archive/ImageInfo/index.tsx +95 -0
- package/archive/ImageInfo/style.module.css +47 -0
- package/archive/ImageLink/ImageLink.stories.tsx +37 -0
- package/archive/ImageLink/index.tsx +49 -0
- package/archive/ImageLink/style.module.css +23 -0
- package/archive/ImageLinkList/ImageLinkList.stories.tsx +34 -0
- package/archive/ImageLinkList/index.tsx +33 -0
- package/archive/ImageLinkList/style.module.css +3 -0
- package/archive/InformationIcon/InformationIcon.stories.tsx +83 -0
- package/archive/InformationIcon/index.tsx +128 -0
- package/archive/InformationIcon/style.module.css +71 -0
- package/archive/InformationIconBlock/InformationIconBlock.stories.tsx +32 -0
- package/archive/InformationIconBlock/index.tsx +63 -0
- package/archive/InformationIconBlock/style.module.css +7 -0
- package/archive/Input/Input.stories.tsx +84 -0
- package/archive/Input/index.tsx +131 -0
- package/archive/Input/style.module.css +60 -0
- package/archive/Jumbotron/Jumbotron.stories.tsx +21 -0
- package/archive/Jumbotron/index.tsx +31 -0
- package/archive/Jumbotron/style.module.css +8 -0
- package/archive/MenuButton/MenuButton.stories.tsx +46 -0
- package/archive/MenuButton/index.tsx +82 -0
- package/archive/MenuButton/style.module.css +45 -0
- package/archive/Modal/Modal.stories.tsx +86 -0
- package/archive/Modal/index.tsx +74 -0
- package/archive/Modal/style.module.css +35 -0
- package/archive/NavItem/NavItem.stories.tsx +90 -0
- package/archive/NavItem/index.tsx +65 -0
- package/archive/NavItem/style.module.css +71 -0
- package/archive/NavOld/NavOld.stories.tsx +193 -0
- package/archive/NavOld/StickyNav.tsx +191 -0
- package/archive/NavOld/index.tsx +273 -0
- package/archive/NavOld/style.module.css +156 -0
- package/archive/NavTwo/Dropdown.tsx +35 -0
- package/archive/NavTwo/Nav.stories.tsx +38 -0
- package/archive/NavTwo/Sidebar.tsx +34 -0
- package/archive/NavTwo/StickyNav.tsx +34 -0
- package/archive/NavTwo/index.tsx +45 -0
- package/archive/NavTwo/style.module.css +35 -0
- package/archive/NewsCard/NewsCard.stories.tsx +72 -0
- package/archive/NewsCard/index.tsx +57 -0
- package/archive/NewsCard/style.module.css +15 -0
- package/archive/Pill/Pill.stories.tsx +44 -0
- package/archive/Pill/index.tsx +64 -0
- package/archive/Pill/style.module.css +32 -0
- package/archive/ProductCard/ProductCard.stories.tsx +61 -0
- package/archive/ProductCard/index.tsx +111 -0
- package/archive/ProductCard/style.module.css +53 -0
- package/archive/ProductCardV2/ProductCardV2.stories.tsx +50 -0
- package/archive/ProductCardV2/index.tsx +119 -0
- package/archive/ProductCardV2/style.module.css +59 -0
- package/archive/Proficiencies/Proficiencies.stories.tsx +50 -0
- package/archive/Proficiencies/index.tsx +63 -0
- package/archive/Proficiencies/style.module.css +31 -0
- package/archive/Profile/Profile.stories.tsx +49 -0
- package/archive/Profile/index.tsx +103 -0
- package/archive/Profile/style.module.css +47 -0
- package/archive/Row/Row.stories.tsx +53 -0
- package/archive/Row/index.tsx +23 -0
- package/archive/Row/style.module.css +3 -0
- package/archive/Search/Search.stories.tsx +63 -0
- package/archive/Search/index.tsx +68 -0
- package/archive/Search/style.module.css +23 -0
- package/archive/Select/Select.stories.tsx +56 -0
- package/archive/Select/index.tsx +106 -0
- package/archive/Select/style.module.css +52 -0
- package/archive/Showcase/Showcase.stories.tsx +30 -0
- package/archive/Showcase/index.tsx +75 -0
- package/archive/Showcase/style.module.css +47 -0
- package/archive/SideNav/SideNav.stories.tsx +50 -0
- package/archive/SideNav/index.tsx +46 -0
- package/archive/SideNav/style.module.css +43 -0
- package/archive/SocialBlock/SocialBlock.stories.tsx +58 -0
- package/archive/SocialBlock/index.tsx +63 -0
- package/archive/SocialButton/SocialButton.stories.tsx +88 -0
- package/archive/SocialButton/index.tsx +71 -0
- package/archive/SocialButton/style.module.css +77 -0
- package/archive/StarRating/StarRating.stories.tsx +23 -0
- package/archive/StarRating/index.tsx +71 -0
- package/archive/Testimonial/Testimonial.stories.tsx +110 -0
- package/archive/Testimonial/index.tsx +61 -0
- package/archive/Testimonial/style.module.css +27 -0
- package/archive/TextAndTitle/TextAndTitle.stories.tsx +70 -0
- package/archive/TextAndTitle/index.tsx +123 -0
- package/archive/TextAndTitle/style.module.css +75 -0
- package/archive/TextArea/TextArea.stories.tsx +55 -0
- package/archive/TextArea/index.tsx +125 -0
- package/archive/TextArea/style.module.css +60 -0
- package/archive/Timeline/Timeline.stories.tsx +92 -0
- package/archive/Timeline/index.tsx +254 -0
- package/archive/Timeline/style.module.css +134 -0
- package/archive/TimelineV2/TimelineV2.stories.tsx +95 -0
- package/archive/TimelineV2/index.tsx +70 -0
- package/archive/TimelineV2/style.module.css +28 -0
- package/archive/Tubestops/Tubestops.stories.tsx +42 -0
- package/archive/Tubestops/index.tsx +58 -0
- package/archive/Tubestops/style.module.css +54 -0
- package/archive/UserIcon/UserIcon.stories.tsx +52 -0
- package/archive/UserIcon/index.tsx +46 -0
- package/archive/UserIcon/style.module.css +19 -0
- package/archive/Video/Video.stories.tsx +23 -0
- package/archive/Video/index.tsx +47 -0
- package/archive/fonts/Sora/OFL.txt +93 -0
- package/archive/fonts/Sora/README.txt +70 -0
- package/archive/fonts/Sora/Sora-VariableFont_wght.ttf +0 -0
- package/archive/fonts/Sora/static/Sora-Bold.ttf +0 -0
- package/archive/fonts/Sora/static/Sora-ExtraBold.ttf +0 -0
- package/archive/fonts/Sora/static/Sora-ExtraLight.ttf +0 -0
- package/archive/fonts/Sora/static/Sora-Light.ttf +0 -0
- package/archive/fonts/Sora/static/Sora-Medium.ttf +0 -0
- package/archive/fonts/Sora/static/Sora-Regular.ttf +0 -0
- package/archive/fonts/Sora/static/Sora-SemiBold.ttf +0 -0
- package/archive/fonts/Sora/static/Sora-Thin.ttf +0 -0
- package/archive/theme.ts +39 -0
- package/archive/typography/Fonts/Fonts.stories.tsx +14 -0
- package/archive/typography/Fonts/Fonts.tsx +181 -0
- package/lib/components/Accordion/index.js +10 -10
- package/lib/components/AlertBar/index.js +10 -10
- package/lib/components/index.d.ts +4 -0
- package/lib/index.js +1 -7
- package/lib/styles/base.css +1 -0
- package/package.json +6 -8
- package/postcss.config.js +8 -0
- package/src/components/Accordion/Accordion.stories.tsx +116 -0
- package/src/components/Accordion/index.tsx +30 -0
- package/src/components/AlertBar/AlertBar.stories.tsx +95 -0
- package/src/components/AlertBar/index.tsx +115 -0
- package/src/components/Avatar/Avatar.stories.tsx +19 -0
- package/src/components/Avatar/index.tsx +495 -0
- package/src/components/index.ts +119 -0
- package/src/documentation/Colours.mdx +192 -0
- package/src/documentation/Introduction.mdx +9 -0
- package/src/index.ts +1 -0
- package/src/styles/base.css +117 -0
- package/src/utils/controls.ts +44 -0
- package/src/utils/matchMedia.ts +9 -0
- package/src/utils/screens.ts +7 -0
- package/svg.d.ts +4 -0
- package/tailwind.config.ts +81 -0
- package/tsconfig.json +43 -0
- package/tsconfig.node.json +12 -0
- package/vite.config.mjs +64 -0
- package/lib/archive/Breadcrumbs/index.js +0 -12
- package/lib/archive/BreadcrumbsBordered/index.js +0 -25
- package/lib/archive/BreadcrumbsItem/index.js +0 -117
- package/lib/src/components/index.d.ts +0 -7
- /package/lib/{src/components → components}/Accordion/Accordion.stories.d.ts +0 -0
- /package/lib/{src/components → components}/Accordion/index.d.ts +0 -0
- /package/lib/{src/components → components}/AlertBar/AlertBar.stories.d.ts +0 -0
- /package/lib/{src/components → components}/AlertBar/index.d.ts +0 -0
- /package/lib/{src/components → components}/Avatar/Avatar.stories.d.ts +0 -0
- /package/lib/{src/components → components}/Avatar/index.d.ts +0 -0
- /package/lib/{src/index.d.ts → index.d.ts} +0 -0
- /package/lib/{src/utils → utils}/controls.d.ts +0 -0
- /package/lib/{src/utils → utils}/matchMedia.d.ts +0 -0
- /package/lib/{src/utils → utils}/screens.d.ts +0 -0
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import
|
|
3
|
-
const
|
|
4
|
-
id:
|
|
5
|
-
className:
|
|
6
|
-
items:
|
|
7
|
-
}) => /* @__PURE__ */
|
|
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__ */
|
|
12
|
-
)) });
|
|
11
|
+
/* @__PURE__ */ r("div", {})
|
|
12
|
+
)) }), m = d;
|
|
13
13
|
export {
|
|
14
|
-
|
|
14
|
+
m as default
|
|
15
15
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { jsx as
|
|
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
|
|
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:
|
|
13
|
+
onDismissClick: g
|
|
14
14
|
}) => {
|
|
15
|
-
const [
|
|
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":
|
|
25
|
-
"opacity-0":
|
|
26
|
-
hidden: !
|
|
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__ */
|
|
46
|
-
};
|
|
45
|
+
), /* @__PURE__ */ e("div", { id: a, className: u, children: /* @__PURE__ */ e("h3", { className: m, children: i }) });
|
|
46
|
+
}, B = f;
|
|
47
47
|
export {
|
|
48
|
-
|
|
48
|
+
B as default
|
|
49
49
|
};
|
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
|
};
|
package/lib/styles/base.css
CHANGED
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
|
-
"
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
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,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 = {};
|