@apliteni/apliteni-ui 0.155.0 → 0.156.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.
@@ -422,10 +422,13 @@ should use a dropdown instead of a filter. The bound does not work with an inlin
422
422
  A chip also cannot become narrower than the selected value's min-content width.
423
423
 
424
424
  **An open menu is wide enough to read.** A chip's trigger is only as wide as the value it shows.
425
- When open, the menu uses the kit's 240px menu floor instead of the trigger's width. If its row is
426
- narrower, it uses the row's width. When the side where it opens is short, it moves back along the
427
- row. It never leaves the row or makes the page wider. When closed, the menu keeps the trigger's
428
- width. This prevents the page from growing before any script runs. The floor is measured after
425
+ When open, the menu uses the kit's 240px menu floor instead of the trigger's width. Its row is
426
+ the toolbar line that holds the bar, or the bar itself when no toolbar holds it, so a bar with one
427
+ chip still gets a readable menu (`src/logic/dropdown-placement.js:100` `function filterPanelRow`).
428
+ If its row is narrower than the floor, it uses the row's width. When the side where it opens is
429
+ short, it moves back along the row. It never leaves the row or makes the page wider. Its rows use
430
+ the body weight, because they list the values the chip prints. When closed, the menu keeps the
431
+ trigger's width. This prevents the page from growing before any script runs. The floor is measured after
429
432
  the kit's JavaScript runs. It is measured again when the row changes width or the chip moves
430
433
  along the row. The width remains held until the menu finishes fading out. Nothing is painted
431
434
  narrower than the row allows. `filterPanelFit(dropdown, floor)` and `DD_MENU_FLOOR` are
@@ -68,7 +68,7 @@
68
68
 
69
69
  **Rule:** Limit each column to its longest cell plus the cell inset.
70
70
 
71
- **Do:** Keep amounts beside their references in a two-column table.
71
+ **Do:** Let each amount sit beside its reference.
72
72
 
73
73
  **Don't:** Stretch short tables across the page.
74
74
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@apliteni/apliteni-ui",
3
- "version": "0.155.0",
3
+ "version": "0.156.0",
4
4
  "workspaces": [
5
5
  "react"
6
6
  ],
package/src/index.d.ts CHANGED
@@ -44,7 +44,8 @@ export declare function dropdownAvail(opts: {
44
44
  }): number;
45
45
  /** The kit's menu floor, the width `.ui-dropdown__panel` writes. */
46
46
  export declare const DD_MENU_FLOOR: number;
47
- /** The `.ui-filter-bar` an anchored menu's fit is measured inside, or `null`.
47
+ /** The `.ui-toolbar` that holds the bar, else the `.ui-filter-bar`, an anchored
48
+ * menu's fit is measured inside, or `null`.
48
49
  * A chip's menu, and a menu that asks for a width with `--ui-filter-panel-ask` on
49
50
  * its own panel: the slide is that trigger's offset along the row, so those two
50
51
  * are the subjects and a panel anchored to the row itself sizes itself.
@@ -95,13 +95,15 @@ const ddFitPanelOf = (dd) => (typeof dd?.querySelector === 'function'
95
95
  * drift from the stylesheet. why: src/styles/filter-bar.css
96
96
  *
97
97
  * @param {Element} dd a `.ui-dropdown` that may be inside a filter row
98
- * @returns {Element|null} the `.ui-filter-bar` this menu's fit is measured in
98
+ * @returns {Element|null} the `.ui-toolbar` or `.ui-filter-bar` this menu's fit is measured in
99
99
  */
100
100
  export function filterPanelRow(dd) {
101
101
  if (typeof dd?.closest !== 'function') return null;
102
102
  const chip = dd.closest('.ui-filter-bar__chip');
103
- if (chip) return chip.closest('.ui-filter-bar');
104
- return ddPanelAsk(ddFitPanelOf(dd)) ? dd.closest('.ui-filter-bar') : null;
103
+ const bar = chip ? chip.closest('.ui-filter-bar') : ddPanelAsk(ddFitPanelOf(dd)) && dd.closest('.ui-filter-bar');
104
+ // A bar in a toolbar is only as wide as its chips, so one chip's menu was that chip's
105
+ // width. The toolbar's line is the row. #757
106
+ return bar ? bar.closest('.ui-toolbar') || bar : null;
105
107
  }
106
108
 
107
109
  /**
@@ -109,6 +109,9 @@
109
109
  Primer and Radix all tick a chosen menu row. #549
110
110
  why: docs/components.md#a-filter-row-holds-its-panels */
111
111
  .ui-filter-bar .ui-dropdown__item.is-selected { background: var(--glow-purple); /* code-bg: inherit — a translucent wash moves the ground, not the chip on it. */ }
112
+ /* A chip's menu lists the values the chip prints, so its rows take the body weight and
113
+ not the kit's semibold menu label. #757 */
114
+ .ui-filter-bar__chip .ui-dropdown__label { font-weight: var(--weight-normal); }
112
115
  /* Kit-wide a chosen label steps down to --text, which left the row in force the
113
116
  faintest in the panel. Under the wash it holds --strong. */
114
117
  .ui-filter-bar .ui-dropdown__item.is-selected .ui-dropdown__label { color: var(--strong); }
@@ -305,7 +305,10 @@
305
305
  .ui-card > .ui-table-scroll:has(> .ui-table--dense) {
306
306
  margin-inline: calc(-1 * var(--space-4));
307
307
  }
308
- .ui-card > .ui-table-scroll > .ui-table--dense {
308
+ /* A hover table's 8px row inset came on top of the bleed above, so a dense hover table
309
+ straight in a card started 8px inside the card's text edge. #757 */
310
+ .ui-card > .ui-table-scroll > .ui-table--dense,
311
+ .ui-card > .ui-table--dense.ui-table--hover:not(.ui-table--zebra) {
309
312
  padding-inline: 0;
310
313
  }
311
314
  /* A hover table's row inset plus the frame's 4px band is one --space-3, so the