techsbcn-storybook 0.8.1 → 0.9.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/tables/SearchComponent/SearchComponent.d.ts +1 -0
- package/dist/components/wrappers/TabsComponent/TabsComponent.d.ts +17 -0
- package/dist/index.d.ts +1 -0
- package/dist/techsbcn-storybook.cjs.development.js +59 -10
- 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 +60 -12
- package/dist/techsbcn-storybook.esm.js.map +1 -1
- package/package.json +2 -1
- package/src/components/tables/SearchComponent/SearchComponent.tsx +11 -5
- package/src/components/wrappers/MainWrapperComponent/MainWrapperComponent.scss +2 -5
- package/src/components/wrappers/MainWrapperComponent/MainWrapperComponent.tsx +8 -6
- package/src/components/wrappers/TabsComponent/TabsComponent.scss +22 -0
- package/src/components/wrappers/TabsComponent/TabsComponent.tsx +49 -0
- package/src/index.tsx +1 -0
- package/src/stories/MainWrapper/MainWrapper.stories.tsx +39 -0
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import './TabsComponent.scss';
|
|
3
|
+
interface TabsComponentProps {
|
|
4
|
+
tabActive: number;
|
|
5
|
+
tabs: TabLabel[];
|
|
6
|
+
tabsComponent: TabComponent[];
|
|
7
|
+
}
|
|
8
|
+
interface TabLabel {
|
|
9
|
+
label: string;
|
|
10
|
+
value: number;
|
|
11
|
+
}
|
|
12
|
+
interface TabComponent {
|
|
13
|
+
component: React.ReactNode;
|
|
14
|
+
value: number;
|
|
15
|
+
}
|
|
16
|
+
export declare const TabsComponent: React.FC<TabsComponentProps>;
|
|
17
|
+
export {};
|
package/dist/index.d.ts
CHANGED
|
@@ -16,3 +16,4 @@ export * from './components/forms/LoginForm';
|
|
|
16
16
|
export * from './components/forms/ChangePasswordForm';
|
|
17
17
|
export * from './components/forms/ResetPasswordForm';
|
|
18
18
|
export * from './components/modals/ModalComponent';
|
|
19
|
+
export * from './components/wrappers/TabsComponent/TabsComponent';
|
|
@@ -16,6 +16,7 @@ var reactSelectAsyncPaginate = require('react-select-async-paginate');
|
|
|
16
16
|
var yup = require('yup');
|
|
17
17
|
var reactHookForm = require('react-hook-form');
|
|
18
18
|
var yup$1 = require('@hookform/resolvers/yup');
|
|
19
|
+
var lab = require('@mui/lab');
|
|
19
20
|
|
|
20
21
|
function styleInject(css, ref) {
|
|
21
22
|
if ( ref === void 0 ) ref = {};
|
|
@@ -130,17 +131,17 @@ var SearchComponent = function SearchComponent(props) {
|
|
|
130
131
|
className: "search-component " + props.className
|
|
131
132
|
}, React__default.createElement(material.Grid, {
|
|
132
133
|
container: true,
|
|
133
|
-
spacing: 2,
|
|
134
134
|
alignItems: "center"
|
|
135
135
|
}, React__default.createElement(material.Grid, {
|
|
136
136
|
item: true,
|
|
137
|
-
xs:
|
|
137
|
+
xs: props.actions ? 6 : 12,
|
|
138
|
+
md: 4
|
|
138
139
|
}, React__default.createElement(material.Box, {
|
|
139
|
-
|
|
140
|
-
className:
|
|
140
|
+
px: 1,
|
|
141
|
+
className: (props.enableAfter ? 'main-background-color-after' : '') + " title"
|
|
141
142
|
}, props.title)), props.actions && React__default.createElement(material.Grid, {
|
|
142
143
|
item: true,
|
|
143
|
-
xs:
|
|
144
|
+
xs: props.title ? 6 : 12,
|
|
144
145
|
sx: {
|
|
145
146
|
display: {
|
|
146
147
|
xs: 'block',
|
|
@@ -198,6 +199,12 @@ var SearchComponent = function SearchComponent(props) {
|
|
|
198
199
|
alignItems: "center"
|
|
199
200
|
}, React__default.createElement(material.Box, {
|
|
200
201
|
ml: "auto",
|
|
202
|
+
sx: (props.searchBar || props.filters) && {
|
|
203
|
+
mt: {
|
|
204
|
+
xs: 2,
|
|
205
|
+
md: 0
|
|
206
|
+
}
|
|
207
|
+
},
|
|
201
208
|
display: "flex",
|
|
202
209
|
width: "100%"
|
|
203
210
|
}, props.searchBar, props.filters && React__default.createElement(material.Box, {
|
|
@@ -232,7 +239,7 @@ var SearchComponent = function SearchComponent(props) {
|
|
|
232
239
|
})))));
|
|
233
240
|
};
|
|
234
241
|
|
|
235
|
-
var css_248z$2 = ".main-wrapper-component {\n background-color: white;\n box-shadow: 0 1px 20px 0 rgba(69, 90, 100, 0.08);\n}\n.main-wrapper-component .
|
|
242
|
+
var css_248z$2 = ".main-wrapper-component {\n background-color: white;\n box-shadow: 0 1px 20px 0 rgba(69, 90, 100, 0.08);\n}\n.main-wrapper-component .main-background-color-after {\n position: relative;\n}\n.main-wrapper-component .main-background-color-after:after {\n content: \"\";\n position: absolute;\n left: -17px;\n top: -4px;\n width: 4px;\n height: 30px;\n}\n.main-wrapper-component .wrapper-actions .btn-action {\n cursor: pointer;\n}\n.main-wrapper-component .wrapper-actions .btn-action .MuiButton-root {\n width: max-content;\n}\n.main-wrapper-component .wrapper-actions .btn-action svg {\n font-size: 40px;\n}";
|
|
236
243
|
styleInject(css_248z$2);
|
|
237
244
|
|
|
238
245
|
var MainWrapperComponent = function MainWrapperComponent(props) {
|
|
@@ -245,15 +252,20 @@ var MainWrapperComponent = function MainWrapperComponent(props) {
|
|
|
245
252
|
px: 2
|
|
246
253
|
}, React__default.createElement(_.CircularProgress, {
|
|
247
254
|
className: "circular-progress-main-color"
|
|
248
|
-
})) : React__default.createElement(React__default.Fragment, null, React__default.createElement(_.Box, {
|
|
255
|
+
})) : React__default.createElement(React__default.Fragment, null, props.headerProps && React__default.createElement(_.Box, {
|
|
249
256
|
mb: props.divider ? 1 : 0,
|
|
250
257
|
px: 2
|
|
251
|
-
}, React__default.createElement(SearchComponent, Object.assign({}, props.headerProps
|
|
252
|
-
|
|
258
|
+
}, React__default.createElement(SearchComponent, Object.assign({}, props.headerProps, {
|
|
259
|
+
enableAfter: true
|
|
260
|
+
}))), props.divider && React__default.createElement(_.Divider, null), props.children && !props.loadingChildren ? React__default.createElement(_.Box, {
|
|
261
|
+
pt: props.headerProps ? 2 : 0,
|
|
253
262
|
px: 2
|
|
254
|
-
},
|
|
263
|
+
}, React__default.createElement(_.Box, {
|
|
264
|
+
className: "" + (props.headerProps ? '' : 'main-background-color-after')
|
|
265
|
+
}, props.children)) : props.loadingChildren ? React__default.createElement(_.Box, {
|
|
255
266
|
display: "flex",
|
|
256
267
|
justifyContent: "center",
|
|
268
|
+
pt: props.headerProps ? 2 : 0,
|
|
257
269
|
px: 2
|
|
258
270
|
}, React__default.createElement(_.CircularProgress, {
|
|
259
271
|
className: "circular-progress-main-color"
|
|
@@ -2238,6 +2250,42 @@ ModalComponent.defaultProps = {
|
|
|
2238
2250
|
dividers: true
|
|
2239
2251
|
};
|
|
2240
2252
|
|
|
2253
|
+
var css_248z$d = ".tabs-component .Mui-selected {\n color: white !important;\n border: none !important;\n background-color: #3299C7;\n}\n.tabs-component .MuiTabs-indicator {\n display: none;\n}\n.tabs-component .MuiTab-root {\n margin: 2px 2px 0px;\n border: 1px solid #00000038;\n border-bottom: none;\n border-radius: 5% 5% 0% 0%;\n color: rgba(0, 0, 0, 0.54);\n}\n.tabs-component .MuiTabPanel-root {\n border: 1px solid #00000038;\n margin: 0px 2px 0px;\n border-radius: 0% 5px 5px 5px;\n}";
|
|
2254
|
+
styleInject(css_248z$d);
|
|
2255
|
+
|
|
2256
|
+
var TabsComponent = function TabsComponent(props) {
|
|
2257
|
+
var _React$useState = React__default.useState(props.tabActive.toString()),
|
|
2258
|
+
value = _React$useState[0],
|
|
2259
|
+
setValue = _React$useState[1];
|
|
2260
|
+
|
|
2261
|
+
var handleChange = function handleChange(_event, newValue) {
|
|
2262
|
+
setValue(newValue);
|
|
2263
|
+
};
|
|
2264
|
+
|
|
2265
|
+
return React__default.createElement(MainWrapperComponent, null, React__default.createElement(material.Box, {
|
|
2266
|
+
className: "tabs-component"
|
|
2267
|
+
}, React__default.createElement(lab.TabContext, {
|
|
2268
|
+
value: value
|
|
2269
|
+
}, React__default.createElement(lab.TabList, {
|
|
2270
|
+
onChange: handleChange
|
|
2271
|
+
}, props.tabs.sort(function (a, b) {
|
|
2272
|
+
return a.value - b.value;
|
|
2273
|
+
}).map(function (tabLabel) {
|
|
2274
|
+
return React__default.createElement(material.Tab, {
|
|
2275
|
+
key: tabLabel.value,
|
|
2276
|
+
label: tabLabel.label,
|
|
2277
|
+
value: tabLabel.value.toString()
|
|
2278
|
+
});
|
|
2279
|
+
})), props.tabsComponent.sort(function (a, b) {
|
|
2280
|
+
return a.value - b.value;
|
|
2281
|
+
}).map(function (tabComponent) {
|
|
2282
|
+
return React__default.createElement(lab.TabPanel, {
|
|
2283
|
+
key: tabComponent.value,
|
|
2284
|
+
value: tabComponent.value.toString()
|
|
2285
|
+
}, tabComponent.component);
|
|
2286
|
+
}))));
|
|
2287
|
+
};
|
|
2288
|
+
|
|
2241
2289
|
exports.AppHeader = AppHeader;
|
|
2242
2290
|
exports.AppSidebar = AppSidebar;
|
|
2243
2291
|
exports.ButtonComponent = ButtonComponent;
|
|
@@ -2253,6 +2301,7 @@ exports.SearchComponent = SearchComponent;
|
|
|
2253
2301
|
exports.SelectAsyncField = SelectAsyncField;
|
|
2254
2302
|
exports.SelectField = SelectField;
|
|
2255
2303
|
exports.TableComponent = TableComponent;
|
|
2304
|
+
exports.TabsComponent = TabsComponent;
|
|
2256
2305
|
exports.TextFieldComponent = TextFieldComponent;
|
|
2257
2306
|
exports.UserInfo = UserInfo;
|
|
2258
2307
|
exports.VerticalNav = VerticalNav;
|