@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.esm.js +16 -7
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +16 -7
- package/dist/index.js.map +1 -1
- package/dist/styles.css +4 -0
- package/package.json +2 -1
package/dist/index.esm.js
CHANGED
|
@@ -14157,8 +14157,7 @@ const Select = ({ options, value, placeholder = 'select', noOptionsMessage = 'no
|
|
|
14157
14157
|
},
|
|
14158
14158
|
placeholder: () => placeholderStyles,
|
|
14159
14159
|
container: ({ selectProps }) => {
|
|
14160
|
-
|
|
14161
|
-
return `${textStyles} ${extraClassNames} ${containerBorderStyles} tw:pointer-events-auto!`;
|
|
14160
|
+
return `${textStyles} ${extraClassNames} tw:pointer-events-auto!`;
|
|
14162
14161
|
},
|
|
14163
14162
|
input: () => textStyles + ' specSelectInput',
|
|
14164
14163
|
menuList: () => menuListStyles,
|
|
@@ -16787,20 +16786,30 @@ const borderColorClasses = [
|
|
|
16787
16786
|
'tw:focus:border-sq-theme-dark',
|
|
16788
16787
|
'tw:active:border-sq-theme-dark',
|
|
16789
16788
|
].join(' ');
|
|
16790
|
-
const
|
|
16791
|
-
const fieldClasses = 'tw:leading-normal tw:outline-none tw:py-1 tw:px-3' + 'tw:p-1 tw:border-solid tw:border';
|
|
16789
|
+
const fieldClasses = 'tw:leading-normal tw:outline-none tw:py-1 tw:px-3 tw:p-1 tw:border-solid tw:border';
|
|
16792
16790
|
const darkTheme = 'tw:dark:bg-sq-dark-background tw:dark:text-sq-dark-text tw:disabled:dark:text-sq-disabled-gray';
|
|
16793
16791
|
const lightTheme = 'tw:text-sq-text-color tw:disabled:text-sq-darkish-gray';
|
|
16794
16792
|
/**
|
|
16795
16793
|
* InputGroup.
|
|
16796
16794
|
*/
|
|
16797
16795
|
const InputGroup = React__default.forwardRef((props, ref) => {
|
|
16798
|
-
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;
|
|
16796
|
+
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;
|
|
16799
16797
|
const tooltipData = getQTipData(tooltipProps);
|
|
16800
16798
|
const appliedClasses = `${baseClasses$1} ${extraClassNames}`;
|
|
16801
|
-
const fieldAppliedClasses = `${fieldClasses} ${extraClassNames} ${lightTheme} ${darkTheme} ${fieldBorderRadius} ${showError ? errorClasses : borderColorClasses} `;
|
|
16802
16799
|
const elementsToAppend = append.filter(Boolean);
|
|
16803
|
-
|
|
16800
|
+
const effectiveInputGroup = inputGroup ?? (elementsToAppend.length > 0 ? 'left' : undefined);
|
|
16801
|
+
const fieldBorderRadius = effectiveInputGroup === 'left'
|
|
16802
|
+
? 'tw:rounded-l-md tw:rounded-r-none'
|
|
16803
|
+
: effectiveInputGroup === 'right'
|
|
16804
|
+
? 'tw:rounded-r-md tw:rounded-l-none'
|
|
16805
|
+
: 'tw:rounded-md';
|
|
16806
|
+
const fieldAppliedClasses = `${fieldClasses} ${extraClassNames} ${lightTheme} ${darkTheme} ${fieldBorderRadius} ${showError ? errorClasses : borderColorClasses} `;
|
|
16807
|
+
// Only pass inputGroup to React components (not DOM elements like div, span, etc.)
|
|
16808
|
+
const isReactComponent = React__default.isValidElement(field) && typeof field.type !== 'string';
|
|
16809
|
+
const fieldWithInputGroup = isReactComponent
|
|
16810
|
+
? React__default.cloneElement(field, { inputGroup: effectiveInputGroup })
|
|
16811
|
+
: field;
|
|
16812
|
+
return (jsxs("div", { id: `input-group-${id}`, className: appliedClasses, children: [field ? (jsx$1("div", { "data-testid": testId, className: `tw:flex tw:flex-1 tw:cursor-pointer tw:active:z-50 ${fieldAppliedClasses}`, children: fieldWithInputGroup })) : (jsx$1(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) => {
|
|
16804
16813
|
return item?.variant === 'button' ? (jsx$1(Button, { extraClassNames: `$
|
|
16805
16814
|
index ? 'tw:-ml-px' : 'tw:ml-0'
|
|
16806
16815
|
} tw:focus:z-40 tw:focus:border tw:rounded-none tw:last:rounded-r-md`, ...item.buttonProps }, index)) : (jsx$1("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));
|