@seeqdev/qomponents 0.0.184 → 0.0.185

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.
Files changed (247) hide show
  1. package/dist/src/Accordion/Accordion.d.ts +4 -0
  2. package/dist/src/Accordion/Accordion.js +8 -0
  3. package/dist/src/Accordion/Accordion.stories.d.ts +5 -0
  4. package/dist/src/Accordion/Accordion.stories.js +96 -0
  5. package/dist/src/Accordion/Accordion.test.d.ts +1 -0
  6. package/dist/src/Accordion/Accordion.test.js +54 -0
  7. package/dist/src/Accordion/Accordion.types.d.ts +86 -0
  8. package/dist/src/Accordion/Accordion.types.js +1 -0
  9. package/dist/src/Accordion/index.d.ts +1 -0
  10. package/dist/src/Accordion/index.js +1 -0
  11. package/dist/src/Alert/Alert.d.ts +7 -0
  12. package/dist/src/Alert/Alert.js +33 -0
  13. package/dist/src/Alert/Alert.stories.d.ts +14 -0
  14. package/dist/src/Alert/Alert.stories.js +72 -0
  15. package/dist/src/Alert/Alert.test.d.ts +1 -0
  16. package/dist/src/Alert/Alert.test.js +49 -0
  17. package/dist/src/Alert/Alert.types.d.ts +62 -0
  18. package/dist/src/Alert/Alert.types.js +1 -0
  19. package/dist/src/Alert/index.d.ts +1 -0
  20. package/dist/src/Alert/index.js +1 -0
  21. package/dist/src/Button/Button.d.ts +10 -0
  22. package/dist/src/Button/Button.js +107 -0
  23. package/dist/src/Button/Button.stories.d.ts +9 -0
  24. package/dist/src/Button/Button.stories.js +74 -0
  25. package/dist/src/Button/Button.test.d.ts +1 -0
  26. package/dist/src/Button/Button.test.js +65 -0
  27. package/dist/src/Button/Button.types.d.ts +148 -0
  28. package/dist/src/Button/Button.types.js +4 -0
  29. package/dist/src/Button/index.d.ts +1 -0
  30. package/dist/src/Button/index.js +1 -0
  31. package/dist/src/ButtonGroup/ButtonGroup.d.ts +7 -0
  32. package/dist/src/ButtonGroup/ButtonGroup.js +34 -0
  33. package/dist/src/ButtonGroup/ButtonGroup.stories.d.ts +5 -0
  34. package/dist/src/ButtonGroup/ButtonGroup.stories.js +328 -0
  35. package/dist/src/ButtonGroup/ButtonGroup.test.d.ts +1 -0
  36. package/dist/src/ButtonGroup/ButtonGroup.test.js +65 -0
  37. package/dist/src/ButtonGroup/ButtonGroup.types.d.ts +80 -0
  38. package/dist/src/ButtonGroup/ButtonGroup.types.js +1 -0
  39. package/dist/src/ButtonGroup/index.d.ts +1 -0
  40. package/dist/src/ButtonGroup/index.js +1 -0
  41. package/dist/src/ButtonWithDropdown/ButtonWithDropdown.d.ts +4 -0
  42. package/dist/src/ButtonWithDropdown/ButtonWithDropdown.js +46 -0
  43. package/dist/src/ButtonWithDropdown/ButtonWithDropdown.stories.d.ts +5 -0
  44. package/dist/src/ButtonWithDropdown/ButtonWithDropdown.stories.js +119 -0
  45. package/dist/src/ButtonWithDropdown/ButtonWithDropdown.test.d.ts +1 -0
  46. package/dist/src/ButtonWithDropdown/ButtonWithDropdown.test.js +92 -0
  47. package/dist/src/ButtonWithDropdown/ButtonWithDropdown.types.d.ts +232 -0
  48. package/dist/src/ButtonWithDropdown/ButtonWithDropdown.types.js +1 -0
  49. package/dist/src/ButtonWithDropdown/index.d.ts +1 -0
  50. package/dist/src/ButtonWithDropdown/index.js +1 -0
  51. package/dist/src/ButtonWithPopover/ButtonWithPopover.d.ts +4 -0
  52. package/dist/src/ButtonWithPopover/ButtonWithPopover.js +54 -0
  53. package/dist/src/ButtonWithPopover/ButtonWithPopover.stories.d.ts +5 -0
  54. package/dist/src/ButtonWithPopover/ButtonWithPopover.stories.js +51 -0
  55. package/dist/src/ButtonWithPopover/ButtonWithPopover.test.d.ts +1 -0
  56. package/dist/src/ButtonWithPopover/ButtonWithPopover.test.js +80 -0
  57. package/dist/src/ButtonWithPopover/ButtonWithPopover.types.d.ts +134 -0
  58. package/dist/src/ButtonWithPopover/ButtonWithPopover.types.js +1 -0
  59. package/dist/src/ButtonWithPopover/index.d.ts +1 -0
  60. package/dist/src/ButtonWithPopover/index.js +1 -0
  61. package/dist/src/Carousel/Carousel.d.ts +9 -0
  62. package/dist/src/Carousel/Carousel.js +80 -0
  63. package/dist/src/Carousel/Carousel.stories.d.ts +5 -0
  64. package/dist/src/Carousel/Carousel.stories.js +100 -0
  65. package/dist/src/Carousel/Carousel.test.d.ts +1 -0
  66. package/dist/src/Carousel/Carousel.test.js +47 -0
  67. package/dist/src/Carousel/Carousel.types.d.ts +85 -0
  68. package/dist/src/Carousel/Carousel.types.js +1 -0
  69. package/dist/src/Carousel/index.d.ts +1 -0
  70. package/dist/src/Carousel/index.js +1 -0
  71. package/dist/src/Checkbox/Checkbox.d.ts +7 -0
  72. package/dist/src/Checkbox/Checkbox.js +24 -0
  73. package/dist/src/Checkbox/Checkbox.stories.d.ts +5 -0
  74. package/dist/src/Checkbox/Checkbox.stories.js +21 -0
  75. package/dist/src/Checkbox/Checkbox.test.d.ts +1 -0
  76. package/dist/src/Checkbox/Checkbox.test.js +93 -0
  77. package/dist/src/Checkbox/Checkbox.types.d.ts +91 -0
  78. package/dist/src/Checkbox/Checkbox.types.js +1 -0
  79. package/dist/src/Checkbox/index.d.ts +1 -0
  80. package/dist/src/Checkbox/index.js +1 -0
  81. package/dist/src/Collapse/Collapse.d.ts +4 -0
  82. package/dist/src/Collapse/Collapse.js +16 -0
  83. package/dist/src/Collapse/Collapse.stories.d.ts +5 -0
  84. package/dist/src/Collapse/Collapse.stories.js +28 -0
  85. package/dist/src/Collapse/Collapse.test.d.ts +1 -0
  86. package/dist/src/Collapse/Collapse.test.js +16 -0
  87. package/dist/src/Collapse/Collapse.types.d.ts +18 -0
  88. package/dist/src/Collapse/Collapse.types.js +1 -0
  89. package/dist/src/Collapse/index.d.ts +1 -0
  90. package/dist/src/Collapse/index.js +1 -0
  91. package/dist/src/Icon/Icon.d.ts +10 -0
  92. package/dist/src/Icon/Icon.js +55 -0
  93. package/dist/src/Icon/Icon.stories.d.ts +5 -0
  94. package/dist/src/Icon/Icon.stories.js +31 -0
  95. package/dist/src/Icon/Icon.test.d.ts +1 -0
  96. package/dist/src/Icon/Icon.test.js +54 -0
  97. package/dist/src/Icon/Icon.types.d.ts +90 -0
  98. package/dist/src/Icon/Icon.types.js +15 -0
  99. package/dist/src/Icon/index.d.ts +1 -0
  100. package/dist/src/Icon/index.js +1 -0
  101. package/dist/src/InputGroup/InputGroup.d.ts +7 -0
  102. package/dist/src/InputGroup/InputGroup.js +33 -0
  103. package/dist/src/InputGroup/InputGroup.stories.d.ts +5 -0
  104. package/dist/src/InputGroup/InputGroup.stories.js +144 -0
  105. package/dist/src/InputGroup/InputGroup.test.d.ts +1 -0
  106. package/dist/src/InputGroup/InputGroup.test.js +41 -0
  107. package/dist/src/InputGroup/InputGroup.types.d.ts +61 -0
  108. package/dist/src/InputGroup/InputGroup.types.js +1 -0
  109. package/dist/src/InputGroup/index.d.ts +2 -0
  110. package/dist/src/InputGroup/index.js +1 -0
  111. package/dist/src/Modal/Modal.d.ts +5 -0
  112. package/dist/src/Modal/Modal.js +86 -0
  113. package/dist/src/Modal/Modal.stories.d.ts +10 -0
  114. package/dist/src/Modal/Modal.stories.js +79 -0
  115. package/dist/src/Modal/Modal.test.d.ts +1 -0
  116. package/dist/src/Modal/Modal.test.js +107 -0
  117. package/dist/src/Modal/Modal.types.d.ts +244 -0
  118. package/dist/src/Modal/Modal.types.js +1 -0
  119. package/dist/src/Modal/index.d.ts +1 -0
  120. package/dist/src/Modal/index.js +1 -0
  121. package/dist/src/ProgressBar/ProgressBar.d.ts +4 -0
  122. package/dist/src/ProgressBar/ProgressBar.js +71 -0
  123. package/dist/src/ProgressBar/ProgressBar.stories.d.ts +5 -0
  124. package/dist/src/ProgressBar/ProgressBar.stories.js +46 -0
  125. package/dist/src/ProgressBar/ProgressBar.test.d.ts +1 -0
  126. package/dist/src/ProgressBar/ProgressBar.test.js +42 -0
  127. package/dist/src/ProgressBar/ProgressBar.types.d.ts +77 -0
  128. package/dist/src/ProgressBar/ProgressBar.types.js +1 -0
  129. package/dist/src/ProgressBar/index.d.ts +1 -0
  130. package/dist/src/ProgressBar/index.js +1 -0
  131. package/dist/src/SeeqActionDropdown/SeeqActionDropdown.d.ts +4 -0
  132. package/dist/src/SeeqActionDropdown/SeeqActionDropdown.js +41 -0
  133. package/dist/src/SeeqActionDropdown/SeeqActionDropdown.stories.d.ts +5 -0
  134. package/dist/src/SeeqActionDropdown/SeeqActionDropdown.stories.js +73 -0
  135. package/dist/src/SeeqActionDropdown/SeeqActionDropdown.test.d.ts +1 -0
  136. package/dist/src/SeeqActionDropdown/SeeqActionDropdown.test.js +72 -0
  137. package/dist/src/SeeqActionDropdown/SeeqActionDropdown.types.d.ts +159 -0
  138. package/dist/src/SeeqActionDropdown/SeeqActionDropdown.types.js +1 -0
  139. package/dist/src/SeeqActionDropdown/index.d.ts +1 -0
  140. package/dist/src/SeeqActionDropdown/index.js +1 -0
  141. package/dist/src/SeeqActionDropdown/variants.d.ts +5 -0
  142. package/dist/src/SeeqActionDropdown/variants.js +34 -0
  143. package/dist/src/Select/Select.d.ts +15 -0
  144. package/dist/src/Select/Select.js +171 -0
  145. package/dist/src/Select/Select.stories.d.ts +5 -0
  146. package/dist/src/Select/Select.stories.js +50 -0
  147. package/dist/src/Select/Select.test.d.ts +1 -0
  148. package/dist/src/Select/Select.test.js +176 -0
  149. package/dist/src/Select/Select.types.d.ts +220 -0
  150. package/dist/src/Select/Select.types.js +1 -0
  151. package/dist/src/Select/index.d.ts +2 -0
  152. package/dist/src/Select/index.js +2 -0
  153. package/dist/src/Slider/Slider.d.ts +6 -0
  154. package/dist/src/Slider/Slider.js +11 -0
  155. package/dist/src/Slider/Slider.stories.d.ts +5 -0
  156. package/dist/src/Slider/Slider.stories.js +37 -0
  157. package/dist/src/Slider/Slider.test.d.ts +1 -0
  158. package/dist/src/Slider/Slider.test.js +31 -0
  159. package/dist/src/Slider/Slider.types.d.ts +84 -0
  160. package/dist/src/Slider/Slider.types.js +1 -0
  161. package/dist/src/Slider/index.d.ts +1 -0
  162. package/dist/src/Slider/index.js +1 -0
  163. package/dist/src/SvgIcon/SvgIcon.d.ts +20 -0
  164. package/dist/src/SvgIcon/SvgIcon.js +27 -0
  165. package/dist/src/SvgIcon/SvgIcon.stories.d.ts +5 -0
  166. package/dist/src/SvgIcon/SvgIcon.stories.js +26 -0
  167. package/dist/src/SvgIcon/SvgIcon.test.d.ts +1 -0
  168. package/dist/src/SvgIcon/SvgIcon.test.js +40 -0
  169. package/dist/src/SvgIcon/SvgIcon.types.d.ts +75 -0
  170. package/dist/src/SvgIcon/SvgIcon.types.js +2 -0
  171. package/dist/src/SvgIcon/index.d.ts +1 -0
  172. package/dist/src/SvgIcon/index.js +1 -0
  173. package/dist/src/Tabs/Tabs.d.ts +4 -0
  174. package/dist/src/Tabs/Tabs.js +18 -0
  175. package/dist/src/Tabs/Tabs.stories.d.ts +5 -0
  176. package/dist/src/Tabs/Tabs.stories.js +83 -0
  177. package/dist/src/Tabs/Tabs.test.d.ts +1 -0
  178. package/dist/src/Tabs/Tabs.test.js +91 -0
  179. package/dist/src/Tabs/Tabs.types.d.ts +100 -0
  180. package/dist/src/Tabs/Tabs.types.js +1 -0
  181. package/dist/src/Tabs/index.d.ts +1 -0
  182. package/dist/src/Tabs/index.js +1 -0
  183. package/dist/src/TextArea/TextArea.d.ts +7 -0
  184. package/dist/src/TextArea/TextArea.js +54 -0
  185. package/dist/src/TextArea/TextArea.stories.d.ts +5 -0
  186. package/dist/src/TextArea/TextArea.stories.js +21 -0
  187. package/dist/src/TextArea/TextArea.test.d.ts +1 -0
  188. package/dist/src/TextArea/TextArea.test.js +129 -0
  189. package/dist/src/TextArea/TextArea.types.d.ts +115 -0
  190. package/dist/src/TextArea/TextArea.types.js +1 -0
  191. package/dist/src/TextArea/index.d.ts +1 -0
  192. package/dist/src/TextArea/index.js +1 -0
  193. package/dist/src/TextField/TextField.d.ts +7 -0
  194. package/dist/src/TextField/TextField.js +85 -0
  195. package/dist/src/TextField/TextField.stories.d.ts +5 -0
  196. package/dist/src/TextField/TextField.stories.js +30 -0
  197. package/dist/src/TextField/TextField.test.d.ts +1 -0
  198. package/dist/src/TextField/TextField.test.js +40 -0
  199. package/dist/src/TextField/TextField.types.d.ts +198 -0
  200. package/dist/src/TextField/TextField.types.js +1 -0
  201. package/dist/src/TextField/index.d.ts +1 -0
  202. package/dist/src/TextField/index.js +1 -0
  203. package/dist/src/ToolbarButton/ToolbarButton.d.ts +3 -0
  204. package/dist/src/ToolbarButton/ToolbarButton.js +58 -0
  205. package/dist/src/ToolbarButton/ToolbarButton.stories.d.ts +5 -0
  206. package/dist/src/ToolbarButton/ToolbarButton.stories.js +63 -0
  207. package/dist/src/ToolbarButton/ToolbarButton.test.d.ts +1 -0
  208. package/dist/src/ToolbarButton/ToolbarButton.test.js +89 -0
  209. package/dist/src/ToolbarButton/ToolbarButton.types.d.ts +122 -0
  210. package/dist/src/ToolbarButton/ToolbarButton.types.js +1 -0
  211. package/dist/src/ToolbarButton/index.d.ts +1 -0
  212. package/dist/src/ToolbarButton/index.js +1 -0
  213. package/dist/src/Tooltip/QTip.stories.d.ts +5 -0
  214. package/dist/src/Tooltip/QTip.stories.js +22 -0
  215. package/dist/src/Tooltip/QTip.types.d.ts +13 -0
  216. package/dist/src/Tooltip/QTip.types.js +1 -0
  217. package/dist/src/Tooltip/QTipPerformance.stories.d.ts +5 -0
  218. package/dist/src/Tooltip/QTipPerformance.stories.js +27 -0
  219. package/dist/src/Tooltip/Qtip.d.ts +26 -0
  220. package/dist/src/Tooltip/Qtip.js +168 -0
  221. package/dist/src/Tooltip/Tooltip.d.ts +13 -0
  222. package/dist/src/Tooltip/Tooltip.js +34 -0
  223. package/dist/src/Tooltip/Tooltip.stories.d.ts +5 -0
  224. package/dist/src/Tooltip/Tooltip.stories.js +20 -0
  225. package/dist/src/Tooltip/Tooltip.types.d.ts +22 -0
  226. package/dist/src/Tooltip/Tooltip.types.js +2 -0
  227. package/dist/src/Tooltip/TooltipPerformance.stories.d.ts +5 -0
  228. package/dist/src/Tooltip/TooltipPerformance.stories.js +25 -0
  229. package/dist/src/Tooltip/index.d.ts +2 -0
  230. package/dist/src/Tooltip/index.js +2 -0
  231. package/dist/src/Tooltip/qTip.utilities.d.ts +3 -0
  232. package/dist/src/Tooltip/qTip.utilities.js +10 -0
  233. package/dist/src/index.d.ts +46 -0
  234. package/dist/src/index.js +47 -0
  235. package/dist/src/setupTests.d.ts +1 -0
  236. package/dist/src/setupTests.js +5 -0
  237. package/dist/src/types.d.ts +27 -0
  238. package/dist/src/types.js +25 -0
  239. package/dist/src/utils/browserId.d.ts +9 -0
  240. package/dist/src/utils/browserId.js +28 -0
  241. package/dist/src/utils/svg.d.ts +15 -0
  242. package/dist/src/utils/svg.js +19 -0
  243. package/dist/src/utils/validateStyleDimension.d.ts +2 -0
  244. package/dist/src/utils/validateStyleDimension.js +13 -0
  245. package/dist/src/utils/validateStyleDimension.test.d.ts +1 -0
  246. package/dist/src/utils/validateStyleDimension.test.js +19 -0
  247. package/package.json +11 -5
@@ -0,0 +1,73 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import React from 'react';
3
+ import { QTip } from '../Tooltip/Qtip';
4
+ import Button from '../Button/Button';
5
+ import SeeqActionDropdown from './SeeqActionDropdown';
6
+ export default {
7
+ title: 'Seeq Action Dropdown',
8
+ };
9
+ const options = [
10
+ {
11
+ display: 'New Workbook',
12
+ text: 'This is a workbook to show details about your data. You can make changes to your account',
13
+ icon: 'fc-analysis',
14
+ id: 'newWorkbook',
15
+ enabled: true,
16
+ iconExtraClassNames: 'workbenchDisplay',
17
+ action: () => { },
18
+ },
19
+ {
20
+ display: 'New Report Binder',
21
+ text: 'This is a data tab to show details about your data. You can make changes to your account',
22
+ icon: 'fc-report',
23
+ enabled: true,
24
+ action: () => { },
25
+ id: 'newReportBinder',
26
+ },
27
+ {
28
+ display: 'New Datalab',
29
+ text: 'This is a data tab to show details about your data. You can make changes to your account',
30
+ icon: 'fc-seeq-datalab',
31
+ id: 'newDataLab',
32
+ enabled: false,
33
+ action: () => { },
34
+ divider: true,
35
+ },
36
+ {
37
+ display: 'Folder',
38
+ icon: 'fc-folder',
39
+ action: () => { },
40
+ id: 'newFolder',
41
+ },
42
+ {
43
+ display: 'SvgIcon',
44
+ 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' +
45
+ ' 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',
46
+ action: () => { },
47
+ id: 'svgIcon',
48
+ },
49
+ ];
50
+ export const AllSeeqActionDropdownVariants = () => {
51
+ const [openDropdown, setOpenDropdown] = React.useState('');
52
+ const allSeeqActionDropdowns = (color, isDark) => (_jsxs("div", { className: isDark ? 'tw-dark tw-bg-sq-dark-background' : '', children: [
53
+ _jsx("div", { className: "tw-p-5 ", children: _jsx(SeeqActionDropdown, { trigger: _jsx(Button, { label: "New", icon: "fa-plus", variant: "theme" }), "data-testid": "homeScreenNewButton", id: "seeqActionDropdownItem", align: "start", alignOffset: 0, placementOffset: 0, variant: "create-workbench", seeqActionDropdownItems: options }, "seeqActionDropdownItem") }), _jsxs("div", { className: "tw-p-5 ", children: [
54
+ _jsx("div", { className: "dark:tw-text-white tw-text-xs", children: "New workbench with arrow" }), _jsx(SeeqActionDropdown, { trigger: _jsx(Button, { label: "New", icon: "fa-plus", variant: "theme" }), "data-testid": "homeScreenNewButton", id: "seeqActionDropdownItem", align: "start", alignOffset: 0, hasArrow: true, variant: "create-workbench", placementOffset: 0, seeqActionDropdownItems: options }, "seeqActionDropdownItem")
55
+ ] }), _jsxs("div", { className: "tw-p-5 ", children: [
56
+ _jsx("div", { className: "dark:tw-text-white tw-text-xs", children: "New workbench with center align" }), _jsx(SeeqActionDropdown, { trigger: _jsx(Button, { label: "New", icon: "fa-plus", variant: "theme" }), "data-testid": "homeScreenNewButton", id: "seeqActionDropdownItem", align: "center", alignOffset: 0, hasArrow: true, variant: "create-workbench", placementOffset: 0, seeqActionDropdownItems: options }, "seeqActionDropdownItem")
57
+ ] }), _jsxs("div", { className: "tw-p-5 ", children: [
58
+ _jsx("div", { className: "dark:tw-text-white tw-text-xs", children: "New workbench with disabled button" }), _jsx(SeeqActionDropdown, { trigger: _jsx(Button, { label: "New", icon: "fa-plus", variant: "theme" }), "data-testid": "homeScreenNewButton", id: "seeqActionDropdownItem", align: "center", disabled: true, variant: "create-workbench", alignOffset: 0, hasArrow: true, placementOffset: 0, seeqActionDropdownItems: options }, "seeqActionDropdownItem")
59
+ ] }), _jsxs("div", { className: "tw-p-5 ", children: [
60
+ _jsx("div", { className: "dark:tw-text-white tw-text-xs", children: "View workbench" }), _jsx(SeeqActionDropdown, { trigger: _jsx(Button, { label: "View", icon: "fa-plus", variant: "theme" }), "data-testid": "homeScreenNewButton", id: "seeqActionDropdownItem", align: "center", variant: "view-workbench", alignOffset: 0, placementOffset: 0, seeqActionDropdownItems: options }, "seeqActionDropdownItem")
61
+ ] }), _jsxs("div", { className: "tw-p-5 ", children: [
62
+ _jsx("div", { className: "dark:tw-text-white tw-text-xs", children: "Insert seeq content" }), _jsx(SeeqActionDropdown, { trigger: _jsx(Button, { label: "Insert", icon: "fc-plus", variant: "theme" }), "data-testid": "homeScreenNewButton", id: "seeqActionDropdownItem", align: "center", variant: "insert-seeq-content", alignOffset: 0, placementOffset: 0, seeqActionDropdownItems: options }, "seeqActionDropdownItem")
63
+ ] })
64
+ ] }));
65
+ const renderAllVariations = (color) => (_jsxs("div", { className: "tw-grid tw-grid-cols-2 tw-gap-4 tw-p-4", children: [allSeeqActionDropdowns(color), allSeeqActionDropdowns(color, true)] }));
66
+ return (_jsxs("div", { className: "tw-grid tw-grid-cols-4 tw-gap-4", children: [
67
+ _jsx(QTip, {}), _jsxs("div", { className: "color_topic", children: [
68
+ _jsx("b", { children: "Topic Colors" }), renderAllVariations('topic')] }), _jsxs("div", { className: "color_analysis", children: [
69
+ _jsx("b", { children: "Analysis Colors" }), renderAllVariations('analysis')] }), _jsxs("div", { className: "color_datalab", children: [
70
+ _jsx("b", { children: "Datalab Colors" }), renderAllVariations('datalab')] }), _jsxs("div", { className: "color_vantage", children: [
71
+ _jsx("b", { children: "Vantage Colors" }), renderAllVariations('vantage')] })
72
+ ] }));
73
+ };
@@ -0,0 +1 @@
1
+ import '@testing-library/jest-dom';
@@ -0,0 +1,72 @@
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 Icon from '../Icon';
6
+ import SeeqActionDropdown from './SeeqActionDropdown';
7
+ describe('SeeqActionDropdown', () => {
8
+ const mockOnClick = jest.fn();
9
+ const testId = 'trigger-icon';
10
+ class Context {
11
+ props = {
12
+ trigger: (_jsx(Icon, { icon: "fc-more", type: "text", testId: testId, extraClassNames: "tw-text-sq-text-color dark:tw-text-sq-white tw-w-[18px]" })),
13
+ containerTestId: 'basic-dropdown1',
14
+ tooltip: 'This is a small dropdown.',
15
+ tooltipDelay: 0,
16
+ tooltipPlacement: 'top',
17
+ variant: 'create-workbench',
18
+ isHtmlTooltip: false,
19
+ seeqActionDropdownItems: [
20
+ { display: 'Orange', icon: 'fc-data-file', action: mockOnClick, enabled: true },
21
+ { display: 'Mango', icon: 'fc-user-community', action: mockOnClick, enabled: true },
22
+ { display: 'Guava', icon: 'fc-user-community', action: mockOnClick },
23
+ { display: 'Banana', icon: 'fc-user-community', action: mockOnClick },
24
+ ],
25
+ };
26
+ }
27
+ let tc;
28
+ beforeEach(() => {
29
+ tc = new Context();
30
+ jest.clearAllMocks();
31
+ });
32
+ const renderSeeqActionDropdown = (props) => render(_jsx(SeeqActionDropdown, { ...props }));
33
+ const openDropdown = async () => {
34
+ const popover = screen.getByTestId(testId);
35
+ await userEvent.click(popover);
36
+ };
37
+ test('renders trigger and opens dropdown content on trigger click', async () => {
38
+ renderSeeqActionDropdown(tc.props);
39
+ expect(screen.getByTestId('trigger-icon')).toBeInTheDocument();
40
+ await openDropdown();
41
+ expect(screen.getByText('Orange')).toBeInTheDocument();
42
+ });
43
+ test('renders dividers correctly', async () => {
44
+ tc.props.seeqActionDropdownItems[1].divider = true;
45
+ renderSeeqActionDropdown(tc.props);
46
+ expect(screen.getByTestId('trigger-icon')).toBeInTheDocument();
47
+ await openDropdown();
48
+ expect(screen.getByText('Orange')).toBeInTheDocument();
49
+ expect(screen.getByTestId('dropdown-divider-1')).toBeInTheDocument();
50
+ });
51
+ test('calls onClick handler when dropdown item is selected', async () => {
52
+ renderSeeqActionDropdown(tc.props);
53
+ await openDropdown();
54
+ const item1 = screen.getByText('Orange');
55
+ await userEvent.click(item1);
56
+ expect(mockOnClick).toHaveBeenCalledTimes(1);
57
+ });
58
+ test('closes dropdown when item is clicked', async () => {
59
+ renderSeeqActionDropdown(tc.props);
60
+ await openDropdown();
61
+ const item1 = screen.getByText('Orange');
62
+ await userEvent.click(item1);
63
+ expect(mockOnClick).toHaveBeenCalledTimes(1);
64
+ expect(screen.queryByText('Orange')).not.toBeInTheDocument();
65
+ });
66
+ test('does not open when disabled', async () => {
67
+ tc.props.disabled = true;
68
+ renderSeeqActionDropdown(tc.props);
69
+ await openDropdown();
70
+ expect(screen.queryByText('Orange')).not.toBeInTheDocument();
71
+ });
72
+ });
@@ -0,0 +1,159 @@
1
+ import { TooltipComponentProps } from '../Tooltip/Tooltip.types';
2
+ /**
3
+ * Interface for individual action items within a SeeqActionDropdown.
4
+ * Each item represents a clickable action with optional icon, text, and divider.
5
+ */
6
+ export interface SeeqActionDropdownItems {
7
+ /**
8
+ * HTML ID attribute for the dropdown item element.
9
+ * Should be unique for proper HTML semantics and accessibility.
10
+ */
11
+ id?: string;
12
+ /**
13
+ * Icon class name to display next to the item label.
14
+ * Typically uses FontAwesome classes (e.g., 'fc-zoom', 'fc-delete').
15
+ * Provides visual context for the action.
16
+ */
17
+ icon?: string;
18
+ /**
19
+ * Additional CSS classes to apply to the icon element.
20
+ * Use this to customize icon appearance beyond standard styling.
21
+ */
22
+ iconExtraClassNames?: string;
23
+ /**
24
+ * Main display text for the dropdown item.
25
+ * This is the primary text that users see and click on to trigger the action.
26
+ */
27
+ display: string;
28
+ /**
29
+ * Callback function triggered when the dropdown item is clicked.
30
+ * Use this to define the specific action that should occur when users select this item.
31
+ */
32
+ action: (e?: Event) => void;
33
+ /**
34
+ * When true, the item is clickable and interactive.
35
+ * When false, the item appears disabled and doesn't respond to clicks.
36
+ * @default true
37
+ */
38
+ enabled?: boolean;
39
+ /**
40
+ * When true, displays a visual divider line below this dropdown item.
41
+ * Useful for grouping related items or separating different sections of actions.
42
+ */
43
+ divider?: boolean;
44
+ /**
45
+ * Test ID attribute for the dropdown item used in automated testing.
46
+ * Helps identify and interact with specific action items in test suites.
47
+ */
48
+ testId?: string;
49
+ /**
50
+ * Secondary descriptive text displayed below the main display text.
51
+ * Provides additional context or explanation about what the action does.
52
+ */
53
+ text?: string;
54
+ }
55
+ /**
56
+ * Props for the SeeqActionDropdown component that creates specialized Seeq-branded action menus.
57
+ * Extends TooltipComponentProps to support tooltip functionality on the trigger.
58
+ */
59
+ export interface SeeqActionDropdownProps extends TooltipComponentProps {
60
+ /**
61
+ * Array of action items to display in the dropdown menu.
62
+ * Each item represents a specific action users can perform, with icons and descriptions.
63
+ */
64
+ seeqActionDropdownItems: SeeqActionDropdownItems[];
65
+ /**
66
+ * React element to use as the clickable trigger for the dropdown.
67
+ * Typically a button, icon, or text element that users click to open the action menu.
68
+ */
69
+ trigger: React.ReactNode;
70
+ /**
71
+ * HTML ID attribute for the dropdown trigger element.
72
+ * Should be unique across the page for proper HTML semantics and accessibility.
73
+ */
74
+ id?: string;
75
+ /**
76
+ * Additional CSS classes to apply to the dropdown container.
77
+ * Use this to customize the dropdown's appearance beyond default Seeq styling.
78
+ */
79
+ extraClassNames?: string;
80
+ /**
81
+ * Test ID attribute for the dropdown container element used in automated testing.
82
+ * Applied to the main container that wraps both trigger and dropdown content.
83
+ */
84
+ containerTestId?: string;
85
+ /**
86
+ * When true, disables the dropdown trigger preventing user interaction.
87
+ * Disabled triggers appear visually dimmed and don't open the dropdown when clicked.
88
+ */
89
+ disabled?: boolean;
90
+ /**
91
+ * Callback function triggered when the trigger is clicked.
92
+ * Primarily used for tracking or analytics purposes. Note: this doesn't control
93
+ * dropdown opening, which is handled separately.
94
+ */
95
+ onClick?: (e: MouseEvent) => void;
96
+ /**
97
+ * Horizontal alignment of the dropdown content relative to the trigger:
98
+ * - `start`: Aligns to the left edge of the trigger
99
+ * - `center`: Centers the dropdown on the trigger
100
+ * - `end`: Aligns to the right edge of the trigger
101
+ */
102
+ align?: 'start' | 'center' | 'end';
103
+ /**
104
+ * Numeric offset in pixels from the aligned position.
105
+ * Positive values move the dropdown further from the trigger in the align direction.
106
+ */
107
+ alignOffset?: number;
108
+ /**
109
+ * Position of the dropdown relative to the trigger element:
110
+ * - `top`: Dropdown appears above the trigger
111
+ * - `bottom`: Dropdown appears below the trigger
112
+ * - `left`: Dropdown appears to the left of the trigger
113
+ * - `right`: Dropdown appears to the right of the trigger
114
+ */
115
+ placement?: 'top' | 'bottom' | 'left' | 'right';
116
+ /**
117
+ * Numeric offset in pixels from the placement position.
118
+ * Positive values move the dropdown further away from the trigger.
119
+ */
120
+ placementOffset?: number;
121
+ /**
122
+ * When true, displays a visual arrow pointing from the dropdown to the trigger.
123
+ * Helps users understand the relationship between trigger and dropdown content.
124
+ */
125
+ hasArrow?: boolean;
126
+ /**
127
+ * Controls whether the dropdown is currently open and visible.
128
+ * Use this for controlled dropdown behavior where you manage open state externally.
129
+ */
130
+ isOpen?: boolean;
131
+ /**
132
+ * Callback function triggered when the dropdown open state changes.
133
+ * Receives the new open state as a boolean parameter. Use this to sync with external state.
134
+ */
135
+ onOpenChange?: (isOpen: boolean) => void;
136
+ /**
137
+ * When true, automatically focuses the trigger button when the dropdown closes.
138
+ * Improves keyboard navigation and accessibility by returning focus to the trigger.
139
+ */
140
+ setFocusOnTriggerOnClose?: boolean;
141
+ /**
142
+ * When true, automatically closes the dropdown when any content inside it is clicked.
143
+ * Useful for action dropdowns where selecting an option should close the dropdown.
144
+ */
145
+ isCloseOnContentClick?: boolean;
146
+ /**
147
+ * When true, traps keyboard focus within the dropdown when it's open.
148
+ * Prevents users from tabbing outside the dropdown, improving accessibility.
149
+ */
150
+ keepFocusInsideDropdown?: boolean;
151
+ /**
152
+ * Predefined variant that determines the dropdown's styling and behavior:
153
+ * - `create-workbench`: For workbench creation actions
154
+ * - `view-workbench`: For workbench viewing and management actions
155
+ * - `insert-seeq-content`: For inserting Seeq-specific content and objects
156
+ * Each variant has specific styling and may filter available actions.
157
+ */
158
+ variant: 'create-workbench' | 'view-workbench' | 'insert-seeq-content';
159
+ }
@@ -0,0 +1 @@
1
+ export { default } from './SeeqActionDropdown';
@@ -0,0 +1 @@
1
+ export { default } from './SeeqActionDropdown';
@@ -0,0 +1,5 @@
1
+ import React from 'react';
2
+ import { SeeqActionDropdownItems } from './SeeqActionDropdown.types';
3
+ export declare const SeeqActionDropdownItem: React.FC<SeeqActionDropdownItems>;
4
+ export declare const ViewWorkbench: React.FC<SeeqActionDropdownItems>;
5
+ export declare const InsertSeeqContent: React.FC<SeeqActionDropdownItems>;
@@ -0,0 +1,34 @@
1
+ import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import Icon from '../Icon/Icon';
3
+ import { isSvgIcon } from '../utils/svg';
4
+ import SvgIcon from '../SvgIcon/SvgIcon';
5
+ export const SeeqActionDropdownItem = (item) => {
6
+ let renderIcon = _jsx(_Fragment, {});
7
+ if (item.icon) {
8
+ renderIcon = isSvgIcon(item.icon) ? (_jsx(SvgIcon, { icon: item.icon, extraClassNames: 'tw-rounded-[3px] tw-h-8 tw-w-8 tw-p-1 tw-flex tw-justify-center tw-items-center tw-bg-sq-color-dark' +
9
+ ' dark:tw-text-sq-white tw-text-[22px] tw-text-sq-white ' +
10
+ item.iconExtraClassNames, ...item })) : (_jsx(Icon, { icon: item.icon, type: "text", extraClassNames: 'tw-rounded-[3px] tw-h-8 tw-w-8 tw-flex tw-justify-center tw-items-center tw-bg-sq-color-dark dark:tw-text-sq-white tw-text-[1.375rem] tw-text-sq-white ' +
11
+ item.iconExtraClassNames }));
12
+ }
13
+ return (_jsxs("div", { className: "tw-flex-col tw-flex tw-p-[10px] tw-pl-5 tw-w-[600px]", children: [
14
+ _jsxs("div", { className: "tw-flex tw-flex-row tw-gap-2 tw-items-end", children: [renderIcon, _jsx("h4", { className: "tw-text-base tw-font-[600] tw-leading-[20px] mb-0", children: item.display })
15
+ ] }), _jsx("div", { className: "tw-text-[0.8125rem] tw-font-normal", children: item.text })
16
+ ] }));
17
+ };
18
+ export const ViewWorkbench = (item) => {
19
+ let renderIcon = _jsx(_Fragment, {});
20
+ if (item.icon) {
21
+ renderIcon = isSvgIcon(item.icon) ? (_jsx(SvgIcon, { icon: item.icon, extraClassNames: 'tw-flex tw-w-5 tw-justify-center tw-items-center tw-text-[1.25rem] dark:tw-text-sq-white' +
22
+ ' tw-text-sq-text-color ' +
23
+ item.iconExtraClassNames, type: "default", ...item })) : (_jsx(Icon, { icon: item.icon, type: "text", extraClassNames: 'tw-flex tw-justify-center tw-items-center tw-text-[1.25rem] dark:tw-text-sq-white' +
24
+ ' tw-text-sq-text-color ' +
25
+ item.iconExtraClassNames }));
26
+ }
27
+ return (_jsx("div", { className: "tw-flex-col tw-flex tw-p-[10px]", children: _jsxs("div", { className: "tw-flex tw-flex-row tw-gap-2 tw-items-end", children: [renderIcon, _jsx("div", { className: "tw-text-[0.8125rem]", children: item.display })
28
+ ] }) }));
29
+ };
30
+ export const InsertSeeqContent = (item) => {
31
+ return (_jsxs("div", { className: "tw-flex-col tw-flex tw-justify-start tw-p-[10px] tw-font-normal tw-text-left tw-text-sq-text-color dark:tw-text-sq-dark-text", children: [
32
+ _jsx("h5", { className: "tw-text-[1rem] tw-font-medium tw-text-sq-color-dark tw-leading-[18px]", children: item.display }), _jsx("div", { className: "tw-text-[0.8125rem] tw-text-sq-text-color dark:tw-text-sq-dark-text !tw-mt-1", children: item.text })
33
+ ] }));
34
+ };
@@ -0,0 +1,15 @@
1
+ import React from 'react';
2
+ import { SelectProps } from './Select.types';
3
+ import '../styles.css';
4
+ import { MultiValue as MV, SingleValue as SV } from 'react-select';
5
+ export type MultiValue<T> = MV<T>;
6
+ export type SingleValue<T> = SV<T>;
7
+ /**
8
+ * Select Component
9
+ * - based on react-select (https://react-select.com/)
10
+ *
11
+ * For ease of testing most of the elements of this select can be identified by classNames prefixed with "spec".
12
+ *
13
+ */
14
+ declare const Select: React.FunctionComponent<SelectProps>;
15
+ export default Select;
@@ -0,0 +1,171 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import '../styles.css';
3
+ import { createFilter, default as ReactSelect } from 'react-select';
4
+ import CreatableSelect from 'react-select/creatable';
5
+ const baseClasses = ['focus:tw-ring-0', 'disabled:tw-cursor-not-allowed'].join(' ');
6
+ const containerStyles = ['tw-bg-white', 'dark:tw-bg-sq-dark-background'].join(' ');
7
+ const errorClasses = 'tw-border-sq-danger-color';
8
+ const borderColorClasses = ['tw-border-sq-disabled-gray', 'dark:tw-border-sq-dark-disabled-gray'].join(' ');
9
+ const borderStyles = ['tw-border-solid', 'tw-border'].join(' ');
10
+ const borderActiveClasses = [
11
+ 'hover:tw-border-sq-color-dark',
12
+ 'focus-within:tw-border-sq-color-dark',
13
+ 'active:tw-border-sq-color-dark',
14
+ 'dark:hover:tw-border-sq-color-dark-dark',
15
+ 'dark:focus-within:tw-border-sq-color-dark-dark',
16
+ 'dark:active:tw-border-sq-color-dark-dark',
17
+ ].join(' ');
18
+ const textStyles = ['tw-text-sq-text-color', 'dark:tw-text-sq-dark-text', 'tw-text-sm'].join(' ');
19
+ const textActiveStyles = [
20
+ 'hover:tw-text-sq-color-dark',
21
+ 'dark:tw-text-sq-dark-disabled-gray',
22
+ 'dark:hover:tw-text-sq-color-dark-dark',
23
+ ].join(' ');
24
+ const menuStyles = [
25
+ 'tw-border-solid',
26
+ 'tw-border',
27
+ 'tw-rounded-b',
28
+ 'tw-border-sq-disabled-gray',
29
+ 'dark:tw-border-sq-dark-disabled-gray',
30
+ 'tw-whitespace-nowrap',
31
+ 'tw-min-w-fit',
32
+ '!tw-z-[9999]',
33
+ ].join(' ');
34
+ const menuListStyles = [
35
+ 'tw-rounded-b',
36
+ 'tw-bg-white',
37
+ 'dark:tw-bg-sq-dark-background',
38
+ 'tw-min-w-fit',
39
+ '!tw-z-[9999]',
40
+ 'specSelectMenu',
41
+ ].join(' ');
42
+ const groupHeadingStyles = [
43
+ 'tw-bg-sq-light-gray',
44
+ 'dark:tw-bg-sq-dark-disabled-gray',
45
+ 'tw-text-sq-darkish-gray',
46
+ 'tw-py-1',
47
+ 'tw-px-2.5',
48
+ 'specSelectGroupHeading',
49
+ ].join(' ');
50
+ const optionStyles = [
51
+ 'hover:tw-bg-sq-gray-highlight',
52
+ 'hover:tw-cursor-pointer',
53
+ 'dark:hover:tw-bg-sq-gray-highlight-dark',
54
+ 'tw-py-1',
55
+ 'tw-px-2.5',
56
+ 'specSelectOption',
57
+ ].join(' ');
58
+ const disabledClasses = ['tw-bg-sq-field-disabled-gray', '!tw-cursor-not-allowed', 'tw-opacity-50'].join(' ');
59
+ const dropDownIndicatorStyles = `tw-text-sq-disabled-gray ${textActiveStyles} specOpenIt`;
60
+ const placeholderStyles = ['tw-text-gray-400', 'dark:tw-text-sq-dark-text-lighter', 'specOpenSelect'].join(' ');
61
+ const multiValueStyles = [
62
+ 'tw-bg-sq-disabled-gray',
63
+ 'dark:tw-bg-sq-multi-gray-dark',
64
+ 'tw-text-sm',
65
+ 'tw-py-0.5',
66
+ 'tw-px-1',
67
+ 'tw-m-0.5',
68
+ 'tw-rounded-sm',
69
+ 'specOpenSelect',
70
+ ].join(' ');
71
+ /**
72
+ * Select Component
73
+ * - based on react-select (https://react-select.com/)
74
+ *
75
+ * For ease of testing most of the elements of this select can be identified by classNames prefixed with "spec".
76
+ *
77
+ */
78
+ const Select = ({ options, value, placeholder = 'select', noOptionsMessage = 'no matching options', isSearchable = true, creatable = false, isMulti = false, isClearable = false, closeMenuOnSelect = true, id, inputId, menuPortalTarget, getOptionLabel, getSelectedValueLabel, getOptionValue, onChange, menuIsOpen, menuPlacement = 'auto', extraClassNames, controlClassNames = '', inputGroup, filterConfig, filterOption, small = false, isDisabled = false, showError = false, isLoading = false, formatGroupLabel, onRemove, defaultValue, onMenuOpen, onMenuClose, components, onMenuInputFocus, onInputChange, inputValue, }) => {
79
+ const getOptionOrSelectedLabel = (option, { context }) => {
80
+ const getSelectedOptionLabel = getSelectedValueLabel ? getSelectedValueLabel : getOptionLabel;
81
+ if (getOptionLabel || getSelectedValueLabel) {
82
+ if (context === 'value') {
83
+ return getSelectedOptionLabel ? getSelectedOptionLabel(option) : option.label;
84
+ }
85
+ else {
86
+ return getOptionLabel ? getOptionLabel(option) : option.label;
87
+ }
88
+ }
89
+ else {
90
+ return option.label;
91
+ }
92
+ };
93
+ const interceptOnChange = (newValue, actionMeta) => {
94
+ if (isMulti && onRemove && actionMeta.action === 'remove-value') {
95
+ onRemove({ id: actionMeta.removedValue });
96
+ return;
97
+ }
98
+ onChange(newValue);
99
+ };
100
+ const props = {
101
+ id,
102
+ value,
103
+ inputId,
104
+ placeholder,
105
+ closeMenuOnSelect,
106
+ blurInputOnSelect: closeMenuOnSelect,
107
+ isSearchable: creatable ? true : isSearchable,
108
+ isMulti,
109
+ isClearable,
110
+ isLoading,
111
+ defaultValue,
112
+ noOptionsMessage: () => noOptionsMessage,
113
+ menuPortalTarget,
114
+ menuIsOpen,
115
+ onChange: interceptOnChange,
116
+ unstyled: true,
117
+ menuPlacement,
118
+ formatOptionLabel: getOptionOrSelectedLabel,
119
+ formatGroupLabel,
120
+ getOptionValue,
121
+ options,
122
+ isDisabled,
123
+ onMenuOpen,
124
+ onMenuClose,
125
+ components,
126
+ onMenuInputFocus,
127
+ onInputChange,
128
+ inputValue,
129
+ hideSelectedOptions: isMulti,
130
+ filterOption: filterOption ? filterOption : filterConfig ? createFilter(filterConfig) : undefined,
131
+ classNames: {
132
+ control: ({ menuIsOpen }) => {
133
+ let border = menuIsOpen ? 'tw-rounded-t-md' : 'tw-rounded-md';
134
+ // if it's on the left side of the input group make sure the right side is straight and not curved
135
+ if (inputGroup === 'left') {
136
+ border = menuIsOpen ? 'tw-rounded-tl-md' : 'tw-rounded-l-md';
137
+ }
138
+ else if (inputGroup === 'right') {
139
+ border = menuIsOpen ? 'tw-rounded-tr-md' : 'tw-rounded-r-md';
140
+ }
141
+ const appliedClasses = `${borderStyles} ${isDisabled ? '' : borderActiveClasses} ${border} ${showError ? errorClasses : borderColorClasses} ${small ? 'reactSelectMinHeightSmall' : 'reactSelectMinHeight'} ${controlClassNames}`;
142
+ return `${appliedClasses} ${baseClasses} ${containerStyles} specSelectControl ${isDisabled ? disabledClasses : ''} ${small ? 'tw-pl-2 tw-pr-1' : 'tw-pl-2.5 tw-pr-1.5'}`;
143
+ },
144
+ placeholder: () => placeholderStyles,
145
+ container: ({ selectProps }) => {
146
+ const containerBorderStyles = selectProps?.menuIsOpen ? 'tw-rounded-t-md' : 'tw-rounded-md';
147
+ return `${textStyles} ${extraClassNames} ${containerBorderStyles} !tw-pointer-events-auto`;
148
+ },
149
+ input: () => textStyles + ' specSelectInput',
150
+ menuList: () => menuListStyles,
151
+ menu: () => menuStyles,
152
+ menuPortal: () => '!tw-z-[9000]',
153
+ dropdownIndicator: () => dropDownIndicatorStyles,
154
+ option: ({ isSelected, isDisabled }) => {
155
+ let classes = optionStyles;
156
+ if (isDisabled) {
157
+ classes += ' specDisabledOption ';
158
+ }
159
+ return isSelected ? classes + ' tw-bg-sq-colored-hover dark:tw-bg-sq-colored-hover-dark' : classes;
160
+ },
161
+ singleValue: () => 'specOpenSelect',
162
+ multiValue: () => multiValueStyles,
163
+ multiValueRemove: () => 'hover:tw-text-sq-danger-color specSelectMultiValueRemove',
164
+ clearIndicator: () => 'tw-text-sq-disabled-gray hover:tw-text-sq-danger-color specClearSelect',
165
+ group: () => 'specSelectGroup',
166
+ groupHeading: () => groupHeadingStyles,
167
+ },
168
+ };
169
+ return creatable ? _jsx(CreatableSelect, { ...props }) : _jsx(ReactSelect, { ...props });
170
+ };
171
+ export default Select;
@@ -0,0 +1,5 @@
1
+ declare const _default: {
2
+ title: string;
3
+ };
4
+ export default _default;
5
+ export declare const AllSelectVariants: () => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,50 @@
1
+ import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import Select from './Select';
3
+ import TextField from '../TextField';
4
+ export default {
5
+ title: 'Select',
6
+ };
7
+ export const AllSelectVariants = () => {
8
+ const options = [
9
+ { value: 'a', label: 'Chocolate' },
10
+ { value: 'b', label: 'Strawberry' },
11
+ { value: 'c', label: 'Vanilla' },
12
+ { value: 'd', label: 'Rocky Road' },
13
+ { value: 'e', label: 'Crazy Cow' },
14
+ { value: 'f', label: 'Almond Joy' },
15
+ { value: 'g', label: 'All of the above' },
16
+ ];
17
+ const colorOptions = [
18
+ { value: 'h', label: 'pink' },
19
+ { value: 'i', label: 'purple' },
20
+ { value: 'j', label: 'green' },
21
+ { value: 'k', label: 'red' },
22
+ ];
23
+ const groupedOptions = [
24
+ {
25
+ label: 'Ice Cream Flavors',
26
+ options: options,
27
+ },
28
+ {
29
+ label: 'Colors',
30
+ options: colorOptions,
31
+ },
32
+ ];
33
+ const customColorOption = (dropdownProps) => {
34
+ return _jsx("div", { style: { color: dropdownProps.data.label }, children: dropdownProps.data.label });
35
+ };
36
+ const allSelects = () => (_jsxs(_Fragment, { children: [
37
+ _jsx("div", { className: "tw-p-5", children: _jsx(Select, { id: "hello", onChange: () => { }, options: options, placeholder: "single value" }) }), _jsx("div", { className: "tw-p-5", children: _jsx(Select, { id: "hello", onChange: () => { }, options: options, placeholder: "single value - small", small: true }) }), _jsx("div", { className: "tw-p-5", children: _jsx(Select, { id: "disabled", onChange: () => { }, options: options, placeholder: "disabled", isDisabled: true }) }), _jsx("div", { className: "tw-p-5", children: _jsx(Select, { id: "error", onChange: () => { }, options: options, placeholder: "error", showError: true }) }), _jsx("div", { className: "tw-p-5", children: _jsx(Select, { onChange: () => { }, options: options, placeholder: "stays open", closeMenuOnSelect: false, creatable: true }) }), _jsx("div", { className: "tw-p-5", children: _jsx(Select, { onChange: () => { }, options: groupedOptions, placeholder: "grouped" }) }), _jsx("div", { className: "tw-p-5", children: _jsx(Select, { onChange: () => { }, options: options, creatable: true, placeholder: "create option" }) }), _jsx("div", { className: "tw-p-5", children: _jsx(Select, { onChange: () => { }, options: options, isClearable: true, placeholder: "clearable" }) }), _jsx("div", { className: "tw-p-5", children: _jsx(Select, { onChange: () => { }, options: options, placeholder: "multi-select", isMulti: true, isSearchable: false }) }), _jsx("div", { className: "tw-p-5", children: _jsx(Select, { onChange: () => { }, placeholder: "type to search", options: options, isSearchable: true }) }), _jsxs("div", { className: "tw-p-5 tw-flex tw-flex-row", children: [
38
+ _jsx(Select, { onChange: () => { }, placeholder: "type to search", options: options, inputGroup: "left", extraClassNames: "tw-w-[200px] tw-flex-2" }), _jsx(TextField, { extraClassNames: "tw-flex-1 tw-min-w-24", onChange: () => { }, placeholder: "change me", inputGroup: "right" })
39
+ ] }), _jsx("div", { className: "tw-p-5", children: _jsx(Select, { onChange: () => { }, options: colorOptions, placeholder: "custom option", components: { Option: (dropdownProps) => customColorOption(dropdownProps) } }) }), _jsx("div", { className: "tw-p-5", children: _jsx(Select, { onChange: () => { }, options: colorOptions, placeholder: "custom option", controlClassNames: "tw-border-0", components: { Option: (dropdownProps) => customColorOption(dropdownProps) } }) })
40
+ ] }));
41
+ const renderAllVariations = () => (_jsxs(_Fragment, { children: [allSelects(), _jsx("div", { className: "tw-dark tw-bg-sq-dark-background", children: allSelects() })
42
+ ] }));
43
+ return (_jsxs("div", { className: "tw-grid tw-grid-cols-4", children: [
44
+ _jsxs("div", { className: "color_topic", children: [
45
+ _jsx("b", { children: "Topic Colors" }), renderAllVariations()] }), _jsxs("div", { className: "color_analysis", children: [
46
+ _jsx("b", { children: "Analysis Colors" }), renderAllVariations()] }), _jsxs("div", { className: "color_datalab", children: [
47
+ _jsx("b", { children: "Datalab Colors" }), renderAllVariations()] }), _jsxs("div", { className: "color_vantage", children: [
48
+ _jsx("b", { children: "Vantage Colors" }), renderAllVariations()] })
49
+ ] }));
50
+ };
@@ -0,0 +1 @@
1
+ import '@testing-library/jest-dom';