@seeqdev/qomponents 0.0.102 → 0.0.104

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 (178) hide show
  1. package/dist/Accordion/Accordion.js +9 -0
  2. package/dist/Accordion/Accordion.js.map +1 -0
  3. package/dist/Accordion/Accordion.stories.js +115 -0
  4. package/dist/Accordion/Accordion.stories.js.map +1 -0
  5. package/dist/Accordion/Accordion.test.js +55 -0
  6. package/dist/Accordion/Accordion.test.js.map +1 -0
  7. package/dist/Accordion/Accordion.types.js +2 -0
  8. package/dist/Accordion/Accordion.types.js.map +1 -0
  9. package/dist/Accordion/index.js +2 -0
  10. package/dist/Accordion/index.js.map +1 -0
  11. package/dist/Alert/Alert.d.ts +7 -0
  12. package/dist/Alert/Alert.js +2 -2
  13. package/dist/Alert/Alert.js.map +1 -1
  14. package/dist/Alert/Alert.stories.d.ts +5 -0
  15. package/dist/Alert/Alert.stories.js +5 -0
  16. package/dist/Alert/Alert.stories.js.map +1 -1
  17. package/dist/Alert/Alert.test.d.ts +1 -1
  18. package/dist/Alert/Alert.types.d.ts +10 -0
  19. package/dist/Alert/index.d.ts +1 -0
  20. package/dist/Button/Button.js +90 -0
  21. package/dist/Button/Button.js.map +1 -0
  22. package/dist/Button/Button.stories.js +98 -0
  23. package/dist/Button/Button.stories.js.map +1 -0
  24. package/dist/Button/Button.test.js +49 -0
  25. package/dist/Button/Button.test.js.map +1 -0
  26. package/dist/Button/Button.types.js +5 -0
  27. package/dist/Button/Button.types.js.map +1 -0
  28. package/dist/Button/index.js +2 -0
  29. package/dist/Button/index.js.map +1 -0
  30. package/dist/ButtonWithDropdown/ButtonWithDropdown.js +67 -0
  31. package/dist/ButtonWithDropdown/ButtonWithDropdown.js.map +1 -0
  32. package/dist/ButtonWithDropdown/ButtonWithDropdown.stories.js +98 -0
  33. package/dist/ButtonWithDropdown/ButtonWithDropdown.stories.js.map +1 -0
  34. package/dist/ButtonWithDropdown/ButtonWithDropdown.test.js +85 -0
  35. package/dist/ButtonWithDropdown/ButtonWithDropdown.test.js.map +1 -0
  36. package/dist/ButtonWithDropdown/ButtonWithDropdown.types.js +2 -0
  37. package/dist/ButtonWithDropdown/ButtonWithDropdown.types.js.map +1 -0
  38. package/dist/ButtonWithDropdown/index.js +2 -0
  39. package/dist/ButtonWithDropdown/index.js.map +1 -0
  40. package/dist/ButtonWithPopover/ButtonWithPopover.js +53 -0
  41. package/dist/ButtonWithPopover/ButtonWithPopover.js.map +1 -0
  42. package/dist/ButtonWithPopover/ButtonWithPopover.stories.js +75 -0
  43. package/dist/ButtonWithPopover/ButtonWithPopover.stories.js.map +1 -0
  44. package/dist/ButtonWithPopover/ButtonWithPopover.test.js +82 -0
  45. package/dist/ButtonWithPopover/ButtonWithPopover.test.js.map +1 -0
  46. package/dist/ButtonWithPopover/ButtonWithPopover.types.js +2 -0
  47. package/dist/ButtonWithPopover/ButtonWithPopover.types.js.map +1 -0
  48. package/dist/ButtonWithPopover/index.js +2 -0
  49. package/dist/ButtonWithPopover/index.js.map +1 -0
  50. package/dist/Checkbox/Checkbox.js +26 -0
  51. package/dist/Checkbox/Checkbox.js.map +1 -0
  52. package/dist/Checkbox/Checkbox.stories.js +34 -0
  53. package/dist/Checkbox/Checkbox.stories.js.map +1 -0
  54. package/dist/Checkbox/Checkbox.test.js +94 -0
  55. package/dist/Checkbox/Checkbox.test.js.map +1 -0
  56. package/dist/Checkbox/Checkbox.types.js +2 -0
  57. package/dist/Checkbox/Checkbox.types.js.map +1 -0
  58. package/dist/Checkbox/index.js +2 -0
  59. package/dist/Checkbox/index.js.map +1 -0
  60. package/dist/Icon/Icon.js +55 -0
  61. package/dist/Icon/Icon.js.map +1 -0
  62. package/dist/Icon/Icon.stories.js +45 -0
  63. package/dist/Icon/Icon.stories.js.map +1 -0
  64. package/dist/Icon/Icon.test.js +55 -0
  65. package/dist/Icon/Icon.test.js.map +1 -0
  66. package/dist/Icon/Icon.types.js +16 -0
  67. package/dist/Icon/Icon.types.js.map +1 -0
  68. package/dist/Icon/index.js +2 -0
  69. package/dist/Icon/index.js.map +1 -0
  70. package/dist/Modal/Modal.js +100 -0
  71. package/dist/Modal/Modal.js.map +1 -0
  72. package/dist/Modal/Modal.stories.js +127 -0
  73. package/dist/Modal/Modal.stories.js.map +1 -0
  74. package/dist/Modal/Modal.test.js +108 -0
  75. package/dist/Modal/Modal.test.js.map +1 -0
  76. package/dist/Modal/Modal.types.js +2 -0
  77. package/dist/Modal/Modal.types.js.map +1 -0
  78. package/dist/Modal/index.js +2 -0
  79. package/dist/Modal/index.js.map +1 -0
  80. package/dist/SeeqActionDropdown/SeeqActionDropdown.js +48 -0
  81. package/dist/SeeqActionDropdown/SeeqActionDropdown.js.map +1 -0
  82. package/dist/SeeqActionDropdown/SeeqActionDropdown.stories.js +80 -0
  83. package/dist/SeeqActionDropdown/SeeqActionDropdown.stories.js.map +1 -0
  84. package/dist/SeeqActionDropdown/SeeqActionDropdown.test.js +73 -0
  85. package/dist/SeeqActionDropdown/SeeqActionDropdown.test.js.map +1 -0
  86. package/dist/SeeqActionDropdown/SeeqActionDropdown.types.js +2 -0
  87. package/dist/SeeqActionDropdown/SeeqActionDropdown.types.js.map +1 -0
  88. package/dist/SeeqActionDropdown/index.js +2 -0
  89. package/dist/SeeqActionDropdown/index.js.map +1 -0
  90. package/dist/SeeqActionDropdown/variants.js +23 -0
  91. package/dist/SeeqActionDropdown/variants.js.map +1 -0
  92. package/dist/Select/Select.js +174 -0
  93. package/dist/Select/Select.js.map +1 -0
  94. package/dist/Select/Select.stories.js +80 -0
  95. package/dist/Select/Select.stories.js.map +1 -0
  96. package/dist/Select/Select.test.js +182 -0
  97. package/dist/Select/Select.test.js.map +1 -0
  98. package/dist/Select/Select.types.js +2 -0
  99. package/dist/Select/Select.types.js.map +1 -0
  100. package/dist/Select/index.js +3 -0
  101. package/dist/Select/index.js.map +1 -0
  102. package/dist/Tabs/Tabs.js +22 -0
  103. package/dist/Tabs/Tabs.js.map +1 -0
  104. package/dist/Tabs/Tabs.stories.js +91 -0
  105. package/dist/Tabs/Tabs.stories.js.map +1 -0
  106. package/dist/Tabs/Tabs.test.js +91 -0
  107. package/dist/Tabs/Tabs.test.js.map +1 -0
  108. package/dist/Tabs/Tabs.types.js +2 -0
  109. package/dist/Tabs/Tabs.types.js.map +1 -0
  110. package/dist/Tabs/index.js +2 -0
  111. package/dist/Tabs/index.js.map +1 -0
  112. package/dist/TextArea/TextArea.js +25 -0
  113. package/dist/TextArea/TextArea.js.map +1 -0
  114. package/dist/TextArea/TextArea.stories.js +46 -0
  115. package/dist/TextArea/TextArea.stories.js.map +1 -0
  116. package/dist/TextArea/TextArea.test.js +68 -0
  117. package/dist/TextArea/TextArea.test.js.map +1 -0
  118. package/dist/TextArea/TextArea.types.js +2 -0
  119. package/dist/TextArea/TextArea.types.js.map +1 -0
  120. package/dist/TextArea/index.js +2 -0
  121. package/dist/TextArea/index.js.map +1 -0
  122. package/dist/TextField/TextField.js +77 -0
  123. package/dist/TextField/TextField.js.map +1 -0
  124. package/dist/TextField/TextField.stories.js +64 -0
  125. package/dist/TextField/TextField.stories.js.map +1 -0
  126. package/dist/TextField/TextField.test.js +39 -0
  127. package/dist/TextField/TextField.test.js.map +1 -0
  128. package/dist/TextField/TextField.types.js +2 -0
  129. package/dist/TextField/TextField.types.js.map +1 -0
  130. package/dist/TextField/index.js +2 -0
  131. package/dist/TextField/index.js.map +1 -0
  132. package/dist/ToolbarButton/ToolbarButton.js +75 -0
  133. package/dist/ToolbarButton/ToolbarButton.js.map +1 -0
  134. package/dist/ToolbarButton/ToolbarButton.stories.js +94 -0
  135. package/dist/ToolbarButton/ToolbarButton.stories.js.map +1 -0
  136. package/dist/ToolbarButton/ToolbarButton.test.js +93 -0
  137. package/dist/ToolbarButton/ToolbarButton.test.js.map +1 -0
  138. package/dist/ToolbarButton/ToolbarButton.types.js +2 -0
  139. package/dist/ToolbarButton/ToolbarButton.types.js.map +1 -0
  140. package/dist/ToolbarButton/index.js +2 -0
  141. package/dist/ToolbarButton/index.js.map +1 -0
  142. package/dist/Tooltip/QTip.stories.js +45 -0
  143. package/dist/Tooltip/QTip.stories.js.map +1 -0
  144. package/dist/Tooltip/QTip.types.js +2 -0
  145. package/dist/Tooltip/QTip.types.js.map +1 -0
  146. package/dist/Tooltip/QTipPerformance.stories.js +30 -0
  147. package/dist/Tooltip/QTipPerformance.stories.js.map +1 -0
  148. package/dist/Tooltip/Qtip.js +155 -0
  149. package/dist/Tooltip/Qtip.js.map +1 -0
  150. package/dist/Tooltip/Tooltip.js +36 -0
  151. package/dist/Tooltip/Tooltip.js.map +1 -0
  152. package/dist/Tooltip/Tooltip.stories.js +32 -0
  153. package/dist/Tooltip/Tooltip.stories.js.map +1 -0
  154. package/dist/Tooltip/Tooltip.types.js +3 -0
  155. package/dist/Tooltip/Tooltip.types.js.map +1 -0
  156. package/dist/Tooltip/TooltipPerformance.stories.js +30 -0
  157. package/dist/Tooltip/TooltipPerformance.stories.js.map +1 -0
  158. package/dist/Tooltip/index.js +3 -0
  159. package/dist/Tooltip/index.js.map +1 -0
  160. package/dist/Tooltip/qTip.utilities.js +11 -0
  161. package/dist/Tooltip/qTip.utilities.js.map +1 -0
  162. package/dist/index.d.ts +2 -0
  163. package/dist/index.esm.js +50 -21
  164. package/dist/index.esm.js.map +1 -1
  165. package/dist/index.js +50 -20
  166. package/dist/index.js.map +1 -1
  167. package/dist/styles.css +14 -0
  168. package/dist/types.js +2 -0
  169. package/dist/types.js.map +1 -0
  170. package/dist/utils/browserId.js +29 -0
  171. package/dist/utils/browserId.js.map +1 -0
  172. package/dist/utils/svg.js +20 -0
  173. package/dist/utils/svg.js.map +1 -0
  174. package/dist/utils/validateStyleDimension.js +14 -0
  175. package/dist/utils/validateStyleDimension.js.map +1 -0
  176. package/dist/utils/validateStyleDimension.test.js +20 -0
  177. package/dist/utils/validateStyleDimension.test.js.map +1 -0
  178. package/package.json +1 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/ButtonWithPopover/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC"}
@@ -0,0 +1,26 @@
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
@@ -0,0 +1 @@
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"}
@@ -0,0 +1,34 @@
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
@@ -0,0 +1 @@
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,IAAC,KAAK,EAAC,GAAG,EAAC,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,YAAY,EAAE,OAAO,EAAC,kBAAkB,GAAG,CAC7F;QACN,6BAAK,SAAS,EAAC,QAAQ;YACrB,oBAAC,QAAQ,IACP,KAAK,EAAC,GAAG,EACT,IAAI,EAAE,IAAI,EACV,OAAO,EAAE,KAAK,EACd,QAAQ,EAAE,IAAI,EACd,KAAK,EACH;;oBAEE,+BAAM;iCAEF,EAER,OAAO,EAAC,kBAAkB,GAC1B,CACE;QACN,6BAAK,SAAS,EAAC,QAAQ;YACrB,oBAAC,QAAQ,IAAC,KAAK,EAAC,GAAG,EAAC,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,KAAK,EAAC,UAAU,EAAC,OAAO,EAAC,kBAAkB,GAAG,CACzG;QACN,6BAAK,SAAS,EAAC,QAAQ;YACrB,oBAAC,QAAQ,IAAC,KAAK,EAAC,GAAG,EAAC,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAC,kBAAkB,GAAG,CACxE;QACN,6BAAK,SAAS,EAAC,QAAQ;YACrB,oBAAC,QAAQ,IAAC,KAAK,EAAC,GAAG,EAAC,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAC,kBAAkB,GAAG,CACzE,CACL,CACJ,CAAC;IACF,MAAM,mBAAmB,GAAG,CAAC,IAA0B,EAAE,EAAE,CAAC,CAC1D;QACE,6BAAK,SAAS,EAAC,cAAc,IAAE,UAAU,CAAC,IAAI,CAAC,CAAO;QACtD,6BAAK,SAAS,EAAC,yCAAyC,IAAE,UAAU,CAAC,IAAI,CAAC,CAAO,CAChF,CACJ,CAAC;IAEF,OAAO,CACL,6BAAK,SAAS,EAAC,iCAAiC;QAC9C;YACE,0CAAe;YACd,mBAAmB,CAAC,UAAU,CAAC,CAC5B;QAEN;YACE,wCAAa;YACZ,mBAAmB,CAAC,OAAO,CAAC,CACzB,CACF,CACP,CAAC;AACJ,CAAC,CAAC"}
@@ -0,0 +1,94 @@
1
+ import React from 'react';
2
+ import '@testing-library/jest-dom';
3
+ import { render, screen } from '@testing-library/react';
4
+ import { Checkbox } from './Checkbox';
5
+ import userEvent from '@testing-library/user-event';
6
+ describe('Checkbox', () => {
7
+ class Context {
8
+ testId = 'checkboxTestId';
9
+ props = {
10
+ onChange: jest.fn(),
11
+ checked: false,
12
+ testId: this.testId,
13
+ };
14
+ }
15
+ let tc;
16
+ beforeEach(() => {
17
+ tc = new Context();
18
+ });
19
+ const renderCheckbox = (props) => render(React.createElement(Checkbox, { ...props }));
20
+ it('renders checkbox', () => {
21
+ renderCheckbox(tc.props);
22
+ expect(screen.getByTestId(tc.testId)).toBeInTheDocument();
23
+ });
24
+ it('renders radio', () => {
25
+ renderCheckbox({ ...tc.props, type: 'radio' });
26
+ expect(screen.getByTestId(tc.testId)).toHaveProperty('type', 'radio');
27
+ });
28
+ it('renders label', () => {
29
+ const label = 'look at this checkbox!';
30
+ renderCheckbox({ ...tc.props, label });
31
+ expect(screen.getByText(label)).toBeInTheDocument();
32
+ });
33
+ it('respects checked', () => {
34
+ renderCheckbox({ ...tc.props, checked: true });
35
+ expect(screen.getByTestId(tc.testId)).toBeChecked();
36
+ });
37
+ it('calls onChange handler', async () => {
38
+ const onChange = jest.fn();
39
+ renderCheckbox({ ...tc.props, onChange });
40
+ await userEvent.click(screen.getByTestId(tc.testId));
41
+ expect(onChange).toHaveBeenCalled();
42
+ });
43
+ it('calls onKeyDown handler', async () => {
44
+ const onKeyDown = jest.fn();
45
+ renderCheckbox({ ...tc.props, onKeyDown });
46
+ await userEvent.type(screen.getByTestId(tc.testId), 'a');
47
+ expect(onKeyDown).toHaveBeenCalled();
48
+ });
49
+ it('calls onClickHandler handler', async () => {
50
+ const onClick = jest.fn();
51
+ renderCheckbox({ ...tc.props, onClick });
52
+ await userEvent.click(screen.getByTestId(tc.testId));
53
+ expect(onClick).toHaveBeenCalled();
54
+ });
55
+ it('respects disabled', () => {
56
+ renderCheckbox({ ...tc.props, disabled: true });
57
+ expect(screen.getByTestId(tc.testId)).not.toBeEnabled();
58
+ });
59
+ it('renders label clickable', async () => {
60
+ const label = 'amazing checkbox';
61
+ const onClick = jest.fn();
62
+ renderCheckbox({ ...tc.props, label, onClick });
63
+ expect(screen.getByTestId(tc.testId)).not.toBeChecked();
64
+ await userEvent.click(screen.getByText(label));
65
+ expect(onClick).toHaveBeenCalled();
66
+ });
67
+ it('respects id', () => {
68
+ const id = 'checkboxId';
69
+ renderCheckbox({ ...tc.props, id });
70
+ expect(screen.getByTestId(tc.testId)).toHaveProperty('id', id);
71
+ });
72
+ it('respects name', () => {
73
+ const name = 'checkboxName';
74
+ renderCheckbox({ ...tc.props, name });
75
+ expect(screen.getByTestId(tc.testId)).toHaveProperty('name', name);
76
+ });
77
+ it('respects name', () => {
78
+ const value = 'priceless';
79
+ renderCheckbox({ ...tc.props, value });
80
+ expect(screen.getByTestId(tc.testId)).toHaveProperty('value', value);
81
+ });
82
+ it('applies extraClassNames', () => {
83
+ const extraClassNames = 'extra styling so fancy';
84
+ renderCheckbox({ ...tc.props, extraClassNames });
85
+ expect(screen.getByTestId(tc.testId).parentNode).toHaveClass(extraClassNames);
86
+ });
87
+ it('applies extraLabelClassNames', () => {
88
+ const extraLabelClassNames = 'special label';
89
+ const label = 'amazing checkbox';
90
+ renderCheckbox({ ...tc.props, extraLabelClassNames, label });
91
+ expect(screen.getByText(label)).toHaveClass(extraLabelClassNames);
92
+ });
93
+ });
94
+ //# sourceMappingURL=Checkbox.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Checkbox.test.js","sourceRoot":"","sources":["../../src/Checkbox/Checkbox.test.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,2BAA2B,CAAC;AACnC,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAGxD,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,SAAS,MAAM,6BAA6B,CAAC;AAEpD,QAAQ,CAAC,UAAU,EAAE,GAAG,EAAE;IACxB,MAAM,OAAO;QACX,MAA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js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Checkbox.types.js","sourceRoot":"","sources":["../../src/Checkbox/Checkbox.types.ts"],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ export { Checkbox as default } from './Checkbox';
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/Checkbox/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,IAAI,OAAO,EAAE,MAAM,YAAY,CAAC"}
@@ -0,0 +1,55 @@
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
@@ -0,0 +1 @@
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,EAA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AC1E,MAAM,gBAAgB,GAAG,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,iBAAiB,CAAC;IAC1E,MAAM,KAAK,GAAG,IAAI,KAAK,OAAO,IAAI,KAAK,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;IACzD,MAAM,iBAAiB,GAAG,GAAG,gBAAgB,IAAI,IAAI,IAAI,KAAK,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,IAAI,KAAK,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE;IACnG,sBAAsB,CAAC,IAAI,CAAC,IAAI,qBAAqB,CAAC,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"}
@@ -0,0 +1,45 @@
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", { className: "tw-dark tw-bg-sq-dark-background" },
25
+ React.createElement(Icon, { icon: "fc-announcements", small: true, extraClassNames: 'tw-p-2', type: iconType, color: iconType === 'color' ? 'purple' : undefined }),
26
+ React.createElement(Icon, { icon: "fc-announcements", extraClassNames: 'tw-p-2', type: iconType, color: iconType === 'color' ? '#928378' : undefined }),
27
+ React.createElement(Icon, { icon: "fc-announcements", large: true, extraClassNames: 'tw-p-2', type: iconType, color: iconType === 'color' ? 'pink' : undefined })),
28
+ React.createElement("br", null)));
29
+ })));
30
+ };
31
+ return (React.createElement("div", { className: "tw-grid tw-grid-cols-4 tw-gap-4" },
32
+ React.createElement("div", { className: "color_topic" },
33
+ React.createElement("b", null, "Topic Colors"),
34
+ renderAllVariations()),
35
+ React.createElement("div", { className: "color_analysis" },
36
+ React.createElement("b", null, "Analysis Colors"),
37
+ renderAllVariations()),
38
+ React.createElement("div", { className: "color_datalab" },
39
+ React.createElement("b", null, "Datalab Colors"),
40
+ renderAllVariations()),
41
+ React.createElement("div", { className: "color_vantage" },
42
+ React.createElement("b", null, "Vantage Colors"),
43
+ renderAllVariations())));
44
+ };
45
+ //# sourceMappingURL=Icon.stories.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Icon.stories.js","sourceRoot":"","sources":["../../src/Icon/Icon.stories.ts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;YACpB,mBAAmB,EAAE,CAClB,CACF,CACP,CAAC;AACJ,CAAC,CAAC"}
@@ -0,0 +1,55 @@
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
@@ -0,0 +1 @@
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,MAAM,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AACxD,OAAO,IAAI,MAAM,QAAQ,CAAC;AAG1B,QAAQ,CAAC,MAAM,EAAE,GAAG,EAAE;IACpB,MAAM,OAAO;QACX,MAAM,GAAG,YAAY,CAAC;QACtB,IAAI,GAAG,UAAU,CAAC;QAClB,KAAK,GAAc;YACjB,IAAI,EAAE,IAAI,CAAC,IAAI;YACf,OAAO,EAAE,IAAI,CAAC,EAAE,EAAE;YAClB,MAAM,EAAE,IAAI,CAAC,MAAM;SACpB,CAAC;KACH;IAED,IAAI,EAAW,CAAC;IAChB,UAAU,CAAC,GAAG,EAAE;QACd,EAAE,GAAG,IAAI,OAAO,EAAE,CAAC;IACrB,CAAC,CAAC,CAAC;IAEH,MAAM,UAAU,GAAG,CAAC,KAAgB,EAAE,EAAE,CAAC,MAAM,CAAC,oBAAC,IAAI,OAAK,KAAK,GAAI,CAAC,CAAC;IAErE,EAAE,CAAC,cAAc,EAAE,GAAG,EAAE;QACtB,UAAU,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC;QACrB,MAAM,CAAC,MAAM,CAAC,WAAW,CAAC,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC,WAAW,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC;IAC7D,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,oBAAoB,EAAE,GAAG,EAAE;QAC5B,UAAU,CAAC,EAAE,GAAG,EAAE,CAAC,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;QACzC,MAAM,CAAC,MAAM,CA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AE;YACrC,UAAU,CAAC,EAAE,GAAG,EAAE,CAAC,KAAK,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,CAAC,CAAC;YAC7D,MAAM,CAAC,MAAM,CAAC,WAAW,CAAC,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC,WAAW,CAAC,gBAAgB,CAAC,CAAC;QACtE,CAAC,CAAC,CAAC;QAEH,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"}
@@ -0,0 +1,16 @@
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
@@ -0,0 +1 @@
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"}
@@ -0,0 +1,2 @@
1
+ export { default } from './Icon';
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/Icon/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAC"}
@@ -0,0 +1,100 @@
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, }) => {
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()), "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
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Modal.js","source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