@seeqdev/qomponents 0.0.79 → 0.0.80

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 (163) hide show
  1. package/dist/ButtonWithDropdown/ButtonWithDropdown.types.d.ts +0 -6
  2. package/dist/ButtonWithPopover/ButtonWithPopover.types.d.ts +0 -6
  3. package/dist/index.esm.js +67 -43
  4. package/dist/index.esm.js.map +1 -1
  5. package/dist/index.js +67 -43
  6. package/dist/index.js.map +1 -1
  7. package/package.json +1 -1
  8. package/dist/Accordion/Accordion.js +0 -9
  9. package/dist/Accordion/Accordion.js.map +0 -1
  10. package/dist/Accordion/Accordion.stories.js +0 -109
  11. package/dist/Accordion/Accordion.stories.js.map +0 -1
  12. package/dist/Accordion/Accordion.test.js +0 -55
  13. package/dist/Accordion/Accordion.test.js.map +0 -1
  14. package/dist/Accordion/Accordion.types.js +0 -2
  15. package/dist/Accordion/Accordion.types.js.map +0 -1
  16. package/dist/Accordion/index.js +0 -2
  17. package/dist/Accordion/index.js.map +0 -1
  18. package/dist/Button/Button.js +0 -90
  19. package/dist/Button/Button.js.map +0 -1
  20. package/dist/Button/Button.stories.js +0 -85
  21. package/dist/Button/Button.stories.js.map +0 -1
  22. package/dist/Button/Button.test.js +0 -49
  23. package/dist/Button/Button.test.js.map +0 -1
  24. package/dist/Button/Button.types.js +0 -5
  25. package/dist/Button/Button.types.js.map +0 -1
  26. package/dist/Button/index.js +0 -2
  27. package/dist/Button/index.js.map +0 -1
  28. package/dist/ButtonWithDropdown/ButtonWithDropdown.js +0 -64
  29. package/dist/ButtonWithDropdown/ButtonWithDropdown.js.map +0 -1
  30. package/dist/ButtonWithDropdown/ButtonWithDropdown.stories.js +0 -93
  31. package/dist/ButtonWithDropdown/ButtonWithDropdown.stories.js.map +0 -1
  32. package/dist/ButtonWithDropdown/ButtonWithDropdown.test.js +0 -72
  33. package/dist/ButtonWithDropdown/ButtonWithDropdown.test.js.map +0 -1
  34. package/dist/ButtonWithDropdown/ButtonWithDropdown.types.js +0 -2
  35. package/dist/ButtonWithDropdown/ButtonWithDropdown.types.js.map +0 -1
  36. package/dist/ButtonWithDropdown/index.js +0 -2
  37. package/dist/ButtonWithDropdown/index.js.map +0 -1
  38. package/dist/ButtonWithPopover/ButtonWithPopover.js +0 -53
  39. package/dist/ButtonWithPopover/ButtonWithPopover.js.map +0 -1
  40. package/dist/ButtonWithPopover/ButtonWithPopover.stories.js +0 -72
  41. package/dist/ButtonWithPopover/ButtonWithPopover.stories.js.map +0 -1
  42. package/dist/ButtonWithPopover/ButtonWithPopover.test.js +0 -82
  43. package/dist/ButtonWithPopover/ButtonWithPopover.test.js.map +0 -1
  44. package/dist/ButtonWithPopover/ButtonWithPopover.types.js +0 -2
  45. package/dist/ButtonWithPopover/ButtonWithPopover.types.js.map +0 -1
  46. package/dist/ButtonWithPopover/index.js +0 -2
  47. package/dist/ButtonWithPopover/index.js.map +0 -1
  48. package/dist/Checkbox/Checkbox.js +0 -26
  49. package/dist/Checkbox/Checkbox.js.map +0 -1
  50. package/dist/Checkbox/Checkbox.stories.js +0 -34
  51. package/dist/Checkbox/Checkbox.stories.js.map +0 -1
  52. package/dist/Checkbox/Checkbox.test.js +0 -94
  53. package/dist/Checkbox/Checkbox.test.js.map +0 -1
  54. package/dist/Checkbox/Checkbox.types.js +0 -2
  55. package/dist/Checkbox/Checkbox.types.js.map +0 -1
  56. package/dist/Checkbox/index.js +0 -2
  57. package/dist/Checkbox/index.js.map +0 -1
  58. package/dist/Icon/Icon.js +0 -55
  59. package/dist/Icon/Icon.js.map +0 -1
  60. package/dist/Icon/Icon.stories.js +0 -41
  61. package/dist/Icon/Icon.stories.js.map +0 -1
  62. package/dist/Icon/Icon.test.js +0 -55
  63. package/dist/Icon/Icon.test.js.map +0 -1
  64. package/dist/Icon/Icon.types.js +0 -16
  65. package/dist/Icon/Icon.types.js.map +0 -1
  66. package/dist/Icon/index.js +0 -2
  67. package/dist/Icon/index.js.map +0 -1
  68. package/dist/Modal/Modal.js +0 -88
  69. package/dist/Modal/Modal.js.map +0 -1
  70. package/dist/Modal/Modal.stories.js +0 -176
  71. package/dist/Modal/Modal.stories.js.map +0 -1
  72. package/dist/Modal/Modal.test.js +0 -108
  73. package/dist/Modal/Modal.test.js.map +0 -1
  74. package/dist/Modal/Modal.types.js +0 -2
  75. package/dist/Modal/Modal.types.js.map +0 -1
  76. package/dist/Modal/index.js +0 -2
  77. package/dist/Modal/index.js.map +0 -1
  78. package/dist/NewWorkbench/NewWorkbench.js +0 -48
  79. package/dist/NewWorkbench/NewWorkbench.js.map +0 -1
  80. package/dist/NewWorkbench/NewWorkbench.stories.js +0 -77
  81. package/dist/NewWorkbench/NewWorkbench.stories.js.map +0 -1
  82. package/dist/NewWorkbench/NewWorkbench.test.js +0 -73
  83. package/dist/NewWorkbench/NewWorkbench.test.js.map +0 -1
  84. package/dist/NewWorkbench/NewWorkbench.types.js +0 -2
  85. package/dist/NewWorkbench/NewWorkbench.types.js.map +0 -1
  86. package/dist/NewWorkbench/index.js +0 -2
  87. package/dist/NewWorkbench/index.js.map +0 -1
  88. package/dist/NewWorkbench/variants.js +0 -23
  89. package/dist/NewWorkbench/variants.js.map +0 -1
  90. package/dist/Select/Select.js +0 -171
  91. package/dist/Select/Select.js.map +0 -1
  92. package/dist/Select/Select.stories.js +0 -77
  93. package/dist/Select/Select.stories.js.map +0 -1
  94. package/dist/Select/Select.test.js +0 -182
  95. package/dist/Select/Select.test.js.map +0 -1
  96. package/dist/Select/Select.types.js +0 -2
  97. package/dist/Select/Select.types.js.map +0 -1
  98. package/dist/Select/index.js +0 -2
  99. package/dist/Select/index.js.map +0 -1
  100. package/dist/Tabs/Tabs.js +0 -22
  101. package/dist/Tabs/Tabs.js.map +0 -1
  102. package/dist/Tabs/Tabs.stories.js +0 -91
  103. package/dist/Tabs/Tabs.stories.js.map +0 -1
  104. package/dist/Tabs/Tabs.test.js +0 -91
  105. package/dist/Tabs/Tabs.test.js.map +0 -1
  106. package/dist/Tabs/Tabs.types.js +0 -2
  107. package/dist/Tabs/Tabs.types.js.map +0 -1
  108. package/dist/Tabs/index.js +0 -2
  109. package/dist/Tabs/index.js.map +0 -1
  110. package/dist/TextArea/TextArea.js +0 -23
  111. package/dist/TextArea/TextArea.js.map +0 -1
  112. package/dist/TextArea/TextArea.stories.js +0 -39
  113. package/dist/TextArea/TextArea.stories.js.map +0 -1
  114. package/dist/TextArea/TextArea.test.js +0 -68
  115. package/dist/TextArea/TextArea.test.js.map +0 -1
  116. package/dist/TextArea/TextArea.types.js +0 -2
  117. package/dist/TextArea/TextArea.types.js.map +0 -1
  118. package/dist/TextArea/index.js +0 -2
  119. package/dist/TextArea/index.js.map +0 -1
  120. package/dist/TextField/TextField.js +0 -64
  121. package/dist/TextField/TextField.js.map +0 -1
  122. package/dist/TextField/TextField.stories.js +0 -41
  123. package/dist/TextField/TextField.stories.js.map +0 -1
  124. package/dist/TextField/TextField.test.js +0 -35
  125. package/dist/TextField/TextField.test.js.map +0 -1
  126. package/dist/TextField/TextField.types.js +0 -2
  127. package/dist/TextField/TextField.types.js.map +0 -1
  128. package/dist/TextField/index.js +0 -2
  129. package/dist/TextField/index.js.map +0 -1
  130. package/dist/ToolbarButton/ToolbarButton.js +0 -73
  131. package/dist/ToolbarButton/ToolbarButton.js.map +0 -1
  132. package/dist/ToolbarButton/ToolbarButton.stories.js +0 -89
  133. package/dist/ToolbarButton/ToolbarButton.stories.js.map +0 -1
  134. package/dist/ToolbarButton/ToolbarButton.test.js +0 -93
  135. package/dist/ToolbarButton/ToolbarButton.test.js.map +0 -1
  136. package/dist/ToolbarButton/ToolbarButton.types.js +0 -2
  137. package/dist/ToolbarButton/ToolbarButton.types.js.map +0 -1
  138. package/dist/ToolbarButton/index.js +0 -2
  139. package/dist/ToolbarButton/index.js.map +0 -1
  140. package/dist/Tooltip/QTip.stories.js +0 -40
  141. package/dist/Tooltip/QTip.stories.js.map +0 -1
  142. package/dist/Tooltip/QTip.types.js +0 -2
  143. package/dist/Tooltip/QTip.types.js.map +0 -1
  144. package/dist/Tooltip/QTipPerformance.stories.js +0 -30
  145. package/dist/Tooltip/QTipPerformance.stories.js.map +0 -1
  146. package/dist/Tooltip/Qtip.js +0 -158
  147. package/dist/Tooltip/Qtip.js.map +0 -1
  148. package/dist/Tooltip/Tooltip.js +0 -36
  149. package/dist/Tooltip/Tooltip.js.map +0 -1
  150. package/dist/Tooltip/Tooltip.stories.js +0 -32
  151. package/dist/Tooltip/Tooltip.stories.js.map +0 -1
  152. package/dist/Tooltip/Tooltip.types.js +0 -3
  153. package/dist/Tooltip/Tooltip.types.js.map +0 -1
  154. package/dist/Tooltip/TooltipPerformance.stories.js +0 -30
  155. package/dist/Tooltip/TooltipPerformance.stories.js.map +0 -1
  156. package/dist/Tooltip/index.js +0 -3
  157. package/dist/Tooltip/index.js.map +0 -1
  158. package/dist/Tooltip/qTip.utilities.js +0 -11
  159. package/dist/Tooltip/qTip.utilities.js.map +0 -1
  160. package/dist/types.js +0 -2
  161. package/dist/types.js.map +0 -1
  162. package/dist/utils/browserId.js +0 -29
  163. package/dist/utils/browserId.js.map +0 -1
@@ -1,89 +0,0 @@
1
- import React from 'react';
2
- import { ToolbarButton } from './ToolbarButton';
3
- import Icon from '../Icon';
4
- import { QTip } from '../Tooltip/Qtip';
5
- export default {
6
- title: 'Toolbar Button',
7
- };
8
- export const AllToolbarButtonVariants = () => {
9
- const options = [
10
- { value: 'a', label: 'Chocolate' },
11
- { value: 'b', label: 'Strawberry' },
12
- { value: 'c', label: 'Vanilla' },
13
- { value: 'd', label: 'Rocky Road' },
14
- { value: 'e', label: 'Crazy Cow' },
15
- { value: 'f', label: 'Almond Joy' },
16
- { value: 'g', label: 'All of the above' },
17
- ];
18
- const colorOptions = [
19
- { value: 'h', label: 'pink' },
20
- { value: 'i', label: 'purple' },
21
- { value: 'j', label: 'green' },
22
- { value: 'k', label: 'red' },
23
- ];
24
- const allToolbarButtons = (isDark) => (React.createElement("div", { className: isDark ? 'tw-dark tw-bg-sq-dark-background' : '' },
25
- React.createElement("div", { className: "tw-p-5 " },
26
- React.createElement(ToolbarButton, { icon: "fc-y-axis", label: "Popover", testId: "basic-popover1", tooltipText: "This is a small popover.", tooltipOptions: { position: 'top', delay: 0 }, isHtmlTooltip: false, isSmall: true, popoverContent: React.createElement("div", { className: "tw-text-sm dark:tw-text-white" },
27
- React.createElement("p", { className: "tw-bg-gray-200 dark:tw-bg-gray-700 tw-p-2" }, "Flavors"),
28
- options.map((option) => (React.createElement("div", { key: option.value, className: "tw-flex tw-items-center tw-p-2 hover:tw-bg-green-500" },
29
- React.createElement(Icon, { type: "color", color: "green", icon: "fc-check", extraClassNames: "tw-mr-2" }),
30
- React.createElement("span", null, option.label)))),
31
- React.createElement("p", { className: "tw-bg-gray-200 dark:tw-bg-gray-700 tw-p-2" }, "Colors"),
32
- colorOptions.map((option) => (React.createElement("div", { key: option.value, className: "tw-flex tw-items-center tw-p-2" },
33
- React.createElement(Icon, { type: "color", color: "green", icon: "fc-check", extraClassNames: "tw-mr-2" }),
34
- React.createElement("span", null, option.label))))) })),
35
- React.createElement("div", { className: "tw-p-5 " },
36
- React.createElement(ToolbarButton, { icon: "fc-y-axis", label: "Normal", testId: "basic-popover1", tooltipText: "This is a normal popover.", tooltipOptions: { position: 'top', delay: 0 }, isHtmlTooltip: false, popoverContent: React.createElement("div", { className: "tw-text-sm dark:tw-text-white" },
37
- React.createElement("p", { className: "tw-bg-gray-200 dark:tw-bg-gray-700 tw-p-2" }, "Flavors"),
38
- options.map((option) => (React.createElement("div", { key: option.value, className: "tw-flex tw-items-center tw-p-2 hover:tw-bg-green-500" },
39
- React.createElement(Icon, { type: "color", color: "green", icon: "fc-check", extraClassNames: "tw-mr-2" }),
40
- React.createElement("span", null, option.label)))),
41
- React.createElement("p", { className: "tw-bg-gray-200 dark:tw-bg-gray-700 tw-p-2" }, "Colors"),
42
- colorOptions.map((option) => (React.createElement("div", { key: option.value, className: "tw-flex tw-items-center tw-p-2" },
43
- React.createElement(Icon, { type: "color", color: "green", icon: "fc-check", extraClassNames: "tw-mr-2" }),
44
- React.createElement("span", null, option.label))))) })),
45
- React.createElement("div", { className: "tw-p-5 " },
46
- React.createElement(ToolbarButton, { icon: "fc-y-axis", label: "With arrow", testId: "basic-popover1", tooltipText: "This is a normal popover.", tooltipOptions: { position: 'top', delay: 0 }, hasArrow: true, isHtmlTooltip: false, popoverContent: React.createElement("div", { className: "tw-text-sm dark:tw-text-white" },
47
- React.createElement("p", { className: "tw-bg-gray-200 dark:tw-bg-gray-700 tw-p-2" }, "Flavors"),
48
- options.map((option) => (React.createElement("div", { key: option.value, className: "tw-flex tw-items-center tw-p-2 hover:tw-bg-green-500" },
49
- React.createElement(Icon, { type: "color", color: "green", icon: "fc-check", extraClassNames: "tw-mr-2" }),
50
- React.createElement("span", null, option.label)))),
51
- React.createElement("p", { className: "tw-bg-gray-200 dark:tw-bg-gray-700 tw-p-2" }, "Colors"),
52
- colorOptions.map((option) => (React.createElement("div", { key: option.value, className: "tw-flex tw-items-center tw-p-2" },
53
- React.createElement(Icon, { type: "color", color: "green", icon: "fc-check", extraClassNames: "tw-mr-2" }),
54
- React.createElement("span", null, option.label))))) })),
55
- React.createElement("div", { className: "tw-p-5 " },
56
- React.createElement("p", { className: "tw-text-sq-color-dark tw-text-[10px]" }, "Without popup"),
57
- React.createElement(ToolbarButton, { icon: "fc-y-axis", label: "Button", testId: "basic-popover3", isHtmlTooltip: false })),
58
- React.createElement("div", { className: "tw-p-5 " },
59
- React.createElement(ToolbarButton, { icon: "fc-y-axis", label: "Disabled", testId: "basic-popover2", tooltipText: "This is a popover.", tooltipOptions: { position: 'top' }, isHtmlTooltip: false, disabled: true, popoverContent: React.createElement("div", { className: "tw-border tw-border-gray-100 tw-p-2 tw-rounded-sm tw-text-sm dark:tw-bg-sq-dark-background" },
60
- React.createElement("p", { className: "tw-bg-gray-200 dark:tw-bg-gray-700 tw-p-2" }, "Flavors"),
61
- options.map((option) => (React.createElement("div", { key: option.value, className: "tw-flex tw-items-center tw-p-2 hover:tw-bg-green-500" },
62
- React.createElement(Icon, { type: "color", color: "green", icon: "fc-check", extraClassNames: "tw-mr-2" }),
63
- React.createElement("span", null, option.label)))),
64
- React.createElement("p", { className: "tw-bg-gray-200 dark:tw-bg-gray-700 tw-p-2" }, "Colors"),
65
- colorOptions.map((option) => (React.createElement("div", { key: option.value, className: "tw-flex tw-items-center tw-p-2" },
66
- React.createElement(Icon, { type: "color", color: "green", icon: "fc-check", extraClassNames: "tw-mr-2" }),
67
- React.createElement("span", null, option.label))))) })),
68
- React.createElement("div", { className: "tw-p-5 " },
69
- React.createElement(ToolbarButton, { id: "scatterPlotFlipXY", isActive: false, disabled: true, testId: "scatterPlotFlipXY", label: "", icon: "fc-grab-window", tooltipText: "This is a large disabled popover.", tooltipOptions: { position: 'top' }, extraClassNames: "no-border ml5" })),
70
- React.createElement("div", { className: "tw-p-5 " },
71
- React.createElement(ToolbarButton, { icon: "fc-y-axis", tooltipText: "This is a large popover icon", tooltipOptions: { position: 'top', delay: 0 }, testId: "basic-popover4", isHtmlTooltip: false })),
72
- React.createElement("div", { className: "tw-p-5 " },
73
- React.createElement(ToolbarButton, { icon: "fc-y-axis", label: "Active", testId: "basic-popover5", tooltipText: "This is a button.", tooltipOptions: { position: 'top', delay: 0 }, isHtmlTooltip: false, isActive: true }))));
74
- const renderAllVariations = () => (React.createElement("div", { className: "tw-grid tw-grid-cols-2 tw-gap-4 tw-p-4" },
75
- allToolbarButtons(),
76
- allToolbarButtons(true)));
77
- return (React.createElement("div", { className: "tw-grid tw-grid-cols-3 tw-gap-4" },
78
- React.createElement(QTip, null),
79
- React.createElement("div", { className: "color_topic" },
80
- React.createElement("b", null, "Topic Colors"),
81
- renderAllVariations()),
82
- React.createElement("div", { className: "color_analysis" },
83
- React.createElement("b", null, "Analysis Colors"),
84
- renderAllVariations()),
85
- React.createElement("div", { className: "color_datalab" },
86
- React.createElement("b", null, "Datalab Colors"),
87
- renderAllVariations())));
88
- };
89
- //# sourceMappingURL=ToolbarButton.stories.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ToolbarButton.stories.js","sourceRoot":"","sources":["../../src/ToolbarButton/ToolbarButton.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,IAAI,MAAM,SAAS,CAAC;AAC3B,OAAO,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AAEvC,eAAe;IACb,KAAK,EAAE,gBAAgB;CACxB,CAAC;AAEF,MAAM,CAAC,MAAM,wBAAwB,GAAG,GAAG,EAAE;IAC3C,MAAM,OAAO,GAAG;QACd,EAAE,KAAK,EAAE,GAAG,EAAE,KAAK,EAAE,WAAW,EAAE;QAClC,EAAE,KAAK,EAAE,GAAG,EAAE,KAAK,EAAE,YAAY,EAAE;QACnC,EAAE,KAAK,EAAE,GAAG,EAAE,KAAK,EAAE,SAAS,EAAE;QAChC,EAAE,KAAK,EAAE,GAAG,EAAE,KAAK,EAAE,YAAY,EAAE;QACnC,EAAE,KAAK,EAAE,GAAG,EAAE,KAAK,EAAE,WAAW,EAAE;QAClC,EAAE,KAAK,EAAE,GAAG,EAAE,KAAK,EAAE,YAAY,EAAE;QACnC,EAAE,KAAK,EAAE,GAAG,EAAE,KAAK,EAAE,kBAAkB,EAAE;KAC1C,CAAC;IAEF,MAAM,YAAY,GAAG;QACnB,EAAE,KAAK,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,EAAE;QAC7B,EAAE,KAAK,EAAE,GAAG,EAAE,KAAK,EAAE,QAAQ,EAAE;QAC/B,EAAE,KAAK,EAAE,GAAG,EAAE,KAAK,EAAE,OAAO,EAAE;QAC9B,EAAE,KAAK,EAAE,GAAG,EAAE,KAAK,EAAE,KAAK,EAAE;KAC7B,CAAC;IAEF,MAAM,iBAAiB,GAAG,CAAC,MAAgB,EAAE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EN,6BAAK,SAAS,EAAC,SAAS;YACtB,oBAAC,aAAa,IACZ,IAAI,EAAC,WAAW,EAChB,KAAK,EAAC,QAAQ,EACd,MAAM,EAAC,gBAAgB,EACvB,WAAW,EAAC,mBAAmB,EAC/B,cAAc,EAAE,EAAE,QAAQ,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,EAAE,EAC7C,aAAa,EAAE,KAAK,EACpB,QAAQ,SACR,CACE,CACF,CACP,CAAC;IACF,MAAM,mBAAmB,GAAG,GAAG,EAAE,CAAC,CAChC,6BAAK,SAAS,EAAC,wCAAwC;QACpD,iBAAiB,EAAE;QACnB,iBAAiB,CAAC,IAAI,CAAC,CACpB,CACP,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,CACF,CACP,CAAC;AACJ,CAAC,CAAC"}
@@ -1,93 +0,0 @@
1
- import React from 'react';
2
- import '@testing-library/jest-dom';
3
- import { render, screen } from '@testing-library/react';
4
- import userEvent from '@testing-library/user-event';
5
- import { ToolbarButton } from './ToolbarButton';
6
- import Icon from '../Icon';
7
- describe('ToolbarButton', () => {
8
- const options = [
9
- { value: 'a', label: 'Chocolate' },
10
- { value: 'b', label: 'Strawberry' },
11
- { value: 'c', label: 'Vanilla' },
12
- { value: 'd', label: 'Rocky Road' },
13
- { value: 'e', label: 'Crazy Cow' },
14
- { value: 'f', label: 'Almond Joy' },
15
- { value: 'g', label: 'All of the above' },
16
- ];
17
- const colorOptions = [
18
- { value: 'h', label: 'pink' },
19
- { value: 'i', label: 'purple' },
20
- { value: 'j', label: 'green' },
21
- { value: 'k', label: 'red' },
22
- ];
23
- const popoverContent = (React.createElement("div", { className: "tw-text-sm" },
24
- React.createElement("p", { className: "tw-bg-gray-200 tw-p-2" }, "Flavors"),
25
- options.map((option) => (React.createElement("div", { key: option.value, className: "tw-flex tw-items-center tw-p-2 hover:tw-bg-green-500" },
26
- React.createElement(Icon, { type: "color", color: "green", icon: "fc-check", extraClassNames: "tw-mr-2" }),
27
- React.createElement("span", null, option.label)))),
28
- React.createElement("p", null, "Colors"),
29
- colorOptions.map((option) => (React.createElement("div", { key: option.value, className: "tw-flex tw-items-center tw-p-2" },
30
- React.createElement(Icon, { type: "color", color: "green", icon: "fc-check", extraClassNames: "tw-mr-2" }),
31
- React.createElement("span", null, option.label))))));
32
- const mockOnClick = jest.fn();
33
- class Context {
34
- testId = 'popoverTestId';
35
- label = 'popover label';
36
- props = {
37
- label: this.label,
38
- onClick: mockOnClick,
39
- testId: this.testId,
40
- icon: 'fc-y-axis',
41
- tooltipText: 'This is a popover.',
42
- tooltipOptions: { position: 'top', delay: 0 },
43
- isHtmlTooltip: false,
44
- isSmall: false,
45
- popoverContent,
46
- };
47
- }
48
- let tc;
49
- beforeEach(() => {
50
- tc = new Context();
51
- jest.clearAllMocks();
52
- });
53
- const renderToolbarButton = (props) => render(React.createElement(ToolbarButton, { ...props }));
54
- const openPopover = async () => {
55
- const popover = screen.getByTestId(tc.testId);
56
- await userEvent.click(popover);
57
- };
58
- it('renders popover icon without label when small', () => {
59
- tc.props.isSmall = true;
60
- renderToolbarButton(tc.props);
61
- const popoverLabel = screen.queryByText(tc.label);
62
- expect(popoverLabel).not.toBeInTheDocument();
63
- });
64
- it('renders popover trigger button', () => {
65
- renderToolbarButton(tc.props);
66
- expect(screen.getByText(tc.label)).toBeInTheDocument();
67
- });
68
- it('opens popover on click', async () => {
69
- renderToolbarButton(tc.props);
70
- await openPopover();
71
- expect(screen.getByText(options[2].label)).toBeVisible();
72
- });
73
- it('renders disabled popover trigger', async () => {
74
- renderToolbarButton({ ...tc.props, disabled: true });
75
- await openPopover();
76
- expect(mockOnClick).not.toHaveBeenCalled();
77
- });
78
- it('handles click events', async () => {
79
- const handleClick = jest.fn();
80
- tc.props.onClick = handleClick;
81
- const { getByTestId } = renderToolbarButton(tc.props);
82
- await userEvent.click(getByTestId(tc.testId));
83
- expect(handleClick).toHaveBeenCalled();
84
- });
85
- it('handles click events within popover and does not close the popover', async () => {
86
- renderToolbarButton(tc.props);
87
- expect(screen.queryByText(options[4].label)).not.toBeInTheDocument();
88
- await openPopover();
89
- await userEvent.click(screen.getByText(options[3].label));
90
- expect(screen.getByText(options[4].label)).toBeInTheDocument();
91
- });
92
- });
93
- //# sourceMappingURL=ToolbarButton.test.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ToolbarButton.test.js","sourceRoot":"","sources":["../../src/ToolbarButton/ToolbarButton.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,SAAS,MAAM,6BAA6B,CAAC;AAEpD,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAEhD,OAAO,IAAI,MAAM,SAAS,CAAC;AAE3B,QAAQ,CAAC,eAAe,EAAE,GAAG,EAAE;IAC7B,MAAM,OAAO,GAAG;QACd,EAAE,KAAK,EAAE,GAAG,EAAE,KAAK,EAAE,WAAW,EAAE;QAClC,EAAE,KAAK,EAAE,GAAG,EAAE,KAAK,EAAE,YAAY,EAAE;QACnC,EAAE,KAAK,EAAE,GAAG,EAAE,KAAK,EAAE,SAAS,EAAE;QAChC,EAAE,KAAK,EAAE,GAAG,EAAE,KAAK,EAAE,YAAY,EAAE;QACnC,EAAE,KAAK,EAAE,GAAG,EAAE,KAAK,EAAE,WAAW,EAAE;QAClC,EAAE,KAAK,EAAE,GAAG,EAAE,KAAK,EAAE,YAAY,EAAE;QACnC,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,CAAC,iBAAiB,EAAE,CAAC;QACrE,MAAM,WAAW,EAAE,CAAC;QACpB,MAAM,SAAS,CAAC,KAAK,CAAC,MAAM,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC;QAC1D,MAAM,CAAC,MAAM,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,iBAAiB,EAAE,CAAC;IACjE,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
@@ -1,2 +0,0 @@
1
- export const toolbarButtonVariants = ['outline', 'theme', 'theme-light', 'warning', 'danger', 'no-border'];
2
- //# sourceMappingURL=ToolbarButton.types.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ToolbarButton.types.js","sourceRoot":"","sources":["../../src/ToolbarButton/ToolbarButton.types.ts"],"names":[],"mappings":"AAKA,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,SAAS,EAAE,OAAO,EAAE,aAAa,EAAE,SAAS,EAAE,QAAQ,EAAE,WAAW,CAAU,CAAC"}
@@ -1,2 +0,0 @@
1
- export { ToolbarButton as default } from './ToolbarButton';
2
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/ToolbarButton/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,IAAI,OAAO,EAAE,MAAM,iBAAiB,CAAC"}
@@ -1,40 +0,0 @@
1
- import React from 'react';
2
- import Button from '../Button';
3
- import { tooltipPositions } from './Tooltip.types';
4
- import { QTip } from './Qtip';
5
- import Icon from '../Icon';
6
- export default {
7
- title: 'Tooltip',
8
- };
9
- export const AllQTips = () => {
10
- const renderButtonsWithTooltip = () => tooltipPositions.map((position) => (React.createElement("div", { key: `${position}_button` },
11
- React.createElement(Button, { tooltip: `Tooltip on the ${position}`, label: position, tooltipOptions: { position } }))));
12
- const renderIconsWithHtmlTooltip = () => tooltipPositions.map((position) => (React.createElement("div", { key: `${position}_icon` },
13
- React.createElement(Icon, { tooltip: "<div><h2>Fancy Tooltip</h2> This is a special tooltip. Why? <br />Because it supports <b>HTML!</b></div>", tooltipPlacement: position, icon: "fc-sun", isHtmlTooltip: true }))));
14
- const renderTextTooltipOnText = () => tooltipPositions.map((position) => (React.createElement("div", { key: `${position}_text` },
15
- React.createElement("span", { "data-qtip-text": "Helpful information provided here", "data-qtip-placement": position },
16
- "Hover for Tooltip (on the ",
17
- position,
18
- ")"))));
19
- const renderTextTooltipOnTextWithDelay = () => tooltipPositions.map((position) => (React.createElement("div", { key: `${position}_text` },
20
- React.createElement("span", { "data-qtip-text": "Helpful information provided here", "data-qtip-placement": position, "data-qtip-delay": 1500 },
21
- "Hover for Tooltip (on the ",
22
- position,
23
- ") - with delay (1500ms)"))));
24
- const renderTextTooltipOnOverflowHiddenText = () => tooltipPositions.map((position) => (React.createElement("div", { key: `${position}_text`, className: "tw-overflow-hidden" },
25
- React.createElement("span", { "data-qtip-text": "Helpful information provided here", "data-qtip-placement": position },
26
- "Hover for Tooltip (on the ",
27
- position,
28
- ")",
29
- React.createElement("br", null),
30
- "(Overflow set to hidden)"))));
31
- return (React.createElement(React.Fragment, null,
32
- React.createElement(QTip, null),
33
- React.createElement("div", { className: "tw-grid tw-grid-cols-4 tw-gap-4 tw-text-center" },
34
- renderButtonsWithTooltip(),
35
- renderIconsWithHtmlTooltip(),
36
- renderTextTooltipOnText(),
37
- renderTextTooltipOnTextWithDelay(),
38
- renderTextTooltipOnOverflowHiddenText())));
39
- };
40
- //# sourceMappingURL=QTip.stories.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"QTip.stories.js","sourceRoot":"","sources":["../../src/Tooltip/QTip.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,MAAM,MAAM,WAAW,CAAC;AAC/B,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;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AC9B,CACH,CACP,CAAC,CAAC;IAEL,MAAM,qCAAqC,GAAG,GAAG,EAAE,CACjD,gBAAgB,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,CACjC,6BAAK,GAAG,EAAE,GAAG,QAAQ,OAAO,EAAE,SAAS,EAAC,oBAAoB;QAC1D,gDAAqB,mCAAmC,yBAAsB,QAAQ;;YACzD,QAAQ;;YAAE,+BAAM;uCAEtC,CACH,CACP,CAAC,CAAC;IAEL,OAAO,CACL;QACE,oBAAC,IAAI,OAAG;QACR,6BAAK,SAAS,EAAC,gDAAgD;YAC5D,wBAAwB,EAAE;YAC1B,0BAA0B,EAAE;YAC5B,uBAAuB,EAAE;YACzB,gCAAgC,EAAE;YAClC,qCAAqC,EAAE,CACpC,CACL,CACJ,CAAC;AACJ,CAAC,CAAC"}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=QTip.types.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"QTip.types.js","sourceRoot":"","sources":["../../src/Tooltip/QTip.types.ts"],"names":[],"mappings":""}
@@ -1,30 +0,0 @@
1
- import React from 'react';
2
- import { QTip } from './Qtip';
3
- import Icon from '../Icon';
4
- export default {
5
- title: 'Tooltip',
6
- };
7
- const renderManyQTips = () => {
8
- const colsCount = 100;
9
- const rowCount = 100;
10
- const rows = [];
11
- const getCols = (rowId) => {
12
- const cols = [];
13
- for (let i = 0; i < colsCount; i++) {
14
- cols.push(React.createElement("td", { key: 'col_' + i + '_row_' + rowId },
15
- React.createElement(Icon, { icon: "fc-sun", tooltip: `hello there ${i}` })));
16
- }
17
- return cols;
18
- };
19
- for (let i = 0; i < rowCount; i++) {
20
- rows.push(React.createElement("tr", { key: 'row_' + i }, ...getCols(i)));
21
- }
22
- return (React.createElement("table", null,
23
- React.createElement("tbody", null, rows.map((row) => row))));
24
- };
25
- export const QtipPerformance = () => {
26
- return (React.createElement(React.Fragment, null,
27
- React.createElement(QTip, null),
28
- React.createElement("div", { className: "tw-grid tw-grid-cols-4 tw-gap-4 tw-text-center" }, renderManyQTips())));
29
- };
30
- //# sourceMappingURL=QTipPerformance.stories.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"QTipPerformance.stories.js","sourceRoot":"","sources":["../../src/Tooltip/QTipPerformance.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAC9B,OAAO,IAAI,MAAM,SAAS,CAAC;AAE3B,eAAe;IACb,KAAK,EAAE,SAAS;CACjB,CAAC;AAEF,MAAM,eAAe,GAAG,GAAG,EAAE;IAC3B,MAAM,SAAS,GAAG,GAAG,CAAC;IACtB,MAAM,QAAQ,GAAG,GAAG,CAAC;IACrB,MAAM,IAAI,GAAG,EAAE,CAAC;IAEhB,MAAM,OAAO,GAAG,CAAC,KAAa,EAAE,EAAE;QAChC,MAAM,IAAI,GAAG,EAAE,CAAC;QAChB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,SAAS,EAAE,CAAC,EAAE,EAAE;YAClC,IAAI,CAAC,IAAI,CACP,4BAAI,GAAG,EAAE,MAAM,GAAG,CAAC,GAAG,OAAO,GAAG,KAAK;gBACnC,oBAAC,IAAI,IAAC,IAAI,EAAC,QAAQ,EAAC,OAAO,EAAE,eAAe,CAAC,EAAE,GAAI,CAChD,CACN,CAAC;SACH;QACD,OAAO,IAAI,CAAC;IACd,CAAC,CAAC;IAEF,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,QAAQ,EAAE,CAAC,EAAE,EAAE;QACjC,IAAI,CAAC,IAAI,CAAC,4BAAI,GAAG,EAAE,MAAM,GAAG,CAAC,OAAM,OAAO,CAAC,CAAC,CAAC,CAAM,CAAC,CAAC;KACtD;IACD,OAAO,CACL;QACE,mCAAQ,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,CAAS,CACjC,CACT,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,eAAe,GAAG,GAAG,EAAE;IAClC,OAAO,CACL;QACE,oBAAC,IAAI,OAAG;QACR,6BAAK,SAAS,EAAC,gDAAgD,IAAE,eAAe,EAAE,CAAO,CACxF,CACJ,CAAC;AACJ,CAAC,CAAC"}
@@ -1,158 +0,0 @@
1
- import DOMPurify from 'dompurify';
2
- import React, { useEffect, useRef, useState } from 'react';
3
- import { arrow, computePosition, offset } from '@floating-ui/dom';
4
- import { useIntervalWhen } from 'rooks';
5
- import { DEFAULT_TOOL_TIP_DELAY } from './Tooltip.types';
6
- const getArrowStyle = (position, x, arrowWidth, tooltipHeight, tooltipWidth) => {
7
- switch (position) {
8
- case 'bottom':
9
- return {
10
- left: `${x}px`,
11
- top: `${-arrowWidth}px`,
12
- };
13
- case 'left':
14
- return {
15
- left: `${tooltipWidth - arrowWidth}px`,
16
- top: `${tooltipHeight / 2 - arrowWidth}px`,
17
- };
18
- case 'right':
19
- return {
20
- left: `${-arrowWidth}px`,
21
- top: `${tooltipHeight / 2 - arrowWidth}px`,
22
- };
23
- default: // 'top':
24
- return {
25
- left: `${x}px`,
26
- top: `${tooltipHeight - 10 + arrowWidth}px`,
27
- };
28
- }
29
- };
30
- const HTMLTip = ({ text }) => {
31
- return React.createElement('div', {
32
- dangerouslySetInnerHTML: { __html: DOMPurify.sanitize(text) },
33
- });
34
- };
35
- /** Tooltips can cause SystemTests to be flaky, so we suppress them in Playwright and Protractor */
36
- const suppressTooltip = () => {
37
- return window.navigator.userAgent === 'Playwright' || window.navigator.userAgent.includes('Protractor');
38
- };
39
- /**
40
- * QTip
41
- *
42
- * QTip is a Singleton Tooltip component that guarantees high-performance and reduces component wrappers!
43
- *
44
- * QTip is used by all qomponents that support the display of tooltips.
45
- * If you want to add a Tooltip to your application you can do so by adding the following html data-attributes:
46
- *
47
- * 'data-qtip-text': the tooltip text to display; this can also be a string containing valid HTML
48
- * 'data-qtip-placement': one of TooltipPosition (top, bottom, right, or left)
49
- * 'data-qtip-is-html': set this to true if you provided a text that contains HTML,
50
- * 'data-qtip-delay': this can be used to delay the showing of the tooltip. this should be a number representing
51
- * the # of milliseconds you want to delay the tooltip for. If no delay is provided the DEFAULT_TOOL_TIP_DELAY is
52
- * applied!
53
- * 'data-qtip-testid': use this attribute to provide a value for a data-testid of your tooltip; this is useful
54
- * for tests
55
- *
56
- * In order for QTip to be able to display Tooltips you must add the QTip component to your top-most component
57
- * (often that's App or Application) - simply add:
58
- *
59
- * <QTip />
60
- *
61
- * and enjoy beautiful & performant tooltips!
62
- */
63
- export const QTip = () => {
64
- const tooltipRef = useRef(null);
65
- const tooltipTarget = useRef(null);
66
- const tooltipArrowRef = useRef(null);
67
- const [tooltipText, setTooltipText] = useState('');
68
- const [tooltipTargetOriginalPosition, setTooltipTargetOriginalPosition] = useState(null);
69
- const [show, setShow] = useState(false);
70
- const [html, setHtml] = useState(false);
71
- const [tooltipTestId, setTooltipTestId] = useState('');
72
- const [overTooltip, setOverTooltip] = useState(false);
73
- // Check every 300ms if the tooltip target position has changed and hide the tooltip if this happens.
74
- useIntervalWhen(() => {
75
- const currentPosition = tooltipTarget?.current?.getBoundingClientRect();
76
- if (overTooltip) {
77
- return;
78
- }
79
- if (tooltipTargetOriginalPosition?.y !== currentPosition?.y ||
80
- tooltipTargetOriginalPosition?.x !== currentPosition?.x) {
81
- setShow(false);
82
- }
83
- }, 300, show);
84
- useEffect(() => {
85
- !suppressTooltip() && document.body.addEventListener('mousemove', onMouseMove);
86
- return () => {
87
- !suppressTooltip() && document.removeEventListener('mousemove', onMouseMove);
88
- };
89
- }, []);
90
- const ttTimeout = useRef();
91
- const onMouseMove = (e) => {
92
- clearTimeout(ttTimeout.current);
93
- if (!(e.target instanceof HTMLElement)) {
94
- return;
95
- }
96
- tooltipTarget.current = e.target;
97
- let dataset = e.target?.dataset;
98
- let text = dataset?.qtipText;
99
- // Buttons support React.Nodes as children, the tooltip however is applied to the actual button component.
100
- // we only check two levels up - alternatively the tooltip can also be provided on the React.Node
101
- if (!text || text === '') {
102
- let currentTooltipTarget = e.target?.parentElement;
103
- dataset = currentTooltipTarget?.dataset;
104
- text = dataset?.qtipText;
105
- if (!text || text === '') {
106
- currentTooltipTarget = e.target?.parentElement?.parentElement;
107
- dataset = currentTooltipTarget?.dataset;
108
- text = dataset?.qtipText;
109
- }
110
- tooltipTarget.current = currentTooltipTarget;
111
- }
112
- if (text) {
113
- const delay = parseInt(dataset?.qtipDelay ?? DEFAULT_TOOL_TIP_DELAY + '');
114
- ttTimeout.current = setTimeout(() => makeTooltip(text, dataset?.qtipPlacement, dataset?.qtipIsHtml === 'true', dataset?.qtipTestid, delay), delay);
115
- }
116
- };
117
- const makeTooltip = (tooltipText, position = 'top', isHtml, dataTestId, delay) => {
118
- if (tooltipText && tooltipTarget.current) {
119
- setHtml(isHtml);
120
- setTooltipText(tooltipText);
121
- setTooltipTestId(dataTestId);
122
- setTooltipTargetOriginalPosition(tooltipTarget.current.getBoundingClientRect());
123
- const positionTooltip = () => {
124
- if (tooltipRef.current && tooltipTarget.current) {
125
- computePosition(tooltipTarget.current, tooltipRef.current, {
126
- placement: position,
127
- middleware: [offset(10), arrow({ element: tooltipArrowRef.current })],
128
- }).then(({ x, y, middlewareData }) => {
129
- Object.assign(tooltipRef.current?.style, {
130
- left: `${x}px`,
131
- top: `${y}px`,
132
- });
133
- if (middlewareData.arrow) {
134
- const { x, y } = middlewareData.arrow;
135
- const arrowWidth = tooltipArrowRef.current?.offsetHeight / 2;
136
- const tooltipHeight = tooltipRef.current?.offsetHeight;
137
- const tooltipWidth = tooltipRef.current?.offsetWidth;
138
- const style = getArrowStyle(position, x || y, arrowWidth, tooltipHeight, tooltipWidth);
139
- Object.assign(tooltipArrowRef.current.style, style);
140
- }
141
- setShow(true);
142
- });
143
- }
144
- };
145
- delay > 0
146
- ? requestAnimationFrame(() => {
147
- positionTooltip();
148
- })
149
- : positionTooltip();
150
- }
151
- };
152
- return (React.createElement(React.Fragment, null,
153
- React.createElement("div", { onMouseEnter: () => setOverTooltip(true), onMouseLeave: () => setOverTooltip(false), "data-testid": tooltipTestId, ref: tooltipRef, className: 'tw-absolute tw-rounded tw-bg-black tw-p-2 tw-text-xs tw-text-white tw-z-[9999] fade-in ' +
154
- (show ? 'tw-visible' : 'tw-invisible tw-pointer-events-none') },
155
- html ? React.createElement(HTMLTip, { text: tooltipText }) : tooltipText,
156
- React.createElement("div", { className: "tw-absolute tw-w-[10px] tw-h-[10px] tw-rotate-45 tw-bg-black", ref: tooltipArrowRef }))));
157
- };
158
- //# sourceMappingURL=Qtip.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Qtip.js","sourceRoot":"","sources":["../../src/Tooltip/Qtip.tsx"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,WAAW,CAAC;AAClC,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC3D,OAAO,EAAE,KAAK,EAAE,eAAe,EAAE,MAAM,EAAa,MAAM,kBAAkB,CAAC;AAC7E,OAAO,EAAE,eAAe,EAAE,MAAM,OAAO,CAAC;AACxC,OAAO,EAAE,sBAAsB,EAAE,MAAM,iBAAiB,CAAC;AAEzD,MAAM,aAAa,GAAG,CACpB,QAAgB,EAChB,CAAqB,EACrB,UAAkB,EAClB,aAAqB,EACrB,YAAoB,EACpB,EAAE;IACF,QAAQ,QAAQ,EAAE;QAChB,KAAK,QAAQ;YACX,OAAO;gBACL,IAAI,EAAE,GAAG,CAAC,IAAI;gBACd,GAAG,EAAE,GAAG,CAAC,UAAU,IAAI;aACxB,CAAC;QAEJ,KAAK,MAAM;YACT,OAAO;gBACL,IAAI,EAAE,GAAG,YAAY,GAAG,UAAU,IAAI;gBACtC,GAAG,EAAE,GAAG,aAAa,GAAG,CAAC,GAAG,UAAU,IAAI;aAC3C,CAAC;QACJ,KAAK,OAAO;YACV,OAAO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AAE,CAAC;gBACpB,CAAC,CAAC;gBACJ,CAAC,CAAC,eAAe,EAAE,CAAC;SACvB;IACH,CAAC,CAAC;IAEF,OAAO,CACL;QACE,6BACE,YAAY,EAAE,GAAG,EAAE,CAAC,cAAc,CAAC,IAAI,CAAC,EACxC,YAAY,EAAE,GAAG,EAAE,CAAC,cAAc,CAAC,KAAK,CAAC,iBAC5B,aAAa,EAC1B,GAAG,EAAE,UAAU,EACf,SAAS,EACP,yFAAyF;gBACzF,CAAC,IAAI,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,qCAAqC,CAAC;YAE9D,IAAI,CAAC,CAAC,CAAC,oBAAC,OAAO,IAAC,IAAI,EAAE,WAAW,GAAI,CAAC,CAAC,CAAC,WAAW;YACpD,6BAAK,SAAS,EAAC,8DAA8D,EAAC,GAAG,EAAE,eAAe,GAAQ,CACtG,CACL,CACJ,CAAC;AACJ,CAAC,CAAC"}
@@ -1,36 +0,0 @@
1
- import React from 'react';
2
- import '../styles.css';
3
- import { DEFAULT_TOOL_TIP_DELAY } from './Tooltip.types';
4
- /**
5
- * @deprecated
6
- * Note: Tooltip has been replaced by QTip - a singleton JS tooltip that behaves well even with overflow settings :)
7
- * See @QTip for more info!
8
- *
9
- * This component displays a Tooltip for the provided children. It is a CSS only tooltip that will not display
10
- * correctly if a parent element has an overflow CSS property assigned. Please use QTip to ensure your tooltips
11
- * display correctly.
12
- */
13
- export const Tooltip = ({ position = 'bottom', children, text, delay = DEFAULT_TOOL_TIP_DELAY, }) => {
14
- const arrowBaseClasses = 'before:tw-content-[\'\'] before:tw-absolute before:tw-border-8';
15
- const centerArrowVertically = 'before:tw-top-1/2 before:-tw-translate-y-1/2';
16
- const centerArrowHorizontally = 'before:tw-left-1/2 before:-tw-translate-x-1/2';
17
- const arrowRight = `${arrowBaseClasses} ${centerArrowVertically} before:tw-right-[100%] before:tw-border-y-transparent
18
- before:tw-border-l-transparent before:tw-border-r-black`;
19
- const arrowLeft = `${arrowBaseClasses} ${centerArrowVertically} before:tw-left-[100%] before:tw-border-y-transparent
20
- before:tw-border-l-black before:tw-border-r-transparent`;
21
- const arrowBottom = `${arrowBaseClasses} ${centerArrowHorizontally} before:-tw-top-4 before:tw-border-b-black
22
- before:tw-border-r-transparent before:tw-border-l-transparent before:tw-border-t-transparent`;
23
- const arrowTop = `${arrowBaseClasses} ${centerArrowHorizontally} before:-tw-bottom-4 before:tw-border-b-transparent
24
- before:tw-border-t-black before:tw-border-l-transparent before:tw-border-r-transparent`;
25
- const placements = {
26
- top: `-tw-top-2 -tw-translate-y-full tw-left-1/2 -tw-translate-x-1/2 ${arrowTop}`,
27
- left: `-tw-translate-x-full -tw-left-3 -tw-translate-y-1/2 tw-top-1/2 ${arrowLeft}`,
28
- right: `tw-translate-x-full -tw-right-3 -tw-translate-y-1/2 tw-top-1/2 ${arrowRight}`,
29
- bottom: `-tw-bottom-2 tw-translate-y-full tw-left-1/2 -tw-translate-x-1/2 ${arrowBottom}`,
30
- };
31
- return (React.createElement("div", { className: "tw-group tw-relative tw-inline-block" },
32
- children,
33
- React.createElement("div", { className: `tw-z-50 tw-whitespace-nowrap tw-hidden group-hover:tw-inline-block group-hover:tw-delay-[${delay}ms]
34
- tw-absolute tw-opacity-0 group-hover:tw-opacity-100 tw-rounded tw-bg-black tw-p-2 tw-text-xs tw-text-white ${placements[position]}` }, text)));
35
- };
36
- //# sourceMappingURL=Tooltip.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Tooltip.js","sourceRoot":"","sources":["../../src/Tooltip/Tooltip.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,eAAe,CAAC;AACvB,OAAO,EAAE,sBAAsB,EAAgB,MAAM,iBAAiB,CAAC;AAEvE;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,OAAO,GAA0C,CAAC,EAC7D,QAAQ,GAAG,QAAQ,EACnB,QAAQ,EACR,IAAI,EACJ,KAAK,GAAG,sBAAsB,GAC/B,EAAE,EAAE;IACH,MAAM,gBAAgB,GAAG,gEAAgE,CAAC;IAC1F,MAAM,qBAAqB,GAAG,8CAA8C,CAAC;IAC7E,MAAM,uBAAuB,GAAG,+CAA+C,CAAC;IAChF,MAAM,UAAU,GAAG,GAAG,gBAAgB,IAAI,qBAAqB;0DACP,CAAC;IAEzD,MAAM,SAAS,GAAG,GAAG,gBAAgB,IAAI,qBAAqB;2DACL,CAAC;IAE1D,MAAM,WAAW,GAAG,GAAG,gBAAgB,IAAI,uBAAuB;+FAC2B,CAAC;IAC9F,MAAM,QAAQ,GAAG,GAAG,gBAAgB,IAAI,uBAAuB;yFACwB,CAAC;IAExF,MAAM,UAAU,GAAG;QACjB,GAAG,EAAE,kEAAkE,QAAQ,EAAE;QACjF,IAAI,EAAE,kEAAkE,SAAS,EAAE;QACnF,KAAK,EAAE,kEAAkE,UAAU,EAAE;QACrF,MAAM,EAAE,oEAAoE,WAAW,EAAE;KAC1F,CAAC;IAEF,OAAO,CACL,6BAAK,SAAS,EAAC,sCAAsC;QAClD,QAAQ;QACT,6BACE,SAAS,EAAE,4FAA4F,KAAK;qHACC,UAAU,CAAC,QAAQ,CAAC,EAAE,IAClI,IAAI,CACD,CACF,CACP,CAAC;AACJ,CAAC,CAAC"}
@@ -1,32 +0,0 @@
1
- import React from 'react';
2
- import { Tooltip } from './Tooltip';
3
- import Icon from '../Icon';
4
- import Button from '../Button';
5
- import { tooltipPositions } from './Tooltip.types';
6
- export default {
7
- title: 'Tooltip',
8
- };
9
- export const AllTooltips = () => {
10
- const renderButtonsWithTooltip = () => tooltipPositions.map((position) => (React.createElement("div", { key: `${position}_button` },
11
- React.createElement(Tooltip, { text: `Tooltip on the ${position}`, position: position },
12
- React.createElement(Button, { label: position })))));
13
- const renderIconsWithHtmlTooltip = () => tooltipPositions.map((position) => (React.createElement("div", { key: `${position}_icon` },
14
- React.createElement(Tooltip, { text: React.createElement("div", null,
15
- React.createElement("h2", null, "Fancy Tooltip"),
16
- " This is a special tooltip. Why?",
17
- React.createElement("br", null),
18
- "Because it supports ",
19
- React.createElement("b", null, "HTML!")), position: position },
20
- React.createElement(Icon, { icon: "fc-sun" })))));
21
- const renderTextTooltipOnText = () => tooltipPositions.map((position) => (React.createElement("div", { key: `${position}_text` },
22
- React.createElement(Tooltip, { text: "Helpful information provided here", position: position },
23
- React.createElement("span", null,
24
- "Hover for Tooltip (on the ",
25
- position,
26
- ")")))));
27
- return (React.createElement("div", { className: "tw-grid tw-grid-cols-4 tw-gap-4 tw-text-center" },
28
- renderButtonsWithTooltip(),
29
- renderIconsWithHtmlTooltip(),
30
- renderTextTooltipOnText()));
31
- };
32
- //# sourceMappingURL=Tooltip.stories.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Tooltip.stories.js","sourceRoot":"","sources":["../../src/Tooltip/Tooltip.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,IAAI,MAAM,SAAS,CAAC;AAC3B,OAAO,MAAM,MAAM,WAAW,CAAC;AAC/B,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAEnD,eAAe;IACb,KAAK,EAAE,SAAS;CACjB,CAAC;AAEF,MAAM,CAAC,MAAM,WAAW,GAAG,GAAG,EAAE;IAC9B,MAAM,wBAAwB,GAAG,GAAG,EAAE,CACpC,gBAAgB,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,CACjC,6BAAK,GAAG,EAAE,GAAG,QAAQ,SAAS;QAC5B,oBAAC,OAAO,IAAC,IAAI,EAAE,kBAAkB,QAAQ,EAAE,EAAE,QAAQ,EAAE,QAAQ;YAC7D,oBAAC,MAAM,IAAC,KAAK,EAAE,QAAQ,GAAI,CACnB,CACN,CACP,CAAC,CAAC;IAEL,MAAM,0BAA0B,GAAG,GAAG,EAAE,CACtC,gBAAgB,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,CACjC,6BAAK,GAAG,EAAE,GAAG,QAAQ,OAAO;QAC1B,oBAAC,OAAO,IACN,IAAI,EACF;gBACE,gDAAsB;;gBACtB,+BAAM;;gBACc,uCAAY,CAC5B,EAER,QAAQ,EAAE,QAAQ;YAClB,oBAAC,IAAI,IAAC,IAAI,EAAC,QAAQ,GAAG,CACd,CACN,CACP,CAAC,CAAC;IAEL,MAAM,uBAAuB,GAAG,GAAG,EAAE,CACnC,gBAAgB,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,CACjC,6BAAK,GAAG,EAAE,GAAG,QAAQ,OAAO;QAC1B,oBAAC,OAAO,IAAC,IAAI,EAAC,mCAAmC,EAAC,QAAQ,EAAE,QAAQ;YAClE;;gBAAiC,QAAQ;oBAAS,CAC1C,CACN,CACP,CAAC,CAAC;IAEL,OAAO,CACL,6BAAK,SAAS,EAAC,gDAAgD;QAC5D,wBAAwB,EAAE;QAC1B,0BAA0B,EAAE;QAC5B,uBAAuB,EAAE,CACtB,CACP,CAAC;AACJ,CAAC,CAAC"}
@@ -1,3 +0,0 @@
1
- export const DEFAULT_TOOL_TIP_DELAY = 500;
2
- export const tooltipPositions = ['top', 'left', 'right', 'bottom'];
3
- //# sourceMappingURL=Tooltip.types.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Tooltip.types.js","sourceRoot":"","sources":["../../src/Tooltip/Tooltip.types.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,sBAAsB,GAAG,GAAG,CAAC;AAC1C,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,QAAQ,CAAU,CAAC"}
@@ -1,30 +0,0 @@
1
- import React from 'react';
2
- import { Tooltip } from './Tooltip';
3
- import Icon from '../Icon';
4
- export default {
5
- title: 'Tooltip',
6
- };
7
- const renderManyTooltips = () => {
8
- const colsCount = 100;
9
- const rowCount = 100;
10
- const rows = [];
11
- const getCols = (rowId) => {
12
- const cols = [];
13
- for (let i = 0; i < colsCount; i++) {
14
- cols.push(React.createElement("td", { key: 'col_' + i + '_row_' + rowId },
15
- React.createElement(Tooltip, { text: `hello there ${i}` },
16
- React.createElement(Icon, { icon: "fc-sun" }))));
17
- }
18
- return cols;
19
- };
20
- for (let i = 0; i < rowCount; i++) {
21
- rows.push(React.createElement("tr", { key: 'row_' + i }, ...getCols(i)));
22
- }
23
- return (React.createElement("table", null,
24
- React.createElement("tbody", null, rows.map((row) => row))));
25
- };
26
- export const TooltipPerformance = () => {
27
- return (React.createElement(React.Fragment, null,
28
- React.createElement("div", { className: "tw-grid tw-grid-cols-4 tw-gap-4 tw-text-center" }, renderManyTooltips())));
29
- };
30
- //# sourceMappingURL=TooltipPerformance.stories.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"TooltipPerformance.stories.js","sourceRoot":"","sources":["../../src/Tooltip/TooltipPerformance.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,IAAI,MAAM,SAAS,CAAC;AAE3B,eAAe;IACb,KAAK,EAAE,SAAS;CACjB,CAAC;AAEF,MAAM,kBAAkB,GAAG,GAAG,EAAE;IAC9B,MAAM,SAAS,GAAG,GAAG,CAAC;IACtB,MAAM,QAAQ,GAAG,GAAG,CAAC;IACrB,MAAM,IAAI,GAAG,EAAE,CAAC;IAEhB,MAAM,OAAO,GAAG,CAAC,KAAa,EAAE,EAAE;QAChC,MAAM,IAAI,GAAG,EAAE,CAAC;QAChB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,SAAS,EAAE,CAAC,EAAE,EAAE;YAClC,IAAI,CAAC,IAAI,CACP,4BAAI,GAAG,EAAE,MAAM,GAAG,CAAC,GAAG,OAAO,GAAG,KAAK;gBACnC,oBAAC,OAAO,IAAC,IAAI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