@seeqdev/qomponents 0.0.112 → 0.0.114
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/Alert/Alert.types.d.ts +5 -2
- package/dist/Collapse/Collapse.d.ts +4 -0
- package/dist/Collapse/Collapse.js +20 -0
- package/dist/Collapse/Collapse.js.map +1 -0
- package/dist/Collapse/Collapse.stories.d.ts +5 -0
- package/dist/Collapse/Collapse.stories.js +37 -0
- package/dist/Collapse/Collapse.stories.js.map +1 -0
- package/dist/Collapse/Collapse.test.d.ts +1 -0
- package/dist/Collapse/Collapse.test.js +24 -0
- package/dist/Collapse/Collapse.test.js.map +1 -0
- package/dist/Collapse/Collapse.types.d.ts +4 -0
- package/dist/Collapse/Collapse.types.js +2 -0
- package/dist/Collapse/Collapse.types.js.map +1 -0
- package/dist/Collapse/index.d.ts +1 -0
- package/dist/Collapse/index.js +2 -0
- package/dist/Collapse/index.js.map +1 -0
- package/dist/InputGroup/InputGroup.types.d.ts +1 -1
- package/dist/InputGroup/index.d.ts +1 -0
- package/dist/ProgressBar/ProgressBar.types.d.ts +2 -0
- package/dist/index.esm.js +15 -12
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +15 -12
- package/dist/index.js.map +1 -1
- package/dist/styles.css +17 -0
- package/package.json +1 -1
- package/dist/ProgressBar/ProgressBar.js +0 -16
- package/dist/ProgressBar/ProgressBar.js.map +0 -1
- package/dist/ProgressBar/ProgressBar.stories.js +0 -42
- package/dist/ProgressBar/ProgressBar.stories.js.map +0 -1
- package/dist/ProgressBar/ProgressBar.test.js +0 -32
- package/dist/ProgressBar/ProgressBar.test.js.map +0 -1
- package/dist/ProgressBar/ProgressBar.types.js +0 -2
- package/dist/ProgressBar/ProgressBar.types.js.map +0 -1
- package/dist/ProgressBar/index.js +0 -2
- package/dist/ProgressBar/index.js.map +0 -1
- package/dist/Slider/Slider.js +0 -13
- package/dist/Slider/Slider.js.map +0 -1
- package/dist/Slider/Slider.stories.js +0 -58
- package/dist/Slider/Slider.stories.js.map +0 -1
- package/dist/Slider/Slider.test.js +0 -38
- package/dist/Slider/Slider.test.js.map +0 -1
- package/dist/Slider/Slider.types.js +0 -2
- package/dist/Slider/Slider.types.js.map +0 -1
- package/dist/Slider/index.js +0 -2
- package/dist/Slider/index.js.map +0 -1
|
@@ -1,10 +1,13 @@
|
|
|
1
|
-
|
|
1
|
+
import { TooltipComponentProps } from '../Tooltip/Tooltip.types';
|
|
2
|
+
interface Props {
|
|
2
3
|
children: React.ReactNode;
|
|
3
4
|
dismissible?: boolean;
|
|
4
5
|
onClose?: () => void;
|
|
5
6
|
show?: boolean;
|
|
6
|
-
variant: 'danger' | 'theme' | 'warning';
|
|
7
|
+
variant: 'danger' | 'theme' | 'warning' | 'gray';
|
|
7
8
|
testId?: string;
|
|
8
9
|
id?: string;
|
|
9
10
|
extraClassNames?: string;
|
|
10
11
|
}
|
|
12
|
+
export type AlertProps = Props & TooltipComponentProps;
|
|
13
|
+
export {};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import React, { useRef, useEffect, useState } from 'react';
|
|
2
|
+
import { animated, useSpring } from '@react-spring/web';
|
|
3
|
+
const Collapse = ({ isVisible, children }) => {
|
|
4
|
+
const contentRef = useRef(null);
|
|
5
|
+
const [contentHeight, setContentHeight] = useState(0);
|
|
6
|
+
useEffect(() => {
|
|
7
|
+
if (contentRef.current) {
|
|
8
|
+
setContentHeight(contentRef.current?.scrollHeight);
|
|
9
|
+
}
|
|
10
|
+
}, [children]);
|
|
11
|
+
const styles = useSpring({
|
|
12
|
+
opacity: isVisible ? 1 : 0,
|
|
13
|
+
height: isVisible ? contentHeight : 0,
|
|
14
|
+
y: isVisible ? 0 : 24,
|
|
15
|
+
});
|
|
16
|
+
return (React.createElement(animated.div, { style: styles },
|
|
17
|
+
React.createElement("div", { ref: contentRef }, children)));
|
|
18
|
+
};
|
|
19
|
+
export default Collapse;
|
|
20
|
+
//# sourceMappingURL=Collapse.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Collapse.js","sourceRoot":"","sources":["../../src/Collapse/Collapse.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,MAAM,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC3D,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAGxD,MAAM,QAAQ,GAA2C,CAAC,EAAE,SAAS,EAAE,QAAQ,EAAE,EAAE,EAAE;IACnF,MAAM,UAAU,GAAG,MAAM,CAAiB,IAAI,CAAC,CAAC;IAChD,MAAM,CAAC,aAAa,EAAE,gBAAgB,CAAC,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAC;IAEtD,SAAS,CAAC,GAAG,EAAE;QACb,IAAI,UAAU,CAAC,OAAO,EAAE;YACtB,gBAAgB,CAAC,UAAU,CAAC,OAAO,EAAE,YAAY,CAAC,CAAC;SACpD;IACH,CAAC,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC;IAEf,MAAM,MAAM,GAAG,SAAS,CAAC;QACvB,OAAO,EAAE,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAC1B,MAAM,EAAE,SAAS,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC;QACrC,CAAC,EAAE,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE;KACtB,CAAC,CAAC;IAEH,OAAO,CACL,oBAAC,QAAQ,CAAC,GAAG,IAAC,KAAK,EAAE,MAAM;QACzB,6BAAK,GAAG,EAAE,UAAU,IAAG,QAAQ,CAAO,CACzB,CAChB,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,QAAQ,CAAC"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import Collapse from './Collapse';
|
|
3
|
+
import { QTip } from '../Tooltip';
|
|
4
|
+
import Button from '../Button';
|
|
5
|
+
export default {
|
|
6
|
+
title: 'Collapse',
|
|
7
|
+
};
|
|
8
|
+
export const AllCollapses = () => {
|
|
9
|
+
const [isVisible, setIsVisible] = React.useState(true);
|
|
10
|
+
const renderChild = () => (React.createElement("div", { className: "tw-text-sq-color-gray dark:tw-text-sq-white" },
|
|
11
|
+
React.createElement("p", { className: "tw-mb-5 tw-text-[15px] tw-leading-normal" }, "This is a content to be shown when the collapse is visible. Clice the button above to toggle it"),
|
|
12
|
+
React.createElement(Button, { variant: "outline", label: "Save data" })));
|
|
13
|
+
const renderAllVariations = () => (React.createElement(React.Fragment, null,
|
|
14
|
+
React.createElement("div", { className: "tw-p-4 light" },
|
|
15
|
+
React.createElement("div", { className: "tw-p-4" },
|
|
16
|
+
React.createElement(Button, { variant: "theme", label: "Toggle Collapse", onClick: () => setIsVisible(!isVisible) }),
|
|
17
|
+
React.createElement(Collapse, { isVisible: isVisible }, renderChild()))),
|
|
18
|
+
React.createElement("div", { className: "tw-p-4 tw-dark tw-bg-sq-dark-background" },
|
|
19
|
+
React.createElement("div", { className: "tw-p-4" },
|
|
20
|
+
React.createElement(Button, { variant: "theme", label: "Toggle Collapse", onClick: () => setIsVisible(!isVisible) }),
|
|
21
|
+
React.createElement(Collapse, { isVisible: isVisible }, renderChild())))));
|
|
22
|
+
return (React.createElement("div", { className: "tw-grid tw-grid-cols-4 tw-gap-4" },
|
|
23
|
+
React.createElement(QTip, null),
|
|
24
|
+
React.createElement("div", { className: "color_topic" },
|
|
25
|
+
React.createElement("b", null, "Topic Colors"),
|
|
26
|
+
renderAllVariations()),
|
|
27
|
+
React.createElement("div", { className: "color_analysis" },
|
|
28
|
+
React.createElement("b", null, "Analysis Colors"),
|
|
29
|
+
renderAllVariations()),
|
|
30
|
+
React.createElement("div", { className: "color_datalab" },
|
|
31
|
+
React.createElement("b", null, "Datalab Colors"),
|
|
32
|
+
renderAllVariations()),
|
|
33
|
+
React.createElement("div", { className: "color_vantage" },
|
|
34
|
+
React.createElement("b", null, "Vantage Colors"),
|
|
35
|
+
renderAllVariations())));
|
|
36
|
+
};
|
|
37
|
+
//# sourceMappingURL=Collapse.stories.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Collapse.stories.js","sourceRoot":"","sources":["../../src/Collapse/Collapse.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,QAAQ,MAAM,YAAY,CAAC;AAClC,OAAO,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAClC,OAAO,MAAM,MAAM,WAAW,CAAC;AAE/B,eAAe;IACb,KAAK,EAAE,UAAU;CAClB,CAAC;AAEF,MAAM,CAAC,MAAM,YAAY,GAAG,GAAG,EAAE;IAC/B,MAAM,CAAC,SAAS,EAAE,YAAY,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;IAEvD,MAAM,WAAW,GAAG,GAAG,EAAE,CAAC,CACxB,6BAAK,SAAS,EAAC,6CAA6C;QAC1D,2BAAG,SAAS,EAAC,0CAA0C,sGAEnD;QACJ,oBAAC,MAAM,IAAC,OAAO,EAAC,SAAS,EAAC,KAAK,EAAC,WAAW,GAAG,CAC1C,CACP,CAAC;IACF,MAAM,mBAAmB,GAAG,GAAG,EAAE,CAAC,CAChC;QACE,6BAAK,SAAS,EAAC,cAAc;YAC3B,6BAAK,SAAS,EAAC,QAAQ;gBACrB,oBAAC,MAAM,IAAC,OAAO,EAAC,OAAO,EAAC,KAAK,EAAC,iBAAiB,EAAC,OAAO,EAAE,GAAG,EAAE,CAAC,YAAY,CAAC,CAAC,SAAS,CAAC,GAAI;gBAC3F,oBAAC,QAAQ,IAAC,SAAS,EAAE,SAAS,IAAG,WAAW,EAAE,CAAY,CACtD,CACF;QAEN,6BAAK,SAAS,EAAC,yCAAyC;YACtD,6BAAK,SAAS,EAAC,QAAQ;gBACrB,oBAAC,MAAM,IAAC,OAAO,EAAC,OAAO,EAAC,KAAK,EAAC,iBAAiB,EAAC,OAAO,EAAE,GAAG,EAAE,CAAC,YAAY,CAAC,CAAC,SAAS,CAAC,GAAI;gBAC3F,oBAAC,QAAQ,IAAC,SAAS,EAAE,SAAS,IAAG,WAAW,EAAE,CAAY,CACtD,CACF,CACL,CACJ,CAAC;IACF,OAAO,CACL,6BAAK,SAAS,EAAC,iCAAiC;QAC9C,oBAAC,IAAI,OAAG;QACR,6BAAK,SAAS,EAAC,aAAa;YAC1B,8CAAmB;YAClB,mBAAmB,EAAE,CAClB;QAEN,6BAAK,SAAS,EAAC,gBAAgB;YAC7B,iDAAsB;YACrB,mBAAmB,EAAE,CAClB;QAEN,6BAAK,SAAS,EAAC,eAAe;YAC5B,gDAAqB;YACpB,mBAAmB,EAAE,CAClB;QAEN,6BAAK,SAAS,EAAC,eAAe;YAC5B,gDAAqB;YACpB,mBAAmB,EAAE,CAClB,CACF,CACP,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import '@testing-library/jest-dom';
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { render, screen } from '@testing-library/react';
|
|
3
|
+
import '@testing-library/jest-dom';
|
|
4
|
+
import Collapse from './Collapse';
|
|
5
|
+
describe('Collapse component', () => {
|
|
6
|
+
test('renders children when visible', () => {
|
|
7
|
+
render(React.createElement(Collapse, { isVisible: true },
|
|
8
|
+
React.createElement("div", { "data-testid": "content" }, "Content")));
|
|
9
|
+
expect(screen.getByTestId('content')).toBeVisible();
|
|
10
|
+
});
|
|
11
|
+
test('does not render children when not visible', () => {
|
|
12
|
+
render(React.createElement(Collapse, { isVisible: false },
|
|
13
|
+
React.createElement("div", { "data-testid": "content" }, "Content")));
|
|
14
|
+
expect(screen.queryByTestId('content')).not.toBeVisible();
|
|
15
|
+
});
|
|
16
|
+
test('applies correct styles when not visible', () => {
|
|
17
|
+
render(React.createElement(Collapse, { isVisible: false },
|
|
18
|
+
React.createElement("div", { "data-testid": "content" }, "Content")));
|
|
19
|
+
const animatedDiv = screen.getByTestId('content').parentElement?.parentElement;
|
|
20
|
+
expect(animatedDiv).toHaveStyle('opacity: 0');
|
|
21
|
+
expect(animatedDiv).toHaveStyle('height: 0');
|
|
22
|
+
});
|
|
23
|
+
});
|
|
24
|
+
//# sourceMappingURL=Collapse.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Collapse.test.js","sourceRoot":"","sources":["../../src/Collapse/Collapse.test.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AACxD,OAAO,2BAA2B,CAAC;AACnC,OAAO,QAAQ,MAAM,YAAY,CAAC;AAElC,QAAQ,CAAC,oBAAoB,EAAE,GAAG,EAAE;IAClC,IAAI,CAAC,+BAA+B,EAAE,GAAG,EAAE;QACzC,MAAM,CACJ,oBAAC,QAAQ,IAAC,SAAS,EAAE,IAAI;YACvB,4CAAiB,SAAS,cAAc,CAC/B,CACZ,CAAC;QAEF,MAAM,CAAC,MAAM,CAAC,WAAW,CAAC,SAAS,CAAC,CAAC,CAAC,WAAW,EAAE,CAAC;IACtD,CAAC,CAAC,CAAC;IAEH,IAAI,CAAC,2CAA2C,EAAE,GAAG,EAAE;QACrD,MAAM,CACJ,oBAAC,QAAQ,IAAC,SAAS,EAAE,KAAK;YACxB,4CAAiB,SAAS,cAAc,CAC/B,CACZ,CAAC;QAEF,MAAM,CAAC,MAAM,CAAC,aAAa,CAAC,SAAS,CAAC,CAAC,CAAC,GAAG,CAAC,WAAW,EAAE,CAAC;IAC5D,CAAC,CAAC,CAAC;IAEH,IAAI,CAAC,yCAAyC,EAAE,GAAG,EAAE;QACnD,MAAM,CACJ,oBAAC,QAAQ,IAAC,SAAS,EAAE,KAAK;YACxB,4CAAiB,SAAS,cAAc,CAC/B,CACZ,CAAC;QAEF,MAAM,WAAW,GAAG,MAAM,CAAC,WAAW,CAAC,SAAS,CAAC,CAAC,aAAa,EAAE,aAAa,CAAC;QAC/E,MAAM,CAAC,WAAW,CAAC,CAAC,WAAW,CAAC,YAAY,CAAC,CAAC;QAC9C,MAAM,CAAC,WAAW,CAAC,CAAC,WAAW,CAAC,WAAW,CAAC,CAAC;IAC/C,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Collapse.types.js","sourceRoot":"","sources":["../../src/Collapse/Collapse.types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './Collapse';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/Collapse/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC"}
|
|
@@ -19,7 +19,7 @@ interface ElementProps {
|
|
|
19
19
|
/** The React node to be rendered as the element */
|
|
20
20
|
element: React.ReactNode;
|
|
21
21
|
}
|
|
22
|
-
type AppendedProps = AppendedButtonProps | ElementProps;
|
|
22
|
+
export type AppendedProps = AppendedButtonProps | ElementProps | undefined;
|
|
23
23
|
/**
|
|
24
24
|
* Interface representing the base properties for an input group component.
|
|
25
25
|
* Extends the properties of a TextField component.
|
package/dist/index.esm.js
CHANGED
|
@@ -15829,7 +15829,7 @@ const ButtonWithDropdown = ({ dropdownItems, triggerIcon, id, extraClassNames, c
|
|
|
15829
15829
|
}))))));
|
|
15830
15830
|
};
|
|
15831
15831
|
|
|
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' +
|
|
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 tw-relative' +
|
|
15833
15833
|
' tw-border-solid tw-border tw-text-sm tw-flex tw-flex-col tw-justify-center tw-items-center';
|
|
15834
15834
|
const darkTheme$1 = 'dark:tw-bg-sq-colored-hover-dark dark:tw-text-sq-dark-text';
|
|
15835
15835
|
const lightTheme$1 = 'tw-text-sq-text-color tw-bg-sq-colored-hover';
|
|
@@ -15838,24 +15838,26 @@ const borderColorClasses$1 = 'tw-border-sq-color-dark';
|
|
|
15838
15838
|
/**
|
|
15839
15839
|
* Alert.
|
|
15840
15840
|
*/
|
|
15841
|
-
const Alert = ({ children, dismissible = true, onClose, show = true, variant, testId, id, extraClassNames, }) => {
|
|
15841
|
+
const Alert = ({ children, dismissible = true, onClose, show = true, variant, testId = 'alert-id', id, extraClassNames, ...tooltipProps }) => {
|
|
15842
15842
|
const appliedTheme = {
|
|
15843
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
|
+
gray: 'tw-bg-sq-light-gray tw-text-sq-text-color dark:tw-bg-sq-dark-disabled-gray dark:tw-text-sq-dark-text',
|
|
15846
15847
|
};
|
|
15847
15848
|
const appliedBorderTheme = {
|
|
15848
15849
|
theme: borderColorClasses$1,
|
|
15849
15850
|
danger: errorClasses$1,
|
|
15850
15851
|
warning: 'tw-border-none',
|
|
15852
|
+
gray: 'tw-border-sq-darkish-gray',
|
|
15851
15853
|
};
|
|
15852
15854
|
const appliedClasses = `${baseClasses$1} ${appliedTheme[variant]} ${extraClassNames} ${appliedBorderTheme[variant]}`;
|
|
15853
15855
|
if (!show) {
|
|
15854
15856
|
return React__default.createElement("div", null);
|
|
15855
15857
|
}
|
|
15856
15858
|
return (React__default.createElement("div", { "data-testid": testId, id: id, className: appliedClasses },
|
|
15857
|
-
|
|
15858
|
-
|
|
15859
|
+
children,
|
|
15860
|
+
dismissible && (React__default.createElement(Icon, { icon: "fc-delete", type: variant.match(/danger|warning/) ? 'color' : 'theme', color: variant.match(/danger|warning/) ? 'inherit' : undefined, extraClassNames: `tw-self-end tw-text-[11px] tw-cursor-pointer tw-absolute tw-right-[10px] tw-top-[10px] ${variant.match(/danger|warning|gray/) ? 'tw-text-sq-text-color dark:tw-text-sq-text-color' : ''}`, testId: `${testId}-close-btn`, onClick: onClose, ...tooltipProps }))));
|
|
15859
15861
|
};
|
|
15860
15862
|
|
|
15861
15863
|
const SeeqActionDropdownItem = (item) => {
|
|
@@ -15932,21 +15934,22 @@ const borderColorClasses = [
|
|
|
15932
15934
|
'focus:tw-border-sq-color-dark',
|
|
15933
15935
|
'active:tw-border-sq-color-dark',
|
|
15934
15936
|
].join(' ');
|
|
15935
|
-
|
|
15937
|
+
const borderRadius = 'tw-rounded-sm tw-rounded-r-none';
|
|
15936
15938
|
const fieldClasses = 'tw-leading-normal tw-outline-none tw-py-1 tw-px-3' + 'tw-p-1 tw-border-solid tw-border';
|
|
15937
15939
|
const darkTheme = 'dark:tw-bg-sq-dark-background dark:tw-text-sq-dark-text disabled:dark:tw-text-sq-dark-text-lighter';
|
|
15938
15940
|
const lightTheme = 'tw-text-sq-text-color disabled:tw-text-sq-darkish-gray';
|
|
15939
15941
|
/**
|
|
15940
15942
|
* InputGroup.
|
|
15941
15943
|
*/
|
|
15942
|
-
const InputGroup = (
|
|
15944
|
+
const InputGroup = React__default.forwardRef((props, ref) => {
|
|
15945
|
+
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;
|
|
15943
15946
|
const tooltipData = getQTipData(tooltipProps);
|
|
15944
15947
|
const appliedClasses = `${baseClasses} ${extraClassNames}`;
|
|
15945
15948
|
const fieldAppliedClasses = `${fieldClasses} ${extraClassNames} ${lightTheme} ${darkTheme} ${borderRadius} ${showError ? errorClasses : borderColorClasses} `;
|
|
15946
|
-
return (React__default.createElement("div", { id: id,
|
|
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-w-full tw-rounded-r-none focus:tw-z-30 ${extraClassNames}`, ...tooltipData })),
|
|
15948
|
-
append.filter(Boolean).map((item, index) => item
|
|
15949
|
-
};
|
|
15949
|
+
return (React__default.createElement("div", { id: id, className: appliedClasses },
|
|
15950
|
+
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 focus:tw-z-30 ${extraClassNames}`, ...tooltipData })),
|
|
15951
|
+
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, tooltip: item.buttonProps.tooltip, tooltipOptions: item.buttonProps.tooltipOptions, tooltipTestId: item.buttonProps.tooltipTestId, isHtmlTooltip: item.buttonProps.isHtmlTooltip, type: item.buttonProps.type, iconPosition: item.buttonProps.iconPosition })) : (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)))));
|
|
15952
|
+
});
|
|
15950
15953
|
|
|
15951
15954
|
// packages/core/number/src/number.ts
|
|
15952
15955
|
function clamp(value, [min, max]) {
|
|
@@ -17162,14 +17165,14 @@ Defaulting to \`null\`.`;
|
|
|
17162
17165
|
var Root = Progress;
|
|
17163
17166
|
var Indicator = ProgressIndicator;
|
|
17164
17167
|
|
|
17165
|
-
const ProgressBar = ({ value, max = 100, label, extraClasses }) => {
|
|
17168
|
+
const ProgressBar = ({ value, max = 100, label, extraClasses, testId }) => {
|
|
17166
17169
|
const tooltipData = getQTipData({ tooltip: label });
|
|
17167
17170
|
const [progress, setProgress] = React__default.useState(0);
|
|
17168
17171
|
React__default.useEffect(() => {
|
|
17169
17172
|
const timer = setTimeout(() => setProgress(value), 500);
|
|
17170
17173
|
return () => clearTimeout(timer);
|
|
17171
17174
|
}, []);
|
|
17172
|
-
return (React__default.createElement("span", { ...tooltipData },
|
|
17175
|
+
return (React__default.createElement("span", { "data-testid": testId, ...tooltipData },
|
|
17173
17176
|
React__default.createElement(Root, { className: "tw-relative tw-h-[18px] tw-w-full tw-overflow-hidden tw-rounded-[2.5px] tw-bg-sq-dark-gray dark:tw-bg-sq-dark-disabled-gray", max: max, value: value },
|
|
17174
17177
|
React__default.createElement(Indicator, { className: `tw-ease-[cubic-bezier(0.65, 0, 0.35, 1)] tw-h-full tw-bg-sq-color-dark tw-transition-transform tw-duration-[660ms] ${extraClasses}`, style: { transform: `translateX(-${100 - progress}%)` } }))));
|
|
17175
17178
|
};
|