@allurereport/web-awesome 3.0.0-beta.6 → 3.0.0-beta.8

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 (251) hide show
  1. package/.eslintrc.cjs +4 -1
  2. package/dist/multi/141.app-4375537b.js +1 -0
  3. package/dist/multi/222.app-4375537b.js +1 -0
  4. package/dist/multi/335.app-4375537b.js +1 -0
  5. package/dist/multi/34.app-4375537b.js +1 -0
  6. package/dist/multi/349.app-4375537b.js +1 -0
  7. package/dist/multi/378.app-4375537b.js +1 -0
  8. package/dist/multi/406.app-4375537b.js +1 -0
  9. package/dist/multi/476.app-4375537b.js +1 -0
  10. package/dist/multi/53.app-4375537b.js +1 -0
  11. package/dist/multi/584.app-4375537b.js +1 -0
  12. package/dist/multi/690.app-4375537b.js +1 -0
  13. package/dist/multi/747.app-4375537b.js +1 -0
  14. package/dist/multi/767.app-4375537b.js +1 -0
  15. package/dist/multi/83.app-4375537b.js +1 -0
  16. package/dist/multi/873.app-4375537b.js +1 -0
  17. package/dist/multi/920.app-4375537b.js +1 -0
  18. package/dist/multi/991.app-4375537b.js +1 -0
  19. package/dist/multi/app-4375537b.js +2 -0
  20. package/dist/multi/manifest.json +20 -20
  21. package/dist/multi/styles-4375537b.css +283 -0
  22. package/dist/single/app-f16f6693.js +2 -0
  23. package/dist/single/manifest.json +1 -1
  24. package/package.json +6 -4
  25. package/src/assets/scss/fonts.scss +2 -20
  26. package/src/components/{app/ArrowButton → ArrowButton}/index.tsx +3 -4
  27. package/src/components/{app/BaseLayout → BaseLayout}/index.tsx +17 -16
  28. package/src/components/{app/Footer → Footer}/FooterLogo.tsx +2 -2
  29. package/src/components/Footer/FooterVersion.tsx +33 -0
  30. package/src/components/Footer/index.tsx +13 -0
  31. package/src/components/Header/index.tsx +14 -0
  32. package/src/components/{app/LanguagePicker → LanguagePicker}/index.tsx +2 -3
  33. package/src/components/MainReport/index.tsx +19 -0
  34. package/src/components/{app/Metadata → Metadata}/index.tsx +23 -16
  35. package/src/components/{app/Metadata → Metadata}/styles.scss +1 -1
  36. package/src/components/{app/MetadataButton → MetadataButton}/index.tsx +3 -4
  37. package/src/components/{app/Modal → Modal}/index.tsx +9 -19
  38. package/src/components/{app/ReportBody → ReportBody}/Filters.tsx +7 -11
  39. package/src/components/{app/ReportBody → ReportBody}/HeaderActions.tsx +1 -1
  40. package/src/components/{app/ReportBody → ReportBody}/SortBy.tsx +12 -14
  41. package/src/components/{app/ReportBody → ReportBody}/index.tsx +2 -2
  42. package/src/components/{app/ReportHeader → ReportHeader}/ReportHeaderLabelList.tsx +2 -2
  43. package/src/components/{app/ReportHeader → ReportHeader}/ReportHeaderLogo.tsx +2 -2
  44. package/src/components/{app/ReportHeader → ReportHeader}/ReportHeaderPie.tsx +2 -2
  45. package/src/components/{app/ReportHeader → ReportHeader}/index.tsx +5 -5
  46. package/src/components/{app/ReportLogo → ReportLogo}/index.tsx +3 -4
  47. package/src/components/{app/ReportLogoFull → ReportLogoFull}/index.tsx +3 -4
  48. package/src/components/{app/ReportMetadata → ReportMetadata}/MetadataItem.tsx +2 -2
  49. package/src/components/{app/ReportMetadata → ReportMetadata}/MetadataSummary.tsx +8 -10
  50. package/src/components/{app/ReportMetadata → ReportMetadata}/MetadataTestType.tsx +5 -5
  51. package/src/components/ReportMetadata/MetadataWithIcon.tsx +21 -0
  52. package/src/components/{app/ReportMetadata → ReportMetadata}/index.tsx +5 -5
  53. package/src/components/{app/ReportMetadata → ReportMetadata}/styles.scss +1 -1
  54. package/src/components/{app/Tabs → Tabs}/index.tsx +1 -1
  55. package/src/components/{app/TestResult → TestResult}/TestResultAttachmentsView/index.tsx +1 -1
  56. package/src/components/{app/TestResult → TestResult}/TestResultDescription/index.tsx +4 -4
  57. package/src/components/TestResult/TestResultDropdown/index.tsx +23 -0
  58. package/src/components/{app/TestResult → TestResult}/TestResultEmpty/index.tsx +5 -6
  59. package/src/components/TestResult/TestResultError/index.tsx +59 -0
  60. package/src/components/{app/TestResult → TestResult}/TestResultHeader/index.tsx +10 -10
  61. package/src/components/{app/TestResult → TestResult}/TestResultHistory/TestResultHistoryItem.tsx +16 -17
  62. package/src/components/{app/TestResult → TestResult}/TestResultHistory/index.tsx +2 -2
  63. package/src/components/{app/TestResult → TestResult}/TestResultInfo/TestResultInfoStatuses.tsx +8 -9
  64. package/src/components/{app/TestResult → TestResult}/TestResultInfo/index.tsx +8 -10
  65. package/src/components/{app/TestResult → TestResult}/TestResultLinks/index.tsx +12 -16
  66. package/src/components/{app/TestResult → TestResult}/TestResultMetadata/index.tsx +4 -4
  67. package/src/components/{app/TestResult → TestResult}/TestResultNavigation/index.tsx +7 -9
  68. package/src/components/{app/TestResult → TestResult}/TestResultOverview.tsx +13 -13
  69. package/src/components/{app/TestResult → TestResult}/TestResultParameters/index.tsx +4 -4
  70. package/src/components/{app/TestResult → TestResult}/TestResultPrevStatuses/index.tsx +6 -9
  71. package/src/components/TestResult/TestResultRetriesView/TestResultRetriesItem.tsx +52 -0
  72. package/src/components/TestResult/TestResultRetriesView/index.tsx +24 -0
  73. package/src/components/{app/TestResult → TestResult}/TestResultSetup/index.tsx +8 -9
  74. package/src/components/TestResult/TestResultSeverity/index.tsx +27 -0
  75. package/src/components/{app/TestResult → TestResult}/TestResultStatus/index.tsx +2 -2
  76. package/src/components/{app/TestResult → TestResult}/TestResultSteps/attachment.tsx +10 -10
  77. package/src/components/{app/TestResult → TestResult}/TestResultSteps/attachmentCode.tsx +7 -2
  78. package/src/components/{app/TestResult → TestResult}/TestResultSteps/attachmentImage.tsx +6 -3
  79. package/src/components/TestResult/TestResultSteps/attachmentVideo.tsx +15 -0
  80. package/src/components/{app/TestResult → TestResult}/TestResultSteps/index.tsx +5 -5
  81. package/src/components/{app/TestResult → TestResult}/TestResultSteps/testResultAttachment.tsx +25 -27
  82. package/src/components/{app/TestResult → TestResult}/TestResultSteps/testResultAttachmentInfo.tsx +8 -12
  83. package/src/components/{app/TestResult → TestResult}/TestResultSteps/testResultStep.tsx +25 -18
  84. package/src/components/TestResult/TestResultSteps/testResultStepInfo.tsx +30 -0
  85. package/src/components/{app/TestResult → TestResult}/TestResultSteps/wrongAttachment.tsx +1 -1
  86. package/src/components/{app/TestResult → TestResult}/TestResultTabs/index.tsx +1 -1
  87. package/src/components/{app/TestResult → TestResult}/TestResultTeardown/index.tsx +6 -6
  88. package/src/components/{app/TestResult → TestResult}/index.tsx +10 -10
  89. package/src/components/{app/ThemeButton → ThemeButton}/ThemeButton.tsx +2 -4
  90. package/src/components/{app/Tree → Tree}/Tree.tsx +3 -10
  91. package/src/components/{app/Tree → Tree}/TreeHeader.tsx +3 -3
  92. package/src/components/{app/Tree → Tree}/TreeItem.tsx +2 -2
  93. package/src/components/Tree/TreeItemIcon.tsx +32 -0
  94. package/src/components/{app/Tree → Tree}/index.tsx +7 -7
  95. package/src/i18n/locales/en.json +1 -0
  96. package/src/index.tsx +2 -2
  97. package/src/stores/index.ts +1 -1
  98. package/src/stores/testResults.ts +7 -3
  99. package/src/stores/tree.ts +1 -1
  100. package/src/utils/isMac.ts +6 -5
  101. package/src/utils/treeFilters.ts +107 -58
  102. package/test/utils/treeFilters.test.ts +25 -1
  103. package/tsconfig.json +5 -3
  104. package/vitest.config.ts +7 -1
  105. package/webpack.config.js +2 -0
  106. package/dist/multi/141.app-07a6d2ea.js +0 -1
  107. package/dist/multi/222.app-07a6d2ea.js +0 -1
  108. package/dist/multi/335.app-07a6d2ea.js +0 -1
  109. package/dist/multi/34.app-07a6d2ea.js +0 -1
  110. package/dist/multi/349.app-07a6d2ea.js +0 -1
  111. package/dist/multi/378.app-07a6d2ea.js +0 -1
  112. package/dist/multi/406.app-07a6d2ea.js +0 -1
  113. package/dist/multi/476.app-07a6d2ea.js +0 -1
  114. package/dist/multi/53.app-07a6d2ea.js +0 -1
  115. package/dist/multi/584.app-07a6d2ea.js +0 -1
  116. package/dist/multi/690.app-07a6d2ea.js +0 -1
  117. package/dist/multi/747.app-07a6d2ea.js +0 -1
  118. package/dist/multi/767.app-07a6d2ea.js +0 -1
  119. package/dist/multi/83.app-07a6d2ea.js +0 -1
  120. package/dist/multi/873.app-07a6d2ea.js +0 -1
  121. package/dist/multi/920.app-07a6d2ea.js +0 -1
  122. package/dist/multi/991.app-07a6d2ea.js +0 -1
  123. package/dist/multi/app-07a6d2ea.js +0 -2
  124. package/dist/multi/styles-07a6d2ea.css +0 -363
  125. package/dist/single/app-c2627b69.js +0 -2
  126. package/src/assets/fonts/JetBrainsMono_vf.woff +0 -0
  127. package/src/assets/fonts/JetBrainsMono_vf.woff2 +0 -0
  128. package/src/assets/fonts/pt-root-ui_vf.woff +0 -0
  129. package/src/assets/fonts/pt-root-ui_vf.woff2 +0 -0
  130. package/src/assets/scss/mixins.scss +0 -26
  131. package/src/assets/svg/arrows-chevron-down.svg +0 -5
  132. package/src/assets/svg/github.svg +0 -5
  133. package/src/assets/svg/line-alerts-notification-box.svg +0 -3
  134. package/src/assets/svg/line-arrows-chevron-down-double.svg +0 -3
  135. package/src/assets/svg/line-arrows-chevron-down.svg +0 -3
  136. package/src/assets/svg/line-arrows-chevron-right.svg +0 -3
  137. package/src/assets/svg/line-arrows-chevron-up-double.svg +0 -3
  138. package/src/assets/svg/line-arrows-chevron-up.svg +0 -3
  139. package/src/assets/svg/line-arrows-corner-down-right.svg +0 -3
  140. package/src/assets/svg/line-arrows-expand-3.svg +0 -3
  141. package/src/assets/svg/line-arrows-refresh-ccw-1.svg +0 -3
  142. package/src/assets/svg/line-arrows-sort-line-asc.svg +0 -3
  143. package/src/assets/svg/line-arrows-sort-line-desc.svg +0 -3
  144. package/src/assets/svg/line-arrows-switch-vertical-1.svg +0 -3
  145. package/src/assets/svg/line-dev-bug-2.svg +0 -3
  146. package/src/assets/svg/line-dev-code-square.svg +0 -3
  147. package/src/assets/svg/line-files-file-attachment-2.svg +0 -3
  148. package/src/assets/svg/line-general-check.svg +0 -3
  149. package/src/assets/svg/line-general-checklist3.svg +0 -3
  150. package/src/assets/svg/line-general-copy-3.svg +0 -3
  151. package/src/assets/svg/line-general-download-cloud.svg +0 -3
  152. package/src/assets/svg/line-general-equal.svg +0 -3
  153. package/src/assets/svg/line-general-home-line.svg +0 -3
  154. package/src/assets/svg/line-general-link-1.svg +0 -3
  155. package/src/assets/svg/line-general-link-external.svg +0 -3
  156. package/src/assets/svg/line-general-search-md.svg +0 -3
  157. package/src/assets/svg/line-general-settings-1.svg +0 -3
  158. package/src/assets/svg/line-general-x-close.svg +0 -3
  159. package/src/assets/svg/line-general-zap.svg +0 -3
  160. package/src/assets/svg/line-helpers-flag.svg +0 -4
  161. package/src/assets/svg/line-helpers-play-circle.svg +0 -4
  162. package/src/assets/svg/line-images-image.svg +0 -3
  163. package/src/assets/svg/line-security-key.svg +0 -3
  164. package/src/assets/svg/line-shapes-dot-circle.svg +0 -3
  165. package/src/assets/svg/line-shapes-moon.svg +0 -3
  166. package/src/assets/svg/line-shapes-sun.svg +0 -3
  167. package/src/assets/svg/line-time-clock-stopwatch.svg +0 -3
  168. package/src/assets/svg/report-logo.svg +0 -64
  169. package/src/assets/svg/solid-alert-circle.svg +0 -3
  170. package/src/assets/svg/solid-check-circle.svg +0 -3
  171. package/src/assets/svg/solid-help-circle.svg +0 -3
  172. package/src/assets/svg/solid-minus-circle.svg +0 -3
  173. package/src/assets/svg/solid-x-circle.svg +0 -3
  174. package/src/assets/svg/spinner.svg +0 -18
  175. package/src/assets/svg/view-off.svg +0 -12
  176. package/src/assets/svg/view.svg +0 -11
  177. package/src/components/app/Footer/FooterVersion.tsx +0 -27
  178. package/src/components/app/Footer/index.tsx +0 -13
  179. package/src/components/app/Header/index.tsx +0 -17
  180. package/src/components/app/MainReport/index.tsx +0 -19
  181. package/src/components/app/ReportMetadata/MetadataWithIcon.tsx +0 -25
  182. package/src/components/app/TestResult/TestResultDropdown/index.tsx +0 -19
  183. package/src/components/app/TestResult/TestResultError/index.tsx +0 -53
  184. package/src/components/app/TestResult/TestResultRetriesView/TestResultRetriesItem.tsx +0 -50
  185. package/src/components/app/TestResult/TestResultRetriesView/index.tsx +0 -24
  186. package/src/components/app/TestResult/TestResultSeverity/index.tsx +0 -34
  187. package/src/components/app/TestResult/TestResultSteps/attachmentVideo.tsx +0 -12
  188. package/src/components/app/TestResult/TestResultSteps/testResultStepInfo.tsx +0 -33
  189. package/src/components/app/Tree/TreeItemIcon.tsx +0 -35
  190. package/src/components/commons/Button/index.tsx +0 -176
  191. package/src/components/commons/Button/styles.scss +0 -560
  192. package/src/components/commons/Counter/index.tsx +0 -29
  193. package/src/components/commons/Counter/styles.scss +0 -21
  194. package/src/components/commons/Label/index.tsx +0 -11
  195. package/src/components/commons/Label/styles.scss +0 -7
  196. package/src/components/commons/Link/index.tsx +0 -20
  197. package/src/components/commons/Link/styles.scss +0 -46
  198. package/src/components/commons/Loadable/index.tsx +0 -32
  199. package/src/components/commons/Menu/index.tsx +0 -198
  200. package/src/components/commons/Menu/styles.scss +0 -94
  201. package/src/components/commons/PageLoader/index.tsx +0 -10
  202. package/src/components/commons/PageLoader/styles.scss +0 -29
  203. package/src/components/commons/SearchBox/index.tsx +0 -64
  204. package/src/components/commons/SearchBox/styles.scss +0 -58
  205. package/src/components/commons/Spinner/index.tsx +0 -8
  206. package/src/components/commons/SuccessRatePieChart/index.tsx +0 -52
  207. package/src/components/commons/SuccessRatePieChart/styles.scss +0 -11
  208. package/src/components/commons/SvgIcon/index.tsx +0 -46
  209. package/src/components/commons/SvgIcon/styles.scss +0 -26
  210. package/src/components/commons/Toggle/index.tsx +0 -30
  211. package/src/components/commons/Toggle/styles.scss +0 -48
  212. package/src/components/commons/Tooltip/index.tsx +0 -123
  213. package/src/components/commons/Tooltip/styles.scss +0 -38
  214. package/src/components/commons/Typography/index.tsx +0 -99
  215. package/src/hooks/useDebouncedCallback.ts +0 -31
  216. /package/dist/multi/{816.app-07a6d2ea.js → 816.app-4375537b.js} +0 -0
  217. /package/dist/multi/{app-07a6d2ea.js.LICENSE.txt → app-4375537b.js.LICENSE.txt} +0 -0
  218. /package/dist/single/{app-c2627b69.js.LICENSE.txt → app-f16f6693.js.LICENSE.txt} +0 -0
  219. /package/src/assets/scss/{code.css → code.scss} +0 -0
  220. /package/src/components/{app/ArrowButton → ArrowButton}/styles.scss +0 -0
  221. /package/src/components/{app/BaseLayout → BaseLayout}/styles.scss +0 -0
  222. /package/src/components/{app/Footer → Footer}/styles.scss +0 -0
  223. /package/src/components/{app/Header → Header}/styles.scss +0 -0
  224. /package/src/components/{app/MetadataButton → MetadataButton}/styles.scss +0 -0
  225. /package/src/components/{app/Modal → Modal}/styles.scss +0 -0
  226. /package/src/components/{app/ReportBody → ReportBody}/context.tsx +0 -0
  227. /package/src/components/{app/ReportBody → ReportBody}/styles.scss +0 -0
  228. /package/src/components/{app/ReportHeader → ReportHeader}/styles.scss +0 -0
  229. /package/src/components/{app/ReportLogo → ReportLogo}/styles.scss +0 -0
  230. /package/src/components/{app/ReportLogoFull → ReportLogoFull}/styles.scss +0 -0
  231. /package/src/components/{app/Tabs → Tabs}/styles.scss +0 -0
  232. /package/src/components/{app/TestResult → TestResult}/TestResultAttachmentsView/styles.scss +0 -0
  233. /package/src/components/{app/TestResult → TestResult}/TestResultDescription/styles.scss +0 -0
  234. /package/src/components/{app/TestResult → TestResult}/TestResultDropdown/styles.scss +0 -0
  235. /package/src/components/{app/TestResult → TestResult}/TestResultEmpty/styles.scss +0 -0
  236. /package/src/components/{app/TestResult → TestResult}/TestResultError/styles.scss +0 -0
  237. /package/src/components/{app/TestResult → TestResult}/TestResultHeader/styles.scss +0 -0
  238. /package/src/components/{app/TestResult → TestResult}/TestResultHistory/styles.scss +0 -0
  239. /package/src/components/{app/TestResult → TestResult}/TestResultInfo/styles.scss +0 -0
  240. /package/src/components/{app/TestResult → TestResult}/TestResultLinks/styles.scss +0 -0
  241. /package/src/components/{app/TestResult → TestResult}/TestResultMetadata/styles.scss +0 -0
  242. /package/src/components/{app/TestResult → TestResult}/TestResultNavigation/styles.scss +0 -0
  243. /package/src/components/{app/TestResult → TestResult}/TestResultParameters/styles.scss +0 -0
  244. /package/src/components/{app/TestResult → TestResult}/TestResultPrevStatuses/styles.scss +0 -0
  245. /package/src/components/{app/TestResult → TestResult}/TestResultRetriesView/styles.scss +0 -0
  246. /package/src/components/{app/TestResult → TestResult}/TestResultSeverity/styles.scss +0 -0
  247. /package/src/components/{app/TestResult → TestResult}/TestResultStatus/styles.scss +0 -0
  248. /package/src/components/{app/TestResult → TestResult}/TestResultSteps/HtmlAttachmentPreview.tsx +0 -0
  249. /package/src/components/{app/TestResult → TestResult}/TestResultSteps/styles.scss +0 -0
  250. /package/src/components/{app/TestResult → TestResult}/TestResultTabs/styles.scss +0 -0
  251. /package/src/components/{app/Tree → Tree}/styles.scss +0 -0
@@ -1,48 +0,0 @@
1
- .toggle {
2
- padding: 0;
3
- margin: 0;
4
- appearance: none;
5
- width: 28px;
6
- height: 16px;
7
- background-color: var(--bg-base-neutral);
8
- position: relative;
9
- border-radius: 9px;
10
- padding: 2px;
11
- transition: background-color var(--color-change-transition-duration);
12
- cursor: pointer;
13
-
14
- &:hover {
15
- background-color: var(--on-icon-secondary);
16
- }
17
-
18
- &:active {
19
- background-color: var(--on-icon-primary);
20
- }
21
-
22
- &:checked {
23
- background-color: var(--bg-support-aldebaran);
24
-
25
- &:hover {
26
- background-color: var(--bg-support-aldebaran-medium);
27
- }
28
-
29
- &:active {
30
- background-color: var(--bg-support-aldebaran-heavy);
31
- }
32
-
33
- &::after {
34
- transform: translateX(12px);
35
- }
36
- }
37
-
38
- &::after {
39
- content: "";
40
- display: block;
41
- width: 12px;
42
- height: 12px;
43
- border-radius: 100px;
44
- background-color: var(--constant-on-icon-primary);
45
- box-shadow: 0px 1px 1px 0px rgba(0, 0, 0, 0.2);
46
- transition: transform var(--interaction-transition-duration) ease-out;
47
- }
48
- }
@@ -1,123 +0,0 @@
1
- import { autoUpdate, computePosition, flip, offset, shift } from "@floating-ui/dom";
2
- import { FunctionalComponent, VNode } from "preact";
3
- import { useEffect, useRef, useState } from "preact/hooks";
4
- import { Text } from "@/components/commons/Typography";
5
- import * as styles from "./styles.scss";
6
-
7
- interface TooltipWrapperProps {
8
- tooltipText?: string;
9
- tooltipTextAfterClick?: string;
10
- tooltipComponent?: FunctionalComponent | VNode;
11
- children: VNode;
12
- placement?: "top" | "bottom" | "left" | "right";
13
- triggerMode?: "hover" | "click";
14
- autoHideDelay?: number;
15
- isTriggerActive?: boolean;
16
- }
17
-
18
- const Tooltip = ({ children }) => (
19
- <div className={styles[`custom-tooltip`]}>
20
- <Text className="tooltip-content" size={"s"} bold>
21
- {children}
22
- </Text>
23
- </div>
24
- );
25
-
26
- export const TooltipWrapper: FunctionalComponent<TooltipWrapperProps> = ({
27
- tooltipText,
28
- tooltipTextAfterClick,
29
- tooltipComponent,
30
- children,
31
- placement = "top",
32
- triggerMode = "hover",
33
- autoHideDelay = 600,
34
- isTriggerActive = true,
35
- }) => {
36
- const tooltipRef = useRef<HTMLDivElement | null>(null);
37
- const triggerRef = useRef<HTMLDivElement | null>(null);
38
- const [isVisible, setIsVisible] = useState(false);
39
- const [currentText, setCurrentText] = useState(tooltipText);
40
- const hideTimer = useRef<number | null>(null);
41
-
42
- useEffect(() => {
43
- setCurrentText(tooltipText);
44
- const updatePosition = () => {
45
- if (triggerRef.current && tooltipRef.current) {
46
- computePosition(triggerRef.current, tooltipRef.current, {
47
- placement,
48
- middleware: [offset(6), flip(), shift({ padding: 5 })],
49
- }).then(({ x, y }) => {
50
- if (tooltipRef.current) {
51
- Object.assign(tooltipRef.current.style, {
52
- "left": `${x}px`,
53
- "top": `${y}px`,
54
- "position": "absolute",
55
- "z-index": 100,
56
- });
57
- }
58
- });
59
- }
60
- };
61
-
62
- const cleanup = () =>
63
- triggerRef.current && tooltipRef.current
64
- ? autoUpdate(triggerRef.current, tooltipRef.current, updatePosition)
65
- : () => {};
66
-
67
- if (isVisible) {
68
- updatePosition();
69
- }
70
-
71
- return cleanup();
72
- }, [isVisible, placement, tooltipText]);
73
-
74
- const onMouseEnter = () => {
75
- if (triggerMode === "hover" && isTriggerActive) setIsVisible(true);
76
-
77
- if (triggerMode === "click" && hideTimer.current) {
78
- clearTimeout(hideTimer.current);
79
- }
80
- };
81
-
82
- const onMouseLeave = () => {
83
- if (triggerMode === "hover") {
84
- setIsVisible(false);
85
- setCurrentText(tooltipText);
86
- } else if (triggerMode === "click" && isVisible) {
87
- hideTimer.current = window.setTimeout(() => {
88
- setIsVisible(false);
89
- }, autoHideDelay);
90
- }
91
- };
92
-
93
- const onClick = () => {
94
- if (triggerMode === "click") {
95
- if (triggerRef.current && isTriggerActive) {
96
- setIsVisible(true);
97
- if (hideTimer.current) {
98
- clearTimeout(hideTimer.current);
99
- }
100
- }
101
- }
102
- if (tooltipTextAfterClick) {
103
- setCurrentText(tooltipTextAfterClick);
104
- }
105
- };
106
-
107
- useEffect(() => {
108
- return () => {
109
- if (hideTimer.current) {
110
- clearTimeout(hideTimer.current);
111
- }
112
- };
113
- }, []);
114
-
115
- const tooltipContent = tooltipComponent ? tooltipComponent : <Tooltip>{currentText}</Tooltip>;
116
-
117
- return (
118
- <div onMouseEnter={onMouseEnter} onMouseLeave={onMouseLeave} onClick={onClick}>
119
- <div ref={triggerRef}>{children}</div>
120
- <div ref={tooltipRef}>{isVisible && tooltipContent}</div>
121
- </div>
122
- );
123
- };
@@ -1,38 +0,0 @@
1
- .custom-tooltip {
2
- z-index: 1000;
3
- background-color: var(--constant-bg-base-modal);
4
- color: var(--constant-on-text-primary);
5
- padding: 2px 8px;
6
- border-radius: 6px;
7
- font-size: 12px;
8
- max-width: 600px;
9
- min-width: max-content;
10
- }
11
-
12
- .custom-tooltip--top {
13
- bottom: 100%;
14
- left: 50%;
15
- transform: translateX(-50%);
16
- margin-bottom: 4px;
17
- }
18
-
19
- .custom-tooltip--bottom {
20
- top: 100%;
21
- left: 50%;
22
- transform: translateX(-50%);
23
- margin-top: 4px;
24
- }
25
-
26
- .custom-tooltip--left {
27
- right: 100%;
28
- top: 50%;
29
- transform: translateY(-50%);
30
- margin-top: 4px;
31
- }
32
-
33
- .custom-tooltip--right {
34
- left: 100%;
35
- top: 50%;
36
- transform: translateY(-50%);
37
- margin-top: 4px;
38
- }
@@ -1,99 +0,0 @@
1
- import { clsx } from "clsx";
2
- import type { FunctionalComponent, JSX } from "preact";
3
-
4
- export const Text: FunctionalComponent<
5
- (
6
- | {
7
- type?: "paragraph";
8
- size?: "s" | "m" | "l";
9
- }
10
- | {
11
- type: "ui";
12
- size: "s" | "m" | "l" | "xs";
13
- }
14
- ) & {
15
- /**
16
- * Additional class name
17
- */
18
- className?: string;
19
- bold?: boolean;
20
- tag?: keyof JSX.IntrinsicElements;
21
- } & Omit<JSX.HTMLAttributes, "type" | "size" | "className" | "bold" | "tag">
22
- > = (props) => {
23
- const { size = "m", tag: Tag = "span", type = "paragraph", bold = false, className, children, ...rest } = props;
24
-
25
- if (type === "paragraph") {
26
- return (
27
- // @ts-expect-error this is fine
28
- <Tag {...rest} className={clsx(`paragraphs-text-${size}${bold ? "-bold" : ""}`, className)}>
29
- {children}
30
- </Tag>
31
- );
32
- }
33
-
34
- if (type === "ui") {
35
- return (
36
- // @ts-expect-error this is fine
37
- <Tag {...rest} className={clsx(`ui-text-${size}-ui${bold ? "-bold" : ""}`, className)}>
38
- {children}
39
- </Tag>
40
- );
41
- }
42
-
43
- return null;
44
- };
45
-
46
- export const Code: FunctionalComponent<
47
- {
48
- type?: "paragraph" | "ui";
49
- size?: "s" | "m";
50
- /**
51
- * Additional class name
52
- */
53
- className?: string;
54
- bold?: boolean;
55
- tag?: keyof JSX.IntrinsicElements;
56
- } & Omit<JSX.HTMLAttributes, "type" | "size" | "className" | "bold" | "tag">
57
- > = (props) => {
58
- const { size = "m", tag: Tag = "span", type = "paragraph", bold = false, className, children, ...rest } = props;
59
-
60
- if (type === "paragraph") {
61
- return (
62
- // @ts-expect-error this is fine
63
- <Tag {...rest} className={clsx(`paragraphs-code-${size}${bold ? "-bold" : ""}`, className)}>
64
- {children}
65
- </Tag>
66
- );
67
- }
68
-
69
- if (type === "ui") {
70
- return (
71
- // @ts-expect-error this is fine
72
- <Tag {...rest} className={clsx(`ui-code-${size}-ui${bold ? "-bold" : ""}`, className)}>
73
- {children}
74
- </Tag>
75
- );
76
- }
77
-
78
- return null;
79
- };
80
-
81
- export const Heading: FunctionalComponent<
82
- {
83
- size?: "s" | "m" | "l";
84
- /**
85
- * Additional class name
86
- */
87
- className?: string;
88
- tag?: keyof JSX.IntrinsicElements;
89
- } & Omit<JSX.HTMLAttributes, "size" | "className" | "tag">
90
- > = (props) => {
91
- const { size = "m", tag: Tag = "span", className, children, ...rest } = props;
92
-
93
- return (
94
- // @ts-expect-error this is fine
95
- <Tag {...rest} className={clsx(`headings-head-${size}`, className)}>
96
- {children}
97
- </Tag>
98
- );
99
- };
@@ -1,31 +0,0 @@
1
- import { useCallback, useEffect, useRef } from "preact/hooks";
2
-
3
- const DEFAULT_TIMEOUT = 300;
4
-
5
- function debounce(cb: () => void, timeout = DEFAULT_TIMEOUT) {
6
- let timer: ReturnType<typeof setTimeout>;
7
-
8
- return (...args: unknown[]) => {
9
- clearTimeout(timer);
10
- timer = setTimeout(() => {
11
- cb.apply(this, args);
12
- }, timeout);
13
- };
14
- }
15
-
16
- export function useDebouncedCallback<Callback extends (...args: unknown[]) => void>(
17
- cb: Callback,
18
- timeout = DEFAULT_TIMEOUT,
19
- ) {
20
- const cbRef = useRef(cb);
21
-
22
- cbRef.current = cb;
23
-
24
- useEffect(() => {
25
- return () => {
26
- cbRef.current = (() => {}) as Callback;
27
- };
28
- }, []);
29
-
30
- return useCallback<Callback>(debounce((...args) => cbRef.current(...args), timeout) as Callback, [timeout]);
31
- }
File without changes
File without changes
File without changes
File without changes