@seeqdev/qomponents 0.0.129 → 0.0.130

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 (238) hide show
  1. package/dist/index.esm.js +3 -3
  2. package/dist/index.esm.js.map +1 -1
  3. package/dist/index.js +3 -3
  4. package/dist/index.js.map +1 -1
  5. package/dist/styles.css +4 -5
  6. package/package.json +1 -1
  7. package/dist/Accordion/Accordion.js +0 -9
  8. package/dist/Accordion/Accordion.js.map +0 -1
  9. package/dist/Accordion/Accordion.stories.js +0 -115
  10. package/dist/Accordion/Accordion.stories.js.map +0 -1
  11. package/dist/Accordion/Accordion.test.js +0 -55
  12. package/dist/Accordion/Accordion.test.js.map +0 -1
  13. package/dist/Accordion/Accordion.types.js +0 -2
  14. package/dist/Accordion/Accordion.types.js.map +0 -1
  15. package/dist/Accordion/index.js +0 -2
  16. package/dist/Accordion/index.js.map +0 -1
  17. package/dist/Alert/Alert.js +0 -34
  18. package/dist/Alert/Alert.js.map +0 -1
  19. package/dist/Alert/Alert.stories.js +0 -52
  20. package/dist/Alert/Alert.stories.js.map +0 -1
  21. package/dist/Alert/Alert.test.js +0 -51
  22. package/dist/Alert/Alert.test.js.map +0 -1
  23. package/dist/Alert/Alert.types.js +0 -2
  24. package/dist/Alert/Alert.types.js.map +0 -1
  25. package/dist/Alert/index.js +0 -2
  26. package/dist/Alert/index.js.map +0 -1
  27. package/dist/Button/Button.js +0 -92
  28. package/dist/Button/Button.js.map +0 -1
  29. package/dist/Button/Button.stories.js +0 -100
  30. package/dist/Button/Button.stories.js.map +0 -1
  31. package/dist/Button/Button.test.js +0 -49
  32. package/dist/Button/Button.test.js.map +0 -1
  33. package/dist/Button/Button.types.js +0 -5
  34. package/dist/Button/Button.types.js.map +0 -1
  35. package/dist/Button/index.js +0 -2
  36. package/dist/Button/index.js.map +0 -1
  37. package/dist/ButtonGroup/ButtonGroup.js +0 -33
  38. package/dist/ButtonGroup/ButtonGroup.js.map +0 -1
  39. package/dist/ButtonGroup/ButtonGroup.stories.js +0 -385
  40. package/dist/ButtonGroup/ButtonGroup.stories.js.map +0 -1
  41. package/dist/ButtonGroup/ButtonGroup.test.js +0 -67
  42. package/dist/ButtonGroup/ButtonGroup.test.js.map +0 -1
  43. package/dist/ButtonGroup/ButtonGroup.types.js +0 -2
  44. package/dist/ButtonGroup/ButtonGroup.types.js.map +0 -1
  45. package/dist/ButtonGroup/index.js +0 -2
  46. package/dist/ButtonGroup/index.js.map +0 -1
  47. package/dist/ButtonWithDropdown/ButtonWithDropdown.js +0 -60
  48. package/dist/ButtonWithDropdown/ButtonWithDropdown.js.map +0 -1
  49. package/dist/ButtonWithDropdown/ButtonWithDropdown.stories.js +0 -143
  50. package/dist/ButtonWithDropdown/ButtonWithDropdown.stories.js.map +0 -1
  51. package/dist/ButtonWithDropdown/ButtonWithDropdown.test.js +0 -93
  52. package/dist/ButtonWithDropdown/ButtonWithDropdown.test.js.map +0 -1
  53. package/dist/ButtonWithDropdown/ButtonWithDropdown.types.js +0 -2
  54. package/dist/ButtonWithDropdown/ButtonWithDropdown.types.js.map +0 -1
  55. package/dist/ButtonWithDropdown/index.js +0 -2
  56. package/dist/ButtonWithDropdown/index.js.map +0 -1
  57. package/dist/ButtonWithPopover/ButtonWithPopover.js +0 -53
  58. package/dist/ButtonWithPopover/ButtonWithPopover.js.map +0 -1
  59. package/dist/ButtonWithPopover/ButtonWithPopover.stories.js +0 -75
  60. package/dist/ButtonWithPopover/ButtonWithPopover.stories.js.map +0 -1
  61. package/dist/ButtonWithPopover/ButtonWithPopover.test.js +0 -82
  62. package/dist/ButtonWithPopover/ButtonWithPopover.test.js.map +0 -1
  63. package/dist/ButtonWithPopover/ButtonWithPopover.types.js +0 -2
  64. package/dist/ButtonWithPopover/ButtonWithPopover.types.js.map +0 -1
  65. package/dist/ButtonWithPopover/index.js +0 -2
  66. package/dist/ButtonWithPopover/index.js.map +0 -1
  67. package/dist/Carousel/Carousel.js +0 -67
  68. package/dist/Carousel/Carousel.js.map +0 -1
  69. package/dist/Carousel/Carousel.stories.js +0 -115
  70. package/dist/Carousel/Carousel.stories.js.map +0 -1
  71. package/dist/Carousel/Carousel.test.js +0 -48
  72. package/dist/Carousel/Carousel.test.js.map +0 -1
  73. package/dist/Carousel/Carousel.types.js +0 -2
  74. package/dist/Carousel/Carousel.types.js.map +0 -1
  75. package/dist/Carousel/index.js +0 -2
  76. package/dist/Carousel/index.js.map +0 -1
  77. package/dist/Checkbox/Checkbox.js +0 -26
  78. package/dist/Checkbox/Checkbox.js.map +0 -1
  79. package/dist/Checkbox/Checkbox.stories.js +0 -34
  80. package/dist/Checkbox/Checkbox.stories.js.map +0 -1
  81. package/dist/Checkbox/Checkbox.test.js +0 -94
  82. package/dist/Checkbox/Checkbox.test.js.map +0 -1
  83. package/dist/Checkbox/Checkbox.types.js +0 -2
  84. package/dist/Checkbox/Checkbox.types.js.map +0 -1
  85. package/dist/Checkbox/index.js +0 -2
  86. package/dist/Checkbox/index.js.map +0 -1
  87. package/dist/Collapse/Collapse.js +0 -18
  88. package/dist/Collapse/Collapse.js.map +0 -1
  89. package/dist/Collapse/Collapse.stories.js +0 -37
  90. package/dist/Collapse/Collapse.stories.js.map +0 -1
  91. package/dist/Collapse/Collapse.test.js +0 -19
  92. package/dist/Collapse/Collapse.test.js.map +0 -1
  93. package/dist/Collapse/Collapse.types.js +0 -2
  94. package/dist/Collapse/Collapse.types.js.map +0 -1
  95. package/dist/Collapse/index.js +0 -2
  96. package/dist/Collapse/index.js.map +0 -1
  97. package/dist/Icon/Icon.js +0 -55
  98. package/dist/Icon/Icon.js.map +0 -1
  99. package/dist/Icon/Icon.stories.js +0 -50
  100. package/dist/Icon/Icon.stories.js.map +0 -1
  101. package/dist/Icon/Icon.test.js +0 -55
  102. package/dist/Icon/Icon.test.js.map +0 -1
  103. package/dist/Icon/Icon.types.js +0 -16
  104. package/dist/Icon/Icon.types.js.map +0 -1
  105. package/dist/Icon/index.js +0 -2
  106. package/dist/Icon/index.js.map +0 -1
  107. package/dist/InputGroup/InputGroup.js +0 -32
  108. package/dist/InputGroup/InputGroup.js.map +0 -1
  109. package/dist/InputGroup/InputGroup.stories.js +0 -168
  110. package/dist/InputGroup/InputGroup.stories.js.map +0 -1
  111. package/dist/InputGroup/InputGroup.test.js +0 -43
  112. package/dist/InputGroup/InputGroup.test.js.map +0 -1
  113. package/dist/InputGroup/InputGroup.types.js +0 -2
  114. package/dist/InputGroup/InputGroup.types.js.map +0 -1
  115. package/dist/InputGroup/index.js +0 -2
  116. package/dist/InputGroup/index.js.map +0 -1
  117. package/dist/Modal/Modal.js +0 -100
  118. package/dist/Modal/Modal.js.map +0 -1
  119. package/dist/Modal/Modal.stories.js +0 -127
  120. package/dist/Modal/Modal.stories.js.map +0 -1
  121. package/dist/Modal/Modal.test.js +0 -108
  122. package/dist/Modal/Modal.test.js.map +0 -1
  123. package/dist/Modal/Modal.types.js +0 -2
  124. package/dist/Modal/Modal.types.js.map +0 -1
  125. package/dist/Modal/index.js +0 -2
  126. package/dist/Modal/index.js.map +0 -1
  127. package/dist/ProgressBar/ProgressBar.js +0 -30
  128. package/dist/ProgressBar/ProgressBar.js.map +0 -1
  129. package/dist/ProgressBar/ProgressBar.stories.js +0 -73
  130. package/dist/ProgressBar/ProgressBar.stories.js.map +0 -1
  131. package/dist/ProgressBar/ProgressBar.test.js +0 -38
  132. package/dist/ProgressBar/ProgressBar.test.js.map +0 -1
  133. package/dist/ProgressBar/ProgressBar.types.js +0 -2
  134. package/dist/ProgressBar/ProgressBar.types.js.map +0 -1
  135. package/dist/ProgressBar/index.js +0 -2
  136. package/dist/ProgressBar/index.js.map +0 -1
  137. package/dist/SeeqActionDropdown/SeeqActionDropdown.js +0 -48
  138. package/dist/SeeqActionDropdown/SeeqActionDropdown.js.map +0 -1
  139. package/dist/SeeqActionDropdown/SeeqActionDropdown.stories.js +0 -80
  140. package/dist/SeeqActionDropdown/SeeqActionDropdown.stories.js.map +0 -1
  141. package/dist/SeeqActionDropdown/SeeqActionDropdown.test.js +0 -73
  142. package/dist/SeeqActionDropdown/SeeqActionDropdown.test.js.map +0 -1
  143. package/dist/SeeqActionDropdown/SeeqActionDropdown.types.js +0 -2
  144. package/dist/SeeqActionDropdown/SeeqActionDropdown.types.js.map +0 -1
  145. package/dist/SeeqActionDropdown/index.js +0 -2
  146. package/dist/SeeqActionDropdown/index.js.map +0 -1
  147. package/dist/SeeqActionDropdown/variants.js +0 -23
  148. package/dist/SeeqActionDropdown/variants.js.map +0 -1
  149. package/dist/Select/Select.js +0 -174
  150. package/dist/Select/Select.js.map +0 -1
  151. package/dist/Select/Select.stories.js +0 -80
  152. package/dist/Select/Select.stories.js.map +0 -1
  153. package/dist/Select/Select.test.js +0 -182
  154. package/dist/Select/Select.test.js.map +0 -1
  155. package/dist/Select/Select.types.js +0 -2
  156. package/dist/Select/Select.types.js.map +0 -1
  157. package/dist/Select/index.js +0 -3
  158. package/dist/Select/index.js.map +0 -1
  159. package/dist/Slider/Slider.js +0 -13
  160. package/dist/Slider/Slider.js.map +0 -1
  161. package/dist/Slider/Slider.stories.js +0 -58
  162. package/dist/Slider/Slider.stories.js.map +0 -1
  163. package/dist/Slider/Slider.test.js +0 -33
  164. package/dist/Slider/Slider.test.js.map +0 -1
  165. package/dist/Slider/Slider.types.js +0 -2
  166. package/dist/Slider/Slider.types.js.map +0 -1
  167. package/dist/Slider/index.js +0 -2
  168. package/dist/Slider/index.js.map +0 -1
  169. package/dist/Tabs/Tabs.js +0 -22
  170. package/dist/Tabs/Tabs.js.map +0 -1
  171. package/dist/Tabs/Tabs.stories.js +0 -91
  172. package/dist/Tabs/Tabs.stories.js.map +0 -1
  173. package/dist/Tabs/Tabs.test.js +0 -91
  174. package/dist/Tabs/Tabs.test.js.map +0 -1
  175. package/dist/Tabs/Tabs.types.js +0 -2
  176. package/dist/Tabs/Tabs.types.js.map +0 -1
  177. package/dist/Tabs/index.js +0 -2
  178. package/dist/Tabs/index.js.map +0 -1
  179. package/dist/TextArea/TextArea.js +0 -25
  180. package/dist/TextArea/TextArea.js.map +0 -1
  181. package/dist/TextArea/TextArea.stories.js +0 -46
  182. package/dist/TextArea/TextArea.stories.js.map +0 -1
  183. package/dist/TextArea/TextArea.test.js +0 -68
  184. package/dist/TextArea/TextArea.test.js.map +0 -1
  185. package/dist/TextArea/TextArea.types.js +0 -2
  186. package/dist/TextArea/TextArea.types.js.map +0 -1
  187. package/dist/TextArea/index.js +0 -2
  188. package/dist/TextArea/index.js.map +0 -1
  189. package/dist/TextField/TextField.js +0 -79
  190. package/dist/TextField/TextField.js.map +0 -1
  191. package/dist/TextField/TextField.stories.js +0 -70
  192. package/dist/TextField/TextField.stories.js.map +0 -1
  193. package/dist/TextField/TextField.test.js +0 -39
  194. package/dist/TextField/TextField.test.js.map +0 -1
  195. package/dist/TextField/TextField.types.js +0 -2
  196. package/dist/TextField/TextField.types.js.map +0 -1
  197. package/dist/TextField/index.js +0 -2
  198. package/dist/TextField/index.js.map +0 -1
  199. package/dist/ToolbarButton/ToolbarButton.js +0 -75
  200. package/dist/ToolbarButton/ToolbarButton.js.map +0 -1
  201. package/dist/ToolbarButton/ToolbarButton.stories.js +0 -94
  202. package/dist/ToolbarButton/ToolbarButton.stories.js.map +0 -1
  203. package/dist/ToolbarButton/ToolbarButton.test.js +0 -93
  204. package/dist/ToolbarButton/ToolbarButton.test.js.map +0 -1
  205. package/dist/ToolbarButton/ToolbarButton.types.js +0 -2
  206. package/dist/ToolbarButton/ToolbarButton.types.js.map +0 -1
  207. package/dist/ToolbarButton/index.js +0 -2
  208. package/dist/ToolbarButton/index.js.map +0 -1
  209. package/dist/Tooltip/QTip.stories.js +0 -45
  210. package/dist/Tooltip/QTip.stories.js.map +0 -1
  211. package/dist/Tooltip/QTip.types.js +0 -2
  212. package/dist/Tooltip/QTip.types.js.map +0 -1
  213. package/dist/Tooltip/QTipPerformance.stories.js +0 -30
  214. package/dist/Tooltip/QTipPerformance.stories.js.map +0 -1
  215. package/dist/Tooltip/Qtip.js +0 -168
  216. package/dist/Tooltip/Qtip.js.map +0 -1
  217. package/dist/Tooltip/Tooltip.js +0 -36
  218. package/dist/Tooltip/Tooltip.js.map +0 -1
  219. package/dist/Tooltip/Tooltip.stories.js +0 -32
  220. package/dist/Tooltip/Tooltip.stories.js.map +0 -1
  221. package/dist/Tooltip/Tooltip.types.js +0 -3
  222. package/dist/Tooltip/Tooltip.types.js.map +0 -1
  223. package/dist/Tooltip/TooltipPerformance.stories.js +0 -30
  224. package/dist/Tooltip/TooltipPerformance.stories.js.map +0 -1
  225. package/dist/Tooltip/index.js +0 -3
  226. package/dist/Tooltip/index.js.map +0 -1
  227. package/dist/Tooltip/qTip.utilities.js +0 -11
  228. package/dist/Tooltip/qTip.utilities.js.map +0 -1
  229. package/dist/types.js +0 -2
  230. package/dist/types.js.map +0 -1
  231. package/dist/utils/browserId.js +0 -29
  232. package/dist/utils/browserId.js.map +0 -1
  233. package/dist/utils/svg.js +0 -20
  234. package/dist/utils/svg.js.map +0 -1
  235. package/dist/utils/validateStyleDimension.js +0 -14
  236. package/dist/utils/validateStyleDimension.js.map +0 -1
  237. package/dist/utils/validateStyleDimension.test.js +0 -20
  238. package/dist/utils/validateStyleDimension.test.js.map +0 -1
@@ -1,75 +0,0 @@
1
- import React from 'react';
2
- import ButtonWithPopover from './ButtonWithPopover';
3
- import Icon from '../Icon';
4
- import { QTip } from '../Tooltip/Qtip';
5
- export default {
6
- title: 'Button with Popover',
7
- };
8
- export const AllButtonWithPopoverVariants = () => {
9
- const options = ['Chocolate', 'Strawberry', 'Vanilla', 'Rocky Road', 'Crazy Cow', 'Almond Joy'];
10
- const renderFlavours = () => (React.createElement("div", { className: "tw-text-sm dark:tw-text-white tw-w-72 tw-p-4" },
11
- React.createElement("p", { className: "tw-font-bold" }, "Flavors"),
12
- React.createElement("div", { className: "tw-w-full tw-flex tw-flex-wrap tw-gap-1" }, options.map((option) => (React.createElement("div", { key: option, className: "tw-flex tw-items-center tw-px-2 tw-py-1 tw-mt-2 tw tw-rounded-full tw-border-sq-color-dark-dark tw-border" },
13
- React.createElement(Icon, { type: "color", color: "rgb(var(--sq-color-dark-dark))", icon: "fc-check", extraClassNames: "tw-mr-2" }),
14
- React.createElement("span", null, option)))))));
15
- const renderInputFields = () => {
16
- const [name, setName] = React.useState('');
17
- const [email, setEmail] = React.useState('');
18
- return (React.createElement("div", { className: "tw-w-72 tw-p-4" },
19
- React.createElement("div", { className: "tw-flex tw-flex-col tw-gap-2" },
20
- React.createElement("input", { type: "text", value: name, onChange: (e) => setName(e.target.value), placeholder: "Enter your name", className: "tw-p-2 tw-rounded tw-border tw-border-sq-color-dark-dark dark:tw-border-sq-dark-background tw-bg-transparent" }),
21
- React.createElement("input", { type: "text", value: email, onChange: (e) => setEmail(e.target.value), placeholder: "Enter your email", className: "tw-p-2 tw-rounded tw-border tw-border-sq-color-dark-dark dark:tw-border-sq-dark-background tw-bg-transparent" }),
22
- React.createElement("button", { className: "tw-p-2 tw-rounded tw-border tw-border-sq-color-dark-dark dark:tw-border-sq-dark-background tw-bg-transparent tw-text-sq-color" }, "Submit"))));
23
- };
24
- const [openPopver, setOpenPopover] = React.useState('');
25
- const iconRef = React.useRef(null);
26
- const allButtonWithPopovers = (isDark = false, topic) => (React.createElement("div", { className: isDark ? 'tw-dark tw-bg-sq-dark-background ' : '' },
27
- React.createElement("div", { className: "tw-p-5 " },
28
- React.createElement(ButtonWithPopover, { trigger: React.createElement(Icon, { type: "color", color: "rgb(var(--sq-color-dark-dark))", icon: "fc-more" }), containerTestId: `basic-popover-${isDark ? 'dark' : 'light'}-${topic}-1`, tooltip: "This is a small popover.", tooltipDelay: 0, tooltipPlacement: "top", isHtmlTooltip: false }, renderFlavours())),
29
- React.createElement("div", { className: "tw-p-5 " },
30
- React.createElement(ButtonWithPopover, { trigger: React.createElement(Icon, { type: "color", color: "rgb(var(--sq-color-dark-dark))", icon: "fc-more" }), containerTestId: `basic-popover-${isDark ? 'dark' : 'light'}-${topic}-2`, isOpen: openPopver === `basic-popover-${isDark ? 'dark' : 'light'}-${topic}-2`, onOpenChange: (isOpen) => setOpenPopover(isOpen ? `basic-popover-${isDark ? 'dark' : 'light'}-${topic}-2` : ''), tooltip: "This is a normal popover.", tooltipDelay: 0, tooltipPlacement: "top", isHtmlTooltip: false }, renderFlavours())),
31
- React.createElement("div", { className: "tw-p-5 " },
32
- React.createElement("p", { className: "dark:tw-text-sq-white tw-text-sm tw-mb-4" }, "Close popover on content click"),
33
- React.createElement(ButtonWithPopover, { trigger: React.createElement(Icon, { type: "color", color: "rgb(var(--sq-color-dark-dark))", icon: "fc-more" }), containerTestId: `basic-popover-${isDark ? 'dark' : 'light'}-${topic}-3`, isOpen: openPopver === `basic-popover-${isDark ? 'dark' : 'light'}-${topic}-3`, onOpenChange: (isOpen) => setOpenPopover(isOpen ? `basic-popover-${isDark ? 'dark' : 'light'}-${topic}-3` : ''), tooltip: "This is a normal popover.", tooltipDelay: 0, tooltipPlacement: "top", isCloseOnContentClick: true, isHtmlTooltip: false }, renderFlavours())),
34
- React.createElement("div", { className: "tw-p-5 " },
35
- React.createElement(ButtonWithPopover, { trigger: React.createElement(Icon, { type: "color", color: "rgb(var(--sq-color-dark-dark))", icon: "fc-more" }), containerTestId: `basic-popover-${isDark ? 'dark' : 'light'}-${topic}-4`, isOpen: openPopver === `basic-popover-${isDark ? 'dark' : 'light'}-${topic}-4`, onOpenChange: (isOpen) => setOpenPopover(isOpen ? `basic-popover-${isDark ? 'dark' : 'light'}-${topic}-4` : ''), tooltip: "This is a disabled popover.", tooltipDelay: 0, tooltipPlacement: "top", isHtmlTooltip: false, disabled: true }, renderFlavours())),
36
- React.createElement("div", { className: "tw-p-5 " },
37
- React.createElement("div", { className: "dark:tw-text-white tw-text-xs" }, "Popover with arrow"),
38
- React.createElement(ButtonWithPopover, { trigger: React.createElement(Icon, { type: "color", color: "rgb(var(--sq-color-dark-dark))", icon: "fc-more" }), containerTestId: `basic-popover-${isDark ? 'dark' : 'light'}-${topic}-5`, isOpen: openPopver === `basic-popover-${isDark ? 'dark' : 'light'}-${topic}-5`, onOpenChange: (isOpen) => setOpenPopover(isOpen ? `basic-popover-${isDark ? 'dark' : 'light'}-${topic}-5` : ''), tooltip: "This is a normal popover with arrow.", tooltipDelay: 0, tooltipPlacement: "top", hasArrow: true, isHtmlTooltip: false }, renderFlavours())),
39
- React.createElement("div", { className: "tw-p-5 " },
40
- React.createElement("div", { className: "dark:tw-text-white tw-text-xs" }, "Popover aligned at center"),
41
- React.createElement(ButtonWithPopover, { trigger: React.createElement(Icon, { type: "color", color: "rgb(var(--sq-color-dark-dark))", icon: "fc-more" }), containerTestId: `basic-popover-${isDark ? 'dark' : 'light'}-${topic}-6`, isOpen: openPopver === `basic-popover-${isDark ? 'dark' : 'light'}-${topic}-6`, onOpenChange: (isOpen) => setOpenPopover(isOpen ? `basic-popover-${isDark ? 'dark' : 'light'}-${topic}-6` : ''), tooltip: "This is a normal popover with arrow.", tooltipDelay: 0, tooltipPlacement: "top", align: "center", hasArrow: true, isHtmlTooltip: false }, renderFlavours())),
42
- React.createElement("div", { className: "tw-p-5 " },
43
- React.createElement("div", { className: "dark:tw-text-white tw-text-xs" }, "Popover aligned at start"),
44
- React.createElement(ButtonWithPopover, { trigger: React.createElement(Icon, { type: "color", color: "rgb(var(--sq-color-dark-dark))", icon: "fc-more" }), containerTestId: `basic-popover-${isDark ? 'dark' : 'light'}-${topic}-7`, isOpen: openPopver === `basic-popover-${isDark ? 'dark' : 'light'}-${topic}-7`, onOpenChange: (isOpen) => setOpenPopover(isOpen ? `basic-popover-${isDark ? 'dark' : 'light'}-${topic}-7` : ''), tooltip: "This is a normal popover with arrow.", tooltipDelay: 0, align: "start", tooltipPlacement: "top", hasArrow: true, isHtmlTooltip: false }, renderFlavours())),
45
- React.createElement("div", { className: "tw-p-5 " },
46
- React.createElement("div", { className: "dark:tw-text-white tw-text-xs" }, "Popover triggered by hover"),
47
- React.createElement(ButtonWithPopover, { trigger: React.createElement(Icon, { type: "color", color: "rgb(var(--sq-color-dark-dark))", icon: "fc-more" }), containerTestId: `basic-popover-${isDark ? 'dark' : 'light'}-${topic}-8`, isOpen: openPopver === `basic-popover-${isDark ? 'dark' : 'light'}-${topic}-8`, onOpenChange: (isOpen) => setOpenPopover(isOpen ? `basic-popover-${isDark ? 'dark' : 'light'}-${topic}-8` : ''), isHoverEnabled: true, align: "start", tooltipPlacement: "top", hasArrow: true, isHtmlTooltip: false }, renderFlavours())),
48
- React.createElement("div", { className: "tw-p-5 " },
49
- React.createElement(ButtonWithPopover, { trigger: React.createElement("div", { className: "dark:tw-text-white tw-text-xs" }, "Popover triggered by another element"), containerTestId: `basic-popover-${isDark ? 'dark' : 'light'}-${topic}-9`, isOpen: openPopver === `basic-popover-${isDark ? 'dark' : 'light'}-${topic}-9`, onInteractOutside: () => setOpenPopover(''), align: "start", tooltipPlacement: "top", hasArrow: true, isHtmlTooltip: false }, renderFlavours()),
50
- openPopver != `basic-popover-${isDark ? 'dark' : 'light'}-${topic}-9` && (React.createElement("div", { ref: iconRef, onClick: () => {
51
- setOpenPopover(`basic-popover-${isDark ? 'dark' : 'light'}-${topic}-9`);
52
- } },
53
- React.createElement(Icon, { type: "text", icon: "fc-all-items" })))),
54
- React.createElement("div", { className: "tw-p-5 " },
55
- React.createElement("div", { className: "dark:tw-text-white tw-text-xs" }, "Popover with input fields"),
56
- React.createElement(ButtonWithPopover, { trigger: React.createElement(Icon, { type: "color", color: "rgb(var(--sq-color-dark-dark))", icon: "fc-more" }), containerTestId: `basic-popover-${isDark ? 'dark' : 'light'}-${topic}-10`, isOpen: openPopver === `basic-popover-${isDark ? 'dark' : 'light'}-${topic}-10`, onOpenChange: (isOpen) => setOpenPopover(isOpen ? `basic-popover-${isDark ? 'dark' : 'light'}-${topic}-10` : ''), tooltip: "This is a normal popover with arrow.", tooltipDelay: 0, tooltipPlacement: "top", align: "center", hasArrow: true, isHtmlTooltip: false }, renderInputFields()))));
57
- const renderAllVariations = (color) => (React.createElement("div", { className: "tw-grid tw-grid-cols-2 tw-gap-4 tw-p-4" },
58
- allButtonWithPopovers(false, color),
59
- allButtonWithPopovers(true, color)));
60
- return (React.createElement("div", { className: "tw-grid tw-grid-cols-4 tw-gap-4" },
61
- React.createElement(QTip, null),
62
- React.createElement("div", { className: "color_topic" },
63
- React.createElement("b", null, "Topic Colors"),
64
- renderAllVariations('topic')),
65
- React.createElement("div", { className: "color_analysis" },
66
- React.createElement("b", null, "Analysis Colors"),
67
- renderAllVariations('analysis')),
68
- React.createElement("div", { className: "color_datalab" },
69
- React.createElement("b", null, "Datalab Colors"),
70
- renderAllVariations('datalab')),
71
- React.createElement("div", { className: "color_vantage" },
72
- React.createElement("b", null, "Vantage Colors"),
73
- renderAllVariations('vantage'))));
74
- };
75
- //# sourceMappingURL=ButtonWithPopover.stories.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ButtonWithPopover.stories.js","sourceRoot":"","sources":["../../src/ButtonWithPopover/ButtonWithPopover.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,iBAAiB,MAAM,qBAAqB,CAAC;AACpD,OAAO,IAAI,MAAM,SAAS,CAAC;AAC3B,OAAO,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AAEvC,eAAe;IACb,KAAK,EAAE,qBAAqB;CAC7B,CAAC;AAEF,MAAM,CAAC,MAAM,4BAA4B,GAAG,GAAG,EAAE;IAC/C,MAAM,OAAO,GAAG,CAAC,WAAW,EAAE,YAAY,EAAE,SAAS,EAAE,YAAY,EAAE,WAAW,EAAE,YAAY,CAAC,CAAC;IAEhG,MAAM,cAAc,GAAG,GAAG,EAAE,CAAC,CAC3B,6BAAK,SAAS,EAAC,8CAA8C;QAC3D,2BAAG,SAAS,EAAC,cAAc,cAAY;QACvC,6BAAK,SAAS,EAAC,yCAAyC,IACrD,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CA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AAE,CACF,CAChB,CACF,CACP,CAAC;IACF,MAAM,mBAAmB,GAAG,CAAC,KAAa,EAAE,EAAE,CAAC,CAC7C,6BAAK,SAAS,EAAC,wCAAwC;QACpD,qBAAqB,CAAC,KAAK,EAAE,KAAK,CAAC;QACnC,qBAAqB,CAAC,IAAI,EAAE,KAAK,CAAC,CAC/B,CACP,CAAC;IACF,OAAO,CACL,6BAAK,SAAS,EAAC,iCAAiC;QAC9C,oBAAC,IAAI,OAAG;QACR,6BAAK,SAAS,EAAC,aAAa;YAC1B,8CAAmB;YAClB,mBAAmB,CAAC,OAAO,CAAC,CACzB;QAEN,6BAAK,SAAS,EAAC,gBAAgB;YAC7B,iDAAsB;YACrB,mBAAmB,CAAC,UAAU,CAAC,CAC5B;QAEN,6BAAK,SAAS,EAAC,eAAe;YAC5B,gDAAqB;YACpB,mBAAmB,CAAC,SAAS,CAAC,CAC3B;QAEN,6BAAK,SAAS,EAAC,eAAe;YAC5B,gDAAqB;YACpB,mBAAmB,CAAC,SAAS,CAAC,CAC3B,CACF,CACP,CAAC;AACJ,CAAC,CAAC"}
@@ -1,82 +0,0 @@
1
- import React from 'react';
2
- import '@testing-library/jest-dom';
3
- import { render, screen, waitFor } from '@testing-library/react';
4
- import userEvent from '@testing-library/user-event';
5
- import ButtonWithPopover from './ButtonWithPopover';
6
- import Icon from '../Icon';
7
- describe('ButtonWithPopover', () => {
8
- const mockOnClick = jest.fn();
9
- const testId = 'trigger-icon';
10
- class Context {
11
- props = {
12
- trigger: (React.createElement(Icon, { icon: "fc-more", type: "text", testId: testId, extraClassNames: "tw-text-sq-text-color dark:tw-text-sq-white tw-w-[18px]" })),
13
- onOpenChange: mockOnClick,
14
- containerTestId: 'basic-Popover1',
15
- tooltip: 'This is a small Popover.',
16
- tooltipDelay: 0,
17
- tooltipPlacement: 'top',
18
- isHtmlTooltip: false,
19
- hoverOpenDelay: 0,
20
- children: React.createElement("div", null, "Popover content"),
21
- };
22
- }
23
- let tc;
24
- beforeEach(() => {
25
- tc = new Context();
26
- jest.clearAllMocks();
27
- });
28
- afterEach(() => {
29
- global.ResizeObserver = undefined;
30
- });
31
- const renderButtonWithPopover = (props) => render(React.createElement("div", { "data-testid": "container", className: "tw-w-10 tw-h-10" },
32
- React.createElement(ButtonWithPopover, { ...props })));
33
- const openPopover = async () => {
34
- const popover = screen.getByTestId(testId);
35
- await userEvent.click(popover);
36
- };
37
- const closePopover = async () => {
38
- const container = screen.getByTestId('container');
39
- await userEvent.click(container);
40
- };
41
- test('renders trigger and opens Popover content on trigger click', async () => {
42
- renderButtonWithPopover(tc.props);
43
- expect(screen.getByTestId('trigger-icon')).toBeInTheDocument();
44
- await openPopover();
45
- expect(screen.getByText('Popover content')).toBeInTheDocument();
46
- await closePopover();
47
- expect(screen.queryByText('Popover content')).not.toBeInTheDocument();
48
- });
49
- test('renders trigger and opens Popover content on trigger hover', async () => {
50
- tc.props.isHoverEnabled = true;
51
- renderButtonWithPopover(tc.props);
52
- expect(screen.getByTestId('trigger-icon')).toBeInTheDocument();
53
- const popover = screen.getByTestId(testId);
54
- await userEvent.hover(popover);
55
- await waitFor(() => {
56
- expect(screen.getByText('Popover content')).toBeInTheDocument();
57
- });
58
- });
59
- test('closes popover when content is clicked and is set in props', async () => {
60
- tc.props.isCloseOnContentClick = true;
61
- renderButtonWithPopover(tc.props);
62
- await openPopover();
63
- const item1 = screen.getByText('Popover content');
64
- await userEvent.click(item1);
65
- expect(mockOnClick).toHaveBeenCalledTimes(2);
66
- });
67
- test('leaves popover open when content is clicked and is set in props', async () => {
68
- tc.props.isCloseOnContentClick = false;
69
- renderButtonWithPopover(tc.props);
70
- await openPopover();
71
- const item1 = screen.getByText('Popover content');
72
- await userEvent.click(item1);
73
- expect(mockOnClick).toHaveBeenCalledTimes(1);
74
- });
75
- test('does not open when disabled', async () => {
76
- tc.props.disabled = true;
77
- renderButtonWithPopover(tc.props);
78
- await openPopover();
79
- expect(screen.queryByText('Popover content')).not.toBeInTheDocument();
80
- });
81
- });
82
- //# sourceMappingURL=ButtonWithPopover.test.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ButtonWithPopover.test.js","sourceRoot":"","sources":["../../src/ButtonWithPopover/ButtonWithPopover.test.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,2BAA2B,CAAC;AACnC,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AACjE,OAAO,SAAS,MAAM,6BAA6B,CAAC;AACpD,OAAO,iBAAiB,MAAM,qBAAqB,CAAC;AAEpD,OAAO,IAAI,MAAM,SAAS,CAAC;AAE3B,QAAQ,CAAC,mBAAmB,EAAE,GAAG,EAAE;IACjC,MAAM,WAAW,GAAG,IAAI,CAAC,EAAE,EAAE,CAAC;IAE9B,MAAM,MAAM,GAAG,cAAc,CAAC;IAC9B,MAAM,OAAO;QACX,KAAK,GAA2B;YAC9B,OAAO,EAAE,CACP,oBAAC,IAAI,IACH,IAAI,EAAC,SAAS,EACd,IAAI,EAAC,MAAM,EACX,MAAM,EAAE,MAAM,EACd,eAAe,EAAC,yDAAyD,GACzE,CACH;YACD,YAAY,EAAE,WAAW;YACzB,eAAe,EAAE,gBAAgB;YACjC,OAAO,EAAE,0BAA0B;YACnC,YAAY,EAAE,CAAC;YACf,gBAAgB,EAAE,KAAK;YACvB,aAAa,EAAE,KAAK;YACpB,cAAc,EAAE,CAAC;YACjB,QAAQ,EAAE,mDAA0B;SACrC,CAAC;KACH;IAED,IAAI,EAAW,CAAC;IAChB,UAAU,CAAC,GAAG,EAAE;QACd,EAAE,GAAG,IAAI,OAAO,EAAE,CAAC;QACnB,IAAI,CAAC,aAAa,EAAE,CAAC;IACvB,CAAC,CAAC,CAAC;IACH,SAAS,CAAC,GAAG,EAAE;QACb,MAAM,CAAC,cAAc,GAAG,SAAgB,CAAC;IAC3C,CAAC,CAAC,CAAC;IAEH,MAAM,uBAAuB,GAAG,CAAC,KA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C,CAAC;QAClC,MAAM,WAAW,EAAE,CAAC;QACpB,MAAM,CAAC,MAAM,CAAC,WAAW,CAAC,iBAAiB,CAAC,CAAC,CAAC,GAAG,CAAC,iBAAiB,EAAE,CAAC;IACxE,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=ButtonWithPopover.types.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ButtonWithPopover.types.js","sourceRoot":"","sources":["../../src/ButtonWithPopover/ButtonWithPopover.types.ts"],"names":[],"mappings":""}
@@ -1,2 +0,0 @@
1
- export { default } from './ButtonWithPopover';
2
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/ButtonWithPopover/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC"}
@@ -1,67 +0,0 @@
1
- import React, { useEffect, useState } from 'react';
2
- import { animated, useTransition } from '@react-spring/web';
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;
13
- setCurrentIndex(newIndex);
14
- onSlide(newIndex, newIndex > currentIndex ? 'right' : 'left');
15
- };
16
- useEffect(() => {
17
- if (autoSlide) {
18
- const currentInterval = setInterval(() => {
19
- if (continuous) {
20
- setCurrentIndex((prevCurrentIndex) => {
21
- onSlide((prevCurrentIndex + 1) % carouselItems.length, (prevCurrentIndex + 1) % carouselItems.length > prevCurrentIndex ? 'right' : 'left');
22
- return (prevCurrentIndex + 1) % carouselItems.length;
23
- });
24
- }
25
- else if (currentIndex === carouselItems.length - 1) {
26
- clearInterval(currentInterval);
27
- }
28
- else {
29
- changeSlide(currentIndex + 1);
30
- }
31
- }, interval);
32
- return () => clearInterval(currentInterval);
33
- }
34
- }, [autoSlide]);
35
- useEffect(() => {
36
- if (activeIndex && activeIndex !== currentIndex) {
37
- setCurrentIndex(activeIndex);
38
- }
39
- }, [activeIndex]);
40
- const transitions = useTransition([currentIndex], {
41
- keys: null,
42
- exitBeforeEnter: true,
43
- from: { transform: 'translate3d(100%,0,0)' },
44
- enter: { transform: 'translate3d(0%,0,0)' },
45
- leave: { transform: 'translate3d(0%,0,0)' },
46
- });
47
- const onBackClick = () => {
48
- if (currentIndex === 0 && !continuous) {
49
- return;
50
- }
51
- changeSlide((currentIndex - 1) % carouselItems.length);
52
- };
53
- const onForwardClick = () => {
54
- if (currentIndex === carouselItems.length - 1 && !continuous) {
55
- return;
56
- }
57
- changeSlide((currentIndex + 1) % carouselItems.length);
58
- };
59
- return (React.createElement("div", { "data-testid": testId, className: `tw-flex tw-flex-col tw-items-center tw-justify-center tw-w-full ${extraClassNames}` },
60
- React.createElement("div", { className: "tw-flex tw-items-center tw-w-full tw-h-max tw-gap-1" },
61
- 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 })),
62
- transitions((style, i) => (React.createElement(animated.div, { "data-testid": `${testId}-${currentIndex}`, style: style }, carouselItems[currentIndex]))),
63
- 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 }))),
64
- 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) })))))));
65
- };
66
- export default Carousel;
67
- //# 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,EAAU,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC3D,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAE5D,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,SAAS,GAAG,aAAa,CAAC,MAAM,CAAC;QAClD,eAAe,CAAC,QAAQ,CAAC,CAAC;QAC1B,OAAO,CAAC,QAAQ,EAAE,QAAQ,GAAG,YAAY,CAAC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AI,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-[15px] 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":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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,EAAE,EAAE,CAAC;IAC9B,MAAM,aAAa,GAAG,CAAC,6BAAK,GAAG,EAAC,GAAG,cAAc,EAAE,6BAAK,GAAG,EAAC,GAAG,cAAc,EAAE,6BAAK,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,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,MAAM,UAAU,GAAG,CAAC,IAA0B,EAAE,EAAE,CAAC,CACjD;QACE,oBAAC,IAAI,OAAG;QACR,6BAAK,SAAS,EAAC,QAAQ;YACrB,oBAAC,QAAQ,IAA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