@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.
- package/.eslintrc.cjs +4 -1
- package/dist/multi/141.app-4375537b.js +1 -0
- package/dist/multi/222.app-4375537b.js +1 -0
- package/dist/multi/335.app-4375537b.js +1 -0
- package/dist/multi/34.app-4375537b.js +1 -0
- package/dist/multi/349.app-4375537b.js +1 -0
- package/dist/multi/378.app-4375537b.js +1 -0
- package/dist/multi/406.app-4375537b.js +1 -0
- package/dist/multi/476.app-4375537b.js +1 -0
- package/dist/multi/53.app-4375537b.js +1 -0
- package/dist/multi/584.app-4375537b.js +1 -0
- package/dist/multi/690.app-4375537b.js +1 -0
- package/dist/multi/747.app-4375537b.js +1 -0
- package/dist/multi/767.app-4375537b.js +1 -0
- package/dist/multi/83.app-4375537b.js +1 -0
- package/dist/multi/873.app-4375537b.js +1 -0
- package/dist/multi/920.app-4375537b.js +1 -0
- package/dist/multi/991.app-4375537b.js +1 -0
- package/dist/multi/app-4375537b.js +2 -0
- package/dist/multi/manifest.json +20 -20
- package/dist/multi/styles-4375537b.css +283 -0
- package/dist/single/app-f16f6693.js +2 -0
- package/dist/single/manifest.json +1 -1
- package/package.json +6 -4
- package/src/assets/scss/fonts.scss +2 -20
- package/src/components/{app/ArrowButton → ArrowButton}/index.tsx +3 -4
- package/src/components/{app/BaseLayout → BaseLayout}/index.tsx +17 -16
- package/src/components/{app/Footer → Footer}/FooterLogo.tsx +2 -2
- package/src/components/Footer/FooterVersion.tsx +33 -0
- package/src/components/Footer/index.tsx +13 -0
- package/src/components/Header/index.tsx +14 -0
- package/src/components/{app/LanguagePicker → LanguagePicker}/index.tsx +2 -3
- package/src/components/MainReport/index.tsx +19 -0
- package/src/components/{app/Metadata → Metadata}/index.tsx +23 -16
- package/src/components/{app/Metadata → Metadata}/styles.scss +1 -1
- package/src/components/{app/MetadataButton → MetadataButton}/index.tsx +3 -4
- package/src/components/{app/Modal → Modal}/index.tsx +9 -19
- package/src/components/{app/ReportBody → ReportBody}/Filters.tsx +7 -11
- package/src/components/{app/ReportBody → ReportBody}/HeaderActions.tsx +1 -1
- package/src/components/{app/ReportBody → ReportBody}/SortBy.tsx +12 -14
- package/src/components/{app/ReportBody → ReportBody}/index.tsx +2 -2
- package/src/components/{app/ReportHeader → ReportHeader}/ReportHeaderLabelList.tsx +2 -2
- package/src/components/{app/ReportHeader → ReportHeader}/ReportHeaderLogo.tsx +2 -2
- package/src/components/{app/ReportHeader → ReportHeader}/ReportHeaderPie.tsx +2 -2
- package/src/components/{app/ReportHeader → ReportHeader}/index.tsx +5 -5
- package/src/components/{app/ReportLogo → ReportLogo}/index.tsx +3 -4
- package/src/components/{app/ReportLogoFull → ReportLogoFull}/index.tsx +3 -4
- package/src/components/{app/ReportMetadata → ReportMetadata}/MetadataItem.tsx +2 -2
- package/src/components/{app/ReportMetadata → ReportMetadata}/MetadataSummary.tsx +8 -10
- package/src/components/{app/ReportMetadata → ReportMetadata}/MetadataTestType.tsx +5 -5
- package/src/components/ReportMetadata/MetadataWithIcon.tsx +21 -0
- package/src/components/{app/ReportMetadata → ReportMetadata}/index.tsx +5 -5
- package/src/components/{app/ReportMetadata → ReportMetadata}/styles.scss +1 -1
- package/src/components/{app/Tabs → Tabs}/index.tsx +1 -1
- package/src/components/{app/TestResult → TestResult}/TestResultAttachmentsView/index.tsx +1 -1
- package/src/components/{app/TestResult → TestResult}/TestResultDescription/index.tsx +4 -4
- package/src/components/TestResult/TestResultDropdown/index.tsx +23 -0
- package/src/components/{app/TestResult → TestResult}/TestResultEmpty/index.tsx +5 -6
- package/src/components/TestResult/TestResultError/index.tsx +59 -0
- package/src/components/{app/TestResult → TestResult}/TestResultHeader/index.tsx +10 -10
- package/src/components/{app/TestResult → TestResult}/TestResultHistory/TestResultHistoryItem.tsx +16 -17
- package/src/components/{app/TestResult → TestResult}/TestResultHistory/index.tsx +2 -2
- package/src/components/{app/TestResult → TestResult}/TestResultInfo/TestResultInfoStatuses.tsx +8 -9
- package/src/components/{app/TestResult → TestResult}/TestResultInfo/index.tsx +8 -10
- package/src/components/{app/TestResult → TestResult}/TestResultLinks/index.tsx +12 -16
- package/src/components/{app/TestResult → TestResult}/TestResultMetadata/index.tsx +4 -4
- package/src/components/{app/TestResult → TestResult}/TestResultNavigation/index.tsx +7 -9
- package/src/components/{app/TestResult → TestResult}/TestResultOverview.tsx +13 -13
- package/src/components/{app/TestResult → TestResult}/TestResultParameters/index.tsx +4 -4
- package/src/components/{app/TestResult → TestResult}/TestResultPrevStatuses/index.tsx +6 -9
- package/src/components/TestResult/TestResultRetriesView/TestResultRetriesItem.tsx +52 -0
- package/src/components/TestResult/TestResultRetriesView/index.tsx +24 -0
- package/src/components/{app/TestResult → TestResult}/TestResultSetup/index.tsx +8 -9
- package/src/components/TestResult/TestResultSeverity/index.tsx +27 -0
- package/src/components/{app/TestResult → TestResult}/TestResultStatus/index.tsx +2 -2
- package/src/components/{app/TestResult → TestResult}/TestResultSteps/attachment.tsx +10 -10
- package/src/components/{app/TestResult → TestResult}/TestResultSteps/attachmentCode.tsx +7 -2
- package/src/components/{app/TestResult → TestResult}/TestResultSteps/attachmentImage.tsx +6 -3
- package/src/components/TestResult/TestResultSteps/attachmentVideo.tsx +15 -0
- package/src/components/{app/TestResult → TestResult}/TestResultSteps/index.tsx +5 -5
- package/src/components/{app/TestResult → TestResult}/TestResultSteps/testResultAttachment.tsx +25 -27
- package/src/components/{app/TestResult → TestResult}/TestResultSteps/testResultAttachmentInfo.tsx +8 -12
- package/src/components/{app/TestResult → TestResult}/TestResultSteps/testResultStep.tsx +25 -18
- package/src/components/TestResult/TestResultSteps/testResultStepInfo.tsx +30 -0
- package/src/components/{app/TestResult → TestResult}/TestResultSteps/wrongAttachment.tsx +1 -1
- package/src/components/{app/TestResult → TestResult}/TestResultTabs/index.tsx +1 -1
- package/src/components/{app/TestResult → TestResult}/TestResultTeardown/index.tsx +6 -6
- package/src/components/{app/TestResult → TestResult}/index.tsx +10 -10
- package/src/components/{app/ThemeButton → ThemeButton}/ThemeButton.tsx +2 -4
- package/src/components/{app/Tree → Tree}/Tree.tsx +3 -10
- package/src/components/{app/Tree → Tree}/TreeHeader.tsx +3 -3
- package/src/components/{app/Tree → Tree}/TreeItem.tsx +2 -2
- package/src/components/Tree/TreeItemIcon.tsx +32 -0
- package/src/components/{app/Tree → Tree}/index.tsx +7 -7
- package/src/i18n/locales/en.json +1 -0
- package/src/index.tsx +2 -2
- package/src/stores/index.ts +1 -1
- package/src/stores/testResults.ts +7 -3
- package/src/stores/tree.ts +1 -1
- package/src/utils/isMac.ts +6 -5
- package/src/utils/treeFilters.ts +107 -58
- package/test/utils/treeFilters.test.ts +25 -1
- package/tsconfig.json +5 -3
- package/vitest.config.ts +7 -1
- package/webpack.config.js +2 -0
- package/dist/multi/141.app-07a6d2ea.js +0 -1
- package/dist/multi/222.app-07a6d2ea.js +0 -1
- package/dist/multi/335.app-07a6d2ea.js +0 -1
- package/dist/multi/34.app-07a6d2ea.js +0 -1
- package/dist/multi/349.app-07a6d2ea.js +0 -1
- package/dist/multi/378.app-07a6d2ea.js +0 -1
- package/dist/multi/406.app-07a6d2ea.js +0 -1
- package/dist/multi/476.app-07a6d2ea.js +0 -1
- package/dist/multi/53.app-07a6d2ea.js +0 -1
- package/dist/multi/584.app-07a6d2ea.js +0 -1
- package/dist/multi/690.app-07a6d2ea.js +0 -1
- package/dist/multi/747.app-07a6d2ea.js +0 -1
- package/dist/multi/767.app-07a6d2ea.js +0 -1
- package/dist/multi/83.app-07a6d2ea.js +0 -1
- package/dist/multi/873.app-07a6d2ea.js +0 -1
- package/dist/multi/920.app-07a6d2ea.js +0 -1
- package/dist/multi/991.app-07a6d2ea.js +0 -1
- package/dist/multi/app-07a6d2ea.js +0 -2
- package/dist/multi/styles-07a6d2ea.css +0 -363
- package/dist/single/app-c2627b69.js +0 -2
- package/src/assets/fonts/JetBrainsMono_vf.woff +0 -0
- package/src/assets/fonts/JetBrainsMono_vf.woff2 +0 -0
- package/src/assets/fonts/pt-root-ui_vf.woff +0 -0
- package/src/assets/fonts/pt-root-ui_vf.woff2 +0 -0
- package/src/assets/scss/mixins.scss +0 -26
- package/src/assets/svg/arrows-chevron-down.svg +0 -5
- package/src/assets/svg/github.svg +0 -5
- package/src/assets/svg/line-alerts-notification-box.svg +0 -3
- package/src/assets/svg/line-arrows-chevron-down-double.svg +0 -3
- package/src/assets/svg/line-arrows-chevron-down.svg +0 -3
- package/src/assets/svg/line-arrows-chevron-right.svg +0 -3
- package/src/assets/svg/line-arrows-chevron-up-double.svg +0 -3
- package/src/assets/svg/line-arrows-chevron-up.svg +0 -3
- package/src/assets/svg/line-arrows-corner-down-right.svg +0 -3
- package/src/assets/svg/line-arrows-expand-3.svg +0 -3
- package/src/assets/svg/line-arrows-refresh-ccw-1.svg +0 -3
- package/src/assets/svg/line-arrows-sort-line-asc.svg +0 -3
- package/src/assets/svg/line-arrows-sort-line-desc.svg +0 -3
- package/src/assets/svg/line-arrows-switch-vertical-1.svg +0 -3
- package/src/assets/svg/line-dev-bug-2.svg +0 -3
- package/src/assets/svg/line-dev-code-square.svg +0 -3
- package/src/assets/svg/line-files-file-attachment-2.svg +0 -3
- package/src/assets/svg/line-general-check.svg +0 -3
- package/src/assets/svg/line-general-checklist3.svg +0 -3
- package/src/assets/svg/line-general-copy-3.svg +0 -3
- package/src/assets/svg/line-general-download-cloud.svg +0 -3
- package/src/assets/svg/line-general-equal.svg +0 -3
- package/src/assets/svg/line-general-home-line.svg +0 -3
- package/src/assets/svg/line-general-link-1.svg +0 -3
- package/src/assets/svg/line-general-link-external.svg +0 -3
- package/src/assets/svg/line-general-search-md.svg +0 -3
- package/src/assets/svg/line-general-settings-1.svg +0 -3
- package/src/assets/svg/line-general-x-close.svg +0 -3
- package/src/assets/svg/line-general-zap.svg +0 -3
- package/src/assets/svg/line-helpers-flag.svg +0 -4
- package/src/assets/svg/line-helpers-play-circle.svg +0 -4
- package/src/assets/svg/line-images-image.svg +0 -3
- package/src/assets/svg/line-security-key.svg +0 -3
- package/src/assets/svg/line-shapes-dot-circle.svg +0 -3
- package/src/assets/svg/line-shapes-moon.svg +0 -3
- package/src/assets/svg/line-shapes-sun.svg +0 -3
- package/src/assets/svg/line-time-clock-stopwatch.svg +0 -3
- package/src/assets/svg/report-logo.svg +0 -64
- package/src/assets/svg/solid-alert-circle.svg +0 -3
- package/src/assets/svg/solid-check-circle.svg +0 -3
- package/src/assets/svg/solid-help-circle.svg +0 -3
- package/src/assets/svg/solid-minus-circle.svg +0 -3
- package/src/assets/svg/solid-x-circle.svg +0 -3
- package/src/assets/svg/spinner.svg +0 -18
- package/src/assets/svg/view-off.svg +0 -12
- package/src/assets/svg/view.svg +0 -11
- package/src/components/app/Footer/FooterVersion.tsx +0 -27
- package/src/components/app/Footer/index.tsx +0 -13
- package/src/components/app/Header/index.tsx +0 -17
- package/src/components/app/MainReport/index.tsx +0 -19
- package/src/components/app/ReportMetadata/MetadataWithIcon.tsx +0 -25
- package/src/components/app/TestResult/TestResultDropdown/index.tsx +0 -19
- package/src/components/app/TestResult/TestResultError/index.tsx +0 -53
- package/src/components/app/TestResult/TestResultRetriesView/TestResultRetriesItem.tsx +0 -50
- package/src/components/app/TestResult/TestResultRetriesView/index.tsx +0 -24
- package/src/components/app/TestResult/TestResultSeverity/index.tsx +0 -34
- package/src/components/app/TestResult/TestResultSteps/attachmentVideo.tsx +0 -12
- package/src/components/app/TestResult/TestResultSteps/testResultStepInfo.tsx +0 -33
- package/src/components/app/Tree/TreeItemIcon.tsx +0 -35
- package/src/components/commons/Button/index.tsx +0 -176
- package/src/components/commons/Button/styles.scss +0 -560
- package/src/components/commons/Counter/index.tsx +0 -29
- package/src/components/commons/Counter/styles.scss +0 -21
- package/src/components/commons/Label/index.tsx +0 -11
- package/src/components/commons/Label/styles.scss +0 -7
- package/src/components/commons/Link/index.tsx +0 -20
- package/src/components/commons/Link/styles.scss +0 -46
- package/src/components/commons/Loadable/index.tsx +0 -32
- package/src/components/commons/Menu/index.tsx +0 -198
- package/src/components/commons/Menu/styles.scss +0 -94
- package/src/components/commons/PageLoader/index.tsx +0 -10
- package/src/components/commons/PageLoader/styles.scss +0 -29
- package/src/components/commons/SearchBox/index.tsx +0 -64
- package/src/components/commons/SearchBox/styles.scss +0 -58
- package/src/components/commons/Spinner/index.tsx +0 -8
- package/src/components/commons/SuccessRatePieChart/index.tsx +0 -52
- package/src/components/commons/SuccessRatePieChart/styles.scss +0 -11
- package/src/components/commons/SvgIcon/index.tsx +0 -46
- package/src/components/commons/SvgIcon/styles.scss +0 -26
- package/src/components/commons/Toggle/index.tsx +0 -30
- package/src/components/commons/Toggle/styles.scss +0 -48
- package/src/components/commons/Tooltip/index.tsx +0 -123
- package/src/components/commons/Tooltip/styles.scss +0 -38
- package/src/components/commons/Typography/index.tsx +0 -99
- package/src/hooks/useDebouncedCallback.ts +0 -31
- /package/dist/multi/{816.app-07a6d2ea.js → 816.app-4375537b.js} +0 -0
- /package/dist/multi/{app-07a6d2ea.js.LICENSE.txt → app-4375537b.js.LICENSE.txt} +0 -0
- /package/dist/single/{app-c2627b69.js.LICENSE.txt → app-f16f6693.js.LICENSE.txt} +0 -0
- /package/src/assets/scss/{code.css → code.scss} +0 -0
- /package/src/components/{app/ArrowButton → ArrowButton}/styles.scss +0 -0
- /package/src/components/{app/BaseLayout → BaseLayout}/styles.scss +0 -0
- /package/src/components/{app/Footer → Footer}/styles.scss +0 -0
- /package/src/components/{app/Header → Header}/styles.scss +0 -0
- /package/src/components/{app/MetadataButton → MetadataButton}/styles.scss +0 -0
- /package/src/components/{app/Modal → Modal}/styles.scss +0 -0
- /package/src/components/{app/ReportBody → ReportBody}/context.tsx +0 -0
- /package/src/components/{app/ReportBody → ReportBody}/styles.scss +0 -0
- /package/src/components/{app/ReportHeader → ReportHeader}/styles.scss +0 -0
- /package/src/components/{app/ReportLogo → ReportLogo}/styles.scss +0 -0
- /package/src/components/{app/ReportLogoFull → ReportLogoFull}/styles.scss +0 -0
- /package/src/components/{app/Tabs → Tabs}/styles.scss +0 -0
- /package/src/components/{app/TestResult → TestResult}/TestResultAttachmentsView/styles.scss +0 -0
- /package/src/components/{app/TestResult → TestResult}/TestResultDescription/styles.scss +0 -0
- /package/src/components/{app/TestResult → TestResult}/TestResultDropdown/styles.scss +0 -0
- /package/src/components/{app/TestResult → TestResult}/TestResultEmpty/styles.scss +0 -0
- /package/src/components/{app/TestResult → TestResult}/TestResultError/styles.scss +0 -0
- /package/src/components/{app/TestResult → TestResult}/TestResultHeader/styles.scss +0 -0
- /package/src/components/{app/TestResult → TestResult}/TestResultHistory/styles.scss +0 -0
- /package/src/components/{app/TestResult → TestResult}/TestResultInfo/styles.scss +0 -0
- /package/src/components/{app/TestResult → TestResult}/TestResultLinks/styles.scss +0 -0
- /package/src/components/{app/TestResult → TestResult}/TestResultMetadata/styles.scss +0 -0
- /package/src/components/{app/TestResult → TestResult}/TestResultNavigation/styles.scss +0 -0
- /package/src/components/{app/TestResult → TestResult}/TestResultParameters/styles.scss +0 -0
- /package/src/components/{app/TestResult → TestResult}/TestResultPrevStatuses/styles.scss +0 -0
- /package/src/components/{app/TestResult → TestResult}/TestResultRetriesView/styles.scss +0 -0
- /package/src/components/{app/TestResult → TestResult}/TestResultSeverity/styles.scss +0 -0
- /package/src/components/{app/TestResult → TestResult}/TestResultStatus/styles.scss +0 -0
- /package/src/components/{app/TestResult → TestResult}/TestResultSteps/HtmlAttachmentPreview.tsx +0 -0
- /package/src/components/{app/TestResult → TestResult}/TestResultSteps/styles.scss +0 -0
- /package/src/components/{app/TestResult → TestResult}/TestResultTabs/styles.scss +0 -0
- /package/src/components/{app/Tree → Tree}/styles.scss +0 -0
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import type { Signal } from "@preact/signals";
|
|
2
|
-
import type { JSX } from "preact";
|
|
3
|
-
import { type StoreSignalState } from "@/stores";
|
|
4
|
-
|
|
5
|
-
export type LoadableProps<T, K = T> = {
|
|
6
|
-
source: Signal<StoreSignalState<T>>;
|
|
7
|
-
transformData?: (data: T) => K;
|
|
8
|
-
renderData: (data: K) => JSX.Element;
|
|
9
|
-
renderLoader?: () => JSX.Element;
|
|
10
|
-
renderError?: (error: string) => JSX.Element;
|
|
11
|
-
};
|
|
12
|
-
|
|
13
|
-
export const Loadable = <T, K = T>(props: LoadableProps<T, K>) => {
|
|
14
|
-
const {
|
|
15
|
-
source,
|
|
16
|
-
transformData = (data: T) => data as unknown as K,
|
|
17
|
-
renderLoader = () => null,
|
|
18
|
-
// TODO: https://github.com/qameta/allure3/issues/179
|
|
19
|
-
renderError = (err) => <div>{err}</div>,
|
|
20
|
-
renderData,
|
|
21
|
-
} = props;
|
|
22
|
-
|
|
23
|
-
if (source.value.loading) {
|
|
24
|
-
return renderLoader();
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
if (source.value.error) {
|
|
28
|
-
return renderError(source.value.error);
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
return renderData(transformData(source.value.data));
|
|
32
|
-
};
|
|
@@ -1,198 +0,0 @@
|
|
|
1
|
-
import { autoUpdate, computePosition, flip, offset, shift } from "@floating-ui/dom";
|
|
2
|
-
import { clsx } from "clsx";
|
|
3
|
-
import type { ComponentChildren, VNode } from "preact";
|
|
4
|
-
import { createContext } from "preact";
|
|
5
|
-
import { useContext, useEffect, useRef, useState } from "preact/hooks";
|
|
6
|
-
import check from "@/assets/svg/line-general-check.svg";
|
|
7
|
-
import { SvgIcon } from "@/components/commons/SvgIcon";
|
|
8
|
-
import { Text } from "@/components/commons/Typography";
|
|
9
|
-
import * as styles from "./styles.scss";
|
|
10
|
-
|
|
11
|
-
type MenuContextT = {
|
|
12
|
-
setIsOpened: (isOpened: boolean) => void;
|
|
13
|
-
};
|
|
14
|
-
|
|
15
|
-
const MenuContext = createContext<MenuContextT | null>(null);
|
|
16
|
-
|
|
17
|
-
export const useMenuContext = () => {
|
|
18
|
-
const context = useContext(MenuContext);
|
|
19
|
-
|
|
20
|
-
if (!context) {
|
|
21
|
-
throw new Error("useMenuContext must be used within a Menu");
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
return context;
|
|
25
|
-
};
|
|
26
|
-
|
|
27
|
-
export const Menu = (props: {
|
|
28
|
-
children: ComponentChildren;
|
|
29
|
-
isInitialOpened?: boolean;
|
|
30
|
-
size?: "s" | "m" | "l" | "xl";
|
|
31
|
-
placement?: "bottom-start" | "bottom-end";
|
|
32
|
-
menuTrigger: (props: { onClick: () => void; isOpened: boolean; setIsOpened: (isOpened: boolean) => void }) => VNode;
|
|
33
|
-
menuTriggerWrapper?: "div" | "span";
|
|
34
|
-
}) => {
|
|
35
|
-
const {
|
|
36
|
-
children,
|
|
37
|
-
menuTrigger,
|
|
38
|
-
menuTriggerWrapper: MenuTriggerWrapper = "div",
|
|
39
|
-
size = "m",
|
|
40
|
-
isInitialOpened = false,
|
|
41
|
-
placement = "bottom-end",
|
|
42
|
-
} = props;
|
|
43
|
-
|
|
44
|
-
const [isOpened, setIsOpened] = useState(isInitialOpened);
|
|
45
|
-
const menuRef = useRef<HTMLDivElement>(null);
|
|
46
|
-
const triggerRef = useRef<HTMLDivElement>(null);
|
|
47
|
-
|
|
48
|
-
const handleTriggerClick = () => {
|
|
49
|
-
setIsOpened(!isOpened);
|
|
50
|
-
};
|
|
51
|
-
|
|
52
|
-
useEffect(() => {
|
|
53
|
-
const handleEscape = (e: KeyboardEvent) => {
|
|
54
|
-
if (e.key === "Escape" && isOpened) {
|
|
55
|
-
setIsOpened(false);
|
|
56
|
-
}
|
|
57
|
-
};
|
|
58
|
-
|
|
59
|
-
document.addEventListener("keydown", handleEscape);
|
|
60
|
-
|
|
61
|
-
return () => {
|
|
62
|
-
document.removeEventListener("keydown", handleEscape);
|
|
63
|
-
};
|
|
64
|
-
}, []);
|
|
65
|
-
|
|
66
|
-
useEffect(() => {
|
|
67
|
-
const handleClickOutside = (e: MouseEvent) => {
|
|
68
|
-
if (!isOpened) {
|
|
69
|
-
return;
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
if (!menuRef.current) {
|
|
73
|
-
return;
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
if (!menuRef.current.contains(e.target as Node)) {
|
|
77
|
-
setIsOpened(false);
|
|
78
|
-
}
|
|
79
|
-
};
|
|
80
|
-
|
|
81
|
-
if (isOpened) {
|
|
82
|
-
document.addEventListener("click", handleClickOutside);
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
return () => {
|
|
86
|
-
document.removeEventListener("click", handleClickOutside);
|
|
87
|
-
};
|
|
88
|
-
}, [menuRef.current, isOpened]);
|
|
89
|
-
|
|
90
|
-
useEffect(() => {
|
|
91
|
-
const updatePosition = () => {
|
|
92
|
-
if (!menuRef.current && !triggerRef.current) {
|
|
93
|
-
return;
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
computePosition(triggerRef.current, menuRef.current, {
|
|
97
|
-
placement,
|
|
98
|
-
middleware: [offset(6), flip(), shift({ padding: 5 })],
|
|
99
|
-
}).then(({ x, y }) => {
|
|
100
|
-
if (menuRef.current) {
|
|
101
|
-
Object.assign(menuRef.current.style, {
|
|
102
|
-
"left": `${x}px`,
|
|
103
|
-
"top": `${y}px`,
|
|
104
|
-
"position": "absolute",
|
|
105
|
-
"z-index": 10,
|
|
106
|
-
});
|
|
107
|
-
}
|
|
108
|
-
});
|
|
109
|
-
};
|
|
110
|
-
|
|
111
|
-
updatePosition();
|
|
112
|
-
return autoUpdate(triggerRef.current, menuRef.current, updatePosition);
|
|
113
|
-
}, [menuRef.current, triggerRef.current]);
|
|
114
|
-
|
|
115
|
-
return (
|
|
116
|
-
<MenuContext.Provider
|
|
117
|
-
value={{
|
|
118
|
-
setIsOpened,
|
|
119
|
-
}}
|
|
120
|
-
>
|
|
121
|
-
<>
|
|
122
|
-
{typeof menuTrigger === "function" && (
|
|
123
|
-
<MenuTriggerWrapper ref={triggerRef}>
|
|
124
|
-
{menuTrigger({
|
|
125
|
-
isOpened,
|
|
126
|
-
onClick: handleTriggerClick,
|
|
127
|
-
setIsOpened,
|
|
128
|
-
})}
|
|
129
|
-
</MenuTriggerWrapper>
|
|
130
|
-
)}
|
|
131
|
-
<div ref={menuRef}>
|
|
132
|
-
{isOpened && <aside className={clsx(styles.menu, styles[`size-${size}`])}>{children}</aside>}
|
|
133
|
-
</div>
|
|
134
|
-
</>
|
|
135
|
-
</MenuContext.Provider>
|
|
136
|
-
);
|
|
137
|
-
};
|
|
138
|
-
|
|
139
|
-
Menu.Section = (props: { children: ComponentChildren }) => {
|
|
140
|
-
return <ul className={styles.section}>{props.children}</ul>;
|
|
141
|
-
};
|
|
142
|
-
|
|
143
|
-
type ItemProps = {
|
|
144
|
-
children: ComponentChildren;
|
|
145
|
-
onClick?: () => void;
|
|
146
|
-
leadingIcon?: string;
|
|
147
|
-
rightSlot?: ComponentChildren;
|
|
148
|
-
closeMenuOnClick?: boolean;
|
|
149
|
-
ariaLabel?: string;
|
|
150
|
-
setIsOpened?: (isOpened: boolean) => void;
|
|
151
|
-
};
|
|
152
|
-
|
|
153
|
-
Menu.Item = (props: ItemProps) => {
|
|
154
|
-
const { setIsOpened } = useMenuContext();
|
|
155
|
-
const { children, onClick, leadingIcon, rightSlot, ariaLabel, closeMenuOnClick = true } = props;
|
|
156
|
-
const isInteractive = typeof onClick === "function";
|
|
157
|
-
const hasLeadingIcon = typeof leadingIcon === "string";
|
|
158
|
-
|
|
159
|
-
const handleItemClick = (e: MouseEvent) => {
|
|
160
|
-
if (isInteractive && closeMenuOnClick) {
|
|
161
|
-
e.stopPropagation();
|
|
162
|
-
setIsOpened(false);
|
|
163
|
-
}
|
|
164
|
-
|
|
165
|
-
if (isInteractive) {
|
|
166
|
-
onClick?.();
|
|
167
|
-
}
|
|
168
|
-
};
|
|
169
|
-
|
|
170
|
-
return (
|
|
171
|
-
<li className={styles.menuListItem}>
|
|
172
|
-
<Text
|
|
173
|
-
aria-label={ariaLabel}
|
|
174
|
-
type="paragraph"
|
|
175
|
-
size="m"
|
|
176
|
-
tag={isInteractive ? "button" : "div"}
|
|
177
|
-
className={clsx(styles.menuItem, isInteractive && styles.interactive)}
|
|
178
|
-
onClick={handleItemClick}
|
|
179
|
-
data-interactive-menu-item={isInteractive ? true : undefined}
|
|
180
|
-
>
|
|
181
|
-
{hasLeadingIcon && <SvgIcon id={leadingIcon} className={styles.leadingIcon} size="m" />}
|
|
182
|
-
<div className={styles.content}>{children}</div>
|
|
183
|
-
{rightSlot && <div className={styles.right}>{rightSlot}</div>}
|
|
184
|
-
</Text>
|
|
185
|
-
</li>
|
|
186
|
-
);
|
|
187
|
-
};
|
|
188
|
-
|
|
189
|
-
Menu.ItemWithCheckmark = (
|
|
190
|
-
props: ItemProps & {
|
|
191
|
-
isChecked: boolean;
|
|
192
|
-
},
|
|
193
|
-
) => {
|
|
194
|
-
const { isChecked = false, ...itemProps } = props;
|
|
195
|
-
return (
|
|
196
|
-
<Menu.Item {...itemProps} rightSlot={isChecked && <SvgIcon className={styles.checkmarkIcon} id={check.id} />} />
|
|
197
|
-
);
|
|
198
|
-
};
|
|
@@ -1,94 +0,0 @@
|
|
|
1
|
-
.menu {
|
|
2
|
-
background-color: var(--bg-base-modal);
|
|
3
|
-
border: 1px solid var(--on-border-primary);
|
|
4
|
-
box-shadow: var(--shadow-medium);
|
|
5
|
-
border-radius: 6px;
|
|
6
|
-
padding-top: 4px;
|
|
7
|
-
padding-bottom: 4px;
|
|
8
|
-
|
|
9
|
-
&.size-s {
|
|
10
|
-
width: 180px;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
&.size-m {
|
|
14
|
-
width: 200px;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
&.size-l {
|
|
18
|
-
width: 280px;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
&.size-xl {
|
|
22
|
-
width: 408px;
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
.menuListItem {
|
|
27
|
-
padding: 2px 4px;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
.section {
|
|
31
|
-
padding: 0;
|
|
32
|
-
margin: 0;
|
|
33
|
-
list-style: none;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
.menuItem {
|
|
37
|
-
background-color: var(--bg-control-flat);
|
|
38
|
-
padding: 6px 8px;
|
|
39
|
-
border-radius: 6px;
|
|
40
|
-
display: flex;
|
|
41
|
-
flex-direction: row;
|
|
42
|
-
gap: 8px;
|
|
43
|
-
user-select: none;
|
|
44
|
-
appearance: none;
|
|
45
|
-
width: 100%;
|
|
46
|
-
border: none;
|
|
47
|
-
|
|
48
|
-
&.interactive {
|
|
49
|
-
transition: background-color var(--color-change-transition-duration);
|
|
50
|
-
cursor: pointer;
|
|
51
|
-
|
|
52
|
-
&:hover {
|
|
53
|
-
background-color: var(--bg-control-flat-medium);
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
&:focus {
|
|
57
|
-
outline: none;
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
&:focus-visible {
|
|
61
|
-
background-color: var(--bg-control-flat-medium);
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
&:active {
|
|
65
|
-
background-color: var(--bg-control-flat-heavy);
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
& .leadingIcon {
|
|
70
|
-
color: var(--on-icon-secondary);
|
|
71
|
-
flex-shrink: 0;
|
|
72
|
-
flex-grow: 0;
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
& .content {
|
|
76
|
-
flex-grow: 1;
|
|
77
|
-
font-size: inherit;
|
|
78
|
-
line-height: inherit;
|
|
79
|
-
font-weight: inherit;
|
|
80
|
-
letter-spacing: inherit;
|
|
81
|
-
font-family: inherit;
|
|
82
|
-
text-align: left;
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
& .right {
|
|
86
|
-
flex-shrink: 0;
|
|
87
|
-
flex-grow: 0;
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
& .checkmarkIcon {
|
|
91
|
-
color: var(--on-support-aldebaran);
|
|
92
|
-
margin-top: 2px;
|
|
93
|
-
}
|
|
94
|
-
}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
.page-loader {
|
|
2
|
-
display: flex;
|
|
3
|
-
justify-content: center;
|
|
4
|
-
align-items: center;
|
|
5
|
-
height: 100vh;
|
|
6
|
-
width: 100vw;
|
|
7
|
-
background: var(--bg-base-secondary);
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
.spinner {
|
|
11
|
-
width: 24px;
|
|
12
|
-
height: 24px;
|
|
13
|
-
border-radius: 100%;
|
|
14
|
-
animation: spin 0.5s linear infinite;
|
|
15
|
-
border-style: solid;
|
|
16
|
-
border-width: 2px;
|
|
17
|
-
border-color: var(--gray-200);
|
|
18
|
-
border-bottom-color: var(--atlas-night-darken-6);
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
@keyframes spin {
|
|
22
|
-
0% {
|
|
23
|
-
transform: rotate(0deg);
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
100% {
|
|
27
|
-
transform: rotate(360deg);
|
|
28
|
-
}
|
|
29
|
-
}
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
import { clsx } from "clsx";
|
|
2
|
-
import {useEffect, useState} from "preact/hooks";
|
|
3
|
-
import searchIcon from "@/assets/svg/line-general-search-md.svg";
|
|
4
|
-
import closeIcon from "@/assets/svg/line-general-x-close.svg";
|
|
5
|
-
import { useDebouncedCallback } from "@/hooks/useDebouncedCallback";
|
|
6
|
-
import { IconButton } from "../Button";
|
|
7
|
-
import { SvgIcon } from "../SvgIcon";
|
|
8
|
-
import { Text } from "../Typography";
|
|
9
|
-
import * as styles from "./styles.scss";
|
|
10
|
-
|
|
11
|
-
type Props = {
|
|
12
|
-
placeholder?: string;
|
|
13
|
-
invalid?: string;
|
|
14
|
-
error?: string;
|
|
15
|
-
value: string;
|
|
16
|
-
onChange: (value: string) => void;
|
|
17
|
-
changeDebounce?: number;
|
|
18
|
-
};
|
|
19
|
-
|
|
20
|
-
export const SearchBox = (props: Props) => {
|
|
21
|
-
const { placeholder, value, onChange, changeDebounce = 300 } = props;
|
|
22
|
-
const [localValue, setLocalValue] = useState(value);
|
|
23
|
-
const onChangeDebounced = useDebouncedCallback(onChange, changeDebounce);
|
|
24
|
-
const handleChange = (e: Event) => {
|
|
25
|
-
const newValue = (e.target as HTMLInputElement).value;
|
|
26
|
-
|
|
27
|
-
setLocalValue(newValue);
|
|
28
|
-
onChangeDebounced(newValue);
|
|
29
|
-
};
|
|
30
|
-
const handleClear = (e: PointerEvent) => {
|
|
31
|
-
e.preventDefault();
|
|
32
|
-
e.stopPropagation();
|
|
33
|
-
setLocalValue("");
|
|
34
|
-
onChangeDebounced("");
|
|
35
|
-
};
|
|
36
|
-
const showClear = !!localValue;
|
|
37
|
-
|
|
38
|
-
useEffect(() => {
|
|
39
|
-
if (localValue !== value) {
|
|
40
|
-
setLocalValue(value);
|
|
41
|
-
}
|
|
42
|
-
}, [value]);
|
|
43
|
-
|
|
44
|
-
return (
|
|
45
|
-
<Text className={styles.inputWrap} type="ui" size="m" tag="div">
|
|
46
|
-
<SvgIcon id={searchIcon.id} size="s" className={styles.leadingIcon} />
|
|
47
|
-
<input
|
|
48
|
-
className={clsx(styles.input, showClear && styles.inputClear)}
|
|
49
|
-
type="text"
|
|
50
|
-
placeholder={placeholder}
|
|
51
|
-
onInput={handleChange}
|
|
52
|
-
value={localValue}
|
|
53
|
-
name="search"
|
|
54
|
-
autocomplete="off"
|
|
55
|
-
data-testid="search-input"
|
|
56
|
-
/>
|
|
57
|
-
{showClear && (
|
|
58
|
-
<div className={styles.clearButton}>
|
|
59
|
-
<IconButton size="s" icon={closeIcon.id} onClick={handleClear} style="ghost" />
|
|
60
|
-
</div>
|
|
61
|
-
)}
|
|
62
|
-
</Text>
|
|
63
|
-
);
|
|
64
|
-
};
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
.inputWrap {
|
|
2
|
-
display: flex;
|
|
3
|
-
flex-grow: 1;
|
|
4
|
-
position: relative;
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
.input {
|
|
8
|
-
color: var(--on-text-primary);
|
|
9
|
-
font-size: inherit;
|
|
10
|
-
line-height: inherit;
|
|
11
|
-
font-weight: inherit;
|
|
12
|
-
letter-spacing: inherit;
|
|
13
|
-
font-family: inherit;
|
|
14
|
-
flex-grow: 1;
|
|
15
|
-
background-color: var(--bg-control-flat);
|
|
16
|
-
border: 1px solid var(--on-border-control);
|
|
17
|
-
padding: 7px;
|
|
18
|
-
padding-left: calc(7px + 16px + 7px);
|
|
19
|
-
border-radius: 6px;
|
|
20
|
-
transition:
|
|
21
|
-
background-color var(--color-change-transition-duration),
|
|
22
|
-
border-color var(--color-change-transition-duration);
|
|
23
|
-
|
|
24
|
-
&:hover:not(:focus) {
|
|
25
|
-
background-color: var(--bg-control-flat-medium);
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
&:focus {
|
|
29
|
-
outline: none;
|
|
30
|
-
border-color: var(--on-border-heavy);
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
&::placeholder {
|
|
34
|
-
color: var(--on-text-secondary);
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
&.inputClear {
|
|
38
|
-
padding-right: calc(7px + 16px + 7px);
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
.leadingIcon {
|
|
43
|
-
display: block;
|
|
44
|
-
top: 8px;
|
|
45
|
-
left: 8px;
|
|
46
|
-
position: absolute;
|
|
47
|
-
user-select: none;
|
|
48
|
-
pointer-events: none;
|
|
49
|
-
color: var(--on-icon-primary);
|
|
50
|
-
z-index: 0;
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
.clearButton {
|
|
54
|
-
top: 4px;
|
|
55
|
-
right: 4px;
|
|
56
|
-
position: absolute;
|
|
57
|
-
z-index: 0;
|
|
58
|
-
}
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
import type { TestStatus } from "@allurereport/core-api";
|
|
2
|
-
import { Heading } from "@/components/commons/Typography";
|
|
3
|
-
import * as styles from "./styles.scss";
|
|
4
|
-
|
|
5
|
-
type Slice = {
|
|
6
|
-
status: TestStatus;
|
|
7
|
-
count: number;
|
|
8
|
-
d: string;
|
|
9
|
-
};
|
|
10
|
-
|
|
11
|
-
type Props = {
|
|
12
|
-
slices: Slice[];
|
|
13
|
-
percentage: number;
|
|
14
|
-
};
|
|
15
|
-
|
|
16
|
-
function getColorFromStatus(status: TestStatus) {
|
|
17
|
-
switch (status) {
|
|
18
|
-
case "passed":
|
|
19
|
-
return "var(--bg-support-castor)";
|
|
20
|
-
case "failed":
|
|
21
|
-
return "var(--bg-support-capella)";
|
|
22
|
-
case "broken":
|
|
23
|
-
return "var(--bg-support-atlas)";
|
|
24
|
-
case "unknown":
|
|
25
|
-
return "var(--bg-support-skat)";
|
|
26
|
-
case "skipped":
|
|
27
|
-
return "var(--bg-support-rau)";
|
|
28
|
-
default:
|
|
29
|
-
return "var(--bg-support-skat)";
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
export const SuccessRatePieChart = (props: Props) => {
|
|
34
|
-
const { slices, percentage } = props;
|
|
35
|
-
|
|
36
|
-
return (
|
|
37
|
-
<article aria-label="Success rate" role="presentation" className={styles.chart}>
|
|
38
|
-
<svg aria-hidden viewBox="0 0 100 100">
|
|
39
|
-
<g transform={`translate(50, 50)`}>
|
|
40
|
-
{slices.map((slice) => (
|
|
41
|
-
<path key={slice.status} d={slice.d} fill={getColorFromStatus(slice.status)} />
|
|
42
|
-
))}
|
|
43
|
-
</g>
|
|
44
|
-
</svg>
|
|
45
|
-
{!!percentage && (
|
|
46
|
-
<Heading className={styles.legend} size="s" tag="b">
|
|
47
|
-
{percentage}%
|
|
48
|
-
</Heading>
|
|
49
|
-
)}
|
|
50
|
-
</article>
|
|
51
|
-
);
|
|
52
|
-
};
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import { clsx } from "clsx";
|
|
2
|
-
import type { JSX } from "preact";
|
|
3
|
-
import * as styles from "./styles.scss";
|
|
4
|
-
|
|
5
|
-
export type SvgIconProps = Omit<JSX.HTMLAttributes<SVGElement>, "className" | "id" | "size" | "inline"> & {
|
|
6
|
-
/**
|
|
7
|
-
* "xs" is 12x12
|
|
8
|
-
* "s" is 16x16
|
|
9
|
-
* "m" size is 20x20
|
|
10
|
-
*
|
|
11
|
-
* @default s
|
|
12
|
-
*/
|
|
13
|
-
size?: "xs" | "s" | "m";
|
|
14
|
-
/**
|
|
15
|
-
* Additional class name
|
|
16
|
-
*/
|
|
17
|
-
className?: string;
|
|
18
|
-
/**
|
|
19
|
-
* Icon id
|
|
20
|
-
*
|
|
21
|
-
* @example
|
|
22
|
-
* import lineShapesMoonIcon from "@/assets/svg/line-shapes-moon.svg";
|
|
23
|
-
*
|
|
24
|
-
* <SvgIcon id={lineShapesMoonIcon.id} />
|
|
25
|
-
*/
|
|
26
|
-
id: string;
|
|
27
|
-
/**
|
|
28
|
-
* Inline icon
|
|
29
|
-
*/
|
|
30
|
-
inline?: boolean;
|
|
31
|
-
};
|
|
32
|
-
|
|
33
|
-
/**
|
|
34
|
-
* Renders SVG icon
|
|
35
|
-
*
|
|
36
|
-
* default size is 16x16
|
|
37
|
-
*/
|
|
38
|
-
export const SvgIcon = (props: SvgIconProps) => {
|
|
39
|
-
const { id, size = "s", inline = false, className = "" } = props;
|
|
40
|
-
|
|
41
|
-
return (
|
|
42
|
-
<svg className={clsx(styles.icon, styles[`size-${size}`], inline && styles.inline, className)}>
|
|
43
|
-
<use xlinkHref={`#${id}`} />
|
|
44
|
-
</svg>
|
|
45
|
-
);
|
|
46
|
-
};
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
.icon {
|
|
2
|
-
display: block;
|
|
3
|
-
overflow: hidden;
|
|
4
|
-
|
|
5
|
-
&.size-xs {
|
|
6
|
-
width: 12px;
|
|
7
|
-
height: 12px;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
&.size-s {
|
|
11
|
-
width: 16px;
|
|
12
|
-
height: 16px;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
&.size-m {
|
|
16
|
-
width: 20px;
|
|
17
|
-
height: 20px;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
&.inline {
|
|
21
|
-
display: inline-block;
|
|
22
|
-
vertical-align: middle;
|
|
23
|
-
position: relative;
|
|
24
|
-
top: -1px;
|
|
25
|
-
}
|
|
26
|
-
}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import * as styles from "./styles.scss";
|
|
2
|
-
|
|
3
|
-
type Props = {
|
|
4
|
-
value: boolean;
|
|
5
|
-
label: string;
|
|
6
|
-
onChange: (value: boolean) => void;
|
|
7
|
-
focusable?: boolean;
|
|
8
|
-
};
|
|
9
|
-
|
|
10
|
-
export const Toggle = (props: Props) => {
|
|
11
|
-
const { value, label, onChange, focusable = true, ...rest } = props;
|
|
12
|
-
|
|
13
|
-
const handleChange = (e: Event) => {
|
|
14
|
-
const newValue = !(e.target as HTMLInputElement).checked;
|
|
15
|
-
onChange(newValue);
|
|
16
|
-
};
|
|
17
|
-
|
|
18
|
-
return (
|
|
19
|
-
<input
|
|
20
|
-
{...rest}
|
|
21
|
-
tabIndex={focusable ? 0 : -1}
|
|
22
|
-
className={styles.toggle}
|
|
23
|
-
role="switch"
|
|
24
|
-
type="checkbox"
|
|
25
|
-
checked={value}
|
|
26
|
-
aria-label={label}
|
|
27
|
-
onToggle={handleChange}
|
|
28
|
-
/>
|
|
29
|
-
);
|
|
30
|
-
};
|