orbital-ds 0.36.0 → 0.40.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 +1 -1
- package/components.manifest.json +147 -15
- package/dist/hooks/use-ds-messages.d.ts +25 -0
- package/dist/hooks/use-in-view.d.ts +9 -0
- package/dist/hooks/use-in-view.js +33 -0
- package/dist/lib/i18n.d.ts +25 -0
- package/dist/lib/i18n.js +75 -0
- package/dist/lib/image-upload.d.ts +41 -0
- package/dist/lib/image-upload.js +66 -0
- package/dist/styles.css +16 -0
- package/dist/themes/lagoon.css +4 -1
- package/dist/themes/lagoon.scoped.css +4 -1
- package/dist/ui/badge.d.ts +5 -1
- package/dist/ui/badge.js +23 -3
- package/dist/ui/card.d.ts +16 -1
- package/dist/ui/card.js +35 -3
- package/dist/ui/checkbox.js +1 -1
- package/dist/ui/choice-card.js +1 -1
- package/dist/ui/combobox.js +1 -1
- package/dist/ui/confirm-dialog.d.ts +21 -0
- package/dist/ui/confirm-dialog.js +54 -0
- package/dist/ui/content-card.d.ts +20 -3
- package/dist/ui/content-card.js +66 -38
- package/dist/ui/error-state.d.ts +16 -0
- package/dist/ui/error-state.js +42 -0
- package/dist/ui/input-group.js +1 -1
- package/dist/ui/input-otp.js +1 -1
- package/dist/ui/input.js +1 -1
- package/dist/ui/instruction-editor.d.ts +15 -2
- package/dist/ui/instruction-editor.js +139 -16
- package/dist/ui/load-more.d.ts +19 -0
- package/dist/ui/load-more.js +72 -0
- package/dist/ui/loading-state.d.ts +5 -1
- package/dist/ui/loading-state.js +16 -12
- package/dist/ui/mosaic.d.ts +4 -2
- package/dist/ui/mosaic.js +13 -2
- package/dist/ui/native-select.js +1 -1
- package/dist/ui/questionnaire.js +4 -4
- package/dist/ui/radio-group.js +1 -1
- package/dist/ui/reveal.d.ts +11 -0
- package/dist/ui/reveal.js +39 -0
- package/dist/ui/scroll-area.js +1 -1
- package/dist/ui/search-box.d.ts +32 -0
- package/dist/ui/search-box.js +238 -0
- package/dist/ui/select.js +1 -1
- package/dist/ui/show-more.d.ts +12 -0
- package/dist/ui/show-more.js +66 -0
- package/dist/ui/skeleton.d.ts +7 -2
- package/dist/ui/skeleton.js +19 -3
- package/dist/ui/slider.d.ts +19 -2
- package/dist/ui/textarea.js +1 -1
- package/docs/designer/criterio.md +87 -0
- package/docs/designer/revision.md +11 -0
- package/package.json +18 -8
- package/scripts/cli.mjs +1 -0
- package/skill/SKILL.md +7 -3
package/dist/ui/questionnaire.js
CHANGED
|
@@ -105,7 +105,7 @@ function QuestionnaireChoice({
|
|
|
105
105
|
{
|
|
106
106
|
"data-slot": "questionnaire-choice",
|
|
107
107
|
className: cn(
|
|
108
|
-
"group/questionnaire-choice relative flex min-h-(--ds-touch-target) cursor-pointer items-start gap-3 rounded-control border border-
|
|
108
|
+
"group/questionnaire-choice relative flex min-h-(--ds-touch-target) cursor-pointer items-start gap-3 rounded-control border border-(--ds-field-border) px-4 py-3.5 text-start text-sm transition-colors duration-(--ds-motion-snap) outline-none select-none hover:bg-input/40 has-[>input:focus-visible]:border-ring has-[>input:focus-visible]:ring-(length:--ds-ring-width) has-[>input:focus-visible]:ring-(--ds-ring-color) data-invalid:border-destructive data-checked:border-(--ds-choice-selected-border) data-checked:bg-(--ds-choice-selected)",
|
|
109
109
|
"data-disabled:pointer-events-none data-disabled:cursor-not-allowed data-disabled:opacity-(--ds-disabled-opacity)",
|
|
110
110
|
className
|
|
111
111
|
),
|
|
@@ -123,7 +123,7 @@ function QuestionnaireChoice({
|
|
|
123
123
|
{
|
|
124
124
|
"aria-hidden": "true",
|
|
125
125
|
"data-slot": "questionnaire-choice-indicator",
|
|
126
|
-
className: "pointer-events-none relative flex size-4 shrink-0 translate-y-[--spacing(0.45)] items-center justify-center rounded-check border border-
|
|
126
|
+
className: "pointer-events-none relative flex size-4 shrink-0 translate-y-[--spacing(0.45)] items-center justify-center rounded-check border border-(--ds-field-border) group-has-data-[slot=questionnaire-choice-description]/questionnaire-choice:translate-y-0.5 group-data-[type=radio]/questionnaire-choice:rounded-full group-data-checked/questionnaire-choice:border-primary group-data-checked/questionnaire-choice:bg-primary group-data-checked/questionnaire-choice:text-primary-foreground bg-(--ds-check-bg) dark:group-data-checked/questionnaire-choice:bg-primary",
|
|
127
127
|
children: [
|
|
128
128
|
/* @__PURE__ */ jsx(
|
|
129
129
|
"span",
|
|
@@ -148,7 +148,7 @@ function QuestionnaireChoice({
|
|
|
148
148
|
QuestionnairePrimitive.ChoiceShortcut,
|
|
149
149
|
{
|
|
150
150
|
"data-slot": "questionnaire-choice-shortcut",
|
|
151
|
-
className: "pointer-events-none ms-auto hidden size-5 shrink-0 translate-y-[--spacing(0.45)] items-center justify-center rounded-full border border-
|
|
151
|
+
className: "pointer-events-none ms-auto hidden size-5 shrink-0 translate-y-[--spacing(0.45)] items-center justify-center rounded-full border border-(--ds-field-border) bg-background/80 font-mono text-2xs leading-none font-(--ds-medium-weight) text-muted-foreground group-has-data-[slot=questionnaire-choice-description]/questionnaire-choice:translate-y-0.5 group-data-[shortcut]/questionnaire-choice:inline-flex"
|
|
152
152
|
}
|
|
153
153
|
)
|
|
154
154
|
]
|
|
@@ -182,7 +182,7 @@ function QuestionnaireInput({
|
|
|
182
182
|
{
|
|
183
183
|
"data-slot": "questionnaire-input",
|
|
184
184
|
className: cn(
|
|
185
|
-
"h-(--ds-control-h-md) min-h-(--ds-touch-target) w-full min-w-0 rounded-control border border-
|
|
185
|
+
"h-(--ds-control-h-md) min-h-(--ds-touch-target) w-full min-w-0 rounded-control border border-(--ds-field-border) bg-(--ds-field-bg) px-(--ds-field-px) py-1 text-base transition-[color,box-shadow,background-color] duration-(--ds-motion-snap) outline-none focus-visible:border-ring focus-visible:ring-(length:--ds-ring-width) focus-visible:ring-(--ds-ring-color) disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-(--ds-disabled-opacity) aria-invalid:border-(--ds-invalid-border) aria-invalid:ring-(length:--ds-ring-width) aria-invalid:ring-(--ds-invalid-ring) sm:min-h-0 md:text-sm",
|
|
186
186
|
"selection:bg-primary selection:text-primary-foreground placeholder:text-muted-foreground",
|
|
187
187
|
className
|
|
188
188
|
),
|
package/dist/ui/radio-group.js
CHANGED
|
@@ -18,7 +18,7 @@ function RadioGroupItem({ className, ...props }) {
|
|
|
18
18
|
{
|
|
19
19
|
"data-slot": "radio-group-item",
|
|
20
20
|
className: cn(
|
|
21
|
-
"group/radio-group-item peer relative flex aspect-square size-(--ds-check-size) shrink-0 rounded-full border border-
|
|
21
|
+
"group/radio-group-item peer relative flex aspect-square size-(--ds-check-size) shrink-0 rounded-full border border-(--ds-field-border) outline-none group-has-[:focus-visible]/field-label:ring-0 group-has-[:focus-visible]/field-label:not-data-checked:border-input after:absolute after:-inset-x-3 after:-inset-y-2 focus-visible:border-ring focus-visible:ring-(length:--ds-ring-width) focus-visible:ring-(--ds-ring-color) disabled:cursor-not-allowed disabled:opacity-(--ds-disabled-opacity) aria-invalid:border-(--ds-invalid-border) aria-invalid:ring-(length:--ds-ring-width) aria-invalid:ring-(--ds-invalid-ring) aria-invalid:aria-checked:border-primary bg-(--ds-check-bg) data-checked:border-primary data-checked:bg-primary data-checked:text-primary-foreground group-has-[:focus-visible]/field-label:data-checked:border-primary dark:data-checked:bg-primary",
|
|
22
22
|
className
|
|
23
23
|
),
|
|
24
24
|
...props,
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
|
|
3
|
+
type RevealEffect = "fade" | "up" | "pop" | "slide";
|
|
4
|
+
declare function Reveal({ effect, index, once, className, style, ...props }: React.ComponentProps<"div"> & {
|
|
5
|
+
effect?: RevealEffect;
|
|
6
|
+
/** Posición en una lista: retrasa la entrada `index × --ds-motion-stagger`. */
|
|
7
|
+
index?: number;
|
|
8
|
+
once?: boolean;
|
|
9
|
+
}): React.JSX.Element;
|
|
10
|
+
|
|
11
|
+
export { Reveal, type RevealEffect };
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
import { useInView } from "../hooks/use-in-view.js";
|
|
4
|
+
import { cn } from "../lib/utils.js";
|
|
5
|
+
const EFFECT = {
|
|
6
|
+
fade: "data-[revealed=false]:opacity-0",
|
|
7
|
+
up: "data-[revealed=false]:translate-y-(--ds-motion-distance) data-[revealed=false]:opacity-0",
|
|
8
|
+
pop: "data-[revealed=false]:scale-(--ds-motion-scale) data-[revealed=false]:opacity-0",
|
|
9
|
+
slide: "data-[revealed=false]:translate-x-(--ds-motion-distance) data-[revealed=false]:opacity-0 rtl:data-[revealed=false]:-translate-x-(--ds-motion-distance)"
|
|
10
|
+
};
|
|
11
|
+
function Reveal({
|
|
12
|
+
effect = "up",
|
|
13
|
+
index = 0,
|
|
14
|
+
once = true,
|
|
15
|
+
className,
|
|
16
|
+
style,
|
|
17
|
+
...props
|
|
18
|
+
}) {
|
|
19
|
+
const [ref, inView] = useInView({ once });
|
|
20
|
+
return /* @__PURE__ */ jsx(
|
|
21
|
+
"div",
|
|
22
|
+
{
|
|
23
|
+
ref,
|
|
24
|
+
"data-slot": "reveal",
|
|
25
|
+
"data-effect": effect,
|
|
26
|
+
"data-revealed": inView,
|
|
27
|
+
style: { transitionDelay: index ? `calc(${index} * var(--ds-motion-stagger))` : void 0, ...style },
|
|
28
|
+
className: cn(
|
|
29
|
+
"transition-[opacity,translate,scale] duration-(--ds-motion-base) ease-(--ds-ease-enter) motion-reduce:transition-none motion-reduce:data-[revealed=false]:translate-x-0 motion-reduce:data-[revealed=false]:translate-y-0 motion-reduce:data-[revealed=false]:scale-100 motion-reduce:data-[revealed=false]:opacity-100",
|
|
30
|
+
EFFECT[effect],
|
|
31
|
+
className
|
|
32
|
+
),
|
|
33
|
+
...props
|
|
34
|
+
}
|
|
35
|
+
);
|
|
36
|
+
}
|
|
37
|
+
export {
|
|
38
|
+
Reveal
|
|
39
|
+
};
|
package/dist/ui/scroll-area.js
CHANGED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
|
|
3
|
+
interface SearchSuggestion {
|
|
4
|
+
id: string;
|
|
5
|
+
label: string;
|
|
6
|
+
/** Texto secundario (categoría, ruta…). */
|
|
7
|
+
description?: string;
|
|
8
|
+
icon?: React.ReactNode;
|
|
9
|
+
[key: string]: unknown;
|
|
10
|
+
}
|
|
11
|
+
interface SearchQueryOptions {
|
|
12
|
+
signal: AbortSignal;
|
|
13
|
+
}
|
|
14
|
+
declare function SearchBox({ onQuery, onSelect, onSubmit, recent, popular, debounce, minChars, maxResults, value: valueProp, defaultValue, onValueChange, placeholder, "aria-label": ariaLabel, className, ...props }: Omit<React.ComponentProps<"div">, "onSelect" | "onSubmit" | "defaultValue"> & {
|
|
15
|
+
/** Devuelve las sugerencias para un texto. Lanza o rechaza para mostrar el estado de error. */
|
|
16
|
+
onQuery: (query: string, options: SearchQueryOptions) => Promise<SearchSuggestion[]> | SearchSuggestion[];
|
|
17
|
+
onSelect?: (suggestion: SearchSuggestion) => void;
|
|
18
|
+
/** Enter sin sugerencia activa: busca el texto tal cual. */
|
|
19
|
+
onSubmit?: (query: string) => void;
|
|
20
|
+
recent?: SearchSuggestion[];
|
|
21
|
+
popular?: SearchSuggestion[];
|
|
22
|
+
debounce?: number;
|
|
23
|
+
minChars?: number;
|
|
24
|
+
maxResults?: number;
|
|
25
|
+
value?: string;
|
|
26
|
+
defaultValue?: string;
|
|
27
|
+
onValueChange?: (value: string) => void;
|
|
28
|
+
placeholder?: string;
|
|
29
|
+
"aria-label"?: string;
|
|
30
|
+
}): React.JSX.Element;
|
|
31
|
+
|
|
32
|
+
export { SearchBox, type SearchQueryOptions, type SearchSuggestion };
|
|
@@ -0,0 +1,238 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { SearchIcon, XIcon } from "lucide-react";
|
|
4
|
+
import * as React from "react";
|
|
5
|
+
import { useDsMessages } from "../hooks/use-ds-messages.js";
|
|
6
|
+
import { dsFormat } from "../lib/i18n.js";
|
|
7
|
+
import { cn } from "../lib/utils.js";
|
|
8
|
+
import { InputGroup, InputGroupAddon, InputGroupButton, InputGroupInput } from "./input-group.js";
|
|
9
|
+
import { Spinner } from "./spinner.js";
|
|
10
|
+
function Highlight({ text, query }) {
|
|
11
|
+
const q = query.trim();
|
|
12
|
+
if (!q) return /* @__PURE__ */ jsx(Fragment, { children: text });
|
|
13
|
+
const i = text.toLocaleLowerCase().indexOf(q.toLocaleLowerCase());
|
|
14
|
+
if (i < 0) return /* @__PURE__ */ jsx(Fragment, { children: text });
|
|
15
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
16
|
+
text.slice(0, i),
|
|
17
|
+
/* @__PURE__ */ jsx("mark", { className: "rounded-xs bg-transparent text-foreground underline decoration-primary underline-offset-2", children: text.slice(i, i + q.length) }),
|
|
18
|
+
text.slice(i + q.length)
|
|
19
|
+
] });
|
|
20
|
+
}
|
|
21
|
+
function SearchBox({
|
|
22
|
+
onQuery,
|
|
23
|
+
onSelect,
|
|
24
|
+
onSubmit,
|
|
25
|
+
recent,
|
|
26
|
+
popular,
|
|
27
|
+
debounce = 200,
|
|
28
|
+
minChars = 1,
|
|
29
|
+
maxResults = 8,
|
|
30
|
+
value: valueProp,
|
|
31
|
+
defaultValue = "",
|
|
32
|
+
onValueChange,
|
|
33
|
+
placeholder,
|
|
34
|
+
"aria-label": ariaLabel,
|
|
35
|
+
className,
|
|
36
|
+
...props
|
|
37
|
+
}) {
|
|
38
|
+
const t = useDsMessages();
|
|
39
|
+
const id = React.useId();
|
|
40
|
+
const listId = `${id}-list`;
|
|
41
|
+
const [inner, setInner] = React.useState(defaultValue);
|
|
42
|
+
const value = valueProp ?? inner;
|
|
43
|
+
const [open, setOpen] = React.useState(false);
|
|
44
|
+
const [results, setResults] = React.useState([]);
|
|
45
|
+
const [state, setState] = React.useState("idle");
|
|
46
|
+
const [searched, setSearched] = React.useState("");
|
|
47
|
+
const [active, setActive] = React.useState(-1);
|
|
48
|
+
const composing = React.useRef(false);
|
|
49
|
+
const queryRef = React.useRef(onQuery);
|
|
50
|
+
queryRef.current = onQuery;
|
|
51
|
+
const trimmed = value.trim();
|
|
52
|
+
const searching = trimmed.length >= minChars;
|
|
53
|
+
const setValue = (v) => {
|
|
54
|
+
setInner(v);
|
|
55
|
+
onValueChange?.(v);
|
|
56
|
+
};
|
|
57
|
+
React.useEffect(() => {
|
|
58
|
+
if (!searching) {
|
|
59
|
+
setResults([]);
|
|
60
|
+
setState("idle");
|
|
61
|
+
setSearched("");
|
|
62
|
+
return;
|
|
63
|
+
}
|
|
64
|
+
const ctrl = new AbortController();
|
|
65
|
+
setState("loading");
|
|
66
|
+
const timer = setTimeout(() => {
|
|
67
|
+
Promise.resolve().then(() => queryRef.current(trimmed, { signal: ctrl.signal })).then(
|
|
68
|
+
(list) => {
|
|
69
|
+
if (ctrl.signal.aborted) return;
|
|
70
|
+
setResults(list.slice(0, maxResults));
|
|
71
|
+
setSearched(trimmed);
|
|
72
|
+
setState("idle");
|
|
73
|
+
setActive(-1);
|
|
74
|
+
},
|
|
75
|
+
() => {
|
|
76
|
+
if (ctrl.signal.aborted) return;
|
|
77
|
+
setResults([]);
|
|
78
|
+
setSearched(trimmed);
|
|
79
|
+
setState("error");
|
|
80
|
+
}
|
|
81
|
+
);
|
|
82
|
+
}, debounce);
|
|
83
|
+
return () => {
|
|
84
|
+
clearTimeout(timer);
|
|
85
|
+
ctrl.abort();
|
|
86
|
+
};
|
|
87
|
+
}, [trimmed, searching, debounce, maxResults]);
|
|
88
|
+
const groups = searching ? [{ key: "results", items: results }] : [
|
|
89
|
+
...recent?.length ? [{ key: "recent", label: t.searchRecent, items: recent.slice(0, maxResults) }] : [],
|
|
90
|
+
...popular?.length ? [{ key: "popular", label: t.searchPopular, items: popular.slice(0, maxResults) }] : []
|
|
91
|
+
];
|
|
92
|
+
const flat = groups.flatMap((g) => g.items);
|
|
93
|
+
const optionId = (i) => `${id}-opt-${i}`;
|
|
94
|
+
const noResults = searching && state === "idle" && searched === trimmed && results.length === 0;
|
|
95
|
+
const showPanel = open && (flat.length > 0 || state === "error" || noResults);
|
|
96
|
+
const choose = (s) => {
|
|
97
|
+
setOpen(false);
|
|
98
|
+
setActive(-1);
|
|
99
|
+
onSelect?.(s);
|
|
100
|
+
};
|
|
101
|
+
const onKeyDown = (e) => {
|
|
102
|
+
if (composing.current || e.nativeEvent.isComposing) return;
|
|
103
|
+
if (e.key === "ArrowDown" || e.key === "ArrowUp") {
|
|
104
|
+
if (!flat.length) return;
|
|
105
|
+
e.preventDefault();
|
|
106
|
+
setOpen(true);
|
|
107
|
+
setActive((a) => {
|
|
108
|
+
if (e.key === "ArrowDown") return (a + 1) % flat.length;
|
|
109
|
+
return a <= 0 ? flat.length - 1 : a - 1;
|
|
110
|
+
});
|
|
111
|
+
} else if (e.key === "Enter") {
|
|
112
|
+
const s = flat[active];
|
|
113
|
+
if (open && s) {
|
|
114
|
+
e.preventDefault();
|
|
115
|
+
choose(s);
|
|
116
|
+
} else if (trimmed && onSubmit) {
|
|
117
|
+
e.preventDefault();
|
|
118
|
+
setOpen(false);
|
|
119
|
+
onSubmit(trimmed);
|
|
120
|
+
}
|
|
121
|
+
} else if (e.key === "Escape") {
|
|
122
|
+
if (open) {
|
|
123
|
+
e.preventDefault();
|
|
124
|
+
setOpen(false);
|
|
125
|
+
setActive(-1);
|
|
126
|
+
} else if (value) {
|
|
127
|
+
e.preventDefault();
|
|
128
|
+
setValue("");
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
};
|
|
132
|
+
const status = state === "loading" ? t.loading : state === "error" ? t.searchError : noResults ? dsFormat(t.searchNoResults, { query: trimmed }) : searching && results.length ? dsFormat(t.searchCount, { count: results.length }) : "";
|
|
133
|
+
let index = -1;
|
|
134
|
+
return /* @__PURE__ */ jsxs(
|
|
135
|
+
"div",
|
|
136
|
+
{
|
|
137
|
+
"data-slot": "search-box",
|
|
138
|
+
"data-state": state,
|
|
139
|
+
className: cn("relative w-full", className),
|
|
140
|
+
onBlur: (e) => {
|
|
141
|
+
if (!e.currentTarget.contains(e.relatedTarget)) setOpen(false);
|
|
142
|
+
},
|
|
143
|
+
...props,
|
|
144
|
+
children: [
|
|
145
|
+
/* @__PURE__ */ jsxs(InputGroup, { children: [
|
|
146
|
+
/* @__PURE__ */ jsx(InputGroupAddon, { children: /* @__PURE__ */ jsx(SearchIcon, {}) }),
|
|
147
|
+
/* @__PURE__ */ jsx(
|
|
148
|
+
InputGroupInput,
|
|
149
|
+
{
|
|
150
|
+
"data-slot": "search-box-input",
|
|
151
|
+
type: "search",
|
|
152
|
+
role: "combobox",
|
|
153
|
+
inputMode: "search",
|
|
154
|
+
enterKeyHint: "search",
|
|
155
|
+
autoComplete: "off",
|
|
156
|
+
"aria-label": ariaLabel ?? placeholder ?? t.searchPlaceholder,
|
|
157
|
+
"aria-expanded": showPanel,
|
|
158
|
+
"aria-controls": listId,
|
|
159
|
+
"aria-autocomplete": "list",
|
|
160
|
+
"aria-activedescendant": showPanel && active >= 0 ? optionId(active) : void 0,
|
|
161
|
+
placeholder: placeholder ?? t.searchPlaceholder,
|
|
162
|
+
value,
|
|
163
|
+
onChange: (e) => {
|
|
164
|
+
setValue(e.target.value);
|
|
165
|
+
setOpen(true);
|
|
166
|
+
},
|
|
167
|
+
onFocus: () => setOpen(true),
|
|
168
|
+
onKeyDown,
|
|
169
|
+
onCompositionStart: () => {
|
|
170
|
+
composing.current = true;
|
|
171
|
+
},
|
|
172
|
+
onCompositionEnd: () => {
|
|
173
|
+
composing.current = false;
|
|
174
|
+
},
|
|
175
|
+
className: "[&::-webkit-search-cancel-button]:hidden"
|
|
176
|
+
}
|
|
177
|
+
),
|
|
178
|
+
/* @__PURE__ */ jsxs(InputGroupAddon, { align: "inline-end", children: [
|
|
179
|
+
state === "loading" ? /* @__PURE__ */ jsx(Spinner, {}) : null,
|
|
180
|
+
value ? /* @__PURE__ */ jsx(InputGroupButton, { size: "icon-xs", "aria-label": t.searchClear, onClick: () => setValue(""), children: /* @__PURE__ */ jsx(XIcon, {}) }) : null
|
|
181
|
+
] })
|
|
182
|
+
] }),
|
|
183
|
+
/* @__PURE__ */ jsx(
|
|
184
|
+
"div",
|
|
185
|
+
{
|
|
186
|
+
id: listId,
|
|
187
|
+
role: "listbox",
|
|
188
|
+
"aria-label": ariaLabel ?? placeholder ?? t.searchPlaceholder,
|
|
189
|
+
"data-slot": "search-box-list",
|
|
190
|
+
hidden: !showPanel,
|
|
191
|
+
className: "absolute inset-x-0 top-full z-(--ds-z-overlay) mt-1 max-h-(--ds-select-max-h) overflow-y-auto rounded-popover bg-popover p-(--ds-menu-p) text-popover-foreground shadow-popover ring-(length:--ds-layer-ring-w) ring-(--ds-layer-ring)",
|
|
192
|
+
children: state === "error" ? /* @__PURE__ */ jsx("p", { className: "px-(--ds-menu-item-px) py-(--ds-menu-item-py) text-sm text-destructive", children: t.searchError }) : noResults ? /* @__PURE__ */ jsx("p", { className: "px-(--ds-menu-item-px) py-(--ds-menu-item-py) text-sm text-muted-foreground", children: dsFormat(t.searchNoResults, { query: trimmed }) }) : groups.map((g) => /* @__PURE__ */ jsxs("div", { role: "group", "aria-label": g.label ?? t.searchResults, "data-slot": "search-box-group", children: [
|
|
193
|
+
g.label ? /* @__PURE__ */ jsx(
|
|
194
|
+
"p",
|
|
195
|
+
{
|
|
196
|
+
"aria-hidden": "true",
|
|
197
|
+
className: "px-(--ds-menu-item-px) py-(--ds-menu-label-py) text-xs font-(--ds-medium-weight) text-muted-foreground",
|
|
198
|
+
children: g.label
|
|
199
|
+
}
|
|
200
|
+
) : null,
|
|
201
|
+
g.items.map((s) => {
|
|
202
|
+
index += 1;
|
|
203
|
+
const i = index;
|
|
204
|
+
return /* @__PURE__ */ jsxs(
|
|
205
|
+
"div",
|
|
206
|
+
{
|
|
207
|
+
id: optionId(i),
|
|
208
|
+
role: "option",
|
|
209
|
+
"aria-selected": i === active,
|
|
210
|
+
tabIndex: -1,
|
|
211
|
+
"data-slot": "search-box-option",
|
|
212
|
+
"data-active": i === active || void 0,
|
|
213
|
+
onMouseDown: (e) => e.preventDefault(),
|
|
214
|
+
onClick: () => choose(s),
|
|
215
|
+
onKeyDown: () => {
|
|
216
|
+
},
|
|
217
|
+
onMouseMove: () => setActive(i),
|
|
218
|
+
className: "flex cursor-default items-center gap-2 rounded-control px-(--ds-menu-item-px) py-(--ds-menu-item-py) text-sm data-active:bg-(--ds-hover-bg) [&_svg]:size-4 [&_svg]:text-muted-foreground",
|
|
219
|
+
children: [
|
|
220
|
+
s.icon,
|
|
221
|
+
/* @__PURE__ */ jsx("span", { className: "min-w-0 flex-1 truncate", children: /* @__PURE__ */ jsx(Highlight, { text: s.label, query: searching ? trimmed : "" }) }),
|
|
222
|
+
s.description ? /* @__PURE__ */ jsx("span", { className: "truncate text-xs text-muted-foreground", children: s.description }) : null
|
|
223
|
+
]
|
|
224
|
+
},
|
|
225
|
+
`${g.key}-${s.id}`
|
|
226
|
+
);
|
|
227
|
+
})
|
|
228
|
+
] }, g.key))
|
|
229
|
+
}
|
|
230
|
+
),
|
|
231
|
+
/* @__PURE__ */ jsx("p", { "data-slot": "search-box-status", role: "status", "aria-live": "polite", className: "sr-only", children: status })
|
|
232
|
+
]
|
|
233
|
+
}
|
|
234
|
+
);
|
|
235
|
+
}
|
|
236
|
+
export {
|
|
237
|
+
SearchBox
|
|
238
|
+
};
|
package/dist/ui/select.js
CHANGED
|
@@ -28,7 +28,7 @@ function SelectTrigger({
|
|
|
28
28
|
"data-slot": "select-trigger",
|
|
29
29
|
"data-size": size,
|
|
30
30
|
className: cn(
|
|
31
|
-
"flex w-fit cursor-pointer items-center justify-between gap-1.5 rounded-control hover:border-ring/60 shadow-control border border-
|
|
31
|
+
"flex w-fit cursor-pointer items-center justify-between gap-1.5 rounded-control hover:border-ring/60 shadow-control border border-(--ds-field-border) bg-(--ds-field-bg) px-(--ds-field-px) py-2 text-sm whitespace-nowrap transition-colors duration-(--ds-motion-snap) outline-none focus-visible:border-ring focus-visible:ring-(length:--ds-ring-width) focus-visible:ring-(--ds-ring-color) disabled:cursor-not-allowed disabled:opacity-(--ds-disabled-opacity) aria-invalid:border-(--ds-invalid-border) aria-invalid:ring-(length:--ds-ring-width) aria-invalid:ring-(--ds-invalid-ring) data-placeholder:text-muted-foreground data-[size=default]:h-(--ds-control-h-md) data-[size=sm]:h-(--ds-control-h-sm) *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-1.5 cursor-pointer hover:bg-(--ds-field-bg-hover) data-popup-open:bg-(--ds-field-bg-hover) [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
32
32
|
className
|
|
33
33
|
),
|
|
34
34
|
...props,
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
|
|
3
|
+
declare function ShowMore({ lines, defaultExpanded, onExpandedChange, moreLabel, lessLabel, className, children, ...props }: Omit<React.ComponentProps<"div">, "children"> & {
|
|
4
|
+
lines?: number;
|
|
5
|
+
defaultExpanded?: boolean;
|
|
6
|
+
onExpandedChange?: (expanded: boolean) => void;
|
|
7
|
+
moreLabel?: React.ReactNode;
|
|
8
|
+
lessLabel?: React.ReactNode;
|
|
9
|
+
children?: React.ReactNode;
|
|
10
|
+
}): React.JSX.Element;
|
|
11
|
+
|
|
12
|
+
export { ShowMore };
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import { useDsMessages } from "../hooks/use-ds-messages.js";
|
|
5
|
+
import { cn } from "../lib/utils.js";
|
|
6
|
+
import { Button } from "./button.js";
|
|
7
|
+
function ShowMore({
|
|
8
|
+
lines = 3,
|
|
9
|
+
defaultExpanded = false,
|
|
10
|
+
onExpandedChange,
|
|
11
|
+
moreLabel,
|
|
12
|
+
lessLabel,
|
|
13
|
+
className,
|
|
14
|
+
children,
|
|
15
|
+
...props
|
|
16
|
+
}) {
|
|
17
|
+
const t = useDsMessages();
|
|
18
|
+
const id = React.useId();
|
|
19
|
+
const ref = React.useRef(null);
|
|
20
|
+
const [expanded, setExpanded] = React.useState(defaultExpanded);
|
|
21
|
+
const [truncated, setTruncated] = React.useState(false);
|
|
22
|
+
React.useEffect(() => {
|
|
23
|
+
const el = ref.current;
|
|
24
|
+
if (!el || expanded) return;
|
|
25
|
+
const measure = () => setTruncated(el.scrollHeight - el.clientHeight > 1);
|
|
26
|
+
measure();
|
|
27
|
+
if (typeof ResizeObserver === "undefined") return;
|
|
28
|
+
const ro = new ResizeObserver(measure);
|
|
29
|
+
ro.observe(el);
|
|
30
|
+
return () => ro.disconnect();
|
|
31
|
+
}, [expanded, lines, children]);
|
|
32
|
+
const toggle = () => {
|
|
33
|
+
setExpanded((v) => {
|
|
34
|
+
onExpandedChange?.(!v);
|
|
35
|
+
return !v;
|
|
36
|
+
});
|
|
37
|
+
};
|
|
38
|
+
return /* @__PURE__ */ jsxs("div", { "data-slot": "show-more", "data-expanded": expanded, className: cn("flex flex-col items-start gap-1", className), ...props, children: [
|
|
39
|
+
/* @__PURE__ */ jsx(
|
|
40
|
+
"div",
|
|
41
|
+
{
|
|
42
|
+
ref,
|
|
43
|
+
id,
|
|
44
|
+
"data-slot": "show-more-content",
|
|
45
|
+
style: expanded ? void 0 : { display: "-webkit-box", WebkitLineClamp: lines, WebkitBoxOrient: "vertical", overflow: "hidden" },
|
|
46
|
+
children
|
|
47
|
+
}
|
|
48
|
+
),
|
|
49
|
+
truncated || expanded ? /* @__PURE__ */ jsx(
|
|
50
|
+
Button,
|
|
51
|
+
{
|
|
52
|
+
"data-slot": "show-more-toggle",
|
|
53
|
+
variant: "link",
|
|
54
|
+
size: "sm",
|
|
55
|
+
className: "h-auto p-0",
|
|
56
|
+
"aria-expanded": expanded,
|
|
57
|
+
"aria-controls": id,
|
|
58
|
+
onClick: toggle,
|
|
59
|
+
children: expanded ? lessLabel ?? t.showLess : moreLabel ?? t.showMore
|
|
60
|
+
}
|
|
61
|
+
) : null
|
|
62
|
+
] });
|
|
63
|
+
}
|
|
64
|
+
export {
|
|
65
|
+
ShowMore
|
|
66
|
+
};
|
package/dist/ui/skeleton.d.ts
CHANGED
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
import * as React$1 from 'react';
|
|
2
|
+
import * as class_variance_authority_types from 'class-variance-authority/types';
|
|
3
|
+
import { VariantProps } from 'class-variance-authority';
|
|
2
4
|
|
|
3
|
-
declare
|
|
5
|
+
declare const skeletonVariants: (props?: ({
|
|
6
|
+
variant?: "default" | "shimmer" | null | undefined;
|
|
7
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
8
|
+
declare function Skeleton({ className, variant, ...props }: React.ComponentProps<"div"> & VariantProps<typeof skeletonVariants>): React$1.JSX.Element;
|
|
4
9
|
|
|
5
|
-
export { Skeleton };
|
|
10
|
+
export { Skeleton, skeletonVariants };
|
package/dist/ui/skeleton.js
CHANGED
|
@@ -1,15 +1,31 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { cva } from "class-variance-authority";
|
|
2
3
|
import { cn } from "../lib/utils.js";
|
|
3
|
-
|
|
4
|
+
const skeletonVariants = cva("rounded-skeleton bg-muted", {
|
|
5
|
+
variants: {
|
|
6
|
+
variant: {
|
|
7
|
+
default: "animate-pulse",
|
|
8
|
+
shimmer: "shimmer motion-reduce:animate-none"
|
|
9
|
+
}
|
|
10
|
+
},
|
|
11
|
+
defaultVariants: { variant: "default" }
|
|
12
|
+
});
|
|
13
|
+
function Skeleton({
|
|
14
|
+
className,
|
|
15
|
+
variant = "default",
|
|
16
|
+
...props
|
|
17
|
+
}) {
|
|
4
18
|
return /* @__PURE__ */ jsx(
|
|
5
19
|
"div",
|
|
6
20
|
{
|
|
7
21
|
"data-slot": "skeleton",
|
|
8
|
-
|
|
22
|
+
"data-variant": variant,
|
|
23
|
+
className: cn(skeletonVariants({ variant }), className),
|
|
9
24
|
...props
|
|
10
25
|
}
|
|
11
26
|
);
|
|
12
27
|
}
|
|
13
28
|
export {
|
|
14
|
-
Skeleton
|
|
29
|
+
Skeleton,
|
|
30
|
+
skeletonVariants
|
|
15
31
|
};
|
package/dist/ui/slider.d.ts
CHANGED
|
@@ -1,6 +1,23 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { Slider as Slider$1 } from '@base-ui/react/slider';
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
type SliderBase = Omit<Slider$1.Root.Props, "value" | "defaultValue" | "onValueChange" | "onValueCommitted">;
|
|
5
|
+
type SliderEventDetails = Slider$1.Root.ChangeEventDetails;
|
|
6
|
+
/** Un tirador: `value` es un número y `onValueChange` recibe un número. */
|
|
7
|
+
type SliderSingleProps = SliderBase & {
|
|
8
|
+
value?: number;
|
|
9
|
+
defaultValue?: number;
|
|
10
|
+
onValueChange?: (value: number, details: SliderEventDetails) => void;
|
|
11
|
+
onValueCommitted?: (value: number, details: Slider$1.Root.CommitEventDetails) => void;
|
|
12
|
+
};
|
|
13
|
+
/** Rango o varios tiradores: `value` es una lista y `onValueChange` recibe una lista. */
|
|
14
|
+
type SliderRangeProps = SliderBase & {
|
|
15
|
+
value?: readonly number[];
|
|
16
|
+
defaultValue?: readonly number[];
|
|
17
|
+
onValueChange?: (value: number[], details: SliderEventDetails) => void;
|
|
18
|
+
onValueCommitted?: (value: number[], details: Slider$1.Root.CommitEventDetails) => void;
|
|
19
|
+
};
|
|
20
|
+
type SliderProps = SliderSingleProps | SliderRangeProps;
|
|
21
|
+
declare function Slider({ className, defaultValue, value, min, max, ...props }: SliderProps): React.JSX.Element;
|
|
5
22
|
|
|
6
|
-
export { Slider };
|
|
23
|
+
export { Slider, type SliderProps };
|
package/dist/ui/textarea.js
CHANGED
|
@@ -6,7 +6,7 @@ function Textarea({ className, ...props }) {
|
|
|
6
6
|
{
|
|
7
7
|
"data-slot": "textarea",
|
|
8
8
|
className: cn(
|
|
9
|
-
"min-h-16 w-full min-w-0 rounded-field-multiline border border-
|
|
9
|
+
"min-h-16 w-full min-w-0 rounded-field-multiline border border-(--ds-field-border) bg-(--ds-field-bg) px-(--ds-field-px) py-2 text-base transition-colors duration-(--ds-motion-snap) outline-none placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-(length:--ds-ring-width) focus-visible:ring-(--ds-ring-color) disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-(--ds-disabled-opacity) aria-invalid:border-(--ds-invalid-border) aria-invalid:ring-(length:--ds-ring-width) aria-invalid:ring-(--ds-invalid-ring) md:text-sm",
|
|
10
10
|
className
|
|
11
11
|
),
|
|
12
12
|
...props
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
# Diseñador orbital-ds · 5. Criterio visual (armonía y elección de elementos)
|
|
2
|
+
|
|
3
|
+
Cómo **analizar el aspecto** de una pantalla y **elegir el elemento correcto** (¿tarjeta, ítem, bento, imagen,
|
|
4
|
+
efecto?) antes de componerla. Va entre `patrones.md` (qué patrón) y `revision.md` (comprobación). Si choca con el
|
|
5
|
+
contrato o el tema, gana el sistema; esto sirve para elegir **dentro** de él.
|
|
6
|
+
|
|
7
|
+
Origen: síntesis de referentes de la industria. Las fuentes son guías públicas y artículos de práctica; los números
|
|
8
|
+
concretos son orientativos, no normas. Contrasta lo que dependa de una cifra.
|
|
9
|
+
|
|
10
|
+
## 1. Qué enseñan los referentes (y cómo se traduce aquí)
|
|
11
|
+
|
|
12
|
+
| Referente | Idea útil | En orbital-ds |
|
|
13
|
+
|---|---|---|
|
|
14
|
+
| **Apple HIG** (claridad, deferencia, profundidad; en iOS 26, jerarquía · armonía · consistencia) | El contenido manda; la interfaz se aparta. El vidrio/material va en la capa de **control y navegación**, no en la de contenido. | `glass` y fondos vivos solo en cabeceras, lateral, paneles flotantes o fondos de acceso; nunca detrás de texto largo ni de tablas. |
|
|
15
|
+
| **Material 3 Expressive** (Google) | Dar **énfasis** (color, forma, tamaño) al elemento clave ayuda a encontrarlo antes; un grupo no pequeño prefiere versiones calmadas. La mejora medida de forma independiente es moderada, no mágica. | Un solo elemento enfatizado por vista (`variant` principal, tarjeta `feature`/`hero`); el resto, calmado. Respeta `--ds-density` y el tema. |
|
|
16
|
+
| **Nielsen** (10 heurísticas) | Estado visible, consistencia, minimalismo, recuperarse de errores. | `ux.md`. Cada elemento extra compite con lo importante. |
|
|
17
|
+
| **Polaris / GOV.UK** | Documentan **cuándo usar y cuándo NO usar** cada pieza. | Los `@note` del manifiesto; si dudas entre dos piezas, lee el `@note` de ambas. |
|
|
18
|
+
| **Carbon / Primer / Atlassian** | Tokens y patrones antes que píxeles; un componente «experimental» no se usa de base. | Variables `--ds-*`; nada de medidas a mano. |
|
|
19
|
+
|
|
20
|
+
## 2. Cómo analizar una pantalla (en este orden, 8 pasos)
|
|
21
|
+
|
|
22
|
+
Puntúa cada uno 0–2 (0 falla · 1 mejorable · 2 bien). Por debajo de 12/16, rehaz antes de entregar.
|
|
23
|
+
|
|
24
|
+
1. **Jerarquía.** Mirando entrecerrado: ¿se distingue **una** cosa principal, luego lo secundario, luego el resto?
|
|
25
|
+
Tamaño y peso primero, color después. Si todo destaca, nada destaca.
|
|
26
|
+
2. **Ritmo y agrupación.** La proximidad agrupa: más espacio **entre** grupos que **dentro**. Misma separación para
|
|
27
|
+
lo del mismo nivel (usa los espacios del sistema, `--ds-density`; no inventes).
|
|
28
|
+
3. **Alineación y rejilla.** Bordes comunes; columnas coherentes; la bento o el mosaico con `Mosaic`, no con
|
|
29
|
+
anchos sueltos. Orden del DOM = orden de lectura (el orden visual no debe contradecirlo).
|
|
30
|
+
4. **Contraste y legibilidad.** Texto sobre imagen **siempre con velo** (`--ds-card-scrim`); estado nunca solo con color; AA mínimo.
|
|
31
|
+
5. **Consistencia.** Mismo patrón para el mismo problema; mismas esquinas, sombras y gestos que el tema.
|
|
32
|
+
6. **Densidad.** ¿Cuánto hay por pantalla? Una vista de trabajo admite densidad; una de decisión, aire. Más de ~9 celdas
|
|
33
|
+
en un bloque bento diluye la jerarquía.
|
|
34
|
+
7. **Estados.** Vacío, carga (forma del contenido), error con reintento, éxito, desactivado, foco, hover/pulsado.
|
|
35
|
+
8. **Movimiento.** Explica origen o cambio de estado; ritmo del tema; quieto con movimiento reducido.
|
|
36
|
+
|
|
37
|
+
## 3. Elegir el elemento (árbol de decisión)
|
|
38
|
+
|
|
39
|
+
**¿Qué tengo que mostrar?**
|
|
40
|
+
- **Una entidad que se lista y se actúa** (agente, dispositivo, proyecto) → `Item variant="card"` (+ `ItemMedia`/`IconTile`,
|
|
41
|
+
`ItemActions`). No `Card` + `Item` a mano.
|
|
42
|
+
- **Contenido con título, texto y a veces imagen** (artículo, producto, recurso) → `ContentCard` con su `preset`
|
|
43
|
+
(`basic` · `feature` · `media` · `horizontal` · `cover`).
|
|
44
|
+
- **Una cifra o una tendencia** → `StatGroup` / KPI / `ChartCard preset="glance"`. No una tarjeta de texto con un número.
|
|
45
|
+
- **Un grupo de bloques de distinto peso** (resumen, portada, panel) → `Mosaic preset="bento" | "hero" | "showcase"` con `MosaicItem span`.
|
|
46
|
+
- **Un bloque único de sección con cabecera, contenido y pie** → `Card`.
|
|
47
|
+
- **Una lista larga homogénea** → `EntityList` / `DataTable`; no un mosaico.
|
|
48
|
+
- **Agrupar sin caja** → separador y espacio, no otra tarjeta (nada de tarjetas dentro de tarjetas).
|
|
49
|
+
|
|
50
|
+
**Tarjeta con imagen o fondo (`ContentCard preset="cover"`, `Card backdrop`):**
|
|
51
|
+
- Úsala cuando la imagen **es** el contenido (destino, producto, campaña). No para decorar un formulario.
|
|
52
|
+
- Título corto sobre el velo; ninguna información crítica solo en la imagen; `alt` o `aria-hidden` según informe o decore.
|
|
53
|
+
- Un fondo vivo (`backdrop` mesh/aurora/dots, `animated`) como mucho en 1–2 tarjetas por vista; son énfasis, no textura general.
|
|
54
|
+
|
|
55
|
+
**Efectos de interacción (`hoverable`, `spotlight`, `glow`):**
|
|
56
|
+
- Solo en tarjetas **pulsables** (llevan enlace o acción). Un efecto de «clicable» en algo que no lo es engaña.
|
|
57
|
+
- Uno por tarjeta (elige `hoverable` **o** `spotlight`); el hover es refuerzo, nunca el único aviso (táctil no tiene hover).
|
|
58
|
+
|
|
59
|
+
**Bento — reglas:**
|
|
60
|
+
- Es una **jerarquía**, no una rejilla de cajas iguales: 1 celda protagonista, 2–3 medianas, el resto pequeñas.
|
|
61
|
+
- Cada celda cuenta una cosa; la protagonista lleva el mensaje principal.
|
|
62
|
+
- En móvil cae a una columna conservando el orden de importancia.
|
|
63
|
+
|
|
64
|
+
**Revelar y cargar:**
|
|
65
|
+
- Entrada al desplazar (`Reveal`): solo bloques fuera de la primera pantalla; no en listas que se filtran o reordenan.
|
|
66
|
+
- Listas largas: `LoadMore` (botón, con el resto visible; `auto` solo como extra) antes que scroll infinito; para saltar a una
|
|
67
|
+
página o trabajar con datos, `Pagination`.
|
|
68
|
+
- Texto largo en una tarjeta: `ShowMore`.
|
|
69
|
+
- Búsqueda mientras se escribe: `SearchBox` (recientes y populares al enfocar; estados vacío/error; la app pone la consulta).
|
|
70
|
+
|
|
71
|
+
## 4. Armonía: lo que hace que «se vea cuidado»
|
|
72
|
+
- **Una voz.** Un énfasis por vista; el resto, calmado. Un tema = un gesto firma.
|
|
73
|
+
- **Radios coherentes:** el radio de lo de dentro es menor que el de su contenedor (los tokens ya lo resuelven; no pongas `rounded-*` sueltos).
|
|
74
|
+
- **Sombras y capas:** solo las del tema (`shadow-*`, `--ds-card-glow`); la elevación indica interactividad o capa, no decoración.
|
|
75
|
+
- **Titulares y párrafos:** equilibrados (`text-wrap: balance` en títulos, `pretty` en párrafos), longitud de línea cómoda (≈ 45–75 caracteres).
|
|
76
|
+
- **Color:** de la marca solo el primario como acento; neutros del tema; los estados con su tono semántico.
|
|
77
|
+
- **Espacio:** el aire es parte del diseño; recortarlo para «meter más» baja la jerarquía.
|
|
78
|
+
- **Detalle de estado:** foco visible, desactivado legible, carga con forma real, error con salida.
|
|
79
|
+
|
|
80
|
+
## 5. Si algo no se puede lograr con el sistema
|
|
81
|
+
No lo fuerces con estilos propios: dilo, propón la combinación de patrones más cercana y anota el hueco (variable o
|
|
82
|
+
variante que faltaría) para la librería. Es mejor un hueco anotado que una pantalla fuera del sistema.
|
|
83
|
+
|
|
84
|
+
## Fuentes
|
|
85
|
+
Apple HIG y su revisión Liquid Glass (resúmenes: createwithswift.com, superdesign.dev); Google Design, «Expressive Design: research»
|
|
86
|
+
y el estudio independiente (ACM, 2026); Nielsen Norman Group (10 heurísticas); guías «cuándo usar / cuándo no» de Polaris y
|
|
87
|
+
GOV.UK; guías de bento y de carga progresiva (Smashing Magazine, uxpatterns.dev). Verifica en las fuentes oficiales si una decisión depende de una cifra.
|