techsbcn-storybook 0.14.6 → 0.14.7

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.
@@ -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;
@@ -1504,28 +1504,58 @@ 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
+
1522
+ var ChildrenValues = function ChildrenValues() {
1523
+ return React__default.createElement(React__default.Fragment, null, props.startIcon && React__default.createElement(_.Box, {
1524
+ mr: 1
1525
+ }, props.startIcon), props.isLoading ? React__default.createElement(_.CircularProgress, {
1526
+ className: "circular-progress-main-color",
1527
+ size: 20
1528
+ }) : props.value, props.endIcon && React__default.createElement(_.Box, {
1529
+ ml: "" + (props.fullWidth ? 'auto' : 1)
1530
+ }, props.endIcon));
1531
+ };
1532
+
1507
1533
  return React__default.createElement(_.Box, {
1508
1534
  className: "text-simple-component",
1509
1535
  display: "flex",
1510
1536
  flexDirection: "column"
1511
- }, props.label && React__default.createElement(_.FormLabel, null, props.label), React__default.createElement(_.Box, {
1512
- display: "" + (props.startIcon || props.endIcon ? 'flex' : 'block'),
1537
+ }, props.skeletonLabel ? React__default.createElement(_.Skeleton, {
1538
+ width: "10%",
1539
+ animation: "wave"
1540
+ }) : props.label ? props.isFormLabel ? React__default.createElement(_.FormLabel, {
1541
+ className: "" + ((_props$classNameLabel = props.classNameLabel) != null ? _props$classNameLabel : '')
1542
+ }, props.label) : React__default.createElement(_.Box, {
1543
+ className: "" + ((_props$classNameLabel2 = props.classNameLabel) != null ? _props$classNameLabel2 : '')
1544
+ }, props.label) : React__default.createElement(React__default.Fragment, null), React__default.createElement(_.Box, {
1545
+ display: "" + (props.skeletonValue && props.skeletonValue.useSkeleton ? 'block' : props.startIcon || props.endIcon ? 'flex' : 'block'),
1513
1546
  alignItems: "center",
1514
- className: "text-simple-box " + (props.className ? props.className : '') + " " + (props.noMargin ? 'no-margin' : '') + " " + (props.noBorders ? 'no-border' : '') + " " + (props.error ? 'has-error-border' : ''),
1547
+ 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
1548
  width: "" + (props.fullWidth ? 'auto' : 'fit-content')
1516
- }, props.startIcon && React__default.createElement(_.Box, {
1517
- mr: 1
1518
- }, props.startIcon), props.isLoading ? React__default.createElement(_.CircularProgress, {
1519
- className: "circular-progress-main-color",
1520
- size: 20
1521
- }) : props.value, props.endIcon && React__default.createElement(_.Box, {
1522
- ml: "" + (props.fullWidth ? 'auto' : 1)
1523
- }, props.endIcon)), props.helperText && React__default.createElement(_.Box, {
1549
+ }, props.skeletonValue && props.skeletonValue.useSkeleton ? React__default.createElement(SkeletonCompleteDefault, Object.assign({}, props.skeletonValue)) : React__default.createElement(ChildrenValues, null)), props.helperText && React__default.createElement(_.Box, {
1524
1550
  className: "helper-text " + (props.error ? 'has-error' : '')
1525
- }, props.helperText));
1551
+ }, props.skeletonValue && props.skeletonValue.useSkeleton ? React__default.createElement(_.Skeleton, {
1552
+ width: "15%",
1553
+ animation: "wave"
1554
+ }) : props.helperText));
1526
1555
  };
1527
1556
  TextSimpleComponent.defaultProps = {
1528
- noBorders: true
1557
+ noBorders: true,
1558
+ isFormLabel: true
1529
1559
  };
1530
1560
 
1531
1561
  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}";