@seeqdev/qomponents 0.0.141 → 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/FontCustom.woff +0 -0
- package/dist/FontCustom.woff2 +0 -0
- package/dist/ToolbarButton/ToolbarButton.types.d.ts +1 -0
- package/dist/index.esm.js +32 -31
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +32 -31
- package/dist/index.js.map +1 -1
- package/dist/styles.css +47 -35
- package/package.json +1 -1
package/dist/FontCustom.woff
CHANGED
|
Binary file
|
package/dist/FontCustom.woff2
CHANGED
|
Binary file
|
|
@@ -30,6 +30,7 @@ export interface ToolbarButtonProps {
|
|
|
30
30
|
tooltipTestId?: string;
|
|
31
31
|
/** options for the tooltip */
|
|
32
32
|
tooltipOptions?: Omit<TooltipProps, 'text'>;
|
|
33
|
+
/** sets button to disabled */
|
|
33
34
|
disabled?: boolean;
|
|
34
35
|
/** function called when the toolbar is clicked on, i.e. for tracking (does not open the popover) */
|
|
35
36
|
onClick?: (e: MouseEvent) => void;
|
package/dist/index.esm.js
CHANGED
|
@@ -4539,35 +4539,29 @@ function getSvgIconPath(icon) {
|
|
|
4539
4539
|
return isSvgIcon(icon) ? icon.substring(SVG_PATH.length) : '';
|
|
4540
4540
|
}
|
|
4541
4541
|
|
|
4542
|
-
const
|
|
4542
|
+
const popoverBorderStyles = [
|
|
4543
4543
|
'tw-border-solid',
|
|
4544
4544
|
'tw-border',
|
|
4545
4545
|
'tw-rounded-[10px]',
|
|
4546
4546
|
'tw-border-sq-disabled-gray',
|
|
4547
4547
|
'dark:tw-border-gray-500',
|
|
4548
4548
|
].join(' ');
|
|
4549
|
-
const
|
|
4550
|
-
'tw-
|
|
4551
|
-
'tw-
|
|
4552
|
-
'tw-
|
|
4553
|
-
'tw-
|
|
4554
|
-
'hover:tw-
|
|
4555
|
-
'
|
|
4556
|
-
'hover:tw-rounded-[10px]',
|
|
4557
|
-
'hover:tw-border-sq-darkish-gray',
|
|
4558
|
-
'active:tw-border-sq-color-dark',
|
|
4559
|
-
'dark:hover:tw-border-sq-color-dark-dark',
|
|
4560
|
-
'dark:focus:tw-border-sq-color-dark-dark',
|
|
4561
|
-
'dark:active:tw-border-sq-color-dark-dark',
|
|
4549
|
+
const triggerBackgroundStyles = [
|
|
4550
|
+
'tw-bg-transparent',
|
|
4551
|
+
'hover:tw-bg-sq-light-gray',
|
|
4552
|
+
'active:tw-bg-sq-light-gray',
|
|
4553
|
+
'dark:tw-bg-transparent',
|
|
4554
|
+
'dark:hover:tw-bg-sq-field-disabled-gray',
|
|
4555
|
+
'dark:active:tw-bg-sq-field-disabled-gray',
|
|
4562
4556
|
].join(' ');
|
|
4563
|
-
const
|
|
4557
|
+
const activeBackgroundStyles = [
|
|
4564
4558
|
'active',
|
|
4565
|
-
'tw-
|
|
4566
|
-
'tw-
|
|
4567
|
-
'tw-
|
|
4568
|
-
'tw-
|
|
4569
|
-
'
|
|
4570
|
-
'dark:
|
|
4559
|
+
'tw-bg-sq-dark-gray',
|
|
4560
|
+
'hover:tw-bg-sq-dark-gray',
|
|
4561
|
+
'active:tw-bg-sq-dark-gray',
|
|
4562
|
+
'dark:tw-bg-sq-field-disabled-gray',
|
|
4563
|
+
'dark:hover:tw-border-sq-field-disabled-gray',
|
|
4564
|
+
'dark:active:tw-bg-sq-field-disabled-gray',
|
|
4571
4565
|
].join(' ');
|
|
4572
4566
|
const bgStyles$3 = ['tw-bg-sq-white', 'dark:tw-bg-sq-dark-background'].join(' ');
|
|
4573
4567
|
const disabledClasses$4 = ['tw-opacity-50', 'tw-cursor-not-allowed'].join(' ');
|
|
@@ -4589,10 +4583,10 @@ const ToolbarButton = ({ isSmall = false, label, icon, secondIcon, forceSmallIco
|
|
|
4589
4583
|
}
|
|
4590
4584
|
};
|
|
4591
4585
|
return (React.createElement($cb5cc270b50c6fcd$export$be92b6f5f03c0fe9, { defaultOpen: false, onOpenChange: onOpenChange },
|
|
4592
|
-
React.createElement($cb5cc270b50c6fcd$export$41fb9f06171c75f4, { id: id, className: `tw-border-none ${isActive ? 'active' : ''}`, disabled: disabled, "data-testid": testId, onClick: (e) => {
|
|
4586
|
+
React.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) => {
|
|
4593
4587
|
onClick && onClick(e);
|
|
4594
4588
|
} },
|
|
4595
|
-
React.createElement("div", { ...tooltipData, className: `tw-
|
|
4589
|
+
React.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 || ''}` },
|
|
4596
4590
|
React.createElement("span", { className: "tw-nowrap" },
|
|
4597
4591
|
isPrimaryAnSvg ? (React.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 },
|
|
4598
4592
|
React.createElement("path", { d: getSvgIconPath(icon) }))) : (React.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` })),
|
|
@@ -4603,7 +4597,7 @@ const ToolbarButton = ({ isSmall = false, label, icon, secondIcon, forceSmallIco
|
|
|
4603
4597
|
React.createElement("div", { className: bgStyles$3 +
|
|
4604
4598
|
' 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' +
|
|
4605
4599
|
' 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' +
|
|
4606
|
-
|
|
4600
|
+
popoverBorderStyles },
|
|
4607
4601
|
hasArrow && (React.createElement($cb5cc270b50c6fcd$export$21b07c8f274aebd5, { asChild: true },
|
|
4608
4602
|
React.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" }))),
|
|
4609
4603
|
popoverContent))) : undefined));
|
|
@@ -13396,6 +13390,7 @@ const multiValueStyles = [
|
|
|
13396
13390
|
*
|
|
13397
13391
|
*/
|
|
13398
13392
|
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, }) => {
|
|
13393
|
+
const [isSelectOptionsOpen, setIsSelectOptionsOpen] = React__default.useState(false);
|
|
13399
13394
|
const getOptionOrSelectedLabel = (option, { context }) => {
|
|
13400
13395
|
const getSelectedOptionLabel = getSelectedValueLabel ? getSelectedValueLabel : getOptionLabel;
|
|
13401
13396
|
if (getOptionLabel || getSelectedValueLabel) {
|
|
@@ -13451,6 +13446,7 @@ const Select = ({ options, value, placeholder = 'select', noOptionsMessage = 'no
|
|
|
13451
13446
|
classNames: {
|
|
13452
13447
|
control: ({ menuIsOpen }) => {
|
|
13453
13448
|
let border = menuIsOpen ? 'tw-rounded-t-md' : 'tw-rounded-md';
|
|
13449
|
+
setIsSelectOptionsOpen(menuIsOpen);
|
|
13454
13450
|
// if it's on the left side of the input group make sure the right side is straight and not curved
|
|
13455
13451
|
if (inputGroup === 'left') {
|
|
13456
13452
|
border = menuIsOpen ? 'tw-rounded-tl-md' : 'tw-rounded-l-md';
|
|
@@ -13462,7 +13458,10 @@ const Select = ({ options, value, placeholder = 'select', noOptionsMessage = 'no
|
|
|
13462
13458
|
return `${appliedClasses} ${baseClasses$3} specSelectControl ${isDisabled ? disabledClasses$3 : ''} ${small ? 'tw-pl-2 tw-pr-1' : 'tw-pl-2.5 tw-pr-1.5'}`;
|
|
13463
13459
|
},
|
|
13464
13460
|
placeholder: () => placeholderStyles,
|
|
13465
|
-
container: () =>
|
|
13461
|
+
container: () => {
|
|
13462
|
+
const containerBorderStyles = isSelectOptionsOpen ? 'tw-rounded-t-md' : 'tw-rounded-md';
|
|
13463
|
+
return `${textStyles} ${containerStyles} ${extraClassNames} ${containerBorderStyles}`;
|
|
13464
|
+
},
|
|
13466
13465
|
input: () => textStyles + ' specSelectInput',
|
|
13467
13466
|
menuList: () => menuListStyles,
|
|
13468
13467
|
menu: () => menuStyles,
|
|
@@ -15985,11 +15984,11 @@ const InputGroup = React__default.forwardRef((props, ref) => {
|
|
|
15985
15984
|
const tooltipData = getQTipData(tooltipProps);
|
|
15986
15985
|
const appliedClasses = `${baseClasses$1} ${extraClassNames}`;
|
|
15987
15986
|
const fieldAppliedClasses = `${fieldClasses} ${extraClassNames} ${lightTheme} ${darkTheme} ${fieldBorderRadius} ${showError ? errorClasses : borderColorClasses} `;
|
|
15987
|
+
const elementsToAppend = append.filter(Boolean);
|
|
15988
15988
|
return (React__default.createElement("div", { id: `input-group-${id}`, className: appliedClasses },
|
|
15989
|
-
field ? (React__default.createElement("div", { "data-testid": testId, className: `tw-flex tw-flex-1 tw-cursor-pointer active:tw-z-50 ${fieldAppliedClasses}` }, field)) : (React__default.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
|
|
15990
|
-
|
|
15991
|
-
|
|
15992
|
-
return 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 ${isLast ? 'tw-rounded-r-md' : ''}`, ...item.buttonProps })) : (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 ${isLast ? 'tw-rounded-r-md' : ''}` }, item?.element));
|
|
15989
|
+
field ? (React__default.createElement("div", { "data-testid": testId, className: `tw-flex tw-flex-1 tw-cursor-pointer active:tw-z-50 ${fieldAppliedClasses}` }, field)) : (React__default.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 })),
|
|
15990
|
+
elementsToAppend.map((item, index) => {
|
|
15991
|
+
return item?.variant === 'button' ? (React__default.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__default.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));
|
|
15993
15992
|
})));
|
|
15994
15993
|
});
|
|
15995
15994
|
|
|
@@ -22229,9 +22228,11 @@ const ButtonGroup = (props) => {
|
|
|
22229
22228
|
const { id, extraClassNames, testId, onChange, buttons = [], ...tooltipProps } = props;
|
|
22230
22229
|
const tooltipData = getQTipData(tooltipProps);
|
|
22231
22230
|
const appliedClasses = `${baseClasses} ${extraClassNames}`;
|
|
22232
|
-
return (React__default.createElement("div", { id: id ? `button-group-${id}` : undefined, "data-testid": testId, className: appliedClasses, ...tooltipData }, buttons
|
|
22231
|
+
return (React__default.createElement("div", { id: id ? `button-group-${id}` : undefined, "data-testid": testId, className: appliedClasses, ...tooltipData }, buttons
|
|
22232
|
+
.filter(Boolean)
|
|
22233
|
+
.map((item, index) => item?.variant === 'button' ? (React__default.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
|
|
22233
22234
|
? `${activeClassesByVariantLightTheme[item?.buttonProps?.variant ?? 'outline']} ${activeClassesByVariantDarkTheme[item?.buttonProps?.variant ?? 'outline']} `
|
|
22234
|
-
: ''} ${item.buttonProps.extraClassNames}`, onClick: () => onChange && onChange(item?.buttonProps?.value) })) : (
|
|
22235
|
+
: ''} ${item.buttonProps.extraClassNames}`, onClick: () => onChange && onChange(item?.buttonProps?.value) })) : (item?.element))));
|
|
22235
22236
|
};
|
|
22236
22237
|
|
|
22237
22238
|
/**
|