@seeqdev/qomponents 0.0.155-react-19-v10 → 0.0.155

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 (304) hide show
  1. package/README.md +135 -135
  2. package/dist/Accordion/Accordion.stories.d.ts +1 -2
  3. package/dist/Alert/Alert.stories.d.ts +1 -2
  4. package/dist/Alert/Alert.types.d.ts +0 -1
  5. package/dist/Button/Button.stories.d.ts +4 -5
  6. package/dist/Button/Button.types.d.ts +1 -1
  7. package/dist/ButtonGroup/ButtonGroup.stories.d.ts +1 -2
  8. package/dist/ButtonGroup/ButtonGroup.types.d.ts +0 -1
  9. package/dist/ButtonWithDropdown/ButtonWithDropdown.stories.d.ts +1 -2
  10. package/dist/ButtonWithDropdown/ButtonWithDropdown.types.d.ts +0 -1
  11. package/dist/ButtonWithPopover/ButtonWithPopover.stories.d.ts +1 -2
  12. package/dist/Carousel/Carousel.stories.d.ts +1 -2
  13. package/dist/Carousel/Carousel.types.d.ts +0 -1
  14. package/dist/Checkbox/Checkbox.stories.d.ts +1 -2
  15. package/dist/Checkbox/Checkbox.types.d.ts +0 -1
  16. package/dist/Collapse/Collapse.stories.d.ts +1 -2
  17. package/dist/Collapse/Collapse.types.d.ts +0 -1
  18. package/dist/Icon/Icon.stories.d.ts +1 -2
  19. package/dist/Icon/Icon.types.d.ts +0 -1
  20. package/dist/InputGroup/InputGroup.stories.d.ts +1 -2
  21. package/dist/InputGroup/InputGroup.types.d.ts +0 -1
  22. package/dist/ProgressBar/ProgressBar.stories.d.ts +3 -2
  23. package/dist/ProgressBar/ProgressBar.types.d.ts +10 -0
  24. package/dist/ProgressBar/index.d.ts +1 -0
  25. package/dist/SeeqActionDropdown/SeeqActionDropdown.stories.d.ts +1 -2
  26. package/dist/SeeqActionDropdown/SeeqActionDropdown.types.d.ts +0 -1
  27. package/dist/Select/Select.stories.d.ts +1 -2
  28. package/dist/Slider/Slider.stories.d.ts +1 -2
  29. package/dist/Slider/Slider.types.d.ts +0 -1
  30. package/dist/SvgIcon/SvgIcon.stories.d.ts +1 -2
  31. package/dist/SvgIcon/SvgIcon.types.d.ts +0 -1
  32. package/dist/Tabs/Tabs.stories.d.ts +1 -2
  33. package/dist/Tabs/Tabs.types.d.ts +1 -2
  34. package/dist/TextArea/TextArea.stories.d.ts +1 -2
  35. package/dist/TextArea/TextArea.types.d.ts +0 -1
  36. package/dist/TextField/TextField.stories.d.ts +1 -2
  37. package/dist/TextField/TextField.types.d.ts +0 -1
  38. package/dist/ToolbarButton/ToolbarButton.stories.d.ts +1 -2
  39. package/dist/Tooltip/QTip.stories.d.ts +1 -2
  40. package/dist/Tooltip/QTipPerformance.stories.d.ts +1 -2
  41. package/dist/Tooltip/Tooltip.stories.d.ts +1 -2
  42. package/dist/Tooltip/Tooltip.types.d.ts +2 -3
  43. package/dist/Tooltip/TooltipPerformance.stories.d.ts +1 -2
  44. package/dist/example/.eslintrc.cjs +14 -14
  45. package/dist/example/README.md +33 -33
  46. package/dist/example/index.html +13 -13
  47. package/dist/example/package.json +30 -30
  48. package/dist/example/src/ComplexSelectExample.tsx +81 -81
  49. package/dist/example/src/Example.tsx +408 -408
  50. package/dist/example/src/index.css +102 -102
  51. package/dist/example/src/main.tsx +10 -10
  52. package/dist/example/src/vite-env.d.ts +1 -1
  53. package/dist/example/tsconfig.json +33 -33
  54. package/dist/example/tsconfig.node.json +12 -12
  55. package/dist/example/vite.config.ts +12 -12
  56. package/dist/index.d.ts +1 -0
  57. package/dist/index.esm.js +7896 -14347
  58. package/dist/index.esm.js.map +1 -1
  59. package/dist/index.js +7889 -14340
  60. package/dist/index.js.map +1 -1
  61. package/dist/styles.css +4006 -3819
  62. package/package.json +88 -91
  63. package/dist/Accordion/Accordion.js +0 -9
  64. package/dist/Accordion/Accordion.js.map +0 -1
  65. package/dist/Accordion/Accordion.stories.js +0 -115
  66. package/dist/Accordion/Accordion.stories.js.map +0 -1
  67. package/dist/Accordion/Accordion.test.js +0 -55
  68. package/dist/Accordion/Accordion.test.js.map +0 -1
  69. package/dist/Accordion/Accordion.types.js +0 -2
  70. package/dist/Accordion/Accordion.types.js.map +0 -1
  71. package/dist/Accordion/index.js +0 -2
  72. package/dist/Accordion/index.js.map +0 -1
  73. package/dist/Alert/Alert.js +0 -34
  74. package/dist/Alert/Alert.js.map +0 -1
  75. package/dist/Alert/Alert.stories.js +0 -52
  76. package/dist/Alert/Alert.stories.js.map +0 -1
  77. package/dist/Alert/Alert.test.js +0 -51
  78. package/dist/Alert/Alert.test.js.map +0 -1
  79. package/dist/Alert/Alert.types.js +0 -2
  80. package/dist/Alert/Alert.types.js.map +0 -1
  81. package/dist/Alert/index.js +0 -2
  82. package/dist/Alert/index.js.map +0 -1
  83. package/dist/Button/Button.js +0 -92
  84. package/dist/Button/Button.js.map +0 -1
  85. package/dist/Button/Button.stories.js +0 -100
  86. package/dist/Button/Button.stories.js.map +0 -1
  87. package/dist/Button/Button.test.js +0 -49
  88. package/dist/Button/Button.test.js.map +0 -1
  89. package/dist/Button/Button.types.js +0 -5
  90. package/dist/Button/Button.types.js.map +0 -1
  91. package/dist/Button/index.js +0 -2
  92. package/dist/Button/index.js.map +0 -1
  93. package/dist/ButtonGroup/ButtonGroup.js +0 -35
  94. package/dist/ButtonGroup/ButtonGroup.js.map +0 -1
  95. package/dist/ButtonGroup/ButtonGroup.stories.js +0 -385
  96. package/dist/ButtonGroup/ButtonGroup.stories.js.map +0 -1
  97. package/dist/ButtonGroup/ButtonGroup.test.js +0 -67
  98. package/dist/ButtonGroup/ButtonGroup.test.js.map +0 -1
  99. package/dist/ButtonGroup/ButtonGroup.types.js +0 -2
  100. package/dist/ButtonGroup/ButtonGroup.types.js.map +0 -1
  101. package/dist/ButtonGroup/index.js +0 -2
  102. package/dist/ButtonGroup/index.js.map +0 -1
  103. package/dist/ButtonWithDropdown/ButtonWithDropdown.js +0 -60
  104. package/dist/ButtonWithDropdown/ButtonWithDropdown.js.map +0 -1
  105. package/dist/ButtonWithDropdown/ButtonWithDropdown.stories.js +0 -143
  106. package/dist/ButtonWithDropdown/ButtonWithDropdown.stories.js.map +0 -1
  107. package/dist/ButtonWithDropdown/ButtonWithDropdown.test.js +0 -93
  108. package/dist/ButtonWithDropdown/ButtonWithDropdown.test.js.map +0 -1
  109. package/dist/ButtonWithDropdown/ButtonWithDropdown.types.js +0 -2
  110. package/dist/ButtonWithDropdown/ButtonWithDropdown.types.js.map +0 -1
  111. package/dist/ButtonWithDropdown/index.js +0 -2
  112. package/dist/ButtonWithDropdown/index.js.map +0 -1
  113. package/dist/ButtonWithPopover/ButtonWithPopover.js +0 -62
  114. package/dist/ButtonWithPopover/ButtonWithPopover.js.map +0 -1
  115. package/dist/ButtonWithPopover/ButtonWithPopover.stories.js +0 -75
  116. package/dist/ButtonWithPopover/ButtonWithPopover.stories.js.map +0 -1
  117. package/dist/ButtonWithPopover/ButtonWithPopover.test.js +0 -82
  118. package/dist/ButtonWithPopover/ButtonWithPopover.test.js.map +0 -1
  119. package/dist/ButtonWithPopover/ButtonWithPopover.types.js +0 -2
  120. package/dist/ButtonWithPopover/ButtonWithPopover.types.js.map +0 -1
  121. package/dist/ButtonWithPopover/index.js +0 -2
  122. package/dist/ButtonWithPopover/index.js.map +0 -1
  123. package/dist/Carousel/Carousel.js +0 -70
  124. package/dist/Carousel/Carousel.js.map +0 -1
  125. package/dist/Carousel/Carousel.stories.js +0 -115
  126. package/dist/Carousel/Carousel.stories.js.map +0 -1
  127. package/dist/Carousel/Carousel.test.js +0 -48
  128. package/dist/Carousel/Carousel.test.js.map +0 -1
  129. package/dist/Carousel/Carousel.types.js +0 -2
  130. package/dist/Carousel/Carousel.types.js.map +0 -1
  131. package/dist/Carousel/index.js +0 -2
  132. package/dist/Carousel/index.js.map +0 -1
  133. package/dist/Checkbox/Checkbox.js +0 -26
  134. package/dist/Checkbox/Checkbox.js.map +0 -1
  135. package/dist/Checkbox/Checkbox.stories.js +0 -34
  136. package/dist/Checkbox/Checkbox.stories.js.map +0 -1
  137. package/dist/Checkbox/Checkbox.test.js +0 -94
  138. package/dist/Checkbox/Checkbox.test.js.map +0 -1
  139. package/dist/Checkbox/Checkbox.types.js +0 -2
  140. package/dist/Checkbox/Checkbox.types.js.map +0 -1
  141. package/dist/Checkbox/index.js +0 -2
  142. package/dist/Checkbox/index.js.map +0 -1
  143. package/dist/Collapse/Collapse.js +0 -15
  144. package/dist/Collapse/Collapse.js.map +0 -1
  145. package/dist/Collapse/Collapse.stories.js +0 -37
  146. package/dist/Collapse/Collapse.stories.js.map +0 -1
  147. package/dist/Collapse/Collapse.test.js +0 -19
  148. package/dist/Collapse/Collapse.test.js.map +0 -1
  149. package/dist/Collapse/Collapse.types.js +0 -2
  150. package/dist/Collapse/Collapse.types.js.map +0 -1
  151. package/dist/Collapse/index.js +0 -2
  152. package/dist/Collapse/index.js.map +0 -1
  153. package/dist/Icon/Icon.js +0 -55
  154. package/dist/Icon/Icon.js.map +0 -1
  155. package/dist/Icon/Icon.stories.js +0 -49
  156. package/dist/Icon/Icon.stories.js.map +0 -1
  157. package/dist/Icon/Icon.test.js +0 -55
  158. package/dist/Icon/Icon.test.js.map +0 -1
  159. package/dist/Icon/Icon.types.js +0 -16
  160. package/dist/Icon/Icon.types.js.map +0 -1
  161. package/dist/Icon/index.js +0 -2
  162. package/dist/Icon/index.js.map +0 -1
  163. package/dist/InputGroup/InputGroup.js +0 -35
  164. package/dist/InputGroup/InputGroup.js.map +0 -1
  165. package/dist/InputGroup/InputGroup.stories.js +0 -176
  166. package/dist/InputGroup/InputGroup.stories.js.map +0 -1
  167. package/dist/InputGroup/InputGroup.test.js +0 -43
  168. package/dist/InputGroup/InputGroup.test.js.map +0 -1
  169. package/dist/InputGroup/InputGroup.types.js +0 -2
  170. package/dist/InputGroup/InputGroup.types.js.map +0 -1
  171. package/dist/InputGroup/index.js +0 -2
  172. package/dist/InputGroup/index.js.map +0 -1
  173. package/dist/Modal/Modal.js +0 -102
  174. package/dist/Modal/Modal.js.map +0 -1
  175. package/dist/Modal/Modal.stories.js +0 -127
  176. package/dist/Modal/Modal.stories.js.map +0 -1
  177. package/dist/Modal/Modal.test.js +0 -108
  178. package/dist/Modal/Modal.test.js.map +0 -1
  179. package/dist/Modal/Modal.types.js +0 -2
  180. package/dist/Modal/Modal.types.js.map +0 -1
  181. package/dist/Modal/index.js +0 -2
  182. package/dist/Modal/index.js.map +0 -1
  183. package/dist/ProgressBar/ProgressBar.js +0 -70
  184. package/dist/ProgressBar/ProgressBar.js.map +0 -1
  185. package/dist/ProgressBar/ProgressBar.stories.js +0 -83
  186. package/dist/ProgressBar/ProgressBar.stories.js.map +0 -1
  187. package/dist/ProgressBar/ProgressBar.test.js +0 -44
  188. package/dist/ProgressBar/ProgressBar.test.js.map +0 -1
  189. package/dist/ProgressBar/ProgressBar.types.js +0 -2
  190. package/dist/ProgressBar/ProgressBar.types.js.map +0 -1
  191. package/dist/ProgressBar/index.js +0 -2
  192. package/dist/ProgressBar/index.js.map +0 -1
  193. package/dist/SeeqActionDropdown/SeeqActionDropdown.js +0 -48
  194. package/dist/SeeqActionDropdown/SeeqActionDropdown.js.map +0 -1
  195. package/dist/SeeqActionDropdown/SeeqActionDropdown.stories.js +0 -87
  196. package/dist/SeeqActionDropdown/SeeqActionDropdown.stories.js.map +0 -1
  197. package/dist/SeeqActionDropdown/SeeqActionDropdown.test.js +0 -73
  198. package/dist/SeeqActionDropdown/SeeqActionDropdown.test.js.map +0 -1
  199. package/dist/SeeqActionDropdown/SeeqActionDropdown.types.js +0 -2
  200. package/dist/SeeqActionDropdown/SeeqActionDropdown.types.js.map +0 -1
  201. package/dist/SeeqActionDropdown/index.js +0 -2
  202. package/dist/SeeqActionDropdown/index.js.map +0 -1
  203. package/dist/SeeqActionDropdown/variants.js +0 -38
  204. package/dist/SeeqActionDropdown/variants.js.map +0 -1
  205. package/dist/Select/Select.js +0 -177
  206. package/dist/Select/Select.js.map +0 -1
  207. package/dist/Select/Select.stories.js +0 -82
  208. package/dist/Select/Select.stories.js.map +0 -1
  209. package/dist/Select/Select.test.js +0 -182
  210. package/dist/Select/Select.test.js.map +0 -1
  211. package/dist/Select/Select.types.js +0 -2
  212. package/dist/Select/Select.types.js.map +0 -1
  213. package/dist/Select/index.js +0 -3
  214. package/dist/Select/index.js.map +0 -1
  215. package/dist/Slider/Slider.js +0 -13
  216. package/dist/Slider/Slider.js.map +0 -1
  217. package/dist/Slider/Slider.stories.js +0 -58
  218. package/dist/Slider/Slider.stories.js.map +0 -1
  219. package/dist/Slider/Slider.test.js +0 -33
  220. package/dist/Slider/Slider.test.js.map +0 -1
  221. package/dist/Slider/Slider.types.js +0 -2
  222. package/dist/Slider/Slider.types.js.map +0 -1
  223. package/dist/Slider/index.js +0 -2
  224. package/dist/Slider/index.js.map +0 -1
  225. package/dist/SvgIcon/SvgIcon.js +0 -30
  226. package/dist/SvgIcon/SvgIcon.js.map +0 -1
  227. package/dist/SvgIcon/SvgIcon.stories.js +0 -42
  228. package/dist/SvgIcon/SvgIcon.stories.js.map +0 -1
  229. package/dist/SvgIcon/SvgIcon.test.js +0 -41
  230. package/dist/SvgIcon/SvgIcon.test.js.map +0 -1
  231. package/dist/SvgIcon/SvgIcon.types.js +0 -6
  232. package/dist/SvgIcon/SvgIcon.types.js.map +0 -1
  233. package/dist/SvgIcon/index.js +0 -2
  234. package/dist/SvgIcon/index.js.map +0 -1
  235. package/dist/Tabs/Tabs.js +0 -22
  236. package/dist/Tabs/Tabs.js.map +0 -1
  237. package/dist/Tabs/Tabs.stories.js +0 -91
  238. package/dist/Tabs/Tabs.stories.js.map +0 -1
  239. package/dist/Tabs/Tabs.test.js +0 -91
  240. package/dist/Tabs/Tabs.test.js.map +0 -1
  241. package/dist/Tabs/Tabs.types.js +0 -2
  242. package/dist/Tabs/Tabs.types.js.map +0 -1
  243. package/dist/Tabs/index.js +0 -2
  244. package/dist/Tabs/index.js.map +0 -1
  245. package/dist/TextArea/TextArea.js +0 -25
  246. package/dist/TextArea/TextArea.js.map +0 -1
  247. package/dist/TextArea/TextArea.stories.js +0 -46
  248. package/dist/TextArea/TextArea.stories.js.map +0 -1
  249. package/dist/TextArea/TextArea.test.js +0 -68
  250. package/dist/TextArea/TextArea.test.js.map +0 -1
  251. package/dist/TextArea/TextArea.types.js +0 -2
  252. package/dist/TextArea/TextArea.types.js.map +0 -1
  253. package/dist/TextArea/index.js +0 -2
  254. package/dist/TextArea/index.js.map +0 -1
  255. package/dist/TextField/TextField.js +0 -86
  256. package/dist/TextField/TextField.js.map +0 -1
  257. package/dist/TextField/TextField.stories.js +0 -70
  258. package/dist/TextField/TextField.stories.js.map +0 -1
  259. package/dist/TextField/TextField.test.js +0 -41
  260. package/dist/TextField/TextField.test.js.map +0 -1
  261. package/dist/TextField/TextField.types.js +0 -2
  262. package/dist/TextField/TextField.types.js.map +0 -1
  263. package/dist/TextField/index.js +0 -2
  264. package/dist/TextField/index.js.map +0 -1
  265. package/dist/ToolbarButton/ToolbarButton.js +0 -69
  266. package/dist/ToolbarButton/ToolbarButton.js.map +0 -1
  267. package/dist/ToolbarButton/ToolbarButton.stories.js +0 -97
  268. package/dist/ToolbarButton/ToolbarButton.stories.js.map +0 -1
  269. package/dist/ToolbarButton/ToolbarButton.test.js +0 -93
  270. package/dist/ToolbarButton/ToolbarButton.test.js.map +0 -1
  271. package/dist/ToolbarButton/ToolbarButton.types.js +0 -2
  272. package/dist/ToolbarButton/ToolbarButton.types.js.map +0 -1
  273. package/dist/ToolbarButton/index.js +0 -2
  274. package/dist/ToolbarButton/index.js.map +0 -1
  275. package/dist/Tooltip/QTip.stories.js +0 -45
  276. package/dist/Tooltip/QTip.stories.js.map +0 -1
  277. package/dist/Tooltip/QTip.types.js +0 -2
  278. package/dist/Tooltip/QTip.types.js.map +0 -1
  279. package/dist/Tooltip/QTipPerformance.stories.js +0 -30
  280. package/dist/Tooltip/QTipPerformance.stories.js.map +0 -1
  281. package/dist/Tooltip/Qtip.js +0 -170
  282. package/dist/Tooltip/Qtip.js.map +0 -1
  283. package/dist/Tooltip/Tooltip.js +0 -36
  284. package/dist/Tooltip/Tooltip.js.map +0 -1
  285. package/dist/Tooltip/Tooltip.stories.js +0 -32
  286. package/dist/Tooltip/Tooltip.stories.js.map +0 -1
  287. package/dist/Tooltip/Tooltip.types.js +0 -3
  288. package/dist/Tooltip/Tooltip.types.js.map +0 -1
  289. package/dist/Tooltip/TooltipPerformance.stories.js +0 -30
  290. package/dist/Tooltip/TooltipPerformance.stories.js.map +0 -1
  291. package/dist/Tooltip/index.js +0 -3
  292. package/dist/Tooltip/index.js.map +0 -1
  293. package/dist/Tooltip/qTip.utilities.js +0 -11
  294. package/dist/Tooltip/qTip.utilities.js.map +0 -1
  295. package/dist/types.js +0 -2
  296. package/dist/types.js.map +0 -1
  297. package/dist/utils/browserId.js +0 -29
  298. package/dist/utils/browserId.js.map +0 -1
  299. package/dist/utils/svg.js +0 -20
  300. package/dist/utils/svg.js.map +0 -1
  301. package/dist/utils/validateStyleDimension.js +0 -14
  302. package/dist/utils/validateStyleDimension.js.map +0 -1
  303. package/dist/utils/validateStyleDimension.test.js +0 -20
  304. package/dist/utils/validateStyleDimension.test.js.map +0 -1
@@ -1,70 +0,0 @@
1
- import React, { useEffect, useState } from 'react';
2
- import { motion } from 'framer-motion';
3
- import Button from '../Button/Button';
4
- /**
5
- * Carousel:
6
- * - Easily create a carousel with custom slides.
7
- * - Supports automatic sliding, navigation arrows, and slide indicators.
8
- */
9
- const Carousel = ({ testId = 'carousel-id', activeIndex = 0, extraClassNames = '', onSlide = () => { }, autoSlide, showIndicators = true, continuous = true, interval = 4000, prevIcon = 'fc-arrow-dropdown tw-rotate-90', nextIcon = 'fc-arrow-dropdown -tw-rotate-90', showArrows = true, iconExtraClassNames = '', carouselItems = [], }) => {
10
- const [currentIndex, setCurrentIndex] = useState(activeIndex);
11
- const changeSlide = (nextIndex) => {
12
- const newIndex = (nextIndex + carouselItems.length) % carouselItems.length;
13
- setCurrentIndex(newIndex);
14
- onSlide(newIndex, newIndex > currentIndex ? 'right' : 'left');
15
- };
16
- useEffect(() => {
17
- if (autoSlide) {
18
- const slideInterval = setInterval(() => {
19
- if (continuous || currentIndex < carouselItems.length - 1) {
20
- changeSlide(currentIndex + 1);
21
- }
22
- else {
23
- clearInterval(slideInterval);
24
- }
25
- }, interval);
26
- return () => clearInterval(slideInterval);
27
- }
28
- }, [autoSlide, currentIndex, continuous, interval, carouselItems.length]);
29
- useEffect(() => {
30
- if (activeIndex !== currentIndex) {
31
- setCurrentIndex(activeIndex);
32
- }
33
- }, [activeIndex]);
34
- const onBackClick = () => {
35
- if (currentIndex === 0 && !continuous) {
36
- return;
37
- }
38
- changeSlide(currentIndex - 1);
39
- };
40
- const onForwardClick = () => {
41
- if (currentIndex === carouselItems.length - 1 && !continuous) {
42
- return;
43
- }
44
- changeSlide(currentIndex + 1);
45
- };
46
- const slideVariants = {
47
- initial: (direction) => ({
48
- x: direction > 0 ? '100%' : '-100%',
49
- opacity: 0,
50
- }),
51
- animate: {
52
- x: 0,
53
- opacity: 1,
54
- transition: { type: 'spring', damping: 20, stiffness: 100 },
55
- },
56
- exit: (direction) => ({
57
- x: direction > 0 ? '-100%' : '100%',
58
- opacity: 0,
59
- transition: { type: 'spring', damping: 20, stiffness: 100 },
60
- }),
61
- };
62
- return (React.createElement("div", { "data-testid": testId, className: `tw-flex tw-flex-col tw-items-center tw-justify-center tw-w-full tw-overflow-hidden ${extraClassNames}` },
63
- React.createElement("div", { className: "tw-flex tw-items-center tw-w-full tw-h-max tw-gap-1" },
64
- showArrows && (React.createElement(Button, { icon: prevIcon, size: "lg", variant: "no-border", testId: "carousel-prev", extraClassNames: `${currentIndex === 0 && !continuous ? 'tw-invisible' : ''} ${iconExtraClassNames} tw-animate-fadeIn`, onClick: onBackClick })),
65
- React.createElement(motion.div, { key: currentIndex, custom: 1, initial: "initial", animate: "animate", exit: "exit", variants: slideVariants, className: "tw-w-full" }, carouselItems[currentIndex]),
66
- showArrows && (React.createElement(Button, { icon: nextIcon, testId: "carousel-next", size: "lg", variant: "no-border", extraClassNames: `${currentIndex === carouselItems.length - 1 && !continuous ? 'tw-invisible' : ''} ${iconExtraClassNames} tw-animate-fadeIn`, onClick: onForwardClick }))),
67
- showIndicators && (React.createElement("div", { className: "tw-flex tw-gap-1 tw-mt-2" }, carouselItems.map((_, i) => (React.createElement("div", { key: i, className: `tw-w-2 tw-h-2 tw-rounded-full tw-cursor-pointer ${i === currentIndex ? 'tw-bg-sq-color-dark' : 'tw-bg-sq-darkish-gray'}`, onClick: () => changeSlide(i) })))))));
68
- };
69
- export default Carousel;
70
- //# sourceMappingURL=Carousel.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Carousel.js","sourceRoot":"","sources":["../../src/Carousel/Carousel.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACnD,OAAO,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAEvC,OAAO,MAAM,MAAM,kBAAkB,CAAC;AAEtC;;;;GAIG;AACH,MAAM,QAAQ,GAA2C,CAAC,EACxD,MAAM,GAAG,aAAa,EACtB,WAAW,GAAG,CAAC,EACf,eAAe,GAAG,EAAE,EACpB,OAAO,GAAG,GAAG,EAAE,GAAE,CAAC,EAClB,SAAS,EACT,cAAc,GAAG,IAAI,EACrB,UAAU,GAAG,IAAI,EACjB,QAAQ,GAAG,IAAI,EACf,QAAQ,GAAG,gCAAgC,EAC3C,QAAQ,GAAG,iCAAiC,EAC5C,UAAU,GAAG,IAAI,EACjB,mBAAmB,GAAG,EAAE,EACxB,aAAa,GAAG,EAAE,GACnB,EAAE,EAAE;IACH,MAAM,CAAC,YAAY,EAAE,eAAe,CAAC,GAAG,QAAQ,CAAC,WAAW,CAAC,CAAC;IAE9D,MAAM,WAAW,GAAG,CAAC,SAAiB,EAAE,EAAE;QACxC,MAAM,QAAQ,GAAG,CAAC,SAAS,GAAG,aAAa,CAAC,MAAM,CAAC,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ACpB,aAAa,CAAC,YAAY,CAAC,CACjB;YAEZ,UAAU,IAAI,CACb,oBAAC,MAAM,IACL,IAAI,EAAE,QAAQ,EACd,MAAM,EAAC,eAAe,EACtB,IAAI,EAAC,IAAI,EACT,OAAO,EAAC,WAAW,EACnB,eAAe,EAAE,GACf,YAAY,KAAK,aAAa,CAAC,MAAM,GAAG,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,EAC9E,IAAI,mBAAmB,oBAAoB,EAC3C,OAAO,EAAE,cAAc,GACvB,CACH,CACG;QACL,cAAc,IAAI,CACjB,6BAAK,SAAS,EAAC,0BAA0B,IACtC,aAAa,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAC3B,6BACE,GAAG,EAAE,CAAC,EACN,SAAS,EAAE,mDACT,CAAC,KAAK,YAAY,CAAC,CAAC,CAAC,qBAAqB,CAAC,CAAC,CAAC,uBAC/C,EAAE,EACF,OAAO,EAAE,GAAG,EAAE,CAAC,WAAW,CAAC,CAAC,CAAC,GAC7B,CACH,CAAC,CACE,CACP,CACG,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,QAAQ,CAAC"}
@@ -1,115 +0,0 @@
1
- import React from 'react';
2
- import { QTip } from '../Tooltip/Qtip';
3
- import Carousel from './Carousel';
4
- import Button from '../Button';
5
- export default {
6
- title: 'Carousel',
7
- };
8
- export const AllCarousels = () => {
9
- const [value, setValue] = React.useState(0);
10
- const renderChild = (text, extraClass) => (React.createElement("div", { className: 'tw-p-4 tw-text-sq-color-gray dark:tw-text-sq-white tw-h-[200px] ' + extraClass },
11
- React.createElement("p", { className: "tw-mb-5 tw-text-[0.9375rem] tw-leading-normal" }, text),
12
- React.createElement(Button, { variant: "outline", label: "Save data" })));
13
- const renderAllVariations = () => (React.createElement(React.Fragment, null,
14
- React.createElement("div", { className: "light" },
15
- React.createElement("div", { className: "tw-p-4" },
16
- React.createElement("p", null, "Controlled"),
17
- React.createElement(Carousel, { carouselItems: [
18
- renderChild('First of her name, the Queen to be, long may she reign', 'tw-bg-yellow-500'),
19
- renderChild('Second of her home, but her love conquers all', 'tw-bg-green-500'),
20
- renderChild('Third is a wonder, the embodiment of hope and faith', 'tw-bg-gray-500'),
21
- ], activeIndex: value, onSlide: (index) => setValue(index) })),
22
- React.createElement("div", { className: "tw-p-4" },
23
- React.createElement("p", null, "Uncontrolled"),
24
- React.createElement(Carousel, { carouselItems: [
25
- renderChild('First of her name, the Queen to be, long may she reign', 'tw-bg-yellow-500'),
26
- renderChild('Second of her home, but her love conquers all', 'tw-bg-green-500'),
27
- renderChild('Third is a wonder, the embodiment of hope and faith', 'tw-bg-gray-500'),
28
- ], autoSlide: true, continuous: true, showArrows: false })),
29
- React.createElement("div", { className: "tw-p-4" },
30
- React.createElement("p", null, "Custom side buttons"),
31
- React.createElement(Carousel, { carouselItems: [
32
- renderChild('First of her name, the Queen to be, long may she reign', 'tw-bg-yellow-500'),
33
- renderChild('Second of her home, but her love conquers all', 'tw-bg-green-500'),
34
- renderChild('Third is a wonder, the embodiment of hope and faith', 'tw-bg-gray-500'),
35
- ], activeIndex: value, onSlide: (index) => setValue(index), nextIcon: "fc-more", prevIcon: "fc-y-axis" })),
36
- React.createElement("div", { className: "tw-p-4" },
37
- React.createElement("p", null, "Continuous"),
38
- React.createElement(Carousel, { carouselItems: [
39
- renderChild('First of her name, the Queen to be, long may she reign', 'tw-bg-yellow-500'),
40
- renderChild('Second of her home, but her love conquers all', 'tw-bg-green-500'),
41
- renderChild('Third is a wonder, the embodiment of hope and faith', 'tw-bg-gray-500'),
42
- ], activeIndex: value, onSlide: (index) => setValue(index), continuous: true })),
43
- React.createElement("div", { className: "tw-p-4" },
44
- React.createElement("p", null, "Non continuous"),
45
- React.createElement(Carousel, { carouselItems: [
46
- renderChild('First of her name, the Queen to be, long may she reign', 'tw-bg-yellow-500'),
47
- renderChild('Second of her home, but her love conquers all', 'tw-bg-green-500'),
48
- renderChild('Third is a wonder, the embodiment of hope and faith', 'tw-bg-gray-500'),
49
- ], activeIndex: value, onSlide: (index) => setValue(index), showArrows: true, continuous: false })),
50
- React.createElement("div", { className: "tw-p-4" },
51
- React.createElement("p", null, "Without indicators"),
52
- React.createElement(Carousel, { carouselItems: [
53
- renderChild('First of her name, the Queen to be, long may she reign', 'tw-bg-yellow-500'),
54
- renderChild('Second of her home, but her love conquers all', 'tw-bg-green-500'),
55
- renderChild('Third is a wonder, the embodiment of hope and faith', 'tw-bg-gray-500'),
56
- ], activeIndex: value, onSlide: (index) => setValue(index), showArrows: true, continuous: true, showIndicators: false }))),
57
- React.createElement("div", { className: "tw-dark tw-bg-sq-dark-background" },
58
- React.createElement("div", { className: "tw-p-4" },
59
- React.createElement("p", null, "Controlled"),
60
- React.createElement(Carousel, { carouselItems: [
61
- renderChild('First of her name, the Queen to be, long may she reign', 'tw-bg-yellow-500'),
62
- renderChild('Second of her home, but her love conquers all', 'tw-bg-green-500'),
63
- renderChild('Third is a wonder, the embodiment of hope and faith', 'tw-bg-gray-500'),
64
- ], activeIndex: value, onSlide: (index) => setValue(index) })),
65
- React.createElement("div", { className: "tw-p-4" },
66
- React.createElement("p", null, "Uncontrolled"),
67
- React.createElement(Carousel, { carouselItems: [
68
- renderChild('First of her name, the Queen to be, long may she reign', 'tw-bg-yellow-500'),
69
- renderChild('Second of her home, but her love conquers all', 'tw-bg-green-500'),
70
- renderChild('Third is a wonder, the embodiment of hope and faith', 'tw-bg-gray-500'),
71
- ], autoSlide: true, continuous: true, showArrows: false })),
72
- React.createElement("div", { className: "tw-p-4" },
73
- React.createElement("p", null, "Custom side buttons"),
74
- React.createElement(Carousel, { carouselItems: [
75
- renderChild('First of her name, the Queen to be, long may she reign', 'tw-bg-yellow-500'),
76
- renderChild('Second of her home, but her love conquers all', 'tw-bg-green-500'),
77
- renderChild('Third is a wonder, the embodiment of hope and faith', 'tw-bg-gray-500'),
78
- ], activeIndex: value, onSlide: (index) => setValue(index), nextIcon: "fc-more", prevIcon: "fc-y-axis" })),
79
- React.createElement("div", { className: "tw-p-4" },
80
- React.createElement("p", null, "Continuous"),
81
- React.createElement(Carousel, { carouselItems: [
82
- renderChild('First of her name, the Queen to be, long may she reign', 'tw-bg-yellow-500'),
83
- renderChild('Second of her home, but her love conquers all', 'tw-bg-green-500'),
84
- renderChild('Third is a wonder, the embodiment of hope and faith', 'tw-bg-gray-500'),
85
- ], activeIndex: value, onSlide: (index) => setValue(index), continuous: true })),
86
- React.createElement("div", { className: "tw-p-4" },
87
- React.createElement("p", null, "Non continuous"),
88
- React.createElement(Carousel, { carouselItems: [
89
- renderChild('First of her name, the Queen to be, long may she reign', 'tw-bg-yellow-500'),
90
- renderChild('Second of her home, but her love conquers all', 'tw-bg-green-500'),
91
- renderChild('Third is a wonder, the embodiment of hope and faith', 'tw-bg-gray-500'),
92
- ], activeIndex: value, onSlide: (index) => setValue(index), showArrows: true, continuous: false })),
93
- React.createElement("div", { className: "tw-p-4" },
94
- React.createElement("p", null, "Without indicators"),
95
- React.createElement(Carousel, { carouselItems: [
96
- renderChild('First of her name, the Queen to be, long may she reign', 'tw-bg-yellow-500'),
97
- renderChild('Second of her home, but her love conquers all', 'tw-bg-green-500'),
98
- renderChild('Third is a wonder, the embodiment of hope and faith', 'tw-bg-gray-500'),
99
- ], activeIndex: value, onSlide: (index) => setValue(index), showArrows: true, continuous: true, showIndicators: false })))));
100
- return (React.createElement("div", { className: "tw-grid tw-grid-cols-4 tw-gap-4" },
101
- React.createElement(QTip, null),
102
- React.createElement("div", { className: "color_topic" },
103
- React.createElement("b", null, "Topic Colors"),
104
- renderAllVariations()),
105
- React.createElement("div", { className: "color_analysis" },
106
- React.createElement("b", null, "Analysis Colors"),
107
- renderAllVariations()),
108
- React.createElement("div", { className: "color_datalab" },
109
- React.createElement("b", null, "Datalab Colors"),
110
- renderAllVariations()),
111
- React.createElement("div", { className: "color_vantage" },
112
- React.createElement("b", null, "Vantage Colors"),
113
- renderAllVariations())));
114
- };
115
- //# sourceMappingURL=Carousel.stories.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Carousel.stories.js","sourceRoot":"","sources":["../../src/Carousel/Carousel.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AACvC,OAAO,QAAQ,MAAM,YAAY,CAAC;AAClC,OAAO,MAAM,MAAM,WAAW,CAAC;AAE/B,eAAe;IACb,KAAK,EAAE,UAAU;CAClB,CAAC;AAEF,MAAM,CAAC,MAAM,YAAY,GAAG,GAAG,EAAE;IAC/B,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;IAE5C,MAAM,WAAW,GAAG,CAAC,IAAY,EAAE,UAAkB,EAAE,EAAE,CAAC,CACxD,6BAAK,SAAS,EAAE,kEAAkE,GAAG,UAAU;QAC7F,2BAAG,SAAS,EAAC,+CAA+C,IAAE,IAAI,CAAK;QACvE,oBAAC,MAAM,IAAC,OAAO,EAAC,SAAS,EAAC,KAAK,EAAC,WAAW,GAAG,CAC1C,CACP,CAAC;IAEF,MAAM,mBAAmB,GAAG,GAAG,EAAE,CAAC,CAChC;QACE,6BAAK,SAAS,EAAC,OAAO;YACpB,6BAAK,SAAS,EAAC,QAAQ;gBACrB,4CAAiB;gBACjB,oBAAC,QAAQ,IACP,aAAa,EAAE;wBACb,WAAW,CAAC,wDAAwD,EAAE,kBAAkB,CAAC;wBACzF,WAAW,CAAC,+CAA+C,EAAE,iBAAiB,CAAC;wBAC/E,WAAW,CAAC,qDAAqD,EAAE,gBAAgB,CAAC;qBACrF,EACD,WAAW,EAAE,KAAK,EAClB,OAAO,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,QAAQ,CAAC,KAAK,CAAC,GACnC,CACE;YACN,6BAAK,SAAS,EAAC,QAAQ;gBACrB,8CAAmB;gBACnB,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DAAwD,EAAE,kBAAkB,CAAC;wBACzF,WAAW,CAAC,+CAA+C,EAAE,iBAAiB,CAAC;wBAC/E,WAAW,CAAC,qDAAqD,EAAE,gBAAgB,CAAC;qBACrF,EACD,WAAW,EAAE,KAAK,EAClB,OAAO,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,QAAQ,CAAC,KAAK,CAAC,EACnC,UAAU,QACV,UAAU,QACV,cAAc,EAAE,KAAK,GACrB,CACE,CACF,CACL,CACJ,CAAC;IACF,OAAO,CACL,6BAAK,SAAS,EAAC,iCAAiC;QAC9C,oBAAC,IAAI,OAAG;QACR,6BAAK,SAAS,EAAC,aAAa;YAC1B,8CAAmB;YAClB,mBAAmB,EAAE,CAClB;QAEN,6BAAK,SAAS,EAAC,gBAAgB;YAC7B,iDAAsB;YACrB,mBAAmB,EAAE,CAClB;QAEN,6BAAK,SAAS,EAAC,eAAe;YAC5B,gDAAqB;YACpB,mBAAmB,EAAE,CAClB;QAEN,6BAAK,SAAS,EAAC,eAAe;YAC5B,gDAAqB;YACpB,mBAAmB,EAAE,CAClB,CACF,CACP,CAAC;AACJ,CAAC,CAAC"}
@@ -1,48 +0,0 @@
1
- import React from 'react';
2
- import '@testing-library/jest-dom';
3
- import { act, render, fireEvent, screen } from '@testing-library/react';
4
- import Carousel from './Carousel';
5
- describe('Carousel Component', () => {
6
- const mockOnSlide = jest.fn();
7
- const carouselItems = [React.createElement("div", { key: "1" }, "Slide 1"), React.createElement("div", { key: "2" }, "Slide 2"), React.createElement("div", { key: "3" }, "Slide 3")];
8
- it('renders correctly', () => {
9
- render(React.createElement(Carousel, { testId: "carousel", carouselItems: carouselItems }));
10
- expect(screen.getByTestId('carousel')).toBeInTheDocument();
11
- });
12
- it('shows the correct initial slide', () => {
13
- render(React.createElement(Carousel, { testId: "carousel", carouselItems: carouselItems, activeIndex: 1 }));
14
- expect(screen.getByText('Slide 2')).toBeInTheDocument();
15
- });
16
- it('calls onSlide when next button is clicked', () => {
17
- render(React.createElement(Carousel, { testId: "carousel", carouselItems: carouselItems, onSlide: mockOnSlide }));
18
- const nextButton = screen.getByTestId('carousel-next');
19
- fireEvent.click(nextButton);
20
- expect(mockOnSlide).toHaveBeenCalledWith(1, 'right');
21
- });
22
- it('calls onSlide when previous button is clicked', () => {
23
- render(React.createElement(Carousel, { testId: "carousel", carouselItems: carouselItems, onSlide: mockOnSlide, activeIndex: 1 }));
24
- const prevButton = screen.getByTestId('carousel-prev');
25
- fireEvent.click(prevButton);
26
- expect(mockOnSlide).toHaveBeenCalledWith(0, 'left');
27
- });
28
- it('does not move past the last slide', () => {
29
- render(React.createElement(Carousel, { testId: "carousel", carouselItems: carouselItems, activeIndex: 2, continuous: false }));
30
- const nextButton = screen.queryByTestId('carousel-next');
31
- expect(nextButton).toHaveClass('tw-invisible');
32
- });
33
- it('autoSlides correctly', async () => {
34
- jest.useFakeTimers();
35
- render(React.createElement(Carousel, { testId: "carousel", carouselItems: carouselItems, autoSlide: true, interval: 1000 }));
36
- expect(screen.getByText('Slide 1')).toBeInTheDocument();
37
- act(() => {
38
- jest.advanceTimersByTime(1000);
39
- });
40
- expect(screen.getByText('Slide 2')).toBeInTheDocument();
41
- act(() => {
42
- jest.advanceTimersByTime(1000);
43
- });
44
- expect(screen.getByText('Slide 3')).toBeInTheDocument();
45
- jest.useRealTimers();
46
- });
47
- });
48
- //# sourceMappingURL=Carousel.test.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Carousel.test.js","sourceRoot":"","sources":["../../src/Carousel/Carousel.test.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,2BAA2B,CAAC;AACnC,OAAO,EAAE,GAAG,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AACxE,OAAO,QAAQ,MAAM,YAAY,CAAC;AAElC,QAAQ,CAAC,oBAAoB,EAAE,GAAG,EAAE;IAClC,MAAM,WAAW,GAAG,IAAI,CAAC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AAM,CAAC,MAAM,CAAC,SAAS,CAAC,SAAS,CAAC,CAAC,CAAC,iBAAiB,EAAE,CAAC;QAExD,IAAI,CAAC,aAAa,EAAE,CAAC;IACvB,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=Carousel.types.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Carousel.types.js","sourceRoot":"","sources":["../../src/Carousel/Carousel.types.ts"],"names":[],"mappings":""}
@@ -1,2 +0,0 @@
1
- export { default } from './Carousel';
2
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/Carousel/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC"}
@@ -1,26 +0,0 @@
1
- import React from 'react';
2
- import '../styles.css';
3
- import { getQTipData } from '../Tooltip/qTip.utilities';
4
- const alignment = 'tw-flex';
5
- const labelClasses = 'tw-ml-1.5 tw-text-sm tw--mt-0.5';
6
- const baseClasses = 'tw-border-1 tw-h-3.5 tw-w-3.5 focus:tw-ring-0 focus:tw-ring-offset-0 tw-outline-none focus:tw-outline-none' +
7
- ' dark:tw-bg-sq-dark-background dark:tw-border-sq-dark-text dark:hover:tw-bg-sq-dark-background' +
8
- ' checked:tw-text-white checked:tw-border-sq-text-color checked:hover:tw-border-sq-color-dark' +
9
- ' checked:active:tw-border-sq-color-dark checked:focus:tw-border-sq-color-dark disabled:tw-border-sq-disabled-gray' +
10
- ' dark:disabled:tw-border-sq-fairly-dark-gray dark:checked:focus:tw-bg-sq-dark-background';
11
- const checkboxClasses = `tw-form-checkbox tw-rounded ${baseClasses}`;
12
- const radioClasses = `tw-form-radio ${baseClasses}`;
13
- /**
14
- * Checkbox and Radio Box Component.
15
- */
16
- export const Checkbox = (props) => {
17
- const { type = 'checkbox', value, disabled = false, label, onChange, onClick, onKeyDown, checked, defaultChecked, id, name, extraClassNames, extraLabelClassNames, testId, ...tooltipProps } = props;
18
- const assignedId = id ?? 'checkbox_' + Math.random();
19
- const tooltipData = getQTipData(tooltipProps);
20
- return (React.createElement("span", { className: `${alignment} ${extraClassNames}` },
21
- React.createElement("input", { value: value, type: type, "data-testid": testId, name: name, id: assignedId, readOnly: !onChange, checked: checked, defaultChecked: defaultChecked, className: `${type === 'checkbox' ? checkboxClasses : radioClasses} ${disabled ? 'tw-cursor-not-allowed' : 'tw-cursor-pointer'}`, disabled: disabled, onClick: onClick, onChange: onChange, onKeyDown: onKeyDown, ...tooltipData }),
22
- React.createElement("label", { htmlFor: assignedId, className: `${labelClasses} ${extraLabelClassNames} ${disabled
23
- ? 'tw-cursor-not-allowed dark:tw-text-sq-fairly-dark-gray tw-text-sq-fairly-dark-gray'
24
- : 'tw-cursor-pointer tw-text-sq-text-color dark:tw-text-sq-dark-text'}` }, label)));
25
- };
26
- //# sourceMappingURL=Checkbox.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Checkbox.js","sourceRoot":"","sources":["../../src/Checkbox/Checkbox.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,eAAe,CAAC;AACvB,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAExD,MAAM,SAAS,GAAG,SAAS,CAAC;AAC5B,MAAM,YAAY,GAAG,iCAAiC,CAAC;AAEvD,MAAM,WAAW,GACf,4GAA4G;IAC5G,iGAAiG;IACjG,8FAA8F;IAC9F,mHAAmH;IACnH,0FAA0F,CAAC;AAE7F,MAAM,eAAe,GAAG,+BAA+B,WAAW,EAAE,CAAC;AAErE,MAAM,YAAY,GAAG,iBAAiB,WAAW,EAAE,CAAC;AAEpD;;GAEG;AACH,MAAM,CAAC,MAAM,QAAQ,GAA2C,CAAC,KAAK,EAAE,EAAE;IACxE,MAAM,EACJ,IAAI,GAAG,UAAU,EACjB,KAAK,EACL,QAAQ,GAAG,KAAK,EAChB,KAAK,EACL,QAAQ,EACR,OAAO,EACP,SAAS,EACT,OAAO,EACP,cAAc,EACd,EAAE,EACF,IAAI,EACJ,eAAe,EACf,oBAAoB,EACpB,MAAM,EACN,GAAG,YAAY,EAChB,GAAG,KAAK,CAAC;IAEV,MAAM,UAAU,GAAG,EAAE,IAAI,WAAW,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC;IACrD,MAAM,WAAW,GAAG,WAAW,CAAC,YAAY,CAAC,CAAC;IAE9C,OAAO,CACL,8BAAM,SAAS,EAAE,GAAG,SAAS,IAAI,eAAe,EAAE;QAChD,+BACE,KAAK,EAAE,KAAK,EACZ,IAAI,EAAE,IAAI,iBACG,MAAM,EACnB,IAAI,EAAE,IAAI,EACV,EAAE,EAAE,UAAU,EACd,QAAQ,EAAE,CAAC,QAAQ,EACnB,OAAO,EAAE,OAAO,EAChB,cAAc,EAAE,cAAc,EAC9B,SAAS,EAAE,GAAG,IAAI,KAAK,UAAU,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,YAAY,IAChE,QAAQ,CAAC,CAAC,CAAC,uBAAuB,CAAC,CAAC,CAAC,mBACvC,EAAE,EACF,QAAQ,EAAE,QAAQ,EAClB,OAAO,EAAE,OAAO,EAChB,QAAQ,EAAE,QAAQ,EAClB,SAAS,EAAE,SAAS,KAChB,WAAW,GACf;QACF,+BACE,OAAO,EAAE,UAAU,EACnB,SAAS,EAAE,GAAG,YAAY,IAAI,oBAAoB,IAChD,QAAQ;gBACN,CAAC,CAAC,oFAAoF;gBACtF,CAAC,CAAC,mEACN,EAAE,IACD,KAAK,CACA,CACH,CACR,CAAC;AACJ,CAAC,CAAC"}
@@ -1,34 +0,0 @@
1
- import React from 'react';
2
- import { Checkbox } from './Checkbox';
3
- import { QTip } from '../Tooltip';
4
- export default {
5
- title: 'Checkbox',
6
- };
7
- export const AllCheckboxes = () => {
8
- const getDisplay = (type) => (React.createElement(React.Fragment, null,
9
- React.createElement(QTip, null),
10
- React.createElement("div", { className: "tw-p-4" },
11
- React.createElement(Checkbox, { value: "a", type: type, checked: true, label: 'with Label', tooltip: "Checkbox Tooltip" })),
12
- React.createElement("div", { className: "tw-p-4" },
13
- React.createElement(Checkbox, { value: "d", type: type, checked: false, disabled: true, label: React.createElement("div", null,
14
- "Disabled",
15
- React.createElement("br", null),
16
- "multi-Line"), tooltip: "Checkbox Tooltip" })),
17
- React.createElement("div", { className: "tw-p-4" },
18
- React.createElement(Checkbox, { value: "d", type: type, checked: true, disabled: true, label: "Disabled", tooltip: "Checkbox Tooltip" })),
19
- React.createElement("div", { className: "tw-p-4" },
20
- React.createElement(Checkbox, { value: "b", type: type, checked: true, tooltip: "Checkbox Tooltip" })),
21
- React.createElement("div", { className: "tw-p-4" },
22
- React.createElement(Checkbox, { value: "c", type: type, checked: false, tooltip: "Checkbox Tooltip" }))));
23
- const renderAllVariations = (type) => (React.createElement(React.Fragment, null,
24
- React.createElement("div", { className: "tw-p-4 light" }, getDisplay(type)),
25
- React.createElement("div", { className: "tw-p-4 tw-dark tw-bg-sq-dark-background" }, getDisplay(type))));
26
- return (React.createElement("div", { className: "tw-grid tw-grid-cols-2 tw-gap-4" },
27
- React.createElement("div", null,
28
- React.createElement("b", null, "Checkbox"),
29
- renderAllVariations('checkbox')),
30
- React.createElement("div", null,
31
- React.createElement("b", null, "Radios"),
32
- renderAllVariations('radio'))));
33
- };
34
- //# sourceMappingURL=Checkbox.stories.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Checkbox.stories.js","sourceRoot":"","sources":["../../src/Checkbox/Checkbox.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAElC,eAAe;IACb,KAAK,EAAE,UAAU;CAClB,CAAC;AAEF,MAAM,CAAC,MAAM,aAAa,GAAG,GAAG,EAAE;IAChC,MA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CAAO,CAChF,CACJ,CAAC;IAEF,OAAO,CACL,6BAAK,SAAS,EAAC,iCAAiC;QAC9C;YACE,0CAAe;YACd,mBAAmB,CAAC,UAAU,CAAC,CAC5B;QAEN;YACE,wCAAa;YACZ,mBAAmB,CAAC,OAAO,CAAC,CACzB,CACF,CACP,CAAC;AACJ,CAAC,CAAC"}
@@ -1,94 +0,0 @@
1
- import React from 'react';
2
- import '@testing-library/jest-dom';
3
- import { render, screen } from '@testing-library/react';
4
- import { Checkbox } from './Checkbox';
5
- import userEvent from '@testing-library/user-event';
6
- describe('Checkbox', () => {
7
- class Context {
8
- testId = 'checkboxTestId';
9
- props = {
10
- onChange: jest.fn(),
11
- checked: false,
12
- testId: this.testId,
13
- };
14
- }
15
- let tc;
16
- beforeEach(() => {
17
- tc = new Context();
18
- });
19
- const renderCheckbox = (props) => render(React.createElement(Checkbox, { ...props }));
20
- it('renders checkbox', () => {
21
- renderCheckbox(tc.props);
22
- expect(screen.getByTestId(tc.testId)).toBeInTheDocument();
23
- });
24
- it('renders radio', () => {
25
- renderCheckbox({ ...tc.props, type: 'radio' });
26
- expect(screen.getByTestId(tc.testId)).toHaveProperty('type', 'radio');
27
- });
28
- it('renders label', () => {
29
- const label = 'look at this checkbox!';
30
- renderCheckbox({ ...tc.props, label });
31
- expect(screen.getByText(label)).toBeInTheDocument();
32
- });
33
- it('respects checked', () => {
34
- renderCheckbox({ ...tc.props, checked: true });
35
- expect(screen.getByTestId(tc.testId)).toBeChecked();
36
- });
37
- it('calls onChange handler', async () => {
38
- const onChange = jest.fn();
39
- renderCheckbox({ ...tc.props, onChange });
40
- await userEvent.click(screen.getByTestId(tc.testId));
41
- expect(onChange).toHaveBeenCalled();
42
- });
43
- it('calls onKeyDown handler', async () => {
44
- const onKeyDown = jest.fn();
45
- renderCheckbox({ ...tc.props, onKeyDown });
46
- await userEvent.type(screen.getByTestId(tc.testId), 'a');
47
- expect(onKeyDown).toHaveBeenCalled();
48
- });
49
- it('calls onClickHandler handler', async () => {
50
- const onClick = jest.fn();
51
- renderCheckbox({ ...tc.props, onClick });
52
- await userEvent.click(screen.getByTestId(tc.testId));
53
- expect(onClick).toHaveBeenCalled();
54
- });
55
- it('respects disabled', () => {
56
- renderCheckbox({ ...tc.props, disabled: true });
57
- expect(screen.getByTestId(tc.testId)).not.toBeEnabled();
58
- });
59
- it('renders label clickable', async () => {
60
- const label = 'amazing checkbox';
61
- const onClick = jest.fn();
62
- renderCheckbox({ ...tc.props, label, onClick });
63
- expect(screen.getByTestId(tc.testId)).not.toBeChecked();
64
- await userEvent.click(screen.getByText(label));
65
- expect(onClick).toHaveBeenCalled();
66
- });
67
- it('respects id', () => {
68
- const id = 'checkboxId';
69
- renderCheckbox({ ...tc.props, id });
70
- expect(screen.getByTestId(tc.testId)).toHaveProperty('id', id);
71
- });
72
- it('respects name', () => {
73
- const name = 'checkboxName';
74
- renderCheckbox({ ...tc.props, name });
75
- expect(screen.getByTestId(tc.testId)).toHaveProperty('name', name);
76
- });
77
- it('respects name', () => {
78
- const value = 'priceless';
79
- renderCheckbox({ ...tc.props, value });
80
- expect(screen.getByTestId(tc.testId)).toHaveProperty('value', value);
81
- });
82
- it('applies extraClassNames', () => {
83
- const extraClassNames = 'extra styling so fancy';
84
- renderCheckbox({ ...tc.props, extraClassNames });
85
- expect(screen.getByTestId(tc.testId).parentNode).toHaveClass(extraClassNames);
86
- });
87
- it('applies extraLabelClassNames', () => {
88
- const extraLabelClassNames = 'special label';
89
- const label = 'amazing checkbox';
90
- renderCheckbox({ ...tc.props, extraLabelClassNames, label });
91
- expect(screen.getByText(label)).toHaveClass(extraLabelClassNames);
92
- });
93
- });
94
- //# sourceMappingURL=Checkbox.test.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Checkbox.test.js","sourceRoot":"","sources":["../../src/Checkbox/Checkbox.test.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,2BAA2B,CAAC;AACnC,OAAO,E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AC;QAC7D,MAAM,CAAC,MAAM,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,CAAC,WAAW,CAAC,oBAAoB,CAAC,CAAC;IACpE,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=Checkbox.types.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Checkbox.types.js","sourceRoot":"","sources":["../../src/Checkbox/Checkbox.types.ts"],"names":[],"mappings":""}
@@ -1,2 +0,0 @@
1
- export { Checkbox as default } from './Checkbox';
2
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/Checkbox/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,IAAI,OAAO,EAAE,MAAM,YAAY,CAAC"}
@@ -1,15 +0,0 @@
1
- import React, { useRef, useEffect, useState } from 'react';
2
- import { motion, AnimatePresence } from 'framer-motion';
3
- const Collapse = ({ isVisible, children }) => {
4
- const contentRef = useRef(null);
5
- const [contentHeight, setContentHeight] = useState(0);
6
- useEffect(() => {
7
- if (contentRef.current) {
8
- setContentHeight(contentRef.current.scrollHeight);
9
- }
10
- }, [children]);
11
- return (React.createElement(AnimatePresence, { initial: false }, isVisible && (React.createElement(motion.div, { initial: { height: 0, opacity: 0 }, animate: { height: contentHeight, opacity: 1 }, exit: { height: 0, opacity: 0 }, transition: { type: 'spring', damping: 20, stiffness: 100 }, style: { overflow: 'hidden' } },
12
- React.createElement("div", { ref: contentRef }, children)))));
13
- };
14
- export default Collapse;
15
- //# sourceMappingURL=Collapse.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Collapse.js","sourceRoot":"","sources":["../../src/Collapse/Collapse.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,MAAM,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC3D,OAAO,EAAE,MAAM,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAGxD,MAAM,QAAQ,GAA2C,CAAC,EAAE,SAAS,EAAE,QAAQ,EAAE,EAAE,EAAE;IACnF,MAAM,UAAU,GAAG,MAAM,CAAiB,IAAI,CAAC,CAAC;IAChD,MAAM,CAAC,aAAa,EAAE,gBAAgB,CAAC,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAC;IAEtD,SAAS,CAAC,GAAG,EAAE;QACb,IAAI,UAAU,CAAC,OAAO,EAAE;YACtB,gBAAgB,CAAC,UAAU,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC;SACnD;IACH,CAAC,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC;IAEf,OAAO,CACL,oBAAC,eAAe,IAAC,OAAO,EAAE,KAAK,IAC5B,SAAS,IAAI,CACZ,oBAAC,MAAM,CAAC,GAAG,IACT,OAAO,EAAE,EAAE,MAAM,EAAE,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,EAClC,OAAO,EAAE,EAAE,MAAM,EAAE,aAAa,EAAE,OAAO,EAAE,CAAC,EAAE,EAC9C,IAAI,EAAE,EAAE,MAAM,EAAE,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,EAC/B,UAAU,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,EAAE,EAAE,SAAS,EAAE,GAAG,EAAE,EAC3D,KAAK,EAAE,EAAE,QAAQ,EAAE,QAAQ,EAAE;QAC7B,6BAAK,GAAG,EAAE,UAAU,IAAG,QAAQ,CAAO,CAC3B,CACd,CACe,CACnB,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,QAAQ,CAAC"}
@@ -1,37 +0,0 @@
1
- import React from 'react';
2
- import Collapse from './Collapse';
3
- import { QTip } from '../Tooltip';
4
- import Button from '../Button';
5
- export default {
6
- title: 'Collapse',
7
- };
8
- export const AllCollapses = () => {
9
- const [isVisible, setIsVisible] = React.useState(true);
10
- const renderChild = () => (React.createElement("div", { className: "tw-text-sq-color-gray dark:tw-text-sq-white" },
11
- React.createElement("p", { className: "tw-mb-5 tw-text-[0.9375rem] tw-leading-normal" }, "This is a content to be shown when the collapse is visible. Click the button above to toggle it"),
12
- React.createElement(Button, { variant: "outline", label: "Save data" })));
13
- const renderAllVariations = () => (React.createElement(React.Fragment, null,
14
- React.createElement("div", { className: "tw-p-4 light" },
15
- React.createElement("div", { className: "tw-p-4" },
16
- React.createElement(Button, { variant: "theme", label: "Toggle Collapse", onClick: () => setIsVisible(!isVisible) }),
17
- React.createElement(Collapse, { isVisible: isVisible }, renderChild()))),
18
- React.createElement("div", { className: "tw-p-4 tw-dark tw-bg-sq-dark-background" },
19
- React.createElement("div", { className: "tw-p-4" },
20
- React.createElement(Button, { variant: "theme", label: "Toggle Collapse", onClick: () => setIsVisible(!isVisible) }),
21
- React.createElement(Collapse, { isVisible: isVisible }, renderChild())))));
22
- return (React.createElement("div", { className: "tw-grid tw-grid-cols-4 tw-gap-4" },
23
- React.createElement(QTip, null),
24
- React.createElement("div", { className: "color_topic" },
25
- React.createElement("b", null, "Topic Colors"),
26
- renderAllVariations()),
27
- React.createElement("div", { className: "color_analysis" },
28
- React.createElement("b", null, "Analysis Colors"),
29
- renderAllVariations()),
30
- React.createElement("div", { className: "color_datalab" },
31
- React.createElement("b", null, "Datalab Colors"),
32
- renderAllVariations()),
33
- React.createElement("div", { className: "color_vantage" },
34
- React.createElement("b", null, "Vantage Colors"),
35
- renderAllVariations())));
36
- };
37
- //# sourceMappingURL=Collapse.stories.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Collapse.stories.js","sourceRoot":"","sources":["../../src/Collapse/Collapse.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,QAAQ,MAAM,YAAY,CAAC;AAClC,OAAO,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAClC,OAAO,MAAM,MAAM,WAAW,CAAC;AAE/B,eAAe;IACb,KAAK,EAAE,UAAU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N,6BAAK,SAAS,EAAC,eAAe;YAC5B,gDAAqB;YACpB,mBAAmB,EAAE,CAClB;QAEN,6BAAK,SAAS,EAAC,eAAe;YAC5B,gDAAqB;YACpB,mBAAmB,EAAE,CAClB,CACF,CACP,CAAC;AACJ,CAAC,CAAC"}
@@ -1,19 +0,0 @@
1
- import React from 'react';
2
- import { render, screen, waitFor } from '@testing-library/react';
3
- import '@testing-library/jest-dom';
4
- import Collapse from './Collapse';
5
- describe('Collapse component', () => {
6
- test('renders children when visible', async () => {
7
- render(React.createElement(Collapse, { isVisible: true },
8
- React.createElement("div", { "data-testid": "content" }, "Content")));
9
- await waitFor(() => {
10
- expect(screen.getByTestId('content')).toBeVisible();
11
- });
12
- });
13
- test('does not render children when not visible', async () => {
14
- render(React.createElement(Collapse, { isVisible: false },
15
- React.createElement("div", { "data-testid": "content" }, "Content")));
16
- expect(screen.queryByTestId('content')).not.toBeInTheDocument();
17
- });
18
- });
19
- //# sourceMappingURL=Collapse.test.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Collapse.test.js","sourceRoot":"","sources":["../../src/Collapse/Collapse.test.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AACjE,OAAO,2BAA2B,CAAC;AACnC,OAAO,QAAQ,MAAM,YAAY,CAAC;AAElC,QAAQ,CAAC,oBAAoB,EAAE,GAAG,EAAE;IAClC,IAAI,CAAC,+BAA+B,EAAE,KAAK,IAAI,EAAE;QAC/C,MAAM,CACJ,oBAAC,QAAQ,IAAC,SAAS,EAAE,IAAI;YACvB,4CAAiB,SAAS,cAAc,CAC/B,CACZ,CAAC;QACF,MAAM,OAAO,CAAC,GAAG,EAAE;YACjB,MAAM,CAAC,MAAM,CAAC,WAAW,CAAC,SAAS,CAAC,CAAC,CAAC,WAAW,EAAE,CAAC;QACtD,CAAC,CAAC,CAAA;IACJ,CAAC,CAAC,CAAC;IAEH,IAAI,CAAC,2CAA2C,EAAE,KAAK,IAAI,EAAE;QAC3D,MAAM,CACJ,oBAAC,QAAQ,IAAC,SAAS,EAAE,KAAK;YACxB,4CAAiB,SAAS,cAAc,CAC/B,CACZ,CAAC;QAEF,MAAM,CAAC,MAAM,CAAC,aAAa,CAAC,SAAS,CAAC,CAAC,CAAC,GAAG,CAAC,iBAAiB,EAAE,CAAC;IAClE,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=Collapse.types.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Collapse.types.js","sourceRoot":"","sources":["../../src/Collapse/Collapse.types.ts"],"names":[],"mappings":""}
@@ -1,2 +0,0 @@
1
- export { default } from './Collapse';
2
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/Collapse/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC"}