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
|
@@ -32,6 +32,8 @@ const BRAND_PUBLIC_TOKENS = /* @__PURE__ */ new Set([
|
|
|
32
32
|
"ds-appbar-h",
|
|
33
33
|
"ds-appbar-h-compact",
|
|
34
34
|
"ds-appbar-px",
|
|
35
|
+
"ds-audit-actor",
|
|
36
|
+
"ds-audit-dot",
|
|
35
37
|
"ds-auth-aside-bg",
|
|
36
38
|
"ds-auth-aside-fg",
|
|
37
39
|
"ds-auth-aside-from",
|
|
@@ -419,6 +421,9 @@ const BRAND_PUBLIC_TOKENS = /* @__PURE__ */ new Set([
|
|
|
419
421
|
"ds-odometer-duration",
|
|
420
422
|
"ds-odometer-ease",
|
|
421
423
|
"ds-odometer-stagger",
|
|
424
|
+
"ds-onboarding-check",
|
|
425
|
+
"ds-onboarding-check-done",
|
|
426
|
+
"ds-onboarding-current-bg",
|
|
422
427
|
"ds-otp-char-animation",
|
|
423
428
|
"ds-otp-pop-scale",
|
|
424
429
|
"ds-overlay-backdrop",
|
|
@@ -451,6 +456,10 @@ const BRAND_PUBLIC_TOKENS = /* @__PURE__ */ new Set([
|
|
|
451
456
|
"ds-panel-p",
|
|
452
457
|
"ds-panel-p-lg",
|
|
453
458
|
"ds-panel-p-sm",
|
|
459
|
+
"ds-permission-col-min",
|
|
460
|
+
"ds-permission-label-min",
|
|
461
|
+
"ds-plan-accent-w",
|
|
462
|
+
"ds-plan-usage-min",
|
|
454
463
|
"ds-popover-p",
|
|
455
464
|
"ds-popover-w",
|
|
456
465
|
"ds-pricing-featured-ring",
|
|
@@ -652,6 +661,11 @@ const BRAND_PUBLIC_TOKENS = /* @__PURE__ */ new Set([
|
|
|
652
661
|
"ds-touch-target",
|
|
653
662
|
"ds-track-bg",
|
|
654
663
|
"ds-track-h",
|
|
664
|
+
"ds-upgrade-accent",
|
|
665
|
+
"ds-upgrade-accent-soft",
|
|
666
|
+
"ds-upgrade-blur",
|
|
667
|
+
"ds-upgrade-overlay-max-w",
|
|
668
|
+
"ds-upgrade-scrim",
|
|
655
669
|
"ds-usage-fill",
|
|
656
670
|
"ds-usage-fill-critical",
|
|
657
671
|
"ds-usage-fill-warning",
|
|
@@ -659,6 +673,8 @@ const BRAND_PUBLIC_TOKENS = /* @__PURE__ */ new Set([
|
|
|
659
673
|
"ds-week-day-radius",
|
|
660
674
|
"ds-week-gap",
|
|
661
675
|
"ds-widest-tracking",
|
|
676
|
+
"ds-workspace-logo",
|
|
677
|
+
"ds-workspace-menu-w",
|
|
662
678
|
"ds-z-overlay",
|
|
663
679
|
"ds-z-raised",
|
|
664
680
|
"ds-z-sidebar",
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/** Tokens de una piel: nombre con o sin `--` → valor CSS. */
|
|
2
|
+
type BrandTokenMap = Record<string, string>;
|
|
3
|
+
/** Marca con las dos pieles. Un objeto plano equivale a `{ light }`. */
|
|
4
|
+
type BrandSkins = {
|
|
5
|
+
light?: BrandTokenMap;
|
|
6
|
+
dark?: BrandTokenMap;
|
|
7
|
+
};
|
|
8
|
+
type BrandSkinName = "light" | "dark";
|
|
9
|
+
type BrandIssueCode = "unknown-token" | "unsafe-value" | "empty-value" | "contrast" | "contrast-unchecked";
|
|
10
|
+
type BrandIssue = {
|
|
11
|
+
skin: BrandSkinName;
|
|
12
|
+
/** Nombre sin `--` (en un par de contraste, el del texto). */
|
|
13
|
+
token: string;
|
|
14
|
+
code: BrandIssueCode;
|
|
15
|
+
message: string;
|
|
16
|
+
ratio?: number;
|
|
17
|
+
min?: number;
|
|
18
|
+
};
|
|
19
|
+
type BrandValidationOptions = {
|
|
20
|
+
/** Colores ya resueltos del tema activo por piel (background, foreground, card…), para medir el contraste. */
|
|
21
|
+
base?: {
|
|
22
|
+
light?: BrandTokenMap;
|
|
23
|
+
dark?: BrandTokenMap;
|
|
24
|
+
};
|
|
25
|
+
/** Longitud máxima de un valor (256 por defecto). */
|
|
26
|
+
maxValueLength?: number;
|
|
27
|
+
};
|
|
28
|
+
type BrandValidation = {
|
|
29
|
+
ok: boolean;
|
|
30
|
+
/** Solo los tokens válidos, con su `--`. */
|
|
31
|
+
light: Record<string, string>;
|
|
32
|
+
dark: Record<string, string>;
|
|
33
|
+
errors: BrandIssue[];
|
|
34
|
+
warnings: BrandIssue[];
|
|
35
|
+
};
|
|
36
|
+
/** Pares de contraste que se miden si la marca toca alguno de sus dos miembros: [texto, fondo, mínimo]. */
|
|
37
|
+
declare const BRAND_CONTRAST_PAIRS: ReadonlyArray<readonly [string, string, number]>;
|
|
38
|
+
/** Valida una marca que viene de datos: nombres públicos, valores seguros y contraste AA. */
|
|
39
|
+
declare function validateBrandTokens(input: BrandTokenMap | BrandSkins | null | undefined, options?: BrandValidationOptions): BrandValidation;
|
|
40
|
+
type BrandCssOptions = {
|
|
41
|
+
/** Selector de la piel clara. Por defecto `:root:root`, que gana al tema sea cual sea el orden de las hojas. */
|
|
42
|
+
selector?: string;
|
|
43
|
+
/** Selector de la piel oscura. Por defecto el modo `.dark` de orbital-ds, en <html> o en un contenedor. */
|
|
44
|
+
darkSelector?: string;
|
|
45
|
+
};
|
|
46
|
+
/**
|
|
47
|
+
* CSS de una marca YA validada. Lanza si la validación tiene errores: así una marca rota nunca llega a la página.
|
|
48
|
+
* Devuelve "" si no hay nada que aplicar.
|
|
49
|
+
*/
|
|
50
|
+
declare function brandTokensToCss(brand: BrandValidation, { selector, darkSelector }?: BrandCssOptions): string;
|
|
51
|
+
|
|
52
|
+
export { BRAND_CONTRAST_PAIRS, type BrandCssOptions, type BrandIssue, type BrandIssueCode, type BrandSkinName, type BrandSkins, type BrandTokenMap, type BrandValidation, type BrandValidationOptions, brandTokensToCss, validateBrandTokens };
|
|
@@ -0,0 +1,307 @@
|
|
|
1
|
+
import { EChartsCoreOption } from 'echarts/core';
|
|
2
|
+
|
|
3
|
+
/** Valor de una serie: `null` = sin dato (hueco), nunca 0. */
|
|
4
|
+
type DsChartValue = number | null;
|
|
5
|
+
interface DsSeries {
|
|
6
|
+
name: string;
|
|
7
|
+
data: DsChartValue[];
|
|
8
|
+
/** Grupo de apilado propio (si no, el de `stack` del constructor). */
|
|
9
|
+
stack?: string;
|
|
10
|
+
}
|
|
11
|
+
/** Formatea un valor en el tooltip y las etiquetas (p. ej. con Intl.NumberFormat). */
|
|
12
|
+
type DsValueFormatter = (value: number) => string;
|
|
13
|
+
/** Línea o área de referencia (las crean `referenceLine` y `referenceArea`). */
|
|
14
|
+
type DsReference = {
|
|
15
|
+
kind: "line";
|
|
16
|
+
markLine: Record<string, unknown>;
|
|
17
|
+
} | {
|
|
18
|
+
kind: "area";
|
|
19
|
+
markArea: Record<string, unknown>;
|
|
20
|
+
};
|
|
21
|
+
type Obj = Record<string, unknown>;
|
|
22
|
+
interface CommonOptions {
|
|
23
|
+
/** Muestra la leyenda (por defecto, si hay más de una serie). */
|
|
24
|
+
legend?: boolean;
|
|
25
|
+
/** Formato de los valores (tooltip y ejes de valor). */
|
|
26
|
+
valueFormatter?: DsValueFormatter;
|
|
27
|
+
/** Opciones propias fusionadas por encima del resultado. */
|
|
28
|
+
extend?: Obj;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Línea de referencia (objetivo, umbral de SLA…). `axis` es el eje del VALOR: "y" en
|
|
32
|
+
* gráficos verticales (por defecto) y "x" en barras horizontales.
|
|
33
|
+
*/
|
|
34
|
+
declare function referenceLine(value: number, label?: string, { axis }?: {
|
|
35
|
+
axis?: "x" | "y";
|
|
36
|
+
}): DsReference;
|
|
37
|
+
/**
|
|
38
|
+
* Banda de referencia entre dos valores (franja horaria, zona de alerta…). Con `axis: "x"`
|
|
39
|
+
* acepta categorías del eje X (p. ej. "08:00" → "15:00"); con "y", valores.
|
|
40
|
+
*/
|
|
41
|
+
declare function referenceArea(from: number | string, to: number | string, label?: string, { axis }?: {
|
|
42
|
+
axis?: "x" | "y";
|
|
43
|
+
}): DsReference;
|
|
44
|
+
/**
|
|
45
|
+
* Escapa texto para HTML. Un `formatter` de tooltip que devuelve una cadena se pinta COMO
|
|
46
|
+
* HTML: todo lo interpolado (categorías, nombres de serie, etiquetas, valores formateados)
|
|
47
|
+
* puede venir de datos de usuario y debe pasar por aquí. El tooltip por defecto de ECharts
|
|
48
|
+
* (nombres y `valueFormatter`) ya escapa; las etiquetas de serie, markLine y markArea son
|
|
49
|
+
* texto del lienzo/SVG, no HTML.
|
|
50
|
+
*/
|
|
51
|
+
declare function escapeHtml(value: unknown): string;
|
|
52
|
+
interface LineOptionInput extends CommonOptions {
|
|
53
|
+
categories: Array<string | number>;
|
|
54
|
+
series: DsSeries[];
|
|
55
|
+
/** Rellena el área bajo cada línea. */
|
|
56
|
+
area?: boolean;
|
|
57
|
+
/** Apila las series (true = un solo grupo, o el nombre del grupo). */
|
|
58
|
+
stack?: boolean | string;
|
|
59
|
+
smooth?: boolean;
|
|
60
|
+
/** Sin puntos en la línea (series largas). */
|
|
61
|
+
showSymbols?: boolean;
|
|
62
|
+
/** Une los huecos (`null`) en lugar de cortar la línea. */
|
|
63
|
+
connectNulls?: boolean;
|
|
64
|
+
references?: DsReference[];
|
|
65
|
+
yName?: string;
|
|
66
|
+
/** Activa el zoom horizontal con la rueda y el arrastre. */
|
|
67
|
+
zoom?: boolean;
|
|
68
|
+
}
|
|
69
|
+
declare function lineOption(input: LineOptionInput): EChartsCoreOption;
|
|
70
|
+
interface BarOptionInput extends CommonOptions {
|
|
71
|
+
categories: Array<string | number>;
|
|
72
|
+
series: DsSeries[];
|
|
73
|
+
/** Barras horizontales (categorías en el eje Y). */
|
|
74
|
+
horizontal?: boolean;
|
|
75
|
+
stack?: boolean | string;
|
|
76
|
+
/**
|
|
77
|
+
* Ranking: ordena la PRIMERA serie de mayor a menor (horizontal por defecto, la mayor
|
|
78
|
+
* arriba) y reordena las demás igual.
|
|
79
|
+
*/
|
|
80
|
+
ranking?: boolean;
|
|
81
|
+
/** Etiqueta con el valor al final de cada barra. */
|
|
82
|
+
showLabels?: boolean;
|
|
83
|
+
references?: DsReference[];
|
|
84
|
+
}
|
|
85
|
+
declare function barOption(input: BarOptionInput): EChartsCoreOption;
|
|
86
|
+
interface ComboOptionInput extends Omit<CommonOptions, "valueFormatter"> {
|
|
87
|
+
categories: Array<string | number>;
|
|
88
|
+
/** Series de barras (eje izquierdo/inicial). */
|
|
89
|
+
bars: DsSeries[];
|
|
90
|
+
/** Series de línea (eje derecho/final). */
|
|
91
|
+
lines: DsSeries[];
|
|
92
|
+
barAxisName?: string;
|
|
93
|
+
lineAxisName?: string;
|
|
94
|
+
barFormatter?: DsValueFormatter;
|
|
95
|
+
lineFormatter?: DsValueFormatter;
|
|
96
|
+
stackBars?: boolean;
|
|
97
|
+
smooth?: boolean;
|
|
98
|
+
/** Referencias sobre el eje de las líneas (p. ej. objetivo de SLA). */
|
|
99
|
+
references?: DsReference[];
|
|
100
|
+
}
|
|
101
|
+
declare function comboOption(input: ComboOptionInput): EChartsCoreOption;
|
|
102
|
+
interface HeatmapOptionInput extends CommonOptions {
|
|
103
|
+
/** Columnas (p. ej. horas "00"…"23"). */
|
|
104
|
+
xCategories: Array<string | number>;
|
|
105
|
+
/** Filas (p. ej. días "Lun"…"Dom"). */
|
|
106
|
+
yCategories: Array<string | number>;
|
|
107
|
+
/** Matriz [fila][columna]; `null` = sin dato (celda vacía, nunca 0). */
|
|
108
|
+
values: DsChartValue[][];
|
|
109
|
+
min?: number;
|
|
110
|
+
max?: number;
|
|
111
|
+
/** Muestra el valor en cada celda. */
|
|
112
|
+
showLabels?: boolean;
|
|
113
|
+
/** Muestra el mapa visual (escala) bajo el gráfico. */
|
|
114
|
+
showScale?: boolean;
|
|
115
|
+
}
|
|
116
|
+
declare function heatmapOption(input: HeatmapOptionInput): EChartsCoreOption;
|
|
117
|
+
interface SankeyLink {
|
|
118
|
+
source: string;
|
|
119
|
+
target: string;
|
|
120
|
+
value: number;
|
|
121
|
+
}
|
|
122
|
+
interface SankeyOptionInput extends CommonOptions {
|
|
123
|
+
/** Nodos (si se omiten, salen de los enlaces). */
|
|
124
|
+
nodes?: string[];
|
|
125
|
+
links: SankeyLink[];
|
|
126
|
+
orient?: "horizontal" | "vertical";
|
|
127
|
+
}
|
|
128
|
+
declare function sankeyOption(input: SankeyOptionInput): EChartsCoreOption;
|
|
129
|
+
interface GaugeOptionInput extends Omit<CommonOptions, "legend"> {
|
|
130
|
+
value: number | null;
|
|
131
|
+
min?: number;
|
|
132
|
+
max?: number;
|
|
133
|
+
/** Nombre bajo la cifra (p. ej. "SLA"). */
|
|
134
|
+
name?: string;
|
|
135
|
+
/** Marcas del eje (por defecto, 5 tramos). */
|
|
136
|
+
splitNumber?: number;
|
|
137
|
+
}
|
|
138
|
+
declare function gaugeOption(input: GaugeOptionInput): EChartsCoreOption;
|
|
139
|
+
interface PieOptionInput extends CommonOptions {
|
|
140
|
+
data: Array<{
|
|
141
|
+
name: string;
|
|
142
|
+
value: number;
|
|
143
|
+
}>;
|
|
144
|
+
/** Donut (por defecto) o tarta llena. */
|
|
145
|
+
donut?: boolean;
|
|
146
|
+
/** Texto en el centro del donut (p. ej. el total). */
|
|
147
|
+
centerLabel?: string;
|
|
148
|
+
centerSubLabel?: string;
|
|
149
|
+
showLabels?: boolean;
|
|
150
|
+
}
|
|
151
|
+
declare function pieOption(input: PieOptionInput): EChartsCoreOption;
|
|
152
|
+
interface ScatterOptionInput extends CommonOptions {
|
|
153
|
+
/** Cada serie es un grupo de puntos `[x, y]` (o `[x, y, tamaño]` con `sizeAxis`). */
|
|
154
|
+
series: Array<{
|
|
155
|
+
name: string;
|
|
156
|
+
data: Array<[number, number] | [number, number, number]>;
|
|
157
|
+
}>;
|
|
158
|
+
xName?: string;
|
|
159
|
+
yName?: string;
|
|
160
|
+
/** La tercera coordenada de cada punto da su tamaño (burbujas). */
|
|
161
|
+
sizeAxis?: boolean;
|
|
162
|
+
/** Formateador del eje X (el del valor se usa para Y). */
|
|
163
|
+
xFormatter?: DsValueFormatter;
|
|
164
|
+
zoom?: boolean;
|
|
165
|
+
}
|
|
166
|
+
declare function scatterOption(input: ScatterOptionInput): EChartsCoreOption;
|
|
167
|
+
interface RadarOptionInput extends CommonOptions {
|
|
168
|
+
/** Dimensiones y su máximo (la escala de cada eje). */
|
|
169
|
+
indicators: Array<{
|
|
170
|
+
name: string;
|
|
171
|
+
max: number;
|
|
172
|
+
}>;
|
|
173
|
+
series: Array<{
|
|
174
|
+
name: string;
|
|
175
|
+
data: number[];
|
|
176
|
+
}>;
|
|
177
|
+
/** Rellena el área de cada serie. */
|
|
178
|
+
area?: boolean;
|
|
179
|
+
}
|
|
180
|
+
declare function radarOption(input: RadarOptionInput): EChartsCoreOption;
|
|
181
|
+
interface FunnelOptionInput extends CommonOptions {
|
|
182
|
+
/** Etapas de mayor a menor; el nombre sale en la etiqueta. */
|
|
183
|
+
data: Array<{
|
|
184
|
+
name: string;
|
|
185
|
+
value: number;
|
|
186
|
+
}>;
|
|
187
|
+
/** Muestra el valor en cada etapa. */
|
|
188
|
+
showValues?: boolean;
|
|
189
|
+
}
|
|
190
|
+
declare function funnelOption(input: FunnelOptionInput): EChartsCoreOption;
|
|
191
|
+
interface HierarchyNode {
|
|
192
|
+
name: string;
|
|
193
|
+
value?: number;
|
|
194
|
+
children?: HierarchyNode[];
|
|
195
|
+
}
|
|
196
|
+
interface TreemapOptionInput extends CommonOptions {
|
|
197
|
+
data: HierarchyNode[];
|
|
198
|
+
/** Muestra la ruta de migas para bajar y subir de nivel. */
|
|
199
|
+
breadcrumb?: boolean;
|
|
200
|
+
}
|
|
201
|
+
/** Peso relativo de partes de un todo con varios niveles (presupuesto, espacio en disco). */
|
|
202
|
+
declare function treemapOption(input: TreemapOptionInput): EChartsCoreOption;
|
|
203
|
+
interface SunburstOptionInput extends CommonOptions {
|
|
204
|
+
data: HierarchyNode[];
|
|
205
|
+
}
|
|
206
|
+
/** Composición en anillos concéntricos (cada anillo, un nivel de la jerarquía). */
|
|
207
|
+
declare function sunburstOption(input: SunburstOptionInput): EChartsCoreOption;
|
|
208
|
+
interface CandlestickOptionInput extends CommonOptions {
|
|
209
|
+
categories: Array<string | number>;
|
|
210
|
+
/** Por categoría: `[apertura, cierre, mínimo, máximo]`. */
|
|
211
|
+
data: Array<[number, number, number, number]>;
|
|
212
|
+
name?: string;
|
|
213
|
+
zoom?: boolean;
|
|
214
|
+
}
|
|
215
|
+
/** Precios o medidas con apertura, cierre, mínimo y máximo por periodo. */
|
|
216
|
+
declare function candlestickOption(input: CandlestickOptionInput): EChartsCoreOption;
|
|
217
|
+
interface BoxplotOptionInput extends CommonOptions {
|
|
218
|
+
categories: Array<string | number>;
|
|
219
|
+
/** Por categoría, ya calculado: `[mínimo, Q1, mediana, Q3, máximo]`. */
|
|
220
|
+
data: Array<[number, number, number, number, number]>;
|
|
221
|
+
name?: string;
|
|
222
|
+
horizontal?: boolean;
|
|
223
|
+
}
|
|
224
|
+
/** Distribución de una medida por grupo (mediana, cuartiles y extremos). */
|
|
225
|
+
declare function boxplotOption(input: BoxplotOptionInput): EChartsCoreOption;
|
|
226
|
+
interface WaterfallStep {
|
|
227
|
+
name: string;
|
|
228
|
+
/** Variación con signo: positiva suma (altas, expansión) y negativa resta (bajas, contracción). */
|
|
229
|
+
value: number;
|
|
230
|
+
}
|
|
231
|
+
interface WaterfallOptionInput extends CommonOptions {
|
|
232
|
+
/** Barra inicial con el valor de partida (MRR al empezar el mes). Opcional. */
|
|
233
|
+
start?: {
|
|
234
|
+
name: string;
|
|
235
|
+
value: number;
|
|
236
|
+
};
|
|
237
|
+
steps: WaterfallStep[];
|
|
238
|
+
/** Barra final con el total acumulado (su etiqueta). `false` = sin barra final. */
|
|
239
|
+
end?: string | false;
|
|
240
|
+
/** Nombres de las series (leyenda y tooltip), en el idioma de la app. */
|
|
241
|
+
increaseLabel: string;
|
|
242
|
+
decreaseLabel: string;
|
|
243
|
+
totalLabel: string;
|
|
244
|
+
showLabels?: boolean;
|
|
245
|
+
}
|
|
246
|
+
/**
|
|
247
|
+
* Cascada: cómo se pasa de un valor a otro sumando y restando (puente de MRR: nuevo, expansión,
|
|
248
|
+
* contracción, bajas). Pensada para acumulados que no bajan de cero.
|
|
249
|
+
*/
|
|
250
|
+
declare function waterfallOption(input: WaterfallOptionInput): EChartsCoreOption;
|
|
251
|
+
interface CohortOptionInput extends CommonOptions {
|
|
252
|
+
/** Cohortes (filas), p. ej. el mes de alta. */
|
|
253
|
+
cohorts: string[];
|
|
254
|
+
/** Periodos desde el alta (columnas): «Mes 0», «Mes 1»… */
|
|
255
|
+
periods: string[];
|
|
256
|
+
/** Retención por cohorte y periodo (0–100 por defecto); `null` = aún no ha llegado (triángulo). */
|
|
257
|
+
values: DsChartValue[][];
|
|
258
|
+
min?: number;
|
|
259
|
+
max?: number;
|
|
260
|
+
showLabels?: boolean;
|
|
261
|
+
showScale?: boolean;
|
|
262
|
+
}
|
|
263
|
+
/** Retención por cohortes: qué parte de cada grupo de altas sigue activa con el tiempo. */
|
|
264
|
+
declare function cohortOption(input: CohortOptionInput): EChartsCoreOption;
|
|
265
|
+
interface CalendarOptionInput extends CommonOptions {
|
|
266
|
+
/** Un valor por día: `[fecha ISO "2026-03-14", valor]`; `null` = sin dato. */
|
|
267
|
+
data: Array<[string, DsChartValue]>;
|
|
268
|
+
/** Año ("2026") o intervalo `["2026-01-01", "2026-06-30"]`. */
|
|
269
|
+
range: string | [string, string];
|
|
270
|
+
/** Idioma de los nombres de días y meses (Intl). Por defecto, inglés. */
|
|
271
|
+
locale?: string;
|
|
272
|
+
/** Primer día de la semana: 0 = domingo, 1 = lunes (por defecto). */
|
|
273
|
+
firstDay?: 0 | 1;
|
|
274
|
+
min?: number;
|
|
275
|
+
max?: number;
|
|
276
|
+
showScale?: boolean;
|
|
277
|
+
}
|
|
278
|
+
/** Actividad diaria en un calendario (uso, despliegues, incidencias por día). */
|
|
279
|
+
declare function calendarOption(input: CalendarOptionInput): EChartsCoreOption;
|
|
280
|
+
interface GraphNode {
|
|
281
|
+
id: string;
|
|
282
|
+
name?: string;
|
|
283
|
+
/** Peso del nodo (tamaño); sin él, todos iguales. */
|
|
284
|
+
value?: number;
|
|
285
|
+
/** Categoría (leyenda y color del tema), por nombre de `categories`. */
|
|
286
|
+
category?: string;
|
|
287
|
+
}
|
|
288
|
+
interface GraphLink {
|
|
289
|
+
source: string;
|
|
290
|
+
target: string;
|
|
291
|
+
value?: number;
|
|
292
|
+
}
|
|
293
|
+
interface GraphOptionInput extends CommonOptions {
|
|
294
|
+
nodes: GraphNode[];
|
|
295
|
+
links: GraphLink[];
|
|
296
|
+
/** Disposición: fuerzas (por defecto) o en círculo. */
|
|
297
|
+
layout?: "force" | "circular";
|
|
298
|
+
/** Categorías de nodo, en orden (cada una toma un color de la paleta del tema). */
|
|
299
|
+
categories?: string[];
|
|
300
|
+
/** Flechas en los enlaces (dependencias: quién llama a quién). */
|
|
301
|
+
directed?: boolean;
|
|
302
|
+
showLabels?: boolean;
|
|
303
|
+
}
|
|
304
|
+
/** Red de relaciones: dependencias entre servicios, integraciones o equipos. */
|
|
305
|
+
declare function graphOption(input: GraphOptionInput): EChartsCoreOption;
|
|
306
|
+
|
|
307
|
+
export { type BarOptionInput, type BoxplotOptionInput, type CalendarOptionInput, type CandlestickOptionInput, type CohortOptionInput, type ComboOptionInput, type DsChartValue, type DsReference, type DsSeries, type DsValueFormatter, type FunnelOptionInput, type GaugeOptionInput, type GraphLink, type GraphNode, type GraphOptionInput, type HeatmapOptionInput, type HierarchyNode, type LineOptionInput, type PieOptionInput, type RadarOptionInput, type SankeyLink, type SankeyOptionInput, type ScatterOptionInput, type SunburstOptionInput, type TreemapOptionInput, type WaterfallOptionInput, type WaterfallStep, barOption, boxplotOption, calendarOption, candlestickOption, cohortOption, comboOption, escapeHtml, funnelOption, gaugeOption, graphOption, heatmapOption, lineOption, pieOption, radarOption, referenceArea, referenceLine, sankeyOption, scatterOption, sunburstOption, treemapOption, waterfallOption };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { EChartsCoreOption } from 'echarts/core';
|
|
2
|
+
import { DsChartTokens, DsEchartsTheme } from './echarts-theme.js';
|
|
3
|
+
|
|
4
|
+
interface RenderEChartOptions {
|
|
5
|
+
width: number;
|
|
6
|
+
height: number;
|
|
7
|
+
/** Valores del tema (piel `light` o `dark` de `<tema>.tokens.json`), o un tema ya montado. */
|
|
8
|
+
tokens?: DsChartTokens;
|
|
9
|
+
theme?: DsEchartsTheme;
|
|
10
|
+
/** Sin animación por defecto: en un documento no se ve. */
|
|
11
|
+
animation?: boolean;
|
|
12
|
+
}
|
|
13
|
+
declare function renderEChartToSvg(option: EChartsCoreOption, { width, height, tokens, theme, animation }: RenderEChartOptions): string;
|
|
14
|
+
|
|
15
|
+
export { type RenderEChartOptions, renderEChartToSvg };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import * as echarts from 'echarts/core';
|
|
2
|
+
export { echarts };
|
|
3
|
+
export { EChartsCoreOption as DsEChartOption } from 'echarts/core';
|
|
4
|
+
|
|
5
|
+
/** Registra los tipos y componentes de orbital-ds (una sola vez) y devuelve `echarts`. */
|
|
6
|
+
declare function dsEcharts(): typeof echarts;
|
|
7
|
+
|
|
8
|
+
export { dsEcharts };
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/** Valores de un tema que necesita un gráfico (lo que trae `<tema>.tokens.json`). */
|
|
2
|
+
interface DsChartTokens {
|
|
3
|
+
palette: string[];
|
|
4
|
+
foreground: string;
|
|
5
|
+
muted: string;
|
|
6
|
+
border: string;
|
|
7
|
+
surface: string;
|
|
8
|
+
surfaceForeground: string;
|
|
9
|
+
fontSans: string;
|
|
10
|
+
fontDisplay: string;
|
|
11
|
+
motionBaseMs: number;
|
|
12
|
+
motionSlowMs: number;
|
|
13
|
+
}
|
|
14
|
+
interface DsEchartsTheme {
|
|
15
|
+
color: string[];
|
|
16
|
+
backgroundColor: string;
|
|
17
|
+
textStyle: {
|
|
18
|
+
fontFamily: string;
|
|
19
|
+
color: string;
|
|
20
|
+
};
|
|
21
|
+
[key: string]: unknown;
|
|
22
|
+
}
|
|
23
|
+
/** Color CSS cualquiera (oklch, color-mix…) → `rgba(r, g, b, a)`. Fuera del navegador lo devuelve tal cual. */
|
|
24
|
+
declare function dsResolveColor(value: string): string;
|
|
25
|
+
/** Lee del navegador los valores del tema ACTIVO (con la marca de la app). */
|
|
26
|
+
declare function dsChartTokens(el?: Element): DsChartTokens;
|
|
27
|
+
/** Paleta de series del tema activo, en RGB. */
|
|
28
|
+
declare function dsChartPalette(el?: Element): string[];
|
|
29
|
+
/** Tema de ECharts a partir de los valores de un tema (navegador o servidor). */
|
|
30
|
+
declare function dsEchartsThemeFromTokens(t: DsChartTokens, { reducedMotion }?: {
|
|
31
|
+
reducedMotion?: boolean | undefined;
|
|
32
|
+
}): DsEchartsTheme;
|
|
33
|
+
/** Tema de ECharts para el tema ACTIVO en el navegador. */
|
|
34
|
+
declare function dsEchartsTheme(el?: Element): DsEchartsTheme;
|
|
35
|
+
|
|
36
|
+
export { type DsChartTokens, type DsEchartsTheme, dsChartPalette, dsChartTokens, dsEchartsTheme, dsEchartsThemeFromTokens, dsResolveColor };
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
type DsUnitDisplay = "short" | "long" | "narrow";
|
|
2
|
+
interface DsQuantityOptions {
|
|
3
|
+
/** Etiqueta BCP 47 (p. ej. "es", "pt-BR"). Por defecto, la del entorno. */
|
|
4
|
+
locale?: string;
|
|
5
|
+
/** "si" (1000, GB) por defecto; "binary" (1024, GiB) para memoria o cuando el contrato lo diga. */
|
|
6
|
+
system?: "si" | "binary";
|
|
7
|
+
/** Forma de la unidad: "short" (12 GB), "long" (12 gigabytes), "narrow" (12GB). */
|
|
8
|
+
unitDisplay?: DsUnitDisplay;
|
|
9
|
+
/** Decimales máximos. Por defecto: 1 en bytes y tasas escaladas, 0 en el resto salvo que el valor los traiga. */
|
|
10
|
+
maximumFractionDigits?: number;
|
|
11
|
+
/** Notación compacta para recuentos grandes (1,2 mil). */
|
|
12
|
+
compact?: boolean;
|
|
13
|
+
}
|
|
14
|
+
/** ¿La unidad es de bytes (UCUM)? */
|
|
15
|
+
declare function isByteUnit(unit: string | undefined): boolean;
|
|
16
|
+
/** Pasa un valor en bytes UCUM (`GBy`, `MiBy`…) a bytes. Devuelve null si la unidad no es de bytes. */
|
|
17
|
+
declare function toBytes(value: number, unit: string): number | null;
|
|
18
|
+
/**
|
|
19
|
+
* Formatea un valor con su unidad UCUM en el idioma indicado.
|
|
20
|
+
*
|
|
21
|
+
* formatQuantity(12_000_000_000, "By", { locale: "es" }) → "12 GB"
|
|
22
|
+
* formatQuantity(50, "GBy", { locale: "es" }) → "50 GB"
|
|
23
|
+
* formatQuantity(73.5, "%", { locale: "es" }) → "73,5 %"
|
|
24
|
+
* formatQuantity(3, "{device}") → "3"
|
|
25
|
+
* formatQuantity(null, "By") → null
|
|
26
|
+
*/
|
|
27
|
+
declare function formatQuantity(value: number | null | undefined, unit?: string, options?: DsQuantityOptions): string | null;
|
|
28
|
+
/** Proporción (0..1) como porcentaje: formatRatio(0.24, { locale: "es" }) → "24 %". */
|
|
29
|
+
declare function formatRatio(ratio: number | null | undefined, options?: {
|
|
30
|
+
locale?: string;
|
|
31
|
+
maximumFractionDigits?: number;
|
|
32
|
+
}): string | null;
|
|
33
|
+
type DsDateInput = Date | string | number | null | undefined;
|
|
34
|
+
/** Pasa una fecha (Date, ISO 8601 o milisegundos) a Date; null si no es válida. */
|
|
35
|
+
declare function toDate(input: DsDateInput): Date | null;
|
|
36
|
+
type DsDateStyle = "date" | "datetime" | "time" | "long" | "short";
|
|
37
|
+
/** Fecha absoluta en el idioma indicado. `style` o, para algo concreto, `format` (Intl.DateTimeFormatOptions). */
|
|
38
|
+
declare function formatDate(input: DsDateInput, options?: {
|
|
39
|
+
locale?: string;
|
|
40
|
+
style?: DsDateStyle;
|
|
41
|
+
format?: Intl.DateTimeFormatOptions;
|
|
42
|
+
timeZone?: string;
|
|
43
|
+
}): string | null;
|
|
44
|
+
/**
|
|
45
|
+
* Tiempo relativo («hace 5 minutos», «en 3 días», «ayer») eligiendo la unidad sola.
|
|
46
|
+
* `now` permite fijar el instante de referencia (pruebas, servidor).
|
|
47
|
+
*/
|
|
48
|
+
declare function formatRelativeTime(input: DsDateInput, options?: {
|
|
49
|
+
locale?: string;
|
|
50
|
+
now?: DsDateInput;
|
|
51
|
+
numeric?: "auto" | "always";
|
|
52
|
+
style?: "long" | "short" | "narrow";
|
|
53
|
+
}): string | null;
|
|
54
|
+
/** Cada cuánto conviene refrescar un tiempo relativo según su distancia al presente (ms). */
|
|
55
|
+
declare function relativeTimeRefreshMs(input: DsDateInput, now?: DsDateInput): number;
|
|
56
|
+
|
|
57
|
+
export { type DsDateInput, type DsDateStyle, type DsQuantityOptions, type DsUnitDisplay, formatDate, formatQuantity, formatRatio, formatRelativeTime, isByteUnit, relativeTimeRefreshMs, toBytes, toDate };
|