techsbcn-storybook 0.14.4 → 0.14.8

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.
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
  import './TextFieldComponent.scss';
3
- export declare type InputType = 'text' | 'radio' | 'checkbox' | 'textarea' | 'submit' | 'date' | 'hidden' | 'number' | 'range' | 'password' | 'time' | 'file';
3
+ 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
4
  export interface TextFieldComponentProps {
5
5
  id?: string;
6
6
  label?: string;
@@ -2,7 +2,10 @@ import React from 'react';
2
2
  import './TextSimpleComponent.scss';
3
3
  interface TextSimpleComponentProps {
4
4
  label?: any;
5
+ skeletonLabel?: boolean;
6
+ isFormLabel?: boolean;
5
7
  value?: any;
8
+ classNameLabel?: string;
6
9
  className?: string;
7
10
  error?: boolean;
8
11
  startIcon?: React.ReactNode;
@@ -12,6 +15,11 @@ interface TextSimpleComponentProps {
12
15
  fullWidth?: boolean;
13
16
  noMargin?: boolean;
14
17
  isLoading?: boolean;
18
+ skeletonValue?: SkeletonProps;
19
+ }
20
+ interface SkeletonProps {
21
+ useSkeleton: boolean;
22
+ mineSkeleton?: any;
15
23
  }
16
24
  export declare const TextSimpleComponent: React.FC<TextSimpleComponentProps>;
17
25
  export {};
@@ -3,4 +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>;
6
+ export declare const TextSimple: Story;
@@ -595,7 +595,7 @@ var TableComponent = function TableComponent(props) {
595
595
  return React__default.createElement(TextFieldComponent, Object.assign({}, editableCell.isTextField.textFieldProps, {
596
596
  onChange: handleTextFieldChange,
597
597
  name: fieldName,
598
- value: value || ''
598
+ defaultValue: value
599
599
  }));
600
600
  } else {
601
601
  return value;
@@ -973,7 +973,7 @@ var SimpleTableComponent = function SimpleTableComponent(props) {
973
973
  return React__default.createElement(TextFieldComponent, Object.assign({}, editableCell.isTextField.textFieldProps, {
974
974
  onChange: handleTextFieldChange,
975
975
  name: fieldName,
976
- value: value || ''
976
+ defaultValue: value
977
977
  }));
978
978
  } else {
979
979
  return value;
@@ -1504,28 +1504,54 @@ var css_248z$e = ".text-simple-component .MuiFormLabel-root {\n color: #666666;
1504
1504
  styleInject(css_248z$e);
1505
1505
 
1506
1506
  var TextSimpleComponent = function TextSimpleComponent(props) {
1507
+ var _props$classNameLabel, _props$classNameLabel2, _props$className;
1508
+
1509
+ function SkeletonCompleteDefault(skeleton) {
1510
+ var _skeleton$mineSkeleto;
1511
+
1512
+ return (_skeleton$mineSkeleto = skeleton.mineSkeleton) != null ? _skeleton$mineSkeleto : React__default.createElement(_.Skeleton, {
1513
+ width: props.fullWidth ? 'auto' : '200px',
1514
+ sx: {
1515
+ padding: props.noMargin ? '0' : '0.868rem'
1516
+ },
1517
+ variant: "rectangular",
1518
+ animation: "wave"
1519
+ });
1520
+ }
1521
+
1507
1522
  return React__default.createElement(_.Box, {
1508
1523
  className: "text-simple-component",
1509
1524
  display: "flex",
1510
1525
  flexDirection: "column"
1511
- }, props.label && React__default.createElement(_.FormLabel, null, props.label), React__default.createElement(_.Box, {
1512
- display: "" + (props.startIcon || props.endIcon ? 'flex' : 'block'),
1526
+ }, props.skeletonLabel ? React__default.createElement(_.Skeleton, {
1527
+ width: "10%",
1528
+ animation: "wave"
1529
+ }) : props.label ? props.isFormLabel ? React__default.createElement(_.FormLabel, {
1530
+ className: "" + ((_props$classNameLabel = props.classNameLabel) != null ? _props$classNameLabel : '')
1531
+ }, props.label) : React__default.createElement(_.Box, {
1532
+ className: "" + ((_props$classNameLabel2 = props.classNameLabel) != null ? _props$classNameLabel2 : '')
1533
+ }, props.label) : React__default.createElement(React__default.Fragment, null), React__default.createElement(_.Box, {
1534
+ display: "" + (props.skeletonValue && props.skeletonValue.useSkeleton ? 'block' : props.startIcon || props.endIcon ? 'flex' : 'block'),
1513
1535
  alignItems: "center",
1514
- className: "text-simple-box " + (props.className ? props.className : '') + " " + (props.noMargin ? 'no-margin' : '') + " " + (props.noBorders ? 'no-border' : '') + " " + (props.error ? 'has-error-border' : ''),
1536
+ className: "text-simple-box " + ((_props$className = props.className) != null ? _props$className : '') + " " + (props.noMargin ? 'no-margin' : '') + " " + (props.noBorders || props.skeletonValue && props.skeletonValue.useSkeleton ? 'no-border' : '') + " " + (props.error ? 'has-error-border' : ''),
1515
1537
  width: "" + (props.fullWidth ? 'auto' : 'fit-content')
1516
- }, props.startIcon && React__default.createElement(_.Box, {
1538
+ }, props.skeletonValue && props.skeletonValue.useSkeleton ? React__default.createElement(SkeletonCompleteDefault, Object.assign({}, props.skeletonValue)) : React__default.createElement(React__default.Fragment, null, props.startIcon && React__default.createElement(_.Box, {
1517
1539
  mr: 1
1518
1540
  }, props.startIcon), props.isLoading ? React__default.createElement(_.CircularProgress, {
1519
1541
  className: "circular-progress-main-color",
1520
1542
  size: 20
1521
1543
  }) : props.value, props.endIcon && React__default.createElement(_.Box, {
1522
1544
  ml: "" + (props.fullWidth ? 'auto' : 1)
1523
- }, props.endIcon)), props.helperText && React__default.createElement(_.Box, {
1545
+ }, props.endIcon))), props.helperText && React__default.createElement(_.Box, {
1524
1546
  className: "helper-text " + (props.error ? 'has-error' : '')
1525
- }, props.helperText));
1547
+ }, props.skeletonValue && props.skeletonValue.useSkeleton ? React__default.createElement(_.Skeleton, {
1548
+ width: "15%",
1549
+ animation: "wave"
1550
+ }) : props.helperText));
1526
1551
  };
1527
1552
  TextSimpleComponent.defaultProps = {
1528
- noBorders: true
1553
+ noBorders: true,
1554
+ isFormLabel: true
1529
1555
  };
1530
1556
 
1531
1557
  var css_248z$f = ".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}";