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,169 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { XIcon } from "lucide-react";
|
|
4
|
+
import * as React from "react";
|
|
5
|
+
import { useDsMessages } from "../hooks/use-ds-messages.js";
|
|
6
|
+
import { cn } from "../lib/utils.js";
|
|
7
|
+
import { Button } from "./button.js";
|
|
8
|
+
function TagInput({
|
|
9
|
+
value: valueProp,
|
|
10
|
+
defaultValue = [],
|
|
11
|
+
onValueChange,
|
|
12
|
+
separators = [","],
|
|
13
|
+
max,
|
|
14
|
+
validate,
|
|
15
|
+
allowDuplicates = false,
|
|
16
|
+
addOnBlur = true,
|
|
17
|
+
name,
|
|
18
|
+
disabled,
|
|
19
|
+
className,
|
|
20
|
+
inputClassName,
|
|
21
|
+
placeholder,
|
|
22
|
+
onKeyDown,
|
|
23
|
+
onBlur,
|
|
24
|
+
onPaste,
|
|
25
|
+
"aria-invalid": ariaInvalid,
|
|
26
|
+
...props
|
|
27
|
+
}) {
|
|
28
|
+
const t = useDsMessages();
|
|
29
|
+
const [inner, setInner] = React.useState(defaultValue);
|
|
30
|
+
const tags = valueProp ?? inner;
|
|
31
|
+
const [draft, setDraft] = React.useState("");
|
|
32
|
+
const [rejected, setRejected] = React.useState(false);
|
|
33
|
+
const inputRef = React.useRef(null);
|
|
34
|
+
const full = max != null && tags.length >= max;
|
|
35
|
+
const commit = (next) => {
|
|
36
|
+
if (valueProp === void 0) setInner(next);
|
|
37
|
+
onValueChange?.(next);
|
|
38
|
+
};
|
|
39
|
+
const add = (raw) => {
|
|
40
|
+
const next = [...tags];
|
|
41
|
+
const left = [];
|
|
42
|
+
for (const r of raw) {
|
|
43
|
+
const tag = r.trim();
|
|
44
|
+
if (!tag) continue;
|
|
45
|
+
const dup = !allowDuplicates && next.some((x) => x.toLowerCase() === tag.toLowerCase());
|
|
46
|
+
if (dup) continue;
|
|
47
|
+
if (max != null && next.length >= max || validate && !validate(tag)) {
|
|
48
|
+
left.push(tag);
|
|
49
|
+
continue;
|
|
50
|
+
}
|
|
51
|
+
next.push(tag);
|
|
52
|
+
}
|
|
53
|
+
if (next.length !== tags.length) commit(next);
|
|
54
|
+
return left;
|
|
55
|
+
};
|
|
56
|
+
const flush = () => {
|
|
57
|
+
if (!draft.trim()) return;
|
|
58
|
+
const left = add([draft]);
|
|
59
|
+
setRejected(left.length > 0);
|
|
60
|
+
setDraft(left.join(" "));
|
|
61
|
+
};
|
|
62
|
+
const remove = (i) => {
|
|
63
|
+
commit(tags.filter((_, j) => j !== i));
|
|
64
|
+
inputRef.current?.focus();
|
|
65
|
+
};
|
|
66
|
+
const splitter = new RegExp(`[${separators.map((s) => s.replace(/[\\\]^-]/g, "\\$&")).join("")}\\n]`);
|
|
67
|
+
return /* @__PURE__ */ jsxs(
|
|
68
|
+
"div",
|
|
69
|
+
{
|
|
70
|
+
"data-slot": "tag-input",
|
|
71
|
+
"data-disabled": disabled || void 0,
|
|
72
|
+
"data-full": full || void 0,
|
|
73
|
+
className: cn(
|
|
74
|
+
"flex min-h-(--ds-control-h-md) w-full min-w-0 cursor-text flex-wrap items-center gap-1.5 rounded-control border border-(--ds-field-border) bg-(--ds-field-bg) bg-clip-padding px-(--ds-field-px) py-1.5 text-sm transition-colors duration-(--ds-motion-snap) focus-within:border-ring focus-within:ring-(length:--ds-ring-width) focus-within:ring-(--ds-ring-color) has-aria-invalid:border-(--ds-invalid-border) has-aria-invalid:ring-(length:--ds-ring-width) has-aria-invalid:ring-(--ds-invalid-ring) has-data-[slot=tag-input-tag]:ps-1.5 data-disabled:pointer-events-none data-disabled:cursor-not-allowed data-disabled:opacity-(--ds-disabled-opacity)",
|
|
75
|
+
className
|
|
76
|
+
),
|
|
77
|
+
onMouseDown: (e) => {
|
|
78
|
+
if (e.target === e.currentTarget) {
|
|
79
|
+
e.preventDefault();
|
|
80
|
+
inputRef.current?.focus();
|
|
81
|
+
}
|
|
82
|
+
},
|
|
83
|
+
children: [
|
|
84
|
+
tags.map((tag, i) => /* @__PURE__ */ jsxs(
|
|
85
|
+
"span",
|
|
86
|
+
{
|
|
87
|
+
"data-slot": "tag-input-tag",
|
|
88
|
+
className: "flex h-(--ds-chip-h) max-w-full min-w-0 items-center gap-1 rounded-control bg-muted-foreground/10 ps-2 text-xs font-(--ds-medium-weight) text-foreground",
|
|
89
|
+
children: [
|
|
90
|
+
/* @__PURE__ */ jsx("span", { className: "truncate", children: tag }),
|
|
91
|
+
/* @__PURE__ */ jsx(
|
|
92
|
+
Button,
|
|
93
|
+
{
|
|
94
|
+
type: "button",
|
|
95
|
+
variant: "ghost",
|
|
96
|
+
size: "icon-xs",
|
|
97
|
+
"data-slot": "tag-input-remove",
|
|
98
|
+
className: "-ms-1 opacity-50 hover:opacity-100",
|
|
99
|
+
disabled,
|
|
100
|
+
"aria-label": t.tagRemove.replace("{name}", tag),
|
|
101
|
+
onClick: () => remove(i),
|
|
102
|
+
children: /* @__PURE__ */ jsx(XIcon, { className: "pointer-events-none" })
|
|
103
|
+
}
|
|
104
|
+
),
|
|
105
|
+
name ? /* @__PURE__ */ jsx("input", { type: "hidden", name, value: tag }) : null
|
|
106
|
+
]
|
|
107
|
+
},
|
|
108
|
+
`${tag}-${i}`
|
|
109
|
+
)),
|
|
110
|
+
/* @__PURE__ */ jsx(
|
|
111
|
+
"input",
|
|
112
|
+
{
|
|
113
|
+
ref: inputRef,
|
|
114
|
+
"data-slot": "tag-input-field",
|
|
115
|
+
className: cn("min-w-16 flex-1 bg-transparent outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed", inputClassName),
|
|
116
|
+
value: draft,
|
|
117
|
+
disabled,
|
|
118
|
+
readOnly: full,
|
|
119
|
+
placeholder: full ? void 0 : placeholder,
|
|
120
|
+
"aria-label": props["aria-label"] ?? (props.id || props["aria-labelledby"] ? void 0 : t.tagAdd),
|
|
121
|
+
"aria-invalid": ariaInvalid ?? (rejected || void 0),
|
|
122
|
+
onChange: (e) => {
|
|
123
|
+
setRejected(false);
|
|
124
|
+
const v = e.target.value;
|
|
125
|
+
if (splitter.test(v)) {
|
|
126
|
+
const parts = v.split(splitter);
|
|
127
|
+
const rest = parts.pop() ?? "";
|
|
128
|
+
const left = add(parts);
|
|
129
|
+
setRejected(left.length > 0);
|
|
130
|
+
setDraft([...left, rest].filter(Boolean).join(" "));
|
|
131
|
+
} else setDraft(v);
|
|
132
|
+
},
|
|
133
|
+
onKeyDown: (e) => {
|
|
134
|
+
onKeyDown?.(e);
|
|
135
|
+
if (e.defaultPrevented || e.nativeEvent.isComposing) return;
|
|
136
|
+
if (e.key === "Enter") {
|
|
137
|
+
if (draft.trim()) {
|
|
138
|
+
e.preventDefault();
|
|
139
|
+
flush();
|
|
140
|
+
}
|
|
141
|
+
} else if (e.key === "Backspace" && draft === "" && tags.length > 0) {
|
|
142
|
+
e.preventDefault();
|
|
143
|
+
commit(tags.slice(0, -1));
|
|
144
|
+
}
|
|
145
|
+
},
|
|
146
|
+
onPaste: (e) => {
|
|
147
|
+
onPaste?.(e);
|
|
148
|
+
if (e.defaultPrevented) return;
|
|
149
|
+
const text = e.clipboardData.getData("text");
|
|
150
|
+
if (!splitter.test(text)) return;
|
|
151
|
+
e.preventDefault();
|
|
152
|
+
const left = add(text.split(splitter));
|
|
153
|
+
setRejected(left.length > 0);
|
|
154
|
+
setDraft(left.join(" "));
|
|
155
|
+
},
|
|
156
|
+
onBlur: (e) => {
|
|
157
|
+
onBlur?.(e);
|
|
158
|
+
if (addOnBlur) flush();
|
|
159
|
+
},
|
|
160
|
+
...props
|
|
161
|
+
}
|
|
162
|
+
)
|
|
163
|
+
]
|
|
164
|
+
}
|
|
165
|
+
);
|
|
166
|
+
}
|
|
167
|
+
export {
|
|
168
|
+
TagInput
|
|
169
|
+
};
|
package/dist/ui/task-loader.d.ts
CHANGED
|
@@ -1,5 +1,20 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
|
|
3
|
+
/**
|
|
4
|
+
* @group feedback
|
|
5
|
+
* @summary Carga ilustrada de una tarea larga (analizar el correo, escanear dispositivos): ilustración, barra fina y brillo al terminar; con `value` muestra avance, sin él es indeterminada.
|
|
6
|
+
* @see task-progress — avance de un proceso con etiqueta, contador y estado, sin ilustración
|
|
7
|
+
* @see progress — barra de avance simple dentro de un formulario o lista
|
|
8
|
+
* @see page-loader — carga de una ruta o de toda la app
|
|
9
|
+
* @example Con avance conocido
|
|
10
|
+
* <TaskLoader icon={<MailIllustration />} value={40} label="Analizando el correo" />
|
|
11
|
+
* @example Indeterminado
|
|
12
|
+
* <TaskLoader icon={<MailIllustration />} label="Analizando…" />
|
|
13
|
+
* @example Terminado
|
|
14
|
+
* <TaskLoader icon={<CheckIllustration />} state="done" label="Análisis completado" />
|
|
15
|
+
* @note La ilustración la pone la app y es decorativa; `label` describe el estado para lectores de pantalla y cambia al terminar.
|
|
16
|
+
*/
|
|
17
|
+
|
|
3
18
|
type TaskLoaderState = "running" | "done";
|
|
4
19
|
declare function TaskLoader({ icon, value, state, label, className, ...props }: Omit<React.ComponentProps<"div">, "children"> & {
|
|
5
20
|
/** Ilustración (decorativa). */
|
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
|
|
3
|
+
/**
|
|
4
|
+
* @group data
|
|
5
|
+
* @summary Avance de una tarea o proceso con su estado (sin empezar, en curso, completado, con error y su motivo visible). Para uso frente a lo contratado, UsageMeter; para pasos de un asistente, StepDots.
|
|
6
|
+
* @see progress — barra de progreso básica, sin estado ni texto propio
|
|
7
|
+
* @see task-loader — espera de un proceso largo con sus pasos
|
|
8
|
+
* @see usage-meter — uso frente a un límite contratado (no es un avance)
|
|
9
|
+
* @example Por recuento
|
|
10
|
+
* <TaskProgress label="Análisis de dispositivos" current={3} total={5} />
|
|
11
|
+
* @example Con error y su motivo
|
|
12
|
+
* <TaskProgress label="Sincronización" value={70} state="error" error="Sin conexión con el servidor" />
|
|
13
|
+
* @note value es un porcentaje 0–100, o current/total para un recuento; sin state, el estado se deduce del valor (0 sin empezar, 100 completado).
|
|
14
|
+
* @note Un fallo va con state="error" y error con el motivo en texto (se anuncia por aria-describedby), no solo en color.
|
|
15
|
+
*/
|
|
16
|
+
|
|
3
17
|
type TaskState = "idle" | "running" | "done" | "error";
|
|
4
18
|
declare function TaskProgress({ label, value, current, total, state, error, counter, className, ...props }: Omit<React.ComponentProps<"div">, "children"> & {
|
|
5
19
|
label?: React.ReactNode;
|
package/dist/ui/textarea.d.ts
CHANGED
|
@@ -1,11 +1,32 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
|
|
3
|
+
/**
|
|
4
|
+
* @group forms
|
|
5
|
+
* @summary Campo de texto de varias líneas para comentarios, notas o descripciones sin formato.
|
|
6
|
+
* @see input — texto de una línea
|
|
7
|
+
* @see instruction-editor — texto con formato (Markdown), prompts o documentos
|
|
8
|
+
* @see chat-composer — escribir mensajes en un chat
|
|
9
|
+
* @example Con etiqueta y ayuda
|
|
10
|
+
* <Field>
|
|
11
|
+
* <FieldLabel htmlFor="notes">Notas al pie</FieldLabel>
|
|
12
|
+
* <Textarea id="notes" placeholder="Condiciones de pago, IBAN…" />
|
|
13
|
+
* <FieldDescription>Máximo 300 caracteres.</FieldDescription>
|
|
14
|
+
* </Field>
|
|
15
|
+
* @example Que crezca con el texto
|
|
16
|
+
* <Textarea autoGrow placeholder="Describe la incidencia" />
|
|
17
|
+
* @note `autoGrow`: crece con lo escrito hasta --ds-textarea-max-h y después desplaza (CSS `field-sizing`; en navegadores sin soporte se queda con su alto).
|
|
18
|
+
* @note Con límite de caracteres, dilo en FieldDescription antes de que la persona escriba.
|
|
19
|
+
*/
|
|
20
|
+
|
|
3
21
|
/**
|
|
4
22
|
* Mismo lenguaje visual que `Input` —borde, fondo, foco, estados aria-invalid—
|
|
5
23
|
* pero con `rounded-md` en vez de `rounded-control shadow-control`: la pildora de `Input` funciona
|
|
6
24
|
* porque su altura fija la acerca a un circulo; en una caja multilinea, mas alta,
|
|
7
25
|
* el mismo radio se ve desproporcionado en las esquinas superiores.
|
|
8
26
|
*/
|
|
9
|
-
declare function Textarea({ className, ...props }: React.ComponentProps<"textarea">
|
|
27
|
+
declare function Textarea({ className, autoGrow, ...props }: React.ComponentProps<"textarea"> & {
|
|
28
|
+
/** Crece con el texto hasta --ds-textarea-max-h (después, desplazamiento). */
|
|
29
|
+
autoGrow?: boolean;
|
|
30
|
+
}): React.JSX.Element;
|
|
10
31
|
|
|
11
32
|
export { Textarea };
|
package/dist/ui/textarea.js
CHANGED
|
@@ -1,12 +1,18 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
2
|
import { cn } from "../lib/utils.js";
|
|
3
|
-
function Textarea({
|
|
3
|
+
function Textarea({
|
|
4
|
+
className,
|
|
5
|
+
autoGrow = false,
|
|
6
|
+
...props
|
|
7
|
+
}) {
|
|
4
8
|
return /* @__PURE__ */ jsx(
|
|
5
9
|
"textarea",
|
|
6
10
|
{
|
|
7
11
|
"data-slot": "textarea",
|
|
12
|
+
"data-auto-grow": autoGrow || void 0,
|
|
8
13
|
className: cn(
|
|
9
14
|
"min-h-16 w-full min-w-0 rounded-field-multiline border border-(--ds-field-border) bg-(--ds-field-bg) px-(--ds-field-px) py-2 text-base transition-colors duration-(--ds-motion-snap) outline-none placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-(length:--ds-ring-width) focus-visible:ring-(--ds-ring-color) disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-(--ds-disabled-opacity) aria-invalid:border-(--ds-invalid-border) aria-invalid:ring-(length:--ds-ring-width) aria-invalid:ring-(--ds-invalid-ring) md:text-sm",
|
|
15
|
+
autoGrow && "max-h-(--ds-textarea-max-h) resize-none overflow-y-auto [field-sizing:content]",
|
|
10
16
|
className
|
|
11
17
|
),
|
|
12
18
|
...props
|
package/dist/ui/timeline.d.ts
CHANGED
|
@@ -1,5 +1,31 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
|
|
3
|
+
/**
|
|
4
|
+
* @group data
|
|
5
|
+
* @summary Historial o actividad en una lista ordenada: eventos con punto o icono, título, hora (absoluta o relativa) y acciones. Para avisos con seguimiento, NotificationCenter (notifications).
|
|
6
|
+
* @see notifications — avisos con estado (nuevo, revisado, resuelto) en la campana
|
|
7
|
+
* @see step-flow — pasos de un proceso que la persona recorre, no eventos pasados
|
|
8
|
+
* @see entity-list — lista de entidades, no de sucesos en el tiempo
|
|
9
|
+
* @example Evento con icono, hora relativa y acciones
|
|
10
|
+
* <Timeline>
|
|
11
|
+
* <TimelineItem tone="danger">
|
|
12
|
+
* <TimelineIndicator>
|
|
13
|
+
* <BellRingIcon />
|
|
14
|
+
* </TimelineIndicator>
|
|
15
|
+
* <TimelineContent>
|
|
16
|
+
* <TimelineTitle>SLA por debajo del 80 %</TimelineTitle>
|
|
17
|
+
* <TimelineTime dateTime={event.createdAt} relative />
|
|
18
|
+
* <TimelineDescription>Cola de soporte técnico, turno de tarde.</TimelineDescription>
|
|
19
|
+
* <TimelineActions>
|
|
20
|
+
* <Button size="sm">Responder</Button>
|
|
21
|
+
* </TimelineActions>
|
|
22
|
+
* </TimelineContent>
|
|
23
|
+
* </TimelineItem>
|
|
24
|
+
* </Timeline>
|
|
25
|
+
* @note Del más reciente al más antiguo; la hora siempre con TimelineTime (relative para lo reciente), nunca escrita a mano.
|
|
26
|
+
* @note tone del vocabulario común (info, success, warning, danger, primary, neutral) para el punto; el significado lo dice el título, no el color.
|
|
27
|
+
*/
|
|
28
|
+
|
|
3
29
|
type TimelineTone = "neutral" | "primary" | "info" | "success" | "warning" | "danger";
|
|
4
30
|
declare function Timeline({ className, ...props }: React.ComponentProps<"ol">): React.JSX.Element;
|
|
5
31
|
declare function TimelineItem({ className, tone, ...props }: React.ComponentProps<"li"> & {
|
|
@@ -5,6 +5,30 @@ import { VariantProps } from 'class-variance-authority';
|
|
|
5
5
|
import { toggleVariants } from './toggle.js';
|
|
6
6
|
import 'class-variance-authority/types';
|
|
7
7
|
|
|
8
|
+
/**
|
|
9
|
+
* @group actions
|
|
10
|
+
* @summary Grupo de botones que quedan pulsados para elegir una opción (vista, periodo) o varias (formato); el estado se ve en el propio botón.
|
|
11
|
+
* @see toggle — un único botón que se activa o desactiva
|
|
12
|
+
* @see radio-group — elegir una opción dentro de un formulario, con etiquetas largas
|
|
13
|
+
* @see tabs — cambiar entre paneles de contenido
|
|
14
|
+
* @example Una opción (vista)
|
|
15
|
+
* <ToggleGroup variant="outline" spacing={0} defaultValue={["grid"]} aria-label="Vista">
|
|
16
|
+
* <ToggleGroupItem value="grid">Cuadrícula</ToggleGroupItem>
|
|
17
|
+
* <ToggleGroupItem value="list">Lista</ToggleGroupItem>
|
|
18
|
+
* </ToggleGroup>
|
|
19
|
+
* @example Varias a la vez, solo icono
|
|
20
|
+
* <ToggleGroup multiple defaultValue={["bold"]} aria-label="Formato">
|
|
21
|
+
* <ToggleGroupItem value="bold" aria-label="Negrita">
|
|
22
|
+
* <BoldIcon />
|
|
23
|
+
* </ToggleGroupItem>
|
|
24
|
+
* <ToggleGroupItem value="italic" aria-label="Cursiva">
|
|
25
|
+
* <ItalicIcon />
|
|
26
|
+
* </ToggleGroupItem>
|
|
27
|
+
* </ToggleGroup>
|
|
28
|
+
* @note `value`/`defaultValue` es siempre una lista, también con una sola opción; `multiple` permite varias.
|
|
29
|
+
* @note Pon `aria-label` al grupo y a cada elemento de solo icono. `spacing={0}` los une en un bloque.
|
|
30
|
+
*/
|
|
31
|
+
|
|
8
32
|
declare function ToggleGroup({ className, variant, size, spacing, orientation, children, ...props }: ToggleGroup$1.Props & VariantProps<typeof toggleVariants> & {
|
|
9
33
|
spacing?: number;
|
|
10
34
|
orientation?: "horizontal" | "vertical";
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @group agents
|
|
5
|
+
* @summary Una llamada a herramienta de un agente: nombre, estado y, plegables, su entrada y su salida; con status="approval" pide a la persona Aprobar o Denegar.
|
|
6
|
+
* @see agent-events — la secuencia completa de lo que hizo el agente
|
|
7
|
+
* @see chain-of-thought — resumen de pasos sin entrada ni salida
|
|
8
|
+
* @see confirm-action — confirmar una acción de la propia persona, no de un agente
|
|
9
|
+
* @example Llamada terminada
|
|
10
|
+
* <ToolCall name="search_docs" status="done" input={{ q: "tarifas 2026" }} output={result} />
|
|
11
|
+
* @example Espera aprobación (human-in-the-loop)
|
|
12
|
+
* <ToolCall name="delete_invoice" status="approval" input={{ id: "F-2026-118" }} onApprove={approve} onDeny={deny} />
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
type ToolCallStatus = "running" | "done" | "error" | "approval";
|
|
16
|
+
declare function ToolCall({ name, status, input, output, defaultOpen, onApprove, onDeny, className, ...props }: Omit<React.ComponentProps<"div">, "children"> & {
|
|
17
|
+
name: string;
|
|
18
|
+
status?: ToolCallStatus;
|
|
19
|
+
input?: unknown;
|
|
20
|
+
output?: unknown;
|
|
21
|
+
defaultOpen?: boolean;
|
|
22
|
+
/** Con `status="approval"`: la persona autoriza o rechaza la ejecución (human-in-the-loop). */
|
|
23
|
+
onApprove?: () => void;
|
|
24
|
+
onDeny?: () => void;
|
|
25
|
+
}): React.JSX.Element;
|
|
26
|
+
|
|
27
|
+
export { ToolCall, type ToolCallStatus };
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import { ChevronDownIcon, WrenchIcon } from "lucide-react";
|
|
5
|
+
import { useDsMessages } from "../hooks/use-ds-messages.js";
|
|
6
|
+
import { cn } from "../lib/utils.js";
|
|
7
|
+
import { Button } from "./button.js";
|
|
8
|
+
import { Collapsible, CollapsibleContent, CollapsibleTrigger } from "./collapsible.js";
|
|
9
|
+
import { Spinner } from "./spinner.js";
|
|
10
|
+
const DOT = {
|
|
11
|
+
approval: "bg-warning",
|
|
12
|
+
running: "bg-info",
|
|
13
|
+
done: "bg-success",
|
|
14
|
+
error: "bg-danger"
|
|
15
|
+
};
|
|
16
|
+
function ToolCall({
|
|
17
|
+
name,
|
|
18
|
+
status = "running",
|
|
19
|
+
input,
|
|
20
|
+
output,
|
|
21
|
+
defaultOpen = false,
|
|
22
|
+
onApprove,
|
|
23
|
+
onDeny,
|
|
24
|
+
className,
|
|
25
|
+
...props
|
|
26
|
+
}) {
|
|
27
|
+
const t = useDsMessages();
|
|
28
|
+
const label = status === "running" ? t.toolRunning : status === "approval" ? t.toolAwaiting : status === "error" ? t.toolError : t.toolDone;
|
|
29
|
+
const show = (v) => React.isValidElement(v) || typeof v === "string" ? v : /* @__PURE__ */ jsx("code", { children: JSON.stringify(v, null, 2) });
|
|
30
|
+
return /* @__PURE__ */ jsx(
|
|
31
|
+
"div",
|
|
32
|
+
{
|
|
33
|
+
"data-slot": "tool-call",
|
|
34
|
+
"data-status": status,
|
|
35
|
+
className: cn("rounded-lg border border-border bg-card text-sm", className),
|
|
36
|
+
...props,
|
|
37
|
+
children: /* @__PURE__ */ jsxs(Collapsible, { defaultOpen: defaultOpen || status === "approval", children: [
|
|
38
|
+
/* @__PURE__ */ jsxs(
|
|
39
|
+
CollapsibleTrigger,
|
|
40
|
+
{
|
|
41
|
+
"data-slot": "tool-call-trigger",
|
|
42
|
+
className: "group flex w-full items-center gap-2 rounded-lg px-3 py-2 text-start outline-none focus-visible:ring-(length:--ds-ring-width) focus-visible:ring-(--ds-ring-color)",
|
|
43
|
+
children: [
|
|
44
|
+
/* @__PURE__ */ jsx(WrenchIcon, { "aria-hidden": true, className: "size-4 text-muted-foreground" }),
|
|
45
|
+
/* @__PURE__ */ jsx("span", { className: cn("flex-1 truncate font-mono", status === "running" && "text-shimmer"), children: name }),
|
|
46
|
+
/* @__PURE__ */ jsxs("span", { className: "flex items-center gap-1.5 text-muted-foreground", children: [
|
|
47
|
+
status === "running" ? /* @__PURE__ */ jsx(Spinner, { "aria-hidden": true, role: "presentation", className: "size-3.5" }) : /* @__PURE__ */ jsx("span", { "aria-hidden": true, className: cn("block size-(--ds-status-dot) rounded-full", DOT[status]) }),
|
|
48
|
+
label
|
|
49
|
+
] }),
|
|
50
|
+
/* @__PURE__ */ jsx(ChevronDownIcon, { "aria-hidden": true, className: "size-4 text-muted-foreground transition-transform group-data-[panel-open]:rotate-180" })
|
|
51
|
+
]
|
|
52
|
+
}
|
|
53
|
+
),
|
|
54
|
+
/* @__PURE__ */ jsxs(CollapsibleContent, { "data-slot": "tool-call-content", className: "flex flex-col gap-2 border-t border-border px-3 py-2", children: [
|
|
55
|
+
input !== void 0 ? /* @__PURE__ */ jsxs("div", { children: [
|
|
56
|
+
/* @__PURE__ */ jsx("div", { className: "text-xs font-(--ds-medium-weight) text-muted-foreground", children: t.toolInput }),
|
|
57
|
+
/* @__PURE__ */ jsx("pre", { className: "overflow-x-auto whitespace-pre-wrap text-xs", children: show(input) })
|
|
58
|
+
] }) : null,
|
|
59
|
+
output !== void 0 ? /* @__PURE__ */ jsxs("div", { children: [
|
|
60
|
+
/* @__PURE__ */ jsx("div", { className: "text-xs font-(--ds-medium-weight) text-muted-foreground", children: t.toolOutput }),
|
|
61
|
+
/* @__PURE__ */ jsx("pre", { className: "overflow-x-auto whitespace-pre-wrap text-xs", children: show(output) })
|
|
62
|
+
] }) : null,
|
|
63
|
+
status === "approval" ? /* @__PURE__ */ jsxs("div", { className: "flex gap-2", children: [
|
|
64
|
+
/* @__PURE__ */ jsx(Button, { size: "sm", onClick: onApprove, children: t.toolApprove }),
|
|
65
|
+
/* @__PURE__ */ jsx(Button, { size: "sm", variant: "outline", onClick: onDeny, children: t.toolDeny })
|
|
66
|
+
] }) : null
|
|
67
|
+
] })
|
|
68
|
+
] })
|
|
69
|
+
}
|
|
70
|
+
);
|
|
71
|
+
}
|
|
72
|
+
export {
|
|
73
|
+
ToolCall
|
|
74
|
+
};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { DsQuantityOptions } from '../lib/format.js';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* @group data
|
|
6
|
+
* @summary Uso frente a lo contratado («12 GB de 50 GB»): avisa al 80 %, es crítico al 100 % e ilimitado va sin barra. Para un objetivo que se quiere alcanzar, StatProgress (en Stat).
|
|
7
|
+
* @see stat — KPI con StatProgress para objetivos (cuota, presupuesto, SLA)
|
|
8
|
+
* @see proportion-bar — parte frente al total o reparto en segmentos, sin semántica de límite
|
|
9
|
+
* @see gauge — un valor en anillo o arco con la cifra en el centro
|
|
10
|
+
* @example Con restante
|
|
11
|
+
* <UsageMeter label="Almacenamiento" value={12} limit={50} unit="GBy" showRemaining />
|
|
12
|
+
* @example Ilimitado y sin medir
|
|
13
|
+
* <UsageMeter label="Copias este mes" value={128} limit={null} />
|
|
14
|
+
* <UsageMeter label="Almacenamiento" value={null} limit={50} unit="GBy" />
|
|
15
|
+
* @example Compacto en una fila de lista
|
|
16
|
+
* <UsageMeter label="Ana" value={3.2} limit={10} unit="GBy" size="compact" />
|
|
17
|
+
*/
|
|
18
|
+
|
|
19
|
+
type UsageState = "normal" | "warning" | "critical" | "unlimited" | "empty";
|
|
20
|
+
type UsageMeterProps = Omit<React.ComponentProps<"div">, "children"> & Pick<DsQuantityOptions, "system" | "maximumFractionDigits"> & {
|
|
21
|
+
/** Qué se mide («Almacenamiento»). Lo pone la app. */
|
|
22
|
+
label?: React.ReactNode;
|
|
23
|
+
/** Uso actual. null = aún sin medir (no es cero). */
|
|
24
|
+
value: number | null | undefined;
|
|
25
|
+
/** Límite contratado, en la misma unidad. null o undefined = ilimitado. */
|
|
26
|
+
limit?: number | null;
|
|
27
|
+
/** Unidad UCUM de value y limit (`GBy`, `By`, `{device}`, `h`…). */
|
|
28
|
+
unit?: string;
|
|
29
|
+
/** Proporción desde la que avisa (0..1). 0.8 por defecto. */
|
|
30
|
+
warnAt?: number;
|
|
31
|
+
/** Proporción desde la que es crítico (0..1). 1 por defecto. */
|
|
32
|
+
dangerAt?: number;
|
|
33
|
+
/** Añade «Quedan 38 GB» (o «8 GB por encima del límite»). */
|
|
34
|
+
showRemaining?: boolean;
|
|
35
|
+
/** default: etiqueta y cifra encima de la barra · compact: en una línea, para filas de lista. */
|
|
36
|
+
size?: "default" | "compact";
|
|
37
|
+
/** Texto propio en lugar de «12 GB de 50 GB». */
|
|
38
|
+
valueText?: React.ReactNode;
|
|
39
|
+
};
|
|
40
|
+
declare function UsageMeter({ label, value, limit, unit, warnAt, dangerAt, showRemaining, size, valueText, system, maximumFractionDigits, className, ...props }: UsageMeterProps): React.JSX.Element;
|
|
41
|
+
|
|
42
|
+
export { UsageMeter, type UsageMeterProps, type UsageState };
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import { Meter as MeterPrimitive } from "@base-ui/react/meter";
|
|
5
|
+
import { useDsLocale, useDsMessages } from "../hooks/use-ds-messages.js";
|
|
6
|
+
import { dsFormat } from "../lib/i18n.js";
|
|
7
|
+
import { formatQuantity, formatRatio } from "../lib/format.js";
|
|
8
|
+
import { cn } from "../lib/utils.js";
|
|
9
|
+
function UsageMeter({
|
|
10
|
+
label,
|
|
11
|
+
value,
|
|
12
|
+
limit,
|
|
13
|
+
unit,
|
|
14
|
+
warnAt = 0.8,
|
|
15
|
+
dangerAt = 1,
|
|
16
|
+
showRemaining = false,
|
|
17
|
+
size = "default",
|
|
18
|
+
valueText,
|
|
19
|
+
system,
|
|
20
|
+
maximumFractionDigits,
|
|
21
|
+
className,
|
|
22
|
+
...props
|
|
23
|
+
}) {
|
|
24
|
+
const t = useDsMessages();
|
|
25
|
+
const locale = useDsLocale();
|
|
26
|
+
const labelId = React.useId();
|
|
27
|
+
const fmt = (n) => formatQuantity(n, unit, { locale, system, maximumFractionDigits });
|
|
28
|
+
const measured = typeof value === "number" && Number.isFinite(value);
|
|
29
|
+
const bounded = typeof limit === "number" && Number.isFinite(limit) && limit > 0;
|
|
30
|
+
const ratio = measured && bounded ? value / limit : null;
|
|
31
|
+
const state = !measured ? "empty" : !bounded ? "unlimited" : ratio >= dangerAt ? "critical" : ratio >= warnAt ? "warning" : "normal";
|
|
32
|
+
const used = fmt(value);
|
|
33
|
+
const total = bounded ? fmt(limit) : null;
|
|
34
|
+
const main = state === "empty" ? t.statNoData : state === "unlimited" ? dsFormat(t.usageUnlimited, { value: used ?? "" }) : dsFormat(t.usageOf, { value: used ?? "", limit: total ?? "" });
|
|
35
|
+
let extra = null;
|
|
36
|
+
if (showRemaining && measured && bounded) {
|
|
37
|
+
const diff = limit - value;
|
|
38
|
+
extra = diff >= 0 ? dsFormat(t.usageRemaining, { amount: fmt(diff) ?? "" }) : dsFormat(t.usageOver, { amount: fmt(-diff) ?? "" });
|
|
39
|
+
}
|
|
40
|
+
const pct = ratio == null ? null : formatRatio(ratio, { locale });
|
|
41
|
+
const ariaText = [main, pct, extra].filter(Boolean).join(" \xB7 ");
|
|
42
|
+
const fill = state === "critical" ? "bg-(--ds-usage-fill-critical)" : state === "warning" ? "bg-(--ds-usage-fill-warning)" : "bg-(--ds-usage-fill)";
|
|
43
|
+
return /* @__PURE__ */ jsxs(
|
|
44
|
+
"div",
|
|
45
|
+
{
|
|
46
|
+
"data-slot": "usage-meter",
|
|
47
|
+
"data-state": state,
|
|
48
|
+
"data-size": size,
|
|
49
|
+
className: cn(
|
|
50
|
+
"group/usage-meter flex min-w-0 flex-col gap-1.5",
|
|
51
|
+
size === "compact" && "gap-1",
|
|
52
|
+
className
|
|
53
|
+
),
|
|
54
|
+
...props,
|
|
55
|
+
children: [
|
|
56
|
+
/* @__PURE__ */ jsxs("div", { "data-slot": "usage-meter-header", className: "flex min-w-0 flex-wrap items-baseline justify-between gap-x-3 gap-y-0.5", children: [
|
|
57
|
+
label != null && /* @__PURE__ */ jsx("span", { id: labelId, "data-slot": "usage-meter-label", className: "min-w-0 text-sm font-(--ds-label-weight) text-foreground", children: label }),
|
|
58
|
+
/* @__PURE__ */ jsx(
|
|
59
|
+
"span",
|
|
60
|
+
{
|
|
61
|
+
"data-slot": "usage-meter-value",
|
|
62
|
+
"aria-hidden": "true",
|
|
63
|
+
className: cn(
|
|
64
|
+
"text-sm text-muted-foreground tabular-nums",
|
|
65
|
+
state === "critical" && "text-danger",
|
|
66
|
+
size === "compact" && "text-xs"
|
|
67
|
+
),
|
|
68
|
+
children: valueText ?? main
|
|
69
|
+
}
|
|
70
|
+
)
|
|
71
|
+
] }),
|
|
72
|
+
state !== "unlimited" && /* @__PURE__ */ jsx(
|
|
73
|
+
MeterPrimitive.Root,
|
|
74
|
+
{
|
|
75
|
+
value: ratio == null ? 0 : Math.min(1, Math.max(0, ratio)) * 100,
|
|
76
|
+
min: 0,
|
|
77
|
+
max: 100,
|
|
78
|
+
"aria-labelledby": label != null ? labelId : void 0,
|
|
79
|
+
getAriaValueText: () => ariaText,
|
|
80
|
+
"data-slot": "usage-meter-bar",
|
|
81
|
+
children: /* @__PURE__ */ jsx(
|
|
82
|
+
MeterPrimitive.Track,
|
|
83
|
+
{
|
|
84
|
+
"data-slot": "usage-meter-track",
|
|
85
|
+
className: "relative block h-(--ds-usage-h) w-full overflow-hidden rounded-track bg-(--ds-track-bg)",
|
|
86
|
+
children: /* @__PURE__ */ jsx(
|
|
87
|
+
MeterPrimitive.Indicator,
|
|
88
|
+
{
|
|
89
|
+
"data-slot": "usage-meter-indicator",
|
|
90
|
+
className: cn(
|
|
91
|
+
"block h-full rounded-track transition-[width,background-color] duration-(--ds-motion-slow) ease-(--ds-ease-standard) motion-reduce:transition-none",
|
|
92
|
+
fill
|
|
93
|
+
)
|
|
94
|
+
}
|
|
95
|
+
)
|
|
96
|
+
}
|
|
97
|
+
)
|
|
98
|
+
}
|
|
99
|
+
),
|
|
100
|
+
state === "unlimited" && /* @__PURE__ */ jsx("span", { className: "sr-only", children: ariaText }),
|
|
101
|
+
extra && /* @__PURE__ */ jsx(
|
|
102
|
+
"span",
|
|
103
|
+
{
|
|
104
|
+
"data-slot": "usage-meter-remaining",
|
|
105
|
+
"aria-hidden": "true",
|
|
106
|
+
className: cn("text-xs text-muted-foreground tabular-nums", state === "critical" && "text-danger"),
|
|
107
|
+
children: extra
|
|
108
|
+
}
|
|
109
|
+
)
|
|
110
|
+
]
|
|
111
|
+
}
|
|
112
|
+
);
|
|
113
|
+
}
|
|
114
|
+
export {
|
|
115
|
+
UsageMeter
|
|
116
|
+
};
|
package/dist/ui/week-strip.d.ts
CHANGED
|
@@ -1,5 +1,16 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
|
|
3
|
+
/**
|
|
4
|
+
* @group navigation
|
|
5
|
+
* @summary Una semana en una fila para elegir un día cercano (agenda, reservas, llamadas), con flechas para cambiar de semana y un punto en los días con algo.
|
|
6
|
+
* @see calendar — mes completo, fechas lejanas o rangos
|
|
7
|
+
* @see date-picker — campo de formulario para una fecha
|
|
8
|
+
* @example Controlado, con días marcados
|
|
9
|
+
* <WeekStrip value={day} onValueChange={setDay} marked={(d) => hasEvents(d)} />
|
|
10
|
+
* @example Libre, semana desde el domingo
|
|
11
|
+
* <WeekStrip defaultValue={new Date()} weekStartsOn={0} />
|
|
12
|
+
*/
|
|
13
|
+
|
|
3
14
|
declare function WeekStrip({ value, defaultValue, onValueChange, weekStartsOn, marked, className, ...props }: Omit<React.ComponentProps<"div">, "defaultValue" | "onChange"> & {
|
|
4
15
|
value?: Date;
|
|
5
16
|
defaultValue?: Date;
|
package/dist/ui/week-strip.js
CHANGED
|
@@ -49,7 +49,7 @@ function WeekStrip({
|
|
|
49
49
|
className: cn("flex items-center gap-(--ds-week-gap)", className),
|
|
50
50
|
...props,
|
|
51
51
|
children: [
|
|
52
|
-
/* @__PURE__ */ jsx(Button, { variant: "ghost", size: "icon-sm", "aria-label": t.weekPrevious, onClick: () => setShift((s) => s - 1), children: /* @__PURE__ */ jsx(ChevronLeftIcon, {}) }),
|
|
52
|
+
/* @__PURE__ */ jsx(Button, { variant: "ghost", size: "icon-sm", "aria-label": t.weekPrevious, onClick: () => setShift((s) => s - 1), children: /* @__PURE__ */ jsx(ChevronLeftIcon, { className: "rtl:rotate-180" }) }),
|
|
53
53
|
/* @__PURE__ */ jsx("div", { className: "grid flex-1 grid-cols-7 gap-(--ds-week-gap)", children: days.map((d) => {
|
|
54
54
|
const active = sameDay(d, selected);
|
|
55
55
|
return /* @__PURE__ */ jsxs(
|
|
@@ -72,7 +72,7 @@ function WeekStrip({
|
|
|
72
72
|
d.toISOString()
|
|
73
73
|
);
|
|
74
74
|
}) }),
|
|
75
|
-
/* @__PURE__ */ jsx(Button, { variant: "ghost", size: "icon-sm", "aria-label": t.weekNext, onClick: () => setShift((s) => s + 1), children: /* @__PURE__ */ jsx(ChevronRightIcon, {}) })
|
|
75
|
+
/* @__PURE__ */ jsx(Button, { variant: "ghost", size: "icon-sm", "aria-label": t.weekNext, onClick: () => setShift((s) => s + 1), children: /* @__PURE__ */ jsx(ChevronRightIcon, { className: "rtl:rotate-180" }) })
|
|
76
76
|
]
|
|
77
77
|
}
|
|
78
78
|
);
|