@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,328 @@
1
+ import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import React from 'react';
3
+ import { QTip } from '../Tooltip/Qtip';
4
+ import { ButtonGroup } from './ButtonGroup';
5
+ import ToolbarButton from '../ToolbarButton';
6
+ export default {
7
+ title: 'ButtonGroup',
8
+ };
9
+ export const AllButtonGroups = () => {
10
+ const [value, setValue] = React.useState('provided-1');
11
+ const renderAllVariations = () => (_jsxs(_Fragment, { children: [
12
+ _jsxs("div", { className: "light", children: [
13
+ _jsx("div", { className: "tw-p-4", children: _jsx(ButtonGroup, { onChange: () => { }, buttons: [
14
+ {
15
+ variant: 'button',
16
+ buttonProps: {
17
+ variant: 'outline',
18
+ icon: 'fc-annotate',
19
+ iconStyle: 'theme',
20
+ value: 'provided-1',
21
+ },
22
+ },
23
+ {
24
+ variant: 'button',
25
+ buttonProps: {
26
+ variant: 'outline',
27
+ icon: 'fc-trash',
28
+ iconStyle: 'theme',
29
+ value: 'provided-2',
30
+ },
31
+ },
32
+ {
33
+ variant: 'button',
34
+ buttonProps: {
35
+ variant: 'outline',
36
+ icon: 'fc-formula-ai',
37
+ iconStyle: 'theme',
38
+ value: 'provided-3',
39
+ },
40
+ },
41
+ ] }) }), _jsx("div", { className: "tw-p-4", children: _jsx(ButtonGroup, { onChange: (newValue) => setValue(newValue), buttons: [
42
+ {
43
+ variant: 'button',
44
+ buttonProps: {
45
+ variant: 'outline',
46
+ icon: 'fc-annotate',
47
+ extraClassNames: 'tw-border-none',
48
+ iconStyle: 'theme',
49
+ value: 'provided-1',
50
+ },
51
+ },
52
+ {
53
+ variant: 'button',
54
+ buttonProps: {
55
+ variant: 'outline',
56
+ icon: 'fc-trash',
57
+ extraClassNames: 'tw-border-none',
58
+ iconStyle: 'theme',
59
+ value: 'provided-2',
60
+ },
61
+ },
62
+ {
63
+ variant: 'button',
64
+ buttonProps: {
65
+ variant: 'outline',
66
+ extraClassNames: 'tw-border-none',
67
+ icon: 'fc-formula-ai',
68
+ iconStyle: 'theme',
69
+ value: 'provided-3',
70
+ },
71
+ },
72
+ ] }) }), _jsx("div", { className: "tw-p-4", children: _jsx(ButtonGroup, { onChange: (newValue) => setValue(newValue), buttons: [
73
+ {
74
+ variant: 'button',
75
+ buttonProps: {
76
+ variant: 'theme',
77
+ icon: 'fc-annotate',
78
+ iconStyle: 'white',
79
+ value: 'provided-1',
80
+ },
81
+ },
82
+ {
83
+ variant: 'button',
84
+ buttonProps: {
85
+ variant: 'theme',
86
+ icon: 'fc-trash',
87
+ iconStyle: 'white',
88
+ value: 'provided-2',
89
+ },
90
+ },
91
+ {
92
+ variant: 'button',
93
+ buttonProps: {
94
+ variant: 'theme',
95
+ icon: 'fc-formula-ai',
96
+ iconStyle: 'white',
97
+ value: 'provided-3',
98
+ },
99
+ },
100
+ ] }) }), _jsx("div", { className: "tw-p-4", children: _jsx(ButtonGroup, { onChange: (newValue) => setValue(newValue), buttons: [
101
+ {
102
+ variant: 'button',
103
+ buttonProps: {
104
+ variant: 'theme',
105
+ label: 'annotate',
106
+ value: 'provided-1',
107
+ },
108
+ },
109
+ {
110
+ variant: 'button',
111
+ buttonProps: {
112
+ variant: 'theme',
113
+ label: 'trash',
114
+ value: 'provided-2',
115
+ },
116
+ },
117
+ {
118
+ variant: 'button',
119
+ buttonProps: {
120
+ variant: 'theme',
121
+ label: 'formula-ai',
122
+ value: 'provided-3',
123
+ },
124
+ },
125
+ ] }) }), _jsx("div", { className: "tw-p-4", children: _jsx(ButtonGroup, { onChange: () => { }, buttons: [
126
+ {
127
+ variant: 'element',
128
+ element: (_jsx(ToolbarButton, { icon: "fc-y-axis", label: "Popover", testId: "basic-popover1", tooltipText: "This is a small popover.", tooltipOptions: { position: 'top', delay: 0 }, isHtmlTooltip: false, popoverContent: _jsx("div", { className: "tw-text-sm dark:tw-text-white", children: _jsx("p", { className: "tw-bg-gray-200 dark:tw-bg-gray-700 tw-p-2", children: "Flavors" }) }) })),
129
+ },
130
+ {
131
+ variant: 'element',
132
+ element: (_jsx(ToolbarButton, { icon: "fc-trash", label: "Trash", testId: "basic-popover1", tooltipText: "This is a small popover.", tooltipOptions: { position: 'top', delay: 0 }, isHtmlTooltip: false, popoverContent: _jsx("div", { className: "tw-text-sm dark:tw-text-white", children: _jsx("p", { className: "tw-bg-gray-200 dark:tw-bg-gray-700 tw-p-2", children: "Flavors" }) }) })),
133
+ },
134
+ {
135
+ variant: 'element',
136
+ element: (_jsx(ToolbarButton, { icon: "fc-formula-ai", label: "Formula", testId: "basic-popover1", tooltipText: "This is a small popover.", tooltipOptions: { position: 'top', delay: 0 }, isHtmlTooltip: false, popoverContent: _jsx("div", { className: "tw-text-sm dark:tw-text-white", children: _jsx("p", { className: "tw-bg-gray-200 dark:tw-bg-gray-700 tw-p-2", children: "Flavors" }) }) })),
137
+ },
138
+ ] }) }), _jsx("div", { className: "tw-p-4", children: _jsx(ButtonGroup, { buttons: [
139
+ {
140
+ variant: 'button',
141
+ buttonProps: {
142
+ size: 'sm',
143
+ icon: 'fc-annotate',
144
+ value: 'left',
145
+ isActive: true,
146
+ },
147
+ },
148
+ {
149
+ variant: 'button',
150
+ buttonProps: {
151
+ size: 'sm',
152
+ icon: 'fc-trash',
153
+ value: 'center',
154
+ isActive: false,
155
+ },
156
+ },
157
+ {
158
+ variant: 'button',
159
+ buttonProps: {
160
+ size: 'sm',
161
+ icon: 'fc-formula-ai',
162
+ value: 'right',
163
+ isActive: false,
164
+ },
165
+ },
166
+ ] }) })
167
+ ] }), _jsxs("div", { className: "tw-dark tw-bg-sq-dark-background", children: [
168
+ _jsx("div", { className: "tw-p-4", children: _jsx(ButtonGroup, { onChange: (newValue) => setValue(newValue), buttons: [
169
+ {
170
+ variant: 'button',
171
+ buttonProps: {
172
+ variant: 'outline',
173
+ icon: 'fc-annotate',
174
+ iconStyle: 'theme',
175
+ value: 'provided-1',
176
+ },
177
+ },
178
+ {
179
+ variant: 'button',
180
+ buttonProps: {
181
+ variant: 'outline',
182
+ icon: 'fc-trash',
183
+ iconStyle: 'theme',
184
+ value: 'provided-2',
185
+ },
186
+ },
187
+ {
188
+ variant: 'button',
189
+ buttonProps: {
190
+ variant: 'outline',
191
+ icon: 'fc-formula-ai',
192
+ iconStyle: 'theme',
193
+ value: 'provided-3',
194
+ },
195
+ },
196
+ ] }) }), _jsx("div", { className: "tw-p-4", children: _jsx(ButtonGroup, { onChange: (newValue) => setValue(newValue), buttons: [
197
+ {
198
+ variant: 'button',
199
+ buttonProps: {
200
+ variant: 'no-border',
201
+ icon: 'fc-annotate',
202
+ iconStyle: 'theme',
203
+ value: 'provided-1',
204
+ },
205
+ },
206
+ {
207
+ variant: 'button',
208
+ buttonProps: {
209
+ variant: 'no-border',
210
+ icon: 'fc-trash',
211
+ iconStyle: 'theme',
212
+ value: 'provided-2',
213
+ },
214
+ },
215
+ {
216
+ variant: 'button',
217
+ buttonProps: {
218
+ variant: 'no-border',
219
+ icon: 'fc-formula-ai',
220
+ iconStyle: 'theme',
221
+ value: 'provided-3',
222
+ },
223
+ },
224
+ ] }) }), _jsx("div", { className: "tw-p-4", children: _jsx(ButtonGroup, { onChange: (newValue) => setValue(newValue), buttons: [
225
+ {
226
+ variant: 'button',
227
+ buttonProps: {
228
+ variant: 'theme',
229
+ icon: 'fc-annotate',
230
+ iconStyle: 'white',
231
+ value: 'provided-1',
232
+ },
233
+ },
234
+ {
235
+ variant: 'button',
236
+ buttonProps: {
237
+ variant: 'theme',
238
+ icon: 'fc-trash',
239
+ iconStyle: 'white',
240
+ value: 'provided-2',
241
+ },
242
+ },
243
+ {
244
+ variant: 'button',
245
+ buttonProps: {
246
+ variant: 'theme',
247
+ icon: 'fc-formula-ai',
248
+ iconStyle: 'white',
249
+ value: 'provided-3',
250
+ },
251
+ },
252
+ ] }) }), _jsx("div", { className: "tw-p-4", children: _jsx(ButtonGroup, { onChange: (newValue) => setValue(newValue), buttons: [
253
+ {
254
+ variant: 'button',
255
+ buttonProps: {
256
+ variant: 'theme',
257
+ label: 'annotate',
258
+ value: 'provided-1',
259
+ },
260
+ },
261
+ {
262
+ variant: 'button',
263
+ buttonProps: {
264
+ variant: 'theme',
265
+ label: 'trash',
266
+ value: 'provided-2',
267
+ },
268
+ },
269
+ {
270
+ variant: 'button',
271
+ buttonProps: {
272
+ variant: 'theme',
273
+ label: 'formula-ai',
274
+ value: 'provided-3',
275
+ },
276
+ },
277
+ ] }) }), _jsx("div", { className: "tw-p-4", children: _jsx(ButtonGroup, { onChange: () => { }, buttons: [
278
+ {
279
+ variant: 'element',
280
+ element: (_jsx(ToolbarButton, { icon: "fc-y-axis", label: "Popover", testId: "basic-popover1", tooltipText: "This is a small popover.", tooltipOptions: { position: 'top', delay: 0 }, isHtmlTooltip: false, popoverContent: _jsx("div", { className: "tw-text-sm dark:tw-text-white", children: _jsx("p", { className: "tw-bg-gray-200 dark:tw-bg-gray-700 tw-p-2", children: "Flavors" }) }) })),
281
+ },
282
+ {
283
+ variant: 'element',
284
+ element: (_jsx(ToolbarButton, { icon: "fc-trash", label: "Trash", testId: "basic-popover1", tooltipText: "This is a small popover.", tooltipOptions: { position: 'top', delay: 0 }, isHtmlTooltip: false, popoverContent: _jsx("div", { className: "tw-text-sm dark:tw-text-white", children: _jsx("p", { className: "tw-bg-gray-200 dark:tw-bg-gray-700 tw-p-2", children: "Flavors" }) }) })),
285
+ },
286
+ {
287
+ variant: 'element',
288
+ element: (_jsx(ToolbarButton, { icon: "fc-formula-ai", label: "Formula", testId: "basic-popover1", tooltipText: "This is a small popover.", tooltipOptions: { position: 'top', delay: 0 }, isHtmlTooltip: false, popoverContent: _jsx("div", { className: "tw-text-sm dark:tw-text-white", children: _jsx("p", { className: "tw-bg-gray-200 dark:tw-bg-gray-700 tw-p-2", children: "Flavors" }) }) })),
289
+ },
290
+ ] }) }), _jsx("div", { className: "tw-p-4", children: _jsx(ButtonGroup, { buttons: [
291
+ {
292
+ variant: 'button',
293
+ buttonProps: {
294
+ size: 'sm',
295
+ icon: 'fc-annotate',
296
+ value: 'left',
297
+ isActive: true,
298
+ },
299
+ },
300
+ {
301
+ variant: 'button',
302
+ buttonProps: {
303
+ size: 'sm',
304
+ icon: 'fc-trash',
305
+ value: 'center',
306
+ isActive: false,
307
+ },
308
+ },
309
+ {
310
+ variant: 'button',
311
+ buttonProps: {
312
+ size: 'sm',
313
+ icon: 'fc-formula-ai',
314
+ value: 'right',
315
+ isActive: false,
316
+ },
317
+ },
318
+ ] }) })
319
+ ] })
320
+ ] }));
321
+ return (_jsxs("div", { className: "tw-grid tw-grid-cols-4 tw-gap-4", children: [
322
+ _jsx(QTip, {}), _jsxs("div", { className: "color_topic", children: [
323
+ _jsx("b", { children: "Topic Colors" }), renderAllVariations()] }), _jsxs("div", { className: "color_analysis", children: [
324
+ _jsx("b", { children: "Analysis Colors" }), renderAllVariations()] }), _jsxs("div", { className: "color_datalab", children: [
325
+ _jsx("b", { children: "Datalab Colors" }), renderAllVariations()] }), _jsxs("div", { className: "color_vantage", children: [
326
+ _jsx("b", { children: "Vantage Colors" }), renderAllVariations()] })
327
+ ] }));
328
+ };
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,65 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { fireEvent, render } from '@testing-library/react';
3
+ import { ButtonGroup } from './ButtonGroup';
4
+ describe('ButtonGroup', () => {
5
+ const mockOnChange = jest.fn();
6
+ const defaultProps = {
7
+ id: 'test-id',
8
+ extraClassNames: 'extra-class',
9
+ testId: 'button-group',
10
+ onChange: mockOnChange,
11
+ buttons: [
12
+ {
13
+ variant: 'button',
14
+ buttonProps: {
15
+ testId: 'button1',
16
+ value: 'button1',
17
+ variant: 'outline',
18
+ extraClassNames: 'button-class',
19
+ isActive: true,
20
+ },
21
+ },
22
+ {
23
+ variant: 'button',
24
+ buttonProps: {
25
+ testId: 'button2',
26
+ value: 'button2',
27
+ variant: 'theme',
28
+ extraClassNames: 'button-class',
29
+ },
30
+ },
31
+ {
32
+ variant: 'element',
33
+ element: _jsx("span", { children: "Custom Element" }, "custom-element"),
34
+ },
35
+ ],
36
+ };
37
+ it('renders ButtonGroup with buttons and custom elements', () => {
38
+ const { getByTestId } = render(_jsx(ButtonGroup, { ...defaultProps }));
39
+ const buttonGroup = getByTestId('button-group');
40
+ expect(buttonGroup).toBeInTheDocument();
41
+ expect(buttonGroup).toHaveClass('tw-flex tw-outline-none tw-w-full tw-relative tw-flex-wrap extra-class');
42
+ const button1 = getByTestId('button1');
43
+ expect(button1).toBeInTheDocument();
44
+ expect(button1).toHaveClass('button-class');
45
+ const button2 = getByTestId('button2');
46
+ expect(button2).toBeInTheDocument();
47
+ expect(button2).toHaveClass('button-class');
48
+ });
49
+ it('calls onChange when a button is clicked', () => {
50
+ const { getByTestId } = render(_jsx(ButtonGroup, { ...defaultProps }));
51
+ const button1 = getByTestId('button1');
52
+ fireEvent.click(button1);
53
+ expect(mockOnChange).toHaveBeenCalledWith('button1');
54
+ const button2 = getByTestId('button2');
55
+ fireEvent.click(button2);
56
+ expect(mockOnChange).toHaveBeenCalledWith('button2');
57
+ });
58
+ it('applies active classes based on value and variant', () => {
59
+ const { getByTestId } = render(_jsx(ButtonGroup, { ...defaultProps }));
60
+ const button1 = getByTestId('button1');
61
+ expect(button1).toHaveClass('!tw-bg-sq-disabled-gray tw-border-sq-color-dark');
62
+ const button2 = getByTestId('button2');
63
+ expect(button2).not.toHaveClass('tw-bg-sq-color-highlight');
64
+ });
65
+ });
@@ -0,0 +1,80 @@
1
+ import { ButtonProps } from '../Button/Button.types';
2
+ import { TooltipComponentProps } from '../Tooltip/Tooltip.types';
3
+ /**
4
+ * Interface representing the properties for a button within a ButtonGroup.
5
+ * Used when you want to include an interactive button as part of the group.
6
+ */
7
+ interface AppendedButtonProps {
8
+ /**
9
+ * Specifies that this group item is a clickable button.
10
+ * Button items can be selected, have active states, and trigger onChange events.
11
+ */
12
+ variant: 'button';
13
+ /**
14
+ * Configuration properties for the button component.
15
+ * Omits the onClick handler since ButtonGroup manages selection internally.
16
+ * Requires a value for selection tracking and optionally an isActive state.
17
+ */
18
+ buttonProps: Omit<ButtonProps, 'onClick'> & {
19
+ /** Unique value used to identify this button when selected */
20
+ value: string;
21
+ /** Whether this button is currently in the active/selected state */
22
+ isActive?: boolean;
23
+ };
24
+ }
25
+ /**
26
+ * Interface for including custom React elements within a ButtonGroup.
27
+ * Used when you need to add non-button content like separators, labels, or custom components.
28
+ */
29
+ interface ElementProps {
30
+ /**
31
+ * Specifies that this group item is a custom React element.
32
+ * Element items are purely presentational and don't participate in selection logic.
33
+ */
34
+ variant: 'element';
35
+ /**
36
+ * The React content to render within the button group.
37
+ * Can be any valid React node including text, icons, separators, or complex components.
38
+ */
39
+ element: React.ReactNode;
40
+ /**
41
+ * Additional CSS classes to apply to the element's container.
42
+ * Use this to style the element consistently with the button group's appearance.
43
+ */
44
+ extraClassNames?: string;
45
+ }
46
+ type Props = AppendedButtonProps | ElementProps | undefined;
47
+ /**
48
+ * Props for the ButtonGroup component that creates a cohesive group of related buttons.
49
+ * Extends TooltipComponentProps to support tooltip functionality on the entire group.
50
+ */
51
+ export interface ButtonGroupProps extends TooltipComponentProps {
52
+ /**
53
+ * Array of items to display in the button group.
54
+ * Each item can be either a button (for interactive elements) or an element (for decorative content).
55
+ * Buttons within the group share consistent styling and spacing for a unified appearance.
56
+ */
57
+ buttons: Props[];
58
+ /**
59
+ * HTML ID attribute for the button group container.
60
+ * Should be unique across the page for proper HTML semantics and accessibility.
61
+ */
62
+ id?: string;
63
+ /**
64
+ * Additional CSS classes to apply to the button group container.
65
+ * Use this to customize the group's appearance, spacing, or layout beyond default styling.
66
+ */
67
+ extraClassNames?: string;
68
+ /**
69
+ * Callback function triggered when a button within the group is selected.
70
+ * Receives the value of the selected button as defined in its buttonProps.value.
71
+ * Use this to handle selection changes and update your application state.
72
+ */
73
+ onChange?: (value: string) => void;
74
+ /**
75
+ * Test ID attribute for the button group container used in automated testing.
76
+ * Applied to the group's root element for test targeting and interaction.
77
+ */
78
+ testId?: string;
79
+ }
80
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export { ButtonGroup as default } from './ButtonGroup';
@@ -0,0 +1 @@
1
+ export { ButtonGroup as default } from './ButtonGroup';
@@ -0,0 +1,4 @@
1
+ import * as React from 'react';
2
+ import { ButtonWithDropdownProps } from './ButtonWithDropdown.types';
3
+ declare const ButtonWithDropdown: React.FunctionComponent<ButtonWithDropdownProps>;
4
+ export default ButtonWithDropdown;
@@ -0,0 +1,46 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import * as DropdownMenu from '@radix-ui/react-dropdown-menu';
3
+ import Icon from '../Icon';
4
+ import { getQTipData } from '../Tooltip/qTip.utilities';
5
+ const borderStyles = [
6
+ 'tw-border-solid',
7
+ 'tw-border',
8
+ 'tw-rounded-popover',
9
+ 'tw-border-sq-disabled-gray',
10
+ 'dark:tw-border-gray-500',
11
+ ].join(' ');
12
+ const bgStyles = ['tw-bg-sq-white', 'dark:tw-bg-sq-dark-background'].join(' ');
13
+ const disabledClasses = ['tw-opacity-50', 'tw-cursor-not-allowed'].join(' ');
14
+ const ButtonWithDropdown = ({ dropdownItems, triggerIcon, id, extraClassNames = '', contentExtraClassNames = '', containerTestId, disabled = false, align = 'end', placement = 'bottom', placementOffset = 5, alignOffset = -35, hasArrow = false, onOpenChange, isOpen, setFocusOnTriggerOnClose = true, keepFocusInsideDropdown = true, onContainerClick, ...tooltipProps }) => {
15
+ const tooltipData = getQTipData(tooltipProps);
16
+ return (_jsxs(DropdownMenu.Root, { defaultOpen: false, open: isOpen, onOpenChange: onOpenChange, modal: keepFocusInsideDropdown, children: [
17
+ _jsx(DropdownMenu.Trigger, { id: id, className: `tw-border-none focus-visible:tw-outline-none focus:tw-outline-none focus-within:tw-outline-none`, disabled: disabled, children: _jsx("div", { ...tooltipData, className: `tw-bg-transparent tw-flex tw-flex-col tw-items-center focus-visible:tw-outline-none focus:tw-outline-none focus-within:tw-outline-none ${disabled ? disabledClasses : ''} ${extraClassNames}`, children: triggerIcon }) }), _jsx(DropdownMenu.Portal, { children: _jsx(DropdownMenu.Content, { onClick: onContainerClick, sideOffset: placementOffset, side: placement, align: align, alignOffset: alignOffset, asChild: true, onCloseAutoFocus: (e) => !setFocusOnTriggerOnClose && e.preventDefault(), className: "focus-visible:tw-outline-none tw-outline-none", children: _jsxs("div", { "data-testid": containerTestId, className: `${bgStyles} tw-relative tw-z-[1200] tw-min-w-6 tw-py-2 focus-visible:tw-outline-none tw-outline-none data-[state=open]:tw-animate-in data-[state=closed]:tw-animate-out forceFont data-[side=top]:tw-animate-slideDownAndFade data-[side=right]:tw-animate-slideLeftAndFade data-[side=bottom]:tw-animate-slideUpAndFade data-[side=left]:tw-animate-slideRightAndFade ${borderStyles} ${contentExtraClassNames}`, children: [hasArrow && (_jsx(DropdownMenu.Arrow, { asChild: true, children: _jsx("div", { className: " tw-fill-transparent tw-bg-white tw-w-[15px] tw-h-[15px] tw-rotate-45 dark:tw-bg-sq-dark-background tw-border-b tw-border-r tw-border-sq-disabled-gray dark:tw-border-gray-500 tw-mt-[-7px]" }) })), dropdownItems.map((item, index) => {
18
+ const tooltipData = getQTipData(item);
19
+ if (item.isLabel) {
20
+ return (_jsxs(DropdownMenu.Label, { className: item.itemExtraClassNames, ...tooltipData, children: [item.icon && (_jsx(Icon, { icon: item.icon, testId: item.iconTestId, type: "text", color: item.iconColor, extraClassNames: "tw-text-sq-text-color dark:tw-text-sq-white tw-w-[18px]" })), _jsx("div", { "data-testid": item.labelTestId, className: `tw-text-[0.8125rem] tw-ml-1 ${item.disabled ? 'tw-text-sq-disabled-gray' : 'tw-text-sq-text-color dark:tw-text-sq-white'} tw-not-italic tw-font-normal ${item.labelClasses}`, children: item.label })
21
+ ] }, (item.id || '') + index));
22
+ }
23
+ if (Array.isArray(item.subMenuItems) && item.subMenuItems.length > 0) {
24
+ return (_jsxs(DropdownMenu.Sub, { children: [
25
+ _jsxs(DropdownMenu.SubTrigger, { id: id, className: `tw-cursor-pointer tw-flex tw-justify-between dark:tw-text-sq-white hover:tw-bg-sq-gray-highlight dark:hover:tw-bg-sq-gray-highlight-dark tw-leading-none tw-items-center tw-h-[27px] tw-pl-[19px] tw-relative tw-select-none tw-outline-none data-[disabled]:tw-pointer-events-none ${item.itemExtraClassNames || ''}`, "data-testid": item.testId, disabled: item.disabled, ...tooltipData, children: [
26
+ _jsxs("div", { className: "tw-flex", children: [item.icon && (_jsx(Icon, { icon: item.icon, extraClassNames: `tw-w-[18px] ${item.disabled
27
+ ? '!tw-text-sq-disabled-gray'
28
+ : 'tw-text-sq-text-color dark:tw-text-sq-white'} ${item.iconExtraClassNames || ''}` })), _jsx("div", { "data-testid": item.labelTestId, "data-customid": item.labelCustomId, className: `tw-text-[0.8125rem] tw-ml-1 ${item.disabled && '!tw-opacity-30'} tw-not-italic tw-font-semibold ${item.labelClasses}`, children: item.label })
29
+ ] }), _jsx(Icon, { small: true, icon: "fc-arrow-dropdown -tw-rotate-90", extraClassNames: `${item.disabled ? 'tw-text-sq-disabled-gray' : 'tw-text-sq-text-color dark:tw-text-sq-white'} tw-w-[18px] tw-ml-4 tw-text-[0.5rem] tw-justify-center tw-flex` })
30
+ ] }), _jsx(DropdownMenu.Portal, { children: _jsx(DropdownMenu.SubContent, { className: "focus-visible:tw-outline-none tw-outline-none", children: _jsx("div", { "data-testid": containerTestId, className: `${bgStyles} tw-relative tw-z-[1000] tw-min-w-6 tw-py-2 focus-visible:tw-outline-none tw-outline-none data-[state=open]:tw-animate-in data-[state=closed]:tw-animate-out forceFont data-[side=top]:tw-animate-slideDownAndFade data-[side=right]:tw-animate-slideLeftAndFade data-[side=bottom]:tw-animate-slideUpAndFade data-[side=left]:tw-animate-slideRightAndFade ${borderStyles}`, children: item.subMenuItems.map((subItem, subIndex) => {
31
+ return (_jsxs(DropdownMenu.Item, { onSelect: subItem.onClick, "data-qtip-text": subItem.tooltip, className: "tw-cursor-pointer tw-flex dark:tw-text-sq-white hover:tw-bg-sq-gray-highlight dark:hover:tw-bg-sq-gray-highlight-dark tw-leading-none tw-items-center tw-h-[27px] tw-px-[19px] tw-relative tw-select-none tw-outline-none data-[disabled]:tw-pointer-events-none", disabled: subItem.disabled, children: [subItem.iconClass && (_jsx(Icon, { icon: subItem.iconClass, type: "text", extraClassNames: `tw-w-[18px] ${item.disabled && '!tw-opacity-30'}` })), _jsx("div", { className: `tw-text-[0.8125rem] tw-ml-1 ${subItem.disabled
32
+ ? 'tw-text-sq-disabled-gray'
33
+ : 'tw-text-sq-text-color dark:tw-text-sq-white'} tw-not-italic tw-font-normal ${item.labelClasses}`, children: subItem.label })
34
+ ] }, subItem.label + subIndex));
35
+ }) }) }) })
36
+ ] }, (item.id || item.icon || '') + index));
37
+ }
38
+ return (_jsxs("div", { ...tooltipData, children: [
39
+ _jsxs(DropdownMenu.Item, { "data-customid": item.itemCustomId, onSelect: (e) => {
40
+ item.onClick(e);
41
+ }, className: `tw-cursor-pointer tw-flex dark:tw-text-sq-white hover:tw-bg-sq-gray-highlight dark:hover:tw-bg-sq-gray-highlight-dark tw-leading-none tw-items-center tw-min-h-[27px] tw-px-[19px] tw-relative tw-select-none tw-outline-none data-[disabled]:tw-pointer-events-none ${item.itemExtraClassNames || ''}`, "data-testid": item.testId, disabled: item.disabled, children: [item.icon && (_jsx(Icon, { icon: item.icon, testId: item.iconTestId, type: (item.iconType || 'text'), color: item.iconColor, customId: item.iconCustomId, extraClassNames: `tw-w-[18px] ${item.disabled && '!tw-opacity-30'} ${item.iconExtraClassNames || ''}` })), _jsx("div", { "data-testid": item.labelTestId, "data-customid": item.labelCustomId, className: `tw-text-[0.8125rem] tw-ml-1 ${item.disabled ? 'tw-text-sq-disabled-gray' : 'tw-text-sq-text-color dark:tw-text-sq-white'} tw-not-italic tw-font-normal ${item.labelClasses || ''}`, children: item.label })
42
+ ] }, (item.id || item.icon || '') + index), item.hasDivider && (_jsx(DropdownMenu.Separator, { "data-testid": `dropdown-divider-${index}`, className: "tw-h-[1px] tw-bg-sq-disabled-gray dark:tw-bg-gray-500 tw-my-[8px]" }))] }, (item.id || '') + index));
43
+ })] }) }) })
44
+ ] }));
45
+ };
46
+ export default ButtonWithDropdown;
@@ -0,0 +1,5 @@
1
+ declare const _default: {
2
+ title: string;
3
+ };
4
+ export default _default;
5
+ export declare const AllButtonWithDropdownVariants: () => import("react/jsx-runtime").JSX.Element;