@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/dist/tokens.css
CHANGED
|
@@ -268,6 +268,11 @@
|
|
|
268
268
|
obvious `bg-ink/30` is a LIGHT veil in the dark theme (ink flips), which
|
|
269
269
|
would lighten what it is meant to dim. */
|
|
270
270
|
--color-scrim: #1a1714; /* 16.96:1 on the ground — a veil, never text */
|
|
271
|
+
/* A QR is black on white in BOTH themes — not ink on paper: a phone's scanner reads dark
|
|
272
|
+
modules on a light ground, and the dark theme's light ink on a dark surface is a QR half
|
|
273
|
+
the scanners refuse. The dark blocks repeat the SAME two values. */
|
|
274
|
+
--color-qr-ink: #000000; /* a QR's modules · white on top 21.00:1 */
|
|
275
|
+
--color-qr-paper: #ffffff; /* a QR's paper and its quiet zone */
|
|
271
276
|
|
|
272
277
|
/* ---------------------------------------------------------------- *
|
|
273
278
|
* THE TWO FAMILIES — and the rule that decides which one goes.
|
|
@@ -502,6 +507,15 @@
|
|
|
502
507
|
`ListingBar`. */
|
|
503
508
|
--container-search: 30rem;
|
|
504
509
|
|
|
510
|
+
/* How wide the bar's suggestions grow: a «campo : comparación valor» row and its hint, at a
|
|
511
|
+
reading width. Hung from the field's start and as wide as the field below this; a field
|
|
512
|
+
as wide as the page no longer stretches two short rows across it. */
|
|
513
|
+
--container-suggestions: 36rem;
|
|
514
|
+
|
|
515
|
+
/* How wide the notifications open from the bar (`Inbox`): a title and two lines of detail
|
|
516
|
+
at a reading width — and never wider than a phone's screen, where it would hang off it. */
|
|
517
|
+
--container-inbox: min(24rem, calc(100vw - 1rem));
|
|
518
|
+
|
|
505
519
|
/* How wide the cuts panel may grow: filters, grouping and favourites side by side — three
|
|
506
520
|
columns of a facet each — and never wider than the screen, so on a phone the columns
|
|
507
521
|
stack and it reads as a popover. It is the SCREEN that decides, not the field: a list's
|
|
@@ -599,6 +613,32 @@
|
|
|
599
613
|
/* One stage of a board by stages: a card with its name, a tag and a figure, without
|
|
600
614
|
wrapping the name into three lines. Five stages fit a desk; more scroll sideways. */
|
|
601
615
|
--container-lane: 18rem;
|
|
616
|
+
/* …and the widest it grows to when the stages fit the screen: lanes share the width
|
|
617
|
+
instead of leaving a blank on the right, but a lane of three cards stretched to 60rem
|
|
618
|
+
reads as a table with one column. */
|
|
619
|
+
--container-lane-max: 26rem;
|
|
620
|
+
/* The narrowest a tile of a grid gets (a product on a till, an item of a shop) — three
|
|
621
|
+
places, like the controls: a dense back-office grid, a till, a shop window. The grid
|
|
622
|
+
fits as many as the width takes (`--grid-tiles-*`). */
|
|
623
|
+
--container-tile-sm: 8.5rem;
|
|
624
|
+
--container-tile-md: 11rem;
|
|
625
|
+
--container-tile-lg: 15rem;
|
|
626
|
+
--grid-tiles-sm: repeat(auto-fill, minmax(min(100%, var(--container-tile-sm)), 1fr));
|
|
627
|
+
--grid-tiles-md: repeat(auto-fill, minmax(min(100%, var(--container-tile-md)), 1fr));
|
|
628
|
+
--grid-tiles-lg: repeat(auto-fill, minmax(min(100%, var(--container-tile-lg)), 1fr));
|
|
629
|
+
/* A plan card is read whole — name, price, what it includes — so it never gets narrower than
|
|
630
|
+
a short list's width; the plans FILL the row (auto-fit), three side by side on a desk and
|
|
631
|
+
stacked on a phone. See `Plans`. */
|
|
632
|
+
--container-plan: 16rem;
|
|
633
|
+
--grid-plans: repeat(auto-fit, minmax(min(100%, var(--container-plan)), 1fr));
|
|
634
|
+
/* A kiosk's reduced height: the empty band above the flow, so every target sits below
|
|
635
|
+
~120 cm on a standing kiosk — within a seated person's reach (ADA 308). */
|
|
636
|
+
--size-kiosk-reach: 45dvh;
|
|
637
|
+
/* A printed ticket: the width of an 80 mm thermal roll's printable area (72 mm). */
|
|
638
|
+
--container-receipt: 72mm;
|
|
639
|
+
/* A tile's picture: 4:3, the shape a product photo is taken in and the one that keeps two
|
|
640
|
+
lines of name under it on a 11rem tile. */
|
|
641
|
+
--aspect-tile: 4 / 3;
|
|
602
642
|
/* The names column of a timeline (an employee with an avatar, a room, a machine): wide enough
|
|
603
643
|
for «Ammy Shalem Aranibar Zambrana» before it truncates. */
|
|
604
644
|
--container-timeline-label: 15rem;
|
|
@@ -705,6 +745,11 @@
|
|
|
705
745
|
--size-control-md: 36px;
|
|
706
746
|
--size-control-lg: 42px;
|
|
707
747
|
|
|
748
|
+
/* The least a pressable thing answers to, whatever it LOOKS like (`hit-target`): a chip's
|
|
749
|
+
«×» is drawn at 16px so a bar of ten filters stays one line, but it answers to 24px —
|
|
750
|
+
WCAG 2.2's minimum target (2.5.8) — and to 44px under a finger (TOUCH, below). */
|
|
751
|
+
--size-target: 24px;
|
|
752
|
+
|
|
708
753
|
--size-icon-sm: 12px;
|
|
709
754
|
--size-icon-md: 16px;
|
|
710
755
|
--size-icon-lg: 18px;
|
|
@@ -753,6 +798,11 @@
|
|
|
753
798
|
answers in 150ms showed a skeleton for one frame — a flash that says «something broke»
|
|
754
799
|
more than «loading». It waits 200ms invisible, then fades in. */
|
|
755
800
|
--animate-reveal-late: reveal var(--duration-quick) var(--ease-out) 200ms both;
|
|
801
|
+
|
|
802
|
+
/* A chip that lands in the search bar ARRIVES: it grows in from a little smaller while it
|
|
803
|
+
takes its opacity. Something set by Enter — the dropdown closes, the text clears — has to
|
|
804
|
+
be seen landing, or the eye looks for where the question went. Behind `motion-safe:`. */
|
|
805
|
+
--animate-chip-in: chip-in var(--duration-quick) var(--ease-out) both;
|
|
756
806
|
}
|
|
757
807
|
|
|
758
808
|
/* ==================================================================== *
|
|
@@ -815,6 +865,13 @@
|
|
|
815
865
|
|
|
816
866
|
/* A box of content: a block, a card of a list, a metric. */
|
|
817
867
|
--radius-ui-card: var(--ui-card-radius, var(--radius-box));
|
|
868
|
+
/* A RECORD's card — one of many on a board or a grid: the control's corner, not the box's.
|
|
869
|
+
Twelve 12px boxes in a lane read as bubbles, not as records. It falls back to the card's
|
|
870
|
+
knob, so an application that re-skinned its cards re-skins these too. */
|
|
871
|
+
--radius-ui-record-card: var(
|
|
872
|
+
--ui-record-card-radius,
|
|
873
|
+
var(--ui-card-radius, var(--radius-control))
|
|
874
|
+
);
|
|
818
875
|
--color-ui-card: var(--ui-card-bg, var(--color-surface));
|
|
819
876
|
--color-ui-card-border: var(--ui-card-border, var(--color-line));
|
|
820
877
|
|
|
@@ -858,6 +915,15 @@
|
|
|
858
915
|
--shadow-guide-veil: 0 0 0 100vmax currentColor;
|
|
859
916
|
}
|
|
860
917
|
|
|
918
|
+
/* From a third and not from nothing: the chip is THERE from its first frame — read, found by
|
|
919
|
+
whoever looks for it — and the motion only says it just arrived. */
|
|
920
|
+
@keyframes chip-in {
|
|
921
|
+
from {
|
|
922
|
+
opacity: 0.35;
|
|
923
|
+
scale: 0.92;
|
|
924
|
+
}
|
|
925
|
+
}
|
|
926
|
+
|
|
861
927
|
@keyframes reveal {
|
|
862
928
|
from {
|
|
863
929
|
opacity: 0;
|
|
@@ -1009,6 +1075,8 @@
|
|
|
1009
1075
|
--color-chrome-warn: #e3b341; /* 9.75:1 */
|
|
1010
1076
|
--color-chrome-bad: #ff8a7a; /* 8.28:1 */
|
|
1011
1077
|
--color-scrim: #000000; /* 1.16:1 on the ground — a veil, never text */
|
|
1078
|
+
--color-qr-ink: #000000; /* a QR's modules · white on top 21.00:1 */
|
|
1079
|
+
--color-qr-paper: #ffffff; /* a QR's paper and its quiet zone */
|
|
1012
1080
|
--shadow-raised: 0 1px 2px -1px rgba(0, 0, 0, 0.5);
|
|
1013
1081
|
--shadow-float: 0 8px 24px -12px rgba(0, 0, 0, 0.75);
|
|
1014
1082
|
--shadow-window:
|
|
@@ -1080,6 +1148,8 @@
|
|
|
1080
1148
|
--color-chrome-warn: #e3b341; /* 9.75:1 */
|
|
1081
1149
|
--color-chrome-bad: #ff8a7a; /* 8.28:1 */
|
|
1082
1150
|
--color-scrim: #000000; /* 1.16:1 on the ground — a veil, never text */
|
|
1151
|
+
--color-qr-ink: #000000; /* a QR's modules · white on top 21.00:1 */
|
|
1152
|
+
--color-qr-paper: #ffffff; /* a QR's paper and its quiet zone */
|
|
1083
1153
|
--shadow-raised: 0 1px 2px -1px rgba(0, 0, 0, 0.5);
|
|
1084
1154
|
--shadow-float: 0 8px 24px -12px rgba(0, 0, 0, 0.75);
|
|
1085
1155
|
--shadow-window: 0 2px 6px -2px rgba(0, 0, 0, 0.55), 0 18px 40px -20px rgba(0, 0, 0, 0.85);
|
|
@@ -1147,6 +1217,8 @@
|
|
|
1147
1217
|
--color-chrome-warn: #e3b341; /* 8.80:1 */
|
|
1148
1218
|
--color-chrome-bad: #ff8a7a; /* 7.48:1 */
|
|
1149
1219
|
--color-scrim: #1a1714; /* 16.96:1 on the ground — a veil, never text */
|
|
1220
|
+
--color-qr-ink: #000000; /* a QR's modules · white on top 21.00:1 */
|
|
1221
|
+
--color-qr-paper: #ffffff; /* a QR's paper and its quiet zone */
|
|
1150
1222
|
--shadow-raised: 0 1px 2px -1px rgba(26, 23, 20, 0.1);
|
|
1151
1223
|
--shadow-float: 0 8px 24px -12px rgba(26, 23, 20, 0.35);
|
|
1152
1224
|
--shadow-window:
|
|
@@ -1553,12 +1625,65 @@
|
|
|
1553
1625
|
* a desktop browser narrowed to 400 px keeps the mouse sizes, a tablet in
|
|
1554
1626
|
* landscape gets the finger ones. Every component reads these tokens, so
|
|
1555
1627
|
* nothing else has to know about touch.
|
|
1628
|
+
*
|
|
1629
|
+
* ── The application can SAY it (`data-pointer`) ─────────────────────
|
|
1630
|
+
*
|
|
1631
|
+
* The browser answers for the PRIMARY pointer, and a till is a touch monitor
|
|
1632
|
+
* with a mouse plugged in: `pointer: coarse` is false there and the cashier
|
|
1633
|
+
* gets 30 px targets. So the application can decide instead, on `<html>` or
|
|
1634
|
+
* on any zone: `data-pointer="touch"` sizes for a finger whatever the device
|
|
1635
|
+
* says, `data-pointer="fine"` keeps the mouse sizes on a tablet that drives a
|
|
1636
|
+
* back office. Without it, the device decides, as before.
|
|
1637
|
+
*
|
|
1638
|
+
* What is not a size — a control that only shows on hover, a shortcut hint —
|
|
1639
|
+
* asks the same question with the `touch:` variant, so it follows the same
|
|
1640
|
+
* decision.
|
|
1556
1641
|
* ==================================================================== */
|
|
1557
1642
|
@media (pointer: coarse) {
|
|
1558
|
-
:root {
|
|
1643
|
+
:root:not([data-pointer="fine"]) {
|
|
1559
1644
|
--size-control-sm: 44px;
|
|
1560
1645
|
--size-control-md: 44px;
|
|
1561
1646
|
--size-control-lg: 48px;
|
|
1647
|
+
--size-target: 44px;
|
|
1648
|
+
}
|
|
1649
|
+
}
|
|
1650
|
+
[data-pointer="touch"] {
|
|
1651
|
+
--size-control-sm: 44px;
|
|
1652
|
+
--size-control-md: 44px;
|
|
1653
|
+
--size-control-lg: 48px;
|
|
1654
|
+
--size-target: 44px;
|
|
1655
|
+
}
|
|
1656
|
+
:root [data-pointer="fine"] {
|
|
1657
|
+
--size-control-sm: 30px;
|
|
1658
|
+
--size-control-md: 36px;
|
|
1659
|
+
--size-control-lg: 42px;
|
|
1660
|
+
--size-target: 24px;
|
|
1661
|
+
}
|
|
1662
|
+
|
|
1663
|
+
/* `touch:` — under a finger, by the device or by the application's word. */
|
|
1664
|
+
@custom-variant touch {
|
|
1665
|
+
@media (pointer: coarse) {
|
|
1666
|
+
&:not(:where([data-pointer="fine"], [data-pointer="fine"] *)) {
|
|
1667
|
+
@slot;
|
|
1668
|
+
}
|
|
1669
|
+
}
|
|
1670
|
+
&:where([data-pointer="touch"], [data-pointer="touch"] *) {
|
|
1671
|
+
@slot;
|
|
1672
|
+
}
|
|
1673
|
+
}
|
|
1674
|
+
|
|
1675
|
+
/* A pressable thing drawn smaller than a finger answers to `--size-target` around its
|
|
1676
|
+
centre: the drawing stays (a bar of chips stays one line), the target grows. */
|
|
1677
|
+
@utility hit-target {
|
|
1678
|
+
position: relative;
|
|
1679
|
+
&::after {
|
|
1680
|
+
content: "";
|
|
1681
|
+
position: absolute;
|
|
1682
|
+
top: 50%;
|
|
1683
|
+
left: 50%;
|
|
1684
|
+
width: max(100%, var(--size-target));
|
|
1685
|
+
height: max(100%, var(--size-target));
|
|
1686
|
+
transform: translate(-50%, -50%);
|
|
1562
1687
|
}
|
|
1563
1688
|
}
|
|
1564
1689
|
|
|
@@ -57,6 +57,15 @@ type BoardProps<T> = {
|
|
|
57
57
|
/** One column per stage, with drag (and Alt + ← / →) to move a card between them. */
|
|
58
58
|
stages?: BoardStages<T>;
|
|
59
59
|
};
|
|
60
|
+
/** The TILES: a grid of `RecordCard layout="tile"` — a till's products, a shop's items.
|
|
61
|
+
* Without `card`, the tile comes from what `List.Rows` says (name, meta, chips). */
|
|
62
|
+
type TilesProps<T> = {
|
|
63
|
+
/** `ways` carries the list's rule of what a press does — call `ways.press` from the tile. */
|
|
64
|
+
card?: (item: T, ways: CardWays) => ReactNode;
|
|
65
|
+
/** How wide a tile gets at least — `sm` a dense back office, `md` a till, `lg` a shop's
|
|
66
|
+
* storefront. The grid fits as many as the width takes. */
|
|
67
|
+
size?: "sm" | "md" | "lg";
|
|
68
|
+
};
|
|
60
69
|
/** The sheet. Without columns of its own, it comes from those `List.Table` declared — the
|
|
61
70
|
* one for RAW data does bring them, because there they come from the file and the code does not know
|
|
62
71
|
* which they are. */
|
|
@@ -155,9 +164,11 @@ export declare namespace List {
|
|
|
155
164
|
var Pagination: ((props: NodeProps) => ReactNode) & import("../../foundations/slots.js").Slotted<"pagination">;
|
|
156
165
|
var Views: ((props: NodeProps) => ReactNode) & import("../../foundations/slots.js").Slotted<"views">;
|
|
157
166
|
var Metrics: ((props: NodeProps) => ReactNode) & import("../../foundations/slots.js").Slotted<"metrics">;
|
|
167
|
+
var Filters: ((props: NodeProps) => ReactNode) & import("../../foundations/slots.js").Slotted<"filters">;
|
|
158
168
|
var Rows: <T>(props: RowsProps<T>) => ReactNode;
|
|
159
169
|
var Table: <T extends object>(props: TableProps<T>) => ReactNode;
|
|
160
170
|
var Board: <T>(props: BoardProps<T>) => ReactNode;
|
|
171
|
+
var Tiles: <T>(props: TilesProps<T>) => ReactNode;
|
|
161
172
|
var Sheet: <T>(props: SheetProps<T>) => ReactNode;
|
|
162
173
|
var Report: ((props: ListReport) => ReactNode) & import("../../foundations/slots.js").Slotted<"report">;
|
|
163
174
|
var Pivot: <T>(props: ListPivot<T>) => ReactNode;
|
package/dist/views/list/List.js
CHANGED
|
@@ -23,11 +23,16 @@ const Views = slot("views", (_props) => null);
|
|
|
23
23
|
/** The metrics that also NARROW: «2 por confirmar». They go below the bar and
|
|
24
24
|
* above the rows, because they belong to the set and not to the frame. */
|
|
25
25
|
const Metrics = slot("metrics", (_props) => null);
|
|
26
|
+
/** The QUICK filters: the few cuts changed all day — a category, a state — always in sight
|
|
27
|
+
* under the bar instead of behind the search's panel. Usually a `Tags size="md"` with
|
|
28
|
+
* `selected` and `count`; under a finger they are the way a till or a shop narrows. */
|
|
29
|
+
const Filters = slot("filters", (_props) => null);
|
|
26
30
|
const Rows = slot("rows", (_props) => null);
|
|
27
31
|
/* Through `unknown`: `create` both receives and hands back a `T` (`onChange`, `draft`),
|
|
28
32
|
so `TableProps` is invariant in `T` and `TableProps<never>` no longer narrows to it. The
|
|
29
33
|
slot only carries the props; `List` reads them back typed against the list's `T`. */
|
|
30
34
|
const TableSlot = slot("table", (_props) => null);
|
|
35
|
+
const Tiles = slot("tiles", (_props) => null);
|
|
31
36
|
const Board = slot("board", (_props) => null);
|
|
32
37
|
const SheetSlot = slot("sheet", (_props) => null);
|
|
33
38
|
const Report = slot("report", (_props) => null);
|
|
@@ -42,6 +47,7 @@ const PRESENT_OF = {
|
|
|
42
47
|
rows: "rows",
|
|
43
48
|
table: "table",
|
|
44
49
|
board: "board",
|
|
50
|
+
tiles: "tiles",
|
|
45
51
|
sheet: "sheet",
|
|
46
52
|
report: "report",
|
|
47
53
|
pivot: "pivot",
|
|
@@ -54,6 +60,7 @@ const FACES = [
|
|
|
54
60
|
"rows",
|
|
55
61
|
"table",
|
|
56
62
|
"board",
|
|
63
|
+
"tiles",
|
|
57
64
|
"sheet",
|
|
58
65
|
"report",
|
|
59
66
|
"pivot",
|
|
@@ -99,9 +106,11 @@ export function List({ items, keyOf, embedded, surface, group, selection: select
|
|
|
99
106
|
const pagination = propsOf(pick(bar, "pagination"))?.children;
|
|
100
107
|
const views = propsOf(pick(bar, "views"))?.children;
|
|
101
108
|
const metrics = propsOf(pick(top, "metrics"))?.children;
|
|
109
|
+
const filters = propsOf(pick(top, "filters"))?.children;
|
|
102
110
|
const rows = propsOf(pick(top, "rows"));
|
|
103
111
|
const table = propsOf(pick(top, "table"));
|
|
104
112
|
const board = propsOf(pick(top, "board"));
|
|
113
|
+
const tiles = propsOf(pick(top, "tiles"));
|
|
105
114
|
const sheet = propsOf(pick(top, "sheet"));
|
|
106
115
|
const report = propsOf(pick(top, "report"));
|
|
107
116
|
const pivot = propsOf(pick(top, "pivot"));
|
|
@@ -122,7 +131,7 @@ export function List({ items, keyOf, embedded, surface, group, selection: select
|
|
|
122
131
|
});
|
|
123
132
|
/* The escape hatch: what the archetype did not foresee is drawn anyway, below.
|
|
124
133
|
Something showing up here is the sign that the archetype is missing a piece. */
|
|
125
|
-
const rest = loose(top, ["bar", "metrics", "present", ...FACES]);
|
|
134
|
+
const rest = loose(top, ["bar", "metrics", "filters", "present", ...FACES]);
|
|
126
135
|
return (_jsx(ListView, { items: items, keyOf: keyOf, row: rows === undefined
|
|
127
136
|
? () => ({ name: "" })
|
|
128
137
|
: readOnly
|
|
@@ -130,7 +139,7 @@ export function List({ items, keyOf, embedded, surface, group, selection: select
|
|
|
130
139
|
const { actions: _actions, ...rest } = rows.row(item);
|
|
131
140
|
return rest;
|
|
132
141
|
}
|
|
133
|
-
: rows.row, ...(rows?.header === undefined ? {} : { rowHeader: rows.header }), ...(identity === undefined ? {} : { identity }), ...(crumbs === undefined ? {} : { crumbs }), ...(embedded === undefined ? {} : { embedded }), ...(surface === undefined ? {} : { surface }), ...(search === undefined ? {} : { search }), ...(actions === undefined ? {} : { actions }), ...(dock === undefined || readOnly ? {} : { dock }), ...(pagination === undefined ? {} : { pagination }), ...(views === undefined ? {} : { views }), ...(metrics === undefined ? {} : { metrics }), ...(table === undefined
|
|
142
|
+
: rows.row, ...(rows?.header === undefined ? {} : { rowHeader: rows.header }), ...(identity === undefined ? {} : { identity }), ...(crumbs === undefined ? {} : { crumbs }), ...(embedded === undefined ? {} : { embedded }), ...(surface === undefined ? {} : { surface }), ...(search === undefined ? {} : { search }), ...(actions === undefined ? {} : { actions }), ...(dock === undefined || readOnly ? {} : { dock }), ...(pagination === undefined ? {} : { pagination }), ...(views === undefined ? {} : { views }), ...(metrics === undefined ? {} : { metrics }), ...(filters === undefined ? {} : { filters }), ...(table === undefined
|
|
134
143
|
? {}
|
|
135
144
|
: {
|
|
136
145
|
/* Read-only: a cell that opens an editor is an action too. */
|
|
@@ -148,7 +157,7 @@ export function List({ items, keyOf, embedded, surface, group, selection: select
|
|
|
148
157
|
...(table.onVisibleColumnIdsChange === undefined
|
|
149
158
|
? {}
|
|
150
159
|
: { onVisibleColumnIdsChange: table.onVisibleColumnIdsChange }),
|
|
151
|
-
}), ...(board?.card === undefined ? {} : { card: board.card }), ...(board?.stages === undefined ? {} : { boardStages: board.stages }), ...(sheet?.columns === undefined || sheet.cell === undefined
|
|
160
|
+
}), ...(board?.card === undefined ? {} : { card: board.card }), ...(board?.stages === undefined ? {} : { boardStages: board.stages }), ...(tiles === undefined ? {} : { tiles }), ...(sheet?.columns === undefined || sheet.cell === undefined
|
|
152
161
|
? {}
|
|
153
162
|
: { sheet: sheet }), ...(report === undefined ? {} : { report }), ...(pivot === undefined ? {} : { pivot }), ...(chart === undefined ? {} : { chart }), ...(calendar === undefined ? {} : { calendar }), ...(gantt === undefined ? {} : { gantt }), ...(timeline === undefined ? {} : { timeline }), ...(faces.length === 0 ? {} : { faces }), ...(presents.length === 0 ? {} : { presents }), ...(present === undefined
|
|
154
163
|
? presents[0] === undefined
|
|
@@ -165,9 +174,11 @@ List.Dock = Dock;
|
|
|
165
174
|
List.Pagination = Pagination;
|
|
166
175
|
List.Views = Views;
|
|
167
176
|
List.Metrics = Metrics;
|
|
177
|
+
List.Filters = Filters;
|
|
168
178
|
List.Rows = Rows;
|
|
169
179
|
List.Table = TableSlot;
|
|
170
180
|
List.Board = Board;
|
|
181
|
+
List.Tiles = Tiles;
|
|
171
182
|
List.Sheet = SheetSlot;
|
|
172
183
|
List.Report = Report;
|
|
173
184
|
List.Pivot = Pivot;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ListViewProps } from "./types.js";
|
|
2
|
-
export declare function ListView<T extends object>({ items, keyOf, identity, crumbs, embedded, surface: requestedSurface, metrics, search, pagination, views, actions: written, dock, row, rowHeader, columns, visibleColumnIds, onVisibleColumnIdsChange, card, boardStages, calendar, gantt, timeline, sheet, report, pivot, chart, faces, present: requested, presents, onPresentChange, sort, onSortChange, sortable, totals, rowActions, create, group, selection, onOpen, onPeek, openTargets, onOpenIn, rowClick, onChoose, state, filtered, empty, children, }: ListViewProps<T>): import("react").JSX.Element;
|
|
2
|
+
export declare function ListView<T extends object>({ items, keyOf, identity, crumbs, embedded, surface: requestedSurface, metrics, filters, search, pagination, views, actions: written, dock, row, rowHeader, columns, visibleColumnIds, onVisibleColumnIdsChange, card, tiles, boardStages, calendar, gantt, timeline, sheet, report, pivot, chart, faces, present: requested, presents, onPresentChange, sort, onSortChange, sortable, totals, rowActions, create, group, selection, onOpen, onPeek, openTargets, onOpenIn, rowClick, onChoose, state, filtered, empty, children, }: ListViewProps<T>): import("react").JSX.Element;
|
|
3
3
|
/** What a list offers when it fails and can be retried. */
|
|
4
4
|
export declare function RetryAction({ onRetry }: {
|
|
5
5
|
onRetry: () => void;
|
|
@@ -30,7 +30,7 @@ import { groupLevelsOf, reportColumnsOf, reportRowsOf, sheetFromColumns, sheetRo
|
|
|
30
30
|
import { SheetPresentation, TablePresentation, } from "./presentations.js";
|
|
31
31
|
import { useNarrowList } from "./useNarrowList.js";
|
|
32
32
|
import { useReachBottom } from "./useReachBottom.js";
|
|
33
|
-
import { CalendarDays, CalendarRange, ChartColumnBig, ChartGantt, Grid3x3, LayoutGrid, List, Sheet, Sigma, Table2, X, } from "lucide-react";
|
|
33
|
+
import { CalendarDays, CalendarRange, ChartColumnBig, ChartGantt, Grid3x3, LayoutGrid, List, Sheet, Sigma, SquareKanban, Table2, X, } from "lucide-react";
|
|
34
34
|
import { Fragment, lazy, Suspense, useCallback, useEffect, useMemo, } from "react";
|
|
35
35
|
import { createPortal } from "react-dom";
|
|
36
36
|
/* The calendar (FullCalendar) and the gantt (SVAR) are each about a third of a list's weight,
|
|
@@ -75,7 +75,8 @@ const ChartExplorer = lazy(() => import("../../components/listing/ChartExplorer.
|
|
|
75
75
|
const PRESENT_ICONS = [
|
|
76
76
|
{ id: "rows", icon: List },
|
|
77
77
|
{ id: "table", icon: Table2 },
|
|
78
|
-
{ id: "board", icon:
|
|
78
|
+
{ id: "board", icon: SquareKanban },
|
|
79
|
+
{ id: "tiles", icon: LayoutGrid },
|
|
79
80
|
{ id: "sheet", icon: Sheet },
|
|
80
81
|
/* The sigma and not a table icon: what sets a report apart from the other
|
|
81
82
|
four is that it SUMS. */
|
|
@@ -88,7 +89,7 @@ const PRESENT_ICONS = [
|
|
|
88
89
|
{ id: "gantt", icon: ChartGantt },
|
|
89
90
|
{ id: "timeline", icon: CalendarRange },
|
|
90
91
|
];
|
|
91
|
-
export function ListView({ items, keyOf, identity, crumbs, embedded = false, surface: requestedSurface, metrics, search, pagination, views, actions: written, dock, row, rowHeader, columns, visibleColumnIds, onVisibleColumnIdsChange, card, boardStages, calendar, gantt, timeline, sheet, report, pivot, chart, faces, present: requested = "rows", presents, onPresentChange, sort, onSortChange, sortable, totals = false, rowActions, create, group, selection, onOpen, onPeek, openTargets, onOpenIn, rowClick = "peek", onChoose, state, filtered = false, empty, children, }) {
|
|
92
|
+
export function ListView({ items, keyOf, identity, crumbs, embedded = false, surface: requestedSurface, metrics, filters, search, pagination, views, actions: written, dock, row, rowHeader, columns, visibleColumnIds, onVisibleColumnIdsChange, card, tiles, boardStages, calendar, gantt, timeline, sheet, report, pivot, chart, faces, present: requested = "rows", presents, onPresentChange, sort, onSortChange, sortable, totals = false, rowActions, create, group, selection, onOpen, onPeek, openTargets, onOpenIn, rowClick = "peek", onChoose, state, filtered = false, empty, children, }) {
|
|
92
93
|
const wide = useMemo(() => [
|
|
93
94
|
...WIDE_PRESENTS,
|
|
94
95
|
...(faces ?? []).filter((f) => f.wide === true).map((f) => f.id),
|
|
@@ -241,9 +242,22 @@ export function ListView({ items, keyOf, identity, crumbs, embedded = false, sur
|
|
|
241
242
|
/* THE COUNTERS, in the modern style, are mini stats under the bar — with the metrics, where a
|
|
242
243
|
list's numbers are read —, not words beside its trail, where they read as more crumbs. */
|
|
243
244
|
const statsBelow = modern && !embedded && density === "comfortable" && identity?.counters !== undefined;
|
|
244
|
-
const counterStats = !statsBelow || identity?.counters === undefined ? undefined : (_jsx(Metrics, { children: identity.counters.map((c) => (_jsx(Metric, { value: c.value, label: c.label }
|
|
245
|
-
|
|
246
|
-
|
|
245
|
+
const counterStats = !statsBelow || identity?.counters === undefined ? undefined : (_jsx(Metrics, { children: identity.counters.map((c) => (_jsx(Metric, { value: c.value, label: c.label, ...(c.tone === undefined ? {} : { tone: c.tone }), ...(c.onClick === undefined
|
|
246
|
+
? {}
|
|
247
|
+
: { onClick: c.onClick, active: c.active === true }) }, c.label))) }));
|
|
248
|
+
/* Under the bar, in the order they are used: the quick filters (what I narrow by), then
|
|
249
|
+
the counters and the metrics (what the set is made of). */
|
|
250
|
+
const statParts = [filters, counterStats, metrics].filter((part) => part !== undefined && part !== null);
|
|
251
|
+
const stats = statParts.length === 0 ? undefined : statParts.length === 1 ? (statParts[0]) : (_jsx("div", { className: "flex min-w-0 flex-col gap-2", children: statParts.map((part, at) => (_jsx(Fragment, { children: part }, at))) }));
|
|
252
|
+
/* A trail of ONE crumb that says the title — the module's root list — is the title said twice
|
|
253
|
+
in the traditional bar: «Facturas» small on the search's row and «Facturas» as the heading
|
|
254
|
+
below (UX-AUDIT §1, finding 3). The modern bar keeps it: there the crumb IS the heading. */
|
|
255
|
+
const soleCrumbIsTitle = viewStyle !== "modern" && crumbs?.length === 1 && crumbs[0]?.label === identity?.title;
|
|
256
|
+
const bar = !barHasControls ? undefined : (_jsx(ListingBar, { surface: surface, look: viewStyle, ...(embedded ? { inline: true, count: items.length } : {}), ...(embedded ||
|
|
257
|
+
crumbs === undefined ||
|
|
258
|
+
crumbs.length === 0 ||
|
|
259
|
+
density === "compact" ||
|
|
260
|
+
soleCrumbIsTitle
|
|
247
261
|
? {}
|
|
248
262
|
: {
|
|
249
263
|
crumbs: (_jsx(Breadcrumb, { crumbs: crumbs, size: viewStyle === "modern" ? "lg" : "md", ...(surface === undefined ? {} : { surface }) })),
|
|
@@ -377,6 +391,20 @@ export function ListView({ items, keyOf, identity, crumbs, embedded = false, sur
|
|
|
377
391
|
const d = row(item);
|
|
378
392
|
return (_jsx(RecordCard, { title: d.name, ...(d.tags === undefined ? {} : { tags: d.tags }), ...(d.meta === undefined ? {} : { meta: d.meta }), ...(press === undefined ? {} : { onOpen: () => press(item) }) }, keyOf(item)));
|
|
379
393
|
};
|
|
394
|
+
/* A tile is a card in its tile shape: the picture on top, pressed whole. Without a `card` of
|
|
395
|
+
its own, it is told by the row — its name, its meta, its chips, its icon. */
|
|
396
|
+
const renderTile = (item) => {
|
|
397
|
+
if (tiles?.card !== undefined) {
|
|
398
|
+
return _jsx(Fragment, { children: tiles.card(item, waysOf(item)) }, keyOf(item));
|
|
399
|
+
}
|
|
400
|
+
const d = row(item);
|
|
401
|
+
return (_jsx(RecordCard, { layout: "tile", title: d.name, ...(d.tags === undefined ? {} : { tags: d.tags }), ...(d.meta === undefined ? {} : { meta: d.meta }), ...(d.icon === undefined ? {} : { media: { icon: d.icon } }), ...(press === undefined ? {} : { onOpen: () => press(item) }) }, keyOf(item)));
|
|
402
|
+
};
|
|
403
|
+
const TILE_GRID = {
|
|
404
|
+
sm: "grid-cols-(--grid-tiles-sm)",
|
|
405
|
+
md: "grid-cols-(--grid-tiles-md)",
|
|
406
|
+
lg: "grid-cols-(--grid-tiles-lg)",
|
|
407
|
+
};
|
|
380
408
|
const body = face !== undefined ? (face.render({
|
|
381
409
|
items: ordered,
|
|
382
410
|
keyOf,
|
|
@@ -444,7 +472,7 @@ export function ListView({ items, keyOf, identity, crumbs, embedded = false, sur
|
|
|
444
472
|
? {}
|
|
445
473
|
: { defaultMeasures: chart.defaultMeasures }), ...(chart.stacked === undefined ? {} : { defaultStacked: chart.stacked }), ...(chart.cumulative === undefined
|
|
446
474
|
? {}
|
|
447
|
-
: { defaultCumulative: chart.cumulative }), ...(chart.order === undefined ? {} : { defaultOrder: chart.order }), ...(chart.compare === undefined ? {} : { compare: chart.compare }), ...((group?.levels.length ?? 0) > 0 ? { levels: group.levels } : {}), ...(chart.onPoint === undefined ? {} : { onPoint: chart.onPoint }), ...(chart.height === undefined ? {} : { height: chart.height }), ...(chart.fileName === undefined ? {} : { fileName: chart.fileName }), ...(identity?.title === undefined ? {} : { label: identity.title }) }) }) })) : present === "calendar" && calendar !== undefined ? (_jsx("div", { className: "p-3", children: _jsx(Suspense, { fallback: _jsx(Skeleton, { label: copy.failed.loading }), children: _jsx(RecordCalendar, { ...calendar, items: ordered, keyOf: keyOf, ...(press === undefined ? {} : { onOpen: press }) }) }) })) : present === "gantt" && gantt !== undefined ? (_jsx("div", { className: "p-3", children: _jsx(Suspense, { fallback: _jsx(Skeleton, { label: copy.failed.loading }), children: _jsx(RecordGantt, { ...gantt, items: ordered, keyOf: keyOf, ...(press === undefined ? {} : { onOpen: press }) }) }) })) : present === "timeline" && timeline !== undefined ? (_jsx("div", { className: "p-3", children: _jsx(RecordTimeline, { ...timeline, items: ordered, keyOf: keyOf, ...(press === undefined ? {} : { onOpen: press }) }) })) : present === "board" && boardStages !== undefined ? (_jsx(BoardColumns, { items: ordered, keyOf: keyOf, stages: boardStages, card: renderCard })) : present === "board" ? (_jsx("div", { className: "flex flex-col", children: wrapGroups((inside) => (_jsx("div", { className: "grid gap-3 p-3 @2xl:grid-cols-2 @5xl:grid-cols-3", children: inside.map(renderCard) }))) })) : (
|
|
475
|
+
: { defaultCumulative: chart.cumulative }), ...(chart.order === undefined ? {} : { defaultOrder: chart.order }), ...(chart.compare === undefined ? {} : { compare: chart.compare }), ...((group?.levels.length ?? 0) > 0 ? { levels: group.levels } : {}), ...(chart.onPoint === undefined ? {} : { onPoint: chart.onPoint }), ...(chart.height === undefined ? {} : { height: chart.height }), ...(chart.fileName === undefined ? {} : { fileName: chart.fileName }), ...(identity?.title === undefined ? {} : { label: identity.title }) }) }) })) : present === "calendar" && calendar !== undefined ? (_jsx("div", { className: "p-3", children: _jsx(Suspense, { fallback: _jsx(Skeleton, { label: copy.failed.loading }), children: _jsx(RecordCalendar, { ...calendar, items: ordered, keyOf: keyOf, ...(press === undefined ? {} : { onOpen: press }) }) }) })) : present === "gantt" && gantt !== undefined ? (_jsx("div", { className: "p-3", children: _jsx(Suspense, { fallback: _jsx(Skeleton, { label: copy.failed.loading }), children: _jsx(RecordGantt, { ...gantt, items: ordered, keyOf: keyOf, ...(press === undefined ? {} : { onOpen: press }) }) }) })) : present === "timeline" && timeline !== undefined ? (_jsx("div", { className: "p-3", children: _jsx(RecordTimeline, { ...timeline, items: ordered, keyOf: keyOf, ...(press === undefined ? {} : { onOpen: press }) }) })) : present === "tiles" ? (_jsx("div", { className: "flex flex-col", children: wrapGroups((inside) => (_jsx("div", { "data-ui": "list.tiles", className: `grid gap-3 p-3 ${TILE_GRID[tiles?.size ?? "md"]}`, children: inside.map(renderTile) }))) })) : present === "board" && boardStages !== undefined ? (_jsx(BoardColumns, { items: ordered, keyOf: keyOf, stages: boardStages, card: renderCard })) : present === "board" ? (_jsx("div", { className: "flex flex-col", children: wrapGroups((inside) => (_jsx("div", { className: "grid gap-3 p-3 @2xl:grid-cols-2 @5xl:grid-cols-3", children: inside.map(renderCard) }))) })) : (
|
|
448
476
|
/* The header goes BEFORE the buckets and not inside each one:
|
|
449
477
|
it labels the row, and the row is the same in all five buckets. */
|
|
450
478
|
_jsxs(_Fragment, { children: [rowHeader === undefined || items.length === 0 ? null : (_jsx(RowHeader, { name: rowHeader.name, ...(rowHeader.meta === undefined ? {} : { meta: rowHeader.meta }), ...(rowHeader.tags === undefined ? {} : { tags: rowHeader.tags }), withSelection: selection !== undefined,
|
|
@@ -471,9 +499,20 @@ export function ListView({ items, keyOf, identity, crumbs, embedded = false, sur
|
|
|
471
499
|
? {}
|
|
472
500
|
: {
|
|
473
501
|
metrics: _jsx("div", { className: "px-3.5", children: stats }),
|
|
474
|
-
}), children: [loading ? _jsx(Skeleton, { label: copy.failed.loading
|
|
502
|
+
}), children: [loading ? (_jsx(Skeleton, { label: copy.failed.loading, shape: present === "tiles"
|
|
503
|
+
? "tiles"
|
|
504
|
+
: present === "board"
|
|
505
|
+
? "board"
|
|
506
|
+
: present === "table" || present === "sheet"
|
|
507
|
+
? "table"
|
|
508
|
+
: "rows" })) : null, isEmpty ? (filtered ? (_jsx(Empty, { ...empty?.whenFiltered, sentence: empty?.whenFiltered?.sentence ?? copy.list.emptyFiltered })) : (_jsx(Empty, { ...(empty === undefined
|
|
475
509
|
? {}
|
|
476
|
-
: {
|
|
510
|
+
: {
|
|
511
|
+
action: empty.action,
|
|
512
|
+
title: empty.title,
|
|
513
|
+
icon: empty.icon,
|
|
514
|
+
illustration: empty.illustration,
|
|
515
|
+
}), sentence: empty?.sentence ?? copy.list.empty }))) : null, _jsxs("div", { className: "relative min-w-0", children: [refreshing ? (
|
|
477
516
|
/* Over the top edge of the rows, not above them: the rows do not move. */
|
|
478
517
|
_jsx("div", { className: "pointer-events-none absolute inset-x-0 top-0 z-20", children: _jsx(ProgressBar, { label: copy.list.refreshing, width: "w-full" }) })) : null, loading || isEmpty ? null : body] })] }), error === null ? null : (_jsx("div", { className: "px-3 pt-(--spacing-block)", children: _jsx(Failed, { heading: copy.failed.list, sentence: error }) })), floating, children] }));
|
|
479
518
|
}
|
|
@@ -113,12 +113,20 @@ export type ListCrumb = {
|
|
|
113
113
|
export type ListEmpty = {
|
|
114
114
|
sentence: string;
|
|
115
115
|
action?: ReactNode;
|
|
116
|
+
/** The empty that IS the screen — a title, and an icon or the application's illustration
|
|
117
|
+
* (`Empty`'s). Without them it is the quiet sentence. */
|
|
118
|
+
title?: string;
|
|
119
|
+
icon?: LucideIcon;
|
|
120
|
+
illustration?: ReactNode;
|
|
116
121
|
/** Empty because of a filter is ANOTHER situation: content is not missing,
|
|
117
122
|
* there is an extra narrowing. Telling «importá tus facturas» to someone who has 180
|
|
118
123
|
* and mistyped a name is answering a different question. */
|
|
119
124
|
whenFiltered?: {
|
|
120
125
|
sentence: string;
|
|
121
126
|
action?: ReactNode;
|
|
127
|
+
title?: string;
|
|
128
|
+
icon?: LucideIcon;
|
|
129
|
+
illustration?: ReactNode;
|
|
122
130
|
};
|
|
123
131
|
};
|
|
124
132
|
/**
|
|
@@ -307,6 +315,8 @@ export type ListViewProps<T extends object> = {
|
|
|
307
315
|
/** The metrics that also NARROW: «2 por confirmar», «41 por entregar». They go
|
|
308
316
|
* below the bar and above the rows — they belong to the set, not to the frame. */
|
|
309
317
|
metrics?: ReactNode;
|
|
318
|
+
/** The quick filters (`List.Filters`): a row under the bar, before the metrics. */
|
|
319
|
+
filters?: ReactNode;
|
|
310
320
|
/** The list is a FIELD of a record (a one2many / many2many) and not a screen: the bar
|
|
311
321
|
* is one line — search, count, sort, columns, switcher, actions —, it does not stick
|
|
312
322
|
* and it does not move into the frame's header. Identity and crumbs are not drawn: the
|
|
@@ -374,6 +384,11 @@ export type ListViewProps<T extends object> = {
|
|
|
374
384
|
card?: (item: T, ways: CardWays) => ReactNode;
|
|
375
385
|
/** The board by stages: one column each, cards moved between them. */
|
|
376
386
|
boardStages?: BoardStages<T>;
|
|
387
|
+
/** The tiles presentation: a grid of tiles, and the tile of one record. */
|
|
388
|
+
tiles?: {
|
|
389
|
+
card?: (item: T, ways: CardWays) => ReactNode;
|
|
390
|
+
size?: "sm" | "md" | "lg";
|
|
391
|
+
};
|
|
377
392
|
/** The calendar presentation: when each record happens. */
|
|
378
393
|
calendar?: ListCalendar<T>;
|
|
379
394
|
/** The Gantt presentation: each record as a span on a timeline. */
|
|
@@ -194,7 +194,7 @@ export function Record({ identity, error = null, dirty, placement, look: ownLook
|
|
|
194
194
|
shorter than the screen. The extra height has no paint of its own: on a desk
|
|
195
195
|
nothing changes. */
|
|
196
196
|
/* The record knows the notes of its fields and rows: their cards register here. */
|
|
197
|
-
_jsx(NoteRegistryContext, { value: registry, children: _jsx("article", { className: "flex min-w-0 flex-1 flex-col", children: _jsx(NotebookScope, { tabs: tabs.length > 0, children: _jsx(RecordHeader, { railSurface: surface, ...(placement === undefined ? {} : { paper: placement === "page" }), ...(ribbon === undefined
|
|
197
|
+
_jsx(NoteRegistryContext, { value: registry, children: _jsx("article", { className: "isolate flex min-w-0 flex-1 flex-col", children: _jsx(NotebookScope, { tabs: tabs.length > 0, children: _jsx(RecordHeader, { railSurface: surface, ...(placement === undefined ? {} : { paper: placement === "page" }), ...(ribbon === undefined
|
|
198
198
|
? {}
|
|
199
199
|
: {
|
|
200
200
|
ribbon: (_jsx(RecordRibbon, { label: ribbon.label, ...(ribbon.tone === undefined ? {} : { tone: ribbon.tone }) })),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sincpro/web-ui",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.14.0",
|
|
4
4
|
"description": "An enterprise web design system for business software — ERPs, back offices, management tools — in React and Tailwind: tokens, primitives, components and the two views every management screen is made of.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -75,7 +75,8 @@
|
|
|
75
75
|
"streamdown": "^2.7.1",
|
|
76
76
|
"tailwind-variants": "^4.0.0",
|
|
77
77
|
"tailwindcss-react-aria-components": "^2.2.0",
|
|
78
|
-
"temporal-polyfill": "^1.0.6"
|
|
78
|
+
"temporal-polyfill": "^1.0.6",
|
|
79
|
+
"uqr": "^0.1.3"
|
|
79
80
|
},
|
|
80
81
|
"devDependencies": {
|
|
81
82
|
"@eslint/js": "^10.0.1",
|