@seeqdev/qomponents 0.0.176 → 0.0.177
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 +9 -0
- 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 +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 +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 +76 -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/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/example/package.json +1 -1
- package/dist/iconFont/FontCustom.woff +0 -0
- package/dist/iconFont/FontCustom.woff2 +0 -0
- package/dist/index.d.ts +46 -0
- package/dist/index.esm.js +5443 -5298
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +5443 -5298
- 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/src/SeeqActionDropdown/SeeqActionDropdown.types.d.ts +5 -0
- package/dist/styles.css +2807 -3535
- 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 +5 -4
|
@@ -0,0 +1,220 @@
|
|
|
1
|
+
import { GroupBase, InputActionMeta, MenuPlacement, MultiValue, SingleValue } from 'react-select';
|
|
2
|
+
import { ReactNode } from 'react';
|
|
3
|
+
import { InputGroupPlacement } from '../types';
|
|
4
|
+
export type Option = {
|
|
5
|
+
label: string;
|
|
6
|
+
value: string | number;
|
|
7
|
+
} | any;
|
|
8
|
+
export type GroupedOption = {
|
|
9
|
+
label: string;
|
|
10
|
+
options: Option[];
|
|
11
|
+
};
|
|
12
|
+
/**
|
|
13
|
+
* Props for the Select component that provides a customizable dropdown selection interface.
|
|
14
|
+
* Built on top of react-select with additional Seeq-specific styling and functionality.
|
|
15
|
+
*/
|
|
16
|
+
export interface SelectProps {
|
|
17
|
+
/**
|
|
18
|
+
* When false (default), automatically closes the dropdown menu after an option is selected.
|
|
19
|
+
* When true, keeps the menu open after selection, useful for multi-select scenarios
|
|
20
|
+
* where users might want to select multiple options quickly.
|
|
21
|
+
*/
|
|
22
|
+
closeMenuOnSelect?: boolean;
|
|
23
|
+
/**
|
|
24
|
+
* When true, allows users to create new options by typing values not in the existing options list.
|
|
25
|
+
* The new option will be added to the selection and can be handled in the onChange callback.
|
|
26
|
+
* Useful for tag-like inputs or dynamic option lists.
|
|
27
|
+
*/
|
|
28
|
+
creatable?: boolean;
|
|
29
|
+
/**
|
|
30
|
+
* When true, disables the entire select component preventing user interaction.
|
|
31
|
+
* The select appears visually dimmed and doesn't respond to clicks or keyboard input.
|
|
32
|
+
*/
|
|
33
|
+
isDisabled?: boolean;
|
|
34
|
+
/**
|
|
35
|
+
* Additional CSS classes to apply to the select container element.
|
|
36
|
+
* Can be used to control the overall size, positioning, or styling of the select component.
|
|
37
|
+
*/
|
|
38
|
+
extraClassNames?: string;
|
|
39
|
+
/**
|
|
40
|
+
* Additional CSS classes to apply specifically to the select control (the main input area).
|
|
41
|
+
* Use this to customize the appearance of the clickable area that displays the selected value.
|
|
42
|
+
*/
|
|
43
|
+
controlClassNames?: string;
|
|
44
|
+
/**
|
|
45
|
+
* Custom filter configuration for search functionality.
|
|
46
|
+
* Advanced option for customizing how the select filters options when users type.
|
|
47
|
+
*/
|
|
48
|
+
filterConfig?: unknown;
|
|
49
|
+
/**
|
|
50
|
+
* Custom function to format how option labels are displayed in the dropdown menu and control.
|
|
51
|
+
* Receives an option object and should return a React node for custom rendering.
|
|
52
|
+
* Useful for displaying rich content like icons, badges, or formatted text.
|
|
53
|
+
*/
|
|
54
|
+
getOptionLabel?: (option: Option) => ReactNode | undefined;
|
|
55
|
+
/**
|
|
56
|
+
* Custom function to extract the value from an option object.
|
|
57
|
+
* Should return a string that uniquely identifies the option.
|
|
58
|
+
* Used internally by react-select for option comparison and selection tracking.
|
|
59
|
+
*/
|
|
60
|
+
getOptionValue?: (option: Option) => string;
|
|
61
|
+
/**
|
|
62
|
+
* Custom function to format how selected option labels are displayed.
|
|
63
|
+
* Similar to getOptionLabel but specifically for rendering selected values.
|
|
64
|
+
* Useful when you want different formatting for selected vs dropdown options.
|
|
65
|
+
*/
|
|
66
|
+
getSelectedValueLabel?: (option: Option) => ReactNode | undefined;
|
|
67
|
+
/**
|
|
68
|
+
* HTML ID attribute for the select component container.
|
|
69
|
+
* Should be unique across the page for proper HTML semantics and accessibility.
|
|
70
|
+
*/
|
|
71
|
+
id?: string;
|
|
72
|
+
/**
|
|
73
|
+
* Specifies the select's position within an input group:
|
|
74
|
+
* - `prepend`: Select is preceded by another element
|
|
75
|
+
* - `append`: Select is followed by another element
|
|
76
|
+
* Affects styling to create seamless grouped appearance.
|
|
77
|
+
*/
|
|
78
|
+
inputGroup?: InputGroupPlacement;
|
|
79
|
+
/**
|
|
80
|
+
* HTML ID attribute for the internal input element.
|
|
81
|
+
* Used for accessibility and form associations. If not provided, one will be generated.
|
|
82
|
+
*/
|
|
83
|
+
inputId?: string;
|
|
84
|
+
/**
|
|
85
|
+
* When true, displays a clear button (X) that allows users to remove their selection.
|
|
86
|
+
* Useful for optional selections where users might want to revert to no selection.
|
|
87
|
+
*/
|
|
88
|
+
isClearable?: boolean;
|
|
89
|
+
/**
|
|
90
|
+
* When true, displays a loading spinner and disables interaction while options are being fetched.
|
|
91
|
+
* Use this when loading options asynchronously to provide visual feedback to users.
|
|
92
|
+
*/
|
|
93
|
+
isLoading?: boolean;
|
|
94
|
+
/**
|
|
95
|
+
* When true, allows selection of multiple options instead of just one.
|
|
96
|
+
* Selected options are displayed as chips/tags within the control area.
|
|
97
|
+
* The onChange callback will receive an array of selected options.
|
|
98
|
+
*/
|
|
99
|
+
isMulti?: boolean;
|
|
100
|
+
/**
|
|
101
|
+
* When true, allows users to type in the select to filter/search through available options.
|
|
102
|
+
* When false, the select acts as a pure dropdown without search functionality.
|
|
103
|
+
*/
|
|
104
|
+
isSearchable?: boolean;
|
|
105
|
+
/**
|
|
106
|
+
* Forces the dropdown menu to remain open regardless of user interaction.
|
|
107
|
+
* Primarily useful for debugging or special UI scenarios. Normally should be left undefined.
|
|
108
|
+
*/
|
|
109
|
+
menuIsOpen?: boolean;
|
|
110
|
+
/**
|
|
111
|
+
* Controls where the dropdown menu appears relative to the select control:
|
|
112
|
+
* - `auto`: Automatically positions based on available space (recommended)
|
|
113
|
+
* - `top`: Always appears above the control
|
|
114
|
+
* - `bottom`: Always appears below the control
|
|
115
|
+
*/
|
|
116
|
+
menuPlacement?: MenuPlacement;
|
|
117
|
+
/**
|
|
118
|
+
* Specifies a DOM element where the dropdown menu should be rendered.
|
|
119
|
+
* When null, renders in the normal document flow. When specified, renders in a portal
|
|
120
|
+
* to that element, which can help with z-index issues.
|
|
121
|
+
*/
|
|
122
|
+
menuPortalTarget?: null | HTMLElement;
|
|
123
|
+
/**
|
|
124
|
+
* Custom message to display when no options are available for selection.
|
|
125
|
+
* Shown when the options array is empty or when search filters exclude all options.
|
|
126
|
+
* @default "No options"
|
|
127
|
+
*/
|
|
128
|
+
noOptionsMessage?: string;
|
|
129
|
+
/**
|
|
130
|
+
* Callback function triggered when the selected value(s) change.
|
|
131
|
+
* For single selects, receives a single Option or null. For multi-selects, receives an array.
|
|
132
|
+
* Use this to handle selection changes and update your application state.
|
|
133
|
+
*/
|
|
134
|
+
onChange: (newValue: SingleValue<Option> | MultiValue<Option>) => void;
|
|
135
|
+
/**
|
|
136
|
+
* Array of available options for selection in the dropdown.
|
|
137
|
+
* Can be a flat array of options or grouped options with category labels.
|
|
138
|
+
* Each option should have at minimum a label and value property.
|
|
139
|
+
*/
|
|
140
|
+
options: Option[] | GroupedOption[];
|
|
141
|
+
/**
|
|
142
|
+
* Placeholder text displayed when no option is selected.
|
|
143
|
+
* Provides guidance to users about what they should select.
|
|
144
|
+
* Only shown when there's no current selection.
|
|
145
|
+
*/
|
|
146
|
+
placeholder?: string;
|
|
147
|
+
/**
|
|
148
|
+
* When true, displays error styling (typically red border) on the select control.
|
|
149
|
+
* Used to indicate validation errors or invalid selections.
|
|
150
|
+
*/
|
|
151
|
+
showError?: boolean;
|
|
152
|
+
/**
|
|
153
|
+
* When true, renders the select in a smaller, more compact size.
|
|
154
|
+
* Useful for dense layouts or when space is limited.
|
|
155
|
+
*/
|
|
156
|
+
small?: boolean;
|
|
157
|
+
/**
|
|
158
|
+
* Currently selected option(s) for controlled component behavior.
|
|
159
|
+
* For single selects, should be a single Option or undefined.
|
|
160
|
+
* For multi-selects, should be an array of Options.
|
|
161
|
+
*/
|
|
162
|
+
value?: Option | undefined;
|
|
163
|
+
/**
|
|
164
|
+
* Initial selected option(s) for uncontrolled component behavior.
|
|
165
|
+
* Used when you want the select to manage its own state internally.
|
|
166
|
+
* Only used during initial render.
|
|
167
|
+
*/
|
|
168
|
+
defaultValue?: Option | undefined;
|
|
169
|
+
/**
|
|
170
|
+
* Custom function to determine if an option should be displayed in the menu.
|
|
171
|
+
* Receives the option and current search input, returns true to show the option.
|
|
172
|
+
* Useful for implementing complex filtering logic beyond simple text matching.
|
|
173
|
+
*/
|
|
174
|
+
filterOption?: (option: Option, rawInput: string) => boolean;
|
|
175
|
+
/**
|
|
176
|
+
* Custom function to format group labels when using grouped options.
|
|
177
|
+
* Receives a group object and should return a React node for the group header.
|
|
178
|
+
*/
|
|
179
|
+
formatGroupLabel?: (group: GroupBase<unknown>) => ReactNode;
|
|
180
|
+
/**
|
|
181
|
+
* Callback triggered when an option is removed in multi-select mode.
|
|
182
|
+
* Receives an object with the ID of the removed option.
|
|
183
|
+
* Useful for handling removal-specific logic separately from general onChange.
|
|
184
|
+
*/
|
|
185
|
+
onRemove?: ({ id }: {
|
|
186
|
+
id: Option | string;
|
|
187
|
+
}) => void;
|
|
188
|
+
/**
|
|
189
|
+
* Callback triggered when the dropdown menu opens.
|
|
190
|
+
* Use this for lazy loading options, analytics, or other open-related side effects.
|
|
191
|
+
*/
|
|
192
|
+
onMenuOpen?: () => void;
|
|
193
|
+
/**
|
|
194
|
+
* Callback triggered when the dropdown menu closes.
|
|
195
|
+
* Use this for cleanup, saving state, or other close-related side effects.
|
|
196
|
+
*/
|
|
197
|
+
onMenuClose?: () => void;
|
|
198
|
+
/**
|
|
199
|
+
* Custom react-select components to override default rendering.
|
|
200
|
+
* Allows deep customization of option rendering, control appearance, etc.
|
|
201
|
+
* See react-select documentation for available component slots.
|
|
202
|
+
*/
|
|
203
|
+
components?: Partial<any>;
|
|
204
|
+
/**
|
|
205
|
+
* Callback triggered when the search input within the menu receives focus.
|
|
206
|
+
* Receives the current input value. Useful for search-related functionality.
|
|
207
|
+
*/
|
|
208
|
+
onMenuInputFocus?: (inputValue: string) => void;
|
|
209
|
+
/**
|
|
210
|
+
* Callback triggered whenever the search input value changes.
|
|
211
|
+
* Different from onChange which only fires on selection - this fires on every keystroke.
|
|
212
|
+
* The action parameter indicates what caused the change (input, menu-close, etc.).
|
|
213
|
+
*/
|
|
214
|
+
onInputChange?: (inputValue: string, action: InputActionMeta) => void;
|
|
215
|
+
/**
|
|
216
|
+
* Current value of the search input for controlled search behavior.
|
|
217
|
+
* Use this when you want to control the search input externally.
|
|
218
|
+
*/
|
|
219
|
+
inputValue?: string;
|
|
220
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Select.types.js","sourceRoot":"","sources":["../../src/Select/Select.types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/Select/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AACnC,OAAO,EAAE,UAAU,IAAI,eAAe,EAAE,MAAM,cAAc,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import * as RadixSlider from '@radix-ui/react-slider';
|
|
3
|
+
/**
|
|
4
|
+
* Slider .
|
|
5
|
+
*/
|
|
6
|
+
export const Slider = (props) => {
|
|
7
|
+
const { onValueChange, onPointerUp, id, value, name, disabled = false, rootExtraClassNames = '', trackExtraClassNames = '', rangeExtraClassNames = '', thumbExtraClassNames = '', step, min, max, } = props;
|
|
8
|
+
return (_jsxs(RadixSlider.Root, { className: `tw:relative tw:flex tw:h-5 tw:w-full tw:touch-none tw:select-none tw:items-center ${rootExtraClassNames}`, defaultValue: [value], value: [value], onValueChange: (value) => onValueChange && onValueChange(value), onPointerUp: (e) => onPointerUp && onPointerUp(e), name: name, id: id, max: max, min: min, disabled: disabled, step: step, children: [_jsx(RadixSlider.Track, { className: `tw:relative tw:h-sq-5 tw:grow tw:rounded-sm tw:bg-sq-dark-gray tw:dark:bg-sq-dark-disabled-gray ${trackExtraClassNames}`, children: _jsx(RadixSlider.Range, { className: `tw:absolute tw:h-full tw:rounded-full ${rangeExtraClassNames}` }) }), _jsx(RadixSlider.Thumb, { className: `tw:block tw:h-sq-15 tw:w-sq-15 tw:rounded-full tw:bg-sq-theme-dark active:tw:bg-sq-theme-darker tw:focus:outline-none tw:focus-visible:outline-none tw:aria-disabled:bg-sq-dark-gray tw:dark:aria-disabled:bg-sq-dark-disabled-gray tw:transition tw:ease-in-out ${thumbExtraClassNames}`, "aria-disabled": disabled })] }));
|
|
9
|
+
};
|
|
10
|
+
//# sourceMappingURL=Slider.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Slider.js","sourceRoot":"","sources":["../../src/Slider/Slider.tsx"],"names":[],"mappings":";AAEA,OAAO,KAAK,WAAW,MAAM,wBAAwB,CAAC;AAEtD;;GAEG;AACH,MAAM,CAAC,MAAM,MAAM,GAAyC,CAAC,KAAK,EAAE,EAAE;IACpE,MAAM,EACJ,aAAa,EACb,WAAW,EACX,EAAE,EACF,KAAK,EACL,IAAI,EACJ,QAAQ,GAAG,KAAK,EAChB,mBAAmB,GAAG,EAAE,EACxB,oBAAoB,GAAG,EAAE,EACzB,oBAAoB,GAAG,EAAE,EACzB,oBAAoB,GAAG,EAAE,EACzB,IAAI,EACJ,GAAG,EACH,GAAG,GACJ,GAAG,KAAK,CAAC;IAEV,OAAO,CACL,MAAC,WAAW,CAAC,IAAI,IACf,SAAS,EAAE,qFAAqF,mBAAmB,EAAE,EACrH,YAAY,EAAE,CAAC,KAAK,CAAC,EACrB,KAAK,EAAE,CAAC,KAAK,CAAC,EACd,aAAa,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,aAAa,IAAI,aAAa,CAAC,KAAK,CAAC,EAC/D,WAAW,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,WAAW,IAAI,WAAW,CAAC,CAAC,CAAC,EACjD,IAAI,EAAE,IAAI,EACV,EAAE,EAAE,EAAE,EACN,GAAG,EAAE,GAAG,EACR,GAAG,EAAE,GAAG,EACR,QAAQ,EAAE,QAAQ,EAClB,IAAI,EAAE,IAAI,aACV,KAAC,WAAW,CAAC,KAAK,IAChB,SAAS,EAAE,mGAAmG,oBAAoB,EAAE,YACpI,KAAC,WAAW,CAAC,KAAK,IAAC,SAAS,EAAE,yCAAyC,oBAAoB,EAAE,GAAI,GAC/E,EACpB,KAAC,WAAW,CAAC,KAAK,IAChB,SAAS,EAAE,oQAAoQ,oBAAoB,EAAE,mBACtR,QAAQ,GACvB,IACe,CACpB,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { Slider } from './Slider';
|
|
4
|
+
import { QTip } from '../Tooltip';
|
|
5
|
+
export default {
|
|
6
|
+
title: 'Slider',
|
|
7
|
+
};
|
|
8
|
+
export const AllSliders = () => {
|
|
9
|
+
const [value1, setValue1] = React.useState(0);
|
|
10
|
+
const [value2, setValue2] = React.useState(0);
|
|
11
|
+
const renderAllVariations = () => (_jsxs(_Fragment, { children: [_jsxs("div", { className: "tw:p-4 light", children: [_jsx("div", { className: "tw:p-4", children: _jsx(Slider, { min: 0, max: 10, value: 4 }) }), _jsx("div", { className: "tw:p-4", children: _jsx(Slider, { min: 0, max: 10, value: 10 }) }), _jsx("div", { className: "tw:p-4", children: _jsx(Slider, { value: 0, min: 0, max: 10 }) }), _jsxs("div", { className: "tw:p-4", children: [_jsx("div", { children: "1 Step" }), _jsx(Slider, { value: value1, min: 0, max: 20, step: 4, onValueChange: (v) => setValue1(v[0]) })] }), _jsxs("div", { className: "tw:p-4", children: [_jsx("div", { children: "10 Steps" }), _jsx(Slider, { value: value2, min: 0, max: 20, step: 10, onValueChange: (v) => setValue2(v[0]) })] }), _jsxs("div", { className: "tw:p-4", children: [_jsx("div", { className: "tw:sq-text-color", children: "Disabled" }), _jsx(Slider, { value: 10, min: 0, max: 20, step: 10, disabled: true })] })] }), _jsxs("div", { className: "tw:p-4 tw-dark tw:bg-sq-dark-background", children: [_jsx("div", { className: "tw:p-4", children: _jsx(Slider, { min: 0, max: 10, value: 4 }) }), _jsx("div", { className: "tw:p-4", children: _jsx(Slider, { min: 0, max: 10, value: 10 }) }), _jsx("div", { className: "tw:p-4", children: _jsx(Slider, { value: 0, min: 0, max: 10 }) }), _jsxs("div", { className: "tw:p-4", children: [_jsx("div", { className: "tw:dark:text-sq-white", children: "1 Step" }), _jsx(Slider, { value: value1, min: 0, max: 20, step: 4, onValueChange: (v) => setValue1(v[0]) })] }), _jsxs("div", { className: "tw:p-4", children: [_jsx("div", { className: "tw:dark:text-sq-white", children: "10 Steps" }), _jsx(Slider, { value: value2, min: 0, max: 20, step: 10, onValueChange: (v) => setValue2(v[0]) })] }), _jsxs("div", { className: "tw:p-4", children: [_jsx("div", { className: "tw:dark:text-sq-white", children: "Disabled" }), _jsx(Slider, { value: 10, min: 0, max: 20, step: 10, disabled: true })] })] })] }));
|
|
12
|
+
return (_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()] })] }));
|
|
13
|
+
};
|
|
14
|
+
//# sourceMappingURL=Slider.stories.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Slider.stories.js","sourceRoot":"","sources":["../../src/Slider/Slider.stories.tsx"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { render } from '@testing-library/react';
|
|
3
|
+
import { Slider } from './Slider';
|
|
4
|
+
describe('Slider Component', () => {
|
|
5
|
+
const defaultProps = {
|
|
6
|
+
onValueChange: jest.fn(),
|
|
7
|
+
onPointerUp: jest.fn(),
|
|
8
|
+
id: 'test-slider',
|
|
9
|
+
value: 50,
|
|
10
|
+
name: 'slider',
|
|
11
|
+
disabled: false,
|
|
12
|
+
testId: 'slider',
|
|
13
|
+
step: 1,
|
|
14
|
+
min: 0,
|
|
15
|
+
max: 100,
|
|
16
|
+
};
|
|
17
|
+
beforeEach(() => {
|
|
18
|
+
global.ResizeObserver = jest.fn().mockImplementation(() => {
|
|
19
|
+
return { observe: jest.fn(), disconnect: jest.fn(), unobserve: jest.fn() };
|
|
20
|
+
});
|
|
21
|
+
});
|
|
22
|
+
it('renders without crashing', () => {
|
|
23
|
+
const { getByRole } = render(_jsx(Slider, { ...defaultProps }));
|
|
24
|
+
expect(getByRole('slider')).toBeInTheDocument();
|
|
25
|
+
});
|
|
26
|
+
it('is disabled when disabled prop is true', () => {
|
|
27
|
+
const { getByRole } = render(_jsx(Slider, { ...defaultProps, disabled: true }));
|
|
28
|
+
const thumb = getByRole('slider');
|
|
29
|
+
expect(thumb).toHaveAttribute('data-disabled', '');
|
|
30
|
+
});
|
|
31
|
+
});
|
|
32
|
+
//# sourceMappingURL=Slider.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Slider.test.js","sourceRoot":"","sources":["../../src/Slider/Slider.test.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAChD,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAGlC,QAAQ,CAAC,kBAAkB,EAAE,GAAG,EAAE;IAChC,MAAM,YAAY,GAAgB;QAChC,aAAa,EAAE,IAAI,CAAC,EAAE,EAAE;QACxB,WAAW,EAAE,IAAI,CAAC,EAAE,EAAE;QACtB,EAAE,EAAE,aAAa;QACjB,KAAK,EAAE,EAAE;QACT,IAAI,EAAE,QAAQ;QACd,QAAQ,EAAE,KAAK;QACf,MAAM,EAAE,QAAQ;QAChB,IAAI,EAAE,CAAC;QACP,GAAG,EAAE,CAAC;QACN,GAAG,EAAE,GAAG;KACT,CAAC;IAEF,UAAU,CAAC,GAAG,EAAE;QACd,MAAM,CAAC,cAAc,GAAG,IAAI,CAAC,EAAE,EAAE,CAAC,kBAAkB,CAAC,GAAG,EAAE;YACxD,OAAO,EAAE,OAAO,EAAE,IAAI,CAAC,EAAE,EAAE,EAAE,UAAU,EAAE,IAAI,CAAC,EAAE,EAAE,EAAE,SAAS,EAAE,IAAI,CAAC,EAAE,EAAE,EAAE,CAAC;QAC7E,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAA;IAEF,EAAE,CAAC,0BAA0B,EAAE,GAAG,EAAE;QAClC,MAAM,EAAE,SAAS,EAAE,GAAG,MAAM,CAAC,KAAC,MAAM,OAAK,YAAY,GAAI,CAAC,CAAC;QAC3D,MAAM,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAC,CAAC,iBAAiB,EAAE,CAAC;IAClD,CAAC,CAAC,CAAC;IAGH,EAAE,CAAC,wCAAwC,EAAE,GAAG,EAAE;QAChD,MAAM,EAAE,SAAS,EAAE,GAAG,MAAM,CAAC,KAAC,MAAM,OAAK,YAAY,EAAE,QAAQ,EAAE,IAAI,GAAI,CAAC,CAAC;QAC3E,MAAM,KAAK,GAAG,SAAS,CAAC,QAAQ,CAAC,CAAC;QAClC,MAAM,CAAC,KAAK,CAAC,CAAC,eAAe,CAAC,eAAe,EAAE,EAAE,CAAC,CAAC;IACrD,CAAC,CAAC,CAAC;AAEL,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Props for the Slider component that provides an interactive range input control.
|
|
3
|
+
*/
|
|
4
|
+
export interface SliderProps {
|
|
5
|
+
/**
|
|
6
|
+
* When true, disables the slider preventing user interaction.
|
|
7
|
+
* Disabled sliders appear visually dimmed and don't respond to mouse or keyboard input.
|
|
8
|
+
*/
|
|
9
|
+
disabled?: boolean;
|
|
10
|
+
/**
|
|
11
|
+
* Callback function triggered when the slider value changes.
|
|
12
|
+
* Receives an array of numbers (even for single-value sliders for consistency).
|
|
13
|
+
* Use this to handle value changes and update your application state.
|
|
14
|
+
*/
|
|
15
|
+
onValueChange?: (value: number[]) => void;
|
|
16
|
+
/**
|
|
17
|
+
* Callback function triggered when the user releases the pointer (mouse/touch) from the slider.
|
|
18
|
+
* Useful for triggering actions only when the user finishes adjusting the value,
|
|
19
|
+
* rather than continuously during dragging.
|
|
20
|
+
*/
|
|
21
|
+
onPointerUp?: React.PointerEventHandler<HTMLDivElement>;
|
|
22
|
+
/**
|
|
23
|
+
* HTML ID attribute for the slider component.
|
|
24
|
+
* Should be unique across the page for proper HTML semantics and accessibility.
|
|
25
|
+
*/
|
|
26
|
+
id?: string;
|
|
27
|
+
/**
|
|
28
|
+
* Name attribute for the slider used in form submission.
|
|
29
|
+
* Identifies the slider's data when the form is submitted to a server.
|
|
30
|
+
*/
|
|
31
|
+
name?: string;
|
|
32
|
+
/**
|
|
33
|
+
* Current value of the slider.
|
|
34
|
+
* Should be within the min/max range. The slider thumb will be positioned
|
|
35
|
+
* proportionally based on this value relative to the min/max range.
|
|
36
|
+
*/
|
|
37
|
+
value: number;
|
|
38
|
+
/**
|
|
39
|
+
* Additional CSS classes to apply to the slider's root container.
|
|
40
|
+
* Use this to customize the overall slider appearance and layout.
|
|
41
|
+
*/
|
|
42
|
+
rootExtraClassNames?: string;
|
|
43
|
+
/**
|
|
44
|
+
* Additional CSS classes to apply to the slider track (the background line).
|
|
45
|
+
* Use this to customize the track's color, height, or styling.
|
|
46
|
+
*/
|
|
47
|
+
trackExtraClassNames?: string;
|
|
48
|
+
/**
|
|
49
|
+
* Additional CSS classes to apply to the slider thumb (the draggable handle).
|
|
50
|
+
* Use this to customize the thumb's size, color, shape, or styling.
|
|
51
|
+
*/
|
|
52
|
+
thumbExtraClassNames?: string;
|
|
53
|
+
/**
|
|
54
|
+
* Additional CSS classes to apply to the active range (filled portion of the track).
|
|
55
|
+
* Use this to customize the color or styling of the filled area from min to current value.
|
|
56
|
+
*/
|
|
57
|
+
rangeExtraClassNames?: string;
|
|
58
|
+
/**
|
|
59
|
+
* Test ID attribute for the slider component used in automated testing.
|
|
60
|
+
* Applied to the slider's root element for test targeting and interaction.
|
|
61
|
+
*/
|
|
62
|
+
testId?: string;
|
|
63
|
+
/**
|
|
64
|
+
* Step value that defines the increment/decrement amount for the slider.
|
|
65
|
+
* The slider value will snap to multiples of this step value.
|
|
66
|
+
* Smaller steps provide finer control, larger steps provide coarser control.
|
|
67
|
+
* @default 1
|
|
68
|
+
*/
|
|
69
|
+
step?: number;
|
|
70
|
+
/**
|
|
71
|
+
* Minimum allowed value for the slider.
|
|
72
|
+
* The slider thumb cannot be moved below this value.
|
|
73
|
+
* Defines the left/bottom end of the slider range.
|
|
74
|
+
* @default 0
|
|
75
|
+
*/
|
|
76
|
+
min?: number;
|
|
77
|
+
/**
|
|
78
|
+
* Maximum allowed value for the slider.
|
|
79
|
+
* The slider thumb cannot be moved above this value.
|
|
80
|
+
* Defines the right/top end of the slider range.
|
|
81
|
+
* @default 100
|
|
82
|
+
*/
|
|
83
|
+
max?: number;
|
|
84
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Slider.types.js","sourceRoot":"","sources":["../../src/Slider/Slider.types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Slider as default } from './Slider';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/Slider/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,IAAI,OAAO,EAAE,MAAM,UAAU,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import '../styles.css';
|
|
3
|
+
import { SvgIconProps } from './SvgIcon.types';
|
|
4
|
+
/**
|
|
5
|
+
* Renders an icon that has an SVG icon path (see {@link isSvgIcon() })
|
|
6
|
+
*
|
|
7
|
+
* @param onClick - function to call when clicking the icon (takes no parameters)
|
|
8
|
+
* @param id - id that can be placed on the SvgIcon component
|
|
9
|
+
* @param testId - id that will be used in the data-testid attribute on the icon
|
|
10
|
+
* @param customId - id that will be used in the data-customid attribute on the icon. Can be used to identify the icon
|
|
11
|
+
* as the click event target in an event handler
|
|
12
|
+
* @param icon - the SVG icon
|
|
13
|
+
* @param color - used to add a custom color to the icon (required if type="color")
|
|
14
|
+
* @param extraClassNames - extra class names to apply
|
|
15
|
+
* @param [viewBox='0 0 19 19'] - optional SVG view box
|
|
16
|
+
* @param type - default will use dark/light text colors otherwise will use the theme color
|
|
17
|
+
* @param tooltipProps - props to pass to the tooltip
|
|
18
|
+
*/
|
|
19
|
+
declare const SvgIcon: React.FunctionComponent<SvgIconProps>;
|
|
20
|
+
export default SvgIcon;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import '../styles.css';
|
|
3
|
+
import { getQTipData } from '../Tooltip/qTip.utilities';
|
|
4
|
+
import { getSvgIconPath } from '../utils/svg';
|
|
5
|
+
/**
|
|
6
|
+
* Renders an icon that has an SVG icon path (see {@link isSvgIcon() })
|
|
7
|
+
*
|
|
8
|
+
* @param onClick - function to call when clicking the icon (takes no parameters)
|
|
9
|
+
* @param id - id that can be placed on the SvgIcon component
|
|
10
|
+
* @param testId - id that will be used in the data-testid attribute on the icon
|
|
11
|
+
* @param customId - id that will be used in the data-customid attribute on the icon. Can be used to identify the icon
|
|
12
|
+
* as the click event target in an event handler
|
|
13
|
+
* @param icon - the SVG icon
|
|
14
|
+
* @param color - used to add a custom color to the icon (required if type="color")
|
|
15
|
+
* @param extraClassNames - extra class names to apply
|
|
16
|
+
* @param [viewBox='0 0 19 19'] - optional SVG view box
|
|
17
|
+
* @param type - default will use dark/light text colors otherwise will use the theme color
|
|
18
|
+
* @param tooltipProps - props to pass to the tooltip
|
|
19
|
+
*/
|
|
20
|
+
const SvgIcon = ({ onClick, icon, color, type = 'default', extraClassNames, viewBox = '0 0 19 19', id, testId, customId, ...tooltipProps }) => {
|
|
21
|
+
const appliedClassNames = `${onClick ? 'tw:cursor-pointer' : ''} ${extraClassNames} focus:tw:outline-none focus-visible:tw:outline-none
|
|
22
|
+
tw:outline-none`;
|
|
23
|
+
const tooltipData = getQTipData(tooltipProps);
|
|
24
|
+
const appliedType = type === 'default' ? 'currentColor' : 'rgb(var(--sq-icon))';
|
|
25
|
+
return (_jsx("div", { onClick: onClick, ...tooltipData, className: `svgContainer ${appliedClassNames}`, children: _jsx("svg", { xmlns: "http://www.w3.org/2000/svg", className: `tw:sq-icon tw:dark:text-sq-white`, viewBox: viewBox, fill: color ? color : appliedType, "data-testid": testId, children: _jsx("path", { d: getSvgIconPath(icon) }) }) }));
|
|
26
|
+
};
|
|
27
|
+
export default SvgIcon;
|
|
28
|
+
//# sourceMappingURL=SvgIcon.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SvgIcon.js","sourceRoot":"","sources":["../../src/SvgIcon/SvgIcon.tsx"],"names":[],"mappings":";AACA,OAAO,eAAe,CAAC;AAEvB,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AACxD,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAE9C;;;;;;;;;;;;;;GAcG;AACH,MAAM,OAAO,GAA0C,CAAC,EACtD,OAAO,EACP,IAAI,EACJ,KAAK,EACL,IAAI,GAAG,SAAS,EAChB,eAAe,EACf,OAAO,GAAG,WAAW,EACrB,EAAE,EACF,MAAM,EACN,QAAQ,EACR,GAAG,YAAY,EAChB,EAAE,EAAE;IACH,MAAM,iBAAiB,GAAG,GACxB,OAAO,CAAC,CAAC,CAAC,mBAAmB,CAAC,CAAC,CAAC,EAClC,IAAI,eAAe;kBACH,CAAC;IACjB,MAAM,WAAW,GAAG,WAAW,CAAC,YAAY,CAAC,CAAC;IAC9C,MAAM,WAAW,GAAG,IAAI,KAAK,SAAS,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,qBAAqB,CAAC;IAEhF,OAAO,CACL,cAAK,OAAO,EAAE,OAAO,KAAM,WAAW,EAAE,SAAS,EAAE,gBAAgB,iBAAiB,EAAE,YACpF,cACE,KAAK,EAAC,4BAA4B,EAClC,SAAS,EAAE,kCAAkC,EAC7C,OAAO,EAAE,OAAO,EAChB,IAAI,EAAE,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,WAAW,iBACpB,MAAM,YACnB,eAAM,CAAC,EAAE,cAAc,CAAC,IAAI,CAAC,GAAI,GAC7B,GACF,CACP,CAAC;AACJ,CAAC,CAAC;AACF,eAAe,OAAO,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import SvgIcon from './SvgIcon';
|
|
3
|
+
import { svgIconTypes } from './SvgIcon.types';
|
|
4
|
+
export default {
|
|
5
|
+
title: 'Svg Icons',
|
|
6
|
+
};
|
|
7
|
+
const icon = 'svgpath:M0 8.8153a8.8153 8.8153 90 1117.6306 0A8.8153 8.8153 90 110 8.8153zM9.9172 3.3057a1.1019' +
|
|
8
|
+
' 1.1019 90 10-2.2038 0 1.1019 1.1019 90 102.2038 0zM8.8153 14.3249c1.2155 0 2.2038-.9883 2.2038-2.2038 0-.5992-.2376-1.1398-.6233-1.5358L12.6031 5.5681c.1825-.4167-.0069-.9056-.4235-1.0881s-.9056.0069-1.0881.4235L8.8807 9.9172c-.0207 0-.0448 0-.0654 0-1.2155 0-2.2038.9883-2.2038 2.2038s.9883 2.2038 2.2038 2.2038zM6.0605 4.9586a1.1019 1.1019 90 10-2.2038 0 1.1019 1.1019 90 102.2038 0zM3.3057 9.9172a1.1019 1.1019 90 100-2.2038 1.1019 1.1019 90 100 2.2038zm12.121-1.1019a1.1019 1.1019 90 10-2.2038 0 1.1019 1.1019 90 102.2038 0z';
|
|
9
|
+
export const AllIcons = () => {
|
|
10
|
+
const renderAllVariations = () => {
|
|
11
|
+
const supportedSvgIconTypes = svgIconTypes.filter((type) => type === 'default' || type === 'theme');
|
|
12
|
+
return (_jsxs(_Fragment, { children: [_jsx("br", {}), _jsx("br", {}), supportedSvgIconTypes.map((iconType) => {
|
|
13
|
+
return (_jsxs("div", { children: [_jsxs("b", { children: ["type=", iconType] }), _jsx("br", {}), _jsx("div", { className: "tw:flex", children: _jsx(SvgIcon, { icon: icon, type: iconType, extraClassNames: 'tw:p-2 tw:w-12', onClick: (e) => window.alert('svg clicked') }) }), _jsx("div", { className: "tw-dark tw:bg-sq-dark-background tw:flex", children: _jsx(SvgIcon, { icon: icon, type: iconType, extraClassNames: 'tw:p-2 tw:w-12', onClick: (e) => window.alert('svg clicked') }) }), _jsx("br", {})] }, `${iconType}`));
|
|
14
|
+
})] }));
|
|
15
|
+
};
|
|
16
|
+
return (_jsxs("div", { className: "tw:grid tw:grid-cols-4 tw:gap-4", children: [_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()] })] }));
|
|
17
|
+
};
|
|
18
|
+
//# sourceMappingURL=SvgIcon.stories.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SvgIcon.stories.js","sourceRoot":"","sources":["../../src/SvgIcon/SvgIcon.stories.tsx"],"names":[],"mappings":";AACA,OAAO,OAAO,MAAM,WAAW,CAAC;AAChC,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAE/C,eAAe;IACb,KAAK,EAAE,WAAW;CACnB,CAAC;AAEF,MAAM,IAAI,GACR,kGAAkG;IAClG,mhBAAmhB,CAAC;AAEthB,MAAM,CAAC,MAAM,QAAQ,GAAG,GAAG,EAAE;IAC3B,MAAM,mBAAmB,GAAG,GAAG,EAAE;QAC/B,MAAM,qBAAqB,GAAG,YAAY,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,KAAK,SAAS,IAAI,IAAI,KAAK,OAAO,CAAC,CAAC;QACpG,OAAO,CACL,8BACE,cAAM,EACN,cAAM,EACL,qBAAqB,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE,EAAE;oBACtC,OAAO,CACL,0BACE,iCAAS,QAAQ,IAAK,EACtB,cAAM,EACN,cAAK,SAAS,EAAC,SAAS,YACtB,KAAC,OAAO,IACN,IAAI,EAAE,IAAI,EACV,IAAI,EAAE,QAAQ,EACd,eAAe,EAAE,gBAAgB,EACjC,OAAO,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,MAAM,CAAC,KAAK,CAAC,aAAa,CAAC,GAC3C,GACE,EACN,cAAK,SAAS,EAAC,0CAA0C,YACvD,KAAC,OAAO,IACN,IAAI,EAAE,IAAI,EACV,IAAI,EAAE,QAAQ,EACd,eAAe,EAAE,gBAAgB,EACjC,OAAO,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,MAAM,CAAC,KAAK,CAAC,aAAa,CAAC,GAC3C,GACE,EACN,cAAM,KAnBE,GAAG,QAAQ,EAAE,CAoBjB,CACP,CAAC;gBACJ,CAAC,CAAC,IACD,CACJ,CAAC;IACJ,CAAC,CAAC;IACF,OAAO,CACL,eAAK,SAAS,EAAC,iCAAiC,aAC9C,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,CACP,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import '@testing-library/jest-dom';
|
|
@@ -0,0 +1,41 @@
|
|
|
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 SvgIcon from './SvgIcon';
|
|
5
|
+
describe('SvgIcon', () => {
|
|
6
|
+
class Context {
|
|
7
|
+
testId = 'svgIconTestId';
|
|
8
|
+
icon = 'svgpath:M0 8.8153a8.8153 8.8153 90 1117.6306 0A8.8153 8.8153 90 110 8.8153zM9.9172 3.3057a1.1019 1.1019' +
|
|
9
|
+
' 90 10-2.2038 0 1.1019 1.1019 90 102.2038 0zM8.8153 14.3249c1.2155 0 2.2038-.9883 2.2038-2.2038' +
|
|
10
|
+
' 0-.5992-.2376-1.1398-.6233-1.5358L12.6031 5.5681c.1825-.4167-.0069-.9056-.4235-1.0881s-.9056.0069-1.0881.4235L8.8807 9.9172c-.0207 0-.0448 0-.0654 0-1.2155 0-2.2038.9883-2.2038 2.2038s.9883 2.2038 2.2038 2.2038zM6.0605 4.9586a1.1019 1.1019 90 10-2.2038 0 1.1019 1.1019 90 102.2038 0zM3.3057 9.9172a1.1019 1.1019 90 100-2.2038 1.1019 1.1019 90 100 2.2038zm12.121-1.1019a1.1019 1.1019 90 10-2.2038 0 1.1019 1.1019 90 102.2038 0z';
|
|
11
|
+
props = {
|
|
12
|
+
icon: this.icon,
|
|
13
|
+
onClick: jest.fn(),
|
|
14
|
+
testId: this.testId,
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
let tc;
|
|
18
|
+
beforeEach(() => {
|
|
19
|
+
tc = new Context();
|
|
20
|
+
});
|
|
21
|
+
const renderIcon = (props) => render(_jsx(SvgIcon, { ...props }));
|
|
22
|
+
it('renders svg icon', () => {
|
|
23
|
+
renderIcon(tc.props);
|
|
24
|
+
expect(screen.getByTestId(tc.testId)).toHaveAttribute('fill');
|
|
25
|
+
});
|
|
26
|
+
describe('icon types', () => {
|
|
27
|
+
it('renders the theme type by default', () => {
|
|
28
|
+
renderIcon(tc.props);
|
|
29
|
+
expect(screen.getByTestId(tc.testId)).toHaveClass('tw:sq-icon');
|
|
30
|
+
});
|
|
31
|
+
it('renders the white icon', () => {
|
|
32
|
+
renderIcon({ ...tc.props, color: 'white' });
|
|
33
|
+
expect(screen.getByTestId(tc.testId)).toHaveAttribute('fill', 'white');
|
|
34
|
+
});
|
|
35
|
+
it('renders the color icon', () => {
|
|
36
|
+
renderIcon({ ...tc.props, color: '#AABBFF' });
|
|
37
|
+
expect(screen.getByTestId(tc.testId)).toHaveAttribute('fill', '#AABBFF');
|
|
38
|
+
});
|
|
39
|
+
});
|
|
40
|
+
});
|
|
41
|
+
//# sourceMappingURL=SvgIcon.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SvgIcon.test.js","sourceRoot":"","sources":["../../src/SvgIcon/SvgIcon.test.tsx"],"names":[],"mappings":";AACA,OAAO,2BAA2B,CAAC;AACnC,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AACxD,OAAO,OAAO,MAAM,WAAW,CAAC;AAGhC,QAAQ,CAAC,SAAS,EAAE,GAAG,EAAE;IACvB,MAAM,OAAO;QACX,MAAM,GAAG,eAAe,CAAC;QACzB,IAAI,GACF,yGAAyG;YACzG,iGAAiG;YACjG,6aAA6a,CAAC;QAChb,KAAK,GAAiB;YACpB,IAAI,EAAE,IAAI,CAAC,IAAI;YACf,OAAO,EAAE,IAAI,CAAC,EAAE,EAAE;YAClB,MAAM,EAAE,IAAI,CAAC,MAAM;SACpB,CAAC;KACH;IAED,IAAI,EAAW,CAAC;IAChB,UAAU,CAAC,GAAG,EAAE;QACd,EAAE,GAAG,IAAI,OAAO,EAAE,CAAC;IACrB,CAAC,CAAC,CAAC;IAEH,MAAM,UAAU,GAAG,CAAC,KAAmB,EAAE,EAAE,CAAC,MAAM,CAAC,KAAC,OAAO,OAAK,KAAK,GAAI,CAAC,CAAC;IAE3E,EAAE,CAAC,kBAAkB,EAAE,GAAG,EAAE;QAC1B,UAAU,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC;QACrB,MAAM,CAAC,MAAM,CAAC,WAAW,CAAC,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC,eAAe,CAAC,MAAM,CAAC,CAAC;IAChE,CAAC,CAAC,CAAC;IAEH,QAAQ,CAAC,YAAY,EAAE,GAAG,EAAE;QAC1B,EAAE,CAAC,mCAAmC,EAAE,GAAG,EAAE;YAC3C,UAAU,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC;YACrB,MAAM,CAAC,MAAM,CAAC,WAAW,CAAC,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC,WAAW,CAAC,YAAY,CAAC,CAAC;QAClE,CAAC,CAAC,CAAC;QAEH,EAAE,CAAC,wBAAwB,EAAE,GAAG,EAAE;YAChC,UAAU,CAAC,EAAE,GAAG,EAAE,CAAC,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC,CAAC;YAC5C,MAAM,CAAC,MAAM,CAAC,WAAW,CAAC,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC,eAAe,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;QACzE,CAAC,CAAC,CAAC;QAEH,EAAE,CAAC,wBAAwB,EAAE,GAAG,EAAE;YAChC,UAAU,CAAC,EAAE,GAAG,EAAE,CAAC,KAAK,EAAE,KAAK,EAAE,SAAS,EAAE,CAAC,CAAC;YAC9C,MAAM,CAAC,MAAM,CAAC,WAAW,CAAC,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC,eAAe,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;QAC3E,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|