@djangocfg/ui-tools 2.1.465 → 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/tree/index.cjs +8 -6
- package/dist/tree/index.cjs.map +1 -1
- package/dist/tree/index.mjs +8 -6
- package/dist/tree/index.mjs.map +1 -1
- package/package.json +6 -6
- 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.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
|
]
|