orbital-ds 0.48.0 → 0.50.0
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 +13 -4
- package/CHANGELOG.md +31 -0
- package/README.md +1 -1
- package/components.manifest.json +383 -37
- package/dist/auth-form-B1hgbXkI.d.ts +144 -0
- package/dist/hooks/use-ds-messages.d.ts +598 -0
- package/dist/hooks/use-ds-motion.d.ts +17 -0
- package/dist/hooks/use-esc-close-stack.d.ts +3 -0
- package/dist/hooks/use-in-view.d.ts +9 -0
- package/dist/hooks/use-mobile.d.ts +3 -0
- package/dist/hooks/use-simulated-progress.d.ts +11 -0
- package/dist/lib/a2ui-catalog.d.ts +42 -0
- package/dist/lib/a2ui.d.ts +289 -0
- package/dist/lib/ai-events.d.ts +15 -0
- package/dist/lib/auth-better-auth.d.ts +29 -0
- package/dist/lib/auth-flow.d.ts +85 -0
- package/dist/lib/auth-providers.d.ts +194 -0
- package/dist/lib/auth.d.ts +68 -0
- package/dist/lib/brand-allowlist.d.ts +3 -0
- package/dist/lib/brand-allowlist.js +16 -0
- package/dist/lib/brand-runtime.d.ts +52 -0
- package/dist/lib/echarts-presets.d.ts +307 -0
- package/dist/lib/echarts-server.d.ts +15 -0
- package/dist/lib/echarts-setup.d.ts +8 -0
- package/dist/lib/echarts-theme.d.ts +36 -0
- package/dist/lib/format.d.ts +57 -0
- package/dist/lib/header-control.d.ts +4 -0
- package/dist/lib/i18n.d.ts +611 -0
- package/dist/lib/i18n.js +162 -3
- package/dist/lib/image-upload.d.ts +41 -0
- package/dist/lib/locales/de.d.ts +7 -0
- package/dist/lib/locales/de.js +54 -1
- package/dist/lib/locales/fr.d.ts +7 -0
- package/dist/lib/locales/fr.js +54 -1
- package/dist/lib/locales/he.d.ts +7 -0
- package/dist/lib/locales/he.js +54 -1
- package/dist/lib/locales/it.d.ts +7 -0
- package/dist/lib/locales/it.js +54 -1
- package/dist/lib/motion.d.ts +74 -0
- package/dist/lib/presets.d.ts +8 -0
- package/dist/lib/template-syntax.d.ts +22 -0
- package/dist/lib/utils.d.ts +5 -0
- package/dist/motion.css +146 -0
- package/dist/styles.css +1819 -0
- package/dist/themes/chocolate.css +259 -0
- package/dist/themes/chocolate.fonts.css +2 -0
- package/dist/themes/chocolate.guide.md +30 -0
- package/dist/themes/chocolate.meta.json +61 -0
- package/dist/themes/chocolate.scoped.css +259 -0
- package/dist/themes/chocolate.tokens.json +49 -0
- package/dist/themes/fractalia.css +556 -0
- package/dist/themes/fractalia.fonts.css +3 -0
- package/dist/themes/fractalia.guide.md +86 -0
- package/dist/themes/fractalia.meta.json +112 -0
- package/dist/themes/fractalia.scoped.css +556 -0
- package/dist/themes/fractalia.tokens.json +39 -0
- package/dist/themes/friendly.css +375 -0
- package/dist/themes/friendly.fonts.css +2 -0
- package/dist/themes/friendly.guide.md +38 -0
- package/dist/themes/friendly.meta.json +82 -0
- package/dist/themes/friendly.scoped.css +375 -0
- package/dist/themes/friendly.tokens.json +45 -0
- package/dist/themes/lagoon.css +362 -0
- package/dist/themes/lagoon.fonts.css +2 -0
- package/dist/themes/lagoon.guide.md +47 -0
- package/dist/themes/lagoon.meta.json +85 -0
- package/dist/themes/lagoon.scoped.css +362 -0
- package/dist/themes/lagoon.tokens.json +49 -0
- package/dist/themes/liquid.css +510 -0
- package/dist/themes/liquid.fonts.css +7 -0
- package/dist/themes/liquid.guide.md +82 -0
- package/dist/themes/liquid.meta.json +134 -0
- package/dist/themes/liquid.scoped.css +510 -0
- package/dist/themes/liquid.tokens.json +47 -0
- package/dist/themes/matcha.css +259 -0
- package/dist/themes/matcha.fonts.css +2 -0
- package/dist/themes/matcha.guide.md +30 -0
- package/dist/themes/matcha.meta.json +61 -0
- package/dist/themes/matcha.scoped.css +259 -0
- package/dist/themes/matcha.tokens.json +49 -0
- package/dist/themes/qratia.css +264 -0
- package/dist/themes/qratia.fonts.css +2 -0
- package/dist/themes/qratia.guide.md +34 -0
- package/dist/themes/qratia.meta.json +49 -0
- package/dist/themes/qratia.scoped.css +264 -0
- package/dist/themes/qratia.tokens.json +49 -0
- package/dist/themes/stone.css +263 -0
- package/dist/themes/stone.fonts.css +2 -0
- package/dist/themes/stone.guide.md +30 -0
- package/dist/themes/stone.meta.json +47 -0
- package/dist/themes/stone.scoped.css +263 -0
- package/dist/themes/stone.tokens.json +49 -0
- package/dist/themes/tactile.css +591 -0
- package/dist/themes/tactile.fonts.css +3 -0
- package/dist/themes/tactile.guide.md +82 -0
- package/dist/themes/tactile.meta.json +182 -0
- package/dist/themes/tactile.scoped.css +591 -0
- package/dist/themes/tactile.tokens.json +42 -0
- package/dist/themes/twitter.css +364 -0
- package/dist/themes/twitter.fonts.css +6 -0
- package/dist/themes/twitter.guide.md +35 -0
- package/dist/themes/twitter.meta.json +90 -0
- package/dist/themes/twitter.scoped.css +364 -0
- package/dist/themes/twitter.tokens.json +45 -0
- package/dist/themes/y2k.css +259 -0
- package/dist/themes/y2k.fonts.css +2 -0
- package/dist/themes/y2k.guide.md +30 -0
- package/dist/themes/y2k.meta.json +59 -0
- package/dist/themes/y2k.scoped.css +259 -0
- package/dist/themes/y2k.tokens.json +49 -0
- package/dist/themes/zyro.css +442 -0
- package/dist/themes/zyro.fonts.css +2 -0
- package/dist/themes/zyro.guide.md +33 -0
- package/dist/themes/zyro.meta.json +74 -0
- package/dist/themes/zyro.scoped.css +442 -0
- package/dist/themes/zyro.tokens.json +46 -0
- package/dist/ui/a2ui-renderer.d.ts +44 -0
- package/dist/ui/accordion.d.ts +9 -0
- package/dist/ui/agent-events.d.ts +49 -0
- package/dist/ui/ai-tag.d.ts +24 -0
- package/dist/ui/alert-dialog.d.ts +60 -0
- package/dist/ui/alert.d.ts +13 -0
- package/dist/ui/animated-number.d.ts +20 -0
- package/dist/ui/api-key-list.d.ts +40 -0
- package/dist/ui/api-key-list.js +89 -0
- package/dist/ui/app-bar.d.ts +32 -0
- package/dist/ui/aspect-ratio.d.ts +7 -0
- package/dist/ui/attachment.d.ts +26 -0
- package/dist/ui/audit-log.d.ts +53 -0
- package/dist/ui/audit-log.js +102 -0
- package/dist/ui/auth-backdrop.d.ts +37 -0
- package/dist/ui/auth-form.d.ts +4 -0
- package/dist/ui/auth-layout.d.ts +110 -0
- package/dist/ui/auth-parts.d.ts +43 -0
- package/dist/ui/auth-status.d.ts +23 -0
- package/dist/ui/avatar.d.ts +43 -0
- package/dist/ui/ayuda.d.ts +22 -0
- package/dist/ui/badge.d.ts +15 -0
- package/dist/ui/banner.d.ts +14 -0
- package/dist/ui/bottom-nav.d.ts +37 -0
- package/dist/ui/breadcrumb.d.ts +34 -0
- package/dist/ui/bubble.d.ts +19 -0
- package/dist/ui/button-group.d.ts +15 -0
- package/dist/ui/button.d.ts +14 -0
- package/dist/ui/calendar.d.ts +28 -0
- package/dist/ui/card-stack.d.ts +36 -0
- package/dist/ui/card.d.ts +61 -0
- package/dist/ui/carousel.d.ts +68 -0
- package/dist/ui/chain-of-thought.d.ts +34 -0
- package/dist/ui/chart-card.d.ts +46 -0
- package/dist/ui/chat-composer.d.ts +58 -0
- package/dist/ui/checkbox.d.ts +6 -0
- package/dist/ui/choice-card.d.ts +49 -0
- package/dist/ui/code-block.d.ts +29 -0
- package/dist/ui/collapsible.d.ts +8 -0
- package/dist/ui/combobox.d.ts +74 -0
- package/dist/ui/command-palette.d.ts +54 -0
- package/dist/ui/command.d.ts +56 -0
- package/dist/ui/confirm-action.d.ts +48 -0
- package/dist/ui/confirm-dialog.d.ts +44 -0
- package/dist/ui/connected-accounts.d.ts +25 -0
- package/dist/ui/content-card.d.ts +66 -0
- package/dist/ui/context-menu.d.ts +66 -0
- package/dist/ui/conversation-list.d.ts +44 -0
- package/dist/ui/copy-button.d.ts +25 -0
- package/dist/ui/cta-banner.d.ts +30 -0
- package/dist/ui/data-table.d.ts +198 -0
- package/dist/ui/date-picker.d.ts +65 -0
- package/dist/ui/date-time.d.ts +40 -0
- package/dist/ui/description-list.d.ts +49 -0
- package/dist/ui/detail-panel.d.ts +40 -0
- package/dist/ui/dialog.d.ts +54 -0
- package/dist/ui/direction.d.ts +1 -0
- package/dist/ui/dock.d.ts +30 -0
- package/dist/ui/drawer.d.ts +59 -0
- package/dist/ui/dropdown-menu.d.ts +63 -0
- package/dist/ui/dropzone.d.ts +44 -0
- package/dist/ui/echart.d.ts +46 -0
- package/dist/ui/empty-state.d.ts +26 -0
- package/dist/ui/empty.d.ts +15 -0
- package/dist/ui/entity-list.d.ts +57 -0
- package/dist/ui/error-page.d.ts +28 -0
- package/dist/ui/error-state.d.ts +16 -0
- package/dist/ui/eyebrow.d.ts +7 -0
- package/dist/ui/faq.d.ts +34 -0
- package/dist/ui/feature-grid.d.ts +40 -0
- package/dist/ui/field.d.ts +28 -0
- package/dist/ui/file-upload.d.ts +42 -0
- package/dist/ui/filter-bar.d.ts +38 -0
- package/dist/ui/form-layout.d.ts +43 -0
- package/dist/ui/gauge.d.ts +66 -0
- package/dist/ui/generated-image.d.ts +33 -0
- package/dist/ui/generated-table.d.ts +29 -0
- package/dist/ui/heatmap-grid.d.ts +59 -0
- package/dist/ui/hero.d.ts +58 -0
- package/dist/ui/hover-card.d.ts +8 -0
- package/dist/ui/i18n-provider.d.ts +27 -0
- package/dist/ui/icon-tile.d.ts +11 -0
- package/dist/ui/input-group.d.ts +22 -0
- package/dist/ui/input-otp.d.ts +36 -0
- package/dist/ui/input.d.ts +21 -0
- package/dist/ui/instruction-editor.d.ts +81 -0
- package/dist/ui/item.d.ts +26 -0
- package/dist/ui/kbd.d.ts +6 -0
- package/dist/ui/label.d.ts +22 -0
- package/dist/ui/landing-section.d.ts +34 -0
- package/dist/ui/legend.d.ts +57 -0
- package/dist/ui/level-meter.d.ts +28 -0
- package/dist/ui/load-more.d.ts +36 -0
- package/dist/ui/loading-state.d.ts +26 -0
- package/dist/ui/locale-switcher.d.ts +19 -0
- package/dist/ui/markdown.d.ts +29 -0
- package/dist/ui/marker.d.ts +13 -0
- package/dist/ui/media-card.d.ts +29 -0
- package/dist/ui/member-list.d.ts +43 -0
- package/dist/ui/member-list.js +107 -0
- package/dist/ui/menubar.d.ts +70 -0
- package/dist/ui/message-actions.d.ts +21 -0
- package/dist/ui/message-scroller.d.ts +46 -0
- package/dist/ui/message.d.ts +45 -0
- package/dist/ui/mfa-challenge.d.ts +4 -0
- package/dist/ui/mfa-setup.d.ts +29 -0
- package/dist/ui/mosaic.d.ts +38 -0
- package/dist/ui/motion-provider.d.ts +28 -0
- package/dist/ui/native-select.d.ts +32 -0
- package/dist/ui/navigation-menu.d.ts +15 -0
- package/dist/ui/next-step-card.d.ts +55 -0
- package/dist/ui/notice-review.d.ts +64 -0
- package/dist/ui/notifications.d.ts +81 -0
- package/dist/ui/oauth-consent.d.ts +54 -0
- package/dist/ui/onboarding-checklist.d.ts +38 -0
- package/dist/ui/onboarding-checklist.js +132 -0
- package/dist/ui/page-header.d.ts +64 -0
- package/dist/ui/page-loader.d.ts +40 -0
- package/dist/ui/page-shell.d.ts +25 -0
- package/dist/ui/pagination.d.ts +42 -0
- package/dist/ui/panel.d.ts +12 -0
- package/dist/ui/passkey-list.d.ts +17 -0
- package/dist/ui/password-input.d.ts +5 -0
- package/dist/ui/password-strength.d.ts +28 -0
- package/dist/ui/permission-matrix.d.ts +35 -0
- package/dist/ui/permission-matrix.js +89 -0
- package/dist/ui/plan-summary.d.ts +59 -0
- package/dist/ui/plan-summary.js +92 -0
- package/dist/ui/popover.d.ts +44 -0
- package/dist/ui/pricing-table.d.ts +29 -0
- package/dist/ui/progress.d.ts +9 -0
- package/dist/ui/proportion-bar.d.ts +52 -0
- package/dist/ui/quantity.d.ts +25 -0
- package/dist/ui/questionnaire.d.ts +62 -0
- package/dist/ui/radio-group.d.ts +8 -0
- package/dist/ui/reasoning.d.ts +24 -0
- package/dist/ui/resizable.d.ts +10 -0
- package/dist/ui/reveal.d.ts +28 -0
- package/dist/ui/scroll-area.d.ts +7 -0
- package/dist/ui/search-box.d.ts +32 -0
- package/dist/ui/select.d.ts +19 -0
- package/dist/ui/separator.d.ts +6 -0
- package/dist/ui/session-list.d.ts +19 -0
- package/dist/ui/session-timeout.d.ts +13 -0
- package/dist/ui/sheet.d.ts +53 -0
- package/dist/ui/shield.d.ts +35 -0
- package/dist/ui/show-more.d.ts +26 -0
- package/dist/ui/sidebar.d.ts +92 -0
- package/dist/ui/sign-out-dialog.d.ts +17 -0
- package/dist/ui/skeleton.d.ts +10 -0
- package/dist/ui/slider.d.ts +23 -0
- package/dist/ui/sparkline.d.ts +26 -0
- package/dist/ui/spinner.d.ts +5 -0
- package/dist/ui/stat-group.d.ts +40 -0
- package/dist/ui/stat.d.ts +90 -0
- package/dist/ui/status-badge.d.ts +39 -0
- package/dist/ui/status-hero.d.ts +30 -0
- package/dist/ui/step-dots.d.ts +22 -0
- package/dist/ui/step-flow.d.ts +48 -0
- package/dist/ui/step-ring.d.ts +26 -0
- package/dist/ui/stepper.d.ts +20 -0
- package/dist/ui/suggestions.d.ts +17 -0
- package/dist/ui/switch.d.ts +8 -0
- package/dist/ui/table.d.ts +38 -0
- package/dist/ui/tabs.d.ts +14 -0
- package/dist/ui/tag-input.d.ts +21 -0
- package/dist/ui/task-loader.d.ts +29 -0
- package/dist/ui/task-progress.d.ts +32 -0
- package/dist/ui/testimonial.d.ts +37 -0
- package/dist/ui/textarea.d.ts +32 -0
- package/dist/ui/theme-toggle.d.ts +14 -0
- package/dist/ui/timeline.d.ts +55 -0
- package/dist/ui/toast.d.ts +19 -0
- package/dist/ui/toggle-group.d.ts +38 -0
- package/dist/ui/toggle.d.ts +12 -0
- package/dist/ui/tool-call.d.ts +27 -0
- package/dist/ui/tooltip.d.ts +9 -0
- package/dist/ui/upgrade-prompt.d.ts +24 -0
- package/dist/ui/upgrade-prompt.js +85 -0
- package/dist/ui/usage-meter.d.ts +42 -0
- package/dist/ui/week-strip.d.ts +23 -0
- package/dist/ui/workflow-run.d.ts +51 -0
- package/dist/ui/workspace-switcher.d.ts +28 -0
- package/dist/ui/workspace-switcher.js +92 -0
- package/docs/GRAFICOS.md +1 -1
- package/docs/designer/patrones.md +29 -1
- package/manifest/actions.json +1 -1
- package/manifest/agents.json +1 -1
- package/manifest/ai.json +1 -1
- package/manifest/auth.json +1 -1
- package/manifest/chat.json +1 -1
- package/manifest/content.json +1 -1
- package/manifest/data.json +498 -1
- package/manifest/feedback.json +230 -43
- package/manifest/forms.json +1 -1
- package/manifest/motion.json +1 -1
- package/manifest/navigation.json +102 -1
- package/manifest/overlays.json +2 -2
- package/package.json +1 -11
- package/scripts/cli.mjs +63 -5
- package/scripts/doctor.mjs +5 -3
- package/scripts/skill.mjs +85 -0
- package/skill/SKILL.md +5 -2
- package/dist/ui/sonner.js +0 -60
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { CheckIcon, LockIcon, MinusIcon } from "lucide-react";
|
|
4
|
+
import { useDsMessages } from "../hooks/use-ds-messages.js";
|
|
5
|
+
import { dsFormat } from "../lib/i18n.js";
|
|
6
|
+
import { cn } from "../lib/utils.js";
|
|
7
|
+
import { Checkbox } from "./checkbox.js";
|
|
8
|
+
import { Switch } from "./switch.js";
|
|
9
|
+
function toggle(value, role, permission, on) {
|
|
10
|
+
const set = new Set(value[role] ?? []);
|
|
11
|
+
if (on) set.add(permission);
|
|
12
|
+
else set.delete(permission);
|
|
13
|
+
return { ...value, [role]: [...set] };
|
|
14
|
+
}
|
|
15
|
+
function PermissionMatrix({ preset = "roles", roles, groups, value, onChange, lockedRoles = [], role, readOnly, className, ...props }) {
|
|
16
|
+
const t = useDsMessages();
|
|
17
|
+
const editable = !(readOnly ?? preset === "review") && onChange != null;
|
|
18
|
+
const has = (r, p) => (value[r] ?? []).includes(p);
|
|
19
|
+
if (preset === "scopes") {
|
|
20
|
+
const r = roles.find((x) => x.value === role) ?? roles[0];
|
|
21
|
+
if (!r) return null;
|
|
22
|
+
const locked = lockedRoles.includes(r.value);
|
|
23
|
+
return /* @__PURE__ */ jsx("div", { "data-slot": "permission-matrix", "data-preset": preset, className: cn("flex min-w-0 flex-col gap-5", className), ...props, children: groups.map((g) => /* @__PURE__ */ jsxs("fieldset", { "data-slot": "permission-matrix-group", className: "flex min-w-0 flex-col gap-1", children: [
|
|
24
|
+
/* @__PURE__ */ jsx("legend", { className: "mb-1 text-xs font-(--ds-medium-weight) text-muted-foreground", children: g.label }),
|
|
25
|
+
g.permissions.map((p) => {
|
|
26
|
+
const id = `pm-${r.value}-${p.id}`;
|
|
27
|
+
const on = has(r.value, p.id);
|
|
28
|
+
return /* @__PURE__ */ jsxs("div", { "data-slot": "permission-matrix-cell", "data-allowed": on || void 0, className: "flex min-w-0 items-start gap-3 rounded-item py-2", children: [
|
|
29
|
+
/* @__PURE__ */ jsxs("label", { htmlFor: id, className: "flex min-w-0 flex-1 flex-col gap-0.5", children: [
|
|
30
|
+
/* @__PURE__ */ jsx("span", { className: "text-sm font-(--ds-medium-weight) text-foreground", children: p.label }),
|
|
31
|
+
p.description != null ? /* @__PURE__ */ jsx("span", { className: "text-sm text-pretty text-muted-foreground", children: p.description }) : null
|
|
32
|
+
] }),
|
|
33
|
+
/* @__PURE__ */ jsx(
|
|
34
|
+
Switch,
|
|
35
|
+
{
|
|
36
|
+
id,
|
|
37
|
+
checked: on,
|
|
38
|
+
disabled: !editable || locked,
|
|
39
|
+
onCheckedChange: (c) => onChange?.(toggle(value, r.value, p.id, c))
|
|
40
|
+
}
|
|
41
|
+
)
|
|
42
|
+
] }, p.id);
|
|
43
|
+
})
|
|
44
|
+
] }, g.id)) });
|
|
45
|
+
}
|
|
46
|
+
return /* @__PURE__ */ jsx("div", { "data-slot": "permission-matrix", "data-preset": preset, className: cn("min-w-0 overflow-x-auto rounded-card border border-border", className), ...props, children: /* @__PURE__ */ jsxs("table", { className: "w-full border-collapse text-sm", children: [
|
|
47
|
+
/* @__PURE__ */ jsx("thead", { children: /* @__PURE__ */ jsxs("tr", { className: "border-b border-border", children: [
|
|
48
|
+
/* @__PURE__ */ jsx("th", { scope: "col", className: "sticky start-0 min-w-(--ds-permission-label-min) bg-card px-3 py-2 text-start text-xs font-(--ds-medium-weight) text-muted-foreground", children: t.permissionHeader }),
|
|
49
|
+
roles.map((r) => /* @__PURE__ */ jsx("th", { scope: "col", className: "min-w-(--ds-permission-col-min) px-3 py-2 text-center text-xs font-(--ds-medium-weight) text-foreground", children: /* @__PURE__ */ jsxs("span", { className: "inline-flex items-center gap-1", children: [
|
|
50
|
+
r.label,
|
|
51
|
+
lockedRoles.includes(r.value) ? /* @__PURE__ */ jsxs("span", { title: t.permissionLocked, className: "inline-flex text-muted-foreground", children: [
|
|
52
|
+
/* @__PURE__ */ jsx(LockIcon, { "aria-hidden": "true", className: "size-3" }),
|
|
53
|
+
/* @__PURE__ */ jsx("span", { className: "sr-only", children: t.permissionLocked })
|
|
54
|
+
] }) : null
|
|
55
|
+
] }) }, r.value))
|
|
56
|
+
] }) }),
|
|
57
|
+
groups.map((g) => /* @__PURE__ */ jsxs("tbody", { "data-slot": "permission-matrix-group", children: [
|
|
58
|
+
/* @__PURE__ */ jsx("tr", { className: "bg-(--ds-row-hover)", children: /* @__PURE__ */ jsx("th", { scope: "colgroup", colSpan: roles.length + 1, className: "sticky start-0 px-3 py-1.5 text-start text-xs font-(--ds-medium-weight) text-muted-foreground", children: g.label }) }),
|
|
59
|
+
g.permissions.map((p) => /* @__PURE__ */ jsxs("tr", { className: "border-t border-border hover:bg-(--ds-row-hover)", children: [
|
|
60
|
+
/* @__PURE__ */ jsxs("th", { scope: "row", className: "sticky start-0 bg-card px-3 py-2 text-start align-top font-(--ds-normal-weight)", children: [
|
|
61
|
+
/* @__PURE__ */ jsx("span", { className: "block text-foreground", children: p.label }),
|
|
62
|
+
p.description != null ? /* @__PURE__ */ jsx("span", { className: "block text-xs text-pretty text-muted-foreground", children: p.description }) : null
|
|
63
|
+
] }),
|
|
64
|
+
roles.map((r) => {
|
|
65
|
+
const on = has(r.value, p.id);
|
|
66
|
+
const locked = lockedRoles.includes(r.value);
|
|
67
|
+
return /* @__PURE__ */ jsx("td", { "data-slot": "permission-matrix-cell", "data-allowed": on || void 0, className: "px-3 py-2 text-center align-middle", children: editable ? /* @__PURE__ */ jsx(
|
|
68
|
+
Checkbox,
|
|
69
|
+
{
|
|
70
|
+
checked: on,
|
|
71
|
+
disabled: locked,
|
|
72
|
+
"aria-label": dsFormat(t.permissionToggle, { permission: p.label, role: r.label }),
|
|
73
|
+
onCheckedChange: (c) => onChange?.(toggle(value, r.value, p.id, c === true))
|
|
74
|
+
}
|
|
75
|
+
) : on ? /* @__PURE__ */ jsxs("span", { className: "inline-flex text-success", children: [
|
|
76
|
+
/* @__PURE__ */ jsx(CheckIcon, { "aria-hidden": "true", className: "size-4" }),
|
|
77
|
+
/* @__PURE__ */ jsx("span", { className: "sr-only", children: t.permissionAllowed })
|
|
78
|
+
] }) : /* @__PURE__ */ jsxs("span", { className: "inline-flex text-muted-foreground", children: [
|
|
79
|
+
/* @__PURE__ */ jsx(MinusIcon, { "aria-hidden": "true", className: "size-4" }),
|
|
80
|
+
/* @__PURE__ */ jsx("span", { className: "sr-only", children: t.permissionDenied })
|
|
81
|
+
] }) }, r.value);
|
|
82
|
+
})
|
|
83
|
+
] }, p.id))
|
|
84
|
+
] }, g.id))
|
|
85
|
+
] }) });
|
|
86
|
+
}
|
|
87
|
+
export {
|
|
88
|
+
PermissionMatrix
|
|
89
|
+
};
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @group data
|
|
5
|
+
* @summary Resumen de la suscripción: plan, estado, precio, renovación o fin de la prueba y el uso frente a lo contratado; presets overview · compact · trial.
|
|
6
|
+
* @see usage-meter — un solo medidor de uso frente a su límite
|
|
7
|
+
* @see pricing-table — elegir entre planes (portada o cambio de plan), no ver el contratado
|
|
8
|
+
* @see next-step-card — un estado con su única acción, sin datos de facturación
|
|
9
|
+
* @example Página de facturación (preset overview)
|
|
10
|
+
* <PlanSummary
|
|
11
|
+
* preset="overview"
|
|
12
|
+
* plan="Pro"
|
|
13
|
+
* status="active"
|
|
14
|
+
* price="49 € / mes"
|
|
15
|
+
* renewsAt="2026-12-21"
|
|
16
|
+
* usage={[
|
|
17
|
+
* { id: "seats", label: "Puestos", value: 8, limit: 10, unit: "{seat}" },
|
|
18
|
+
* { id: "storage", label: "Almacenamiento", value: 42, limit: 50, unit: "GBy" },
|
|
19
|
+
* ]}
|
|
20
|
+
* actions={<Button variant="outline">Gestionar el plan</Button>}
|
|
21
|
+
* />
|
|
22
|
+
* @example Prueba que termina pronto (preset trial)
|
|
23
|
+
* <PlanSummary preset="trial" plan="Pro" status="trialing" trialEndsAt="2026-11-28" actions={<Button>Elegir un plan</Button>} />
|
|
24
|
+
*/
|
|
25
|
+
|
|
26
|
+
type PlanSummaryPreset = "overview" | "compact" | "trial";
|
|
27
|
+
type PlanStatus = "active" | "trialing" | "past_due" | "canceled";
|
|
28
|
+
type PlanUsage = {
|
|
29
|
+
id: string;
|
|
30
|
+
label: React.ReactNode;
|
|
31
|
+
value: number | null;
|
|
32
|
+
limit?: number | null;
|
|
33
|
+
unit?: string;
|
|
34
|
+
};
|
|
35
|
+
type PlanSummaryProps = Omit<React.ComponentProps<"section">, "children"> & {
|
|
36
|
+
preset?: PlanSummaryPreset;
|
|
37
|
+
/** Nombre del plan («Pro»). */
|
|
38
|
+
plan: React.ReactNode;
|
|
39
|
+
status?: PlanStatus;
|
|
40
|
+
/** Precio ya formateado por la app («49 € / mes»). */
|
|
41
|
+
price?: React.ReactNode;
|
|
42
|
+
/** Próxima renovación (activo). */
|
|
43
|
+
renewsAt?: string | number | Date | null;
|
|
44
|
+
/** Fin del servicio (cancelado). */
|
|
45
|
+
endsAt?: string | number | Date | null;
|
|
46
|
+
/** Fin de la prueba. */
|
|
47
|
+
trialEndsAt?: string | number | Date | null;
|
|
48
|
+
usage?: PlanUsage[];
|
|
49
|
+
showUsage?: boolean;
|
|
50
|
+
/** Fechas como «dentro de 5 días» en vez de la fecha. */
|
|
51
|
+
relative?: boolean;
|
|
52
|
+
/** Texto de apoyo (qué incluye, por qué hay pago pendiente). */
|
|
53
|
+
description?: React.ReactNode;
|
|
54
|
+
/** Botones (gestionar, cambiar de plan). */
|
|
55
|
+
actions?: React.ReactNode;
|
|
56
|
+
};
|
|
57
|
+
declare function PlanSummary({ preset, plan, status, price, renewsAt, endsAt, trialEndsAt, usage, showUsage, relative, description, actions, className, ...props }: PlanSummaryProps): React.JSX.Element;
|
|
58
|
+
|
|
59
|
+
export { type PlanStatus, PlanSummary, type PlanSummaryPreset, type PlanSummaryProps, type PlanUsage };
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { useDsMessages } from "../hooks/use-ds-messages.js";
|
|
4
|
+
import { cn } from "../lib/utils.js";
|
|
5
|
+
import { Badge } from "./badge.js";
|
|
6
|
+
import { Card } from "./card.js";
|
|
7
|
+
import { DateTime, RelativeTime } from "./date-time.js";
|
|
8
|
+
import { UsageMeter } from "./usage-meter.js";
|
|
9
|
+
const PRESETS = {
|
|
10
|
+
overview: { showUsage: true, surface: true, relative: false, accent: false },
|
|
11
|
+
compact: { showUsage: false, surface: false, relative: false, accent: false },
|
|
12
|
+
trial: { showUsage: true, surface: true, relative: true, accent: true }
|
|
13
|
+
};
|
|
14
|
+
const STATUS = {
|
|
15
|
+
active: { variant: "success", key: "planActive" },
|
|
16
|
+
trialing: { variant: "info", key: "planTrialing" },
|
|
17
|
+
past_due: { variant: "danger", key: "planPastDue" },
|
|
18
|
+
canceled: { variant: "neutral", key: "planCanceled" }
|
|
19
|
+
};
|
|
20
|
+
function PlanSummary({
|
|
21
|
+
preset = "overview",
|
|
22
|
+
plan,
|
|
23
|
+
status = "active",
|
|
24
|
+
price,
|
|
25
|
+
renewsAt,
|
|
26
|
+
endsAt,
|
|
27
|
+
trialEndsAt,
|
|
28
|
+
usage,
|
|
29
|
+
showUsage,
|
|
30
|
+
relative,
|
|
31
|
+
description,
|
|
32
|
+
actions,
|
|
33
|
+
className,
|
|
34
|
+
...props
|
|
35
|
+
}) {
|
|
36
|
+
const t = useDsMessages();
|
|
37
|
+
const p = PRESETS[preset];
|
|
38
|
+
const rel = relative ?? p.relative;
|
|
39
|
+
const withUsage = (showUsage ?? p.showUsage) && usage && usage.length > 0;
|
|
40
|
+
const s = STATUS[status];
|
|
41
|
+
const accent = p.accent || status === "past_due";
|
|
42
|
+
const when = (value) => rel ? /* @__PURE__ */ jsx(RelativeTime, { value }) : /* @__PURE__ */ jsx(DateTime, { value });
|
|
43
|
+
const date = status === "trialing" && trialEndsAt != null ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
44
|
+
t.planTrialEnds,
|
|
45
|
+
" ",
|
|
46
|
+
when(trialEndsAt)
|
|
47
|
+
] }) : status === "canceled" && endsAt != null ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
48
|
+
t.planEnds,
|
|
49
|
+
" ",
|
|
50
|
+
when(endsAt)
|
|
51
|
+
] }) : renewsAt != null && status !== "canceled" ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
52
|
+
t.planRenews,
|
|
53
|
+
" ",
|
|
54
|
+
when(renewsAt)
|
|
55
|
+
] }) : null;
|
|
56
|
+
const head = /* @__PURE__ */ jsxs("div", { "data-slot": "plan-summary-header", className: cn("flex min-w-0 flex-wrap gap-x-4 gap-y-2", preset === "compact" ? "items-center" : "items-start"), children: [
|
|
57
|
+
/* @__PURE__ */ jsxs("div", { className: "flex min-w-0 flex-1 flex-col gap-1", children: [
|
|
58
|
+
/* @__PURE__ */ jsxs("div", { className: "flex min-w-0 flex-wrap items-center gap-2", children: [
|
|
59
|
+
/* @__PURE__ */ jsx("h3", { "data-slot": "plan-summary-plan", className: cn("leading-tight font-(--ds-heading-weight) text-foreground", preset === "compact" ? "text-sm" : "text-lg"), children: plan }),
|
|
60
|
+
/* @__PURE__ */ jsx(Badge, { variant: s.variant, size: "sm", "data-slot": "plan-summary-status", children: t[s.key] })
|
|
61
|
+
] }),
|
|
62
|
+
(price != null || date != null) && /* @__PURE__ */ jsxs("p", { className: "flex flex-wrap gap-x-3 text-sm text-muted-foreground", children: [
|
|
63
|
+
price != null ? /* @__PURE__ */ jsx("span", { "data-slot": "plan-summary-price", className: "font-(--ds-medium-weight) text-foreground tabular-nums", children: price }) : null,
|
|
64
|
+
date != null ? /* @__PURE__ */ jsx("span", { "data-slot": "plan-summary-date", children: date }) : null
|
|
65
|
+
] }),
|
|
66
|
+
description != null && preset !== "compact" ? /* @__PURE__ */ jsx("p", { className: "text-sm text-pretty text-muted-foreground", children: description }) : null
|
|
67
|
+
] }),
|
|
68
|
+
actions != null ? /* @__PURE__ */ jsx("div", { "data-slot": "plan-summary-actions", className: "flex shrink-0 flex-wrap gap-2", children: actions }) : null
|
|
69
|
+
] });
|
|
70
|
+
const meters = withUsage ? /* @__PURE__ */ jsxs("div", { "data-slot": "plan-summary-usage", className: "flex flex-col gap-2", children: [
|
|
71
|
+
/* @__PURE__ */ jsx("h4", { className: "text-xs font-(--ds-medium-weight) text-muted-foreground", children: t.planUsage }),
|
|
72
|
+
/* @__PURE__ */ jsx("div", { className: "grid grid-cols-[repeat(auto-fill,minmax(min(100%,var(--ds-plan-usage-min)),1fr))] gap-4", children: usage.map((u) => /* @__PURE__ */ jsx(UsageMeter, { label: u.label, value: u.value, limit: u.limit, unit: u.unit, size: "compact" }, u.id)) })
|
|
73
|
+
] }) : null;
|
|
74
|
+
const body = /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
75
|
+
head,
|
|
76
|
+
meters
|
|
77
|
+
] });
|
|
78
|
+
return /* @__PURE__ */ jsx("section", { "data-slot": "plan-summary", "data-preset": preset, "data-status": status, className: cn("min-w-0", className), ...props, children: p.surface ? /* @__PURE__ */ jsx(
|
|
79
|
+
Card,
|
|
80
|
+
{
|
|
81
|
+
className: cn(
|
|
82
|
+
"flex flex-col gap-5 px-(--ds-card-spacing)",
|
|
83
|
+
accent && "border-s-(length:--ds-plan-accent-w)",
|
|
84
|
+
accent && (status === "past_due" ? "border-s-danger" : "border-s-primary")
|
|
85
|
+
),
|
|
86
|
+
children: body
|
|
87
|
+
}
|
|
88
|
+
) : /* @__PURE__ */ jsx("div", { className: "flex flex-col gap-3", children: body }) });
|
|
89
|
+
}
|
|
90
|
+
export {
|
|
91
|
+
PlanSummary
|
|
92
|
+
};
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { Popover as Popover$1 } from '@base-ui/react/popover';
|
|
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="inline-end">
|
|
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
|
+
|
|
36
|
+
declare function Popover({ ...props }: Popover$1.Root.Props): React.JSX.Element;
|
|
37
|
+
declare function PopoverTrigger({ ...props }: Popover$1.Trigger.Props): React.JSX.Element;
|
|
38
|
+
declare function PopoverContent({ className, align, side, sideOffset, ...props }: Popover$1.Popup.Props & Pick<Popover$1.Positioner.Props, "align" | "side" | "sideOffset">): React.JSX.Element;
|
|
39
|
+
declare function PopoverAnchor({ ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
40
|
+
declare function PopoverHeader({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
41
|
+
declare function PopoverTitle({ className, ...props }: React.ComponentProps<"h2">): React.JSX.Element;
|
|
42
|
+
declare function PopoverDescription({ className, ...props }: React.ComponentProps<"p">): React.JSX.Element;
|
|
43
|
+
|
|
44
|
+
export { Popover, PopoverAnchor, PopoverContent, PopoverDescription, PopoverHeader, PopoverTitle, PopoverTrigger };
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
|
|
3
|
+
declare function PricingTable({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
4
|
+
type PricingPlanProps = Omit<React.ComponentProps<"div">, "title"> & {
|
|
5
|
+
/** Nombre del plan. */
|
|
6
|
+
name: React.ReactNode;
|
|
7
|
+
/** Precio ya formateado por la app («29 €», «A medida»). */
|
|
8
|
+
price: React.ReactNode;
|
|
9
|
+
/** Periodo junto al precio («/mes», «por usuario y mes»). */
|
|
10
|
+
period?: React.ReactNode;
|
|
11
|
+
/** Para quién es, en una frase. */
|
|
12
|
+
description?: React.ReactNode;
|
|
13
|
+
/** Distintivo junto al nombre («Más elegido»). */
|
|
14
|
+
badge?: React.ReactNode;
|
|
15
|
+
/** Plan recomendado: filete de marca. Solo uno. */
|
|
16
|
+
featured?: boolean;
|
|
17
|
+
/** Botón del plan (ancho completo). */
|
|
18
|
+
action?: React.ReactNode;
|
|
19
|
+
/** Nota bajo el botón («Sin tarjeta», «IVA no incluido»). */
|
|
20
|
+
footnote?: React.ReactNode;
|
|
21
|
+
};
|
|
22
|
+
declare function PricingPlan({ name, price, period, description, badge, featured, action, footnote, className, children, ...props }: PricingPlanProps): React.JSX.Element;
|
|
23
|
+
type PricingFeatureProps = React.ComponentProps<"li"> & {
|
|
24
|
+
/** false: el plan NO lo incluye (se tacha en gris y se anuncia «No incluido»). */
|
|
25
|
+
included?: boolean;
|
|
26
|
+
};
|
|
27
|
+
declare function PricingFeature({ included, className, children, ...props }: PricingFeatureProps): React.JSX.Element;
|
|
28
|
+
|
|
29
|
+
export { PricingFeature, type PricingFeatureProps, PricingPlan, type PricingPlanProps, PricingTable };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { Progress as Progress$1 } from '@base-ui/react/progress';
|
|
3
|
+
import { DsDataTone } from './legend.js';
|
|
4
|
+
|
|
5
|
+
declare function Progress({ className, value, tone, ...props }: Progress$1.Root.Props & {
|
|
6
|
+
tone?: DsDataTone;
|
|
7
|
+
}): React.JSX.Element;
|
|
8
|
+
|
|
9
|
+
export { Progress };
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { DsDataTone } from './legend.js';
|
|
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
|
+
|
|
29
|
+
interface ProportionSegment {
|
|
30
|
+
value: number;
|
|
31
|
+
tone?: DsDataTone;
|
|
32
|
+
/** Nombre del segmento (para el texto accesible y el tooltip nativo). */
|
|
33
|
+
label?: string;
|
|
34
|
+
}
|
|
35
|
+
declare function ProportionBar({ className, value, max, segments, tone, label, showValue, unknown, formatValue, ...props }: Omit<React.ComponentProps<"div">, "children"> & {
|
|
36
|
+
/** Parte del total (sin `segments`). `null`/`undefined` sin segmentos = sin dato. */
|
|
37
|
+
value?: number | null;
|
|
38
|
+
/** Total (por defecto 100). */
|
|
39
|
+
max?: number;
|
|
40
|
+
segments?: ProportionSegment[];
|
|
41
|
+
tone?: DsDataTone;
|
|
42
|
+
/** Etiqueta visible sobre la barra (y nombre accesible). */
|
|
43
|
+
label?: React.ReactNode;
|
|
44
|
+
/** Muestra el valor formateado junto a la etiqueta. */
|
|
45
|
+
showValue?: boolean;
|
|
46
|
+
/** Sin dato: rayado neutro, nunca una barra a 0. */
|
|
47
|
+
unknown?: boolean;
|
|
48
|
+
/** Formato del valor (por defecto, porcentaje en el idioma activo). */
|
|
49
|
+
formatValue?: (value: number, max: number) => string;
|
|
50
|
+
}): React.JSX.Element;
|
|
51
|
+
|
|
52
|
+
export { ProportionBar, type ProportionSegment };
|
|
@@ -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,62 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { Questionnaire as Questionnaire$1 } from '@shadcn/react/questionnaire';
|
|
3
|
+
import { Button } from './button.js';
|
|
4
|
+
import 'class-variance-authority/types';
|
|
5
|
+
import '@base-ui/react/use-render';
|
|
6
|
+
import 'class-variance-authority';
|
|
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
|
+
|
|
46
|
+
declare function Questionnaire({ className, ...props }: React.ComponentProps<typeof Questionnaire$1.Root>): React.JSX.Element;
|
|
47
|
+
declare function QuestionnaireProgress({ className, ...props }: React.ComponentProps<typeof Questionnaire$1.Progress>): React.JSX.Element;
|
|
48
|
+
declare function QuestionnaireItem({ className, ...props }: React.ComponentProps<typeof Questionnaire$1.Item>): React.JSX.Element;
|
|
49
|
+
declare function QuestionnaireTitle({ className, ...props }: React.ComponentProps<typeof Questionnaire$1.Title>): React.JSX.Element;
|
|
50
|
+
declare function QuestionnaireDescription({ className, ...props }: React.ComponentProps<typeof Questionnaire$1.Description>): React.JSX.Element;
|
|
51
|
+
declare function QuestionnaireChoices({ className, ...props }: React.ComponentProps<typeof Questionnaire$1.Choices>): React.JSX.Element;
|
|
52
|
+
declare function QuestionnaireChoice({ children, className, ...props }: React.ComponentProps<typeof Questionnaire$1.Choice>): React.JSX.Element;
|
|
53
|
+
declare function QuestionnaireChoiceDescription({ className, ...props }: React.ComponentProps<"span">): React.JSX.Element;
|
|
54
|
+
declare function QuestionnaireInput({ className, ...props }: React.ComponentProps<typeof Questionnaire$1.Input>): React.JSX.Element;
|
|
55
|
+
declare function QuestionnaireError({ className, ...props }: React.ComponentProps<typeof Questionnaire$1.Error>): React.JSX.Element;
|
|
56
|
+
declare function QuestionnaireActions({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
57
|
+
declare function QuestionnairePrevious({ children, className, size, variant, ...props }: React.ComponentProps<typeof Questionnaire$1.Previous> & Pick<React.ComponentProps<typeof Button>, "size" | "variant">): React.JSX.Element;
|
|
58
|
+
declare function QuestionnaireSkip({ children, className, size, variant, ...props }: React.ComponentProps<typeof Questionnaire$1.Skip> & Pick<React.ComponentProps<typeof Button>, "size" | "variant">): React.JSX.Element;
|
|
59
|
+
declare function QuestionnaireNext({ children, className, size, variant, ...props }: React.ComponentProps<typeof Questionnaire$1.Next> & Pick<React.ComponentProps<typeof Button>, "size" | "variant">): React.JSX.Element;
|
|
60
|
+
declare function QuestionnaireSubmit({ children, className, size, variant, ...props }: React.ComponentProps<typeof Questionnaire$1.Submit> & Pick<React.ComponentProps<typeof Button>, "size" | "variant">): React.JSX.Element;
|
|
61
|
+
|
|
62
|
+
export { Questionnaire, QuestionnaireActions, QuestionnaireChoice, QuestionnaireChoiceDescription, QuestionnaireChoices, QuestionnaireDescription, QuestionnaireError, QuestionnaireInput, QuestionnaireItem, QuestionnaireNext, QuestionnairePrevious, QuestionnaireProgress, QuestionnaireSkip, QuestionnaireSubmit, QuestionnaireTitle };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { Radio } from '@base-ui/react/radio';
|
|
3
|
+
import { RadioGroup as RadioGroup$1 } from '@base-ui/react/radio-group';
|
|
4
|
+
|
|
5
|
+
declare function RadioGroup({ className, ...props }: RadioGroup$1.Props): React.JSX.Element;
|
|
6
|
+
declare function RadioGroupItem({ className, ...props }: Radio.Root.Props): React.JSX.Element;
|
|
7
|
+
|
|
8
|
+
export { RadioGroup, RadioGroupItem };
|
|
@@ -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 };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import * as ResizablePrimitive from 'react-resizable-panels';
|
|
3
|
+
|
|
4
|
+
declare function ResizablePanelGroup({ className, ...props }: ResizablePrimitive.GroupProps): React.JSX.Element;
|
|
5
|
+
declare function ResizablePanel({ ...props }: ResizablePrimitive.PanelProps): React.JSX.Element;
|
|
6
|
+
declare function ResizableHandle({ withHandle, className, ...props }: ResizablePrimitive.SeparatorProps & {
|
|
7
|
+
withHandle?: boolean;
|
|
8
|
+
}): React.JSX.Element;
|
|
9
|
+
|
|
10
|
+
export { ResizableHandle, ResizablePanel, ResizablePanelGroup };
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @group content
|
|
5
|
+
* @summary Hace aparecer un bloque al entrar en pantalla con el scroll (fade, up, pop, slide) con CSS y el ritmo del tema; sin JS o con movimiento reducido, queda visible.
|
|
6
|
+
* @see motion-provider — animaciones con Motion (salidas, gestos, layout)
|
|
7
|
+
* @see animated-number — una cifra que cuenta hasta su valor
|
|
8
|
+
* @example Tarjeta que sube al aparecer
|
|
9
|
+
* <Reveal effect="up">
|
|
10
|
+
* <ContentCard title="Integraciones" description="Conecta tus herramientas" />
|
|
11
|
+
* </Reveal>
|
|
12
|
+
* @example Cascada en una lista
|
|
13
|
+
* {features.map((f, i) => (
|
|
14
|
+
* <Reveal key={f.id} index={i}>
|
|
15
|
+
* <ContentCard title={f.title} />
|
|
16
|
+
* </Reveal>
|
|
17
|
+
* ))}
|
|
18
|
+
*/
|
|
19
|
+
|
|
20
|
+
type RevealEffect = "fade" | "up" | "pop" | "slide";
|
|
21
|
+
declare function Reveal({ effect, index, once, className, style, ...props }: React.ComponentProps<"div"> & {
|
|
22
|
+
effect?: RevealEffect;
|
|
23
|
+
/** Posición en una lista: retrasa la entrada `index × --ds-motion-stagger`. */
|
|
24
|
+
index?: number;
|
|
25
|
+
once?: boolean;
|
|
26
|
+
}): React.JSX.Element;
|
|
27
|
+
|
|
28
|
+
export { Reveal, type RevealEffect };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { ScrollArea as ScrollArea$1 } from '@base-ui/react/scroll-area';
|
|
3
|
+
|
|
4
|
+
declare function ScrollArea({ className, children, ...props }: ScrollArea$1.Root.Props): React.JSX.Element;
|
|
5
|
+
declare function ScrollBar({ className, orientation, ...props }: ScrollArea$1.Scrollbar.Props): React.JSX.Element;
|
|
6
|
+
|
|
7
|
+
export { ScrollArea, ScrollBar };
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
|
|
3
|
+
interface SearchSuggestion {
|
|
4
|
+
id: string;
|
|
5
|
+
label: string;
|
|
6
|
+
/** Texto secundario (categoría, ruta…). */
|
|
7
|
+
description?: string;
|
|
8
|
+
icon?: React.ReactNode;
|
|
9
|
+
[key: string]: unknown;
|
|
10
|
+
}
|
|
11
|
+
interface SearchQueryOptions {
|
|
12
|
+
signal: AbortSignal;
|
|
13
|
+
}
|
|
14
|
+
declare function SearchBox({ onQuery, onSelect, onSubmit, recent, popular, debounce, minChars, maxResults, value: valueProp, defaultValue, onValueChange, placeholder, "aria-label": ariaLabel, className, ...props }: Omit<React.ComponentProps<"div">, "onSelect" | "onSubmit" | "defaultValue"> & {
|
|
15
|
+
/** Devuelve las sugerencias para un texto. Lanza o rechaza para mostrar el estado de error. */
|
|
16
|
+
onQuery: (query: string, options: SearchQueryOptions) => Promise<SearchSuggestion[]> | SearchSuggestion[];
|
|
17
|
+
onSelect?: (suggestion: SearchSuggestion) => void;
|
|
18
|
+
/** Enter sin sugerencia activa: busca el texto tal cual. */
|
|
19
|
+
onSubmit?: (query: string) => void;
|
|
20
|
+
recent?: SearchSuggestion[];
|
|
21
|
+
popular?: SearchSuggestion[];
|
|
22
|
+
debounce?: number;
|
|
23
|
+
minChars?: number;
|
|
24
|
+
maxResults?: number;
|
|
25
|
+
value?: string;
|
|
26
|
+
defaultValue?: string;
|
|
27
|
+
onValueChange?: (value: string) => void;
|
|
28
|
+
placeholder?: string;
|
|
29
|
+
"aria-label"?: string;
|
|
30
|
+
}): React.JSX.Element;
|
|
31
|
+
|
|
32
|
+
export { SearchBox, type SearchQueryOptions, type SearchSuggestion };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { Select as Select$1 } from '@base-ui/react/select';
|
|
3
|
+
|
|
4
|
+
declare const Select: typeof Select$1.Root;
|
|
5
|
+
declare function SelectGroup({ className, ...props }: Select$1.Group.Props): React.JSX.Element;
|
|
6
|
+
declare function SelectValue({ ...props }: Select$1.Value.Props): React.JSX.Element;
|
|
7
|
+
declare function SelectTrigger({ className, size, children, ...props }: Select$1.Trigger.Props & {
|
|
8
|
+
size?: "sm" | "default";
|
|
9
|
+
}): React.JSX.Element;
|
|
10
|
+
declare function SelectContent({ className, children, position, align, ...props }: Select$1.Popup.Props & Pick<Select$1.Positioner.Props, "align"> & {
|
|
11
|
+
position?: "item-aligned" | "popper";
|
|
12
|
+
}): React.JSX.Element;
|
|
13
|
+
declare function SelectLabel({ className, ...props }: Select$1.GroupLabel.Props): React.JSX.Element;
|
|
14
|
+
declare function SelectItem({ className, children, ...props }: Select$1.Item.Props): React.JSX.Element;
|
|
15
|
+
declare function SelectSeparator({ className, ...props }: Select$1.Separator.Props): React.JSX.Element;
|
|
16
|
+
declare function SelectScrollUpButton({ className, ...props }: Select$1.ScrollUpArrow.Props): React.JSX.Element;
|
|
17
|
+
declare function SelectScrollDownButton({ className, ...props }: Select$1.ScrollDownArrow.Props): React.JSX.Element;
|
|
18
|
+
|
|
19
|
+
export { Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
|
|
3
|
+
type SessionDeviceKind = "desktop" | "laptop" | "mobile" | "tablet";
|
|
4
|
+
type SessionInfo = {
|
|
5
|
+
id: string;
|
|
6
|
+
device?: React.ReactNode;
|
|
7
|
+
kind?: SessionDeviceKind;
|
|
8
|
+
location?: React.ReactNode;
|
|
9
|
+
ip?: string;
|
|
10
|
+
lastActive?: string | number | Date;
|
|
11
|
+
current?: boolean;
|
|
12
|
+
};
|
|
13
|
+
declare function SessionList({ sessions, onRevoke, onRevokeOthers, className, ...props }: React.ComponentProps<"div"> & {
|
|
14
|
+
sessions: SessionInfo[];
|
|
15
|
+
onRevoke?: (id: string) => void | Promise<void>;
|
|
16
|
+
onRevokeOthers?: () => void | Promise<void>;
|
|
17
|
+
}): React.JSX.Element;
|
|
18
|
+
|
|
19
|
+
export { type SessionDeviceKind, type SessionInfo, SessionList };
|