@seeqdev/qomponents 0.0.139 → 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 +54 -31
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +54 -31
- package/dist/index.js.map +1 -1
- package/dist/styles.css +56 -30
- package/package.json +1 -1
- package/dist/Accordion/Accordion.js +0 -9
- package/dist/Accordion/Accordion.js.map +0 -1
- package/dist/Accordion/Accordion.stories.js +0 -115
- package/dist/Accordion/Accordion.stories.js.map +0 -1
- package/dist/Accordion/Accordion.test.js +0 -55
- package/dist/Accordion/Accordion.test.js.map +0 -1
- package/dist/Accordion/Accordion.types.js +0 -2
- package/dist/Accordion/Accordion.types.js.map +0 -1
- package/dist/Accordion/index.js +0 -2
- package/dist/Accordion/index.js.map +0 -1
- package/dist/Alert/Alert.js +0 -34
- package/dist/Alert/Alert.js.map +0 -1
- package/dist/Alert/Alert.stories.js +0 -52
- package/dist/Alert/Alert.stories.js.map +0 -1
- package/dist/Alert/Alert.test.js +0 -51
- package/dist/Alert/Alert.test.js.map +0 -1
- package/dist/Alert/Alert.types.js +0 -2
- package/dist/Alert/Alert.types.js.map +0 -1
- package/dist/Alert/index.js +0 -2
- package/dist/Alert/index.js.map +0 -1
- package/dist/Button/Button.js +0 -92
- package/dist/Button/Button.js.map +0 -1
- package/dist/Button/Button.stories.js +0 -100
- package/dist/Button/Button.stories.js.map +0 -1
- package/dist/Button/Button.test.js +0 -49
- package/dist/Button/Button.test.js.map +0 -1
- package/dist/Button/Button.types.js +0 -5
- package/dist/Button/Button.types.js.map +0 -1
- package/dist/Button/index.js +0 -2
- package/dist/Button/index.js.map +0 -1
- package/dist/ButtonGroup/ButtonGroup.js +0 -33
- package/dist/ButtonGroup/ButtonGroup.js.map +0 -1
- package/dist/ButtonGroup/ButtonGroup.stories.js +0 -385
- package/dist/ButtonGroup/ButtonGroup.stories.js.map +0 -1
- package/dist/ButtonGroup/ButtonGroup.test.js +0 -67
- package/dist/ButtonGroup/ButtonGroup.test.js.map +0 -1
- package/dist/ButtonGroup/ButtonGroup.types.js +0 -2
- package/dist/ButtonGroup/ButtonGroup.types.js.map +0 -1
- package/dist/ButtonGroup/index.js +0 -2
- package/dist/ButtonGroup/index.js.map +0 -1
- package/dist/ButtonWithDropdown/ButtonWithDropdown.js +0 -60
- package/dist/ButtonWithDropdown/ButtonWithDropdown.js.map +0 -1
- package/dist/ButtonWithDropdown/ButtonWithDropdown.stories.js +0 -143
- package/dist/ButtonWithDropdown/ButtonWithDropdown.stories.js.map +0 -1
- package/dist/ButtonWithDropdown/ButtonWithDropdown.test.js +0 -93
- package/dist/ButtonWithDropdown/ButtonWithDropdown.test.js.map +0 -1
- package/dist/ButtonWithDropdown/ButtonWithDropdown.types.js +0 -2
- package/dist/ButtonWithDropdown/ButtonWithDropdown.types.js.map +0 -1
- package/dist/ButtonWithDropdown/index.js +0 -2
- package/dist/ButtonWithDropdown/index.js.map +0 -1
- package/dist/ButtonWithPopover/ButtonWithPopover.js +0 -62
- package/dist/ButtonWithPopover/ButtonWithPopover.js.map +0 -1
- package/dist/ButtonWithPopover/ButtonWithPopover.stories.js +0 -75
- package/dist/ButtonWithPopover/ButtonWithPopover.stories.js.map +0 -1
- package/dist/ButtonWithPopover/ButtonWithPopover.test.js +0 -82
- package/dist/ButtonWithPopover/ButtonWithPopover.test.js.map +0 -1
- package/dist/ButtonWithPopover/ButtonWithPopover.types.js +0 -2
- package/dist/ButtonWithPopover/ButtonWithPopover.types.js.map +0 -1
- package/dist/ButtonWithPopover/index.js +0 -2
- package/dist/ButtonWithPopover/index.js.map +0 -1
- package/dist/Carousel/Carousel.js +0 -67
- package/dist/Carousel/Carousel.js.map +0 -1
- package/dist/Carousel/Carousel.stories.js +0 -115
- package/dist/Carousel/Carousel.stories.js.map +0 -1
- package/dist/Carousel/Carousel.test.js +0 -48
- package/dist/Carousel/Carousel.test.js.map +0 -1
- package/dist/Carousel/Carousel.types.js +0 -2
- package/dist/Carousel/Carousel.types.js.map +0 -1
- package/dist/Carousel/index.js +0 -2
- package/dist/Carousel/index.js.map +0 -1
- package/dist/Checkbox/Checkbox.js +0 -26
- package/dist/Checkbox/Checkbox.js.map +0 -1
- package/dist/Checkbox/Checkbox.stories.js +0 -34
- package/dist/Checkbox/Checkbox.stories.js.map +0 -1
- package/dist/Checkbox/Checkbox.test.js +0 -94
- package/dist/Checkbox/Checkbox.test.js.map +0 -1
- package/dist/Checkbox/Checkbox.types.js +0 -2
- package/dist/Checkbox/Checkbox.types.js.map +0 -1
- package/dist/Checkbox/index.js +0 -2
- package/dist/Checkbox/index.js.map +0 -1
- package/dist/Collapse/Collapse.js +0 -18
- package/dist/Collapse/Collapse.js.map +0 -1
- package/dist/Collapse/Collapse.stories.js +0 -37
- package/dist/Collapse/Collapse.stories.js.map +0 -1
- package/dist/Collapse/Collapse.test.js +0 -19
- package/dist/Collapse/Collapse.test.js.map +0 -1
- package/dist/Collapse/Collapse.types.js +0 -2
- package/dist/Collapse/Collapse.types.js.map +0 -1
- package/dist/Collapse/index.js +0 -2
- package/dist/Collapse/index.js.map +0 -1
- package/dist/Icon/Icon.js +0 -55
- package/dist/Icon/Icon.js.map +0 -1
- package/dist/Icon/Icon.stories.js +0 -47
- package/dist/Icon/Icon.stories.js.map +0 -1
- package/dist/Icon/Icon.test.js +0 -55
- package/dist/Icon/Icon.test.js.map +0 -1
- package/dist/Icon/Icon.types.js +0 -16
- package/dist/Icon/Icon.types.js.map +0 -1
- package/dist/Icon/index.js +0 -2
- package/dist/Icon/index.js.map +0 -1
- package/dist/InputGroup/InputGroup.js +0 -32
- package/dist/InputGroup/InputGroup.js.map +0 -1
- package/dist/InputGroup/InputGroup.stories.js +0 -168
- package/dist/InputGroup/InputGroup.stories.js.map +0 -1
- package/dist/InputGroup/InputGroup.test.js +0 -43
- package/dist/InputGroup/InputGroup.test.js.map +0 -1
- package/dist/InputGroup/InputGroup.types.js +0 -2
- package/dist/InputGroup/InputGroup.types.js.map +0 -1
- package/dist/InputGroup/index.js +0 -2
- package/dist/InputGroup/index.js.map +0 -1
- package/dist/Modal/Modal.js +0 -100
- package/dist/Modal/Modal.js.map +0 -1
- package/dist/Modal/Modal.stories.js +0 -127
- package/dist/Modal/Modal.stories.js.map +0 -1
- package/dist/Modal/Modal.test.js +0 -108
- package/dist/Modal/Modal.test.js.map +0 -1
- package/dist/Modal/Modal.types.js +0 -2
- package/dist/Modal/Modal.types.js.map +0 -1
- package/dist/Modal/index.js +0 -2
- package/dist/Modal/index.js.map +0 -1
- package/dist/ProgressBar/ProgressBar.js +0 -50
- package/dist/ProgressBar/ProgressBar.js.map +0 -1
- package/dist/ProgressBar/ProgressBar.stories.js +0 -81
- package/dist/ProgressBar/ProgressBar.stories.js.map +0 -1
- package/dist/ProgressBar/ProgressBar.test.js +0 -44
- 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/SeeqActionDropdown/SeeqActionDropdown.js +0 -48
- package/dist/SeeqActionDropdown/SeeqActionDropdown.js.map +0 -1
- package/dist/SeeqActionDropdown/SeeqActionDropdown.stories.js +0 -87
- package/dist/SeeqActionDropdown/SeeqActionDropdown.stories.js.map +0 -1
- package/dist/SeeqActionDropdown/SeeqActionDropdown.test.js +0 -73
- package/dist/SeeqActionDropdown/SeeqActionDropdown.test.js.map +0 -1
- package/dist/SeeqActionDropdown/SeeqActionDropdown.types.js +0 -2
- package/dist/SeeqActionDropdown/SeeqActionDropdown.types.js.map +0 -1
- package/dist/SeeqActionDropdown/index.js +0 -2
- package/dist/SeeqActionDropdown/index.js.map +0 -1
- package/dist/SeeqActionDropdown/variants.js +0 -38
- package/dist/SeeqActionDropdown/variants.js.map +0 -1
- package/dist/Select/Select.js +0 -174
- package/dist/Select/Select.js.map +0 -1
- package/dist/Select/Select.stories.js +0 -80
- package/dist/Select/Select.stories.js.map +0 -1
- package/dist/Select/Select.test.js +0 -182
- package/dist/Select/Select.test.js.map +0 -1
- package/dist/Select/Select.types.js +0 -2
- package/dist/Select/Select.types.js.map +0 -1
- package/dist/Select/index.js +0 -3
- package/dist/Select/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 -33
- 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
- package/dist/SvgIcon/SvgIcon.js +0 -30
- package/dist/SvgIcon/SvgIcon.js.map +0 -1
- package/dist/SvgIcon/SvgIcon.stories.js +0 -42
- package/dist/SvgIcon/SvgIcon.stories.js.map +0 -1
- package/dist/SvgIcon/SvgIcon.test.js +0 -41
- package/dist/SvgIcon/SvgIcon.test.js.map +0 -1
- package/dist/SvgIcon/SvgIcon.types.js +0 -6
- package/dist/SvgIcon/SvgIcon.types.js.map +0 -1
- package/dist/SvgIcon/index.js +0 -2
- package/dist/SvgIcon/index.js.map +0 -1
- package/dist/Tabs/Tabs.js +0 -22
- package/dist/Tabs/Tabs.js.map +0 -1
- package/dist/Tabs/Tabs.stories.js +0 -91
- package/dist/Tabs/Tabs.stories.js.map +0 -1
- package/dist/Tabs/Tabs.test.js +0 -91
- package/dist/Tabs/Tabs.test.js.map +0 -1
- package/dist/Tabs/Tabs.types.js +0 -2
- package/dist/Tabs/Tabs.types.js.map +0 -1
- package/dist/Tabs/index.js +0 -2
- package/dist/Tabs/index.js.map +0 -1
- package/dist/TextArea/TextArea.js +0 -25
- package/dist/TextArea/TextArea.js.map +0 -1
- package/dist/TextArea/TextArea.stories.js +0 -46
- package/dist/TextArea/TextArea.stories.js.map +0 -1
- package/dist/TextArea/TextArea.test.js +0 -68
- package/dist/TextArea/TextArea.test.js.map +0 -1
- package/dist/TextArea/TextArea.types.js +0 -2
- package/dist/TextArea/TextArea.types.js.map +0 -1
- package/dist/TextArea/index.js +0 -2
- package/dist/TextArea/index.js.map +0 -1
- package/dist/TextField/TextField.js +0 -79
- package/dist/TextField/TextField.js.map +0 -1
- package/dist/TextField/TextField.stories.js +0 -70
- package/dist/TextField/TextField.stories.js.map +0 -1
- package/dist/TextField/TextField.test.js +0 -39
- package/dist/TextField/TextField.test.js.map +0 -1
- package/dist/TextField/TextField.types.js +0 -2
- package/dist/TextField/TextField.types.js.map +0 -1
- package/dist/TextField/index.js +0 -2
- package/dist/TextField/index.js.map +0 -1
- package/dist/ToolbarButton/ToolbarButton.js +0 -75
- package/dist/ToolbarButton/ToolbarButton.js.map +0 -1
- package/dist/ToolbarButton/ToolbarButton.stories.js +0 -94
- package/dist/ToolbarButton/ToolbarButton.stories.js.map +0 -1
- package/dist/ToolbarButton/ToolbarButton.test.js +0 -93
- package/dist/ToolbarButton/ToolbarButton.test.js.map +0 -1
- package/dist/ToolbarButton/ToolbarButton.types.js +0 -2
- package/dist/ToolbarButton/ToolbarButton.types.js.map +0 -1
- package/dist/ToolbarButton/index.js +0 -2
- package/dist/ToolbarButton/index.js.map +0 -1
- package/dist/Tooltip/QTip.stories.js +0 -45
- package/dist/Tooltip/QTip.stories.js.map +0 -1
- package/dist/Tooltip/QTip.types.js +0 -2
- package/dist/Tooltip/QTip.types.js.map +0 -1
- package/dist/Tooltip/QTipPerformance.stories.js +0 -30
- package/dist/Tooltip/QTipPerformance.stories.js.map +0 -1
- package/dist/Tooltip/Qtip.js +0 -168
- package/dist/Tooltip/Qtip.js.map +0 -1
- package/dist/Tooltip/Tooltip.js +0 -36
- package/dist/Tooltip/Tooltip.js.map +0 -1
- package/dist/Tooltip/Tooltip.stories.js +0 -32
- package/dist/Tooltip/Tooltip.stories.js.map +0 -1
- package/dist/Tooltip/Tooltip.types.js +0 -3
- package/dist/Tooltip/Tooltip.types.js.map +0 -1
- package/dist/Tooltip/TooltipPerformance.stories.js +0 -30
- package/dist/Tooltip/TooltipPerformance.stories.js.map +0 -1
- package/dist/Tooltip/index.js +0 -3
- package/dist/Tooltip/index.js.map +0 -1
- package/dist/Tooltip/qTip.utilities.js +0 -11
- package/dist/Tooltip/qTip.utilities.js.map +0 -1
- package/dist/types.js +0 -2
- package/dist/types.js.map +0 -1
- package/dist/utils/browserId.js +0 -29
- package/dist/utils/browserId.js.map +0 -1
- package/dist/utils/svg.js +0 -20
- package/dist/utils/svg.js.map +0 -1
- package/dist/utils/validateStyleDimension.js +0 -14
- package/dist/utils/validateStyleDimension.js.map +0 -1
- package/dist/utils/validateStyleDimension.test.js +0 -20
- package/dist/utils/validateStyleDimension.test.js.map +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/TextField/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,IAAI,OAAO,EAAE,MAAM,aAAa,CAAC"}
|
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import * as PopoverPrimitive from '@radix-ui/react-popover';
|
|
3
|
-
import Icon from '../Icon';
|
|
4
|
-
import { DEFAULT_TOOL_TIP_DELAY } from '../Tooltip/Tooltip.types';
|
|
5
|
-
import { getSvgIconPath } from '../utils/svg';
|
|
6
|
-
const borderStyles = [
|
|
7
|
-
'tw-border-solid',
|
|
8
|
-
'tw-border',
|
|
9
|
-
'tw-rounded-sm',
|
|
10
|
-
'tw-border-sq-disabled-gray',
|
|
11
|
-
'dark:tw-border-gray-500',
|
|
12
|
-
].join(' ');
|
|
13
|
-
const triggerBorderStyles = [
|
|
14
|
-
'tw-border-solid',
|
|
15
|
-
'tw-border',
|
|
16
|
-
'tw-rounded-sm',
|
|
17
|
-
'tw-border-transparent',
|
|
18
|
-
'hover:tw-border-solid',
|
|
19
|
-
'hover:tw-border',
|
|
20
|
-
'hover:tw-rounded-sm',
|
|
21
|
-
'hover:tw-border-sq-darkish-gray',
|
|
22
|
-
'active:tw-border-sq-color-dark',
|
|
23
|
-
'dark:hover:tw-border-sq-color-dark-dark',
|
|
24
|
-
'dark:focus:tw-border-sq-color-dark-dark',
|
|
25
|
-
'dark:active:tw-border-sq-color-dark-dark',
|
|
26
|
-
].join(' ');
|
|
27
|
-
const activeBorderStyles = [
|
|
28
|
-
'active',
|
|
29
|
-
'tw-border-solid',
|
|
30
|
-
'tw-border',
|
|
31
|
-
'tw-rounded-sm',
|
|
32
|
-
'tw-border-sq-color-dark',
|
|
33
|
-
'active:tw-border-sq-color-dark',
|
|
34
|
-
'dark:hover:tw-border-sq-color-dark-dark',
|
|
35
|
-
].join(' ');
|
|
36
|
-
const bgStyles = ['tw-bg-sq-white', 'dark:tw-bg-sq-dark-background'].join(' ');
|
|
37
|
-
const disabledClasses = ['tw-opacity-50', 'tw-cursor-not-allowed'].join(' ');
|
|
38
|
-
const PopoverContent = React.forwardRef(({ className, align = 'center', sideOffset = 4, ...props }, ref) => (React.createElement(PopoverPrimitive.Content, { ref: ref, align: align, sideOffset: sideOffset, ...props, asChild: true })));
|
|
39
|
-
export const ToolbarButton = ({ isSmall = false, label, icon, secondIcon, forceSmallIcon = false, tooltipText, id, popoverContent, extraClassNames, testId, tooltipTestId, tooltipOptions, isActive = false, isHtmlTooltip = false, hasArrow = false, disabled = false, isPrimaryAnSvg = false, primaryIconExtraClassNames = false, iconHeight = 24, iconWidth = 24, primaryIconViewbox = '0 0 24 24', onClick, onHide, }) => {
|
|
40
|
-
let tooltipData = undefined;
|
|
41
|
-
if (tooltipText) {
|
|
42
|
-
tooltipData = {
|
|
43
|
-
'data-qtip-text': tooltipText,
|
|
44
|
-
'data-qtip-placement': tooltipOptions?.position,
|
|
45
|
-
'data-qtip-is-html': isHtmlTooltip,
|
|
46
|
-
'data-qtip-testid': tooltipTestId,
|
|
47
|
-
'data-qtip-delay': tooltipOptions?.delay ?? DEFAULT_TOOL_TIP_DELAY,
|
|
48
|
-
};
|
|
49
|
-
}
|
|
50
|
-
const onOpenChange = (open) => {
|
|
51
|
-
if (!open) {
|
|
52
|
-
onHide && onHide();
|
|
53
|
-
}
|
|
54
|
-
};
|
|
55
|
-
return (React.createElement(PopoverPrimitive.Root, { defaultOpen: false, onOpenChange: onOpenChange },
|
|
56
|
-
React.createElement(PopoverPrimitive.Trigger, { id: id, className: `tw-border-none ${isActive ? 'active' : ''}`, disabled: disabled, "data-testid": testId, onClick: (e) => {
|
|
57
|
-
onClick && onClick(e);
|
|
58
|
-
} },
|
|
59
|
-
React.createElement("div", { ...tooltipData, className: `tw-bg-transparent tw-p-0 tw-flex tw-flex-col tw-items-center ${isSmall ? 'tw-py-[1px] tw-px-[5px]' : 'tw-px-2 tw-py-[5px]'} ${disabled ? disabledClasses : isActive ? activeBorderStyles : triggerBorderStyles} ${extraClassNames || ''}` },
|
|
60
|
-
React.createElement("span", { className: "tw-nowrap" },
|
|
61
|
-
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 },
|
|
62
|
-
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` })),
|
|
63
|
-
secondIcon && React.createElement(Icon, { icon: secondIcon, type: "text", testId: "secondIcon" }),
|
|
64
|
-
popoverContent ? (React.createElement(Icon, { icon: "fc-arrow-dropdown", extraClassNames: "tw-text-sq-text-color dark:tw-text-sq-dark-text tw-ml-[3px] tw-text-[8px]", type: "text" })) : undefined),
|
|
65
|
-
!isSmall && (React.createElement("small", { className: "tw-text-sq-text-color dark:tw-text-sq-dark-text tw-text-[10px]" }, label)))),
|
|
66
|
-
!!popoverContent ? (React.createElement(PopoverContent, { sideOffset: 2, align: "start" },
|
|
67
|
-
React.createElement("div", { className: bgStyles +
|
|
68
|
-
' 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' +
|
|
69
|
-
' 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' +
|
|
70
|
-
borderStyles },
|
|
71
|
-
hasArrow && (React.createElement(PopoverPrimitive.Arrow, { asChild: true },
|
|
72
|
-
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" }))),
|
|
73
|
-
popoverContent))) : undefined));
|
|
74
|
-
};
|
|
75
|
-
//# sourceMappingURL=ToolbarButton.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ToolbarButton.js","sourceRoot":"","sources":["../../src/ToolbarButton/ToolbarButton.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,gBAAgB,MAAM,yBAAyB,CAAC;AAE5D,OAAO,IAAI,MAAM,SAAS,CAAC;AAE3B,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAE9C,MAAM,YAAY,GAAG;IACnB,iBAAiB;IACjB,WAAW;IACX,eAAe;IACf,4BAA4B;IAC5B,yBAAyB;CAC1B,CA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BACA,cAAc,CACX,CACS,CAClB,CAAC,CAAC,CAAC,SAAS,CACS,CACzB,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -1,94 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { ToolbarButton } from './ToolbarButton';
|
|
3
|
-
import Icon from '../Icon';
|
|
4
|
-
import { QTip } from '../Tooltip/Qtip';
|
|
5
|
-
export default {
|
|
6
|
-
title: 'Toolbar Button',
|
|
7
|
-
};
|
|
8
|
-
export const AllToolbarButtonVariants = () => {
|
|
9
|
-
const options = [
|
|
10
|
-
{ value: 'a', label: 'Chocolate' },
|
|
11
|
-
{ value: 'b', label: 'Strawberry' },
|
|
12
|
-
{ value: 'c', label: 'Vanilla' },
|
|
13
|
-
{ value: 'd', label: 'Rocky Road' },
|
|
14
|
-
{ value: 'e', label: 'Crazy Cow' },
|
|
15
|
-
{ value: 'f', label: 'Almond Joy' },
|
|
16
|
-
{ value: 'g', label: 'All of the above' },
|
|
17
|
-
];
|
|
18
|
-
const colorOptions = [
|
|
19
|
-
{ value: 'h', label: 'pink' },
|
|
20
|
-
{ value: 'i', label: 'purple' },
|
|
21
|
-
{ value: 'j', label: 'green' },
|
|
22
|
-
{ value: 'k', label: 'red' },
|
|
23
|
-
];
|
|
24
|
-
const allToolbarButtons = (isDark) => (React.createElement("div", { className: isDark ? 'tw-dark tw-bg-sq-dark-background' : '' },
|
|
25
|
-
React.createElement("div", { className: "tw-p-5 " },
|
|
26
|
-
React.createElement(ToolbarButton, { icon: "fc-y-axis", label: "Popover", testId: "basic-popover1", tooltipText: "This is a small popover.", tooltipOptions: { position: 'top', delay: 0 }, isHtmlTooltip: false, isSmall: true, popoverContent: React.createElement("div", { className: "tw-text-sm dark:tw-text-white" },
|
|
27
|
-
React.createElement("p", { className: "tw-bg-gray-200 dark:tw-bg-gray-700 tw-p-2" }, "Flavors"),
|
|
28
|
-
options.map((option) => (React.createElement("div", { key: option.value, className: "tw-flex tw-items-center tw-p-2 hover:tw-bg-green-500" },
|
|
29
|
-
React.createElement(Icon, { type: "color", color: "green", icon: "fc-check", extraClassNames: "tw-mr-2" }),
|
|
30
|
-
React.createElement("span", null, option.label)))),
|
|
31
|
-
React.createElement("p", { className: "tw-bg-gray-200 dark:tw-bg-gray-700 tw-p-2" }, "Colors"),
|
|
32
|
-
colorOptions.map((option) => (React.createElement("div", { key: option.value, className: "tw-flex tw-items-center tw-p-2" },
|
|
33
|
-
React.createElement(Icon, { type: "color", color: "green", icon: "fc-check", extraClassNames: "tw-mr-2" }),
|
|
34
|
-
React.createElement("span", null, option.label))))) })),
|
|
35
|
-
React.createElement("div", { className: "tw-p-5 " },
|
|
36
|
-
React.createElement(ToolbarButton, { icon: "fc-y-axis", label: "Normal", testId: "basic-popover1", tooltipText: "This is a normal popover.", tooltipOptions: { position: 'top', delay: 0 }, isHtmlTooltip: false, popoverContent: React.createElement("div", { className: "tw-text-sm dark:tw-text-white" },
|
|
37
|
-
React.createElement("p", { className: "tw-bg-gray-200 dark:tw-bg-gray-700 tw-p-2" }, "Flavors"),
|
|
38
|
-
options.map((option) => (React.createElement("div", { key: option.value, className: "tw-flex tw-items-center tw-p-2 hover:tw-bg-green-500" },
|
|
39
|
-
React.createElement(Icon, { type: "color", color: "green", icon: "fc-check", extraClassNames: "tw-mr-2" }),
|
|
40
|
-
React.createElement("span", null, option.label)))),
|
|
41
|
-
React.createElement("p", { className: "tw-bg-gray-200 dark:tw-bg-gray-700 tw-p-2" }, "Colors"),
|
|
42
|
-
colorOptions.map((option) => (React.createElement("div", { key: option.value, className: "tw-flex tw-items-center tw-p-2" },
|
|
43
|
-
React.createElement(Icon, { type: "color", color: "green", icon: "fc-check", extraClassNames: "tw-mr-2" }),
|
|
44
|
-
React.createElement("span", null, option.label))))) })),
|
|
45
|
-
React.createElement("div", { className: "tw-p-5 " },
|
|
46
|
-
React.createElement(ToolbarButton, { icon: "fc-y-axis", label: "With arrow", testId: "basic-popover1", tooltipText: "This is a normal popover.", tooltipOptions: { position: 'top', delay: 0 }, hasArrow: true, isHtmlTooltip: false, popoverContent: React.createElement("div", { className: "tw-text-sm dark:tw-text-white" },
|
|
47
|
-
React.createElement("p", { className: "tw-bg-gray-200 dark:tw-bg-gray-700 tw-p-2" }, "Flavors"),
|
|
48
|
-
options.map((option) => (React.createElement("div", { key: option.value, className: "tw-flex tw-items-center tw-p-2 hover:tw-bg-green-500" },
|
|
49
|
-
React.createElement(Icon, { type: "color", color: "green", icon: "fc-check", extraClassNames: "tw-mr-2" }),
|
|
50
|
-
React.createElement("span", null, option.label)))),
|
|
51
|
-
React.createElement("p", { className: "tw-bg-gray-200 dark:tw-bg-gray-700 tw-p-2" }, "Colors"),
|
|
52
|
-
colorOptions.map((option) => (React.createElement("div", { key: option.value, className: "tw-flex tw-items-center tw-p-2" },
|
|
53
|
-
React.createElement(Icon, { type: "color", color: "green", icon: "fc-check", extraClassNames: "tw-mr-2" }),
|
|
54
|
-
React.createElement("span", null, option.label))))) })),
|
|
55
|
-
React.createElement("div", { className: "tw-p-5 " },
|
|
56
|
-
React.createElement("p", { className: "tw-text-sq-color-dark tw-text-[10px]" }, "Without popup"),
|
|
57
|
-
React.createElement(ToolbarButton, { icon: "fc-y-axis", label: "Button", testId: "basic-popover3", isHtmlTooltip: false })),
|
|
58
|
-
React.createElement("div", { className: "tw-p-5 " },
|
|
59
|
-
React.createElement(ToolbarButton, { icon: "fc-y-axis", label: "Disabled", testId: "basic-popover2", tooltipText: "This is a popover.", tooltipOptions: { position: 'top' }, isHtmlTooltip: false, disabled: true, popoverContent: React.createElement("div", { className: "tw-border tw-border-gray-100 tw-p-2 tw-rounded-sm tw-text-sm dark:tw-bg-sq-dark-background" },
|
|
60
|
-
React.createElement("p", { className: "tw-bg-gray-200 dark:tw-bg-gray-700 tw-p-2" }, "Flavors"),
|
|
61
|
-
options.map((option) => (React.createElement("div", { key: option.value, className: "tw-flex tw-items-center tw-p-2 hover:tw-bg-green-500" },
|
|
62
|
-
React.createElement(Icon, { type: "color", color: "green", icon: "fc-check", extraClassNames: "tw-mr-2" }),
|
|
63
|
-
React.createElement("span", null, option.label)))),
|
|
64
|
-
React.createElement("p", { className: "tw-bg-gray-200 dark:tw-bg-gray-700 tw-p-2" }, "Colors"),
|
|
65
|
-
colorOptions.map((option) => (React.createElement("div", { key: option.value, className: "tw-flex tw-items-center tw-p-2" },
|
|
66
|
-
React.createElement(Icon, { type: "color", color: "green", icon: "fc-check", extraClassNames: "tw-mr-2" }),
|
|
67
|
-
React.createElement("span", null, option.label))))) })),
|
|
68
|
-
React.createElement("div", { className: "tw-p-5 " },
|
|
69
|
-
React.createElement(ToolbarButton, { id: "scatterPlotFlipXY", isActive: false, disabled: true, testId: "scatterPlotFlipXY", label: "", icon: "fc-grab-window", tooltipText: "This is a large disabled popover.", tooltipOptions: { position: 'top' }, extraClassNames: "no-border ml5" })),
|
|
70
|
-
React.createElement("div", { className: "tw-p-5 " },
|
|
71
|
-
React.createElement(ToolbarButton, { icon: "fc-y-axis", tooltipText: "This is a large popover icon", tooltipOptions: { position: 'top', delay: 0 }, testId: "basic-popover4", isHtmlTooltip: false })),
|
|
72
|
-
React.createElement("div", { className: "tw-p-5 " },
|
|
73
|
-
React.createElement(ToolbarButton, { icon: "fc-y-axis", label: "Active", testId: "basic-popover5", tooltipText: "This is a button.", tooltipOptions: { position: 'top', delay: 0 }, isHtmlTooltip: false, isActive: true })),
|
|
74
|
-
React.createElement("div", { className: "tw-p-5 " },
|
|
75
|
-
React.createElement(ToolbarButton, { isPrimaryAnSvg: true, iconHeight: 13, iconWidth: 13, icon: "svgpath:M 19 2.76 L 18.016 4.066 L 7.678 17.765 L 6.745 19 L 5.812 17.765 L 0.984 11.373 L 0 10.067 L 1.867 7.307 L 2.851 8.613 L 6.745 13.771 L 16.149 1.306 L 17.133 0 L 19 2.76 Z", label: "Active", testId: "basic-popover5", tooltipText: "This is a button.", tooltipOptions: { position: 'top', delay: 0 }, isHtmlTooltip: false, isActive: true }))));
|
|
76
|
-
const renderAllVariations = () => (React.createElement("div", { className: "tw-grid tw-grid-cols-2 tw-gap-4 tw-p-4" },
|
|
77
|
-
allToolbarButtons(),
|
|
78
|
-
allToolbarButtons(true)));
|
|
79
|
-
return (React.createElement("div", { className: "tw-grid tw-grid-cols-4 tw-gap-4" },
|
|
80
|
-
React.createElement(QTip, null),
|
|
81
|
-
React.createElement("div", { className: "color_topic" },
|
|
82
|
-
React.createElement("b", null, "Topic Colors"),
|
|
83
|
-
renderAllVariations()),
|
|
84
|
-
React.createElement("div", { className: "color_analysis" },
|
|
85
|
-
React.createElement("b", null, "Analysis Colors"),
|
|
86
|
-
renderAllVariations()),
|
|
87
|
-
React.createElement("div", { className: "color_datalab" },
|
|
88
|
-
React.createElement("b", null, "Datalab Colors"),
|
|
89
|
-
renderAllVariations()),
|
|
90
|
-
React.createElement("div", { className: "color_vantage" },
|
|
91
|
-
React.createElement("b", null, "Vantage Colors"),
|
|
92
|
-
renderAllVariations())));
|
|
93
|
-
};
|
|
94
|
-
//# sourceMappingURL=ToolbarButton.stories.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ToolbarButton.stories.js","sourceRoot":"","sources":["../../src/ToolbarButton/ToolbarButton.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,IAAI,MAAM,SAAS,CAAC;AAC3B,OAAO,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AAEvC,eAAe;IACb,KAAK,EAAE,gBAAgB;CACxB,CAAC;AAEF,MAAM,CAAC,MAAM,wBAAwB,GAAG,GAAG,EAAE;IAC3C,MAAM,OAAO,GAAG;QACd,EAAE,KAAK,EAAE,GAAG,EAAE,KAAK,EAAE,WAAW,EAAE;QAClC,EAAE,KAAK,EAAE,GAAG,EAAE,KAAK,EAAE,YAAY,EAAE;QACnC,EAAE,KAAK,EAAE,GAAG,E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C;IACF,MAAM,mBAAmB,GAAG,GAAG,EAAE,CAAC,CAChC,6BAAK,SAAS,EAAC,wCAAwC;QACpD,iBAAiB,EAAE;QACnB,iBAAiB,CAAC,IAAI,CAAC,CACpB,CACP,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"}
|
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import '@testing-library/jest-dom';
|
|
3
|
-
import { render, screen } from '@testing-library/react';
|
|
4
|
-
import userEvent from '@testing-library/user-event';
|
|
5
|
-
import { ToolbarButton } from './ToolbarButton';
|
|
6
|
-
import Icon from '../Icon';
|
|
7
|
-
describe('ToolbarButton', () => {
|
|
8
|
-
const options = [
|
|
9
|
-
{ value: 'a', label: 'Chocolate' },
|
|
10
|
-
{ value: 'b', label: 'Strawberry' },
|
|
11
|
-
{ value: 'c', label: 'Vanilla' },
|
|
12
|
-
{ value: 'd', label: 'Rocky Road' },
|
|
13
|
-
{ value: 'e', label: 'Crazy Cow' },
|
|
14
|
-
{ value: 'f', label: 'Almond Joy' },
|
|
15
|
-
{ value: 'g', label: 'All of the above' },
|
|
16
|
-
];
|
|
17
|
-
const colorOptions = [
|
|
18
|
-
{ value: 'h', label: 'pink' },
|
|
19
|
-
{ value: 'i', label: 'purple' },
|
|
20
|
-
{ value: 'j', label: 'green' },
|
|
21
|
-
{ value: 'k', label: 'red' },
|
|
22
|
-
];
|
|
23
|
-
const popoverContent = (React.createElement("div", { className: "tw-text-sm" },
|
|
24
|
-
React.createElement("p", { className: "tw-bg-gray-200 tw-p-2" }, "Flavors"),
|
|
25
|
-
options.map((option) => (React.createElement("div", { key: option.value, className: "tw-flex tw-items-center tw-p-2 hover:tw-bg-green-500" },
|
|
26
|
-
React.createElement(Icon, { type: "color", color: "green", icon: "fc-check", extraClassNames: "tw-mr-2" }),
|
|
27
|
-
React.createElement("span", null, option.label)))),
|
|
28
|
-
React.createElement("p", null, "Colors"),
|
|
29
|
-
colorOptions.map((option) => (React.createElement("div", { key: option.value, className: "tw-flex tw-items-center tw-p-2" },
|
|
30
|
-
React.createElement(Icon, { type: "color", color: "green", icon: "fc-check", extraClassNames: "tw-mr-2" }),
|
|
31
|
-
React.createElement("span", null, option.label))))));
|
|
32
|
-
const mockOnClick = jest.fn();
|
|
33
|
-
class Context {
|
|
34
|
-
testId = 'popoverTestId';
|
|
35
|
-
label = 'popover label';
|
|
36
|
-
props = {
|
|
37
|
-
label: this.label,
|
|
38
|
-
onClick: mockOnClick,
|
|
39
|
-
testId: this.testId,
|
|
40
|
-
icon: 'fc-y-axis',
|
|
41
|
-
tooltipText: 'This is a popover.',
|
|
42
|
-
tooltipOptions: { position: 'top', delay: 0 },
|
|
43
|
-
isHtmlTooltip: false,
|
|
44
|
-
isSmall: false,
|
|
45
|
-
popoverContent,
|
|
46
|
-
};
|
|
47
|
-
}
|
|
48
|
-
let tc;
|
|
49
|
-
beforeEach(() => {
|
|
50
|
-
tc = new Context();
|
|
51
|
-
jest.clearAllMocks();
|
|
52
|
-
});
|
|
53
|
-
const renderToolbarButton = (props) => render(React.createElement(ToolbarButton, { ...props }));
|
|
54
|
-
const openPopover = async () => {
|
|
55
|
-
const popover = screen.getByTestId(tc.testId);
|
|
56
|
-
await userEvent.click(popover);
|
|
57
|
-
};
|
|
58
|
-
it('renders popover icon without label when small', () => {
|
|
59
|
-
tc.props.isSmall = true;
|
|
60
|
-
renderToolbarButton(tc.props);
|
|
61
|
-
const popoverLabel = screen.queryByText(tc.label);
|
|
62
|
-
expect(popoverLabel).not.toBeInTheDocument();
|
|
63
|
-
});
|
|
64
|
-
it('renders popover trigger button', () => {
|
|
65
|
-
renderToolbarButton(tc.props);
|
|
66
|
-
expect(screen.getByText(tc.label)).toBeInTheDocument();
|
|
67
|
-
});
|
|
68
|
-
it('opens popover on click', async () => {
|
|
69
|
-
renderToolbarButton(tc.props);
|
|
70
|
-
await openPopover();
|
|
71
|
-
expect(screen.getByText(options[2].label)).toBeVisible();
|
|
72
|
-
});
|
|
73
|
-
it('renders disabled popover trigger', async () => {
|
|
74
|
-
renderToolbarButton({ ...tc.props, disabled: true });
|
|
75
|
-
await openPopover();
|
|
76
|
-
expect(mockOnClick).not.toHaveBeenCalled();
|
|
77
|
-
});
|
|
78
|
-
it('handles click events', async () => {
|
|
79
|
-
const handleClick = jest.fn();
|
|
80
|
-
tc.props.onClick = handleClick;
|
|
81
|
-
const { getByTestId } = renderToolbarButton(tc.props);
|
|
82
|
-
await userEvent.click(getByTestId(tc.testId));
|
|
83
|
-
expect(handleClick).toHaveBeenCalled();
|
|
84
|
-
});
|
|
85
|
-
it('handles click events within popover and does not close the popover', async () => {
|
|
86
|
-
renderToolbarButton(tc.props);
|
|
87
|
-
expect(screen.queryByText(options[4].label)).not.toBeInTheDocument();
|
|
88
|
-
await openPopover();
|
|
89
|
-
await userEvent.click(screen.getByText(options[3].label));
|
|
90
|
-
expect(screen.getByText(options[4].label)).toBeInTheDocument();
|
|
91
|
-
});
|
|
92
|
-
});
|
|
93
|
-
//# sourceMappingURL=ToolbarButton.test.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ToolbarButton.test.js","sourceRoot":"","sources":["../../src/ToolbarButton/ToolbarButton.test.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,2BAA2B,CAAC;AACnC,OAAO,EAAE,MA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version":3,"file":"index.js","sourceRoot":"","sources":["../../src/ToolbarButton/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,IAAI,OAAO,EAAE,MAAM,iBAAiB,CAAC"}
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import Button from '../Button';
|
|
3
|
-
import { tooltipPositions } from './Tooltip.types';
|
|
4
|
-
import { QTip } from './Qtip';
|
|
5
|
-
import Icon from '../Icon';
|
|
6
|
-
export default {
|
|
7
|
-
title: 'Tooltip',
|
|
8
|
-
};
|
|
9
|
-
export const AllQTips = () => {
|
|
10
|
-
const renderSvgWithTooltip = () => tooltipPositions.map((position) => (React.createElement("div", { className: "tw-w-full tw-flex tw-justify-center tw-items-center" },
|
|
11
|
-
React.createElement("div", { "data-qtip-text": "this is a test tooltip", "data-qtip-placement": position, key: `${position}_svg` },
|
|
12
|
-
React.createElement("svg", { viewBox: "0 0 19 19", xmlns: "http://www.w3.org/2000/svg", className: "seeq-icon p2", height: "19", width: "19" },
|
|
13
|
-
React.createElement("path", { d: "M 2.714 1.188 L 2.714 0 L 0 0 L 0 1.188 L 0 2.375 L 0 13.656 L 0 17.813 L 0 19 L 2.714 19 L 2.714 17.813 L 2.714 13.063 L 5.441 12.465 C 7.184 12.083 9.029 12.261 10.637 12.962 C 12.511 13.782 14.687 13.883 16.646 13.237 L 19 12.469 L 19 0.594 L 16.693 1.603 C 14.729 2.464 12.418 2.464 10.454 1.603 C 8.966 0.95 7.256 0.787 5.641 1.139 L 2.714 1.781 L 2.714 1.188 Z", fill: "red" }))))));
|
|
14
|
-
const renderButtonsWithTooltip = () => tooltipPositions.map((position) => (React.createElement("div", { key: `${position}_button` },
|
|
15
|
-
React.createElement(Button, { tooltip: `Tooltip on the ${position}`, label: position, tooltipOptions: { position } }))));
|
|
16
|
-
const renderIconsWithHtmlTooltip = () => tooltipPositions.map((position) => (React.createElement("div", { key: `${position}_icon` },
|
|
17
|
-
React.createElement(Icon, { tooltip: "<div><h2>Fancy Tooltip</h2> This is a special tooltip. Why? <br />Because it supports <b>HTML!</b></div>", tooltipPlacement: position, icon: "fc-sun", isHtmlTooltip: true }))));
|
|
18
|
-
const renderTextTooltipOnText = () => tooltipPositions.map((position) => (React.createElement("div", { key: `${position}_text` },
|
|
19
|
-
React.createElement("span", { "data-qtip-text": "Helpful information provided here", "data-qtip-placement": position },
|
|
20
|
-
"Hover for Tooltip (on the ",
|
|
21
|
-
position,
|
|
22
|
-
")"))));
|
|
23
|
-
const renderTextTooltipOnTextWithDelay = () => tooltipPositions.map((position) => (React.createElement("div", { key: `${position}_text` },
|
|
24
|
-
React.createElement("span", { "data-qtip-text": "Helpful information provided here", "data-qtip-placement": position, "data-qtip-delay": 1500 },
|
|
25
|
-
"Hover for Tooltip (on the ",
|
|
26
|
-
position,
|
|
27
|
-
") - with delay (1500ms)"))));
|
|
28
|
-
const renderTextTooltipOnOverflowHiddenText = () => tooltipPositions.map((position) => (React.createElement("div", { key: `${position}_text`, className: "tw-overflow-hidden" },
|
|
29
|
-
React.createElement("span", { "data-qtip-text": "Helpful information provided here", "data-qtip-placement": position },
|
|
30
|
-
"Hover for Tooltip (on the ",
|
|
31
|
-
position,
|
|
32
|
-
")",
|
|
33
|
-
React.createElement("br", null),
|
|
34
|
-
"(Overflow set to hidden)"))));
|
|
35
|
-
return (React.createElement(React.Fragment, null,
|
|
36
|
-
React.createElement(QTip, null),
|
|
37
|
-
React.createElement("div", { className: "tw-grid tw-grid-cols-4 tw-gap-4 tw-text-center" },
|
|
38
|
-
renderSvgWithTooltip(),
|
|
39
|
-
renderButtonsWithTooltip(),
|
|
40
|
-
renderIconsWithHtmlTooltip(),
|
|
41
|
-
renderTextTooltipOnText(),
|
|
42
|
-
renderTextTooltipOnTextWithDelay(),
|
|
43
|
-
renderTextTooltipOnOverflowHiddenText())));
|
|
44
|
-
};
|
|
45
|
-
//# sourceMappingURL=QTip.stories.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
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"file":"QTip.types.js","sourceRoot":"","sources":["../../src/Tooltip/QTip.types.ts"],"names":[],"mappings":""}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { QTip } from './Qtip';
|
|
3
|
-
import Icon from '../Icon';
|
|
4
|
-
export default {
|
|
5
|
-
title: 'Tooltip',
|
|
6
|
-
};
|
|
7
|
-
const renderManyQTips = () => {
|
|
8
|
-
const colsCount = 100;
|
|
9
|
-
const rowCount = 100;
|
|
10
|
-
const rows = [];
|
|
11
|
-
const getCols = (rowId) => {
|
|
12
|
-
const cols = [];
|
|
13
|
-
for (let i = 0; i < colsCount; i++) {
|
|
14
|
-
cols.push(React.createElement("td", { key: 'col_' + i + '_row_' + rowId },
|
|
15
|
-
React.createElement(Icon, { icon: "fc-sun", tooltip: `hello there ${i}` })));
|
|
16
|
-
}
|
|
17
|
-
return cols;
|
|
18
|
-
};
|
|
19
|
-
for (let i = 0; i < rowCount; i++) {
|
|
20
|
-
rows.push(React.createElement("tr", { key: 'row_' + i }, ...getCols(i)));
|
|
21
|
-
}
|
|
22
|
-
return (React.createElement("table", null,
|
|
23
|
-
React.createElement("tbody", null, rows.map((row) => row))));
|
|
24
|
-
};
|
|
25
|
-
export const QtipPerformance = () => {
|
|
26
|
-
return (React.createElement(React.Fragment, null,
|
|
27
|
-
React.createElement(QTip, null),
|
|
28
|
-
React.createElement("div", { className: "tw-grid tw-grid-cols-4 tw-gap-4 tw-text-center" }, renderManyQTips())));
|
|
29
|
-
};
|
|
30
|
-
//# sourceMappingURL=QTipPerformance.stories.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"QTipPerformance.stories.js","sourceRoot":"","sources":["../../src/Tooltip/QTipPerformance.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAC9B,OAAO,IAAI,MAAM,SAAS,CAAC;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{ useEffect, useRef, useState } from 'react';
|
|
3
|
-
import { arrow, computePosition, offset } from '@floating-ui/dom';
|
|
4
|
-
import { useIntervalWhen } from 'rooks';
|
|
5
|
-
import { DEFAULT_TOOL_TIP_DELAY } from './Tooltip.types';
|
|
6
|
-
const getArrowStyle = (position, x, arrowWidth, tooltipHeight, tooltipWidth) => {
|
|
7
|
-
switch (position) {
|
|
8
|
-
case 'bottom':
|
|
9
|
-
return {
|
|
10
|
-
left: `${x}px`,
|
|
11
|
-
top: `${-arrowWidth}px`,
|
|
12
|
-
};
|
|
13
|
-
case 'left':
|
|
14
|
-
return {
|
|
15
|
-
left: `${tooltipWidth - arrowWidth}px`,
|
|
16
|
-
top: `${tooltipHeight / 2 - arrowWidth}px`,
|
|
17
|
-
};
|
|
18
|
-
case 'right':
|
|
19
|
-
return {
|
|
20
|
-
left: `${-arrowWidth}px`,
|
|
21
|
-
top: `${tooltipHeight / 2 - arrowWidth}px`,
|
|
22
|
-
};
|
|
23
|
-
default: // 'top':
|
|
24
|
-
return {
|
|
25
|
-
left: `${x}px`,
|
|
26
|
-
top: `${tooltipHeight - 10 + arrowWidth}px`,
|
|
27
|
-
};
|
|
28
|
-
}
|
|
29
|
-
};
|
|
30
|
-
const HTMLTip = ({ text }) => {
|
|
31
|
-
return React.createElement('div', {
|
|
32
|
-
dangerouslySetInnerHTML: { __html: DOMPurify.sanitize(text) },
|
|
33
|
-
});
|
|
34
|
-
};
|
|
35
|
-
/** Tooltips can cause SystemTests to be flaky, so we suppress them in Playwright and Protractor */
|
|
36
|
-
const suppressTooltip = () => {
|
|
37
|
-
return window.navigator.userAgent === 'Playwright' || window.navigator.userAgent.includes('Protractor');
|
|
38
|
-
};
|
|
39
|
-
/**
|
|
40
|
-
* QTip
|
|
41
|
-
*
|
|
42
|
-
* QTip is a Singleton Tooltip component that guarantees high-performance and reduces component wrappers!
|
|
43
|
-
*
|
|
44
|
-
* QTip is used by all qomponents that support the display of tooltips.
|
|
45
|
-
* If you want to add a Tooltip to your application you can do so by adding the following html data-attributes:
|
|
46
|
-
*
|
|
47
|
-
* 'data-qtip-text': the tooltip text to display; this can also be a string containing valid HTML
|
|
48
|
-
* 'data-qtip-placement': one of TooltipPosition (top, bottom, right, or left)
|
|
49
|
-
* 'data-qtip-is-html': set this to true if you provided a text that contains HTML,
|
|
50
|
-
* 'data-qtip-delay': this can be used to delay the showing of the tooltip. this should be a number representing
|
|
51
|
-
* the # of milliseconds you want to delay the tooltip for. If no delay is provided the DEFAULT_TOOL_TIP_DELAY is
|
|
52
|
-
* applied!
|
|
53
|
-
* 'data-qtip-testid': use this attribute to provide a value for a data-testid of your tooltip; this is useful
|
|
54
|
-
* for tests
|
|
55
|
-
*
|
|
56
|
-
* In order for QTip to be able to display Tooltips you must add the QTip component to your top-most component
|
|
57
|
-
* (often that's App or Application) - simply add:
|
|
58
|
-
*
|
|
59
|
-
* <QTip />
|
|
60
|
-
*
|
|
61
|
-
* and enjoy beautiful & performant tooltips!
|
|
62
|
-
*/
|
|
63
|
-
export const QTip = () => {
|
|
64
|
-
const tooltipRef = useRef(null);
|
|
65
|
-
const tooltipTarget = useRef(null);
|
|
66
|
-
const tooltipArrowRef = useRef(null);
|
|
67
|
-
const [tooltipText, setTooltipText] = useState('');
|
|
68
|
-
const [tooltipTargetOriginalPosition, setTooltipTargetOriginalPosition] = useState(null);
|
|
69
|
-
const [show, setShow] = useState(false);
|
|
70
|
-
const [html, setHtml] = useState(false);
|
|
71
|
-
const [tooltipTestId, setTooltipTestId] = useState('');
|
|
72
|
-
const [overTooltip, setOverTooltip] = useState(false);
|
|
73
|
-
// Check every 300ms if the tooltip target position has changed and hide the tooltip if this happens.
|
|
74
|
-
useIntervalWhen(() => {
|
|
75
|
-
const currentPosition = tooltipTarget?.current?.getBoundingClientRect();
|
|
76
|
-
if (overTooltip) {
|
|
77
|
-
return;
|
|
78
|
-
}
|
|
79
|
-
if (tooltipTargetOriginalPosition?.y !== currentPosition?.y ||
|
|
80
|
-
tooltipTargetOriginalPosition?.x !== currentPosition?.x) {
|
|
81
|
-
setShow(false);
|
|
82
|
-
}
|
|
83
|
-
}, 300, show);
|
|
84
|
-
useEffect(() => {
|
|
85
|
-
!suppressTooltip() && document.body.addEventListener('mousemove', onMouseMove);
|
|
86
|
-
return () => {
|
|
87
|
-
!suppressTooltip() && document.removeEventListener('mousemove', onMouseMove);
|
|
88
|
-
};
|
|
89
|
-
}, []);
|
|
90
|
-
const ttTimeout = useRef();
|
|
91
|
-
const findTooltipData = (element) => {
|
|
92
|
-
// Traverse up to 8 levels to find the tooltip data
|
|
93
|
-
for (let i = 0; i < 8 && element; i++) {
|
|
94
|
-
if (!element) {
|
|
95
|
-
return null;
|
|
96
|
-
}
|
|
97
|
-
if (element?.dataset?.qtipText) {
|
|
98
|
-
return element.dataset;
|
|
99
|
-
}
|
|
100
|
-
element = element?.parentElement;
|
|
101
|
-
}
|
|
102
|
-
return null;
|
|
103
|
-
};
|
|
104
|
-
const onMouseMove = (e) => {
|
|
105
|
-
clearTimeout(ttTimeout.current);
|
|
106
|
-
// Find tooltip data on the current or parent elements
|
|
107
|
-
const target = e.target;
|
|
108
|
-
const dataset = findTooltipData(target);
|
|
109
|
-
if (!dataset) {
|
|
110
|
-
// No tooltip data found
|
|
111
|
-
tooltipTarget.current = null;
|
|
112
|
-
return;
|
|
113
|
-
}
|
|
114
|
-
tooltipTarget.current = target;
|
|
115
|
-
const text = dataset.qtipText;
|
|
116
|
-
if (text) {
|
|
117
|
-
const delay = parseInt(dataset.qtipDelay || `${DEFAULT_TOOL_TIP_DELAY}`, 10);
|
|
118
|
-
const placement = dataset.qtipPlacement || 'top';
|
|
119
|
-
const isHtml = dataset.qtipIsHtml === 'true';
|
|
120
|
-
const testId = dataset.qtipTestid;
|
|
121
|
-
// Debounced tooltip display
|
|
122
|
-
ttTimeout.current = setTimeout(() => {
|
|
123
|
-
makeTooltip(text, placement, isHtml, testId, delay);
|
|
124
|
-
}, delay);
|
|
125
|
-
}
|
|
126
|
-
};
|
|
127
|
-
const makeTooltip = (tooltipText, position = 'top', isHtml, dataTestId, delay) => {
|
|
128
|
-
if (tooltipText && tooltipTarget.current) {
|
|
129
|
-
setHtml(isHtml);
|
|
130
|
-
setTooltipText(tooltipText);
|
|
131
|
-
setTooltipTestId(dataTestId);
|
|
132
|
-
setTooltipTargetOriginalPosition(tooltipTarget.current.getBoundingClientRect());
|
|
133
|
-
const positionTooltip = () => {
|
|
134
|
-
if (tooltipRef.current && tooltipTarget.current) {
|
|
135
|
-
computePosition(tooltipTarget.current, tooltipRef.current, {
|
|
136
|
-
placement: position,
|
|
137
|
-
middleware: [offset(10), arrow({ element: tooltipArrowRef.current })],
|
|
138
|
-
}).then(({ x, y, middlewareData }) => {
|
|
139
|
-
Object.assign(tooltipRef.current?.style, {
|
|
140
|
-
left: `${x}px`,
|
|
141
|
-
top: `${y}px`,
|
|
142
|
-
});
|
|
143
|
-
if (middlewareData.arrow) {
|
|
144
|
-
const { x, y } = middlewareData.arrow;
|
|
145
|
-
const arrowWidth = tooltipArrowRef.current?.offsetHeight / 2;
|
|
146
|
-
const tooltipHeight = tooltipRef.current?.offsetHeight;
|
|
147
|
-
const tooltipWidth = tooltipRef.current?.offsetWidth;
|
|
148
|
-
const style = getArrowStyle(position, x || y, arrowWidth, tooltipHeight, tooltipWidth);
|
|
149
|
-
Object.assign(tooltipArrowRef.current.style, style);
|
|
150
|
-
}
|
|
151
|
-
setShow(true);
|
|
152
|
-
});
|
|
153
|
-
}
|
|
154
|
-
};
|
|
155
|
-
delay > 0
|
|
156
|
-
? requestAnimationFrame(() => {
|
|
157
|
-
positionTooltip();
|
|
158
|
-
})
|
|
159
|
-
: positionTooltip();
|
|
160
|
-
}
|
|
161
|
-
};
|
|
162
|
-
return (React.createElement(React.Fragment, null,
|
|
163
|
-
React.createElement("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 ' +
|
|
164
|
-
(show ? 'tw-visible' : 'tw-invisible tw-pointer-events-none') },
|
|
165
|
-
html ? React.createElement(HTMLTip, { text: tooltipText }) : tooltipText,
|
|
166
|
-
React.createElement("div", { className: "tw-absolute tw-w-[10px] tw-h-[10px] tw-rotate-45 tw-bg-black", ref: tooltipArrowRef }))));
|
|
167
|
-
};
|
|
168
|
-
//# sourceMappingURL=Qtip.js.map
|
package/dist/Tooltip/Qtip.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Qtip.js","sourceRoot":"","sources":["../../src/Tooltip/Qtip.tsx"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,WAAW,CAAC;AAClC,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC3D,OAAO,EAAE,KAAK,EAAE,eAAe,EAAE,MAAM,EAAa,MAAM,kBAAkB,CAAC;AAC7E,OAAO,EAAE,eAAe,EAAE,MAAM,OAAO,CAAC;AACxC,OAAO,EAAE,sBAAsB,EAAE,MAAM,iBAAiB,CAAC;AAEzD,MAAM,aAAa,GAAG,CACpB,QAAgB,EAChB,CAAqB,EACrB,UAAkB,EAClB,aAAqB,EACrB,YAAoB,EACpB,EAAE;IACF,QAAQ,QAAQ,EAAE;QAChB,KAAK,QAAQ;YACX,OAAO;gBACL,IAAI,EAAE,GAAG,CAAC,IAAI;gBACd,GAAG,EAAE,GAAG,CAAC,UAAU,IAAI;aACxB,CAAC;QAEJ,KAAK,MAAM;YACT,OAAO;gBACL,IAAI,EAAE,GAAG,YAAY,GAAG,UAAU,IAAI;gBACtC,GAAG,EAAE,GAAG,aAAa,GAAG,CAAC,GAAG,UAAU,IAAI;aAC3C,CAAC;QACJ,KAAK,OAAO;YACV,OAAO;gBACL,IAAI,EAAE,GAAG,CAAC,UAAU,IAAI;gBACxB,GAAG,EAAE,GAAG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