@seeqdev/qomponents 0.0.193 → 0.0.194

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
@@ -14177,8 +14177,7 @@ const Select = ({ options, value, placeholder = 'select', noOptionsMessage = 'no
14177
14177
  },
14178
14178
  placeholder: () => placeholderStyles,
14179
14179
  container: ({ selectProps }) => {
14180
- const containerBorderStyles = selectProps?.menuIsOpen ? 'tw:rounded-t-md' : 'tw:rounded-md';
14181
- return `${textStyles} ${extraClassNames} ${containerBorderStyles} tw:pointer-events-auto!`;
14180
+ return `${textStyles} ${extraClassNames} tw:pointer-events-auto!`;
14182
14181
  },
14183
14182
  input: () => textStyles + ' specSelectInput',
14184
14183
  menuList: () => menuListStyles,
@@ -16807,20 +16806,30 @@ const borderColorClasses = [
16807
16806
  'tw:focus:border-sq-theme-dark',
16808
16807
  'tw:active:border-sq-theme-dark',
16809
16808
  ].join(' ');
16810
- const fieldBorderRadius = 'tw:rounded-l-md tw:rounded-r-none';
16811
- const fieldClasses = 'tw:leading-normal tw:outline-none tw:py-1 tw:px-3' + 'tw:p-1 tw:border-solid tw:border';
16809
+ const fieldClasses = 'tw:leading-normal tw:outline-none tw:py-1 tw:px-3 tw:p-1 tw:border-solid tw:border';
16812
16810
  const darkTheme = 'tw:dark:bg-sq-dark-background tw:dark:text-sq-dark-text tw:disabled:dark:text-sq-disabled-gray';
16813
16811
  const lightTheme = 'tw:text-sq-text-color tw:disabled:text-sq-darkish-gray';
16814
16812
  /**
16815
16813
  * InputGroup.
16816
16814
  */
16817
16815
  const InputGroup = React.forwardRef((props, ref) => {
16818
- const { readonly = false, onChange, onKeyUp, onFocus, onBlur, onKeyDown, name, value, placeholder, append = [], extraClassNames = '', id, testId, showError, required, autoComplete, autoFocus, disabled, type, step, min, max, field, maxLength, minLength, ...tooltipProps } = props;
16816
+ const { readonly = false, onChange, onKeyUp, onFocus, onBlur, onKeyDown, name, value, placeholder, append = [], extraClassNames = '', id, testId, showError, required, autoComplete, autoFocus, disabled, type, step, min, max, field, maxLength, minLength, inputGroup, ...tooltipProps } = props;
16819
16817
  const tooltipData = getQTipData(tooltipProps);
16820
16818
  const appliedClasses = `${baseClasses$1} ${extraClassNames}`;
16821
- const fieldAppliedClasses = `${fieldClasses} ${extraClassNames} ${lightTheme} ${darkTheme} ${fieldBorderRadius} ${showError ? errorClasses : borderColorClasses} `;
16822
16819
  const elementsToAppend = append.filter(Boolean);
16823
- return (jsxRuntime.jsxs("div", { id: `input-group-${id}`, className: appliedClasses, children: [field ? (jsxRuntime.jsx("div", { "data-testid": testId, className: `tw:flex tw:flex-1 tw:cursor-pointer tw:active:z-50 ${fieldAppliedClasses}`, children: field })) : (jsxRuntime.jsx(TextField, { testId: testId, readonly: readonly, onChange: onChange, onKeyUp: onKeyUp, onFocus: onFocus, onBlur: onBlur, onKeyDown: onKeyDown, name: name, ref: ref, showError: showError, value: value, required: required, placeholder: placeholder, autoComplete: autoComplete, autoFocus: autoFocus, id: id, type: type, disabled: disabled, step: step, min: min, max: max, maxLength: maxLength, minLength: minLength, extraClassNames: `tw:flex tw:flex-1 tw:w-full tw:focus:z-30 tw:rounded-r-none tw:last:rounded-r-md ${extraClassNames}`, ...tooltipData })), elementsToAppend.map((item, index) => {
16820
+ const effectiveInputGroup = inputGroup ?? (elementsToAppend.length > 0 ? 'left' : undefined);
16821
+ const fieldBorderRadius = effectiveInputGroup === 'left'
16822
+ ? 'tw:rounded-l-md tw:rounded-r-none'
16823
+ : effectiveInputGroup === 'right'
16824
+ ? 'tw:rounded-r-md tw:rounded-l-none'
16825
+ : 'tw:rounded-md';
16826
+ const fieldAppliedClasses = `${fieldClasses} ${extraClassNames} ${lightTheme} ${darkTheme} ${fieldBorderRadius} ${showError ? errorClasses : borderColorClasses} `;
16827
+ // Only pass inputGroup to React components (not DOM elements like div, span, etc.)
16828
+ const isReactComponent = React.isValidElement(field) && typeof field.type !== 'string';
16829
+ const fieldWithInputGroup = isReactComponent
16830
+ ? React.cloneElement(field, { inputGroup: effectiveInputGroup })
16831
+ : field;
16832
+ return (jsxRuntime.jsxs("div", { id: `input-group-${id}`, className: appliedClasses, children: [field ? (jsxRuntime.jsx("div", { "data-testid": testId, className: `tw:flex tw:flex-1 tw:cursor-pointer tw:active:z-50 ${fieldAppliedClasses}`, children: fieldWithInputGroup })) : (jsxRuntime.jsx(TextField, { testId: testId, readonly: readonly, onChange: onChange, onKeyUp: onKeyUp, onFocus: onFocus, onBlur: onBlur, onKeyDown: onKeyDown, name: name, ref: ref, showError: showError, value: value, required: required, placeholder: placeholder, autoComplete: autoComplete, autoFocus: autoFocus, id: id, type: type, disabled: disabled, step: step, min: min, max: max, maxLength: maxLength, minLength: minLength, inputGroup: effectiveInputGroup, extraClassNames: `tw:flex tw:flex-1 tw:w-full tw:focus:z-30 ${extraClassNames}`, ...tooltipData })), elementsToAppend.map((item, index) => {
16824
16833
  return item?.variant === 'button' ? (jsxRuntime.jsx(Button, { extraClassNames: `$
16825
16834
  index ? 'tw:-ml-px' : 'tw:ml-0'
16826
16835
  } tw:focus:z-40 tw:focus:border tw:rounded-none tw:last:rounded-r-md`, ...item.buttonProps }, index)) : (jsxRuntime.jsx("div", { className: `${borderColorClasses} ${index ? 'tw:-ml-px' : 'tw:ml-0'} tw:flex tw:items-center tw:justify-center tw:rounded-none tw:last:rounded-r-md tw:active:z-30 tw:active:border tw:border`, children: item?.element }, index));