@jsenv/navi 0.29.345 → 0.29.347

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.
@@ -50776,9 +50776,15 @@ const COMMAND_DEFAULT_PROPS_FACTORIES = {
50776
50776
  * drawn — must still close it. What `<Link pressableDuringRouteTransition>`
50777
50777
  * says, for the other half of a toggle. Only for a control that does not
50778
50778
  * travel with the pages.
50779
- * @param {Function} [action] On a button with an `href` or a `route`, the
50780
- * same order as a Link's: it runs on the press, before the navigation, and
50781
- * the navigation does not wait for it (see Link's `action`).
50779
+ * @param {Function} [action] What the press runs: a button holds no value, so
50780
+ * every press is one call. The button is busy while it runs, refuses a second
50781
+ * press and draws the error on itself. On a button with an `href` or a
50782
+ * `route`, the same order as a Link's: it runs on the press, before the
50783
+ * navigation, and the navigation does not wait for it (see Link's `action`).
50784
+ * @param {Function} [uiAction] The same press, for what cannot fail and takes
50785
+ * no time — moving something else on screen, writing a local signal: a plain
50786
+ * callback, no busy state, nothing drawn if it throws (see
50787
+ * docs/actions.md#action-or-uiaction).
50782
50788
  * @param {string} [selfInteractions] The interactions this button takes for
50783
50789
  * itself inside a zone that belongs to another control — a chip's cross on a
50784
50790
  * picker's façade, an eye on a pressable row, a badge against the edge of a
@@ -68486,6 +68492,7 @@ const useListScrollSync = ({
68486
68492
  };
68487
68493
  useLayoutEffect(resolveScroller);
68488
68494
  useStickyScrollportWarning(ref, scroller);
68495
+ useDuplicateHeaderWarning(ref);
68489
68496
  useStuckWindowWarning({
68490
68497
  ref,
68491
68498
  scrollerElResolved,
@@ -69508,6 +69515,34 @@ const useStickyScrollportWarning = (ref, scroller) => {
69508
69515
  });
69509
69516
  });
69510
69517
  };
69518
+ // A list has one header: the row that caps it — the column row of a table —
69519
+ // and the box the list measures to keep the others from scrolling under it. A
69520
+ // second one takes that same place, so both sit at the capped edge before
69521
+ // every row and the rows declared between them read as belonging to the last:
69522
+ // a title meant to open a run of rows ends up titling nothing. That title is a
69523
+ // group label, which is why this points at List.Group rather than at the
69524
+ // stacking.
69525
+ const useDuplicateHeaderWarning = ref => {
69526
+ const doneRef = useRef(false);
69527
+ useLayoutEffect(() => {
69528
+ if (doneRef.current) {
69529
+ return;
69530
+ }
69531
+ const listContainerEl = ref.current;
69532
+ if (!listContainerEl) {
69533
+ return;
69534
+ }
69535
+ const headerEls = listContainerEl.querySelectorAll(".navi_list_item_header");
69536
+ if (headerEls.length < 2) {
69537
+ return;
69538
+ }
69539
+ doneRef.current = true;
69540
+ console.warn(`<List> has ${headerEls.length} rows carrying "header", and a list has one: they all stick to the edge it caps, before every row, and the rows declared between them read as belonging to the last one. A title standing over a run of rows is a group: <List.Group label="...">{rows}</List.Group>.`, {
69541
+ list: listContainerEl,
69542
+ headers: [...headerEls]
69543
+ });
69544
+ });
69545
+ };
69511
69546
 
69512
69547
  /**
69513
69548
  * "Am I stuck?" — the question a `position: sticky` element cannot ask about
@@ -71902,7 +71937,7 @@ const useItemStore = ({
71902
71937
  };
71903
71938
 
71904
71939
  /**
71905
- * ListGroup — a labeled group of list items.
71940
+ * List.Group — a labeled group of list items.
71906
71941
  *
71907
71942
  * Renders a <li role="presentation"> wrapper containing a label span
71908
71943
  * (accessible via aria-labelledby) and a <ul role="group"> for the items.
@@ -72238,7 +72273,8 @@ const ListResolved = /*#__PURE__*/createComponentResolver([ListFirstResolver, Li
72238
72273
  */
72239
72274
  const List = /*#__PURE__*/Object.assign(ListResolved, {
72240
72275
  Item: ListItem,
72241
- Items: ListItems
72276
+ Items: ListItems,
72277
+ Group: ListItemGroup
72242
72278
  });
72243
72279
 
72244
72280
  const PickerNaviTime = props => {