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,55 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { Card } from './card.js';
|
|
3
|
+
import './auth-backdrop.js';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* @group feedback
|
|
7
|
+
* @summary Tarjeta con el estado de algo (un servicio, una cuenta, un trámite) y la ÚNICA acción que toca ahora; el preset sigue al estado: activate · open · resolve · inactive.
|
|
8
|
+
* @see stat — una cifra suelta (KPI), sin acción
|
|
9
|
+
* @see content-card — tarjeta de contenido o de navegación, sin estado
|
|
10
|
+
* @see alert — aviso dentro de una sección, sin tarjeta de estado
|
|
11
|
+
* @example Pendiente de activar (preset activate)
|
|
12
|
+
* <NextStepCard
|
|
13
|
+
* preset="activate"
|
|
14
|
+
* icon={<ShieldIcon />}
|
|
15
|
+
* title={service.name}
|
|
16
|
+
* status={<StatusBadge level="info">Pendiente de activar</StatusBadge>}
|
|
17
|
+
* description={t("backup.activateHint")}
|
|
18
|
+
* action={<Button onClick={activate}>Activar</Button>}
|
|
19
|
+
* />
|
|
20
|
+
* @example Activo, con su uso debajo (preset open)
|
|
21
|
+
* <NextStepCard
|
|
22
|
+
* preset="open"
|
|
23
|
+
* title={service.name}
|
|
24
|
+
* status={<StatusBadge level="ok">Activo</StatusBadge>}
|
|
25
|
+
* action={<Button render={<a href={service.url} />}>Abrir el servicio</Button>}
|
|
26
|
+
* >
|
|
27
|
+
* <UsageMeter label="Almacenamiento" value={12} limit={50} unit="GBy" />
|
|
28
|
+
* </NextStepCard>
|
|
29
|
+
*/
|
|
30
|
+
|
|
31
|
+
type NextStepPreset = "activate" | "open" | "resolve" | "inactive";
|
|
32
|
+
type NextStepTone = "info" | "success" | "warning" | "danger" | "neutral";
|
|
33
|
+
type NextStepCardProps = Omit<React.ComponentProps<typeof Card>, "title"> & {
|
|
34
|
+
preset?: NextStepPreset;
|
|
35
|
+
tone?: NextStepTone;
|
|
36
|
+
/** Filete de color en el borde de inicio para lo que pide acción. */
|
|
37
|
+
emphasis?: boolean;
|
|
38
|
+
/** Icono (svg) en una baldosa del color del tono. */
|
|
39
|
+
icon?: React.ReactNode;
|
|
40
|
+
title: React.ReactNode;
|
|
41
|
+
/** Estado, normalmente un StatusBadge. */
|
|
42
|
+
status?: React.ReactNode;
|
|
43
|
+
description?: React.ReactNode;
|
|
44
|
+
/** Línea de datos secundarios (plan, fechas, última actividad). */
|
|
45
|
+
meta?: React.ReactNode;
|
|
46
|
+
/** La acción principal: un solo botón. */
|
|
47
|
+
action?: React.ReactNode;
|
|
48
|
+
/** Acciones de menor peso (ghost/outline), detrás de la principal. */
|
|
49
|
+
secondaryActions?: React.ReactNode;
|
|
50
|
+
/** Nivel del título (h2 por defecto). */
|
|
51
|
+
headingLevel?: 2 | 3 | 4;
|
|
52
|
+
};
|
|
53
|
+
declare function NextStepCard({ preset, tone, emphasis, icon, title, status, description, meta, action, secondaryActions, headingLevel, className, children, ...props }: NextStepCardProps): React.JSX.Element;
|
|
54
|
+
|
|
55
|
+
export { NextStepCard, type NextStepCardProps, type NextStepPreset, type NextStepTone };
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { cn } from "../lib/utils.js";
|
|
4
|
+
import { Card } from "./card.js";
|
|
5
|
+
import { IconTile } from "./icon-tile.js";
|
|
6
|
+
const PRESETS = {
|
|
7
|
+
activate: { tone: "info", emphasis: true },
|
|
8
|
+
open: { tone: "success", emphasis: false },
|
|
9
|
+
resolve: { tone: "warning", emphasis: true },
|
|
10
|
+
inactive: { tone: "neutral", emphasis: false }
|
|
11
|
+
};
|
|
12
|
+
const ACCENT = {
|
|
13
|
+
info: "before:bg-info",
|
|
14
|
+
success: "before:bg-success",
|
|
15
|
+
warning: "before:bg-warning",
|
|
16
|
+
danger: "before:bg-danger",
|
|
17
|
+
neutral: "before:bg-neutral"
|
|
18
|
+
};
|
|
19
|
+
function NextStepCard({
|
|
20
|
+
preset = "open",
|
|
21
|
+
tone,
|
|
22
|
+
emphasis,
|
|
23
|
+
icon,
|
|
24
|
+
title,
|
|
25
|
+
status,
|
|
26
|
+
description,
|
|
27
|
+
meta,
|
|
28
|
+
action,
|
|
29
|
+
secondaryActions,
|
|
30
|
+
headingLevel = 2,
|
|
31
|
+
className,
|
|
32
|
+
children,
|
|
33
|
+
...props
|
|
34
|
+
}) {
|
|
35
|
+
const p = PRESETS[preset];
|
|
36
|
+
const t = tone ?? p.tone;
|
|
37
|
+
const accent = emphasis ?? p.emphasis;
|
|
38
|
+
const Heading = `h${headingLevel}`;
|
|
39
|
+
return /* @__PURE__ */ jsxs(
|
|
40
|
+
Card,
|
|
41
|
+
{
|
|
42
|
+
"data-slot": "next-step-card",
|
|
43
|
+
"data-preset": preset,
|
|
44
|
+
"data-tone": t,
|
|
45
|
+
"data-emphasis": accent || void 0,
|
|
46
|
+
className: cn(
|
|
47
|
+
"@container/next-step-card",
|
|
48
|
+
accent && cn(
|
|
49
|
+
"relative isolate before:pointer-events-none before:absolute before:inset-y-0 before:start-0 before:w-(--ds-next-step-accent-w) before:content-['']",
|
|
50
|
+
ACCENT[t]
|
|
51
|
+
),
|
|
52
|
+
className
|
|
53
|
+
),
|
|
54
|
+
...props,
|
|
55
|
+
children: [
|
|
56
|
+
/* @__PURE__ */ jsxs(
|
|
57
|
+
"div",
|
|
58
|
+
{
|
|
59
|
+
"data-slot": "next-step-card-layout",
|
|
60
|
+
className: "flex min-w-0 flex-col gap-(--ds-card-spacing) px-(--ds-card-spacing) @lg/next-step-card:flex-row @lg/next-step-card:items-start",
|
|
61
|
+
children: [
|
|
62
|
+
icon != null && /* @__PURE__ */ jsx(IconTile, { "data-slot": "next-step-card-icon", "aria-hidden": "true", tone: t === "neutral" ? "neutral" : t, size: "md", children: icon }),
|
|
63
|
+
/* @__PURE__ */ jsxs("div", { "data-slot": "next-step-card-body", className: "flex min-w-0 flex-1 flex-col gap-1", children: [
|
|
64
|
+
/* @__PURE__ */ jsxs("div", { className: "flex min-w-0 flex-wrap items-center gap-x-2 gap-y-1", children: [
|
|
65
|
+
/* @__PURE__ */ jsx(Heading, { "data-slot": "next-step-card-title", className: "min-w-0 text-base leading-tight font-(--ds-heading-weight) text-card-foreground", children: title }),
|
|
66
|
+
status
|
|
67
|
+
] }),
|
|
68
|
+
description != null && /* @__PURE__ */ jsx("p", { "data-slot": "next-step-card-description", className: "text-sm text-pretty text-muted-foreground", children: description }),
|
|
69
|
+
meta != null && /* @__PURE__ */ jsx("div", { "data-slot": "next-step-card-meta", className: "flex flex-wrap items-center gap-x-3 gap-y-1 text-xs text-muted-foreground", children: meta })
|
|
70
|
+
] }),
|
|
71
|
+
(action != null || secondaryActions != null) && /* @__PURE__ */ jsxs(
|
|
72
|
+
"div",
|
|
73
|
+
{
|
|
74
|
+
"data-slot": "next-step-card-actions",
|
|
75
|
+
className: "flex flex-col-reverse gap-2 *:w-full @sm/next-step-card:flex-row @sm/next-step-card:flex-wrap @sm/next-step-card:*:w-auto @lg/next-step-card:shrink-0 @lg/next-step-card:justify-end",
|
|
76
|
+
children: [
|
|
77
|
+
secondaryActions,
|
|
78
|
+
action
|
|
79
|
+
]
|
|
80
|
+
}
|
|
81
|
+
)
|
|
82
|
+
]
|
|
83
|
+
}
|
|
84
|
+
),
|
|
85
|
+
children != null && /* @__PURE__ */ jsx("div", { "data-slot": "next-step-card-content", className: "flex min-w-0 flex-col gap-3 px-(--ds-card-spacing)", children })
|
|
86
|
+
]
|
|
87
|
+
}
|
|
88
|
+
);
|
|
89
|
+
}
|
|
90
|
+
export {
|
|
91
|
+
NextStepCard
|
|
92
|
+
};
|
|
@@ -7,6 +7,38 @@ import 'class-variance-authority/types';
|
|
|
7
7
|
import '@base-ui/react/tabs';
|
|
8
8
|
import 'class-variance-authority';
|
|
9
9
|
|
|
10
|
+
/**
|
|
11
|
+
* @group feedback
|
|
12
|
+
* @summary Revisión de un aviso o comunicación con su contexto completo y la acción que pide (leer, reconocer, resolver con nota, aceptar o rechazar); se abre desde la campana.
|
|
13
|
+
* @see notifications — la campana y la lista de avisos desde la que se abre
|
|
14
|
+
* @see confirm-action — confirmar una acción delicada de la propia persona, no un aviso
|
|
15
|
+
* @see alert-dialog — bloquear hasta decidir algo que no es un aviso
|
|
16
|
+
* @example Reconocer un aviso (preset acknowledge)
|
|
17
|
+
* <NoticeReview
|
|
18
|
+
* open={open}
|
|
19
|
+
* onOpenChange={setOpen}
|
|
20
|
+
* preset="acknowledge"
|
|
21
|
+
* tone="warning"
|
|
22
|
+
* icon={<ServerCrashIcon />}
|
|
23
|
+
* title={notice.title}
|
|
24
|
+
* time={notice.createdAt}
|
|
25
|
+
* state="new"
|
|
26
|
+
* onAcknowledge={() => acknowledge(notice.id)}
|
|
27
|
+
* >
|
|
28
|
+
* <p>{notice.body}</p>
|
|
29
|
+
* </NoticeReview>
|
|
30
|
+
* @example Resolver con nota, en panel lateral (preset resolve)
|
|
31
|
+
* <NoticeReview
|
|
32
|
+
* open={open}
|
|
33
|
+
* onOpenChange={setOpen}
|
|
34
|
+
* preset="resolve"
|
|
35
|
+
* presentation="sheet"
|
|
36
|
+
* title={notice.title}
|
|
37
|
+
* state="acknowledged"
|
|
38
|
+
* onResolve={(note) => resolve(notice.id, note)}
|
|
39
|
+
* />
|
|
40
|
+
*/
|
|
41
|
+
|
|
10
42
|
type NoticeReviewPreset = "read" | "acknowledge" | "resolve" | "respond";
|
|
11
43
|
declare function NoticeReview({ open, onOpenChange, preset, presentation, tone, icon, title, description, time, state, children, onAcknowledge, onResolve, onRespond, onSnooze, className, }: {
|
|
12
44
|
open?: boolean;
|
package/dist/ui/page-header.d.ts
CHANGED
|
@@ -3,20 +3,62 @@ import { IconTile } from './icon-tile.js';
|
|
|
3
3
|
import 'class-variance-authority/types';
|
|
4
4
|
import 'class-variance-authority';
|
|
5
5
|
|
|
6
|
+
/**
|
|
7
|
+
* @group navigation
|
|
8
|
+
* @summary Cabecera del contenido de una vista: migas, título (h1), subtítulo, acciones y avisos. SectionHeader, en el mismo fichero, titula un bloque (h2) dentro de la vista.
|
|
9
|
+
* @see app-bar — barra superior de la app (menú, título corto, idioma y tema), fuera del contenido
|
|
10
|
+
* @see page-shell — contenedor de la vista que envuelve la cabecera y las secciones
|
|
11
|
+
* @example Atajo con props
|
|
12
|
+
* <PageHeader
|
|
13
|
+
* title={t("clients.title")}
|
|
14
|
+
* description={t("clients.description")}
|
|
15
|
+
* actions={<Button>Nuevo cliente</Button>}
|
|
16
|
+
* />
|
|
17
|
+
* @example Con piezas y aviso de página
|
|
18
|
+
* <PageHeader preset="compact">
|
|
19
|
+
* <PageHeaderTitle>Operaciones</PageHeaderTitle>
|
|
20
|
+
* <PageHeaderDescription>Estado del servicio en tiempo real.</PageHeaderDescription>
|
|
21
|
+
* <PageHeaderNotice>
|
|
22
|
+
* <Banner variant="warning">Mantenimiento esta noche.</Banner>
|
|
23
|
+
* </PageHeaderNotice>
|
|
24
|
+
* </PageHeader>
|
|
25
|
+
* @example Cabecera de un bloque (SectionHeader)
|
|
26
|
+
* <SectionHeader title={t("queues")} description={t("last15")} icon={<PhoneIcon />} iconTone="info" actions={<Button size="sm">Ver todas</Button>} />
|
|
27
|
+
*/
|
|
28
|
+
|
|
6
29
|
type PageHeaderPreset = "page" | "compact" | "canvas";
|
|
7
|
-
|
|
30
|
+
type PageHeaderProps = Omit<React.ComponentProps<"header">, "title"> & {
|
|
8
31
|
preset?: PageHeaderPreset;
|
|
9
|
-
|
|
32
|
+
/** Atajo: título de la vista (h1). Equivale a <PageHeaderTitle>. No es el atributo HTML `title`. */
|
|
33
|
+
title?: React.ReactNode;
|
|
34
|
+
/** Atajo: subtítulo. Equivale a <PageHeaderDescription>. */
|
|
35
|
+
description?: React.ReactNode;
|
|
36
|
+
/** Atajo: acciones de la vista. Equivale a <PageHeaderActions>. */
|
|
37
|
+
actions?: React.ReactNode;
|
|
38
|
+
};
|
|
39
|
+
declare function PageHeader({ preset, title, description, actions, className, children, ...props }: PageHeaderProps): React.JSX.Element;
|
|
10
40
|
declare function PageHeaderBreadcrumb({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
11
41
|
declare function PageHeaderTitle({ className, ...props }: React.ComponentProps<"h1">): React.JSX.Element;
|
|
12
42
|
declare function PageHeaderDescription({ className, ...props }: React.ComponentProps<"p">): React.JSX.Element;
|
|
13
43
|
declare function PageHeaderActions({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
14
44
|
/** Hueco para avisos de la página (Banner, Alert) bajo la cabecera. */
|
|
15
45
|
declare function PageHeaderNotice({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
16
|
-
|
|
46
|
+
type SectionHeaderProps = Omit<React.ComponentProps<"div">, "title"> & {
|
|
47
|
+
/** Atajo: título del bloque (h2). Equivale a <SectionHeaderTitle>. No es el atributo HTML `title`. */
|
|
48
|
+
title?: React.ReactNode;
|
|
49
|
+
/** Atajo: descripción. Equivale a <SectionHeaderDescription>. */
|
|
50
|
+
description?: React.ReactNode;
|
|
51
|
+
/** Atajo: acciones del bloque. Equivale a <SectionHeaderActions>. */
|
|
52
|
+
actions?: React.ReactNode;
|
|
53
|
+
/** Atajo: icono (svg) en una baldosa. Equivale a <SectionHeaderIcon>. */
|
|
54
|
+
icon?: React.ReactNode;
|
|
55
|
+
/** Tono de la baldosa del icono. */
|
|
56
|
+
iconTone?: React.ComponentProps<typeof IconTile>["tone"];
|
|
57
|
+
};
|
|
58
|
+
declare function SectionHeader({ title, description, actions, icon, iconTone, className, children, ...props }: SectionHeaderProps): React.JSX.Element;
|
|
17
59
|
declare function SectionHeaderIcon({ className, size, ...props }: React.ComponentProps<typeof IconTile>): React.JSX.Element;
|
|
18
60
|
declare function SectionHeaderTitle({ className, ...props }: React.ComponentProps<"h2">): React.JSX.Element;
|
|
19
61
|
declare function SectionHeaderDescription({ className, ...props }: React.ComponentProps<"p">): React.JSX.Element;
|
|
20
62
|
declare function SectionHeaderActions({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
21
63
|
|
|
22
|
-
export { PageHeader, PageHeaderActions, PageHeaderBreadcrumb, PageHeaderDescription, PageHeaderNotice, type PageHeaderPreset, PageHeaderTitle, SectionHeader, SectionHeaderActions, SectionHeaderDescription, SectionHeaderIcon, SectionHeaderTitle };
|
|
64
|
+
export { PageHeader, PageHeaderActions, PageHeaderBreadcrumb, PageHeaderDescription, PageHeaderNotice, type PageHeaderPreset, type PageHeaderProps, PageHeaderTitle, SectionHeader, SectionHeaderActions, SectionHeaderDescription, SectionHeaderIcon, type SectionHeaderProps, SectionHeaderTitle };
|
package/dist/ui/page-header.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { jsx } from "react/jsx-runtime";
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { cn } from "../lib/utils.js";
|
|
3
3
|
import { IconTile } from "./icon-tile.js";
|
|
4
4
|
const HEADER_PRESETS = {
|
|
@@ -6,12 +6,8 @@ const HEADER_PRESETS = {
|
|
|
6
6
|
compact: "[--ds-page-title-size:var(--ds-page-title-size-compact)] [--ds-page-title-size-wide:var(--ds-page-title-size-compact-wide)] mb-(--ds-section-gap)",
|
|
7
7
|
canvas: "max-w-none"
|
|
8
8
|
};
|
|
9
|
-
function PageHeader({
|
|
10
|
-
|
|
11
|
-
className,
|
|
12
|
-
...props
|
|
13
|
-
}) {
|
|
14
|
-
return /* @__PURE__ */ jsx(
|
|
9
|
+
function PageHeader({ preset = "page", title, description, actions, className, children, ...props }) {
|
|
10
|
+
return /* @__PURE__ */ jsxs(
|
|
15
11
|
"header",
|
|
16
12
|
{
|
|
17
13
|
"data-slot": "page-header",
|
|
@@ -21,7 +17,13 @@ function PageHeader({
|
|
|
21
17
|
HEADER_PRESETS[preset],
|
|
22
18
|
className
|
|
23
19
|
),
|
|
24
|
-
...props
|
|
20
|
+
...props,
|
|
21
|
+
children: [
|
|
22
|
+
title != null && /* @__PURE__ */ jsx(PageHeaderTitle, { children: title }),
|
|
23
|
+
description != null && /* @__PURE__ */ jsx(PageHeaderDescription, { children: description }),
|
|
24
|
+
actions != null && /* @__PURE__ */ jsx(PageHeaderActions, { children: actions }),
|
|
25
|
+
children
|
|
26
|
+
]
|
|
25
27
|
}
|
|
26
28
|
);
|
|
27
29
|
}
|
|
@@ -74,8 +76,8 @@ function PageHeaderNotice({ className, ...props }) {
|
|
|
74
76
|
}
|
|
75
77
|
);
|
|
76
78
|
}
|
|
77
|
-
function SectionHeader({ className, ...props }) {
|
|
78
|
-
return /* @__PURE__ */
|
|
79
|
+
function SectionHeader({ title, description, actions, icon, iconTone, className, children, ...props }) {
|
|
80
|
+
return /* @__PURE__ */ jsxs(
|
|
79
81
|
"div",
|
|
80
82
|
{
|
|
81
83
|
"data-slot": "section-header",
|
|
@@ -83,7 +85,14 @@ function SectionHeader({ className, ...props }) {
|
|
|
83
85
|
"group/section-header @container/section-header mb-(--ds-section-gap) grid grid-cols-[minmax(0,1fr)_auto] items-center gap-x-3 gap-y-0 [grid-template-areas:'title_actions'_'description_actions'] has-data-[slot=section-header-icon]:grid-cols-[auto_minmax(0,1fr)_auto] has-data-[slot=section-header-icon]:[grid-template-areas:'icon_title_actions'_'icon_description_actions']",
|
|
84
86
|
className
|
|
85
87
|
),
|
|
86
|
-
...props
|
|
88
|
+
...props,
|
|
89
|
+
children: [
|
|
90
|
+
icon != null && /* @__PURE__ */ jsx(SectionHeaderIcon, { tone: iconTone, children: icon }),
|
|
91
|
+
title != null && /* @__PURE__ */ jsx(SectionHeaderTitle, { children: title }),
|
|
92
|
+
description != null && /* @__PURE__ */ jsx(SectionHeaderDescription, { children: description }),
|
|
93
|
+
actions != null && /* @__PURE__ */ jsx(SectionHeaderActions, { children: actions }),
|
|
94
|
+
children
|
|
95
|
+
]
|
|
87
96
|
}
|
|
88
97
|
);
|
|
89
98
|
}
|
package/dist/ui/page-loader.d.ts
CHANGED
|
@@ -1,5 +1,22 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
|
|
3
|
+
/**
|
|
4
|
+
* @group motion
|
|
5
|
+
* @summary Indicador de carga con intención: arranque de la app (`splash`), cambio de ruta (`route`), una región (`section`) o proceso sobre contenido (`overlay`); no imita el contenido.
|
|
6
|
+
* @see loading-state — esqueleto con la forma del contenido que carga
|
|
7
|
+
* @see spinner — carga pequeña dentro de un botón o una línea
|
|
8
|
+
* @see task-loader — tarea larga con ilustración
|
|
9
|
+
* @example Una región que carga
|
|
10
|
+
* <PageLoader preset="section" message={t("loadingData")} />
|
|
11
|
+
* @example Arranque de la app con marca y mensajes
|
|
12
|
+
* <PageLoader preset="splash" mark={<Logo />} messages={[t("connecting"), t("preparing")]} />
|
|
13
|
+
* @example Procesando sobre contenido
|
|
14
|
+
* <div className="relative">
|
|
15
|
+
* <InvoiceList />
|
|
16
|
+
* <PageLoader preset="overlay" />
|
|
17
|
+
* </div>
|
|
18
|
+
*/
|
|
19
|
+
|
|
3
20
|
type PageLoaderPreset = "splash" | "route" | "section" | "overlay";
|
|
4
21
|
type PageLoaderIndicator = "orbit" | "pulse" | "bars";
|
|
5
22
|
declare function PageLoader({ preset, indicator, message, messages, interval, value, mark, delay, className, }: {
|
package/dist/ui/page-shell.d.ts
CHANGED
|
@@ -1,5 +1,22 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
|
|
3
|
+
/**
|
|
4
|
+
* @group navigation
|
|
5
|
+
* @summary Contenedor del contenido de cada vista que fija ancho y separación: `content` para listas y paneles, `detail` para una entidad, `canvas` para lienzos a todo el ancho.
|
|
6
|
+
* @see page-header — cabecera de la vista, primer hijo del PageShell
|
|
7
|
+
* @see app-bar — barra superior de la app, fuera del PageShell
|
|
8
|
+
* @example Vista de lista (preset content)
|
|
9
|
+
* <PageShell preset="content">
|
|
10
|
+
* <PageHeader title={t("invoices.title")} actions={<Button>Nueva factura</Button>} />
|
|
11
|
+
* <InvoiceTable />
|
|
12
|
+
* </PageShell>
|
|
13
|
+
* @example Detalle de una entidad
|
|
14
|
+
* <PageShell preset="detail">
|
|
15
|
+
* <PageHeader title={client.name} />
|
|
16
|
+
* <ClientForm />
|
|
17
|
+
* </PageShell>
|
|
18
|
+
*/
|
|
19
|
+
|
|
3
20
|
type PageShellPreset = "content" | "detail" | "canvas";
|
|
4
21
|
declare function PageShell({ preset, className, ...props }: React.ComponentProps<"main"> & {
|
|
5
22
|
preset?: PageShellPreset;
|
package/dist/ui/pagination.d.ts
CHANGED
|
@@ -4,6 +4,26 @@ import 'class-variance-authority/types';
|
|
|
4
4
|
import '@base-ui/react/use-render';
|
|
5
5
|
import 'class-variance-authority';
|
|
6
6
|
|
|
7
|
+
/**
|
|
8
|
+
* @group navigation
|
|
9
|
+
* @summary Paginación por números para recorrer una lista o tabla larga página a página, con enlaces reales (href) para que cada página tenga su URL.
|
|
10
|
+
* @see load-more — cargar más resultados al final de la lista, sin páginas numeradas
|
|
11
|
+
* @see data-table — tabla con su propia paginación, orden y filtros
|
|
12
|
+
* @see step-dots — indicador de paso, no navegación entre páginas
|
|
13
|
+
* @example Páginas con anterior y siguiente
|
|
14
|
+
* <Pagination>
|
|
15
|
+
* <PaginationContent>
|
|
16
|
+
* <PaginationItem><PaginationPrevious href="?page=1" /></PaginationItem>
|
|
17
|
+
* <PaginationItem><PaginationLink href="?page=1">1</PaginationLink></PaginationItem>
|
|
18
|
+
* <PaginationItem><PaginationLink href="?page=2" isActive>2</PaginationLink></PaginationItem>
|
|
19
|
+
* <PaginationItem><PaginationEllipsis /></PaginationItem>
|
|
20
|
+
* <PaginationItem><PaginationNext href="?page=3" /></PaginationItem>
|
|
21
|
+
* </PaginationContent>
|
|
22
|
+
* </Pagination>
|
|
23
|
+
* @note Marca la página actual con `isActive` (pone aria-current); «Anterior» y «Siguiente» salen del idioma activo y `text` los sobrescribe.
|
|
24
|
+
* @note Para un listado que crece al final (feed), usa LoadMore en vez de páginas.
|
|
25
|
+
*/
|
|
26
|
+
|
|
7
27
|
declare function Pagination({ className, ...props }: React.ComponentProps<"nav">): React.JSX.Element;
|
|
8
28
|
declare function PaginationContent({ className, ...props }: React.ComponentProps<"ul">): React.JSX.Element;
|
|
9
29
|
declare function PaginationItem({ ...props }: React.ComponentProps<"li">): React.JSX.Element;
|
package/dist/ui/pagination.js
CHANGED
|
@@ -73,7 +73,7 @@ function PaginationPrevious({
|
|
|
73
73
|
className: cn("ps-2", className),
|
|
74
74
|
...props,
|
|
75
75
|
children: [
|
|
76
|
-
/* @__PURE__ */ jsx(ChevronLeftIcon, { "data-icon": "inline-start" }),
|
|
76
|
+
/* @__PURE__ */ jsx(ChevronLeftIcon, { "data-icon": "inline-start", className: "rtl:rotate-180" }),
|
|
77
77
|
/* @__PURE__ */ jsx("span", { className: "hidden sm:block", children: text ?? t.paginationPrevious })
|
|
78
78
|
]
|
|
79
79
|
}
|
|
@@ -95,7 +95,7 @@ function PaginationNext({
|
|
|
95
95
|
...props,
|
|
96
96
|
children: [
|
|
97
97
|
/* @__PURE__ */ jsx("span", { className: "hidden sm:block", children: text ?? t.paginationNext }),
|
|
98
|
-
/* @__PURE__ */ jsx(ChevronRightIcon, { "data-icon": "inline-end" })
|
|
98
|
+
/* @__PURE__ */ jsx(ChevronRightIcon, { "data-icon": "inline-end", className: "rtl:rotate-180" })
|
|
99
99
|
]
|
|
100
100
|
}
|
|
101
101
|
);
|
package/dist/ui/panel.d.ts
CHANGED
|
@@ -5,7 +5,7 @@ import { VariantProps } from 'class-variance-authority';
|
|
|
5
5
|
|
|
6
6
|
declare const panelVariants: (props?: ({
|
|
7
7
|
variant?: "default" | "outline" | "ghost" | "glass" | "muted" | null | undefined;
|
|
8
|
-
size?: "sm" | "
|
|
8
|
+
size?: "sm" | "md" | "lg" | null | undefined;
|
|
9
9
|
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
10
10
|
declare function Panel({ className, variant, size, render, ...props }: useRender.ComponentProps<"div"> & VariantProps<typeof panelVariants>): React.ReactElement<unknown, string | React.JSXElementConstructor<any>>;
|
|
11
11
|
|
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
|
|
3
|
+
/**
|
|
4
|
+
* @group forms
|
|
5
|
+
* @summary Medidor de fuerza de una contraseña en segmentos (débil, media, fuerte) bajo el campo al crearla o cambiarla.
|
|
6
|
+
* @see password-input — el campo de contraseña
|
|
7
|
+
* @see level-meter — un nivel genérico que no es de contraseña
|
|
8
|
+
* @see progress — avance de una tarea
|
|
9
|
+
* @example Por puntuación
|
|
10
|
+
* <PasswordStrength value={puntuacion} />
|
|
11
|
+
* @example Nivel directo, sin texto
|
|
12
|
+
* <PasswordStrength level="strong" showLabel={false} />
|
|
13
|
+
* @note No calcula la fuerza: la app la mide (longitud, listas de contraseñas filtradas…) y pasa `value` o `level`.
|
|
14
|
+
* @note Solo al crear o cambiar la contraseña, nunca al iniciar sesión.
|
|
15
|
+
*/
|
|
16
|
+
|
|
3
17
|
type StrengthLevel = "weak" | "medium" | "strong";
|
|
4
18
|
declare function PasswordStrength({ value, level, segments, showLabel, className, ...props }: Omit<React.ComponentProps<"div">, "children"> & {
|
|
5
19
|
/** Segmentos llenos (0–segments). */
|
package/dist/ui/popover.d.ts
CHANGED
|
@@ -1,6 +1,38 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { Popover as Popover$1 } from '@base-ui/react/popover';
|
|
3
3
|
|
|
4
|
+
/**
|
|
5
|
+
* @group overlays
|
|
6
|
+
* @summary Panel flotante anclado a un botón con contenido breve e interactivo (un campo, filtros, ajustes de una vista); se abre con clic y no bloquea la página.
|
|
7
|
+
* @see tooltip — solo una etiqueta de texto al pasar el ratón
|
|
8
|
+
* @see hover-card — vista previa no interactiva al pasar sobre un enlace
|
|
9
|
+
* @see dialog — tarea que pide foco total o varios campos
|
|
10
|
+
* @example Pequeño formulario
|
|
11
|
+
* <Popover>
|
|
12
|
+
* <PopoverTrigger render={<Button variant="outline" />}>Invitar</PopoverTrigger>
|
|
13
|
+
* <PopoverContent align="start">
|
|
14
|
+
* <PopoverHeader>
|
|
15
|
+
* <PopoverTitle>Invitar a un compañero</PopoverTitle>
|
|
16
|
+
* <PopoverDescription>Recibirá un correo para unirse.</PopoverDescription>
|
|
17
|
+
* </PopoverHeader>
|
|
18
|
+
* <Input type="email" aria-label={t("invite.email")} />
|
|
19
|
+
* <Button size="sm" onClick={send}>Enviar invitación</Button>
|
|
20
|
+
* </PopoverContent>
|
|
21
|
+
* </Popover>
|
|
22
|
+
* @example Disparador de solo icono, abre a la derecha
|
|
23
|
+
* <Popover>
|
|
24
|
+
* <PopoverTrigger render={<Button size="icon" variant="ghost" aria-label={t("view.settings")} />}>
|
|
25
|
+
* <Settings2Icon />
|
|
26
|
+
* </PopoverTrigger>
|
|
27
|
+
* <PopoverContent side="right">
|
|
28
|
+
* <PopoverHeader>
|
|
29
|
+
* <PopoverTitle>Vista del panel</PopoverTitle>
|
|
30
|
+
* </PopoverHeader>
|
|
31
|
+
* </PopoverContent>
|
|
32
|
+
* </Popover>
|
|
33
|
+
* @note Contenido corto; si crece a varios campos o pide confirmar, pasa a Dialog o Sheet.
|
|
34
|
+
*/
|
|
35
|
+
|
|
4
36
|
declare function Popover({ ...props }: Popover$1.Root.Props): React.JSX.Element;
|
|
5
37
|
declare function PopoverTrigger({ ...props }: Popover$1.Trigger.Props): React.JSX.Element;
|
|
6
38
|
declare function PopoverContent({ className, align, side, sideOffset, ...props }: Popover$1.Popup.Props & Pick<Popover$1.Positioner.Props, "align" | "side" | "sideOffset">): React.JSX.Element;
|
|
@@ -1,6 +1,31 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { DsDataTone } from './legend.js';
|
|
3
3
|
|
|
4
|
+
/**
|
|
5
|
+
* @group data
|
|
6
|
+
* @summary Barra de una parte frente al total o de un reparto en segmentos (ocupación, backlog por estado), accesible como meter. Para uso frente a lo contratado, UsageMeter; para el avance de una tarea, TaskProgress.
|
|
7
|
+
* @see usage-meter — uso frente a un límite contratado, con aviso al 80 %
|
|
8
|
+
* @see task-progress — avance de una tarea con estado (en curso, completada, con error)
|
|
9
|
+
* @see gauge — un valor en anillo o arco con la cifra en el centro
|
|
10
|
+
* @example Parte frente a total
|
|
11
|
+
* <ProportionBar label="Facturación" value={38} max={42} tone="danger" showValue />
|
|
12
|
+
* @example Reparto en segmentos
|
|
13
|
+
* <ProportionBar
|
|
14
|
+
* label="Por estado"
|
|
15
|
+
* max={1240}
|
|
16
|
+
* showValue
|
|
17
|
+
* segments={[
|
|
18
|
+
* { value: 520, tone: "chart-1", label: "Nuevos" },
|
|
19
|
+
* { value: 410, tone: "chart-2", label: "En curso" },
|
|
20
|
+
* { value: 310, tone: "chart-3", label: "Escalados" },
|
|
21
|
+
* ]}
|
|
22
|
+
* />
|
|
23
|
+
* @example Sin dato (rayada, nunca 0)
|
|
24
|
+
* <ProportionBar label="Bajas" max={18} unknown showValue />
|
|
25
|
+
* @note Sin dato es unknown (barra rayada), nunca value={0}. Para un texto propio del valor, formatValue (p. ej. «38 de 42 agentes»).
|
|
26
|
+
* @note Con segments, acompáñala de Legend con los mismos tonos y valores.
|
|
27
|
+
*/
|
|
28
|
+
|
|
4
29
|
interface ProportionSegment {
|
|
5
30
|
value: number;
|
|
6
31
|
tone?: DsDataTone;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { DsQuantityOptions } from '../lib/format.js';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* @group data
|
|
6
|
+
* @summary Cifra con unidad UCUM (bytes, %, horas, días, recuentos) en el idioma activo; un nulo pinta «Sin dato». Para uso frente a un límite, UsageMeter; para una fecha, DateTime.
|
|
7
|
+
* @see usage-meter — uso frente a lo contratado, con barra y aviso
|
|
8
|
+
* @see date-time — fechas y horas (absolutas o «hace 5 minutos»)
|
|
9
|
+
* @see stat — cifra clave destacada con etiqueta y variación
|
|
10
|
+
* @example Bytes, duración y recuento
|
|
11
|
+
* <Quantity value={12_345_678_901} unit="By" />
|
|
12
|
+
* <Quantity value={30} unit="d" unitDisplay="long" />
|
|
13
|
+
* <Quantity value={3} unit="{device}" />
|
|
14
|
+
* @example Memoria en unidades binarias (GiB)
|
|
15
|
+
* <Quantity value={17_179_869_184} unit="By" system="binary" />
|
|
16
|
+
*/
|
|
17
|
+
|
|
18
|
+
type QuantityProps = Omit<React.ComponentProps<"span">, "children"> & Pick<DsQuantityOptions, "system" | "unitDisplay" | "maximumFractionDigits" | "compact"> & {
|
|
19
|
+
value: number | null | undefined;
|
|
20
|
+
/** Unidad UCUM (`By`, `GBy`, `%`, `h`, `{device}`…). Sin ella, número sin unidad. */
|
|
21
|
+
unit?: string;
|
|
22
|
+
};
|
|
23
|
+
declare function Quantity({ value, unit, system, unitDisplay, maximumFractionDigits, compact, className, ...props }: QuantityProps): React.JSX.Element;
|
|
24
|
+
|
|
25
|
+
export { Quantity, type QuantityProps };
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { useDsLocale, useDsMessages } from "../hooks/use-ds-messages.js";
|
|
4
|
+
import { formatQuantity } from "../lib/format.js";
|
|
5
|
+
import { cn } from "../lib/utils.js";
|
|
6
|
+
function Quantity({ value, unit, system, unitDisplay, maximumFractionDigits, compact, className, ...props }) {
|
|
7
|
+
const locale = useDsLocale();
|
|
8
|
+
const t = useDsMessages();
|
|
9
|
+
const text = formatQuantity(value, unit, { locale, system, unitDisplay, maximumFractionDigits, compact });
|
|
10
|
+
return /* @__PURE__ */ jsx(
|
|
11
|
+
"span",
|
|
12
|
+
{
|
|
13
|
+
"data-slot": "quantity",
|
|
14
|
+
"data-state": text == null ? "empty" : "value",
|
|
15
|
+
"data-unit": unit,
|
|
16
|
+
className: cn("tabular-nums", className),
|
|
17
|
+
...props,
|
|
18
|
+
children: text ?? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
19
|
+
/* @__PURE__ */ jsx("span", { "aria-hidden": "true", children: "\u2014" }),
|
|
20
|
+
/* @__PURE__ */ jsx("span", { className: "sr-only", children: t.statNoData })
|
|
21
|
+
] })
|
|
22
|
+
}
|
|
23
|
+
);
|
|
24
|
+
}
|
|
25
|
+
export {
|
|
26
|
+
Quantity
|
|
27
|
+
};
|
|
@@ -5,6 +5,44 @@ import 'class-variance-authority/types';
|
|
|
5
5
|
import '@base-ui/react/use-render';
|
|
6
6
|
import 'class-variance-authority';
|
|
7
7
|
|
|
8
|
+
/**
|
|
9
|
+
* @group forms
|
|
10
|
+
* @summary Cuestionario de varias preguntas con elección única, múltiple o respuesta libre, navegando con Anterior/Siguiente (encuestas, perfil inicial).
|
|
11
|
+
* @see step-flow — un alta o asistente por pasos con campos de formulario
|
|
12
|
+
* @see choice-card — una sola pregunta visual dentro de un formulario
|
|
13
|
+
* @see form-layout — un formulario corriente que se ve entero
|
|
14
|
+
* @example Una pregunta de opción única
|
|
15
|
+
* <Questionnaire onSubmit={enviar}>
|
|
16
|
+
* <QuestionnaireItem name="rol" required>
|
|
17
|
+
* <QuestionnaireTitle>¿Cuál es tu función en el equipo?</QuestionnaireTitle>
|
|
18
|
+
* <QuestionnaireChoices>
|
|
19
|
+
* <QuestionnaireChoice value="ventas">Ventas</QuestionnaireChoice>
|
|
20
|
+
* <QuestionnaireChoice value="soporte">Soporte</QuestionnaireChoice>
|
|
21
|
+
* </QuestionnaireChoices>
|
|
22
|
+
* <QuestionnaireError>Elige una opción para continuar.</QuestionnaireError>
|
|
23
|
+
* </QuestionnaireItem>
|
|
24
|
+
* <QuestionnaireActions>
|
|
25
|
+
* <QuestionnairePrevious>Anterior</QuestionnairePrevious>
|
|
26
|
+
* <QuestionnaireNext>Siguiente</QuestionnaireNext>
|
|
27
|
+
* <QuestionnaireSubmit>Enviar</QuestionnaireSubmit>
|
|
28
|
+
* </QuestionnaireActions>
|
|
29
|
+
* </Questionnaire>
|
|
30
|
+
* @example Varias respuestas y texto libre
|
|
31
|
+
* <QuestionnaireItem name="objetivos" multiple>
|
|
32
|
+
* <QuestionnaireTitle>¿Qué quieres conseguir?</QuestionnaireTitle>
|
|
33
|
+
* <QuestionnaireChoices>
|
|
34
|
+
* <QuestionnaireChoice value="captacion">Captar clientes</QuestionnaireChoice>
|
|
35
|
+
* <QuestionnaireChoice value="retencion">Reducir bajas</QuestionnaireChoice>
|
|
36
|
+
* </QuestionnaireChoices>
|
|
37
|
+
* </QuestionnaireItem>
|
|
38
|
+
* <QuestionnaireItem name="empresa">
|
|
39
|
+
* <QuestionnaireTitle>¿Cómo se llama tu empresa?</QuestionnaireTitle>
|
|
40
|
+
* <QuestionnaireInput placeholder="Acme S.L." />
|
|
41
|
+
* </QuestionnaireItem>
|
|
42
|
+
* @note Cada QuestionnaireItem lleva `name`: las respuestas llegan en el FormData de `onSubmit`.
|
|
43
|
+
* @note `multiple` convierte la pregunta en elección múltiple; QuestionnaireInput, en respuesta libre.
|
|
44
|
+
*/
|
|
45
|
+
|
|
8
46
|
declare function Questionnaire({ className, ...props }: React.ComponentProps<typeof Questionnaire$1.Root>): React.JSX.Element;
|
|
9
47
|
declare function QuestionnaireProgress({ className, ...props }: React.ComponentProps<typeof Questionnaire$1.Progress>): React.JSX.Element;
|
|
10
48
|
declare function QuestionnaireItem({ className, ...props }: React.ComponentProps<typeof Questionnaire$1.Item>): React.JSX.Element;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @group agents
|
|
5
|
+
* @summary El razonamiento en texto libre del modelo, plegable: «Pensando…» mientras llega y «Razonado» al terminar; no muestra pasos ni herramientas.
|
|
6
|
+
* @see chain-of-thought — los pasos que dio el agente, uno por línea con resultados
|
|
7
|
+
* @see tool-call — una llamada concreta a una herramienta con su entrada y salida
|
|
8
|
+
* @see agent-events — la traza completa con tiempos (pensar, herramientas, traspasos)
|
|
9
|
+
* @example Mientras el modelo piensa
|
|
10
|
+
* <Reasoning streaming={isThinking}>{thoughts}</Reasoning>
|
|
11
|
+
* @example Con Markdown y título propio
|
|
12
|
+
* <Reasoning streaming={isThinking} title="Cómo lo he calculado">
|
|
13
|
+
* <Markdown streaming={isThinking}>{thoughts}</Markdown>
|
|
14
|
+
* </Reasoning>
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
declare function Reasoning({ streaming, title, defaultOpen, onOpenChange, className, children, ...props }: Omit<React.ComponentProps<"div">, "title"> & {
|
|
18
|
+
streaming?: boolean;
|
|
19
|
+
title?: React.ReactNode;
|
|
20
|
+
defaultOpen?: boolean;
|
|
21
|
+
onOpenChange?: (open: boolean) => void;
|
|
22
|
+
}): React.JSX.Element;
|
|
23
|
+
|
|
24
|
+
export { Reasoning };
|