orbital-ds 0.41.0 → 0.48.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 +54 -12
- package/CHANGELOG.md +458 -0
- package/README.md +2 -2
- package/components.manifest.json +6630 -3569
- package/dist/hooks/use-esc-close-stack.js +38 -0
- package/dist/hooks/use-simulated-progress.js +30 -0
- package/dist/lib/brand-allowlist.js +703 -0
- package/dist/lib/brand-runtime.js +85 -0
- package/dist/lib/echarts-presets.js +152 -1
- package/dist/lib/echarts-setup.js +2 -0
- package/dist/lib/format.js +177 -0
- package/dist/lib/i18n.js +35 -2
- package/dist/lib/locales/de.js +536 -0
- package/dist/lib/locales/fr.js +536 -0
- package/dist/lib/locales/he.js +536 -0
- package/dist/lib/locales/it.js +536 -0
- package/dist/ui/auth-form.js +13 -6
- package/dist/ui/ayuda.js +4 -1
- package/dist/ui/breadcrumb.js +1 -1
- package/dist/ui/calendar.js +3 -0
- package/dist/ui/carousel.js +10 -5
- package/dist/ui/context-menu.js +3 -3
- package/dist/ui/cta-banner.js +63 -0
- package/dist/ui/date-time.js +55 -0
- package/dist/ui/description-list.js +86 -0
- package/dist/ui/detail-panel.js +2 -2
- package/dist/ui/dropdown-menu.js +1 -1
- package/dist/ui/faq.js +25 -0
- package/dist/ui/feature-grid.js +40 -0
- package/dist/ui/hero.js +145 -0
- package/dist/ui/landing-section.js +59 -0
- package/dist/ui/mfa-challenge.js +1 -1
- package/dist/ui/next-step-card.js +92 -0
- package/dist/ui/page-header.js +20 -11
- package/dist/ui/pagination.js +2 -2
- package/dist/ui/pricing-table.js +86 -0
- package/dist/ui/quantity.js +27 -0
- package/dist/ui/sheet.js +6 -2
- package/dist/ui/sidebar.js +7 -3
- package/dist/ui/tag-input.js +169 -0
- package/dist/ui/testimonial.js +61 -0
- package/dist/ui/textarea.js +7 -1
- package/dist/ui/usage-meter.js +116 -0
- package/dist/ui/week-strip.js +2 -2
- package/docs/adr/0001-rtl-clases-logicas.md +14 -1
- package/docs/designer/flujo.md +1 -1
- package/docs/designer/patrones.md +45 -1
- package/manifest/actions.json +364 -0
- package/manifest/agents.json +399 -0
- package/manifest/ai.json +128 -0
- package/manifest/auth.json +1547 -0
- package/manifest/chat.json +612 -0
- package/manifest/content.json +2793 -0
- package/manifest/data.json +2802 -0
- package/manifest/feedback.json +1005 -0
- package/manifest/forms.json +1954 -0
- package/manifest/motion.json +196 -0
- package/manifest/navigation.json +1792 -0
- package/manifest/overlays.json +934 -0
- package/package.json +240 -238
- package/scripts/cli.mjs +124 -8
- package/scripts/doctor.mjs +153 -2
- package/scripts/eslint-plugin.mjs +125 -0
- package/scripts/i18n.mjs +1 -1
- package/scripts/manifest.mjs +179 -7
- package/scripts/upgrade.mjs +126 -0
- package/skill/SKILL.md +8 -3
- package/dist/hooks/use-ds-messages.d.ts +0 -537
- package/dist/hooks/use-ds-motion.d.ts +0 -17
- package/dist/hooks/use-in-view.d.ts +0 -9
- package/dist/hooks/use-mobile.d.ts +0 -3
- package/dist/lib/a2ui-catalog.d.ts +0 -42
- package/dist/lib/a2ui.d.ts +0 -289
- package/dist/lib/ai-events.d.ts +0 -15
- package/dist/lib/auth-better-auth.d.ts +0 -29
- package/dist/lib/auth-flow.d.ts +0 -85
- package/dist/lib/auth-providers.d.ts +0 -194
- package/dist/lib/auth.d.ts +0 -68
- package/dist/lib/echarts-presets.d.ts +0 -227
- package/dist/lib/echarts-server.d.ts +0 -15
- package/dist/lib/echarts-setup.d.ts +0 -8
- package/dist/lib/echarts-theme.d.ts +0 -36
- package/dist/lib/header-control.d.ts +0 -4
- package/dist/lib/i18n.d.ts +0 -545
- package/dist/lib/image-upload.d.ts +0 -41
- package/dist/lib/motion.d.ts +0 -74
- package/dist/lib/presets.d.ts +0 -8
- package/dist/lib/template-syntax.d.ts +0 -22
- package/dist/lib/utils.d.ts +0 -5
- package/dist/motion.css +0 -146
- package/dist/styles.css +0 -1737
- package/dist/themes/chocolate.css +0 -259
- package/dist/themes/chocolate.fonts.css +0 -2
- package/dist/themes/chocolate.guide.md +0 -30
- package/dist/themes/chocolate.meta.json +0 -61
- package/dist/themes/chocolate.scoped.css +0 -259
- package/dist/themes/chocolate.tokens.json +0 -49
- package/dist/themes/fractalia.css +0 -556
- package/dist/themes/fractalia.fonts.css +0 -3
- package/dist/themes/fractalia.guide.md +0 -86
- package/dist/themes/fractalia.meta.json +0 -112
- package/dist/themes/fractalia.scoped.css +0 -556
- package/dist/themes/fractalia.tokens.json +0 -39
- package/dist/themes/friendly.css +0 -375
- package/dist/themes/friendly.fonts.css +0 -2
- package/dist/themes/friendly.guide.md +0 -38
- package/dist/themes/friendly.meta.json +0 -82
- package/dist/themes/friendly.scoped.css +0 -375
- package/dist/themes/friendly.tokens.json +0 -45
- package/dist/themes/lagoon.css +0 -362
- package/dist/themes/lagoon.fonts.css +0 -2
- package/dist/themes/lagoon.guide.md +0 -47
- package/dist/themes/lagoon.meta.json +0 -85
- package/dist/themes/lagoon.scoped.css +0 -362
- package/dist/themes/lagoon.tokens.json +0 -49
- package/dist/themes/liquid.css +0 -510
- package/dist/themes/liquid.fonts.css +0 -7
- package/dist/themes/liquid.guide.md +0 -82
- package/dist/themes/liquid.meta.json +0 -134
- package/dist/themes/liquid.scoped.css +0 -510
- package/dist/themes/liquid.tokens.json +0 -47
- package/dist/themes/matcha.css +0 -259
- package/dist/themes/matcha.fonts.css +0 -2
- package/dist/themes/matcha.guide.md +0 -30
- package/dist/themes/matcha.meta.json +0 -61
- package/dist/themes/matcha.scoped.css +0 -259
- package/dist/themes/matcha.tokens.json +0 -49
- package/dist/themes/qratia.css +0 -264
- package/dist/themes/qratia.fonts.css +0 -2
- package/dist/themes/qratia.guide.md +0 -34
- package/dist/themes/qratia.meta.json +0 -49
- package/dist/themes/qratia.scoped.css +0 -264
- package/dist/themes/qratia.tokens.json +0 -49
- package/dist/themes/stone.css +0 -263
- package/dist/themes/stone.fonts.css +0 -2
- package/dist/themes/stone.guide.md +0 -30
- package/dist/themes/stone.meta.json +0 -47
- package/dist/themes/stone.scoped.css +0 -263
- package/dist/themes/stone.tokens.json +0 -49
- package/dist/themes/tactile.css +0 -596
- package/dist/themes/tactile.fonts.css +0 -3
- package/dist/themes/tactile.guide.md +0 -82
- package/dist/themes/tactile.meta.json +0 -182
- package/dist/themes/tactile.scoped.css +0 -596
- package/dist/themes/tactile.tokens.json +0 -42
- package/dist/themes/twitter.css +0 -364
- package/dist/themes/twitter.fonts.css +0 -6
- package/dist/themes/twitter.guide.md +0 -35
- package/dist/themes/twitter.meta.json +0 -90
- package/dist/themes/twitter.scoped.css +0 -364
- package/dist/themes/twitter.tokens.json +0 -45
- package/dist/themes/y2k.css +0 -259
- package/dist/themes/y2k.fonts.css +0 -2
- package/dist/themes/y2k.guide.md +0 -30
- package/dist/themes/y2k.meta.json +0 -59
- package/dist/themes/y2k.scoped.css +0 -259
- package/dist/themes/y2k.tokens.json +0 -49
- package/dist/themes/zyro.css +0 -442
- package/dist/themes/zyro.fonts.css +0 -2
- package/dist/themes/zyro.guide.md +0 -33
- package/dist/themes/zyro.meta.json +0 -74
- package/dist/themes/zyro.scoped.css +0 -442
- package/dist/themes/zyro.tokens.json +0 -46
- package/dist/ui/a2ui-renderer.d.ts +0 -33
- package/dist/ui/accordion.d.ts +0 -9
- package/dist/ui/agent-events.d.ts +0 -32
- package/dist/ui/ai-tag.d.ts +0 -8
- package/dist/ui/alert-dialog.d.ts +0 -23
- package/dist/ui/alert.d.ts +0 -13
- package/dist/ui/animated-number.d.ts +0 -9
- package/dist/ui/app-bar.d.ts +0 -10
- package/dist/ui/aspect-ratio.d.ts +0 -7
- package/dist/ui/attachment.d.ts +0 -26
- package/dist/ui/auth-backdrop.d.ts +0 -20
- package/dist/ui/auth-form.d.ts +0 -113
- package/dist/ui/auth-layout.d.ts +0 -72
- package/dist/ui/auth-parts.d.ts +0 -43
- package/dist/ui/auth-status.d.ts +0 -23
- package/dist/ui/avatar.d.ts +0 -16
- package/dist/ui/ayuda.d.ts +0 -22
- package/dist/ui/badge.d.ts +0 -15
- package/dist/ui/banner.d.ts +0 -14
- package/dist/ui/bottom-nav.d.ts +0 -15
- package/dist/ui/breadcrumb.d.ts +0 -12
- package/dist/ui/bubble.d.ts +0 -19
- package/dist/ui/button-group.d.ts +0 -15
- package/dist/ui/button.d.ts +0 -14
- package/dist/ui/calendar.d.ts +0 -15
- package/dist/ui/card-stack.d.ts +0 -9
- package/dist/ui/card.d.ts +0 -28
- package/dist/ui/carousel.d.ts +0 -33
- package/dist/ui/chain-of-thought.d.ts +0 -19
- package/dist/ui/chart-card.d.ts +0 -28
- package/dist/ui/chart.d.ts +0 -46
- package/dist/ui/chart.js +0 -254
- package/dist/ui/chat-composer.d.ts +0 -39
- package/dist/ui/checkbox.d.ts +0 -6
- package/dist/ui/choice-card.d.ts +0 -16
- package/dist/ui/code-block.d.ts +0 -14
- package/dist/ui/collapsible.d.ts +0 -8
- package/dist/ui/combobox.d.ts +0 -26
- package/dist/ui/command-palette.d.ts +0 -36
- package/dist/ui/command.d.ts +0 -22
- package/dist/ui/confirm-action.d.ts +0 -18
- package/dist/ui/confirm-dialog.d.ts +0 -21
- package/dist/ui/connected-accounts.d.ts +0 -25
- package/dist/ui/content-card.d.ts +0 -52
- package/dist/ui/context-menu.d.ts +0 -31
- package/dist/ui/conversation-list.d.ts +0 -24
- package/dist/ui/copy-button.d.ts +0 -14
- package/dist/ui/data-table.d.ts +0 -198
- package/dist/ui/date-picker.d.ts +0 -65
- package/dist/ui/detail-panel.d.ts +0 -16
- package/dist/ui/dialog.d.ts +0 -19
- package/dist/ui/direction.d.ts +0 -1
- package/dist/ui/dock.d.ts +0 -13
- package/dist/ui/drawer.d.ts +0 -18
- package/dist/ui/dropdown-menu.d.ts +0 -31
- package/dist/ui/dropzone.d.ts +0 -44
- package/dist/ui/echart.d.ts +0 -31
- package/dist/ui/empty-state.d.ts +0 -26
- package/dist/ui/empty.d.ts +0 -15
- package/dist/ui/entity-list.d.ts +0 -25
- package/dist/ui/error-page.d.ts +0 -28
- package/dist/ui/error-state.d.ts +0 -16
- package/dist/ui/eyebrow.d.ts +0 -7
- package/dist/ui/field.d.ts +0 -28
- package/dist/ui/file-upload.d.ts +0 -42
- package/dist/ui/filter-bar.d.ts +0 -38
- package/dist/ui/form-layout.d.ts +0 -19
- package/dist/ui/gauge.d.ts +0 -40
- package/dist/ui/generated-image.d.ts +0 -14
- package/dist/ui/generated-table.d.ts +0 -11
- package/dist/ui/heatmap-grid.d.ts +0 -39
- package/dist/ui/hover-card.d.ts +0 -8
- package/dist/ui/i18n-provider.d.ts +0 -11
- package/dist/ui/icon-tile.d.ts +0 -11
- package/dist/ui/input-group.d.ts +0 -22
- package/dist/ui/input-otp.d.ts +0 -13
- package/dist/ui/input.d.ts +0 -5
- package/dist/ui/instruction-editor.d.ts +0 -64
- package/dist/ui/item.d.ts +0 -26
- package/dist/ui/kbd.d.ts +0 -6
- package/dist/ui/label.d.ts +0 -5
- package/dist/ui/legend.d.ts +0 -32
- package/dist/ui/level-meter.d.ts +0 -16
- package/dist/ui/load-more.d.ts +0 -19
- package/dist/ui/loading-state.d.ts +0 -14
- package/dist/ui/locale-switcher.d.ts +0 -19
- package/dist/ui/markdown.d.ts +0 -14
- package/dist/ui/marker.d.ts +0 -13
- package/dist/ui/media-card.d.ts +0 -13
- package/dist/ui/menubar.d.ts +0 -31
- package/dist/ui/message-actions.d.ts +0 -12
- package/dist/ui/message-scroller.d.ts +0 -16
- package/dist/ui/message.d.ts +0 -12
- package/dist/ui/mfa-challenge.d.ts +0 -33
- package/dist/ui/mfa-setup.d.ts +0 -29
- package/dist/ui/mosaic.d.ts +0 -15
- package/dist/ui/motion-provider.d.ts +0 -11
- package/dist/ui/native-select.d.ts +0 -10
- package/dist/ui/navigation-menu.d.ts +0 -15
- package/dist/ui/notice-review.d.ts +0 -32
- package/dist/ui/notifications.d.ts +0 -81
- package/dist/ui/oauth-consent.d.ts +0 -54
- package/dist/ui/page-header.d.ts +0 -22
- package/dist/ui/page-loader.d.ts +0 -23
- package/dist/ui/page-shell.d.ts +0 -8
- package/dist/ui/pagination.d.ts +0 -22
- package/dist/ui/panel.d.ts +0 -12
- package/dist/ui/passkey-list.d.ts +0 -17
- package/dist/ui/password-input.d.ts +0 -5
- package/dist/ui/password-strength.d.ts +0 -14
- package/dist/ui/popover.d.ts +0 -12
- package/dist/ui/progress.d.ts +0 -9
- package/dist/ui/proportion-bar.d.ts +0 -27
- package/dist/ui/questionnaire.d.ts +0 -24
- package/dist/ui/radio-group.d.ts +0 -8
- package/dist/ui/reasoning.d.ts +0 -10
- package/dist/ui/resizable.d.ts +0 -10
- package/dist/ui/reveal.d.ts +0 -11
- package/dist/ui/scroll-area.d.ts +0 -7
- package/dist/ui/search-box.d.ts +0 -32
- package/dist/ui/select.d.ts +0 -19
- package/dist/ui/separator.d.ts +0 -6
- package/dist/ui/session-list.d.ts +0 -19
- package/dist/ui/session-timeout.d.ts +0 -13
- package/dist/ui/sheet.d.ts +0 -16
- package/dist/ui/shield.d.ts +0 -21
- package/dist/ui/show-more.d.ts +0 -12
- package/dist/ui/sidebar.d.ts +0 -90
- package/dist/ui/sign-out-dialog.d.ts +0 -17
- package/dist/ui/skeleton.d.ts +0 -10
- package/dist/ui/slider.d.ts +0 -23
- package/dist/ui/sonner.d.ts +0 -6
- package/dist/ui/sparkline.d.ts +0 -26
- package/dist/ui/spinner.d.ts +0 -5
- package/dist/ui/stat-group.d.ts +0 -8
- package/dist/ui/stat.d.ts +0 -90
- package/dist/ui/status-badge.d.ts +0 -39
- package/dist/ui/status-hero.d.ts +0 -12
- package/dist/ui/step-dots.d.ts +0 -10
- package/dist/ui/step-flow.d.ts +0 -48
- package/dist/ui/step-ring.d.ts +0 -12
- package/dist/ui/stepper.d.ts +0 -20
- package/dist/ui/suggestions.d.ts +0 -8
- package/dist/ui/switch.d.ts +0 -8
- package/dist/ui/table.d.ts +0 -12
- package/dist/ui/tabs.d.ts +0 -14
- package/dist/ui/task-loader.d.ts +0 -14
- package/dist/ui/task-progress.d.ts +0 -18
- package/dist/ui/textarea.d.ts +0 -11
- package/dist/ui/theme-toggle.d.ts +0 -14
- package/dist/ui/timeline.d.ts +0 -29
- package/dist/ui/toast.d.ts +0 -19
- package/dist/ui/toggle-group.d.ts +0 -14
- package/dist/ui/toggle.d.ts +0 -12
- package/dist/ui/tool-call.d.ts +0 -15
- package/dist/ui/tooltip.d.ts +0 -9
- package/dist/ui/week-strip.d.ts +0 -12
- package/dist/ui/workflow-run.d.ts +0 -23
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import { Meter as MeterPrimitive } from "@base-ui/react/meter";
|
|
5
|
+
import { useDsLocale, useDsMessages } from "../hooks/use-ds-messages.js";
|
|
6
|
+
import { dsFormat } from "../lib/i18n.js";
|
|
7
|
+
import { formatQuantity, formatRatio } from "../lib/format.js";
|
|
8
|
+
import { cn } from "../lib/utils.js";
|
|
9
|
+
function UsageMeter({
|
|
10
|
+
label,
|
|
11
|
+
value,
|
|
12
|
+
limit,
|
|
13
|
+
unit,
|
|
14
|
+
warnAt = 0.8,
|
|
15
|
+
dangerAt = 1,
|
|
16
|
+
showRemaining = false,
|
|
17
|
+
size = "default",
|
|
18
|
+
valueText,
|
|
19
|
+
system,
|
|
20
|
+
maximumFractionDigits,
|
|
21
|
+
className,
|
|
22
|
+
...props
|
|
23
|
+
}) {
|
|
24
|
+
const t = useDsMessages();
|
|
25
|
+
const locale = useDsLocale();
|
|
26
|
+
const labelId = React.useId();
|
|
27
|
+
const fmt = (n) => formatQuantity(n, unit, { locale, system, maximumFractionDigits });
|
|
28
|
+
const measured = typeof value === "number" && Number.isFinite(value);
|
|
29
|
+
const bounded = typeof limit === "number" && Number.isFinite(limit) && limit > 0;
|
|
30
|
+
const ratio = measured && bounded ? value / limit : null;
|
|
31
|
+
const state = !measured ? "empty" : !bounded ? "unlimited" : ratio >= dangerAt ? "critical" : ratio >= warnAt ? "warning" : "normal";
|
|
32
|
+
const used = fmt(value);
|
|
33
|
+
const total = bounded ? fmt(limit) : null;
|
|
34
|
+
const main = state === "empty" ? t.statNoData : state === "unlimited" ? dsFormat(t.usageUnlimited, { value: used ?? "" }) : dsFormat(t.usageOf, { value: used ?? "", limit: total ?? "" });
|
|
35
|
+
let extra = null;
|
|
36
|
+
if (showRemaining && measured && bounded) {
|
|
37
|
+
const diff = limit - value;
|
|
38
|
+
extra = diff >= 0 ? dsFormat(t.usageRemaining, { amount: fmt(diff) ?? "" }) : dsFormat(t.usageOver, { amount: fmt(-diff) ?? "" });
|
|
39
|
+
}
|
|
40
|
+
const pct = ratio == null ? null : formatRatio(ratio, { locale });
|
|
41
|
+
const ariaText = [main, pct, extra].filter(Boolean).join(" \xB7 ");
|
|
42
|
+
const fill = state === "critical" ? "bg-(--ds-usage-fill-critical)" : state === "warning" ? "bg-(--ds-usage-fill-warning)" : "bg-(--ds-usage-fill)";
|
|
43
|
+
return /* @__PURE__ */ jsxs(
|
|
44
|
+
"div",
|
|
45
|
+
{
|
|
46
|
+
"data-slot": "usage-meter",
|
|
47
|
+
"data-state": state,
|
|
48
|
+
"data-size": size,
|
|
49
|
+
className: cn(
|
|
50
|
+
"group/usage-meter flex min-w-0 flex-col gap-1.5",
|
|
51
|
+
size === "compact" && "gap-1",
|
|
52
|
+
className
|
|
53
|
+
),
|
|
54
|
+
...props,
|
|
55
|
+
children: [
|
|
56
|
+
/* @__PURE__ */ jsxs("div", { "data-slot": "usage-meter-header", className: "flex min-w-0 flex-wrap items-baseline justify-between gap-x-3 gap-y-0.5", children: [
|
|
57
|
+
label != null && /* @__PURE__ */ jsx("span", { id: labelId, "data-slot": "usage-meter-label", className: "min-w-0 text-sm font-(--ds-label-weight) text-foreground", children: label }),
|
|
58
|
+
/* @__PURE__ */ jsx(
|
|
59
|
+
"span",
|
|
60
|
+
{
|
|
61
|
+
"data-slot": "usage-meter-value",
|
|
62
|
+
"aria-hidden": "true",
|
|
63
|
+
className: cn(
|
|
64
|
+
"text-sm text-muted-foreground tabular-nums",
|
|
65
|
+
state === "critical" && "text-danger",
|
|
66
|
+
size === "compact" && "text-xs"
|
|
67
|
+
),
|
|
68
|
+
children: valueText ?? main
|
|
69
|
+
}
|
|
70
|
+
)
|
|
71
|
+
] }),
|
|
72
|
+
state !== "unlimited" && /* @__PURE__ */ jsx(
|
|
73
|
+
MeterPrimitive.Root,
|
|
74
|
+
{
|
|
75
|
+
value: ratio == null ? 0 : Math.min(1, Math.max(0, ratio)) * 100,
|
|
76
|
+
min: 0,
|
|
77
|
+
max: 100,
|
|
78
|
+
"aria-labelledby": label != null ? labelId : void 0,
|
|
79
|
+
getAriaValueText: () => ariaText,
|
|
80
|
+
"data-slot": "usage-meter-bar",
|
|
81
|
+
children: /* @__PURE__ */ jsx(
|
|
82
|
+
MeterPrimitive.Track,
|
|
83
|
+
{
|
|
84
|
+
"data-slot": "usage-meter-track",
|
|
85
|
+
className: "relative block h-(--ds-usage-h) w-full overflow-hidden rounded-track bg-(--ds-track-bg)",
|
|
86
|
+
children: /* @__PURE__ */ jsx(
|
|
87
|
+
MeterPrimitive.Indicator,
|
|
88
|
+
{
|
|
89
|
+
"data-slot": "usage-meter-indicator",
|
|
90
|
+
className: cn(
|
|
91
|
+
"block h-full rounded-track transition-[width,background-color] duration-(--ds-motion-slow) ease-(--ds-ease-standard) motion-reduce:transition-none",
|
|
92
|
+
fill
|
|
93
|
+
)
|
|
94
|
+
}
|
|
95
|
+
)
|
|
96
|
+
}
|
|
97
|
+
)
|
|
98
|
+
}
|
|
99
|
+
),
|
|
100
|
+
state === "unlimited" && /* @__PURE__ */ jsx("span", { className: "sr-only", children: ariaText }),
|
|
101
|
+
extra && /* @__PURE__ */ jsx(
|
|
102
|
+
"span",
|
|
103
|
+
{
|
|
104
|
+
"data-slot": "usage-meter-remaining",
|
|
105
|
+
"aria-hidden": "true",
|
|
106
|
+
className: cn("text-xs text-muted-foreground tabular-nums", state === "critical" && "text-danger"),
|
|
107
|
+
children: extra
|
|
108
|
+
}
|
|
109
|
+
)
|
|
110
|
+
]
|
|
111
|
+
}
|
|
112
|
+
);
|
|
113
|
+
}
|
|
114
|
+
export {
|
|
115
|
+
UsageMeter
|
|
116
|
+
};
|
package/dist/ui/week-strip.js
CHANGED
|
@@ -49,7 +49,7 @@ function WeekStrip({
|
|
|
49
49
|
className: cn("flex items-center gap-(--ds-week-gap)", className),
|
|
50
50
|
...props,
|
|
51
51
|
children: [
|
|
52
|
-
/* @__PURE__ */ jsx(Button, { variant: "ghost", size: "icon-sm", "aria-label": t.weekPrevious, onClick: () => setShift((s) => s - 1), children: /* @__PURE__ */ jsx(ChevronLeftIcon, {}) }),
|
|
52
|
+
/* @__PURE__ */ jsx(Button, { variant: "ghost", size: "icon-sm", "aria-label": t.weekPrevious, onClick: () => setShift((s) => s - 1), children: /* @__PURE__ */ jsx(ChevronLeftIcon, { className: "rtl:rotate-180" }) }),
|
|
53
53
|
/* @__PURE__ */ jsx("div", { className: "grid flex-1 grid-cols-7 gap-(--ds-week-gap)", children: days.map((d) => {
|
|
54
54
|
const active = sameDay(d, selected);
|
|
55
55
|
return /* @__PURE__ */ jsxs(
|
|
@@ -72,7 +72,7 @@ function WeekStrip({
|
|
|
72
72
|
d.toISOString()
|
|
73
73
|
);
|
|
74
74
|
}) }),
|
|
75
|
-
/* @__PURE__ */ jsx(Button, { variant: "ghost", size: "icon-sm", "aria-label": t.weekNext, onClick: () => setShift((s) => s + 1), children: /* @__PURE__ */ jsx(ChevronRightIcon, {}) })
|
|
75
|
+
/* @__PURE__ */ jsx(Button, { variant: "ghost", size: "icon-sm", "aria-label": t.weekNext, onClick: () => setShift((s) => s + 1), children: /* @__PURE__ */ jsx(ChevronRightIcon, { className: "rtl:rotate-180" }) })
|
|
76
76
|
]
|
|
77
77
|
}
|
|
78
78
|
);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# ADR 0001 · Soporte de derecha a izquierda (RTL) con clases lógicas
|
|
2
2
|
|
|
3
|
-
- **Estado:** aceptado
|
|
3
|
+
- **Estado:** aceptado e **implementado** (0.43.0). Ver «Estado de la implementación» al final.
|
|
4
4
|
- **Fecha:** 2026-10-12
|
|
5
5
|
- **Origen:** revisión de i18n de orbital-ds 0.9.0 y petición de la plantilla de referencia (`CAS-IA/TANSTACK-WORKER-UI`, issue #4).
|
|
6
6
|
|
|
@@ -76,3 +76,16 @@ En RTL esas clases no se invierten: márgenes, rellenos, alineaciones, flechas y
|
|
|
76
76
|
3. Iconos de dirección con `rtl:rotate-180`.
|
|
77
77
|
4. Escaparate con `ar` y `dir="rtl"`.
|
|
78
78
|
5. Doctor en modo error, guía en `AGENTS.md` y versión menor.
|
|
79
|
+
|
|
80
|
+
## Estado de la implementación (0.43.0)
|
|
81
|
+
|
|
82
|
+
- **Clases lógicas:** hechas. El doctor ya **rechaza** (error) `ml`/`mr`/`pl`/`pr`, `text-left/right`, `border-l/r` y
|
|
83
|
+
`rounded-l/r` en los componentes. Quedan físicos a propósito los centrados `left-1/2 -translate-x-1/2` (simétricos).
|
|
84
|
+
- **Iconos de dirección:** `rtl:rotate-180` en miga de pan, submenús, paginación, carrusel, tira de semana, «volver» del
|
|
85
|
+
acceso, pasos y tabla; el calendario lo hace con su propio selector y recibe `dir`.
|
|
86
|
+
- **Paneles:** `Sheet` y `Sidebar` aceptan `side="start" | "end"` (traducido con `dsPhysicalSide`); `left`/`right`
|
|
87
|
+
siguen siendo físicos y su filete interior cae en el lado correcto también en RTL. La pista del lateral recogido
|
|
88
|
+
sale en `inline-end`.
|
|
89
|
+
- **Carrusel:** Embla recibe `direction` y las flechas del teclado se invierten en RTL.
|
|
90
|
+
- **Punto 4 revisado:** a petición de la suite, el paquete trae ya **hebreo** (`he`), además de fr, it y de.
|
|
91
|
+
- **Pendiente:** revisión visual en el escaparate con `he` y `dir="rtl"` (punto 6).
|
package/docs/designer/flujo.md
CHANGED
|
@@ -55,7 +55,7 @@ hueco (ver §6).
|
|
|
55
55
|
Ni `!important`, ni selectores propios contra la librería.
|
|
56
56
|
- La marca es de `brand.css`; la personalidad, del tema. El diseñador **no elige** fuentes, colores ni radios:
|
|
57
57
|
los pone el tema. Si la app necesita otro aspecto, se ajusta en `brand.css` (o se elige otro tema).
|
|
58
|
-
- Textos de la app con su i18n; los de orbital-ds ya vienen en en/es/pt-BR.
|
|
58
|
+
- Textos de la app con su i18n; los de orbital-ds ya vienen en en/es/pt-BR/fr/it/de/he.
|
|
59
59
|
- Movimiento: el del tema (`orbital-ds/motion.css` si está activo; Motion con `useDsMotion()` para lo demás).
|
|
60
60
|
|
|
61
61
|
## 5. Verificar (antes de dar nada por bueno)
|
|
@@ -88,7 +88,7 @@ Formato: **cuándo** · **piezas** · **reglas** · **evita**.
|
|
|
88
88
|
- **Tarea larga:** `TaskProgress` o `TaskLoader`; para estados de protección/seguridad, `Shield`/`StatusHero`.
|
|
89
89
|
|
|
90
90
|
## P10 · Avisos y respuesta del sistema
|
|
91
|
-
- **Piezas:** `toast` (
|
|
91
|
+
- **Piezas:** `toast` (`Toaster` + `toast.add`, Base UI) para confirmar algo hecho («Cliente creado») con «Deshacer» si aplica; `Alert` en
|
|
92
92
|
el contexto del problema; `Banner` para algo de toda la página (mantenimiento, prueba gratuita);
|
|
93
93
|
`NotificationCenter` para lo que llega sin que la persona lo pida.
|
|
94
94
|
- **Reglas:** el aviso dice qué pasó en voz activa; los errores dicen cómo arreglarlo; nada de avisos para lo
|
|
@@ -128,9 +128,53 @@ Formato: **cuándo** · **piezas** · **reglas** · **evita**.
|
|
|
128
128
|
(`AuthErrorCode`), no de la respuesta del proveedor. Idioma y tema siempre visibles en la esquina (`toolbar`).
|
|
129
129
|
Una sola acción principal por pantalla; los proveedores van antes o después del formulario, no mezclados.
|
|
130
130
|
Contraseña con `PasswordInput` (mostrar/ocultar) y, al crearla, `PasswordStrength`.
|
|
131
|
+
Segundo factor **dentro** del mismo formulario: `onSubmit` devuelve `{ next: "mfa" }` y se pasa `mfa={{ preset, onVerify }}`
|
|
132
|
+
(monta `MfaChallenge`). «Volver» regresa a las puertas si las hay; la redirección a SSO lleva «Cancelar».
|
|
131
133
|
- **Evita:** fondos animados en un backoffice interno (usa `minimal` o `centered` sin fondo); proveedores que la
|
|
132
134
|
app no tiene configurados; CAPTCHA o pasos extra antes de saber si hacen falta.
|
|
133
135
|
|
|
136
|
+
|
|
137
|
+
## P14 · Panel de un servicio contratado
|
|
138
|
+
- **Cuándo:** la vista de un servicio que la persona tiene (o puede activar): estado, siguiente paso, uso frente a lo
|
|
139
|
+
contratado, límites del plan y datos del servicio. Vale para individual, familia o pyme: cambia el contenido, no la
|
|
140
|
+
estructura.
|
|
141
|
+
- **Piezas:** `PageShell` + `PageHeader` (atajo `title` / `description` / `actions`). Arriba, **una** `NextStepCard`
|
|
142
|
+
con el preset del estado (`activate` sin activar · `open` activo · `resolve` con algo que arreglar · `inactive` de
|
|
143
|
+
baja) y su única acción principal. Debajo, el uso con `UsageMeter` (uno por medida con límite; `limit={null}` es
|
|
144
|
+
ilimitado, `value={null}` es «sin dato», nunca 0). Límites y atributos con `DescriptionList` (`inline divided`; `grid`
|
|
145
|
+
si son muchos y cortos). Cada valor con unidad con `Quantity` (UCUM: `By`, `GBy`, `%`, `d`, `{device}`), fechas con
|
|
146
|
+
`DateTime` y «hace 5 minutos» con `RelativeTime`. Bloques con `SectionHeader title description`.
|
|
147
|
+
- **De un esquema de widgets a componentes** (la traducción la hace la app, no orbital-ds):
|
|
148
|
+
`value` → `Quantity` · `progress` → `UsageMeter` (o `StatProgress` en una tarjeta KPI) · `badge` → `StatusBadge` ·
|
|
149
|
+
`date` → `DateTime` · `relative-time` → `RelativeTime` · `list-link` → `Item` con enlace (o `DescriptionList` con el
|
|
150
|
+
enlace como valor).
|
|
151
|
+
- **Reglas:** el estado decide el preset y el preset la acción; no pongas dos acciones principales. Bytes en SI por
|
|
152
|
+
defecto (lo que muestra el sistema operativo de la mayoría); `system="binary"` solo si el plan se vende en GiB. Nada
|
|
153
|
+
de unidades ni fechas formateadas a mano: siempre por el idioma activo.
|
|
154
|
+
- **Evita:** barras de progreso a mano (`h-2 bg-primary` con `width`), «GB» calculado dividiendo entre 1024, estados
|
|
155
|
+
con colores propios y «Límites» como texto suelto en lugar de una lista de definición.
|
|
156
|
+
|
|
157
|
+
## P15 · Portada (hero)
|
|
158
|
+
- **Cuándo:** la primera pantalla de una web pública, la presentación de un producto o la entrada a un módulo de la
|
|
159
|
+
app que hay que «vender» (integraciones, informes, novedades). Nunca en una vista de trabajo: ahí va `PageHeader`.
|
|
160
|
+
- **Piezas:** `Hero` con el preset de la intención: `landing` (portada centrada; con `backdrop="mesh"`/`"dots"`
|
|
161
|
+
para darle personalidad), `split` (texto junto a una captura o demo en `media`, con su `alt`), `media` (foto o
|
|
162
|
+
vídeo de fondo en `backdropMedia`; el texto va sobre una placa que garantiza el contraste) y `section` (entrada a un
|
|
163
|
+
módulo, alineada al inicio y con menos aire). `eyebrow` para una `Badge` de novedad; `footer` para la tira de
|
|
164
|
+
cifras (`StatGroup preset="strip"`) o de logos; `animated` para la entrada en cascada con el ritmo del tema.
|
|
165
|
+
- **Contenido:** un título que dice el beneficio en una frase (no el nombre del producto), una o dos frases de apoyo y,
|
|
166
|
+
como mucho, **dos acciones** (principal + secundaria `outline`).
|
|
167
|
+
- **El resto de una web pública** (debajo del hero), cada bloque dentro de un `LandingSection` (antetítulo, título,
|
|
168
|
+
texto; mismo ancho y ritmo): `FeatureGrid` + `Feature` (qué hace, 3–6 ventajas) → `Testimonial`/`TestimonialGrid`
|
|
169
|
+
(prueba social real, con nombre y cargo) → `PricingTable` + `PricingPlan` + `PricingFeature` (2–4 planes, uno
|
|
170
|
+
`featured` con su `badge` en texto; mensual/anual con `ToggleGroup`) → `Faq` (4–8 preguntas; `structuredData` para
|
|
171
|
+
buscadores) → `CtaBanner` (la acción principal otra vez, al pie). Contenido libre: `Mosaic` o `ContentCard` con
|
|
172
|
+
`Reveal`. Quita lo que no aporte; no hace falta usarlos todos.
|
|
173
|
+
- **Reglas:** un hero por página y arriba del todo; `titleAs="h2"` si la vista ya tiene su h1. El diseño sigue el
|
|
174
|
+
ancho del contenedor, no la pantalla. Medidas y escala en `--ds-hero-*` (la marca las ajusta en `brand.css`).
|
|
175
|
+
- **Evita:** carruseles en la portada, más de dos botones, texto directamente sobre una foto sin placa, títulos con
|
|
176
|
+
degradado y alturas a pantalla completa que esconden el contenido.
|
|
177
|
+
|
|
134
178
|
---
|
|
135
179
|
|
|
136
180
|
## Patrones de movimiento
|
|
@@ -0,0 +1,364 @@
|
|
|
1
|
+
{
|
|
2
|
+
"package": "orbital-ds",
|
|
3
|
+
"version": "0.48.0",
|
|
4
|
+
"group": "actions",
|
|
5
|
+
"about": "Botones y acciones sueltas.",
|
|
6
|
+
"components": {
|
|
7
|
+
"button-group": {
|
|
8
|
+
"import": "orbital-ds/ui/button-group",
|
|
9
|
+
"group": "actions",
|
|
10
|
+
"summary": "Bloque que une varios botones o un campo y su botón en una sola pieza: acciones hermanas, paginación o acción principal + menú.",
|
|
11
|
+
"see": [
|
|
12
|
+
{
|
|
13
|
+
"component": "toggle-group",
|
|
14
|
+
"when": "elegir una o varias opciones que quedan pulsadas (vista, alineación)"
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
"component": "input-group",
|
|
18
|
+
"when": "adornar un campo con iconos, prefijos o botones dentro del borde"
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
"component": "button",
|
|
22
|
+
"when": "una acción suelta"
|
|
23
|
+
}
|
|
24
|
+
],
|
|
25
|
+
"exports": [
|
|
26
|
+
"ButtonGroup",
|
|
27
|
+
"ButtonGroupSeparator",
|
|
28
|
+
"ButtonGroupText",
|
|
29
|
+
"buttonGroupVariants"
|
|
30
|
+
],
|
|
31
|
+
"slots": [
|
|
32
|
+
"button-group",
|
|
33
|
+
"button-group-separator",
|
|
34
|
+
"button-group-text"
|
|
35
|
+
],
|
|
36
|
+
"optionalPeers": [],
|
|
37
|
+
"props": {
|
|
38
|
+
"ButtonGroup": {
|
|
39
|
+
"orientation": {
|
|
40
|
+
"type": "\"horizontal\" | \"vertical\"",
|
|
41
|
+
"values": [
|
|
42
|
+
"horizontal",
|
|
43
|
+
"vertical"
|
|
44
|
+
]
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
},
|
|
48
|
+
"notes": [
|
|
49
|
+
"Solo une acciones; si los botones representan un estado elegido (vista, filtro), usa ToggleGroup.",
|
|
50
|
+
"`orientation=\"vertical\"` apila las piezas; un ButtonGroup dentro de otro deja hueco entre bloques."
|
|
51
|
+
],
|
|
52
|
+
"examples": [
|
|
53
|
+
{
|
|
54
|
+
"title": "Acciones hermanas",
|
|
55
|
+
"code": "<ButtonGroup>\n <Button variant=\"outline\">Archivar</Button>\n <Button variant=\"outline\">Duplicar</Button>\n</ButtonGroup>"
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
"title": "Acción principal + menú",
|
|
59
|
+
"code": "<ButtonGroup>\n <Button>Guardar</Button>\n <ButtonGroupSeparator />\n <Button size=\"icon\" aria-label=\"Más opciones de guardado\">\n <ChevronDownIcon />\n </Button>\n</ButtonGroup>"
|
|
60
|
+
}
|
|
61
|
+
]
|
|
62
|
+
},
|
|
63
|
+
"button": {
|
|
64
|
+
"import": "orbital-ds/ui/button",
|
|
65
|
+
"group": "actions",
|
|
66
|
+
"summary": "Botón para una acción que la persona dispara (guardar, crear, abrir un diálogo). Una sola acción principal por vista.",
|
|
67
|
+
"see": [
|
|
68
|
+
{
|
|
69
|
+
"component": "button-group",
|
|
70
|
+
"when": "varias acciones unidas en un bloque (alternativas o acción + menú)"
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
"component": "toggle",
|
|
74
|
+
"when": "botón que se queda pulsado (activa o desactiva un estado)"
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
"component": "copy-button",
|
|
78
|
+
"when": "copiar un valor al portapapeles con confirmación"
|
|
79
|
+
}
|
|
80
|
+
],
|
|
81
|
+
"exports": [
|
|
82
|
+
"Button",
|
|
83
|
+
"buttonVariants"
|
|
84
|
+
],
|
|
85
|
+
"slots": [
|
|
86
|
+
"button"
|
|
87
|
+
],
|
|
88
|
+
"optionalPeers": [],
|
|
89
|
+
"props": {
|
|
90
|
+
"Button": {
|
|
91
|
+
"variant": {
|
|
92
|
+
"type": "\"link\" | \"default\" | \"outline\" | \"secondary\" | \"ghost\" | \"destructive\" | \"cta\"",
|
|
93
|
+
"values": [
|
|
94
|
+
"link",
|
|
95
|
+
"default",
|
|
96
|
+
"outline",
|
|
97
|
+
"secondary",
|
|
98
|
+
"ghost",
|
|
99
|
+
"destructive",
|
|
100
|
+
"cta"
|
|
101
|
+
]
|
|
102
|
+
},
|
|
103
|
+
"size": {
|
|
104
|
+
"type": "\"default\" | \"xs\" | \"sm\" | \"lg\" | \"icon\" | \"icon-xs\" | \"icon-sm\" | \"icon-lg\"",
|
|
105
|
+
"values": [
|
|
106
|
+
"default",
|
|
107
|
+
"xs",
|
|
108
|
+
"sm",
|
|
109
|
+
"lg",
|
|
110
|
+
"icon",
|
|
111
|
+
"icon-xs",
|
|
112
|
+
"icon-sm",
|
|
113
|
+
"icon-lg"
|
|
114
|
+
]
|
|
115
|
+
},
|
|
116
|
+
"nativeButton": {
|
|
117
|
+
"type": "boolean"
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
},
|
|
121
|
+
"notes": [
|
|
122
|
+
"Una sola acción principal (variant default) por vista; las demás outline/ghost o en un menú.",
|
|
123
|
+
"Texto con verbo + objeto («Crear cliente»), nunca «Aceptar» o «Enviar»; botón de solo icono con aria-label.",
|
|
124
|
+
"cta: segunda voz de la vista (acción comercial o de captación); el tema la pinta con --ds-cta-bg/-fg/-hover y, sin ellos, es igual que default. Una por vista.",
|
|
125
|
+
"Destructivo: variant destructive y siempre con confirmación (AlertDialog) o deshacer."
|
|
126
|
+
],
|
|
127
|
+
"examples": [
|
|
128
|
+
{
|
|
129
|
+
"title": "Acción principal y secundaria",
|
|
130
|
+
"code": "<Button>Guardar cambios</Button>\n<Button variant=\"outline\">Cancelar</Button>"
|
|
131
|
+
},
|
|
132
|
+
{
|
|
133
|
+
"title": "Botón de solo icono (con texto accesible)",
|
|
134
|
+
"code": "<Button size=\"icon\" variant=\"ghost\" aria-label={t(\"actions.add\")}>\n <PlusIcon />\n</Button>"
|
|
135
|
+
},
|
|
136
|
+
{
|
|
137
|
+
"title": "Navegar con aspecto de botón (render, nunca asChild)",
|
|
138
|
+
"code": "<Button render={<a href=\"/clients/new\" />}>Nuevo cliente</Button>"
|
|
139
|
+
}
|
|
140
|
+
]
|
|
141
|
+
},
|
|
142
|
+
"copy-button": {
|
|
143
|
+
"import": "orbital-ds/ui/copy-button",
|
|
144
|
+
"group": "actions",
|
|
145
|
+
"summary": "Copia un valor al portapapeles y confirma «Copiado»: CopyButton (icono junto a un dato) o CopyField (el dato entero pulsable).",
|
|
146
|
+
"see": [
|
|
147
|
+
{
|
|
148
|
+
"component": "code-block",
|
|
149
|
+
"when": "mostrar código o comandos de varias líneas, con su propio copiar"
|
|
150
|
+
},
|
|
151
|
+
{
|
|
152
|
+
"component": "input-group",
|
|
153
|
+
"when": "un campo editable con botones dentro"
|
|
154
|
+
}
|
|
155
|
+
],
|
|
156
|
+
"exports": [
|
|
157
|
+
"CopyButton",
|
|
158
|
+
"CopyField"
|
|
159
|
+
],
|
|
160
|
+
"slots": [
|
|
161
|
+
"copy-button",
|
|
162
|
+
"copy-field",
|
|
163
|
+
"copy-field-icon",
|
|
164
|
+
"copy-field-value"
|
|
165
|
+
],
|
|
166
|
+
"optionalPeers": [],
|
|
167
|
+
"props": {
|
|
168
|
+
"CopyButton": {
|
|
169
|
+
"variant": {
|
|
170
|
+
"type": "\"link\" | \"default\" | \"outline\" | \"secondary\" | \"ghost\" | \"destructive\" | \"cta\"",
|
|
171
|
+
"values": [
|
|
172
|
+
"link",
|
|
173
|
+
"default",
|
|
174
|
+
"outline",
|
|
175
|
+
"secondary",
|
|
176
|
+
"ghost",
|
|
177
|
+
"destructive",
|
|
178
|
+
"cta"
|
|
179
|
+
]
|
|
180
|
+
},
|
|
181
|
+
"size": {
|
|
182
|
+
"type": "\"default\" | \"xs\" | \"sm\" | \"lg\" | \"icon\" | \"icon-xs\" | \"icon-sm\" | \"icon-lg\"",
|
|
183
|
+
"values": [
|
|
184
|
+
"default",
|
|
185
|
+
"xs",
|
|
186
|
+
"sm",
|
|
187
|
+
"lg",
|
|
188
|
+
"icon",
|
|
189
|
+
"icon-xs",
|
|
190
|
+
"icon-sm",
|
|
191
|
+
"icon-lg"
|
|
192
|
+
]
|
|
193
|
+
},
|
|
194
|
+
"nativeButton": {
|
|
195
|
+
"type": "boolean"
|
|
196
|
+
},
|
|
197
|
+
"value": {
|
|
198
|
+
"type": "string",
|
|
199
|
+
"required": true
|
|
200
|
+
}
|
|
201
|
+
},
|
|
202
|
+
"CopyField": {
|
|
203
|
+
"value": {
|
|
204
|
+
"type": "string",
|
|
205
|
+
"required": true
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
},
|
|
209
|
+
"notes": [
|
|
210
|
+
"El dato va limpio, sin instrucciones dentro del texto («Copia esta IP…»): el botón ya lo dice."
|
|
211
|
+
],
|
|
212
|
+
"examples": [
|
|
213
|
+
{
|
|
214
|
+
"title": "Dato pulsable",
|
|
215
|
+
"code": "<CopyField value=\"168.245.96.234\" />"
|
|
216
|
+
},
|
|
217
|
+
{
|
|
218
|
+
"title": "Solo el icono junto a un dato",
|
|
219
|
+
"code": "<CopyButton value={token} />"
|
|
220
|
+
}
|
|
221
|
+
]
|
|
222
|
+
},
|
|
223
|
+
"toggle-group": {
|
|
224
|
+
"import": "orbital-ds/ui/toggle-group",
|
|
225
|
+
"group": "actions",
|
|
226
|
+
"summary": "Grupo de botones que quedan pulsados para elegir una opción (vista, periodo) o varias (formato); el estado se ve en el propio botón.",
|
|
227
|
+
"see": [
|
|
228
|
+
{
|
|
229
|
+
"component": "toggle",
|
|
230
|
+
"when": "un único botón que se activa o desactiva"
|
|
231
|
+
},
|
|
232
|
+
{
|
|
233
|
+
"component": "radio-group",
|
|
234
|
+
"when": "elegir una opción dentro de un formulario, con etiquetas largas"
|
|
235
|
+
},
|
|
236
|
+
{
|
|
237
|
+
"component": "tabs",
|
|
238
|
+
"when": "cambiar entre paneles de contenido"
|
|
239
|
+
}
|
|
240
|
+
],
|
|
241
|
+
"exports": [
|
|
242
|
+
"ToggleGroup",
|
|
243
|
+
"ToggleGroupItem"
|
|
244
|
+
],
|
|
245
|
+
"slots": [
|
|
246
|
+
"toggle-group",
|
|
247
|
+
"toggle-group-item"
|
|
248
|
+
],
|
|
249
|
+
"optionalPeers": [],
|
|
250
|
+
"props": {
|
|
251
|
+
"ToggleGroup": {
|
|
252
|
+
"variant": {
|
|
253
|
+
"type": "\"default\" | \"outline\"",
|
|
254
|
+
"values": [
|
|
255
|
+
"default",
|
|
256
|
+
"outline"
|
|
257
|
+
]
|
|
258
|
+
},
|
|
259
|
+
"size": {
|
|
260
|
+
"type": "\"default\" | \"sm\" | \"lg\"",
|
|
261
|
+
"values": [
|
|
262
|
+
"default",
|
|
263
|
+
"sm",
|
|
264
|
+
"lg"
|
|
265
|
+
]
|
|
266
|
+
},
|
|
267
|
+
"spacing": {
|
|
268
|
+
"type": "number"
|
|
269
|
+
}
|
|
270
|
+
},
|
|
271
|
+
"ToggleGroupItem": {
|
|
272
|
+
"variant": {
|
|
273
|
+
"type": "\"default\" | \"outline\"",
|
|
274
|
+
"values": [
|
|
275
|
+
"default",
|
|
276
|
+
"outline"
|
|
277
|
+
]
|
|
278
|
+
},
|
|
279
|
+
"size": {
|
|
280
|
+
"type": "\"default\" | \"sm\" | \"lg\"",
|
|
281
|
+
"values": [
|
|
282
|
+
"default",
|
|
283
|
+
"sm",
|
|
284
|
+
"lg"
|
|
285
|
+
]
|
|
286
|
+
}
|
|
287
|
+
}
|
|
288
|
+
},
|
|
289
|
+
"notes": [
|
|
290
|
+
"`value`/`defaultValue` es siempre una lista, también con una sola opción; `multiple` permite varias.",
|
|
291
|
+
"Pon `aria-label` al grupo y a cada elemento de solo icono. `spacing={0}` los une en un bloque."
|
|
292
|
+
],
|
|
293
|
+
"examples": [
|
|
294
|
+
{
|
|
295
|
+
"title": "Una opción (vista)",
|
|
296
|
+
"code": "<ToggleGroup variant=\"outline\" spacing={0} defaultValue={[\"grid\"]} aria-label=\"Vista\">\n <ToggleGroupItem value=\"grid\">Cuadrícula</ToggleGroupItem>\n <ToggleGroupItem value=\"list\">Lista</ToggleGroupItem>\n</ToggleGroup>"
|
|
297
|
+
},
|
|
298
|
+
{
|
|
299
|
+
"title": "Varias a la vez, solo icono",
|
|
300
|
+
"code": "<ToggleGroup multiple defaultValue={[\"bold\"]} aria-label=\"Formato\">\n <ToggleGroupItem value=\"bold\" aria-label=\"Negrita\">\n <BoldIcon />\n </ToggleGroupItem>\n <ToggleGroupItem value=\"italic\" aria-label=\"Cursiva\">\n <ItalicIcon />\n </ToggleGroupItem>\n</ToggleGroup>"
|
|
301
|
+
}
|
|
302
|
+
]
|
|
303
|
+
},
|
|
304
|
+
"toggle": {
|
|
305
|
+
"import": "orbital-ds/ui/toggle",
|
|
306
|
+
"group": "actions",
|
|
307
|
+
"summary": "Botón que se queda pulsado para activar o desactivar un estado (favorito, seguir, negrita); no ejecuta una acción puntual.",
|
|
308
|
+
"see": [
|
|
309
|
+
{
|
|
310
|
+
"component": "toggle-group",
|
|
311
|
+
"when": "varias opciones relacionadas que se eligen juntas"
|
|
312
|
+
},
|
|
313
|
+
{
|
|
314
|
+
"component": "switch",
|
|
315
|
+
"when": "activar un ajuste en un formulario o en la configuración"
|
|
316
|
+
},
|
|
317
|
+
{
|
|
318
|
+
"component": "button",
|
|
319
|
+
"when": "una acción que se dispara y termina"
|
|
320
|
+
}
|
|
321
|
+
],
|
|
322
|
+
"exports": [
|
|
323
|
+
"Toggle",
|
|
324
|
+
"toggleVariants"
|
|
325
|
+
],
|
|
326
|
+
"slots": [
|
|
327
|
+
"toggle"
|
|
328
|
+
],
|
|
329
|
+
"optionalPeers": [],
|
|
330
|
+
"props": {
|
|
331
|
+
"Toggle": {
|
|
332
|
+
"variant": {
|
|
333
|
+
"type": "\"default\" | \"outline\"",
|
|
334
|
+
"values": [
|
|
335
|
+
"default",
|
|
336
|
+
"outline"
|
|
337
|
+
]
|
|
338
|
+
},
|
|
339
|
+
"size": {
|
|
340
|
+
"type": "\"default\" | \"sm\" | \"lg\"",
|
|
341
|
+
"values": [
|
|
342
|
+
"default",
|
|
343
|
+
"sm",
|
|
344
|
+
"lg"
|
|
345
|
+
]
|
|
346
|
+
}
|
|
347
|
+
}
|
|
348
|
+
},
|
|
349
|
+
"notes": [
|
|
350
|
+
"El texto o el `aria-label` no cambia al pulsarlo: el estado lo anuncia `aria-pressed`."
|
|
351
|
+
],
|
|
352
|
+
"examples": [
|
|
353
|
+
{
|
|
354
|
+
"title": "Solo icono",
|
|
355
|
+
"code": "<Toggle aria-label=\"Marcar como favorito\">\n <StarIcon />\n</Toggle>"
|
|
356
|
+
},
|
|
357
|
+
{
|
|
358
|
+
"title": "Con texto y borde, controlado",
|
|
359
|
+
"code": "<Toggle variant=\"outline\" pressed={siguiendo} onPressedChange={setSiguiendo}>\n <BellIcon data-icon=\"inline-start\" />\n Seguir hilo\n</Toggle>"
|
|
360
|
+
}
|
|
361
|
+
]
|
|
362
|
+
}
|
|
363
|
+
}
|
|
364
|
+
}
|