@seeqdev/qomponents 0.0.110 → 0.0.111
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/InputGroup/InputGroup.types.d.ts +19 -4
- package/dist/index.esm.js +39 -34
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +39 -34
- package/dist/index.js.map +1 -1
- package/dist/styles.css +22 -4
- package/package.json +1 -1
|
@@ -1,20 +1,35 @@
|
|
|
1
1
|
import { ButtonProps } from '../Button/Button.types';
|
|
2
|
-
import { TextFieldProps } from '../TextField/TextField.types';
|
|
2
|
+
import { InputLengthStyleProps, TextFieldProps } from '../TextField/TextField.types';
|
|
3
3
|
import { TooltipComponentProps } from '../Tooltip/Tooltip.types';
|
|
4
|
+
/**
|
|
5
|
+
* Interface representing the properties for an appended button.
|
|
6
|
+
*/
|
|
4
7
|
interface AppendedButtonProps {
|
|
8
|
+
/** Specifies that the variant is a button */
|
|
5
9
|
variant: 'button';
|
|
10
|
+
/** The properties for the button */
|
|
6
11
|
buttonProps: ButtonProps;
|
|
7
12
|
}
|
|
13
|
+
/**
|
|
14
|
+
* Props for an element variant in the InputGroup appended component.
|
|
15
|
+
*/
|
|
8
16
|
interface ElementProps {
|
|
17
|
+
/** Specifies that this is an element variant */
|
|
9
18
|
variant: 'element';
|
|
19
|
+
/** The React node to be rendered as the element */
|
|
10
20
|
element: React.ReactNode;
|
|
11
21
|
}
|
|
12
22
|
type AppendedProps = AppendedButtonProps | ElementProps;
|
|
23
|
+
/**
|
|
24
|
+
* Interface representing the base properties for an input group component.
|
|
25
|
+
* Extends the properties of a TextField component.
|
|
26
|
+
*/
|
|
13
27
|
interface BaseInputGroupProps extends TextFieldProps {
|
|
14
|
-
/** Append elements */
|
|
28
|
+
/** Append elements - Array of elements to be appended to the input group */
|
|
15
29
|
append: AppendedProps[];
|
|
16
|
-
|
|
30
|
+
/** The field to be rendered in the input group */
|
|
31
|
+
field?: React.ReactNode;
|
|
17
32
|
}
|
|
18
33
|
/** Combined InputGroupProps */
|
|
19
|
-
export type InputGroupProps = BaseInputGroupProps & TooltipComponentProps;
|
|
34
|
+
export type InputGroupProps = BaseInputGroupProps & TooltipComponentProps & InputLengthStyleProps;
|
|
20
35
|
export {};
|
package/dist/index.esm.js
CHANGED
|
@@ -4623,8 +4623,8 @@ const setValidInputDimension = (width, height) => {
|
|
|
4623
4623
|
return inputStyle;
|
|
4624
4624
|
};
|
|
4625
4625
|
|
|
4626
|
-
const errorClasses$
|
|
4627
|
-
const borderColorClasses$
|
|
4626
|
+
const errorClasses$4 = 'tw-border-sq-danger-color';
|
|
4627
|
+
const borderColorClasses$4 = [
|
|
4628
4628
|
'tw-border-sq-disabled-gray',
|
|
4629
4629
|
'dark:tw-border-sq-dark-disabled-gray',
|
|
4630
4630
|
'dark:focus:tw-border-sq-color-dark-dark',
|
|
@@ -4636,8 +4636,8 @@ const baseClasses$5 = 'tw-h-inputs tw-leading-normal tw-outline-none tw-py-1 tw-
|
|
|
4636
4636
|
' disabled:tw-pointer-events-none disabled:tw-bg-sq-light-gray disabled:dark:tw-bg-sq-dark-disabled-gray' +
|
|
4637
4637
|
' disabled:tw-cursor-not-allowed tw-p-1 tw-border-solid tw-border tw-placeholder-gray-400' +
|
|
4638
4638
|
' dark:tw-placeholder-sq-dark-text-lighter specTextField';
|
|
4639
|
-
const darkTheme$
|
|
4640
|
-
const lightTheme$
|
|
4639
|
+
const darkTheme$3 = 'dark:tw-bg-sq-dark-background dark:tw-text-sq-dark-text disabled:dark:tw-text-sq-dark-text-lighter';
|
|
4640
|
+
const lightTheme$3 = 'tw-text-sq-text-color disabled:tw-text-sq-darkish-gray';
|
|
4641
4641
|
const sizeClasses = {
|
|
4642
4642
|
sm: 'tw-text-sm',
|
|
4643
4643
|
lg: 'tw-text-xl',
|
|
@@ -4682,7 +4682,7 @@ const TextField = React__default.forwardRef((props, ref) => {
|
|
|
4682
4682
|
else if (inputGroup === 'right') {
|
|
4683
4683
|
borderRadius = 'tw-rounded-r-sm tw-border-l-0 focus:tw-border-l active:tw-border-l';
|
|
4684
4684
|
}
|
|
4685
|
-
const appliedClasses = `${baseClasses$5} ${sizeClasses[size]} ${extraClassNames} ${lightTheme$
|
|
4685
|
+
const appliedClasses = `${baseClasses$5} ${sizeClasses[size]} ${extraClassNames} ${lightTheme$3} ${darkTheme$3} ${borderRadius} ${showError ? errorClasses$4 : borderColorClasses$4} `;
|
|
4686
4686
|
const inputProp = setValidInputDimension(inputWidth, inputHeight)
|
|
4687
4687
|
? {
|
|
4688
4688
|
style: setValidInputDimension(inputWidth, inputHeight),
|
|
@@ -4724,11 +4724,11 @@ const Checkbox = (props) => {
|
|
|
4724
4724
|
const baseClasses$3 = 'tw-leading-normal tw-outline-none tw-py-1 tw-px-3 tw-rounded-sm tw-w-full' +
|
|
4725
4725
|
' disabled:tw-pointer-events-none disabled:tw-bg-sq-light-gray disabled:dark:tw-bg-sq-dark-disabled-gray' +
|
|
4726
4726
|
' disabled:tw-cursor-not-allowed tw-p-1 tw-border-solid tw-border tw-text-sm';
|
|
4727
|
-
const darkTheme$
|
|
4727
|
+
const darkTheme$2 = 'dark:tw-bg-sq-dark-background dark:tw-text-sq-dark-text ' +
|
|
4728
4728
|
'dark:tw-placeholder-sq-dark-text-lighter disabled:dark:tw-text-sq-dark-text-lighter';
|
|
4729
|
-
const lightTheme$
|
|
4730
|
-
const errorClasses$
|
|
4731
|
-
const borderColorClasses$
|
|
4729
|
+
const lightTheme$2 = 'tw-text-sq-text-color tw-placeholder-gray-400 disabled:tw-text-sq-darkish-gray';
|
|
4730
|
+
const errorClasses$3 = 'tw-border-sq-danger-color';
|
|
4731
|
+
const borderColorClasses$3 = [
|
|
4732
4732
|
'tw-border-sq-disabled-gray',
|
|
4733
4733
|
'dark:tw-border-sq-dark-disabled-gray',
|
|
4734
4734
|
'dark:focus:tw-border-sq-color-dark-dark',
|
|
@@ -4740,7 +4740,7 @@ const borderColorClasses$2 = [
|
|
|
4740
4740
|
* TextArea.
|
|
4741
4741
|
*/
|
|
4742
4742
|
const TextArea = ({ readonly = false, disabled = false, onChange, onKeyUp, onFocus, onBlur, onKeyDown, id, name, rows = 3, cols = undefined, value, placeholder, showError, extraClassNames, testId, autoFocus = false, }) => {
|
|
4743
|
-
const appliedClasses = `${baseClasses$3} ${extraClassNames} ${lightTheme$
|
|
4743
|
+
const appliedClasses = `${baseClasses$3} ${extraClassNames} ${lightTheme$2} ${darkTheme$2} ${showError ? errorClasses$3 : borderColorClasses$3}`;
|
|
4744
4744
|
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 }));
|
|
4745
4745
|
};
|
|
4746
4746
|
|
|
@@ -11573,7 +11573,7 @@ var colors = {
|
|
|
11573
11573
|
neutral80: 'hsl(0, 0%, 20%)',
|
|
11574
11574
|
neutral90: 'hsl(0, 0%, 10%)'
|
|
11575
11575
|
};
|
|
11576
|
-
var borderRadius = 4;
|
|
11576
|
+
var borderRadius$1 = 4;
|
|
11577
11577
|
// Used to calculate consistent margin/padding on elements
|
|
11578
11578
|
var baseUnit = 4;
|
|
11579
11579
|
// The minimum height of the control
|
|
@@ -11586,7 +11586,7 @@ var spacing = {
|
|
|
11586
11586
|
menuGutter: menuGutter
|
|
11587
11587
|
};
|
|
11588
11588
|
var defaultTheme = {
|
|
11589
|
-
borderRadius: borderRadius,
|
|
11589
|
+
borderRadius: borderRadius$1,
|
|
11590
11590
|
colors: colors,
|
|
11591
11591
|
spacing: spacing
|
|
11592
11592
|
};
|
|
@@ -13319,8 +13319,8 @@ var CreatableSelect$1 = CreatableSelect;
|
|
|
13319
13319
|
|
|
13320
13320
|
const baseClasses$2 = ['focus:tw-ring-0', 'disabled:tw-cursor-not-allowed'].join(' ');
|
|
13321
13321
|
const containerStyles = ['tw-bg-white', 'dark:tw-bg-sq-dark-background'].join(' ');
|
|
13322
|
-
const errorClasses$
|
|
13323
|
-
const borderColorClasses$
|
|
13322
|
+
const errorClasses$2 = 'tw-border-sq-danger-color';
|
|
13323
|
+
const borderColorClasses$2 = ['tw-border-sq-disabled-gray', 'dark:tw-border-sq-dark-disabled-gray'].join(' ');
|
|
13324
13324
|
const borderStyles$3 = [
|
|
13325
13325
|
'tw-border-solid',
|
|
13326
13326
|
'tw-border',
|
|
@@ -13458,7 +13458,7 @@ const Select = ({ options, value, placeholder = 'select', noOptionsMessage = 'no
|
|
|
13458
13458
|
else if (inputGroup === 'right') {
|
|
13459
13459
|
border = menuIsOpen ? 'tw-rounded-tr-sm' : 'tw-rounded-r-sm';
|
|
13460
13460
|
}
|
|
13461
|
-
const appliedClasses = `${borderStyles$3} ${border} ${showError ? errorClasses$
|
|
13461
|
+
const appliedClasses = `${borderStyles$3} ${border} ${showError ? errorClasses$2 : borderColorClasses$2} ${small ? 'reactSelectMinHeightSmall' : 'reactSelectMinHeight'} `;
|
|
13462
13462
|
return `${appliedClasses} ${baseClasses$2} specSelectControl ${isDisabled ? disabledClasses$3 : ''} ${small ? 'tw-pl-2 tw-pr-1' : 'tw-pl-2.5 tw-pr-1.5'}`;
|
|
13463
13463
|
},
|
|
13464
13464
|
placeholder: () => placeholderStyles,
|
|
@@ -15831,22 +15831,22 @@ const ButtonWithDropdown = ({ dropdownItems, triggerIcon, id, extraClassNames, c
|
|
|
15831
15831
|
|
|
15832
15832
|
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' +
|
|
15833
15833
|
' tw-border-solid tw-border tw-text-sm tw-flex tw-flex-col tw-justify-center tw-items-center';
|
|
15834
|
-
const darkTheme = 'dark:tw-bg-sq-colored-hover-dark dark:tw-text-sq-dark-text';
|
|
15835
|
-
const lightTheme = 'tw-text-sq-text-color tw-bg-sq-colored-hover';
|
|
15836
|
-
const errorClasses = 'tw-border-sq-danger-color';
|
|
15837
|
-
const borderColorClasses = 'tw-border-sq-color-dark';
|
|
15834
|
+
const darkTheme$1 = 'dark:tw-bg-sq-colored-hover-dark dark:tw-text-sq-dark-text';
|
|
15835
|
+
const lightTheme$1 = 'tw-text-sq-text-color tw-bg-sq-colored-hover';
|
|
15836
|
+
const errorClasses$1 = 'tw-border-sq-danger-color';
|
|
15837
|
+
const borderColorClasses$1 = 'tw-border-sq-color-dark';
|
|
15838
15838
|
/**
|
|
15839
15839
|
* Alert.
|
|
15840
15840
|
*/
|
|
15841
15841
|
const Alert = ({ children, dismissible = true, onClose, show = true, variant, testId, id, extraClassNames, }) => {
|
|
15842
15842
|
const appliedTheme = {
|
|
15843
|
-
theme: `${lightTheme} ${darkTheme}`,
|
|
15843
|
+
theme: `${lightTheme$1} ${darkTheme$1}`,
|
|
15844
15844
|
danger: 'tw-text-sq-text-color tw-bg-sq-danger-color',
|
|
15845
15845
|
warning: 'tw-bg-sq-bg-warning-color tw-text-sq-text-color',
|
|
15846
15846
|
};
|
|
15847
15847
|
const appliedBorderTheme = {
|
|
15848
|
-
theme: borderColorClasses,
|
|
15849
|
-
danger: errorClasses,
|
|
15848
|
+
theme: borderColorClasses$1,
|
|
15849
|
+
danger: errorClasses$1,
|
|
15850
15850
|
warning: 'tw-border-none',
|
|
15851
15851
|
};
|
|
15852
15852
|
const appliedClasses = `${baseClasses$1} ${appliedTheme[variant]} ${extraClassNames} ${appliedBorderTheme[variant]}`;
|
|
@@ -15923,24 +15923,29 @@ const SeeqActionDropdown = ({ seeqActionDropdownItems, trigger, id, extraClassNa
|
|
|
15923
15923
|
};
|
|
15924
15924
|
|
|
15925
15925
|
const baseClasses = 'tw-flex tw-outline-none tw-rounded-sm tw-w-full tw-relative tw-flex-wrap tw-items-stretch';
|
|
15926
|
+
const errorClasses = 'tw-border-sq-danger-color';
|
|
15927
|
+
const borderColorClasses = [
|
|
15928
|
+
'tw-border-sq-disabled-gray',
|
|
15929
|
+
'dark:tw-border-sq-dark-disabled-gray',
|
|
15930
|
+
'dark:focus:tw-border-sq-color-dark-dark',
|
|
15931
|
+
'dark:active:tw-border-sq-color-dark-dark',
|
|
15932
|
+
'focus:tw-border-sq-color-dark',
|
|
15933
|
+
'active:tw-border-sq-color-dark',
|
|
15934
|
+
].join(' ');
|
|
15935
|
+
let borderRadius = 'tw-rounded-sm tw-rounded-r-none';
|
|
15936
|
+
const fieldClasses = 'tw-leading-normal tw-outline-none tw-py-1 tw-px-3' + 'tw-p-1 tw-border-solid tw-border';
|
|
15937
|
+
const darkTheme = 'dark:tw-bg-sq-dark-background dark:tw-text-sq-dark-text disabled:dark:tw-text-sq-dark-text-lighter';
|
|
15938
|
+
const lightTheme = 'tw-text-sq-text-color disabled:tw-text-sq-darkish-gray';
|
|
15926
15939
|
/**
|
|
15927
15940
|
* InputGroup.
|
|
15928
15941
|
*/
|
|
15929
|
-
const InputGroup = ({ readonly = false, onChange, onKeyUp, onFocus, onBlur, onKeyDown,
|
|
15942
|
+
const InputGroup = ({ readonly = false, onChange, onKeyUp, onFocus, onBlur, onKeyDown, name, value, placeholder, append = [], extraClassNames = '', id, testId, showError, required, autoComplete, autoFocus, disabled, type, step, min, max, field, ...tooltipProps }) => {
|
|
15930
15943
|
const tooltipData = getQTipData(tooltipProps);
|
|
15931
15944
|
const appliedClasses = `${baseClasses} ${extraClassNames}`;
|
|
15932
|
-
const
|
|
15933
|
-
'tw-border-sq-disabled-gray',
|
|
15934
|
-
'dark:tw-border-sq-dark-disabled-gray',
|
|
15935
|
-
'dark:focus:tw-border-sq-color-dark-dark',
|
|
15936
|
-
'dark:active:tw-border-sq-color-dark-dark',
|
|
15937
|
-
'focus:tw-border-sq-color-dark',
|
|
15938
|
-
'active:tw-border-sq-color-dark',
|
|
15939
|
-
].join(' ');
|
|
15940
|
-
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 }));
|
|
15945
|
+
const fieldAppliedClasses = `${fieldClasses} ${extraClassNames} ${lightTheme} ${darkTheme} ${borderRadius} ${showError ? errorClasses : borderColorClasses} `;
|
|
15941
15946
|
return (React__default.createElement("div", { id: id, "data-testid": testId, className: appliedClasses },
|
|
15942
|
-
|
|
15943
|
-
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-
|
|
15947
|
+
field ? (React__default.createElement("div", { className: `tw-flex tw-flex-1 tw-cursor-pointer active:tw-z-50 ${fieldAppliedClasses}` }, field)) : (React__default.createElement(TextField, { readonly: 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 ${extraClassNames}`, ...tooltipData })),
|
|
15948
|
+
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-justify-center tw-rounded-none tw-ml-[-1px] active:tw-z-30 active:tw-border tw-border last:tw-rounded-r-sm` }, item.element)))));
|
|
15944
15949
|
};
|
|
15945
15950
|
|
|
15946
15951
|
// packages/react/context/src/createContext.tsx
|