@djangocfg/ui-tools 2.1.464 → 2.1.466
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/audio-player/index.d.cts +1 -2
- package/dist/audio-player/index.d.ts +1 -2
- package/dist/file-icon/index.d.cts +2 -3
- package/dist/file-icon/index.d.ts +2 -3
- package/dist/tree/index.cjs +8 -6
- package/dist/tree/index.cjs.map +1 -1
- package/dist/tree/index.d.cts +16 -17
- package/dist/tree/index.d.ts +16 -17
- package/dist/tree/index.mjs +8 -6
- package/dist/tree/index.mjs.map +1 -1
- package/package.json +50 -50
- package/src/tools/chat/README.md +5 -1
- package/src/tools/chat/shell/SuggestedPrompts.tsx +26 -33
- package/src/tools/chat/shell/__tests__/SuggestedPrompts.test.tsx +51 -0
- package/src/tools/data/Tree/README.md +3 -0
- package/src/tools/data/Tree/TreeRoot.tsx +13 -6
- package/src/tools/data/Tree/__tests__/TreeRoot.accessibility.test.tsx +36 -0
- package/src/tools/data/Tree/components/TreeEmpty.tsx +1 -0
package/dist/tree/index.d.cts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
1
|
import * as react from 'react';
|
|
3
2
|
import { CSSProperties } from 'react';
|
|
4
3
|
import { T as TreeNode, a as TreeItemId, b as TreeRowSlot, c as TreeContextMenuSlot, d as TreeContextMenuActionsResolver, F as FlatRow, e as TreeRowRenderProps, f as TreeContextMenuItem } from '../slots-ClRpIzoh.cjs';
|
|
@@ -354,7 +353,7 @@ interface TreeActionsHandle {
|
|
|
354
353
|
* For full control, compose with <TreeProvider>, <TreeContent>,
|
|
355
354
|
* <TreeSearchInput>, <TreeRow>, etc. directly from `@djangocfg/ui-tools/tree`.
|
|
356
355
|
*/
|
|
357
|
-
declare function TreeRoot<T>(props: TreeRootProps<T>):
|
|
356
|
+
declare function TreeRoot<T>(props: TreeRootProps<T>): react.JSX.Element;
|
|
358
357
|
|
|
359
358
|
/**
|
|
360
359
|
* `<FinderTree>` — opinionated Finder/Explorer-style preset.
|
|
@@ -375,7 +374,7 @@ declare function TreeRoot<T>(props: TreeRootProps<T>): react_jsx_runtime.JSX.Ele
|
|
|
375
374
|
* />
|
|
376
375
|
* ```
|
|
377
376
|
*/
|
|
378
|
-
declare function FinderTree<T>(props: TreeRootProps<T>):
|
|
377
|
+
declare function FinderTree<T>(props: TreeRootProps<T>): react.JSX.Element;
|
|
379
378
|
|
|
380
379
|
type ClipboardKind = 'cut' | 'copy';
|
|
381
380
|
interface ClipboardEntry {
|
|
@@ -552,7 +551,7 @@ declare function useTreeContext<T>(): TreeContextValue<T>;
|
|
|
552
551
|
interface TreeProviderProps<T> extends Pick<TreeRootProps<T>, 'data' | 'getItemName' | 'loadChildren' | 'selectionMode' | 'activationMode' | 'initialExpandedIds' | 'initialSelectedIds' | 'indent' | 'appearance' | 'onSelectionChange' | 'onExpansionChange' | 'onActivate' | 'filterNode' | 'enableSearch' | 'showIndentGuides' | 'renderIcon' | 'renderLabel' | 'renderActions' | 'renderContextMenu' | 'contextMenuActions' | 'labels' | 'persistKey' | 'persistSelection' | 'adapter' | 'defaultMenuItems' | 'enableInlineRename' | 'enableDnD' | 'canDrop'> {
|
|
553
552
|
children: react.ReactNode;
|
|
554
553
|
}
|
|
555
|
-
declare function TreeProvider<T>(props: TreeProviderProps<T>):
|
|
554
|
+
declare function TreeProvider<T>(props: TreeProviderProps<T>): react.JSX.Element;
|
|
556
555
|
|
|
557
556
|
interface FlattenInput<T> {
|
|
558
557
|
roots: TreeNode<T>[];
|
|
@@ -844,7 +843,7 @@ interface TreeChevronProps {
|
|
|
844
843
|
* Memoised: re-renders only when `isExpanded`, `isFolder` or `className`
|
|
845
844
|
* change. Reads appearance from context.
|
|
846
845
|
*/
|
|
847
|
-
declare function TreeChevronRaw({ isExpanded, isFolder, className }: TreeChevronProps):
|
|
846
|
+
declare function TreeChevronRaw({ isExpanded, isFolder, className }: TreeChevronProps): react.JSX.Element;
|
|
848
847
|
declare const TreeChevron: react.MemoExoticComponent<typeof TreeChevronRaw>;
|
|
849
848
|
|
|
850
849
|
interface TreeIconProps {
|
|
@@ -859,7 +858,7 @@ interface TreeIconProps {
|
|
|
859
858
|
* change. Reads appearance from context — context updates will still
|
|
860
859
|
* trigger re-render as expected.
|
|
861
860
|
*/
|
|
862
|
-
declare function TreeIconRaw({ isFolder, isExpanded, className }: TreeIconProps):
|
|
861
|
+
declare function TreeIconRaw({ isFolder, isExpanded, className }: TreeIconProps): react.JSX.Element;
|
|
863
862
|
declare const TreeIcon: react.MemoExoticComponent<typeof TreeIconRaw>;
|
|
864
863
|
|
|
865
864
|
interface TreeLabelProps {
|
|
@@ -873,7 +872,7 @@ interface TreeLabelProps {
|
|
|
873
872
|
* Memoised: re-renders only when `children`, `isMatchingSearch` or
|
|
874
873
|
* `className` change. `children` is compared by reference.
|
|
875
874
|
*/
|
|
876
|
-
declare function TreeLabelRaw({ children, isMatchingSearch, className }: TreeLabelProps):
|
|
875
|
+
declare function TreeLabelRaw({ children, isMatchingSearch, className }: TreeLabelProps): react.JSX.Element;
|
|
877
876
|
declare const TreeLabel: react.MemoExoticComponent<typeof TreeLabelRaw>;
|
|
878
877
|
|
|
879
878
|
interface TreeRowProps<T> {
|
|
@@ -887,7 +886,7 @@ interface TreeRowProps<T> {
|
|
|
887
886
|
* `row` is treated as immutable — the parent should not mutate node
|
|
888
887
|
* objects in place.
|
|
889
888
|
*/
|
|
890
|
-
declare function TreeRowRaw<T>({ row, className }: TreeRowProps<T>):
|
|
889
|
+
declare function TreeRowRaw<T>({ row, className }: TreeRowProps<T>): react.JSX.Element;
|
|
891
890
|
declare const TreeRow: typeof TreeRowRaw;
|
|
892
891
|
|
|
893
892
|
interface TreeContentProps<T> {
|
|
@@ -903,31 +902,31 @@ interface TreeContentProps<T> {
|
|
|
903
902
|
*/
|
|
904
903
|
role?: 'tree' | 'group' | 'presentation';
|
|
905
904
|
}
|
|
906
|
-
declare function TreeContent<T>({ children, className, ariaLabel, role, }: TreeContentProps<T>):
|
|
905
|
+
declare function TreeContent<T>({ children, className, ariaLabel, role, }: TreeContentProps<T>): react.JSX.Element;
|
|
907
906
|
|
|
908
907
|
interface TreeSearchInputProps {
|
|
909
908
|
className?: string;
|
|
910
909
|
showMatches?: boolean;
|
|
911
910
|
}
|
|
912
|
-
declare function TreeSearchInput({ className, showMatches }: TreeSearchInputProps):
|
|
911
|
+
declare function TreeSearchInput({ className, showMatches }: TreeSearchInputProps): react.JSX.Element;
|
|
913
912
|
|
|
914
913
|
interface TreeEmptyProps {
|
|
915
914
|
children: React.ReactNode;
|
|
916
915
|
className?: string;
|
|
917
916
|
}
|
|
918
|
-
declare function TreeEmpty({ children, className }: TreeEmptyProps):
|
|
917
|
+
declare function TreeEmpty({ children, className }: TreeEmptyProps): react.JSX.Element;
|
|
919
918
|
|
|
920
919
|
interface TreeSkeletonProps {
|
|
921
920
|
rows?: number;
|
|
922
921
|
className?: string;
|
|
923
922
|
}
|
|
924
|
-
declare function TreeSkeleton({ rows, className }: TreeSkeletonProps):
|
|
923
|
+
declare function TreeSkeleton({ rows, className }: TreeSkeletonProps): react.JSX.Element;
|
|
925
924
|
|
|
926
925
|
interface TreeErrorProps {
|
|
927
926
|
children: React.ReactNode;
|
|
928
927
|
className?: string;
|
|
929
928
|
}
|
|
930
|
-
declare function TreeError({ children, className }: TreeErrorProps):
|
|
929
|
+
declare function TreeError({ children, className }: TreeErrorProps): react.JSX.Element;
|
|
931
930
|
|
|
932
931
|
interface TreeIndentGuidesProps {
|
|
933
932
|
level: number;
|
|
@@ -938,7 +937,7 @@ interface TreeIndentGuidesProps {
|
|
|
938
937
|
* 1px column per ancestor level. Decorative — `aria-hidden` and
|
|
939
938
|
* pointer-events disabled. Opacity comes from the tree appearance.
|
|
940
939
|
*/
|
|
941
|
-
declare function TreeIndentGuides({ level, indent }: TreeIndentGuidesProps):
|
|
940
|
+
declare function TreeIndentGuides({ level, indent }: TreeIndentGuidesProps): react.JSX.Element;
|
|
942
941
|
|
|
943
942
|
interface TreeRenameInputProps {
|
|
944
943
|
initialValue: string;
|
|
@@ -962,7 +961,7 @@ interface TreeRenameInputProps {
|
|
|
962
961
|
* - all other keys are stopped from bubbling so Tree's container
|
|
963
962
|
* hotkeys (↑↓ delete F2 etc.) don't fire while typing.
|
|
964
963
|
*/
|
|
965
|
-
declare function TreeRenameInput({ initialValue, isFolder, onCommit, onCancel, className, }: TreeRenameInputProps):
|
|
964
|
+
declare function TreeRenameInput({ initialValue, isFolder, onCommit, onCancel, className, }: TreeRenameInputProps): react.JSX.Element;
|
|
966
965
|
|
|
967
966
|
interface TreeDropIndicatorProps {
|
|
968
967
|
position: TreeMovePosition;
|
|
@@ -982,7 +981,7 @@ interface TreeDropIndicatorProps {
|
|
|
982
981
|
*
|
|
983
982
|
* Positioned absolutely — the parent `TreeRow` provides `position: relative`.
|
|
984
983
|
*/
|
|
985
|
-
declare function TreeDropIndicator({ position, indent, invalid, }: TreeDropIndicatorProps):
|
|
984
|
+
declare function TreeDropIndicator({ position, indent, invalid, }: TreeDropIndicatorProps): react.JSX.Element;
|
|
986
985
|
|
|
987
986
|
interface TreeEmptyAreaProps {
|
|
988
987
|
className?: string;
|
|
@@ -1000,6 +999,6 @@ interface TreeEmptyAreaProps {
|
|
|
1000
999
|
* `adapter.createFile/Folder` and without a clipboard payload shows
|
|
1001
1000
|
* no menu at all.
|
|
1002
1001
|
*/
|
|
1003
|
-
declare function TreeEmptyArea({ className }: TreeEmptyAreaProps):
|
|
1002
|
+
declare function TreeEmptyArea({ className }: TreeEmptyAreaProps): react.JSX.Element;
|
|
1004
1003
|
|
|
1005
1004
|
export { type ChildCache, type ChildEntry, type ChildEntryStatus, DEFAULT_TREE_APPEARANCE, DEFAULT_TREE_LABELS, type DemoNode, FinderTree, FlatRow, type FlattenInput, type PersistedTreeState, type ResolvedAppearance, TREE_DND_MIME, TreeRoot as Tree, type TreeAccentIntensity, type TreeActionsHandle, type TreeActivateOptions, type TreeActivationMode, type TreeAdapter, type TreeAppearance, type TreeBuiltinAction, TreeChevron, type TreeChevronProps, TreeContent, type TreeContentProps, TreeContextMenuActionsResolver, TreeContextMenuItem, TreeContextMenuSlot, type TreeContextValue, type TreeDensity, TreeDropIndicator, type TreeDropIndicatorProps, TreeEmpty, TreeEmptyArea, type TreeEmptyAreaProps, type TreeEmptyProps, TreeError, type TreeErrorProps, TreeIcon, type TreeIconProps, TreeIndentGuides, type TreeIndentGuidesProps, TreeItemId, TreeLabel, type TreeLabelProps, type TreeLabels, type TreeLoadChildren, type TreeMovePosition, TreeNode, TreeProvider, type TreeProviderProps, type TreeRadius, TreeRenameInput, type TreeRenameInputProps, TreeRoot, type TreeRootProps, TreeRow, type TreeRowProps, TreeRowRenderProps, type TreeRowSizing, TreeRowSlot, TreeSearchInput, type TreeSearchInputProps, type TreeSelectionMode, TreeSkeleton, type TreeSkeletonProps, type TreeVariant, type UseTreeFinderHotkeysOptions, type UseTreeKeyboardOptions, type UseTreeTypeAheadOptions, appearanceToStyle, autoSelectRange, clearTreeState, createChildCache, createDemoTree, TreeRoot as default, defaultCanDrop, flattenTree, loadTreeState, resolveAppearance, resolveChildren, resolveDropZone, saveTreeState, splitFileName, useTreeActions, useTreeClipboard, useTreeContext, useTreeDnd, useTreeExpansion, useTreeFinderHotkeys, useTreeFocus, useTreeKeyboard, useTreeLabels, useTreeRename, useTreeRows, useTreeSearch, useTreeSelection, useTreeTypeAhead };
|
package/dist/tree/index.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
1
|
import * as react from 'react';
|
|
3
2
|
import { CSSProperties } from 'react';
|
|
4
3
|
import { T as TreeNode, a as TreeItemId, b as TreeRowSlot, c as TreeContextMenuSlot, d as TreeContextMenuActionsResolver, F as FlatRow, e as TreeRowRenderProps, f as TreeContextMenuItem } from '../slots-ClRpIzoh.js';
|
|
@@ -354,7 +353,7 @@ interface TreeActionsHandle {
|
|
|
354
353
|
* For full control, compose with <TreeProvider>, <TreeContent>,
|
|
355
354
|
* <TreeSearchInput>, <TreeRow>, etc. directly from `@djangocfg/ui-tools/tree`.
|
|
356
355
|
*/
|
|
357
|
-
declare function TreeRoot<T>(props: TreeRootProps<T>):
|
|
356
|
+
declare function TreeRoot<T>(props: TreeRootProps<T>): react.JSX.Element;
|
|
358
357
|
|
|
359
358
|
/**
|
|
360
359
|
* `<FinderTree>` — opinionated Finder/Explorer-style preset.
|
|
@@ -375,7 +374,7 @@ declare function TreeRoot<T>(props: TreeRootProps<T>): react_jsx_runtime.JSX.Ele
|
|
|
375
374
|
* />
|
|
376
375
|
* ```
|
|
377
376
|
*/
|
|
378
|
-
declare function FinderTree<T>(props: TreeRootProps<T>):
|
|
377
|
+
declare function FinderTree<T>(props: TreeRootProps<T>): react.JSX.Element;
|
|
379
378
|
|
|
380
379
|
type ClipboardKind = 'cut' | 'copy';
|
|
381
380
|
interface ClipboardEntry {
|
|
@@ -552,7 +551,7 @@ declare function useTreeContext<T>(): TreeContextValue<T>;
|
|
|
552
551
|
interface TreeProviderProps<T> extends Pick<TreeRootProps<T>, 'data' | 'getItemName' | 'loadChildren' | 'selectionMode' | 'activationMode' | 'initialExpandedIds' | 'initialSelectedIds' | 'indent' | 'appearance' | 'onSelectionChange' | 'onExpansionChange' | 'onActivate' | 'filterNode' | 'enableSearch' | 'showIndentGuides' | 'renderIcon' | 'renderLabel' | 'renderActions' | 'renderContextMenu' | 'contextMenuActions' | 'labels' | 'persistKey' | 'persistSelection' | 'adapter' | 'defaultMenuItems' | 'enableInlineRename' | 'enableDnD' | 'canDrop'> {
|
|
553
552
|
children: react.ReactNode;
|
|
554
553
|
}
|
|
555
|
-
declare function TreeProvider<T>(props: TreeProviderProps<T>):
|
|
554
|
+
declare function TreeProvider<T>(props: TreeProviderProps<T>): react.JSX.Element;
|
|
556
555
|
|
|
557
556
|
interface FlattenInput<T> {
|
|
558
557
|
roots: TreeNode<T>[];
|
|
@@ -844,7 +843,7 @@ interface TreeChevronProps {
|
|
|
844
843
|
* Memoised: re-renders only when `isExpanded`, `isFolder` or `className`
|
|
845
844
|
* change. Reads appearance from context.
|
|
846
845
|
*/
|
|
847
|
-
declare function TreeChevronRaw({ isExpanded, isFolder, className }: TreeChevronProps):
|
|
846
|
+
declare function TreeChevronRaw({ isExpanded, isFolder, className }: TreeChevronProps): react.JSX.Element;
|
|
848
847
|
declare const TreeChevron: react.MemoExoticComponent<typeof TreeChevronRaw>;
|
|
849
848
|
|
|
850
849
|
interface TreeIconProps {
|
|
@@ -859,7 +858,7 @@ interface TreeIconProps {
|
|
|
859
858
|
* change. Reads appearance from context — context updates will still
|
|
860
859
|
* trigger re-render as expected.
|
|
861
860
|
*/
|
|
862
|
-
declare function TreeIconRaw({ isFolder, isExpanded, className }: TreeIconProps):
|
|
861
|
+
declare function TreeIconRaw({ isFolder, isExpanded, className }: TreeIconProps): react.JSX.Element;
|
|
863
862
|
declare const TreeIcon: react.MemoExoticComponent<typeof TreeIconRaw>;
|
|
864
863
|
|
|
865
864
|
interface TreeLabelProps {
|
|
@@ -873,7 +872,7 @@ interface TreeLabelProps {
|
|
|
873
872
|
* Memoised: re-renders only when `children`, `isMatchingSearch` or
|
|
874
873
|
* `className` change. `children` is compared by reference.
|
|
875
874
|
*/
|
|
876
|
-
declare function TreeLabelRaw({ children, isMatchingSearch, className }: TreeLabelProps):
|
|
875
|
+
declare function TreeLabelRaw({ children, isMatchingSearch, className }: TreeLabelProps): react.JSX.Element;
|
|
877
876
|
declare const TreeLabel: react.MemoExoticComponent<typeof TreeLabelRaw>;
|
|
878
877
|
|
|
879
878
|
interface TreeRowProps<T> {
|
|
@@ -887,7 +886,7 @@ interface TreeRowProps<T> {
|
|
|
887
886
|
* `row` is treated as immutable — the parent should not mutate node
|
|
888
887
|
* objects in place.
|
|
889
888
|
*/
|
|
890
|
-
declare function TreeRowRaw<T>({ row, className }: TreeRowProps<T>):
|
|
889
|
+
declare function TreeRowRaw<T>({ row, className }: TreeRowProps<T>): react.JSX.Element;
|
|
891
890
|
declare const TreeRow: typeof TreeRowRaw;
|
|
892
891
|
|
|
893
892
|
interface TreeContentProps<T> {
|
|
@@ -903,31 +902,31 @@ interface TreeContentProps<T> {
|
|
|
903
902
|
*/
|
|
904
903
|
role?: 'tree' | 'group' | 'presentation';
|
|
905
904
|
}
|
|
906
|
-
declare function TreeContent<T>({ children, className, ariaLabel, role, }: TreeContentProps<T>):
|
|
905
|
+
declare function TreeContent<T>({ children, className, ariaLabel, role, }: TreeContentProps<T>): react.JSX.Element;
|
|
907
906
|
|
|
908
907
|
interface TreeSearchInputProps {
|
|
909
908
|
className?: string;
|
|
910
909
|
showMatches?: boolean;
|
|
911
910
|
}
|
|
912
|
-
declare function TreeSearchInput({ className, showMatches }: TreeSearchInputProps):
|
|
911
|
+
declare function TreeSearchInput({ className, showMatches }: TreeSearchInputProps): react.JSX.Element;
|
|
913
912
|
|
|
914
913
|
interface TreeEmptyProps {
|
|
915
914
|
children: React.ReactNode;
|
|
916
915
|
className?: string;
|
|
917
916
|
}
|
|
918
|
-
declare function TreeEmpty({ children, className }: TreeEmptyProps):
|
|
917
|
+
declare function TreeEmpty({ children, className }: TreeEmptyProps): react.JSX.Element;
|
|
919
918
|
|
|
920
919
|
interface TreeSkeletonProps {
|
|
921
920
|
rows?: number;
|
|
922
921
|
className?: string;
|
|
923
922
|
}
|
|
924
|
-
declare function TreeSkeleton({ rows, className }: TreeSkeletonProps):
|
|
923
|
+
declare function TreeSkeleton({ rows, className }: TreeSkeletonProps): react.JSX.Element;
|
|
925
924
|
|
|
926
925
|
interface TreeErrorProps {
|
|
927
926
|
children: React.ReactNode;
|
|
928
927
|
className?: string;
|
|
929
928
|
}
|
|
930
|
-
declare function TreeError({ children, className }: TreeErrorProps):
|
|
929
|
+
declare function TreeError({ children, className }: TreeErrorProps): react.JSX.Element;
|
|
931
930
|
|
|
932
931
|
interface TreeIndentGuidesProps {
|
|
933
932
|
level: number;
|
|
@@ -938,7 +937,7 @@ interface TreeIndentGuidesProps {
|
|
|
938
937
|
* 1px column per ancestor level. Decorative — `aria-hidden` and
|
|
939
938
|
* pointer-events disabled. Opacity comes from the tree appearance.
|
|
940
939
|
*/
|
|
941
|
-
declare function TreeIndentGuides({ level, indent }: TreeIndentGuidesProps):
|
|
940
|
+
declare function TreeIndentGuides({ level, indent }: TreeIndentGuidesProps): react.JSX.Element;
|
|
942
941
|
|
|
943
942
|
interface TreeRenameInputProps {
|
|
944
943
|
initialValue: string;
|
|
@@ -962,7 +961,7 @@ interface TreeRenameInputProps {
|
|
|
962
961
|
* - all other keys are stopped from bubbling so Tree's container
|
|
963
962
|
* hotkeys (↑↓ delete F2 etc.) don't fire while typing.
|
|
964
963
|
*/
|
|
965
|
-
declare function TreeRenameInput({ initialValue, isFolder, onCommit, onCancel, className, }: TreeRenameInputProps):
|
|
964
|
+
declare function TreeRenameInput({ initialValue, isFolder, onCommit, onCancel, className, }: TreeRenameInputProps): react.JSX.Element;
|
|
966
965
|
|
|
967
966
|
interface TreeDropIndicatorProps {
|
|
968
967
|
position: TreeMovePosition;
|
|
@@ -982,7 +981,7 @@ interface TreeDropIndicatorProps {
|
|
|
982
981
|
*
|
|
983
982
|
* Positioned absolutely — the parent `TreeRow` provides `position: relative`.
|
|
984
983
|
*/
|
|
985
|
-
declare function TreeDropIndicator({ position, indent, invalid, }: TreeDropIndicatorProps):
|
|
984
|
+
declare function TreeDropIndicator({ position, indent, invalid, }: TreeDropIndicatorProps): react.JSX.Element;
|
|
986
985
|
|
|
987
986
|
interface TreeEmptyAreaProps {
|
|
988
987
|
className?: string;
|
|
@@ -1000,6 +999,6 @@ interface TreeEmptyAreaProps {
|
|
|
1000
999
|
* `adapter.createFile/Folder` and without a clipboard payload shows
|
|
1001
1000
|
* no menu at all.
|
|
1002
1001
|
*/
|
|
1003
|
-
declare function TreeEmptyArea({ className }: TreeEmptyAreaProps):
|
|
1002
|
+
declare function TreeEmptyArea({ className }: TreeEmptyAreaProps): react.JSX.Element;
|
|
1004
1003
|
|
|
1005
1004
|
export { type ChildCache, type ChildEntry, type ChildEntryStatus, DEFAULT_TREE_APPEARANCE, DEFAULT_TREE_LABELS, type DemoNode, FinderTree, FlatRow, type FlattenInput, type PersistedTreeState, type ResolvedAppearance, TREE_DND_MIME, TreeRoot as Tree, type TreeAccentIntensity, type TreeActionsHandle, type TreeActivateOptions, type TreeActivationMode, type TreeAdapter, type TreeAppearance, type TreeBuiltinAction, TreeChevron, type TreeChevronProps, TreeContent, type TreeContentProps, TreeContextMenuActionsResolver, TreeContextMenuItem, TreeContextMenuSlot, type TreeContextValue, type TreeDensity, TreeDropIndicator, type TreeDropIndicatorProps, TreeEmpty, TreeEmptyArea, type TreeEmptyAreaProps, type TreeEmptyProps, TreeError, type TreeErrorProps, TreeIcon, type TreeIconProps, TreeIndentGuides, type TreeIndentGuidesProps, TreeItemId, TreeLabel, type TreeLabelProps, type TreeLabels, type TreeLoadChildren, type TreeMovePosition, TreeNode, TreeProvider, type TreeProviderProps, type TreeRadius, TreeRenameInput, type TreeRenameInputProps, TreeRoot, type TreeRootProps, TreeRow, type TreeRowProps, TreeRowRenderProps, type TreeRowSizing, TreeRowSlot, TreeSearchInput, type TreeSearchInputProps, type TreeSelectionMode, TreeSkeleton, type TreeSkeletonProps, type TreeVariant, type UseTreeFinderHotkeysOptions, type UseTreeKeyboardOptions, type UseTreeTypeAheadOptions, appearanceToStyle, autoSelectRange, clearTreeState, createChildCache, createDemoTree, TreeRoot as default, defaultCanDrop, flattenTree, loadTreeState, resolveAppearance, resolveChildren, resolveDropZone, saveTreeState, splitFileName, useTreeActions, useTreeClipboard, useTreeContext, useTreeDnd, useTreeExpansion, useTreeFinderHotkeys, useTreeFocus, useTreeKeyboard, useTreeLabels, useTreeRename, useTreeRows, useTreeSearch, useTreeSelection, useTreeTypeAhead };
|
package/dist/tree/index.mjs
CHANGED
|
@@ -2092,6 +2092,7 @@ function TreeEmpty({ children, className }) {
|
|
|
2092
2092
|
return /* @__PURE__ */ jsx(
|
|
2093
2093
|
"div",
|
|
2094
2094
|
{
|
|
2095
|
+
role: "status",
|
|
2095
2096
|
className: cn(
|
|
2096
2097
|
"flex h-full min-h-32 items-center justify-center px-4 py-6 text-sm text-muted-foreground",
|
|
2097
2098
|
className
|
|
@@ -3025,6 +3026,7 @@ function TreeRootShell({
|
|
|
3025
3026
|
[keyboardRef, finderHotkeysRef]
|
|
3026
3027
|
);
|
|
3027
3028
|
const focusedId = ctx.focused;
|
|
3029
|
+
const isEmpty = ctx.flatRows.length === 0;
|
|
3028
3030
|
useEffect(() => {
|
|
3029
3031
|
if (!focusedId) return;
|
|
3030
3032
|
const el = containerRef.current?.querySelector(
|
|
@@ -3049,11 +3051,11 @@ function TreeRootShell({
|
|
|
3049
3051
|
"div",
|
|
3050
3052
|
{
|
|
3051
3053
|
ref: setContainerRef,
|
|
3052
|
-
tabIndex: 0,
|
|
3053
|
-
role: "tree",
|
|
3054
|
-
"aria-label": ctx.labels.ariaLabel,
|
|
3055
|
-
"aria-multiselectable": ctx.selectionMode === "multiple"
|
|
3056
|
-
"aria-activedescendant": focusedId ? treeRowDomId(focusedId) : void 0,
|
|
3054
|
+
tabIndex: isEmpty ? void 0 : 0,
|
|
3055
|
+
role: isEmpty ? void 0 : "tree",
|
|
3056
|
+
"aria-label": isEmpty ? void 0 : ctx.labels.ariaLabel,
|
|
3057
|
+
"aria-multiselectable": !isEmpty && ctx.selectionMode === "multiple" ? true : void 0,
|
|
3058
|
+
"aria-activedescendant": !isEmpty && focusedId ? treeRowDomId(focusedId) : void 0,
|
|
3057
3059
|
className: cn(
|
|
3058
3060
|
"group/tree flex h-full w-full flex-col gap-2 rounded-sm outline-none",
|
|
3059
3061
|
"focus-visible:ring-1 focus-visible:ring-ring/50",
|
|
@@ -3064,7 +3066,7 @@ function TreeRootShell({
|
|
|
3064
3066
|
children: [
|
|
3065
3067
|
enableSearch ? /* @__PURE__ */ jsx(TreeSearchInput, { className: "mx-2 mt-2" }) : null,
|
|
3066
3068
|
/* @__PURE__ */ jsxs("div", { className: "flex min-h-0 flex-1 flex-col overflow-auto px-1", children: [
|
|
3067
|
-
/* @__PURE__ */ jsx(TreeContent, { role: "group", children: renderRow }),
|
|
3069
|
+
/* @__PURE__ */ jsx(TreeContent, { role: isEmpty ? "presentation" : "group", children: renderRow }),
|
|
3068
3070
|
/* @__PURE__ */ jsx(TreeEmptyArea, {})
|
|
3069
3071
|
] })
|
|
3070
3072
|
]
|