@seeqdev/qomponents 0.0.140 → 0.0.142
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/ToolbarButton/ToolbarButton.types.d.ts +1 -0
- package/dist/index.esm.js +34 -33
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +34 -33
- package/dist/index.js.map +1 -1
- package/dist/styles.css +47 -31
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -4559,35 +4559,29 @@ function getSvgIconPath(icon) {
|
|
|
4559
4559
|
return isSvgIcon(icon) ? icon.substring(SVG_PATH.length) : '';
|
|
4560
4560
|
}
|
|
4561
4561
|
|
|
4562
|
-
const
|
|
4562
|
+
const popoverBorderStyles = [
|
|
4563
4563
|
'tw-border-solid',
|
|
4564
4564
|
'tw-border',
|
|
4565
4565
|
'tw-rounded-[10px]',
|
|
4566
4566
|
'tw-border-sq-disabled-gray',
|
|
4567
4567
|
'dark:tw-border-gray-500',
|
|
4568
4568
|
].join(' ');
|
|
4569
|
-
const
|
|
4570
|
-
'tw-
|
|
4571
|
-
'tw-
|
|
4572
|
-
'tw-
|
|
4573
|
-
'tw-
|
|
4574
|
-
'hover:tw-
|
|
4575
|
-
'
|
|
4576
|
-
'hover:tw-rounded-[10px]',
|
|
4577
|
-
'hover:tw-border-sq-darkish-gray',
|
|
4578
|
-
'active:tw-border-sq-color-dark',
|
|
4579
|
-
'dark:hover:tw-border-sq-color-dark-dark',
|
|
4580
|
-
'dark:focus:tw-border-sq-color-dark-dark',
|
|
4581
|
-
'dark:active:tw-border-sq-color-dark-dark',
|
|
4569
|
+
const triggerBackgroundStyles = [
|
|
4570
|
+
'tw-bg-transparent',
|
|
4571
|
+
'hover:tw-bg-sq-light-gray',
|
|
4572
|
+
'active:tw-bg-sq-light-gray',
|
|
4573
|
+
'dark:tw-bg-transparent',
|
|
4574
|
+
'dark:hover:tw-bg-sq-field-disabled-gray',
|
|
4575
|
+
'dark:active:tw-bg-sq-field-disabled-gray',
|
|
4582
4576
|
].join(' ');
|
|
4583
|
-
const
|
|
4577
|
+
const activeBackgroundStyles = [
|
|
4584
4578
|
'active',
|
|
4585
|
-
'tw-
|
|
4586
|
-
'tw-
|
|
4587
|
-
'tw-
|
|
4588
|
-
'tw-
|
|
4589
|
-
'
|
|
4590
|
-
'dark:
|
|
4579
|
+
'tw-bg-sq-dark-gray',
|
|
4580
|
+
'hover:tw-bg-sq-dark-gray',
|
|
4581
|
+
'active:tw-bg-sq-dark-gray',
|
|
4582
|
+
'dark:tw-bg-sq-field-disabled-gray',
|
|
4583
|
+
'dark:hover:tw-border-sq-field-disabled-gray',
|
|
4584
|
+
'dark:active:tw-bg-sq-field-disabled-gray',
|
|
4591
4585
|
].join(' ');
|
|
4592
4586
|
const bgStyles$3 = ['tw-bg-sq-white', 'dark:tw-bg-sq-dark-background'].join(' ');
|
|
4593
4587
|
const disabledClasses$4 = ['tw-opacity-50', 'tw-cursor-not-allowed'].join(' ');
|
|
@@ -4609,10 +4603,10 @@ const ToolbarButton = ({ isSmall = false, label, icon, secondIcon, forceSmallIco
|
|
|
4609
4603
|
}
|
|
4610
4604
|
};
|
|
4611
4605
|
return (React__namespace.createElement($cb5cc270b50c6fcd$export$be92b6f5f03c0fe9, { defaultOpen: false, onOpenChange: onOpenChange },
|
|
4612
|
-
React__namespace.createElement($cb5cc270b50c6fcd$export$41fb9f06171c75f4, { id: id, className: `tw-border-none ${isActive ? 'active' : ''}`, disabled: disabled, "data-testid": testId, onClick: (e) => {
|
|
4606
|
+
React__namespace.createElement($cb5cc270b50c6fcd$export$41fb9f06171c75f4, { id: id, className: `tw-border-none tw-mx-[1.5px] first:tw-ml-0 last:tw-mr-0 ${isActive ? 'active' : ''}`, disabled: disabled, "data-testid": testId, onClick: (e) => {
|
|
4613
4607
|
onClick && onClick(e);
|
|
4614
4608
|
} },
|
|
4615
|
-
React__namespace.createElement("div", { ...tooltipData, className: `tw-
|
|
4609
|
+
React__namespace.createElement("div", { ...tooltipData, className: `tw-flex tw-flex-col tw-items-center tw-rounded-[10px] ${isSmall ? 'tw-py-[1px] tw-px-1' : 'tw-px-2 tw-py-[5px]'} ${disabled ? disabledClasses$4 : isActive ? activeBackgroundStyles : triggerBackgroundStyles} ${extraClassNames || ''}` },
|
|
4616
4610
|
React__namespace.createElement("span", { className: "tw-nowrap" },
|
|
4617
4611
|
isPrimaryAnSvg ? (React__namespace.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", className: `tw-text-sq-text-color dark:tw-text-sq-dark-text ${primaryIconExtraClassNames || ''}`, viewBox: primaryIconViewbox, height: `${iconHeight}px`, width: `${iconWidth}px`, fill: "currentColor", "data-testid": testId },
|
|
4618
4612
|
React__namespace.createElement("path", { d: getSvgIconPath(icon) }))) : (React__namespace.createElement(Icon, { icon: icon, testId: "firstIcon", type: "text", large: !isSmall && !label && !secondIcon && !forceSmallIcon, extraClassNames: `tw-text-sq-text-color dark:tw-text-sq-dark-text` })),
|
|
@@ -4623,7 +4617,7 @@ const ToolbarButton = ({ isSmall = false, label, icon, secondIcon, forceSmallIco
|
|
|
4623
4617
|
React__namespace.createElement("div", { className: bgStyles$3 +
|
|
4624
4618
|
' tw-relative tw-z-[1000] tw-min-w-6 tw-p-[0.5rem] focus-visible:tw-outline-none tw-outline-none data-[state=open]:animate-in data-[state=closed]:animate-out' +
|
|
4625
4619
|
' data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2' +
|
|
4626
|
-
|
|
4620
|
+
popoverBorderStyles },
|
|
4627
4621
|
hasArrow && (React__namespace.createElement($cb5cc270b50c6fcd$export$21b07c8f274aebd5, { asChild: true },
|
|
4628
4622
|
React__namespace.createElement("div", { className: " tw-fill-transparent tw-bg-white tw-w-[15px] tw-h-[15px] tw-mt-[-7px] tw-rotate-45 dark:tw-bg-sq-dark-background tw-border-b tw-border-r tw-border-sq-disabled-gray dark:tw-border-gray-500" }))),
|
|
4629
4623
|
popoverContent))) : undefined));
|
|
@@ -13416,6 +13410,7 @@ const multiValueStyles = [
|
|
|
13416
13410
|
*
|
|
13417
13411
|
*/
|
|
13418
13412
|
const Select = ({ options, value, placeholder = 'select', noOptionsMessage = 'no matching options', isSearchable = true, creatable = false, isMulti = false, isClearable = false, closeMenuOnSelect = true, id, inputId, menuPortalTarget, getOptionLabel, getSelectedValueLabel, getOptionValue, onChange, menuIsOpen, menuPlacement = 'auto', extraClassNames, inputGroup, filterConfig, filterOption, small = false, isDisabled = false, showError = false, isLoading = false, formatGroupLabel, onRemove, defaultValue, onMenuOpen, onMenuClose, components, onMenuInputFocus, onInputChange, inputValue, }) => {
|
|
13413
|
+
const [isSelectOptionsOpen, setIsSelectOptionsOpen] = React.useState(false);
|
|
13419
13414
|
const getOptionOrSelectedLabel = (option, { context }) => {
|
|
13420
13415
|
const getSelectedOptionLabel = getSelectedValueLabel ? getSelectedValueLabel : getOptionLabel;
|
|
13421
13416
|
if (getOptionLabel || getSelectedValueLabel) {
|
|
@@ -13471,6 +13466,7 @@ const Select = ({ options, value, placeholder = 'select', noOptionsMessage = 'no
|
|
|
13471
13466
|
classNames: {
|
|
13472
13467
|
control: ({ menuIsOpen }) => {
|
|
13473
13468
|
let border = menuIsOpen ? 'tw-rounded-t-md' : 'tw-rounded-md';
|
|
13469
|
+
setIsSelectOptionsOpen(menuIsOpen);
|
|
13474
13470
|
// if it's on the left side of the input group make sure the right side is straight and not curved
|
|
13475
13471
|
if (inputGroup === 'left') {
|
|
13476
13472
|
border = menuIsOpen ? 'tw-rounded-tl-md' : 'tw-rounded-l-md';
|
|
@@ -13482,7 +13478,10 @@ const Select = ({ options, value, placeholder = 'select', noOptionsMessage = 'no
|
|
|
13482
13478
|
return `${appliedClasses} ${baseClasses$3} specSelectControl ${isDisabled ? disabledClasses$3 : ''} ${small ? 'tw-pl-2 tw-pr-1' : 'tw-pl-2.5 tw-pr-1.5'}`;
|
|
13483
13479
|
},
|
|
13484
13480
|
placeholder: () => placeholderStyles,
|
|
13485
|
-
container: () =>
|
|
13481
|
+
container: () => {
|
|
13482
|
+
const containerBorderStyles = isSelectOptionsOpen ? 'tw-rounded-t-md' : 'tw-rounded-md';
|
|
13483
|
+
return `${textStyles} ${containerStyles} ${extraClassNames} ${containerBorderStyles}`;
|
|
13484
|
+
},
|
|
13486
13485
|
input: () => textStyles + ' specSelectInput',
|
|
13487
13486
|
menuList: () => menuListStyles,
|
|
13488
13487
|
menu: () => menuStyles,
|
|
@@ -16005,11 +16004,11 @@ const InputGroup = React.forwardRef((props, ref) => {
|
|
|
16005
16004
|
const tooltipData = getQTipData(tooltipProps);
|
|
16006
16005
|
const appliedClasses = `${baseClasses$1} ${extraClassNames}`;
|
|
16007
16006
|
const fieldAppliedClasses = `${fieldClasses} ${extraClassNames} ${lightTheme} ${darkTheme} ${fieldBorderRadius} ${showError ? errorClasses : borderColorClasses} `;
|
|
16007
|
+
const elementsToAppend = append.filter(Boolean);
|
|
16008
16008
|
return (React.createElement("div", { id: `input-group-${id}`, className: appliedClasses },
|
|
16009
|
-
field ? (React.createElement("div", { "data-testid": testId, className: `tw-flex tw-flex-1 tw-cursor-pointer active:tw-z-50 ${fieldAppliedClasses}` }, field)) : (React.createElement(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-rounded-r-none
|
|
16010
|
-
|
|
16011
|
-
|
|
16012
|
-
return 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 ${isLast ? 'tw-rounded-r-md' : ''}`, ...item.buttonProps })) : (React.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 ${isLast ? 'tw-rounded-r-md' : ''}` }, item?.element));
|
|
16009
|
+
field ? (React.createElement("div", { "data-testid": testId, className: `tw-flex tw-flex-1 tw-cursor-pointer active:tw-z-50 ${fieldAppliedClasses}` }, field)) : (React.createElement(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 focus:tw-z-30 tw-rounded-r-none last:tw-rounded-r-md ${extraClassNames}`, ...tooltipData })),
|
|
16010
|
+
elementsToAppend.map((item, index) => {
|
|
16011
|
+
return item?.variant === 'button' ? (React.createElement(Button, { key: index, extraClassNames: `tw-ml-[-1px] focus:tw-z-40 focus:tw-border tw-rounded-none last:tw-rounded-r-md`, ...item.buttonProps })) : (React.createElement("div", { key: index, className: `${borderColorClasses} tw-flex tw-items-center tw-justify-center tw-rounded-none last:tw-rounded-r-md tw-ml-[-1px] active:tw-z-30 active:tw-border tw-border` }, item?.element));
|
|
16013
16012
|
})));
|
|
16014
16013
|
});
|
|
16015
16014
|
|
|
@@ -22211,12 +22210,12 @@ const ProgressIndicator = (props) => {
|
|
|
22211
22210
|
computeTextClass(indicatorElementRef.current);
|
|
22212
22211
|
}
|
|
22213
22212
|
}, [!!indicatorElementRef.current]);
|
|
22214
|
-
return (React.createElement(Indicator, { className: `tw-ease-[cubic-bezier(0.65, 0, 0.35, 1)] tw-w-full tw-h-[18px] tw-duration-[660ms] tw-flex tw-justify-center tw-items-center tw-overflow-hidden ${roundedCorners} ${bgClass} ${extraClasses}`, ...tooltipData, "data-qtip-text": tooltipProps.tooltip ? tooltipProps.tooltip : `${value}%`, "data-testid": `progress-bar-indicator-${testId ? testId : value}`, key: `${index}-${value}`, ref: indicatorElementRef, style: {
|
|
22213
|
+
return (React.createElement(Indicator, { className: `tw-ease-[cubic-bezier(0.65, 0, 0.35, 1)] tw-w-full tw-h-[18px] tw-duration-[660ms] tw-flex tw-justify-center tw-items-center ${valuesLength === 1 ? '' : 'tw-overflow-hidden'} ${roundedCorners} ${bgClass} ${extraClasses}`, ...tooltipData, "data-qtip-text": tooltipProps.tooltip ? tooltipProps.tooltip : `${value}%`, "data-testid": `progress-bar-indicator-${testId ? testId : value}`, key: `${index}-${value}`, ref: indicatorElementRef, style: {
|
|
22215
22214
|
// Background color will default to the theme color if undefined
|
|
22216
22215
|
backgroundColor: bgColor,
|
|
22217
22216
|
animation: 'width 660ms forwards',
|
|
22218
22217
|
width: `${animatedWidth}%`,
|
|
22219
|
-
} }, label ? React.createElement("span", { className: `${baseLabelClasses} ${labelClasses} ${textColorClass}` }, label) : undefined));
|
|
22218
|
+
} }, label ? (React.createElement("span", { className: `${baseLabelClasses} ${labelClasses} ${textColorClass} ${valuesLength === 1 ? 'tw-absolute tw-z-50' : ''}` }, label)) : undefined));
|
|
22220
22219
|
};
|
|
22221
22220
|
const ProgressBar = ({ values = [], max = 100, containerExtraClasses = '', zeroValueLabel = 'No progress yet', }) => {
|
|
22222
22221
|
const totalValue = values.reduce((acc, { value }) => acc + value, 0);
|
|
@@ -22249,9 +22248,11 @@ const ButtonGroup = (props) => {
|
|
|
22249
22248
|
const { id, extraClassNames, testId, onChange, buttons = [], ...tooltipProps } = props;
|
|
22250
22249
|
const tooltipData = getQTipData(tooltipProps);
|
|
22251
22250
|
const appliedClasses = `${baseClasses} ${extraClassNames}`;
|
|
22252
|
-
return (React.createElement("div", { id: id ? `button-group-${id}` : undefined, "data-testid": testId, className: appliedClasses, ...tooltipData }, buttons
|
|
22251
|
+
return (React.createElement("div", { id: id ? `button-group-${id}` : undefined, "data-testid": testId, className: appliedClasses, ...tooltipData }, buttons
|
|
22252
|
+
.filter(Boolean)
|
|
22253
|
+
.map((item, index) => item?.variant === 'button' ? (React.createElement(Button, { key: index, ...item.buttonProps, extraClassNames: `tw-ml-[-1px] focus:tw-z-40 tw-outline-none focus:tw-border tw-rounded-none first:tw-rounded-l-md last:tw-rounded-r-md ${item.buttonProps?.isActive
|
|
22253
22254
|
? `${activeClassesByVariantLightTheme[item?.buttonProps?.variant ?? 'outline']} ${activeClassesByVariantDarkTheme[item?.buttonProps?.variant ?? 'outline']} `
|
|
22254
|
-
: ''} ${item.buttonProps.extraClassNames}`, onClick: () => onChange && onChange(item?.buttonProps?.value) })) : (
|
|
22255
|
+
: ''} ${item.buttonProps.extraClassNames}`, onClick: () => onChange && onChange(item?.buttonProps?.value) })) : (item?.element))));
|
|
22255
22256
|
};
|
|
22256
22257
|
|
|
22257
22258
|
/**
|