Skip to content

Commit aa8e5ff

Browse files
committed
init libs
1 parent 3bd9e9e commit aa8e5ff

File tree

7 files changed

+38
-5
lines changed

7 files changed

+38
-5
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,24 @@
11
import type { JSX } from "react";
22

3-
import useOptionTraceClasses from "./styles";
3+
import { useComboboxFilter, useId } from "@lib-hooks";
4+
import { Combobox, Flex } from "@lib-components";
5+
import type { TComboboxProps } from "@lib-components";
6+
7+
import { OptionLayoutTemplate } from "../../templates";
8+
import useClasses from "./styles";
49

510
type TProps = {};
611

712
export default function OptionTrace({}: TProps): JSX.Element {
8-
const classes = useOptionTraceClasses();
9-
return <div className={classes.root}>OptionTrace</div>;
13+
const classes = useClasses();
14+
return (
15+
<OptionLayoutTemplate
16+
header="Trace a Word"
17+
subtitle="Use a word as a anchor and find words that are related to it."
18+
onClick={() => {}}
19+
isLoading={false}
20+
disableClick={false}
21+
buttonLabel="Construct trace tree"
22+
></OptionLayoutTemplate>
23+
);
1024
}

apps/frontend/ui/src/navigation/templates/OptionLayout/func.tsx

+7-1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ type TProps = {
99
header: string;
1010
onClick: () => void;
1111
disableClick?: boolean;
12+
buttonLabel?: string;
1213
isLoading?: boolean;
1314
subtitle?: string;
1415
children?: ReactNode;
@@ -17,6 +18,7 @@ type TProps = {
1718
export default function OptionLayout({
1819
header,
1920
onClick,
21+
buttonLabel = "Search",
2022
subtitle = undefined,
2123
children = undefined,
2224
disableClick = false,
@@ -31,7 +33,11 @@ export default function OptionLayout({
3133
</Flex>
3234
{children}
3335
<Button appearance="primary" disabled={disableClick} onClick={onClick}>
34-
{isLoading ? <Spinner size="tiny" appearance="inverted" /> : "Search"}
36+
{isLoading ? (
37+
<Spinner size="tiny" appearance="inverted" />
38+
) : (
39+
buttonLabel
40+
)}
3541
</Button>
3642
</Flex>
3743
);

libs/components/src/index.ts

+3
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,11 @@ export { Button } from "@fluentui/react-components";
55
export { MenuList } from "@fluentui/react-components";
66
export { MenuItemRadio } from "@fluentui/react-components";
77
export { Spinner } from "@fluentui/react-components";
8+
export { Combobox } from "@fluentui/react-components";
89

910
export { Collapse } from "@fluentui/react-motion-components-preview";
1011

1112
export { Tooltip } from "@lib-components/atoms";
1213
export { Flex } from "fluentui-helpers";
14+
15+
export type { ComboboxProps as TComboboxProps } from "@fluentui/react-components";

libs/hooks/.eslintrc.yml

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
extends:
2+
- "../../.eslintrc.frontend.yml"

libs/hooks/src/index.ts

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
export { useComboboxFilter } from "@fluentui/react-components";
2+
export { useId } from "@fluentui/react-components";

libs/hooks/tsconfig.json

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"extends": "../../tsconfig.frontend.json",
3+
"include": ["src"]
4+
}

tsconfig.json

+3-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,9 @@
1818
"@lib-components": ["libs/components/src"],
1919
"@lib-components/*": ["libs/components/src/*"],
2020
"@lib-theme": ["libs/theme/src"],
21-
"@lib-theme/*": ["libs/theme/src/*"]
21+
"@lib-theme/*": ["libs/theme/src/*"],
22+
"@lib-hooks": ["libs/hooks/src"],
23+
"@lib-hooks/*": ["libs/hooks/src/*"]
2224
}
2325
}
2426
}

0 commit comments

Comments
 (0)