techsbcn-storybook 0.20.0 → 0.21.0
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/fields/TextFieldComponent/TextFieldComponent.d.ts +2 -1
- package/dist/components/layouts/Standard/AppHeader/AppHeader.d.ts +2 -1
- package/dist/components/navigation/VerticalNav/NavIcon.d.ts +7 -0
- package/dist/components/navigation/VerticalNav/VerticalNav.d.ts +2 -0
- package/dist/components/wrappers/MainWrapperComponent/MainWrapperComponent.d.ts +1 -0
- package/dist/techsbcn-storybook.cjs.development.js +35 -6
- package/dist/techsbcn-storybook.cjs.development.js.map +1 -1
- package/dist/techsbcn-storybook.cjs.production.min.js +1 -1
- package/dist/techsbcn-storybook.cjs.production.min.js.map +1 -1
- package/dist/techsbcn-storybook.esm.js +35 -6
- package/dist/techsbcn-storybook.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/components/fields/TextFieldComponent/TextFieldComponent.tsx +2 -2
- package/src/components/layouts/Standard/AppHeader/AppHeader.tsx +14 -11
- package/src/components/navigation/VerticalNav/NavIcon.tsx +20 -0
- package/src/components/navigation/VerticalNav/VerticalNav.scss +12 -3
- package/src/components/navigation/VerticalNav/VerticalNav.tsx +2 -0
- package/src/components/navigation/VerticalNav/VerticalNavItem.tsx +5 -0
- package/src/components/navigation/VerticalNav/VerticalNavItemCollapse.tsx +2 -0
- package/src/components/wrappers/MainWrapperComponent/MainWrapperComponent.tsx +2 -1
- package/src/stories/Layouts/MainLayoutSimple.stories.tsx +13 -2
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import { StandardTextFieldProps } from '@mui/material/';
|
|
2
3
|
import './TextFieldComponent.scss';
|
|
3
4
|
export declare type InputType = 'button' | 'checkbox' | 'color' | 'date' | 'datetime-local' | 'email' | 'file' | 'hidden' | 'image' | 'month' | 'number' | 'password' | 'radio' | 'range' | 'reset' | 'search' | 'submit' | 'tel' | 'text' | 'time' | 'url' | 'week';
|
|
4
|
-
export interface TextFieldComponentProps {
|
|
5
|
+
export interface TextFieldComponentProps extends StandardTextFieldProps {
|
|
5
6
|
id?: string;
|
|
6
7
|
label?: string;
|
|
7
8
|
name?: string;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import './AppHeader.scss';
|
|
3
3
|
interface AppHeaderProps {
|
|
4
|
-
handleDrawerOpen
|
|
4
|
+
handleDrawerOpen?: () => void;
|
|
5
5
|
children?: React.ReactNode;
|
|
6
|
+
className?: string;
|
|
6
7
|
}
|
|
7
8
|
export declare const AppHeader: React.FC<AppHeaderProps>;
|
|
8
9
|
export {};
|
|
@@ -261,9 +261,11 @@ var css_248z$3 = ".main-wrapper-component {\n background-color: white;\n box-s
|
|
|
261
261
|
styleInject(css_248z$3);
|
|
262
262
|
|
|
263
263
|
var MainWrapperComponent = function MainWrapperComponent(props) {
|
|
264
|
+
var _props$height;
|
|
265
|
+
|
|
264
266
|
return React__default.createElement(_.Box, {
|
|
265
267
|
className: "main-wrapper-component",
|
|
266
|
-
height: "100%
|
|
268
|
+
height: "" + ((_props$height = props.height) != null ? _props$height : '100%')
|
|
267
269
|
}, React__default.createElement(_.Box, {
|
|
268
270
|
height: "4px"
|
|
269
271
|
}, props.loadingProgressBar && React__default.createElement(LinearProgressComponent, null)), React__default.createElement(_.Box, {
|
|
@@ -1224,6 +1226,22 @@ var MainLayoutSimple = function MainLayoutSimple(props) {
|
|
|
1224
1226
|
}, props.mainComponent))));
|
|
1225
1227
|
};
|
|
1226
1228
|
|
|
1229
|
+
var NavIcon = function NavIcon(props) {
|
|
1230
|
+
if (props.iconClassName) {
|
|
1231
|
+
return React__default.createElement(material.Box, {
|
|
1232
|
+
className: "pcoded-micon"
|
|
1233
|
+
}, React__default.createElement("i", {
|
|
1234
|
+
className: props.iconClassName
|
|
1235
|
+
}));
|
|
1236
|
+
} else if (props.iconComponent) {
|
|
1237
|
+
return React__default.createElement(material.Box, {
|
|
1238
|
+
className: "pcoded-micon"
|
|
1239
|
+
}, props.iconComponent);
|
|
1240
|
+
}
|
|
1241
|
+
|
|
1242
|
+
return React__default.createElement(React__default.Fragment, null);
|
|
1243
|
+
};
|
|
1244
|
+
|
|
1227
1245
|
var VerticalNavItem = function VerticalNavItem(props) {
|
|
1228
1246
|
var _useLocation = reactRouterDom.useLocation(),
|
|
1229
1247
|
pathname = _useLocation.pathname;
|
|
@@ -1244,10 +1262,16 @@ var VerticalNavItem = function VerticalNavItem(props) {
|
|
|
1244
1262
|
onClick: props.onHide
|
|
1245
1263
|
}, React__default.createElement(material.Box, {
|
|
1246
1264
|
p: 2,
|
|
1265
|
+
display: "flex",
|
|
1266
|
+
alignContent: "flex-end",
|
|
1267
|
+
alignItems: "center",
|
|
1247
1268
|
className: "nav-item " + (reactRouterDom.matchPath({
|
|
1248
1269
|
path: props.item.route + "/*" || ''
|
|
1249
1270
|
}, pathname) ? 'main-background-color' : '')
|
|
1250
|
-
}, React__default.createElement(
|
|
1271
|
+
}, React__default.createElement(NavIcon, {
|
|
1272
|
+
iconClassName: props.item.iconClassName,
|
|
1273
|
+
iconComponent: props.item.iconComponent
|
|
1274
|
+
}), React__default.createElement(material.Box, {
|
|
1251
1275
|
className: "nav-item-text"
|
|
1252
1276
|
}, props.item.title)));
|
|
1253
1277
|
};
|
|
@@ -1319,7 +1343,10 @@ var VerticalNavItemCollapse = function VerticalNavItemCollapse(props) {
|
|
|
1319
1343
|
alignItems: "center",
|
|
1320
1344
|
className: "nav-item " + (open ? 'open' : '') + " " + (needsToBeOpened(pathname, props.item) ? 'active' : ''),
|
|
1321
1345
|
onClick: handleClick
|
|
1322
|
-
}, React__default.createElement(
|
|
1346
|
+
}, React__default.createElement(NavIcon, {
|
|
1347
|
+
iconClassName: props.item.iconClassName,
|
|
1348
|
+
iconComponent: props.item.iconComponent
|
|
1349
|
+
}), React__default.createElement(material.Box, {
|
|
1323
1350
|
className: "nav-item-text"
|
|
1324
1351
|
}, props.item.title), React__default.createElement(material.Box, {
|
|
1325
1352
|
ml: "auto",
|
|
@@ -1348,7 +1375,7 @@ var VerticalNavItemCollapse = function VerticalNavItemCollapse(props) {
|
|
|
1348
1375
|
|
|
1349
1376
|
var VerticalNavItemCollapse$1 = /*#__PURE__*/React__default.memo(VerticalNavItemCollapse);
|
|
1350
1377
|
|
|
1351
|
-
var css_248z$8 = ".vertical-navigation {\n background: transparent;\n color: white;\n}\n.vertical-navigation .
|
|
1378
|
+
var css_248z$8 = ".vertical-navigation {\n background: transparent;\n color: white;\n}\n.vertical-navigation .pcoded-micon {\n font-size: 1rem;\n margin-right: 7px;\n border-radius: 4px;\n width: 30px;\n display: inline-flex;\n align-items: center;\n height: 30px;\n text-align: center;\n}\n.vertical-navigation .nav-item {\n cursor: pointer;\n}\n.vertical-navigation .nav-item {\n padding: 12px;\n}\n.vertical-navigation .nav-item:hover {\n background-color: #333f54;\n}\n.vertical-navigation .active .nav-item {\n background-color: #3299C7;\n border-radius: 0 25px 25px 0;\n margin-right: 16px;\n}\n.vertical-navigation .active .nav-item .nav-item-text {\n color: white !important;\n}\n.vertical-navigation .active .nav-item:hover {\n color: white !important;\n}\n.vertical-navigation .active .nav-item:hover .nav-item-text {\n color: white !important;\n}\n.vertical-navigation .nav-item-collapse .active {\n background-color: #333f54;\n}\n.vertical-navigation .nav-item-collapse .active .nav-item-text {\n color: white !important;\n}\n.vertical-navigation .nav-item-collapse .active:hover {\n color: white !important;\n}\n.vertical-navigation .nav-item-collapse .active:hover .nav-item-text {\n color: white !important;\n}\n.vertical-navigation .nav-item-collapse .open {\n background-color: #333f54;\n color: white !important;\n}\n.vertical-navigation .nav-item-collapse .open .nav-item-text {\n color: white !important;\n}\n.vertical-navigation .nav-item-collapse .collapse-children {\n background-color: #39465e;\n}\n.vertical-navigation .nav-item-collapse .collapse-children .nav-item-text {\n padding-left: 16px;\n padding-right: 16px;\n}";
|
|
1352
1379
|
styleInject(css_248z$8);
|
|
1353
1380
|
|
|
1354
1381
|
(function (NavigationType) {
|
|
@@ -1521,12 +1548,14 @@ var css_248z$c = ".app-bar {\n background-color: white !important;\n border-bo
|
|
|
1521
1548
|
styleInject(css_248z$c);
|
|
1522
1549
|
|
|
1523
1550
|
var AppHeader = function AppHeader(props) {
|
|
1551
|
+
var _props$className;
|
|
1552
|
+
|
|
1524
1553
|
return React__default.createElement(material.AppBar, {
|
|
1525
1554
|
position: "sticky",
|
|
1526
|
-
className: "app-bar main-background-body"
|
|
1555
|
+
className: "app-bar main-background-body " + ((_props$className = props.className) != null ? _props$className : '')
|
|
1527
1556
|
}, React__default.createElement(material.Toolbar, {
|
|
1528
1557
|
className: "app-toolbar"
|
|
1529
|
-
}, React__default.createElement(material.IconButton, {
|
|
1558
|
+
}, props.handleDrawerOpen && React__default.createElement(material.IconButton, {
|
|
1530
1559
|
sx: {
|
|
1531
1560
|
display: {
|
|
1532
1561
|
xs: 'inline-flex',
|