@seeqdev/qomponents 0.0.169 → 0.0.171
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/README.md +135 -135
- 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 +32 -0
- package/dist/Alert/Alert.js.map +1 -0
- package/dist/Alert/Alert.stories.d.ts +5 -0
- package/dist/Alert/Alert.stories.js +57 -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 +63 -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 +90 -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 +47 -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 +81 -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 +233 -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 +75 -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 +86 -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 +25 -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 +92 -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 +19 -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 +91 -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 +34 -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 +62 -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 +56 -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 +160 -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 +29 -0
- package/dist/SeeqActionDropdown/variants.js.map +1 -0
- package/dist/Select/Select.d.ts +15 -0
- package/dist/Select/Select.js +177 -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 +85 -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 +76 -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 +95 -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 +116 -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 +199 -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 +57 -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/example/.eslintrc.cjs +14 -14
- package/dist/example/README.md +33 -33
- package/dist/example/index.html +13 -13
- package/dist/example/package.json +32 -32
- package/dist/example/src/ComplexSelectExample.tsx +81 -81
- package/dist/example/src/Example.tsx +638 -638
- package/dist/example/src/index.css +103 -103
- package/dist/example/src/main.tsx +10 -10
- package/dist/example/src/vite-env.d.ts +1 -1
- package/dist/example/tsconfig.json +33 -33
- package/dist/example/tsconfig.node.json +12 -12
- package/dist/example/vite.config.ts +13 -13
- package/dist/index.d.ts +46 -0
- package/dist/index.esm.js +12 -12
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +12 -12
- 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 +3868 -3852
- 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 +89 -89
package/README.md
CHANGED
|
@@ -1,136 +1,136 @@
|
|
|
1
|
-
<!-- markdownlint-disable-next-line -->
|
|
2
|
-
<p align="center">
|
|
3
|
-
<img width="150" src="https://seeq.com/sites/default/files/seeq-content/seeq-logo-blue-web-33h.svg" alt="Seeq logo">
|
|
4
|
-
</p>
|
|
5
|
-
<h1 align="center">qomponents</h1>
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
Seeq qomponents are a collection of UI components, including a Button, a TextField, an Icon, as well as a Tooltip
|
|
9
|
-
React component (more coming soon!)
|
|
10
|
-
|
|
11
|
-
These components are used by Seeq's application and are made publicly available for Developers who want to expand
|
|
12
|
-
the Seeq eco-system with their own plugins and add-ons without having to worry about creating a cohesive Seeq UX
|
|
13
|
-
experience. Every component comes fully styled (and with dark mode support).
|
|
14
|
-
|
|
15
|
-
## Installation
|
|
16
|
-
|
|
17
|
-
Seeq qomponents are available on npm.
|
|
18
|
-
|
|
19
|
-
**npm:**
|
|
20
|
-
|
|
21
|
-
```sh
|
|
22
|
-
npm install @seeqdev/qomponents
|
|
23
|
-
```
|
|
24
|
-
|
|
25
|
-
**yarn:**
|
|
26
|
-
|
|
27
|
-
```sh
|
|
28
|
-
yarn add @seeqdev/qomponents
|
|
29
|
-
```
|
|
30
|
-
|
|
31
|
-
## Getting started with Seeq qomponents
|
|
32
|
-
|
|
33
|
-
Prefer a more complete example? <br/>Checkout the example folder provided.
|
|
34
|
-
It includes a ready to run example application. Start with the readme in the example folder to get up and running!
|
|
35
|
-
|
|
36
|
-
Here is an example of a basic app using the `Button` component:
|
|
37
|
-
|
|
38
|
-
```jsx
|
|
39
|
-
import * as React from 'react';
|
|
40
|
-
import {Button} from '@seeqdev/qomponents';
|
|
41
|
-
|
|
42
|
-
function App() {
|
|
43
|
-
return <Button variant="theme" label="Seeq Rocks" />;
|
|
44
|
-
}
|
|
45
|
-
```
|
|
46
|
-
|
|
47
|
-
To make sure all styles are properly applied be sure to include the qomponents css file in your main css file.
|
|
48
|
-
|
|
49
|
-
```css
|
|
50
|
-
@import '@seeqdev/qomponents/dist/styles.css';
|
|
51
|
-
```
|
|
52
|
-
|
|
53
|
-
<b>A note on CSS:</b> Seeq's qomponents come fully styled and ready to use. While it is tempting to use the
|
|
54
|
-
available <i>extraClassNames</i> property to provide yet additional styling we strongly advise you to use this
|
|
55
|
-
property to provide only width, margins and padding. This will ensure for a smooth upgrade experience when
|
|
56
|
-
Seeq's look and feel changes.
|
|
57
|
-
<br />
|
|
58
|
-
<b>Tip:</b>: to indicate missing or wrong user input use the <i>showError</i> property available on TextField,
|
|
59
|
-
TextArea, as well as Select.
|
|
60
|
-
|
|
61
|
-
## Frequently asked questions
|
|
62
|
-
|
|
63
|
-
<h3>1) I use webpack and I get a strange error once I added qomponents to my package.json!</h3>
|
|
64
|
-
|
|
65
|
-
Webpack needs a little help :)
|
|
66
|
-
Add the following to the <code>rules</code> array in your <code>webpack.config</code>
|
|
67
|
-
|
|
68
|
-
```
|
|
69
|
-
{
|
|
70
|
-
test: /@?(seeqdev).*\.(ts|js)x?$/,
|
|
71
|
-
loader:'babel-loader'
|
|
72
|
-
},
|
|
73
|
-
{
|
|
74
|
-
test: /\.(woff|woff2|eot|ttf|otf)$/i,
|
|
75
|
-
type: 'asset/resource',
|
|
76
|
-
}
|
|
77
|
-
```
|
|
78
|
-
|
|
79
|
-
If you're using webpack + scss be sure to include a <code>~</code> as part of the css import path:
|
|
80
|
-
|
|
81
|
-
```
|
|
82
|
-
@import '~@seeqdev/qomponents/dist/styles.css';
|
|
83
|
-
@import '~@fortawesome/fontawesome-free/css/all.css';
|
|
84
|
-
```
|
|
85
|
-
|
|
86
|
-
<h3>2) How do I get my Button to be green?</h3>
|
|
87
|
-
|
|
88
|
-
The colors of your qomponents are controlled by the "theme". </br>
|
|
89
|
-
If you do not provide a theme your qomponents will use the default blue or also known as Topic-based theme.
|
|
90
|
-
Themes are applied by adding the class of the desired theme to a wrapper of your application. The theme class can
|
|
91
|
-
also be applied to the body tag.
|
|
92
|
-
|
|
93
|
-
```html
|
|
94
|
-
|
|
95
|
-
<div class="color_analysis">
|
|
96
|
-
... your application here
|
|
97
|
-
</div>
|
|
98
|
-
|
|
99
|
-
```
|
|
100
|
-
|
|
101
|
-
There are 3 themes available:
|
|
102
|
-
|
|
103
|
-
| Theme | Color | Class | Example |
|
|
104
|
-
|:---------|:-------|:---------------|:-----------------------|
|
|
105
|
-
| Topic | blue | color_topic | class="color_topic" |
|
|
106
|
-
| Analysis | green | color_analysis | class="color_analysis" |
|
|
107
|
-
| DataLab | orange | color_datalab | class="color_datalab" |
|
|
108
|
-
|
|
109
|
-
<h3>3) How do I use Fontawesome Icons?</h3>
|
|
110
|
-
Before you can use Fontawesome icons you must install FontAwesome.
|
|
111
|
-
|
|
112
|
-
```
|
|
113
|
-
npm install --save @fortawesome/fontawesome-free
|
|
114
|
-
```
|
|
115
|
-
|
|
116
|
-
Once it's installed simply import the required css files. To import all variations of FontAwesome's Icons you can
|
|
117
|
-
add the following import to your main css file:
|
|
118
|
-
|
|
119
|
-
```
|
|
120
|
-
@import "@fortawesome/fontawesome-free/css/all.css";
|
|
121
|
-
```
|
|
122
|
-
|
|
123
|
-
If your project only uses Classic Solid or (Sharp Solids, or any other one kind) it's better to import only the
|
|
124
|
-
required css for that Icon type to keep your packages size small.<br/> Note: if you don't import "all" like shown above
|
|
125
|
-
be sure to include <code>fontawesome.css</code> in addition to whatever Icon style you require.
|
|
126
|
-
|
|
127
|
-
For Example:
|
|
128
|
-
|
|
129
|
-
```
|
|
130
|
-
@import "@fortawesome/fontawesome-free/css/fontawesome.css";
|
|
131
|
-
@import "@fortawesome/fontawesome-free/css/solid.css";
|
|
132
|
-
```
|
|
133
|
-
|
|
134
|
-
<h3>4) How can I see all the props that are available?</h3>
|
|
135
|
-
Take a look at the <code>.types.d.ts</code> files that can be found in the <code>dist/{component name}/</code>
|
|
1
|
+
<!-- markdownlint-disable-next-line -->
|
|
2
|
+
<p align="center">
|
|
3
|
+
<img width="150" src="https://seeq.com/sites/default/files/seeq-content/seeq-logo-blue-web-33h.svg" alt="Seeq logo">
|
|
4
|
+
</p>
|
|
5
|
+
<h1 align="center">qomponents</h1>
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
Seeq qomponents are a collection of UI components, including a Button, a TextField, an Icon, as well as a Tooltip
|
|
9
|
+
React component (more coming soon!)
|
|
10
|
+
|
|
11
|
+
These components are used by Seeq's application and are made publicly available for Developers who want to expand
|
|
12
|
+
the Seeq eco-system with their own plugins and add-ons without having to worry about creating a cohesive Seeq UX
|
|
13
|
+
experience. Every component comes fully styled (and with dark mode support).
|
|
14
|
+
|
|
15
|
+
## Installation
|
|
16
|
+
|
|
17
|
+
Seeq qomponents are available on npm.
|
|
18
|
+
|
|
19
|
+
**npm:**
|
|
20
|
+
|
|
21
|
+
```sh
|
|
22
|
+
npm install @seeqdev/qomponents
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
**yarn:**
|
|
26
|
+
|
|
27
|
+
```sh
|
|
28
|
+
yarn add @seeqdev/qomponents
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
## Getting started with Seeq qomponents
|
|
32
|
+
|
|
33
|
+
Prefer a more complete example? <br/>Checkout the example folder provided.
|
|
34
|
+
It includes a ready to run example application. Start with the readme in the example folder to get up and running!
|
|
35
|
+
|
|
36
|
+
Here is an example of a basic app using the `Button` component:
|
|
37
|
+
|
|
38
|
+
```jsx
|
|
39
|
+
import * as React from 'react';
|
|
40
|
+
import {Button} from '@seeqdev/qomponents';
|
|
41
|
+
|
|
42
|
+
function App() {
|
|
43
|
+
return <Button variant="theme" label="Seeq Rocks" />;
|
|
44
|
+
}
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
To make sure all styles are properly applied be sure to include the qomponents css file in your main css file.
|
|
48
|
+
|
|
49
|
+
```css
|
|
50
|
+
@import '@seeqdev/qomponents/dist/styles.css';
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
<b>A note on CSS:</b> Seeq's qomponents come fully styled and ready to use. While it is tempting to use the
|
|
54
|
+
available <i>extraClassNames</i> property to provide yet additional styling we strongly advise you to use this
|
|
55
|
+
property to provide only width, margins and padding. This will ensure for a smooth upgrade experience when
|
|
56
|
+
Seeq's look and feel changes.
|
|
57
|
+
<br />
|
|
58
|
+
<b>Tip:</b>: to indicate missing or wrong user input use the <i>showError</i> property available on TextField,
|
|
59
|
+
TextArea, as well as Select.
|
|
60
|
+
|
|
61
|
+
## Frequently asked questions
|
|
62
|
+
|
|
63
|
+
<h3>1) I use webpack and I get a strange error once I added qomponents to my package.json!</h3>
|
|
64
|
+
|
|
65
|
+
Webpack needs a little help :)
|
|
66
|
+
Add the following to the <code>rules</code> array in your <code>webpack.config</code>
|
|
67
|
+
|
|
68
|
+
```
|
|
69
|
+
{
|
|
70
|
+
test: /@?(seeqdev).*\.(ts|js)x?$/,
|
|
71
|
+
loader:'babel-loader'
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
test: /\.(woff|woff2|eot|ttf|otf)$/i,
|
|
75
|
+
type: 'asset/resource',
|
|
76
|
+
}
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
If you're using webpack + scss be sure to include a <code>~</code> as part of the css import path:
|
|
80
|
+
|
|
81
|
+
```
|
|
82
|
+
@import '~@seeqdev/qomponents/dist/styles.css';
|
|
83
|
+
@import '~@fortawesome/fontawesome-free/css/all.css';
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
<h3>2) How do I get my Button to be green?</h3>
|
|
87
|
+
|
|
88
|
+
The colors of your qomponents are controlled by the "theme". </br>
|
|
89
|
+
If you do not provide a theme your qomponents will use the default blue or also known as Topic-based theme.
|
|
90
|
+
Themes are applied by adding the class of the desired theme to a wrapper of your application. The theme class can
|
|
91
|
+
also be applied to the body tag.
|
|
92
|
+
|
|
93
|
+
```html
|
|
94
|
+
|
|
95
|
+
<div class="color_analysis">
|
|
96
|
+
... your application here
|
|
97
|
+
</div>
|
|
98
|
+
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
There are 3 themes available:
|
|
102
|
+
|
|
103
|
+
| Theme | Color | Class | Example |
|
|
104
|
+
|:---------|:-------|:---------------|:-----------------------|
|
|
105
|
+
| Topic | blue | color_topic | class="color_topic" |
|
|
106
|
+
| Analysis | green | color_analysis | class="color_analysis" |
|
|
107
|
+
| DataLab | orange | color_datalab | class="color_datalab" |
|
|
108
|
+
|
|
109
|
+
<h3>3) How do I use Fontawesome Icons?</h3>
|
|
110
|
+
Before you can use Fontawesome icons you must install FontAwesome.
|
|
111
|
+
|
|
112
|
+
```
|
|
113
|
+
npm install --save @fortawesome/fontawesome-free
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
Once it's installed simply import the required css files. To import all variations of FontAwesome's Icons you can
|
|
117
|
+
add the following import to your main css file:
|
|
118
|
+
|
|
119
|
+
```
|
|
120
|
+
@import "@fortawesome/fontawesome-free/css/all.css";
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
If your project only uses Classic Solid or (Sharp Solids, or any other one kind) it's better to import only the
|
|
124
|
+
required css for that Icon type to keep your packages size small.<br/> Note: if you don't import "all" like shown above
|
|
125
|
+
be sure to include <code>fontawesome.css</code> in addition to whatever Icon style you require.
|
|
126
|
+
|
|
127
|
+
For Example:
|
|
128
|
+
|
|
129
|
+
```
|
|
130
|
+
@import "@fortawesome/fontawesome-free/css/fontawesome.css";
|
|
131
|
+
@import "@fortawesome/fontawesome-free/css/solid.css";
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
<h3>4) How can I see all the props that are available?</h3>
|
|
135
|
+
Take a look at the <code>.types.d.ts</code> files that can be found in the <code>dist/{component name}/</code>
|
|
136
136
|
folder. This file contains all available properties including some descriptive text that tells you more about them.
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Root, Item, Trigger, Content } from '@radix-ui/react-accordion';
|
|
3
|
+
const Accordion = ({ accordionItems, defaultValue, value, onItemSelect, disabled, extraClassNames, testId, }) => {
|
|
4
|
+
return (_jsx(Root, { className: `tw-rounded-md tw-w-full focus-visible:tw-outline-none ${extraClassNames || ''}`, type: "single", defaultValue: defaultValue, value: value, collapsible: true, "data-testid": testId, onValueChange: (_value) => onItemSelect(_value), children: accordionItems.map((item) => (_jsxs(Item, { className: `tw-bg-transparent tw-p-0 tw-flex tw-flex-col tw-w-full`, disabled: disabled, value: item.value, children: [_jsx(Trigger, { disabled: disabled, className: `tw-w-full tw-cursor-default focus-visible:tw-outline-none`, children: item.trigger }), _jsx(Content, { className: `data-[state=open]:tw-animate-slideDown data-[state=closed]:tw-animate-slideUp tw-overflow-hidden focus-visible:tw-outline-none ${item.contentClassNames || ''}`, children: item.content })] }, item.value))) }));
|
|
5
|
+
};
|
|
6
|
+
export default Accordion;
|
|
7
|
+
//# sourceMappingURL=Accordion.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Accordion.js","sourceRoot":"","sources":["../../src/Accordion/Accordion.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,2BAA2B,CAAC;AAGzE,MAAM,SAAS,GAA4C,CAAC,EAC1D,cAAc,EACd,YAAY,EACZ,KAAK,EACL,YAAY,EACZ,QAAQ,EACR,eAAe,EACf,MAAM,GACP,EAAE,EAAE;IACH,OAAO,CACL,KAAC,IAAI,IACH,SAAS,EAAE,yDAAyD,eAAe,IAAI,EAAE,EAAE,EAC3F,IAAI,EAAC,QAAQ,EACb,YAAY,EAAE,YAAY,EAC1B,KAAK,EAAE,KAAK,EACZ,WAAW,uBACE,MAAM,EACnB,aAAa,EAAE,CAAC,MAAM,EAAE,EAAE,CAAC,YAAY,CAAC,MAAM,CAAC,YAC9C,cAAc,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAC5B,MAAC,IAAI,IACH,SAAS,EAAE,wDAAwD,EAEnE,QAAQ,EAAE,QAAQ,EAClB,KAAK,EAAE,IAAI,CAAC,KAAK,aACjB,KAAC,OAAO,IAAC,QAAQ,EAAE,QAAQ,EAAE,SAAS,EAAE,2DAA2D,YAChG,IAAI,CAAC,OAAO,GACL,EACV,KAAC,OAAO,IACN,SAAS,EAAE,kIACT,IAAI,CAAC,iBAAiB,IAAI,EAC5B,EAAE,YACD,IAAI,CAAC,OAAO,GACL,KAXL,IAAI,CAAC,KAAK,CAYV,CACR,CAAC,GACG,CACR,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,SAAS,CAAC"}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import Accordion from './Accordion';
|
|
4
|
+
import { QTip } from '../Tooltip/Qtip';
|
|
5
|
+
import Icon from '../Icon';
|
|
6
|
+
import Tabs from '../Tabs';
|
|
7
|
+
import Button from '../Button';
|
|
8
|
+
export default {
|
|
9
|
+
title: 'Accordion',
|
|
10
|
+
};
|
|
11
|
+
const Trigger = ({ label }) => (_jsxs("div", { className: "tw-flex tw-justify-start tw-items-center tw-border-b tw-px-2 tw-text-sq-color-dark", children: [_jsx(Icon, { icon: "fc-arrow-dropdown", extraClassNames: "tw-text-sq-color-dark tw-mr-[0.5rem] tw-text-[0.75rem]", type: "text" }), label] }));
|
|
12
|
+
const TriggerSecond = ({ label }) => (_jsxs("div", { className: "tw-flex tw-justify-between tw-items-center tw-border-b tw-px-2 tw-text-sq-color-dark tw-py-2", children: [label, _jsx(Icon, { icon: "fc-arrow-dropdown", extraClassNames: "tw-text-sq-color-dark tw-mr-[0.5rem] tw-text-[0.75rem]", type: "text" })] }));
|
|
13
|
+
const renderData = () => (_jsxs("div", { className: "tw-text-sq-color-gray dark:tw-text-sq-white", children: [_jsx("p", { className: "tw-mb-5 tw-text-[0.9375rem] tw-leading-normal", children: "This is a data tab to show details about your data. You can make changes to your account" }), _jsx(Button, { variant: "outline", label: "Save data" })] }));
|
|
14
|
+
const renderTools = () => (_jsxs("div", { className: "tw-text-sq-color-gray dark:tw-text-sq-white", children: [_jsx("p", { className: "tw-mb-5 tw-text-[0.9375rem] tw-leading-normal", children: "Make changes to your account here. Click save when you're done." }), _jsx(Button, { variant: "outline", label: "Save tools" })] }));
|
|
15
|
+
const renderJournal = () => (_jsxs("div", { className: "tw-text-sq-color-gray dark:tw-text-sq-white", children: [_jsx("p", { className: "tw-mb-5 tw-text-[0.9375rem] tw-leading-normal", children: "Make changes to your account here. Click save when you're done." }), _jsx(Button, { variant: "outline", label: "Save journal" })] }));
|
|
16
|
+
const tabsList = [
|
|
17
|
+
{
|
|
18
|
+
id: 'data',
|
|
19
|
+
label: 'Data',
|
|
20
|
+
icon: 'fc-data',
|
|
21
|
+
content: renderData(),
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
id: 'tools',
|
|
25
|
+
label: 'Tools',
|
|
26
|
+
icon: 'fc-gears-2',
|
|
27
|
+
content: renderTools(),
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
id: 'journal',
|
|
31
|
+
label: 'Journal',
|
|
32
|
+
icon: 'fc-workbook-lock',
|
|
33
|
+
content: renderJournal(),
|
|
34
|
+
},
|
|
35
|
+
];
|
|
36
|
+
export const AllAccordionVariants = () => {
|
|
37
|
+
const [activeTab, setActiveTab] = React.useState('data');
|
|
38
|
+
const [value, setValue] = React.useState('oranges');
|
|
39
|
+
const accordionItems = [
|
|
40
|
+
{
|
|
41
|
+
value: 'oranges',
|
|
42
|
+
id: 'oranges',
|
|
43
|
+
itemTestId: 'oranges',
|
|
44
|
+
trigger: _jsx(Trigger, { label: "Oranges" }),
|
|
45
|
+
content: (_jsx("div", { className: "tw-p-2 tw-text-[0.8125rem] dark:tw-text-sq-white", children: "Oranges are the fruit of the citrus species Citrus \u00D7 sinensis in the family Rutaceae. They are also called sweet oranges to distinguish them from the related Citrus \u00D7 aurantium, referred to as bitter oranges. They are round and orange, and usually have a sour or bitter taste. Oranges are a good source of vitamin C." })),
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
value: 'apples',
|
|
49
|
+
id: 'apples',
|
|
50
|
+
itemTestId: 'apples',
|
|
51
|
+
trigger: _jsx(Trigger, { label: "Apples" }),
|
|
52
|
+
content: (_jsx("div", { children: _jsx("div", { className: "tw-p-4", children: _jsx(Tabs, { stretchTabs: true, activeTab: activeTab, onTabSelect: setActiveTab, defaultActiveTab: "data", tabs: tabsList }) }) })),
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
value: 'bananas',
|
|
56
|
+
id: 'bananas',
|
|
57
|
+
trigger: _jsx(Trigger, { label: "Bananas" }),
|
|
58
|
+
itemTestId: 'bananas',
|
|
59
|
+
content: (_jsx("div", { children: "A banana is an elongated, edible fruit \u2013 botanically a berry \u2013 produced by several kinds of large herbaceous flowering plants in the genus Musa. In some countries, bananas used for cooking may be called \"plantains\", distinguishing them from dessert bananas. The fruit is variable in size, color, and firmness, but is usually elongated and curved, with soft flesh rich in starch covered with a rind, which may be green, yellow, red, purple, or brown when ripe." })),
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
value: 'pineapples',
|
|
63
|
+
id: 'pineapples',
|
|
64
|
+
trigger: _jsx(Trigger, { label: "Pineapples" }),
|
|
65
|
+
itemTestId: 'pineapples',
|
|
66
|
+
content: (_jsx("div", { children: "The pineapple is a tropical plant with an edible fruit and the most economically significant plant in the family Bromeliaceae. The pineapple is indigenous to South America, where it has been cultivated for many centuries. The introduction of the pineapple to Europe in the 17th century made it a significant cultural icon of luxury. Since the 1820s, pineapple has been commercially grown in greenhouses and many tropical plantations." })),
|
|
67
|
+
},
|
|
68
|
+
];
|
|
69
|
+
const allAccordions = (isDark) => (_jsx("div", { className: isDark ? 'tw-dark tw-bg-sq-dark-background' : '', children: _jsx("div", { className: "tw-p-5 ", children: _jsx(Accordion, { accordionItems: isDark
|
|
70
|
+
? accordionItems
|
|
71
|
+
: accordionItems.map((item) => ({ ...item, trigger: _jsx(TriggerSecond, { label: item.value.toUpperCase() }) })), value: value, testId: "basic-accordion1", onItemSelect: (value) => setValue(value) }) }) }));
|
|
72
|
+
const renderAllVariations = (isDark) => _jsx("div", { className: "tw-p-4", children: allAccordions(isDark) });
|
|
73
|
+
return (_jsxs(_Fragment, { children: [_jsxs("div", { className: "tw-grid tw-grid-cols-4 tw-gap-4", children: [_jsx(QTip, {}), _jsxs("div", { className: "color_topic", children: [_jsx("b", { children: "Topic Colors" }), renderAllVariations()] }), _jsxs("div", { className: "color_analysis", children: [_jsx("b", { children: "Analysis Colors" }), renderAllVariations()] }), _jsxs("div", { className: "color_datalab", children: [_jsx("b", { children: "Datalab Colors" }), renderAllVariations()] }), _jsxs("div", { className: "color_vantage", children: [_jsx("b", { children: "Vantage Colors" }), renderAllVariations()] })] }), _jsxs("div", { className: "tw-dark tw-bg-sq-dark-background tw-grid tw-grid-cols-4 tw-gap-4 tw-py-4", children: [_jsxs("div", { className: "color_topic dark:tw-text-sq-white tw-text-center", children: [_jsx("b", { children: "Topic Colors" }), renderAllVariations(true)] }), _jsxs("div", { className: "color_analysis dark:tw-text-sq-white tw-text-center", children: [_jsx("b", { children: "Analysis Colors" }), renderAllVariations(true)] }), _jsxs("div", { className: "color_datalab dark:tw-text-sq-white tw-text-center", children: [_jsx("b", { children: "Datalab Colors" }), renderAllVariations(true)] }), _jsxs("div", { className: "color_vantage dark:tw-text-sq-white tw-text-center", children: [_jsx("b", { children: "Vantage Colors" }), renderAllVariations(true)] })] })] }));
|
|
74
|
+
};
|
|
75
|
+
//# sourceMappingURL=Accordion.stories.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Accordion.stories.js","sourceRoot":"","sources":["../../src/Accordion/Accordion.stories.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,SAAS,MAAM,aAAa,CAAC;AACpC,OAAO,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AACvC,OAAO,IAAI,MAAM,SAAS,CAAC;AAC3B,OAAO,IAAI,MAAM,SAAS,CAAC;AAC3B,OAAO,MAAM,MAAM,WAAW,CAAC;AAE/B,eAAe;IACb,KAAK,EAAE,WAAW;CACnB,CAAC;AAEF,MAAM,OAAO,GAAG,CAAC,EAAE,KAAK,EAAqB,EAAE,EAAE,CAAC,CAChD,eAAK,SAAS,EAAC,oFAAoF,aACjG,KAAC,IAAI,IAAC,IAAI,EAAC,mBAAmB,EAAC,eAAe,EAAC,wDAAwD,EAAC,IAAI,EAAC,MAAM,GAAG,EACrH,KAAK,IACF,CACP,CAAC;AAEF,MAAM,aAAa,GAAG,CAAC,EAAE,KAAK,EAAqB,EAAE,EAAE,CAAC,CACtD,eAAK,SAAS,EAAC,8FAA8F,aAC1G,KAAK,EACN,KAAC,IAAI,IAAC,IAAI,EAAC,mBAAmB,EAAC,eAAe,EAAC,wDAAwD,EAAC,IAAI,EAAC,MAAM,GAAG,IAClH,CACP,CAAC;AAEF,MAAM,UAAU,GAAG,GAAG,EAAE,CAAC,CACvB,eAAK,SAAS,EAAC,6CAA6C,aAC1D,YAAG,SAAS,EAAC,+CAA+C,yGAExD,EACJ,KAAC,MAAM,IAAC,OAAO,EAAC,SAAS,EAAC,KAAK,EAAC,WAAW,GAAG,IAC1C,CACP,CAAC;AAEF,MAAM,WAAW,GAAG,GAAG,EAAE,CAAC,CACxB,eAAK,SAAS,EAAC,6CAA6C,aAC1D,YAAG,SAAS,EAAC,+CAA+C,gFAExD,EACJ,KA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AAgB,EAAE,EAAE,CAAC,cAAK,SAAS,EAAC,QAAQ,YAAE,aAAa,CAAC,MAAM,CAAC,GAAO,CAAC;IAExG,OAAO,CACL,8BACE,eAAK,SAAS,EAAC,iCAAiC,aAC9C,KAAC,IAAI,KAAG,EACR,eAAK,SAAS,EAAC,aAAa,aAC1B,uCAAmB,EAClB,mBAAmB,EAAE,IAClB,EAEN,eAAK,SAAS,EAAC,gBAAgB,aAC7B,0CAAsB,EACrB,mBAAmB,EAAE,IAClB,EAEN,eAAK,SAAS,EAAC,eAAe,aAC5B,yCAAqB,EACpB,mBAAmB,EAAE,IAClB,EAEN,eAAK,SAAS,EAAC,eAAe,aAC5B,yCAAqB,EACpB,mBAAmB,EAAE,IAClB,IACF,EACN,eAAK,SAAS,EAAC,0EAA0E,aACvF,eAAK,SAAS,EAAC,kDAAkD,aAC/D,uCAAmB,EAClB,mBAAmB,CAAC,IAAI,CAAC,IACtB,EAEN,eAAK,SAAS,EAAC,qDAAqD,aAClE,0CAAsB,EACrB,mBAAmB,CAAC,IAAI,CAAC,IACtB,EAEN,eAAK,SAAS,EAAC,oDAAoD,aACjE,yCAAqB,EACpB,mBAAmB,CAAC,IAAI,CAAC,IACtB,EAEN,eAAK,SAAS,EAAC,oDAAoD,aACjE,yCAAqB,EACpB,mBAAmB,CAAC,IAAI,CAAC,IACtB,IACF,IACL,CACJ,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import '@testing-library/jest-dom';
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import '@testing-library/jest-dom';
|
|
3
|
+
import { render, screen } from '@testing-library/react';
|
|
4
|
+
import userEvent from '@testing-library/user-event';
|
|
5
|
+
import Accordion from './Accordion';
|
|
6
|
+
describe('Accordion', () => {
|
|
7
|
+
const mockOnItemSelect = jest.fn();
|
|
8
|
+
class Context {
|
|
9
|
+
testId = 'buttonTestId';
|
|
10
|
+
label = 'button label';
|
|
11
|
+
props = {
|
|
12
|
+
accordionItems: [
|
|
13
|
+
{
|
|
14
|
+
id: 'item1',
|
|
15
|
+
value: 'item1',
|
|
16
|
+
trigger: 'Item 1',
|
|
17
|
+
content: 'Content 1',
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
id: 'item2',
|
|
21
|
+
value: 'item2',
|
|
22
|
+
trigger: 'Item 2',
|
|
23
|
+
content: 'Content 2',
|
|
24
|
+
},
|
|
25
|
+
],
|
|
26
|
+
defaultValue: 'item1',
|
|
27
|
+
value: 'item1',
|
|
28
|
+
onItemSelect: (key) => mockOnItemSelect(key),
|
|
29
|
+
disabled: false,
|
|
30
|
+
extraClassNames: 'extra-class',
|
|
31
|
+
testId: this.testId,
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
let tc;
|
|
35
|
+
beforeEach(() => {
|
|
36
|
+
tc = new Context();
|
|
37
|
+
});
|
|
38
|
+
const renderAccordion = (props) => render(_jsx(Accordion, { ...props }));
|
|
39
|
+
it('renders accordion items', () => {
|
|
40
|
+
renderAccordion(tc.props);
|
|
41
|
+
expect(screen.getByText('Item 1')).toBeInTheDocument();
|
|
42
|
+
expect(screen.getByText('Item 2')).toBeInTheDocument();
|
|
43
|
+
});
|
|
44
|
+
it('renders accordion content', () => {
|
|
45
|
+
renderAccordion(tc.props);
|
|
46
|
+
expect(screen.getByText('Content 1')).toBeInTheDocument();
|
|
47
|
+
expect(screen.queryByText('Content 2')).not.toBeInTheDocument();
|
|
48
|
+
});
|
|
49
|
+
it('calls onItemSelect when an item is selected', async () => {
|
|
50
|
+
renderAccordion(tc.props);
|
|
51
|
+
await userEvent.click(screen.getByText('Item 2'));
|
|
52
|
+
expect(mockOnItemSelect).toHaveBeenCalledWith('item2');
|
|
53
|
+
});
|
|
54
|
+
});
|
|
55
|
+
//# sourceMappingURL=Accordion.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Accordion.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AAM,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAC,CAAC,iBAAiB,EAAE,CAAC;QACvD,MAAM,CAAC,MAAM,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAC,CAAC,iBAAiB,EAAE,CAAC;IACzD,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,2BAA2B,EAAE,GAAG,EAAE;QACnC,eAAe,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC;QAC1B,MAAM,CAAC,MAAM,CAAC,SAAS,CAAC,WAAW,CAAC,CAAC,CAAC,iBAAiB,EAAE,CAAC;QAC1D,MAAM,CAAC,MAAM,CAAC,WAAW,CAAC,WAAW,CAAC,CAAC,CAAC,GAAG,CAAC,iBAAiB,EAAE,CAAC;IAClE,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,6CAA6C,EAAE,KAAK,IAAI,EAAE;QAC3D,eAAe,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC;QAC1B,MAAM,SAAS,CAAC,KAAK,CAAC,MAAM,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAC,CAAC;QAClD,MAAM,CAAC,gBAAgB,CAAC,CAAC,oBAAoB,CAAC,OAAO,CAAC,CAAC;IACzD,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export interface AccordionProps {
|
|
3
|
+
/**
|
|
4
|
+
* Additional CSS classes to apply to the accordion container.
|
|
5
|
+
* Use this to customize the styling of the entire accordion component.
|
|
6
|
+
*/
|
|
7
|
+
extraClassNames?: string;
|
|
8
|
+
/**
|
|
9
|
+
* The value of the accordion item that should be expanded by default when the component first renders.
|
|
10
|
+
* Only used when the accordion is in uncontrolled mode (when you don't manage the state externally).
|
|
11
|
+
* Should match the `value` of one of the items in `accordionItems`.
|
|
12
|
+
*/
|
|
13
|
+
defaultValue?: string;
|
|
14
|
+
/**
|
|
15
|
+
* The value of the currently selected/expanded accordion item.
|
|
16
|
+
* This should match the `value` property of one of the items in `accordionItems`.
|
|
17
|
+
* Use this when you want to control which item is expanded from a parent component.
|
|
18
|
+
*/
|
|
19
|
+
value: string;
|
|
20
|
+
/**
|
|
21
|
+
* When true, disables the entire accordion component, preventing any user interaction.
|
|
22
|
+
* Individual items can still be disabled independently using their own `disabled` property.
|
|
23
|
+
*/
|
|
24
|
+
disabled?: boolean;
|
|
25
|
+
/**
|
|
26
|
+
* Array of accordion items to render. Each item represents a collapsible section
|
|
27
|
+
* with a clickable header (trigger) and expandable content area.
|
|
28
|
+
*/
|
|
29
|
+
accordionItems: AccordionItem[];
|
|
30
|
+
/**
|
|
31
|
+
* Test ID attribute for the accordion container element.
|
|
32
|
+
* Used for automated testing and element selection in test suites.
|
|
33
|
+
*/
|
|
34
|
+
testId?: string;
|
|
35
|
+
/**
|
|
36
|
+
* Callback function triggered when a user clicks on an accordion item header.
|
|
37
|
+
* Receives the `value` of the selected item as a parameter.
|
|
38
|
+
* Use this to handle accordion state changes and update the `value` prop accordingly.
|
|
39
|
+
*/
|
|
40
|
+
onItemSelect: (key: string) => void;
|
|
41
|
+
}
|
|
42
|
+
interface AccordionItem {
|
|
43
|
+
/**
|
|
44
|
+
* Unique identifier for the accordion item.
|
|
45
|
+
* This value is used to determine which item is currently expanded and
|
|
46
|
+
* is passed to the `onItemSelect` callback when the item is clicked.
|
|
47
|
+
*/
|
|
48
|
+
value: string;
|
|
49
|
+
/**
|
|
50
|
+
* The content displayed in the clickable header/trigger area of the accordion item.
|
|
51
|
+
* This is what users click to expand or collapse the item.
|
|
52
|
+
* Can be any React element (text, icons, buttons, etc.).
|
|
53
|
+
*/
|
|
54
|
+
trigger: React.ReactNode;
|
|
55
|
+
/**
|
|
56
|
+
* The content displayed when the accordion item is expanded.
|
|
57
|
+
* This is the collapsible content area that shows/hides when the trigger is clicked.
|
|
58
|
+
* Can contain any React elements including forms, lists, text, or other components.
|
|
59
|
+
*/
|
|
60
|
+
content: React.ReactNode;
|
|
61
|
+
/**
|
|
62
|
+
* Test ID attribute for this specific accordion item.
|
|
63
|
+
* Used for automated testing to uniquely identify and interact with this item.
|
|
64
|
+
* Applied to the item's container element.
|
|
65
|
+
*/
|
|
66
|
+
itemTestId?: string;
|
|
67
|
+
/**
|
|
68
|
+
* HTML ID attribute for the accordion item's container element.
|
|
69
|
+
* Useful for accessibility, linking, or custom styling via CSS selectors.
|
|
70
|
+
* Should be unique across the entire page.
|
|
71
|
+
*/
|
|
72
|
+
id?: string;
|
|
73
|
+
/**
|
|
74
|
+
* When true, disables this specific accordion item, preventing user interaction.
|
|
75
|
+
* The item will appear visually disabled and clicking on it will have no effect.
|
|
76
|
+
* This overrides the parent accordion's disabled state for this individual item.
|
|
77
|
+
*/
|
|
78
|
+
disabled?: boolean;
|
|
79
|
+
/**
|
|
80
|
+
* Additional CSS classes to apply specifically to this item's content area.
|
|
81
|
+
* Use this to customize the styling of the expandable content section.
|
|
82
|
+
* Does not affect the trigger/header styling.
|
|
83
|
+
*/
|
|
84
|
+
contentClassNames?: string;
|
|
85
|
+
}
|
|
86
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Accordion.types.js","sourceRoot":"","sources":["../../src/Accordion/Accordion.types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './Accordion';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/Accordion/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import '../styles.css';
|
|
3
|
+
import Icon from '../Icon';
|
|
4
|
+
const baseClasses = 'tw-mx-auto tw-p-4 tw-leading-normal tw-outline-none tw-py-2 tw-px-3 tw-rounded-[10px] tw-w-full tw-relative' +
|
|
5
|
+
' tw-border-solid tw-border tw-text-sm tw-flex tw-flex-col tw-justify-center tw-items-center';
|
|
6
|
+
const darkTheme = 'dark:tw-bg-sq-colored-hover-dark dark:tw-text-sq-dark-text';
|
|
7
|
+
const lightTheme = 'tw-text-sq-text-color tw-bg-sq-colored-hover';
|
|
8
|
+
const errorClasses = 'tw-border-sq-danger-color';
|
|
9
|
+
const borderColorClasses = 'tw-border-sq-color-dark';
|
|
10
|
+
/**
|
|
11
|
+
* Alert.
|
|
12
|
+
*/
|
|
13
|
+
export const Alert = ({ children, dismissible = true, onClose, show = true, variant, testId = 'alert-id', id, extraClassNames, ...tooltipProps }) => {
|
|
14
|
+
const appliedTheme = {
|
|
15
|
+
theme: `${lightTheme} ${darkTheme}`,
|
|
16
|
+
danger: 'tw-text-sq-text-color tw-bg-sq-danger-color',
|
|
17
|
+
warning: 'tw-bg-sq-bg-warning-color tw-text-sq-text-color',
|
|
18
|
+
gray: 'tw-bg-sq-light-gray tw-text-sq-text-color dark:tw-bg-sq-worksheetspanel-gray-dark dark:tw-text-sq-dark-text',
|
|
19
|
+
};
|
|
20
|
+
const appliedBorderTheme = {
|
|
21
|
+
theme: borderColorClasses,
|
|
22
|
+
danger: errorClasses,
|
|
23
|
+
warning: 'tw-border-none',
|
|
24
|
+
gray: 'tw-border-sq-darkish-gray',
|
|
25
|
+
};
|
|
26
|
+
const appliedClasses = `${baseClasses} ${appliedTheme[variant]} ${extraClassNames} ${appliedBorderTheme[variant]}`;
|
|
27
|
+
if (!show) {
|
|
28
|
+
return _jsx("div", {});
|
|
29
|
+
}
|
|
30
|
+
return (_jsxs("div", { "data-testid": testId, id: id, className: appliedClasses, children: [children, dismissible && (_jsx(Icon, { icon: "fc-delete", type: variant.match(/danger|warning/) ? 'color' : 'theme', color: variant.match(/danger|warning/) ? 'inherit' : undefined, extraClassNames: `tw-self-end tw-text-[0.6875rem] tw-cursor-pointer tw-absolute tw-right-[10px] tw-top-[10px] ${variant.match(/danger|warning|gray/) ? 'tw-text-sq-text-color dark:tw-text-sq-dark-text' : ''}`, testId: `${testId}-close-btn`, onClick: onClose, ...tooltipProps }))] }));
|
|
31
|
+
};
|
|
32
|
+
//# sourceMappingURL=Alert.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Alert.js","sourceRoot":"","sources":["../../src/Alert/Alert.tsx"],"names":[],"mappings":";AACA,OAAO,eAAe,CAAC;AACvB,OAAO,IAAI,MAAM,SAAS,CAAC;AAG3B,MAAM,WAAW,GACf,6GAA6G;IAC7G,6FAA6F,CAAC;AAEhG,MAAM,SAAS,GAAG,4DAA4D,CAAC;AAC/E,MAAM,UAAU,GAAG,8CAA8C,CAAC;AAElE,MAAM,YAAY,GAAG,2BAA2B,CAAC;AAEjD,MAAM,kBAAkB,GAAG,yBAAyB,CAAC;AAErD;;GAEG;AACH,MAAM,CAAC,MAAM,KAAK,GAAwC,CAAC,EACzD,QAAQ,EACR,WAAW,GAAG,IAAI,EAClB,OAAO,EACP,IAAI,GAAG,IAAI,EACX,OAAO,EACP,MAAM,GAAG,UAAU,EACnB,EAAE,EACF,eAAe,EACf,GAAG,YAAY,EAChB,EAAE,EAAE;IACH,MAAM,YAAY,GAA0C;QAC1D,KAAK,EAAE,GAAG,UAAU,IAAI,SAAS,EAAE;QACnC,MAAM,EAAE,6CAA6C;QACrD,OAAO,EAAE,iDAAiD;QAC1D,IAAI,EAAE,6GAA6G;KACpH,CAAC;IACF,MAAM,kBAAkB,GAA0C;QAChE,KAAK,EAAE,kBAAkB;QACzB,MAAM,EAAE,YAAY;QACpB,OAAO,EAAE,gBAAgB;QACzB,IAAI,EAAE,2BAA2B;KAClC,CAAC;IACF,MAAM,cAAc,GAAG,GAAG,WAAW,IAAI,YAAY,CAAC,OAAO,CAAC,IAAI,eAAe,IAAI,kBAAkB,CAAC,OAAO,CAAC,EAAE,CAAC;IAEnH,IAAI,CAAC,IAAI,EAAE,CAAC;QACV,OAAO,eAAO,CAAC;IACjB,CA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