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,13 @@
|
|
|
1
|
+
import * as class_variance_authority_types from 'class-variance-authority/types';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { VariantProps } from 'class-variance-authority';
|
|
4
|
+
|
|
5
|
+
declare const alertVariants: (props?: ({
|
|
6
|
+
variant?: "info" | "warning" | "success" | "danger" | "default" | "destructive" | null | undefined;
|
|
7
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
8
|
+
declare function Alert({ className, variant, ...props }: React.ComponentProps<"div"> & VariantProps<typeof alertVariants>): React.JSX.Element;
|
|
9
|
+
declare function AlertTitle({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
10
|
+
declare function AlertDescription({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
11
|
+
declare function AlertAction({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
12
|
+
|
|
13
|
+
export { Alert, AlertAction, AlertDescription, AlertTitle };
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @group data
|
|
5
|
+
* @summary Cifra que rueda como un cuentakilómetros al aparecer o cambiar, para la cifra principal de un resumen. Dentro de un KPI basta con StatValue animate.
|
|
6
|
+
* @see stat — KPI con etiqueta, variación y tono (StatValue animate ya anima la cifra)
|
|
7
|
+
* @see quantity — cifra con unidad que no necesita animarse (tablas, textos, fichas)
|
|
8
|
+
* @example Cifra principal de un resumen
|
|
9
|
+
* <AnimatedNumber value={1284} />
|
|
10
|
+
* @example Con unidad fija (la unidad no rueda)
|
|
11
|
+
* <AnimatedNumber value={12.5} format={(n) => `${n.toFixed(1)} h`} />
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
declare function AnimatedNumber({ value, format, className, ...props }: Omit<React.ComponentProps<"span">, "children"> & {
|
|
15
|
+
value: number;
|
|
16
|
+
/** Cómo escribir el número. Por defecto, `Intl.NumberFormat` del idioma activo. */
|
|
17
|
+
format?: (value: number) => string;
|
|
18
|
+
}): React.JSX.Element;
|
|
19
|
+
|
|
20
|
+
export { AnimatedNumber };
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
|
|
3
|
+
type ApiKeyListPreset = "keys" | "tokens" | "webhooks";
|
|
4
|
+
type ApiKeyStatus = "active" | "expired" | "revoked" | "paused";
|
|
5
|
+
type ApiKeyInfo = {
|
|
6
|
+
id: string;
|
|
7
|
+
name: React.ReactNode;
|
|
8
|
+
/** Texto para etiquetas accesibles cuando `name` no es texto. */
|
|
9
|
+
label?: string;
|
|
10
|
+
/** Valor visible: prefijo enmascarado (`sk_live_••••a1b2`) o la URL de un webhook. */
|
|
11
|
+
value: string;
|
|
12
|
+
/** Permisos o eventos. */
|
|
13
|
+
scopes?: string[];
|
|
14
|
+
createdAt?: string | number | Date;
|
|
15
|
+
lastUsed?: string | number | Date | null;
|
|
16
|
+
/** null = no caduca. */
|
|
17
|
+
expiresAt?: string | number | Date | null;
|
|
18
|
+
status?: ApiKeyStatus;
|
|
19
|
+
/** Webhooks: estado de la última entrega. */
|
|
20
|
+
health?: "ok" | "failing";
|
|
21
|
+
};
|
|
22
|
+
type ApiKeyListProps = Omit<React.ComponentProps<"div">, "children"> & {
|
|
23
|
+
preset?: ApiKeyListPreset;
|
|
24
|
+
items: ApiKeyInfo[];
|
|
25
|
+
/** Secreto recién creado: se enseña una vez, encima de su fila. */
|
|
26
|
+
revealed?: {
|
|
27
|
+
id: string;
|
|
28
|
+
secret: string;
|
|
29
|
+
} | null;
|
|
30
|
+
showScopes?: boolean;
|
|
31
|
+
showExpiry?: boolean;
|
|
32
|
+
showUsage?: boolean;
|
|
33
|
+
onRevoke?: (id: string) => void | Promise<void>;
|
|
34
|
+
onRoll?: (id: string) => void | Promise<void>;
|
|
35
|
+
/** Acciones propias por fila (DropdownMenuItem), además de las de serie. */
|
|
36
|
+
renderActions?: (item: ApiKeyInfo) => React.ReactNode;
|
|
37
|
+
};
|
|
38
|
+
declare function ApiKeyList({ preset, items, revealed, showScopes, showExpiry, showUsage, onRevoke, onRoll, renderActions, className, ...props }: ApiKeyListProps): React.JSX.Element;
|
|
39
|
+
|
|
40
|
+
export { type ApiKeyInfo, ApiKeyList, type ApiKeyListPreset, type ApiKeyListProps, type ApiKeyStatus };
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { KeyRoundIcon, MoreHorizontalIcon, TicketIcon, WebhookIcon } 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 { Alert, AlertDescription, AlertTitle } from "./alert.js";
|
|
8
|
+
import { Badge } from "./badge.js";
|
|
9
|
+
import { Button } from "./button.js";
|
|
10
|
+
import { CopyField } from "./copy-button.js";
|
|
11
|
+
import { RelativeTime } from "./date-time.js";
|
|
12
|
+
import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuTrigger } from "./dropdown-menu.js";
|
|
13
|
+
import { Item, ItemActions, ItemContent, ItemDescription, ItemGroup, ItemMedia, ItemTitle } from "./item.js";
|
|
14
|
+
import { StatusBadge } from "./status-badge.js";
|
|
15
|
+
const PRESETS = {
|
|
16
|
+
keys: { icon: /* @__PURE__ */ jsx(KeyRoundIcon, {}), showScopes: false, showExpiry: false, showUsage: true, showHealth: false },
|
|
17
|
+
tokens: { icon: /* @__PURE__ */ jsx(TicketIcon, {}), showScopes: true, showExpiry: true, showUsage: true, showHealth: false },
|
|
18
|
+
webhooks: { icon: /* @__PURE__ */ jsx(WebhookIcon, {}), showScopes: true, showExpiry: false, showUsage: false, showHealth: true }
|
|
19
|
+
};
|
|
20
|
+
function isPast(value) {
|
|
21
|
+
const ms = new Date(value).getTime();
|
|
22
|
+
return Number.isFinite(ms) && ms < Date.now();
|
|
23
|
+
}
|
|
24
|
+
function ApiKeyList({ preset = "keys", items, revealed, showScopes, showExpiry, showUsage, onRevoke, onRoll, renderActions, className, ...props }) {
|
|
25
|
+
const t = useDsMessages();
|
|
26
|
+
const p = PRESETS[preset];
|
|
27
|
+
const scopes = showScopes ?? p.showScopes;
|
|
28
|
+
const expiry = showExpiry ?? p.showExpiry;
|
|
29
|
+
const usage = showUsage ?? p.showUsage;
|
|
30
|
+
return /* @__PURE__ */ jsxs("div", { "data-slot": "api-key-list", "data-preset": preset, className: cn("flex min-w-0 flex-col gap-2", className), ...props, children: [
|
|
31
|
+
revealed ? /* @__PURE__ */ jsxs(Alert, { "data-slot": "api-key-list-reveal", variant: "warning", children: [
|
|
32
|
+
/* @__PURE__ */ jsx(AlertTitle, { children: t.apiKeyRevealTitle }),
|
|
33
|
+
/* @__PURE__ */ jsxs(AlertDescription, { className: "flex flex-col gap-2", children: [
|
|
34
|
+
/* @__PURE__ */ jsx("span", { children: t.apiKeyRevealHint }),
|
|
35
|
+
/* @__PURE__ */ jsx(CopyField, { value: revealed.secret, className: "max-w-full font-mono" })
|
|
36
|
+
] })
|
|
37
|
+
] }) : null,
|
|
38
|
+
/* @__PURE__ */ jsx(ItemGroup, { className: "gap-2", children: items.map((k) => {
|
|
39
|
+
const text = k.label ?? (typeof k.name === "string" ? k.name : k.id);
|
|
40
|
+
const status = k.status ?? (k.expiresAt != null && isPast(k.expiresAt) ? "expired" : "active");
|
|
41
|
+
const live = status === "active" || status === "paused";
|
|
42
|
+
const meta = [];
|
|
43
|
+
if (k.createdAt != null && preset !== "webhooks") meta.push(/* @__PURE__ */ jsxs("span", { children: [
|
|
44
|
+
t.apiKeyCreated,
|
|
45
|
+
" ",
|
|
46
|
+
/* @__PURE__ */ jsx(RelativeTime, { value: k.createdAt })
|
|
47
|
+
] }, "c"));
|
|
48
|
+
if (usage) meta.push(k.lastUsed != null ? /* @__PURE__ */ jsxs("span", { children: [
|
|
49
|
+
t.apiKeyLastUsed,
|
|
50
|
+
" ",
|
|
51
|
+
/* @__PURE__ */ jsx(RelativeTime, { value: k.lastUsed })
|
|
52
|
+
] }, "u") : /* @__PURE__ */ jsx("span", { children: t.apiKeyNeverUsed }, "u"));
|
|
53
|
+
if (expiry && live) meta.push(k.expiresAt != null ? /* @__PURE__ */ jsxs("span", { children: [
|
|
54
|
+
t.apiKeyExpires,
|
|
55
|
+
" ",
|
|
56
|
+
/* @__PURE__ */ jsx(RelativeTime, { value: k.expiresAt })
|
|
57
|
+
] }, "e") : /* @__PURE__ */ jsx("span", { children: t.apiKeyNoExpiry }, "e"));
|
|
58
|
+
const menu = live && (onRevoke || onRoll || renderActions);
|
|
59
|
+
return /* @__PURE__ */ jsxs(Item, { variant: "card", size: "sm", "data-slot": "api-key-list-item", "data-status": status, "data-revealed": revealed?.id === k.id || void 0, className: cn(!live && "opacity-(--ds-disabled-opacity)"), children: [
|
|
60
|
+
/* @__PURE__ */ jsx(ItemMedia, { variant: "icon", children: p.icon }),
|
|
61
|
+
/* @__PURE__ */ jsxs(ItemContent, { className: "min-w-0", children: [
|
|
62
|
+
/* @__PURE__ */ jsxs(ItemTitle, { className: "min-w-0 flex-wrap", children: [
|
|
63
|
+
/* @__PURE__ */ jsx("span", { className: "truncate", children: k.name }),
|
|
64
|
+
status === "expired" ? /* @__PURE__ */ jsx(Badge, { variant: "warning", size: "sm", children: t.apiKeyExpired }) : null,
|
|
65
|
+
status === "revoked" ? /* @__PURE__ */ jsx(Badge, { variant: "neutral", size: "sm", children: t.apiKeyRevoked }) : null,
|
|
66
|
+
status === "paused" ? /* @__PURE__ */ jsx(Badge, { variant: "neutral", size: "sm", children: t.apiKeyPaused }) : null,
|
|
67
|
+
p.showHealth && live && k.health ? /* @__PURE__ */ jsx(StatusBadge, { variant: "dot", level: k.health === "ok" ? "ok" : "critical", children: k.health === "ok" ? t.apiKeyHealthy : t.apiKeyFailing }) : null
|
|
68
|
+
] }),
|
|
69
|
+
/* @__PURE__ */ jsxs(ItemDescription, { className: "flex min-w-0 flex-col gap-1", children: [
|
|
70
|
+
/* @__PURE__ */ jsx("code", { "data-slot": "api-key-list-value", className: "truncate font-mono text-xs text-foreground", children: k.value }),
|
|
71
|
+
scopes && k.scopes?.length ? /* @__PURE__ */ jsx("span", { "data-slot": "api-key-list-scopes", className: "flex flex-wrap gap-1", children: k.scopes.map((s) => /* @__PURE__ */ jsx(Badge, { variant: "outline", size: "sm", className: "font-mono", children: s }, s)) }) : null,
|
|
72
|
+
meta.length ? /* @__PURE__ */ jsx("span", { "data-slot": "api-key-list-meta", className: "flex flex-wrap gap-x-3 gap-y-0.5 text-xs", children: meta }) : null
|
|
73
|
+
] })
|
|
74
|
+
] }),
|
|
75
|
+
menu ? /* @__PURE__ */ jsx(ItemActions, { children: /* @__PURE__ */ jsxs(DropdownMenu, { children: [
|
|
76
|
+
/* @__PURE__ */ jsx(DropdownMenuTrigger, { render: /* @__PURE__ */ jsx(Button, { type: "button", size: "icon-sm", variant: "ghost", "aria-label": dsFormat(t.conversationActions, { name: text }) }), children: /* @__PURE__ */ jsx(MoreHorizontalIcon, {}) }),
|
|
77
|
+
/* @__PURE__ */ jsxs(DropdownMenuContent, { align: "end", children: [
|
|
78
|
+
onRoll ? /* @__PURE__ */ jsx(DropdownMenuItem, { onClick: () => void onRoll(k.id), children: t.apiKeyRoll }) : null,
|
|
79
|
+
renderActions?.(k),
|
|
80
|
+
onRevoke ? /* @__PURE__ */ jsx(DropdownMenuItem, { variant: "destructive", onClick: () => void onRevoke(k.id), children: t.apiKeyRevoke }) : null
|
|
81
|
+
] })
|
|
82
|
+
] }) }) : null
|
|
83
|
+
] }, k.id);
|
|
84
|
+
}) })
|
|
85
|
+
] });
|
|
86
|
+
}
|
|
87
|
+
export {
|
|
88
|
+
ApiKeyList
|
|
89
|
+
};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @group navigation
|
|
5
|
+
* @summary Barra superior de la app dentro del lienzo: botón de menú, título corto y controles fijos (avisos, idioma, tema). El título de la vista va en PageHeader.
|
|
6
|
+
* @see page-header — título (h1), subtítulo y acciones de la vista, al inicio del contenido
|
|
7
|
+
* @see sidebar — navegación principal lateral; su SidebarTrigger va dentro de la AppBar
|
|
8
|
+
* @see bottom-nav — navegación principal inferior en móvil
|
|
9
|
+
* @example Menú, título, idioma y tema
|
|
10
|
+
* <AppBar>
|
|
11
|
+
* <SidebarTrigger />
|
|
12
|
+
* <AppBarTitle>Clientes</AppBarTitle>
|
|
13
|
+
* <AppBarActions>
|
|
14
|
+
* <LocaleSwitcher locales={locales} value={locale} onValueChange={setLocale} />
|
|
15
|
+
* <ThemeToggle value={theme} onValueChange={setTheme} />
|
|
16
|
+
* </AppBarActions>
|
|
17
|
+
* </AppBar>
|
|
18
|
+
* @example Preset transparent sobre un lienzo flotante
|
|
19
|
+
* <AppBar preset="transparent">
|
|
20
|
+
* <SidebarTrigger />
|
|
21
|
+
* <AppBarTitle>Mapa</AppBarTitle>
|
|
22
|
+
* </AppBar>
|
|
23
|
+
*/
|
|
24
|
+
|
|
25
|
+
type AppBarPreset = "app" | "compact" | "transparent";
|
|
26
|
+
declare function AppBar({ preset, className, ...props }: React.ComponentProps<"header"> & {
|
|
27
|
+
preset?: AppBarPreset;
|
|
28
|
+
}): React.JSX.Element;
|
|
29
|
+
declare function AppBarTitle({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
30
|
+
declare function AppBarActions({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
31
|
+
|
|
32
|
+
export { AppBar, AppBarActions, type AppBarPreset, AppBarTitle };
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import * as class_variance_authority_types from 'class-variance-authority/types';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { useRender } from '@base-ui/react/use-render';
|
|
4
|
+
import { VariantProps } from 'class-variance-authority';
|
|
5
|
+
import { Button } from './button.js';
|
|
6
|
+
|
|
7
|
+
declare const attachmentVariants: (props?: ({
|
|
8
|
+
size?: "default" | "xs" | "sm" | null | undefined;
|
|
9
|
+
orientation?: "vertical" | "horizontal" | null | undefined;
|
|
10
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
11
|
+
declare function Attachment({ className, state, size, orientation, ...props }: React.ComponentProps<"div"> & VariantProps<typeof attachmentVariants> & {
|
|
12
|
+
state?: "idle" | "uploading" | "processing" | "error" | "done";
|
|
13
|
+
}): React.JSX.Element;
|
|
14
|
+
declare const attachmentMediaVariants: (props?: ({
|
|
15
|
+
variant?: "icon" | "image" | null | undefined;
|
|
16
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
17
|
+
declare function AttachmentMedia({ className, variant, ...props }: React.ComponentProps<"div"> & VariantProps<typeof attachmentMediaVariants>): React.JSX.Element;
|
|
18
|
+
declare function AttachmentContent({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
19
|
+
declare function AttachmentTitle({ className, ...props }: React.ComponentProps<"span">): React.JSX.Element;
|
|
20
|
+
declare function AttachmentDescription({ className, ...props }: React.ComponentProps<"span">): React.JSX.Element;
|
|
21
|
+
declare function AttachmentActions({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
22
|
+
declare function AttachmentAction({ className, variant, size, ...props }: React.ComponentProps<typeof Button>): React.JSX.Element;
|
|
23
|
+
declare function AttachmentTrigger({ className, render, type, ...props }: useRender.ComponentProps<"button">): React.ReactElement<unknown, string | React.JSXElementConstructor<any>>;
|
|
24
|
+
declare function AttachmentGroup({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
25
|
+
|
|
26
|
+
export { Attachment, AttachmentAction, AttachmentActions, AttachmentContent, AttachmentDescription, AttachmentGroup, AttachmentMedia, AttachmentTitle, AttachmentTrigger };
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @group data
|
|
5
|
+
* @summary Registro de actividad (quién hizo qué, sobre qué y cuándo), agrupado por día, para auditoría y seguridad de una cuenta o de una entidad; presets full · compact · entity.
|
|
6
|
+
* @see timeline — hitos de un proceso, no eventos de auditoría con autor
|
|
7
|
+
* @see data-table — miles de eventos con filtros, orden y exportación
|
|
8
|
+
* @see session-list — sesiones abiertas, no acciones hechas
|
|
9
|
+
* @example Registro de la cuenta (preset full)
|
|
10
|
+
* <AuditLog
|
|
11
|
+
* preset="full"
|
|
12
|
+
* events={[
|
|
13
|
+
* { id: "1", actor: { name: "Ana Ruiz" }, action: "cambió el rol de", target: "Leo Díaz", at: "2026-11-21T09:12:00Z", ip: "81.44.12.9" },
|
|
14
|
+
* { id: "2", action: "renovó el certificado", target: "api.acme.com", at: "2026-11-20T23:00:00Z" },
|
|
15
|
+
* ]}
|
|
16
|
+
* />
|
|
17
|
+
* @example Historial de una entidad en su detalle (preset entity)
|
|
18
|
+
* <AuditLog preset="entity" events={events} />
|
|
19
|
+
*/
|
|
20
|
+
|
|
21
|
+
type AuditLogPreset = "full" | "compact" | "entity";
|
|
22
|
+
type AuditTone = "neutral" | "info" | "success" | "warning" | "danger";
|
|
23
|
+
type AuditActor = {
|
|
24
|
+
name: string;
|
|
25
|
+
avatar?: string;
|
|
26
|
+
};
|
|
27
|
+
type AuditEvent = {
|
|
28
|
+
id: string;
|
|
29
|
+
/** Autor; sin autor = el sistema. */
|
|
30
|
+
actor?: AuditActor | string | null;
|
|
31
|
+
/** Verbo y complemento, en el idioma de la app («cambió el rol de»). */
|
|
32
|
+
action: React.ReactNode;
|
|
33
|
+
/** Sobre qué se hizo. */
|
|
34
|
+
target?: React.ReactNode;
|
|
35
|
+
at: string | number | Date;
|
|
36
|
+
ip?: string;
|
|
37
|
+
tone?: AuditTone;
|
|
38
|
+
/** Detalle adicional (un diff, un motivo). */
|
|
39
|
+
detail?: React.ReactNode;
|
|
40
|
+
};
|
|
41
|
+
type AuditLogProps = Omit<React.ComponentProps<"div">, "children"> & {
|
|
42
|
+
preset?: AuditLogPreset;
|
|
43
|
+
events: AuditEvent[];
|
|
44
|
+
/** Agrupa por día («Hoy», «Ayer», fecha). */
|
|
45
|
+
group?: boolean;
|
|
46
|
+
showTarget?: boolean;
|
|
47
|
+
showIp?: boolean;
|
|
48
|
+
/** Contenido si no hay eventos (por ejemplo, un EmptyState). */
|
|
49
|
+
empty?: React.ReactNode;
|
|
50
|
+
};
|
|
51
|
+
declare function AuditLog({ preset, events, group, showTarget, showIp, empty, className, ...props }: AuditLogProps): React.JSX.Element;
|
|
52
|
+
|
|
53
|
+
export { type AuditActor, type AuditEvent, AuditLog, type AuditLogPreset, type AuditLogProps, type AuditTone };
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { useDsLocale, useDsMessages } from "../hooks/use-ds-messages.js";
|
|
4
|
+
import { cn } from "../lib/utils.js";
|
|
5
|
+
import { Avatar, AvatarFallback, AvatarImage } from "./avatar.js";
|
|
6
|
+
import { DateTime, RelativeTime } from "./date-time.js";
|
|
7
|
+
const PRESETS = {
|
|
8
|
+
full: { group: true, showTarget: true, showIp: true, showAvatar: true, absolute: true, timeline: false },
|
|
9
|
+
compact: { group: false, showTarget: true, showIp: false, showAvatar: false, absolute: false, timeline: false },
|
|
10
|
+
entity: { group: true, showTarget: false, showIp: false, showAvatar: false, absolute: false, timeline: true }
|
|
11
|
+
};
|
|
12
|
+
const DOT_TONE = {
|
|
13
|
+
neutral: "bg-(--ds-field-border)",
|
|
14
|
+
info: "bg-info",
|
|
15
|
+
success: "bg-success",
|
|
16
|
+
warning: "bg-warning",
|
|
17
|
+
danger: "bg-danger"
|
|
18
|
+
};
|
|
19
|
+
function dayKey(d) {
|
|
20
|
+
return `${d.getFullYear()}-${d.getMonth()}-${d.getDate()}`;
|
|
21
|
+
}
|
|
22
|
+
function initials(text) {
|
|
23
|
+
return text.split(/\s+/).filter(Boolean).slice(0, 2).map((w) => w[0]?.toUpperCase() ?? "").join("");
|
|
24
|
+
}
|
|
25
|
+
function AuditLog({ preset = "full", events, group, showTarget, showIp, empty, className, ...props }) {
|
|
26
|
+
const t = useDsMessages();
|
|
27
|
+
const locale = useDsLocale();
|
|
28
|
+
const p = PRESETS[preset];
|
|
29
|
+
const grouped = group ?? p.group;
|
|
30
|
+
const target = showTarget ?? p.showTarget;
|
|
31
|
+
const ip = showIp ?? p.showIp;
|
|
32
|
+
const sorted = [...events].sort((a, b) => new Date(b.at).getTime() - new Date(a.at).getTime());
|
|
33
|
+
const now = /* @__PURE__ */ new Date();
|
|
34
|
+
const yesterday = new Date(now);
|
|
35
|
+
yesterday.setDate(now.getDate() - 1);
|
|
36
|
+
const dayLabel = (d) => {
|
|
37
|
+
const k = dayKey(d);
|
|
38
|
+
if (k === dayKey(now)) return t.auditToday;
|
|
39
|
+
if (k === dayKey(yesterday)) return t.auditYesterday;
|
|
40
|
+
return new Intl.DateTimeFormat(locale, { weekday: "long", day: "numeric", month: "long", year: d.getFullYear() === now.getFullYear() ? void 0 : "numeric" }).format(d);
|
|
41
|
+
};
|
|
42
|
+
const groups = [];
|
|
43
|
+
for (const e of sorted) {
|
|
44
|
+
const d = new Date(e.at);
|
|
45
|
+
const key = grouped ? dayKey(d) : "all";
|
|
46
|
+
let g = groups[groups.length - 1];
|
|
47
|
+
if (!g || g.key !== key) {
|
|
48
|
+
g = { key, label: grouped ? dayLabel(d) : null, items: [] };
|
|
49
|
+
groups.push(g);
|
|
50
|
+
}
|
|
51
|
+
g.items.push(e);
|
|
52
|
+
}
|
|
53
|
+
const event = (e) => {
|
|
54
|
+
const actor = e.actor == null ? null : typeof e.actor === "string" ? { name: e.actor } : e.actor;
|
|
55
|
+
const tone = e.tone ?? "neutral";
|
|
56
|
+
const sentence = /* @__PURE__ */ jsxs("p", { className: cn("min-w-0 text-sm text-pretty text-muted-foreground", preset === "compact" && "truncate"), children: [
|
|
57
|
+
/* @__PURE__ */ jsx("span", { className: "font-(--ds-medium-weight) text-foreground", children: actor?.name ?? t.auditSystem }),
|
|
58
|
+
" ",
|
|
59
|
+
e.action,
|
|
60
|
+
target && e.target != null ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
61
|
+
" ",
|
|
62
|
+
/* @__PURE__ */ jsx("span", { className: "font-(--ds-medium-weight) text-foreground", children: e.target })
|
|
63
|
+
] }) : null
|
|
64
|
+
] });
|
|
65
|
+
const time = p.absolute ? /* @__PURE__ */ jsxs("span", { className: "flex flex-wrap gap-x-2 text-xs text-muted-foreground", children: [
|
|
66
|
+
/* @__PURE__ */ jsx(DateTime, { value: e.at, style: "time" }),
|
|
67
|
+
/* @__PURE__ */ jsx(RelativeTime, { value: e.at }),
|
|
68
|
+
ip && e.ip ? /* @__PURE__ */ jsx("span", { className: "font-mono", children: e.ip }) : null
|
|
69
|
+
] }) : /* @__PURE__ */ jsx("span", { className: "shrink-0 text-xs text-muted-foreground", children: /* @__PURE__ */ jsx(RelativeTime, { value: e.at }) });
|
|
70
|
+
if (p.timeline) {
|
|
71
|
+
return /* @__PURE__ */ jsxs("li", { "data-slot": "audit-log-event", "data-tone": tone, className: "relative flex gap-3 pb-4 last:pb-0", children: [
|
|
72
|
+
/* @__PURE__ */ jsxs("span", { "aria-hidden": "true", className: "relative flex w-(--ds-audit-dot) shrink-0 justify-center", children: [
|
|
73
|
+
/* @__PURE__ */ jsx("span", { className: cn("mt-1.5 size-(--ds-audit-dot) rounded-full", DOT_TONE[tone]) }),
|
|
74
|
+
/* @__PURE__ */ jsx("span", { className: "absolute top-(--ds-audit-dot) bottom-0 mt-2.5 w-px bg-border in-[li:last-child]:hidden" })
|
|
75
|
+
] }),
|
|
76
|
+
/* @__PURE__ */ jsxs("div", { className: "flex min-w-0 flex-1 flex-col gap-0.5", children: [
|
|
77
|
+
sentence,
|
|
78
|
+
e.detail != null ? /* @__PURE__ */ jsx("div", { className: "text-sm text-muted-foreground", children: e.detail }) : null,
|
|
79
|
+
time
|
|
80
|
+
] })
|
|
81
|
+
] }, e.id);
|
|
82
|
+
}
|
|
83
|
+
return /* @__PURE__ */ jsxs("li", { "data-slot": "audit-log-event", "data-tone": tone, className: cn("flex min-w-0 gap-3", preset === "compact" ? "items-center py-1.5" : "items-start py-2.5"), children: [
|
|
84
|
+
p.showAvatar ? /* @__PURE__ */ jsxs(Avatar, { size: "sm", className: "size-(--ds-audit-actor)", children: [
|
|
85
|
+
actor?.avatar ? /* @__PURE__ */ jsx(AvatarImage, { src: actor.avatar, alt: "" }) : null,
|
|
86
|
+
/* @__PURE__ */ jsx(AvatarFallback, { children: initials(actor?.name ?? t.auditSystem) })
|
|
87
|
+
] }) : /* @__PURE__ */ jsx("span", { "aria-hidden": "true", className: cn("size-(--ds-audit-dot) shrink-0 rounded-full", DOT_TONE[tone]) }),
|
|
88
|
+
/* @__PURE__ */ jsxs("div", { className: cn("flex min-w-0 flex-1", preset === "compact" ? "items-center gap-3" : "flex-col gap-0.5"), children: [
|
|
89
|
+
/* @__PURE__ */ jsx("div", { className: "min-w-0 flex-1", children: sentence }),
|
|
90
|
+
e.detail != null && preset !== "compact" ? /* @__PURE__ */ jsx("div", { className: "text-sm text-muted-foreground", children: e.detail }) : null,
|
|
91
|
+
time
|
|
92
|
+
] })
|
|
93
|
+
] }, e.id);
|
|
94
|
+
};
|
|
95
|
+
return /* @__PURE__ */ jsx("div", { "data-slot": "audit-log", "data-preset": preset, className: cn("flex min-w-0 flex-col gap-4", className), ...props, children: sorted.length === 0 ? empty : groups.map((g) => /* @__PURE__ */ jsxs("section", { "data-slot": "audit-log-day", className: "flex min-w-0 flex-col gap-1", children: [
|
|
96
|
+
g.label != null ? /* @__PURE__ */ jsx("h3", { className: "text-xs font-(--ds-medium-weight) text-muted-foreground first-letter:uppercase", children: g.label }) : null,
|
|
97
|
+
/* @__PURE__ */ jsx("ol", { className: cn("flex flex-col", preset !== "entity" && "divide-y divide-border"), children: g.items.map(event) })
|
|
98
|
+
] }, g.key)) });
|
|
99
|
+
}
|
|
100
|
+
export {
|
|
101
|
+
AuditLog
|
|
102
|
+
};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @group auth
|
|
5
|
+
* @summary Fondo decorativo y animado (puntos, rejilla, aurora, malla, anillos, haces o foto de marca) detrás de una pantalla de acceso o una portada; va dentro de un contenedor relativo.
|
|
6
|
+
* @see auth-layout — pantalla de acceso completa: su prop `backdrop` ya monta este fondo
|
|
7
|
+
* @see error-page — página de error con fondo (`backdrop`), sin montarlo a mano
|
|
8
|
+
* @see empty-state — estado vacío con fondo (`backdrop`), sin montarlo a mano
|
|
9
|
+
* @example Detrás de una portada
|
|
10
|
+
* <div className="relative isolate overflow-hidden">
|
|
11
|
+
* <AuthBackdrop variant="dots" />
|
|
12
|
+
* <h1>Bienvenida a Acme</h1>
|
|
13
|
+
* </div>
|
|
14
|
+
* @example Foto de marca teñida con cristal
|
|
15
|
+
* <div className="relative isolate overflow-hidden">
|
|
16
|
+
* <AuthBackdrop variant="image" media={<img src="/portada.jpg" alt="" />} mediaTint="brand" glass />
|
|
17
|
+
* </div>
|
|
18
|
+
*/
|
|
19
|
+
|
|
20
|
+
type AuthBackdropVariant = "none" | "dots" | "grid" | "aurora" | "mesh" | "glow" | "rings" | "beams" | "image";
|
|
21
|
+
declare function AuthBackdrop({ variant, interactive, ink, animated, media, mediaTint, glass, className, ...props }: Omit<React.ComponentProps<"div">, "children"> & {
|
|
22
|
+
variant?: AuthBackdropVariant;
|
|
23
|
+
/** image: la foto o el vídeo (un <img>/<video> con alt=""). */
|
|
24
|
+
media?: React.ReactNode;
|
|
25
|
+
/** image: tinte de marca (brand), dos tintas (duotone) o la foto tal cual (none). */
|
|
26
|
+
mediaTint?: "none" | "brand" | "duotone";
|
|
27
|
+
/** Cristal esmerilado encima del fondo (mesh, aurora, imagen…): suaviza y da profundidad. */
|
|
28
|
+
glass?: boolean;
|
|
29
|
+
/** Paralaje suave con inercia al mover el puntero (no en táctil ni con movimiento reducido). */
|
|
30
|
+
interactive?: boolean;
|
|
31
|
+
/** Tinta de puntos y líneas. */
|
|
32
|
+
ink?: "canvas" | "brand";
|
|
33
|
+
/** Motion graphics: false = fondo quieto. */
|
|
34
|
+
animated?: boolean;
|
|
35
|
+
}): React.JSX.Element | null;
|
|
36
|
+
|
|
37
|
+
export { AuthBackdrop, type AuthBackdropVariant };
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { AuthBackdropVariant } from './auth-backdrop.js';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* @group auth
|
|
6
|
+
* @summary Maqueta de la pantalla de acceso (centered, split, cover, banner, minimal) con logo, fondo, panel de marca e idioma y tema en la esquina; dentro va AuthForm u otra pieza de acceso.
|
|
7
|
+
* @see page-shell — maqueta de una página de la app ya dentro (no de acceso)
|
|
8
|
+
* @see error-page — 404, 500, sin conexión o mantenimiento
|
|
9
|
+
* @see auth-backdrop — solo el fondo animado, detrás de otra superficie
|
|
10
|
+
* @example Centrada, con idioma y tema siempre visibles
|
|
11
|
+
* <AuthLayout
|
|
12
|
+
* preset="centered"
|
|
13
|
+
* logo={<img src="/logo.svg" alt="Acme" />}
|
|
14
|
+
* toolbar={
|
|
15
|
+
* <>
|
|
16
|
+
* <LocaleSwitcher locales={locales} value={lang} onValueChange={setLang} />
|
|
17
|
+
* <ThemeToggle value={theme} onValueChange={setTheme} />
|
|
18
|
+
* </>
|
|
19
|
+
* }
|
|
20
|
+
* >
|
|
21
|
+
* <AuthForm preset="sign-in" onSubmit={signIn} />
|
|
22
|
+
* </AuthLayout>
|
|
23
|
+
* @example Panel de marca a un lado (preset split)
|
|
24
|
+
* <AuthLayout
|
|
25
|
+
* preset="split"
|
|
26
|
+
* logo={<img src="/logo.svg" alt="Acme" />}
|
|
27
|
+
* aside={
|
|
28
|
+
* <AuthAside>
|
|
29
|
+
* <AuthAsideTitle>Todo tu equipo, en un solo lugar</AuthAsideTitle>
|
|
30
|
+
* <AuthAsideText>Entra con tu método favorito.</AuthAsideText>
|
|
31
|
+
* </AuthAside>
|
|
32
|
+
* }
|
|
33
|
+
* >
|
|
34
|
+
* <AuthForm preset="social" providers={authProviders(["google", "microsoft"])} onProvider={signInSocial} />
|
|
35
|
+
* </AuthLayout>
|
|
36
|
+
* @example Sin tarjeta para una app interna
|
|
37
|
+
* <AuthLayout preset="minimal" backdrop="none">
|
|
38
|
+
* <AuthForm preset="sso" onSso={signInSso} />
|
|
39
|
+
* </AuthLayout>
|
|
40
|
+
*/
|
|
41
|
+
|
|
42
|
+
type AuthLayoutPreset = "centered" | "split" | "cover" | "banner" | "minimal";
|
|
43
|
+
type AuthSurface = "solid" | "glass" | "elevated" | "plain";
|
|
44
|
+
type AuthShape = "rounded" | "soft" | "sharp";
|
|
45
|
+
type AuthMotion = "full" | "entrance" | "off";
|
|
46
|
+
/** Movimiento de la pantalla de acceso (para que el contenido anime igual que la maqueta). */
|
|
47
|
+
declare function useAuthMotion(): AuthMotion;
|
|
48
|
+
/** Cómo se tiñe una imagen o vídeo de fondo con la marca: none = tal cual · brand = tono del
|
|
49
|
+
* primario (conserva luces y sombras) · duotone = blanco y negro en dos tintas de la paleta. */
|
|
50
|
+
type AuthMediaTint = "none" | "brand" | "duotone";
|
|
51
|
+
declare function AuthLayout({ preset, surface, shape, backdrop, backdropMedia, backdropGlass, asideBackdrop, interactive, motion, side, logo, aside, media, mediaTint, toolbar, footer, className, children, ...props }: React.ComponentProps<"div"> & {
|
|
52
|
+
preset?: AuthLayoutPreset;
|
|
53
|
+
/** Superficie de la tarjeta. */
|
|
54
|
+
surface?: AuthSurface;
|
|
55
|
+
/** Forma de la tarjeta. */
|
|
56
|
+
shape?: AuthShape;
|
|
57
|
+
/** Fondo animado del lienzo. */
|
|
58
|
+
backdrop?: AuthBackdropVariant;
|
|
59
|
+
/** backdrop="image": la foto o el vídeo del lienzo (si falta, usa `media`). Se tiñe con `mediaTint`. */
|
|
60
|
+
backdropMedia?: React.ReactNode;
|
|
61
|
+
/** Cristal esmerilado sobre el fondo del lienzo («mesh + glass», «image + glass»). */
|
|
62
|
+
backdropGlass?: boolean;
|
|
63
|
+
/** Fondo animado del panel de marca (split, banner). */
|
|
64
|
+
asideBackdrop?: AuthBackdropVariant;
|
|
65
|
+
/** Foco que sigue al puntero en el fondo. */
|
|
66
|
+
interactive?: boolean;
|
|
67
|
+
/** full = fondo animado y entrada · entrance = solo la entrada · off = quieto. */
|
|
68
|
+
motion?: AuthMotion;
|
|
69
|
+
/** split: lado del panel de marca · cover: lado de la tarjeta. */
|
|
70
|
+
side?: "start" | "end";
|
|
71
|
+
/** Logo de la app (imagen o SVG; su alto lo fija --ds-auth-logo-h). */
|
|
72
|
+
logo?: React.ReactNode;
|
|
73
|
+
/** Panel de marca (split, banner): normalmente <AuthAside>. */
|
|
74
|
+
aside?: React.ReactNode;
|
|
75
|
+
/** cover: imagen o vídeo de fondo (la app lo pone; se recorta a pantalla completa). */
|
|
76
|
+
media?: React.ReactNode;
|
|
77
|
+
/** cover: tinte de marca sobre `media` (la foto se adapta al color de la marca). */
|
|
78
|
+
mediaTint?: AuthMediaTint;
|
|
79
|
+
/** Esquina superior: idioma y tema, siempre visibles. */
|
|
80
|
+
toolbar?: React.ReactNode;
|
|
81
|
+
/** Pie: enlaces legales, versión, soporte. */
|
|
82
|
+
footer?: React.ReactNode;
|
|
83
|
+
}): React.JSX.Element;
|
|
84
|
+
declare function AuthAside({ logo, align, backdrop, media, mediaTint, className, children, ...props }: React.ComponentProps<"aside"> & {
|
|
85
|
+
/** Logo arriba del panel (en split, la maqueta lo quita del formulario en ancho). */
|
|
86
|
+
logo?: React.ReactNode;
|
|
87
|
+
/** between = logo arriba y texto abajo (por defecto) · center = todo agrupado y centrado en vertical (portal corporativo). */
|
|
88
|
+
align?: "between" | "center";
|
|
89
|
+
/** Fondo animado del panel (por defecto, el del preset). */
|
|
90
|
+
backdrop?: AuthBackdropVariant;
|
|
91
|
+
/** Imagen o vídeo del panel (sustituye al degradado; el texto se lee sobre un velo de la marca). */
|
|
92
|
+
media?: React.ReactNode;
|
|
93
|
+
/** Tinte de marca sobre `media` (por defecto brand: la foto toma el color de la marca). */
|
|
94
|
+
mediaTint?: AuthMediaTint;
|
|
95
|
+
}): React.JSX.Element;
|
|
96
|
+
declare function AuthAsideEyebrow({ className, ...props }: React.ComponentProps<"p">): React.JSX.Element;
|
|
97
|
+
declare function AuthAsideTitle({ className, ...props }: React.ComponentProps<"h2">): React.JSX.Element;
|
|
98
|
+
declare function AuthAsideText({ className, ...props }: React.ComponentProps<"p">): React.JSX.Element;
|
|
99
|
+
declare function AuthAsidePoints({ className, ...props }: React.ComponentProps<"ul">): React.JSX.Element;
|
|
100
|
+
declare function AuthAsidePoint({ icon, className, children, ...props }: React.ComponentProps<"li"> & {
|
|
101
|
+
icon?: React.ReactNode;
|
|
102
|
+
}): React.JSX.Element;
|
|
103
|
+
declare function AuthAsideQuote({ author, role, avatar, className, children, ...props }: React.ComponentProps<"figure"> & {
|
|
104
|
+
author?: React.ReactNode;
|
|
105
|
+
role?: React.ReactNode;
|
|
106
|
+
avatar?: React.ReactNode;
|
|
107
|
+
}): React.JSX.Element;
|
|
108
|
+
declare function AuthAsideFooter({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
109
|
+
|
|
110
|
+
export { AuthAside, AuthAsideEyebrow, AuthAsideFooter, AuthAsidePoint, AuthAsidePoints, AuthAsideQuote, AuthAsideText, AuthAsideTitle, AuthLayout, type AuthLayoutPreset, type AuthMediaTint, type AuthMotion, type AuthShape, type AuthSurface, useAuthMotion };
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { AuthLink, AuthErrorCode, AuthProviderOption } from '../lib/auth.js';
|
|
3
|
+
import { Button } from './button.js';
|
|
4
|
+
import '../lib/i18n.js';
|
|
5
|
+
import 'class-variance-authority/types';
|
|
6
|
+
import '@base-ui/react/use-render';
|
|
7
|
+
import 'class-variance-authority';
|
|
8
|
+
|
|
9
|
+
/** Bloque que entra en cascada según el `motion` de AuthLayout (índice = orden). */
|
|
10
|
+
declare function AuthStagger({ index, className, style, ...props }: React.ComponentProps<"div"> & {
|
|
11
|
+
index?: number;
|
|
12
|
+
}): React.JSX.Element;
|
|
13
|
+
declare function AuthHeader({ icon, title, description, align, className, ...props }: Omit<React.ComponentProps<"div">, "title"> & {
|
|
14
|
+
icon?: React.ReactNode;
|
|
15
|
+
title: React.ReactNode;
|
|
16
|
+
description?: React.ReactNode;
|
|
17
|
+
align?: "start" | "center";
|
|
18
|
+
}): React.JSX.Element;
|
|
19
|
+
declare function AuthDivider({ children, className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
20
|
+
declare function AuthProviders({ providers, onProvider, pending, lastUsed, layout, className, ...props }: Omit<React.ComponentProps<"div">, "onSelect"> & {
|
|
21
|
+
providers: AuthProviderOption[];
|
|
22
|
+
onProvider?: (id: string) => void;
|
|
23
|
+
/** Proveedor en curso (muestra el spinner y bloquea los demás). */
|
|
24
|
+
pending?: string | null;
|
|
25
|
+
/** Último método usado en este dispositivo (lo guarda la app): lleva una etiqueta. */
|
|
26
|
+
lastUsed?: string | null;
|
|
27
|
+
/** stack = uno por fila con texto · grid = dos columnas · icons = solo iconos. Por defecto: stack hasta 2, grid desde 3. */
|
|
28
|
+
layout?: "stack" | "grid" | "icons";
|
|
29
|
+
}): React.JSX.Element;
|
|
30
|
+
declare function AuthPasskeyButton({ pending, lastUsed, variant, children, ...props }: React.ComponentProps<typeof Button> & {
|
|
31
|
+
pending?: boolean;
|
|
32
|
+
lastUsed?: boolean;
|
|
33
|
+
}): React.JSX.Element;
|
|
34
|
+
/** Error de acceso: un código (texto del catálogo) o un nodo de la app. Se anuncia (role="alert"). */
|
|
35
|
+
declare function AuthError({ error, className, ...props }: Omit<React.ComponentProps<"div">, "children"> & {
|
|
36
|
+
error?: AuthErrorCode | React.ReactNode;
|
|
37
|
+
}): React.JSX.Element | null;
|
|
38
|
+
/** Enlace de acceso: URL → <a>; función → botón con aspecto de enlace (router de la app). */
|
|
39
|
+
declare function AuthAnchor({ to, className, children, ...props }: Omit<React.ComponentProps<"a">, "href" | "onClick"> & {
|
|
40
|
+
to: AuthLink;
|
|
41
|
+
}): React.JSX.Element;
|
|
42
|
+
|
|
43
|
+
export { AuthAnchor, AuthDivider, AuthError, AuthHeader, AuthPasskeyButton, AuthProviders, AuthStagger };
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { AuthLink } from '../lib/auth.js';
|
|
3
|
+
import '../lib/i18n.js';
|
|
4
|
+
|
|
5
|
+
type AuthStatusPreset = "signed-out" | "session-expired" | "check-email" | "verify-email" | "email-verified" | "password-changed" | "account-locked" | "link-expired" | "access-denied";
|
|
6
|
+
declare function AuthStatus({ preset, title, description, icon, email, action, actionLabel, secondaryAction, secondaryLabel, onResend, resendAfter, align, children, className, ...props }: Omit<React.ComponentProps<"div">, "title"> & {
|
|
7
|
+
preset?: AuthStatusPreset;
|
|
8
|
+
title?: React.ReactNode;
|
|
9
|
+
description?: React.ReactNode;
|
|
10
|
+
icon?: React.ReactNode;
|
|
11
|
+
/** check-email, verify-email: a qué correo se envió. */
|
|
12
|
+
email?: string;
|
|
13
|
+
/** Acción principal (URL o función del router). */
|
|
14
|
+
action?: AuthLink;
|
|
15
|
+
actionLabel?: React.ReactNode;
|
|
16
|
+
secondaryAction?: AuthLink;
|
|
17
|
+
secondaryLabel?: React.ReactNode;
|
|
18
|
+
onResend?: () => void | Promise<void>;
|
|
19
|
+
resendAfter?: number;
|
|
20
|
+
align?: "start" | "center";
|
|
21
|
+
}): React.JSX.Element;
|
|
22
|
+
|
|
23
|
+
export { AuthStatus, type AuthStatusPreset };
|