@seeqdev/qomponents 0.0.139 → 0.0.140

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 (248) hide show
  1. package/dist/index.esm.js +54 -31
  2. package/dist/index.esm.js.map +1 -1
  3. package/dist/index.js +54 -31
  4. package/dist/index.js.map +1 -1
  5. package/dist/styles.css +56 -30
  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 -62
  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 -47
  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 -50
  128. package/dist/ProgressBar/ProgressBar.js.map +0 -1
  129. package/dist/ProgressBar/ProgressBar.stories.js +0 -81
  130. package/dist/ProgressBar/ProgressBar.stories.js.map +0 -1
  131. package/dist/ProgressBar/ProgressBar.test.js +0 -44
  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 -87
  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 -38
  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/SvgIcon/SvgIcon.js +0 -30
  170. package/dist/SvgIcon/SvgIcon.js.map +0 -1
  171. package/dist/SvgIcon/SvgIcon.stories.js +0 -42
  172. package/dist/SvgIcon/SvgIcon.stories.js.map +0 -1
  173. package/dist/SvgIcon/SvgIcon.test.js +0 -41
  174. package/dist/SvgIcon/SvgIcon.test.js.map +0 -1
  175. package/dist/SvgIcon/SvgIcon.types.js +0 -6
  176. package/dist/SvgIcon/SvgIcon.types.js.map +0 -1
  177. package/dist/SvgIcon/index.js +0 -2
  178. package/dist/SvgIcon/index.js.map +0 -1
  179. package/dist/Tabs/Tabs.js +0 -22
  180. package/dist/Tabs/Tabs.js.map +0 -1
  181. package/dist/Tabs/Tabs.stories.js +0 -91
  182. package/dist/Tabs/Tabs.stories.js.map +0 -1
  183. package/dist/Tabs/Tabs.test.js +0 -91
  184. package/dist/Tabs/Tabs.test.js.map +0 -1
  185. package/dist/Tabs/Tabs.types.js +0 -2
  186. package/dist/Tabs/Tabs.types.js.map +0 -1
  187. package/dist/Tabs/index.js +0 -2
  188. package/dist/Tabs/index.js.map +0 -1
  189. package/dist/TextArea/TextArea.js +0 -25
  190. package/dist/TextArea/TextArea.js.map +0 -1
  191. package/dist/TextArea/TextArea.stories.js +0 -46
  192. package/dist/TextArea/TextArea.stories.js.map +0 -1
  193. package/dist/TextArea/TextArea.test.js +0 -68
  194. package/dist/TextArea/TextArea.test.js.map +0 -1
  195. package/dist/TextArea/TextArea.types.js +0 -2
  196. package/dist/TextArea/TextArea.types.js.map +0 -1
  197. package/dist/TextArea/index.js +0 -2
  198. package/dist/TextArea/index.js.map +0 -1
  199. package/dist/TextField/TextField.js +0 -79
  200. package/dist/TextField/TextField.js.map +0 -1
  201. package/dist/TextField/TextField.stories.js +0 -70
  202. package/dist/TextField/TextField.stories.js.map +0 -1
  203. package/dist/TextField/TextField.test.js +0 -39
  204. package/dist/TextField/TextField.test.js.map +0 -1
  205. package/dist/TextField/TextField.types.js +0 -2
  206. package/dist/TextField/TextField.types.js.map +0 -1
  207. package/dist/TextField/index.js +0 -2
  208. package/dist/TextField/index.js.map +0 -1
  209. package/dist/ToolbarButton/ToolbarButton.js +0 -75
  210. package/dist/ToolbarButton/ToolbarButton.js.map +0 -1
  211. package/dist/ToolbarButton/ToolbarButton.stories.js +0 -94
  212. package/dist/ToolbarButton/ToolbarButton.stories.js.map +0 -1
  213. package/dist/ToolbarButton/ToolbarButton.test.js +0 -93
  214. package/dist/ToolbarButton/ToolbarButton.test.js.map +0 -1
  215. package/dist/ToolbarButton/ToolbarButton.types.js +0 -2
  216. package/dist/ToolbarButton/ToolbarButton.types.js.map +0 -1
  217. package/dist/ToolbarButton/index.js +0 -2
  218. package/dist/ToolbarButton/index.js.map +0 -1
  219. package/dist/Tooltip/QTip.stories.js +0 -45
  220. package/dist/Tooltip/QTip.stories.js.map +0 -1
  221. package/dist/Tooltip/QTip.types.js +0 -2
  222. package/dist/Tooltip/QTip.types.js.map +0 -1
  223. package/dist/Tooltip/QTipPerformance.stories.js +0 -30
  224. package/dist/Tooltip/QTipPerformance.stories.js.map +0 -1
  225. package/dist/Tooltip/Qtip.js +0 -168
  226. package/dist/Tooltip/Qtip.js.map +0 -1
  227. package/dist/Tooltip/Tooltip.js +0 -36
  228. package/dist/Tooltip/Tooltip.js.map +0 -1
  229. package/dist/Tooltip/Tooltip.stories.js +0 -32
  230. package/dist/Tooltip/Tooltip.stories.js.map +0 -1
  231. package/dist/Tooltip/Tooltip.types.js +0 -3
  232. package/dist/Tooltip/Tooltip.types.js.map +0 -1
  233. package/dist/Tooltip/TooltipPerformance.stories.js +0 -30
  234. package/dist/Tooltip/TooltipPerformance.stories.js.map +0 -1
  235. package/dist/Tooltip/index.js +0 -3
  236. package/dist/Tooltip/index.js.map +0 -1
  237. package/dist/Tooltip/qTip.utilities.js +0 -11
  238. package/dist/Tooltip/qTip.utilities.js.map +0 -1
  239. package/dist/types.js +0 -2
  240. package/dist/types.js.map +0 -1
  241. package/dist/utils/browserId.js +0 -29
  242. package/dist/utils/browserId.js.map +0 -1
  243. package/dist/utils/svg.js +0 -20
  244. package/dist/utils/svg.js.map +0 -1
  245. package/dist/utils/validateStyleDimension.js +0 -14
  246. package/dist/utils/validateStyleDimension.js.map +0 -1
  247. package/dist/utils/validateStyleDimension.test.js +0 -20
  248. package/dist/utils/validateStyleDimension.test.js.map +0 -1
package/dist/Icon/Icon.js DELETED
@@ -1,55 +0,0 @@
1
- import React from 'react';
2
- import '../styles.css';
3
- import { getQTipData } from '../Tooltip/qTip.utilities';
4
- const colorClassesThemeLight = {
5
- 'theme': 'tw-text-sq-color-dark',
6
- 'white': 'tw-text-white',
7
- 'dark-gray': 'tw-text-sq-fairly-dark-gray',
8
- 'warning': 'tw-text-sq-warning-color',
9
- 'darkish-gray': 'tw-text-sq-darkish-gray',
10
- 'gray': 'tw-text-sq-disabled-gray',
11
- 'color': '',
12
- 'info': 'tw-text-sq-link',
13
- 'text': 'tw-text-sq-text-color',
14
- 'inherit': '',
15
- 'danger': 'tw-text-sq-danger-color',
16
- 'theme-light': 'tw-text-sq-color-light',
17
- 'success': 'tw-text-sq-success-color',
18
- };
19
- const colorClassesThemeDark = {
20
- 'theme': 'dark:tw-text-sq-color-dark-dark',
21
- 'white': '',
22
- 'dark-gray': 'tw-text-sq-fairly-dark-gray',
23
- 'warning': '',
24
- 'darkish-gray': 'tw-text-sq-darkish-gray',
25
- 'gray': 'dark:tw-text-sq-dark-disabled-gray',
26
- 'color': '',
27
- 'info': 'dark:tw-text-sq-link-dark',
28
- 'text': 'dark:tw-text-sq-dark-text',
29
- 'inherit': '',
30
- 'danger': 'tw-text-sq-danger-color',
31
- 'theme-light': 'tw-text-sq-color-light',
32
- 'success': 'tw-text-sq-success-color',
33
- };
34
- /**
35
- * Icon:
36
- * - access to Seeq custom icons by providing the desired icon
37
- * - leverage "type" to style your icon
38
- */
39
- const Icon = ({ onClick, icon, iconPrefix = undefined, type = 'theme', extraClassNames, id, large, small, color, testId, customId, number, ...tooltipProps }) => {
40
- if ((type === 'color' && (color === undefined || color === '')) || (color && type !== 'color')) {
41
- const errorMessage = color === undefined || color === ''
42
- ? 'Icon with type="color" must have prop color specified.'
43
- : 'Icon with prop color must have type="color".';
44
- return React.createElement("div", { className: "tw-text-sq-danger-color" }, errorMessage);
45
- }
46
- const fontAwesomePrefix = iconPrefix ? iconPrefix : 'fa-sharp fa-regular';
47
- const iconPrefixString = icon.startsWith('fc') ? 'fc' : fontAwesomePrefix;
48
- const style = type === 'color' && color ? { color } : {};
49
- const appliedClassNames = `${iconPrefixString} ${icon} ${small ? 'fa-sm' : ''} ${large ? 'fa-lg' : ''}
50
- ${colorClassesThemeLight[type]} ${colorClassesThemeDark[type]} ${onClick ? 'tw-cursor-pointer' : ''} ${extraClassNames} focus:tw-outline-none focus-visible:tw-outline-none tw-outline-none`;
51
- const tooltipData = getQTipData(tooltipProps);
52
- return (React.createElement("i", { className: appliedClassNames, style: style, onClick: onClick, "data-testid": testId, "data-customid": customId, id: id, "data-number": number, ...tooltipData }));
53
- };
54
- export default Icon;
55
- //# sourceMappingURL=Icon.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Icon.js","sourceRoot":"","sources":["../../src/Icon/Icon.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,eAAe,CAAC;AAEvB,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAExD,MAAM,sBAAsB,GAAG;IAC7B,OAAO,EAAE,uBAAuB;IAChC,OAAO,EAAE,eAAe;IACxB,WAAW,EAAE,6BAA6B;IAC1C,SAAS,EAAE,0BAA0B;IACrC,cAAc,EAAE,yBAAyB;IACzC,MAAM,EAAE,0BAA0B;IAClC,OAAO,EAAE,EAAE;IACX,MAAM,EAAE,iBAAiB;IACzB,MAAM,EAAE,uBAAuB;IAC/B,SAAS,EAAE,EAAE;IACb,QAAQ,EAAE,yBAAyB;IACnC,aAAa,EAAE,wBAAwB;IACvC,SAAS,EAAE,0BAA0B;CACtC,CAAC;AAEF,MAAM,qBAAqB,GAAG;IAC5B,OAAO,EAAE,iCAAiC;IAC1C,OAAO,EAAE,EAAE;IACX,WAAW,EAAE,6BAA6B;IAC1C,SAAS,EAAE,EAAE;IACb,cAAc,EAAE,yBAAyB;IACzC,MAAM,EAAE,oCAAoC;IAC5C,OAAO,EAAE,EAAE;IACX,MAAM,EAAE,2BAA2B;IACnC,MAAM,EAAE,2BAA2B;IACnC,SAAS,EAAE,EAAE;IACb,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C,IAAI,CAAC,IAC3D,OAAO,CAAC,CAAC,CAAC,mBAAmB,CAAC,CAAC,CAAC,EAClC,IAAI,eAAe,sEAAsE,CAAC;IAE1F,MAAM,WAAW,GAAG,WAAW,CAAC,YAAY,CAAC,CAAC;IAE9C,OAAO,CACL,2BACE,SAAS,EAAE,iBAAiB,EAC5B,KAAK,EAAE,KAAK,EACZ,OAAO,EAAE,OAAO,iBACH,MAAM,mBACJ,QAAQ,EACvB,EAAE,EAAE,EAAE,iBACO,MAAM,KACf,WAAW,GACf,CACH,CAAC;AACJ,CAAC,CAAC;AACF,eAAe,IAAI,CAAC"}
@@ -1,47 +0,0 @@
1
- import React from 'react';
2
- import Icon from './Icon';
3
- import { iconTypes } from './Icon.types';
4
- export default {
5
- title: 'Icons',
6
- };
7
- export const AllIcons = () => {
8
- const renderAllVariations = () => {
9
- return (React.createElement(React.Fragment, null,
10
- React.createElement("br", null),
11
- React.createElement("br", null),
12
- iconTypes.map((iconType) => {
13
- return (React.createElement("div", { key: `${iconType}` },
14
- React.createElement("b", null,
15
- "type=",
16
- iconType),
17
- React.createElement("br", null),
18
- React.createElement("div", null,
19
- React.createElement(Icon, { icon: "fc-genai-chat", small: true, extraClassNames: 'tw-p-2', type: iconType, color: iconType === 'color' ? 'purple' : undefined }),
20
- React.createElement(Icon, { icon: "fc-formula-ai", extraClassNames: 'tw-p-2', type: iconType, color: iconType === 'color' ? '#928378' : undefined }),
21
- React.createElement(Icon, { icon: "fc-datalab-ai", extraClassNames: 'tw-p-2', type: iconType, color: iconType === 'color' ? 'pink' : undefined }),
22
- React.createElement(Icon, { icon: "fc-workbook-ai", extraClassNames: 'tw-p-2', type: iconType, color: iconType === 'color' ? 'pink' : undefined }),
23
- React.createElement(Icon, { icon: "fc-vantage", extraClassNames: 'tw-p-2', type: iconType, color: iconType === 'color' ? 'pink' : undefined })),
24
- React.createElement("div", null,
25
- React.createElement(Icon, { icon: "fc-signal-forecast", small: true, extraClassNames: 'tw-p-2', type: iconType, color: iconType === 'color' ? 'purple' : undefined })),
26
- React.createElement("div", { className: "tw-dark tw-bg-sq-dark-background" },
27
- React.createElement(Icon, { icon: "fc-announcements", small: true, extraClassNames: 'tw-p-2', type: iconType, color: iconType === 'color' ? 'purple' : undefined }),
28
- React.createElement(Icon, { icon: "fc-announcements", extraClassNames: 'tw-p-2', type: iconType, color: iconType === 'color' ? '#928378' : undefined }),
29
- React.createElement(Icon, { icon: "fc-announcements", large: true, extraClassNames: 'tw-p-2', type: iconType, color: iconType === 'color' ? 'pink' : undefined })),
30
- React.createElement("br", null)));
31
- })));
32
- };
33
- return (React.createElement("div", { className: "tw-grid tw-grid-cols-4 tw-gap-4" },
34
- React.createElement("div", { className: "color_topic" },
35
- React.createElement("b", null, "Topic Colors"),
36
- renderAllVariations()),
37
- React.createElement("div", { className: "color_analysis" },
38
- React.createElement("b", null, "Analysis Colors"),
39
- renderAllVariations()),
40
- React.createElement("div", { className: "color_datalab" },
41
- React.createElement("b", null, "Datalab Colors"),
42
- renderAllVariations()),
43
- React.createElement("div", { className: "color_vantage" },
44
- React.createElement("b", null, "Vantage Colors"),
45
- renderAllVariations())));
46
- };
47
- //# sourceMappingURL=Icon.stories.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Icon.stories.js","sourceRoot":"","sources":["../../src/Icon/Icon.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,IAAI,MAAM,QAAQ,CAAC;AAC1B,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEzC,eAAe;IACb,KAAK,EAAE,OAAO;CACf,CAAC;AAEF,MAAM,CAAC,MAAM,QAAQ,GAAG,GAAG,EAAE;IAC3B,MAAM,mBAAmB,GAAG,GAAG,EAAE;QAC/B,OAAO,CACL;YACE,+BAAM;YACN,+BAAM;YACL,SAAS,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE,EAAE;gBAC1B,OAAO,CACL,6BAAK,GAAG,EAA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CACE;oBACN,6BAAK,SAAS,EAAC,kCAAkC;wBAC/C,oBAAC,IAAI,IACH,IAAI,EAAC,kBAAkB,EACvB,KAAK,EAAE,IAAI,EACX,eAAe,EAAE,QAAQ,EACzB,IAAI,EAAE,QAAQ,EACd,KAAK,EAAE,QAAQ,KAAK,OAAO,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,SAAS,GAClD;wBACF,oBAAC,IAAI,IACH,IAAI,EAAC,kBAAkB,EACvB,eAAe,EAAE,QAAQ,EACzB,IAAI,EAAE,QAAQ,EACd,KAAK,EAAE,QAAQ,KAAK,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,SAAS,GACnD;wBACF,oBAAC,IAAI,IACH,IAAI,EAAC,kBAAkB,EACvB,KAAK,EAAE,IAAI,EACX,eAAe,EAAE,QAAQ,EACzB,IAAI,EAAE,QAAQ,EACd,KAAK,EAAE,QAAQ,KAAK,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,GAChD,CACE;oBACN,+BAAM,CACF,CACP,CAAC;YACJ,CAAC,CAAC,CACD,CACJ,CAAC;IACJ,CAAC,CAAC;IACF,OAAO,CACL,6BAAK,SAAS,EAAC,iCAAiC;QAC9C,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,55 +0,0 @@
1
- import React from 'react';
2
- import '@testing-library/jest-dom';
3
- import { render, screen } from '@testing-library/react';
4
- import Icon from './Icon';
5
- describe('Icon', () => {
6
- class Context {
7
- testId = 'iconTestId';
8
- icon = 'testIcon';
9
- props = {
10
- icon: this.icon,
11
- onClick: jest.fn(),
12
- testId: this.testId,
13
- };
14
- }
15
- let tc;
16
- beforeEach(() => {
17
- tc = new Context();
18
- });
19
- const renderIcon = (props) => render(React.createElement(Icon, { ...props }));
20
- it('renders icon', () => {
21
- renderIcon(tc.props);
22
- expect(screen.getByTestId(tc.testId)).toHaveClass(tc.icon);
23
- });
24
- it('renders large icon', () => {
25
- renderIcon({ ...tc.props, large: true });
26
- expect(screen.getByTestId(tc.testId)).toHaveClass('fa-lg');
27
- });
28
- it('renders small icon', () => {
29
- renderIcon({ ...tc.props, small: true });
30
- expect(screen.getByTestId(tc.testId)).toHaveClass('fa-sm');
31
- });
32
- describe('icon types', () => {
33
- it('renders the theme type by default', () => {
34
- renderIcon(tc.props);
35
- expect(screen.getByTestId(tc.testId)).toHaveClass('tw-text-sq-color-dark');
36
- });
37
- it('renders the white icon', () => {
38
- renderIcon({ ...tc.props, type: 'white' });
39
- expect(screen.getByTestId(tc.testId)).toHaveClass('tw-text-white');
40
- });
41
- it('renders the text-type icon', () => {
42
- renderIcon({ ...tc.props, type: 'text' });
43
- expect(screen.getByTestId(tc.testId)).toHaveClass('tw-text-sq-text-color');
44
- });
45
- it('renders the color-type icon', () => {
46
- renderIcon({ ...tc.props, type: 'color', color: '#AABBFF' });
47
- expect(screen.getByTestId(tc.testId)).toHaveStyle('color: #AABBFF');
48
- });
49
- it('renders a warning if type=color and no color is provided', () => {
50
- renderIcon({ ...tc.props, type: 'color' });
51
- expect(screen.getByText('Icon with type="color" must have prop color specified.')).toBeInTheDocument();
52
- });
53
- });
54
- });
55
- //# sourceMappingURL=Icon.test.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Icon.test.js","sourceRoot":"","sources":["../../src/Icon/Icon.test.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,2BAA2B,CAAC;AACnC,OAAO,EAAE,MA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EH,EAAE,CAAC,0DAA0D,EAAE,GAAG,EAAE;YAClE,UAAU,CAAC,EAAE,GAAG,EAAE,CAAC,KAAK,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC,CAAC;YAC3C,MAAM,CAAC,MAAM,CAAC,SAAS,CAAC,wDAAwD,CAAC,CAAC,CAAC,iBAAiB,EAAE,CAAC;QACzG,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
@@ -1,16 +0,0 @@
1
- export const iconTypes = [
2
- 'theme',
3
- 'white',
4
- 'dark-gray',
5
- 'darkish-gray',
6
- 'gray',
7
- 'color',
8
- 'info',
9
- 'text',
10
- 'warning',
11
- 'inherit',
12
- 'danger',
13
- 'theme-light',
14
- 'success',
15
- ];
16
- //# sourceMappingURL=Icon.types.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Icon.types.js","sourceRoot":"","sources":["../../src/Icon/Icon.types.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,SAAS,GAAG;IACvB,OAAO;IACP,OAAO;IACP,WAAW;IACX,cAAc;IACd,MAAM;IACN,OAAO;IACP,MAAM;IACN,MAAM;IACN,SAAS;IACT,SAAS;IACT,QAAQ;IACR,aAAa;IACb,SAAS;CACD,CAAC"}
@@ -1,2 +0,0 @@
1
- export { default } from './Icon';
2
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/Icon/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAC"}
@@ -1,32 +0,0 @@
1
- import React from 'react';
2
- import '../styles.css';
3
- import { getQTipData } from '../Tooltip/qTip.utilities';
4
- import TextField from '../TextField';
5
- import Button from '../Button';
6
- const baseClasses = 'tw-flex tw-outline-none tw-rounded-sm tw-w-full tw-relative tw-flex-wrap';
7
- const errorClasses = 'tw-border-sq-danger-color';
8
- const borderColorClasses = [
9
- 'tw-border-sq-disabled-gray',
10
- 'dark:tw-border-sq-dark-disabled-gray',
11
- 'dark:focus:tw-border-sq-color-dark-dark',
12
- 'dark:active:tw-border-sq-color-dark-dark',
13
- 'focus:tw-border-sq-color-dark',
14
- 'active:tw-border-sq-color-dark',
15
- ].join(' ');
16
- const borderRadius = 'tw-rounded-sm tw-rounded-r-none';
17
- const fieldClasses = 'tw-leading-normal tw-outline-none tw-py-1 tw-px-3' + 'tw-p-1 tw-border-solid tw-border';
18
- const darkTheme = 'dark:tw-bg-sq-dark-background dark:tw-text-sq-dark-text disabled:dark:tw-text-sq-dark-text-lighter';
19
- const lightTheme = 'tw-text-sq-text-color disabled:tw-text-sq-darkish-gray';
20
- /**
21
- * InputGroup.
22
- */
23
- export const InputGroup = React.forwardRef((props, ref) => {
24
- const { readonly = false, onChange, onKeyUp, onFocus, onBlur, onKeyDown, name, value, placeholder, append = [], extraClassNames = '', id, testId, showError, required, autoComplete, autoFocus, disabled, type, step, min, max, field, maxLength, minLength, ...tooltipProps } = props;
25
- const tooltipData = getQTipData(tooltipProps);
26
- const appliedClasses = `${baseClasses} ${extraClassNames}`;
27
- const fieldAppliedClasses = `${fieldClasses} ${extraClassNames} ${lightTheme} ${darkTheme} ${borderRadius} ${showError ? errorClasses : borderColorClasses} `;
28
- return (React.createElement("div", { id: `input-group-${id}`, className: appliedClasses },
29
- field ? (React.createElement("div", { "data-testid": testId, className: `tw-flex tw-flex-1 tw-cursor-pointer active:tw-z-50 ${fieldAppliedClasses}` }, field)) : (React.createElement(TextField, { testId: testId, readonly: readonly, onChange: onChange, onKeyUp: onKeyUp, onFocus: onFocus, onBlur: onBlur, onKeyDown: onKeyDown, name: name, ref: ref, showError: showError, value: value, required: required, placeholder: placeholder, autoComplete: autoComplete, autoFocus: autoFocus, id: id, type: type, disabled: disabled, step: step, min: min, max: max, maxLength: maxLength, minLength: minLength, extraClassNames: `tw-flex tw-flex-1 tw-w-full tw-rounded-r-none focus:tw-z-30 ${extraClassNames}`, ...tooltipData })),
30
- append.filter(Boolean).map((item, index) => item?.variant === 'button' ? (React.createElement(Button, { key: index, extraClassNames: "tw-ml-[-1px] focus:tw-z-40 focus:tw-border tw-rounded-l-none tw-rounded-r-none last:tw-rounded-r-sm", ...item.buttonProps })) : (React.createElement("div", { key: index, className: `${borderColorClasses} tw-flex tw-items-center tw-justify-center tw-rounded-none tw-ml-[-1px] active:tw-z-30 active:tw-border tw-border last:tw-rounded-r-sm` }, item?.element)))));
31
- });
32
- //# sourceMappingURL=InputGroup.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"InputGroup.js","sourceRoot":"","sources":["../../src/InputGroup/InputGroup.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,eAAe,CAAC;AACvB,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AACxD,OAAO,SAAS,MAAM,cAAc,CAAC;AACrC,OAAO,MAAM,MAAM,WAAW,CAAC;AAE/B,MAAM,WAAW,GAAG,0EAA0E,CAAC;AAE/F,MAAM,YAAY,GAAG,2BAA2B,CAAC;AAEjD,MAAM,kBAAkB,GAAG;IACzB,4BAA4B;IAC5B,sCAAsC;IACtC,yCAAyC;IACzC,0CAA0C;IAC1C,+BAA+B;IAC/B,gCAAgC;CACjC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAEZ,MAAM,YAAY,GAAG,iCAAiC,CAAC;AAEvD,MAAM,YAAY,GAAG,mDAAmD,GAAG,kCAAkC,CAAC;AAE9G,MAAM,SAAS,GAAG,oGAAoG,CAAC;AACvH,MAAM,UAAU,GAAG,wDAAwD,CAAC;AAE5E;;GAEG;AACH,MAAM,CAAC,MAAM,UAAU,GAA6C,KAAK,CAAC,UAAU,CAClF,CAAC,KAAK,EAAE,GAAQ,EAAE,EAAE;IAClB,MAAM,EACJ,QAAQ,GAAG,KAAK,EAChB,QAAQ,EACR,OAAO,EACP,OAAO,EACP,MAAM,EACN,SAAS,EACT,IAA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EACV,GAAG,EAAE,GAAG,EACR,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,SAAS,EACpB,SAAS,EAAE,SAAS,EACpB,eAAe,EAAE,+DAA+D,eAAe,EAAE,KAC7F,WAAW,GACf,CACH;QAEA,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CAC1C,IAAI,EAAE,OAAO,KAAK,QAAQ,CAAC,CAAC,CAAC,CAC3B,oBAAC,MAAM,IACL,GAAG,EAAE,KAAK,EACV,eAAe,EAAC,qGAAqG,KACjH,IAAI,CAAC,WAAW,GACpB,CACH,CAAC,CAAC,CAAC,CACF,6BACE,GAAG,EAAE,KAAK,EACV,SAAS,EAAE,GAAG,kBAAkB,wIAAwI,IACvK,IAAI,EAAE,OAAO,CACV,CACP,CACF,CACG,CACP,CAAC;AACJ,CAAC,CACF,CAAC"}
@@ -1,168 +0,0 @@
1
- import React from 'react';
2
- import { InputGroup } from './InputGroup';
3
- import { QTip } from '../Tooltip/Qtip';
4
- export default {
5
- title: 'InputGroup',
6
- };
7
- export const AllTextFields = () => {
8
- const renderAllVariations = () => (React.createElement(React.Fragment, null,
9
- React.createElement("div", { className: "light" },
10
- React.createElement("div", { className: "tw-p-4" },
11
- React.createElement(InputGroup, { value: "value provided", append: [
12
- {
13
- variant: 'button',
14
- buttonProps: {
15
- icon: 'fc-annotate',
16
- iconStyle: 'theme',
17
- },
18
- },
19
- {
20
- variant: 'button',
21
- buttonProps: {
22
- icon: 'fc-trash',
23
- iconStyle: 'theme',
24
- },
25
- },
26
- ] })),
27
- React.createElement("div", { className: "tw-p-4" },
28
- React.createElement(InputGroup, { tooltip: "This is a small input group.", tooltipDelay: 0, tooltipPlacement: "top", isHtmlTooltip: false, value: "with tooltip", append: [
29
- {
30
- variant: 'button',
31
- buttonProps: {
32
- icon: 'fc-annotate',
33
- iconStyle: 'theme',
34
- },
35
- },
36
- {
37
- variant: 'button',
38
- buttonProps: {
39
- icon: 'fc-trash',
40
- iconStyle: 'theme',
41
- },
42
- },
43
- ] })),
44
- React.createElement("div", { className: "tw-p-4" },
45
- React.createElement(InputGroup, { tooltip: "This is a small input group.", tooltipDelay: 0, tooltipPlacement: "top", isHtmlTooltip: false, value: "with tooltip", append: [
46
- {
47
- variant: 'button',
48
- buttonProps: {
49
- icon: 'fc-annotate',
50
- iconStyle: 'theme',
51
- },
52
- },
53
- ] })),
54
- React.createElement("div", { className: "tw-p-4" },
55
- React.createElement(InputGroup, { tooltip: "This is a small input group.", tooltipDelay: 0, tooltipPlacement: "top", isHtmlTooltip: false, value: "with custom element", append: [
56
- {
57
- variant: 'element',
58
- element: React.createElement("div", { className: "tw-text-sm tw-p-1 tw-bg-sq-light-background" }, "Custom"),
59
- },
60
- ] })),
61
- React.createElement("div", { className: "tw-p-4" },
62
- React.createElement(InputGroup, { tooltip: "This is a small input group.", tooltipDelay: 0, tooltipPlacement: "top", isHtmlTooltip: false, value: "button input group", field: React.createElement("div", { className: "tw-text-sm tw-p-1 tw-bg-sq-light-background", onClick: () => console.log('clicked') }, "custom grouped element"), append: [
63
- {
64
- variant: 'element',
65
- element: (React.createElement("div", { className: "tw-text-sm tw-p-1 tw-bg-sq-light-background dark:tw-text-sq-dark-text" }, "Custom")),
66
- },
67
- ] })),
68
- React.createElement("div", { className: "tw-p-4" },
69
- React.createElement(InputGroup, { tooltip: "This is a small input group.", tooltipDelay: 0, tooltipPlacement: "top", isHtmlTooltip: false, field: React.createElement("div", { className: "tw-text-sm tw-p-1 tw-bg-sq-light-background" },
70
- React.createElement("div", { className: "tw-rounded-sm tw-bg-green-400 " }, "Custom element 1"),
71
- React.createElement("div", { className: "tw-rounded-sm tw-bg-red-400 tw-mt-1", onClick: () => console.log('clicked') }, "Custom element 2")), append: [
72
- {
73
- variant: 'element',
74
- element: (React.createElement("div", { className: "tw-text-sm tw-p-1 tw-bg-sq-light-background dark:tw-text-sq-dark-text" }, "Edit")),
75
- },
76
- {
77
- variant: 'element',
78
- element: (React.createElement("div", { className: "tw-text-sm tw-p-1 tw-bg-sq-light-background dark:tw-text-sq-dark-text" }, "Delete")),
79
- },
80
- ] }))),
81
- React.createElement("div", { className: "tw-dark tw-bg-sq-dark-background" },
82
- React.createElement("div", { className: "tw-p-4" },
83
- React.createElement(InputGroup, { value: "value provided", append: [
84
- {
85
- variant: 'button',
86
- buttonProps: {
87
- icon: 'fc-annotate',
88
- iconStyle: 'theme',
89
- },
90
- },
91
- {
92
- variant: 'button',
93
- buttonProps: {
94
- icon: 'fc-trash',
95
- iconStyle: 'theme',
96
- },
97
- },
98
- ] })),
99
- React.createElement("div", { className: "tw-p-4" },
100
- React.createElement(InputGroup, { tooltip: "This is a small input group.", tooltipDelay: 0, tooltipPlacement: "top", isHtmlTooltip: false, value: "with tooltip", append: [
101
- {
102
- variant: 'button',
103
- buttonProps: {
104
- icon: 'fc-annotate',
105
- iconStyle: 'theme',
106
- },
107
- },
108
- {
109
- variant: 'button',
110
- buttonProps: {
111
- icon: 'fc-trash',
112
- iconStyle: 'theme',
113
- },
114
- },
115
- ] })),
116
- React.createElement("div", { className: "tw-p-4" },
117
- React.createElement(InputGroup, { tooltip: "This is a small input group.", tooltipDelay: 0, tooltipPlacement: "top", isHtmlTooltip: false, value: "with tooltip", append: [
118
- {
119
- variant: 'button',
120
- buttonProps: {
121
- icon: 'fc-annotate',
122
- iconStyle: 'theme',
123
- },
124
- },
125
- ] })),
126
- React.createElement("div", { className: "tw-p-4" },
127
- React.createElement(InputGroup, { tooltip: "This is a small input group.", tooltipDelay: 0, tooltipPlacement: "top", isHtmlTooltip: false, value: "with custom element", append: [
128
- {
129
- variant: 'element',
130
- element: (React.createElement("div", { className: "tw-text-sm tw-p-1 tw-bg-sq-light-background dark:tw-text-sq-dark-text" }, "Custom")),
131
- },
132
- ] })),
133
- React.createElement("div", { className: "tw-p-4" },
134
- React.createElement(InputGroup, { tooltip: "This is a small input group.", tooltipDelay: 0, tooltipPlacement: "top", isHtmlTooltip: false, value: "button input group", field: React.createElement("div", { className: "tw-text-sm tw-p-1 tw-bg-sq-light-background dark:tw-text-sq-dark-text", onClick: () => console.log('clicked') }, "custom grouped element"), append: [
135
- {
136
- variant: 'element',
137
- element: (React.createElement("div", { className: "tw-text-sm tw-p-1 tw-bg-sq-light-background dark:tw-text-sq-dark-text" }, "Custom")),
138
- },
139
- ] })),
140
- React.createElement("div", { className: "tw-p-4" },
141
- React.createElement(InputGroup, { tooltip: "This is a small input group.", tooltipDelay: 0, tooltipPlacement: "top", isHtmlTooltip: false, field: React.createElement("div", { className: "tw-text-sm tw-p-1 tw-bg-sq-light-background" },
142
- React.createElement("div", { className: "tw-rounded-sm tw-bg-green-400 dark:tw-text-sq-dark-text" }, "Custom element 1"),
143
- React.createElement("div", { className: "tw-rounded-sm tw-bg-red-400 dark:tw-text-sq-dark-text tw-mt-1", onClick: () => console.log('clicked') }, "Custom element 2")), append: [
144
- {
145
- variant: 'element',
146
- element: (React.createElement("div", { className: "tw-text-sm tw-p-1 tw-bg-sq-light-background dark:tw-text-sq-dark-text" }, "Edit")),
147
- },
148
- {
149
- variant: 'element',
150
- element: (React.createElement("div", { className: "tw-text-sm tw-p-1 tw-bg-sq-light-background dark:tw-text-sq-dark-text" }, "Delete")),
151
- },
152
- ] })))));
153
- return (React.createElement("div", { className: "tw-grid tw-grid-cols-4 tw-gap-4" },
154
- React.createElement(QTip, null),
155
- React.createElement("div", { className: "color_topic" },
156
- React.createElement("b", null, "Topic Colors"),
157
- renderAllVariations()),
158
- React.createElement("div", { className: "color_analysis" },
159
- React.createElement("b", null, "Analysis Colors"),
160
- renderAllVariations()),
161
- React.createElement("div", { className: "color_datalab" },
162
- React.createElement("b", null, "Datalab Colors"),
163
- renderAllVariations()),
164
- React.createElement("div", { className: "color_vantage" },
165
- React.createElement("b", null, "Vantage Colors"),
166
- renderAllVariations())));
167
- };
168
- //# sourceMappingURL=InputGroup.stories.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"InputGroup.stories.js","sourceRoot":"","sources":["../../src/InputGroup/InputGroup.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AAEvC,eAAe;IACb,KAAK,EAAE,YAAY;CACpB,CAAC;AAEF,MAAM,CAAC,MAAM,aAAa,GAAG,GAAG,EAAE;IAChC,MAAM,mBAAmB,GAAG,GAAG,EAAE,CAAC,CAChC;QACE,6BAAK,SAAS,EAAC,OAAO;YACpB,6BAAK,SAAS,EAAC,QAAQ;gBACrB,oBAAC,UAAU,IACT,KAAK,EAAC,gBAAgB,EACtB,MAAM,EAAE;wBACN;4BACE,OAAO,EAAE,QAAQ;4BACjB,WAAW,EAAE;gCACX,IAAI,EAAE,aAAa;gCACnB,SAAS,EAAE,OAAO;6BACnB;yBACF;wBACD;4BACE,OAAO,EAAE,QAAQ;4BACjB,WAAW,EAAE;gCACX,IAAI,EAAE,UAAU;gCAChB,SAAS,EAAE,OAAO;6BACnB;yBACF;qBACF,GACD,CACE;YACN,6BAAK,SAAS,EAAC,QAAQ;gBACrB,oBAAC,UAAU,IACT,OAAO,EAAC,8BAA8B,EACtC,YAAY,EAAE,CAAC,EACf,gBAAgB,EAAC,KAAK,EACtB,aAAa,EAAE,KAAK,EACpB,KAAK,EAAC,cAAc,EACpB,MAAM,EAAE;wBACN;4BACE,OAAO,EAAE,QAAQ;4BACjB,WAAW,EAAE;gCACX,IAAI,EAAE,aAAa;gCACnB,SAAS,EAAE,OAAO;6BACnB;yBACF;wBACD;4BACE,OAAO,EAAE,QAAQ;4BACjB,WAAW,EAAE;gCACX,IAAI,EAAE,UAAU;gCAChB,SAAS,EAAE,OAAO;6BACnB;yBACF;qBACF,GACD,CACE;YACN,6BAAK,SAAS,EAAC,QAAQ;gBACrB,oBAAC,UAAU,IACT,OAAO,EAAC,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AAuB;wBAC/F,6BACE,SAAS,EAAC,+DAA+D,EACzE,OAAO,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,SAAS,CAAC,uBAEjC,CACF,EAER,MAAM,EAAE;wBACN;4BACE,OAAO,EAAE,SAAS;4BAClB,OAAO,EAAE,CACP,6BAAK,SAAS,EAAC,uEAAuE,WAAW,CAClG;yBACF;wBACD;4BACE,OAAO,EAAE,SAAS;4BAClB,OAAO,EAAE,CACP,6BAAK,SAAS,EAAC,uEAAuE,aAAa,CACpG;yBACF;qBACF,GACD,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,43 +0,0 @@
1
- import React from 'react';
2
- import { render } from '@testing-library/react';
3
- import '@testing-library/jest-dom/extend-expect';
4
- import { InputGroup } from './InputGroup';
5
- describe('InputGroup', () => {
6
- const defaultProps = {
7
- value: 'with tooltip',
8
- append: [
9
- {
10
- variant: 'button',
11
- buttonProps: {
12
- icon: 'fc-annotate',
13
- iconStyle: 'theme',
14
- },
15
- },
16
- ],
17
- extraClassNames: 'extra-class',
18
- tooltip: 'Tooltip title',
19
- tooltipDelay: 0,
20
- id: 'input-group-id',
21
- testId: 'input-group-test-id',
22
- };
23
- it('renders without crashing', () => {
24
- const { getByTestId } = render(React.createElement(InputGroup, { ...defaultProps }));
25
- expect(getByTestId('input-group-test-id')).toBeInTheDocument();
26
- });
27
- it('applies the correct classes', () => {
28
- const { getByTestId } = render(React.createElement(InputGroup, { ...defaultProps }));
29
- const inputGroup = getByTestId('input-group-test-id');
30
- expect(inputGroup).toHaveClass('tw-flex');
31
- expect(inputGroup).toHaveClass('tw-outline-none');
32
- expect(inputGroup).toHaveClass('extra-class');
33
- });
34
- it('renders append items', () => {
35
- const { getByRole } = render(React.createElement(InputGroup, { ...defaultProps }));
36
- expect(getByRole('button')).toBeInTheDocument();
37
- });
38
- it('renders input element', () => {
39
- const { container } = render(React.createElement(InputGroup, { ...defaultProps }));
40
- expect(container.querySelector('input[type="text"]')).toBeInTheDocument();
41
- });
42
- });
43
- //# sourceMappingURL=InputGroup.test.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"InputGroup.test.js","sourceRoot":"","sources":["../../src/InputGroup/InputGroup.test.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAChD,OAAO,yCAAyC,CAAC;AACjD,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAG1C,QAAQ,CAAC,YAAY,EAAE,GAAG,EAAE;IAC1B,MAAM,YAAY,GAAoB;QACpC,KAAK,EAAE,cAAc;QACrB,MAAM,EAAE;YACN;gBACE,OAAO,EAAE,QAAQ;gBACjB,WAAW,EAAE;oBACX,IAAI,EAAE,aAAa;oBACnB,SAAS,EAAE,OAAO;iBACnB;aACF;SACF;QACD,eAAe,EAAE,aAAa;QAC9B,OAAO,EAAE,eAAe;QACxB,YAAY,EAAE,CAAC;QACf,EAAE,EAAE,gBAAgB;QACpB,MAAM,EAAE,qBAAqB;KAC9B,CAAC;IAEF,EAAE,CAAC,0BAA0B,EAAE,GAAG,EAAE;QAClC,MAAM,EAAE,WAAW,EAAE,GAAG,MAAM,CAAC,oBAAC,UAAU,OAAK,YAAY,GAAI,CAAC,CAAC;QACjE,MAAM,CAAC,WAAW,CAAC,qBAAqB,CAAC,CAAC,CAAC,iBAAiB,EAAE,CAAC;IACjE,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,6BAA6B,EAAE,GAAG,EAAE;QACrC,MAAM,EAAE,WAAW,EAAE,GAAG,MAAM,CAAC,oBAAC,UAAU,OAAK,YAAY,GAAI,CAAC,CAAC;QACjE,MAAM,UAAU,GAAG,WAAW,CAAC,qBAAqB,CAAC,CAAC;QACtD,MAAM,CAAC,UAAU,CAAC,CAAC,WAAW,CAAC,SAAS,CAAC,CAAC;QAC1C,MAAM,CAAC,UAAU,CAAC,CAAC,WAAW,CAAC,iBAAiB,CAAC,CAAC;QAClD,MAAM,CAAC,UAAU,CAAC,CAAC,WAAW,CAAC,aAAa,CAAC,CAAC;IAChD,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,sBAAsB,EAAE,GAAG,EAAE;QAC9B,MAAM,EAAE,SAAS,EAAE,GAAG,MAAM,CAAC,oBAAC,UAAU,OAAK,YAAY,GAAI,CAAC,CAAC;QAC/D,MAAM,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAC,CAAC,iBAAiB,EAAE,CAAC;IAClD,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,uBAAuB,EAAE,GAAG,EAAE;QAC/B,MAAM,EAAE,SAAS,EAAE,GAAG,MAAM,CAAC,oBAAC,UAAU,OAAK,YAAY,GAAI,CAAC,CAAC;QAC/D,MAAM,CAAC,SAAS,CAAC,aAAa,CAAC,oBAAoB,CAAC,CAAC,CAAC,iBAAiB,EAAE,CAAC;IAC5E,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=InputGroup.types.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"InputGroup.types.js","sourceRoot":"","sources":["../../src/InputGroup/InputGroup.types.ts"],"names":[],"mappings":""}
@@ -1,2 +0,0 @@
1
- export { InputGroup as default } from './InputGroup';
2
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/InputGroup/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,IAAI,OAAO,EAAE,MAAM,cAAc,CAAC"}
@@ -1,100 +0,0 @@
1
- import React, { useEffect, useState } from 'react';
2
- import * as DialogPrimitive from '@radix-ui/react-dialog';
3
- import classNames from 'classnames';
4
- import '../styles.css';
5
- import Button from '../Button';
6
- import Icon from '../Icon';
7
- import TextField from '../TextField';
8
- const Dialog = DialogPrimitive.Root;
9
- const DialogPortal = DialogPrimitive.Portal;
10
- const DialogClose = DialogPrimitive.Close;
11
- const DialogContent = React.forwardRef(({ className, children, ...props }, ref) => (React.createElement(DialogPortal, null,
12
- React.createElement("div", { className: "tw-select-none tw-fixed tw-w-full tw-h-full tw-opacity-50 tw-inset-0 tw-z-[1009] tw-bg-sq-dark-background\n data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0\n data-[state=open]:fade-in-0 " }),
13
- React.createElement(DialogPrimitive.Content, { ref: ref, className: `tw-fixed tw-left-[50%] tw-top-0 tw-my-6 tw-translate-x-[-50%] tw-z-[1010] tw-grid
14
- tw-gap-4 tw-border tw-bg-sq-white dark:tw-bg-sq-dark-background tw-p-6 tw-shadow-lg tw-duration-200
15
- tw-rounded-lg ${className}`, ...props }, children))));
16
- DialogContent.displayName = DialogPrimitive.Content.displayName;
17
- const DialogHeader = (props) => (React.createElement("div", { className: "tw-w-full tw-justify-between" },
18
- React.createElement("div", { ...props })));
19
- DialogHeader.displayName = 'DialogHeader';
20
- const DialogFooter = (props) => React.createElement("div", { ...props });
21
- DialogFooter.displayName = 'DialogFooter';
22
- const DialogTitle = React.forwardRef((props, ref) => React.createElement(DialogPrimitive.Title, { ref: ref, ...props }));
23
- DialogTitle.displayName = DialogPrimitive.Title.displayName;
24
- const DialogDescription = React.forwardRef((props, ref) => React.createElement(DialogPrimitive.Description, { ref: ref, ...props }));
25
- DialogDescription.displayName = DialogPrimitive.Description.displayName;
26
- const Modal = ({ titleIcon, title = 'Modal title example', titleSuffixLabel, subtitle, children, open = false, onClose, customButton = false, customButtonLabel = 'Back', onClickCustomButton, submitButtonLabel = 'Submit', cancelButtonLabel = 'Cancel', disableSubmitButton = false, stopPropagationSubmitButton = false, onSubmit, isTitleEditable = false, onTitleChanged, inputExtraClassNames, hideCloseIcon = false, size = 'xl', titleIconPosition = 'left', hideFooterButtons = false, hideSubmitButton = false, hideCancelButton = false, testId = 'modal', modalFooter, dialogClassName, titlePlaceholder, titleRequired, titleError, submitButtonTooltip, cancelButtonTooltip, disableCustomButton, customHeader, middleFooterSection = React.createElement(React.Fragment, null), customButtonVariant = 'outline', submitButtonVariant = 'theme', keepFocusInsideModal = true, onPointerDownOutside, onInteractOutside, }) => {
27
- const [isLoading, setIsLoading] = useState(false);
28
- // the Dialog is adding pointerEvents: none to body and the dropdowns from the modal does not work anymore
29
- useEffect(() => {
30
- if (open) {
31
- // Pushing the change to the end of the call stack
32
- const timer = setTimeout(() => {
33
- document.body.style.pointerEvents = '';
34
- }, 0);
35
- return () => clearTimeout(timer);
36
- }
37
- else {
38
- document.body.style.pointerEvents = 'auto';
39
- }
40
- }, [open]);
41
- const handleSubmit = async (e) => {
42
- if (!onSubmit)
43
- return;
44
- try {
45
- setIsLoading(true);
46
- await onSubmit(e);
47
- }
48
- finally {
49
- setIsLoading(false);
50
- }
51
- };
52
- const renderTitle = () => {
53
- let titleIconElement = React.createElement(React.Fragment, null);
54
- if (titleIcon) {
55
- if (typeof titleIcon === 'string') {
56
- titleIconElement = (React.createElement(Icon, { icon: titleIcon, testId: "modalTitleIcon", extraClassNames: "tw-flex tw-text-xl tw-mt-1" }));
57
- }
58
- else {
59
- titleIconElement = React.createElement("div", { className: "tw-mt-1.5" }, titleIcon);
60
- }
61
- }
62
- return (React.createElement(React.Fragment, null,
63
- titleIcon && titleIconPosition === 'left' ? React.createElement("div", { className: "tw-flex tw-mr-2" }, titleIconElement) : React.createElement(React.Fragment, null),
64
- React.createElement(DialogTitle, { asChild: true }, isTitleEditable ? (React.createElement("div", { className: "tw-flex tw-w-full tw-items-center" },
65
- React.createElement(TextField, { extraClassNames: inputExtraClassNames, value: title, type: "text", testId: "modalTitle", onChange: onTitleChanged, placeholder: titlePlaceholder, required: titleRequired, showError: !!titleError }),
66
- titleError && React.createElement("p", { className: "tw-text-sq-danger-color tw-min-w-fit tw-pl-2 tw-mb-0" }, titleError))) : (customHeader ?? (React.createElement("div", { "data-testid": "modalTitle", className: "modal-title" },
67
- React.createElement("div", { className: "tw-flex tw-items-center" },
68
- React.createElement("h3", null, title),
69
- titleSuffixLabel && React.createElement("span", { className: "tw-text-xl tw-pl-0.5" }, titleSuffixLabel)),
70
- subtitle && (React.createElement("div", { className: "tw-italic tw-text-sm tw-text-left tw-mt-1", "data-testid": "modal-subtitle" }, subtitle)))))),
71
- titleIcon && titleIconPosition === 'right' ? React.createElement("div", { className: "tw-flex tw-ml-4" }, titleIconElement) : React.createElement(React.Fragment, null)));
72
- };
73
- return open ? (React.createElement(Dialog, { open: true, onOpenChange: onClose, modal: keepFocusInsideModal },
74
- React.createElement(DialogContent, { onPointerDownOutside: (e) => (onPointerDownOutside ? onPointerDownOutside(e) : e.preventDefault()), onInteractOutside: (e) => (onInteractOutside ? onInteractOutside(e) : e.preventDefault()), "data-testid": testId, className: classNames(`modalContent tw-w-full !tw-p-0 tw-border-none tw-shadow-none dark:tw-text-sq-dark-text !tw-gap-0`, {
75
- 'tw-max-w-xs': size === 'xs',
76
- 'tw-max-w-sm': size === 'sm',
77
- 'tw-max-w-md': size === 'md',
78
- 'tw-max-w-lg': size === 'lg',
79
- 'tw-max-w-xl': size === 'xl',
80
- 'tw-max-w-2xl': size === '2xl',
81
- 'tw-max-w-3xl': size === '3xl',
82
- 'tw-max-w-4xl': size === '4xl',
83
- 'tw-max-w-5xl': size === '5xl',
84
- 'tw-max-w-6xl': size === '6xl',
85
- }, dialogClassName) },
86
- React.createElement(DialogHeader, { className: "modal-header tw-flex tw-w-full tw-justify-between tw-border-sq-disabled-gray\n dark:tw-border-sq-dark-disabled-gray tw-border-0 tw-border-b tw-px-6 tw-py-4" },
87
- React.createElement("div", { className: "tw-flex tw-w-full" }, renderTitle()),
88
- !hideCloseIcon && (React.createElement(DialogClose, { autoFocus: false, className: "[&:has(:focus-visible)]:none tw-opacity-70 tw-bg-transparent hover:tw-opacity-100 close tw-cursor-pointer tw-ml-4", "data-testid": "closeButton" },
89
- React.createElement("span", { className: "tw-cursor-pointer" }, "\u00D7")))),
90
- React.createElement(DialogDescription, { className: "modal-body tw-px-6 tw-py-4 tw-overflow-y-auto", asChild: true }, children),
91
- !hideFooterButtons && (React.createElement(DialogFooter, { className: "modal-footer tw-px-6 tw-py-4" }, modalFooter ?? (React.createElement("div", { className: "tw-flex tw-w-full tw-justify-between", "data-testid": "modalFooter" },
92
- React.createElement("div", { className: "tw-flex tw-justify-start" }, customButton && (React.createElement(Button, { label: customButtonLabel, onClick: onClickCustomButton, disabled: disableCustomButton, extraClassNames: "tw-justify-start tw-min-w-[100px]", testId: "customButton", variant: customButtonVariant }))),
93
- React.createElement("div", { className: "tw-flex tw-justify-end" },
94
- React.createElement("div", { className: "tw-flex tw-items-center" }, middleFooterSection),
95
- !hideCancelButton && (React.createElement(DialogClose, { asChild: true },
96
- React.createElement(Button, { label: cancelButtonLabel, extraClassNames: "tw-mr-5 tw-min-w-[100px]", tooltip: cancelButtonTooltip, variant: "outline", stopPropagation: false, testId: "cancelButton" }))),
97
- !hideSubmitButton && (React.createElement(Button, { label: submitButtonLabel, onClick: handleSubmit, disabled: disableSubmitButton || isLoading, variant: submitButtonVariant, stopPropagation: stopPropagationSubmitButton, tooltip: submitButtonTooltip, icon: isLoading ? 'fc-loading-notch tw-animate-spin' : undefined, iconPosition: "left", testId: "submitButton", extraClassNames: "tw-min-w-[100px]" })))))))))) : (React.createElement(React.Fragment, null));
98
- };
99
- export default Modal;
100
- //# sourceMappingURL=Modal.js.map