@seeqdev/qomponents 0.0.179 → 0.0.181
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/Accordion/Accordion.d.ts +4 -0
- package/dist/Accordion/Accordion.js +7 -0
- package/dist/Accordion/Accordion.js.map +1 -0
- package/dist/Accordion/Accordion.stories.d.ts +5 -0
- package/dist/Accordion/Accordion.stories.js +75 -0
- package/dist/Accordion/Accordion.stories.js.map +1 -0
- package/dist/Accordion/Accordion.test.d.ts +1 -0
- package/dist/Accordion/Accordion.test.js +55 -0
- package/dist/Accordion/Accordion.test.js.map +1 -0
- package/dist/Accordion/Accordion.types.d.ts +86 -0
- package/dist/Accordion/Accordion.types.js +2 -0
- package/dist/Accordion/Accordion.types.js.map +1 -0
- package/dist/Accordion/index.d.ts +1 -0
- package/dist/Accordion/index.js +2 -0
- package/dist/Accordion/index.js.map +1 -0
- package/dist/Alert/Alert.d.ts +7 -0
- package/dist/Alert/Alert.js +34 -0
- package/dist/Alert/Alert.js.map +1 -0
- package/dist/Alert/Alert.stories.d.ts +6 -0
- package/dist/Alert/Alert.stories.js +65 -0
- package/dist/Alert/Alert.stories.js.map +1 -0
- package/dist/Alert/Alert.test.d.ts +1 -0
- package/dist/Alert/Alert.test.js +50 -0
- package/dist/Alert/Alert.test.js.map +1 -0
- package/dist/Alert/Alert.types.d.ts +62 -0
- package/dist/Alert/Alert.types.js +2 -0
- package/dist/Alert/Alert.types.js.map +1 -0
- package/dist/Alert/index.d.ts +1 -0
- package/dist/Alert/index.js +2 -0
- package/dist/Alert/index.js.map +1 -0
- package/dist/Button/Button.d.ts +10 -0
- package/dist/Button/Button.js +108 -0
- package/dist/Button/Button.js.map +1 -0
- package/dist/Button/Button.stories.d.ts +9 -0
- package/dist/Button/Button.stories.js +29 -0
- package/dist/Button/Button.stories.js.map +1 -0
- package/dist/Button/Button.test.d.ts +1 -0
- package/dist/Button/Button.test.js +65 -0
- package/dist/Button/Button.test.js.map +1 -0
- package/dist/Button/Button.types.d.ts +148 -0
- package/dist/Button/Button.types.js +5 -0
- package/dist/Button/Button.types.js.map +1 -0
- package/dist/Button/index.d.ts +1 -0
- package/dist/Button/index.js +2 -0
- package/dist/Button/index.js.map +1 -0
- package/dist/ButtonGroup/ButtonGroup.d.ts +7 -0
- package/dist/ButtonGroup/ButtonGroup.js +35 -0
- package/dist/ButtonGroup/ButtonGroup.js.map +1 -0
- package/dist/ButtonGroup/ButtonGroup.stories.d.ts +5 -0
- package/dist/ButtonGroup/ButtonGroup.stories.js +317 -0
- package/dist/ButtonGroup/ButtonGroup.stories.js.map +1 -0
- package/dist/ButtonGroup/ButtonGroup.test.d.ts +1 -0
- package/dist/ButtonGroup/ButtonGroup.test.js +66 -0
- package/dist/ButtonGroup/ButtonGroup.test.js.map +1 -0
- package/dist/ButtonGroup/ButtonGroup.types.d.ts +80 -0
- package/dist/ButtonGroup/ButtonGroup.types.js +2 -0
- package/dist/ButtonGroup/ButtonGroup.types.js.map +1 -0
- package/dist/ButtonGroup/index.d.ts +1 -0
- package/dist/ButtonGroup/index.js +2 -0
- package/dist/ButtonGroup/index.js.map +1 -0
- package/dist/ButtonWithDropdown/ButtonWithDropdown.d.ts +4 -0
- package/dist/ButtonWithDropdown/ButtonWithDropdown.js +36 -0
- package/dist/ButtonWithDropdown/ButtonWithDropdown.js.map +1 -0
- package/dist/ButtonWithDropdown/ButtonWithDropdown.stories.d.ts +5 -0
- package/dist/ButtonWithDropdown/ButtonWithDropdown.stories.js +104 -0
- package/dist/ButtonWithDropdown/ButtonWithDropdown.stories.js.map +1 -0
- package/dist/ButtonWithDropdown/ButtonWithDropdown.test.d.ts +1 -0
- package/dist/ButtonWithDropdown/ButtonWithDropdown.test.js +93 -0
- package/dist/ButtonWithDropdown/ButtonWithDropdown.test.js.map +1 -0
- package/dist/ButtonWithDropdown/ButtonWithDropdown.types.d.ts +232 -0
- package/dist/ButtonWithDropdown/ButtonWithDropdown.types.js +2 -0
- package/dist/ButtonWithDropdown/ButtonWithDropdown.types.js.map +1 -0
- package/dist/ButtonWithDropdown/index.d.ts +1 -0
- package/dist/ButtonWithDropdown/index.js +2 -0
- package/dist/ButtonWithDropdown/index.js.map +1 -0
- package/dist/ButtonWithPopover/ButtonWithPopover.d.ts +4 -0
- package/dist/ButtonWithPopover/ButtonWithPopover.js +55 -0
- package/dist/ButtonWithPopover/ButtonWithPopover.js.map +1 -0
- package/dist/ButtonWithPopover/ButtonWithPopover.stories.d.ts +5 -0
- package/dist/ButtonWithPopover/ButtonWithPopover.stories.js +25 -0
- package/dist/ButtonWithPopover/ButtonWithPopover.stories.js.map +1 -0
- package/dist/ButtonWithPopover/ButtonWithPopover.test.d.ts +1 -0
- package/dist/ButtonWithPopover/ButtonWithPopover.test.js +81 -0
- package/dist/ButtonWithPopover/ButtonWithPopover.test.js.map +1 -0
- package/dist/ButtonWithPopover/ButtonWithPopover.types.d.ts +134 -0
- package/dist/ButtonWithPopover/ButtonWithPopover.types.js +2 -0
- package/dist/ButtonWithPopover/ButtonWithPopover.types.js.map +1 -0
- package/dist/ButtonWithPopover/index.d.ts +1 -0
- package/dist/ButtonWithPopover/index.js +2 -0
- package/dist/ButtonWithPopover/index.js.map +1 -0
- package/dist/Carousel/Carousel.d.ts +9 -0
- package/dist/Carousel/Carousel.js +80 -0
- package/dist/Carousel/Carousel.js.map +1 -0
- package/dist/Carousel/Carousel.stories.d.ts +5 -0
- package/dist/Carousel/Carousel.stories.js +63 -0
- package/dist/Carousel/Carousel.stories.js.map +1 -0
- package/dist/Carousel/Carousel.test.d.ts +1 -0
- package/dist/Carousel/Carousel.test.js +48 -0
- package/dist/Carousel/Carousel.test.js.map +1 -0
- package/dist/Carousel/Carousel.types.d.ts +85 -0
- package/dist/Carousel/Carousel.types.js +2 -0
- package/dist/Carousel/Carousel.types.js.map +1 -0
- package/dist/Carousel/index.d.ts +1 -0
- package/dist/Carousel/index.js +2 -0
- package/dist/Carousel/index.js.map +1 -0
- package/dist/Checkbox/Checkbox.d.ts +7 -0
- package/dist/Checkbox/Checkbox.js +24 -0
- package/dist/Checkbox/Checkbox.js.map +1 -0
- package/dist/Checkbox/Checkbox.stories.d.ts +5 -0
- package/dist/Checkbox/Checkbox.stories.js +12 -0
- package/dist/Checkbox/Checkbox.stories.js.map +1 -0
- package/dist/Checkbox/Checkbox.test.d.ts +1 -0
- package/dist/Checkbox/Checkbox.test.js +94 -0
- package/dist/Checkbox/Checkbox.test.js.map +1 -0
- package/dist/Checkbox/Checkbox.types.d.ts +91 -0
- package/dist/Checkbox/Checkbox.types.js +2 -0
- package/dist/Checkbox/Checkbox.types.js.map +1 -0
- package/dist/Checkbox/index.d.ts +1 -0
- package/dist/Checkbox/index.js +2 -0
- package/dist/Checkbox/index.js.map +1 -0
- package/dist/Collapse/Collapse.d.ts +4 -0
- package/dist/Collapse/Collapse.js +17 -0
- package/dist/Collapse/Collapse.js.map +1 -0
- package/dist/Collapse/Collapse.stories.d.ts +5 -0
- package/dist/Collapse/Collapse.stories.js +15 -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 +17 -0
- package/dist/Collapse/Collapse.test.js.map +1 -0
- package/dist/Collapse/Collapse.types.d.ts +18 -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/FontCustom.woff +0 -0
- package/dist/FontCustom.woff2 +0 -0
- package/dist/Icon/Icon.d.ts +10 -0
- package/dist/Icon/Icon.js +56 -0
- package/dist/Icon/Icon.js.map +1 -0
- package/dist/Icon/Icon.stories.d.ts +5 -0
- package/dist/Icon/Icon.stories.js +15 -0
- package/dist/Icon/Icon.stories.js.map +1 -0
- package/dist/Icon/Icon.test.d.ts +1 -0
- package/dist/Icon/Icon.test.js +55 -0
- package/dist/Icon/Icon.test.js.map +1 -0
- package/dist/Icon/Icon.types.d.ts +90 -0
- package/dist/Icon/Icon.types.js +16 -0
- package/dist/Icon/Icon.types.js.map +1 -0
- package/dist/Icon/index.d.ts +1 -0
- package/dist/Icon/index.js +2 -0
- package/dist/Icon/index.js.map +1 -0
- package/dist/InputGroup/InputGroup.d.ts +7 -0
- package/dist/InputGroup/InputGroup.js +36 -0
- package/dist/InputGroup/InputGroup.js.map +1 -0
- package/dist/InputGroup/InputGroup.stories.d.ts +5 -0
- package/dist/InputGroup/InputGroup.stories.js +129 -0
- package/dist/InputGroup/InputGroup.stories.js.map +1 -0
- package/dist/InputGroup/InputGroup.test.d.ts +1 -0
- package/dist/InputGroup/InputGroup.test.js +42 -0
- package/dist/InputGroup/InputGroup.test.js.map +1 -0
- package/dist/InputGroup/InputGroup.types.d.ts +61 -0
- package/dist/InputGroup/InputGroup.types.js +2 -0
- package/dist/InputGroup/InputGroup.types.js.map +1 -0
- package/dist/InputGroup/index.d.ts +2 -0
- package/dist/InputGroup/index.js +2 -0
- package/dist/InputGroup/index.js.map +1 -0
- package/dist/Modal/Modal.d.ts +5 -0
- package/dist/Modal/Modal.js +76 -0
- package/dist/Modal/Modal.js.map +1 -0
- package/dist/Modal/Modal.stories.d.ts +10 -0
- package/dist/Modal/Modal.stories.js +44 -0
- package/dist/Modal/Modal.stories.js.map +1 -0
- package/dist/Modal/Modal.test.d.ts +1 -0
- package/dist/Modal/Modal.test.js +108 -0
- package/dist/Modal/Modal.test.js.map +1 -0
- package/dist/Modal/Modal.types.d.ts +244 -0
- package/dist/Modal/Modal.types.js +2 -0
- package/dist/Modal/Modal.types.js.map +1 -0
- package/dist/Modal/index.d.ts +1 -0
- package/dist/Modal/index.js +2 -0
- package/dist/Modal/index.js.map +1 -0
- package/dist/ProgressBar/ProgressBar.d.ts +4 -0
- package/dist/ProgressBar/ProgressBar.js +72 -0
- package/dist/ProgressBar/ProgressBar.js.map +1 -0
- package/dist/ProgressBar/ProgressBar.stories.d.ts +5 -0
- package/dist/ProgressBar/ProgressBar.stories.js +35 -0
- package/dist/ProgressBar/ProgressBar.stories.js.map +1 -0
- package/dist/ProgressBar/ProgressBar.test.d.ts +1 -0
- package/dist/ProgressBar/ProgressBar.test.js +43 -0
- package/dist/ProgressBar/ProgressBar.test.js.map +1 -0
- package/dist/ProgressBar/ProgressBar.types.d.ts +77 -0
- package/dist/ProgressBar/ProgressBar.types.js +2 -0
- package/dist/ProgressBar/ProgressBar.types.js.map +1 -0
- package/dist/ProgressBar/index.d.ts +1 -0
- package/dist/ProgressBar/index.js +2 -0
- package/dist/ProgressBar/index.js.map +1 -0
- package/dist/SeeqActionDropdown/SeeqActionDropdown.d.ts +4 -0
- package/dist/SeeqActionDropdown/SeeqActionDropdown.js +39 -0
- package/dist/SeeqActionDropdown/SeeqActionDropdown.js.map +1 -0
- package/dist/SeeqActionDropdown/SeeqActionDropdown.stories.d.ts +5 -0
- package/dist/SeeqActionDropdown/SeeqActionDropdown.stories.js +58 -0
- package/dist/SeeqActionDropdown/SeeqActionDropdown.stories.js.map +1 -0
- package/dist/SeeqActionDropdown/SeeqActionDropdown.test.d.ts +1 -0
- package/dist/SeeqActionDropdown/SeeqActionDropdown.test.js +73 -0
- package/dist/SeeqActionDropdown/SeeqActionDropdown.test.js.map +1 -0
- package/dist/SeeqActionDropdown/SeeqActionDropdown.types.d.ts +164 -0
- package/dist/SeeqActionDropdown/SeeqActionDropdown.types.js +2 -0
- package/dist/SeeqActionDropdown/SeeqActionDropdown.types.js.map +1 -0
- package/dist/SeeqActionDropdown/index.d.ts +1 -0
- package/dist/SeeqActionDropdown/index.js +2 -0
- package/dist/SeeqActionDropdown/index.js.map +1 -0
- package/dist/SeeqActionDropdown/variants.d.ts +5 -0
- package/dist/SeeqActionDropdown/variants.js +23 -0
- package/dist/SeeqActionDropdown/variants.js.map +1 -0
- package/dist/Select/Select.d.ts +15 -0
- package/dist/Select/Select.js +179 -0
- package/dist/Select/Select.js.map +1 -0
- package/dist/Select/Select.stories.d.ts +5 -0
- package/dist/Select/Select.stories.js +40 -0
- package/dist/Select/Select.stories.js.map +1 -0
- package/dist/Select/Select.test.d.ts +1 -0
- package/dist/Select/Select.test.js +175 -0
- package/dist/Select/Select.test.js.map +1 -0
- package/dist/Select/Select.types.d.ts +220 -0
- package/dist/Select/Select.types.js +2 -0
- package/dist/Select/Select.types.js.map +1 -0
- package/dist/Select/index.d.ts +2 -0
- package/dist/Select/index.js +3 -0
- package/dist/Select/index.js.map +1 -0
- package/dist/Slider/Slider.d.ts +6 -0
- package/dist/Slider/Slider.js +10 -0
- package/dist/Slider/Slider.js.map +1 -0
- package/dist/Slider/Slider.stories.d.ts +5 -0
- package/dist/Slider/Slider.stories.js +14 -0
- package/dist/Slider/Slider.stories.js.map +1 -0
- package/dist/Slider/Slider.test.d.ts +1 -0
- package/dist/Slider/Slider.test.js +32 -0
- package/dist/Slider/Slider.test.js.map +1 -0
- package/dist/Slider/Slider.types.d.ts +84 -0
- package/dist/Slider/Slider.types.js +2 -0
- package/dist/Slider/Slider.types.js.map +1 -0
- package/dist/Slider/index.d.ts +1 -0
- package/dist/Slider/index.js +2 -0
- package/dist/Slider/index.js.map +1 -0
- package/dist/SvgIcon/SvgIcon.d.ts +20 -0
- package/dist/SvgIcon/SvgIcon.js +28 -0
- package/dist/SvgIcon/SvgIcon.js.map +1 -0
- package/dist/SvgIcon/SvgIcon.stories.d.ts +5 -0
- package/dist/SvgIcon/SvgIcon.stories.js +18 -0
- package/dist/SvgIcon/SvgIcon.stories.js.map +1 -0
- package/dist/SvgIcon/SvgIcon.test.d.ts +1 -0
- package/dist/SvgIcon/SvgIcon.test.js +41 -0
- package/dist/SvgIcon/SvgIcon.test.js.map +1 -0
- package/dist/SvgIcon/SvgIcon.types.d.ts +75 -0
- package/dist/SvgIcon/SvgIcon.types.js +3 -0
- package/dist/SvgIcon/SvgIcon.types.js.map +1 -0
- package/dist/SvgIcon/index.d.ts +1 -0
- package/dist/SvgIcon/index.js +2 -0
- package/dist/SvgIcon/index.js.map +1 -0
- package/dist/Tabs/Tabs.d.ts +4 -0
- package/dist/Tabs/Tabs.js +17 -0
- package/dist/Tabs/Tabs.js.map +1 -0
- package/dist/Tabs/Tabs.stories.d.ts +5 -0
- package/dist/Tabs/Tabs.stories.js +73 -0
- package/dist/Tabs/Tabs.stories.js.map +1 -0
- package/dist/Tabs/Tabs.test.d.ts +1 -0
- package/dist/Tabs/Tabs.test.js +86 -0
- package/dist/Tabs/Tabs.test.js.map +1 -0
- package/dist/Tabs/Tabs.types.d.ts +100 -0
- package/dist/Tabs/Tabs.types.js +2 -0
- package/dist/Tabs/Tabs.types.js.map +1 -0
- package/dist/Tabs/index.d.ts +1 -0
- package/dist/Tabs/index.js +2 -0
- package/dist/Tabs/index.js.map +1 -0
- package/dist/TextArea/TextArea.d.ts +7 -0
- package/dist/TextArea/TextArea.js +55 -0
- package/dist/TextArea/TextArea.js.map +1 -0
- package/dist/TextArea/TextArea.stories.d.ts +5 -0
- package/dist/TextArea/TextArea.stories.js +10 -0
- package/dist/TextArea/TextArea.stories.js.map +1 -0
- package/dist/TextArea/TextArea.test.d.ts +1 -0
- package/dist/TextArea/TextArea.test.js +130 -0
- package/dist/TextArea/TextArea.test.js.map +1 -0
- package/dist/TextArea/TextArea.types.d.ts +115 -0
- package/dist/TextArea/TextArea.types.js +2 -0
- package/dist/TextArea/TextArea.types.js.map +1 -0
- package/dist/TextArea/index.d.ts +1 -0
- package/dist/TextArea/index.js +2 -0
- package/dist/TextArea/index.js.map +1 -0
- package/dist/TextField/TextField.d.ts +7 -0
- package/dist/TextField/TextField.js +85 -0
- package/dist/TextField/TextField.js.map +1 -0
- package/dist/TextField/TextField.stories.d.ts +5 -0
- package/dist/TextField/TextField.stories.js +11 -0
- package/dist/TextField/TextField.stories.js.map +1 -0
- package/dist/TextField/TextField.test.d.ts +1 -0
- package/dist/TextField/TextField.test.js +41 -0
- package/dist/TextField/TextField.test.js.map +1 -0
- package/dist/TextField/TextField.types.d.ts +198 -0
- package/dist/TextField/TextField.types.js +2 -0
- package/dist/TextField/TextField.types.js.map +1 -0
- package/dist/TextField/index.d.ts +1 -0
- package/dist/TextField/index.js +2 -0
- package/dist/TextField/index.js.map +1 -0
- package/dist/ToolbarButton/ToolbarButton.d.ts +3 -0
- package/dist/ToolbarButton/ToolbarButton.js +56 -0
- package/dist/ToolbarButton/ToolbarButton.js.map +1 -0
- package/dist/ToolbarButton/ToolbarButton.stories.d.ts +5 -0
- package/dist/ToolbarButton/ToolbarButton.stories.js +28 -0
- package/dist/ToolbarButton/ToolbarButton.stories.js.map +1 -0
- package/dist/ToolbarButton/ToolbarButton.test.d.ts +1 -0
- package/dist/ToolbarButton/ToolbarButton.test.js +85 -0
- package/dist/ToolbarButton/ToolbarButton.test.js.map +1 -0
- package/dist/ToolbarButton/ToolbarButton.types.d.ts +122 -0
- package/dist/ToolbarButton/ToolbarButton.types.js +2 -0
- package/dist/ToolbarButton/ToolbarButton.types.js.map +1 -0
- package/dist/ToolbarButton/index.d.ts +1 -0
- package/dist/ToolbarButton/index.js +2 -0
- package/dist/ToolbarButton/index.js.map +1 -0
- package/dist/Tooltip/QTip.stories.d.ts +5 -0
- package/dist/Tooltip/QTip.stories.js +19 -0
- package/dist/Tooltip/QTip.stories.js.map +1 -0
- package/dist/Tooltip/QTip.types.d.ts +13 -0
- package/dist/Tooltip/QTip.types.js +2 -0
- package/dist/Tooltip/QTip.types.js.map +1 -0
- package/dist/Tooltip/QTipPerformance.stories.d.ts +5 -0
- package/dist/Tooltip/QTipPerformance.stories.js +26 -0
- package/dist/Tooltip/QTipPerformance.stories.js.map +1 -0
- package/dist/Tooltip/Qtip.d.ts +26 -0
- package/dist/Tooltip/Qtip.js +168 -0
- package/dist/Tooltip/Qtip.js.map +1 -0
- package/dist/Tooltip/Tooltip.d.ts +13 -0
- package/dist/Tooltip/Tooltip.js +34 -0
- package/dist/Tooltip/Tooltip.js.map +1 -0
- package/dist/Tooltip/Tooltip.stories.d.ts +5 -0
- package/dist/Tooltip/Tooltip.stories.js +15 -0
- package/dist/Tooltip/Tooltip.stories.js.map +1 -0
- package/dist/Tooltip/Tooltip.types.d.ts +22 -0
- package/dist/Tooltip/Tooltip.types.js +3 -0
- package/dist/Tooltip/Tooltip.types.js.map +1 -0
- package/dist/Tooltip/TooltipPerformance.stories.d.ts +5 -0
- package/dist/Tooltip/TooltipPerformance.stories.js +26 -0
- package/dist/Tooltip/TooltipPerformance.stories.js.map +1 -0
- package/dist/Tooltip/index.d.ts +2 -0
- package/dist/Tooltip/index.js +3 -0
- package/dist/Tooltip/index.js.map +1 -0
- package/dist/Tooltip/qTip.utilities.d.ts +3 -0
- package/dist/Tooltip/qTip.utilities.js +11 -0
- package/dist/Tooltip/qTip.utilities.js.map +1 -0
- package/dist/index.d.ts +46 -0
- package/dist/index.esm.js +1220 -1186
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +1220 -1186
- package/dist/index.js.map +1 -1
- package/dist/setupTests.d.ts +1 -0
- package/dist/setupTests.js +6 -0
- package/dist/setupTests.js.map +1 -0
- package/dist/styles.css +6 -0
- package/dist/types.d.ts +27 -0
- package/dist/types.js +26 -0
- package/dist/types.js.map +1 -0
- package/dist/utils/browserId.d.ts +9 -0
- package/dist/utils/browserId.js +29 -0
- package/dist/utils/browserId.js.map +1 -0
- package/dist/utils/svg.d.ts +15 -0
- package/dist/utils/svg.js +20 -0
- package/dist/utils/svg.js.map +1 -0
- package/dist/utils/validateStyleDimension.d.ts +2 -0
- package/dist/utils/validateStyleDimension.js +14 -0
- package/dist/utils/validateStyleDimension.js.map +1 -0
- package/dist/utils/validateStyleDimension.test.d.ts +1 -0
- package/dist/utils/validateStyleDimension.test.js +20 -0
- package/dist/utils/validateStyleDimension.test.js.map +1 -0
- package/package.json +10 -10
- package/dist/iconFont/FontCustom.woff +0 -0
- package/dist/iconFont/FontCustom.woff2 +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Q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AE,EACvC,sCAAsC,EAAE,IACrC,IACL,CACJ,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { TooltipPosition } from './Tooltip.types';
|
|
2
|
+
export interface QTipDataAttributes {
|
|
3
|
+
/** text displayed by the tooltip */
|
|
4
|
+
'data-qtip-text': string;
|
|
5
|
+
/** one of TooltipPosition */
|
|
6
|
+
'data-qtip-placement'?: TooltipPosition;
|
|
7
|
+
/** set to true to render the provided text as html */
|
|
8
|
+
'data-qtip-is-html'?: boolean;
|
|
9
|
+
/** number of milliseconds to wait before showing a tooltip on-hover */
|
|
10
|
+
'data-qtip-delay'?: number;
|
|
11
|
+
/** useful for testing; sets the provided string as the data-testid attribute of the tooltip */
|
|
12
|
+
'data-qtip-testid'?: string;
|
|
13
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"QTip.types.js","sourceRoot":"","sources":["../../src/Tooltip/QTip.types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
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(_jsx("td", { children: _jsx(Icon, { icon: "fc-sun", tooltip: `hello there ${i}` }) }, 'col_' + i + '_row_' + rowId));
|
|
15
|
+
}
|
|
16
|
+
return cols;
|
|
17
|
+
};
|
|
18
|
+
for (let i = 0; i < rowCount; i++) {
|
|
19
|
+
rows.push(_jsxs("tr", { children: [...getCols(i)] }, 'row_' + i));
|
|
20
|
+
}
|
|
21
|
+
return (_jsx("table", { children: _jsx("tbody", { children: rows.map((row) => row) }) }));
|
|
22
|
+
};
|
|
23
|
+
export const QtipPerformance = () => {
|
|
24
|
+
return (_jsxs(_Fragment, { children: [_jsx(QTip, {}), _jsx("div", { className: "tw:grid tw:grid-cols-4 tw:gap-4 tw:text-center", children: renderManyQTips() })] }));
|
|
25
|
+
};
|
|
26
|
+
//# sourceMappingURL=QTipPerformance.stories.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"QTipPerformance.stories.js","sourceRoot":"","sources":["../../src/Tooltip/QTipPerformance.stories.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAC9B,OAAO,IAAI,MAAM,SAAS,CAAC;AAE3B,eAAe;IACb,KAAK,EAAE,SAAS;CACjB,CAAC;AAEF,MAAM,eAAe,GAAG,GAAG,EAAE;IAC3B,MAAM,SAAS,GAAG,GAAG,CAAC;IACtB,MAAM,QAAQ,GAAG,GAAG,CAAC;IACrB,MAAM,IAAI,GAAG,EAAE,CAAC;IAEhB,MAAM,OAAO,GAAG,CAAC,KAAa,EAAE,EAAE;QAChC,MAAM,IAAI,GAAG,EAAE,CAAC;QAChB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,SAAS,EAAE,CAAC,EAAE,EAAE,CAAC;YACnC,IAAI,CAAC,IAAI,CACP,uBACE,KAAC,IAAI,IAAC,IAAI,EAAC,QAAQ,EAAC,OAAO,EAAE,eAAe,CAAC,EAAE,GAAI,IAD5C,MAAM,GAAG,CAAC,GAAG,OAAO,GAAG,KAAK,CAEhC,CACN,CAAC;QACJ,CAAC;QACD,OAAO,IAAI,CAAC;IACd,CAAC,CAAC;IAEF,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,QAAQ,EAAE,CAAC,EAAE,EAAE,CAAC;QAClC,IAAI,CAAC,IAAI,CAAC,4BAAyB,OAAO,CAAC,CAAC,CAAC,KAA1B,MAAM,GAAG,CAAC,CAAsB,CAAC,CAAC;IACvD,CAAC;IACD,OAAO,CACL,0BACE,0BAAQ,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,GAAS,GACjC,CACT,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,eAAe,GAAG,GAAG,EAAE;IAClC,OAAO,CACL,8BACE,KAAC,IAAI,KAAG,EACR,cAAK,SAAS,EAAC,gDAAgD,YAAE,eAAe,EAAE,GAAO,IACxF,CACJ,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* QTip
|
|
4
|
+
*
|
|
5
|
+
* QTip is a Singleton Tooltip component that guarantees high-performance and reduces component wrappers!
|
|
6
|
+
*
|
|
7
|
+
* QTip is used by all qomponents that support the display of tooltips.
|
|
8
|
+
* If you want to add a Tooltip to your application you can do so by adding the following html data-attributes:
|
|
9
|
+
*
|
|
10
|
+
* 'data-qtip-text': the tooltip text to display; this can also be a string containing valid HTML
|
|
11
|
+
* 'data-qtip-placement': one of TooltipPosition (top, bottom, right, or left)
|
|
12
|
+
* 'data-qtip-is-html': set this to true if you provided a text that contains HTML,
|
|
13
|
+
* 'data-qtip-delay': this can be used to delay the showing of the tooltip. this should be a number representing
|
|
14
|
+
* the # of milliseconds you want to delay the tooltip for. If no delay is provided the DEFAULT_TOOL_TIP_DELAY is
|
|
15
|
+
* applied!
|
|
16
|
+
* 'data-qtip-testid': use this attribute to provide a value for a data-testid of your tooltip; this is useful
|
|
17
|
+
* for tests
|
|
18
|
+
*
|
|
19
|
+
* In order for QTip to be able to display Tooltips you must add the QTip component to your top-most component
|
|
20
|
+
* (often that's App or Application) - simply add:
|
|
21
|
+
*
|
|
22
|
+
* <QTip />
|
|
23
|
+
*
|
|
24
|
+
* and enjoy beautiful & performant tooltips!
|
|
25
|
+
*/
|
|
26
|
+
export declare const QTip: React.FunctionComponent<any>;
|
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import DOMPurify from 'dompurify';
|
|
3
|
+
import React, { useEffect, useRef, useState } from 'react';
|
|
4
|
+
import { arrow, computePosition, offset, flip, shift } from '@floating-ui/dom';
|
|
5
|
+
import { useIntervalWhen } from 'rooks';
|
|
6
|
+
import { DEFAULT_TOOL_TIP_DELAY } from './Tooltip.types';
|
|
7
|
+
const getArrowStyle = (position, x, arrowWidth, tooltipHeight, tooltipWidth) => {
|
|
8
|
+
switch (position) {
|
|
9
|
+
case 'bottom':
|
|
10
|
+
return {
|
|
11
|
+
left: `${x}px`,
|
|
12
|
+
top: `${-arrowWidth}px`,
|
|
13
|
+
};
|
|
14
|
+
case 'left':
|
|
15
|
+
return {
|
|
16
|
+
left: `${tooltipWidth - arrowWidth}px`,
|
|
17
|
+
top: `${tooltipHeight / 2 - arrowWidth}px`,
|
|
18
|
+
};
|
|
19
|
+
case 'right':
|
|
20
|
+
return {
|
|
21
|
+
left: `${-arrowWidth}px`,
|
|
22
|
+
top: `${tooltipHeight / 2 - arrowWidth}px`,
|
|
23
|
+
};
|
|
24
|
+
default: // 'top':
|
|
25
|
+
return {
|
|
26
|
+
left: `${x}px`,
|
|
27
|
+
top: `${tooltipHeight - 10 + arrowWidth}px`,
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
};
|
|
31
|
+
const HTMLTip = ({ text }) => {
|
|
32
|
+
return React.createElement('div', {
|
|
33
|
+
dangerouslySetInnerHTML: { __html: DOMPurify.sanitize(text) },
|
|
34
|
+
});
|
|
35
|
+
};
|
|
36
|
+
/** Tooltips can cause SystemTests to be flaky, so we suppress them in Playwright and Protractor */
|
|
37
|
+
const suppressTooltip = () => {
|
|
38
|
+
return window.navigator.userAgent === 'Playwright' || window.navigator.userAgent.includes('Protractor');
|
|
39
|
+
};
|
|
40
|
+
/**
|
|
41
|
+
* QTip
|
|
42
|
+
*
|
|
43
|
+
* QTip is a Singleton Tooltip component that guarantees high-performance and reduces component wrappers!
|
|
44
|
+
*
|
|
45
|
+
* QTip is used by all qomponents that support the display of tooltips.
|
|
46
|
+
* If you want to add a Tooltip to your application you can do so by adding the following html data-attributes:
|
|
47
|
+
*
|
|
48
|
+
* 'data-qtip-text': the tooltip text to display; this can also be a string containing valid HTML
|
|
49
|
+
* 'data-qtip-placement': one of TooltipPosition (top, bottom, right, or left)
|
|
50
|
+
* 'data-qtip-is-html': set this to true if you provided a text that contains HTML,
|
|
51
|
+
* 'data-qtip-delay': this can be used to delay the showing of the tooltip. this should be a number representing
|
|
52
|
+
* the # of milliseconds you want to delay the tooltip for. If no delay is provided the DEFAULT_TOOL_TIP_DELAY is
|
|
53
|
+
* applied!
|
|
54
|
+
* 'data-qtip-testid': use this attribute to provide a value for a data-testid of your tooltip; this is useful
|
|
55
|
+
* for tests
|
|
56
|
+
*
|
|
57
|
+
* In order for QTip to be able to display Tooltips you must add the QTip component to your top-most component
|
|
58
|
+
* (often that's App or Application) - simply add:
|
|
59
|
+
*
|
|
60
|
+
* <QTip />
|
|
61
|
+
*
|
|
62
|
+
* and enjoy beautiful & performant tooltips!
|
|
63
|
+
*/
|
|
64
|
+
export const QTip = () => {
|
|
65
|
+
const tooltipRef = useRef(null);
|
|
66
|
+
const tooltipTarget = useRef(null);
|
|
67
|
+
const tooltipArrowRef = useRef(null);
|
|
68
|
+
const [tooltipText, setTooltipText] = useState('');
|
|
69
|
+
const [tooltipTargetOriginalPosition, setTooltipTargetOriginalPosition] = useState(null);
|
|
70
|
+
const [show, setShow] = useState(false);
|
|
71
|
+
const [html, setHtml] = useState(false);
|
|
72
|
+
const [tooltipTestId, setTooltipTestId] = useState('');
|
|
73
|
+
const [overTooltip, setOverTooltip] = useState(false);
|
|
74
|
+
// Check every 300ms if the tooltip target position has changed and hide the tooltip if this happens.
|
|
75
|
+
useIntervalWhen(() => {
|
|
76
|
+
const currentPosition = tooltipTarget?.current?.getBoundingClientRect();
|
|
77
|
+
if (overTooltip) {
|
|
78
|
+
return;
|
|
79
|
+
}
|
|
80
|
+
if (tooltipTargetOriginalPosition?.y !== currentPosition?.y ||
|
|
81
|
+
tooltipTargetOriginalPosition?.x !== currentPosition?.x) {
|
|
82
|
+
setShow(false);
|
|
83
|
+
}
|
|
84
|
+
}, 300, show);
|
|
85
|
+
useEffect(() => {
|
|
86
|
+
!suppressTooltip() && document.body.addEventListener('mousemove', onMouseMove);
|
|
87
|
+
return () => {
|
|
88
|
+
!suppressTooltip() && document.removeEventListener('mousemove', onMouseMove);
|
|
89
|
+
};
|
|
90
|
+
}, []);
|
|
91
|
+
const ttTimeout = useRef(null);
|
|
92
|
+
const findTooltipData = (element) => {
|
|
93
|
+
// Traverse up to 8 levels to find the tooltip data
|
|
94
|
+
for (let i = 0; i < 8 && element; i++) {
|
|
95
|
+
if (!element) {
|
|
96
|
+
return null;
|
|
97
|
+
}
|
|
98
|
+
if (element?.dataset?.qtipText) {
|
|
99
|
+
return element.dataset;
|
|
100
|
+
}
|
|
101
|
+
element = element?.parentElement;
|
|
102
|
+
}
|
|
103
|
+
return null;
|
|
104
|
+
};
|
|
105
|
+
const onMouseMove = (e) => {
|
|
106
|
+
if (ttTimeout.current) {
|
|
107
|
+
clearTimeout(ttTimeout.current);
|
|
108
|
+
}
|
|
109
|
+
// Find tooltip data on the current or parent elements
|
|
110
|
+
const target = e.target;
|
|
111
|
+
const dataset = findTooltipData(target);
|
|
112
|
+
if (!dataset) {
|
|
113
|
+
// No tooltip data found
|
|
114
|
+
tooltipTarget.current = null;
|
|
115
|
+
return;
|
|
116
|
+
}
|
|
117
|
+
tooltipTarget.current = target;
|
|
118
|
+
const text = dataset.qtipText;
|
|
119
|
+
if (text) {
|
|
120
|
+
const delay = parseInt(dataset.qtipDelay || `${DEFAULT_TOOL_TIP_DELAY}`, 10);
|
|
121
|
+
const placement = dataset.qtipPlacement || 'top';
|
|
122
|
+
const isHtml = dataset.qtipIsHtml === 'true';
|
|
123
|
+
const testId = dataset.qtipTestid;
|
|
124
|
+
// Debounced tooltip display
|
|
125
|
+
ttTimeout.current = setTimeout(() => {
|
|
126
|
+
makeTooltip(text, placement, isHtml, testId, delay);
|
|
127
|
+
}, delay);
|
|
128
|
+
}
|
|
129
|
+
};
|
|
130
|
+
const makeTooltip = (tooltipText, position = 'top', isHtml, dataTestId, delay) => {
|
|
131
|
+
if (tooltipText && tooltipTarget.current) {
|
|
132
|
+
setHtml(isHtml);
|
|
133
|
+
setTooltipText(tooltipText);
|
|
134
|
+
setTooltipTestId(dataTestId);
|
|
135
|
+
setTooltipTargetOriginalPosition(tooltipTarget.current.getBoundingClientRect());
|
|
136
|
+
const positionTooltip = () => {
|
|
137
|
+
if (tooltipRef.current && tooltipTarget.current) {
|
|
138
|
+
computePosition(tooltipTarget.current, tooltipRef.current, {
|
|
139
|
+
placement: position,
|
|
140
|
+
middleware: [offset(10), flip(), shift({ padding: 8 }), arrow({ element: tooltipArrowRef.current })],
|
|
141
|
+
}).then(({ x, y, middlewareData, placement: finalPlacement }) => {
|
|
142
|
+
Object.assign(tooltipRef.current?.style, {
|
|
143
|
+
left: `${x}px`,
|
|
144
|
+
top: `${y}px`,
|
|
145
|
+
});
|
|
146
|
+
if (middlewareData.arrow) {
|
|
147
|
+
const { x, y } = middlewareData.arrow;
|
|
148
|
+
const arrowWidth = tooltipArrowRef.current?.offsetHeight / 2;
|
|
149
|
+
const tooltipHeight = tooltipRef.current?.offsetHeight;
|
|
150
|
+
const tooltipWidth = tooltipRef.current?.offsetWidth;
|
|
151
|
+
const style = getArrowStyle(finalPlacement, x || y, arrowWidth, tooltipHeight, tooltipWidth);
|
|
152
|
+
Object.assign(tooltipArrowRef.current.style, style);
|
|
153
|
+
}
|
|
154
|
+
setShow(true);
|
|
155
|
+
});
|
|
156
|
+
}
|
|
157
|
+
};
|
|
158
|
+
delay > 0
|
|
159
|
+
? requestAnimationFrame(() => {
|
|
160
|
+
positionTooltip();
|
|
161
|
+
})
|
|
162
|
+
: positionTooltip();
|
|
163
|
+
}
|
|
164
|
+
};
|
|
165
|
+
return (_jsx(_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-sq-white tw:z-[9999] tw:fade-in ' +
|
|
166
|
+
(show ? 'tw:visible' : 'tw:invisible tw:pointer-events-none'), children: [html ? _jsx(HTMLTip, { text: tooltipText }) : tooltipText, _jsx("div", { className: "tw:absolute tw:w-2.5 tw:h-2.5 tw:rotate-45 tw:bg-sq-black", ref: tooltipArrowRef })] }) }));
|
|
167
|
+
};
|
|
168
|
+
//# sourceMappingURL=Qtip.js.map
|
|
@@ -0,0 +1 @@
|
|
|
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,IAAI,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAC1F,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,CAAC;QACjB,KAAK,QAAQ;YACX,OAAO;gBACL,IAAI,EAAE,GAAG,CAAC,IAAI;gBACd,GAAG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 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import '../styles.css';
|
|
3
|
+
import { TooltipProps } from './Tooltip.types';
|
|
4
|
+
/**
|
|
5
|
+
* @deprecated
|
|
6
|
+
* Note: Tooltip has been replaced by QTip - a singleton JS tooltip that behaves well even with overflow settings :)
|
|
7
|
+
* See @QTip for more info!
|
|
8
|
+
*
|
|
9
|
+
* This component displays a Tooltip for the provided children. It is a CSS only tooltip that will not display
|
|
10
|
+
* correctly if a parent element has an overflow CSS property assigned. Please use QTip to ensure your tooltips
|
|
11
|
+
* display correctly.
|
|
12
|
+
*/
|
|
13
|
+
export declare const Tooltip: React.FunctionComponent<TooltipProps>;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import '../styles.css';
|
|
3
|
+
import { DEFAULT_TOOL_TIP_DELAY } from './Tooltip.types';
|
|
4
|
+
/**
|
|
5
|
+
* @deprecated
|
|
6
|
+
* Note: Tooltip has been replaced by QTip - a singleton JS tooltip that behaves well even with overflow settings :)
|
|
7
|
+
* See @QTip for more info!
|
|
8
|
+
*
|
|
9
|
+
* This component displays a Tooltip for the provided children. It is a CSS only tooltip that will not display
|
|
10
|
+
* correctly if a parent element has an overflow CSS property assigned. Please use QTip to ensure your tooltips
|
|
11
|
+
* display correctly.
|
|
12
|
+
*/
|
|
13
|
+
export const Tooltip = ({ position = 'bottom', children, text, delay = DEFAULT_TOOL_TIP_DELAY, }) => {
|
|
14
|
+
const arrowBaseClasses = "tw:before:content-[''] tw:before:absolute tw:before:border-8";
|
|
15
|
+
const centerArrowVertically = 'tw:before:top-1/2 tw:before:-translate-y-1/2';
|
|
16
|
+
const centerArrowHorizontally = 'tw:before:left-1/2 tw:before:-translate-x-1/2';
|
|
17
|
+
const arrowRight = `${arrowBaseClasses} ${centerArrowVertically} tw:before:right-full tw:before:border-y-transparent
|
|
18
|
+
tw:before:border-l-transparent tw:before:border-r-sq-black`;
|
|
19
|
+
const arrowLeft = `${arrowBaseClasses} ${centerArrowVertically} tw:before:left-full tw:before:border-y-transparent
|
|
20
|
+
tw:before:border-l-sq-black tw:before:border-r-transparent`;
|
|
21
|
+
const arrowBottom = `${arrowBaseClasses} ${centerArrowHorizontally} tw:before:-top-4 tw:before:border-b-sq-black
|
|
22
|
+
tw:before:border-r-transparent tw:before:border-l-transparent tw:before:border-t-transparent`;
|
|
23
|
+
const arrowTop = `${arrowBaseClasses} ${centerArrowHorizontally} tw:before:-bottom-4 tw:before:border-b-transparent
|
|
24
|
+
tw:before:border-t-sq-black tw:before:border-l-transparent tw:before:border-r-transparent`;
|
|
25
|
+
const placements = {
|
|
26
|
+
top: `tw:-top-2 tw:-translate-y-full tw:left-1/2 tw:-translate-x-1/2 ${arrowTop}`,
|
|
27
|
+
left: `tw:-translate-x-full tw:-left-3 tw:-translate-y-1/2 tw:top-1/2 ${arrowLeft}`,
|
|
28
|
+
right: `tw:translate-x-full tw:-right-3 tw:-translate-y-1/2 tw:top-1/2 ${arrowRight}`,
|
|
29
|
+
bottom: `tw:-bottom-2 tw:translate-y-full tw:left-1/2 tw:-translate-x-1/2 ${arrowBottom}`,
|
|
30
|
+
};
|
|
31
|
+
return (_jsxs("div", { className: "tw:group tw:relative tw:inline-block", children: [children, _jsx("div", { className: `tw:z-50 tw:whitespace-nowrap tw:hidden tw:group-hover:inline-block tw:group-hover:delay-[${delay}ms]
|
|
32
|
+
tw:absolute tw:opacity-0 tw:group-hover:opacity-100 tw:rounded tw:bg-sq-black tw:p-2 tw:text-xs tw:text-sq-white ${placements[position]}`, children: text })] }));
|
|
33
|
+
};
|
|
34
|
+
//# sourceMappingURL=Tooltip.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Tooltip.js","sourceRoot":"","sources":["../../src/Tooltip/Tooltip.tsx"],"names":[],"mappings":";AACA,OAAO,eAAe,CAAC;AACvB,OAAO,EAAE,sBAAsB,EAAgB,MAAM,iBAAiB,CAAC;AAEvE;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,OAAO,GAA0C,CAAC,EAC7D,QAAQ,GAAG,QAAQ,EACnB,QAAQ,EACR,IAAI,EACJ,KAAK,GAAG,sBAAsB,GAC/B,EAAE,EAAE;IACH,MAAM,gBAAgB,GAAG,8DAA8D,CAAC;IACxF,MAAM,qBAAqB,GAAG,8CAA8C,CAAC;IAC7E,MAAM,uBAAuB,GAAG,+CAA+C,CAAC;IAChF,MAAM,UAAU,GAAG,GAAG,gBAAgB,IAAI,qBAAqB;6DACJ,CAAC;IAE5D,MAAM,SAAS,GAAG,GAAG,gBAAgB,IAAI,qBAAqB;8DACF,CAAC;IAE7D,MAAM,WAAW,GAAG,GAAG,gBAAgB,IAAI,uBAAuB;+FAC2B,CAAC;IAC9F,MAAM,QAAQ,GAAG,GAAG,gBAAgB,IAAI,uBAAuB;4FAC2B,CAAC;IAE3F,MAAM,UAAU,GAAG;QACjB,GAAG,EAAE,kEAAkE,QAAQ,EAAE;QACjF,IAAI,EAAE,kEAAkE,SAAS,EAAE;QACnF,KAAK,EAAE,kEAAkE,UAAU,EAAE;QACrF,MAAM,EAAE,oEAAoE,WAAW,EAAE;KAC1F,CAAC;IAEF,OAAO,CACL,eAAK,SAAS,EAAC,sCAAsC,aAClD,QAAQ,EACT,cACE,SAAS,EAAE,4FAA4F,KAAK;2HACO,UAAU,CAAC,QAAQ,CAAC,EAAE,YACxI,IAAI,GACD,IACF,CACP,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Tooltip } from './Tooltip';
|
|
3
|
+
import Icon from '../Icon';
|
|
4
|
+
import Button from '../Button';
|
|
5
|
+
import { tooltipPositions } from './Tooltip.types';
|
|
6
|
+
export default {
|
|
7
|
+
title: 'Tooltip',
|
|
8
|
+
};
|
|
9
|
+
export const AllTooltips = () => {
|
|
10
|
+
const renderButtonsWithTooltip = () => tooltipPositions.map((position) => (_jsx("div", { children: _jsx(Tooltip, { text: `Tooltip on the ${position}`, position: position, children: _jsx(Button, { label: position }) }) }, `${position}_button`)));
|
|
11
|
+
const renderIconsWithHtmlTooltip = () => tooltipPositions.map((position) => (_jsx("div", { children: _jsx(Tooltip, { text: _jsxs("div", { children: [_jsx("h2", { children: "Fancy Tooltip" }), " This is a special tooltip. Why?", _jsx("br", {}), "Because it supports ", _jsx("b", { children: "HTML!" })] }), position: position, children: _jsx(Icon, { icon: "fc-sun" }) }) }, `${position}_icon`)));
|
|
12
|
+
const renderTextTooltipOnText = () => tooltipPositions.map((position) => (_jsx("div", { children: _jsx(Tooltip, { text: "Helpful information provided here", position: position, children: _jsxs("span", { children: ["Hover for Tooltip (on the ", position, ")"] }) }) }, `${position}_text`)));
|
|
13
|
+
return (_jsxs("div", { className: "tw:grid tw:grid-cols-4 tw:gap-4 tw:text-center", children: [renderButtonsWithTooltip(), renderIconsWithHtmlTooltip(), renderTextTooltipOnText()] }));
|
|
14
|
+
};
|
|
15
|
+
//# sourceMappingURL=Tooltip.stories.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Tooltip.stories.js","sourceRoot":"","sources":["../../src/Tooltip/Tooltip.stories.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,IAAI,MAAM,SAAS,CAAC;AAC3B,OAAO,MAAM,MAAM,WAAW,CAAC;AAC/B,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAEnD,eAAe;IACb,KAAK,EAAE,SAAS;CACjB,CAAC;AAEF,MAAM,CAAC,MAAM,WAAW,GAAG,GAAG,EAAE;IAC9B,MAAM,wBAAwB,GAAG,GAAG,EAAE,CACpC,gBAAgB,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,CACjC,wBACE,KAAC,OAAO,IAAC,IAAI,EAAE,kBAAkB,QAAQ,EAAE,EAAE,QAAQ,EAAE,QAAQ,YAC7D,KAAC,MAAM,IAAC,KAAK,EAAE,QAAQ,GAAI,GACnB,IAHF,GAAG,QAAQ,SAAS,CAIxB,CACP,CAAC,CAAC;IAEL,MAAM,0BAA0B,GAAG,GAAG,EAAE,CACtC,gBAAgB,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,CACjC,wBACE,KAAC,OAAO,IACN,IAAI,EACF,0BACE,yCAAsB,sCACtB,cAAM,0BACc,gCAAY,IAC5B,EAER,QAAQ,EAAE,QAAQ,YAClB,KAAC,IAAI,IAAC,IAAI,EAAC,QAAQ,GAAG,GACd,IAXF,GAAG,QAAQ,OAAO,CAYtB,CACP,CAAC,CAAC;IAEL,MAAM,uBAAuB,GAAG,GAAG,EAAE,CACnC,gBAAgB,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,CACjC,wBACE,KAAC,OAAO,IAAC,IAAI,EAAC,mCAAmC,EAAC,QAAQ,EAAE,QAAQ,YAClE,yDAAiC,QAAQ,SAAS,GAC1C,IAHF,GAAG,QAAQ,OAAO,CAItB,CACP,CAAC,CAAC;IAEL,OAAO,CACL,eAAK,SAAS,EAAC,gDAAgD,aAC5D,wBAAwB,EAAE,EAC1B,0BAA0B,EAAE,EAC5B,uBAAuB,EAAE,IACtB,CACP,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export declare const DEFAULT_TOOL_TIP_DELAY = 500;
|
|
2
|
+
export declare const tooltipPositions: readonly ["top", "left", "right", "bottom"];
|
|
3
|
+
import React from 'react';
|
|
4
|
+
export type TooltipPosition = (typeof tooltipPositions)[number];
|
|
5
|
+
export interface TooltipProps {
|
|
6
|
+
position?: TooltipPosition;
|
|
7
|
+
children?: React.JSX.Element | string;
|
|
8
|
+
text: React.JSX.Element | string;
|
|
9
|
+
delay?: number;
|
|
10
|
+
}
|
|
11
|
+
export interface TooltipComponentProps {
|
|
12
|
+
/** text to display on tooltip */
|
|
13
|
+
tooltip?: string;
|
|
14
|
+
/** number of milliseconds to wait before showing a tooltip on-hover */
|
|
15
|
+
tooltipDelay?: number;
|
|
16
|
+
/** one of four possible tooltip positions */
|
|
17
|
+
tooltipPlacement?: TooltipPosition;
|
|
18
|
+
/** true if the provided tooltip text should be rendered as HTML */
|
|
19
|
+
isHtmlTooltip?: boolean;
|
|
20
|
+
/** optional testId applied to the tooltip - useful for testing */
|
|
21
|
+
tooltipTestId?: string;
|
|
22
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Tooltip.types.js","sourceRoot":"","sources":["../../src/Tooltip/Tooltip.types.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,sBAAsB,GAAG,GAAG,CAAC;AAC1C,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,QAAQ,CAAU,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { Tooltip } from './Tooltip';
|
|
3
|
+
import Icon from '../Icon';
|
|
4
|
+
export default {
|
|
5
|
+
title: 'Tooltip',
|
|
6
|
+
};
|
|
7
|
+
const renderManyTooltips = () => {
|
|
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(_jsx("td", { children: _jsx(Tooltip, { text: `hello there ${i}`, children: _jsx(Icon, { icon: "fc-sun" }) }) }, 'col_' + i + '_row_' + rowId));
|
|
15
|
+
}
|
|
16
|
+
return cols;
|
|
17
|
+
};
|
|
18
|
+
for (let i = 0; i < rowCount; i++) {
|
|
19
|
+
rows.push(_jsxs("tr", { children: [...getCols(i)] }, 'row_' + i));
|
|
20
|
+
}
|
|
21
|
+
return (_jsx("table", { children: _jsx("tbody", { children: rows.map((row) => row) }) }));
|
|
22
|
+
};
|
|
23
|
+
export const TooltipPerformance = () => {
|
|
24
|
+
return (_jsx(_Fragment, { children: _jsx("div", { className: "tw:grid tw:grid-cols-4 tw:gap-4 tw:text-center", children: renderManyTooltips() }) }));
|
|
25
|
+
};
|
|
26
|
+
//# sourceMappingURL=TooltipPerformance.stories.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TooltipPerformance.stories.js","sourceRoot":"","sources":["../../src/Tooltip/TooltipPerformance.stories.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,IAAI,MAAM,SAAS,CAAC;AAE3B,eAAe;IACb,KAAK,EAAE,SAAS;CACjB,CAAC;AAEF,MAAM,kBAAkB,GAAG,GAAG,EAAE;IAC9B,MAAM,SAAS,GAAG,GAAG,CAAC;IACtB,MAAM,QAAQ,GAAG,GAAG,CAAC;IACrB,MAAM,IAAI,GAAG,EAAE,CAAC;IAEhB,MAAM,OAAO,GAAG,CAAC,KAAa,EAAE,EAAE;QAChC,MAAM,IAAI,GAAG,EAAE,CAAC;QAChB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,SAAS,EAAE,CAAC,EAAE,EAAE,CAAC;YACnC,IAAI,CAAC,IAAI,CACP,uBACE,KAAC,OAAO,IAAC,IAAI,EAAE,eAAe,CAAC,EAAE,YAC/B,KAAC,IAAI,IAAC,IAAI,EAAC,QAAQ,GAAG,GACd,IAHH,MAAM,GAAG,CAAC,GAAG,OAAO,GAAG,KAAK,CAIhC,CACN,CAAC;QACJ,CAAC;QACD,OAAO,IAAI,CAAC;IACd,CAAC,CAAC;IAEF,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,QAAQ,EAAE,CAAC,EAAE,EAAE,CAAC;QAClC,IAAI,CAAC,IAAI,CAAC,4BAAyB,OAAO,CAAC,CAAC,CAAC,KAA1B,MAAM,GAAG,CAAC,CAAsB,CAAC,CAAC;IACvD,CAAC;IACD,OAAO,CACL,0BACE,0BAAQ,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,GAAS,GACjC,CACT,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,kBAAkB,GAAG,GAAG,EAAE;IACrC,OAAO,CACL,4BACE,cAAK,SAAS,EAAC,gDAAgD,YAAE,kBAAkB,EAAE,GAAO,GAC3F,CACJ,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/Tooltip/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC"}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { QTipDataAttributes } from './QTip.types';
|
|
2
|
+
import { TooltipComponentProps } from './Tooltip.types';
|
|
3
|
+
export declare const getQTipData: ({ tooltip, tooltipPlacement, isHtmlTooltip, tooltipTestId, tooltipDelay, }: TooltipComponentProps) => QTipDataAttributes | undefined;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { DEFAULT_TOOL_TIP_DELAY } from './Tooltip.types';
|
|
2
|
+
export const getQTipData = ({ tooltip, tooltipPlacement, isHtmlTooltip, tooltipTestId, tooltipDelay = DEFAULT_TOOL_TIP_DELAY, }) => tooltip
|
|
3
|
+
? {
|
|
4
|
+
'data-qtip-text': tooltip,
|
|
5
|
+
'data-qtip-placement': tooltipPlacement,
|
|
6
|
+
'data-qtip-is-html': isHtmlTooltip,
|
|
7
|
+
'data-qtip-testid': tooltipTestId,
|
|
8
|
+
'data-qtip-delay': tooltipDelay,
|
|
9
|
+
}
|
|
10
|
+
: undefined;
|
|
11
|
+
//# sourceMappingURL=qTip.utilities.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"qTip.utilities.js","sourceRoot":"","sources":["../../src/Tooltip/qTip.utilities.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,sBAAsB,EAAyB,MAAM,iBAAiB,CAAC;AAEhF,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,EAC1B,OAAO,EACP,gBAAgB,EAChB,aAAa,EACb,aAAa,EACb,YAAY,GAAG,sBAAsB,GACf,EAAkC,EAAE,CAC1D,OAAO;IACL,CAAC,CAAC;QACE,gBAAgB,EAAE,OAAO;QACzB,qBAAqB,EAAE,gBAAgB;QACvC,mBAAmB,EAAE,aAAa;QAClC,kBAAkB,EAAE,aAAa;QACjC,iBAAiB,EAAE,YAAY;KAChC;IACH,CAAC,CAAC,SAAS,CAAC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import Button from './Button';
|
|
2
|
+
import ToolbarButton from './ToolbarButton';
|
|
3
|
+
import TextField from './TextField';
|
|
4
|
+
import Checkbox from './Checkbox';
|
|
5
|
+
import TextArea from './TextArea';
|
|
6
|
+
import { QTip, Tooltip } from './Tooltip';
|
|
7
|
+
import Icon from './Icon';
|
|
8
|
+
import Select from './Select';
|
|
9
|
+
import { SelectCompoents } from './Select';
|
|
10
|
+
import Modal from './Modal';
|
|
11
|
+
import Tabs from './Tabs';
|
|
12
|
+
import Accordion from './Accordion';
|
|
13
|
+
import ButtonWithPopover from './ButtonWithPopover';
|
|
14
|
+
import ButtonWithDropdown from './ButtonWithDropdown';
|
|
15
|
+
import Alert from './Alert';
|
|
16
|
+
import SeeqActionDropdown from './SeeqActionDropdown';
|
|
17
|
+
import InputGroup from './InputGroup';
|
|
18
|
+
import Collapse from './Collapse';
|
|
19
|
+
import Slider from './Slider';
|
|
20
|
+
import ProgressBar from './ProgressBar';
|
|
21
|
+
import ButtonGroup from './ButtonGroup';
|
|
22
|
+
import Carousel from './Carousel';
|
|
23
|
+
export { Tabs };
|
|
24
|
+
export { Button };
|
|
25
|
+
export { ToolbarButton };
|
|
26
|
+
export { TextField };
|
|
27
|
+
export { TextArea };
|
|
28
|
+
export { Tooltip };
|
|
29
|
+
export { Checkbox };
|
|
30
|
+
export { Icon };
|
|
31
|
+
export { Select };
|
|
32
|
+
export { SelectCompoents };
|
|
33
|
+
export { QTip };
|
|
34
|
+
export { Modal };
|
|
35
|
+
export { Accordion };
|
|
36
|
+
export { ButtonWithPopover };
|
|
37
|
+
export { ButtonWithDropdown };
|
|
38
|
+
export { Alert };
|
|
39
|
+
export { SeeqActionDropdown };
|
|
40
|
+
export { InputGroup };
|
|
41
|
+
export { Collapse };
|
|
42
|
+
export { Slider };
|
|
43
|
+
export { ProgressBar };
|
|
44
|
+
export { ButtonGroup };
|
|
45
|
+
export { Carousel };
|
|
46
|
+
export * from './types';
|