@beweco/aurora-ui 1.0.0-beta.150 → 1.0.0-beta.155
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 +166 -29
- package/dist/index.esm.js +166 -29
- package/dist/types/components/menu-claw/MenuClaw.d.ts.map +1 -1
- package/dist/types/components/menu-claw/MenuClaw.types.d.ts +19 -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 +14 -3
- 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 +8 -0
- package/dist/types/components/menu-claw/_internal/menu-claw-history/MenuClawHistoryPanel.types.d.ts.map +1 -1
- package/dist/types/components/menu-claw/_internal/menu-claw-history/menuClawHistoryLoadMore.d.ts +21 -0
- package/dist/types/components/menu-claw/_internal/menu-claw-history/menuClawHistoryLoadMore.d.ts.map +1 -0
- package/dist/types/components/toast/GlobalToast.d.ts +9 -1
- package/dist/types/components/toast/GlobalToast.d.ts.map +1 -1
- package/dist/types/components/toast/_internal/toast-host.d.ts +39 -0
- package/dist/types/components/toast/_internal/toast-host.d.ts.map +1 -0
- package/dist/types/components/toast/index.d.ts +1 -1
- package/dist/types/components/toast/index.d.ts.map +1 -1
- package/dist/types/providers/toast/toast-provider.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/index.esm.js
CHANGED
|
@@ -8113,18 +8113,49 @@ const MenuComponent = $8WNJc$react.memo(function Menu({ commerceInfo, userInfo,
|
|
|
8113
8113
|
color: "default", className: " text-default-500 data-[hovered=true]:text-default-600", startContent: jsx(IconComponent, { className: "text-default-500", icon: "solar:info-circle-line-duotone", size: "md" }), variant: "light", onPress: handleHelpClick, isIconOnly: isCollapsed, children: !isCollapsed && (jsx("span", { className: "collapsible-item truncate", children: helpSection.title })) }) })) : null] }) })] }));
|
|
8114
8114
|
});
|
|
8115
8115
|
|
|
8116
|
+
/**
|
|
8117
|
+
* «Cargar más» solo se ofrece si hay otra página, alguien que pueda pedirla y la lista
|
|
8118
|
+
* ya enseña todo lo recibido (desplegada, o sin ítems plegados tras «Ver más»).
|
|
8119
|
+
*/
|
|
8120
|
+
function isLoadMoreVisible({ hasMore, hasOnLoadMore, isExpanded, hasHiddenItems, }) {
|
|
8121
|
+
return hasMore && hasOnLoadMore && (isExpanded || !hasHiddenItems);
|
|
8122
|
+
}
|
|
8123
|
+
/**
|
|
8124
|
+
* Pulsación de «Cargar más». Con una página en vuelo no hace nada: el botón no usa
|
|
8125
|
+
* `disabled` nativo (perdería el foco del teclado), así que la guarda vive aquí.
|
|
8126
|
+
* Si no, despliega la lista y pide la página, para que lo nuevo no quede tras «Ver más».
|
|
8127
|
+
*/
|
|
8128
|
+
function pressLoadMore({ isLoadingMore, onLoadMore, expand, }) {
|
|
8129
|
+
if (isLoadingMore) {
|
|
8130
|
+
return;
|
|
8131
|
+
}
|
|
8132
|
+
expand();
|
|
8133
|
+
onLoadMore();
|
|
8134
|
+
}
|
|
8135
|
+
|
|
8116
8136
|
/**
|
|
8117
8137
|
* Sección de historial de conversaciones: botón de nueva conversación + lista de
|
|
8118
|
-
* entradas recientes con "ver más"
|
|
8138
|
+
* entradas recientes con "ver más" y, si el consumidor tiene más páginas,
|
|
8139
|
+
* "cargar más".
|
|
8119
8140
|
*
|
|
8120
8141
|
* La lista tiene **scroll interno propio** (`flex-1 min-h-0 overflow-y-auto`) y
|
|
8121
8142
|
* la sección está acotada en altura, para que crecer el historial no arrastre ni
|
|
8122
8143
|
* recorte el área de navegación.
|
|
8123
8144
|
*
|
|
8124
|
-
* Densidad de MenuClaw: fila de 36px, `px-2`, `text-small`/`text-tiny` y
|
|
8125
|
-
* `rounded-lg
|
|
8145
|
+
* Densidad de MenuClaw: fila de 36px, `px-2`, `text-small`/`text-tiny` y filas del
|
|
8146
|
+
* historial con `rounded-lg` — que es justo lo que difiere del menú compartido.
|
|
8147
|
+
*
|
|
8148
|
+
* «Nueva conversación» es el `Button` de la librería, no un `<button>` propio, y
|
|
8149
|
+
* por eso lleva su radio por defecto (`rounded-[24px]`, la píldora de v3): sobre
|
|
8150
|
+
* 36px de alto el radio se recorta a la mitad, así que desplegado es una píldora
|
|
8151
|
+
* y plegado (`isIconOnly`, 36×36) un círculo. Encima de la fachada solo se fija lo
|
|
8152
|
+
* propio de MenuClaw: el alto de 36px (`size="md"` de la fachada mide 40), el
|
|
8153
|
+
* contenido alineado a la izquierda con `px-2`/`gap-3`, el peso 500 y el color
|
|
8154
|
+
* `bg-foreground`/`text-background`, que la fachada no tiene como `color` y que
|
|
8155
|
+
* gana a sus `--button-*` porque las utilidades van en una capa posterior a la de
|
|
8156
|
+
* `.button`.
|
|
8126
8157
|
*/
|
|
8127
|
-
const MenuClawHistoryPanel = $8WNJc$react.memo(function MenuClawHistoryPanel({ items, initialVisibleCount, onNewConversation, 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, onBeforeSelect, }) {
|
|
8128
8159
|
const [isExpanded, setIsExpanded] = $8WNJc$react.useState(false);
|
|
8129
8160
|
const visibleItems = useMemo(() => (isExpanded ? items : items.slice(0, initialVisibleCount)), [isExpanded, items, initialVisibleCount]);
|
|
8130
8161
|
const hasHiddenItems = items.length > initialVisibleCount;
|
|
@@ -8145,11 +8176,23 @@ const MenuClawHistoryPanel = $8WNJc$react.memo(function MenuClawHistoryPanel({ i
|
|
|
8145
8176
|
if (isCollapsed && !onNewConversation) {
|
|
8146
8177
|
return null;
|
|
8147
8178
|
}
|
|
8148
|
-
return (jsxs("div", { className: "flex max-h-[40%] min-h-0 flex-col gap-2 pb-3", children: [onNewConversation ? (jsxs(
|
|
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 ? newLabel : undefined, isIconOnly: isCollapsed, fullWidth: !isCollapsed, onPress: () => onNewConversation(), className: cn("h-9 shrink-0 bg-foreground text-sm font-medium text-background", isCollapsed
|
|
8180
|
+
? "w-9 min-w-9 self-center"
|
|
8181
|
+
: "justify-start gap-3 px-2"), children: [jsx("span", { className: "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 ? (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
|
|
8149
8182
|
? "cursor-not-allowed opacity-50"
|
|
8150
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
|
|
8151
8184
|
? "solar:alt-arrow-up-linear"
|
|
8152
|
-
: "solar:alt-arrow-down-linear", size: "sm", "aria-hidden": true }), isExpanded ? showLessLabel : showMoreLabel] })) : null
|
|
8185
|
+
: "solar:alt-arrow-down-linear", size: "sm", "aria-hidden": true }), isExpanded ? showLessLabel : showMoreLabel] })) : null, onLoadMore &&
|
|
8186
|
+
isLoadMoreVisible({
|
|
8187
|
+
hasMore,
|
|
8188
|
+
hasOnLoadMore: true,
|
|
8189
|
+
isExpanded,
|
|
8190
|
+
hasHiddenItems,
|
|
8191
|
+
}) ? (jsxs("button", { type: "button", onClick: () => pressLoadMore({
|
|
8192
|
+
isLoadingMore,
|
|
8193
|
+
onLoadMore,
|
|
8194
|
+
expand: () => setIsExpanded(true),
|
|
8195
|
+
}), "aria-disabled": isLoadingMore, "aria-busy": isLoadingMore, 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 aria-disabled:cursor-not-allowed aria-disabled:opacity-50", children: [jsx(IconComponent, { icon: "solar:add-circle-linear", size: "sm", "aria-hidden": true }), loadMoreLabel] })) : null] })) : null] }));
|
|
8153
8196
|
});
|
|
8154
8197
|
|
|
8155
8198
|
/** ¿Está la key seleccionada en este ítem o en cualquiera de sus descendientes? */
|
|
@@ -8213,6 +8256,7 @@ const DEFAULT_TRANSLATIONS$a = {
|
|
|
8213
8256
|
historyNewLabel: "Nueva conversación",
|
|
8214
8257
|
historyShowMoreLabel: "Ver más",
|
|
8215
8258
|
historyShowLessLabel: "Ver menos",
|
|
8259
|
+
historyLoadMoreLabel: "Cargar más",
|
|
8216
8260
|
};
|
|
8217
8261
|
/** Ítems del historial visibles antes de pulsar "ver más". */
|
|
8218
8262
|
const DEFAULT_HISTORY_VISIBLE_COUNT = 5;
|
|
@@ -8271,7 +8315,12 @@ const MenuClaw = $8WNJc$react.memo(function MenuClaw({ userInfo, helpButton, men
|
|
|
8271
8315
|
const initialVisibleCount = typeof rawCount === "number" && Number.isFinite(rawCount) && rawCount > 0
|
|
8272
8316
|
? Math.floor(rawCount)
|
|
8273
8317
|
: DEFAULT_HISTORY_VISIBLE_COUNT;
|
|
8274
|
-
return {
|
|
8318
|
+
return {
|
|
8319
|
+
items,
|
|
8320
|
+
initialVisibleCount,
|
|
8321
|
+
hasMore: history?.hasMore === true,
|
|
8322
|
+
isLoadingMore: history?.isLoadingMore === true,
|
|
8323
|
+
};
|
|
8275
8324
|
}, [history]);
|
|
8276
8325
|
const bottomBarItems = useMemo(() => {
|
|
8277
8326
|
if (!mobileBottomBarGroupKey) {
|
|
@@ -8316,7 +8365,7 @@ const MenuClaw = $8WNJc$react.memo(function MenuClaw({ userInfo, helpButton, men
|
|
|
8316
8365
|
? "solar:alt-arrow-right-linear"
|
|
8317
8366
|
: "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()
|
|
8318
8367
|
? undefined
|
|
8319
|
-
: "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, isCollapsed: collapsed, title: t.historyTitle, newLabel: t.historyNewLabel, showMoreLabel: t.historyShowMoreLabel, showLessLabel: t.historyShowLessLabel, 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,
|
|
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,
|
|
8320
8369
|
// TECH-2459 · G2 — la fachada propia de `Button` (D-G4-1) pinta
|
|
8321
8370
|
// `color="primary"` por defecto; el crudo de v2 pintaba "default"
|
|
8322
8371
|
// (gris). Se fija explícito para no teñir de azul un botón neutro.
|
|
@@ -12209,7 +12258,7 @@ function measureTextareaHeight(node, minRows, maxRows) {
|
|
|
12209
12258
|
};
|
|
12210
12259
|
}
|
|
12211
12260
|
// `useLayoutEffect` en el servidor avisa en React 18; el alto solo tiene sentido en el cliente.
|
|
12212
|
-
const useIsomorphicLayoutEffect = typeof window !== "undefined" ? useLayoutEffect : useEffect;
|
|
12261
|
+
const useIsomorphicLayoutEffect$1 = typeof window !== "undefined" ? useLayoutEffect : useEffect;
|
|
12213
12262
|
/**
|
|
12214
12263
|
* Autocrecimiento del `<textarea>` apuntado por `nodeRef`. Devuelve el `resize` para llamarlo
|
|
12215
12264
|
* desde el `onChange` de la fachada.
|
|
@@ -12239,11 +12288,11 @@ function useTextareaAutosize(nodeRef, { enabled, minRows, maxRows }) {
|
|
|
12239
12288
|
const resizeRef = useRef(resize);
|
|
12240
12289
|
resizeRef.current = resize;
|
|
12241
12290
|
// Cada render, como v2: el valor controlado, el `size` o la clase pueden haber cambiado.
|
|
12242
|
-
useIsomorphicLayoutEffect(() => {
|
|
12291
|
+
useIsomorphicLayoutEffect$1(() => {
|
|
12243
12292
|
resize();
|
|
12244
12293
|
});
|
|
12245
12294
|
// Al apagar el autosize, se retira lo que se escribió a mano para que mande el CSS.
|
|
12246
|
-
useIsomorphicLayoutEffect(() => {
|
|
12295
|
+
useIsomorphicLayoutEffect$1(() => {
|
|
12247
12296
|
const node = nodeRef.current;
|
|
12248
12297
|
if (enabled || !node) {
|
|
12249
12298
|
return;
|
|
@@ -12691,6 +12740,68 @@ const useAuraToast = () => {
|
|
|
12691
12740
|
return context;
|
|
12692
12741
|
};
|
|
12693
12742
|
|
|
12743
|
+
const ToastHostContext = createContext(null);
|
|
12744
|
+
// `useLayoutEffect` para que el cambio de quién pinta se resuelva antes de pintar (sin un frame
|
|
12745
|
+
// con cero o con dos toasts); en el servidor avisa en React 18, y ahí no hay nada que pintar.
|
|
12746
|
+
const useIsomorphicLayoutEffect = typeof window !== "undefined" ? useLayoutEffect : useEffect;
|
|
12747
|
+
function pickActive(hosts) {
|
|
12748
|
+
let best = null;
|
|
12749
|
+
for (const entry of hosts) {
|
|
12750
|
+
if (best === null ||
|
|
12751
|
+
entry[1].priority > best[1].priority ||
|
|
12752
|
+
(entry[1].priority === best[1].priority && entry[1].seq < best[1].seq)) {
|
|
12753
|
+
best = entry;
|
|
12754
|
+
}
|
|
12755
|
+
}
|
|
12756
|
+
return best ? best[0] : null;
|
|
12757
|
+
}
|
|
12758
|
+
/** Estado del registro, para el provider. */
|
|
12759
|
+
function useToastHostRegistry() {
|
|
12760
|
+
const [hosts, setHosts] = useState(() => new Map());
|
|
12761
|
+
const seqRef = useRef(0);
|
|
12762
|
+
const register = useCallback((id, priority) => {
|
|
12763
|
+
seqRef.current += 1;
|
|
12764
|
+
const seq = seqRef.current;
|
|
12765
|
+
setHosts((prev) => {
|
|
12766
|
+
const next = new Map(prev);
|
|
12767
|
+
next.set(id, { priority, seq });
|
|
12768
|
+
return next;
|
|
12769
|
+
});
|
|
12770
|
+
return () => {
|
|
12771
|
+
setHosts((prev) => {
|
|
12772
|
+
// Solo borra SU registro: si ya lo sustituyó otro con el mismo id, no lo toca.
|
|
12773
|
+
if (prev.get(id)?.seq !== seq) {
|
|
12774
|
+
return prev;
|
|
12775
|
+
}
|
|
12776
|
+
const next = new Map(prev);
|
|
12777
|
+
next.delete(id);
|
|
12778
|
+
return next;
|
|
12779
|
+
});
|
|
12780
|
+
};
|
|
12781
|
+
}, []);
|
|
12782
|
+
const activeId = useMemo(() => pickActive(hosts), [hosts]);
|
|
12783
|
+
return useMemo(() => ({ activeId, register }), [activeId, register]);
|
|
12784
|
+
}
|
|
12785
|
+
/**
|
|
12786
|
+
* Registra la instancia y dice si le toca pintar. Sin provider (sin registro) devuelve `true`:
|
|
12787
|
+
* el comportamiento de antes, que decide `useAuraToast`.
|
|
12788
|
+
*/
|
|
12789
|
+
function useIsActiveToastHost(priority) {
|
|
12790
|
+
const registry = useContext(ToastHostContext);
|
|
12791
|
+
const id = useId();
|
|
12792
|
+
const register = registry?.register;
|
|
12793
|
+
useIsomorphicLayoutEffect(() => {
|
|
12794
|
+
if (!register) {
|
|
12795
|
+
return;
|
|
12796
|
+
}
|
|
12797
|
+
return register(id, priority);
|
|
12798
|
+
}, [register, id, priority]);
|
|
12799
|
+
if (!registry) {
|
|
12800
|
+
return true;
|
|
12801
|
+
}
|
|
12802
|
+
return registry.activeId === id;
|
|
12803
|
+
}
|
|
12804
|
+
|
|
12694
12805
|
const VARIANT_BY_COLOR = {
|
|
12695
12806
|
primary: "accent",
|
|
12696
12807
|
secondary: "default",
|
|
@@ -12706,13 +12817,28 @@ const VARIANT_BY_COLOR = {
|
|
|
12706
12817
|
// de `.toast` (`bg-surface`: blanco en claro, la superficie oscura del pack en oscuro) en los seis
|
|
12707
12818
|
// colores, y el color del estado va SOLO en el título y en el icono. La descripción es la de v3
|
|
12708
12819
|
// (`text-muted`), sin tocar.
|
|
12709
|
-
//
|
|
12710
|
-
//
|
|
12711
|
-
//
|
|
12712
|
-
//
|
|
12713
|
-
//
|
|
12714
|
-
//
|
|
12715
|
-
|
|
12820
|
+
// TECH-2459 · Geometría de v3 — DECISIÓN DEL USUARIO del 2-oct-2026, tras ver la .149/.150 en la
|
|
12821
|
+
// app: «déjalos tal cual se ven en la v3 de HeroUI». Al aspecto del 1-oct (colores) se suma ahora
|
|
12822
|
+
// la geometría: radio, caja del icono, hueco, alto y botón de cierre son los de `.toast` de v3 sin
|
|
12823
|
+
// pisar nada (`toast.css` de `@heroui/styles`, última aparición de cada selector):
|
|
12824
|
+
// - radio: `min(32px, var(--radius-3xl))` de `.toast` (24px con el tema de v3);
|
|
12825
|
+
// - padding `px-4 py-3` y `gap-1.5` (6px) entre icono y contenido, de `.toast`;
|
|
12826
|
+
// - icono: `.toast__indicator` (`p-1`) con el glifo a `size-4` por `[data-slot="toast-default-icon"]`,
|
|
12827
|
+
// así que el glifo lleva ese `data-slot`, igual que el que monta el `ToastIndicator` nativo;
|
|
12828
|
+
// - contenido: `.toast__content` (`self-center`), sin suelo de alto: lo dan el padding y el texto;
|
|
12829
|
+
// - la `x`: `.toast__close-button` (slot `close` de `toastVariants`), un círculo de 20px absoluto en
|
|
12830
|
+
// la esquina superior final (`-top-1 -end-1`, sobresale 4px), con borde y fondo `overlay` desde
|
|
12831
|
+
// `sm` y sin borde y fondo `default` por debajo; oculto en reposo y revelado por
|
|
12832
|
+
// `.toast[data-frontmost="true"]:hover` — el flag `data-frontmost` de abajo hace que esa regla
|
|
12833
|
+
// nativa aplique aquí también. v3 no tiene regla para `(hover: none)`: en táctil el primer toque
|
|
12834
|
+
// sobre el toast activa el `:hover` emulado y revela la `x`, y el segundo la pulsa (medido igual
|
|
12835
|
+
// en el nativo).
|
|
12836
|
+
//
|
|
12837
|
+
// Lo ÚNICO que se añade a v3 es el revelado con teclado (`REVEAL_ON_FOCUS`): v3 no tiene ninguna
|
|
12838
|
+
// regla de `:focus`/`:focus-visible`/`:focus-within` que lo haga visible, así que con Tab el foco
|
|
12839
|
+
// caía en un botón con `opacity: 0` (medido en el `Toast` nativo). Es accesibilidad, no aspecto: en
|
|
12840
|
+
// reposo y con ratón el botón se comporta exactamente como el nativo.
|
|
12841
|
+
const REVEAL_ON_FOCUS = "data-[focus-visible=true]:pointer-events-auto data-[focus-visible=true]:opacity-100";
|
|
12716
12842
|
// TECH-2459 · Indicador de estado — REPUESTO el 8-sep-2026 por decisión del usuario, a partir del
|
|
12717
12843
|
// finding `app-loginos-toast-v3-visual.md` (smoke de loginos contra QA, beta.114): con el MISMO
|
|
12718
12844
|
// toast (`color="danger"`, login con credenciales inválidas) v2 pintaba un glifo de estado a la
|
|
@@ -12759,20 +12885,29 @@ const ICON_BY_COLOR = {
|
|
|
12759
12885
|
danger: "",
|
|
12760
12886
|
default: "",
|
|
12761
12887
|
};
|
|
12762
|
-
// Geometría del hueco del icono en v2 (slot `iconWrapper`: `flex-none relative w-9 h-9
|
|
12763
|
-
// rounded-full grid place-items-center`, con el glifo a `w-6`). El toast de v2 pasaba
|
|
12764
|
-
// `hideIconWrapper`, que solo dejaba transparente el círculo (`!bg-transparent !shadow-none
|
|
12765
|
-
// !border-none`) sin ocultar el glifo, así que aquí se repone la caja de 36 px y el glifo de
|
|
12766
|
-
// 24 px, sin fondo ni borde. `p-0` y `[&_svg]:size-6` anulan el `p-1` + icono de 16 px de
|
|
12767
|
-
// `.toast__indicator`; son utilidades, así que ganan a la capa `components` de `@heroui/styles`.
|
|
12768
|
-
const INDICATOR_BASE = "size-9 p-0 [&_svg]:size-6 [&_svg]:fill-current";
|
|
12769
12888
|
const DEFAULT_TRANSLATIONS$6 = {
|
|
12770
12889
|
closeButtonAriaLabel: "Cerrar notificación",
|
|
12771
12890
|
};
|
|
12772
|
-
|
|
12891
|
+
/**
|
|
12892
|
+
* Toast global de la app. Idempotente: si bajo el mismo `AuraToastProvider` hay más de uno
|
|
12893
|
+
* montado (el que el provider monta por dentro + el que la app pone en su layout), pinta solo
|
|
12894
|
+
* uno — el de la app, y entre varios de la app el que recibe `translations` (ver
|
|
12895
|
+
* `_internal/toast-host.ts`).
|
|
12896
|
+
*/
|
|
12897
|
+
function GlobalToast({ translations } = {}) {
|
|
12898
|
+
const priority = translations ? 2 : 1;
|
|
12899
|
+
return jsx(ToastSlot, { translations: translations, priority: priority });
|
|
12900
|
+
}
|
|
12901
|
+
/** El `GlobalToast` que `AuraToastProvider` monta por dentro: el de menor prioridad. */
|
|
12902
|
+
function ProviderToast() {
|
|
12903
|
+
return jsx(ToastSlot, { priority: 0 });
|
|
12904
|
+
}
|
|
12905
|
+
function ToastSlot({ translations = {}, priority, }) {
|
|
12906
|
+
// Sin provider, `useAuraToast` lanza igual que antes (no se cambia ese contrato).
|
|
12773
12907
|
const { toast, hideToast } = useAuraToast();
|
|
12908
|
+
const isActive = useIsActiveToastHost(priority);
|
|
12774
12909
|
const t = { ...DEFAULT_TRANSLATIONS$6, ...translations };
|
|
12775
|
-
if (!toast.isVisible) {
|
|
12910
|
+
if (!(toast.isVisible && isActive)) {
|
|
12776
12911
|
return null;
|
|
12777
12912
|
}
|
|
12778
12913
|
const color = toast.color ?? "primary";
|
|
@@ -12782,7 +12917,7 @@ function GlobalToast({ translations = {} } = {}) {
|
|
|
12782
12917
|
const slots = toastVariants({ placement: "top end", variant });
|
|
12783
12918
|
const isSecondary = color === "secondary";
|
|
12784
12919
|
const StatusIcon = ICON_BY_VARIANT[variant];
|
|
12785
|
-
return (jsx("div", { className: "fixed top-4 right-4 z-[2000] w-full max-w-sm", children: jsxs("div", { className:
|
|
12920
|
+
return (jsx("div", { className: "fixed top-4 right-4 z-[2000] w-full max-w-sm", children: jsxs("div", { className: slots.toast(), "data-frontmost": "true", style: { position: "relative" }, children: [jsx("div", { className: cn(slots.indicator(), ICON_BY_COLOR[color]), children: jsx(StatusIcon, { "data-slot": "toast-default-icon" }) }), jsxs("div", { className: slots.content(), children: [jsx("div", { className: slots.title(), style: isSecondary ? { color: "var(--color-secondary-600)" } : undefined, children: toast.title }), toast.description && (jsx("div", { className: slots.description(), children: toast.description }))] }), jsx(CloseButton, { "aria-label": t.closeButtonAriaLabel, className: cn(slots.close(), REVEAL_ON_FOCUS), onPress: hideToast })] }) }));
|
|
12786
12921
|
}
|
|
12787
12922
|
|
|
12788
12923
|
/**
|
|
@@ -19532,6 +19667,8 @@ const AuraToastProvider = ({ children }) => {
|
|
|
19532
19667
|
color: "primary",
|
|
19533
19668
|
duration: 8000,
|
|
19534
19669
|
});
|
|
19670
|
+
// Registro de los `GlobalToast` montados debajo, para que pinte uno solo (ver toast-host.ts).
|
|
19671
|
+
const toastHosts = useToastHostRegistry();
|
|
19535
19672
|
const timerRef = useRef(null);
|
|
19536
19673
|
const hideToast = useCallback(() => {
|
|
19537
19674
|
if (timerRef.current) {
|
|
@@ -19559,7 +19696,7 @@ const AuraToastProvider = ({ children }) => {
|
|
|
19559
19696
|
}
|
|
19560
19697
|
};
|
|
19561
19698
|
}, []);
|
|
19562
|
-
return (
|
|
19699
|
+
return (jsx(ToastContext.Provider, { value: { toast, showToast, hideToast }, children: jsxs(ToastHostContext.Provider, { value: toastHosts, children: [jsx(ProviderToast, {}), children] }) }));
|
|
19563
19700
|
};
|
|
19564
19701
|
|
|
19565
19702
|
const NavigationLoadingContext = createContext(undefined);
|
|
@@ -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;AAoB5E;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,eAAO,MAAM,QAAQ,EAAE,KAAK,CAAC,EAAE,CAAC,aAAa,CAwU3C,CAAC"}
|
|
@@ -37,6 +37,23 @@ export interface MenuClawHistory {
|
|
|
37
37
|
* Si se proporciona, se muestra el botón de nueva conversación sobre la lista.
|
|
38
38
|
*/
|
|
39
39
|
onNewConversation?: () => void;
|
|
40
|
+
/**
|
|
41
|
+
* `true` si el consumidor puede traer más entradas de las ya listadas (hay otra
|
|
42
|
+
* página en el servidor). Con `onLoadMore`, pinta «Cargar más» al final de la lista
|
|
43
|
+
* —cuando no quedan ítems plegados tras «Ver más»—. Sin esta prop, nada cambia.
|
|
44
|
+
* @default false
|
|
45
|
+
*/
|
|
46
|
+
hasMore?: boolean;
|
|
47
|
+
/**
|
|
48
|
+
* Pide la página siguiente. Sin esta prop no se pinta «Cargar más» aunque `hasMore`
|
|
49
|
+
* sea `true`: no se promete una página que nadie puede pedir.
|
|
50
|
+
*/
|
|
51
|
+
onLoadMore?: () => void;
|
|
52
|
+
/**
|
|
53
|
+
* Página siguiente en vuelo: «Cargar más» queda desactivado y con `aria-busy`.
|
|
54
|
+
* @default false
|
|
55
|
+
*/
|
|
56
|
+
isLoadingMore?: boolean;
|
|
40
57
|
}
|
|
41
58
|
/**
|
|
42
59
|
* Traducciones de MenuClaw. Todas opcionales para permitir traducciones
|
|
@@ -61,6 +78,8 @@ export type MenuClawTranslations = {
|
|
|
61
78
|
historyShowMoreLabel?: string;
|
|
62
79
|
/** Etiqueta del botón que vuelve a plegar el historial */
|
|
63
80
|
historyShowLessLabel?: string;
|
|
81
|
+
/** Etiqueta del botón que pide la página siguiente del historial */
|
|
82
|
+
historyLoadMoreLabel?: string;
|
|
64
83
|
};
|
|
65
84
|
export interface MenuClawProps {
|
|
66
85
|
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;CACtB;AAED;;;GAGG;AACH,MAAM,WAAW,eAAe;IAC/B,yDAAyD;IACzD,KAAK,EAAE,mBAAmB,EAAE,CAAC;IAC7B;;;;OAIG;IACH,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B;;OAEG;IACH,iBAAiB,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
CHANGED
|
@@ -2,14 +2,25 @@ import React from "react";
|
|
|
2
2
|
import type { MenuClawHistoryPanelProps } from "./MenuClawHistoryPanel.types";
|
|
3
3
|
/**
|
|
4
4
|
* Sección de historial de conversaciones: botón de nueva conversación + lista de
|
|
5
|
-
* entradas recientes con "ver más"
|
|
5
|
+
* entradas recientes con "ver más" y, si el consumidor tiene más páginas,
|
|
6
|
+
* "cargar más".
|
|
6
7
|
*
|
|
7
8
|
* La lista tiene **scroll interno propio** (`flex-1 min-h-0 overflow-y-auto`) y
|
|
8
9
|
* la sección está acotada en altura, para que crecer el historial no arrastre ni
|
|
9
10
|
* recorte el área de navegación.
|
|
10
11
|
*
|
|
11
|
-
* Densidad de MenuClaw: fila de 36px, `px-2`, `text-small`/`text-tiny` y
|
|
12
|
-
* `rounded-lg
|
|
12
|
+
* Densidad de MenuClaw: fila de 36px, `px-2`, `text-small`/`text-tiny` y filas del
|
|
13
|
+
* historial con `rounded-lg` — que es justo lo que difiere del menú compartido.
|
|
14
|
+
*
|
|
15
|
+
* «Nueva conversación» es el `Button` de la librería, no un `<button>` propio, y
|
|
16
|
+
* por eso lleva su radio por defecto (`rounded-[24px]`, la píldora de v3): sobre
|
|
17
|
+
* 36px de alto el radio se recorta a la mitad, así que desplegado es una píldora
|
|
18
|
+
* y plegado (`isIconOnly`, 36×36) un círculo. Encima de la fachada solo se fija lo
|
|
19
|
+
* propio de MenuClaw: el alto de 36px (`size="md"` de la fachada mide 40), el
|
|
20
|
+
* contenido alineado a la izquierda con `px-2`/`gap-3`, el peso 500 y el color
|
|
21
|
+
* `bg-foreground`/`text-background`, que la fachada no tiene como `color` y que
|
|
22
|
+
* gana a sus `--button-*` porque las utilidades van en una capa posterior a la de
|
|
23
|
+
* `.button`.
|
|
13
24
|
*/
|
|
14
25
|
export declare const MenuClawHistoryPanel: React.FC<MenuClawHistoryPanelProps>;
|
|
15
26
|
//# sourceMappingURL=MenuClawHistoryPanel.d.ts.map
|
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;
|
|
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,CAmLlE,CAAC"}
|
package/dist/types/components/menu-claw/_internal/menu-claw-history/MenuClawHistoryPanel.types.d.ts
CHANGED
|
@@ -6,6 +6,14 @@ export type MenuClawHistoryPanelProps = {
|
|
|
6
6
|
initialVisibleCount: number;
|
|
7
7
|
/** Si se proporciona, se muestra el botón de nueva conversación sobre la lista. */
|
|
8
8
|
onNewConversation?: () => void;
|
|
9
|
+
/** Hay otra página en el servidor (ver `MenuClawHistory.hasMore`). */
|
|
10
|
+
hasMore: boolean;
|
|
11
|
+
/** Pide la página siguiente; sin ella no se pinta «Cargar más». */
|
|
12
|
+
onLoadMore?: () => void;
|
|
13
|
+
/** Página siguiente en vuelo: botón desactivado y `aria-busy`. */
|
|
14
|
+
isLoadingMore: boolean;
|
|
15
|
+
/** Etiqueta del botón que pide la página siguiente. */
|
|
16
|
+
loadMoreLabel: string;
|
|
9
17
|
/** Lateral comprimido: solo el botón de nueva conversación, en modo icono. */
|
|
10
18
|
isCollapsed: boolean;
|
|
11
19
|
/** Título de la secció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,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;;;OAGG;IACH,cAAc,CAAC,EAAE,MAAM,IAAI,CAAC;CAC5B,CAAC"}
|
package/dist/types/components/menu-claw/_internal/menu-claw-history/menuClawHistoryLoadMore.d.ts
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* «Cargar más» solo se ofrece si hay otra página, alguien que pueda pedirla y la lista
|
|
3
|
+
* ya enseña todo lo recibido (desplegada, o sin ítems plegados tras «Ver más»).
|
|
4
|
+
*/
|
|
5
|
+
export declare function isLoadMoreVisible({ hasMore, hasOnLoadMore, isExpanded, hasHiddenItems, }: {
|
|
6
|
+
hasMore: boolean;
|
|
7
|
+
hasOnLoadMore: boolean;
|
|
8
|
+
isExpanded: boolean;
|
|
9
|
+
hasHiddenItems: boolean;
|
|
10
|
+
}): boolean;
|
|
11
|
+
/**
|
|
12
|
+
* Pulsación de «Cargar más». Con una página en vuelo no hace nada: el botón no usa
|
|
13
|
+
* `disabled` nativo (perdería el foco del teclado), así que la guarda vive aquí.
|
|
14
|
+
* Si no, despliega la lista y pide la página, para que lo nuevo no quede tras «Ver más».
|
|
15
|
+
*/
|
|
16
|
+
export declare function pressLoadMore({ isLoadingMore, onLoadMore, expand, }: {
|
|
17
|
+
isLoadingMore: boolean;
|
|
18
|
+
onLoadMore: () => void;
|
|
19
|
+
expand: () => void;
|
|
20
|
+
}): void;
|
|
21
|
+
//# sourceMappingURL=menuClawHistoryLoadMore.d.ts.map
|
package/dist/types/components/menu-claw/_internal/menu-claw-history/menuClawHistoryLoadMore.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"menuClawHistoryLoadMore.d.ts","sourceRoot":"","sources":["../../../../../../src/components/menu-claw/_internal/menu-claw-history/menuClawHistoryLoadMore.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,EACjC,OAAO,EACP,aAAa,EACb,UAAU,EACV,cAAc,GACd,EAAE;IACF,OAAO,EAAE,OAAO,CAAC;IACjB,aAAa,EAAE,OAAO,CAAC;IACvB,UAAU,EAAE,OAAO,CAAC;IACpB,cAAc,EAAE,OAAO,CAAC;CACxB,GAAG,OAAO,CAEV;AAED;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,EAC7B,aAAa,EACb,UAAU,EACV,MAAM,GACN,EAAE;IACF,aAAa,EAAE,OAAO,CAAC;IACvB,UAAU,EAAE,MAAM,IAAI,CAAC;IACvB,MAAM,EAAE,MAAM,IAAI,CAAC;CACnB,GAAG,IAAI,CAMP"}
|
|
@@ -1,3 +1,11 @@
|
|
|
1
1
|
import type { GlobalToastProps } from "./GlobalToast.types";
|
|
2
|
-
|
|
2
|
+
/**
|
|
3
|
+
* Toast global de la app. Idempotente: si bajo el mismo `AuraToastProvider` hay más de uno
|
|
4
|
+
* montado (el que el provider monta por dentro + el que la app pone en su layout), pinta solo
|
|
5
|
+
* uno — el de la app, y entre varios de la app el que recibe `translations` (ver
|
|
6
|
+
* `_internal/toast-host.ts`).
|
|
7
|
+
*/
|
|
8
|
+
export declare function GlobalToast({ translations }?: GlobalToastProps): import("react").JSX.Element;
|
|
9
|
+
/** El `GlobalToast` que `AuraToastProvider` monta por dentro: el de menor prioridad. */
|
|
10
|
+
export declare function ProviderToast(): import("react").JSX.Element;
|
|
3
11
|
//# sourceMappingURL=GlobalToast.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GlobalToast.d.ts","sourceRoot":"","sources":["../../../../src/components/toast/GlobalToast.tsx"],"names":[],"mappings":"AAWA,OAAO,KAAK,EACX,gBAAgB,EAEhB,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"GlobalToast.d.ts","sourceRoot":"","sources":["../../../../src/components/toast/GlobalToast.tsx"],"names":[],"mappings":"AAWA,OAAO,KAAK,EACX,gBAAgB,EAEhB,MAAM,qBAAqB,CAAC;AAmH7B;;;;;GAKG;AACH,wBAAgB,WAAW,CAAC,EAAE,YAAY,EAAE,GAAE,gBAAqB,+BAGlE;AAED,wFAAwF;AACxF,wBAAgB,aAAa,gCAE5B"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Registro de los `GlobalToast` montados bajo un mismo `AuraToastProvider`, para que solo
|
|
3
|
+
* UNO pinte (TECH-2459).
|
|
4
|
+
*
|
|
5
|
+
* `AuraToastProvider` monta su propio `GlobalToast`, y las apps (beweossmbs, beweosagency,
|
|
6
|
+
* backoffice) montan OTRO en su layout: los dos leen el mismo estado, así que salían dos toasts
|
|
7
|
+
* apilados en `top-4 right-4` con la sombra duplicada (en v2 pasaba igual). Decisión del usuario:
|
|
8
|
+
* arreglarlo en la librería, sin que las apps toquen nada.
|
|
9
|
+
*
|
|
10
|
+
* Cada instancia se registra en un effect con una prioridad, y pinta solo la que el registro
|
|
11
|
+
* elige. Nada de DOM global (`querySelector`): el registro vive en el provider, así que dos
|
|
12
|
+
* providers no se pisan. Y nada de reclamar en el render: con StrictMode (doble montaje en dev)
|
|
13
|
+
* el desmontaje simulado borra la entrada y el remontaje la vuelve a crear, simétrico.
|
|
14
|
+
*
|
|
15
|
+
* Quién gana (de mayor a menor prioridad; a igualdad, el primero que se registró):
|
|
16
|
+
* 2 · un `GlobalToast` de la app CON `translations`;
|
|
17
|
+
* 1 · un `GlobalToast` de la app sin `translations`;
|
|
18
|
+
* 0 · el que monta `AuraToastProvider` por dentro.
|
|
19
|
+
* El del provider no puede recibir `translations` (el provider no tiene esa prop), así que si
|
|
20
|
+
* pintara él se perdería el idioma que la app le pasa al suyo. Por eso gana el de la app, y entre
|
|
21
|
+
* varios de la app, el que trae traducciones. Si el de la app se desmonta (cambio de ruta), su
|
|
22
|
+
* entrada desaparece y el siguiente toma el relevo en el mismo commit; el estado del toast vive en
|
|
23
|
+
* el provider, así que el que está visible sigue visible.
|
|
24
|
+
*/
|
|
25
|
+
export type ToastHostPriority = 0 | 1 | 2;
|
|
26
|
+
export type ToastHostRegistry = {
|
|
27
|
+
/** Instancia que pinta ahora mismo, o `null` antes del primer registro. */
|
|
28
|
+
activeId: string | null;
|
|
29
|
+
register: (id: string, priority: ToastHostPriority) => () => void;
|
|
30
|
+
};
|
|
31
|
+
export declare const ToastHostContext: import("react").Context<ToastHostRegistry | null>;
|
|
32
|
+
/** Estado del registro, para el provider. */
|
|
33
|
+
export declare function useToastHostRegistry(): ToastHostRegistry;
|
|
34
|
+
/**
|
|
35
|
+
* Registra la instancia y dice si le toca pintar. Sin provider (sin registro) devuelve `true`:
|
|
36
|
+
* el comportamiento de antes, que decide `useAuraToast`.
|
|
37
|
+
*/
|
|
38
|
+
export declare function useIsActiveToastHost(priority: ToastHostPriority): boolean;
|
|
39
|
+
//# sourceMappingURL=toast-host.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toast-host.d.ts","sourceRoot":"","sources":["../../../../../src/components/toast/_internal/toast-host.ts"],"names":[],"mappings":"AAYA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,MAAM,MAAM,iBAAiB,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;AAI1C,MAAM,MAAM,iBAAiB,GAAG;IAC/B,2EAA2E;IAC3E,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,QAAQ,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,QAAQ,EAAE,iBAAiB,KAAK,MAAM,IAAI,CAAC;CAClE,CAAC;AAEF,eAAO,MAAM,gBAAgB,mDAAgD,CAAC;AAqB9E,6CAA6C;AAC7C,wBAAgB,oBAAoB,IAAI,iBAAiB,CA2BxD;AAED;;;GAGG;AACH,wBAAgB,oBAAoB,CAAC,QAAQ,EAAE,iBAAiB,GAAG,OAAO,CAgBzE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/toast/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/toast/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,YAAY,EACX,gBAAgB,EAChB,uBAAuB,GACvB,MAAM,qBAAqB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toast-provider.d.ts","sourceRoot":"","sources":["../../../../src/providers/toast/toast-provider.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"toast-provider.d.ts","sourceRoot":"","sources":["../../../../src/providers/toast/toast-provider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAa3C,UAAU,sBAAsB;IAC/B,QAAQ,EAAE,SAAS,CAAC;CACpB;AAED,eAAO,MAAM,iBAAiB,EAAE,EAAE,CAAC,sBAAsB,CAyDxD,CAAC"}
|