@seeqdev/qomponents 0.0.138 → 0.0.140
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 +53 -30
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +53 -30
- package/dist/index.js.map +1 -1
- package/dist/styles.css +56 -30
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -121,7 +121,7 @@ const Icon = ({ onClick, icon, iconPrefix = undefined, type = 'theme', extraClas
|
|
|
121
121
|
* - include tooltips and/or icons
|
|
122
122
|
*/
|
|
123
123
|
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, }) => {
|
|
124
|
-
const baseClasses = 'tw-py-1 tw-px-2.5 tw-rounded-
|
|
124
|
+
const baseClasses = 'tw-py-1 tw-px-2.5 tw-rounded-md focus:tw-ring-0 focus-visible:tw-outline-none disabled:tw-pointer-events-none';
|
|
125
125
|
const baseClassesByVariant = {
|
|
126
126
|
'outline': 'disabled:tw-opacity-50 tw-border-solid tw-border',
|
|
127
127
|
'theme': 'disabled:tw-opacity-50 tw-border-solid tw-border',
|
|
@@ -4562,18 +4562,18 @@ function getSvgIconPath(icon) {
|
|
|
4562
4562
|
const borderStyles$4 = [
|
|
4563
4563
|
'tw-border-solid',
|
|
4564
4564
|
'tw-border',
|
|
4565
|
-
'tw-rounded-
|
|
4565
|
+
'tw-rounded-[10px]',
|
|
4566
4566
|
'tw-border-sq-disabled-gray',
|
|
4567
4567
|
'dark:tw-border-gray-500',
|
|
4568
4568
|
].join(' ');
|
|
4569
4569
|
const triggerBorderStyles = [
|
|
4570
4570
|
'tw-border-solid',
|
|
4571
4571
|
'tw-border',
|
|
4572
|
-
'tw-rounded-
|
|
4572
|
+
'tw-rounded-[10px]',
|
|
4573
4573
|
'tw-border-transparent',
|
|
4574
4574
|
'hover:tw-border-solid',
|
|
4575
4575
|
'hover:tw-border',
|
|
4576
|
-
'hover:tw-rounded-
|
|
4576
|
+
'hover:tw-rounded-[10px]',
|
|
4577
4577
|
'hover:tw-border-sq-darkish-gray',
|
|
4578
4578
|
'active:tw-border-sq-color-dark',
|
|
4579
4579
|
'dark:hover:tw-border-sq-color-dark-dark',
|
|
@@ -4584,7 +4584,7 @@ const activeBorderStyles = [
|
|
|
4584
4584
|
'active',
|
|
4585
4585
|
'tw-border-solid',
|
|
4586
4586
|
'tw-border',
|
|
4587
|
-
'tw-rounded-
|
|
4587
|
+
'tw-rounded-[10px]',
|
|
4588
4588
|
'tw-border-sq-color-dark',
|
|
4589
4589
|
'active:tw-border-sq-color-dark',
|
|
4590
4590
|
'dark:hover:tw-border-sq-color-dark-dark',
|
|
@@ -4695,12 +4695,12 @@ const TextField = React.forwardRef((props, ref) => {
|
|
|
4695
4695
|
internalRef.current.value = `${value}`;
|
|
4696
4696
|
}
|
|
4697
4697
|
}, [value]);
|
|
4698
|
-
let borderRadius = 'tw-rounded-
|
|
4698
|
+
let borderRadius = 'tw-rounded-md';
|
|
4699
4699
|
if (inputGroup === 'left') {
|
|
4700
|
-
borderRadius = 'tw-rounded-l-
|
|
4700
|
+
borderRadius = 'tw-rounded-l-md tw-border-r-0 focus:tw-border-r' + ' active:tw-border-r';
|
|
4701
4701
|
}
|
|
4702
4702
|
else if (inputGroup === 'right') {
|
|
4703
|
-
borderRadius = 'tw-rounded-r-
|
|
4703
|
+
borderRadius = 'tw-rounded-r-md tw-border-l-0 focus:tw-border-l active:tw-border-l';
|
|
4704
4704
|
}
|
|
4705
4705
|
const appliedClasses = `${baseClasses$6} ${sizeClasses[size]} ${extraClassNames} ${lightTheme$3} ${darkTheme$3} ${borderRadius} ${showError ? errorClasses$4 : borderColorClasses$4} `;
|
|
4706
4706
|
const inputProp = setValidInputDimension(inputWidth, inputHeight)
|
|
@@ -4741,7 +4741,7 @@ const Checkbox = (props) => {
|
|
|
4741
4741
|
: 'tw-cursor-pointer tw-text-sq-text-color dark:tw-text-sq-dark-text'}` }, label)));
|
|
4742
4742
|
};
|
|
4743
4743
|
|
|
4744
|
-
const baseClasses$4 = 'tw-leading-normal tw-outline-none tw-py-1 tw-px-3 tw-rounded-
|
|
4744
|
+
const baseClasses$4 = 'tw-leading-normal tw-outline-none tw-py-1 tw-px-3 tw-rounded-md tw-w-full' +
|
|
4745
4745
|
' disabled:tw-pointer-events-none disabled:tw-bg-sq-light-gray disabled:dark:tw-bg-sq-dark-disabled-gray' +
|
|
4746
4746
|
' disabled:tw-cursor-not-allowed tw-p-1 tw-border-solid tw-border tw-text-sm';
|
|
4747
4747
|
const darkTheme$2 = 'dark:tw-bg-sq-dark-background dark:tw-text-sq-dark-text ' +
|
|
@@ -11593,7 +11593,7 @@ var colors$1 = {
|
|
|
11593
11593
|
neutral80: 'hsl(0, 0%, 20%)',
|
|
11594
11594
|
neutral90: 'hsl(0, 0%, 10%)'
|
|
11595
11595
|
};
|
|
11596
|
-
var borderRadius
|
|
11596
|
+
var borderRadius = 4;
|
|
11597
11597
|
// Used to calculate consistent margin/padding on elements
|
|
11598
11598
|
var baseUnit = 4;
|
|
11599
11599
|
// The minimum height of the control
|
|
@@ -11606,7 +11606,7 @@ var spacing = {
|
|
|
11606
11606
|
menuGutter: menuGutter
|
|
11607
11607
|
};
|
|
11608
11608
|
var defaultTheme = {
|
|
11609
|
-
borderRadius: borderRadius
|
|
11609
|
+
borderRadius: borderRadius,
|
|
11610
11610
|
colors: colors$1,
|
|
11611
11611
|
spacing: spacing
|
|
11612
11612
|
};
|
|
@@ -13470,13 +13470,13 @@ const Select = ({ options, value, placeholder = 'select', noOptionsMessage = 'no
|
|
|
13470
13470
|
filterOption: filterOption ? filterOption : filterConfig ? createFilter(filterConfig) : undefined,
|
|
13471
13471
|
classNames: {
|
|
13472
13472
|
control: ({ menuIsOpen }) => {
|
|
13473
|
-
let border = menuIsOpen ? 'tw-rounded-t-
|
|
13473
|
+
let border = menuIsOpen ? 'tw-rounded-t-md' : 'tw-rounded-md';
|
|
13474
13474
|
// if it's on the left side of the input group make sure the right side is straight and not curved
|
|
13475
13475
|
if (inputGroup === 'left') {
|
|
13476
|
-
border = menuIsOpen ? 'tw-rounded-tl-
|
|
13476
|
+
border = menuIsOpen ? 'tw-rounded-tl-md' : 'tw-rounded-l-md';
|
|
13477
13477
|
}
|
|
13478
13478
|
else if (inputGroup === 'right') {
|
|
13479
|
-
border = menuIsOpen ? 'tw-rounded-tr-
|
|
13479
|
+
border = menuIsOpen ? 'tw-rounded-tr-md' : 'tw-rounded-r-md';
|
|
13480
13480
|
}
|
|
13481
13481
|
const appliedClasses = `${borderStyles$3} ${border} ${showError ? errorClasses$2 : borderColorClasses$2} ${small ? 'reactSelectMinHeightSmall' : 'reactSelectMinHeight'} `;
|
|
13482
13482
|
return `${appliedClasses} ${baseClasses$3} specSelectControl ${isDisabled ? disabledClasses$3 : ''} ${small ? 'tw-pl-2 tw-pr-1' : 'tw-pl-2.5 tw-pr-1.5'}`;
|
|
@@ -14336,12 +14336,12 @@ const Tabs = ({ tabs, defaultActiveTab, activeTab, onTabSelect, extraClassNames,
|
|
|
14336
14336
|
onTabSelect && onTabSelect(tabId);
|
|
14337
14337
|
};
|
|
14338
14338
|
return (React.createElement($69cb30bb0017df05$export$be92b6f5f03c0fe9, { className: `tw-flex tw-flex-col tw-min-w-[300px] tw-max-w-full tw-flex-grow focus-visible:tw-outline-none ${extraClassNames || ''}`, defaultValue: defaultActiveTab, "data-testid": testId, id: id, value: activeTab, onValueChange: handleTabSelect },
|
|
14339
|
-
React.createElement($69cb30bb0017df05$export$54c2e3dc7acea9f5, { className: `tw-flex tw-flex-row tw-flex-wrap tw-z-[1001]` }, tabs.map(({ id, icon, label, tabExtraClassNames, testId: tabsTestId, disabled }, index) => (React.createElement($69cb30bb0017df05$export$41fb9f06171c75f4, { className: `tw-bg-sq-white dark:tw-bg-sq-dark-background tw-h-[
|
|
14339
|
+
React.createElement($69cb30bb0017df05$export$54c2e3dc7acea9f5, { className: `tw-flex tw-flex-row tw-flex-wrap tw-z-[1001]` }, tabs.map(({ id, icon, label, tabExtraClassNames, testId: tabsTestId, disabled }, index) => (React.createElement($69cb30bb0017df05$export$41fb9f06171c75f4, { className: `tw-bg-sq-white dark:tw-bg-sq-dark-background tw-h-[25px] focus-visible:tw-outline-none tw-min-w-[100px] tw-px-4 tw-border-solid dark:tw-border-gray-700 tw-flex tw-flex-1 tw-justify-center tw-items-center tw-border-r-[2px] last:tw-border-r-0 ${stretchTabs ? '' : 'tw-max-w-max tw-min-w-fit'} ${tabExtraClassNames || ''} ${activeTab === id
|
|
14340
14340
|
? 'tw-border-b-sq-color-dark dark:tw-border-b-sq-color-dark tw-border-b-[3px]'
|
|
14341
14341
|
: 'hover:tw-bg-sq-light-gray tw-border-b-[1px] hover:dark:tw-bg-gray-700'}`, "data-testid": tabsTestId, disabled: disabled, key: `${label}-${id}-${index}`, value: id },
|
|
14342
|
-
React.createElement("span",
|
|
14343
|
-
icon && React.createElement(Icon, { icon: icon, testId: `${id}_tab-icon`, extraClassNames: "tw-text-[15px] tw-mr-[7px]" }),
|
|
14344
|
-
React.createElement("span", { className: `tw-text-[14px] tw-font-medium ${activeTab === id
|
|
14342
|
+
React.createElement("span", { className: "tw-flex tw-items-center tw-overflow-hidden tw-pb-[3px]" },
|
|
14343
|
+
icon && React.createElement(Icon, { icon: icon, testId: `${id}_tab-icon`, extraClassNames: "tw-text-[15px] tw-mr-[7px] tw-flex-shrink-0" }),
|
|
14344
|
+
React.createElement("span", { className: `tw-text-[14px] tw-font-medium tw-whitespace-nowrap tw-overflow-hidden tw-text-ellipsis ${activeTab === id
|
|
14345
14345
|
? 'dark:tw-text-sq-dark-text tw-text-gray-500'
|
|
14346
14346
|
: 'dark:tw-text-sq-color-dark-dark tw-text-sq-color-dark'}` }, label)))))),
|
|
14347
14347
|
tabs.map((tab, index) => (React.createElement($69cb30bb0017df05$export$7c6e2c02157bb7d2, { className: `tw-bg-sq-white dark:tw-bg-sq-dark-background tw-overflow-y-auto -tw-mt-[1px] tw-border-t-[1px] dark:tw-border-gray-700 tw-z-[500] tw-flex tw-flex-col tw-flex-grow focus-visible:tw-outline-none ${tab.tabContentExtraClassNames || ''}`, key: `${tab.label}_${index}_content`, value: tab.id }, tab.content)))));
|
|
@@ -15850,7 +15850,7 @@ const ButtonWithDropdown = ({ dropdownItems, triggerIcon, id, extraClassNames =
|
|
|
15850
15850
|
}))))));
|
|
15851
15851
|
};
|
|
15852
15852
|
|
|
15853
|
-
const baseClasses$2 = 'tw-mx-auto tw-p-4 tw-leading-normal tw-outline-none tw-py-2 tw-px-3 tw-rounded-
|
|
15853
|
+
const baseClasses$2 = 'tw-mx-auto tw-p-4 tw-leading-normal tw-outline-none tw-py-2 tw-px-3 tw-rounded-[15px] tw-w-full tw-relative' +
|
|
15854
15854
|
' tw-border-solid tw-border tw-text-sm tw-flex tw-flex-col tw-justify-center tw-items-center';
|
|
15855
15855
|
const darkTheme$1 = 'dark:tw-bg-sq-colored-hover-dark dark:tw-text-sq-dark-text';
|
|
15856
15856
|
const lightTheme$1 = 'tw-text-sq-text-color tw-bg-sq-colored-hover';
|
|
@@ -15943,7 +15943,7 @@ const InsertSeeqContent = (item) => {
|
|
|
15943
15943
|
const borderStyles = [
|
|
15944
15944
|
'tw-border-solid',
|
|
15945
15945
|
'tw-border',
|
|
15946
|
-
'tw-rounded-
|
|
15946
|
+
'tw-rounded-md',
|
|
15947
15947
|
'tw-border-sq-disabled-gray',
|
|
15948
15948
|
'dark:tw-border-gray-500',
|
|
15949
15949
|
].join(' ');
|
|
@@ -15983,7 +15983,7 @@ const SeeqActionDropdown = ({ seeqActionDropdownItems, trigger, id, extraClassNa
|
|
|
15983
15983
|
})))));
|
|
15984
15984
|
};
|
|
15985
15985
|
|
|
15986
|
-
const baseClasses$1 = 'tw-flex tw-outline-none tw-rounded-
|
|
15986
|
+
const baseClasses$1 = 'tw-flex tw-outline-none tw-rounded-md tw-w-full tw-relative tw-flex-wrap';
|
|
15987
15987
|
const errorClasses = 'tw-border-sq-danger-color';
|
|
15988
15988
|
const borderColorClasses = [
|
|
15989
15989
|
'tw-border-sq-disabled-gray',
|
|
@@ -15993,7 +15993,7 @@ const borderColorClasses = [
|
|
|
15993
15993
|
'focus:tw-border-sq-color-dark',
|
|
15994
15994
|
'active:tw-border-sq-color-dark',
|
|
15995
15995
|
].join(' ');
|
|
15996
|
-
const
|
|
15996
|
+
const fieldBorderRadius = 'tw-rounded-l-md tw-rounded-r-none';
|
|
15997
15997
|
const fieldClasses = 'tw-leading-normal tw-outline-none tw-py-1 tw-px-3' + 'tw-p-1 tw-border-solid tw-border';
|
|
15998
15998
|
const darkTheme = 'dark:tw-bg-sq-dark-background dark:tw-text-sq-dark-text disabled:dark:tw-text-sq-dark-text-lighter';
|
|
15999
15999
|
const lightTheme = 'tw-text-sq-text-color disabled:tw-text-sq-darkish-gray';
|
|
@@ -16004,10 +16004,13 @@ const InputGroup = React.forwardRef((props, ref) => {
|
|
|
16004
16004
|
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;
|
|
16005
16005
|
const tooltipData = getQTipData(tooltipProps);
|
|
16006
16006
|
const appliedClasses = `${baseClasses$1} ${extraClassNames}`;
|
|
16007
|
-
const fieldAppliedClasses = `${fieldClasses} ${extraClassNames} ${lightTheme} ${darkTheme} ${
|
|
16007
|
+
const fieldAppliedClasses = `${fieldClasses} ${extraClassNames} ${lightTheme} ${darkTheme} ${fieldBorderRadius} ${showError ? errorClasses : borderColorClasses} `;
|
|
16008
16008
|
return (React.createElement("div", { id: `input-group-${id}`, className: appliedClasses },
|
|
16009
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 focus:tw-z-30 ${extraClassNames}`, ...tooltipData })),
|
|
16010
|
-
append.filter(Boolean).map((item, index
|
|
16010
|
+
append.filter(Boolean).map((item, index, array) => {
|
|
16011
|
+
const isLast = index === array.length - 1;
|
|
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));
|
|
16013
|
+
})));
|
|
16011
16014
|
});
|
|
16012
16015
|
|
|
16013
16016
|
// src/index.ts
|
|
@@ -22159,12 +22162,32 @@ function validateWCAG2Parms(parms) {
|
|
|
22159
22162
|
|
|
22160
22163
|
const baseLabelClasses = 'tw-left-1 tw-text-xs tw-text-sq-text-color dark:tw-text-sq-dark-text tw-items-center tw-h-[18px]';
|
|
22161
22164
|
const ProgressIndicator = (props) => {
|
|
22162
|
-
const { value, color = undefined, testId, label, extraClasses = '', labelClasses = '', valuesLength, max, index, ...tooltipProps } = props;
|
|
22165
|
+
const { value, color = undefined, testId, label, extraClasses = '', labelClasses = '', valuesLength, max, index, totalValue, ...tooltipProps } = props;
|
|
22163
22166
|
const tooltipData = getQTipData(tooltipProps);
|
|
22164
22167
|
const previousWidth = React.useRef(0);
|
|
22165
22168
|
const indicatorElementRef = React.useRef(null);
|
|
22166
22169
|
const [textColorClass, setTextColorClass] = React.useState('');
|
|
22167
22170
|
const [animatedWidth, setAnimatedWidth] = React.useState(previousWidth.current);
|
|
22171
|
+
// Determine which corners to round based on position and total value
|
|
22172
|
+
let roundedCorners = '';
|
|
22173
|
+
if (totalValue >= max) {
|
|
22174
|
+
// If progress is 100%, round both ends
|
|
22175
|
+
if (index === 0 && valuesLength === 1) {
|
|
22176
|
+
roundedCorners = 'tw-rounded-[15px]';
|
|
22177
|
+
}
|
|
22178
|
+
else if (index === 0) {
|
|
22179
|
+
roundedCorners = 'tw-rounded-l-[15px]';
|
|
22180
|
+
}
|
|
22181
|
+
else if (index === valuesLength - 1) {
|
|
22182
|
+
roundedCorners = 'tw-rounded-r-[15px]';
|
|
22183
|
+
}
|
|
22184
|
+
}
|
|
22185
|
+
else {
|
|
22186
|
+
// Otherwise, only round the leftmost indicator
|
|
22187
|
+
if (index === 0) {
|
|
22188
|
+
roundedCorners = 'tw-rounded-l-[15px]';
|
|
22189
|
+
}
|
|
22190
|
+
}
|
|
22168
22191
|
React.useEffect(() => {
|
|
22169
22192
|
const timeout = setTimeout(() => {
|
|
22170
22193
|
const newWidth = (Number(value) / Number(max)) * 100;
|
|
@@ -22188,7 +22211,7 @@ const ProgressIndicator = (props) => {
|
|
|
22188
22211
|
computeTextClass(indicatorElementRef.current);
|
|
22189
22212
|
}
|
|
22190
22213
|
}, [!!indicatorElementRef.current]);
|
|
22191
|
-
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
|
|
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: {
|
|
22192
22215
|
// Background color will default to the theme color if undefined
|
|
22193
22216
|
backgroundColor: bgColor,
|
|
22194
22217
|
animation: 'width 660ms forwards',
|
|
@@ -22197,12 +22220,12 @@ const ProgressIndicator = (props) => {
|
|
|
22197
22220
|
};
|
|
22198
22221
|
const ProgressBar = ({ values = [], max = 100, containerExtraClasses = '', zeroValueLabel = 'No progress yet', }) => {
|
|
22199
22222
|
const totalValue = values.reduce((acc, { value }) => acc + value, 0);
|
|
22200
|
-
return (React.createElement(Root, { className: `tw-relative tw-h-[18px] tw-w-full tw-overflow-hidden tw-rounded-[
|
|
22201
|
-
return React.createElement(ProgressIndicator, { ...props, max: max, valuesLength: values.length, index: i, key: i });
|
|
22223
|
+
return (React.createElement(Root, { className: `tw-relative tw-h-[18px] tw-w-full tw-overflow-hidden tw-rounded-[15px] tw-bg-sq-dark-gray dark:tw-bg-sq-dark-disabled-gray tw-flex tw-flex-1 ${containerExtraClasses}`, max: max, value: totalValue }, totalValue > 0 ? (values.map((props, i) => {
|
|
22224
|
+
return React.createElement(ProgressIndicator, { ...props, max: max, valuesLength: values.length, index: i, totalValue: totalValue, key: i });
|
|
22202
22225
|
})) : (React.createElement("div", { className: `${baseLabelClasses} tw-mx-auto tw-overflow-hidden` }, zeroValueLabel))));
|
|
22203
22226
|
};
|
|
22204
22227
|
|
|
22205
|
-
const baseClasses = 'tw-flex tw-outline-none tw-
|
|
22228
|
+
const baseClasses = 'tw-flex tw-outline-none tw-w-full tw-relative tw-flex-wrap';
|
|
22206
22229
|
const activeClassesByVariantLightTheme = {
|
|
22207
22230
|
'outline': '!tw-bg-sq-disabled-gray tw-border-sq-color-dark',
|
|
22208
22231
|
'theme': 'tw-bg-sq-color-highlight',
|
|
@@ -22226,7 +22249,7 @@ const ButtonGroup = (props) => {
|
|
|
22226
22249
|
const { id, extraClassNames, testId, onChange, buttons = [], ...tooltipProps } = props;
|
|
22227
22250
|
const tooltipData = getQTipData(tooltipProps);
|
|
22228
22251
|
const appliedClasses = `${baseClasses} ${extraClassNames}`;
|
|
22229
|
-
return (React.createElement("div", { id: id ? `button-group-${id}` : undefined, "data-testid": testId, className: appliedClasses, ...tooltipData }, buttons.filter(Boolean).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-
|
|
22252
|
+
return (React.createElement("div", { id: id ? `button-group-${id}` : undefined, "data-testid": testId, className: appliedClasses, ...tooltipData }, buttons.filter(Boolean).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
|
|
22230
22253
|
? `${activeClassesByVariantLightTheme[item?.buttonProps?.variant ?? 'outline']} ${activeClassesByVariantDarkTheme[item?.buttonProps?.variant ?? 'outline']} `
|
|
22231
22254
|
: ''} ${item.buttonProps.extraClassNames}`, onClick: () => onChange && onChange(item?.buttonProps?.value) })) : (React.createElement("div", { key: index, className: ` tw-flex tw-items-center tw-justify-center tw-rounded-none tw-ml-[-1px] active:tw-z-30 ${item?.extraClassNames || ''}` }, item?.element)))));
|
|
22232
22255
|
};
|