techsbcn-storybook 0.10.1 → 0.11.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 +1 -0
- package/dist/components/fields/TextSimpleComponent/TextSimpleComponent.d.ts +15 -0
- package/dist/index.d.ts +1 -0
- package/dist/stories/Fields/Fields.stories.d.ts +1 -0
- package/dist/techsbcn-storybook.cjs.development.js +33 -7
- 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 +33 -8
- package/dist/techsbcn-storybook.esm.js.map +1 -1
- package/package.json +2 -2
- package/src/components/fields/TextFieldComponent/TextFieldComponent.scss +5 -0
- package/src/components/fields/TextFieldComponent/TextFieldComponent.tsx +4 -3
- package/src/components/fields/TextSimpleComponent/TextSimpleComponent.scss +39 -0
- package/src/components/fields/TextSimpleComponent/TextSimpleComponent.tsx +40 -0
- package/src/index.tsx +1 -0
- package/src/stories/Fields/Fields.stories.tsx +274 -0
|
@@ -28,6 +28,7 @@ interface TextFieldComponentProps {
|
|
|
28
28
|
onChange?: (event: React.ChangeEvent<HTMLInputElement>) => void;
|
|
29
29
|
onKeyUp?: (event: React.KeyboardEvent<HTMLInputElement>) => void;
|
|
30
30
|
step?: number | string;
|
|
31
|
+
noBorders?: boolean;
|
|
31
32
|
}
|
|
32
33
|
export declare const TextFieldComponent: React.FC<TextFieldComponentProps>;
|
|
33
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/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>;
|
|
@@ -965,7 +965,7 @@ var ButtonComponent = function ButtonComponent(props) {
|
|
|
965
965
|
}) : props.label);
|
|
966
966
|
};
|
|
967
967
|
|
|
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}";
|
|
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.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
969
|
styleInject(css_248z$b);
|
|
970
970
|
|
|
971
971
|
var TextFieldComponent = function TextFieldComponent(props) {
|
|
@@ -987,8 +987,8 @@ var TextFieldComponent = function TextFieldComponent(props) {
|
|
|
987
987
|
error: props.error,
|
|
988
988
|
id: props.id,
|
|
989
989
|
label: props.label,
|
|
990
|
-
value: props.
|
|
991
|
-
defaultValue: props.
|
|
990
|
+
value: props.value,
|
|
991
|
+
defaultValue: props.defaultValue,
|
|
992
992
|
className: props.className,
|
|
993
993
|
required: props.required,
|
|
994
994
|
disabled: props.disabled,
|
|
@@ -998,7 +998,7 @@ var TextFieldComponent = function TextFieldComponent(props) {
|
|
|
998
998
|
variant: "standard",
|
|
999
999
|
ref: props.inputRef,
|
|
1000
1000
|
InputProps: {
|
|
1001
|
-
className: "" + (!props.disabled && hover ? 'main-border-color' : ''),
|
|
1001
|
+
className: (props.noBorders ? 'no-border' : '') + " " + (!props.disabled && hover ? 'main-border-color' : ''),
|
|
1002
1002
|
disableUnderline: true,
|
|
1003
1003
|
startAdornment: props.startIcon,
|
|
1004
1004
|
endAdornment: props.endIcon,
|
|
@@ -1030,9 +1030,34 @@ TextFieldComponent.defaultProps = {
|
|
|
1030
1030
|
type: 'text'
|
|
1031
1031
|
};
|
|
1032
1032
|
|
|
1033
|
-
var css_248z$c = ".
|
|
1033
|
+
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}";
|
|
1034
1034
|
styleInject(css_248z$c);
|
|
1035
1035
|
|
|
1036
|
+
var TextSimpleComponent = function TextSimpleComponent(props) {
|
|
1037
|
+
return React__default.createElement(_.Box, {
|
|
1038
|
+
className: "text-simple-component",
|
|
1039
|
+
display: "flex",
|
|
1040
|
+
flexDirection: "column"
|
|
1041
|
+
}, props.label && React__default.createElement(_.FormLabel, null, props.label), React__default.createElement(_.Box, {
|
|
1042
|
+
display: "flex",
|
|
1043
|
+
alignItems: "center",
|
|
1044
|
+
className: "text-simple-box " + (props.className ? props.className : '') + " " + (props.noBorders ? 'no-border' : '') + " " + (props.error ? 'has-error-border' : ''),
|
|
1045
|
+
width: "" + (props.fullWidth ? 'auto' : 'fit-content')
|
|
1046
|
+
}, props.startIcon && React__default.createElement(_.Box, {
|
|
1047
|
+
mr: 1
|
|
1048
|
+
}, props.startIcon), props.value, props.endIcon && React__default.createElement(_.Box, {
|
|
1049
|
+
ml: "" + (props.fullWidth ? 'auto' : 1)
|
|
1050
|
+
}, props.endIcon)), props.helperText && React__default.createElement(_.Box, {
|
|
1051
|
+
className: "helper-text " + (props.error ? 'has-error' : '')
|
|
1052
|
+
}, props.helperText));
|
|
1053
|
+
};
|
|
1054
|
+
TextSimpleComponent.defaultProps = {
|
|
1055
|
+
noBorders: true
|
|
1056
|
+
};
|
|
1057
|
+
|
|
1058
|
+
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}";
|
|
1059
|
+
styleInject(css_248z$d);
|
|
1060
|
+
|
|
1036
1061
|
var SelectField = function SelectField(props) {
|
|
1037
1062
|
return React__default.createElement(_.Box, {
|
|
1038
1063
|
className: "select-field",
|
|
@@ -2270,8 +2295,8 @@ ModalComponent.defaultProps = {
|
|
|
2270
2295
|
dividers: true
|
|
2271
2296
|
};
|
|
2272
2297
|
|
|
2273
|
-
var css_248z$
|
|
2274
|
-
styleInject(css_248z$
|
|
2298
|
+
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}";
|
|
2299
|
+
styleInject(css_248z$e);
|
|
2275
2300
|
|
|
2276
2301
|
var TabsComponent = function TabsComponent(props) {
|
|
2277
2302
|
var _React$useState = React__default.useState(props.tabActive.toString()),
|
|
@@ -2323,6 +2348,7 @@ exports.SelectField = SelectField;
|
|
|
2323
2348
|
exports.TableComponent = TableComponent;
|
|
2324
2349
|
exports.TabsComponent = TabsComponent;
|
|
2325
2350
|
exports.TextFieldComponent = TextFieldComponent;
|
|
2351
|
+
exports.TextSimpleComponent = TextSimpleComponent;
|
|
2326
2352
|
exports.UserInfo = UserInfo;
|
|
2327
2353
|
exports.VerticalNav = VerticalNav;
|
|
2328
2354
|
//# sourceMappingURL=techsbcn-storybook.cjs.development.js.map
|