basalt-ui 2.0.3 → 2.0.5

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.
@@ -63,6 +63,49 @@
63
63
  overflow-x: auto;
64
64
  }
65
65
 
66
+ /*
67
+ * A page-scrolled sticky header INSIDE the shell seals the strip above it.
68
+ *
69
+ * `AppShell.Main` is the scrollport and carries block padding (`app-main.module.css`: `stack-md`,
70
+ * one rung down to `stack-sm` from `sm` up). A sticky `<thead>` resolves against the scrollport's
71
+ * CONTENT edge, so at `top: 0` it parked that padding below the band and every body row scrolled
72
+ * through the gap. A negative offset equal to the padding moves the stick line out to the band's
73
+ * edge, flush. The two media/token pairs below mirror `.main` there — the layout suite
74
+ * (`data-table.layout.test.ts`, invariant 8) fails on drift. A consumer `stickyHeaderOffset` is an
75
+ * inline `--table-sticky-header-offset` on the table and beats this class, so it still wins.
76
+ * Outside a shell no `.mantine-AppShell-main` ancestor matches and the offset stays 0.
77
+ */
78
+ :global(.mantine-AppShell-main) .pageSticky {
79
+ --table-sticky-header-offset: calc(-1 * var(--vx-space-stack-md));
80
+ }
81
+
82
+ /* theme-allow raw-media-query — mirrors app-main.module.css's own `sm` switch for Main's block padding; invariant 8 in data-table.layout.test.ts fails on drift */
83
+ @media (min-width: 52.5em) {
84
+ :global(.mantine-AppShell-main) .pageSticky {
85
+ --table-sticky-header-offset: calc(-1 * var(--vx-space-stack-sm));
86
+ }
87
+ }
88
+
89
+ /*
90
+ * A Badge cell keeps its label. Mantine's Badge label is `overflow: hidden; text-overflow:
91
+ * ellipsis`, which gives the badge a min-content of ~0, so an auto-layout column holding only
92
+ * badges was free to shrink under its neighbours (`WORKING` → `WOR…` at 1280px). `max-content`
93
+ * as the floor makes the status column the widest thing a short enum ever needs.
94
+ */
95
+ .table :global(.mantine-Badge-root) {
96
+ min-width: max-content;
97
+ }
98
+
99
+ /* Visually hidden, still announced — the fold toggle column's header has no visible label. */
100
+ .srOnly {
101
+ position: absolute;
102
+ width: 1px;
103
+ height: 1px;
104
+ overflow: hidden;
105
+ clip-path: inset(50%);
106
+ white-space: nowrap;
107
+ }
108
+
66
109
  /*
67
110
  * The selection column's hit area is the WHOLE cell (`docs/CONTROLS-SPEC.md` §2): the
68
111
  * cell is the positioning box and the wrapping <label>'s ::after stretches over it, so a tap
@@ -16,7 +16,10 @@ declare const classes: {
16
16
  readonly foldToggle: string
17
17
  readonly foldToggleCell: string
18
18
  readonly foldWrapper: string
19
+ readonly pageSticky: string
19
20
  readonly selectCell: string
20
21
  readonly selectHit: string
22
+ readonly srOnly: string
23
+ readonly table: string
21
24
  }
22
25
  export default classes
@@ -1642,7 +1642,11 @@ export function BasaltDataTable<T extends RowData>(props: BasaltDataTableProps<T
1642
1642
 
1643
1643
  const tableNode = (
1644
1644
  <Table
1645
- className={cx(classNames?.table)}
1645
+ className={cx(
1646
+ classes.table,
1647
+ pageStickyHeader && !contained && classes.pageSticky,
1648
+ classNames?.table,
1649
+ )}
1646
1650
  {...(striped !== undefined && { striped })}
1647
1651
  {...(highlightOnHover !== undefined && { highlightOnHover })}
1648
1652
  {...(stickyHeader !== undefined && { stickyHeader })}
@@ -1659,7 +1663,11 @@ export function BasaltDataTable<T extends RowData>(props: BasaltDataTableProps<T
1659
1663
  <Table.Tr key={headerGroup.id}>
1660
1664
  {/* The disclosure toggle column has no header of its own — nothing is "sorted" or
1661
1665
  "selected all" across it, only revealed per row. */}
1662
- {hasFolded && <Table.Th className={classes.foldToggleCell} aria-hidden />}
1666
+ {hasFolded && (
1667
+ <Table.Th className={classes.foldToggleCell}>
1668
+ <span className={classes.srOnly}>Details</span>
1669
+ </Table.Th>
1670
+ )}
1663
1671
  {headerGroup.headers.map((header) => {
1664
1672
  const canSort = sortingEnabled && header.column.getCanSort()
1665
1673
  const sorted = header.column.getIsSorted()