@seeqdev/qomponents 0.0.94 → 0.0.96

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/index.js CHANGED
@@ -4695,11 +4695,11 @@ const borderColorClasses$2 = [
4695
4695
  'active:tw-border-sq-color-dark',
4696
4696
  ].join(' ');
4697
4697
  const baseClasses$3 = 'tw-h-inputs tw-leading-normal tw-outline-none tw-py-1 tw-px-3' +
4698
- ' disabled:tw-pointer-events-none' +
4698
+ ' disabled:tw-pointer-events-none disabled:tw-bg-sq-light-gray disabled:dark:tw-bg-sq-dark-disabled-gray' +
4699
4699
  ' disabled:tw-cursor-not-allowed tw-p-1 tw-border-solid tw-border tw-placeholder-gray-400' +
4700
4700
  ' dark:tw-placeholder-sq-dark-text-lighter specTextField';
4701
- const darkTheme$1 = 'dark:tw-bg-sq-dark-background dark:tw-text-sq-dark-text';
4702
- const lightTheme$1 = 'tw-text-sq-text-color';
4701
+ const darkTheme$1 = 'dark:tw-bg-sq-dark-background dark:tw-text-sq-dark-text disabled:dark:tw-text-sq-dark-text-lighter';
4702
+ const lightTheme$1 = 'tw-text-sq-text-color disabled:tw-text-sq-darkish-gray';
4703
4703
  const sizeClasses = {
4704
4704
  sm: 'tw-text-sm',
4705
4705
  lg: 'tw-text-xl',
@@ -4708,7 +4708,7 @@ const sizeClasses = {
4708
4708
  * Textfield.
4709
4709
  */
4710
4710
  const TextField = React.forwardRef((props, ref) => {
4711
- const { readonly = false, onChange, onKeyUp, onFocus, onBlur, onKeyDown, id, name, size = 'sm', value, placeholder, extraClassNames, testId, type = 'text', inputGroup, step, showError, errorText, required = false, autoComplete = 'off', inputWidth = undefined, inputHeight = undefined, } = props;
4711
+ const { readonly = false, disabled = false, onChange, onKeyUp, onFocus, onBlur, onKeyDown, id, name, size = 'sm', value, placeholder, extraClassNames, testId, type = 'text', inputGroup, step, showError, errorText, maxLength, minLength, required = false, autoComplete = 'off', inputWidth = undefined, inputHeight = undefined, autoFocus = false, } = props;
4712
4712
  const internalRef = React.useRef(null);
4713
4713
  const [cursor, setCursor] = React.useState(null);
4714
4714
  const setAllRefs = (receivedRef) => {
@@ -4718,7 +4718,7 @@ const TextField = React.forwardRef((props, ref) => {
4718
4718
  };
4719
4719
  React.useEffect(() => {
4720
4720
  const input = internalRef.current;
4721
- if (input && type !== 'number')
4721
+ if (input && type !== 'number' && type !== 'email')
4722
4722
  input.setSelectionRange(cursor, cursor);
4723
4723
  }, [ref, cursor, value]);
4724
4724
  const handleChange = (e) => {
@@ -4744,13 +4744,18 @@ const TextField = React.forwardRef((props, ref) => {
4744
4744
  borderRadius = 'tw-rounded-r-sm tw-border-l-0 focus:tw-border-l active:tw-border-l';
4745
4745
  }
4746
4746
  const appliedClasses = `${baseClasses$3} ${sizeClasses[size]} ${extraClassNames} ${lightTheme$1} ${darkTheme$1} ${borderRadius} ${showError ? errorClasses$2 : borderColorClasses$2} `;
4747
- const styleProp = setValidInputDimension(inputWidth, inputHeight)
4747
+ const inputProp = setValidInputDimension(inputWidth, inputHeight)
4748
4748
  ? {
4749
4749
  style: setValidInputDimension(inputWidth, inputHeight),
4750
4750
  }
4751
4751
  : {};
4752
+ const inputLenghtProp = {};
4753
+ if (maxLength)
4754
+ inputLenghtProp.maxLength = maxLength;
4755
+ if (minLength)
4756
+ inputLenghtProp.minLength = minLength;
4752
4757
  return (React.createElement(React.Fragment, null,
4753
- React.createElement("input", { ref: setAllRefs, "data-testid": testId, name: name, id: id, type: type, value: value, className: appliedClasses, placeholder: placeholder, disabled: readonly, autoComplete: autoComplete, onChange: handleChange, onFocus: onFocus, onBlur: onBlur, onKeyDown: onKeyDown, onKeyUp: onKeyUp, step: step, required: required, ...styleProp }),
4758
+ React.createElement("input", { ref: setAllRefs, "data-testid": testId, name: name, id: id, type: type, value: value, className: appliedClasses, placeholder: placeholder, disabled: disabled, readOnly: readonly, autoComplete: autoComplete, onChange: handleChange, onFocus: onFocus, onBlur: onBlur, onKeyDown: onKeyDown, onKeyUp: onKeyUp, step: step, required: required, autoFocus: autoFocus, ...inputLenghtProp, ...inputProp }),
4754
4759
  errorText && showError && React.createElement("div", { className: "tw-text-sq-danger-color tw-text-xs tw-mt-1" }, errorText)));
4755
4760
  });
4756
4761
 
@@ -4778,9 +4783,11 @@ const Checkbox = (props) => {
4778
4783
  };
4779
4784
 
4780
4785
  const baseClasses$1 = 'tw-leading-normal tw-outline-none tw-py-1 tw-px-3 tw-rounded-sm' +
4786
+ ' disabled:tw-pointer-events-none disabled:tw-bg-sq-light-gray disabled:dark:tw-bg-sq-dark-disabled-gray' +
4781
4787
  ' disabled:tw-cursor-not-allowed tw-p-1 tw-border-solid tw-border tw-text-sm';
4782
- const darkTheme = 'dark:tw-bg-sq-dark-background dark:tw-text-sq-dark-text ' + 'dark:tw-placeholder-sq-dark-text-lighter';
4783
- const lightTheme = 'tw-text-sq-text-color tw-placeholder-gray-400';
4788
+ const darkTheme = 'dark:tw-bg-sq-dark-background dark:tw-text-sq-dark-text ' +
4789
+ 'dark:tw-placeholder-sq-dark-text-lighter disabled:dark:tw-text-sq-dark-text-lighter';
4790
+ const lightTheme = 'tw-text-sq-text-color tw-placeholder-gray-400 disabled:tw-text-sq-darkish-gray';
4784
4791
  const errorClasses$1 = 'tw-border-sq-danger-color';
4785
4792
  const borderColorClasses$1 = [
4786
4793
  'tw-border-sq-disabled-gray',
@@ -4793,9 +4800,9 @@ const borderColorClasses$1 = [
4793
4800
  /**
4794
4801
  * TextArea.
4795
4802
  */
4796
- const TextArea = ({ readonly = false, onChange, onKeyUp, id, name, rows = 3, cols = undefined, value, placeholder, extraClassNames, testId, autofocus = false, showError, }) => {
4803
+ const TextArea = ({ readonly = false, disabled = false, onChange, onKeyUp, onFocus, onBlur, onKeyDown, id, name, rows = 3, cols = undefined, value, placeholder, showError, extraClassNames, testId, autoFocus = false, }) => {
4797
4804
  const appliedClasses = `${baseClasses$1} ${extraClassNames} ${lightTheme} ${darkTheme} ${showError ? errorClasses$1 : borderColorClasses$1}`;
4798
- return (React.createElement("textarea", { "data-testid": testId, name: name, id: id, value: value, className: appliedClasses, placeholder: placeholder, disabled: readonly, onChange: onChange, onKeyUp: onKeyUp, rows: rows, cols: cols, autoFocus: autofocus }));
4805
+ return (React.createElement("textarea", { "data-testid": testId, name: name, id: id, value: value, className: appliedClasses, placeholder: placeholder, disabled: disabled, readOnly: readonly, onChange: onChange, onFocus: onFocus, onBlur: onBlur, onKeyDown: onKeyDown, onKeyUp: onKeyUp, rows: rows, cols: cols, autoFocus: autoFocus }));
4799
4806
  };
4800
4807
 
4801
4808
  /**