@sincpro/web-ui 2.12.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 +56 -21
- 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 +3 -0
- package/dist/components/index.js +3 -0
- package/dist/components/listing/BoardColumns.js +10 -6
- package/dist/components/listing/ColumnsMenu.js +4 -2
- package/dist/components/listing/Listing.js +3 -1
- package/dist/components/listing/ListingBar.d.ts +16 -94
- package/dist/components/listing/ListingBar.js +24 -2
- package/dist/components/listing/RecordCard.d.ts +41 -3
- package/dist/components/listing/RecordCard.js +63 -22
- package/dist/components/listing/Row.js +5 -2
- package/dist/components/listing/columns.d.ts +3 -0
- package/dist/components/listing/columns.js +4 -0
- package/dist/components/listing/index.d.ts +2 -2
- package/dist/components/listing/index.js +2 -2
- package/dist/components/listing/set.d.ts +1 -1
- 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/receipt/Receipt.d.ts +51 -0
- package/dist/components/receipt/Receipt.js +23 -0
- package/dist/components/receipt/index.d.ts +1 -0
- package/dist/components/receipt/index.js +3 -0
- package/dist/components/search/CriteriaChips.d.ts +14 -1
- package/dist/components/search/CriteriaChips.js +123 -13
- 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/KioskFrame.d.ts +35 -0
- package/dist/components/shell/KioskFrame.js +39 -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 +2 -0
- package/dist/components/shell/index.js +4 -0
- package/dist/foundations/clock.d.ts +3 -0
- package/dist/foundations/clock.js +41 -0
- package/dist/foundations/copy.es.js +86 -1
- package/dist/foundations/form.d.ts +7 -0
- package/dist/foundations/form.js +1 -0
- package/dist/foundations/idle.d.ts +1 -0
- package/dist/foundations/idle.js +34 -0
- package/dist/foundations/index.d.ts +3 -0
- package/dist/foundations/index.js +7 -0
- package/dist/foundations/pointer.d.ts +25 -0
- package/dist/foundations/pointer.js +28 -0
- package/dist/foundations/uiCopy.d.ts +123 -2
- package/dist/foundations/uiCopy.js +86 -1
- package/dist/primitives/choice/RadioGroup.d.ts +8 -1
- package/dist/primitives/choice/RadioGroup.js +38 -1
- 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 +7 -0
- package/dist/primitives/field/Field.js +1 -0
- package/dist/primitives/field/Keypad.d.ts +43 -0
- package/dist/primitives/field/Keypad.js +62 -0
- package/dist/primitives/field/Stepper.d.ts +28 -0
- package/dist/primitives/field/Stepper.js +52 -0
- package/dist/primitives/field/clipboard.js +1 -1
- package/dist/primitives/field/index.d.ts +3 -0
- package/dist/primitives/field/index.js +6 -0
- package/dist/primitives/field/keypadKeys.d.ts +24 -0
- package/dist/primitives/field/keypadKeys.js +80 -0
- package/dist/primitives/hint/Hint.js +1 -1
- 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/Flag.js +1 -1
- package/dist/primitives/notice/Notice.d.ts +38 -10
- package/dist/primitives/notice/Notice.js +48 -9
- package/dist/primitives/notice/Outcome.d.ts +28 -0
- package/dist/primitives/notice/Outcome.js +28 -0
- package/dist/primitives/notice/index.d.ts +4 -1
- package/dist/primitives/notice/index.js +5 -0
- package/dist/primitives/notice/tones.d.ts +8 -0
- package/dist/primitives/notice/tones.js +22 -0
- package/dist/primitives/table/CellCopy.js +1 -1
- package/dist/primitives/table/ReportTable.js +1 -1
- package/dist/primitives/table/RowActions.js +1 -1
- package/dist/primitives/table/Table.js +9 -5
- package/dist/primitives/tag/Tags.d.ts +22 -1
- package/dist/primitives/tag/Tags.js +57 -14
- package/dist/primitives/tag/index.d.ts +1 -1
- package/dist/primitives/value/Elapsed.d.ts +16 -0
- package/dist/primitives/value/Elapsed.js +37 -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/elapsedTime.d.ts +26 -0
- package/dist/primitives/value/elapsedTime.js +32 -0
- package/dist/primitives/value/index.d.ts +5 -0
- package/dist/primitives/value/index.js +10 -0
- package/dist/primitives/value/priceFormat.d.ts +12 -0
- package/dist/primitives/value/priceFormat.js +22 -0
- package/dist/tokens.css +126 -1
- package/dist/views/list/List.d.ts +11 -0
- package/dist/views/list/List.js +14 -3
- package/dist/views/list/ListView.d.ts +1 -1
- package/dist/views/list/ListView.js +48 -9
- package/dist/views/list/types.d.ts +15 -0
- package/dist/views/record/Record.js +1 -1
- package/package.json +3 -2
package/README.md
CHANGED
|
@@ -265,22 +265,23 @@ follows:
|
|
|
265
265
|
}
|
|
266
266
|
```
|
|
267
267
|
|
|
268
|
-
| Component
|
|
269
|
-
|
|
|
270
|
-
| `Button`, `ButtonLink`
|
|
271
|
-
| `IconButton`, `IconLink`
|
|
272
|
-
| Inputs, selects, date and pickers' boxes
|
|
273
|
-
| Menus, lists, popovers, the cuts panel
|
|
274
|
-
| A row inside them (menu item, option)
|
|
275
|
-
| `Dialog`
|
|
276
|
-
| `Block`, `RecordCard`, `Metric`
|
|
277
|
-
| A
|
|
278
|
-
|
|
|
279
|
-
| `
|
|
280
|
-
|
|
|
281
|
-
|
|
|
282
|
-
|
|
|
283
|
-
|
|
|
268
|
+
| Component | Tokens |
|
|
269
|
+
| ------------------------------------------------------------------------------ | -------------------------------------------------------------------------------------- |
|
|
270
|
+
| `Button`, `ButtonLink` | `--ui-button-radius` |
|
|
271
|
+
| `IconButton`, `IconLink` | `--ui-icon-button-radius` |
|
|
272
|
+
| Inputs, selects, date and pickers' boxes | `--ui-control-radius`, `--ui-control-bg`, `--ui-control-border` |
|
|
273
|
+
| Menus, lists, popovers, the cuts panel | `--ui-popover-radius`, `--ui-popover-bg`, `--ui-popover-border`, `--ui-popover-shadow` |
|
|
274
|
+
| A row inside them (menu item, option) | `--ui-option-radius`, `--ui-option-active-bg` |
|
|
275
|
+
| `Dialog` | `--ui-dialog-radius`, `--ui-dialog-bg` |
|
|
276
|
+
| `Block`, `RecordCard`, `Metric` | `--ui-card-radius`, `--ui-card-bg`, `--ui-card-border` |
|
|
277
|
+
| A record's card on a board or a grid (`RecordCard`, `RadioGroup look="cards"`) | `--ui-record-card-radius` (falls back to the card's, then to the control's corner) |
|
|
278
|
+
| A board's `BoardTile` and `BoardStat` | `--ui-tile-radius`, `--ui-tile-bg`, `--ui-tile-border` (fall back to the card's) |
|
|
279
|
+
| `Tag`, `Tags`, the search bar's chips | `--ui-tag-radius` |
|
|
280
|
+
| `SearchBar`'s field | `--ui-search-radius` (and the control's bg and border) |
|
|
281
|
+
| The sidebar on the canvas | `--ui-sidebar-bg`, `--ui-sidebar-border` |
|
|
282
|
+
| `NavigationTree` | `--ui-nav-radius`, `--ui-nav-current-bg` |
|
|
283
|
+
| Table headers (`DataTable`, `EditableTable`, `ReportTable`) | `--ui-table-head-bg` |
|
|
284
|
+
| `Guide` (a guided tour): its card and its veil | `--ui-guide-radius`, `--ui-guide-bg`, `--ui-guide-scrim` |
|
|
284
285
|
|
|
285
286
|
What a token does not cover, a **part** does. Every customizable piece names its root
|
|
286
287
|
`data-ui="<component>"` and its parts `data-ui="<component>.<part>"`, with its variant beside
|
|
@@ -296,13 +297,24 @@ of classes that change with the next refactor:
|
|
|
296
297
|
}
|
|
297
298
|
```
|
|
298
299
|
|
|
299
|
-
The parts: `button`, `icon-button`, `control`, `popover`, `menu`, `menu.trigger`,
|
|
300
|
-
`menu.section`, `menu.item`, `menu.fold`, `dialog`, `block`, `record-card
|
|
300
|
+
The parts: `button`, `icon-button`, `control`, `popover`, `menu`, `menu.trigger`, `context-menu`,
|
|
301
|
+
`menu.section`, `menu.item`, `menu.fold`, `dialog`, `block`, `record-card` (with `data-layout`
|
|
302
|
+
`card` | `compact` | `tile`), `record-card.title`, `record-card.figure`, `record-card.fields`,
|
|
303
|
+
`record-card.media`, `record-card.badge`, `record-card.footer`, `record-card.stripe`,
|
|
304
|
+
`board.lane`, `list.tiles`, `elapsed`, `keypad`, `keypad.key`, `keypad.screen`, `stepper`,
|
|
305
|
+
`radio-group` (with `data-look` `list` | `cards` | `swatches`), `radio-group.card`,
|
|
306
|
+
`radio-group.swatch`, `radio-group.chosen`, `tags.count`, `skeleton` (with `data-shape` `rows` | `table` | `tiles` | `board`), `empty` (with `data-size="page"` when it has a title or a picture), `empty.visual`,
|
|
307
|
+
`empty.title`, `outcome`, `outcome.figure`, `receipt`,
|
|
308
|
+
`receipt.document`, `receipt.lines`, `receipt.totals`, `kiosk`, `kiosk.attract`,
|
|
309
|
+
`kiosk.content`, `kiosk.reach`, `board.tile`,
|
|
301
310
|
`board.stat`, `board.stat.value`, `activity.changes`, `file-list`, `file-list.file`, `file-value`, `metric`, `metric.detail`, `tag`, `tags.item`, `search`, `search.field`, `search.chip`,
|
|
302
|
-
`search.panel`, `search.suggestions`, `search.suggestion`, `search.record`, `search.
|
|
303
|
-
`search.keys`, `search-entry`, `search-entry.keys`, `table`, `table.pile`, `yes-no`,
|
|
311
|
+
`search.panel`, `search.suggestions`, `search.suggestion`, `search.record`, `search.recent`,
|
|
312
|
+
`search.advanced`, `search.keys`, `search.completion`, `search.undo`, `search.slash`, `search-entry`, `search-entry.keys`, `table`, `table.pile`, `yes-no`,
|
|
304
313
|
`table.head`, `row.ways`, `topbar`, `topbar.brand`, `topbar.menus`, `topbar.actions`, `topbar.user`,
|
|
305
|
-
`frame`, `frame.bar`, `frame.sidebar`, `frame.main`, `
|
|
314
|
+
`frame`, `frame.banner`, `frame.bar`, `frame.sidebar`, `frame.main`, `banner`, `banner.action`,
|
|
315
|
+
`inbox`, `inbox.item` (with `data-unread`), `kbd`, `plans`, `plan` (with `data-highlight`, `data-current`), `plan.highlight`, `plan.price`,
|
|
316
|
+
`plan.features`, `plan.action`, `qr`, `price`, `price.before`, `range-slider`, `rating`, `gallery`,
|
|
317
|
+
`gallery.main`, `gallery.strip`, `lightbox`, `sidebar`, `sidebar.brand`,
|
|
306
318
|
`sidebar.user`, `sidebar.search`, `sidebar.nav`, `sidebar.account`, `navigation`,
|
|
307
319
|
`navigation.item`, `dirty.blocked`, `dirty.bar`, `field`, `field.label`, `form.section`,
|
|
308
320
|
`form.index`, `dock`, `dock.pill`, `dock.bare`, `pager`, `pagination`, `smart`, `guide`, `guide.veil`, `guide.spot`, `guide.card`,
|
|
@@ -310,6 +322,29 @@ The parts: `button`, `icon-button`, `control`, `popover`, `menu`, `menu.trigger`
|
|
|
310
322
|
carries `data-key` too (`navigation.item`). Put your rules in a cascade layer above web-ui's, or
|
|
311
323
|
outside any layer.
|
|
312
324
|
|
|
325
|
+
#### Touch and the counter: a till, a kitchen, a kiosk, a shop
|
|
326
|
+
|
|
327
|
+
The same pieces as the ERP, drawn for a finger — no «POS» inside the package. The application
|
|
328
|
+
says what the person presses with, on `<html>` or on a zone (a till is a touch monitor with a
|
|
329
|
+
mouse plugged in, so the browser alone says «mouse»):
|
|
330
|
+
|
|
331
|
+
```tsx
|
|
332
|
+
<html {...pointerAttributes("touch")}> {/* data-pointer="touch" */}
|
|
333
|
+
```
|
|
334
|
+
|
|
335
|
+
Controls grow to 44 px, what is drawn small answers to `--size-target` (`hit-target`), and what
|
|
336
|
+
only shows on hover follows the `touch:` variant. Then: `List.Tiles` (a product grid),
|
|
337
|
+
`List.Filters` with `Tags size="md" | "lg"` and `count`, `RadioGroup look="cards"`, `Keypad`
|
|
338
|
+
(with `screen`), `Stepper`, `RecordCard elapsed`, `Outcome`, `Receipt`, and `KioskFrame` (an
|
|
339
|
+
attract screen, `idleAfter`, a reduced-height mode). The Storybook page «Táctil y mostrador»
|
|
340
|
+
orders them by what they solve; `5 · Plantillas/Mostrador` has the till, the express till, the
|
|
341
|
+
kitchen, the kiosk and the shop.
|
|
342
|
+
|
|
343
|
+
For a shop's product page and a customer portal: `Price` (the price before struck, the discount
|
|
344
|
+
computed), `Rating` (an average with its figure, or the opinion asked), `Gallery` (with a
|
|
345
|
+
full-size `Lightbox`), `Inbox` (the bell in `TopBar systray`, or `InboxList` as a page), and
|
|
346
|
+
`Banner` — a notice about the whole application, in `AppFrame banner`.
|
|
347
|
+
|
|
313
348
|
#### A form that explains itself: the «settings» style
|
|
314
349
|
|
|
315
350
|
The default form is the dense sheet of an ERP — label | control, two columns, help behind a
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { type GalleryImage } from "./Lightbox.js";
|
|
2
|
+
declare const ASPECT: {
|
|
3
|
+
readonly square: "aspect-square";
|
|
4
|
+
readonly tile: "aspect-(--aspect-tile)";
|
|
5
|
+
readonly wide: "aspect-video";
|
|
6
|
+
};
|
|
7
|
+
export type GalleryProps = {
|
|
8
|
+
images: readonly GalleryImage[];
|
|
9
|
+
/** The shape of the main image. The photos are never cropped inside it: `contain`. */
|
|
10
|
+
aspect?: keyof typeof ASPECT;
|
|
11
|
+
/** Which image is shown, when the application holds it (a variant chosen shows its photo). */
|
|
12
|
+
index?: number;
|
|
13
|
+
onIndexChange?: (next: number) => void;
|
|
14
|
+
/** Pressing the image opens it at full size (`Lightbox`). On by default. */
|
|
15
|
+
zoom?: boolean;
|
|
16
|
+
};
|
|
17
|
+
/**
|
|
18
|
+
* The images of ONE thing — a product, a property, an asset, a damage reported: a big one, the
|
|
19
|
+
* strip of the rest under it, and full size on a press.
|
|
20
|
+
*
|
|
21
|
+
* Context: a product's page lives on its photos, and a carousel that turns by itself is a
|
|
22
|
+
* photo nobody chose to see. Here the person moves it: the arrows at the sides, the strip, the
|
|
23
|
+
* keyboard's arrows, a finger swiping. Where they are is written («2 de 5»), never only a dot.
|
|
24
|
+
* The image is never cropped (`object-contain` on the ground tone): a cropped product is a
|
|
25
|
+
* different product. Controlled or not: a shop that changes the photo when a colour is chosen
|
|
26
|
+
* passes `index`.
|
|
27
|
+
*/
|
|
28
|
+
export declare function Gallery({ images, aspect, index: indexProp, onIndexChange, zoom, }: GalleryProps): import("react").JSX.Element;
|
|
29
|
+
export {};
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
|
+
import { Lightbox, wrapIndex, } from "./Lightbox.js";
|
|
4
|
+
import { fillCopy, useUiCopy } from "../../foundations/copy.js";
|
|
5
|
+
import { IconButton } from "../../primitives/button/Button.js";
|
|
6
|
+
import { ChevronLeft, ChevronRight, ImageOff } from "lucide-react";
|
|
7
|
+
import { useRef, useState } from "react";
|
|
8
|
+
const ASPECT = {
|
|
9
|
+
square: "aspect-square",
|
|
10
|
+
/* The tile's 4:3 — the same box `RecordCard layout="tile"` draws a product in. */
|
|
11
|
+
tile: "aspect-(--aspect-tile)",
|
|
12
|
+
wide: "aspect-video",
|
|
13
|
+
};
|
|
14
|
+
/* A finger that moves this far sideways meant «next», not «open». */
|
|
15
|
+
const SWIPE = 40;
|
|
16
|
+
/**
|
|
17
|
+
* The images of ONE thing — a product, a property, an asset, a damage reported: a big one, the
|
|
18
|
+
* strip of the rest under it, and full size on a press.
|
|
19
|
+
*
|
|
20
|
+
* Context: a product's page lives on its photos, and a carousel that turns by itself is a
|
|
21
|
+
* photo nobody chose to see. Here the person moves it: the arrows at the sides, the strip, the
|
|
22
|
+
* keyboard's arrows, a finger swiping. Where they are is written («2 de 5»), never only a dot.
|
|
23
|
+
* The image is never cropped (`object-contain` on the ground tone): a cropped product is a
|
|
24
|
+
* different product. Controlled or not: a shop that changes the photo when a colour is chosen
|
|
25
|
+
* passes `index`.
|
|
26
|
+
*/
|
|
27
|
+
export function Gallery({ images, aspect = "square", index: indexProp, onIndexChange, zoom = true, }) {
|
|
28
|
+
const copy = useUiCopy();
|
|
29
|
+
const [own, setOwn] = useState(0);
|
|
30
|
+
const [open, setOpen] = useState(false);
|
|
31
|
+
const swipe = useRef(null);
|
|
32
|
+
const total = images.length;
|
|
33
|
+
const index = wrapIndex(indexProp ?? own, total);
|
|
34
|
+
const image = images[index];
|
|
35
|
+
const show = (next) => {
|
|
36
|
+
const at = wrapIndex(next, total);
|
|
37
|
+
if (indexProp === undefined)
|
|
38
|
+
setOwn(at);
|
|
39
|
+
onIndexChange?.(at);
|
|
40
|
+
};
|
|
41
|
+
const position = (at) => fillCopy(copy.gallery.position, { index: at + 1, total });
|
|
42
|
+
const keys = (event) => {
|
|
43
|
+
if (total < 2)
|
|
44
|
+
return;
|
|
45
|
+
if (event.key === "ArrowRight")
|
|
46
|
+
show(index + 1);
|
|
47
|
+
else if (event.key === "ArrowLeft")
|
|
48
|
+
show(index - 1);
|
|
49
|
+
else
|
|
50
|
+
return;
|
|
51
|
+
event.preventDefault();
|
|
52
|
+
};
|
|
53
|
+
const down = (event) => {
|
|
54
|
+
swipe.current = { x: event.clientX, moved: false };
|
|
55
|
+
};
|
|
56
|
+
const up = (event) => {
|
|
57
|
+
const start = swipe.current;
|
|
58
|
+
if (start === null || total < 2)
|
|
59
|
+
return;
|
|
60
|
+
const dx = event.clientX - start.x;
|
|
61
|
+
if (Math.abs(dx) < SWIPE)
|
|
62
|
+
return;
|
|
63
|
+
start.moved = true;
|
|
64
|
+
show(index + (dx < 0 ? 1 : -1));
|
|
65
|
+
};
|
|
66
|
+
if (image === undefined) {
|
|
67
|
+
return (_jsxs("div", { "data-ui": "gallery", className: `flex w-full flex-col items-center justify-center gap-2 rounded-ui-card bg-ground text-muted ${ASPECT[aspect]}`, children: [_jsx(ImageOff, { className: "size-8", strokeWidth: 1.5, "aria-hidden": true }), _jsx("p", { className: "text-meta", children: copy.gallery.empty })] }));
|
|
68
|
+
}
|
|
69
|
+
const picture = (_jsx("img", { src: image.src, alt: image.alt, draggable: false, className: "size-full object-contain select-none" }));
|
|
70
|
+
return (_jsxs("div", { role: "group", "aria-label": copy.gallery.label, "aria-roledescription": copy.gallery.roledescription, "data-ui": "gallery", className: "flex min-w-0 flex-col gap-2", onKeyDown: keys, children: [_jsxs("div", { "data-ui": "gallery.main", className: `relative w-full overflow-clip rounded-ui-card bg-ground touch-pan-y ${ASPECT[aspect]}`, onPointerDown: down, onPointerUp: up, children: [zoom ? (_jsx("button", { type: "button", "aria-label": `${copy.gallery.open}: ${image.alt}`, className: "size-full cursor-zoom-in outline-0 focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-primary", onClick: () => {
|
|
71
|
+
/* The press that ended a swipe is not an «open». */
|
|
72
|
+
if (swipe.current?.moved === true)
|
|
73
|
+
return;
|
|
74
|
+
setOpen(true);
|
|
75
|
+
}, children: picture })) : (picture), total < 2 ? null : (_jsxs(_Fragment, { children: [_jsx("span", { className: "absolute top-1/2 left-2 -translate-y-1/2 rounded-pill bg-surface/85 shadow-raised", children: _jsx(IconButton, { icon: ChevronLeft, label: copy.gallery.previous, size: "md", surface: "canvas", onClick: () => show(index - 1) }) }), _jsx("span", { className: "absolute top-1/2 right-2 -translate-y-1/2 rounded-pill bg-surface/85 shadow-raised", children: _jsx(IconButton, { icon: ChevronRight, label: copy.gallery.next, size: "md", surface: "canvas", onClick: () => show(index + 1) }) }), _jsxs("span", { "aria-live": "polite", className: "absolute right-2 bottom-2 rounded-pill bg-surface/85 px-2 py-0.5 text-micro font-medium text-ink tabular-nums shadow-raised", children: [index + 1, " / ", total, _jsx("span", { className: "sr-only", children: `, ${position(index)}` })] })] }))] }), total < 2 ? null : (_jsx("div", { "data-ui": "gallery.strip", className: "flex gap-2 overflow-x-auto pb-1", children: images.map((one, at) => (_jsx("button", { type: "button", "aria-label": `${position(at)}: ${one.alt}`, "aria-current": at === index ? "true" : undefined, onClick: () => show(at), className: `size-14 shrink-0 overflow-clip rounded-control border-2 bg-ground transition-colors duration-(--duration-instant) focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary ${at === index
|
|
76
|
+
? "border-primary"
|
|
77
|
+
: "border-transparent hover:border-line-strong"}`, children: _jsx("img", { src: one.thumb ?? one.src, alt: "", className: "size-full object-cover" }) }, `${one.src}-${at}`))) })), zoom ? (_jsx(Lightbox, { images: images, index: index, onIndexChange: show, open: open, onClose: () => setOpen(false) })) : null] }));
|
|
78
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
export type GalleryImage = {
|
|
2
|
+
src: string;
|
|
3
|
+
/** What the image shows, said: «Silla Nórdica, vista de frente». Not optional — an image
|
|
4
|
+
* without words is a hole for a screen reader. */
|
|
5
|
+
alt: string;
|
|
6
|
+
/** A smaller file for the strip of thumbnails; the `src` when absent. */
|
|
7
|
+
thumb?: string;
|
|
8
|
+
};
|
|
9
|
+
export type LightboxProps = {
|
|
10
|
+
images: readonly GalleryImage[];
|
|
11
|
+
/** Which one is shown. */
|
|
12
|
+
index: number;
|
|
13
|
+
onIndexChange: (next: number) => void;
|
|
14
|
+
open: boolean;
|
|
15
|
+
onClose: () => void;
|
|
16
|
+
};
|
|
17
|
+
/** The step that wraps: past the last comes the first, the way a shop's photos go round. */
|
|
18
|
+
export declare function wrapIndex(index: number, total: number): number;
|
|
19
|
+
/**
|
|
20
|
+
* The image at full size, over everything: a product's photo, a damage reported with the
|
|
21
|
+
* phone, a scanned receipt.
|
|
22
|
+
*
|
|
23
|
+
* Context: a modal of React Aria — focus goes in, Escape and the ✕ close it, focus comes back
|
|
24
|
+
* to the image that opened it — on a near-black veil, with the controls on the chrome palette
|
|
25
|
+
* so they read on it. The arrows of the keyboard and the buttons at the sides step through the
|
|
26
|
+
* images; the position is written («2 de 5») so «where am I» never depends on counting dots.
|
|
27
|
+
*/
|
|
28
|
+
export declare function Lightbox({ images, index, onIndexChange, open, onClose }: LightboxProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
|
+
import { fillCopy, useUiCopy } from "../../foundations/copy.js";
|
|
4
|
+
import { SurfaceProvider } from "../../foundations/surface.js";
|
|
5
|
+
import { tv } from "../../foundations/variants.js";
|
|
6
|
+
import { IconButton } from "../../primitives/button/Button.js";
|
|
7
|
+
import { ChevronLeft, ChevronRight, X } from "lucide-react";
|
|
8
|
+
import { useEffect } from "react";
|
|
9
|
+
import { Dialog, Modal, ModalOverlay } from "react-aria-components";
|
|
10
|
+
/* Almost the scrim itself, not a dialog's 40 % veil: the page under it is not what the window
|
|
11
|
+
is about — the image is. At 90 % the page still showed around a light photo and competed with
|
|
12
|
+
it (seen in the gallery's story). Never 100 %: a veil is a share of the scrim (tokens.test). */
|
|
13
|
+
const overlay = tv({
|
|
14
|
+
base: "fixed inset-0 z-50 bg-scrim/95 transition-opacity duration-(--duration-quick) ease-(--ease-out)",
|
|
15
|
+
variants: {
|
|
16
|
+
isEntering: { true: "opacity-0" },
|
|
17
|
+
isExiting: { true: "opacity-0" },
|
|
18
|
+
},
|
|
19
|
+
});
|
|
20
|
+
/** The step that wraps: past the last comes the first, the way a shop's photos go round. */
|
|
21
|
+
export function wrapIndex(index, total) {
|
|
22
|
+
return total === 0 ? 0 : ((index % total) + total) % total;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* The image at full size, over everything: a product's photo, a damage reported with the
|
|
26
|
+
* phone, a scanned receipt.
|
|
27
|
+
*
|
|
28
|
+
* Context: a modal of React Aria — focus goes in, Escape and the ✕ close it, focus comes back
|
|
29
|
+
* to the image that opened it — on a near-black veil, with the controls on the chrome palette
|
|
30
|
+
* so they read on it. The arrows of the keyboard and the buttons at the sides step through the
|
|
31
|
+
* images; the position is written («2 de 5») so «where am I» never depends on counting dots.
|
|
32
|
+
*/
|
|
33
|
+
export function Lightbox({ images, index, onIndexChange, open, onClose }) {
|
|
34
|
+
const copy = useUiCopy();
|
|
35
|
+
const total = images.length;
|
|
36
|
+
const image = images[wrapIndex(index, total)];
|
|
37
|
+
const go = (step) => onIndexChange(wrapIndex(index + step, total));
|
|
38
|
+
/* On the window and not on the dialog: the focus starts ON the dialog, and a key pressed
|
|
39
|
+
there never reaches a handler inside it. */
|
|
40
|
+
useEffect(() => {
|
|
41
|
+
if (!open || total < 2)
|
|
42
|
+
return;
|
|
43
|
+
const keys = (event) => {
|
|
44
|
+
if (event.key !== "ArrowRight" && event.key !== "ArrowLeft")
|
|
45
|
+
return;
|
|
46
|
+
event.preventDefault();
|
|
47
|
+
onIndexChange(wrapIndex(index + (event.key === "ArrowRight" ? 1 : -1), total));
|
|
48
|
+
};
|
|
49
|
+
window.addEventListener("keydown", keys);
|
|
50
|
+
return () => window.removeEventListener("keydown", keys);
|
|
51
|
+
}, [open, total, index, onIndexChange]);
|
|
52
|
+
return (_jsx(ModalOverlay, { isOpen: open && image !== undefined, onOpenChange: (next) => {
|
|
53
|
+
if (!next)
|
|
54
|
+
onClose();
|
|
55
|
+
}, isDismissable: true, className: overlay, children: _jsx(Modal, { className: "fixed inset-0 outline-0", children: _jsx(Dialog, { "aria-label": image?.alt ?? copy.gallery.label, className: "flex size-full flex-col outline-0", "data-ui": "lightbox", children: _jsxs(SurfaceProvider, { value: "chrome", children: [_jsxs("div", { className: "flex shrink-0 items-center justify-between gap-3 px-4 py-3", children: [_jsx("p", { className: "min-w-0 truncate text-meta text-chrome-ink", "aria-live": "polite", children: fillCopy(copy.gallery.position, {
|
|
56
|
+
index: wrapIndex(index, total) + 1,
|
|
57
|
+
total,
|
|
58
|
+
}) }), _jsx(IconButton, { icon: X, label: copy.gallery.close, size: "md", onClick: onClose })] }), _jsxs("div", { className: "relative flex min-h-0 flex-1 items-center justify-center px-4 pb-6 sm:px-16", children: [image === undefined ? null : (_jsx("img", { src: image.src, alt: image.alt, className: "max-h-full max-w-full rounded-control object-contain select-none", draggable: false })), total < 2 ? null : (_jsxs(_Fragment, { children: [_jsx("span", { className: "absolute top-1/2 left-2 -translate-y-1/2 rounded-pill bg-chrome-ink/12", children: _jsx(IconButton, { icon: ChevronLeft, label: copy.gallery.previous, size: "lg", onClick: () => go(-1) }) }), _jsx("span", { className: "absolute top-1/2 right-2 -translate-y-1/2 rounded-pill bg-chrome-ink/12", children: _jsx(IconButton, { icon: ChevronRight, label: copy.gallery.next, size: "lg", onClick: () => go(1) }) })] }))] })] }) }) }) }));
|
|
59
|
+
}
|
|
@@ -8,12 +8,15 @@ export * from "./chat/index.js";
|
|
|
8
8
|
export * from "./flow/index.js";
|
|
9
9
|
export * from "./form/index.js";
|
|
10
10
|
export * from "./frame/index.js";
|
|
11
|
+
export * from "./gallery/index.js";
|
|
11
12
|
export * from "./gantt/index.js";
|
|
12
13
|
export * from "./guide/index.js";
|
|
13
14
|
export * from "./lines/index.js";
|
|
14
15
|
export * from "./listing/index.js";
|
|
15
16
|
export * from "./navigation/index.js";
|
|
17
|
+
export * from "./plans/index.js";
|
|
16
18
|
export * from "./preview/index.js";
|
|
19
|
+
export * from "./receipt/index.js";
|
|
17
20
|
export * from "./record/index.js";
|
|
18
21
|
export * from "./search/index.js";
|
|
19
22
|
export * from "./shell/index.js";
|
package/dist/components/index.js
CHANGED
|
@@ -9,12 +9,15 @@ export * from "./chat/index.js";
|
|
|
9
9
|
export * from "./flow/index.js";
|
|
10
10
|
export * from "./form/index.js";
|
|
11
11
|
export * from "./frame/index.js";
|
|
12
|
+
export * from "./gallery/index.js";
|
|
12
13
|
export * from "./gantt/index.js";
|
|
13
14
|
export * from "./guide/index.js";
|
|
14
15
|
export * from "./lines/index.js";
|
|
15
16
|
export * from "./listing/index.js";
|
|
16
17
|
export * from "./navigation/index.js";
|
|
18
|
+
export * from "./plans/index.js";
|
|
17
19
|
export * from "./preview/index.js";
|
|
20
|
+
export * from "./receipt/index.js";
|
|
18
21
|
export * from "./record/index.js";
|
|
19
22
|
export * from "./search/index.js";
|
|
20
23
|
export * from "./shell/index.js";
|
|
@@ -41,7 +41,7 @@ function ProgressBar({ items, progress, }) {
|
|
|
41
41
|
const parts = PROGRESS_ORDER.filter((tone) => (counts.get(tone) ?? 0) > 0);
|
|
42
42
|
if (parts.length === 0)
|
|
43
43
|
return null;
|
|
44
|
-
return (_jsx("div", { role: "img", "aria-label": parts.map((tone) => `${tone}: ${counts.get(tone)}`).join(", "), className: "mx-1 flex h-1
|
|
44
|
+
return (_jsx("div", { role: "img", "aria-label": parts.map((tone) => `${tone}: ${counts.get(tone)}`).join(", "), className: "mx-1.5 flex h-1 overflow-hidden rounded-pill bg-ink/8", children: parts.map((tone) => (_jsx("span", { className: PROGRESS_FILL[tone], style: { width: `${((counts.get(tone) ?? 0) / items.length) * 100}%` } }, tone))) }));
|
|
45
45
|
}
|
|
46
46
|
/* ==================================================================== *
|
|
47
47
|
* THE BOARD BY STAGES — Odoo's kanban.
|
|
@@ -106,14 +106,18 @@ export function BoardColumns({ items, keyOf, stages, card, }) {
|
|
|
106
106
|
event.preventDefault();
|
|
107
107
|
move(keyOf(item), next.id);
|
|
108
108
|
};
|
|
109
|
-
return (
|
|
109
|
+
return (
|
|
110
|
+
/* The lanes are a wash on the canvas and not boxes: the card is the only box, so a board
|
|
111
|
+
reads as columns of records and not as boxes inside boxes. They share the width when
|
|
112
|
+
the stages fit (up to `--container-lane-max`) and scroll sideways when they do not. */
|
|
113
|
+
_jsxs("div", { className: "flex min-w-0 items-start gap-2 overflow-x-auto p-3", children: [columns.map((column) => {
|
|
110
114
|
const inside = items.filter((item) => of(item) === column.id);
|
|
111
115
|
if (folded.has(column.id)) {
|
|
112
116
|
/* Folded: a strip with its count and its name down the spine. Still a drop target —
|
|
113
117
|
dropping on «perdido» is how a lost deal is marked. */
|
|
114
|
-
return (_jsxs("section", { "aria-label": column.label, ...dropOn(column.id), className: `flex w-12 shrink-0 flex-col items-center gap-2 rounded-
|
|
118
|
+
return (_jsxs("section", { "aria-label": column.label, ...dropOn(column.id), className: `flex w-12 shrink-0 flex-col items-center gap-2 rounded-control py-2 ${over === column.id ? "bg-primary/8 ring-1 ring-primary/40" : "bg-ink/3"}`, children: [_jsx(IconButton, { icon: ChevronsLeftRight, label: fillCopy(copy.board.unfold, { column: column.label }), onClick: () => toggleFold(column.id) }), _jsx("span", { className: "text-micro text-muted tabular-nums", children: inside.length }), _jsx("span", { className: "text-vertical text-meta font-semibold text-ink", children: column.label })] }, column.id));
|
|
115
119
|
}
|
|
116
|
-
return (_jsxs("section", { "aria-label": column.label, ...dropOn(column.id), className: `flex w-(--container-lane) shrink-0 flex-col gap-
|
|
120
|
+
return (_jsxs("section", { "aria-label": column.label, ...dropOn(column.id), "data-ui": "board.lane", className: `flex max-w-(--container-lane-max) min-w-(--container-lane) flex-1 shrink-0 basis-(--container-lane) flex-col gap-1.5 rounded-control p-1.5 transition-colors duration-(--duration-instant) ${over === column.id ? "bg-primary/8 ring-1 ring-primary/40" : "bg-ink/3"}`, children: [_jsxs("header", { className: "flex min-w-0 items-center gap-1.5 px-1.5 pt-0.5", children: [_jsx("h3", { className: "min-w-0 flex-1 truncate text-meta font-semibold text-ink", children: column.tone === undefined ? (column.label) : (_jsx(StatusDot, { tone: column.tone, label: column.label })) }), _jsx("span", { className: "shrink-0 rounded-pill bg-ink/6 px-1.5 text-micro text-muted tabular-nums", children: inside.length }), total === undefined ? null : (_jsx("span", { className: "shrink-0 text-meta font-semibold text-ink tabular-nums", children: total(inside) })), onQuickCreate === undefined ? null : (_jsx(IconButton, { icon: Plus, label: fillCopy(copy.board.quickCreate, { column: column.label }), onClick: () => setCreating(column.id) })), _jsx(IconButton, { icon: ChevronsLeftRight, label: fillCopy(copy.board.fold, { column: column.label }), onClick: () => toggleFold(column.id) })] }), progress === undefined || inside.length === 0 ? null : (_jsx(ProgressBar, { items: inside, progress: progress })), creating === column.id && onQuickCreate !== undefined ? (_jsx(BoardInput, { label: fillCopy(copy.board.quickCreate, { column: column.label }), placeholder: copy.board.quickPlaceholder, onCommit: (name) => onQuickCreate(column.id, name), onClose: () => setCreating(null) })) : null, inside.length === 0 ? (_jsx("p", { className: "px-1 py-3 text-micro text-muted", children: copy.board.emptyLane })) : (_jsx("ul", { className: "flex min-w-0 flex-col gap-1.5", children: inside.map((item) => {
|
|
117
121
|
const id = keyOf(item);
|
|
118
122
|
return (_jsx("li", { ...(onMove === undefined
|
|
119
123
|
? {}
|
|
@@ -129,9 +133,9 @@ export function BoardColumns({ items, keyOf, stages, card, }) {
|
|
|
129
133
|
},
|
|
130
134
|
onDragEnd: () => setDragging(null),
|
|
131
135
|
onKeyDown: (event) => byKeyboard(event, item),
|
|
132
|
-
}), className: `flex min-w-0 flex-col rounded-
|
|
136
|
+
}), className: `flex min-w-0 flex-col rounded-ui-record-card focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary ${onMove === undefined ? "" : "cursor-grab active:cursor-grabbing"} ${dragging === id ? "opacity-50" : ""}`, children: card(item) }, id));
|
|
133
137
|
}) }))] }, column.id));
|
|
134
|
-
}), onAddColumn === undefined ? null : (_jsx("div", { className: "flex w-(--container-lane) shrink-0 flex-col gap-2 p-
|
|
138
|
+
}), onAddColumn === undefined ? null : (_jsx("div", { className: "flex w-(--container-lane) shrink-0 flex-col gap-2 p-1.5", children: adding ? (_jsx(BoardInput, { label: copy.board.addColumn, placeholder: copy.board.addColumnPlaceholder, onCommit: (label) => {
|
|
135
139
|
onAddColumn(label);
|
|
136
140
|
setAdding(false);
|
|
137
141
|
}, onClose: () => setAdding(false) })) : (_jsxs("button", { type: "button", onClick: () => setAdding(true), className: "flex h-(--size-control-md) items-center gap-1.5 rounded-control px-2 text-meta text-muted transition-colors duration-(--duration-instant) hover:bg-ink/5 hover:text-ink focus-visible:outline-2 focus-visible:outline-primary", children: [_jsx(Plus, { "aria-hidden": true, className: "size-(--size-icon-sm)", strokeWidth: 2 }), copy.board.addColumn] })) })), _jsx("span", { role: "status", className: "sr-only", children: said })] }));
|
|
@@ -44,8 +44,10 @@ export function ColumnsMenu({ control, surface, addPath, }) {
|
|
|
44
44
|
{ label: copy.frame.required, options: requiredOptions },
|
|
45
45
|
{ label: copy.frame.optional, options: optionalOptions },
|
|
46
46
|
];
|
|
47
|
-
const
|
|
48
|
-
|
|
47
|
+
const menu = (_jsx(Menu, { label: copy.frame.columns, icon: Columns3, groups: groups, onSelect: control.toggle, closeOnSelect: false,
|
|
48
|
+
/* Marked when the person changed the columns — not when the view's own defaults hide an
|
|
49
|
+
optional one: at rest every such list read as «something is set here». */
|
|
50
|
+
active: control.changed, ...(surface === undefined ? {} : { surface }), size: "sm" }));
|
|
49
51
|
return picker === null ? (menu) : (_jsxs("span", { className: "flex items-center gap-1.5", children: [menu, picker] }));
|
|
50
52
|
}
|
|
51
53
|
/* `specsFromColumns` is plain (`columnSpecs.ts`), without the directive; re-exported so every
|
|
@@ -84,5 +84,7 @@ export function Listing({ bar, metrics, sticky = false, surface, children, }) {
|
|
|
84
84
|
background is its white and its radius; a frame around a list that is
|
|
85
85
|
already inside a framed panel is a nested rectangle, and nested
|
|
86
86
|
rectangles are what make a product read like a cloud console. */
|
|
87
|
-
|
|
87
|
+
/* `isolate`: the list's sticky bar and floating pill stay over its rows, and under
|
|
88
|
+
whatever the host lays on the list — a workspace's modal (see `Record`). */
|
|
89
|
+
_jsxs("div", { className: `isolate flex min-w-0 flex-col ${byDensity(d, "gap-2.5", "gap-2")}`, children: [bar === undefined || bar === null ? null : inSlot ? (createPortal(bar, slot)) : (_jsx("div", { ref: band.ref, className: `min-w-0 ${pegada ? `sticky z-30 ${surface === "chrome" ? "bg-chrome" : "bg-ground"}` : ""}`, style: pegada ? band.self : undefined, children: bar })), inSlot && metrics !== undefined ? _jsx("div", { className: "pt-2", children: metrics }) : metrics, _jsx("div", { className: "min-w-0 overflow-clip rounded-box bg-surface", style: pegada && !inSlot ? band.below : undefined, children: children })] }));
|
|
88
90
|
}
|
|
@@ -1,91 +1,19 @@
|
|
|
1
|
-
import type { Surface } from "../../foundations/types.js";
|
|
1
|
+
import type { Surface, Tone } from "../../foundations/types.js";
|
|
2
2
|
import type { ViewStyle } from "../../foundations/viewStyle.js";
|
|
3
3
|
import type { ReactNode } from "react";
|
|
4
|
-
/**
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
* painted over each other the moment the window shrank.
|
|
18
|
-
*
|
|
19
|
-
* ── Why it is two lines tall ────────────────────────────────────────
|
|
20
|
-
*
|
|
21
|
-
* Because the three things that go on the left do not fit in one: a
|
|
22
|
-
* comfortable button is 34 px tall, a list title may have to wrap onto two
|
|
23
|
-
* lines, and below it goes a sentence saying what the list is made of. Forcing
|
|
24
|
-
* it into a single line means shrinking the button —the defect we already
|
|
25
|
-
* fixed— or truncating the title, which is worse: a list that cannot be named
|
|
26
|
-
* in full is indistinguishable from the one next to it.
|
|
27
|
-
*
|
|
28
|
-
* ── The selection transforms the bar, it does not add one ───────────
|
|
29
|
-
*
|
|
30
|
-
* When rows get selected, the identity zone turns into «3 elegidas ✕» plus the
|
|
31
|
-
* actions that apply. **In the same place and without pushing anything.** A
|
|
32
|
-
* bar that appears shifts the list downwards right when somebody is ticking
|
|
33
|
-
* checkboxes, and the row they were about to tick is no longer where it was.
|
|
34
|
-
*
|
|
35
|
-
* The actions on the left do NOT go away: «Nuevo» stays available with three
|
|
36
|
-
* rows selected, because selecting is not entering a mode.
|
|
37
|
-
*
|
|
38
|
-
* ── The modern style: the trail is the heading ──────────────────────
|
|
39
|
-
*
|
|
40
|
-
* ┌──────────────────────────────────────────────────────────────────┐
|
|
41
|
-
* │ Ventas › Andina › Pedidos ( 1–12 / 12 ‹ › ) │
|
|
42
|
-
* │ what it is made of 🔍 search… [sort][cols] [▤▦] │
|
|
43
|
-
* └──────────────────────────────────────────────────────────────────┘
|
|
44
|
-
* ( Pedidos │ Importar · Exportar ▾ · + Nueva cotización ) ← floats
|
|
45
|
-
*
|
|
46
|
-
* As a record in the modern style, WHERE I AM is the page's heading: the trail at the
|
|
47
|
-
* title's size (`Breadcrumb size="lg"`), its last crumb the list's name — so the title is
|
|
48
|
-
* not said twice —, and the page range at the other end, as the record's pager pill. Its
|
|
49
|
-
* counters are not here: beside the trail they read as more crumbs; the list draws them as
|
|
50
|
-
* mini stats under the bar (`List.Metrics`). The second row is how I look at the set: what
|
|
51
|
-
* it is made of (the description), the search centred, sort, columns and the faces. The
|
|
52
|
-
* list's actions float at the bottom of the screen in a pill named by the list
|
|
53
|
-
* (`List.Dock`), which turns into what is done to the chosen rows while some are chosen;
|
|
54
|
-
* given `placement="bar"`, or drawn by hand, they take the start of the second row and the
|
|
55
|
-
* description goes on demand (`Hint`) beside the heading. Without crumbs the title is the
|
|
56
|
-
* heading. Compact keeps the one bar below.
|
|
57
|
-
*
|
|
58
|
-
* ── Inside a record it is ONE line (`inline`) ────────────────────────
|
|
59
|
-
*
|
|
60
|
-
* ┌───────────────────────────────────────────────────────────────┐
|
|
61
|
-
* │ 🔍 search the lines… 12 records [sort][cols][▤▦] │
|
|
62
|
-
* └───────────────────────────────────────────────────────────────┘
|
|
63
|
-
* WHAT I LOOK FOR (fills) HOW MANY HOW I LOOK
|
|
64
|
-
*
|
|
65
|
-
* A collection that is a FIELD of a record — the lines of an order, the
|
|
66
|
-
* contacts of a customer, the journal items of an invoice — is not a screen.
|
|
67
|
-
* Everything the two rows above answer is already answered by the record
|
|
68
|
-
* around it: where I am (the record's crumbs), what this is (the tab it sits
|
|
69
|
-
* in), what I can do (the record's actions). Drawn with the page bar, it
|
|
70
|
-
* spent two rows and a rule on the one question left —the search, alone and
|
|
71
|
-
* centred on the first row; «Ordenar» and the switcher alone on the second—
|
|
72
|
-
* and pushed the rows, which are what the tab is for, below the fold.
|
|
73
|
-
*
|
|
74
|
-
* So it is a single line, and the order is the order of the questions: the
|
|
75
|
-
* search FILLS from the left (it is the only thing with variable content),
|
|
76
|
-
* then how many there are, then how they are looked at, then what starts a
|
|
77
|
-
* new one. No band, no padding, no hairline: it sits on the record's paper,
|
|
78
|
-
* aligned with the fields above it, and a light band inside a white sheet is
|
|
79
|
-
* a rectangle inside a rectangle.
|
|
80
|
-
*
|
|
81
|
-
* On a phone the line breaks by itself, with no threshold written anywhere:
|
|
82
|
-
* the search asks for `--container-name` before it gives up its place, so
|
|
83
|
-
* when the controls do not fit next to it they drop to a second line, pushed
|
|
84
|
-
* to the right, and the search keeps the whole first one.
|
|
85
|
-
*
|
|
86
|
-
* The count is a live region: typing in the search changes it, and somebody
|
|
87
|
-
* who cannot see the rows thin out hears how many are left. With
|
|
88
|
-
* `pagination` the page range replaces it — it already says how many. */
|
|
4
|
+
/**
|
|
5
|
+
* One count of what the list is made of — «64 cotizaciones». With `onClick` it also NARROWS
|
|
6
|
+
* the list to them (a quick filter that already says how many it will leave), and `active`
|
|
7
|
+
* says it is applied: a number that leads somewhere is pressed, as a `Metric` is.
|
|
8
|
+
*/
|
|
9
|
+
export type ListCounter = {
|
|
10
|
+
label: string;
|
|
11
|
+
value: number | string;
|
|
12
|
+
onClick?: () => void;
|
|
13
|
+
active?: boolean;
|
|
14
|
+
/** What the count means — overdue in `bad`. The figure takes it; the label stays muted. */
|
|
15
|
+
tone?: Tone;
|
|
16
|
+
};
|
|
89
17
|
export declare function ListingBar({ actions, title, description, counters, selection, search, pagination, views, crumbs, surface, inline, count, look, }: {
|
|
90
18
|
/** How the bar is drawn: `modern` makes the trail the heading and puts the search on the
|
|
91
19
|
* row of the controls (see the header). The list passes its view style. */
|
|
@@ -98,10 +26,7 @@ export declare function ListingBar({ actions, title, description, counters, sele
|
|
|
98
26
|
description?: string;
|
|
99
27
|
/** The totals per category. The ones in the pagination say how many there
|
|
100
28
|
* are; these say what they are made of, which is another question. */
|
|
101
|
-
counters?: readonly
|
|
102
|
-
label: string;
|
|
103
|
-
value: number | string;
|
|
104
|
-
}[];
|
|
29
|
+
counters?: readonly ListCounter[];
|
|
105
30
|
/** When there are selected rows. It replaces the identity, in the same place. */
|
|
106
31
|
selection?: {
|
|
107
32
|
count: number;
|
|
@@ -134,8 +59,5 @@ export declare function ListingBar({ actions, title, description, counters, sele
|
|
|
134
59
|
export type ListIdentity = {
|
|
135
60
|
title?: string;
|
|
136
61
|
description?: string;
|
|
137
|
-
counters?: readonly
|
|
138
|
-
label: string;
|
|
139
|
-
value: number | string;
|
|
140
|
-
}[];
|
|
62
|
+
counters?: readonly ListCounter[];
|
|
141
63
|
};
|