orbital-ds 0.40.0 → 0.44.1
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/AGENTS.md +29 -10
- package/components.manifest.json +6469 -3349
- package/dist/auth-form-B1hgbXkI.d.ts +144 -0
- package/dist/hooks/use-ds-messages.d.ts +89 -0
- package/dist/lib/a2ui-catalog.d.ts +42 -0
- package/dist/lib/a2ui-catalog.js +558 -0
- package/dist/lib/a2ui.d.ts +289 -0
- package/dist/lib/a2ui.js +215 -0
- package/dist/lib/ai-events.d.ts +15 -0
- package/dist/lib/ai-events.js +202 -0
- package/dist/lib/auth-flow.d.ts +3 -1
- package/dist/lib/auth-flow.js +24 -3
- package/dist/lib/format.d.ts +57 -0
- package/dist/lib/format.js +177 -0
- package/dist/lib/i18n.d.ts +96 -2
- package/dist/lib/i18n.js +278 -2
- package/dist/lib/locales/de.d.ts +7 -0
- package/dist/lib/locales/de.js +535 -0
- package/dist/lib/locales/fr.d.ts +7 -0
- package/dist/lib/locales/fr.js +535 -0
- package/dist/lib/locales/he.d.ts +7 -0
- package/dist/lib/locales/he.js +535 -0
- package/dist/lib/locales/it.d.ts +7 -0
- package/dist/lib/locales/it.js +535 -0
- package/dist/styles.css +62 -2
- package/dist/ui/a2ui-renderer.d.ts +44 -0
- package/dist/ui/a2ui-renderer.js +793 -0
- package/dist/ui/agent-events.d.ts +49 -0
- package/dist/ui/agent-events.js +108 -0
- package/dist/ui/ai-tag.d.ts +16 -0
- package/dist/ui/alert-dialog.d.ts +37 -0
- package/dist/ui/alert.d.ts +1 -1
- package/dist/ui/animated-number.d.ts +11 -0
- package/dist/ui/app-bar.d.ts +22 -0
- package/dist/ui/attachment.d.ts +1 -1
- package/dist/ui/auth-backdrop.d.ts +17 -0
- package/dist/ui/auth-form.d.ts +3 -110
- package/dist/ui/auth-form.js +46 -11
- package/dist/ui/auth-layout.d.ts +38 -0
- package/dist/ui/avatar.d.ts +27 -0
- package/dist/ui/ayuda.d.ts +1 -1
- package/dist/ui/ayuda.js +4 -1
- package/dist/ui/badge.d.ts +1 -1
- package/dist/ui/banner.d.ts +1 -1
- package/dist/ui/bottom-nav.d.ts +22 -0
- package/dist/ui/breadcrumb.d.ts +22 -0
- package/dist/ui/breadcrumb.js +1 -1
- package/dist/ui/bubble.d.ts +1 -1
- package/dist/ui/button.d.ts +2 -2
- package/dist/ui/calendar.d.ts +13 -0
- package/dist/ui/calendar.js +3 -0
- package/dist/ui/card-stack.d.ts +27 -0
- package/dist/ui/card.d.ts +33 -0
- package/dist/ui/carousel.d.ts +35 -0
- package/dist/ui/carousel.js +10 -5
- package/dist/ui/chain-of-thought.d.ts +34 -0
- package/dist/ui/chain-of-thought.js +90 -0
- package/dist/ui/chart-card.d.ts +19 -0
- package/dist/ui/chart.d.ts +19 -0
- package/dist/ui/chat-composer.d.ts +58 -0
- package/dist/ui/chat-composer.js +192 -0
- package/dist/ui/choice-card.d.ts +33 -0
- package/dist/ui/code-block.d.ts +15 -0
- package/dist/ui/combobox.d.ts +48 -0
- package/dist/ui/command-palette.d.ts +18 -0
- package/dist/ui/command.d.ts +34 -0
- package/dist/ui/confirm-action.d.ts +30 -0
- package/dist/ui/confirm-dialog.d.ts +23 -0
- package/dist/ui/content-card.d.ts +14 -0
- package/dist/ui/context-menu.d.ts +35 -0
- package/dist/ui/context-menu.js +1 -1
- package/dist/ui/conversation-list.d.ts +44 -0
- package/dist/ui/conversation-list.js +141 -0
- package/dist/ui/copy-button.d.ts +11 -0
- package/dist/ui/date-time.d.ts +40 -0
- package/dist/ui/date-time.js +55 -0
- package/dist/ui/description-list.d.ts +49 -0
- package/dist/ui/description-list.js +86 -0
- package/dist/ui/detail-panel.d.ts +22 -0
- package/dist/ui/dialog.d.ts +35 -0
- package/dist/ui/dock.d.ts +17 -0
- package/dist/ui/drawer.d.ts +41 -0
- package/dist/ui/dropdown-menu.d.ts +32 -0
- package/dist/ui/dropdown-menu.js +1 -1
- package/dist/ui/echart.d.ts +15 -0
- package/dist/ui/empty.d.ts +1 -1
- package/dist/ui/entity-list.d.ts +32 -0
- package/dist/ui/form-layout.d.ts +24 -0
- package/dist/ui/gauge.d.ts +26 -0
- package/dist/ui/generated-image.d.ts +33 -0
- package/dist/ui/generated-image.js +65 -0
- package/dist/ui/generated-table.d.ts +29 -0
- package/dist/ui/generated-table.js +59 -0
- package/dist/ui/heatmap-grid.d.ts +20 -0
- package/dist/ui/hero.d.ts +58 -0
- package/dist/ui/hero.js +145 -0
- package/dist/ui/i18n-provider.d.ts +16 -0
- package/dist/ui/icon-tile.d.ts +2 -2
- package/dist/ui/input-group.d.ts +1 -1
- package/dist/ui/input-otp.d.ts +23 -0
- package/dist/ui/input.d.ts +16 -0
- package/dist/ui/instruction-editor.d.ts +17 -0
- package/dist/ui/item.d.ts +3 -3
- package/dist/ui/label.d.ts +17 -0
- package/dist/ui/legend.d.ts +25 -0
- package/dist/ui/level-meter.d.ts +12 -0
- package/dist/ui/load-more.d.ts +17 -0
- package/dist/ui/loading-state.d.ts +12 -0
- package/dist/ui/markdown.d.ts +29 -0
- package/dist/ui/markdown.js +123 -0
- package/dist/ui/media-card.d.ts +16 -0
- package/dist/ui/menubar.d.ts +39 -0
- package/dist/ui/message-actions.d.ts +21 -0
- package/dist/ui/message-actions.js +79 -0
- package/dist/ui/message-scroller.d.ts +30 -0
- package/dist/ui/message.d.ts +33 -0
- package/dist/ui/mfa-challenge.d.ts +3 -32
- package/dist/ui/mfa-challenge.js +1 -1
- package/dist/ui/mfa-setup.d.ts +1 -1
- package/dist/ui/mosaic.d.ts +23 -0
- package/dist/ui/motion-provider.d.ts +17 -0
- package/dist/ui/native-select.d.ts +22 -0
- package/dist/ui/next-step-card.d.ts +55 -0
- package/dist/ui/next-step-card.js +92 -0
- package/dist/ui/notice-review.d.ts +32 -0
- package/dist/ui/oauth-consent.d.ts +1 -1
- package/dist/ui/page-header.d.ts +46 -4
- package/dist/ui/page-header.js +20 -11
- package/dist/ui/page-loader.d.ts +17 -0
- package/dist/ui/page-shell.d.ts +17 -0
- package/dist/ui/pagination.d.ts +20 -0
- package/dist/ui/pagination.js +2 -2
- package/dist/ui/panel.d.ts +1 -1
- package/dist/ui/password-strength.d.ts +14 -0
- package/dist/ui/popover.d.ts +32 -0
- package/dist/ui/proportion-bar.d.ts +25 -0
- package/dist/ui/quantity.d.ts +25 -0
- package/dist/ui/quantity.js +27 -0
- package/dist/ui/questionnaire.d.ts +38 -0
- package/dist/ui/reasoning.d.ts +24 -0
- package/dist/ui/reasoning.js +62 -0
- package/dist/ui/reveal.d.ts +17 -0
- package/dist/ui/sheet.d.ts +39 -2
- package/dist/ui/sheet.js +6 -2
- package/dist/ui/shield.d.ts +14 -0
- package/dist/ui/show-more.d.ts +14 -0
- package/dist/ui/sidebar.d.ts +4 -2
- package/dist/ui/sidebar.js +7 -3
- package/dist/ui/sparkline.d.ts +1 -1
- package/dist/ui/stat-group.d.ts +32 -0
- package/dist/ui/stat.d.ts +1 -1
- package/dist/ui/status-badge.d.ts +3 -3
- package/dist/ui/status-hero.d.ts +18 -0
- package/dist/ui/step-dots.d.ts +12 -0
- package/dist/ui/step-ring.d.ts +14 -0
- package/dist/ui/suggestions.d.ts +17 -0
- package/dist/ui/suggestions.js +39 -0
- package/dist/ui/table.d.ts +26 -0
- package/dist/ui/tag-input.d.ts +21 -0
- package/dist/ui/tag-input.js +169 -0
- package/dist/ui/task-loader.d.ts +15 -0
- package/dist/ui/task-progress.d.ts +14 -0
- package/dist/ui/textarea.d.ts +22 -1
- package/dist/ui/textarea.js +7 -1
- package/dist/ui/timeline.d.ts +26 -0
- package/dist/ui/toggle-group.d.ts +24 -0
- package/dist/ui/tool-call.d.ts +27 -0
- package/dist/ui/tool-call.js +74 -0
- package/dist/ui/usage-meter.d.ts +42 -0
- package/dist/ui/usage-meter.js +116 -0
- package/dist/ui/week-strip.d.ts +11 -0
- package/dist/ui/week-strip.js +2 -2
- package/dist/ui/workflow-run.d.ts +51 -0
- package/dist/ui/workflow-run.js +185 -0
- package/docs/adr/0001-rtl-clases-logicas.md +14 -1
- package/docs/designer/criterio.md +87 -87
- package/docs/designer/flujo.md +1 -1
- package/docs/designer/patrones.md +43 -2
- package/manifest/actions.json +364 -0
- package/manifest/agents.json +399 -0
- package/manifest/ai.json +128 -0
- package/manifest/auth.json +1547 -0
- package/manifest/chat.json +612 -0
- package/manifest/content.json +2298 -0
- package/manifest/data.json +2904 -0
- package/manifest/feedback.json +1005 -0
- package/manifest/forms.json +1954 -0
- package/manifest/motion.json +196 -0
- package/manifest/navigation.json +1792 -0
- package/manifest/overlays.json +931 -0
- package/package.json +35 -21
- package/scripts/cli.mjs +105 -8
- package/scripts/doctor.mjs +126 -1
- package/scripts/eslint-plugin.mjs +93 -0
- package/scripts/i18n.mjs +1 -1
- package/scripts/manifest.mjs +159 -7
- package/skill/SKILL.md +8 -3
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @group agents
|
|
5
|
+
* @summary Traza en línea de tiempo de lo que hizo un agente (pensar, herramientas, mensajes, traspasos, error y fin) con hora y datos; para seguirlo en vivo o auditarlo después.
|
|
6
|
+
* @see chain-of-thought — resumen compacto de los pasos dentro de la respuesta
|
|
7
|
+
* @see tool-call — detalle de una sola llamada con entrada, salida y aprobación
|
|
8
|
+
* @see timeline — eventos genéricos que no vienen de un agente
|
|
9
|
+
* @example Traza en vivo
|
|
10
|
+
* <AgentEvents
|
|
11
|
+
* events={[
|
|
12
|
+
* { id: "1", type: "thinking", summary: "Planifica la búsqueda", time: "2026-11-21T10:00:00Z" },
|
|
13
|
+
* { id: "2", type: "tool", title: "search_docs", summary: "3 resultados", status: "running" },
|
|
14
|
+
* ]}
|
|
15
|
+
* />
|
|
16
|
+
* @example Compacta, con tiempo relativo fijo en SSR
|
|
17
|
+
* <AgentEvents density="compact" events={events} now={now} />
|
|
18
|
+
*/
|
|
19
|
+
|
|
20
|
+
type AgentEventType = "thinking" | "tool" | "message" | "handoff" | "error" | "done";
|
|
21
|
+
type AgentEventStatus = "running" | "done" | "error";
|
|
22
|
+
/** Dato breve del evento (modelo, tokens, coste, herramienta…) que se muestra como badge. */
|
|
23
|
+
interface AgentEventChip {
|
|
24
|
+
kind: "model" | "tokens" | "cost" | "tools" | "reasoning" | "branch" | "tool" | "content";
|
|
25
|
+
label: string;
|
|
26
|
+
}
|
|
27
|
+
interface AgentEvent {
|
|
28
|
+
id: string;
|
|
29
|
+
type: AgentEventType;
|
|
30
|
+
/** Qué hizo (nombre de la herramienta, a quién traspasa…); si falta, se usa la etiqueta del tipo. */
|
|
31
|
+
title?: React.ReactNode;
|
|
32
|
+
/** Texto breve visible siempre. */
|
|
33
|
+
summary?: React.ReactNode;
|
|
34
|
+
/** Contenido plegado (razonamiento completo, entrada y salida…). */
|
|
35
|
+
detail?: React.ReactNode;
|
|
36
|
+
time?: Date | string | number;
|
|
37
|
+
/** Metadatos del evento (véase `chipsFromMeta` en `orbital-ds/lib/ai-events`). */
|
|
38
|
+
chips?: AgentEventChip[];
|
|
39
|
+
/** `running` pulsa el indicador; por defecto `done` (`error` en el tipo error). */
|
|
40
|
+
status?: AgentEventStatus;
|
|
41
|
+
}
|
|
42
|
+
declare function AgentEvents({ events, density, now, className, ...props }: Omit<React.ComponentProps<"ol">, "children"> & {
|
|
43
|
+
events: AgentEvent[];
|
|
44
|
+
density?: "default" | "compact";
|
|
45
|
+
/** Referencia para el tiempo relativo (fíjala en SSR). */
|
|
46
|
+
now?: Date;
|
|
47
|
+
}): React.JSX.Element;
|
|
48
|
+
|
|
49
|
+
export { type AgentEvent, type AgentEventChip, type AgentEventStatus, type AgentEventType, AgentEvents };
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import {
|
|
4
|
+
AlertCircleIcon,
|
|
5
|
+
BrainIcon,
|
|
6
|
+
CheckCircle2Icon,
|
|
7
|
+
ChevronDownIcon,
|
|
8
|
+
MessageSquareIcon,
|
|
9
|
+
RepeatIcon,
|
|
10
|
+
WrenchIcon
|
|
11
|
+
} from "lucide-react";
|
|
12
|
+
import { useDsMessages } from "../hooks/use-ds-messages.js";
|
|
13
|
+
import { cn } from "../lib/utils.js";
|
|
14
|
+
import { Collapsible, CollapsibleContent, CollapsibleTrigger } from "./collapsible.js";
|
|
15
|
+
import {
|
|
16
|
+
Timeline,
|
|
17
|
+
TimelineContent,
|
|
18
|
+
TimelineDescription,
|
|
19
|
+
TimelineIndicator,
|
|
20
|
+
TimelineItem,
|
|
21
|
+
TimelineTime
|
|
22
|
+
} from "./timeline.js";
|
|
23
|
+
const ICON = {
|
|
24
|
+
thinking: /* @__PURE__ */ jsx(BrainIcon, {}),
|
|
25
|
+
tool: /* @__PURE__ */ jsx(WrenchIcon, {}),
|
|
26
|
+
message: /* @__PURE__ */ jsx(MessageSquareIcon, {}),
|
|
27
|
+
handoff: /* @__PURE__ */ jsx(RepeatIcon, {}),
|
|
28
|
+
error: /* @__PURE__ */ jsx(AlertCircleIcon, {}),
|
|
29
|
+
done: /* @__PURE__ */ jsx(CheckCircle2Icon, {})
|
|
30
|
+
};
|
|
31
|
+
const TONE = {
|
|
32
|
+
thinking: "neutral",
|
|
33
|
+
tool: "info",
|
|
34
|
+
message: "primary",
|
|
35
|
+
handoff: "warning",
|
|
36
|
+
error: "danger",
|
|
37
|
+
done: "success"
|
|
38
|
+
};
|
|
39
|
+
function AgentEvents({
|
|
40
|
+
events,
|
|
41
|
+
density = "default",
|
|
42
|
+
now,
|
|
43
|
+
className,
|
|
44
|
+
...props
|
|
45
|
+
}) {
|
|
46
|
+
const t = useDsMessages();
|
|
47
|
+
const label = {
|
|
48
|
+
thinking: t.eventThinking,
|
|
49
|
+
tool: t.eventTool,
|
|
50
|
+
message: t.eventMessage,
|
|
51
|
+
handoff: t.eventHandoff,
|
|
52
|
+
error: t.eventError,
|
|
53
|
+
done: t.eventDone
|
|
54
|
+
};
|
|
55
|
+
return /* @__PURE__ */ jsx(Timeline, { "data-slot": "agent-events", "data-density": density, className: cn("w-full", className), ...props, children: events.map((e) => {
|
|
56
|
+
const status = e.status ?? (e.type === "error" ? "error" : "done");
|
|
57
|
+
const body = /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
58
|
+
/* @__PURE__ */ jsxs("div", { className: "flex flex-wrap items-baseline gap-x-2", children: [
|
|
59
|
+
/* @__PURE__ */ jsx(
|
|
60
|
+
"span",
|
|
61
|
+
{
|
|
62
|
+
"data-slot": "agent-event-title",
|
|
63
|
+
className: cn(
|
|
64
|
+
"text-sm font-(--ds-strong-weight)",
|
|
65
|
+
e.type === "tool" && e.title && "font-mono",
|
|
66
|
+
status === "running" && "text-shimmer"
|
|
67
|
+
),
|
|
68
|
+
children: e.title ?? label[e.type]
|
|
69
|
+
}
|
|
70
|
+
),
|
|
71
|
+
e.title ? /* @__PURE__ */ jsx("span", { className: "text-xs text-muted-foreground", children: label[e.type] }) : null,
|
|
72
|
+
status === "running" ? /* @__PURE__ */ jsx("span", { className: "text-xs text-info", children: t.toolRunning }) : null,
|
|
73
|
+
e.time !== void 0 ? /* @__PURE__ */ jsx(TimelineTime, { dateTime: e.time, now, relative: true, className: "ms-auto" }) : null
|
|
74
|
+
] }),
|
|
75
|
+
e.summary && density !== "compact" ? /* @__PURE__ */ jsx(TimelineDescription, { children: e.summary }) : null
|
|
76
|
+
] });
|
|
77
|
+
return /* @__PURE__ */ jsxs(
|
|
78
|
+
TimelineItem,
|
|
79
|
+
{
|
|
80
|
+
"data-slot": "agent-event",
|
|
81
|
+
"data-type": e.type,
|
|
82
|
+
"data-status": status,
|
|
83
|
+
tone: status === "error" ? "danger" : TONE[e.type],
|
|
84
|
+
className: density === "compact" ? "[&_[data-slot=timeline-content]]:pb-3" : void 0,
|
|
85
|
+
children: [
|
|
86
|
+
/* @__PURE__ */ jsx(
|
|
87
|
+
TimelineIndicator,
|
|
88
|
+
{
|
|
89
|
+
className: cn(status === "running" && "[&_[data-slot=timeline-icon]]:animate-ds-ring-inner motion-reduce:[&_[data-slot=timeline-icon]]:animate-none"),
|
|
90
|
+
children: ICON[e.type]
|
|
91
|
+
}
|
|
92
|
+
),
|
|
93
|
+
/* @__PURE__ */ jsx(TimelineContent, { children: e.detail ? /* @__PURE__ */ jsxs(Collapsible, { children: [
|
|
94
|
+
/* @__PURE__ */ jsx(CollapsibleTrigger, { className: "group flex w-full flex-col gap-0.5 rounded-control text-start outline-none focus-visible:ring-(length:--ds-ring-width) focus-visible:ring-(--ds-ring-color)", children: /* @__PURE__ */ jsxs("div", { className: "flex w-full items-start gap-2", children: [
|
|
95
|
+
/* @__PURE__ */ jsx("div", { className: "min-w-0 flex-1", children: body }),
|
|
96
|
+
/* @__PURE__ */ jsx(ChevronDownIcon, { "aria-hidden": true, className: "mt-0.5 size-4 shrink-0 text-muted-foreground transition-transform group-data-[panel-open]:rotate-180" })
|
|
97
|
+
] }) }),
|
|
98
|
+
/* @__PURE__ */ jsx(CollapsibleContent, { className: "mt-2 whitespace-pre-wrap rounded-lg border border-border bg-muted/40 p-3 text-xs text-muted-foreground", children: e.detail })
|
|
99
|
+
] }) : body })
|
|
100
|
+
]
|
|
101
|
+
},
|
|
102
|
+
e.id
|
|
103
|
+
);
|
|
104
|
+
}) });
|
|
105
|
+
}
|
|
106
|
+
export {
|
|
107
|
+
AgentEvents
|
|
108
|
+
};
|
package/dist/ui/ai-tag.d.ts
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
|
|
3
|
+
/**
|
|
4
|
+
* @group chat
|
|
5
|
+
* @summary Etiqueta informativa que marca un contenido como generado o asistido por IA («Generado con IA»), con un dato secundario opcional (hora, modelo).
|
|
6
|
+
* @see badge — etiqueta de estado o categoría que no es de IA
|
|
7
|
+
* @see status-badge — estado de un proceso o de una entidad
|
|
8
|
+
* @example Texto por defecto (en el idioma activo)
|
|
9
|
+
* <AiTag />
|
|
10
|
+
* @example Texto propio con dato secundario
|
|
11
|
+
* <AiTag>
|
|
12
|
+
* Resumen automático
|
|
13
|
+
* <AiTagMeta>10:24</AiTagMeta>
|
|
14
|
+
* </AiTag>
|
|
15
|
+
* @example Solo el icono
|
|
16
|
+
* <AiTag iconOnly />
|
|
17
|
+
*/
|
|
18
|
+
|
|
3
19
|
declare function AiTag({ className, children, iconOnly, ...props }: React.ComponentProps<"span"> & {
|
|
4
20
|
iconOnly?: boolean;
|
|
5
21
|
}): React.JSX.Element;
|
|
@@ -5,6 +5,43 @@ import 'class-variance-authority/types';
|
|
|
5
5
|
import '@base-ui/react/use-render';
|
|
6
6
|
import 'class-variance-authority';
|
|
7
7
|
|
|
8
|
+
/**
|
|
9
|
+
* @group overlays
|
|
10
|
+
* @summary Diálogo modal que interrumpe para pedir una decisión importante o destructiva, montado por piezas; úsalo cuando el contenido no encaja en ConfirmAction.
|
|
11
|
+
* @see confirm-action — confirmación ya montada (título, descripción, verbo, escribir el nombre) junto a un botón
|
|
12
|
+
* @see confirm-dialog — confirmar desde un manejador con `await confirm(...)`, sin estado de apertura
|
|
13
|
+
* @see dialog — ventana modal que no pide una decisión (formulario corto, detalle)
|
|
14
|
+
* @example Confirmar un borrado (AlertDialogAction no cierra solo: cierra tú tras actuar)
|
|
15
|
+
* <AlertDialog open={open} onOpenChange={setOpen}>
|
|
16
|
+
* <AlertDialogTrigger render={<Button variant="destructive" />}>Eliminar proyecto</AlertDialogTrigger>
|
|
17
|
+
* <AlertDialogContent>
|
|
18
|
+
* <AlertDialogHeader>
|
|
19
|
+
* <AlertDialogTitle>¿Eliminar «Campaña otoño»?</AlertDialogTitle>
|
|
20
|
+
* <AlertDialogDescription>Se borrarán sus 34 tareas. No se puede deshacer.</AlertDialogDescription>
|
|
21
|
+
* </AlertDialogHeader>
|
|
22
|
+
* <AlertDialogFooter>
|
|
23
|
+
* <AlertDialogCancel>Cancelar</AlertDialogCancel>
|
|
24
|
+
* <AlertDialogAction variant="destructive" onClick={() => { remove(); setOpen(false); }}>
|
|
25
|
+
* Eliminar proyecto
|
|
26
|
+
* </AlertDialogAction>
|
|
27
|
+
* </AlertDialogFooter>
|
|
28
|
+
* </AlertDialogContent>
|
|
29
|
+
* </AlertDialog>
|
|
30
|
+
* @example Tamaño pequeño con icono
|
|
31
|
+
* <AlertDialogContent size="sm">
|
|
32
|
+
* <AlertDialogHeader>
|
|
33
|
+
* <AlertDialogMedia>
|
|
34
|
+
* <UploadIcon />
|
|
35
|
+
* </AlertDialogMedia>
|
|
36
|
+
* <AlertDialogTitle>¿Publicar la nueva versión?</AlertDialogTitle>
|
|
37
|
+
* </AlertDialogHeader>
|
|
38
|
+
* <AlertDialogFooter>
|
|
39
|
+
* <AlertDialogCancel>Cancelar</AlertDialogCancel>
|
|
40
|
+
* <AlertDialogAction onClick={publish}>Publicar</AlertDialogAction>
|
|
41
|
+
* </AlertDialogFooter>
|
|
42
|
+
* </AlertDialogContent>
|
|
43
|
+
*/
|
|
44
|
+
|
|
8
45
|
declare function AlertDialog({ ...props }: AlertDialog$1.Root.Props): React.JSX.Element;
|
|
9
46
|
declare function AlertDialogTrigger({ ...props }: AlertDialog$1.Trigger.Props): React.JSX.Element;
|
|
10
47
|
declare function AlertDialogPortal({ ...props }: AlertDialog$1.Portal.Props): React.JSX.Element;
|
package/dist/ui/alert.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ import * as React from 'react';
|
|
|
3
3
|
import { VariantProps } from 'class-variance-authority';
|
|
4
4
|
|
|
5
5
|
declare const alertVariants: (props?: ({
|
|
6
|
-
variant?: "
|
|
6
|
+
variant?: "info" | "success" | "warning" | "danger" | "default" | "destructive" | null | undefined;
|
|
7
7
|
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
8
8
|
declare function Alert({ className, variant, ...props }: React.ComponentProps<"div"> & VariantProps<typeof alertVariants>): React.JSX.Element;
|
|
9
9
|
declare function AlertTitle({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
@@ -1,5 +1,16 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
|
|
3
|
+
/**
|
|
4
|
+
* @group data
|
|
5
|
+
* @summary Cifra que rueda como un cuentakilómetros al aparecer o cambiar, para la cifra principal de un resumen. Dentro de un KPI basta con StatValue animate.
|
|
6
|
+
* @see stat — KPI con etiqueta, variación y tono (StatValue animate ya anima la cifra)
|
|
7
|
+
* @see quantity — cifra con unidad que no necesita animarse (tablas, textos, fichas)
|
|
8
|
+
* @example Cifra principal de un resumen
|
|
9
|
+
* <AnimatedNumber value={1284} />
|
|
10
|
+
* @example Con unidad fija (la unidad no rueda)
|
|
11
|
+
* <AnimatedNumber value={12.5} format={(n) => `${n.toFixed(1)} h`} />
|
|
12
|
+
*/
|
|
13
|
+
|
|
3
14
|
declare function AnimatedNumber({ value, format, className, ...props }: Omit<React.ComponentProps<"span">, "children"> & {
|
|
4
15
|
value: number;
|
|
5
16
|
/** Cómo escribir el número. Por defecto, `Intl.NumberFormat` del idioma activo. */
|
package/dist/ui/app-bar.d.ts
CHANGED
|
@@ -1,5 +1,27 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
|
|
3
|
+
/**
|
|
4
|
+
* @group navigation
|
|
5
|
+
* @summary Barra superior de la app dentro del lienzo: botón de menú, título corto y controles fijos (avisos, idioma, tema). El título de la vista va en PageHeader.
|
|
6
|
+
* @see page-header — título (h1), subtítulo y acciones de la vista, al inicio del contenido
|
|
7
|
+
* @see sidebar — navegación principal lateral; su SidebarTrigger va dentro de la AppBar
|
|
8
|
+
* @see bottom-nav — navegación principal inferior en móvil
|
|
9
|
+
* @example Menú, título, idioma y tema
|
|
10
|
+
* <AppBar>
|
|
11
|
+
* <SidebarTrigger />
|
|
12
|
+
* <AppBarTitle>Clientes</AppBarTitle>
|
|
13
|
+
* <AppBarActions>
|
|
14
|
+
* <LocaleSwitcher locales={locales} value={locale} onValueChange={setLocale} />
|
|
15
|
+
* <ThemeToggle value={theme} onValueChange={setTheme} />
|
|
16
|
+
* </AppBarActions>
|
|
17
|
+
* </AppBar>
|
|
18
|
+
* @example Preset transparent sobre un lienzo flotante
|
|
19
|
+
* <AppBar preset="transparent">
|
|
20
|
+
* <SidebarTrigger />
|
|
21
|
+
* <AppBarTitle>Mapa</AppBarTitle>
|
|
22
|
+
* </AppBar>
|
|
23
|
+
*/
|
|
24
|
+
|
|
3
25
|
type AppBarPreset = "app" | "compact" | "transparent";
|
|
4
26
|
declare function AppBar({ preset, className, ...props }: React.ComponentProps<"header"> & {
|
|
5
27
|
preset?: AppBarPreset;
|
package/dist/ui/attachment.d.ts
CHANGED
|
@@ -5,7 +5,7 @@ import { VariantProps } from 'class-variance-authority';
|
|
|
5
5
|
import { Button } from './button.js';
|
|
6
6
|
|
|
7
7
|
declare const attachmentVariants: (props?: ({
|
|
8
|
-
size?: "default" | "
|
|
8
|
+
size?: "default" | "sm" | "xs" | null | undefined;
|
|
9
9
|
orientation?: "horizontal" | "vertical" | null | undefined;
|
|
10
10
|
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
11
11
|
declare function Attachment({ className, state, size, orientation, ...props }: React.ComponentProps<"div"> & VariantProps<typeof attachmentVariants> & {
|
|
@@ -1,5 +1,22 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
|
|
3
|
+
/**
|
|
4
|
+
* @group auth
|
|
5
|
+
* @summary Fondo decorativo y animado (puntos, rejilla, aurora, malla, anillos, haces o foto de marca) detrás de una pantalla de acceso o una portada; va dentro de un contenedor relativo.
|
|
6
|
+
* @see auth-layout — pantalla de acceso completa: su prop `backdrop` ya monta este fondo
|
|
7
|
+
* @see error-page — página de error con fondo (`backdrop`), sin montarlo a mano
|
|
8
|
+
* @see empty-state — estado vacío con fondo (`backdrop`), sin montarlo a mano
|
|
9
|
+
* @example Detrás de una portada
|
|
10
|
+
* <div className="relative isolate overflow-hidden">
|
|
11
|
+
* <AuthBackdrop variant="dots" />
|
|
12
|
+
* <h1>Bienvenida a Acme</h1>
|
|
13
|
+
* </div>
|
|
14
|
+
* @example Foto de marca teñida con cristal
|
|
15
|
+
* <div className="relative isolate overflow-hidden">
|
|
16
|
+
* <AuthBackdrop variant="image" media={<img src="/portada.jpg" alt="" />} mediaTint="brand" glass />
|
|
17
|
+
* </div>
|
|
18
|
+
*/
|
|
19
|
+
|
|
3
20
|
type AuthBackdropVariant = "none" | "dots" | "grid" | "aurora" | "mesh" | "glow" | "rings" | "beams" | "image";
|
|
4
21
|
declare function AuthBackdrop({ variant, interactive, ink, animated, media, mediaTint, glass, className, ...props }: Omit<React.ComponentProps<"div">, "children"> & {
|
|
5
22
|
variant?: AuthBackdropVariant;
|
package/dist/ui/auth-form.d.ts
CHANGED
|
@@ -1,111 +1,4 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
1
|
+
import 'react';
|
|
2
|
+
import '../lib/auth.js';
|
|
3
|
+
export { b as AuthForm, c as AuthFormPreset, d as AuthFormValues, e as AuthOrganization, A as AuthResult, f as AuthRoute } from '../auth-form-B1hgbXkI.js';
|
|
3
4
|
import '../lib/i18n.js';
|
|
4
|
-
|
|
5
|
-
type AuthFormPreset = "sign-in" | "social" | "sign-up" | "magic-link" | "email-code" | "sso" | "forgot-password" | "reset-password";
|
|
6
|
-
type AuthIdentifierKind = "email" | "username" | "email-or-username";
|
|
7
|
-
type AuthMessage = AuthErrorCode | React.ReactNode;
|
|
8
|
-
type AuthFormValues = {
|
|
9
|
-
identifier: string;
|
|
10
|
-
password: string;
|
|
11
|
-
name: string;
|
|
12
|
-
confirmPassword: string;
|
|
13
|
-
remember: boolean;
|
|
14
|
-
terms: boolean;
|
|
15
|
-
/** Campos extra (`extraFields`) y todo lo demás del formulario. */
|
|
16
|
-
formData: FormData;
|
|
17
|
-
};
|
|
18
|
-
type AuthOrganization = {
|
|
19
|
-
id: string;
|
|
20
|
-
label: React.ReactNode;
|
|
21
|
-
description?: React.ReactNode;
|
|
22
|
-
icon?: React.ReactNode;
|
|
23
|
-
};
|
|
24
|
-
/** Lo que devuelve un callback: error general, errores por campo o la vista siguiente. */
|
|
25
|
-
type AuthResult = void | undefined | {
|
|
26
|
-
error?: AuthMessage;
|
|
27
|
-
fieldErrors?: Partial<Record<AuthField, AuthMessage>>;
|
|
28
|
-
next?: "password" | "code" | "sent" | "sso" | "redirecting";
|
|
29
|
-
};
|
|
30
|
-
/** Ruta que decide la app para un identificador (home realm discovery). */
|
|
31
|
-
type AuthRoute = void | undefined | {
|
|
32
|
-
method: "password" | "sso" | "passkey" | "email-code" | "magic-link";
|
|
33
|
-
/** Puerta por la que entra: plantilla o gente de fuera (se muestra junto al correo). */
|
|
34
|
-
access?: "internal" | "external";
|
|
35
|
-
/** SSO con varias organizaciones para el mismo dominio: se deja elegir. */
|
|
36
|
-
organizations?: AuthOrganization[];
|
|
37
|
-
error?: AuthMessage;
|
|
38
|
-
};
|
|
39
|
-
declare function AuthForm({ preset, title, description, icon, identifier, defaultIdentifier, identifierFirst, onIdentify, audience, fields, extraFields, passwordRules, showStrength, remember, providers, onProvider, providersPlacement, providersLayout, onPasskey, onSso, ssoBy, lastUsed, onSubmit, onVerifyCode, onResend, resendAfter, codeLength, error: errorProp, fieldErrors: fieldErrorsProp, links, submitLabel, footer, className, ...props }: Omit<React.ComponentProps<"div">, "title" | "onSubmit"> & {
|
|
40
|
-
preset?: AuthFormPreset;
|
|
41
|
-
title?: React.ReactNode;
|
|
42
|
-
description?: React.ReactNode;
|
|
43
|
-
/** Icono sobre el título (IconTile, logo de la app…). */
|
|
44
|
-
icon?: React.ReactNode;
|
|
45
|
-
/** Qué identifica a la persona. */
|
|
46
|
-
identifier?: AuthIdentifierKind;
|
|
47
|
-
defaultIdentifier?: string;
|
|
48
|
-
/** sign-in: primero el identificador; luego el método que toque. */
|
|
49
|
-
identifierFirst?: boolean;
|
|
50
|
-
/** Home realm discovery: la app dice qué método le toca a ese identificador. */
|
|
51
|
-
onIdentify?: (identifier: string) => AuthRoute | Promise<AuthRoute>;
|
|
52
|
-
/** Quién puede entrar: explica en pantalla, antes de escribir el correo, qué puerta le toca a cada persona. */
|
|
53
|
-
audience?: "internal" | "external" | "mixed";
|
|
54
|
-
/** Campos y orden (sign-up y reset-password). */
|
|
55
|
-
fields?: AuthField[];
|
|
56
|
-
/** Campos propios de la app, antes del botón (llegan en `formData`). */
|
|
57
|
-
extraFields?: React.ReactNode;
|
|
58
|
-
passwordRules?: PasswordRules;
|
|
59
|
-
/** Barra de fuerza de la contraseña (sign-up y reset-password por defecto). */
|
|
60
|
-
showStrength?: boolean;
|
|
61
|
-
/** Casilla «mantener la sesión iniciada». */
|
|
62
|
-
remember?: boolean;
|
|
63
|
-
/** SSO o redes sociales (la app pone nombre e icono). */
|
|
64
|
-
providers?: AuthProviderOption[];
|
|
65
|
-
onProvider?: (id: string) => void | Promise<AuthResult>;
|
|
66
|
-
providersPlacement?: "top" | "bottom";
|
|
67
|
-
providersLayout?: "stack" | "grid" | "icons";
|
|
68
|
-
/** Entrar con passkey (y autocompletado de passkeys en el campo del identificador). */
|
|
69
|
-
onPasskey?: () => void | Promise<AuthResult>;
|
|
70
|
-
/** SSO de empresa: enlace «usar SSO» en sign-in y envío del preset sso. */
|
|
71
|
-
onSso?: (input: {
|
|
72
|
-
identifier: string;
|
|
73
|
-
organization?: string;
|
|
74
|
-
}) => AuthResult | Promise<AuthResult | {
|
|
75
|
-
organizations: AuthOrganization[];
|
|
76
|
-
}>;
|
|
77
|
-
/** sso: se identifica por correo de trabajo o por organización. */
|
|
78
|
-
ssoBy?: "email" | "organization";
|
|
79
|
-
/** Último método usado en este dispositivo: id de proveedor, "passkey", "sso" o "password". */
|
|
80
|
-
lastUsed?: string | null;
|
|
81
|
-
onSubmit?: (values: AuthFormValues) => AuthResult | Promise<AuthResult>;
|
|
82
|
-
/** email-code: verifica el código (se llama al completarse). */
|
|
83
|
-
onVerifyCode?: (code: string, values: {
|
|
84
|
-
identifier: string;
|
|
85
|
-
}) => AuthResult | Promise<AuthResult>;
|
|
86
|
-
/** Reenviar enlace o código. */
|
|
87
|
-
onResend?: (values: {
|
|
88
|
-
identifier: string;
|
|
89
|
-
}) => void | Promise<void>;
|
|
90
|
-
/** Segundos hasta poder reenviar. */
|
|
91
|
-
resendAfter?: number;
|
|
92
|
-
codeLength?: number;
|
|
93
|
-
/** Error controlado por la app. */
|
|
94
|
-
error?: AuthMessage;
|
|
95
|
-
fieldErrors?: Partial<Record<AuthField, AuthMessage>>;
|
|
96
|
-
/** Enlaces: URL o función del router. */
|
|
97
|
-
links?: {
|
|
98
|
-
signIn?: AuthLink;
|
|
99
|
-
email?: AuthLink;
|
|
100
|
-
signUp?: AuthLink;
|
|
101
|
-
requestAccess?: AuthLink;
|
|
102
|
-
forgotPassword?: AuthLink;
|
|
103
|
-
terms?: AuthLink;
|
|
104
|
-
privacy?: AuthLink;
|
|
105
|
-
};
|
|
106
|
-
submitLabel?: React.ReactNode;
|
|
107
|
-
/** Sustituye el pie de enlaces. */
|
|
108
|
-
footer?: React.ReactNode;
|
|
109
|
-
}): React.JSX.Element;
|
|
110
|
-
|
|
111
|
-
export { AuthForm, type AuthFormPreset, type AuthFormValues, type AuthOrganization, type AuthResult, type AuthRoute };
|
package/dist/ui/auth-form.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
-
import { ArrowLeftIcon, Building2Icon, CheckIcon, CircleIcon, MailCheckIcon } from "lucide-react";
|
|
3
|
+
import { ArrowLeftIcon, Building2Icon, CheckIcon, CircleIcon, MailCheckIcon, UsersRoundIcon } from "lucide-react";
|
|
4
4
|
import * as React from "react";
|
|
5
5
|
import { useDsMessages } from "../hooks/use-ds-messages.js";
|
|
6
6
|
import {
|
|
@@ -21,6 +21,7 @@ import { Checkbox } from "./checkbox.js";
|
|
|
21
21
|
import { IconTile } from "./icon-tile.js";
|
|
22
22
|
import { Input } from "./input.js";
|
|
23
23
|
import { InputOTP, InputOTPGroup, InputOTPSlot } from "./input-otp.js";
|
|
24
|
+
import { MfaChallenge } from "./mfa-challenge.js";
|
|
24
25
|
import { Label } from "./label.js";
|
|
25
26
|
import { PasswordInput } from "./password-input.js";
|
|
26
27
|
import { PasswordStrength } from "./password-strength.js";
|
|
@@ -45,6 +46,7 @@ function AuthForm({
|
|
|
45
46
|
identifierFirst,
|
|
46
47
|
onIdentify,
|
|
47
48
|
audience,
|
|
49
|
+
entry = "identifier",
|
|
48
50
|
fields,
|
|
49
51
|
extraFields,
|
|
50
52
|
passwordRules,
|
|
@@ -58,6 +60,7 @@ function AuthForm({
|
|
|
58
60
|
onSso,
|
|
59
61
|
ssoBy = "email",
|
|
60
62
|
lastUsed,
|
|
63
|
+
mfa,
|
|
61
64
|
onSubmit,
|
|
62
65
|
onVerifyCode,
|
|
63
66
|
onResend,
|
|
@@ -75,11 +78,13 @@ function AuthForm({
|
|
|
75
78
|
const d = PRESETS[preset];
|
|
76
79
|
const list = fields ?? d.fields;
|
|
77
80
|
const [accessKind, setAccessKind] = React.useState(null);
|
|
78
|
-
const
|
|
81
|
+
const doors = entry === "doors" && preset === "sign-in" && !!onSso;
|
|
82
|
+
const stepFirst = preset === "sign-in" && !doors && (identifierFirst ?? d.identifierFirst);
|
|
79
83
|
const strength = showStrength ?? d.strength;
|
|
80
84
|
const uid = React.useId();
|
|
85
|
+
const fallbackView = preset === "sso" ? "sso" : doors ? "doors" : "form";
|
|
81
86
|
const ids = (f) => `${uid}-${f}`;
|
|
82
|
-
const [view, setView] = React.useState(preset === "sso" ? "sso" : "form");
|
|
87
|
+
const [view, setView] = React.useState(preset === "sso" ? "sso" : doors ? "doors" : "form");
|
|
83
88
|
const [values, setValues] = React.useState({ identifier: defaultIdentifier, password: "", name: "", confirmPassword: "", remember: false, terms: false });
|
|
84
89
|
const [code, setCode] = React.useState("");
|
|
85
90
|
const [errors, setErrors] = React.useState({});
|
|
@@ -91,6 +96,7 @@ function AuthForm({
|
|
|
91
96
|
const formRef = React.useRef(null);
|
|
92
97
|
if (preset === "sign-up" && !list.includes("identifier")) dsWarn("AuthForm", 'preset "sign-up" without "identifier" in `fields`.');
|
|
93
98
|
if (preset === "email-code" && !onVerifyCode) dsWarn("AuthForm", 'preset "email-code" expects `onVerifyCode`.');
|
|
99
|
+
if (!mfa && view === "mfa") dsWarn("AuthForm", 'a callback returned `next: "mfa"` but there is no `mfa` prop.');
|
|
94
100
|
if (preset === "sso" && !onSso) dsWarn("AuthForm", 'preset "sso" expects `onSso`.');
|
|
95
101
|
const shownError = errorProp ?? error;
|
|
96
102
|
const fieldError = (f) => fieldErrorsProp?.[f] ?? errors[f];
|
|
@@ -382,9 +388,9 @@ function AuthForm({
|
|
|
382
388
|
onPasskey && (preset === "sign-in" || preset === "social") ? /* @__PURE__ */ jsx(AuthPasskeyButton, { pending: pending === "passkey", disabled: pending != null && pending !== "passkey", lastUsed: lastUsed === "passkey", onClick: () => void run("passkey", async () => apply(await onPasskey() ?? void 0, null)) }) : null
|
|
383
389
|
] }) : null;
|
|
384
390
|
const divider = providersBlock && preset !== "social" ? /* @__PURE__ */ jsx(AuthStagger, { index: 2, children: /* @__PURE__ */ jsx(AuthDivider, {}) }) : null;
|
|
385
|
-
const backToForm = /* @__PURE__ */ jsxs(Button, { type: "button", variant: "ghost", size: "sm", className: "self-start", onClick: () => go(preset === "sso" ? "sso" : "form"), children: [
|
|
386
|
-
/* @__PURE__ */ jsx(ArrowLeftIcon, {}),
|
|
387
|
-
t.authUseDifferentEmail
|
|
391
|
+
const backToForm = /* @__PURE__ */ jsxs(Button, { type: "button", variant: "ghost", size: "sm", className: "self-start", onClick: () => go(doors && view !== "code" && view !== "sent" ? "doors" : preset === "sso" ? "sso" : "form"), children: [
|
|
392
|
+
/* @__PURE__ */ jsx(ArrowLeftIcon, { className: "rtl:rotate-180" }),
|
|
393
|
+
doors && view !== "code" && view !== "sent" ? t.authBackToSignIn : t.authUseDifferentEmail
|
|
388
394
|
] });
|
|
389
395
|
let content;
|
|
390
396
|
if (view === "sent") {
|
|
@@ -459,10 +465,35 @@ function AuthForm({
|
|
|
459
465
|
) }, o.id)) }) }),
|
|
460
466
|
backToForm
|
|
461
467
|
] });
|
|
468
|
+
} else if (view === "doors") {
|
|
469
|
+
content = /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
470
|
+
/* @__PURE__ */ jsx(AuthHeader, { icon, title: title ?? head[preset][0], description: description ?? head[preset][1] }),
|
|
471
|
+
/* @__PURE__ */ jsx(AuthError, { error: shownError }),
|
|
472
|
+
/* @__PURE__ */ jsxs(AuthStagger, { index: 2, "data-slot": "auth-form-doors", className: "flex flex-col gap-6", children: [
|
|
473
|
+
/* @__PURE__ */ jsxs("section", { "data-door": "staff", className: "flex flex-col gap-3", children: [
|
|
474
|
+
/* @__PURE__ */ jsx("p", { className: "text-sm text-pretty text-muted-foreground", children: t.authDoorStaffHint }),
|
|
475
|
+
/* @__PURE__ */ jsxs(Button, { type: "button", size: "lg", className: "w-full", "data-last-used": lastUsed === "sso" || void 0, disabled: pending != null, "aria-busy": pending === "sso" || void 0, onClick: () => void startSso(), children: [
|
|
476
|
+
pending === "sso" ? /* @__PURE__ */ jsx(Spinner, {}) : /* @__PURE__ */ jsx(Building2Icon, {}),
|
|
477
|
+
t.authContinueSso
|
|
478
|
+
] })
|
|
479
|
+
] }),
|
|
480
|
+
/* @__PURE__ */ jsx(AuthDivider, {}),
|
|
481
|
+
/* @__PURE__ */ jsxs("section", { "data-door": "external", className: "flex flex-col gap-3", children: [
|
|
482
|
+
/* @__PURE__ */ jsx("p", { className: "text-sm text-pretty text-muted-foreground", children: t.authDoorExternalHint }),
|
|
483
|
+
/* @__PURE__ */ jsxs(Button, { type: "button", size: "lg", variant: "outline", className: "w-full", disabled: pending != null, onClick: () => go("form"), children: [
|
|
484
|
+
/* @__PURE__ */ jsx(UsersRoundIcon, {}),
|
|
485
|
+
t.authDoorExternal
|
|
486
|
+
] })
|
|
487
|
+
] })
|
|
488
|
+
] })
|
|
489
|
+
] });
|
|
490
|
+
} else if (view === "mfa" && mfa) {
|
|
491
|
+
content = /* @__PURE__ */ jsx(MfaChallenge, { ...mfa, onCancel: () => go(fallbackView) });
|
|
462
492
|
} else if (view === "redirecting") {
|
|
463
493
|
content = /* @__PURE__ */ jsxs("div", { "data-slot": "auth-form-redirecting", role: "status", className: "flex flex-col items-center gap-4 py-6 text-center", children: [
|
|
464
494
|
/* @__PURE__ */ jsx(Spinner, { className: "size-6" }),
|
|
465
|
-
/* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground", children: t.authSsoRedirecting })
|
|
495
|
+
/* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground", children: t.authSsoRedirecting }),
|
|
496
|
+
/* @__PURE__ */ jsx(Button, { type: "button", variant: "ghost", size: "sm", onClick: () => go(fallbackView), children: t.authCancel })
|
|
466
497
|
] });
|
|
467
498
|
} else {
|
|
468
499
|
const ssoView = view === "sso";
|
|
@@ -481,7 +512,7 @@ function AuthForm({
|
|
|
481
512
|
/* @__PURE__ */ jsx(Button, { type: "button", variant: "link", size: "sm", onClick: () => go("form"), children: t.authChange }),
|
|
482
513
|
/* @__PURE__ */ jsx("input", { type: "hidden", name: "username", autoComplete: "username", value: email })
|
|
483
514
|
] }) : null,
|
|
484
|
-
audience && audience !== "external" && stepFirst && view === "form" ? /* @__PURE__ */ jsx("p", { "data-slot": "auth-form-audience", "data-audience": audience, className: "rounded-(--ds-auth-radius) bg-muted px-3 py-2 text-xs text-pretty text-muted-foreground", children: audience === "mixed" ? t.authAudienceMixed : t.authAudienceInternal }) : null,
|
|
515
|
+
audience && audience !== "external" && stepFirst && view === "form" && !doors ? /* @__PURE__ */ jsx("p", { "data-slot": "auth-form-audience", "data-audience": audience, className: "rounded-(--ds-auth-radius) bg-muted px-3 py-2 text-xs text-pretty text-muted-foreground", children: audience === "mixed" ? t.authAudienceMixed : t.authAudienceInternal }) : null,
|
|
485
516
|
visibleFields.map(renderField),
|
|
486
517
|
!ssoView && extraFields && !(stepFirst && view === "form") ? extraFields : null,
|
|
487
518
|
remember && preset === "sign-in" && !(stepFirst && view === "form") ? /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2.5", children: [
|
|
@@ -502,13 +533,17 @@ function AuthForm({
|
|
|
502
533
|
/* @__PURE__ */ jsx(Building2Icon, {}),
|
|
503
534
|
t.authUseSso
|
|
504
535
|
] }) }) : null,
|
|
505
|
-
|
|
506
|
-
/* @__PURE__ */ jsx(ArrowLeftIcon, {}),
|
|
536
|
+
doors && view === "form" ? /* @__PURE__ */ jsxs(Button, { type: "button", variant: "ghost", size: "sm", className: "self-center", onClick: () => go("doors"), children: [
|
|
537
|
+
/* @__PURE__ */ jsx(ArrowLeftIcon, { className: "rtl:rotate-180" }),
|
|
538
|
+
t.authBackToSignIn
|
|
539
|
+
] }) : null,
|
|
540
|
+
ssoView && (preset === "sign-in" || preset === "social") ? /* @__PURE__ */ jsxs(Button, { type: "button", variant: "ghost", size: "sm", className: "self-center", onClick: () => go(doors ? "doors" : "form"), children: [
|
|
541
|
+
/* @__PURE__ */ jsx(ArrowLeftIcon, { className: "rtl:rotate-180" }),
|
|
507
542
|
t.authBackToSignIn
|
|
508
543
|
] }) : null
|
|
509
544
|
] });
|
|
510
545
|
}
|
|
511
|
-
const footerLinks = footer ?? (view === "form" || view === "sso" ? (preset === "sign-in" || preset === "social") && links.signUp ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
546
|
+
const footerLinks = footer ?? (view === "doors" || view === "form" || view === "sso" ? (preset === "sign-in" || preset === "social") && links.signUp ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
512
547
|
t.authNoAccount,
|
|
513
548
|
" ",
|
|
514
549
|
/* @__PURE__ */ jsx(AuthAnchor, { to: links.signUp, children: t.authSignUpLink })
|
package/dist/ui/auth-layout.d.ts
CHANGED
|
@@ -1,6 +1,44 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { AuthBackdropVariant } from './auth-backdrop.js';
|
|
3
3
|
|
|
4
|
+
/**
|
|
5
|
+
* @group auth
|
|
6
|
+
* @summary Maqueta de la pantalla de acceso (centered, split, cover, banner, minimal) con logo, fondo, panel de marca e idioma y tema en la esquina; dentro va AuthForm u otra pieza de acceso.
|
|
7
|
+
* @see page-shell — maqueta de una página de la app ya dentro (no de acceso)
|
|
8
|
+
* @see error-page — 404, 500, sin conexión o mantenimiento
|
|
9
|
+
* @see auth-backdrop — solo el fondo animado, detrás de otra superficie
|
|
10
|
+
* @example Centrada, con idioma y tema siempre visibles
|
|
11
|
+
* <AuthLayout
|
|
12
|
+
* preset="centered"
|
|
13
|
+
* logo={<img src="/logo.svg" alt="Acme" />}
|
|
14
|
+
* toolbar={
|
|
15
|
+
* <>
|
|
16
|
+
* <LocaleSwitcher locales={locales} value={lang} onValueChange={setLang} />
|
|
17
|
+
* <ThemeToggle value={theme} onValueChange={setTheme} />
|
|
18
|
+
* </>
|
|
19
|
+
* }
|
|
20
|
+
* >
|
|
21
|
+
* <AuthForm preset="sign-in" onSubmit={signIn} />
|
|
22
|
+
* </AuthLayout>
|
|
23
|
+
* @example Panel de marca a un lado (preset split)
|
|
24
|
+
* <AuthLayout
|
|
25
|
+
* preset="split"
|
|
26
|
+
* logo={<img src="/logo.svg" alt="Acme" />}
|
|
27
|
+
* aside={
|
|
28
|
+
* <AuthAside>
|
|
29
|
+
* <AuthAsideTitle>Todo tu equipo, en un solo lugar</AuthAsideTitle>
|
|
30
|
+
* <AuthAsideText>Entra con tu método favorito.</AuthAsideText>
|
|
31
|
+
* </AuthAside>
|
|
32
|
+
* }
|
|
33
|
+
* >
|
|
34
|
+
* <AuthForm preset="social" providers={authProviders(["google", "microsoft"])} onProvider={signInSocial} />
|
|
35
|
+
* </AuthLayout>
|
|
36
|
+
* @example Sin tarjeta para una app interna
|
|
37
|
+
* <AuthLayout preset="minimal" backdrop="none">
|
|
38
|
+
* <AuthForm preset="sso" onSso={signInSso} />
|
|
39
|
+
* </AuthLayout>
|
|
40
|
+
*/
|
|
41
|
+
|
|
4
42
|
type AuthLayoutPreset = "centered" | "split" | "cover" | "banner" | "minimal";
|
|
5
43
|
type AuthSurface = "solid" | "glass" | "elevated" | "plain";
|
|
6
44
|
type AuthShape = "rounded" | "soft" | "sharp";
|
package/dist/ui/avatar.d.ts
CHANGED
|
@@ -2,6 +2,33 @@ import * as React from 'react';
|
|
|
2
2
|
import { Avatar as Avatar$1 } from '@base-ui/react/avatar';
|
|
3
3
|
import { DsDataTone } from './legend.js';
|
|
4
4
|
|
|
5
|
+
/**
|
|
6
|
+
* @group content
|
|
7
|
+
* @summary Foto o iniciales que identifican a una persona (o cuenta), con insignia de estado opcional y grupos solapados con contador.
|
|
8
|
+
* @see icon-tile — icono en baldosa tintada para objetos que no son personas
|
|
9
|
+
* @see badge — etiqueta de texto o de estado, no una identidad
|
|
10
|
+
* @example Foto con iniciales de respaldo
|
|
11
|
+
* <Avatar>
|
|
12
|
+
* <AvatarImage src={user.avatarUrl} alt="" />
|
|
13
|
+
* <AvatarFallback>LM</AvatarFallback>
|
|
14
|
+
* </Avatar>
|
|
15
|
+
* @example Iniciales con tono y tamaño
|
|
16
|
+
* <Avatar size="lg">
|
|
17
|
+
* <AvatarFallback tone="info">AR</AvatarFallback>
|
|
18
|
+
* </Avatar>
|
|
19
|
+
* @example Grupo con contador
|
|
20
|
+
* <AvatarGroup>
|
|
21
|
+
* <Avatar size="sm">
|
|
22
|
+
* <AvatarFallback>AR</AvatarFallback>
|
|
23
|
+
* </Avatar>
|
|
24
|
+
* <Avatar size="sm">
|
|
25
|
+
* <AvatarFallback>JO</AvatarFallback>
|
|
26
|
+
* </Avatar>
|
|
27
|
+
* <AvatarGroupCount>+5</AvatarGroupCount>
|
|
28
|
+
* </AvatarGroup>
|
|
29
|
+
* @note Pon siempre AvatarFallback (iniciales) aunque haya foto: se ve mientras carga o si falla. Si el nombre ya está escrito al lado, la imagen lleva `alt=""`.
|
|
30
|
+
*/
|
|
31
|
+
|
|
5
32
|
declare function Avatar({ className, size, ...props }: Avatar$1.Root.Props & {
|
|
6
33
|
size?: "default" | "sm" | "lg";
|
|
7
34
|
}): React.JSX.Element;
|