@djangocfg/ui-tools 2.1.465 → 2.1.468
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/messages/MessageBubble.tsx +5 -4
- package/src/tools/chat/messages/MessageDateSeparator.tsx +36 -0
- package/src/tools/chat/messages/MessageList.tsx +81 -5
- package/src/tools/chat/messages/__tests__/messageDate.test.ts +50 -0
- package/src/tools/chat/messages/index.ts +7 -0
- package/src/tools/chat/messages/messageDate.ts +79 -0
- package/src/tools/chat/shell/SuggestedPrompts.tsx +26 -33
- package/src/tools/chat/shell/__tests__/SuggestedPrompts.test.tsx +51 -0
- package/src/tools/chat/styles/bubbleTokens.ts +9 -10
- 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.cjs
CHANGED
|
@@ -2115,6 +2115,7 @@ function TreeEmpty({ children, className }) {
|
|
|
2115
2115
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
2116
2116
|
"div",
|
|
2117
2117
|
{
|
|
2118
|
+
role: "status",
|
|
2118
2119
|
className: lib.cn(
|
|
2119
2120
|
"flex h-full min-h-32 items-center justify-center px-4 py-6 text-sm text-muted-foreground",
|
|
2120
2121
|
className
|
|
@@ -3048,6 +3049,7 @@ function TreeRootShell({
|
|
|
3048
3049
|
[keyboardRef, finderHotkeysRef]
|
|
3049
3050
|
);
|
|
3050
3051
|
const focusedId = ctx.focused;
|
|
3052
|
+
const isEmpty = ctx.flatRows.length === 0;
|
|
3051
3053
|
React.useEffect(() => {
|
|
3052
3054
|
if (!focusedId) return;
|
|
3053
3055
|
const el = containerRef.current?.querySelector(
|
|
@@ -3072,11 +3074,11 @@ function TreeRootShell({
|
|
|
3072
3074
|
"div",
|
|
3073
3075
|
{
|
|
3074
3076
|
ref: setContainerRef,
|
|
3075
|
-
tabIndex: 0,
|
|
3076
|
-
role: "tree",
|
|
3077
|
-
"aria-label": ctx.labels.ariaLabel,
|
|
3078
|
-
"aria-multiselectable": ctx.selectionMode === "multiple"
|
|
3079
|
-
"aria-activedescendant": focusedId ? treeRowDomId(focusedId) : void 0,
|
|
3077
|
+
tabIndex: isEmpty ? void 0 : 0,
|
|
3078
|
+
role: isEmpty ? void 0 : "tree",
|
|
3079
|
+
"aria-label": isEmpty ? void 0 : ctx.labels.ariaLabel,
|
|
3080
|
+
"aria-multiselectable": !isEmpty && ctx.selectionMode === "multiple" ? true : void 0,
|
|
3081
|
+
"aria-activedescendant": !isEmpty && focusedId ? treeRowDomId(focusedId) : void 0,
|
|
3080
3082
|
className: lib.cn(
|
|
3081
3083
|
"group/tree flex h-full w-full flex-col gap-2 rounded-sm outline-none",
|
|
3082
3084
|
"focus-visible:ring-1 focus-visible:ring-ring/50",
|
|
@@ -3087,7 +3089,7 @@ function TreeRootShell({
|
|
|
3087
3089
|
children: [
|
|
3088
3090
|
enableSearch ? /* @__PURE__ */ jsxRuntime.jsx(TreeSearchInput, { className: "mx-2 mt-2" }) : null,
|
|
3089
3091
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex min-h-0 flex-1 flex-col overflow-auto px-1", children: [
|
|
3090
|
-
/* @__PURE__ */ jsxRuntime.jsx(TreeContent, { role: "group", children: renderRow }),
|
|
3092
|
+
/* @__PURE__ */ jsxRuntime.jsx(TreeContent, { role: isEmpty ? "presentation" : "group", children: renderRow }),
|
|
3091
3093
|
/* @__PURE__ */ jsxRuntime.jsx(TreeEmptyArea, {})
|
|
3092
3094
|
] })
|
|
3093
3095
|
]
|