@seeqdev/qomponents 0.0.69 → 0.0.70

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 (151) 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 +109 -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/Button/Button.js +90 -0
  12. package/dist/Button/Button.js.map +1 -0
  13. package/dist/Button/Button.stories.js +85 -0
  14. package/dist/Button/Button.stories.js.map +1 -0
  15. package/dist/Button/Button.test.js +49 -0
  16. package/dist/Button/Button.test.js.map +1 -0
  17. package/dist/Button/Button.types.js +5 -0
  18. package/dist/Button/Button.types.js.map +1 -0
  19. package/dist/Button/index.js +2 -0
  20. package/dist/Button/index.js.map +1 -0
  21. package/dist/ButtonWithDropdown/ButtonWithDropdown.js +60 -0
  22. package/dist/ButtonWithDropdown/ButtonWithDropdown.js.map +1 -0
  23. package/dist/ButtonWithDropdown/ButtonWithDropdown.stories.js +81 -0
  24. package/dist/ButtonWithDropdown/ButtonWithDropdown.stories.js.map +1 -0
  25. package/dist/ButtonWithDropdown/ButtonWithDropdown.test.js +72 -0
  26. package/dist/ButtonWithDropdown/ButtonWithDropdown.test.js.map +1 -0
  27. package/dist/ButtonWithDropdown/ButtonWithDropdown.types.js +2 -0
  28. package/dist/ButtonWithDropdown/ButtonWithDropdown.types.js.map +1 -0
  29. package/dist/ButtonWithDropdown/index.js +2 -0
  30. package/dist/ButtonWithDropdown/index.js.map +1 -0
  31. package/dist/ButtonWithPopover/ButtonWithPopover.js +52 -0
  32. package/dist/ButtonWithPopover/ButtonWithPopover.js.map +1 -0
  33. package/dist/ButtonWithPopover/ButtonWithPopover.stories.js +72 -0
  34. package/dist/ButtonWithPopover/ButtonWithPopover.stories.js.map +1 -0
  35. package/dist/ButtonWithPopover/ButtonWithPopover.test.js +87 -0
  36. package/dist/ButtonWithPopover/ButtonWithPopover.test.js.map +1 -0
  37. package/dist/ButtonWithPopover/ButtonWithPopover.types.d.ts +6 -0
  38. package/dist/ButtonWithPopover/ButtonWithPopover.types.js +2 -0
  39. package/dist/ButtonWithPopover/ButtonWithPopover.types.js.map +1 -0
  40. package/dist/ButtonWithPopover/index.js +2 -0
  41. package/dist/ButtonWithPopover/index.js.map +1 -0
  42. package/dist/Checkbox/Checkbox.js +26 -0
  43. package/dist/Checkbox/Checkbox.js.map +1 -0
  44. package/dist/Checkbox/Checkbox.stories.js +34 -0
  45. package/dist/Checkbox/Checkbox.stories.js.map +1 -0
  46. package/dist/Checkbox/Checkbox.test.js +94 -0
  47. package/dist/Checkbox/Checkbox.test.js.map +1 -0
  48. package/dist/Checkbox/Checkbox.types.js +2 -0
  49. package/dist/Checkbox/Checkbox.types.js.map +1 -0
  50. package/dist/Checkbox/index.js +2 -0
  51. package/dist/Checkbox/index.js.map +1 -0
  52. package/dist/Icon/Icon.js +55 -0
  53. package/dist/Icon/Icon.js.map +1 -0
  54. package/dist/Icon/Icon.stories.js +41 -0
  55. package/dist/Icon/Icon.stories.js.map +1 -0
  56. package/dist/Icon/Icon.test.js +55 -0
  57. package/dist/Icon/Icon.test.js.map +1 -0
  58. package/dist/Icon/Icon.types.js +16 -0
  59. package/dist/Icon/Icon.types.js.map +1 -0
  60. package/dist/Icon/index.js +2 -0
  61. package/dist/Icon/index.js.map +1 -0
  62. package/dist/Modal/Modal.js +99 -0
  63. package/dist/Modal/Modal.js.map +1 -0
  64. package/dist/Modal/Modal.stories.js +176 -0
  65. package/dist/Modal/Modal.stories.js.map +1 -0
  66. package/dist/Modal/Modal.test.js +108 -0
  67. package/dist/Modal/Modal.test.js.map +1 -0
  68. package/dist/Modal/Modal.types.js +2 -0
  69. package/dist/Modal/Modal.types.js.map +1 -0
  70. package/dist/Modal/index.js +2 -0
  71. package/dist/Modal/index.js.map +1 -0
  72. package/dist/Select/Select.js +168 -0
  73. package/dist/Select/Select.js.map +1 -0
  74. package/dist/Select/Select.stories.js +72 -0
  75. package/dist/Select/Select.stories.js.map +1 -0
  76. package/dist/Select/Select.test.js +161 -0
  77. package/dist/Select/Select.test.js.map +1 -0
  78. package/dist/Select/Select.types.js +2 -0
  79. package/dist/Select/Select.types.js.map +1 -0
  80. package/dist/Select/index.js +2 -0
  81. package/dist/Select/index.js.map +1 -0
  82. package/dist/Tabs/Tabs.js +22 -0
  83. package/dist/Tabs/Tabs.js.map +1 -0
  84. package/dist/Tabs/Tabs.stories.js +91 -0
  85. package/dist/Tabs/Tabs.stories.js.map +1 -0
  86. package/dist/Tabs/Tabs.test.js +91 -0
  87. package/dist/Tabs/Tabs.test.js.map +1 -0
  88. package/dist/Tabs/Tabs.types.js +2 -0
  89. package/dist/Tabs/Tabs.types.js.map +1 -0
  90. package/dist/Tabs/index.js +2 -0
  91. package/dist/Tabs/index.js.map +1 -0
  92. package/dist/TextArea/TextArea.js +23 -0
  93. package/dist/TextArea/TextArea.js.map +1 -0
  94. package/dist/TextArea/TextArea.stories.js +39 -0
  95. package/dist/TextArea/TextArea.stories.js.map +1 -0
  96. package/dist/TextArea/TextArea.test.js +68 -0
  97. package/dist/TextArea/TextArea.test.js.map +1 -0
  98. package/dist/TextArea/TextArea.types.js +2 -0
  99. package/dist/TextArea/TextArea.types.js.map +1 -0
  100. package/dist/TextArea/index.js +2 -0
  101. package/dist/TextArea/index.js.map +1 -0
  102. package/dist/TextField/TextField.js +64 -0
  103. package/dist/TextField/TextField.js.map +1 -0
  104. package/dist/TextField/TextField.stories.js +41 -0
  105. package/dist/TextField/TextField.stories.js.map +1 -0
  106. package/dist/TextField/TextField.test.js +35 -0
  107. package/dist/TextField/TextField.test.js.map +1 -0
  108. package/dist/TextField/TextField.types.js +2 -0
  109. package/dist/TextField/TextField.types.js.map +1 -0
  110. package/dist/TextField/index.js +2 -0
  111. package/dist/TextField/index.js.map +1 -0
  112. package/dist/ToolbarButton/ToolbarButton.js +73 -0
  113. package/dist/ToolbarButton/ToolbarButton.js.map +1 -0
  114. package/dist/ToolbarButton/ToolbarButton.stories.js +89 -0
  115. package/dist/ToolbarButton/ToolbarButton.stories.js.map +1 -0
  116. package/dist/ToolbarButton/ToolbarButton.test.js +93 -0
  117. package/dist/ToolbarButton/ToolbarButton.test.js.map +1 -0
  118. package/dist/ToolbarButton/ToolbarButton.types.js +2 -0
  119. package/dist/ToolbarButton/ToolbarButton.types.js.map +1 -0
  120. package/dist/ToolbarButton/index.js +2 -0
  121. package/dist/ToolbarButton/index.js.map +1 -0
  122. package/dist/Tooltip/QTip.stories.js +40 -0
  123. package/dist/Tooltip/QTip.stories.js.map +1 -0
  124. package/dist/Tooltip/QTip.types.js +2 -0
  125. package/dist/Tooltip/QTip.types.js.map +1 -0
  126. package/dist/Tooltip/QTipPerformance.stories.js +30 -0
  127. package/dist/Tooltip/QTipPerformance.stories.js.map +1 -0
  128. package/dist/Tooltip/Qtip.js +154 -0
  129. package/dist/Tooltip/Qtip.js.map +1 -0
  130. package/dist/Tooltip/Tooltip.js +36 -0
  131. package/dist/Tooltip/Tooltip.js.map +1 -0
  132. package/dist/Tooltip/Tooltip.stories.js +32 -0
  133. package/dist/Tooltip/Tooltip.stories.js.map +1 -0
  134. package/dist/Tooltip/Tooltip.types.js +3 -0
  135. package/dist/Tooltip/Tooltip.types.js.map +1 -0
  136. package/dist/Tooltip/TooltipPerformance.stories.js +30 -0
  137. package/dist/Tooltip/TooltipPerformance.stories.js.map +1 -0
  138. package/dist/Tooltip/index.js +3 -0
  139. package/dist/Tooltip/index.js.map +1 -0
  140. package/dist/Tooltip/qTip.utilities.js +11 -0
  141. package/dist/Tooltip/qTip.utilities.js.map +1 -0
  142. package/dist/index.esm.js +28 -11
  143. package/dist/index.esm.js.map +1 -1
  144. package/dist/index.js +28 -11
  145. package/dist/index.js.map +1 -1
  146. package/dist/styles.css +9 -0
  147. package/dist/types.js +2 -0
  148. package/dist/types.js.map +1 -0
  149. package/dist/utils/browserId.js +29 -0
  150. package/dist/utils/browserId.js.map +1 -0
  151. package/package.json +1 -1
@@ -0,0 +1,154 @@
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
+ /**
36
+ * QTip
37
+ *
38
+ * QTip is a Singleton Tooltip component that guarantees high-performance and reduces component wrappers!
39
+ *
40
+ * QTip is used by all qomponents that support the display of tooltips.
41
+ * If you want to add a Tooltip to your application you can do so by adding the following html data-attributes:
42
+ *
43
+ * 'data-qtip-text': the tooltip text to display; this can also be a string containing valid HTML
44
+ * 'data-qtip-placement': one of TooltipPosition (top, bottom, right, or left)
45
+ * 'data-qtip-is-html': set this to true if you provided a text that contains HTML,
46
+ * 'data-qtip-delay': this can be used to delay the showing of the tooltip. this should be a number representing
47
+ * the # of milliseconds you want to delay the tooltip for. If no delay is provided the DEFAULT_TOOL_TIP_DELAY is
48
+ * applied!
49
+ * 'data-qtip-testid': use this attribute to provide a value for a data-testid of your tooltip; this is useful
50
+ * for tests
51
+ *
52
+ * In order for QTip to be able to display Tooltips you must add the QTip component to your top-most component
53
+ * (often that's App or Application) - simply add:
54
+ *
55
+ * <QTip />
56
+ *
57
+ * and enjoy beautiful & performant tooltips!
58
+ */
59
+ export const QTip = () => {
60
+ const tooltipRef = useRef(null);
61
+ const tooltipTarget = useRef(null);
62
+ const tooltipArrowRef = useRef(null);
63
+ const [tooltipText, setTooltipText] = useState('');
64
+ const [tooltipTargetOriginalPosition, setTooltipTargetOriginalPosition] = useState(null);
65
+ const [show, setShow] = useState(false);
66
+ const [html, setHtml] = useState(false);
67
+ const [tooltipTestId, setTooltipTestId] = useState('');
68
+ const [overTooltip, setOverTooltip] = useState(false);
69
+ // Check every 300ms if the tooltip target position has changed and hide the tooltip if this happens.
70
+ useIntervalWhen(() => {
71
+ const currentPosition = tooltipTarget?.current?.getBoundingClientRect();
72
+ if (overTooltip) {
73
+ return;
74
+ }
75
+ if (tooltipTargetOriginalPosition?.y !== currentPosition?.y ||
76
+ tooltipTargetOriginalPosition?.x !== currentPosition?.x) {
77
+ setShow(false);
78
+ }
79
+ }, 300, show);
80
+ useEffect(() => {
81
+ document.body.addEventListener('mousemove', onMouseMove);
82
+ return () => {
83
+ document.removeEventListener('mousemove', onMouseMove);
84
+ };
85
+ }, []);
86
+ const ttTimeout = useRef();
87
+ const onMouseMove = (e) => {
88
+ clearTimeout(ttTimeout.current);
89
+ if (!(e.target instanceof HTMLElement)) {
90
+ return;
91
+ }
92
+ tooltipTarget.current = e.target;
93
+ let dataset = e.target?.dataset;
94
+ let text = dataset?.qtipText;
95
+ // Buttons support React.Nodes as children, the tooltip however is applied to the actual button component.
96
+ // we only check two levels up - alternatively the tooltip can also be provided on the React.Node
97
+ if (!text || text === '') {
98
+ let currentTooltipTarget = e.target?.parentElement;
99
+ dataset = currentTooltipTarget?.dataset;
100
+ text = dataset?.qtipText;
101
+ if (!text || text === '') {
102
+ currentTooltipTarget = e.target?.parentElement?.parentElement;
103
+ dataset = currentTooltipTarget?.dataset;
104
+ text = dataset?.qtipText;
105
+ }
106
+ tooltipTarget.current = currentTooltipTarget;
107
+ }
108
+ if (text) {
109
+ const delay = parseInt(dataset?.qtipDelay ?? DEFAULT_TOOL_TIP_DELAY + '');
110
+ ttTimeout.current = setTimeout(() => makeTooltip(text, dataset?.qtipPlacement, dataset?.qtipIsHtml === 'true', dataset?.qtipTestid, delay), delay);
111
+ }
112
+ };
113
+ const makeTooltip = (tooltipText, position = 'top', isHtml, dataTestId, delay) => {
114
+ if (tooltipText && tooltipTarget.current) {
115
+ setHtml(isHtml);
116
+ setTooltipText(tooltipText);
117
+ setTooltipTestId(dataTestId);
118
+ setTooltipTargetOriginalPosition(tooltipTarget.current.getBoundingClientRect());
119
+ const positionTooltip = () => {
120
+ if (tooltipRef.current && tooltipTarget.current) {
121
+ computePosition(tooltipTarget.current, tooltipRef.current, {
122
+ placement: position,
123
+ middleware: [offset(10), arrow({ element: tooltipArrowRef.current })],
124
+ }).then(({ x, y, middlewareData }) => {
125
+ Object.assign(tooltipRef.current?.style, {
126
+ left: `${x}px`,
127
+ top: `${y}px`,
128
+ });
129
+ if (middlewareData.arrow) {
130
+ const { x, y } = middlewareData.arrow;
131
+ const arrowWidth = tooltipArrowRef.current?.offsetHeight / 2;
132
+ const tooltipHeight = tooltipRef.current?.offsetHeight;
133
+ const tooltipWidth = tooltipRef.current?.offsetWidth;
134
+ const style = getArrowStyle(position, x || y, arrowWidth, tooltipHeight, tooltipWidth);
135
+ Object.assign(tooltipArrowRef.current.style, style);
136
+ }
137
+ setShow(true);
138
+ });
139
+ }
140
+ };
141
+ delay > 0
142
+ ? requestAnimationFrame(() => {
143
+ positionTooltip();
144
+ })
145
+ : positionTooltip();
146
+ }
147
+ };
148
+ return (React.createElement(React.Fragment, null,
149
+ 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 ' +
150
+ (show ? 'tw-visible' : 'tw-invisible tw-pointer-events-none') },
151
+ html ? React.createElement(HTMLTip, { text: tooltipText }) : tooltipText,
152
+ React.createElement("div", { className: "tw-absolute tw-w-[10px] tw-h-[10px] tw-rotate-45 tw-bg-black", ref: tooltipArrowRef }))));
153
+ };
154
+ //# sourceMappingURL=Qtip.js.map
@@ -0,0 +1 @@
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,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AAC,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"}
@@ -0,0 +1,36 @@
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
@@ -0,0 +1 @@
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"}
@@ -0,0 +1,32 @@
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
@@ -0,0 +1 @@
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"}
@@ -0,0 +1,3 @@
1
+ export const DEFAULT_TOOL_TIP_DELAY = 500;
2
+ export const tooltipPositions = ['top', 'left', 'right', 'bottom'];
3
+ //# sourceMappingURL=Tooltip.types.js.map
@@ -0,0 +1 @@
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"}
@@ -0,0 +1,30 @@
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
@@ -0,0 +1 @@
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,EAAE,eAAe,CAAC,EAAE;oBAC/B,oBAAC,IAAI,IAAC,IAAI,EAAC,QAAQ,GAAG,CACd,CACP,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,kBAAkB,GAAG,GAAG,EAAE;IACrC,OAAO,CACL;QACE,6BAAK,SAAS,EAAC,gDAAgD,IAAE,kBAAkB,EAAE,CAAO,CAC3F,CACJ,CAAC;AACJ,CAAC,CAAC"}
@@ -0,0 +1,3 @@
1
+ export { Tooltip } from './Tooltip';
2
+ export { QTip } from './Qtip';
3
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/Tooltip/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC"}
@@ -0,0 +1,11 @@
1
+ import { DEFAULT_TOOL_TIP_DELAY } from './Tooltip.types';
2
+ export const getQTipData = ({ tooltip, tooltipPlacement, isHtmlTooltip, tooltipTestId, tooltipDelay = DEFAULT_TOOL_TIP_DELAY, }) => tooltip
3
+ ? {
4
+ 'data-qtip-text': tooltip,
5
+ 'data-qtip-placement': tooltipPlacement,
6
+ 'data-qtip-is-html': isHtmlTooltip,
7
+ 'data-qtip-testid': tooltipTestId,
8
+ 'data-qtip-delay': tooltipDelay,
9
+ }
10
+ : undefined;
11
+ //# sourceMappingURL=qTip.utilities.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"qTip.utilities.js","sourceRoot":"","sources":["../../src/Tooltip/qTip.utilities.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,sBAAsB,EAAyB,MAAM,iBAAiB,CAAC;AAEhF,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,EAC1B,OAAO,EACP,gBAAgB,EAChB,aAAa,EACb,aAAa,EACb,YAAY,GAAG,sBAAsB,GACf,EAAkC,EAAE,CAC1D,OAAO;IACL,CAAC,CAAC;QACE,gBAAgB,EAAE,OAAO;QACzB,qBAAqB,EAAE,gBAAgB;QACvC,mBAAmB,EAAE,aAAa;QAClC,kBAAkB,EAAE,aAAa;QACjC,iBAAiB,EAAE,YAAY;KAChC;IACH,CAAC,CAAC,SAAS,CAAC"}
package/dist/index.esm.js CHANGED
@@ -4406,6 +4406,19 @@ const $cb5cc270b50c6fcd$export$7dacb05d26466c3 = /*#__PURE__*/ forwardRef((props
4406
4406
  const [$cb5cc270b50c6fcd$var$PortalProvider, $cb5cc270b50c6fcd$var$usePortalContext] = $cb5cc270b50c6fcd$var$createPopoverContext($cb5cc270b50c6fcd$var$PORTAL_NAME, {
4407
4407
  forceMount: undefined
4408
4408
  });
4409
+ const $cb5cc270b50c6fcd$export$dd679ffb4362d2d4 = (props)=>{
4410
+ const { __scopePopover: __scopePopover , forceMount: forceMount , children: children , container: container } = props;
4411
+ const context = $cb5cc270b50c6fcd$var$usePopoverContext($cb5cc270b50c6fcd$var$PORTAL_NAME, __scopePopover);
4412
+ return /*#__PURE__*/ createElement($cb5cc270b50c6fcd$var$PortalProvider, {
4413
+ scope: __scopePopover,
4414
+ forceMount: forceMount
4415
+ }, /*#__PURE__*/ createElement($921a889cee6df7e8$export$99c2b779aa4e8b8b, {
4416
+ present: forceMount || context.open
4417
+ }, /*#__PURE__*/ createElement($f1701beae083dbae$export$602eac185826482c, {
4418
+ asChild: true,
4419
+ container: container
4420
+ }, children)));
4421
+ };
4409
4422
  /* -------------------------------------------------------------------------------------------------
4410
4423
  * PopoverContent
4411
4424
  * -----------------------------------------------------------------------------------------------*/ const $cb5cc270b50c6fcd$var$CONTENT_NAME = 'PopoverContent';
@@ -4544,6 +4557,7 @@ const $cb5cc270b50c6fcd$export$3152841115e061b2 = /*#__PURE__*/ forwardRef((prop
4544
4557
  }
4545
4558
  const $cb5cc270b50c6fcd$export$be92b6f5f03c0fe9 = $cb5cc270b50c6fcd$export$5b6b19405a83ff9d;
4546
4559
  const $cb5cc270b50c6fcd$export$41fb9f06171c75f4 = $cb5cc270b50c6fcd$export$7dacb05d26466c3;
4560
+ const $cb5cc270b50c6fcd$export$602eac185826482c = $cb5cc270b50c6fcd$export$dd679ffb4362d2d4;
4547
4561
  const $cb5cc270b50c6fcd$export$7c6e2c02157bb7d2 = $cb5cc270b50c6fcd$export$d7e1f420b25549ff;
4548
4562
  const $cb5cc270b50c6fcd$export$21b07c8f274aebd5 = $cb5cc270b50c6fcd$export$3152841115e061b2;
4549
4563
 
@@ -15003,7 +15017,7 @@ const borderStyles$1 = [
15003
15017
  'dark:tw-border-gray-500',
15004
15018
  ].join(' ');
15005
15019
  const disabledClasses$1 = ['tw-opacity-50', 'tw-cursor-not-allowed'].join(' ');
15006
- const ButtonWithPopover = ({ children, trigger, id, hasArrow, extraTriggerClassNames, extraPopoverClassNames, containerTestId, onInteractOutside, onPointerDownOutside, disabled = false, align = 'end', alignOffset = -35, placement = 'bottom', placementOffset = 2, isHoverEnabled = false, hoverOpenDelay = 300, onOpenChange, isOpen, isCloseOnContentClick = false, setFocusOnTriggerOnClose = true, ...tooltipProps }) => {
15020
+ const ButtonWithPopover = ({ children, trigger, id, hasArrow, extraTriggerClassNames, extraPopoverClassNames, containerTestId, onInteractOutside, onPointerDownOutside, isTriggerAsChild = false, shouldTriggerFullWidth = false, disabled = false, align = 'end', alignOffset = -35, placement = 'bottom', placementOffset = 2, isHoverEnabled = false, hoverOpenDelay = 300, onOpenChange, isOpen, isCloseOnContentClick = false, setFocusOnTriggerOnClose = true, isPortal = false, ...tooltipProps }) => {
15007
15021
  const tooltipData = getQTipData(tooltipProps);
15008
15022
  let timeout;
15009
15023
  const [isHoveredOpen, setIsHoveredOpen] = React.useState(false);
@@ -15024,17 +15038,20 @@ const ButtonWithPopover = ({ children, trigger, id, hasArrow, extraTriggerClassN
15024
15038
  }
15025
15039
  };
15026
15040
  React.useEffect(() => () => timeout && clearTimeout(timeout), []);
15041
+ const renderContent = () => {
15042
+ return (React.createElement($cb5cc270b50c6fcd$export$7c6e2c02157bb7d2, { sideOffset: placementOffset, align: align, side: placement, onInteractOutside: onInteractOutside, onPointerDownOutside: onPointerDownOutside, alignOffset: isHoverEnabled ? -10 : alignOffset, asChild: true, onClick: () => isCloseOnContentClick && onOpenChange && onOpenChange(false), className: "focus-visible:tw-outline-none tw-outline-none tw-w-full tw-h-full" },
15043
+ React.createElement("div", { "data-testid": containerTestId, className: `${bgStyles$1} ${borderStyles$1} tw-relative tw-z-[1000] tw-min-w-6 focus-visible:tw-outline-none tw-outline-none data-[state=open]:tw-animate-in data-[state=closed]:tw-animate-out
15044
+ data-[side=top]:tw-animate-slideDownAndFade data-[side=right]:tw-animate-slideLeftAndFade data-[side=bottom]:tw-animate-slideUpAndFade data-[side=left]:tw-animate-slideRightAndFade tw-text-sq-text-color
15045
+ ${extraPopoverClassNames || ''}` },
15046
+ hasArrow && (React.createElement($cb5cc270b50c6fcd$export$21b07c8f274aebd5, { asChild: true },
15047
+ React.createElement("div", { className: " tw-fill-transparent tw-bg-white tw-w-[15px] tw-h-[15px] tw-mt-[-7px] tw-rotate-45 dark:tw-bg-sq-dark-background tw-border-b tw-border-r tw-border-sq-disabled-gray dark:tw-border-gray-500" }))),
15048
+ children)));
15049
+ };
15027
15050
  const renderPopover = (popoverOpenState) => {
15028
15051
  return (React.createElement($cb5cc270b50c6fcd$export$be92b6f5f03c0fe9, { open: popoverOpenState, defaultOpen: false, onOpenChange: onOpenChange },
15029
- React.createElement($cb5cc270b50c6fcd$export$41fb9f06171c75f4, { id: id, className: `tw-border-none`, disabled: disabled },
15030
- React.createElement("div", { ...tooltipData, onMouseOver: onHoverStart, onMouseOut: onHoverEnd, className: `tw-bg-transparent tw-flex tw-flex-col tw-items-center tw-justify-center focus-visible:tw-outline-none tw-outline-none ${disabled ? disabledClasses$1 : ''} ${extraTriggerClassNames || ''}` }, trigger)),
15031
- React.createElement($cb5cc270b50c6fcd$export$7c6e2c02157bb7d2, { sideOffset: placementOffset, align: align, side: placement, onInteractOutside: onInteractOutside, onPointerDownOutside: onPointerDownOutside, alignOffset: isHoverEnabled ? -10 : alignOffset, asChild: true, onClick: () => isCloseOnContentClick && onOpenChange && onOpenChange(false), className: "focus-visible:tw-outline-none tw-outline-none" },
15032
- React.createElement("div", { "data-testid": containerTestId, className: `${bgStyles$1} ${borderStyles$1} tw-relative tw-z-[1000] tw-min-w-6 focus-visible:tw-outline-none tw-outline-none data-[state=open]:tw-animate-in data-[state=closed]:tw-animate-out
15033
- data-[side=top]:tw-animate-slideDownAndFade data-[side=right]:tw-animate-slideLeftAndFade data-[side=bottom]:tw-animate-slideUpAndFade data-[side=left]:tw-animate-slideRightAndFade tw-text-sq-text-color
15034
- ${extraPopoverClassNames || ''}` },
15035
- hasArrow && (React.createElement($cb5cc270b50c6fcd$export$21b07c8f274aebd5, { asChild: true },
15036
- React.createElement("div", { className: " tw-fill-transparent tw-bg-white tw-w-[15px] tw-h-[15px] tw-mt-[-7px] tw-rotate-45 dark:tw-bg-sq-dark-background tw-border-b tw-border-r tw-border-sq-disabled-gray dark:tw-border-gray-500" }))),
15037
- children))));
15052
+ React.createElement($cb5cc270b50c6fcd$export$41fb9f06171c75f4, { id: id, asChild: isTriggerAsChild, className: `focus-visible:tw-outline-none tw-outline-none ${shouldTriggerFullWidth ? 'tw-w-full tw-h-full' : ''}`, disabled: disabled },
15053
+ React.createElement("div", { ...tooltipData, onMouseOver: onHoverStart, onMouseOut: onHoverEnd, className: `tw-bg-transparent focus-visible:tw-outline-none tw-outline-none ${disabled ? disabledClasses$1 : ''} ${shouldTriggerFullWidth ? 'tw-flex tw-flex-col tw-items-center tw-justify-center' : 'inline'} ${extraTriggerClassNames || ''}` }, trigger)),
15054
+ isPortal ? React.createElement($cb5cc270b50c6fcd$export$602eac185826482c, null, renderContent()) : renderContent()));
15038
15055
  };
15039
15056
  return isHoverEnabled ? renderPopover(isHoveredOpen) : renderPopover(isOpen);
15040
15057
  };
@@ -16039,7 +16056,7 @@ const ButtonWithDropdown = ({ dropdownItems, triggerIcon, id, extraClassNames, c
16039
16056
  if (item.isLabel) {
16040
16057
  return (React.createElement($d08ef79370b62062$export$b04be29aa201d4f5, { key: (item.label || '') + index, className: item.containerExtraClassNames },
16041
16058
  item.icon && (React.createElement(Icon, { icon: item.icon, testId: item.iconTestId, type: "text", color: item.iconColor, extraClassNames: "tw-text-sq-text-color dark:tw-text-sq-white tw-w-[18px]" })),
16042
- React.createElement("div", { "data-testid": item.labelTestId, className: "tw-text-[13px] tw-ml-1" }, item.label)));
16059
+ React.createElement("div", { "data-testid": item.labelTestId, className: "tw-text-[13px] tw-text-sq-text-color dark:tw-text-sq-white tw-ml-1" }, item.label)));
16043
16060
  }
16044
16061
  if (Array.isArray(item.subMenuItems) && item.subMenuItems.length > 0) {
16045
16062
  return (React.createElement($d08ef79370b62062$export$d7a01e11500dfb6f, { key: item.label + index },