@jsenv/navi 0.29.376 → 0.29.378

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.
@@ -227,7 +227,9 @@ to start when unsure which export solves a problem.
227
227
  viewport on Chrome Android and miscenters every dialog; `overflow-x: clip`.
228
228
  - `z_index.md` — DOM order first; a `z-index` without `isolation: isolate`
229
229
  competes with the page; navi's bands. Read before writing a `z-index`.
230
- - `typography.md` — text is a component; `maxLines` is the one truncation;
230
+ - `typography.md` — text is a component; `maxLines` is the one truncation
231
+ (never `lineClamp`/`overflowEllipsis`/`text-overflow` by hand), on `Text`
232
+ and its family, a `Picker`'s value, a `Binder`'s tabs, a `BadgeList`'s rows;
231
233
  `attachLastChild`; one line height for everything (`--navi-line-height`,
232
234
  1.25). Read before an overflowing label, and before touching a
233
235
  `line-height`.
@@ -66,9 +66,34 @@ Do **not** write `lineClamp={1}`. `lineClamp` and `overflowEllipsis` are raw
66
66
  is not a `Text` (or deliberately opts out of it) and still needs that CSS. They
67
67
  know nothing about each other, so `lineClamp={1}` gives a single-line webkit box
68
68
  without the single-line handling `maxLines={1}` brings — `maxLines` switches the
69
- element to a block, sets `min-width: 0` on itself, and keeps `white-space`
70
- sensible for the tag it renders (a `<p>` keeps its line breaks). On a `Text`,
71
- `maxLines` is always the right answer.
69
+ element to a block, sets `min-width: 0` on itself, and states the `white-space`
70
+ its line count needs: one line does not wrap, n lines may (a `<p>` keeps its
71
+ line breaks in both cases). That last part is what makes it hold anywhere:
72
+ `white-space` is inherited, and a raw clamp put under a single-line ancestor — a
73
+ `Picker`'s value, a `Time` — inherits `nowrap`, gets one line to cut, and lets
74
+ the text run past its box instead. On a `Text`, `maxLines` is always the right
75
+ answer, and an explicit `noWrap`/`pre`/`preLine` beside it still wins.
76
+
77
+ ### Who takes `maxLines`
78
+
79
+ The prop is the same everywhere: a number of lines, cut with an ellipsis.
80
+
81
+ - **`Text`** and everything built on it — `Title`, `Paragraph`, `Caption`,
82
+ `Link`, `Time`, `Quantity`… — the prop flows through. `Badge` is `maxLines={1}`
83
+ by construction.
84
+ - **`Picker`** — its value, `maxLines={1}` by default; `variant="text"` and
85
+ `variant="bare"` draw the caller's own thing and are not clamped, a `Text` in
86
+ their `ui` cuts itself with its own `maxLines`.
87
+ - **`PickerSpin`** (`DaySpin`, `TimeSpin`…) — its value; left out, a long value
88
+ wraps and the box grows.
89
+ - **`Binder`** — its tab labels, `maxLines={1}` by default, `false` lets them
90
+ wrap; overridable per item.
91
+ - **`BadgeList`** — its rows, measured (a wrapped flex row is not a line box):
92
+ the badges that fit and a "+N" badge for the rest. Inside a `Picker` it
93
+ inherits the picker's count, see [badge_list.md](./badge_list.md).
94
+
95
+ On a plain `Box`, `maxLines` is the raw CSS mapping described above: it clamps
96
+ whatever the box holds, and states nothing else.
72
97
 
73
98
  ### Truncation only happens if something says "you may shrink"
74
99
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jsenv/navi",
3
- "version": "0.29.376",
3
+ "version": "0.29.378",
4
4
  "type": "module",
5
5
  "description": "Library of components including navigation to create frontend applications",
6
6
  "repository": {