trepur_components 0.1.43 → 0.2.2
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/dist/Assets/Images/logoCoco.png +0 -0
- package/dist/Assets/Images/logoCocoBanner.png +0 -0
- package/dist/Assets/Videos/example.mp4 +0 -0
- package/dist/Assets/Videos/example.ogv +0 -0
- package/dist/components/Atoms/AlertBar/AlertBar.stories.js +69 -0
- package/dist/components/Atoms/AlertBar/index.js +66 -0
- package/dist/components/Atoms/Breadcrumbs/Breadcrumbs.stories.js +41 -0
- package/dist/components/{Breadcrumbs → Atoms/Breadcrumbs}/index.js +2 -0
- package/dist/components/Atoms/BreadcrumbsItem/BreadcrumbsItem.stories.js +86 -0
- package/dist/components/Atoms/BreadcrumbsItem/index.css +42 -0
- package/dist/components/{BreadcrumbsBorderedItem → Atoms/BreadcrumbsItem}/index.js +2 -0
- package/dist/components/{Button → Atoms/Button}/Styles.css +0 -0
- package/dist/components/Atoms/Button/button.stories.js +68 -0
- package/dist/components/{Button → Atoms/Button}/index.js +28 -24
- package/dist/components/Atoms/Collapsible/Collapsible.stories.js +144 -0
- package/dist/components/Atoms/Collapsible/index.js +111 -0
- package/dist/components/Atoms/Column/Column.stories.js +24 -0
- package/dist/components/{Column → Atoms/Column}/index.js +22 -4
- package/dist/components/Atoms/Icon/Icon.stories.js +21 -0
- package/dist/components/{Icon → Atoms/Icon}/index.js +2 -0
- package/dist/components/Atoms/Image/Image.stories.js +21 -0
- package/dist/components/Atoms/Image/index.js +66 -0
- package/dist/components/Atoms/InformationIcon/InformationIcon.stories.js +95 -0
- package/dist/components/{InformationIcon → Atoms/InformationIcon}/index.js +3 -2
- package/dist/components/Atoms/Input/Input.stories.js +47 -0
- package/dist/components/Atoms/Input/index.js +40 -0
- package/dist/components/Atoms/NavItem/NavItem.stories.js +100 -0
- package/dist/components/{NavItem → Atoms/NavItem}/index.js +7 -6
- package/dist/components/Atoms/Row/Row.stories.js +18 -0
- package/dist/components/Atoms/Row/index.js +35 -0
- package/dist/components/Atoms/StarRating/StarRating.stories.js +22 -0
- package/dist/components/Atoms/StarRating/index.css +8 -0
- package/dist/components/{StarRating → Atoms/StarRating}/index.js +2 -2
- package/dist/components/Atoms/TextAndTitle/TextAndTitle.stories.js +53 -0
- package/dist/components/{TextAndTitle → Atoms/TextAndTitle}/index.js +10 -2
- package/dist/components/Atoms/Tubestops/Tubestops.stories.js +49 -0
- package/dist/components/Atoms/Tubestops/index.js +59 -0
- package/dist/components/Atoms/Tubestops/styles.css +92 -0
- package/dist/components/Atoms/Video/Video.stories.js +29 -0
- package/dist/components/Atoms/Video/index.js +57 -0
- package/dist/components/Organisms/Accordion/Accordion.stories.js +99 -0
- package/dist/components/Organisms/Accordion/index.js +46 -0
- package/dist/components/Organisms/BreadcrumbsBordered/BreadcrumbsBordered.stories.js +122 -0
- package/dist/components/{BreadcrumbsBordered → Organisms/BreadcrumbsBordered}/index.js +4 -2
- package/dist/components/Organisms/Card/Card.stories.js +352 -0
- package/dist/components/{Card → Organisms/Card}/index.js +38 -2
- package/dist/components/Organisms/CardWithTopImage/CardWithTopImage.stories.js +64 -0
- package/dist/components/Organisms/CardWithTopImage/index.js +59 -0
- package/dist/components/Organisms/CardWithTopImage/styles.css +3 -0
- package/dist/components/Organisms/Carousel/Carousel.stories.js +111 -0
- package/dist/components/Organisms/Carousel/index.css +7 -0
- package/dist/components/{Carousel → Organisms/Carousel}/index.js +5 -2
- package/dist/components/Organisms/Chevron Card/ChevronCard.stories.js +18 -0
- package/dist/components/Organisms/Chevron Card/index.js +60 -0
- package/dist/components/Organisms/Chevron Card/styles.css +0 -0
- package/dist/components/Organisms/Form/Form.stories.js +118 -0
- package/dist/components/{Form → Organisms/Form}/index.js +6 -4
- package/dist/components/Organisms/FyreCard/FyreCard.stories.js +127 -0
- package/dist/components/{Input → Organisms/FyreCard}/index.js +34 -30
- package/dist/components/Organisms/ImageLink/ImageLink.stories.js +64 -0
- package/dist/components/Organisms/ImageLink/index.js +45 -0
- package/dist/components/Organisms/ImageLinkList/ImageLinkList.stories.js +35 -0
- package/dist/components/Organisms/ImageLinkList/index.js +33 -0
- package/dist/components/Organisms/Jumbotron/Jumbotron.stories.js +42 -0
- package/dist/components/{Jumbotron → Organisms/Jumbotron}/index.js +8 -6
- package/dist/components/Organisms/Nav/Nav.stories.js +103 -0
- package/dist/components/{Nav → Organisms/Nav}/index.js +65 -20
- package/dist/components/Organisms/NewsCard/NewsCard.stories.js +56 -0
- package/dist/components/Organisms/NewsCard/index.js +73 -0
- package/dist/components/Organisms/Profile/Profile.stories.js +85 -0
- package/dist/components/{Profile → Organisms/Profile}/index.js +10 -7
- package/dist/components/Organisms/Search/Search.stories.js +44 -0
- package/dist/components/{Search → Organisms/Search}/index.js +22 -13
- package/dist/components/Organisms/Testimonial/Testimonial.stories.js +103 -0
- package/dist/components/{Testimonial → Organisms/Testimonial}/index.js +2 -0
- package/dist/components/Organisms/Timeline/Timeline.stories.js +73 -0
- package/dist/components/Organisms/Timeline/index.js +127 -0
- package/dist/components/Organisms/Timeline/styles.css +89 -0
- package/dist/components/Organisms/UserIcon/UserIcon.stories.js +41 -0
- package/dist/components/{UserIcon → Organisms/UserIcon}/index.js +2 -0
- package/dist/index.js +84 -52
- package/dist/utils/controls.js +505 -0
- package/package.json +28 -24
- package/dist/components/Accordion/Accordion.stories.js +0 -64
- package/dist/components/Accordion/README.md +0 -29
- package/dist/components/Accordion/index.js +0 -40
- package/dist/components/AlertBar/AlertBar.stories.js +0 -128
- package/dist/components/AlertBar/README.md +0 -19
- package/dist/components/AlertBar/index.js +0 -43
- package/dist/components/Breadcrumbs/Breadcrumbs.stories.js +0 -60
- package/dist/components/Breadcrumbs/README.md +0 -28
- package/dist/components/BreadcrumbsBordered/BreadcrumbsBordered.stories.js +0 -73
- package/dist/components/BreadcrumbsBordered/README.md +0 -28
- package/dist/components/BreadcrumbsBorderedItem/BreadcrumbsBorderedItem.stories.js +0 -57
- package/dist/components/BreadcrumbsBorderedItem/README.md +0 -28
- package/dist/components/BreadcrumbsBorderedItem/index.css +0 -57
- package/dist/components/Button/Button.stories.js +0 -389
- package/dist/components/Button/README.md +0 -36
- package/dist/components/Card/Card.stories.js +0 -353
- package/dist/components/Card/README.md +0 -44
- package/dist/components/CardImageLink/CardImageLink.stories.js +0 -115
- package/dist/components/CardImageLink/README.md +0 -1
- package/dist/components/CardImageLink/index.js +0 -49
- package/dist/components/CardImageLinkList/CardImageLinkList.stories.js +0 -63
- package/dist/components/CardImageLinkList/README.md +0 -1
- package/dist/components/CardImageLinkList/index.js +0 -48
- package/dist/components/Carousel/Carousel.stories.js +0 -124
- package/dist/components/Carousel/README.md +0 -22
- package/dist/components/Carousel/index.css +0 -7
- package/dist/components/Collapsible/Collapsible.stories.js +0 -101
- package/dist/components/Collapsible/README.md +0 -19
- package/dist/components/Collapsible/index.js +0 -58
- package/dist/components/Column/Column.stories.js +0 -168
- package/dist/components/Column/README.md +0 -23
- package/dist/components/Form/Form.stories.js +0 -59
- package/dist/components/Form/README.md +0 -16
- package/dist/components/Icon/Icon.stories.js +0 -68
- package/dist/components/Icon/README.md +0 -12
- package/dist/components/Image/Image.stories.js +0 -62
- package/dist/components/Image/README.md +0 -12
- package/dist/components/Image/index.js +0 -31
- package/dist/components/InformationIcon/InformationIcon.stories.js +0 -122
- package/dist/components/InformationIcon/README.md +0 -23
- package/dist/components/Input/Input.stories.js +0 -58
- package/dist/components/Input/README.md +0 -23
- package/dist/components/Jumbotron/Jumbotron.stories.js +0 -118
- package/dist/components/Jumbotron/README.md +0 -24
- package/dist/components/ListItem/ListItem.stories.js +0 -50
- package/dist/components/ListItem/README.md +0 -17
- package/dist/components/ListItem/index.js +0 -25
- package/dist/components/ListItemDropdown/ListItemDropdown.stories.js +0 -50
- package/dist/components/ListItemDropdown/README.md +0 -16
- package/dist/components/ListItemDropdown/index.js +0 -56
- package/dist/components/Nav/Nav.stories.js +0 -322
- package/dist/components/Nav/README.md +0 -30
- package/dist/components/NavItem/NavItem.stories.js +0 -150
- package/dist/components/NavItem/README.md +0 -36
- package/dist/components/Profile/Profile.stories.js +0 -86
- package/dist/components/Profile/README.md +0 -17
- package/dist/components/Profile/user.jpeg +0 -0
- package/dist/components/Search/README.md +0 -21
- package/dist/components/Search/Search.stories.js +0 -122
- package/dist/components/StarRating/README.md +0 -12
- package/dist/components/StarRating/StarRating.stories.js +0 -79
- package/dist/components/StarRating/index.css +0 -8
- package/dist/components/Testimonial/README.md +0 -22
- package/dist/components/Testimonial/Testimonial.stories.js +0 -125
- package/dist/components/TextAndTitle/README.md +0 -14
- package/dist/components/TextAndTitle/TextAndTitle.stories.js +0 -66
- package/dist/components/UserIcon/README.md +0 -18
- package/dist/components/UserIcon/UserIcon.stories.js +0 -38
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
|
|
8
|
+
require("core-js/modules/web.dom-collections.iterator.js");
|
|
9
|
+
|
|
10
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
11
|
+
|
|
12
|
+
var _index = _interopRequireDefault(require("../Icon/index"));
|
|
13
|
+
|
|
14
|
+
require("../../../../index.css");
|
|
15
|
+
|
|
16
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
17
|
+
|
|
18
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
19
|
+
|
|
20
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
21
|
+
|
|
22
|
+
const Collapsible = _ref => {
|
|
23
|
+
let {
|
|
24
|
+
title,
|
|
25
|
+
subtitle,
|
|
26
|
+
isDropdown,
|
|
27
|
+
textColor,
|
|
28
|
+
bgColor,
|
|
29
|
+
hoverTextColor,
|
|
30
|
+
hoverBgColor,
|
|
31
|
+
icon,
|
|
32
|
+
content,
|
|
33
|
+
boldTitle,
|
|
34
|
+
borderTop,
|
|
35
|
+
borderBottom,
|
|
36
|
+
contentBgColor,
|
|
37
|
+
contentTextColor,
|
|
38
|
+
showBottomLine,
|
|
39
|
+
iconSize,
|
|
40
|
+
children
|
|
41
|
+
} = _ref;
|
|
42
|
+
const [expanded, setExpanded] = (0, _react.useState)(false);
|
|
43
|
+
const [styles, setStyles] = (0, _react.useState)({
|
|
44
|
+
'background-color': bgColor ? bgColor : 'grey',
|
|
45
|
+
color: textColor ? textColor : 'white'
|
|
46
|
+
});
|
|
47
|
+
const [contentStyles, setContentStyles] = (0, _react.useState)({
|
|
48
|
+
'background-color': contentBgColor ? contentBgColor : 'white',
|
|
49
|
+
color: contentTextColor ? contentTextColor : 'black'
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
const toggleExpanded = () => {
|
|
53
|
+
setExpanded(!expanded);
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
const setHoverState = isHovering => {
|
|
57
|
+
if (isHovering) {
|
|
58
|
+
setStyles({
|
|
59
|
+
'background-color': hoverBgColor ? hoverBgColor : 'black',
|
|
60
|
+
color: hoverTextColor ? hoverTextColor : 'white'
|
|
61
|
+
});
|
|
62
|
+
} else {
|
|
63
|
+
setStyles({
|
|
64
|
+
'background-color': bgColor ? bgColor : 'grey',
|
|
65
|
+
color: textColor ? textColor : 'white'
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
const padding = title && subtitle ? 'pt-7' : 'pt-4';
|
|
71
|
+
const sizeIcon = iconSize ? iconSize : '1';
|
|
72
|
+
const iconPadding = title && subtitle ? 'pt-6' : 'pt-4';
|
|
73
|
+
const textSubstitutePadding = !title && !subtitle ? 'pb-4' : '';
|
|
74
|
+
let borders = '';
|
|
75
|
+
borders += borderBottom ? 'border-b ' : '';
|
|
76
|
+
borders += borderTop ? 'border-t ' : '';
|
|
77
|
+
const bottomLine = showBottomLine ? 'border-b' : ''; // let alignment = ''
|
|
78
|
+
// alignment = contentAlignment && contentAlignment === 'left' && 'text-left'
|
|
79
|
+
// alignment = contentAlignment && contentAlignment === 'right' && 'text-right'
|
|
80
|
+
// alignment = contentAlignment && contentAlignment === 'center' && 'text-center'
|
|
81
|
+
// alignment = contentAlignment && contentAlignment === 'justified' && 'text-justify'
|
|
82
|
+
|
|
83
|
+
const contentWrapperClasses = 'expandable w-auto ' + bottomLine; //+ ' ' + alignment
|
|
84
|
+
|
|
85
|
+
return /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement("div", {
|
|
86
|
+
style: styles,
|
|
87
|
+
onMouseOver: () => setHoverState(true),
|
|
88
|
+
onMouseOut: () => setHoverState(false),
|
|
89
|
+
onClick: () => toggleExpanded(),
|
|
90
|
+
className: 'w-auto flex text-center ' + borders
|
|
91
|
+
}, icon && /*#__PURE__*/_react.default.createElement("div", {
|
|
92
|
+
className: 'pl-4 text-left ' + iconPadding + ' ' + textSubstitutePadding
|
|
93
|
+
}, /*#__PURE__*/_react.default.createElement("span", null, /*#__PURE__*/_react.default.createElement(_index.default, {
|
|
94
|
+
type: icon,
|
|
95
|
+
size: sizeIcon
|
|
96
|
+
}))), title || subtitle ? /*#__PURE__*/_react.default.createElement("div", {
|
|
97
|
+
className: "w-full pl-4 py-4 text-left"
|
|
98
|
+
}, title && boldTitle ? /*#__PURE__*/_react.default.createElement("h1", null, /*#__PURE__*/_react.default.createElement("b", null, title)) : /*#__PURE__*/_react.default.createElement("h1", null, title), subtitle && /*#__PURE__*/_react.default.createElement("h2", null, /*#__PURE__*/_react.default.createElement("small", null, subtitle))) : null, /*#__PURE__*/_react.default.createElement("div", {
|
|
99
|
+
className: 'w-full pr-8 text-right ' + padding
|
|
100
|
+
}, isDropdown ? expanded ? /*#__PURE__*/_react.default.createElement("span", null, /*#__PURE__*/_react.default.createElement(_index.default, {
|
|
101
|
+
type: "arrow-up"
|
|
102
|
+
})) : /*#__PURE__*/_react.default.createElement("span", null, /*#__PURE__*/_react.default.createElement(_index.default, {
|
|
103
|
+
type: "arrow-down"
|
|
104
|
+
})) : null)), expanded ? /*#__PURE__*/_react.default.createElement("div", {
|
|
105
|
+
style: contentStyles,
|
|
106
|
+
className: contentWrapperClasses
|
|
107
|
+
}, children) : null);
|
|
108
|
+
};
|
|
109
|
+
|
|
110
|
+
var _default = Collapsible;
|
|
111
|
+
exports.default = _default;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import Column from './index'
|
|
3
|
+
import { columnOptions } from '../../../utils/controls'
|
|
4
|
+
|
|
5
|
+
export default {
|
|
6
|
+
title: 'Trepur Components/Atoms/Column',
|
|
7
|
+
component: Column,
|
|
8
|
+
parameters: {},
|
|
9
|
+
argTypes: {
|
|
10
|
+
...columnOptions
|
|
11
|
+
},
|
|
12
|
+
args: {
|
|
13
|
+
sm: 1,
|
|
14
|
+
md: 1,
|
|
15
|
+
lg: 1,
|
|
16
|
+
xl: 1,
|
|
17
|
+
className: 'border h-16'
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
const Template = (args) => <Column {...args} />;
|
|
22
|
+
|
|
23
|
+
export const _Column = Template.bind({});
|
|
24
|
+
_Column.args = {};
|
|
@@ -7,6 +7,8 @@ exports.default = void 0;
|
|
|
7
7
|
|
|
8
8
|
var _react = _interopRequireDefault(require("react"));
|
|
9
9
|
|
|
10
|
+
require("../../../../index.css");
|
|
11
|
+
|
|
10
12
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
11
13
|
|
|
12
14
|
const Column = _ref => {
|
|
@@ -17,8 +19,23 @@ const Column = _ref => {
|
|
|
17
19
|
md,
|
|
18
20
|
lg,
|
|
19
21
|
xl,
|
|
20
|
-
children
|
|
22
|
+
children,
|
|
23
|
+
id
|
|
21
24
|
} = _ref;
|
|
25
|
+
const widthOptions = {
|
|
26
|
+
1: 'w-1/12',
|
|
27
|
+
2: 'w-2/12',
|
|
28
|
+
3: 'w-3/12',
|
|
29
|
+
4: 'w-4/12',
|
|
30
|
+
5: 'w-5/12',
|
|
31
|
+
6: 'w-6/12',
|
|
32
|
+
7: 'w-7/12',
|
|
33
|
+
8: 'w-8/12',
|
|
34
|
+
9: 'w-9/12',
|
|
35
|
+
10: 'w-10/12',
|
|
36
|
+
11: 'w-11/12',
|
|
37
|
+
12: 'w-12/12'
|
|
38
|
+
};
|
|
22
39
|
|
|
23
40
|
const calculateWidth = size => {
|
|
24
41
|
let width;
|
|
@@ -26,13 +43,13 @@ const Column = _ref => {
|
|
|
26
43
|
if (size === 12) {
|
|
27
44
|
width = 'w-full';
|
|
28
45
|
} else {
|
|
29
|
-
width =
|
|
46
|
+
width = widthOptions[size];
|
|
30
47
|
}
|
|
31
48
|
|
|
32
49
|
return width;
|
|
33
50
|
};
|
|
34
51
|
|
|
35
|
-
let classes = className + ' ';
|
|
52
|
+
let classes = className ? className + ' ' : '';
|
|
36
53
|
|
|
37
54
|
if (xs) {
|
|
38
55
|
let xsClass;
|
|
@@ -42,7 +59,7 @@ const Column = _ref => {
|
|
|
42
59
|
|
|
43
60
|
if (sm) {
|
|
44
61
|
let smClass;
|
|
45
|
-
smClass =
|
|
62
|
+
smClass = calculateWidth(sm);
|
|
46
63
|
classes += smClass + ' ';
|
|
47
64
|
}
|
|
48
65
|
|
|
@@ -65,6 +82,7 @@ const Column = _ref => {
|
|
|
65
82
|
}
|
|
66
83
|
|
|
67
84
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
85
|
+
id: id,
|
|
68
86
|
className: classes
|
|
69
87
|
}, children);
|
|
70
88
|
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import Icon from './index'
|
|
3
|
+
import { iconOptions } from '../../../utils/controls'
|
|
4
|
+
|
|
5
|
+
export default {
|
|
6
|
+
title: 'Trepur Components/Atoms/Icon',
|
|
7
|
+
components: Icon,
|
|
8
|
+
parameters: {},
|
|
9
|
+
argTypes: {
|
|
10
|
+
...iconOptions
|
|
11
|
+
},
|
|
12
|
+
args: {
|
|
13
|
+
type: 'th',
|
|
14
|
+
size: 3
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
const Template = (args) => <Icon {...args} />;
|
|
19
|
+
|
|
20
|
+
export const _Icon = Template.bind({});
|
|
21
|
+
_Icon.args = {};
|
|
@@ -9,6 +9,8 @@ require("core-js/modules/es.object.assign.js");
|
|
|
9
9
|
|
|
10
10
|
var _react = _interopRequireDefault(require("react"));
|
|
11
11
|
|
|
12
|
+
require("../../../../index.css");
|
|
13
|
+
|
|
12
14
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
13
15
|
|
|
14
16
|
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import Image from './index'
|
|
3
|
+
import logo from '../../../Assets/Images/logoWhite.png'
|
|
4
|
+
import { imageOptions } from '../../../utils/controls'
|
|
5
|
+
|
|
6
|
+
export default {
|
|
7
|
+
title: 'Trepur Components/Atoms/Image',
|
|
8
|
+
components: Image,
|
|
9
|
+
parameters: {},
|
|
10
|
+
argTypes: {
|
|
11
|
+
...imageOptions
|
|
12
|
+
},
|
|
13
|
+
args: {
|
|
14
|
+
image: logo
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
const Template = (args) => <Image {...args} />;
|
|
19
|
+
|
|
20
|
+
export const _Image = Template.bind({});
|
|
21
|
+
_Image.args = {};
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
|
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
|
9
|
+
|
|
10
|
+
require("../../../../index.css");
|
|
11
|
+
|
|
12
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
13
|
+
|
|
14
|
+
const Image = _ref => {
|
|
15
|
+
let {
|
|
16
|
+
id,
|
|
17
|
+
image,
|
|
18
|
+
altText,
|
|
19
|
+
height,
|
|
20
|
+
width,
|
|
21
|
+
classNames
|
|
22
|
+
} = _ref;
|
|
23
|
+
const widthOptions = {
|
|
24
|
+
2: 'w-2',
|
|
25
|
+
4: 'w-4',
|
|
26
|
+
8: 'w-8',
|
|
27
|
+
12: 'w-12',
|
|
28
|
+
16: 'w-16',
|
|
29
|
+
20: 'w-20',
|
|
30
|
+
24: 'w-24',
|
|
31
|
+
28: 'w-28',
|
|
32
|
+
32: 'w-32'
|
|
33
|
+
};
|
|
34
|
+
const heightOptions = {
|
|
35
|
+
2: 'h-2',
|
|
36
|
+
4: 'h-4',
|
|
37
|
+
8: 'h-8',
|
|
38
|
+
12: 'h-12',
|
|
39
|
+
16: 'h-16',
|
|
40
|
+
20: 'h-20',
|
|
41
|
+
24: 'h-24',
|
|
42
|
+
28: 'h-28',
|
|
43
|
+
32: 'h-32'
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
const getWidth = width => {
|
|
47
|
+
return widthOptions[width];
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
const getHeight = height => {
|
|
51
|
+
return heightOptions[height];
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
const imgWidth = width && getWidth(width);
|
|
55
|
+
const imgHeight = height && getHeight(height);
|
|
56
|
+
const classes = imgWidth + ' ' + imgHeight + ' ' + classNames;
|
|
57
|
+
return /*#__PURE__*/_react.default.createElement("img", {
|
|
58
|
+
id: id,
|
|
59
|
+
className: classes,
|
|
60
|
+
src: image,
|
|
61
|
+
alt: altText
|
|
62
|
+
});
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
var _default = Image;
|
|
66
|
+
exports.default = _default;
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import InformationIcon from './index'
|
|
3
|
+
|
|
4
|
+
export default {
|
|
5
|
+
title: 'Trepur Components/Atoms/Information Icon',
|
|
6
|
+
components: InformationIcon,
|
|
7
|
+
parameters: {},
|
|
8
|
+
argTypes: {
|
|
9
|
+
type: {
|
|
10
|
+
description: 'The name of the icon you wish to use',
|
|
11
|
+
control: 'text',
|
|
12
|
+
table: {
|
|
13
|
+
category: '',
|
|
14
|
+
}
|
|
15
|
+
},
|
|
16
|
+
text: {
|
|
17
|
+
description: '',
|
|
18
|
+
control: 'text',
|
|
19
|
+
table: {
|
|
20
|
+
category: '',
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
number: {
|
|
24
|
+
description: '',
|
|
25
|
+
control: 'number',
|
|
26
|
+
table: {
|
|
27
|
+
category: '',
|
|
28
|
+
}
|
|
29
|
+
},
|
|
30
|
+
size: {
|
|
31
|
+
description: 'An integer between 1 and 5 to dictate the magnification of the icon',
|
|
32
|
+
control: 'number',
|
|
33
|
+
table: {
|
|
34
|
+
category: '',
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
bordered: {
|
|
38
|
+
description: '',
|
|
39
|
+
control: 'boolean',
|
|
40
|
+
table: {
|
|
41
|
+
category: '',
|
|
42
|
+
}
|
|
43
|
+
},
|
|
44
|
+
rounded: {
|
|
45
|
+
description: '',
|
|
46
|
+
control: 'boolean',
|
|
47
|
+
table: {
|
|
48
|
+
category: '',
|
|
49
|
+
}
|
|
50
|
+
},
|
|
51
|
+
bgColor: {
|
|
52
|
+
description: '',
|
|
53
|
+
control: 'color',
|
|
54
|
+
table: {
|
|
55
|
+
category: 'Colors',
|
|
56
|
+
}
|
|
57
|
+
},
|
|
58
|
+
textColor: {
|
|
59
|
+
description: '',
|
|
60
|
+
control: 'color',
|
|
61
|
+
table: {
|
|
62
|
+
category: 'Colors',
|
|
63
|
+
}
|
|
64
|
+
},
|
|
65
|
+
hoverBgColor: {
|
|
66
|
+
description: '',
|
|
67
|
+
control: 'color',
|
|
68
|
+
table: {
|
|
69
|
+
category: 'Colors',
|
|
70
|
+
subcategory: 'Hover'
|
|
71
|
+
}
|
|
72
|
+
},
|
|
73
|
+
hoverTextColor: {
|
|
74
|
+
description: '',
|
|
75
|
+
control: 'color',
|
|
76
|
+
table: {
|
|
77
|
+
category: 'Colors',
|
|
78
|
+
subcategory: 'Hover'
|
|
79
|
+
}
|
|
80
|
+
},
|
|
81
|
+
},
|
|
82
|
+
args: {
|
|
83
|
+
type: 'th',
|
|
84
|
+
text: 'Text',
|
|
85
|
+
number: 21,
|
|
86
|
+
size: 3,
|
|
87
|
+
bordered: true,
|
|
88
|
+
rounded: true
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
const Template = (args) => <InformationIcon {...args} />;
|
|
93
|
+
|
|
94
|
+
export const _InformationIcon = Template.bind({});
|
|
95
|
+
_InformationIcon.args = {};
|
|
@@ -9,6 +9,8 @@ require("core-js/modules/web.dom-collections.iterator.js");
|
|
|
9
9
|
|
|
10
10
|
var _react = _interopRequireWildcard(require("react"));
|
|
11
11
|
|
|
12
|
+
require("../../../../index.css");
|
|
13
|
+
|
|
12
14
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
13
15
|
|
|
14
16
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
@@ -59,13 +61,12 @@ const Icon = _ref => {
|
|
|
59
61
|
}; //-----------------------------------
|
|
60
62
|
|
|
61
63
|
|
|
62
|
-
if (!type) return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null);
|
|
63
64
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
64
65
|
style: styles,
|
|
65
66
|
className: classes,
|
|
66
67
|
onMouseOver: () => setHoverState(true),
|
|
67
68
|
onMouseOut: () => setHoverState(false)
|
|
68
|
-
}, /*#__PURE__*/_react.default.createElement("span", {
|
|
69
|
+
}, type && /*#__PURE__*/_react.default.createElement("span", {
|
|
69
70
|
className: classList,
|
|
70
71
|
role: "img",
|
|
71
72
|
"aria-hidden": "true",
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import Input from './index'
|
|
3
|
+
|
|
4
|
+
export default {
|
|
5
|
+
title: 'Trepur Components/Atoms/Input',
|
|
6
|
+
component: Input,
|
|
7
|
+
parameters: {},
|
|
8
|
+
argTypes: {
|
|
9
|
+
label: {
|
|
10
|
+
description: '',
|
|
11
|
+
control: 'text',
|
|
12
|
+
table: {
|
|
13
|
+
category: '',
|
|
14
|
+
}
|
|
15
|
+
},
|
|
16
|
+
placeholder: {
|
|
17
|
+
description: '',
|
|
18
|
+
control: 'text',
|
|
19
|
+
table: {
|
|
20
|
+
category: '',
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
inputType: {
|
|
24
|
+
description: '',
|
|
25
|
+
control: 'text',
|
|
26
|
+
table: {
|
|
27
|
+
category: '',
|
|
28
|
+
}
|
|
29
|
+
},
|
|
30
|
+
bold: {
|
|
31
|
+
description: '',
|
|
32
|
+
control: 'boolean',
|
|
33
|
+
table: {
|
|
34
|
+
category: '',
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
args: {
|
|
39
|
+
label: 'This is a label',
|
|
40
|
+
placeholder: 'This is a placeholder'
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
const Template = (args) => <Input {...args} />;
|
|
45
|
+
|
|
46
|
+
export const _Input = Template.bind({});
|
|
47
|
+
_Input.args = {};
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
|
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
|
9
|
+
|
|
10
|
+
require("../../../../index.css");
|
|
11
|
+
|
|
12
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
13
|
+
|
|
14
|
+
const Input = _ref => {
|
|
15
|
+
let {
|
|
16
|
+
id,
|
|
17
|
+
label,
|
|
18
|
+
placeholder,
|
|
19
|
+
inputType,
|
|
20
|
+
bold,
|
|
21
|
+
classNames
|
|
22
|
+
} = _ref;
|
|
23
|
+
let classes = 'flex flex-col w-96 ' + classNames;
|
|
24
|
+
let labelClasses = bold ? 'font-bold w-auto' : 'w-auto';
|
|
25
|
+
let inputClasses = 'border h-12 pl-2';
|
|
26
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
27
|
+
className: classes
|
|
28
|
+
}, label && /*#__PURE__*/_react.default.createElement("label", {
|
|
29
|
+
className: labelClasses,
|
|
30
|
+
htmlFor: id
|
|
31
|
+
}, /*#__PURE__*/_react.default.createElement("b", null, label)), /*#__PURE__*/_react.default.createElement("input", {
|
|
32
|
+
className: inputClasses,
|
|
33
|
+
type: inputType,
|
|
34
|
+
id: id,
|
|
35
|
+
placeholder: placeholder
|
|
36
|
+
}));
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
var _default = Input;
|
|
40
|
+
exports.default = _default;
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import Column from '../Column';
|
|
3
|
+
import NavItem from './index'
|
|
4
|
+
|
|
5
|
+
export default {
|
|
6
|
+
title: 'Trepur Components/Atoms/Nav Item',
|
|
7
|
+
component: NavItem,
|
|
8
|
+
parameters: {},
|
|
9
|
+
argTypes: {
|
|
10
|
+
name: {
|
|
11
|
+
description: '',
|
|
12
|
+
control: 'text',
|
|
13
|
+
table: {
|
|
14
|
+
category: 'Standard',
|
|
15
|
+
subcategory: 'Content',
|
|
16
|
+
},
|
|
17
|
+
},
|
|
18
|
+
url: {
|
|
19
|
+
description: '',
|
|
20
|
+
control: 'text',
|
|
21
|
+
table: {
|
|
22
|
+
category: 'Standard',
|
|
23
|
+
subcategory: 'Content',
|
|
24
|
+
},
|
|
25
|
+
},
|
|
26
|
+
bgColor: {
|
|
27
|
+
description: '',
|
|
28
|
+
control: 'color',
|
|
29
|
+
table: {
|
|
30
|
+
category: 'Standard',
|
|
31
|
+
subcategory: 'Colors',
|
|
32
|
+
},
|
|
33
|
+
},
|
|
34
|
+
textColor: {
|
|
35
|
+
description: '',
|
|
36
|
+
control: 'color',
|
|
37
|
+
table: {
|
|
38
|
+
category: 'Standard',
|
|
39
|
+
subcategory: 'Colors',
|
|
40
|
+
},
|
|
41
|
+
},
|
|
42
|
+
borderColor: {
|
|
43
|
+
description: '',
|
|
44
|
+
control: 'color',
|
|
45
|
+
table: {
|
|
46
|
+
category: 'Standard',
|
|
47
|
+
subcategory: 'Colors',
|
|
48
|
+
},
|
|
49
|
+
},
|
|
50
|
+
hoverBgColor: {
|
|
51
|
+
description: '',
|
|
52
|
+
control: 'color',
|
|
53
|
+
table: {
|
|
54
|
+
category: 'Hover',
|
|
55
|
+
subcategory: 'Colors',
|
|
56
|
+
},
|
|
57
|
+
},
|
|
58
|
+
hoverTextColor: {
|
|
59
|
+
description: '',
|
|
60
|
+
control: 'color',
|
|
61
|
+
table: {
|
|
62
|
+
category: 'Hover',
|
|
63
|
+
subcategory: 'Colors',
|
|
64
|
+
},
|
|
65
|
+
},
|
|
66
|
+
hoverBorderColor: {
|
|
67
|
+
description: '',
|
|
68
|
+
control: 'color',
|
|
69
|
+
table: {
|
|
70
|
+
category: 'Hover',
|
|
71
|
+
subcategory: 'Colors',
|
|
72
|
+
},
|
|
73
|
+
},
|
|
74
|
+
rounded: {
|
|
75
|
+
description: '',
|
|
76
|
+
control: 'boolean',
|
|
77
|
+
table: {
|
|
78
|
+
category: '',
|
|
79
|
+
},
|
|
80
|
+
},
|
|
81
|
+
bordered: {
|
|
82
|
+
description: '',
|
|
83
|
+
control: 'boolean',
|
|
84
|
+
table: {
|
|
85
|
+
category: '',
|
|
86
|
+
},
|
|
87
|
+
}
|
|
88
|
+
},
|
|
89
|
+
args: {
|
|
90
|
+
name: 'Home',
|
|
91
|
+
bordered: true,
|
|
92
|
+
rounded: true
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
|
|
97
|
+
const Template = (args) => <Column sm={1}><NavItem {...args} /></Column>
|
|
98
|
+
|
|
99
|
+
export const _NavItem = Template.bind({});
|
|
100
|
+
_NavItem.args = {};
|
|
@@ -9,6 +9,8 @@ require("core-js/modules/web.dom-collections.iterator.js");
|
|
|
9
9
|
|
|
10
10
|
var _react = _interopRequireWildcard(require("react"));
|
|
11
11
|
|
|
12
|
+
require("../../../../index.css");
|
|
13
|
+
|
|
12
14
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
13
15
|
|
|
14
16
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
@@ -27,27 +29,26 @@ const NavItem = _ref => {
|
|
|
27
29
|
hoverTextColor,
|
|
28
30
|
hoverBgColor,
|
|
29
31
|
bordered,
|
|
30
|
-
rounded
|
|
32
|
+
rounded,
|
|
33
|
+
underlineOnHover
|
|
31
34
|
} = _ref;
|
|
32
|
-
let linkClasses = linkClassNames ? linkClassNames : '';
|
|
35
|
+
let linkClasses = linkClassNames ? linkClassNames : '';
|
|
36
|
+
const underline = underlineOnHover ? ' hover:underline' : ''; //---------- Styling ---------------
|
|
33
37
|
|
|
34
38
|
const [styles, setStyles] = (0, _react.useState)({
|
|
35
39
|
'backgroundColor': bgColor ? bgColor : 'white',
|
|
36
40
|
color: textColor ? textColor : 'black',
|
|
37
41
|
'borderColor': borderColor ? borderColor : 'black'
|
|
38
42
|
});
|
|
39
|
-
const [hovering, setHovering] = (0, _react.useState)(false);
|
|
40
43
|
|
|
41
44
|
const setHoverState = isHovering => {
|
|
42
45
|
if (isHovering) {
|
|
43
|
-
setHovering(true);
|
|
44
46
|
setStyles({
|
|
45
47
|
'backgroundColor': hoverBgColor ? hoverBgColor : 'black',
|
|
46
48
|
color: hoverTextColor ? hoverTextColor : 'white',
|
|
47
49
|
'borderColor': hoverBorderColor ? hoverBorderColor : 'black'
|
|
48
50
|
});
|
|
49
51
|
} else {
|
|
50
|
-
setHovering(false);
|
|
51
52
|
setStyles({
|
|
52
53
|
'backgroundColor': bgColor ? bgColor : 'white',
|
|
53
54
|
color: textColor ? textColor : 'black',
|
|
@@ -68,7 +69,7 @@ const NavItem = _ref => {
|
|
|
68
69
|
onMouseOver: () => setHoverState(true),
|
|
69
70
|
onMouseOut: () => setHoverState(false),
|
|
70
71
|
key: name,
|
|
71
|
-
className: "px-4 mx-2 " + linkClasses + borderClass + round,
|
|
72
|
+
className: "px-4 mx-2 mb-4 text-center " + linkClasses + borderClass + round + underline,
|
|
72
73
|
onClick: onClick
|
|
73
74
|
}, name)));
|
|
74
75
|
};
|