techsbcn-storybook 0.10.0 → 0.11.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/components/fields/ButtonComponent/ButtonComponent.d.ts +1 -0
- package/dist/components/fields/TextFieldComponent/TextFieldComponent.d.ts +2 -0
- package/dist/components/fields/TextSimpleComponent/TextSimpleComponent.d.ts +15 -0
- package/dist/data/UserList.d.ts +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/interfaces/search/BasicEntity.d.ts +2 -2
- package/dist/stories/Fields/Fields.stories.d.ts +1 -0
- package/dist/stories/button/Button.stories.d.ts +1 -0
- package/dist/techsbcn-storybook.cjs.development.js +46 -11
- 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 +46 -12
- package/dist/techsbcn-storybook.esm.js.map +1 -1
- package/package.json +2 -2
- package/src/components/fields/ButtonComponent/ButtonComponent.tsx +6 -0
- package/src/components/fields/TextFieldComponent/TextFieldComponent.scss +5 -0
- package/src/components/fields/TextFieldComponent/TextFieldComponent.tsx +5 -2
- package/src/components/fields/TextSimpleComponent/TextSimpleComponent.scss +39 -0
- package/src/components/fields/TextSimpleComponent/TextSimpleComponent.tsx +40 -0
- package/src/components/tables/TableComponent/TableComponent.tsx +8 -4
- package/src/data/UserList.tsx +3 -3
- package/src/index.tsx +1 -0
- package/src/interfaces/search/BasicEntity.tsx +2 -2
- package/src/stories/Fields/Fields.stories.tsx +274 -0
- package/src/stories/button/Button.stories.tsx +9 -0
|
@@ -24,9 +24,11 @@ interface TextFieldComponentProps {
|
|
|
24
24
|
multiline?: boolean;
|
|
25
25
|
rows?: number;
|
|
26
26
|
maxLength?: number;
|
|
27
|
+
defaultValue?: string | number;
|
|
27
28
|
onChange?: (event: React.ChangeEvent<HTMLInputElement>) => void;
|
|
28
29
|
onKeyUp?: (event: React.KeyboardEvent<HTMLInputElement>) => void;
|
|
29
30
|
step?: number | string;
|
|
31
|
+
noBorders?: boolean;
|
|
30
32
|
}
|
|
31
33
|
export declare const TextFieldComponent: React.FC<TextFieldComponentProps>;
|
|
32
34
|
export {};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import './TextSimpleComponent.scss';
|
|
3
|
+
interface TextSimpleComponentProps {
|
|
4
|
+
label?: string;
|
|
5
|
+
value?: any;
|
|
6
|
+
className?: string;
|
|
7
|
+
error?: boolean;
|
|
8
|
+
startIcon?: React.ReactNode;
|
|
9
|
+
endIcon?: React.ReactNode;
|
|
10
|
+
helperText?: string;
|
|
11
|
+
noBorders?: boolean;
|
|
12
|
+
fullWidth?: boolean;
|
|
13
|
+
}
|
|
14
|
+
export declare const TextSimpleComponent: React.FC<TextSimpleComponentProps>;
|
|
15
|
+
export {};
|
package/dist/data/UserList.d.ts
CHANGED
package/dist/index.d.ts
CHANGED
|
@@ -10,6 +10,7 @@ export * from './components/layouts/DrawerLayout/DrawerSidebar/DrawerSidebar';
|
|
|
10
10
|
export * from './components/layouts/Standard/AppHeader/AppHeader';
|
|
11
11
|
export * from './components/fields/ButtonComponent/ButtonComponent';
|
|
12
12
|
export * from './components/fields/TextFieldComponent/TextFieldComponent';
|
|
13
|
+
export * from './components/fields/TextSimpleComponent/TextSimpleComponent';
|
|
13
14
|
export * from './components/fields/SelectFieldComponent/SelectField';
|
|
14
15
|
export * from './components/fields/SelectFieldComponent/SelectAsyncField';
|
|
15
16
|
export * from './components/forms/LoginForm';
|
|
@@ -3,3 +3,4 @@ declare const meta: Meta;
|
|
|
3
3
|
export default meta;
|
|
4
4
|
export declare const TextField: Story<import("@storybook/react").Args>;
|
|
5
5
|
export declare const SelectFieldTemplate: Story<import("@storybook/react").Args>;
|
|
6
|
+
export declare const TextSimple: Story<import("@storybook/react").Args>;
|
|
@@ -7,3 +7,4 @@ export declare const ModalCancel: Story<import("@storybook/react").Args>;
|
|
|
7
7
|
export declare const Loading: Story<import("@storybook/react").Args>;
|
|
8
8
|
export declare const StartIcon: Story<import("@storybook/react").Args>;
|
|
9
9
|
export declare const EndIcon: Story<import("@storybook/react").Args>;
|
|
10
|
+
export declare const Span: Story<import("@storybook/react").Args>;
|
|
@@ -402,10 +402,14 @@ var TableComponent = function TableComponent(props) {
|
|
|
402
402
|
for (var i = 0, n = a.length; i < n; ++i) {
|
|
403
403
|
var k = a[i];
|
|
404
404
|
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
405
|
+
try {
|
|
406
|
+
if (k in o) {
|
|
407
|
+
o = o[k];
|
|
408
|
+
} else {
|
|
409
|
+
return undefined;
|
|
410
|
+
}
|
|
411
|
+
} catch (_error) {
|
|
412
|
+
return undefined;
|
|
409
413
|
}
|
|
410
414
|
}
|
|
411
415
|
|
|
@@ -959,13 +963,17 @@ var ButtonComponent = function ButtonComponent(props) {
|
|
|
959
963
|
startIcon: !props.loading && props.startIcon,
|
|
960
964
|
endIcon: !props.loading && props.endIcon,
|
|
961
965
|
onClick: props.onClick,
|
|
962
|
-
disabled: !props.loading && props.disabled
|
|
966
|
+
disabled: !props.loading && props.disabled,
|
|
967
|
+
component: props.component
|
|
963
968
|
}, props.loading ? React__default.createElement(_.CircularProgress, {
|
|
964
969
|
size: 25
|
|
965
970
|
}) : props.label);
|
|
966
971
|
};
|
|
972
|
+
ButtonComponent.defaultProps = {
|
|
973
|
+
component: 'button'
|
|
974
|
+
};
|
|
967
975
|
|
|
968
|
-
var css_248z$b = ".text-field-component .MuiFormLabel-root {\n color: #666666 !important;\n font-size: calc(12pt + (14 - 12) * calc(100vw - 300px)/1300) !important;\n transform: translate(0, 0.5px) scale(0.85);\n transform-origin: top left;\n text-overflow: initial !important;\n}\n.text-field-component .MuiFormLabel-root + .MuiInputBase-formControl {\n margin-top: 25px !important;\n}\n.text-field-component .MuiInputBase-root {\n color: #666666 !important;\n border: 1px solid grey;\n padding: 0.43rem 0.87rem;\n background-color: white !important;\n border-radius: 3px !important;\n}\n.text-field-component .MuiInputBase-root.Mui-error {\n border: 1px solid #F24726 !important;\n}\n.text-field-component .MuiInputBase-root:not(.Mui-disabled):hover {\n border: 1px solid grey;\n}\n.text-field-component .MuiInputBase-root.Mui-focused {\n border: 1px solid #3299C7;\n}\n.text-field-component .MuiInputBase-root .MuiInputBase-input {\n color: #666666 !important;\n background-color: white !important;\n}\n.text-field-component .MuiInputBase-root .MuiInputBase-input::placeholder {\n text-overflow: ellipsis !important;\n color: #666666 !important;\n opacity: 1;\n}\n.text-field-component .MuiInputBase-root .Mui-disabled {\n -webkit-text-fill-color: #666666 !important;\n}\n.text-field-component .MuiFormHelperText-root {\n padding: 0 !important;\n font-size: 0.85rem !important;\n color: #666666;\n}";
|
|
976
|
+
var css_248z$b = ".text-field-component .MuiFormLabel-root {\n color: #666666 !important;\n font-size: calc(12pt + (14 - 12) * calc(100vw - 300px)/1300) !important;\n transform: translate(0, 0.5px) scale(0.85);\n transform-origin: top left;\n text-overflow: initial !important;\n}\n.text-field-component .MuiFormLabel-root + .MuiInputBase-formControl {\n margin-top: 25px !important;\n}\n.text-field-component .MuiInputBase-root.no-border {\n border: none !important;\n padding: 0 !important;\n width: fit-content !important;\n}\n.text-field-component .MuiInputBase-root {\n color: #666666 !important;\n border: 1px solid grey;\n padding: 0.43rem 0.87rem;\n background-color: white !important;\n border-radius: 3px !important;\n}\n.text-field-component .MuiInputBase-root.Mui-error {\n border: 1px solid #F24726 !important;\n}\n.text-field-component .MuiInputBase-root:not(.Mui-disabled):hover {\n border: 1px solid grey;\n}\n.text-field-component .MuiInputBase-root.Mui-focused {\n border: 1px solid #3299C7;\n}\n.text-field-component .MuiInputBase-root .MuiInputBase-input {\n color: #666666 !important;\n background-color: white !important;\n}\n.text-field-component .MuiInputBase-root .MuiInputBase-input::placeholder {\n text-overflow: ellipsis !important;\n color: #666666 !important;\n opacity: 1;\n}\n.text-field-component .MuiInputBase-root .Mui-disabled {\n -webkit-text-fill-color: #666666 !important;\n}\n.text-field-component .MuiFormHelperText-root {\n padding: 0 !important;\n font-size: 0.85rem !important;\n color: #666666;\n}";
|
|
969
977
|
styleInject(css_248z$b);
|
|
970
978
|
|
|
971
979
|
var TextFieldComponent = function TextFieldComponent(props) {
|
|
@@ -987,7 +995,8 @@ var TextFieldComponent = function TextFieldComponent(props) {
|
|
|
987
995
|
error: props.error,
|
|
988
996
|
id: props.id,
|
|
989
997
|
label: props.label,
|
|
990
|
-
|
|
998
|
+
value: props.value,
|
|
999
|
+
defaultValue: props.defaultValue,
|
|
991
1000
|
className: props.className,
|
|
992
1001
|
required: props.required,
|
|
993
1002
|
disabled: props.disabled,
|
|
@@ -997,7 +1006,7 @@ var TextFieldComponent = function TextFieldComponent(props) {
|
|
|
997
1006
|
variant: "standard",
|
|
998
1007
|
ref: props.inputRef,
|
|
999
1008
|
InputProps: {
|
|
1000
|
-
className: "" + (!props.disabled && hover ? 'main-border-color' : ''),
|
|
1009
|
+
className: (props.noBorders ? 'no-border' : '') + " " + (!props.disabled && hover ? 'main-border-color' : ''),
|
|
1001
1010
|
disableUnderline: true,
|
|
1002
1011
|
startAdornment: props.startIcon,
|
|
1003
1012
|
endAdornment: props.endIcon,
|
|
@@ -1029,9 +1038,34 @@ TextFieldComponent.defaultProps = {
|
|
|
1029
1038
|
type: 'text'
|
|
1030
1039
|
};
|
|
1031
1040
|
|
|
1032
|
-
var css_248z$c = ".
|
|
1041
|
+
var css_248z$c = ".text-simple-component .MuiFormLabel-root {\n color: #666666 !important;\n font-size: calc(12pt + (14 - 12) * calc(100vw - 300px)/1300) !important;\n transform: translate(0, 0.5px) scale(0.85);\n transform-origin: top left;\n text-overflow: initial !important;\n}\n.text-simple-component .MuiFormLabel-root + .text-simple-box.no-border {\n margin-top: 7px !important;\n}\n.text-simple-component .text-simple-box.no-border {\n border: none !important;\n padding: 0 !important;\n}\n.text-simple-component .text-simple-box {\n color: #666666 !important;\n font-size: 1rem;\n border: 1px solid grey;\n padding: 0.868rem;\n border-radius: 3px !important;\n}\n.text-simple-component .helper-text {\n font-size: 0.85rem !important;\n padding: 0 !important;\n margin-top: 3px;\n line-height: 1.66;\n color: #666666 !important;\n letter-spacing: 0.03333em;\n}\n.text-simple-component .has-error-border {\n border-color: #F24726 !important;\n}\n.text-simple-component .has-error {\n color: #F24726 !important;\n}";
|
|
1033
1042
|
styleInject(css_248z$c);
|
|
1034
1043
|
|
|
1044
|
+
var TextSimpleComponent = function TextSimpleComponent(props) {
|
|
1045
|
+
return React__default.createElement(_.Box, {
|
|
1046
|
+
className: "text-simple-component",
|
|
1047
|
+
display: "flex",
|
|
1048
|
+
flexDirection: "column"
|
|
1049
|
+
}, props.label && React__default.createElement(_.FormLabel, null, props.label), React__default.createElement(_.Box, {
|
|
1050
|
+
display: "flex",
|
|
1051
|
+
alignItems: "center",
|
|
1052
|
+
className: "text-simple-box " + (props.className ? props.className : '') + " " + (props.noBorders ? 'no-border' : '') + " " + (props.error ? 'has-error-border' : ''),
|
|
1053
|
+
width: "" + (props.fullWidth ? 'auto' : 'fit-content')
|
|
1054
|
+
}, props.startIcon && React__default.createElement(_.Box, {
|
|
1055
|
+
mr: 1
|
|
1056
|
+
}, props.startIcon), props.value, props.endIcon && React__default.createElement(_.Box, {
|
|
1057
|
+
ml: "" + (props.fullWidth ? 'auto' : 1)
|
|
1058
|
+
}, props.endIcon)), props.helperText && React__default.createElement(_.Box, {
|
|
1059
|
+
className: "helper-text " + (props.error ? 'has-error' : '')
|
|
1060
|
+
}, props.helperText));
|
|
1061
|
+
};
|
|
1062
|
+
TextSimpleComponent.defaultProps = {
|
|
1063
|
+
noBorders: true
|
|
1064
|
+
};
|
|
1065
|
+
|
|
1066
|
+
var css_248z$d = ".select-field .MuiFormLabel-root {\n color: #666666 !important;\n font-size: calc(12pt + (14 - 12) * calc(100vw - 300px)/1300) !important;\n transform: translate(0, 0.5px) scale(0.85);\n transform-origin: top left;\n text-overflow: initial !important;\n}\n.select-field .select {\n font-size: 1rem;\n}\n.select-field .select__menu {\n z-index: 3 !important;\n background-color: white;\n}\n.select-field .select__control {\n cursor: pointer;\n border: 1px solid grey;\n border-radius: 5px !important;\n padding: 0.33rem 0.2rem;\n font-size: 1rem;\n color: grey !important;\n background-color: transparent;\n}\n.select-field .select__option {\n cursor: pointer;\n color: #666666 !important;\n background-color: white !important;\n}\n.select-field .select__option--is-focused {\n background-color: rgba(0, 0, 0, 0.04) !important;\n color: #666666 !important;\n}\n.select-field .select__option--is-selected {\n color: white !important;\n}\n.select-field .select__indicator {\n color: grey !important;\n}\n.select-field .select__indicator:hover {\n color: black !important;\n}\n.select-field .select__placeholder {\n text-overflow: ellipsis !important;\n color: #666666 !important;\n opacity: 1;\n}\n.select-field .select__single-value {\n color: #666666 !important;\n}\n.select-field .select__multi-value__label {\n color: #666666 !important;\n font-size: 1rem;\n}\n.select-field .select__control--is-focused {\n border-color: grey !important;\n box-shadow: none !important;\n}\n.select-field .helper-text {\n font-size: 0.85rem !important;\n padding: 0 !important;\n margin-top: 3px;\n line-height: 1.66;\n color: #666666 !important;\n letter-spacing: 0.03333em;\n}\n.select-field .has-error {\n color: #F24726 !important;\n}\n.select-field .has-error .select__control {\n border: 1px #F24726 solid !important;\n}\n.select-field .has-error .select__control--is-focused {\n border-color: #F24726 !important;\n box-shadow: 0 0 0 1px #F24726;\n}";
|
|
1067
|
+
styleInject(css_248z$d);
|
|
1068
|
+
|
|
1035
1069
|
var SelectField = function SelectField(props) {
|
|
1036
1070
|
return React__default.createElement(_.Box, {
|
|
1037
1071
|
className: "select-field",
|
|
@@ -2269,8 +2303,8 @@ ModalComponent.defaultProps = {
|
|
|
2269
2303
|
dividers: true
|
|
2270
2304
|
};
|
|
2271
2305
|
|
|
2272
|
-
var css_248z$
|
|
2273
|
-
styleInject(css_248z$
|
|
2306
|
+
var css_248z$e = ".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}";
|
|
2307
|
+
styleInject(css_248z$e);
|
|
2274
2308
|
|
|
2275
2309
|
var TabsComponent = function TabsComponent(props) {
|
|
2276
2310
|
var _React$useState = React__default.useState(props.tabActive.toString()),
|
|
@@ -2322,6 +2356,7 @@ exports.SelectField = SelectField;
|
|
|
2322
2356
|
exports.TableComponent = TableComponent;
|
|
2323
2357
|
exports.TabsComponent = TabsComponent;
|
|
2324
2358
|
exports.TextFieldComponent = TextFieldComponent;
|
|
2359
|
+
exports.TextSimpleComponent = TextSimpleComponent;
|
|
2325
2360
|
exports.UserInfo = UserInfo;
|
|
2326
2361
|
exports.VerticalNav = VerticalNav;
|
|
2327
2362
|
//# sourceMappingURL=techsbcn-storybook.cjs.development.js.map
|