@seeqdev/qomponents 0.0.159-patch-package-alternative → 0.0.160
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 +56 -15
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +64 -14
- package/dist/index.js.map +1 -1
- package/dist/src/ToolbarButton/ToolbarButton.types.d.ts +0 -2
- package/dist/src/index.d.ts +1 -0
- package/dist/src/types.d.ts +25 -0
- package/dist/styles.css +4 -0
- package/package.json +2 -4
package/dist/index.esm.js
CHANGED
|
@@ -33,6 +33,7 @@ browserId && parseInt(browserId.split(' ', 2)[1], 10);
|
|
|
33
33
|
const browserIsFirefox = browserId && browserName === 'Firefox';
|
|
34
34
|
|
|
35
35
|
const DEFAULT_TOOL_TIP_DELAY = 500;
|
|
36
|
+
const tooltipPositions = ['top', 'left', 'right', 'bottom'];
|
|
36
37
|
|
|
37
38
|
const getQTipData = ({ tooltip, tooltipPlacement, isHtmlTooltip, tooltipTestId, tooltipDelay = DEFAULT_TOOL_TIP_DELAY, }) => tooltip
|
|
38
39
|
? {
|
|
@@ -1312,7 +1313,7 @@ const arrow$4 = options => ({
|
|
|
1312
1313
|
* clipping boundary. Alternative to `autoPlacement`.
|
|
1313
1314
|
* @see https://floating-ui.com/docs/flip
|
|
1314
1315
|
*/
|
|
1315
|
-
const flip$
|
|
1316
|
+
const flip$4 = function (options) {
|
|
1316
1317
|
if (options === void 0) {
|
|
1317
1318
|
options = {};
|
|
1318
1319
|
}
|
|
@@ -1598,7 +1599,7 @@ const offset$2 = function (options) {
|
|
|
1598
1599
|
* keep it in view when it will overflow the clipping boundary.
|
|
1599
1600
|
* @see https://floating-ui.com/docs/shift
|
|
1600
1601
|
*/
|
|
1601
|
-
const shift$
|
|
1602
|
+
const shift$3 = function (options) {
|
|
1602
1603
|
if (options === void 0) {
|
|
1603
1604
|
options = {};
|
|
1604
1605
|
}
|
|
@@ -2652,7 +2653,7 @@ const offset$1 = offset$2;
|
|
|
2652
2653
|
* keep it in view when it will overflow the clipping boundary.
|
|
2653
2654
|
* @see https://floating-ui.com/docs/shift
|
|
2654
2655
|
*/
|
|
2655
|
-
const shift$
|
|
2656
|
+
const shift$2 = shift$3;
|
|
2656
2657
|
|
|
2657
2658
|
/**
|
|
2658
2659
|
* Optimizes the visibility of the floating element by flipping the `placement`
|
|
@@ -2660,7 +2661,7 @@ const shift$1 = shift$2;
|
|
|
2660
2661
|
* clipping boundary. Alternative to `autoPlacement`.
|
|
2661
2662
|
* @see https://floating-ui.com/docs/flip
|
|
2662
2663
|
*/
|
|
2663
|
-
const flip$
|
|
2664
|
+
const flip$3 = flip$4;
|
|
2664
2665
|
|
|
2665
2666
|
/**
|
|
2666
2667
|
* Provides data that allows you to change the size of the floating element —
|
|
@@ -2999,8 +3000,8 @@ const offset = (options, deps) => ({
|
|
|
2999
3000
|
* keep it in view when it will overflow the clipping boundary.
|
|
3000
3001
|
* @see https://floating-ui.com/docs/shift
|
|
3001
3002
|
*/
|
|
3002
|
-
const shift = (options, deps) => ({
|
|
3003
|
-
...shift$
|
|
3003
|
+
const shift$1 = (options, deps) => ({
|
|
3004
|
+
...shift$2(options),
|
|
3004
3005
|
options: [options, deps]
|
|
3005
3006
|
});
|
|
3006
3007
|
|
|
@@ -3018,8 +3019,8 @@ const limitShift = (options, deps) => ({
|
|
|
3018
3019
|
* clipping boundary. Alternative to `autoPlacement`.
|
|
3019
3020
|
* @see https://floating-ui.com/docs/flip
|
|
3020
3021
|
*/
|
|
3021
|
-
const flip$
|
|
3022
|
-
...flip$
|
|
3022
|
+
const flip$2 = (options, deps) => ({
|
|
3023
|
+
...flip$3(options),
|
|
3023
3024
|
options: [options, deps]
|
|
3024
3025
|
});
|
|
3025
3026
|
|
|
@@ -3186,13 +3187,13 @@ var PopperContent = React.forwardRef(
|
|
|
3186
3187
|
},
|
|
3187
3188
|
middleware: [
|
|
3188
3189
|
offset({ mainAxis: sideOffset + arrowHeight, alignmentAxis: alignOffset }),
|
|
3189
|
-
avoidCollisions && shift({
|
|
3190
|
+
avoidCollisions && shift$1({
|
|
3190
3191
|
mainAxis: true,
|
|
3191
3192
|
crossAxis: false,
|
|
3192
3193
|
limiter: sticky === "partial" ? limitShift() : void 0,
|
|
3193
3194
|
...detectOverflowOptions
|
|
3194
3195
|
}),
|
|
3195
|
-
avoidCollisions && flip$
|
|
3196
|
+
avoidCollisions && flip$2({ ...detectOverflowOptions }),
|
|
3196
3197
|
size({
|
|
3197
3198
|
...detectOverflowOptions,
|
|
3198
3199
|
apply: ({ elements, rects, availableWidth, availableHeight }) => {
|
|
@@ -6880,6 +6881,21 @@ function autoUpdate(reference, floating, update, options) {
|
|
|
6880
6881
|
};
|
|
6881
6882
|
}
|
|
6882
6883
|
|
|
6884
|
+
/**
|
|
6885
|
+
* Optimizes the visibility of the floating element by shifting it in order to
|
|
6886
|
+
* keep it in view when it will overflow the clipping boundary.
|
|
6887
|
+
* @see https://floating-ui.com/docs/shift
|
|
6888
|
+
*/
|
|
6889
|
+
const shift = shift$3;
|
|
6890
|
+
|
|
6891
|
+
/**
|
|
6892
|
+
* Optimizes the visibility of the floating element by flipping the `placement`
|
|
6893
|
+
* in order to keep it in view when the preferred placement(s) will overflow the
|
|
6894
|
+
* clipping boundary. Alternative to `autoPlacement`.
|
|
6895
|
+
* @see https://floating-ui.com/docs/flip
|
|
6896
|
+
*/
|
|
6897
|
+
const flip$1 = flip$4;
|
|
6898
|
+
|
|
6883
6899
|
/**
|
|
6884
6900
|
* Provides data to position an inner element of the floating element so that it
|
|
6885
6901
|
* appears centered to the reference element.
|
|
@@ -7401,8 +7417,8 @@ const QTip = () => {
|
|
|
7401
7417
|
if (tooltipRef.current && tooltipTarget.current) {
|
|
7402
7418
|
computePosition(tooltipTarget.current, tooltipRef.current, {
|
|
7403
7419
|
placement: position,
|
|
7404
|
-
middleware: [offset$2(10), arrow({ element: tooltipArrowRef.current })],
|
|
7405
|
-
}).then(({ x, y, middlewareData }) => {
|
|
7420
|
+
middleware: [offset$2(10), flip$1(), shift({ padding: 8 }), arrow({ element: tooltipArrowRef.current })],
|
|
7421
|
+
}).then(({ x, y, middlewareData, placement: finalPlacement }) => {
|
|
7406
7422
|
Object.assign(tooltipRef.current?.style, {
|
|
7407
7423
|
left: `${x}px`,
|
|
7408
7424
|
top: `${y}px`,
|
|
@@ -7412,7 +7428,7 @@ const QTip = () => {
|
|
|
7412
7428
|
const arrowWidth = tooltipArrowRef.current?.offsetHeight / 2;
|
|
7413
7429
|
const tooltipHeight = tooltipRef.current?.offsetHeight;
|
|
7414
7430
|
const tooltipWidth = tooltipRef.current?.offsetWidth;
|
|
7415
|
-
const style = getArrowStyle(
|
|
7431
|
+
const style = getArrowStyle(finalPlacement, x || y, arrowWidth, tooltipHeight, tooltipWidth);
|
|
7416
7432
|
Object.assign(tooltipArrowRef.current.style, style);
|
|
7417
7433
|
}
|
|
7418
7434
|
setShow(true);
|
|
@@ -7426,7 +7442,7 @@ const QTip = () => {
|
|
|
7426
7442
|
: positionTooltip();
|
|
7427
7443
|
}
|
|
7428
7444
|
};
|
|
7429
|
-
return (jsx$1(Fragment, { children: jsxs("div", { onMouseEnter: () => setOverTooltip(true), onMouseLeave: () => setOverTooltip(false), "data-testid": tooltipTestId, ref: tooltipRef, className: 'tw-absolute tw-rounded tw-bg-black tw-p-2 tw-text-xs tw-text-white tw-z-[9999] fade-in ' +
|
|
7445
|
+
return (jsx$1(Fragment, { children: jsxs("div", { onMouseEnter: () => setOverTooltip(true), onMouseLeave: () => setOverTooltip(false), "data-testid": tooltipTestId, ref: tooltipRef, className: 'tw-absolute tw-rounded tw-bg-black tw-max-w-96 tw-p-2 tw-text-xs tw-text-white tw-z-[9999] fade-in ' +
|
|
7430
7446
|
(show ? 'tw-visible' : 'tw-invisible tw-pointer-events-none'), children: [html ? jsx$1(HTMLTip, { text: tooltipText }) : tooltipText, jsx$1("div", { className: "tw-absolute tw-w-[10px] tw-h-[10px] tw-rotate-45 tw-bg-black", ref: tooltipArrowRef })] }) }));
|
|
7431
7447
|
};
|
|
7432
7448
|
|
|
@@ -28766,5 +28782,30 @@ const Carousel = ({ testId = 'carousel-id', activeIndex = 0, extraClassNames = '
|
|
|
28766
28782
|
return (jsxs("div", { "data-testid": testId, className: `tw-flex tw-flex-col tw-items-center tw-justify-center tw-w-full tw-overflow-hidden ${extraClassNames}`, children: [jsxs("div", { className: "tw-flex tw-items-center tw-w-full tw-h-max tw-gap-1", children: [showArrows && (jsx$1(Button, { icon: prevIcon, size: "lg", variant: "no-border", testId: "carousel-prev", extraClassNames: `${currentIndex === 0 && !continuous ? 'tw-invisible' : ''} ${iconExtraClassNames} tw-animate-fadeIn`, onClick: onBackClick })), jsx$1(motion.div, { custom: 1, initial: "initial", animate: "animate", exit: "exit", variants: slideVariants, className: "tw-w-full", children: carouselItems[currentIndex] }, currentIndex), showArrows && (jsx$1(Button, { icon: nextIcon, testId: "carousel-next", size: "lg", variant: "no-border", extraClassNames: `${currentIndex === carouselItems.length - 1 && !continuous ? 'tw-invisible' : ''} ${iconExtraClassNames} tw-animate-fadeIn`, onClick: onForwardClick }))] }), showIndicators && (jsx$1("div", { className: "tw-flex tw-gap-1 tw-mt-2", children: carouselItems.map((_, i) => (jsx$1("div", { className: `tw-w-2 tw-h-2 tw-rounded-full tw-cursor-pointer ${i === currentIndex ? 'tw-bg-sq-color-dark' : 'tw-bg-sq-darkish-gray'}`, onClick: () => changeSlide(i) }, i))) }))] }));
|
|
28767
28783
|
};
|
|
28768
28784
|
|
|
28769
|
-
|
|
28785
|
+
const buttonTypes = ['button', 'reset', 'submit', 'link'];
|
|
28786
|
+
const buttonSizes = ['sm', 'lg'];
|
|
28787
|
+
const buttonVariants = ['outline', 'theme', 'theme-light', 'warning', 'danger', 'no-border'];
|
|
28788
|
+
const iconPositions = ['left', 'right'];
|
|
28789
|
+
|
|
28790
|
+
const iconTypes = [
|
|
28791
|
+
'theme',
|
|
28792
|
+
'white',
|
|
28793
|
+
'dark-gray',
|
|
28794
|
+
'darkish-gray',
|
|
28795
|
+
'gray',
|
|
28796
|
+
'color',
|
|
28797
|
+
'info',
|
|
28798
|
+
'text',
|
|
28799
|
+
'warning',
|
|
28800
|
+
'inherit',
|
|
28801
|
+
'danger',
|
|
28802
|
+
'theme-light',
|
|
28803
|
+
'success',
|
|
28804
|
+
];
|
|
28805
|
+
|
|
28806
|
+
const svgIconTypes = [...iconTypes, 'default'];
|
|
28807
|
+
|
|
28808
|
+
const toolbarButtonVariants = ['outline', 'theme', 'theme-light', 'warning', 'danger', 'no-border'];
|
|
28809
|
+
|
|
28810
|
+
export { Accordion, Alert, Button, ButtonGroup, ButtonWithDropdown, ButtonWithPopover, Carousel, Checkbox, Collapse, DEFAULT_TOOL_TIP_DELAY, Icon, InputGroup, Modal, ProgressBar, QTip, SeeqActionDropdown, Select, components as SelectCompoents, Slider, Tabs, TextArea, TextField, ToolbarButton, Tooltip, buttonSizes, buttonTypes, buttonVariants, iconPositions, iconTypes, svgIconTypes, toolbarButtonVariants, tooltipPositions };
|
|
28770
28811
|
//# sourceMappingURL=index.esm.js.map
|