trepur_components 0.1.37 → 0.1.41

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.
@@ -24,7 +24,7 @@ const Column = _ref => {
24
24
  let width;
25
25
 
26
26
  if (size === 12) {
27
- width = 'full';
27
+ width = 'w-full';
28
28
  } else {
29
29
  width = 'w-' + size + '/12';
30
30
  }
@@ -0,0 +1,62 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = exports._Image = 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
+ var _addonActions = require("@storybook/addon-actions");
17
+
18
+ var _logoWhite = _interopRequireDefault(require("../../Assets/Images/logoWhite.png"));
19
+
20
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
21
+
22
+ var _default = {
23
+ title: 'Components/Image',
24
+ argTypes: {
25
+ width: {
26
+ name: 'Type',
27
+ description: 'The name of the icon you wish to use',
28
+ control: {
29
+ type: 'text'
30
+ },
31
+ defaultValue: 'search'
32
+ },
33
+ height: {
34
+ name: 'Size',
35
+ description: 'an integer between 1 and 5 to dictage the magnification of the icon',
36
+ control: {
37
+ type: 'number'
38
+ },
39
+ defaultValue: 1
40
+ }
41
+ },
42
+ decorators: [story => /*#__PURE__*/_react.default.createElement("div", {
43
+ className: "p-4"
44
+ }, story())],
45
+ parameters: {
46
+ readme: {
47
+ content: _README.default
48
+ }
49
+ }
50
+ };
51
+ exports.default = _default;
52
+
53
+ const _Image = args => {
54
+ return /*#__PURE__*/_react.default.createElement(_index.default, {
55
+ altText: "logo",
56
+ image: _logoWhite.default,
57
+ height: "32",
58
+ width: "32"
59
+ });
60
+ };
61
+
62
+ exports._Image = _Image;
@@ -0,0 +1,12 @@
1
+ # Icon
2
+
3
+ A simple icon that can be used on its own or as a visual on any other component
4
+
5
+ ## Example
6
+
7
+ ```
8
+ <Icon type='thumbs-up' size='4'/>
9
+ ```
10
+
11
+ ## Parameters
12
+ `type={string} (default=null)`
@@ -0,0 +1,31 @@
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
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
11
+
12
+ const Image = _ref => {
13
+ let {
14
+ image,
15
+ altText,
16
+ height,
17
+ width,
18
+ classNames
19
+ } = _ref;
20
+ const imgWidth = width && 'w-' + width;
21
+ const imgHeight = height && 'h-' + height;
22
+ const classes = imgWidth + ' ' + imgHeight + ' ' + classNames;
23
+ return /*#__PURE__*/_react.default.createElement("img", {
24
+ className: classes,
25
+ src: image,
26
+ alt: altText
27
+ });
28
+ };
29
+
30
+ var _default = Image;
31
+ exports.default = _default;
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.default = exports._NavWithColors = exports._Nav = exports.NavWithSearchAndProfile = exports.NavWithSearch = exports.NavWithProfile = exports.NavAlignedWithSearchAndProfile = exports.NavAlignedWithSearch = exports.NavAlignedWithProfile = exports.NavAligned = void 0;
6
+ exports.default = exports._NavWithTwoRows = exports._NavWithThreeRows = exports._NavWithOneRow = exports._Nav = exports.WithTwoRowsAsSideBar = void 0;
7
7
 
8
8
  var _react = _interopRequireDefault(require("react"));
9
9
 
@@ -17,6 +17,16 @@ var _user = _interopRequireDefault(require("../../Assets/Images/user.jpeg"));
17
17
 
18
18
  var _logoWhite = _interopRequireDefault(require("../../Assets/Images/logoWhite.png"));
19
19
 
20
+ var _Image = _interopRequireDefault(require("../Image"));
21
+
22
+ var _Profile = _interopRequireDefault(require("../Profile"));
23
+
24
+ var _TextAndTitle = _interopRequireDefault(require("../TextAndTitle"));
25
+
26
+ var _Search = _interopRequireDefault(require("../Search"));
27
+
28
+ var _NavItem = _interopRequireDefault(require("../NavItem"));
29
+
20
30
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
21
31
 
22
32
  const links = [{
@@ -32,6 +42,211 @@ const links = [{
32
42
  name: 'link n',
33
43
  reference: '/'
34
44
  }];
45
+ const rowOneOfOne = [{
46
+ classNames: 'mx-auto h-full flex-none',
47
+ xsColumnWidth: 3,
48
+ smColumnWidth: 2,
49
+ mdColumnWidth: 1,
50
+ lgColumnWidth: 1,
51
+ component: /*#__PURE__*/_react.default.createElement(_Image.default, {
52
+ classNames: "mx-auto",
53
+ height: "full",
54
+ width: "auto",
55
+ image: _logoWhite.default,
56
+ altText: "Logo"
57
+ })
58
+ }, {
59
+ columnClasses: 'hidden lg:inline-flex',
60
+ classNames: '',
61
+ mdColumnWidth: 3,
62
+ lgColumnWidth: 2,
63
+ component: null
64
+ }, {
65
+ classNames: 'pt-5 ',
66
+ xsColumnWidth: 9,
67
+ smColumnWidth: 10,
68
+ mdColumnWidth: 4,
69
+ lgColumnWidth: 5,
70
+ component: /*#__PURE__*/_react.default.createElement("ul", {
71
+ id: "nav-list",
72
+ className: "flex justify-center items-center"
73
+ }, links && links.map(link => {
74
+ return /*#__PURE__*/_react.default.createElement(_NavItem.default, {
75
+ name: link.name,
76
+ url: link.reference,
77
+ borderColor: "black",
78
+ textColor: "black",
79
+ bgColor: "",
80
+ hoverBorderColor: "blue",
81
+ hoverTextColor: "blue",
82
+ hoverBgColor: "white",
83
+ bordered: true,
84
+ rounded: true
85
+ });
86
+ }))
87
+ }, {
88
+ columnClasses: 'hidden lg:inline-flex',
89
+ classNames: 'pt-2 mx-auto',
90
+ smColumnWidth: 1,
91
+ mdColumnWidth: 3,
92
+ lgColumnWidth: 4,
93
+ component: /*#__PURE__*/_react.default.createElement(_TextAndTitle.default, {
94
+ classNames: "md:pr-4 text-white",
95
+ title: "irupertbennett@gmail.com"
96
+ })
97
+ }];
98
+ const firstRowClasses = 'py-2';
99
+ const secondRowClasses = '';
100
+ const thirdRowClasses = 'py-2';
101
+ const rowOneOfTwo = [{
102
+ columnClasses: 'xs:hidden md:inline-flex',
103
+ classNames: 'pt-2 mx-auto',
104
+ smColumnWidth: 5,
105
+ mdColumnWidth: 5,
106
+ lgColumnWidth: 5,
107
+ component: null
108
+ }, {
109
+ classNames: 'mx-auto h-full',
110
+ smColumnWidth: 2,
111
+ mdColumnWidth: 2,
112
+ lgColumnWidth: 2,
113
+ component: /*#__PURE__*/_react.default.createElement(_Image.default, {
114
+ classNames: "mx-auto",
115
+ height: "full",
116
+ width: "auto",
117
+ image: _logoWhite.default,
118
+ altText: "Logo"
119
+ })
120
+ }, {
121
+ columnClasses: 'lg:inline-flex hidden',
122
+ classNames: '',
123
+ mdColumnWidth: 1,
124
+ lgColumnWidth: 2,
125
+ component: null
126
+ }, {
127
+ classNames: 'pt-3',
128
+ smColumnWidth: 3,
129
+ mdColumnWidth: 3,
130
+ lgColumnWidth: 2,
131
+ component: /*#__PURE__*/_react.default.createElement(_Search.default, {
132
+ placeholder: "search"
133
+ })
134
+ }, {
135
+ classNames: 'h-full pt-2 mx-auto pr-4 ',
136
+ smColumnWidth: 2,
137
+ mdColumnWidth: 1,
138
+ lgColumnWidth: 1,
139
+ component: /*#__PURE__*/_react.default.createElement(_Profile.default, {
140
+ imageHeight: "12",
141
+ imageWidth: "auto",
142
+ profileLinks: links,
143
+ userImage: _user.default,
144
+ rounded: true
145
+ })
146
+ }];
147
+ const rowTwoOfTwo = [{
148
+ columnClasses: 'hidden',
149
+ classNames: '',
150
+ component: null
151
+ }, {
152
+ classNames: '',
153
+ smColumnWidth: 12,
154
+ mdColumnWidth: 12,
155
+ lgColumnWidth: 12,
156
+ component: /*#__PURE__*/_react.default.createElement("ul", {
157
+ id: "nav-list",
158
+ className: "flex justify-center items-center pt-5"
159
+ }, links && links.map(link => {
160
+ return /*#__PURE__*/_react.default.createElement(_NavItem.default, {
161
+ name: link.name,
162
+ url: link.reference,
163
+ borderColor: "black",
164
+ textColor: "black",
165
+ bgColor: "",
166
+ hoverBorderColor: "blue",
167
+ hoverTextColor: "blue",
168
+ hoverBgColor: "white",
169
+ bordered: true,
170
+ rounded: true
171
+ });
172
+ }))
173
+ }, {
174
+ columnClasses: 'hidden',
175
+ classNames: '',
176
+ component: null
177
+ }];
178
+ const mobileItems = [{
179
+ classNames: 'pt-3',
180
+ component: /*#__PURE__*/_react.default.createElement(_Search.default, {
181
+ placeholder: "search"
182
+ })
183
+ }, {
184
+ classNames: '',
185
+ component: /*#__PURE__*/_react.default.createElement(_Profile.default, {
186
+ imageHeight: "12",
187
+ imageWidth: "auto",
188
+ profileLinks: links,
189
+ userImage: _user.default,
190
+ rounded: true
191
+ })
192
+ }, {
193
+ classNames: '',
194
+ component: /*#__PURE__*/_react.default.createElement("ul", {
195
+ id: "nav-list",
196
+ className: ""
197
+ }, links && links.map(link => {
198
+ return /*#__PURE__*/_react.default.createElement(_NavItem.default, {
199
+ name: link.name,
200
+ url: link.reference,
201
+ bgColor: "#38B6FF",
202
+ textColor: "white",
203
+ hoverTextColor: "#38B6FF",
204
+ hoverBgColor: "white",
205
+ rounded: true
206
+ });
207
+ }))
208
+ }];
209
+ const thirdRow = [{
210
+ smColumnWidth: 6,
211
+ mdColumnWidth: 4,
212
+ lgColumnWidth: 4,
213
+ component: /*#__PURE__*/_react.default.createElement(_Image.default, {
214
+ classNames: "mx-auto h-full",
215
+ height: "32",
216
+ width: "auto",
217
+ image: _logoWhite.default,
218
+ altText: "Logo"
219
+ })
220
+ }, {
221
+ smColumnWidth: 0,
222
+ mdColumnWidth: 4,
223
+ lgColumnWidth: 4,
224
+ component: null
225
+ }, {
226
+ smColumnWidth: 6,
227
+ mdColumnWidth: 4,
228
+ lgColumnWidth: 4,
229
+ component: /*#__PURE__*/_react.default.createElement(_Image.default, {
230
+ classNames: "mx-auto h-full",
231
+ height: "32",
232
+ width: "auto",
233
+ image: _logoWhite.default,
234
+ altText: "Logo"
235
+ })
236
+ }];
237
+ const profileLinks = [{
238
+ name: 'PROFILE ITEM 1',
239
+ reference: '/'
240
+ }, {
241
+ name: 'PROFILE ITEM 2',
242
+ reference: '/'
243
+ }, {
244
+ name: 'PROFILE ITEM 3',
245
+ reference: '/'
246
+ }, {
247
+ name: 'PROFILE ITEM 4',
248
+ reference: '/'
249
+ }];
35
250
  var _default = {
36
251
  title: 'Components/Nav',
37
252
  argTypes: {},
@@ -46,153 +261,60 @@ exports.default = _default;
46
261
 
47
262
  const _Nav = args => {
48
263
  return /*#__PURE__*/_react.default.createElement(_index.default, {
49
- links: links,
50
- navPosition: "1",
51
- logoImage: _logoWhite.default,
52
- icon: _user.default,
53
- navItemRounded: false
264
+ firstRow: rowOneOfTwo,
265
+ secondRow: rowTwoOfTwo,
266
+ thirdRow: thirdRow,
267
+ mobileItems: mobileItems
54
268
  });
55
269
  };
56
270
 
57
271
  exports._Nav = _Nav;
58
272
 
59
- const _NavWithColors = args => {
60
- return /*#__PURE__*/_react.default.createElement(_index.default, {
61
- links: links,
62
- navPosition: "1" //center
63
- ,
64
- navClass: "py-4",
65
- logoImage: _logoWhite.default,
66
- icon: _user.default,
67
- navItemBorderColor: "white",
68
- navItemTextColor: "white",
69
- navItemBgColor: "#38B6FF",
70
- hoverNavItemBorderColor: "#38B6FF",
71
- hoverNavItemTextColor: "#38B6FF",
72
- hoverNavItemBgColor: "white",
73
- bgColor: "#38B6FF",
74
- navItemBordered: true,
75
- navItemRounded: true,
76
- showProfile: false,
77
- showSearch: false,
78
- alignNavAndLogo: false,
79
- navItemLinkClassNames: "py-1",
80
- mobileNavItemBordered: false,
81
- mobileNavItemRounded: true,
82
- mobileNavItemLinkClassNames: "",
83
- mobileNavItemClassNames: "",
84
- mobileNavButtonBgColor: "#38B6FF",
85
- mobileNavButtonColor: "white",
86
- hoverMobileNavButtonBgColor: "white",
87
- hoverMobileNavButtonColor: "#38B6FF"
88
- });
89
- };
90
-
91
- exports._NavWithColors = _NavWithColors;
92
-
93
- const NavWithSearch = () => {
94
- return /*#__PURE__*/_react.default.createElement(_index.default, {
95
- links: links,
96
- navPosition: "1",
97
- navClass: "bg-brand-primary",
98
- navLinkClass: "px-2 py-2 rounded-lg flex-1 hover:text-white hover:bg-black",
99
- logoClass: "py-4",
100
- showSearch: true,
101
- logoImage: _logoWhite.default
102
- });
103
- };
104
-
105
- exports.NavWithSearch = NavWithSearch;
106
-
107
- const NavWithProfile = () => {
108
- return /*#__PURE__*/_react.default.createElement(_index.default, {
109
- links: links,
110
- navPosition: "1",
111
- navClass: "bg-brand-primary",
112
- navLinkClass: "px-2 py-2 rounded-lg flex-1 hover:text-white hover:bg-black",
113
- logoClass: "py-4",
114
- showProfile: true,
115
- icon: _user.default,
116
- logoImage: _logoWhite.default
117
- });
118
- };
119
-
120
- exports.NavWithProfile = NavWithProfile;
121
-
122
- const NavWithSearchAndProfile = () => {
123
- return /*#__PURE__*/_react.default.createElement(_index.default, {
124
- links: links,
125
- navPosition: "1",
126
- navClass: "bg-brand-primary",
127
- navLinkClass: "px-2 py-2 rounded-lg flex-1 hover:text-white hover:bg-black",
128
- logoClass: "py-4",
129
- showProfile: true,
130
- showSearch: true,
131
- logoImage: _logoWhite.default,
132
- icon: _user.default
133
- });
134
- };
135
-
136
- exports.NavWithSearchAndProfile = NavWithSearchAndProfile;
137
-
138
- const NavAligned = () => {
273
+ const _NavWithOneRow = args => {
139
274
  return /*#__PURE__*/_react.default.createElement(_index.default, {
140
- links: links,
141
- navPosition: "1",
142
- navClass: "bg-brand-primary",
143
- navLinkClass: "hover:text-white hover:bg-black",
144
- alignNavAndLogo: true,
145
- logoImage: _logoWhite.default,
146
- icon: _user.default
275
+ firstRow: rowOneOfOne,
276
+ firstRowClasses: firstRowClasses,
277
+ mobileItems: mobileItems
147
278
  });
148
279
  };
149
280
 
150
- exports.NavAligned = NavAligned;
281
+ exports._NavWithOneRow = _NavWithOneRow;
151
282
 
152
- const NavAlignedWithSearch = () => {
283
+ const _NavWithTwoRows = args => {
153
284
  return /*#__PURE__*/_react.default.createElement(_index.default, {
154
- links: links,
155
- navPosition: "1",
156
- navClass: "bg-brand-primary",
157
- navLinkClass: "hover:text-white hover:bg-black",
158
- alignNavAndLogo: true,
159
- logoImage: _logoWhite.default,
160
- icon: _user.default,
161
- showProfile: false,
162
- showSearch: true
285
+ firstRow: rowOneOfTwo,
286
+ firstRowClasses: firstRowClasses,
287
+ secondRow: rowTwoOfTwo,
288
+ secondRowClasses: secondRowClasses,
289
+ mobileItems: mobileItems
163
290
  });
164
291
  };
165
292
 
166
- exports.NavAlignedWithSearch = NavAlignedWithSearch;
293
+ exports._NavWithTwoRows = _NavWithTwoRows;
167
294
 
168
- const NavAlignedWithProfile = () => {
295
+ const _NavWithThreeRows = args => {
169
296
  return /*#__PURE__*/_react.default.createElement(_index.default, {
170
- links: links,
171
- navPosition: "1",
172
- navClass: "bg-brand-primary",
173
- navLinkClass: "hover:text-white hover:bg-black",
174
- alignNavAndLogo: true,
175
- logoImage: _logoWhite.default,
176
- icon: _user.default,
177
- showProfile: true,
178
- showSearch: false
297
+ firstRow: rowOneOfTwo,
298
+ firstRowClasses: firstRowClasses,
299
+ secondRow: rowTwoOfTwo,
300
+ secondRowClasses: secondRowClasses,
301
+ thirdRow: thirdRow,
302
+ thirdRowClasses: thirdRowClasses,
303
+ mobileItems: mobileItems
179
304
  });
180
305
  };
181
306
 
182
- exports.NavAlignedWithProfile = NavAlignedWithProfile;
307
+ exports._NavWithThreeRows = _NavWithThreeRows;
183
308
 
184
- const NavAlignedWithSearchAndProfile = () => {
309
+ const WithTwoRowsAsSideBar = args => {
185
310
  return /*#__PURE__*/_react.default.createElement(_index.default, {
186
- links: links,
187
- navPosition: "1",
188
- navClass: "bg-brand-primary",
189
- navLinkClass: "hover:text-white hover:bg-black",
190
- alignNavAndLogo: true,
191
- logoImage: _logoWhite.default,
192
- icon: _user.default,
193
- showProfile: true,
194
- showSearch: true
311
+ firstRow: rowOneOfTwo,
312
+ firstRowClasses: firstRowClasses,
313
+ secondRow: rowTwoOfTwo,
314
+ secondRowClasses: secondRowClasses,
315
+ mobileItems: mobileItems,
316
+ asSideBar: true
195
317
  });
196
318
  };
197
319
 
198
- exports.NavAlignedWithSearchAndProfile = NavAlignedWithSearchAndProfile;
320
+ exports.WithTwoRowsAsSideBar = WithTwoRowsAsSideBar;
@@ -7,17 +7,13 @@ exports.default = void 0;
7
7
 
8
8
  require("core-js/modules/web.dom-collections.iterator.js");
9
9
 
10
- require("core-js/modules/es.regexp.exec.js");
11
-
12
- require("core-js/modules/es.string.split.js");
13
-
14
10
  var _react = _interopRequireWildcard(require("react"));
15
11
 
16
- var _index = _interopRequireDefault(require("../Profile/index"));
12
+ var _Column = _interopRequireDefault(require("../Column"));
17
13
 
18
- var _index2 = _interopRequireDefault(require("../Search/index"));
14
+ var _logoWhite = _interopRequireDefault(require("../../Assets/Images/logoWhite.png"));
19
15
 
20
- var _index3 = _interopRequireDefault(require("../NavItem/index"));
16
+ var _Icon = _interopRequireDefault(require("../Icon"));
21
17
 
22
18
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
23
19
 
@@ -27,16 +23,13 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
27
23
 
28
24
  const Header = _ref => {
29
25
  let {
30
- links,
31
- navPosition,
32
- alignNavAndLogo,
33
- navClass,
34
- navLinkClass,
35
- logoClass,
36
- showSearch,
37
- showProfile,
38
- icon,
39
- logoImage,
26
+ firstRow,
27
+ firstRowClasses,
28
+ secondRow,
29
+ secondRowClasses,
30
+ thirdRow,
31
+ thirdRowClasses,
32
+ mobileItems,
40
33
  navItemBorderColor,
41
34
  navItemTextColor,
42
35
  navItemBgColor,
@@ -56,56 +49,9 @@ const Header = _ref => {
56
49
  mobileNavButtonColor,
57
50
  hoverMobileNavButtonBgColor,
58
51
  hoverMobileNavButtonColor,
59
- margin
52
+ asSideBar
60
53
  } = _ref;
61
- const user = icon ? icon : '';
62
- const [mobileMenuState, setmobileMenuState] = (0, _react.useState)(false);
63
- const profileLinks = [{
64
- name: 'PROFILE ITEM 1',
65
- reference: '/'
66
- }, {
67
- name: 'PROFILE ITEM 2',
68
- reference: '/'
69
- }, {
70
- name: 'PROFILE ITEM 3',
71
- reference: '/'
72
- }, {
73
- name: 'PROFILE ITEM 4',
74
- reference: '/'
75
- }];
76
- const pathArray = window.location.pathname.split('/');
77
- let slug = pathArray[pathArray.length - 1];
78
- slug = slug === '' ? '/' : slug;
79
- console.log(pathArray);
80
- console.log(slug);
81
- let containerClass = margin ? ' container mx-auto' : '';
82
- let backgroundColor = bgColor ? bgColor : 'grey';
83
- let containsSearchOrProfile = showSearch ? showSearch : showProfile;
84
- let flexType = containsSearchOrProfile ? 'flex-col w-full' : 'flex-1 ';
85
- let combinedLogoClass = logoClass;
86
- let navItemTopPadding = 'pt-2';
87
- let combinedMobileLogoClass = logoClass + ' sm:hidden block flex-1 flex items-center justify-center sm:items-stretch ';
88
- let linkContainerClass = 'flex-1 flex ';
89
- let logoHeight = 16;
90
-
91
- if (!alignNavAndLogo) {
92
- combinedLogoClass += ' flex justify-center ';
93
- } else {
94
- navItemTopPadding = containsSearchOrProfile ? '' : 'pt-' + logoHeight / 4;
95
- }
96
-
97
- if (navPosition === '0') {
98
- linkContainerClass += 'sm:justify-start';
99
- }
100
-
101
- if (navPosition === '1') {
102
- linkContainerClass += 'sm:justify-center';
103
- }
104
-
105
- if (navPosition === '2') {
106
- linkContainerClass += 'sm:justify-end';
107
- } //---------- Styling ---------------
108
-
54
+ const [mobileMenuState, setmobileMenuState] = (0, _react.useState)(false); //---------- Styling ---------------
109
55
 
110
56
  const [styles, setStyles] = (0, _react.useState)({
111
57
  'background-color': mobileNavButtonBgColor ? mobileNavButtonBgColor : 'white',
@@ -127,23 +73,38 @@ const Header = _ref => {
127
73
  }; //-----------------------------------
128
74
 
129
75
 
76
+ const [sideNavWidth, setSideNavWidth] = (0, _react.useState)({
77
+ 'width': '0px'
78
+ });
79
+
80
+ const openSideNav = () => {
81
+ setSideNavWidth({
82
+ 'width': '200px',
83
+ 'border-right': '3px solid black',
84
+ 'padding-right': '10px'
85
+ });
86
+ };
87
+
88
+ const closeNav = () => {
89
+ setSideNavWidth({
90
+ 'width': '0px'
91
+ });
92
+ };
93
+
130
94
  return /*#__PURE__*/_react.default.createElement("nav", {
131
- style: {
132
- 'background-color': backgroundColor
133
- },
134
95
  id: "nav",
135
- className: navClass
96
+ className: "bg-brand-primary"
136
97
  }, /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement("div", {
137
98
  id: "sm-nav",
138
- className: "relative flex items-center justify-between h-16 sm:hidden"
99
+ className: "relative flex items-center sm:hidden py-2"
139
100
  }, /*#__PURE__*/_react.default.createElement("div", {
140
101
  id: "nav-collapse-btn-wrapper",
141
- className: "absolute inset-y-0 left-0 flex items-center"
102
+ className: "absolute inset-y-0 left-2 flex items-center"
142
103
  }, /*#__PURE__*/_react.default.createElement("button", {
143
104
  style: styles,
144
105
  onMouseOver: () => setHoverState(true),
145
106
  onMouseOut: () => setHoverState(false),
146
- onClick: () => setmobileMenuState(!mobileMenuState),
107
+ onClick: asSideBar ? () => openSideNav() : () => setmobileMenuState(!mobileMenuState),
147
108
  type: "button",
148
109
  className: "inline-flex items-center justify-center p-2 rounded-md focus:ring-2 focus:ring-inset focus:ring-white",
149
110
  "aria-controls": "mobile-menu",
@@ -168,102 +129,62 @@ const Header = _ref => {
168
129
  d: "M6 18L18 6M6 6l12 12"
169
130
  })))), /*#__PURE__*/_react.default.createElement("div", {
170
131
  id: "logo",
171
- className: combinedMobileLogoClass
132
+ className: "mx-auto"
172
133
  }, /*#__PURE__*/_react.default.createElement("img", {
173
134
  className: "h-16 w-auto",
174
- src: logoImage,
135
+ src: _logoWhite.default,
175
136
  alt: " Logo "
176
137
  }))), /*#__PURE__*/_react.default.createElement("div", {
177
- className: 'hidden sm:block items-center justify-between sm:items-stretch text-center ' + containerClass
138
+ className: 'hidden sm:block items-center justify-between sm:items-stretch text-center '
178
139
  }, /*#__PURE__*/_react.default.createElement("div", {
179
- className: alignNavAndLogo ? 'flex' : ''
180
- }, /*#__PURE__*/_react.default.createElement("div", {
181
- id: "logo",
182
- className: combinedLogoClass
183
- }, /*#__PURE__*/_react.default.createElement("img", {
184
- className: "h-" + logoHeight,
185
- src: logoImage,
186
- alt: " Logo "
140
+ className: 'flex ' + firstRowClasses
141
+ }, firstRow && firstRow.map(rowItem => {
142
+ return /*#__PURE__*/_react.default.createElement(_Column.default, {
143
+ className: 'h-16 ' + rowItem.columnClasses,
144
+ xs: rowItem.xsColumnWidth,
145
+ sm: rowItem.smColumnWidth,
146
+ md: rowItem.columnWidth,
147
+ lg: rowItem.lgColumnWidth
148
+ }, /*#__PURE__*/_react.default.createElement("div", {
149
+ className: rowItem.classNames
150
+ }, rowItem.component));
187
151
  })), /*#__PURE__*/_react.default.createElement("div", {
188
- className: 'flex ' + flexType
189
- }, containsSearchOrProfile && /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement("div", {
190
- className: "flex float-right"
191
- }, showSearch && /*#__PURE__*/_react.default.createElement(_index2.default, {
192
- placeholder: "search"
193
- }), showProfile && /*#__PURE__*/_react.default.createElement(_index.default, {
194
- profileLinks: profileLinks,
195
- userImage: user,
196
- classNames: "ml-2"
197
- }))), /*#__PURE__*/_react.default.createElement("div", {
198
- id: "nav-items-container",
199
- className: linkContainerClass
200
- }, /*#__PURE__*/_react.default.createElement("div", {
201
- id: "nav-block",
202
- className: "hidden sm:inline-flex"
203
- }, /*#__PURE__*/_react.default.createElement("ul", {
204
- id: "nav-list",
205
- className: 'flex ' + navItemTopPadding
206
- }, links && links.map(link => {
207
- return /*#__PURE__*/_react.default.createElement(_index3.default, {
208
- name: link.name,
209
- url: link.reference,
210
- borderColor: slug === link.reference ? navItemBorderColor : hoverNavItemBorderColor,
211
- textColor: slug === link.reference ? navItemTextColor : hoverNavItemTextColor,
212
- bgColor: slug === link.reference ? navItemBgColor : hoverNavItemBgColor,
213
- hoverBorderColor: hoverNavItemBorderColor,
214
- hoverTextColor: hoverNavItemTextColor,
215
- hoverBgColor: hoverNavItemBgColor,
216
- bordered: navItemBordered,
217
- rounded: navItemRounded,
218
- classNames: navItemClassNames,
219
- linkClassNames: navItemLinkClassNames
220
- });
221
- })))))))), mobileMenuState && /*#__PURE__*/_react.default.createElement("div", {
222
- className: "sm:hidden",
152
+ className: 'flex ' + secondRowClasses
153
+ }, secondRow && secondRow.map(rowItem => {
154
+ return /*#__PURE__*/_react.default.createElement(_Column.default, {
155
+ className: "h-16 ",
156
+ xs: rowItem.xsColumnWidth,
157
+ sm: rowItem.smColumnWidth,
158
+ md: rowItem.columnWidth
159
+ }, rowItem.component);
160
+ })), /*#__PURE__*/_react.default.createElement("div", {
161
+ className: 'flex ' + thirdRowClasses
162
+ }, thirdRow && thirdRow.map(rowItem => {
163
+ return /*#__PURE__*/_react.default.createElement(_Column.default, {
164
+ className: "h-16",
165
+ xs: rowItem.xsColumnWidth,
166
+ sm: rowItem.smColumnWidth,
167
+ md: rowItem.columnWidth
168
+ }, rowItem.component);
169
+ })))), asSideBar ? /*#__PURE__*/_react.default.createElement("div", {
170
+ style: sideNavWidth,
171
+ className: "pt-12 bg-brand-primary fixed top-0 left-0 z-1 overflow-hidden h-full w-0 duration-500"
172
+ }, /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement(_Icon.default, {
173
+ className: "text-white absolute top-1 right-3",
174
+ onClick: () => closeNav(),
175
+ type: "times",
176
+ size: "2"
177
+ })), mobileItems && mobileItems.map(item => {
178
+ return /*#__PURE__*/_react.default.createElement("div", null, item.component);
179
+ })) :
180
+ /* dropdown */
181
+ mobileMenuState && /*#__PURE__*/_react.default.createElement("div", {
182
+ className: "sm:hidden py-2",
223
183
  id: "mobile-menu"
224
- }, showSearch && /*#__PURE__*/_react.default.createElement(_index2.default, {
225
- className: "ml-4 py-4 flex flex-1",
226
- placeholder: 'Search'
227
- }), showProfile && /*#__PURE__*/_react.default.createElement("img", {
228
- className: "ml-8 h-8 w-8 rounded-full",
229
- src: user,
230
- alt: ""
231
- }), /*#__PURE__*/_react.default.createElement("div", {
184
+ }, /*#__PURE__*/_react.default.createElement("div", {
232
185
  className: "px-2 pt-2 pb-3 space-y-1"
233
- }, links && links.map(link => {
234
- return /*#__PURE__*/_react.default.createElement(_index3.default, {
235
- name: link.name,
236
- url: link.reference,
237
- borderColor: navItemBorderColor,
238
- textColor: navItemTextColor,
239
- bgColor: navItemBgColor,
240
- hoverBorderColor: hoverNavItemBorderColor,
241
- hoverTextColor: hoverNavItemTextColor,
242
- hoverBgColor: hoverNavItemBgColor,
243
- bordered: mobileNavItemBordered,
244
- rounded: mobileNavItemRounded,
245
- classNames: mobileNavItemClassNames,
246
- linkClassNames: mobileNavItemLinkClassNames
247
- });
248
- }), /*#__PURE__*/_react.default.createElement("hr", {
249
- style: {
250
- 'color': navItemTextColor
251
- }
252
- }), showProfile && profileLinks && profileLinks.map(link => {
253
- return /*#__PURE__*/_react.default.createElement(_index3.default, {
254
- name: link.name,
255
- url: link.reference,
256
- borderColor: navItemBorderColor,
257
- textColor: navItemTextColor,
258
- bgColor: navItemBgColor,
259
- hoverBorderColor: hoverNavItemBorderColor,
260
- hoverTextColor: hoverNavItemTextColor,
261
- hoverBgColor: hoverNavItemBgColor,
262
- bordered: mobileNavItemBordered,
263
- rounded: mobileNavItemRounded,
264
- classNames: mobileNavItemClassNames,
265
- linkClassNames: mobileNavItemLinkClassNames
266
- });
186
+ }, mobileItems && mobileItems.map(item => {
187
+ return /*#__PURE__*/_react.default.createElement("div", null, item.component);
267
188
  }))));
268
189
  };
269
190
 
@@ -60,7 +60,7 @@ const NavItem = _ref => {
60
60
  let borderClass = bordered ? ' border ' : '';
61
61
  let round = rounded ? ' rounded-lg ' : '';
62
62
  return /*#__PURE__*/_react.default.createElement("div", {
63
- className: 'w-32 list-none ' + classNames
63
+ className: 'w-auto list-none ' + classNames
64
64
  }, /*#__PURE__*/_react.default.createElement("a", {
65
65
  href: url
66
66
  }, /*#__PURE__*/_react.default.createElement("li", {
@@ -19,11 +19,18 @@ const Profile = _ref => {
19
19
  alignRight,
20
20
  alignLeft,
21
21
  userImage,
22
- classNames
22
+ imageHeight,
23
+ imageWidth,
24
+ classNames,
25
+ rounded
23
26
  } = _ref;
24
27
  let profileAlignment = alignRight ? ' float-right ' : alignLeft ? ' float-left ' : '';
25
28
  let dropdownAlignement = alignRight ? ' mt-16 -mr-16 ' : alignLeft ? ' mt-16 -ml-16 ' : '';
26
29
  let dropdownTextAlignement = alignRight ? ' ' : alignLeft ? ' ' : 'text-center';
30
+ const height = imageHeight && 'h-' + imageHeight;
31
+ const width = imageWidth && 'w-' + imageWidth;
32
+ const round = rounded ? 'rounded-full' : '';
33
+ const classes = width + ' ' + height + ' ' + round;
27
34
  const [profileState, setProfileState] = (0, _react.useState)(false);
28
35
  return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("div", {
29
36
  className: 'text-center ' + classNames
@@ -34,13 +41,13 @@ const Profile = _ref => {
34
41
  type: "button",
35
42
  className: "bg-gray-800 flex rounded-full focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-offset-gray-800 focus:ring-white"
36
43
  }, /*#__PURE__*/_react.default.createElement("img", {
37
- className: "h-10 w-10 rounded-full",
44
+ className: classes,
38
45
  src: userImage,
39
46
  alt: ""
40
47
  })))), profileState && /*#__PURE__*/_react.default.createElement("div", {
41
48
  className: dropdownTextAlignement
42
49
  }, /*#__PURE__*/_react.default.createElement("div", {
43
- className: "w-48 sm:inline-block shadow-lg " + profileAlignment + dropdownAlignement
50
+ className: "w-48 sm:inline-block shadow-lg bg-brand-highlight text-white z-10 hover:bg-brand-border-light hover:text-black " + profileAlignment + dropdownAlignement
44
51
  }, profileLinks && profileLinks.map((link, i) => {
45
52
  return /*#__PURE__*/_react.default.createElement("a", {
46
53
  href: link.link,
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.default = exports._Search = exports.SearchWithRightIcon = exports.SearchWithLeftIcon = exports.SearchWithLabel = exports.SearchWithBothIcons = void 0;
6
+ exports.default = exports._Search = exports.SearchWithRightIcon = exports.SearchWithLeftIcon = exports.SearchWithLabel = exports.SearchWithBothIconsAndLabel = exports.SearchWithBothIcons = void 0;
7
7
 
8
8
  var _react = _interopRequireDefault(require("react"));
9
9
 
@@ -108,4 +108,15 @@ const SearchWithBothIcons = args => {
108
108
  });
109
109
  };
110
110
 
111
- exports.SearchWithBothIcons = SearchWithBothIcons;
111
+ exports.SearchWithBothIcons = SearchWithBothIcons;
112
+
113
+ const SearchWithBothIconsAndLabel = args => {
114
+ return /*#__PURE__*/_react.default.createElement(_index.default, {
115
+ placeholder: args.placeholder,
116
+ leftIcon: args.leftIcon,
117
+ rightIcon: args.rightIcon,
118
+ text: "Search"
119
+ });
120
+ };
121
+
122
+ exports.SearchWithBothIconsAndLabel = SearchWithBothIconsAndLabel;
@@ -34,11 +34,11 @@ const Search = _ref => {
34
34
  }, text && /*#__PURE__*/_react.default.createElement("h2", {
35
35
  className: "font-base-lg pt-2"
36
36
  }, text), /*#__PURE__*/_react.default.createElement("div", {
37
- className: "relative block"
37
+ className: "relative block w-full"
38
38
  }, leftIcon && /*#__PURE__*/_react.default.createElement("span", {
39
39
  className: "absolute inset-y-0 left-5 flex items-center pl-2"
40
40
  }, iconLeft), /*#__PURE__*/_react.default.createElement("input", {
41
- className: "ml-4 pr-32 border-2 border-gray-300 h-10 px-5 placeholder:italic placeholder:text-gray-400 rounded-md py-2 focus:outline-none focus:border-sky-500 focus:ring-sky-500 focus:ring-1 " + leftPadding,
41
+ className: "w-full border-2 border-gray-300 placeholder:italic placeholder:text-gray-400 rounded-md py-1 focus:outline-none focus:border-sky-500 focus:ring-sky-500 focus:ring-1 " + leftPadding,
42
42
  onChange: e => _onChange(e.target.value),
43
43
  placeholder: placeholder,
44
44
  type: "text",
@@ -15,8 +15,12 @@ const TextAndTitle = _ref => {
15
15
  text,
16
16
  title,
17
17
  bgColor,
18
- textColor
18
+ textColor,
19
+ titleClass,
20
+ textClass
19
21
  } = _ref;
22
+ const titleClasses = titleClass + ' text-2xl';
23
+ const textClasses = textClass + '';
20
24
  const classes = classNames + ' text-center'; //---------- Styling ---------------
21
25
 
22
26
  const styles = {
@@ -28,8 +32,10 @@ const TextAndTitle = _ref => {
28
32
  style: styles,
29
33
  className: classes
30
34
  }, /*#__PURE__*/_react.default.createElement("p", {
31
- className: "text-2xl"
32
- }, title), /*#__PURE__*/_react.default.createElement("p", null, text));
35
+ className: titleClasses
36
+ }, title), /*#__PURE__*/_react.default.createElement("p", {
37
+ className: textClasses
38
+ }, text));
33
39
  };
34
40
 
35
41
  var _default = TextAndTitle;
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "trepur_components",
3
3
  "description": "component lib",
4
4
  "author": "trepur_ttenneb",
5
- "version": "0.1.37",
5
+ "version": "0.1.41",
6
6
  "private": false,
7
7
  "keywords": [
8
8
  "react",