@danxbot/ui 2.5.0 → 2.6.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/dist/index.js CHANGED
@@ -38648,6 +38648,90 @@ const vx = kt({
38648
38648
  laneHint: "truncate text-2xs text-secondary",
38649
38649
  /* The scroller AND the drop container: one element, per the banner. */
38650
38650
  laneItems: "min-h-40 flex-col gap-2 overflow-y-auto p-2",
38651
+ /* THE CARD IS THE FULL WIDTH OF ITS LANE, AND THE GRIP SITS ON TOP OF IT.
38652
+
38653
+ The grip used to be a FLEX SIBLING of the card — `flex items-start gap-1`
38654
+ with a 24px handle and a `flex-1` card — which took the handle's width
38655
+ plus the gap off the card. Two things were wrong with that and only one
38656
+ of them was reported.
38657
+
38658
+ THE ONE THAT WAS REPORTED. A 286px lane rendered a 242px card, so every
38659
+ card was inset 28px from the left edge its own lane header was flush
38660
+ with, and the grip floated in the resulting dead space, vertically
38661
+ centred against the card's full height rather than sitting near anything.
38662
+ The two columns of a board — the header row and the cards under it — did
38663
+ not line up.
38664
+
38665
+ THE ONE THAT WAS NOT. A `flex-1` card is sized by what is left after its
38666
+ siblings, so ANYTHING that changes a sibling's contribution comes off the
38667
+ card instead of being absorbed. The handle is `shrink-0` and `dx-tap`, so
38668
+ its width is `--tap-target` — `auto` on a mouse, 44px on a coarse
38669
+ pointer. The same board therefore drew a 242px card on a laptop and a
38670
+ 222px one on a tablet, from the same lane. Sizing a card from its
38671
+ siblings is the shape of that defect; taking the grip out of flow removes
38672
+ the shape, not just the instance.
38673
+
38674
+ So the card is the only IN-FLOW child here, and a flex column stretches
38675
+ it to the lane.
38676
+
38677
+ AND THE WIDTH IS THEN ASSERTED, because being the only in-flow child is
38678
+ not sufficient on its own. A `<button>` in a block container is sized
38679
+ SHRINK-TO-FIT, and `display: flex` does not change that — so an
38680
+ `interactive` `RecordCard`, which renders a real `<button>` precisely so
38681
+ Enter and Space work, sizes itself from its own content. Measured in this
38682
+ lane: a button card carrying two words was 61.73px next to a 270px div
38683
+ card in the same column, and one carrying a long title was 270px. Every
38684
+ card a different width, from nothing but how much text it holds, on a
38685
+ board where a card being interactive is the normal case.
38686
+
38687
+ `w-full` on whatever the consumer rendered is the board asserting the
38688
+ geometry it owns. Not on `RecordCard`, which is also used in flex rows
38689
+ and pickers where filling the container is not the right default — the
38690
+ column is this component's to guarantee, so it guarantees it here rather
38691
+ than depending on what `renderItem` happened to return.
38692
+
38693
+ The result is that nothing about the card — emphasis, selection, a ring,
38694
+ how many chips it carries, whether it is a button or a div — can reach
38695
+ its width. `probe-kanban.mjs` measures that in a browser, because
38696
+ `getBoundingClientRect` is zero in happy-dom and a suite with no layout
38697
+ engine cannot tell equal widths from no widths at all.
38698
+
38699
+ `relative` IS DECLARED HERE, DELIBERATELY. The grip is absolute, so it
38700
+ resolves against the nearest positioned ancestor — and inheriting one by
38701
+ luck from somewhere up the consumer's tree means the day that ancestor
38702
+ stops being positioned, every grip on the board jumps to the page.
38703
+
38704
+ THE CORNER IS RESERVED ON THE CARD, RATHER THAN THE GRIP SITTING IN THE
38705
+ CARD'S OWN PADDING GUTTER — and that is a choice between two imperfect
38706
+ options, so here is why.
38707
+
38708
+ The card comes from `renderItem` and is opaque: the board cannot reach
38709
+ inside it, and its padding is whatever the consumer chose. `RecordCard`
38710
+ is `p-3`, so its gutter is 12px and its first line — the identifier, at
38711
+ the top-left — starts there. The grip is 24px. Dropping it in that gutter
38712
+ lands it on the identifier of every card on the board, which is the one
38713
+ thing on a record card that is never optional.
38714
+
38715
+ So the board reserves the corner instead, on whatever the consumer
38716
+ rendered. `:not([data-dnd-handle])` rather than a positional selector
38717
+ because the grip is a child of this element too, and `pl-` on the grip
38718
+ would push its own glyph out of its own box.
38719
+
38720
+ `pointer-coarse:pl-(--tap-target)` for the same reason `Input`'s leading
38721
+ adornment carries the pair: `dx-tap` grows the grip to 44px under a
38722
+ finger, and a reservation measured against the mouse size would let the
38723
+ hit target cover the identifier it was moved off. */
38724
+ card: [
38725
+ "relative min-w-0",
38726
+ "[&>:not([data-dnd-handle])]:w-full",
38727
+ "[&>:not([data-dnd-handle])]:pl-8",
38728
+ "pointer-coarse:[&>:not([data-dnd-handle])]:pl-(--tap-target)"
38729
+ ],
38730
+ /* Overlaid on the card's top-left corner, in the space `card` reserves.
38731
+ Not `z-*`: the card is in normal flow and this is positioned, so it
38732
+ already paints above — and a z-index here would open a stacking context
38733
+ for a 24px grip. */
38734
+ cardHandle: "absolute top-0 left-0",
38651
38735
  /* Not `hidden` when a lane fills up — an empty lane still has to be a
38652
38736
  visible target, and a message is what tells somebody the lane is empty
38653
38737
  rather than still loading. */
@@ -38759,15 +38843,15 @@ function G3({
38759
38843
  id: n(w),
38760
38844
  index: x,
38761
38845
  label: r(w),
38762
- children: /* @__PURE__ */ M("div", { className: "flex items-start gap-1", children: [
38846
+ children: /* @__PURE__ */ M("div", { className: m.card(), children: [
38763
38847
  /* @__PURE__ */ p(
38764
38848
  wh,
38765
38849
  {
38766
38850
  label: `Move ${r(w)}`,
38767
- className: "mt-2 shrink-0"
38851
+ className: m.cardHandle()
38768
38852
  }
38769
38853
  ),
38770
- /* @__PURE__ */ p("div", { className: "min-w-0 flex-1", children: o(w) })
38854
+ o(w)
38771
38855
  ] })
38772
38856
  },
38773
38857
  n(w)