@reltio/design 0.0.2 → 0.1.0
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/components/AssistantLoader/AssistantLoader.d.ts +7 -0
- package/components/AssistantLoader/AssistantLoader.js +15 -0
- package/components/AssistantLoader/AssistantLoader.module.css.d.ts +2 -0
- package/components/AssistantLoader/AssistantLoader.module.css.js +101 -0
- package/components/AssistantLoader/AssistantLoader.module.css.json +1 -0
- package/components/AssistantLoader/AssistantLoader.types.d.ts +16 -0
- package/components/AssistantLoader/AssistantLoader.types.js +1 -0
- package/components/AssistantLoader/index.d.ts +2 -0
- package/components/AssistantLoader/index.js +1 -0
- package/components/Chat/Chat.d.ts +14 -0
- package/components/Chat/Chat.js +84 -0
- package/components/Chat/Chat.module.css.d.ts +2 -0
- package/components/Chat/Chat.module.css.js +78 -0
- package/components/Chat/Chat.module.css.json +1 -0
- package/components/Chat/Chat.types.d.ts +58 -0
- package/components/Chat/Chat.types.js +1 -0
- package/components/Chat/components/AssistantMessage/AssistantMessage.d.ts +7 -0
- package/components/Chat/components/AssistantMessage/AssistantMessage.js +24 -0
- package/components/Chat/components/AssistantMessage/AssistantMessage.module.css.d.ts +2 -0
- package/components/Chat/components/AssistantMessage/AssistantMessage.module.css.js +26 -0
- package/components/Chat/components/AssistantMessage/AssistantMessage.module.css.json +1 -0
- package/components/Chat/components/AssistantMessage/AssistantMessage.types.d.ts +20 -0
- package/components/Chat/components/AssistantMessage/AssistantMessage.types.js +1 -0
- package/components/Chat/components/AssistantMessage/index.d.ts +2 -0
- package/components/Chat/components/AssistantMessage/index.js +1 -0
- package/components/Chat/components/UserMessage/UserMessage.d.ts +6 -0
- package/components/Chat/components/UserMessage/UserMessage.js +12 -0
- package/components/Chat/components/UserMessage/UserMessage.module.css.d.ts +2 -0
- package/components/Chat/components/UserMessage/UserMessage.module.css.js +11 -0
- package/components/Chat/components/UserMessage/UserMessage.module.css.json +1 -0
- package/components/Chat/components/UserMessage/UserMessage.types.d.ts +16 -0
- package/components/Chat/components/UserMessage/UserMessage.types.js +1 -0
- package/components/Chat/components/UserMessage/index.d.ts +2 -0
- package/components/Chat/components/UserMessage/index.js +1 -0
- package/components/Chat/index.d.ts +2 -0
- package/components/Chat/index.js +1 -0
- package/components/Details/Details.d.ts +7 -0
- package/components/Details/Details.js +40 -0
- package/components/Details/Details.module.css.d.ts +2 -0
- package/components/Details/Details.module.css.js +105 -0
- package/components/Details/Details.module.css.json +1 -0
- package/components/Details/Details.types.d.ts +55 -0
- package/components/Details/Details.types.js +1 -0
- package/components/Details/index.d.ts +2 -0
- package/components/Details/index.js +1 -0
- package/components/ErrorBoundary/ErrorBoundary.d.ts +12 -0
- package/components/ErrorBoundary/ErrorBoundary.js +23 -0
- package/components/ErrorBoundary/ErrorBoundary.types.d.ts +25 -0
- package/components/ErrorBoundary/ErrorBoundary.types.js +1 -0
- package/components/ErrorBoundary/index.d.ts +2 -0
- package/components/ErrorBoundary/index.js +1 -0
- package/components/ErrorMessage/ErrorMessage.d.ts +6 -0
- package/components/ErrorMessage/ErrorMessage.js +12 -0
- package/components/ErrorMessage/ErrorMessage.module.css.d.ts +2 -0
- package/components/ErrorMessage/ErrorMessage.module.css.js +50 -0
- package/components/ErrorMessage/ErrorMessage.module.css.json +1 -0
- package/components/ErrorMessage/ErrorMessage.types.d.ts +14 -0
- package/components/ErrorMessage/ErrorMessage.types.js +1 -0
- package/components/ErrorMessage/index.d.ts +2 -0
- package/components/ErrorMessage/index.js +1 -0
- package/components/Markdown/Markdown.d.ts +8 -0
- package/components/Markdown/Markdown.js +26 -0
- package/components/Markdown/Markdown.module.css.d.ts +2 -0
- package/components/Markdown/Markdown.module.css.js +228 -0
- package/components/Markdown/Markdown.module.css.json +1 -0
- package/components/Markdown/Markdown.types.d.ts +54 -0
- package/components/Markdown/Markdown.types.js +1 -0
- package/components/Markdown/index.d.ts +2 -0
- package/components/Markdown/index.js +1 -0
- package/components/Markdown/markdownOverrides.d.ts +19 -0
- package/components/Markdown/markdownOverrides.js +36 -0
- package/components/Skeleton/Skeleton.d.ts +7 -0
- package/components/Skeleton/Skeleton.js +16 -0
- package/components/Skeleton/Skeleton.module.css.d.ts +2 -0
- package/components/Skeleton/Skeleton.module.css.js +73 -0
- package/components/Skeleton/Skeleton.module.css.json +1 -0
- package/components/Skeleton/Skeleton.types.d.ts +31 -0
- package/components/Skeleton/Skeleton.types.js +1 -0
- package/components/Skeleton/index.d.ts +2 -0
- package/components/Skeleton/index.js +1 -0
- package/components/TextArea/TextArea.d.ts +22 -0
- package/components/TextArea/TextArea.js +13 -0
- package/components/TextArea/TextArea.module.css.d.ts +2 -0
- package/components/TextArea/TextArea.module.css.js +159 -0
- package/components/TextArea/TextArea.module.css.json +1 -0
- package/components/TextArea/TextArea.types.d.ts +39 -0
- package/components/TextArea/TextArea.types.js +1 -0
- package/components/TextArea/index.d.ts +2 -0
- package/components/TextArea/index.js +1 -0
- package/components/TreeList/TreeList.js +8 -9
- package/components/TreeList/TreeList.types.d.ts +5 -3
- package/components/TreeList/components/TreeNode/TreeNode.js +4 -4
- package/components/TreeList/components/TreeNode/TreeNode.module.css.js +33 -5
- package/components/TreeList/components/TreeNode/TreeNode.module.css.json +1 -1
- package/components/TreeList/components/TreeNode/TreeNode.types.d.ts +1 -1
- package/components/TreeList/helpers.js +1 -1
- package/components/index.d.ts +10 -0
- package/components/index.js +10 -0
- package/icons/AccountCircle.d.ts +2 -0
- package/icons/AccountCircle.js +6 -0
- package/icons/Add.d.ts +2 -0
- package/icons/Add.js +6 -0
- package/icons/ArrowBack.d.ts +2 -0
- package/icons/ArrowBack.js +6 -0
- package/icons/ArrowDropDown.d.ts +2 -0
- package/icons/ArrowDropDown.js +6 -0
- package/icons/ArrowDropUp.d.ts +2 -0
- package/icons/ArrowDropUp.js +6 -0
- package/icons/ArrowForward.d.ts +2 -0
- package/icons/ArrowForward.js +6 -0
- package/icons/ArrowLeft.d.ts +2 -0
- package/icons/ArrowLeft.js +6 -0
- package/icons/ArrowRight.d.ts +2 -0
- package/icons/ArrowRight.js +6 -0
- package/icons/Attachment.d.ts +2 -0
- package/icons/Attachment.js +6 -0
- package/icons/Chat.d.ts +2 -0
- package/icons/Chat.js +6 -0
- package/icons/Check.d.ts +2 -0
- package/icons/Check.js +6 -0
- package/icons/CheckCircle.d.ts +2 -0
- package/icons/CheckCircle.js +6 -0
- package/icons/ChevronLeft.d.ts +2 -0
- package/icons/ChevronLeft.js +6 -0
- package/icons/ChevronRight.d.ts +2 -0
- package/icons/ChevronRight.js +6 -0
- package/icons/Close.d.ts +2 -0
- package/icons/Close.js +6 -0
- package/icons/CodeBrackets.d.ts +2 -0
- package/icons/CodeBrackets.js +6 -0
- package/icons/Comment.d.ts +2 -0
- package/icons/Comment.js +6 -0
- package/icons/ContentCopy.d.ts +2 -0
- package/icons/ContentCopy.js +6 -0
- package/icons/ContentPaste.d.ts +2 -0
- package/icons/ContentPaste.js +6 -0
- package/icons/Delete.d.ts +2 -0
- package/icons/Delete.js +6 -0
- package/icons/Description.d.ts +2 -0
- package/icons/Description.js +6 -0
- package/icons/Download.d.ts +2 -0
- package/icons/Download.js +6 -0
- package/icons/Edit.d.ts +2 -0
- package/icons/Edit.js +6 -0
- package/icons/Email.d.ts +2 -0
- package/icons/Email.js +6 -0
- package/icons/ErrorCircle.d.ts +2 -0
- package/icons/ErrorCircle.js +6 -0
- package/icons/ExpandLess.d.ts +2 -0
- package/icons/ExpandLess.js +6 -0
- package/icons/ExpandMore.d.ts +2 -0
- package/icons/ExpandMore.js +6 -0
- package/icons/FilterList.d.ts +2 -0
- package/icons/FilterList.js +6 -0
- package/icons/Folder.d.ts +2 -0
- package/icons/Folder.js +6 -0
- package/icons/Help.d.ts +2 -0
- package/icons/Help.js +6 -0
- package/icons/Icon.module.css.d.ts +2 -0
- package/icons/Icon.module.css.js +70 -0
- package/icons/Icon.module.css.json +1 -0
- package/icons/Icon.types.d.ts +13 -0
- package/icons/Icon.types.js +1 -0
- package/icons/Info.d.ts +2 -0
- package/icons/Info.js +6 -0
- package/icons/KeyboardArrowDown.d.ts +2 -0
- package/icons/KeyboardArrowDown.js +6 -0
- package/icons/KeyboardArrowUp.d.ts +2 -0
- package/icons/KeyboardArrowUp.js +6 -0
- package/icons/Logout.d.ts +2 -0
- package/icons/Logout.js +6 -0
- package/icons/Menu.d.ts +2 -0
- package/icons/Menu.js +6 -0
- package/icons/Notifications.d.ts +2 -0
- package/icons/Notifications.js +6 -0
- package/icons/People.d.ts +2 -0
- package/icons/People.js +6 -0
- package/icons/Person.d.ts +2 -0
- package/icons/Person.js +6 -0
- package/icons/Refresh.d.ts +2 -0
- package/icons/Refresh.js +6 -0
- package/icons/Remove.d.ts +2 -0
- package/icons/Remove.js +6 -0
- package/icons/Save.d.ts +2 -0
- package/icons/Save.js +6 -0
- package/icons/Search.d.ts +2 -0
- package/icons/Search.js +6 -0
- package/icons/Settings.d.ts +2 -0
- package/icons/Settings.js +6 -0
- package/icons/Share.d.ts +2 -0
- package/icons/Share.js +6 -0
- package/icons/Sort.d.ts +2 -0
- package/icons/Sort.js +6 -0
- package/icons/Upload.d.ts +2 -0
- package/icons/Upload.js +6 -0
- package/icons/Visibility.d.ts +2 -0
- package/icons/Visibility.js +6 -0
- package/icons/VisibilityOff.d.ts +2 -0
- package/icons/VisibilityOff.js +6 -0
- package/icons/Warning.d.ts +2 -0
- package/icons/Warning.js +6 -0
- package/icons/index.d.ts +52 -0
- package/icons/index.js +101 -0
- package/package.json +8 -7
- package/packages/design/index.d.ts +1 -2
- package/packages/design/index.js +1 -2
- package/components/TreeList/components/ChevronIcon.d.ts +0 -5
- package/components/TreeList/components/ChevronIcon.js +0 -8
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./Markdown";
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { MarkdownToJSX } from "markdown-to-jsx";
|
|
2
|
+
import type React from "react";
|
|
3
|
+
type OverrideProps<T extends keyof React.JSX.IntrinsicElements> = React.ComponentPropsWithoutRef<T> & {
|
|
4
|
+
node?: unknown;
|
|
5
|
+
};
|
|
6
|
+
/**
|
|
7
|
+
* Markdown tag overrides — only elements that require React component
|
|
8
|
+
* replacement or extra attributes/logic. Standard HTML elements are
|
|
9
|
+
* styled via `.root` descendant selectors in Markdown.module.css.
|
|
10
|
+
*/
|
|
11
|
+
export declare const baseOverrides: {
|
|
12
|
+
a: ({ node: _node, href, ...props }: OverrideProps<"a">) => import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
table: ({ node: _node, ...props }: OverrideProps<"table">) => import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
button: ({ node: _node, ...props }: OverrideProps<"button">) => import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
details: ({ node: _node, ...props }: OverrideProps<"details">) => import("react/jsx-runtime").JSX.Element;
|
|
16
|
+
li: ({ node: _node, children, ...props }: OverrideProps<"li">) => import("react/jsx-runtime").JSX.Element;
|
|
17
|
+
};
|
|
18
|
+
export declare const allowedOverrides: MarkdownToJSX.Overrides;
|
|
19
|
+
export {};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Children, isValidElement } from "react";
|
|
3
|
+
import { Button } from "../../components/Button";
|
|
4
|
+
import { Details } from "../../components/Details";
|
|
5
|
+
import { classNames } from "../../utils/classNames";
|
|
6
|
+
import styles from "./Markdown.module.css";
|
|
7
|
+
/**
|
|
8
|
+
* Markdown tag overrides — only elements that require React component
|
|
9
|
+
* replacement or extra attributes/logic. Standard HTML elements are
|
|
10
|
+
* styled via `.root` descendant selectors in Markdown.module.css.
|
|
11
|
+
*/
|
|
12
|
+
export const baseOverrides = {
|
|
13
|
+
// Links — external detection, target/rel attributes
|
|
14
|
+
a: ({ node: _node, href, ...props }) => {
|
|
15
|
+
const isExternal = href && (href.startsWith("http") || href.startsWith("//"));
|
|
16
|
+
return (_jsx("a", { ...props, href: href, target: isExternal ? "_blank" : undefined, rel: isExternal ? "noopener noreferrer" : undefined }));
|
|
17
|
+
},
|
|
18
|
+
// Tables — wrapped in a div for overflow scrolling
|
|
19
|
+
table: ({ node: _node, ...props }) => (_jsx("div", { className: classNames(styles.tableWrapper), children: _jsx("table", { ...props }) })),
|
|
20
|
+
// Button — replaced with design system Button component
|
|
21
|
+
button: ({ node: _node, ...props }) => (_jsx(Button, { ...props, className: classNames(props.className) })),
|
|
22
|
+
// Details/Summary — replaced with Details component
|
|
23
|
+
details: ({ node: _node, ...props }) => (_jsx(Details, { ...props, children: props.children })),
|
|
24
|
+
// Task list items — wrap checkbox + text in <label> for accessibility
|
|
25
|
+
li: ({ node: _node, children, ...props }) => {
|
|
26
|
+
const childArray = Children.toArray(children);
|
|
27
|
+
const firstChild = childArray[0];
|
|
28
|
+
const isTaskItem = isValidElement(firstChild) &&
|
|
29
|
+
firstChild.props?.type === "checkbox";
|
|
30
|
+
if (isTaskItem) {
|
|
31
|
+
return (_jsx("li", { ...props, children: _jsx("label", { children: children }) }));
|
|
32
|
+
}
|
|
33
|
+
return _jsx("li", { ...props, children: children });
|
|
34
|
+
},
|
|
35
|
+
};
|
|
36
|
+
export const allowedOverrides = { Button };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { SkeletonProps } from "./Skeleton.types";
|
|
2
|
+
/**
|
|
3
|
+
* Displays a configurable number of rectangular placeholder bars with a shimmer
|
|
4
|
+
* (moving gradient) animation. Used as a loading placeholder to reserve space
|
|
5
|
+
* and indicate that content is loading. Full width by default.
|
|
6
|
+
*/
|
|
7
|
+
export declare const Skeleton: ({ rows, className, ...rest }: SkeletonProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { classNames } from "../../utils/classNames";
|
|
3
|
+
import styles from "./Skeleton.module.css";
|
|
4
|
+
const DEFAULT_LABEL = "Loading content";
|
|
5
|
+
const DEFAULT_ROWS = 3;
|
|
6
|
+
/**
|
|
7
|
+
* Displays a configurable number of rectangular placeholder bars with a shimmer
|
|
8
|
+
* (moving gradient) animation. Used as a loading placeholder to reserve space
|
|
9
|
+
* and indicate that content is loading. Full width by default.
|
|
10
|
+
*/
|
|
11
|
+
export const Skeleton = ({ rows = DEFAULT_ROWS, className, ...rest }) => {
|
|
12
|
+
const rowCount = Math.max(1, Math.floor(Number(rows)) || DEFAULT_ROWS);
|
|
13
|
+
return (
|
|
14
|
+
// biome-ignore lint/a11y/useSemanticElements: status role is correct for loading placeholder; output is for calculation results
|
|
15
|
+
_jsx("div", { className: classNames(styles.skeletonRoot, className), "aria-busy": "true", "aria-label": DEFAULT_LABEL, role: "status", ...rest, children: Array.from({ length: rowCount }, (_, i) => (_jsx("div", { className: styles.row, "aria-hidden": "true" }, i))) }));
|
|
16
|
+
};
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import styleInject from 'style-inject';
|
|
2
|
+
import json from './Skeleton.module.css.json';
|
|
3
|
+
styleInject(`
|
|
4
|
+
._skeletonRoot_1e8wa_1 {
|
|
5
|
+
--reltio-skeleton-row-height: 16px;
|
|
6
|
+
--reltio-skeleton-row-gap: 12px;
|
|
7
|
+
width: 100%;
|
|
8
|
+
display: flex;
|
|
9
|
+
flex-direction: column;
|
|
10
|
+
gap: var(--reltio-skeleton-row-gap, 12px);
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
._row_1e8wa_10 {
|
|
14
|
+
width: 100%;
|
|
15
|
+
height: var(--reltio-skeleton-row-height, 16px);
|
|
16
|
+
background-color: #f5f5fa;
|
|
17
|
+
overflow: hidden;
|
|
18
|
+
position: relative;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
._row_1e8wa_10::before {
|
|
22
|
+
content: "";
|
|
23
|
+
position: absolute;
|
|
24
|
+
top: 0;
|
|
25
|
+
left: 0;
|
|
26
|
+
bottom: 0;
|
|
27
|
+
background-color: #9898b34d;
|
|
28
|
+
animation: _indeterminate1_1e8wa_1 2.1s cubic-bezier(0.65, 0.815, 0.735, 0.395)
|
|
29
|
+
infinite;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
._row_1e8wa_10::after {
|
|
33
|
+
content: "";
|
|
34
|
+
position: absolute;
|
|
35
|
+
top: 0;
|
|
36
|
+
left: 0;
|
|
37
|
+
bottom: 0;
|
|
38
|
+
background-color: #9898b34d;
|
|
39
|
+
animation: _indeterminate2_1e8wa_1 2.1s cubic-bezier(0.165, 0.84, 0.44, 1) infinite;
|
|
40
|
+
animation-delay: 1.15s;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
@keyframes _indeterminate1_1e8wa_1 {
|
|
44
|
+
0% {
|
|
45
|
+
left: -35%;
|
|
46
|
+
right: 100%;
|
|
47
|
+
}
|
|
48
|
+
60% {
|
|
49
|
+
left: 100%;
|
|
50
|
+
right: -90%;
|
|
51
|
+
}
|
|
52
|
+
100% {
|
|
53
|
+
left: 100%;
|
|
54
|
+
right: -90%;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
@keyframes _indeterminate2_1e8wa_1 {
|
|
59
|
+
0% {
|
|
60
|
+
left: -200%;
|
|
61
|
+
right: 100%;
|
|
62
|
+
}
|
|
63
|
+
60% {
|
|
64
|
+
left: 107%;
|
|
65
|
+
right: -8%;
|
|
66
|
+
}
|
|
67
|
+
100% {
|
|
68
|
+
left: 107%;
|
|
69
|
+
right: -8%;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
`);
|
|
73
|
+
export default json;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{ "skeletonRoot": "_skeletonRoot_1e8wa_1", "row": "_row_1e8wa_10", "indeterminate1": "_indeterminate1_1e8wa_1", "indeterminate2": "_indeterminate2_1e8wa_1" }
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type React from "react";
|
|
2
|
+
/**
|
|
3
|
+
* Props for the Skeleton component
|
|
4
|
+
*/
|
|
5
|
+
export type SkeletonProps = {
|
|
6
|
+
/**
|
|
7
|
+
* Number of rectangular placeholder bars to display
|
|
8
|
+
* @default 3
|
|
9
|
+
*/
|
|
10
|
+
rows?: number;
|
|
11
|
+
/**
|
|
12
|
+
* Size (number) passed to styles; affects line height and line gap of placeholder bars (e.g. pixels).
|
|
13
|
+
* @default 16
|
|
14
|
+
*/
|
|
15
|
+
size?: number;
|
|
16
|
+
/**
|
|
17
|
+
* Accessible label for screen readers. When not provided, a default label is used.
|
|
18
|
+
*/
|
|
19
|
+
label?: string;
|
|
20
|
+
/**
|
|
21
|
+
* Additional CSS class names
|
|
22
|
+
*/
|
|
23
|
+
className?: string;
|
|
24
|
+
/**
|
|
25
|
+
* Inline styles (e.g. for CSS variable overrides)
|
|
26
|
+
*/
|
|
27
|
+
style?: React.CSSProperties & {
|
|
28
|
+
"--reltio-skeleton-row-height"?: string;
|
|
29
|
+
"--reltio-skeleton-row-gap"?: string;
|
|
30
|
+
};
|
|
31
|
+
} & Omit<React.ComponentPropsWithoutRef<"div">, "children" | "className" | "style">;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./Skeleton";
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export declare const TextArea: import("react").ForwardRefExoticComponent<{
|
|
2
|
+
label?: string;
|
|
3
|
+
error?: boolean;
|
|
4
|
+
supportingText?: string;
|
|
5
|
+
toolbar?: import("react").ReactNode;
|
|
6
|
+
style?: import("react").CSSProperties & {
|
|
7
|
+
"--reltio-textarea-font-family"?: string;
|
|
8
|
+
"--reltio-textarea-font-size"?: string;
|
|
9
|
+
"--reltio-textarea-line-height"?: string;
|
|
10
|
+
"--reltio-textarea-color-text"?: string;
|
|
11
|
+
"--reltio-textarea-color-border"?: string;
|
|
12
|
+
"--reltio-textarea-color-border-focus"?: string;
|
|
13
|
+
"--reltio-textarea-color-background"?: string;
|
|
14
|
+
"--reltio-textarea-color-error"?: string;
|
|
15
|
+
"--reltio-textarea-color-label"?: string;
|
|
16
|
+
"--reltio-textarea-color-supporting-text"?: string;
|
|
17
|
+
"--reltio-textarea-border-radius"?: string;
|
|
18
|
+
"--reltio-textarea-padding"?: string;
|
|
19
|
+
"--reltio-textarea-min-height"?: string;
|
|
20
|
+
"--reltio-textarea-max-height"?: string;
|
|
21
|
+
};
|
|
22
|
+
} & Omit<import("react").TextareaHTMLAttributes<HTMLTextAreaElement>, "style"> & import("react").RefAttributes<HTMLTextAreaElement>>;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { forwardRef, useId } from "react";
|
|
4
|
+
import { classNames } from "../../utils/classNames";
|
|
5
|
+
import styles from "./TextArea.module.css";
|
|
6
|
+
export const TextArea = forwardRef(({ label, error, supportingText, toolbar, className, id: providedId, ...rest }, ref) => {
|
|
7
|
+
const generatedId = useId();
|
|
8
|
+
const textareaId = providedId || generatedId;
|
|
9
|
+
const supportingTextId = `${textareaId}-supporting`;
|
|
10
|
+
const hasValue = String(rest.value ?? rest.defaultValue ?? "").length > 0;
|
|
11
|
+
return (_jsxs("div", { "data-error": error || undefined, "data-disabled": rest.disabled || undefined, "data-has-value": hasValue || undefined, className: classNames(styles.root, className), children: [_jsxs("label", { htmlFor: textareaId, className: classNames(styles.inputContainer), children: [_jsx("textarea", { ref: ref, id: textareaId, className: classNames(styles.textarea), placeholder: label || rest.placeholder, "aria-invalid": error || undefined, "aria-describedby": supportingText ? supportingTextId : undefined, ...rest }), label && _jsx("span", { className: classNames(styles.label), children: label }), toolbar && (_jsx("div", { className: classNames(styles.toolbar), children: toolbar }))] }), supportingText && (_jsx("div", { id: supportingTextId, className: classNames(styles.supportingText), children: supportingText }))] }));
|
|
12
|
+
});
|
|
13
|
+
TextArea.displayName = "TextArea";
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
import styleInject from 'style-inject';
|
|
2
|
+
import json from './TextArea.module.css.json';
|
|
3
|
+
styleInject(`
|
|
4
|
+
._root_1k56p_1 {
|
|
5
|
+
--reltio-textarea-font-family: var(
|
|
6
|
+
--reltio-font-family-body,
|
|
7
|
+
"Roboto",
|
|
8
|
+
sans-serif
|
|
9
|
+
);
|
|
10
|
+
--reltio-textarea-font-size: var(--reltio-font-size-body, 16px);
|
|
11
|
+
--reltio-textarea-line-height: var(--reltio-line-height-body, 1.5);
|
|
12
|
+
--reltio-textarea-color-text: var(--reltio-color-text, #1d1b20);
|
|
13
|
+
--reltio-textarea-color-border: var(--reltio-color-border, #79747e);
|
|
14
|
+
--reltio-textarea-color-border-focus: var(--reltio-color-primary, #6750a4);
|
|
15
|
+
--reltio-textarea-color-background: var(--reltio-color-background, #fff);
|
|
16
|
+
--reltio-textarea-color-error: var(--reltio-color-error, #b3261e);
|
|
17
|
+
--reltio-textarea-color-label: var(--reltio-color-text-secondary, #49454f);
|
|
18
|
+
--reltio-textarea-color-supporting-text: var(
|
|
19
|
+
--reltio-color-text-secondary,
|
|
20
|
+
#49454f
|
|
21
|
+
);
|
|
22
|
+
--reltio-textarea-border-radius: var(--reltio-spacing-xs, 4px);
|
|
23
|
+
--reltio-textarea-padding: var(--reltio-spacing-md, 16px);
|
|
24
|
+
--reltio-textarea-min-height: var(--reltio-spacing-3xl, 56px);
|
|
25
|
+
--reltio-textarea-max-height: min(500px, 50cqh);
|
|
26
|
+
--reltio-textarea-border-width: 1px;
|
|
27
|
+
--reltio-textarea-border-width-focus: 2px;
|
|
28
|
+
|
|
29
|
+
--_border-color: var(--reltio-textarea-color-border);
|
|
30
|
+
--_border-width: var(--reltio-textarea-border-width);
|
|
31
|
+
--_label-color: var(--reltio-textarea-color-label);
|
|
32
|
+
--_supporting-text-color: var(--reltio-textarea-color-supporting-text);
|
|
33
|
+
|
|
34
|
+
font-family: var(--reltio-textarea-font-family);
|
|
35
|
+
container-type: inline-size;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
._root_1k56p_1:focus-within {
|
|
39
|
+
--_border-color: var(--reltio-textarea-color-border-focus);
|
|
40
|
+
--_border-width: var(--reltio-textarea-border-width-focus);
|
|
41
|
+
--_label-color: var(--reltio-textarea-color-border-focus);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
._root_1k56p_1[data-error="true"] {
|
|
45
|
+
--_border-color: var(--reltio-textarea-color-error);
|
|
46
|
+
--_label-color: var(--reltio-textarea-color-error);
|
|
47
|
+
--_supporting-text-color: var(--reltio-textarea-color-error);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
._root_1k56p_1[data-error="true"]:focus-within {
|
|
51
|
+
--_border-color: var(--reltio-textarea-color-error);
|
|
52
|
+
--_label-color: var(--reltio-textarea-color-error);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
._root_1k56p_1[data-disabled="true"] {
|
|
56
|
+
opacity: 0.38;
|
|
57
|
+
cursor: not-allowed;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
._inputContainer_1k56p_57 {
|
|
61
|
+
position: relative;
|
|
62
|
+
display: grid;
|
|
63
|
+
grid-template-columns: 1fr;
|
|
64
|
+
grid-template-rows: 1fr auto;
|
|
65
|
+
grid-template-areas:
|
|
66
|
+
"textarea"
|
|
67
|
+
"toolbar";
|
|
68
|
+
margin: 0;
|
|
69
|
+
box-sizing: border-box;
|
|
70
|
+
border-radius: var(--reltio-textarea-border-radius);
|
|
71
|
+
outline: var(--_border-width) solid var(--_border-color);
|
|
72
|
+
cursor: text;
|
|
73
|
+
transition:
|
|
74
|
+
outline-color 0.1s ease,
|
|
75
|
+
outline-width 0.1s ease;
|
|
76
|
+
background: var(--reltio-textarea-color-background);
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
._root_1k56p_1[data-disabled="true"] ._inputContainer_1k56p_57 {
|
|
80
|
+
cursor: not-allowed;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
._textarea_1k56p_80 {
|
|
84
|
+
grid-area: textarea;
|
|
85
|
+
position: relative;
|
|
86
|
+
display: block;
|
|
87
|
+
z-index: 1;
|
|
88
|
+
border: none;
|
|
89
|
+
outline: none;
|
|
90
|
+
background: none;
|
|
91
|
+
width: 100%;
|
|
92
|
+
min-height: var(--reltio-textarea-min-height);
|
|
93
|
+
max-height: var(--reltio-textarea-max-height);
|
|
94
|
+
border-radius: var(--reltio-textarea-border-radius);
|
|
95
|
+
box-sizing: border-box;
|
|
96
|
+
font-size: var(--reltio-textarea-font-size);
|
|
97
|
+
font-family: var(--reltio-textarea-font-family);
|
|
98
|
+
line-height: var(--reltio-textarea-line-height);
|
|
99
|
+
resize: none;
|
|
100
|
+
color: var(--reltio-textarea-color-text);
|
|
101
|
+
padding: var(--reltio-textarea-padding);
|
|
102
|
+
overflow-y: auto;
|
|
103
|
+
field-sizing: content;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
._textarea_1k56p_80::placeholder {
|
|
107
|
+
color: var(--reltio-textarea-color-label);
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
._textarea_1k56p_80:disabled {
|
|
111
|
+
cursor: not-allowed;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
._label_1k56p_111 {
|
|
115
|
+
position: absolute;
|
|
116
|
+
opacity: 0;
|
|
117
|
+
top: 16px;
|
|
118
|
+
left: 8px;
|
|
119
|
+
transform: translateY(-50%);
|
|
120
|
+
transition: all 0.2s ease;
|
|
121
|
+
background-color: var(--reltio-textarea-color-background);
|
|
122
|
+
padding: 4px 8px;
|
|
123
|
+
border-radius: var(--reltio-textarea-border-radius);
|
|
124
|
+
color: var(--_label-color);
|
|
125
|
+
z-index: 2;
|
|
126
|
+
font-size: var(--reltio-textarea-font-size);
|
|
127
|
+
font-family: var(--reltio-textarea-font-family);
|
|
128
|
+
pointer-events: none;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
._textarea_1k56p_80:not(:placeholder-shown) + ._label_1k56p_111 {
|
|
132
|
+
top: -1px;
|
|
133
|
+
font-size: 12px;
|
|
134
|
+
opacity: 1;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
._textarea_1k56p_80:focus + ._label_1k56p_111 {
|
|
138
|
+
top: -1px;
|
|
139
|
+
font-size: 12px;
|
|
140
|
+
opacity: 1;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
._supportingText_1k56p_140 {
|
|
144
|
+
font-size: 12px;
|
|
145
|
+
padding: 4px var(--reltio-textarea-padding);
|
|
146
|
+
color: var(--_supporting-text-color);
|
|
147
|
+
font-family: var(--reltio-textarea-font-family);
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
._toolbar_1k56p_147 {
|
|
151
|
+
grid-area: toolbar;
|
|
152
|
+
display: flex;
|
|
153
|
+
flex-direction: row;
|
|
154
|
+
align-items: center;
|
|
155
|
+
gap: 12px;
|
|
156
|
+
padding: 8px 12px;
|
|
157
|
+
}
|
|
158
|
+
`);
|
|
159
|
+
export default json;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{ "root": "_root_1k56p_1", "inputContainer": "_inputContainer_1k56p_57", "textarea": "_textarea_1k56p_80", "label": "_label_1k56p_111", "supportingText": "_supportingText_1k56p_140", "toolbar": "_toolbar_1k56p_147" }
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import type React from "react";
|
|
2
|
+
export type TextAreaProps = {
|
|
3
|
+
/**
|
|
4
|
+
* Floating label text displayed above the textarea
|
|
5
|
+
*/
|
|
6
|
+
label?: string;
|
|
7
|
+
/**
|
|
8
|
+
* Whether the textarea is in an error state
|
|
9
|
+
* @default false
|
|
10
|
+
*/
|
|
11
|
+
error?: boolean;
|
|
12
|
+
/**
|
|
13
|
+
* Helper text displayed below the textarea
|
|
14
|
+
*/
|
|
15
|
+
supportingText?: string;
|
|
16
|
+
/**
|
|
17
|
+
* Toolbar content rendered below the textarea input
|
|
18
|
+
*/
|
|
19
|
+
toolbar?: React.ReactNode;
|
|
20
|
+
/**
|
|
21
|
+
* Custom styles including CSS custom properties for theming
|
|
22
|
+
*/
|
|
23
|
+
style?: React.CSSProperties & {
|
|
24
|
+
"--reltio-textarea-font-family"?: string;
|
|
25
|
+
"--reltio-textarea-font-size"?: string;
|
|
26
|
+
"--reltio-textarea-line-height"?: string;
|
|
27
|
+
"--reltio-textarea-color-text"?: string;
|
|
28
|
+
"--reltio-textarea-color-border"?: string;
|
|
29
|
+
"--reltio-textarea-color-border-focus"?: string;
|
|
30
|
+
"--reltio-textarea-color-background"?: string;
|
|
31
|
+
"--reltio-textarea-color-error"?: string;
|
|
32
|
+
"--reltio-textarea-color-label"?: string;
|
|
33
|
+
"--reltio-textarea-color-supporting-text"?: string;
|
|
34
|
+
"--reltio-textarea-border-radius"?: string;
|
|
35
|
+
"--reltio-textarea-padding"?: string;
|
|
36
|
+
"--reltio-textarea-min-height"?: string;
|
|
37
|
+
"--reltio-textarea-max-height"?: string;
|
|
38
|
+
};
|
|
39
|
+
} & Omit<React.TextareaHTMLAttributes<HTMLTextAreaElement>, "style">;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./TextArea";
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import Tree from "rc-tree";
|
|
3
3
|
import { memo, useCallback, useMemo, useState } from "react";
|
|
4
|
+
import { classNames } from "../../utils/classNames";
|
|
4
5
|
import { TreeNode } from "./components/TreeNode/TreeNode";
|
|
5
6
|
import { getLevelLinesData, transformTreeData } from "./helpers";
|
|
6
7
|
import styles from "./TreeList.module.css";
|
|
@@ -12,18 +13,16 @@ export const TreeList = memo(({ data, LabelComponent, expandedKeys: expandedKeys
|
|
|
12
13
|
const levelLinesMap = useMemo(() => getLevelLinesData(rcData), [rcData]);
|
|
13
14
|
const expandedSet = useMemo(() => isControlled ? new Set(expandedKeysProp ?? []) : expandedKeys, [expandedKeysProp, expandedKeys, isControlled]);
|
|
14
15
|
const expandedArray = useMemo(() => Array.from(expandedSet), [expandedSet]);
|
|
15
|
-
const updateExpandedKeys = useCallback((keys) => {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
16
|
+
const updateExpandedKeys = useCallback((keys, treeItem) => {
|
|
17
|
+
onExpand?.(keys, treeItem);
|
|
18
|
+
if (!isControlled) {
|
|
19
|
+
setExpandedKeys(new Set(keys));
|
|
19
20
|
}
|
|
20
|
-
setExpandedKeys(new Set(keys));
|
|
21
|
-
onExpand?.(keys);
|
|
22
21
|
}, [isControlled, onExpand]);
|
|
23
|
-
const handleToggle = useCallback((id, isExpanded) => {
|
|
22
|
+
const handleToggle = useCallback((id, isExpanded, treeItem) => {
|
|
24
23
|
const next = new Set(expandedSet);
|
|
25
24
|
isExpanded ? next.delete(id) : next.add(id);
|
|
26
|
-
updateExpandedKeys(Array.from(next));
|
|
25
|
+
updateExpandedKeys(Array.from(next), treeItem);
|
|
27
26
|
}, [expandedSet, updateExpandedKeys]);
|
|
28
27
|
const renderTitle = useCallback((node) => {
|
|
29
28
|
const raw = node.data.raw;
|
|
@@ -32,6 +31,6 @@ export const TreeList = memo(({ data, LabelComponent, expandedKeys: expandedKeys
|
|
|
32
31
|
const [levelLines, isLast] = levelLinesMap[node.key] ?? [[], false];
|
|
33
32
|
return (_jsx(TreeNode, { id: node.key, node: raw, depth: node.data.depth, isLeaf: isLeafNode, isExpanded: isExpanded, levelLines: levelLines, isLast: isLast, onToggle: handleToggle, LabelComponent: LabelComponent }));
|
|
34
33
|
}, [expandedSet, levelLinesMap, LabelComponent, handleToggle]);
|
|
35
|
-
return (_jsx("div", { className: styles.root, children: _jsx(Tree, { treeData: rcData, expandAction: false, virtual: false, selectable: false, expandedKeys: expandedArray,
|
|
34
|
+
return (_jsx("div", { className: classNames(styles.root), children: _jsx(Tree, { treeData: rcData, expandAction: false, virtual: false, selectable: false, expandedKeys: expandedArray, showIcon: false, titleRender: renderTitle }) }));
|
|
36
35
|
});
|
|
37
36
|
TreeList.displayName = "TreeList";
|
|
@@ -13,6 +13,8 @@ export type TreeItem = {
|
|
|
13
13
|
label: string;
|
|
14
14
|
/** Optional nested children. */
|
|
15
15
|
children?: TreeItem[];
|
|
16
|
+
/** Optional loading flag for async child fetching. */
|
|
17
|
+
isLoading?: boolean;
|
|
16
18
|
};
|
|
17
19
|
/**
|
|
18
20
|
* Internal rc-tree node representation used for rendering.
|
|
@@ -33,7 +35,7 @@ export type RcTreeNodeData<T> = {
|
|
|
33
35
|
*/
|
|
34
36
|
export type TreeListProps = {
|
|
35
37
|
/** Hierarchical data to render.
|
|
36
|
-
* `type TreeItem = {id: TreeKey; label: string; children?: TreeItem[]}` `type TreeKey = string | number`
|
|
38
|
+
* `type TreeItem = {id: TreeKey; label: string; children?: TreeItem[]; isLoading?: boolean}` `type TreeKey = string | number`
|
|
37
39
|
* @example
|
|
38
40
|
* [
|
|
39
41
|
* { id: "1", label: "Node 1", children: [
|
|
@@ -54,7 +56,7 @@ export type TreeListProps = {
|
|
|
54
56
|
expandedKeys?: TreeKey[];
|
|
55
57
|
/**
|
|
56
58
|
* Called when the expanded state changes (controlled mode).
|
|
57
|
-
* Provides the resulting expanded keys list.
|
|
59
|
+
* Provides the resulting expanded keys list and the toggled node.
|
|
58
60
|
*/
|
|
59
|
-
onExpand?: (keys: TreeKey[]) => void;
|
|
61
|
+
onExpand?: (keys: TreeKey[], node: TreeItem) => void;
|
|
60
62
|
};
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { memo, useCallback } from "react";
|
|
3
|
+
import { ArrowRight } from "../../../../icons/ArrowRight";
|
|
3
4
|
import { classNames } from "../../../../utils/classNames";
|
|
4
|
-
import { ChevronIcon } from "../ChevronIcon";
|
|
5
5
|
import { TreeLevelLines } from "../TreeLevelLines/TreeLevelLines";
|
|
6
6
|
import styles from "./TreeNode.module.css";
|
|
7
7
|
export const TreeNode = memo(({ id, node, depth, isLeaf, isExpanded, levelLines, isLast, onToggle, LabelComponent, }) => {
|
|
8
8
|
const handleToggleClick = useCallback((event) => {
|
|
9
9
|
event.stopPropagation();
|
|
10
|
-
onToggle(id, isExpanded);
|
|
11
|
-
}, [onToggle, id, isExpanded]);
|
|
12
|
-
return (_jsxs("div", { className: classNames(styles.wrapper), "data-depth": depth, children: [_jsx(TreeLevelLines, { levelLines: levelLines, isLast: isLast }), _jsx("span", { className: styles.indent, style: { ["--depth"]: `${depth}` } }), isLeaf ? (_jsx("span", { className: styles.toggle, "aria-hidden": "true" })) : (_jsx("button", { type: "button", className: styles.toggle, "aria-label": isExpanded ? "Collapse" : "Expand", onClick: handleToggleClick, children: _jsx(
|
|
10
|
+
onToggle(id, isExpanded, node);
|
|
11
|
+
}, [onToggle, id, isExpanded, node]);
|
|
12
|
+
return (_jsxs("div", { className: classNames(styles.wrapper), "data-depth": depth, children: [_jsx(TreeLevelLines, { levelLines: levelLines, isLast: isLast }), _jsx("span", { className: classNames(styles.indent), style: { ["--depth"]: `${depth}` } }), isLeaf ? (_jsx("span", { className: classNames(styles.toggle), "aria-hidden": "true" })) : node.isLoading ? (_jsx("span", { className: classNames(styles.toggle), "aria-hidden": "true", children: _jsx("span", { className: classNames(styles.spinner) }) })) : (_jsx("button", { type: "button", className: classNames(styles.toggle), "aria-label": isExpanded ? "Collapse" : "Expand", onClick: handleToggleClick, children: _jsx(ArrowRight, { size: "small", className: classNames(styles.chevron, isExpanded && styles.expanded) }) })), LabelComponent ? _jsx(LabelComponent, { data: node }) : node.label] }));
|
|
13
13
|
});
|
|
14
14
|
TreeNode.displayName = "TreeNode";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import styleInject from 'style-inject';
|
|
2
2
|
import json from './TreeNode.module.css.json';
|
|
3
3
|
styleInject(`
|
|
4
|
-
.
|
|
4
|
+
._wrapper_xk2s6_1 {
|
|
5
5
|
display: flex;
|
|
6
6
|
align-items: center;
|
|
7
7
|
line-height: var(--reltio-tree-list-line-height, 1.5);
|
|
@@ -11,13 +11,13 @@ styleInject(`
|
|
|
11
11
|
z-index: 1;
|
|
12
12
|
}
|
|
13
13
|
|
|
14
|
-
.
|
|
14
|
+
._indent_xk2s6_11 {
|
|
15
15
|
display: inline-block;
|
|
16
16
|
width: calc(var(--depth, 1) * var(--reltio-tree-list-indent-size, 16px));
|
|
17
17
|
flex: 0 0 auto;
|
|
18
18
|
}
|
|
19
19
|
|
|
20
|
-
.
|
|
20
|
+
._toggle_xk2s6_17 {
|
|
21
21
|
display: inline-flex;
|
|
22
22
|
align-items: center;
|
|
23
23
|
justify-content: center;
|
|
@@ -29,13 +29,41 @@ styleInject(`
|
|
|
29
29
|
cursor: pointer;
|
|
30
30
|
}
|
|
31
31
|
|
|
32
|
-
.
|
|
32
|
+
._chevron_xk2s6_29 {
|
|
33
|
+
transition: transform 0.2s ease;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
._expanded_xk2s6_33 {
|
|
37
|
+
transform: rotate(90deg);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
._spinner_xk2s6_37 {
|
|
41
|
+
display: inline-block;
|
|
42
|
+
width: var(--reltio-tree-list-spinner-size, 10px);
|
|
43
|
+
height: var(--reltio-tree-list-spinner-size, 10px);
|
|
44
|
+
border-radius: 50%;
|
|
45
|
+
border: var(--reltio-tree-list-spinner-width, 2px) solid
|
|
46
|
+
var(--reltio-tree-list-spinner-color, currentColor);
|
|
47
|
+
border-top-color: transparent;
|
|
48
|
+
animation: _spin_xk2s6_37 0.8s linear infinite;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
@keyframes _spin_xk2s6_37 {
|
|
52
|
+
from {
|
|
53
|
+
transform: rotate(0deg);
|
|
54
|
+
}
|
|
55
|
+
to {
|
|
56
|
+
transform: rotate(360deg);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
._actions_xk2s6_57 {
|
|
33
61
|
margin-left: auto;
|
|
34
62
|
opacity: 0;
|
|
35
63
|
transition: opacity 0.12s ease;
|
|
36
64
|
}
|
|
37
65
|
|
|
38
|
-
.
|
|
66
|
+
._wrapper_xk2s6_1:hover ._actions_xk2s6_57 {
|
|
39
67
|
opacity: 1;
|
|
40
68
|
}
|
|
41
69
|
`);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{ "wrapper": "
|
|
1
|
+
{ "wrapper": "_wrapper_xk2s6_1", "indent": "_indent_xk2s6_11", "toggle": "_toggle_xk2s6_17", "chevron": "_chevron_xk2s6_29", "expanded": "_expanded_xk2s6_33", "spinner": "_spinner_xk2s6_37", "spin": "_spin_xk2s6_37", "actions": "_actions_xk2s6_57" }
|
|
@@ -8,7 +8,7 @@ export type TreeNodeProps = {
|
|
|
8
8
|
isExpanded: boolean;
|
|
9
9
|
levelLines: boolean[];
|
|
10
10
|
isLast: boolean;
|
|
11
|
-
onToggle: (id: TreeKey, expanded: boolean) => void;
|
|
11
|
+
onToggle: (id: TreeKey, expanded: boolean, node: TreeItem) => void;
|
|
12
12
|
LabelComponent?: ComponentType<{
|
|
13
13
|
data: TreeItem;
|
|
14
14
|
}>;
|
|
@@ -18,7 +18,7 @@ export const transformTreeData = (data, depth = 1, parentId) => {
|
|
|
18
18
|
return data.map((item) => ({
|
|
19
19
|
key: item.id,
|
|
20
20
|
title: null,
|
|
21
|
-
isLeaf: !item.children
|
|
21
|
+
isLeaf: !item.children,
|
|
22
22
|
data: { raw: item, depth, parentId },
|
|
23
23
|
children: item.children
|
|
24
24
|
? transformTreeData(item.children, depth + 1, item.id)
|