@sincpro/web-ui 2.13.0 → 2.14.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/README.md +15 -5
- package/dist/components/gallery/Gallery.d.ts +29 -0
- package/dist/components/gallery/Gallery.js +78 -0
- package/dist/components/gallery/Lightbox.d.ts +28 -0
- package/dist/components/gallery/Lightbox.js +59 -0
- package/dist/components/gallery/index.d.ts +2 -0
- package/dist/components/gallery/index.js +3 -0
- package/dist/components/index.d.ts +2 -0
- package/dist/components/index.js +2 -0
- package/dist/components/listing/ColumnsMenu.js +4 -2
- package/dist/components/listing/columns.d.ts +3 -0
- package/dist/components/listing/columns.js +4 -0
- package/dist/components/plans/PlanCard.d.ts +43 -0
- package/dist/components/plans/PlanCard.js +35 -0
- package/dist/components/plans/index.d.ts +1 -0
- package/dist/components/plans/index.js +2 -0
- package/dist/components/search/CriteriaChips.d.ts +14 -1
- package/dist/components/search/CriteriaChips.js +118 -10
- package/dist/components/search/JoinWord.js +8 -14
- package/dist/components/search/SearchBar.d.ts +10 -1
- package/dist/components/search/SearchBar.js +715 -176
- package/dist/components/search/WordChoice.d.ts +19 -0
- package/dist/components/search/WordChoice.js +8 -0
- package/dist/components/search/criteria.d.ts +27 -0
- package/dist/components/search/criteria.js +33 -0
- package/dist/components/search/index.d.ts +2 -2
- package/dist/components/search/index.js +2 -2
- package/dist/components/search/query.d.ts +24 -0
- package/dist/components/search/query.js +29 -0
- package/dist/components/shell/AppFrame.d.ts +4 -0
- package/dist/components/shell/AppFrame.js +4 -1
- package/dist/components/shell/Inbox.d.ts +53 -0
- package/dist/components/shell/Inbox.js +55 -0
- package/dist/components/shell/SearchEntry.js +2 -3
- package/dist/components/shell/TopBar.d.ts +4 -2
- package/dist/components/shell/TopBar.js +3 -3
- package/dist/components/shell/index.d.ts +1 -0
- package/dist/components/shell/index.js +3 -0
- package/dist/foundations/copy.es.js +60 -1
- package/dist/foundations/form.d.ts +7 -0
- package/dist/foundations/form.js +1 -0
- package/dist/foundations/uiCopy.d.ts +85 -2
- package/dist/foundations/uiCopy.js +60 -1
- package/dist/primitives/choice/RadioGroup.d.ts +1 -1
- package/dist/primitives/choice/RadioGroup.js +29 -0
- package/dist/primitives/choice/Rating.d.ts +32 -0
- package/dist/primitives/choice/Rating.js +75 -0
- package/dist/primitives/choice/Slider.d.ts +19 -0
- package/dist/primitives/choice/Slider.js +27 -2
- package/dist/primitives/choice/index.d.ts +2 -1
- package/dist/primitives/choice/index.js +4 -1
- package/dist/primitives/choice/options.d.ts +4 -0
- package/dist/primitives/field/Field.js +1 -0
- package/dist/primitives/hint/Kbd.d.ts +23 -0
- package/dist/primitives/hint/Kbd.js +23 -0
- package/dist/primitives/hint/index.d.ts +1 -0
- package/dist/primitives/hint/index.js +2 -0
- package/dist/primitives/menu/ContextMenu.d.ts +29 -0
- package/dist/primitives/menu/ContextMenu.js +74 -0
- package/dist/primitives/menu/Menu.d.ts +4 -1
- package/dist/primitives/menu/Menu.js +2 -2
- package/dist/primitives/menu/index.d.ts +1 -0
- package/dist/primitives/menu/index.js +2 -0
- package/dist/primitives/notice/Banner.d.ts +27 -0
- package/dist/primitives/notice/Banner.js +21 -0
- package/dist/primitives/notice/Callout.d.ts +4 -4
- package/dist/primitives/notice/Callout.js +8 -19
- package/dist/primitives/notice/Notice.d.ts +38 -10
- package/dist/primitives/notice/Notice.js +48 -9
- package/dist/primitives/notice/index.d.ts +3 -1
- package/dist/primitives/notice/index.js +3 -0
- package/dist/primitives/notice/tones.d.ts +8 -0
- package/dist/primitives/notice/tones.js +22 -0
- package/dist/primitives/value/Price.d.ts +31 -0
- package/dist/primitives/value/Price.js +32 -0
- package/dist/primitives/value/QrCode.d.ts +32 -0
- package/dist/primitives/value/QrCode.js +53 -0
- package/dist/primitives/value/index.d.ts +3 -0
- package/dist/primitives/value/index.js +6 -0
- package/dist/primitives/value/priceFormat.d.ts +12 -0
- package/dist/primitives/value/priceFormat.js +22 -0
- package/dist/tokens.css +39 -0
- package/dist/views/list/ListView.js +22 -3
- package/dist/views/list/types.d.ts +8 -0
- package/package.json +3 -2
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export interface WordOption<K extends string> {
|
|
2
|
+
id: K;
|
|
3
|
+
label: string;
|
|
4
|
+
/** What tells it apart when the word alone does not: «<=» beside «como mucho». */
|
|
5
|
+
note?: string;
|
|
6
|
+
}
|
|
7
|
+
export declare function WordChoice<K extends string>({ value, options, onChange, label, word, className, }: {
|
|
8
|
+
value: K;
|
|
9
|
+
options: readonly WordOption<K>[];
|
|
10
|
+
onChange: (next: K) => void;
|
|
11
|
+
/** What the word decides — the trigger's and the list's name. */
|
|
12
|
+
label: string;
|
|
13
|
+
/** The word as it reads in the bar —«como mucho», «todas»—. It STARTS the trigger's name
|
|
14
|
+
* («como mucho, comparar total de otra manera»): a name that does not hold what is seen
|
|
15
|
+
* fails whoever drives the screen by voice, saying the word they read. */
|
|
16
|
+
word: string;
|
|
17
|
+
/** How the word looks; the trigger is a button and takes the focus ring from here. */
|
|
18
|
+
className: string;
|
|
19
|
+
}): import("react").JSX.Element;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { Popover } from "../../primitives/overlay/Popover.js";
|
|
4
|
+
import { Check } from "lucide-react";
|
|
5
|
+
import { Button as AriaButton, Menu as AriaMenu, MenuItem, MenuTrigger, } from "react-aria-components";
|
|
6
|
+
export function WordChoice({ value, options, onChange, label, word, className, }) {
|
|
7
|
+
return (_jsxs(MenuTrigger, { children: [_jsx(AriaButton, { "aria-label": `${word}, ${label.toLocaleLowerCase()}`, className: className, children: word }), _jsx(Popover, { placement: "bottom start", className: "min-w-36 p-1", children: _jsx(AriaMenu, { "aria-label": label, selectionMode: "single", selectedKeys: [value], disallowEmptySelection: true, autoFocus: "first", onAction: (key) => onChange(String(key)), className: "flex max-h-72 flex-col gap-0.5 overflow-y-auto outline-0", children: options.map((one) => (_jsx(MenuItem, { id: one.id, textValue: one.label, className: "flex cursor-pointer items-center gap-2 rounded-ui-option px-2 py-1 text-meta text-ink outline-0 transition-colors duration-(--duration-instant) data-focused:bg-ui-option-active", children: ({ isSelected }) => (_jsxs(_Fragment, { children: [_jsx("span", { className: "flex size-(--size-icon-sm) shrink-0 items-center justify-center", children: isSelected ? (_jsx(Check, { className: "size-(--size-icon-sm) text-primary", strokeWidth: 2.5, "aria-hidden": true })) : null }), _jsx("span", { className: `min-w-0 flex-1 truncate ${isSelected ? "font-medium" : ""}`, children: one.label }), one.note === undefined ? null : (_jsx("span", { className: "shrink-0 font-mono text-micro text-muted", children: one.note }))] })) }, one.id))) }) })] }));
|
|
8
|
+
}
|
|
@@ -121,6 +121,14 @@ export type GroupCriteria = Extract<SearchCriteria, {
|
|
|
121
121
|
export declare function groupsOf(all: readonly SearchCriteria[]): GroupCriteria[];
|
|
122
122
|
/** The filter ones, which are the ones that nest. */
|
|
123
123
|
export declare function filtersOf(all: readonly SearchCriteria[]): SearchCriteria[];
|
|
124
|
+
/**
|
|
125
|
+
* The PIECES the bar draws, in its order, each with the top-level paths it covers: the
|
|
126
|
+
* grouping chain first —every level in ONE piece—, then each filter on top.
|
|
127
|
+
*
|
|
128
|
+
* It is what the keyboard walks: ← on the empty bar marks the last piece, and removing a
|
|
129
|
+
* piece removes everything it covers — the whole chain, or one filter with its nesting.
|
|
130
|
+
*/
|
|
131
|
+
export declare function facetPaths(all: readonly SearchCriteria[]): CriteriaPath[][];
|
|
124
132
|
/** The instance at that path, if there is one. */
|
|
125
133
|
export declare function at(all: readonly SearchCriteria[], path: CriteriaPath): SearchCriteria | undefined;
|
|
126
134
|
/** The same tree with one instance changed. Returning a new one and not touching the
|
|
@@ -133,6 +141,25 @@ export declare function replaceAt(all: readonly SearchCriteria[], path: Criteria
|
|
|
133
141
|
* parenthesis around nothing, and leaving it forces reading a group that does not group.
|
|
134
142
|
*/
|
|
135
143
|
export declare function removeAt(all: readonly SearchCriteria[], path: CriteriaPath): SearchCriteria[];
|
|
144
|
+
/** What was removed, and how to put it back: «Quitado: cliente contiene andina · Deshacer». */
|
|
145
|
+
export type Removal = {
|
|
146
|
+
label: string;
|
|
147
|
+
removed: readonly {
|
|
148
|
+
path: CriteriaPath;
|
|
149
|
+
node: SearchCriteria;
|
|
150
|
+
}[];
|
|
151
|
+
before: readonly SearchCriteria[];
|
|
152
|
+
after: readonly SearchCriteria[];
|
|
153
|
+
};
|
|
154
|
+
/**
|
|
155
|
+
* What was removed, back in the list as it is NOW.
|
|
156
|
+
*
|
|
157
|
+
* A removed piece on top goes back to its place even if something was set after it — undoing
|
|
158
|
+
* one chip must not take away the next one. A piece removed from inside a group can only go
|
|
159
|
+
* back while nothing changed since: its group may be gone (`removeAt` dismantles a group left
|
|
160
|
+
* with one), and guessing where it lands is worse than not offering it.
|
|
161
|
+
*/
|
|
162
|
+
export declare function restoreRemoval(current: readonly SearchCriteria[], removal: Removal): SearchCriteria[] | null;
|
|
136
163
|
/** How a node's instances are joined: `all` → `any` → `not` and round again. It is
|
|
137
164
|
* the same wheel the selector shows open, for whoever prefers the
|
|
138
165
|
* shortcut. */
|
|
@@ -7,6 +7,18 @@ export function groupsOf(all) {
|
|
|
7
7
|
export function filtersOf(all) {
|
|
8
8
|
return all.filter((one) => one.kind !== "group");
|
|
9
9
|
}
|
|
10
|
+
/**
|
|
11
|
+
* The PIECES the bar draws, in its order, each with the top-level paths it covers: the
|
|
12
|
+
* grouping chain first —every level in ONE piece—, then each filter on top.
|
|
13
|
+
*
|
|
14
|
+
* It is what the keyboard walks: ← on the empty bar marks the last piece, and removing a
|
|
15
|
+
* piece removes everything it covers — the whole chain, or one filter with its nesting.
|
|
16
|
+
*/
|
|
17
|
+
export function facetPaths(all) {
|
|
18
|
+
const groups = all.flatMap((one, index) => (one.kind === "group" ? [[index]] : []));
|
|
19
|
+
const filters = all.flatMap((one, index) => (one.kind === "group" ? [] : [[[index]]]));
|
|
20
|
+
return [...(groups.length === 0 ? [] : [groups]), ...filters];
|
|
21
|
+
}
|
|
10
22
|
/** The instance at that path, if there is one. */
|
|
11
23
|
export function at(all, path) {
|
|
12
24
|
const [head, ...rest] = path;
|
|
@@ -56,6 +68,27 @@ export function removeAt(all, path) {
|
|
|
56
68
|
return [{ ...one, of: inside }];
|
|
57
69
|
});
|
|
58
70
|
}
|
|
71
|
+
/**
|
|
72
|
+
* What was removed, back in the list as it is NOW.
|
|
73
|
+
*
|
|
74
|
+
* A removed piece on top goes back to its place even if something was set after it — undoing
|
|
75
|
+
* one chip must not take away the next one. A piece removed from inside a group can only go
|
|
76
|
+
* back while nothing changed since: its group may be gone (`removeAt` dismantles a group left
|
|
77
|
+
* with one), and guessing where it lands is worse than not offering it.
|
|
78
|
+
*/
|
|
79
|
+
export function restoreRemoval(current, removal) {
|
|
80
|
+
if (removal.removed.every((one) => one.path.length === 1)) {
|
|
81
|
+
const next = [...current];
|
|
82
|
+
const ordered = [...removal.removed].sort((a, b) => (a.path[0] ?? 0) - (b.path[0] ?? 0));
|
|
83
|
+
for (const one of ordered) {
|
|
84
|
+
if (next.some((each) => each.id === one.node.id))
|
|
85
|
+
continue;
|
|
86
|
+
next.splice(Math.min(one.path[0] ?? next.length, next.length), 0, one.node);
|
|
87
|
+
}
|
|
88
|
+
return next;
|
|
89
|
+
}
|
|
90
|
+
return current === removal.after ? [...removal.before] : null;
|
|
91
|
+
}
|
|
59
92
|
/** How a node's instances are joined: `all` → `any` → `not` and round again. It is
|
|
60
93
|
* the same wheel the selector shows open, for whoever prefers the
|
|
61
94
|
* shortcut. */
|
|
@@ -7,10 +7,10 @@ export { formatJson } from "./formatJson.js";
|
|
|
7
7
|
export { JsonEditor } from "./JsonEditor.js";
|
|
8
8
|
export { createModelCache, type FieldPathStep, type FieldPathValue, isRelation, isToMany, type LoadModel, type ModelCache, pathLabel, peekLabels, resolvePath, } from "./paths.js";
|
|
9
9
|
export { SearchBar, type SearchBarProps, type SearchFacet, } from "./SearchBar.js";
|
|
10
|
-
export { at, criteriaId, type CriteriaJoin, type CriteriaPath, filterCriteria, filtersOf, type GroupCriteria, groupCriteria, groupsOf, hasNamed, levelsOf, nextJoin, type RecordKey, type RecordOption, removeAt, replaceAt, type SearchCriteria, selectionOf, toggleNamed, withLevels, } from "./criteria.js";
|
|
10
|
+
export { at, criteriaId, type CriteriaJoin, type CriteriaPath, facetPaths, filterCriteria, filtersOf, type GroupCriteria, groupCriteria, groupsOf, hasNamed, levelsOf, nextJoin, type RecordKey, type RecordOption, type Removal, removeAt, replaceAt, restoreRemoval, type SearchCriteria, selectionOf, toggleNamed, withLevels, } from "./criteria.js";
|
|
11
11
|
export { CriteriaChips, type CriteriaChipsProps, } from "./CriteriaChips.js";
|
|
12
12
|
export { choiceLabel, type FieldDefinition, fieldLabel, filterableNames, isFilterable, isNumericType, type ModelDefinition, type ModelTranslations, } from "./model.js";
|
|
13
|
-
export { answers, choiceValues, conditionCriteria, defaultOp, describeCondition, fieldKey, globToLike, opLabel, type QueryDraft, type QueryField, queryField, queryFields, type QueryKind, type QuerySuggestion, readTyped, sayValues, suggest, type TypedValue, valueFor, valueLabel, valuesCriteria, type ValueShape, valuesSelection, withoutValue, withValue, } from "./query.js";
|
|
13
|
+
export { answers, type ChipParts, chipParts, choiceValues, conditionCriteria, defaultOp, describeCondition, fieldKey, globToLike, opLabel, type QueryDraft, type QueryField, queryField, queryFields, type QueryKind, type QuerySuggestion, readTyped, sayValues, suggest, type TypedValue, valueFor, valueLabel, valuesCriteria, type ValueShape, valuesSelection, withoutValue, withParts, withValue, } from "./query.js";
|
|
14
14
|
export { SearchProvider, type SearchSettings, useSearchSettings, type ValueEditor, type ValueEditorProps, } from "./context.js";
|
|
15
15
|
export { type BrowseRecords, type RecordBrowse, type RecordSearch, recordsFilter, recordsOf, type RecordTarget, recordTarget, sameKey, type SearchRecords, } from "./records.js";
|
|
16
16
|
export { RuleValue } from "./RuleValue.js";
|
|
@@ -15,7 +15,7 @@ export { SearchBar, } from "./SearchBar.js";
|
|
|
15
15
|
/* WHAT THE BAR HAS SET: instances. A single thing for both kinds
|
|
16
16
|
—group and filter—, with their UI metadata outside and the engine's object
|
|
17
17
|
inside, intact. */
|
|
18
|
-
export { at, criteriaId, filterCriteria, filtersOf, groupCriteria, groupsOf, hasNamed, levelsOf, nextJoin, removeAt, replaceAt, selectionOf, toggleNamed, withLevels, } from "./criteria.js";
|
|
18
|
+
export { at, criteriaId, facetPaths, filterCriteria, filtersOf, groupCriteria, groupsOf, hasNamed, levelsOf, nextJoin, removeAt, replaceAt, restoreRemoval, selectionOf, toggleNamed, withLevels, } from "./criteria.js";
|
|
19
19
|
export { CriteriaChips, } from "./CriteriaChips.js";
|
|
20
20
|
/* THE MODEL'S VOCABULARY — what the server publishes about its fields. The
|
|
21
21
|
filter builder, the criteria builder and the search bar speak it, so
|
|
@@ -23,7 +23,7 @@ export { CriteriaChips, } from "./CriteriaChips.js";
|
|
|
23
23
|
export { choiceLabel, fieldLabel, filterableNames, isFilterable, isNumericType, } from "./model.js";
|
|
24
24
|
/* THE BAR'S GRAMMAR: what can be asked about a model, and with what.
|
|
25
25
|
Three steps —field, operator, value— that can be written as one. */
|
|
26
|
-
export { answers, choiceValues, conditionCriteria, defaultOp, describeCondition, fieldKey, globToLike, opLabel, queryField, queryFields, readTyped, sayValues, suggest, valueFor, valueLabel, valuesCriteria, valuesSelection, withoutValue, withValue, } from "./query.js";
|
|
26
|
+
export { answers, chipParts, choiceValues, conditionCriteria, defaultOp, describeCondition, fieldKey, globToLike, opLabel, queryField, queryFields, readTyped, sayValues, suggest, valueFor, valueLabel, valuesCriteria, valuesSelection, withoutValue, withParts, withValue, } from "./query.js";
|
|
27
27
|
/* THE RECORDS OF A RELATION: chosen by name, sent by key. The application gives ONE search
|
|
28
28
|
(`searchRecords`) — by prop, or once for every bar and builder with `SearchProvider` — and
|
|
29
29
|
its own value controls (`valueEditor`) for the fields it draws its way. */
|
|
@@ -236,6 +236,30 @@ export declare function describeCondition(field: QueryField, op: string, value:
|
|
|
236
236
|
/** The question about one field as a chip — what the bar puts when a condition is chosen:
|
|
237
237
|
* «nombre contiene test». */
|
|
238
238
|
export declare function conditionCriteria(field: QueryField, op: string, value: string): SearchCriteria;
|
|
239
|
+
/**
|
|
240
|
+
* A chip's PARTS — the field, the comparison and the value —, when the chip is a question the
|
|
241
|
+
* bar itself writes.
|
|
242
|
+
*
|
|
243
|
+
* Context: «total como mucho 1000» read at one weight, and changing 1000 to 2000 meant opening
|
|
244
|
+
* the whole builder. Split, the chip reads the way the eye scans it —the field quiet, the
|
|
245
|
+
* comparison a small word, the value strong— and each part is touched on its own. Only a chip
|
|
246
|
+
* that DESCRIBES itself splits: a declared one keeps its name («sólo vencidas») and is one
|
|
247
|
+
* piece, since that name is somebody's decision and not the condition read aloud.
|
|
248
|
+
*/
|
|
249
|
+
export type ChipParts = {
|
|
250
|
+
kind: "condition";
|
|
251
|
+
field: QueryField;
|
|
252
|
+
op: string;
|
|
253
|
+
value: string;
|
|
254
|
+
} | {
|
|
255
|
+
kind: "values";
|
|
256
|
+
field: QueryField;
|
|
257
|
+
values: readonly RecordOption[];
|
|
258
|
+
};
|
|
259
|
+
export declare function chipParts(node: SearchCriteria, fields: readonly QueryField[]): ChipParts | undefined;
|
|
260
|
+
/** The same chip asking with another comparison or value — its identity (`id`) kept, so it
|
|
261
|
+
* stays where it was and nothing that points at it loses it. */
|
|
262
|
+
export declare function withParts(node: SearchCriteria, field: QueryField, op: string, value: string): SearchCriteria;
|
|
239
263
|
/** What asks for these values of a field: records of a relation by their key (see
|
|
240
264
|
* `recordsFilter`), values of an enum or of any column with `=` / `in`. */
|
|
241
265
|
export declare function valuesSelection(field: QueryField, values: readonly RecordOption[]): BuiltCondition | BuiltFilter;
|
|
@@ -617,6 +617,35 @@ export function conditionCriteria(field, op, value) {
|
|
|
617
617
|
«está vacío»: sending it the empty string would be asking for the field that is "". */
|
|
618
618
|
{ field: field.field, operator: op, value: withoutValue(op) ? true : value }, describeCondition(field, op, value));
|
|
619
619
|
}
|
|
620
|
+
export function chipParts(node, fields) {
|
|
621
|
+
if (node.kind !== "filter" || node.selection === undefined)
|
|
622
|
+
return undefined;
|
|
623
|
+
if (node.values !== undefined) {
|
|
624
|
+
const field = fields.find((one) => node.id === `v:${fieldKey(one)}`);
|
|
625
|
+
return field === undefined || node.values.length === 0
|
|
626
|
+
? undefined
|
|
627
|
+
: { kind: "values", field, values: node.values };
|
|
628
|
+
}
|
|
629
|
+
const selection = node.selection;
|
|
630
|
+
if (!("operator" in selection))
|
|
631
|
+
return undefined;
|
|
632
|
+
const op = selection.operator;
|
|
633
|
+
const raw = selection.value;
|
|
634
|
+
const value = withoutValue(op)
|
|
635
|
+
? ""
|
|
636
|
+
: typeof raw === "string" || typeof raw === "number"
|
|
637
|
+
? String(raw)
|
|
638
|
+
: undefined;
|
|
639
|
+
if (value === undefined)
|
|
640
|
+
return undefined;
|
|
641
|
+
const field = fields.find((one) => one.field === selection.field && node.label === describeCondition(one, op, value));
|
|
642
|
+
return field === undefined ? undefined : { kind: "condition", field, op, value };
|
|
643
|
+
}
|
|
644
|
+
/** The same chip asking with another comparison or value — its identity (`id`) kept, so it
|
|
645
|
+
* stays where it was and nothing that points at it loses it. */
|
|
646
|
+
export function withParts(node, field, op, value) {
|
|
647
|
+
return { ...conditionCriteria(field, op, value), id: node.id };
|
|
648
|
+
}
|
|
620
649
|
/** What asks for these values of a field: records of a relation by their key (see
|
|
621
650
|
* `recordsFilter`), values of an enum or of any column with `=` / `in`. */
|
|
622
651
|
export function valuesSelection(field, values) {
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import type { Surface } from "../../foundations/types.js";
|
|
2
2
|
import { type ReactNode } from "react";
|
|
3
3
|
export declare function AppFrame({
|
|
4
|
+
/** A notice about the whole application — a `Banner` — above the bar, edge to edge. It
|
|
5
|
+
* scrolls away with the page: stuck on top it would take a line from every screen. */
|
|
6
|
+
banner,
|
|
4
7
|
/** The bar at the top. It stays in view while scrolling. */
|
|
5
8
|
menu,
|
|
6
9
|
/** The band at the bottom. It goes AFTER the content, not pinned to the
|
|
@@ -20,6 +23,7 @@ sidebarSurface,
|
|
|
20
23
|
/** Who scrolls. `page` (the default): the whole page, with the bars stuck on top. `view`:
|
|
21
24
|
* the frame is the window's height and the view scrolls inside itself — a workspace. */
|
|
22
25
|
scroll, children, }: {
|
|
26
|
+
banner?: ReactNode;
|
|
23
27
|
menu?: ReactNode;
|
|
24
28
|
status?: ReactNode;
|
|
25
29
|
sidebar?: ReactNode;
|
|
@@ -134,6 +134,9 @@ function SidebarDrawerPanel({ id, open, onClose, surface, children, }) {
|
|
|
134
134
|
}, isDismissable: true, className: ({ isEntering, isExiting }) => `fixed inset-0 z-50 bg-scrim/40 transition-opacity duration-(--duration-quick) ease-(--ease-out) sm:hidden print:hidden ${isEntering || isExiting ? "opacity-0" : ""}`, children: _jsx(Modal, { className: ({ isEntering, isExiting }) => `fixed inset-y-0 start-0 flex w-(--container-drawer) flex-col border-e shadow-window outline-0 transition-[translate] duration-(--duration-panel) ease-(--ease-out) ${bySurface(surface, "border-line-strong bg-ground", "border-chrome-edge bg-chrome")} ${isEntering || isExiting ? "-translate-x-full rtl:translate-x-full" : ""}`, children: _jsx(AriaDialog, { id: id, "aria-label": copy.shell.navigation, className: "flex min-h-0 flex-1 flex-col outline-0", children: _jsxs(SurfaceProvider, { value: surface, children: [_jsx("div", { className: "flex shrink-0 justify-end px-2 pt-2", children: _jsx(IconButton, { icon: X, label: copy.shell.close, onClick: onClose }) }), _jsx("div", { className: "flex min-h-0 flex-1 flex-col overflow-y-auto", onClickCapture: closeOnLink(onClose), children: children })] }) }) }) }));
|
|
135
135
|
}
|
|
136
136
|
export function AppFrame({
|
|
137
|
+
/** A notice about the whole application — a `Banner` — above the bar, edge to edge. It
|
|
138
|
+
* scrolls away with the page: stuck on top it would take a line from every screen. */
|
|
139
|
+
banner,
|
|
137
140
|
/** The bar at the top. It stays in view while scrolling. */
|
|
138
141
|
menu,
|
|
139
142
|
/** The band at the bottom. It goes AFTER the content, not pinned to the
|
|
@@ -201,7 +204,7 @@ scroll = "page", children, }) {
|
|
|
201
204
|
for both made the navigation read as part of the list bar. On the chrome it wears the
|
|
202
205
|
brand's colour. On a phone it is hidden: the drawer shows it. */
|
|
203
206
|
const aside = sidebar === undefined ? null : (_jsx("aside", { className: `sticky w-(--container-sidebar) shrink-0 self-start overflow-y-auto overscroll-contain border-r max-sm:hidden print:hidden ${bySurface(sidebarSurface, "border-ui-sidebar-border bg-ui-sidebar", "border-chrome-edge bg-chrome")}`, style: { ...stickyTop, height: "calc(100dvh - var(--sticky-top, 0px))" }, "data-ui": "frame.sidebar", children: _jsx(SurfaceProvider, { value: sidebarSurface, children: sidebar }) }));
|
|
204
|
-
return (_jsx(SidebarDrawerContext, { value: drawer, children: _jsxs("div", { className: `relative flex min-w-0 flex-col bg-ground ${fills ? "h-dvh overflow-hidden print:h-auto print:overflow-visible" : "min-h-dvh"}`, "data-ui": "frame", "data-scroll": scroll, children: [top === undefined ? null : (
|
|
207
|
+
return (_jsx(SidebarDrawerContext, { value: drawer, children: _jsxs("div", { className: `relative flex min-w-0 flex-col bg-ground ${fills ? "h-dvh overflow-hidden print:h-auto print:overflow-visible" : "min-h-dvh"}`, "data-ui": "frame", "data-scroll": scroll, children: [banner === undefined ? null : (_jsx("div", { className: "shrink-0", "data-ui": "frame.banner", children: banner })), top === undefined ? null : (
|
|
205
208
|
/* Hidden on a wide screen when it is only the phone's bar: it measures 0 there, so
|
|
206
209
|
nothing below is pushed down by it. */
|
|
207
210
|
_jsx("div", { ref: bar.ref, className: `sticky top-0 z-40 print:hidden ${sidebarIsChrome ? "sm:hidden" : ""}`, "data-ui": "frame.bar", children: top })), sidebar === undefined ? (_jsx("main", { className: `flex min-w-0 flex-1 flex-col ${mainScroll}`, style: fills ? stickyReset() : bar.below, "data-ui": "frame.main", children: children })) : sidebarIsChrome ? (_jsxs("div", { className: `flex min-w-0 flex-1 items-start ${region}`, style: bar.below, children: [aside, _jsx("main", { className: `flex min-w-0 flex-1 flex-col self-stretch ${mainScroll}`, ...(fills ? { style: stickyReset() } : {}), "data-ui": "frame.main", children: children })] })) : (_jsx(HeaderSlotContext, { value: slot, children: _jsxs("div", { className: `flex min-w-0 flex-1 flex-col ${region}`, style: bar.below, children: [_jsx("div", { ref: (node) => {
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import type { Tone } from "../../foundations/types.js";
|
|
2
|
+
import { type LucideIcon } from "lucide-react";
|
|
3
|
+
export type InboxItem = {
|
|
4
|
+
id: string;
|
|
5
|
+
/** What happened, in a line: «Tu pedido 0047 salió a reparto». */
|
|
6
|
+
title: string;
|
|
7
|
+
/** The rest, two lines at most. */
|
|
8
|
+
detail?: string;
|
|
9
|
+
when: Date | string;
|
|
10
|
+
/** Not seen yet: a dot, the title in bold, and said. */
|
|
11
|
+
unread?: boolean;
|
|
12
|
+
/** When it is a notice of a degree — a payment rejected (`bad`), a stock low (`warn`). Its
|
|
13
|
+
* icon comes with it, as in a `Callout`. */
|
|
14
|
+
tone?: Extract<Tone, "info" | "warn" | "bad" | "good">;
|
|
15
|
+
/** An icon of its own (a truck, a message) when it is not a notice of a degree. */
|
|
16
|
+
icon?: LucideIcon;
|
|
17
|
+
};
|
|
18
|
+
export type InboxListProps = {
|
|
19
|
+
items: readonly InboxItem[];
|
|
20
|
+
/** Pressing one: the application opens what it is about (and marks it read). */
|
|
21
|
+
onOpen?: (id: string) => void;
|
|
22
|
+
/** «Marcar todo como leído» — drawn while something is unread. */
|
|
23
|
+
onMarkAllRead?: () => void;
|
|
24
|
+
/** «Ver todas» — the page with the whole history, when the application has one. */
|
|
25
|
+
onSeeAll?: () => void;
|
|
26
|
+
/** «Notificaciones» by default. */
|
|
27
|
+
title?: string;
|
|
28
|
+
/** The clock the times are read against; now by default (a test passes a fixed one). */
|
|
29
|
+
now?: Date;
|
|
30
|
+
};
|
|
31
|
+
/**
|
|
32
|
+
* The notifications themselves, as a list: in the bar's popover (`Inbox`), or as the whole
|
|
33
|
+
* page of a portal's «Notificaciones».
|
|
34
|
+
*
|
|
35
|
+
* Context: unread is not only a colour — the dot goes with the title in bold and with the word
|
|
36
|
+
* said to a screen reader. The time is relative while it is recent («hace 5 minutos») and a
|
|
37
|
+
* date after a week, the way the activity writes it. The newest first is the application's
|
|
38
|
+
* order: it is passed already sorted, as a list is.
|
|
39
|
+
*/
|
|
40
|
+
export declare function InboxList({ items, onOpen, onMarkAllRead, onSeeAll, title, now, }: InboxListProps): import("react").JSX.Element;
|
|
41
|
+
export type InboxProps = InboxListProps & {
|
|
42
|
+
/** The bell by default. */
|
|
43
|
+
icon?: LucideIcon;
|
|
44
|
+
};
|
|
45
|
+
/**
|
|
46
|
+
* The notifications, from the bar: a bell with how many are unread, and the list in a
|
|
47
|
+
* popover — the portal's «tu pedido salió», the ERP's «te asignaron una tarea».
|
|
48
|
+
*
|
|
49
|
+
* Context: the bell is a `SystrayButton` — zero is not drawn, past 99 it says «99+», and the
|
|
50
|
+
* number is in its name — and the list is `InboxList` on the paper even under the navy bar.
|
|
51
|
+
* Opening one closes the popover: what it is about takes the screen.
|
|
52
|
+
*/
|
|
53
|
+
export declare function Inbox({ icon, onOpen, ...list }: InboxProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { SystrayButton } from "./TopBar.js";
|
|
4
|
+
import { fillCopy, useUiCopy } from "../../foundations/copy.js";
|
|
5
|
+
import { SurfaceProvider } from "../../foundations/surface.js";
|
|
6
|
+
import { Button } from "../../primitives/button/Button.js";
|
|
7
|
+
import { Empty } from "../../primitives/notice/Notice.js";
|
|
8
|
+
import { NOTICE_ICON } from "../../primitives/notice/tones.js";
|
|
9
|
+
import { Popover } from "../../primitives/overlay/Popover.js";
|
|
10
|
+
import { formatRelative } from "../../primitives/value/format.js";
|
|
11
|
+
import { Bell } from "lucide-react";
|
|
12
|
+
import { useState } from "react";
|
|
13
|
+
import { Dialog, DialogTrigger, Heading, Pressable } from "react-aria-components";
|
|
14
|
+
const ICON_TONE = {
|
|
15
|
+
info: "text-info",
|
|
16
|
+
good: "text-good",
|
|
17
|
+
warn: "text-warn",
|
|
18
|
+
bad: "text-bad",
|
|
19
|
+
};
|
|
20
|
+
/**
|
|
21
|
+
* The notifications themselves, as a list: in the bar's popover (`Inbox`), or as the whole
|
|
22
|
+
* page of a portal's «Notificaciones».
|
|
23
|
+
*
|
|
24
|
+
* Context: unread is not only a colour — the dot goes with the title in bold and with the word
|
|
25
|
+
* said to a screen reader. The time is relative while it is recent («hace 5 minutos») and a
|
|
26
|
+
* date after a week, the way the activity writes it. The newest first is the application's
|
|
27
|
+
* order: it is passed already sorted, as a list is.
|
|
28
|
+
*/
|
|
29
|
+
export function InboxList({ items, onOpen, onMarkAllRead, onSeeAll, title, now, }) {
|
|
30
|
+
const copy = useUiCopy();
|
|
31
|
+
const unread = items.filter((item) => item.unread === true).length;
|
|
32
|
+
return (_jsxs("div", { "data-ui": "inbox", className: "flex min-w-0 flex-col", children: [_jsxs("div", { className: "flex items-center justify-between gap-3 border-b border-line px-3 py-2", children: [_jsxs(Heading, { slot: "title", level: 2, className: "text-meta font-semibold text-ink", children: [title ?? copy.inbox.label, unread === 0 ? null : (_jsx("span", { className: "ml-1.5 font-normal text-muted tabular-nums", children: fillCopy(copy.inbox.unreadCount, { count: unread }) }))] }), onMarkAllRead === undefined || unread === 0 ? null : (_jsx(Button, { role: "ghost", size: "sm", onClick: onMarkAllRead, children: copy.inbox.markAllRead }))] }), items.length === 0 ? (_jsx(Empty, { sentence: copy.inbox.empty })) : (_jsx("ul", { className: "flex flex-col divide-y divide-line", children: items.map((item) => {
|
|
33
|
+
const Icon = item.icon ?? (item.tone === undefined ? undefined : NOTICE_ICON[item.tone]);
|
|
34
|
+
const fresh = item.unread === true;
|
|
35
|
+
return (_jsx("li", { children: _jsxs("button", { type: "button", "data-ui": "inbox.item", "data-unread": fresh ? "" : undefined, onClick: () => onOpen?.(item.id), className: `flex w-full items-start gap-3 px-3 py-2.5 text-left transition-colors duration-(--duration-instant) hover:bg-ink/4 focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-primary ${fresh ? "bg-primary/4" : ""}`, children: [Icon === undefined ? null : (_jsx(Icon, { "aria-hidden": true, strokeWidth: 2, className: `mt-0.5 size-(--size-icon-md) shrink-0 ${item.tone === undefined ? "text-muted" : ICON_TONE[item.tone]}` })), _jsxs("span", { className: "flex min-w-0 flex-1 flex-col gap-0.5", children: [_jsxs("span", { className: `text-meta text-ink ${fresh ? "font-semibold" : "font-normal"}`, children: [fresh ? _jsxs("span", { className: "sr-only", children: [copy.inbox.unread, ": "] }) : null, item.title] }), item.detail === undefined ? null : (_jsx("span", { className: "line-clamp-2 text-meta text-muted", children: item.detail })), _jsx("span", { className: "text-micro text-muted tabular-nums", children: formatRelative(new Date(item.when), now, copy) })] }), fresh ? (_jsx("span", { "aria-hidden": true, className: "mt-1.5 size-2 shrink-0 rounded-pill bg-primary" })) : null] }) }, item.id));
|
|
36
|
+
}) })), onSeeAll === undefined ? null : (_jsx("div", { className: "border-t border-line px-1 py-1", children: _jsx(Button, { role: "ghost", size: "sm", onClick: onSeeAll, children: copy.inbox.seeAll }) }))] }));
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* The notifications, from the bar: a bell with how many are unread, and the list in a
|
|
40
|
+
* popover — the portal's «tu pedido salió», the ERP's «te asignaron una tarea».
|
|
41
|
+
*
|
|
42
|
+
* Context: the bell is a `SystrayButton` — zero is not drawn, past 99 it says «99+», and the
|
|
43
|
+
* number is in its name — and the list is `InboxList` on the paper even under the navy bar.
|
|
44
|
+
* Opening one closes the popover: what it is about takes the screen.
|
|
45
|
+
*/
|
|
46
|
+
export function Inbox({ icon = Bell, onOpen, ...list }) {
|
|
47
|
+
const copy = useUiCopy();
|
|
48
|
+
const [open, setOpen] = useState(false);
|
|
49
|
+
const unread = list.items.filter((item) => item.unread === true).length;
|
|
50
|
+
const label = list.title ?? copy.inbox.label;
|
|
51
|
+
return (_jsxs(DialogTrigger, { isOpen: open, onOpenChange: setOpen, children: [_jsx(Pressable, { children: _jsx(SystrayButton, { icon: icon, label: label, count: unread, active: open, "aria-haspopup": "dialog", "aria-expanded": open }) }), _jsx(Popover, { placement: "bottom end", children: _jsx(Dialog, { "aria-label": label, className: "max-h-[inherit] w-(--container-inbox) overflow-auto outline-0", children: _jsx(SurfaceProvider, { value: "canvas", children: _jsx(InboxList, { ...list, onOpen: (id) => {
|
|
52
|
+
setOpen(false);
|
|
53
|
+
onOpen?.(id);
|
|
54
|
+
} }) }) }) })] }));
|
|
55
|
+
}
|
|
@@ -4,15 +4,14 @@ import { useSidebarDrawer } from "./sidebarDrawer.js";
|
|
|
4
4
|
import { useUiCopy } from "../../foundations/copy.js";
|
|
5
5
|
import { modShortcut, useKeyboardPlatform } from "../../foundations/shortcut.js";
|
|
6
6
|
import { useSurface } from "../../foundations/surface.js";
|
|
7
|
+
import { Kbd } from "../../primitives/hint/Kbd.js";
|
|
7
8
|
import { Search } from "lucide-react";
|
|
8
9
|
const SKIN = {
|
|
9
10
|
canvas: {
|
|
10
11
|
box: "border-ui-control-border bg-ui-control text-muted hover:border-line-strong hover:text-ink focus-visible:outline-primary",
|
|
11
|
-
keys: "border-line text-muted",
|
|
12
12
|
},
|
|
13
13
|
chrome: {
|
|
14
14
|
box: "border-chrome-ink/15 bg-chrome-ink/6 text-chrome-muted hover:bg-chrome-ink/10 hover:text-chrome-ink focus-visible:outline-chrome-link",
|
|
15
|
-
keys: "border-chrome-ink/20 text-chrome-muted",
|
|
16
15
|
},
|
|
17
16
|
};
|
|
18
17
|
export function SearchEntry({ onSearch, label, shortcut = "K", layout = "row", surface, }) {
|
|
@@ -30,5 +29,5 @@ export function SearchEntry({ onSearch, label, shortcut = "K", layout = "row", s
|
|
|
30
29
|
}, ...(keys === null ? {} : { "aria-keyshortcuts": keys.aria }), className: `flex h-(--size-control-sm) min-w-0 cursor-pointer items-center gap-2 rounded-ui-control border px-2 text-meta transition-colors duration-(--duration-instant) focus-visible:outline-2 focus-visible:outline-offset-2 ${bar ? "shrink-0 max-sm:w-(--size-control-sm) max-sm:justify-center" : "w-full"} ${skin.box}`, "data-ui": "search-entry", "data-surface": sup, children: [_jsx(Search, { className: "size-(--size-icon-md) shrink-0", strokeWidth: 2, "aria-hidden": true }), _jsx("span", { className: `min-w-0 flex-1 truncate text-left ${bar ? "max-sm:sr-only" : ""}`, children: label ?? copy.shell.search }), keys === null ? null : (
|
|
31
30
|
/* Seen, not heard: `aria-keyshortcuts` already tells a screen reader, and «⌘K» read
|
|
32
31
|
aloud is noise after the name. Not drawn for a finger: a phone has no ⌘. */
|
|
33
|
-
_jsx("
|
|
32
|
+
_jsx("span", { className: `inline-flex shrink-0 ${bar ? "max-sm:hidden" : ""}`, "data-ui": "search-entry.keys", children: _jsx(Kbd, { surface: sup, children: keys.label }) }))] }));
|
|
34
33
|
}
|
|
@@ -2,7 +2,7 @@ import { type BrandLogo } from "./brandMark.js";
|
|
|
2
2
|
import { type SearchEntryProps } from "./SearchEntry.js";
|
|
3
3
|
import { type MenuGroup } from "../../primitives/menu/Menu.js";
|
|
4
4
|
import { type LucideIcon } from "lucide-react";
|
|
5
|
-
import { type ReactNode } from "react";
|
|
5
|
+
import { type ButtonHTMLAttributes, type ReactNode, type Ref } from "react";
|
|
6
6
|
export interface AppEntry {
|
|
7
7
|
id: string;
|
|
8
8
|
label: string;
|
|
@@ -68,13 +68,15 @@ export declare function AppSwitcher({ apps, current, onSelect, }: {
|
|
|
68
68
|
* Zero is NOT drawn: a bell with a «0» next to it forces you to read a number
|
|
69
69
|
* to discover there is nothing. With no count you can already see there is
|
|
70
70
|
* nothing. */
|
|
71
|
-
export declare function SystrayButton({ icon: Icon, label, count, tone, onClick, active, }: {
|
|
71
|
+
export declare function SystrayButton({ icon: Icon, label, count, tone, onClick, active, ref, ...native }: Omit<ButtonHTMLAttributes<HTMLButtonElement>, "children" | "type" | "onClick"> & {
|
|
72
72
|
icon: LucideIcon;
|
|
73
73
|
label: string;
|
|
74
74
|
count?: number;
|
|
75
75
|
tone?: "info" | "warn" | "bad";
|
|
76
76
|
onClick?: () => void;
|
|
77
77
|
active?: boolean;
|
|
78
|
+
/** Forwarded, with the native props, so a popover or a menu can open from it — `Inbox`. */
|
|
79
|
+
ref?: Ref<HTMLButtonElement>;
|
|
78
80
|
}): import("react").JSX.Element;
|
|
79
81
|
/** Who I am and how I leave. The name is drawn when there is width; when narrow
|
|
80
82
|
* only the avatar stays, which is what gets recognised without reading. */
|
|
@@ -9,7 +9,7 @@ import { Menu } from "../../primitives/menu/Menu.js";
|
|
|
9
9
|
import { Count, countText } from "../../primitives/tag/Count.js";
|
|
10
10
|
import { Avatar } from "../../primitives/value/Person.js";
|
|
11
11
|
import { Grid3x3 } from "lucide-react";
|
|
12
|
-
import { useMemo, useState } from "react";
|
|
12
|
+
import { useMemo, useState, } from "react";
|
|
13
13
|
export function TopBar({ app, apps, currentApp, onAppSelect, menus, currentMenu, onMenuSelect, search, systray, user, onUserSelect, userGroups, }) {
|
|
14
14
|
const copy = useUiCopy();
|
|
15
15
|
const actual = apps?.find((a) => a.id === currentApp);
|
|
@@ -42,13 +42,13 @@ const SYSTRAY_MAX = 99;
|
|
|
42
42
|
* Zero is NOT drawn: a bell with a «0» next to it forces you to read a number
|
|
43
43
|
* to discover there is nothing. With no count you can already see there is
|
|
44
44
|
* nothing. */
|
|
45
|
-
export function SystrayButton({ icon: Icon, label, count = 0, tone = "info", onClick, active = false, }) {
|
|
45
|
+
export function SystrayButton({ icon: Icon, label, count = 0, tone = "info", onClick, active = false, ref, ...native }) {
|
|
46
46
|
const copy = useUiCopy();
|
|
47
47
|
const number = useMemo(() => new Intl.NumberFormat(copy.locale), [copy.locale]);
|
|
48
48
|
/* The button says the number in its name, so the badge is only seen — and both say the
|
|
49
49
|
same «99+», not a badge that is cut and a name that is not. */
|
|
50
50
|
const said = countText(count, number.format, SYSTRAY_MAX);
|
|
51
|
-
return (_jsxs("button", { type: "button", onClick: onClick, title: count > 0 ? `${label} (${said})` : label, "aria-label": count > 0 ? `${label}: ${said}` : label, className: `relative inline-flex size-(--size-control-md) items-center justify-center rounded-pill transition-colors duration-(--duration-instant) focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-chrome-link ${active
|
|
51
|
+
return (_jsxs("button", { ...native, ref: ref, type: "button", onClick: onClick, title: count > 0 ? `${label} (${said})` : label, "aria-label": count > 0 ? `${label}: ${said}` : label, className: `relative inline-flex size-(--size-control-md) items-center justify-center rounded-pill transition-colors duration-(--duration-instant) focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-chrome-link ${active
|
|
52
52
|
? "bg-chrome-ink/12 text-chrome-ink"
|
|
53
53
|
: "text-chrome-muted hover:bg-chrome-ink/10 hover:text-chrome-ink"}`, children: [_jsx(Icon, { className: "size-(--size-icon-md)", strokeWidth: 2, "aria-hidden": true }), count <= 0 ? null : (_jsx("span", { className: "absolute -top-0.5 -right-0.5 flex", children: _jsx(Count, { value: count, tone: tone, solid: true, max: SYSTRAY_MAX, surface: "chrome", "aria-hidden": true }) }))] }));
|
|
54
54
|
}
|
|
@@ -4,5 +4,6 @@ export { Sidebar, type SidebarAction, type SidebarProps, } from "./Sidebar.js";
|
|
|
4
4
|
export { SearchEntry, type SearchEntryProps, } from "./SearchEntry.js";
|
|
5
5
|
export { type SidebarDrawer, SidebarToggle, useSidebarDrawer, } from "./sidebarDrawer.js";
|
|
6
6
|
export { type AppEntry, SystrayButton, TopBar, type TopMenu, } from "./TopBar.js";
|
|
7
|
+
export { Inbox, type InboxItem, InboxList, type InboxListProps, type InboxProps, } from "./Inbox.js";
|
|
7
8
|
export { KioskFrame, type KioskFrameProps, } from "./KioskFrame.js";
|
|
8
9
|
export { Pane, Panes } from "./Panes.js";
|
|
@@ -10,6 +10,9 @@ export { SearchEntry, } from "./SearchEntry.js";
|
|
|
10
10
|
/* The sidebar's phone drawer, for a bar an application writes itself. */
|
|
11
11
|
export { SidebarToggle, useSidebarDrawer, } from "./sidebarDrawer.js";
|
|
12
12
|
export { SystrayButton, TopBar, } from "./TopBar.js";
|
|
13
|
+
/* The notifications: a bell with how many are unread and the list in a popover — or the list
|
|
14
|
+
alone, as a portal's page. */
|
|
15
|
+
export { Inbox, InboxList, } from "./Inbox.js";
|
|
13
16
|
/* A screen of N sets side by side — the reconciliation: each pane scrolls on its own. */
|
|
14
17
|
export { KioskFrame, } from "./KioskFrame.js";
|
|
15
18
|
export { Pane, Panes } from "./Panes.js";
|
|
@@ -191,7 +191,23 @@ export const SPANISH_COPY = {
|
|
|
191
191
|
recordsFailed: "No se pudo buscar",
|
|
192
192
|
moreRecords: "Buscar más…",
|
|
193
193
|
advanced: "Búsqueda avanzada…",
|
|
194
|
-
|
|
194
|
+
keys: {
|
|
195
|
+
move: "moverse",
|
|
196
|
+
put: "poner",
|
|
197
|
+
open: "abrir",
|
|
198
|
+
complete: "completar",
|
|
199
|
+
undo: "deshacer",
|
|
200
|
+
panel: "filtros",
|
|
201
|
+
advanced: "avanzada",
|
|
202
|
+
},
|
|
203
|
+
recent: "Recientes",
|
|
204
|
+
searchBy: "Buscar por",
|
|
205
|
+
removed: "Quitado: {label}",
|
|
206
|
+
undo: "Deshacer",
|
|
207
|
+
chipMarked: "{label} marcado. Supr lo quita, Enter lo edita, las flechas se mueven.",
|
|
208
|
+
editValue: "Cambiar el valor de {label}",
|
|
209
|
+
changeOp: "Comparar {field} de otra manera",
|
|
210
|
+
findIn: "Buscar en {column}",
|
|
195
211
|
landsHere: "acá cae lo próximo",
|
|
196
212
|
closeGroup: "Cerrar este grupo",
|
|
197
213
|
condition: "{field} {op} {value}",
|
|
@@ -577,6 +593,49 @@ export const SPANISH_COPY = {
|
|
|
577
593
|
increase: "Uno más",
|
|
578
594
|
remove: "Quitar",
|
|
579
595
|
},
|
|
596
|
+
plans: {
|
|
597
|
+
current: "Tu plan",
|
|
598
|
+
included: "Incluye",
|
|
599
|
+
excluded: "No incluye",
|
|
600
|
+
onRequest: "A convenir",
|
|
601
|
+
},
|
|
602
|
+
range: {
|
|
603
|
+
min: "Mínimo",
|
|
604
|
+
max: "Máximo",
|
|
605
|
+
},
|
|
606
|
+
price: {
|
|
607
|
+
now: "Ahora",
|
|
608
|
+
before: "Antes",
|
|
609
|
+
free: "Gratis",
|
|
610
|
+
per: "por",
|
|
611
|
+
off: "{percent} % menos",
|
|
612
|
+
},
|
|
613
|
+
rating: {
|
|
614
|
+
label: "Calificación",
|
|
615
|
+
average: "{value} de {max}",
|
|
616
|
+
count: "{count} opiniones",
|
|
617
|
+
countOne: "{count} opinión",
|
|
618
|
+
none: "todavía sin calificar",
|
|
619
|
+
stars: "{value} de {max} estrellas",
|
|
620
|
+
},
|
|
621
|
+
gallery: {
|
|
622
|
+
label: "Imágenes",
|
|
623
|
+
roledescription: "galería",
|
|
624
|
+
previous: "Imagen anterior",
|
|
625
|
+
next: "Imagen siguiente",
|
|
626
|
+
position: "Imagen {index} de {total}",
|
|
627
|
+
open: "Ver en tamaño completo",
|
|
628
|
+
close: "Cerrar",
|
|
629
|
+
empty: "Todavía no hay imágenes",
|
|
630
|
+
},
|
|
631
|
+
inbox: {
|
|
632
|
+
label: "Notificaciones",
|
|
633
|
+
unread: "Sin leer",
|
|
634
|
+
unreadCount: "{count} sin leer",
|
|
635
|
+
markAllRead: "Marcar todo como leído",
|
|
636
|
+
seeAll: "Ver todas",
|
|
637
|
+
empty: "Nada nuevo por acá",
|
|
638
|
+
},
|
|
580
639
|
outcome: {
|
|
581
640
|
figure: "Número",
|
|
582
641
|
},
|
|
@@ -15,6 +15,12 @@ export type FieldIds = {
|
|
|
15
15
|
/** The id of the field's label. A native input is named by `<label for>`; a React Aria
|
|
16
16
|
* control — a date picker, a combobox — is a group of elements, and is named by this. */
|
|
17
17
|
labelId: string;
|
|
18
|
+
/** The label's words. A control that is a group of inputs needs them as a NAME and not as
|
|
19
|
+
* a reference: React Aria names each slider thumb by pointing at the group, and a group
|
|
20
|
+
* named only through `aria-labelledby` is read by its whole text when pointed at (the
|
|
21
|
+
* accessible-name rules do not follow a reference twice) — the thumb said «Bs 50 – Bs 300
|
|
22
|
+
* Precio». With the words, the group carries them as `aria-label` too. */
|
|
23
|
+
label?: string;
|
|
18
24
|
describedBy: string | undefined;
|
|
19
25
|
invalid: boolean;
|
|
20
26
|
};
|
|
@@ -57,6 +63,7 @@ export declare function useFieldIds(own: {
|
|
|
57
63
|
}): {
|
|
58
64
|
id: string | undefined;
|
|
59
65
|
labelledBy: string | undefined;
|
|
66
|
+
label: string | undefined;
|
|
60
67
|
describedBy: string | undefined;
|
|
61
68
|
invalid: boolean;
|
|
62
69
|
};
|
package/dist/foundations/form.js
CHANGED
|
@@ -25,6 +25,7 @@ export function useFieldIds(own) {
|
|
|
25
25
|
return {
|
|
26
26
|
id: own.id ?? field?.id,
|
|
27
27
|
labelledBy: field?.labelId,
|
|
28
|
+
label: field?.label,
|
|
28
29
|
describedBy: own.describedBy ?? field?.describedBy ?? place?.describedBy,
|
|
29
30
|
invalid: own.invalid ?? field?.invalid ?? place?.invalid ?? false,
|
|
30
31
|
};
|