@allurereport/web-awesome 3.0.0 → 3.0.1
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/dist/multi/{173.app-9931797d1602fc52db5b.js → 173.app-bae2a0fe5738d77cd976.js} +1 -1
- package/dist/multi/174.app-bae2a0fe5738d77cd976.js +1 -0
- package/dist/multi/{252.app-9931797d1602fc52db5b.js → 252.app-bae2a0fe5738d77cd976.js} +1 -1
- package/dist/multi/{282.app-9931797d1602fc52db5b.js → 282.app-bae2a0fe5738d77cd976.js} +1 -1
- package/dist/multi/{29.app-9931797d1602fc52db5b.js → 29.app-bae2a0fe5738d77cd976.js} +1 -1
- package/dist/multi/{416.app-9931797d1602fc52db5b.js → 416.app-bae2a0fe5738d77cd976.js} +1 -1
- package/dist/multi/{527.app-9931797d1602fc52db5b.js → 527.app-bae2a0fe5738d77cd976.js} +1 -1
- package/dist/multi/{600.app-9931797d1602fc52db5b.js → 600.app-bae2a0fe5738d77cd976.js} +1 -1
- package/dist/multi/{605.app-9931797d1602fc52db5b.js → 605.app-bae2a0fe5738d77cd976.js} +1 -1
- package/dist/multi/{638.app-9931797d1602fc52db5b.js → 638.app-bae2a0fe5738d77cd976.js} +1 -1
- package/dist/multi/{672.app-9931797d1602fc52db5b.js → 672.app-bae2a0fe5738d77cd976.js} +1 -1
- package/dist/multi/{686.app-9931797d1602fc52db5b.js → 686.app-bae2a0fe5738d77cd976.js} +1 -1
- package/dist/multi/{725.app-9931797d1602fc52db5b.js → 725.app-bae2a0fe5738d77cd976.js} +1 -1
- package/dist/multi/{741.app-9931797d1602fc52db5b.js → 741.app-bae2a0fe5738d77cd976.js} +1 -1
- package/dist/multi/{755.app-9931797d1602fc52db5b.js → 755.app-bae2a0fe5738d77cd976.js} +1 -1
- package/dist/multi/{894.app-9931797d1602fc52db5b.js → 894.app-bae2a0fe5738d77cd976.js} +1 -1
- package/dist/multi/{91.app-9931797d1602fc52db5b.js → 91.app-bae2a0fe5738d77cd976.js} +1 -1
- package/dist/multi/{943.app-9931797d1602fc52db5b.js → 943.app-bae2a0fe5738d77cd976.js} +1 -1
- package/dist/multi/{980.app-9931797d1602fc52db5b.js → 980.app-bae2a0fe5738d77cd976.js} +1 -1
- package/dist/multi/app-bae2a0fe5738d77cd976.js +2 -0
- package/dist/multi/manifest.json +21 -21
- package/dist/multi/{styles-8fe37354d1c2270c691e.css → styles-bbf68b2ba63c38b53c38.css} +3 -3
- package/dist/single/app-996d3b5869f8fc942b66.js +2 -0
- package/dist/single/manifest.json +1 -1
- package/package.json +8 -8
- package/src/assets/scss/palette.scss +102 -102
- package/src/components/ReportBody/Filters.tsx +84 -33
- package/src/components/ReportBody/HeaderActions.tsx +2 -2
- package/src/components/ReportBody/SortBy.tsx +4 -7
- package/src/components/ReportBody/index.tsx +12 -17
- package/src/components/ReportTabs/index.tsx +37 -0
- package/src/components/SplitLayout/index.tsx +0 -2
- package/src/components/TestResult/TestStepsEmpty/index.tsx +1 -7
- package/src/components/TestResult/TrEmpty/index.tsx +1 -7
- package/src/components/TestResult/TrError/index.tsx +9 -2
- package/src/components/TestResult/TrSteps/TrStep.tsx +3 -3
- package/src/components/Tree/index.tsx +9 -17
- package/src/index.tsx +0 -1
- package/src/locales/az.json +3 -1
- package/src/locales/de.json +3 -1
- package/src/locales/en.json +4 -2
- package/src/locales/es.json +3 -1
- package/src/locales/fr.json +3 -1
- package/src/locales/he.json +3 -1
- package/src/locales/hy.json +3 -1
- package/src/locales/it.json +3 -1
- package/src/locales/ja.json +3 -1
- package/src/locales/ka.json +3 -1
- package/src/locales/kr.json +3 -1
- package/src/locales/nl.json +3 -1
- package/src/locales/pl.json +3 -1
- package/src/locales/pt.json +3 -1
- package/src/locales/ru.json +3 -1
- package/src/locales/sv.json +3 -1
- package/src/locales/tr.json +3 -1
- package/src/locales/ua.json +3 -1
- package/src/locales/zh.json +3 -1
- package/src/stores/tree.ts +37 -121
- package/src/stores/treeFilters/actions.ts +67 -0
- package/src/stores/treeFilters/constants.ts +7 -0
- package/src/stores/treeFilters/index.ts +3 -0
- package/src/stores/treeFilters/store.ts +73 -0
- package/src/stores/treeFilters/types.ts +12 -0
- package/src/utils/persist.ts +23 -0
- package/src/utils/tree.ts +12 -5
- package/src/utils/treeFilters.ts +16 -4
- package/test/stores/treeFilters.test.ts +302 -0
- package/test/utils/treeFilters.test.ts +145 -0
- package/types.d.ts +2 -0
- package/dist/multi/174.app-9931797d1602fc52db5b.js +0 -1
- package/dist/multi/app-9931797d1602fc52db5b.js +0 -2
- package/dist/single/app-6199dc1c2fd3bddc2526.js +0 -2
- package/src/components/Tabs/index.tsx +0 -62
- /package/dist/multi/{app-9931797d1602fc52db5b.js.LICENSE.txt → app-bae2a0fe5738d77cd976.js.LICENSE.txt} +0 -0
- /package/dist/single/{app-6199dc1c2fd3bddc2526.js.LICENSE.txt → app-996d3b5869f8fc942b66.js.LICENSE.txt} +0 -0
- /package/src/components/{Tabs → ReportTabs}/styles.scss +0 -0
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
import { Text } from "@allurereport/web-components";
|
|
2
|
-
import { type ComponentChildren, createContext } from "preact";
|
|
3
|
-
import { useContext, useState } from "preact/hooks";
|
|
4
|
-
import { setTreeStatus } from "@/stores/tree";
|
|
5
|
-
import type { AwesomeStatus } from "../../../types";
|
|
6
|
-
import * as styles from "./styles.scss";
|
|
7
|
-
|
|
8
|
-
type TabsContextT = {
|
|
9
|
-
currentTab: string | undefined;
|
|
10
|
-
setCurrentTab: (tab: string) => void;
|
|
11
|
-
};
|
|
12
|
-
|
|
13
|
-
const TabsContext = createContext<TabsContextT | null>(null);
|
|
14
|
-
|
|
15
|
-
export const useTabsContext = () => {
|
|
16
|
-
const context = useContext(TabsContext);
|
|
17
|
-
|
|
18
|
-
if (!context) {
|
|
19
|
-
throw new Error("Tabs' components must be used within a Tabs component");
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
return context;
|
|
23
|
-
};
|
|
24
|
-
|
|
25
|
-
export const TabsProvider = (props: { initialTab?: string; children: ComponentChildren }) => {
|
|
26
|
-
const { children, initialTab } = props;
|
|
27
|
-
const [currentTab, setCurrentTab] = useState<string | undefined>(initialTab);
|
|
28
|
-
|
|
29
|
-
return <TabsContext.Provider value={{ currentTab, setCurrentTab }}>{children}</TabsContext.Provider>;
|
|
30
|
-
};
|
|
31
|
-
|
|
32
|
-
export const Tabs = (props: { children: ComponentChildren; initialTab?: string }) => {
|
|
33
|
-
return <TabsProvider {...props} />;
|
|
34
|
-
};
|
|
35
|
-
|
|
36
|
-
export const TabsList = (props: { children: ComponentChildren }) => {
|
|
37
|
-
return <div className={styles.tabsList}>{props.children}</div>;
|
|
38
|
-
};
|
|
39
|
-
|
|
40
|
-
export const Tab = (props: { id: string; children: ComponentChildren }) => {
|
|
41
|
-
const { id, children, ...rest } = props;
|
|
42
|
-
const { currentTab, setCurrentTab } = useTabsContext();
|
|
43
|
-
const isCurrentTab = currentTab === id;
|
|
44
|
-
const handleTabClick = () => {
|
|
45
|
-
if (isCurrentTab) {
|
|
46
|
-
setCurrentTab("total");
|
|
47
|
-
setTreeStatus("total");
|
|
48
|
-
return;
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
setCurrentTab(id);
|
|
52
|
-
setTreeStatus(id as AwesomeStatus);
|
|
53
|
-
};
|
|
54
|
-
|
|
55
|
-
return (
|
|
56
|
-
<button {...rest} className={styles.tab} onClick={handleTabClick} aria-current={isCurrentTab ? true : undefined}>
|
|
57
|
-
<Text type="paragraph" size="m" bold>
|
|
58
|
-
{children}
|
|
59
|
-
</Text>
|
|
60
|
-
</button>
|
|
61
|
-
);
|
|
62
|
-
};
|
|
File without changes
|
|
File without changes
|
|
File without changes
|