@apipass/design-system 1.10.1 → 1.11.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.
@@ -0,0 +1,19 @@
1
+ import type { Key, ReactNode } from "react";
2
+ import { type TreeProps as RACTreeProps } from "react-aria-components";
3
+ import "./tree.css";
4
+ export interface TreeNode<T = unknown> {
5
+ id: string;
6
+ label: string;
7
+ data?: T;
8
+ /** Signals a node has children before they are fetched, so the chevron renders ahead of a lazy load. */
9
+ hasChildItems?: boolean;
10
+ /** `undefined` = not loaded yet, `[]` = loaded and empty. */
11
+ children?: TreeNode<T>[];
12
+ }
13
+ export type TreeProps<T> = Omit<RACTreeProps<TreeNode<T>>, "children" | "items"> & {
14
+ items: TreeNode<T>[];
15
+ renderItem: (node: TreeNode<T>) => ReactNode;
16
+ isNodeLoading?: (id: Key) => boolean;
17
+ onItemAction?: (node: TreeNode<T>) => void;
18
+ };
19
+ export declare function Tree<T>({ className, items, renderItem, isNodeLoading, onItemAction, ...props }: TreeProps<T>): import("react/jsx-runtime").JSX.Element;
@@ -28,6 +28,7 @@ export * from "./Tab/Tab";
28
28
  export * from "./Table/Table";
29
29
  export * from "./Tag/Tag";
30
30
  export * from "./Toast/Toast";
31
+ export * from "./Tree/Tree";
31
32
  export * from "./Text/Text";
32
33
  export * from "./Textarea/Textarea";
33
34
  export * from "./Tooltip/Tooltip";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@apipass/design-system",
3
- "version": "1.10.1",
3
+ "version": "1.11.1",
4
4
  "type": "module",
5
5
  "description": "APIPass React Design System",
6
6
  "sideEffects": [