trepur_components 0.1.6 → 0.1.10
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/components/AlertBar/AlertBar.stories.js +130 -0
- package/dist/components/AlertBar/README.md +1 -0
- package/dist/components/AlertBar/index.js +41 -0
- package/dist/{Components/Profile/Profile.stories.js → components/Breadcrumbs/Breadcrumbs.stories.js} +8 -10
- package/dist/components/Breadcrumbs/README.md +27 -0
- package/dist/{Components → components}/Breadcrumbs/index.js +8 -16
- package/dist/components/BreadcrumbsBordered/BreadcrumbsBordered.stories.js +48 -0
- package/dist/components/BreadcrumbsBordered/README.md +27 -0
- package/dist/components/BreadcrumbsBordered/index.css +57 -0
- package/dist/components/BreadcrumbsBordered/index.js +52 -0
- package/dist/components/Button/Button.stories.js +151 -0
- package/dist/components/Button/README.md +18 -0
- package/dist/{Components → components}/Button/index.js +12 -12
- package/dist/components/ButtonSlide/ButtonSlide.stories.js +151 -0
- package/dist/components/ButtonSlide/README.md +12 -0
- package/dist/{Components → components}/ButtonSlide/Styles.css +0 -0
- package/dist/{Components → components}/ButtonSlide/index.js +12 -12
- package/dist/components/Card/Card.stories.js +299 -0
- package/dist/components/Card/README.md +44 -0
- package/dist/components/Card/index.js +91 -0
- package/dist/{Components → components}/CardImageLink/CardImageLink.stories.js +39 -21
- package/dist/{Components/Breadcrumbs → components/CardImageLink}/README.md +0 -0
- package/dist/{Components → components}/CardImageLink/index.js +10 -10
- package/dist/{Components → components}/CardImageLinkList/CardImageLinkList.stories.js +5 -9
- package/dist/{Components/BreadcrumbsBordered → components/CardImageLinkList}/README.md +0 -0
- package/dist/{Components → components}/CardImageLinkList/index.js +6 -8
- package/dist/components/CardList/CardList.stories.js +58 -0
- package/dist/components/CardList/README.md +29 -0
- package/dist/components/CardList/index.js +39 -0
- package/dist/components/Icon/Icon.stories.js +56 -0
- package/dist/components/Icon/README.md +12 -0
- package/dist/{Components → components}/Icon/index.js +10 -17
- package/dist/components/Jumbotron/Jumbotron.stories.js +118 -0
- package/dist/components/Jumbotron/README.md +22 -0
- package/dist/{Components → components}/Jumbotron/index.js +10 -10
- package/dist/{Components → components}/Nav/Nav.stories.js +9 -13
- package/dist/{Components/Button → components/Nav}/README.md +0 -0
- package/dist/{Components → components}/Nav/index.js +21 -62
- package/dist/components/Profile/Profile.stories.js +88 -0
- package/dist/{Components/ButtonSlide → components/Profile}/README.md +0 -0
- package/dist/components/Profile/index.js +51 -0
- package/dist/components/Search/README.md +18 -0
- package/dist/components/Search/Search.stories.js +111 -0
- package/dist/components/Search/index.js +50 -0
- package/dist/{Components/Card → components/SignedInLinks}/README.md +0 -0
- package/dist/{Components → components}/SignedInLinks/SignedInLinks.stories.js +5 -9
- package/dist/{Components → components}/SignedInLinks/index.js +5 -9
- package/dist/{Components/CardImageLink → components/SignedOutLinks}/README.md +0 -0
- package/dist/{Components → components}/SignedOutLinks/SignedOutLinks.stories.js +5 -9
- package/dist/{Components → components}/SignedOutLinks/index.js +5 -9
- package/dist/components/index.js +16 -0
- package/dist/components/test/index.js +20 -0
- package/dist/index.js +29 -47
- package/package.json +13 -3
- package/.babelrc +0 -14
- package/.storybook/main.js +0 -32
- package/.storybook/preview.js +0 -9
- package/babel.config.js +0 -4
- package/craco.config.js +0 -10
- package/dist/Components/Breadcrumbs/Breadcrumbs.stories.js +0 -168
- package/dist/Components/BreadcrumbsBordered/BreadcrumbsBordered.stories.js +0 -91
- package/dist/Components/BreadcrumbsBordered/index.css +0 -67
- package/dist/Components/BreadcrumbsBordered/index.js +0 -57
- package/dist/Components/Button/Button.stories.js +0 -189
- package/dist/Components/ButtonSlide/ButtonSlide.stories.js +0 -189
- package/dist/Components/Card/Card.stories.js +0 -208
- package/dist/Components/Card/index.js +0 -85
- package/dist/Components/CardImageLinkList/README.md +0 -0
- package/dist/Components/CardList/CardList.stories.js +0 -57
- package/dist/Components/CardList/README.md +0 -0
- package/dist/Components/CardList/index.js +0 -40
- package/dist/Components/Icon/Icon.stories.js +0 -77
- package/dist/Components/Icon/README.md +0 -0
- package/dist/Components/Jumbotron/Jumbotron.stories.js +0 -85
- package/dist/Components/Jumbotron/README.md +0 -0
- package/dist/Components/Nav/README.md +0 -0
- package/dist/Components/Profile/README.md +0 -0
- package/dist/Components/Profile/index.js +0 -82
- package/dist/Components/Search/README.md +0 -0
- package/dist/Components/Search/Search.stories.js +0 -76
- package/dist/Components/Search/index.js +0 -45
- package/dist/Components/SignedInLinks/README.md +0 -0
- package/dist/Components/SignedOutLinks/README.md +0 -0
- package/dist/index.css +0 -4
- package/src/Components/Breadcrumbs/Breadcrumbs.stories.js +0 -158
- package/src/Components/Breadcrumbs/README.md +0 -0
- package/src/Components/Breadcrumbs/index.js +0 -27
- package/src/Components/BreadcrumbsBordered/BreadcrumbsBordered.stories.js +0 -67
- package/src/Components/BreadcrumbsBordered/README.md +0 -0
- package/src/Components/BreadcrumbsBordered/index.css +0 -67
- package/src/Components/BreadcrumbsBordered/index.js +0 -35
- package/src/Components/Button/Button.stories.js +0 -144
- package/src/Components/Button/README.md +0 -0
- package/src/Components/Button/index.js +0 -26
- package/src/Components/ButtonSlide/ButtonSlide.stories.js +0 -144
- package/src/Components/ButtonSlide/README.md +0 -0
- package/src/Components/ButtonSlide/Styles.css +0 -25
- package/src/Components/ButtonSlide/index.js +0 -26
- package/src/Components/Card/Card.stories.js +0 -190
- package/src/Components/Card/README.md +0 -0
- package/src/Components/Card/index.js +0 -67
- package/src/Components/CardImageLink/CardImageLink.stories.js +0 -73
- package/src/Components/CardImageLink/README.md +0 -0
- package/src/Components/CardImageLink/index.js +0 -22
- package/src/Components/CardImageLinkList/CardImageLinkList.stories.js +0 -50
- package/src/Components/CardImageLinkList/README.md +0 -0
- package/src/Components/CardImageLinkList/index.js +0 -24
- package/src/Components/CardList/CardList.stories.js +0 -39
- package/src/Components/CardList/README.md +0 -0
- package/src/Components/CardList/index.js +0 -29
- package/src/Components/Icon/Icon.stories.js +0 -49
- package/src/Components/Icon/README.md +0 -0
- package/src/Components/Icon/index.js +0 -28
- package/src/Components/Jumbotron/Jumbotron.stories.js +0 -66
- package/src/Components/Jumbotron/README.md +0 -0
- package/src/Components/Jumbotron/index.js +0 -31
- package/src/Components/Nav/Nav.stories.js +0 -89
- package/src/Components/Nav/README.md +0 -0
- package/src/Components/Nav/index.js +0 -109
- package/src/Components/Profile/Profile.stories.js +0 -39
- package/src/Components/Profile/README.md +0 -0
- package/src/Components/Profile/index.js +0 -25
- package/src/Components/Search/README.md +0 -0
- package/src/Components/Search/Search.stories.js +0 -58
- package/src/Components/Search/index.js +0 -26
- package/src/Components/SignedInLinks/README.md +0 -0
- package/src/Components/SignedInLinks/SignedInLinks.stories.js +0 -39
- package/src/Components/SignedInLinks/index.js +0 -14
- package/src/Components/SignedOutLinks/README.md +0 -0
- package/src/Components/SignedOutLinks/SignedOutLinks.stories.js +0 -39
- package/src/Components/SignedOutLinks/index.js +0 -13
- package/src/index.css +0 -4
- package/src/index.js +0 -4
- package/tailwind.config.js +0 -69
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = exports._AlertBarWithRightIcon = exports._AlertBar = exports.AlertBarWithLeftIcon = exports.AlertBarWithBothIcons = exports.AlertBarWarning = exports.AlertBarSuccess = exports.AlertBarError = void 0;
|
|
7
|
+
|
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
|
9
|
+
|
|
10
|
+
var _README = _interopRequireDefault(require("./README.md"));
|
|
11
|
+
|
|
12
|
+
require("../../index.css");
|
|
13
|
+
|
|
14
|
+
var _index2 = _interopRequireDefault(require("./index"));
|
|
15
|
+
|
|
16
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
17
|
+
|
|
18
|
+
var _default = {
|
|
19
|
+
title: 'Components/AlertBar',
|
|
20
|
+
argTypes: {
|
|
21
|
+
text: {
|
|
22
|
+
name: 'Text',
|
|
23
|
+
description: 'The text the appears as an overlay on the Jumbotron',
|
|
24
|
+
control: {
|
|
25
|
+
type: 'text'
|
|
26
|
+
},
|
|
27
|
+
defaultValue: 'This is some text to display as an alert message'
|
|
28
|
+
},
|
|
29
|
+
type: {
|
|
30
|
+
name: 'Warning Type',
|
|
31
|
+
defaultValue: 'success',
|
|
32
|
+
control: {
|
|
33
|
+
type: 'select'
|
|
34
|
+
},
|
|
35
|
+
options: ['success', 'warning', 'error']
|
|
36
|
+
},
|
|
37
|
+
leftIcon: {
|
|
38
|
+
name: 'Left Icon',
|
|
39
|
+
control: {
|
|
40
|
+
type: 'text'
|
|
41
|
+
},
|
|
42
|
+
defaultValue: 'star'
|
|
43
|
+
},
|
|
44
|
+
rightIcon: {
|
|
45
|
+
name: 'Right Icon',
|
|
46
|
+
control: {
|
|
47
|
+
type: 'text'
|
|
48
|
+
},
|
|
49
|
+
defaultValue: 'star'
|
|
50
|
+
}
|
|
51
|
+
},
|
|
52
|
+
decorators: [story => /*#__PURE__*/_react.default.createElement("div", {
|
|
53
|
+
className: "p-4"
|
|
54
|
+
}, story())],
|
|
55
|
+
addParameters: {
|
|
56
|
+
oprions: {
|
|
57
|
+
showNav: false
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
};
|
|
61
|
+
exports.default = _default;
|
|
62
|
+
|
|
63
|
+
const _AlertBar = args => {
|
|
64
|
+
return /*#__PURE__*/_react.default.createElement(_index2.default, {
|
|
65
|
+
text: args.text,
|
|
66
|
+
type: args.type,
|
|
67
|
+
leftIcon: args.leftIcon,
|
|
68
|
+
rightIcon: args.rightIcon
|
|
69
|
+
});
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
exports._AlertBar = _AlertBar;
|
|
73
|
+
|
|
74
|
+
const AlertBarSuccess = args => {
|
|
75
|
+
return /*#__PURE__*/_react.default.createElement(_index2.default, {
|
|
76
|
+
text: "This is some text to display as an alert message",
|
|
77
|
+
type: "success"
|
|
78
|
+
});
|
|
79
|
+
};
|
|
80
|
+
|
|
81
|
+
exports.AlertBarSuccess = AlertBarSuccess;
|
|
82
|
+
|
|
83
|
+
const AlertBarWarning = args => {
|
|
84
|
+
return /*#__PURE__*/_react.default.createElement(_index2.default, {
|
|
85
|
+
text: "This is some text to display as an alert message",
|
|
86
|
+
type: "warning"
|
|
87
|
+
});
|
|
88
|
+
};
|
|
89
|
+
|
|
90
|
+
exports.AlertBarWarning = AlertBarWarning;
|
|
91
|
+
|
|
92
|
+
const AlertBarError = args => {
|
|
93
|
+
return /*#__PURE__*/_react.default.createElement(_index2.default, {
|
|
94
|
+
text: "This is some text to display as an alert message",
|
|
95
|
+
type: "error"
|
|
96
|
+
});
|
|
97
|
+
};
|
|
98
|
+
|
|
99
|
+
exports.AlertBarError = AlertBarError;
|
|
100
|
+
|
|
101
|
+
const AlertBarWithLeftIcon = args => {
|
|
102
|
+
return /*#__PURE__*/_react.default.createElement(_index2.default, {
|
|
103
|
+
text: args.text,
|
|
104
|
+
type: args.type,
|
|
105
|
+
leftIcon: args.leftIcon
|
|
106
|
+
});
|
|
107
|
+
};
|
|
108
|
+
|
|
109
|
+
exports.AlertBarWithLeftIcon = AlertBarWithLeftIcon;
|
|
110
|
+
|
|
111
|
+
const _AlertBarWithRightIcon = args => {
|
|
112
|
+
return /*#__PURE__*/_react.default.createElement(_index2.default, {
|
|
113
|
+
text: args.text,
|
|
114
|
+
type: args.type,
|
|
115
|
+
rightIcon: args.rightIcon
|
|
116
|
+
});
|
|
117
|
+
};
|
|
118
|
+
|
|
119
|
+
exports._AlertBarWithRightIcon = _AlertBarWithRightIcon;
|
|
120
|
+
|
|
121
|
+
const AlertBarWithBothIcons = args => {
|
|
122
|
+
return /*#__PURE__*/_react.default.createElement(_index2.default, {
|
|
123
|
+
text: args.text,
|
|
124
|
+
type: args.type,
|
|
125
|
+
leftIcon: args.leftIcon,
|
|
126
|
+
rightIcon: args.rightIcon
|
|
127
|
+
});
|
|
128
|
+
};
|
|
129
|
+
|
|
130
|
+
exports.AlertBarWithBothIcons = AlertBarWithBothIcons;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
# Jumbotron
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
|
|
8
|
+
var _index = _interopRequireDefault(require("../Icon/index"));
|
|
9
|
+
|
|
10
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
11
|
+
|
|
12
|
+
const AlertBar = _ref => {
|
|
13
|
+
let {
|
|
14
|
+
type,
|
|
15
|
+
text,
|
|
16
|
+
leftIcon,
|
|
17
|
+
rightIcon
|
|
18
|
+
} = _ref;
|
|
19
|
+
let bgColor;
|
|
20
|
+
if (type === 'success') bgColor = 'bg-brand-success';
|
|
21
|
+
if (type === 'warning') bgColor = 'bg-brand-warning';
|
|
22
|
+
if (type === 'error') bgColor = 'bg-brand-error';
|
|
23
|
+
let iconLeft = leftIcon ? /*#__PURE__*/React.createElement(_index.default, {
|
|
24
|
+
type: leftIcon
|
|
25
|
+
}) : null;
|
|
26
|
+
let iconRight = rightIcon ? /*#__PURE__*/React.createElement(_index.default, {
|
|
27
|
+
type: rightIcon
|
|
28
|
+
}) : null;
|
|
29
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
30
|
+
className: 'w-parent flex text-center h-8 ' + bgColor
|
|
31
|
+
}, leftIcon && /*#__PURE__*/React.createElement("span", {
|
|
32
|
+
className: "pt-1 left-5 pl-8"
|
|
33
|
+
}, iconLeft), /*#__PURE__*/React.createElement("h3", {
|
|
34
|
+
className: "text-white w-full text-center pt-1 pl-8"
|
|
35
|
+
}, text), rightIcon && /*#__PURE__*/React.createElement("span", {
|
|
36
|
+
className: "px-8 pt-1 float-right"
|
|
37
|
+
}, iconRight));
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
var _default = AlertBar;
|
|
41
|
+
exports.default = _default;
|
package/dist/{Components/Profile/Profile.stories.js → components/Breadcrumbs/Breadcrumbs.stories.js}
RENAMED
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
require("core-js/modules/es.object.define-property.js");
|
|
4
|
-
|
|
5
3
|
Object.defineProperty(exports, "__esModule", {
|
|
6
4
|
value: true
|
|
7
5
|
});
|
|
@@ -17,7 +15,7 @@ require("../../index.css");
|
|
|
17
15
|
|
|
18
16
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
19
17
|
|
|
20
|
-
|
|
18
|
+
const links = [{
|
|
21
19
|
link: '/',
|
|
22
20
|
name: 'link 1'
|
|
23
21
|
}, {
|
|
@@ -30,11 +28,9 @@ var links = [{
|
|
|
30
28
|
var _default = {
|
|
31
29
|
title: 'Components/Breadcrumbs',
|
|
32
30
|
argTypes: {},
|
|
33
|
-
decorators: [
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
}, story());
|
|
37
|
-
}],
|
|
31
|
+
decorators: [story => /*#__PURE__*/_react.default.createElement("div", {
|
|
32
|
+
className: "p-4"
|
|
33
|
+
}, story())],
|
|
38
34
|
parameters: {
|
|
39
35
|
readme: {
|
|
40
36
|
sidebar: _README.default
|
|
@@ -43,8 +39,10 @@ var _default = {
|
|
|
43
39
|
};
|
|
44
40
|
exports.default = _default;
|
|
45
41
|
|
|
46
|
-
|
|
47
|
-
return /*#__PURE__*/_react.default.createElement(_index.default,
|
|
42
|
+
const _Breadcrumbs = () => {
|
|
43
|
+
return /*#__PURE__*/_react.default.createElement(_index.default, {
|
|
44
|
+
links: links
|
|
45
|
+
});
|
|
48
46
|
};
|
|
49
47
|
|
|
50
48
|
exports._Breadcrumbs = _Breadcrumbs;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# Breadcrumbs
|
|
2
|
+
|
|
3
|
+
Basic breadcrumbs
|
|
4
|
+
|
|
5
|
+
## Example
|
|
6
|
+
|
|
7
|
+
```
|
|
8
|
+
const links = [
|
|
9
|
+
{
|
|
10
|
+
link: '/',
|
|
11
|
+
name: 'link 1'
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
link: '/',
|
|
15
|
+
name: 'link 2'
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
link: '/',
|
|
19
|
+
name: 'Link 3'
|
|
20
|
+
},
|
|
21
|
+
]
|
|
22
|
+
|
|
23
|
+
<BreadCrumbs links={links} />
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
## Parameters
|
|
27
|
+
`links={array} (default=null)`
|
|
@@ -1,28 +1,20 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
require("core-js/modules/es.object.define-property.js");
|
|
4
|
-
|
|
5
3
|
Object.defineProperty(exports, "__esModule", {
|
|
6
4
|
value: true
|
|
7
5
|
});
|
|
8
6
|
exports.default = void 0;
|
|
9
7
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
var Breadcrumbs = function Breadcrumbs(_ref) {
|
|
19
|
-
var className = _ref.className,
|
|
20
|
-
links = _ref.links;
|
|
21
|
-
var linksLength = Object.keys(links).length;
|
|
22
|
-
var classes = className + ' flex py-2 px-8 ';
|
|
8
|
+
const Breadcrumbs = _ref => {
|
|
9
|
+
let {
|
|
10
|
+
className,
|
|
11
|
+
links
|
|
12
|
+
} = _ref;
|
|
13
|
+
const linksLength = Object.keys(links).length;
|
|
14
|
+
let classes = className + ' flex py-2 px-8 ';
|
|
23
15
|
return /*#__PURE__*/React.createElement("ul", {
|
|
24
16
|
className: classes
|
|
25
|
-
}, links && links.map(
|
|
17
|
+
}, links && links.map((link, i) => {
|
|
26
18
|
return /*#__PURE__*/React.createElement("div", {
|
|
27
19
|
key: link.name
|
|
28
20
|
}, /*#__PURE__*/React.createElement("li", null, /*#__PURE__*/React.createElement("div", {
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = exports._BreadcrumbsBordered = void 0;
|
|
7
|
+
|
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
|
9
|
+
|
|
10
|
+
var _README = _interopRequireDefault(require("./README.md"));
|
|
11
|
+
|
|
12
|
+
var _index = _interopRequireDefault(require("./index"));
|
|
13
|
+
|
|
14
|
+
require("./index.css");
|
|
15
|
+
|
|
16
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
17
|
+
|
|
18
|
+
const links = [{
|
|
19
|
+
link: '/',
|
|
20
|
+
name: 'link 1'
|
|
21
|
+
}, {
|
|
22
|
+
link: '/',
|
|
23
|
+
name: 'link 2'
|
|
24
|
+
}, {
|
|
25
|
+
link: '/',
|
|
26
|
+
name: 'Link 3'
|
|
27
|
+
}];
|
|
28
|
+
var _default = {
|
|
29
|
+
title: 'Components/BreadcrumbsBordered',
|
|
30
|
+
argTypes: {},
|
|
31
|
+
decorators: [story => /*#__PURE__*/_react.default.createElement("div", {
|
|
32
|
+
className: "p-4"
|
|
33
|
+
}, story())],
|
|
34
|
+
parameters: {
|
|
35
|
+
readme: {
|
|
36
|
+
sidebar: _README.default
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
};
|
|
40
|
+
exports.default = _default;
|
|
41
|
+
|
|
42
|
+
const _BreadcrumbsBordered = args => {
|
|
43
|
+
return /*#__PURE__*/_react.default.createElement(_index.default, {
|
|
44
|
+
links: links
|
|
45
|
+
});
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
exports._BreadcrumbsBordered = _BreadcrumbsBordered;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# Breadcrumbs
|
|
2
|
+
|
|
3
|
+
Breadcrumbs with a bit of styling
|
|
4
|
+
|
|
5
|
+
## Example
|
|
6
|
+
|
|
7
|
+
```
|
|
8
|
+
const links = [
|
|
9
|
+
{
|
|
10
|
+
link: '/',
|
|
11
|
+
name: 'link 1'
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
link: '/',
|
|
15
|
+
name: 'link 2'
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
link: '/',
|
|
19
|
+
name: 'Link 3'
|
|
20
|
+
},
|
|
21
|
+
]
|
|
22
|
+
|
|
23
|
+
<BreadCrumbs links={links} />
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
## Parameters
|
|
27
|
+
`links={array} (default=null)`
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
@tailwind base;
|
|
2
|
+
@tailwind components;
|
|
3
|
+
@tailwind utilities;
|
|
4
|
+
@import url('https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.css');
|
|
5
|
+
|
|
6
|
+
.right-arrow {
|
|
7
|
+
@apply w-0;
|
|
8
|
+
@apply h-0;
|
|
9
|
+
border-top: 17px solid transparent;
|
|
10
|
+
border-bottom: 15px solid transparent;
|
|
11
|
+
border-left: 16px solid theme('colors.brand-border');
|
|
12
|
+
@apply absolute;
|
|
13
|
+
right: -16px;
|
|
14
|
+
@apply top-0;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.test-arrow-bottom {
|
|
18
|
+
@apply w-0;
|
|
19
|
+
@apply h-0;
|
|
20
|
+
border-top: 17px solid theme('colors.brand-border');
|
|
21
|
+
border-bottom: 18px solid transparent;
|
|
22
|
+
border-left: 17px solid transparent;
|
|
23
|
+
@apply absolute;
|
|
24
|
+
left: -17px;
|
|
25
|
+
bottom: -0px;
|
|
26
|
+
-webkit-transform: scaleY(-1);
|
|
27
|
+
transform: scaleY(-1);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.test-arrow-top {
|
|
31
|
+
@apply w-0;
|
|
32
|
+
@apply h-0;
|
|
33
|
+
border-top: 18px solid theme('colors.brand-border');
|
|
34
|
+
border-bottom: 17px solid transparent;
|
|
35
|
+
border-left: 17px solid transparent;
|
|
36
|
+
@apply absolute;
|
|
37
|
+
left: -17px;
|
|
38
|
+
top: 0px;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
.bc-item {
|
|
42
|
+
@apply relative;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
.item:hover .right-arrow {
|
|
46
|
+
border-left-color: theme('colors.brand-secondary');
|
|
47
|
+
}
|
|
48
|
+
.item:hover .test-arrow-bottom {
|
|
49
|
+
border-top-color: theme('colors.brand-secondary');
|
|
50
|
+
}
|
|
51
|
+
.item:hover .test-arrow-top {
|
|
52
|
+
border-top-color: theme('colors.brand-secondary');
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
.bc-item:focus {
|
|
56
|
+
@apply border-0;
|
|
57
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
|
|
8
|
+
const Breadcrumbs = _ref => {
|
|
9
|
+
let {
|
|
10
|
+
className,
|
|
11
|
+
links
|
|
12
|
+
} = _ref;
|
|
13
|
+
const linksLength = Object.keys(links).length;
|
|
14
|
+
let classes = 'flex py-2 px-8 ' + className;
|
|
15
|
+
return /*#__PURE__*/React.createElement("ul", {
|
|
16
|
+
className: classes
|
|
17
|
+
}, links && links.map((link, i) => {
|
|
18
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
19
|
+
key: link.name,
|
|
20
|
+
className: "item"
|
|
21
|
+
}, /*#__PURE__*/React.createElement("li", null, /*#__PURE__*/React.createElement("div", {
|
|
22
|
+
className: " bc-item px-4 mx-3 hover:bg-brand-secondary bg-brand-border border-brand-secondary h-8"
|
|
23
|
+
}, i + 1 < linksLength ? i === 0 ? /*#__PURE__*/React.createElement("a", {
|
|
24
|
+
href: link.link
|
|
25
|
+
}, /*#__PURE__*/React.createElement("p", {
|
|
26
|
+
className: i !== 0 ? 'pl-2 pt-1 text-social-facebook hover:underline' : 'pt-1 text-social-facebook hover:underline'
|
|
27
|
+
}, link.name, /*#__PURE__*/React.createElement("span", {
|
|
28
|
+
className: "right-arrow"
|
|
29
|
+
}))) : /*#__PURE__*/React.createElement("a", {
|
|
30
|
+
href: link.link
|
|
31
|
+
}, /*#__PURE__*/React.createElement("p", {
|
|
32
|
+
className: i !== 0 ? 'pl-2 pt-1 text-social-facebook hover:underline' : 'pt-1 text-social-facebook hover:underline'
|
|
33
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
34
|
+
className: "test-arrow-bottom"
|
|
35
|
+
}), /*#__PURE__*/React.createElement("span", {
|
|
36
|
+
className: "test-arrow-top"
|
|
37
|
+
}), link.name, /*#__PURE__*/React.createElement("span", {
|
|
38
|
+
className: "right-arrow"
|
|
39
|
+
}))) : /*#__PURE__*/React.createElement("p", {
|
|
40
|
+
className: "pt-1"
|
|
41
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
42
|
+
className: "test-arrow-bottom"
|
|
43
|
+
}), /*#__PURE__*/React.createElement("span", {
|
|
44
|
+
className: "test-arrow-top"
|
|
45
|
+
}), link.name, /*#__PURE__*/React.createElement("span", {
|
|
46
|
+
className: "right-arrow"
|
|
47
|
+
})))));
|
|
48
|
+
}));
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
var _default = Breadcrumbs;
|
|
52
|
+
exports.default = _default;
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = exports._Button = exports.WithOnClickMethod = exports.WithIconRight = exports.WithIconLeft = exports.WithBothIcons = exports.ButtonAsInternalLink = exports.ButtonAsExternalLink = void 0;
|
|
7
|
+
|
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
|
9
|
+
|
|
10
|
+
var _addonActions = require("@storybook/addon-actions");
|
|
11
|
+
|
|
12
|
+
var _README = _interopRequireDefault(require("./README.md"));
|
|
13
|
+
|
|
14
|
+
var _index = _interopRequireDefault(require("./index"));
|
|
15
|
+
|
|
16
|
+
require("../../index.css");
|
|
17
|
+
|
|
18
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
19
|
+
|
|
20
|
+
var _default = {
|
|
21
|
+
title: 'Components/Button',
|
|
22
|
+
argTypes: {
|
|
23
|
+
text: {
|
|
24
|
+
name: 'Button Text',
|
|
25
|
+
control: {
|
|
26
|
+
type: 'text'
|
|
27
|
+
},
|
|
28
|
+
defaultValue: 'Button 1'
|
|
29
|
+
},
|
|
30
|
+
type: {
|
|
31
|
+
name: 'Type',
|
|
32
|
+
defaultValue: 'primary',
|
|
33
|
+
control: {
|
|
34
|
+
type: 'select'
|
|
35
|
+
},
|
|
36
|
+
options: ['primary', 'secondary', 'ghost']
|
|
37
|
+
},
|
|
38
|
+
iconPlacement: {
|
|
39
|
+
name: 'Icon',
|
|
40
|
+
defaultValue: 'none',
|
|
41
|
+
control: {
|
|
42
|
+
type: 'select'
|
|
43
|
+
},
|
|
44
|
+
options: ['left', 'right', 'both', 'none']
|
|
45
|
+
},
|
|
46
|
+
leftIcon: {
|
|
47
|
+
name: 'Left Icon',
|
|
48
|
+
defaultValue: 'thumbs-down',
|
|
49
|
+
control: {
|
|
50
|
+
type: 'select'
|
|
51
|
+
},
|
|
52
|
+
options: ['thumbs-up', 'thumbs-down', 'search', 'th']
|
|
53
|
+
},
|
|
54
|
+
rightIcon: {
|
|
55
|
+
name: 'Right Icon',
|
|
56
|
+
defaultValue: 'thumbs-up',
|
|
57
|
+
control: {
|
|
58
|
+
type: 'select'
|
|
59
|
+
},
|
|
60
|
+
options: ['thumbs-up', 'thumbs-down', 'search', 'th']
|
|
61
|
+
},
|
|
62
|
+
padded: {
|
|
63
|
+
name: 'Padded',
|
|
64
|
+
control: {
|
|
65
|
+
type: 'boolean'
|
|
66
|
+
},
|
|
67
|
+
defaultValue: false
|
|
68
|
+
},
|
|
69
|
+
social: {
|
|
70
|
+
name: 'Social',
|
|
71
|
+
defaultValue: 'None',
|
|
72
|
+
control: {
|
|
73
|
+
type: 'select'
|
|
74
|
+
},
|
|
75
|
+
options: ['Facebook', 'Twitter', 'Whatsapp', 'None']
|
|
76
|
+
}
|
|
77
|
+
},
|
|
78
|
+
decorators: [story => /*#__PURE__*/_react.default.createElement("div", {
|
|
79
|
+
className: "p-4"
|
|
80
|
+
}, story())],
|
|
81
|
+
parameters: {
|
|
82
|
+
readme: {
|
|
83
|
+
sidebar: _README.default
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
};
|
|
87
|
+
exports.default = _default;
|
|
88
|
+
|
|
89
|
+
const _Button = args => {
|
|
90
|
+
return /*#__PURE__*/_react.default.createElement(_index.default, {
|
|
91
|
+
ctaText: args.text
|
|
92
|
+
});
|
|
93
|
+
};
|
|
94
|
+
|
|
95
|
+
exports._Button = _Button;
|
|
96
|
+
|
|
97
|
+
const WithIconRight = args => {
|
|
98
|
+
return /*#__PURE__*/_react.default.createElement(_index.default, {
|
|
99
|
+
rightIcon: args.rightIcon,
|
|
100
|
+
ctaText: args.text
|
|
101
|
+
});
|
|
102
|
+
};
|
|
103
|
+
|
|
104
|
+
exports.WithIconRight = WithIconRight;
|
|
105
|
+
|
|
106
|
+
const WithIconLeft = args => {
|
|
107
|
+
return /*#__PURE__*/_react.default.createElement(_index.default, {
|
|
108
|
+
leftIcon: args.leftIcon,
|
|
109
|
+
ctaText: args.text
|
|
110
|
+
});
|
|
111
|
+
};
|
|
112
|
+
|
|
113
|
+
exports.WithIconLeft = WithIconLeft;
|
|
114
|
+
|
|
115
|
+
const WithBothIcons = args => {
|
|
116
|
+
return /*#__PURE__*/_react.default.createElement(_index.default, {
|
|
117
|
+
leftIcon: args.leftIcon,
|
|
118
|
+
rightIcon: args.rightIcon,
|
|
119
|
+
ctaText: args.text
|
|
120
|
+
});
|
|
121
|
+
};
|
|
122
|
+
|
|
123
|
+
exports.WithBothIcons = WithBothIcons;
|
|
124
|
+
|
|
125
|
+
const ButtonAsExternalLink = args => {
|
|
126
|
+
return /*#__PURE__*/_react.default.createElement(_index.default, {
|
|
127
|
+
as: "a-external",
|
|
128
|
+
ctaText: args.text
|
|
129
|
+
});
|
|
130
|
+
};
|
|
131
|
+
|
|
132
|
+
exports.ButtonAsExternalLink = ButtonAsExternalLink;
|
|
133
|
+
|
|
134
|
+
const ButtonAsInternalLink = args => {
|
|
135
|
+
return /*#__PURE__*/_react.default.createElement(_index.default, {
|
|
136
|
+
as: "Link",
|
|
137
|
+
ctaText: args.text,
|
|
138
|
+
url: "/"
|
|
139
|
+
});
|
|
140
|
+
};
|
|
141
|
+
|
|
142
|
+
exports.ButtonAsInternalLink = ButtonAsInternalLink;
|
|
143
|
+
|
|
144
|
+
const WithOnClickMethod = args => {
|
|
145
|
+
return /*#__PURE__*/_react.default.createElement(_index.default, {
|
|
146
|
+
ctaText: args.text,
|
|
147
|
+
onClick: (0, _addonActions.action)('button-click')
|
|
148
|
+
});
|
|
149
|
+
};
|
|
150
|
+
|
|
151
|
+
exports.WithOnClickMethod = WithOnClickMethod;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
# Button
|
|
2
|
+
|
|
3
|
+
A basic button
|
|
4
|
+
|
|
5
|
+
## Example
|
|
6
|
+
|
|
7
|
+
```
|
|
8
|
+
<Search
|
|
9
|
+
placeholder={args.placeholder}
|
|
10
|
+
text={args.text}
|
|
11
|
+
leftIcon={args.leftIcon}>
|
|
12
|
+
</Search>
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## Parameters
|
|
16
|
+
`placeholder={string} (default=null)`
|
|
17
|
+
`text={string} (default=null)`
|
|
18
|
+
`leftIcon={string} (default=null)`
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
require("core-js/modules/es.object.define-property.js");
|
|
4
|
-
|
|
5
3
|
Object.defineProperty(exports, "__esModule", {
|
|
6
4
|
value: true
|
|
7
5
|
});
|
|
@@ -11,18 +9,20 @@ var _index = _interopRequireDefault(require("../Icon/index"));
|
|
|
11
9
|
|
|
12
10
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
13
11
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
12
|
+
const Button = _ref => {
|
|
13
|
+
let {
|
|
14
|
+
ctaText,
|
|
15
|
+
ctaLink,
|
|
16
|
+
className,
|
|
17
|
+
onClick,
|
|
18
|
+
leftIcon,
|
|
19
|
+
rightIcon
|
|
20
|
+
} = _ref;
|
|
21
|
+
let classes = className + ' py-2 px-8 rounded-lg text-black border-2 border-black border-gray-300 bg-white hover:bg-red hover:text-black transition-background-color duration-500 transform';
|
|
22
|
+
let iconLeft = /*#__PURE__*/React.createElement(_index.default, {
|
|
23
23
|
type: leftIcon
|
|
24
24
|
});
|
|
25
|
-
|
|
25
|
+
let iconRight = /*#__PURE__*/React.createElement(_index.default, {
|
|
26
26
|
type: rightIcon
|
|
27
27
|
});
|
|
28
28
|
return /*#__PURE__*/React.createElement("button", {
|