@beweco/aurora-ui 1.0.1-beta.157 → 1.0.1-beta.161
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/assets/css/styles.css +1 -1
- package/dist/index.cjs.js +21 -6
- package/dist/index.esm.js +21 -6
- package/dist/types/components/menu-claw/MenuClaw.d.ts.map +1 -1
- package/dist/types/components/menu-claw/MenuClaw.types.d.ts +17 -0
- package/dist/types/components/menu-claw/MenuClaw.types.d.ts.map +1 -1
- package/dist/types/components/menu-claw/_internal/menu-claw-history/MenuClawHistoryPanel.d.ts.map +1 -1
- package/dist/types/components/menu-claw/_internal/menu-claw-history/MenuClawHistoryPanel.types.d.ts +4 -0
- package/dist/types/components/menu-claw/_internal/menu-claw-history/MenuClawHistoryPanel.types.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs.js
CHANGED
|
@@ -8155,10 +8155,23 @@ function pressLoadMore({ isLoadingMore, onLoadMore, expand, }) {
|
|
|
8155
8155
|
* gana a sus `--button-*` porque las utilidades van en una capa posterior a la de
|
|
8156
8156
|
* `.button`.
|
|
8157
8157
|
*/
|
|
8158
|
-
const MenuClawHistoryPanel = $8WNJc$react.memo(function MenuClawHistoryPanel({ items, initialVisibleCount, onNewConversation, hasMore, onLoadMore, isLoadingMore, loadMoreLabel, isCollapsed, title, newLabel, showMoreLabel, showLessLabel, onBeforeSelect, }) {
|
|
8158
|
+
const MenuClawHistoryPanel = $8WNJc$react.memo(function MenuClawHistoryPanel({ items, initialVisibleCount, onNewConversation, hasMore, onLoadMore, isLoadingMore, loadMoreLabel, isCollapsed, title, newLabel, showMoreLabel, showLessLabel, newsLabel, collapsedNewsLabel, onBeforeSelect, }) {
|
|
8159
8159
|
const [isExpanded, setIsExpanded] = $8WNJc$react.useState(false);
|
|
8160
8160
|
const visibleItems = $8WNJc$react.useMemo(() => (isExpanded ? items : items.slice(0, initialVisibleCount)), [isExpanded, items, initialVisibleCount]);
|
|
8161
8161
|
const hasHiddenItems = items.length > initialVisibleCount;
|
|
8162
|
+
// Punto agregado del lateral comprimido: cuenta TODOS los ítems recibidos, también
|
|
8163
|
+
// los plegados tras «Ver más» (comprimido no hay lista que desplegar).
|
|
8164
|
+
const hasAnyNews = $8WNJc$react.useMemo(() => items.some((item) => item.hasNews === true), [items]);
|
|
8165
|
+
// Expandido pero plegado: una novedad detrás de «Ver más» se señala en el botón, para
|
|
8166
|
+
// que no quede a la vista solo en el agregado del lateral comprimido.
|
|
8167
|
+
const hasHiddenNews = $8WNJc$react.useMemo(() => !isExpanded &&
|
|
8168
|
+
items.slice(initialVisibleCount).some((item) => item.hasNews === true), [isExpanded, items, initialVisibleCount]);
|
|
8169
|
+
// Plegado el botón es solo un icono y su nombre accesible es `aria-label` (que tapa
|
|
8170
|
+
// cualquier `sr-only` hijo): con novedades lleva primero la acción y luego el aviso,
|
|
8171
|
+
// para que el lector no anuncie solo «hay novedades» y pierda «Nueva conversación».
|
|
8172
|
+
const collapsedAriaLabel = hasAnyNews
|
|
8173
|
+
? `${newLabel}, ${collapsedNewsLabel}`
|
|
8174
|
+
: newLabel;
|
|
8162
8175
|
const handleToggleExpand = $8WNJc$react.useCallback(() => {
|
|
8163
8176
|
setIsExpanded((prev) => !prev);
|
|
8164
8177
|
}, []);
|
|
@@ -8176,13 +8189,13 @@ const MenuClawHistoryPanel = $8WNJc$react.memo(function MenuClawHistoryPanel({ i
|
|
|
8176
8189
|
if (isCollapsed && !onNewConversation) {
|
|
8177
8190
|
return null;
|
|
8178
8191
|
}
|
|
8179
|
-
return (jsxRuntime.jsxs("div", { className: "flex max-h-[40%] min-h-0 flex-col gap-2 pb-3", children: [onNewConversation ? (jsxRuntime.jsxs(Button, { title: newLabel, "aria-label": isCollapsed ?
|
|
8192
|
+
return (jsxRuntime.jsxs("div", { className: "flex max-h-[40%] min-h-0 flex-col gap-2 pb-3", children: [onNewConversation ? (jsxRuntime.jsxs(Button, { title: newLabel, "aria-label": isCollapsed ? collapsedAriaLabel : undefined, isIconOnly: isCollapsed, fullWidth: !isCollapsed, onPress: () => onNewConversation(), className: cn("h-9 shrink-0 bg-foreground text-sm font-medium text-background", isCollapsed
|
|
8180
8193
|
? "w-9 min-w-9 self-center"
|
|
8181
|
-
: "justify-start gap-3 px-2"), children: [jsxRuntime.
|
|
8194
|
+
: "justify-start gap-3 px-2"), children: [jsxRuntime.jsxs("span", { className: "relative flex h-5 w-5 shrink-0 items-center justify-center", children: [jsxRuntime.jsx(IconComponent, { icon: "solar:pen-new-square-linear", size: "md", "aria-hidden": true }), isCollapsed && hasAnyNews ? (jsxRuntime.jsx("span", { "data-history-news-aggregate": "", "aria-hidden": "true", className: "absolute -right-1 -top-1 h-2.5 w-2.5 rounded-full bg-primary ring-2 ring-background" })) : null] }), !isCollapsed ? (jsxRuntime.jsx("span", { className: "menu-claw-collapsible truncate", children: newLabel })) : null] })) : null, !isCollapsed && items.length > 0 ? (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx("p", { className: "shrink-0 px-2 pb-1 pt-2 text-xs font-medium uppercase tracking-wide text-default-400", children: title }), jsxRuntime.jsx("ul", { "aria-label": title, className: "flex min-h-0 flex-1 flex-col gap-0.5 overflow-y-auto [&::-webkit-scrollbar]:hidden [-ms-overflow-style:none] [scrollbar-width:none]", children: visibleItems.map((item) => (jsxRuntime.jsx("li", { children: jsxRuntime.jsxs("button", { type: "button", disabled: item.disabled, "aria-disabled": item.disabled, title: item.title, onClick: () => handleItemPress(item), className: cn("flex min-h-9 w-full items-center gap-3 rounded-lg px-2 py-1.5 text-left text-sm text-default-600 transition-colors", "focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-focus", item.disabled
|
|
8182
8195
|
? "cursor-not-allowed opacity-50"
|
|
8183
|
-
: "hover:bg-default-100"), children: [jsxRuntime.jsx("span", { className: "flex h-5 w-5 shrink-0 items-center justify-center text-default-400", children: jsxRuntime.jsx(IconComponent, { icon: "solar:chat-round-dots-linear", size: "md", "aria-hidden": true }) }), jsxRuntime.jsxs("span", { className: "flex min-w-0 flex-col", children: [jsxRuntime.jsx("span", { className: "truncate", children: item.title }), item.meta ? (jsxRuntime.jsx("span", { className: "truncate text-xs text-default-400", children: item.meta })) : null] })] }) }, item.id))) }), hasHiddenItems ? (jsxRuntime.jsxs("button", { type: "button", onClick: handleToggleExpand, "aria-expanded": isExpanded, className: "flex w-full shrink-0 items-center gap-1.5 rounded-lg px-2 py-2 text-xs font-medium text-default-500 transition-colors hover:bg-default-100 hover:text-default-700 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-focus", children: [jsxRuntime.jsx(IconComponent, { icon: isExpanded
|
|
8196
|
+
: "hover:bg-default-100"), children: [jsxRuntime.jsx("span", { className: "flex h-5 w-5 shrink-0 items-center justify-center text-default-400", children: jsxRuntime.jsx(IconComponent, { icon: "solar:chat-round-dots-linear", size: "md", "aria-hidden": true }) }), jsxRuntime.jsxs("span", { className: "flex min-w-0 flex-1 flex-col", children: [jsxRuntime.jsx("span", { className: "truncate", children: item.title }), item.meta ? (jsxRuntime.jsx("span", { className: "truncate text-xs text-default-400", children: item.meta })) : null] }), item.hasNews === true ? (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx("span", { "data-history-news-dot": "", "aria-hidden": "true", className: "h-2 w-2 shrink-0 rounded-full bg-primary" }), jsxRuntime.jsx("span", { className: "sr-only", children: newsLabel })] })) : null] }) }, item.id))) }), hasHiddenItems ? (jsxRuntime.jsxs("button", { type: "button", onClick: handleToggleExpand, "aria-expanded": isExpanded, className: "flex w-full shrink-0 items-center gap-1.5 rounded-lg px-2 py-2 text-xs font-medium text-default-500 transition-colors hover:bg-default-100 hover:text-default-700 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-focus", children: [jsxRuntime.jsx(IconComponent, { icon: isExpanded
|
|
8184
8197
|
? "solar:alt-arrow-up-linear"
|
|
8185
|
-
: "solar:alt-arrow-down-linear", size: "sm", "aria-hidden": true }), isExpanded ? showLessLabel : showMoreLabel] })) : null, onLoadMore &&
|
|
8198
|
+
: "solar:alt-arrow-down-linear", size: "sm", "aria-hidden": true }), isExpanded ? showLessLabel : showMoreLabel, hasHiddenNews ? (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx("span", { "data-history-news-hidden": "", "aria-hidden": "true", className: "h-2 w-2 shrink-0 rounded-full bg-primary" }), jsxRuntime.jsx("span", { className: "sr-only", children: newsLabel })] })) : null] })) : null, onLoadMore &&
|
|
8186
8199
|
isLoadMoreVisible({
|
|
8187
8200
|
hasMore,
|
|
8188
8201
|
hasOnLoadMore: true,
|
|
@@ -8257,6 +8270,8 @@ const DEFAULT_TRANSLATIONS$a = {
|
|
|
8257
8270
|
historyShowMoreLabel: "Ver más",
|
|
8258
8271
|
historyShowLessLabel: "Ver menos",
|
|
8259
8272
|
historyLoadMoreLabel: "Cargar más",
|
|
8273
|
+
historyNewsLabel: "Con novedades",
|
|
8274
|
+
historyCollapsedNewsLabel: "Hay conversaciones con novedades",
|
|
8260
8275
|
};
|
|
8261
8276
|
/** Ítems del historial visibles antes de pulsar "ver más". */
|
|
8262
8277
|
const DEFAULT_HISTORY_VISIBLE_COUNT = 5;
|
|
@@ -8365,7 +8380,7 @@ const MenuClaw = $8WNJc$react.memo(function MenuClaw({ userInfo, helpButton, men
|
|
|
8365
8380
|
? "solar:alt-arrow-right-linear"
|
|
8366
8381
|
: "solar:alt-arrow-left-linear", size: "md", "aria-hidden": true }) })] }), jsxRuntime.jsxs("div", { className: cn("flex items-center py-3", collapsed ? "justify-center gap-0" : "gap-3"), children: [jsxRuntime.jsxs(react.Avatar, { size: "sm", className: "shrink-0", children: [userInfo?.avatar?.trim() ? (jsxRuntime.jsx(react.Avatar.Image, { src: userInfo.avatar, alt: userName })) : null, jsxRuntime.jsx(react.Avatar.Fallback, { className: userInfo?.avatar?.trim()
|
|
8367
8382
|
? undefined
|
|
8368
|
-
: "bg-warning text-warning-foreground", children: getUserInitials(userName) })] }), !collapsed ? (jsxRuntime.jsxs("div", { className: "menu-claw-collapsible flex min-w-0 flex-col overflow-hidden", children: [jsxRuntime.jsx("p", { className: "truncate text-sm font-semibold text-foreground", children: userName }), jsxRuntime.jsx("p", { className: "truncate text-xs text-default-400", children: userRole })] })) : null] }), jsxRuntime.jsx(MenuClawHistoryPanel, { items: historyConfig.items, initialVisibleCount: historyConfig.initialVisibleCount, onNewConversation: history?.onNewConversation, hasMore: historyConfig.hasMore, onLoadMore: history?.onLoadMore, isLoadingMore: historyConfig.isLoadingMore, isCollapsed: collapsed, title: t.historyTitle, newLabel: t.historyNewLabel, showMoreLabel: t.historyShowMoreLabel, showLessLabel: t.historyShowLessLabel, loadMoreLabel: t.historyLoadMoreLabel, onBeforeSelect: handleSidebarClose }), jsxRuntime.jsx("nav", { className: "flex min-h-0 flex-1 flex-col overflow-y-auto [&::-webkit-scrollbar]:hidden [-ms-overflow-style:none] [scrollbar-width:none]", children: menuItems.items.map((group) => (jsxRuntime.jsxs("div", { className: "mb-2", children: [group.title && !collapsed ? (jsxRuntime.jsx("p", { className: "px-2 pb-1 pt-2 text-xs font-medium uppercase tracking-wide text-default-400", children: group.title })) : null, jsxRuntime.jsx("ul", { className: "flex flex-col gap-0.5", children: (group.items ?? []).map((item) => (jsxRuntime.jsx(MenuClawNavItem, { item: item, selectedKey: selectedKey, isCollapsed: collapsed, onSelect: handleMenuSelect }, item.key))) })] }, group.key))) }), helpSection ? (jsxRuntime.jsx("div", { className: "mt-auto flex flex-col items-center justify-center", children: jsxRuntime.jsx(Button, { fullWidth: true,
|
|
8383
|
+
: "bg-warning text-warning-foreground", children: getUserInitials(userName) })] }), !collapsed ? (jsxRuntime.jsxs("div", { className: "menu-claw-collapsible flex min-w-0 flex-col overflow-hidden", children: [jsxRuntime.jsx("p", { className: "truncate text-sm font-semibold text-foreground", children: userName }), jsxRuntime.jsx("p", { className: "truncate text-xs text-default-400", children: userRole })] })) : null] }), jsxRuntime.jsx(MenuClawHistoryPanel, { items: historyConfig.items, initialVisibleCount: historyConfig.initialVisibleCount, onNewConversation: history?.onNewConversation, hasMore: historyConfig.hasMore, onLoadMore: history?.onLoadMore, isLoadingMore: historyConfig.isLoadingMore, isCollapsed: collapsed, title: t.historyTitle, newLabel: t.historyNewLabel, showMoreLabel: t.historyShowMoreLabel, showLessLabel: t.historyShowLessLabel, loadMoreLabel: t.historyLoadMoreLabel, newsLabel: t.historyNewsLabel, collapsedNewsLabel: t.historyCollapsedNewsLabel, onBeforeSelect: handleSidebarClose }), jsxRuntime.jsx("nav", { className: "flex min-h-0 flex-1 flex-col overflow-y-auto [&::-webkit-scrollbar]:hidden [-ms-overflow-style:none] [scrollbar-width:none]", children: menuItems.items.map((group) => (jsxRuntime.jsxs("div", { className: "mb-2", children: [group.title && !collapsed ? (jsxRuntime.jsx("p", { className: "px-2 pb-1 pt-2 text-xs font-medium uppercase tracking-wide text-default-400", children: group.title })) : null, jsxRuntime.jsx("ul", { className: "flex flex-col gap-0.5", children: (group.items ?? []).map((item) => (jsxRuntime.jsx(MenuClawNavItem, { item: item, selectedKey: selectedKey, isCollapsed: collapsed, onSelect: handleMenuSelect }, item.key))) })] }, group.key))) }), helpSection ? (jsxRuntime.jsx("div", { className: "mt-auto flex flex-col items-center justify-center", children: jsxRuntime.jsx(Button, { fullWidth: true,
|
|
8369
8384
|
// TECH-2459 · G2 — la fachada propia de `Button` (D-G4-1) pinta
|
|
8370
8385
|
// `color="primary"` por defecto; el crudo de v2 pintaba "default"
|
|
8371
8386
|
// (gris). Se fija explícito para no teñir de azul un botón neutro.
|
package/dist/index.esm.js
CHANGED
|
@@ -8155,10 +8155,23 @@ function pressLoadMore({ isLoadingMore, onLoadMore, expand, }) {
|
|
|
8155
8155
|
* gana a sus `--button-*` porque las utilidades van en una capa posterior a la de
|
|
8156
8156
|
* `.button`.
|
|
8157
8157
|
*/
|
|
8158
|
-
const MenuClawHistoryPanel = $8WNJc$react.memo(function MenuClawHistoryPanel({ items, initialVisibleCount, onNewConversation, hasMore, onLoadMore, isLoadingMore, loadMoreLabel, isCollapsed, title, newLabel, showMoreLabel, showLessLabel, onBeforeSelect, }) {
|
|
8158
|
+
const MenuClawHistoryPanel = $8WNJc$react.memo(function MenuClawHistoryPanel({ items, initialVisibleCount, onNewConversation, hasMore, onLoadMore, isLoadingMore, loadMoreLabel, isCollapsed, title, newLabel, showMoreLabel, showLessLabel, newsLabel, collapsedNewsLabel, onBeforeSelect, }) {
|
|
8159
8159
|
const [isExpanded, setIsExpanded] = $8WNJc$react.useState(false);
|
|
8160
8160
|
const visibleItems = useMemo(() => (isExpanded ? items : items.slice(0, initialVisibleCount)), [isExpanded, items, initialVisibleCount]);
|
|
8161
8161
|
const hasHiddenItems = items.length > initialVisibleCount;
|
|
8162
|
+
// Punto agregado del lateral comprimido: cuenta TODOS los ítems recibidos, también
|
|
8163
|
+
// los plegados tras «Ver más» (comprimido no hay lista que desplegar).
|
|
8164
|
+
const hasAnyNews = useMemo(() => items.some((item) => item.hasNews === true), [items]);
|
|
8165
|
+
// Expandido pero plegado: una novedad detrás de «Ver más» se señala en el botón, para
|
|
8166
|
+
// que no quede a la vista solo en el agregado del lateral comprimido.
|
|
8167
|
+
const hasHiddenNews = useMemo(() => !isExpanded &&
|
|
8168
|
+
items.slice(initialVisibleCount).some((item) => item.hasNews === true), [isExpanded, items, initialVisibleCount]);
|
|
8169
|
+
// Plegado el botón es solo un icono y su nombre accesible es `aria-label` (que tapa
|
|
8170
|
+
// cualquier `sr-only` hijo): con novedades lleva primero la acción y luego el aviso,
|
|
8171
|
+
// para que el lector no anuncie solo «hay novedades» y pierda «Nueva conversación».
|
|
8172
|
+
const collapsedAriaLabel = hasAnyNews
|
|
8173
|
+
? `${newLabel}, ${collapsedNewsLabel}`
|
|
8174
|
+
: newLabel;
|
|
8162
8175
|
const handleToggleExpand = useCallback(() => {
|
|
8163
8176
|
setIsExpanded((prev) => !prev);
|
|
8164
8177
|
}, []);
|
|
@@ -8176,13 +8189,13 @@ const MenuClawHistoryPanel = $8WNJc$react.memo(function MenuClawHistoryPanel({ i
|
|
|
8176
8189
|
if (isCollapsed && !onNewConversation) {
|
|
8177
8190
|
return null;
|
|
8178
8191
|
}
|
|
8179
|
-
return (jsxs("div", { className: "flex max-h-[40%] min-h-0 flex-col gap-2 pb-3", children: [onNewConversation ? (jsxs(Button, { title: newLabel, "aria-label": isCollapsed ?
|
|
8192
|
+
return (jsxs("div", { className: "flex max-h-[40%] min-h-0 flex-col gap-2 pb-3", children: [onNewConversation ? (jsxs(Button, { title: newLabel, "aria-label": isCollapsed ? collapsedAriaLabel : undefined, isIconOnly: isCollapsed, fullWidth: !isCollapsed, onPress: () => onNewConversation(), className: cn("h-9 shrink-0 bg-foreground text-sm font-medium text-background", isCollapsed
|
|
8180
8193
|
? "w-9 min-w-9 self-center"
|
|
8181
|
-
: "justify-start gap-3 px-2"), children: [
|
|
8194
|
+
: "justify-start gap-3 px-2"), children: [jsxs("span", { className: "relative flex h-5 w-5 shrink-0 items-center justify-center", children: [jsx(IconComponent, { icon: "solar:pen-new-square-linear", size: "md", "aria-hidden": true }), isCollapsed && hasAnyNews ? (jsx("span", { "data-history-news-aggregate": "", "aria-hidden": "true", className: "absolute -right-1 -top-1 h-2.5 w-2.5 rounded-full bg-primary ring-2 ring-background" })) : null] }), !isCollapsed ? (jsx("span", { className: "menu-claw-collapsible truncate", children: newLabel })) : null] })) : null, !isCollapsed && items.length > 0 ? (jsxs(Fragment$1, { children: [jsx("p", { className: "shrink-0 px-2 pb-1 pt-2 text-xs font-medium uppercase tracking-wide text-default-400", children: title }), jsx("ul", { "aria-label": title, className: "flex min-h-0 flex-1 flex-col gap-0.5 overflow-y-auto [&::-webkit-scrollbar]:hidden [-ms-overflow-style:none] [scrollbar-width:none]", children: visibleItems.map((item) => (jsx("li", { children: jsxs("button", { type: "button", disabled: item.disabled, "aria-disabled": item.disabled, title: item.title, onClick: () => handleItemPress(item), className: cn("flex min-h-9 w-full items-center gap-3 rounded-lg px-2 py-1.5 text-left text-sm text-default-600 transition-colors", "focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-focus", item.disabled
|
|
8182
8195
|
? "cursor-not-allowed opacity-50"
|
|
8183
|
-
: "hover:bg-default-100"), children: [jsx("span", { className: "flex h-5 w-5 shrink-0 items-center justify-center text-default-400", children: jsx(IconComponent, { icon: "solar:chat-round-dots-linear", size: "md", "aria-hidden": true }) }), jsxs("span", { className: "flex min-w-0 flex-col", children: [jsx("span", { className: "truncate", children: item.title }), item.meta ? (jsx("span", { className: "truncate text-xs text-default-400", children: item.meta })) : null] })] }) }, item.id))) }), hasHiddenItems ? (jsxs("button", { type: "button", onClick: handleToggleExpand, "aria-expanded": isExpanded, className: "flex w-full shrink-0 items-center gap-1.5 rounded-lg px-2 py-2 text-xs font-medium text-default-500 transition-colors hover:bg-default-100 hover:text-default-700 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-focus", children: [jsx(IconComponent, { icon: isExpanded
|
|
8196
|
+
: "hover:bg-default-100"), children: [jsx("span", { className: "flex h-5 w-5 shrink-0 items-center justify-center text-default-400", children: jsx(IconComponent, { icon: "solar:chat-round-dots-linear", size: "md", "aria-hidden": true }) }), jsxs("span", { className: "flex min-w-0 flex-1 flex-col", children: [jsx("span", { className: "truncate", children: item.title }), item.meta ? (jsx("span", { className: "truncate text-xs text-default-400", children: item.meta })) : null] }), item.hasNews === true ? (jsxs(Fragment$1, { children: [jsx("span", { "data-history-news-dot": "", "aria-hidden": "true", className: "h-2 w-2 shrink-0 rounded-full bg-primary" }), jsx("span", { className: "sr-only", children: newsLabel })] })) : null] }) }, item.id))) }), hasHiddenItems ? (jsxs("button", { type: "button", onClick: handleToggleExpand, "aria-expanded": isExpanded, className: "flex w-full shrink-0 items-center gap-1.5 rounded-lg px-2 py-2 text-xs font-medium text-default-500 transition-colors hover:bg-default-100 hover:text-default-700 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-focus", children: [jsx(IconComponent, { icon: isExpanded
|
|
8184
8197
|
? "solar:alt-arrow-up-linear"
|
|
8185
|
-
: "solar:alt-arrow-down-linear", size: "sm", "aria-hidden": true }), isExpanded ? showLessLabel : showMoreLabel] })) : null, onLoadMore &&
|
|
8198
|
+
: "solar:alt-arrow-down-linear", size: "sm", "aria-hidden": true }), isExpanded ? showLessLabel : showMoreLabel, hasHiddenNews ? (jsxs(Fragment$1, { children: [jsx("span", { "data-history-news-hidden": "", "aria-hidden": "true", className: "h-2 w-2 shrink-0 rounded-full bg-primary" }), jsx("span", { className: "sr-only", children: newsLabel })] })) : null] })) : null, onLoadMore &&
|
|
8186
8199
|
isLoadMoreVisible({
|
|
8187
8200
|
hasMore,
|
|
8188
8201
|
hasOnLoadMore: true,
|
|
@@ -8257,6 +8270,8 @@ const DEFAULT_TRANSLATIONS$a = {
|
|
|
8257
8270
|
historyShowMoreLabel: "Ver más",
|
|
8258
8271
|
historyShowLessLabel: "Ver menos",
|
|
8259
8272
|
historyLoadMoreLabel: "Cargar más",
|
|
8273
|
+
historyNewsLabel: "Con novedades",
|
|
8274
|
+
historyCollapsedNewsLabel: "Hay conversaciones con novedades",
|
|
8260
8275
|
};
|
|
8261
8276
|
/** Ítems del historial visibles antes de pulsar "ver más". */
|
|
8262
8277
|
const DEFAULT_HISTORY_VISIBLE_COUNT = 5;
|
|
@@ -8365,7 +8380,7 @@ const MenuClaw = $8WNJc$react.memo(function MenuClaw({ userInfo, helpButton, men
|
|
|
8365
8380
|
? "solar:alt-arrow-right-linear"
|
|
8366
8381
|
: "solar:alt-arrow-left-linear", size: "md", "aria-hidden": true }) })] }), jsxs("div", { className: cn("flex items-center py-3", collapsed ? "justify-center gap-0" : "gap-3"), children: [jsxs(Avatar, { size: "sm", className: "shrink-0", children: [userInfo?.avatar?.trim() ? (jsx(Avatar.Image, { src: userInfo.avatar, alt: userName })) : null, jsx(Avatar.Fallback, { className: userInfo?.avatar?.trim()
|
|
8367
8382
|
? undefined
|
|
8368
|
-
: "bg-warning text-warning-foreground", children: getUserInitials(userName) })] }), !collapsed ? (jsxs("div", { className: "menu-claw-collapsible flex min-w-0 flex-col overflow-hidden", children: [jsx("p", { className: "truncate text-sm font-semibold text-foreground", children: userName }), jsx("p", { className: "truncate text-xs text-default-400", children: userRole })] })) : null] }), jsx(MenuClawHistoryPanel, { items: historyConfig.items, initialVisibleCount: historyConfig.initialVisibleCount, onNewConversation: history?.onNewConversation, hasMore: historyConfig.hasMore, onLoadMore: history?.onLoadMore, isLoadingMore: historyConfig.isLoadingMore, isCollapsed: collapsed, title: t.historyTitle, newLabel: t.historyNewLabel, showMoreLabel: t.historyShowMoreLabel, showLessLabel: t.historyShowLessLabel, loadMoreLabel: t.historyLoadMoreLabel, onBeforeSelect: handleSidebarClose }), jsx("nav", { className: "flex min-h-0 flex-1 flex-col overflow-y-auto [&::-webkit-scrollbar]:hidden [-ms-overflow-style:none] [scrollbar-width:none]", children: menuItems.items.map((group) => (jsxs("div", { className: "mb-2", children: [group.title && !collapsed ? (jsx("p", { className: "px-2 pb-1 pt-2 text-xs font-medium uppercase tracking-wide text-default-400", children: group.title })) : null, jsx("ul", { className: "flex flex-col gap-0.5", children: (group.items ?? []).map((item) => (jsx(MenuClawNavItem, { item: item, selectedKey: selectedKey, isCollapsed: collapsed, onSelect: handleMenuSelect }, item.key))) })] }, group.key))) }), helpSection ? (jsx("div", { className: "mt-auto flex flex-col items-center justify-center", children: jsx(Button, { fullWidth: true,
|
|
8383
|
+
: "bg-warning text-warning-foreground", children: getUserInitials(userName) })] }), !collapsed ? (jsxs("div", { className: "menu-claw-collapsible flex min-w-0 flex-col overflow-hidden", children: [jsx("p", { className: "truncate text-sm font-semibold text-foreground", children: userName }), jsx("p", { className: "truncate text-xs text-default-400", children: userRole })] })) : null] }), jsx(MenuClawHistoryPanel, { items: historyConfig.items, initialVisibleCount: historyConfig.initialVisibleCount, onNewConversation: history?.onNewConversation, hasMore: historyConfig.hasMore, onLoadMore: history?.onLoadMore, isLoadingMore: historyConfig.isLoadingMore, isCollapsed: collapsed, title: t.historyTitle, newLabel: t.historyNewLabel, showMoreLabel: t.historyShowMoreLabel, showLessLabel: t.historyShowLessLabel, loadMoreLabel: t.historyLoadMoreLabel, newsLabel: t.historyNewsLabel, collapsedNewsLabel: t.historyCollapsedNewsLabel, onBeforeSelect: handleSidebarClose }), jsx("nav", { className: "flex min-h-0 flex-1 flex-col overflow-y-auto [&::-webkit-scrollbar]:hidden [-ms-overflow-style:none] [scrollbar-width:none]", children: menuItems.items.map((group) => (jsxs("div", { className: "mb-2", children: [group.title && !collapsed ? (jsx("p", { className: "px-2 pb-1 pt-2 text-xs font-medium uppercase tracking-wide text-default-400", children: group.title })) : null, jsx("ul", { className: "flex flex-col gap-0.5", children: (group.items ?? []).map((item) => (jsx(MenuClawNavItem, { item: item, selectedKey: selectedKey, isCollapsed: collapsed, onSelect: handleMenuSelect }, item.key))) })] }, group.key))) }), helpSection ? (jsx("div", { className: "mt-auto flex flex-col items-center justify-center", children: jsx(Button, { fullWidth: true,
|
|
8369
8384
|
// TECH-2459 · G2 — la fachada propia de `Button` (D-G4-1) pinta
|
|
8370
8385
|
// `color="primary"` por defecto; el crudo de v2 pintaba "default"
|
|
8371
8386
|
// (gris). Se fija explícito para no teñir de azul un botón neutro.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MenuClaw.d.ts","sourceRoot":"","sources":["../../../../src/components/menu-claw/MenuClaw.tsx"],"names":[],"mappings":"AACA,OAAO,KAA+B,MAAM,OAAO,CAAC;AAEpD,OAAO,iBAAiB,CAAC;AAMzB,OAAO,KAAK,EAAE,aAAa,EAAwB,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"MenuClaw.d.ts","sourceRoot":"","sources":["../../../../src/components/menu-claw/MenuClaw.tsx"],"names":[],"mappings":"AACA,OAAO,KAA+B,MAAM,OAAO,CAAC;AAEpD,OAAO,iBAAiB,CAAC;AAMzB,OAAO,KAAK,EAAE,aAAa,EAAwB,MAAM,kBAAkB,CAAC;AAsB5E;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,eAAO,MAAM,QAAQ,EAAE,KAAK,CAAC,EAAE,CAAC,aAAa,CA0U3C,CAAC"}
|
|
@@ -19,6 +19,16 @@ export interface MenuClawHistoryItem {
|
|
|
19
19
|
disabled?: boolean;
|
|
20
20
|
/** Se invoca al activar el ítem. No se llama si `disabled` es `true`. */
|
|
21
21
|
onSelect?: () => void;
|
|
22
|
+
/**
|
|
23
|
+
* La conversación tiene una novedad que el usuario aún no ha visto (p. ej. una
|
|
24
|
+
* tarea terminada). Con `true`, la fila pinta un punto con el color primario
|
|
25
|
+
* (`--color-primary`, el primary del pack activo: el de la agencia) y un texto solo para lectores de pantalla
|
|
26
|
+
* (`translations.historyNewsLabel`). Con el lateral comprimido, si algún ítem lo
|
|
27
|
+
* trae, el icono de la sección lleva un punto agregado
|
|
28
|
+
* (`translations.historyCollapsedNewsLabel`). Ausente = sin punto.
|
|
29
|
+
* @default false
|
|
30
|
+
*/
|
|
31
|
+
hasNews?: boolean;
|
|
22
32
|
}
|
|
23
33
|
/**
|
|
24
34
|
* Sección de historial. Va integrada de serie en `MenuClaw` (no es opt-in),
|
|
@@ -80,6 +90,13 @@ export type MenuClawTranslations = {
|
|
|
80
90
|
historyShowLessLabel?: string;
|
|
81
91
|
/** Etiqueta del botón que pide la página siguiente del historial */
|
|
82
92
|
historyLoadMoreLabel?: string;
|
|
93
|
+
/** Texto para lectores de pantalla de una conversación con novedad (`hasNews`) */
|
|
94
|
+
historyNewsLabel?: string;
|
|
95
|
+
/**
|
|
96
|
+
* Texto para lectores de pantalla del punto agregado del lateral comprimido,
|
|
97
|
+
* cuando alguna conversación tiene novedad
|
|
98
|
+
*/
|
|
99
|
+
historyCollapsedNewsLabel?: string;
|
|
83
100
|
};
|
|
84
101
|
export interface MenuClawProps {
|
|
85
102
|
userInfo: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MenuClaw.types.d.ts","sourceRoot":"","sources":["../../../../src/components/menu-claw/MenuClaw.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mDAAmD,CAAC;AAEzF,YAAY,EAAE,eAAe,EAAE,CAAC;AAEhC;;;GAGG;AACH,MAAM,WAAW,mBAAmB;IACnC,wEAAwE;IACxE,EAAE,EAAE,MAAM,CAAC;IACX,uDAAuD;IACvD,KAAK,EAAE,MAAM,CAAC;IACd,2EAA2E;IAC3E,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;;;OAIG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,yEAAyE;IACzE,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;
|
|
1
|
+
{"version":3,"file":"MenuClaw.types.d.ts","sourceRoot":"","sources":["../../../../src/components/menu-claw/MenuClaw.types.ts"],"names":[],"mappings":"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"}
|
package/dist/types/components/menu-claw/_internal/menu-claw-history/MenuClawHistoryPanel.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MenuClawHistoryPanel.d.ts","sourceRoot":"","sources":["../../../../../../src/components/menu-claw/_internal/menu-claw-history/MenuClawHistoryPanel.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA+B,MAAM,OAAO,CAAC;AAKpD,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,8BAA8B,CAAC;AAG9E;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,eAAO,MAAM,oBAAoB,EAAE,KAAK,CAAC,EAAE,CAAC,yBAAyB,
|
|
1
|
+
{"version":3,"file":"MenuClawHistoryPanel.d.ts","sourceRoot":"","sources":["../../../../../../src/components/menu-claw/_internal/menu-claw-history/MenuClawHistoryPanel.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA+B,MAAM,OAAO,CAAC;AAKpD,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,8BAA8B,CAAC;AAG9E;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,eAAO,MAAM,oBAAoB,EAAE,KAAK,CAAC,EAAE,CAAC,yBAAyB,CAwOlE,CAAC"}
|
package/dist/types/components/menu-claw/_internal/menu-claw-history/MenuClawHistoryPanel.types.d.ts
CHANGED
|
@@ -24,6 +24,10 @@ export type MenuClawHistoryPanelProps = {
|
|
|
24
24
|
showMoreLabel: string;
|
|
25
25
|
/** Etiqueta del botón que vuelve a plegar la lista. */
|
|
26
26
|
showLessLabel: string;
|
|
27
|
+
/** Texto para lectores de pantalla de una fila con novedad (`hasNews`). */
|
|
28
|
+
newsLabel: string;
|
|
29
|
+
/** Texto para lectores de pantalla del punto agregado del lateral comprimido. */
|
|
30
|
+
collapsedNewsLabel: string;
|
|
27
31
|
/**
|
|
28
32
|
* Se invoca antes del `onSelect` del ítem, para que el menú cierre el lateral
|
|
29
33
|
* en móvil igual que hace con los ítems de navegación.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MenuClawHistoryPanel.types.d.ts","sourceRoot":"","sources":["../../../../../../src/components/menu-claw/_internal/menu-claw-history/MenuClawHistoryPanel.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAEhE,MAAM,MAAM,yBAAyB,GAAG;IACvC,yDAAyD;IACzD,KAAK,EAAE,mBAAmB,EAAE,CAAC;IAC7B,sDAAsD;IACtD,mBAAmB,EAAE,MAAM,CAAC;IAC5B,mFAAmF;IACnF,iBAAiB,CAAC,EAAE,MAAM,IAAI,CAAC;IAC/B,sEAAsE;IACtE,OAAO,EAAE,OAAO,CAAC;IACjB,mEAAmE;IACnE,UAAU,CAAC,EAAE,MAAM,IAAI,CAAC;IACxB,kEAAkE;IAClE,aAAa,EAAE,OAAO,CAAC;IACvB,uDAAuD;IACvD,aAAa,EAAE,MAAM,CAAC;IACtB,8EAA8E;IAC9E,WAAW,EAAE,OAAO,CAAC;IACrB,4BAA4B;IAC5B,KAAK,EAAE,MAAM,CAAC;IACd,gDAAgD;IAChD,QAAQ,EAAE,MAAM,CAAC;IACjB,0DAA0D;IAC1D,aAAa,EAAE,MAAM,CAAC;IACtB,uDAAuD;IACvD,aAAa,EAAE,MAAM,CAAC;IACtB;;;OAGG;IACH,cAAc,CAAC,EAAE,MAAM,IAAI,CAAC;CAC5B,CAAC"}
|
|
1
|
+
{"version":3,"file":"MenuClawHistoryPanel.types.d.ts","sourceRoot":"","sources":["../../../../../../src/components/menu-claw/_internal/menu-claw-history/MenuClawHistoryPanel.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAEhE,MAAM,MAAM,yBAAyB,GAAG;IACvC,yDAAyD;IACzD,KAAK,EAAE,mBAAmB,EAAE,CAAC;IAC7B,sDAAsD;IACtD,mBAAmB,EAAE,MAAM,CAAC;IAC5B,mFAAmF;IACnF,iBAAiB,CAAC,EAAE,MAAM,IAAI,CAAC;IAC/B,sEAAsE;IACtE,OAAO,EAAE,OAAO,CAAC;IACjB,mEAAmE;IACnE,UAAU,CAAC,EAAE,MAAM,IAAI,CAAC;IACxB,kEAAkE;IAClE,aAAa,EAAE,OAAO,CAAC;IACvB,uDAAuD;IACvD,aAAa,EAAE,MAAM,CAAC;IACtB,8EAA8E;IAC9E,WAAW,EAAE,OAAO,CAAC;IACrB,4BAA4B;IAC5B,KAAK,EAAE,MAAM,CAAC;IACd,gDAAgD;IAChD,QAAQ,EAAE,MAAM,CAAC;IACjB,0DAA0D;IAC1D,aAAa,EAAE,MAAM,CAAC;IACtB,uDAAuD;IACvD,aAAa,EAAE,MAAM,CAAC;IACtB,2EAA2E;IAC3E,SAAS,EAAE,MAAM,CAAC;IAClB,iFAAiF;IACjF,kBAAkB,EAAE,MAAM,CAAC;IAC3B;;;OAGG;IACH,cAAc,CAAC,EAAE,MAAM,IAAI,CAAC;CAC5B,CAAC"}
|