@seeqdev/qomponents 0.0.106 → 0.0.107

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
@@ -120,7 +120,7 @@ const Icon = ({ onClick, icon, iconPrefix = undefined, type = 'theme', extraClas
120
120
  * - include tooltips and/or icons
121
121
  */
122
122
  const Button = ({ onClick, label, variant = 'outline', type = 'button', size = 'sm', disabled, extraClassNames, id, testId, stopPropagation = true, tooltip, tooltipOptions, iconStyle = 'text', icon, iconColor, iconPosition = 'left', iconPrefix = undefined, preventBlur = false, isHtmlTooltip = false, tooltipTestId, }) => {
123
- const baseClasses = 'tw-py-1 tw-px-2.5 tw-rounded-sm focus:tw-ring-0 disabled:tw-pointer-events-none';
123
+ const baseClasses = 'tw-py-1 tw-px-2.5 tw-rounded-sm focus:tw-ring-0 focus-visible:tw-outline-none disabled:tw-pointer-events-none';
124
124
  const baseClassesByVariant = {
125
125
  'outline': 'disabled:tw-opacity-50 tw-border-solid tw-border',
126
126
  'theme': 'disabled:tw-opacity-50 tw-border-solid tw-border',
@@ -183,8 +183,10 @@ const Button = ({ onClick, label, variant = 'outline', type = 'button', size = '
183
183
  'data-qtip-delay': tooltipOptions?.delay ?? DEFAULT_TOOL_TIP_DELAY,
184
184
  };
185
185
  }
186
- const iconClass = (iconPosition === 'left' ? 'tw-mr-1' : 'tw-ml-1');
187
- const iconElement = icon && (React.createElement(Icon, { icon: icon, iconPrefix: iconPrefix, type: iconStyle, color: iconColor, extraClassNames: label ? `${iconClass} ${textClassesByVariantLightTheme[variant]} ${textClassesByVariantDarkTheme[variant]}` : '', testId: `${id}_spinner` }));
186
+ const iconClass = iconPosition === 'left' ? 'tw-mr-1' : 'tw-ml-1';
187
+ const iconElement = icon && (React.createElement(Icon, { icon: icon, iconPrefix: iconPrefix, type: iconStyle, color: iconColor, extraClassNames: label
188
+ ? `${iconClass} ${textClassesByVariantLightTheme[variant]} ${textClassesByVariantDarkTheme[variant]}`
189
+ : '', testId: `${id}_spinner` }));
188
190
  return (React.createElement("button", { id: id, ...tooltipData, disabled: disabled, "data-testid": testId, type: type === 'link' || (type === 'submit' && browserIsFirefox) ? 'button' : type, onClick: (e) => {
189
191
  stopPropagation && e.stopPropagation();
190
192
  onClick && onClick(e);
@@ -4694,7 +4696,7 @@ const borderColorClasses$3 = [
4694
4696
  'focus:tw-border-sq-color-dark',
4695
4697
  'active:tw-border-sq-color-dark',
4696
4698
  ].join(' ');
4697
- const baseClasses$4 = 'tw-h-inputs tw-leading-normal tw-outline-none tw-py-1 tw-px-3' +
4699
+ const baseClasses$5 = 'tw-h-inputs tw-leading-normal tw-outline-none tw-py-1 tw-px-3' +
4698
4700
  ' disabled:tw-pointer-events-none disabled:tw-bg-sq-light-gray disabled:dark:tw-bg-sq-dark-disabled-gray' +
4699
4701
  ' disabled:tw-cursor-not-allowed tw-p-1 tw-border-solid tw-border tw-placeholder-gray-400' +
4700
4702
  ' dark:tw-placeholder-sq-dark-text-lighter specTextField';
@@ -4708,9 +4710,10 @@ const sizeClasses = {
4708
4710
  * Textfield.
4709
4711
  */
4710
4712
  const TextField = React.forwardRef((props, ref) => {
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, min, max, maxLength, minLength, required = false, autoComplete = 'off', inputWidth = undefined, inputHeight = undefined, autoFocus = false, } = props;
4713
+ const { readonly = false, disabled = false, onChange, onKeyUp, onFocus, onBlur, onKeyDown, id, name, size = 'sm', value, placeholder, extraClassNames, testId, type = 'text', inputGroup, step, showError, errorText, min, max, maxLength, minLength, required = false, autoComplete = 'off', inputWidth = undefined, inputHeight = undefined, autoFocus = false, ...tooltipProps } = props;
4712
4714
  const internalRef = React.useRef(null);
4713
4715
  const [cursor, setCursor] = React.useState(null);
4716
+ const tooltipData = getQTipData(tooltipProps);
4714
4717
  const setAllRefs = (receivedRef) => {
4715
4718
  if (ref)
4716
4719
  ref.current = receivedRef;
@@ -4743,7 +4746,7 @@ const TextField = React.forwardRef((props, ref) => {
4743
4746
  else if (inputGroup === 'right') {
4744
4747
  borderRadius = 'tw-rounded-r-sm tw-border-l-0 focus:tw-border-l active:tw-border-l';
4745
4748
  }
4746
- const appliedClasses = `${baseClasses$4} ${sizeClasses[size]} ${extraClassNames} ${lightTheme$2} ${darkTheme$2} ${borderRadius} ${showError ? errorClasses$3 : borderColorClasses$3} `;
4749
+ const appliedClasses = `${baseClasses$5} ${sizeClasses[size]} ${extraClassNames} ${lightTheme$2} ${darkTheme$2} ${borderRadius} ${showError ? errorClasses$3 : borderColorClasses$3} `;
4747
4750
  const inputProp = setValidInputDimension(inputWidth, inputHeight)
4748
4751
  ? {
4749
4752
  style: setValidInputDimension(inputWidth, inputHeight),
@@ -4755,19 +4758,19 @@ const TextField = React.forwardRef((props, ref) => {
4755
4758
  if (minLength)
4756
4759
  inputLenghtProp.minLength = minLength;
4757
4760
  return (React.createElement(React.Fragment, null,
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, min: min, max: max, ...inputLenghtProp, ...inputProp }),
4761
+ 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, min: min, max: max, ...inputLenghtProp, ...inputProp, ...tooltipData }),
4759
4762
  errorText && showError && React.createElement("div", { className: "tw-text-sq-danger-color tw-text-xs tw-mt-1" }, errorText)));
4760
4763
  });
4761
4764
 
4762
4765
  const alignment = 'tw-flex';
4763
4766
  const labelClasses = 'tw-ml-1.5 tw-text-sm tw--mt-0.5';
4764
- const baseClasses$3 = 'tw-border-1 tw-h-3.5 tw-w-3.5 focus:tw-ring-0 focus:tw-ring-offset-0 tw-outline-none focus:tw-outline-none' +
4767
+ const baseClasses$4 = 'tw-border-1 tw-h-3.5 tw-w-3.5 focus:tw-ring-0 focus:tw-ring-offset-0 tw-outline-none focus:tw-outline-none' +
4765
4768
  ' dark:tw-bg-sq-dark-background dark:tw-border-sq-dark-text dark:hover:tw-bg-sq-dark-background' +
4766
4769
  ' checked:tw-text-white checked:tw-border-sq-text-color checked:hover:tw-border-sq-color-dark' +
4767
4770
  ' checked:active:tw-border-sq-color-dark checked:focus:tw-border-sq-color-dark disabled:tw-border-sq-disabled-gray' +
4768
4771
  ' dark:disabled:tw-border-sq-fairly-dark-gray dark:checked:focus:tw-bg-sq-dark-background';
4769
- const checkboxClasses = `tw-form-checkbox tw-rounded ${baseClasses$3}`;
4770
- const radioClasses = `tw-form-radio ${baseClasses$3}`;
4772
+ const checkboxClasses = `tw-form-checkbox tw-rounded ${baseClasses$4}`;
4773
+ const radioClasses = `tw-form-radio ${baseClasses$4}`;
4771
4774
  /**
4772
4775
  * Checkbox and Radio Box Component.
4773
4776
  */
@@ -4782,7 +4785,7 @@ const Checkbox = (props) => {
4782
4785
  : 'tw-cursor-pointer tw-text-sq-text-color dark:tw-text-sq-dark-text'}` }, label)));
4783
4786
  };
4784
4787
 
4785
- const baseClasses$2 = 'tw-leading-normal tw-outline-none tw-py-1 tw-px-3 tw-rounded-sm tw-w-full' +
4788
+ const baseClasses$3 = 'tw-leading-normal tw-outline-none tw-py-1 tw-px-3 tw-rounded-sm tw-w-full' +
4786
4789
  ' disabled:tw-pointer-events-none disabled:tw-bg-sq-light-gray disabled:dark:tw-bg-sq-dark-disabled-gray' +
4787
4790
  ' disabled:tw-cursor-not-allowed tw-p-1 tw-border-solid tw-border tw-text-sm';
4788
4791
  const darkTheme$1 = 'dark:tw-bg-sq-dark-background dark:tw-text-sq-dark-text ' +
@@ -4801,7 +4804,7 @@ const borderColorClasses$2 = [
4801
4804
  * TextArea.
4802
4805
  */
4803
4806
  const TextArea = ({ readonly = false, disabled = false, onChange, onKeyUp, onFocus, onBlur, onKeyDown, id, name, rows = 3, cols = undefined, value, placeholder, showError, extraClassNames, testId, autoFocus = false, }) => {
4804
- const appliedClasses = `${baseClasses$2} ${extraClassNames} ${lightTheme$1} ${darkTheme$1} ${showError ? errorClasses$2 : borderColorClasses$2}`;
4807
+ const appliedClasses = `${baseClasses$3} ${extraClassNames} ${lightTheme$1} ${darkTheme$1} ${showError ? errorClasses$2 : borderColorClasses$2}`;
4805
4808
  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 }));
4806
4809
  };
4807
4810
 
@@ -13678,7 +13681,7 @@ var CreatableSelect = /*#__PURE__*/React.forwardRef(function (props, ref) {
13678
13681
  });
13679
13682
  var CreatableSelect$1 = CreatableSelect;
13680
13683
 
13681
- const baseClasses$1 = ['focus:tw-ring-0', 'disabled:tw-cursor-not-allowed'].join(' ');
13684
+ const baseClasses$2 = ['focus:tw-ring-0', 'disabled:tw-cursor-not-allowed'].join(' ');
13682
13685
  const containerStyles = ['tw-bg-white', 'dark:tw-bg-sq-dark-background'].join(' ');
13683
13686
  const errorClasses$1 = 'tw-border-sq-danger-color';
13684
13687
  const borderColorClasses$1 = ['tw-border-sq-disabled-gray', 'dark:tw-border-sq-dark-disabled-gray'].join(' ');
@@ -13820,7 +13823,7 @@ const Select = ({ options, value, placeholder = 'select', noOptionsMessage = 'no
13820
13823
  border = menuIsOpen ? 'tw-rounded-tr-sm' : 'tw-rounded-r-sm';
13821
13824
  }
13822
13825
  const appliedClasses = `${borderStyles$3} ${border} ${showError ? errorClasses$1 : borderColorClasses$1} ${small ? 'reactSelectMinHeightSmall' : 'reactSelectMinHeight'} `;
13823
- return `${appliedClasses} ${baseClasses$1} specSelectControl ${isDisabled ? disabledClasses$3 : ''} ${small ? 'tw-pl-2 tw-pr-1' : 'tw-pl-2.5 tw-pr-1.5'}`;
13826
+ return `${appliedClasses} ${baseClasses$2} specSelectControl ${isDisabled ? disabledClasses$3 : ''} ${small ? 'tw-pl-2 tw-pr-1' : 'tw-pl-2.5 tw-pr-1.5'}`;
13824
13827
  },
13825
13828
  placeholder: () => placeholderStyles,
13826
13829
  container: () => `${textStyles} ${containerStyles} ${extraClassNames}`,
@@ -16190,7 +16193,7 @@ const ButtonWithDropdown = ({ dropdownItems, triggerIcon, id, extraClassNames, c
16190
16193
  }))))));
16191
16194
  };
16192
16195
 
16193
- const baseClasses = 'tw-mx-auto tw-p-4 tw-leading-normal tw-outline-none tw-py-2 tw-px-3 tw-rounded-sm tw-w-full' +
16196
+ const baseClasses$1 = 'tw-mx-auto tw-p-4 tw-leading-normal tw-outline-none tw-py-2 tw-px-3 tw-rounded-sm tw-w-full' +
16194
16197
  ' tw-border-solid tw-border tw-text-sm tw-flex tw-flex-col tw-justify-center tw-items-center';
16195
16198
  const darkTheme = 'dark:tw-bg-sq-colored-hover-dark dark:tw-text-sq-dark-text';
16196
16199
  const lightTheme = 'tw-text-sq-text-color tw-bg-sq-colored-hover';
@@ -16210,7 +16213,7 @@ const Alert = ({ children, dismissible = true, onClose, show = true, variant, te
16210
16213
  danger: errorClasses,
16211
16214
  warning: 'tw-border-none',
16212
16215
  };
16213
- const appliedClasses = `${baseClasses} ${appliedTheme[variant]} ${extraClassNames} ${appliedBorderTheme[variant]}`;
16216
+ const appliedClasses = `${baseClasses$1} ${appliedTheme[variant]} ${extraClassNames} ${appliedBorderTheme[variant]}`;
16214
16217
  if (!show) {
16215
16218
  return React.createElement("div", null);
16216
16219
  }
@@ -16283,6 +16286,27 @@ const SeeqActionDropdown = ({ seeqActionDropdownItems, trigger, id, extraClassNa
16283
16286
  })))));
16284
16287
  };
16285
16288
 
16289
+ const baseClasses = 'tw-flex tw-outline-none tw-rounded-sm tw-w-full tw-relative tw-flex-wrap tw-items-stretch';
16290
+ /**
16291
+ * InputGroup.
16292
+ */
16293
+ const InputGroup = ({ readonly = false, onChange, onKeyUp, onFocus, onBlur, onKeyDown, onClick, name, value, placeholder, append = [], extraClassNames = '', id, testId, showError, required, autoComplete, autoFocus, disabled, type, step, min, max, ...tooltipProps }) => {
16294
+ const tooltipData = getQTipData(tooltipProps);
16295
+ const appliedClasses = `${baseClasses} ${extraClassNames}`;
16296
+ const borderColorClasses = [
16297
+ 'tw-border-sq-disabled-gray',
16298
+ 'dark:tw-border-sq-dark-disabled-gray',
16299
+ 'dark:focus:tw-border-sq-color-dark-dark',
16300
+ 'dark:active:tw-border-sq-color-dark-dark',
16301
+ 'focus:tw-border-sq-color-dark',
16302
+ 'active:tw-border-sq-color-dark',
16303
+ ].join(' ');
16304
+ const textfield = (React.createElement(TextField, { readonly: onClick ? true : readonly, onChange: onChange, onKeyUp: onKeyUp, onFocus: onFocus, onBlur: onBlur, onKeyDown: onKeyDown, name: name, showError: showError, value: value, required: required, placeholder: placeholder, autoComplete: autoComplete, autoFocus: autoFocus, id: id, type: type, disabled: disabled, step: step, min: min, max: max, extraClassNames: `tw-flex tw-flex-1 tw-rounded-r-none focus:tw-z-30 ${onClick ? 'tw-cursor-pointer' : ''} ${extraClassNames}`, ...tooltipData }));
16305
+ return (React.createElement("div", { id: id, "data-testid": testId, className: appliedClasses },
16306
+ onClick ? (React.createElement("div", { onClick: onClick, className: "tw-flex tw-flex-1 tw-cursor-pointer" }, textfield)) : (textfield),
16307
+ append.filter(Boolean).map((item, index) => item.variant === 'button' ? (React.createElement(Button, { key: index, extraClassNames: "tw-ml-[-1px] focus:tw-z-40 focus:tw-border tw-rounded-l-none tw-rounded-r-none last:tw-rounded-r-sm", onClick: item.buttonProps.onClick, variant: item.buttonProps.variant, icon: item.buttonProps.icon, iconColor: item.buttonProps.iconColor, testId: item.buttonProps.testId, disabled: item.buttonProps.disabled, label: item.buttonProps.label, iconStyle: item.buttonProps.iconStyle })) : (React.createElement("div", { key: index, className: `${borderColorClasses} tw-flex tw-items-center tw-h-inputs tw-justify-center tw-rounded-none tw-ml-[-1px] focus:tw-z-40 focus:tw-border last:tw-border last:tw-rounded-r-sm` }, item.element)))));
16308
+ };
16309
+
16286
16310
  exports.Accordion = Accordion;
16287
16311
  exports.Alert = Alert;
16288
16312
  exports.Button = Button;
@@ -16290,6 +16314,7 @@ exports.ButtonWithDropdown = ButtonWithDropdown;
16290
16314
  exports.ButtonWithPopover = ButtonWithPopover;
16291
16315
  exports.Checkbox = Checkbox;
16292
16316
  exports.Icon = Icon;
16317
+ exports.InputGroup = InputGroup;
16293
16318
  exports.Modal = Modal;
16294
16319
  exports.QTip = QTip;
16295
16320
  exports.SeeqActionDropdown = SeeqActionDropdown;