@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/Button/Button.js +5 -3
- package/dist/Button/Button.js.map +1 -1
- package/dist/InputGroup/InputGroup.d.ts +7 -0
- package/dist/InputGroup/InputGroup.js +16 -17
- package/dist/InputGroup/InputGroup.js.map +1 -1
- package/dist/InputGroup/InputGroup.stories.d.ts +5 -0
- package/dist/InputGroup/InputGroup.stories.js +102 -26
- package/dist/InputGroup/InputGroup.stories.js.map +1 -1
- package/dist/InputGroup/InputGroup.test.d.ts +1 -1
- package/dist/InputGroup/InputGroup.test.js +12 -9
- package/dist/InputGroup/InputGroup.test.js.map +1 -1
- package/dist/InputGroup/InputGroup.types.d.ts +20 -0
- package/dist/InputGroup/index.d.ts +1 -0
- package/dist/TextField/TextField.js +4 -2
- package/dist/TextField/TextField.js.map +1 -1
- package/dist/TextField/TextField.stories.js +8 -2
- package/dist/TextField/TextField.stories.js.map +1 -1
- package/dist/TextField/TextField.types.d.ts +2 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.esm.js +41 -17
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +41 -16
- package/dist/index.js.map +1 -1
- package/dist/styles.css +43 -0
- package/package.json +1 -1
package/dist/index.esm.js
CHANGED
|
@@ -100,7 +100,7 @@ const Icon = ({ onClick, icon, iconPrefix = undefined, type = 'theme', extraClas
|
|
|
100
100
|
* - include tooltips and/or icons
|
|
101
101
|
*/
|
|
102
102
|
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, }) => {
|
|
103
|
-
const baseClasses = 'tw-py-1 tw-px-2.5 tw-rounded-sm focus:tw-ring-0 disabled:tw-pointer-events-none';
|
|
103
|
+
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';
|
|
104
104
|
const baseClassesByVariant = {
|
|
105
105
|
'outline': 'disabled:tw-opacity-50 tw-border-solid tw-border',
|
|
106
106
|
'theme': 'disabled:tw-opacity-50 tw-border-solid tw-border',
|
|
@@ -163,8 +163,10 @@ const Button = ({ onClick, label, variant = 'outline', type = 'button', size = '
|
|
|
163
163
|
'data-qtip-delay': tooltipOptions?.delay ?? DEFAULT_TOOL_TIP_DELAY,
|
|
164
164
|
};
|
|
165
165
|
}
|
|
166
|
-
const iconClass =
|
|
167
|
-
const iconElement = icon && (React__default.createElement(Icon, { icon: icon, iconPrefix: iconPrefix, type: iconStyle, color: iconColor, extraClassNames: label
|
|
166
|
+
const iconClass = iconPosition === 'left' ? 'tw-mr-1' : 'tw-ml-1';
|
|
167
|
+
const iconElement = icon && (React__default.createElement(Icon, { icon: icon, iconPrefix: iconPrefix, type: iconStyle, color: iconColor, extraClassNames: label
|
|
168
|
+
? `${iconClass} ${textClassesByVariantLightTheme[variant]} ${textClassesByVariantDarkTheme[variant]}`
|
|
169
|
+
: '', testId: `${id}_spinner` }));
|
|
168
170
|
return (React__default.createElement("button", { id: id, ...tooltipData, disabled: disabled, "data-testid": testId, type: type === 'link' || (type === 'submit' && browserIsFirefox) ? 'button' : type, onClick: (e) => {
|
|
169
171
|
stopPropagation && e.stopPropagation();
|
|
170
172
|
onClick && onClick(e);
|
|
@@ -4674,7 +4676,7 @@ const borderColorClasses$3 = [
|
|
|
4674
4676
|
'focus:tw-border-sq-color-dark',
|
|
4675
4677
|
'active:tw-border-sq-color-dark',
|
|
4676
4678
|
].join(' ');
|
|
4677
|
-
const baseClasses$
|
|
4679
|
+
const baseClasses$5 = 'tw-h-inputs tw-leading-normal tw-outline-none tw-py-1 tw-px-3' +
|
|
4678
4680
|
' disabled:tw-pointer-events-none disabled:tw-bg-sq-light-gray disabled:dark:tw-bg-sq-dark-disabled-gray' +
|
|
4679
4681
|
' disabled:tw-cursor-not-allowed tw-p-1 tw-border-solid tw-border tw-placeholder-gray-400' +
|
|
4680
4682
|
' dark:tw-placeholder-sq-dark-text-lighter specTextField';
|
|
@@ -4688,9 +4690,10 @@ const sizeClasses = {
|
|
|
4688
4690
|
* Textfield.
|
|
4689
4691
|
*/
|
|
4690
4692
|
const TextField = React__default.forwardRef((props, ref) => {
|
|
4691
|
-
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;
|
|
4693
|
+
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;
|
|
4692
4694
|
const internalRef = useRef(null);
|
|
4693
4695
|
const [cursor, setCursor] = useState(null);
|
|
4696
|
+
const tooltipData = getQTipData(tooltipProps);
|
|
4694
4697
|
const setAllRefs = (receivedRef) => {
|
|
4695
4698
|
if (ref)
|
|
4696
4699
|
ref.current = receivedRef;
|
|
@@ -4723,7 +4726,7 @@ const TextField = React__default.forwardRef((props, ref) => {
|
|
|
4723
4726
|
else if (inputGroup === 'right') {
|
|
4724
4727
|
borderRadius = 'tw-rounded-r-sm tw-border-l-0 focus:tw-border-l active:tw-border-l';
|
|
4725
4728
|
}
|
|
4726
|
-
const appliedClasses = `${baseClasses$
|
|
4729
|
+
const appliedClasses = `${baseClasses$5} ${sizeClasses[size]} ${extraClassNames} ${lightTheme$2} ${darkTheme$2} ${borderRadius} ${showError ? errorClasses$3 : borderColorClasses$3} `;
|
|
4727
4730
|
const inputProp = setValidInputDimension(inputWidth, inputHeight)
|
|
4728
4731
|
? {
|
|
4729
4732
|
style: setValidInputDimension(inputWidth, inputHeight),
|
|
@@ -4735,19 +4738,19 @@ const TextField = React__default.forwardRef((props, ref) => {
|
|
|
4735
4738
|
if (minLength)
|
|
4736
4739
|
inputLenghtProp.minLength = minLength;
|
|
4737
4740
|
return (React__default.createElement(React__default.Fragment, null,
|
|
4738
|
-
React__default.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 }),
|
|
4741
|
+
React__default.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 }),
|
|
4739
4742
|
errorText && showError && React__default.createElement("div", { className: "tw-text-sq-danger-color tw-text-xs tw-mt-1" }, errorText)));
|
|
4740
4743
|
});
|
|
4741
4744
|
|
|
4742
4745
|
const alignment = 'tw-flex';
|
|
4743
4746
|
const labelClasses = 'tw-ml-1.5 tw-text-sm tw--mt-0.5';
|
|
4744
|
-
const baseClasses$
|
|
4747
|
+
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' +
|
|
4745
4748
|
' dark:tw-bg-sq-dark-background dark:tw-border-sq-dark-text dark:hover:tw-bg-sq-dark-background' +
|
|
4746
4749
|
' checked:tw-text-white checked:tw-border-sq-text-color checked:hover:tw-border-sq-color-dark' +
|
|
4747
4750
|
' checked:active:tw-border-sq-color-dark checked:focus:tw-border-sq-color-dark disabled:tw-border-sq-disabled-gray' +
|
|
4748
4751
|
' dark:disabled:tw-border-sq-fairly-dark-gray dark:checked:focus:tw-bg-sq-dark-background';
|
|
4749
|
-
const checkboxClasses = `tw-form-checkbox tw-rounded ${baseClasses$
|
|
4750
|
-
const radioClasses = `tw-form-radio ${baseClasses$
|
|
4752
|
+
const checkboxClasses = `tw-form-checkbox tw-rounded ${baseClasses$4}`;
|
|
4753
|
+
const radioClasses = `tw-form-radio ${baseClasses$4}`;
|
|
4751
4754
|
/**
|
|
4752
4755
|
* Checkbox and Radio Box Component.
|
|
4753
4756
|
*/
|
|
@@ -4762,7 +4765,7 @@ const Checkbox = (props) => {
|
|
|
4762
4765
|
: 'tw-cursor-pointer tw-text-sq-text-color dark:tw-text-sq-dark-text'}` }, label)));
|
|
4763
4766
|
};
|
|
4764
4767
|
|
|
4765
|
-
const baseClasses$
|
|
4768
|
+
const baseClasses$3 = 'tw-leading-normal tw-outline-none tw-py-1 tw-px-3 tw-rounded-sm tw-w-full' +
|
|
4766
4769
|
' disabled:tw-pointer-events-none disabled:tw-bg-sq-light-gray disabled:dark:tw-bg-sq-dark-disabled-gray' +
|
|
4767
4770
|
' disabled:tw-cursor-not-allowed tw-p-1 tw-border-solid tw-border tw-text-sm';
|
|
4768
4771
|
const darkTheme$1 = 'dark:tw-bg-sq-dark-background dark:tw-text-sq-dark-text ' +
|
|
@@ -4781,7 +4784,7 @@ const borderColorClasses$2 = [
|
|
|
4781
4784
|
* TextArea.
|
|
4782
4785
|
*/
|
|
4783
4786
|
const TextArea = ({ readonly = false, disabled = false, onChange, onKeyUp, onFocus, onBlur, onKeyDown, id, name, rows = 3, cols = undefined, value, placeholder, showError, extraClassNames, testId, autoFocus = false, }) => {
|
|
4784
|
-
const appliedClasses = `${baseClasses$
|
|
4787
|
+
const appliedClasses = `${baseClasses$3} ${extraClassNames} ${lightTheme$1} ${darkTheme$1} ${showError ? errorClasses$2 : borderColorClasses$2}`;
|
|
4785
4788
|
return (React__default.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 }));
|
|
4786
4789
|
};
|
|
4787
4790
|
|
|
@@ -13658,7 +13661,7 @@ var CreatableSelect = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
13658
13661
|
});
|
|
13659
13662
|
var CreatableSelect$1 = CreatableSelect;
|
|
13660
13663
|
|
|
13661
|
-
const baseClasses$
|
|
13664
|
+
const baseClasses$2 = ['focus:tw-ring-0', 'disabled:tw-cursor-not-allowed'].join(' ');
|
|
13662
13665
|
const containerStyles = ['tw-bg-white', 'dark:tw-bg-sq-dark-background'].join(' ');
|
|
13663
13666
|
const errorClasses$1 = 'tw-border-sq-danger-color';
|
|
13664
13667
|
const borderColorClasses$1 = ['tw-border-sq-disabled-gray', 'dark:tw-border-sq-dark-disabled-gray'].join(' ');
|
|
@@ -13800,7 +13803,7 @@ const Select = ({ options, value, placeholder = 'select', noOptionsMessage = 'no
|
|
|
13800
13803
|
border = menuIsOpen ? 'tw-rounded-tr-sm' : 'tw-rounded-r-sm';
|
|
13801
13804
|
}
|
|
13802
13805
|
const appliedClasses = `${borderStyles$3} ${border} ${showError ? errorClasses$1 : borderColorClasses$1} ${small ? 'reactSelectMinHeightSmall' : 'reactSelectMinHeight'} `;
|
|
13803
|
-
return `${appliedClasses} ${baseClasses$
|
|
13806
|
+
return `${appliedClasses} ${baseClasses$2} specSelectControl ${isDisabled ? disabledClasses$3 : ''} ${small ? 'tw-pl-2 tw-pr-1' : 'tw-pl-2.5 tw-pr-1.5'}`;
|
|
13804
13807
|
},
|
|
13805
13808
|
placeholder: () => placeholderStyles,
|
|
13806
13809
|
container: () => `${textStyles} ${containerStyles} ${extraClassNames}`,
|
|
@@ -16170,7 +16173,7 @@ const ButtonWithDropdown = ({ dropdownItems, triggerIcon, id, extraClassNames, c
|
|
|
16170
16173
|
}))))));
|
|
16171
16174
|
};
|
|
16172
16175
|
|
|
16173
|
-
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' +
|
|
16176
|
+
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' +
|
|
16174
16177
|
' tw-border-solid tw-border tw-text-sm tw-flex tw-flex-col tw-justify-center tw-items-center';
|
|
16175
16178
|
const darkTheme = 'dark:tw-bg-sq-colored-hover-dark dark:tw-text-sq-dark-text';
|
|
16176
16179
|
const lightTheme = 'tw-text-sq-text-color tw-bg-sq-colored-hover';
|
|
@@ -16190,7 +16193,7 @@ const Alert = ({ children, dismissible = true, onClose, show = true, variant, te
|
|
|
16190
16193
|
danger: errorClasses,
|
|
16191
16194
|
warning: 'tw-border-none',
|
|
16192
16195
|
};
|
|
16193
|
-
const appliedClasses = `${baseClasses} ${appliedTheme[variant]} ${extraClassNames} ${appliedBorderTheme[variant]}`;
|
|
16196
|
+
const appliedClasses = `${baseClasses$1} ${appliedTheme[variant]} ${extraClassNames} ${appliedBorderTheme[variant]}`;
|
|
16194
16197
|
if (!show) {
|
|
16195
16198
|
return React__default.createElement("div", null);
|
|
16196
16199
|
}
|
|
@@ -16263,5 +16266,26 @@ const SeeqActionDropdown = ({ seeqActionDropdownItems, trigger, id, extraClassNa
|
|
|
16263
16266
|
})))));
|
|
16264
16267
|
};
|
|
16265
16268
|
|
|
16266
|
-
|
|
16269
|
+
const baseClasses = 'tw-flex tw-outline-none tw-rounded-sm tw-w-full tw-relative tw-flex-wrap tw-items-stretch';
|
|
16270
|
+
/**
|
|
16271
|
+
* InputGroup.
|
|
16272
|
+
*/
|
|
16273
|
+
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 }) => {
|
|
16274
|
+
const tooltipData = getQTipData(tooltipProps);
|
|
16275
|
+
const appliedClasses = `${baseClasses} ${extraClassNames}`;
|
|
16276
|
+
const borderColorClasses = [
|
|
16277
|
+
'tw-border-sq-disabled-gray',
|
|
16278
|
+
'dark:tw-border-sq-dark-disabled-gray',
|
|
16279
|
+
'dark:focus:tw-border-sq-color-dark-dark',
|
|
16280
|
+
'dark:active:tw-border-sq-color-dark-dark',
|
|
16281
|
+
'focus:tw-border-sq-color-dark',
|
|
16282
|
+
'active:tw-border-sq-color-dark',
|
|
16283
|
+
].join(' ');
|
|
16284
|
+
const textfield = (React__default.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 }));
|
|
16285
|
+
return (React__default.createElement("div", { id: id, "data-testid": testId, className: appliedClasses },
|
|
16286
|
+
onClick ? (React__default.createElement("div", { onClick: onClick, className: "tw-flex tw-flex-1 tw-cursor-pointer" }, textfield)) : (textfield),
|
|
16287
|
+
append.filter(Boolean).map((item, index) => item.variant === 'button' ? (React__default.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__default.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)))));
|
|
16288
|
+
};
|
|
16289
|
+
|
|
16290
|
+
export { Accordion, Alert, Button, ButtonWithDropdown, ButtonWithPopover, Checkbox, Icon, InputGroup, Modal, QTip, SeeqActionDropdown, Select, components as SelectCompoents, Tabs, TextArea, TextField, ToolbarButton, Tooltip };
|
|
16267
16291
|
//# sourceMappingURL=index.esm.js.map
|