@charcuterie/ui 3.6.0 → 3.8.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.
Files changed (46) hide show
  1. package/dist/Checkbox/Checkbox.d.ts +39 -1
  2. package/dist/Checkbox/Checkbox.d.ts.map +1 -1
  3. package/dist/Checkbox/Checkbox.js +131 -71
  4. package/dist/Checkbox/Checkbox.js.map +1 -1
  5. package/dist/Field/Field.d.ts +67 -2
  6. package/dist/Field/Field.d.ts.map +1 -1
  7. package/dist/Field/Field.js +22 -0
  8. package/dist/Field/Field.js.map +1 -1
  9. package/dist/Field/FieldGroup.d.ts +28 -3
  10. package/dist/Field/FieldGroup.d.ts.map +1 -1
  11. package/dist/Field/FieldGroup.js +5 -2
  12. package/dist/Field/FieldGroup.js.map +1 -1
  13. package/dist/VirtualizedGrid/VirtualizedGrid.d.ts +147 -0
  14. package/dist/VirtualizedGrid/VirtualizedGrid.d.ts.map +1 -0
  15. package/dist/VirtualizedGrid/VirtualizedGrid.js +177 -0
  16. package/dist/VirtualizedGrid/VirtualizedGrid.js.map +1 -0
  17. package/dist/VirtualizedGrid/gridGap.d.ts +20 -0
  18. package/dist/VirtualizedGrid/gridGap.d.ts.map +1 -0
  19. package/dist/VirtualizedGrid/gridGap.js +20 -0
  20. package/dist/VirtualizedGrid/gridGap.js.map +1 -0
  21. package/dist/index.d.ts +3 -0
  22. package/dist/index.d.ts.map +1 -1
  23. package/dist/index.js +2 -0
  24. package/dist/index.js.map +1 -1
  25. package/dist/slotProps.d.ts +14 -1
  26. package/dist/slotProps.d.ts.map +1 -1
  27. package/dist/slotProps.js +13 -0
  28. package/dist/slotProps.js.map +1 -1
  29. package/package.json +1 -1
  30. package/src/Checkbox/Checkbox.mdx +32 -0
  31. package/src/Checkbox/Checkbox.stories.tsx +74 -0
  32. package/src/Checkbox/Checkbox.test.tsx +110 -2
  33. package/src/Checkbox/Checkbox.tsx +234 -125
  34. package/src/Field/Field.mdx +41 -0
  35. package/src/Field/Field.stories.tsx +79 -0
  36. package/src/Field/Field.test.tsx +137 -0
  37. package/src/Field/Field.tsx +99 -25
  38. package/src/Field/FieldGroup.tsx +60 -19
  39. package/src/VirtualizedGrid/VirtualizedGrid.mdx +110 -0
  40. package/src/VirtualizedGrid/VirtualizedGrid.stories.tsx +258 -0
  41. package/src/VirtualizedGrid/VirtualizedGrid.test.tsx +182 -0
  42. package/src/VirtualizedGrid/VirtualizedGrid.tsx +340 -0
  43. package/src/VirtualizedGrid/gridGap.ts +19 -0
  44. package/src/index.ts +3 -0
  45. package/src/slotProps.ts +16 -2
  46. package/src/sourceRules.test.ts +10 -1
@@ -0,0 +1,147 @@
1
+ import type { ReactNode } from "react";
2
+ import type { BlockSizeResolver } from "../AdaptiveGrid/useAdaptiveColumns.ts";
3
+ export type VirtualizedGridProps<Item> = {
4
+ /**
5
+ * Where the available block size is read from. Defaults to the
6
+ * viewport, which is the only thing that can answer "will this
7
+ * scroll".
8
+ */
9
+ blockSizeResolver?: BlockSizeResolver;
10
+ /**
11
+ * Everything down the page that is not this grid, in CSS px —
12
+ * header, rails, filter rows. Subtracted before asking how many
13
+ * items stack.
14
+ */
15
+ chromeBlockSize?: number;
16
+ className?: string;
17
+ /**
18
+ * Draw this many columns instead of the automatic answer — the
19
+ * manual override, for a page that hoisted `useAdaptiveColumns`
20
+ * itself.
21
+ */
22
+ columns?: number;
23
+ /** The gap between tracks and rows, in CSS px. */
24
+ gap?: number;
25
+ /**
26
+ * A stable identity per item. Without one the key is the index,
27
+ * which is wrong the moment the list is filtered or an item
28
+ * leaves the middle — React reuses the mounted subtree and the
29
+ * wrong tile inherits the wrong open menu.
30
+ */
31
+ getItemKey?: (item: Item, index: number) => string | number;
32
+ /**
33
+ * One row's block size in CSS px, as a starting guess.
34
+ *
35
+ * Unlike `AdaptiveGrid`'s, this is an *estimate* and not a
36
+ * commitment: every mounted row is measured and the estimate
37
+ * corrected. It still wants to be close, because it is what the
38
+ * scrollbar is sized from before anything has been measured — a
39
+ * bad guess makes the bar jump under the thumb on first scroll.
40
+ */
41
+ itemBlockSize: number;
42
+ /** Every item, mounted or not. */
43
+ items: readonly Item[];
44
+ /**
45
+ * An accessible name for the list. Worth giving: a windowed list
46
+ * is one whose length a reader cannot count for itself.
47
+ */
48
+ label?: string;
49
+ /** The most columns the automatic answer will take. */
50
+ maxColumns?: number;
51
+ /** The narrowest a column may be, in CSS px. */
52
+ minColumnInlineSize?: number;
53
+ /**
54
+ * How many rows to mount above and below the viewport.
55
+ *
56
+ * Four rather than `@tanstack/react-virtual`'s default of one:
57
+ * these are media tiles whose images load over the network, and
58
+ * a row that mounts at the moment it becomes visible shows a
59
+ * blank box while the image arrives. Overscan buys the load a
60
+ * head start.
61
+ */
62
+ overscanRows?: number;
63
+ /** Draw one item. */
64
+ renderItem: (item: Item, index: number) => ReactNode;
65
+ /**
66
+ * The `localStorage` key a manual column choice is remembered
67
+ * under. Namespace it to the app; omit it and nothing is
68
+ * written.
69
+ */
70
+ storageKey?: string;
71
+ };
72
+ /**
73
+ * `AdaptiveGrid`'s layout, with only the rows you can see mounted.
74
+ *
75
+ * The fleet's grids render every item they are given. That is the
76
+ * right default, and it stops being right somewhere in the low
77
+ * thousands: QueuePilot's Pending page put **2,162** tiles on one
78
+ * screen — 19,933 DOM nodes, 2,162 `<img>`, 4,371 `<button>`, 7.8
79
+ * seconds to settle, and roughly 43fps while scrolling on a machine
80
+ * with no GPU to lose. Nothing about that page was wrong except how
81
+ * much of it existed at once.
82
+ *
83
+ * ### It is the same grid, and deliberately so
84
+ *
85
+ * Columns come from `useAdaptiveColumns` — the identical
86
+ * height-first rule `AdaptiveGrid` uses, with the identical two-box
87
+ * structure protecting it (an uncapped outer box is measured, an
88
+ * inner box carries the cap). Windowing is the only difference. A
89
+ * second column heuristic that windowed lists followed and flow
90
+ * lists did not would be a fleet where the same content lays out
91
+ * two ways depending on how many of it there are.
92
+ *
93
+ * ### The window is padding, not absolute positioning
94
+ *
95
+ * The obvious build — absolutely position a row per visible row —
96
+ * is the one this does not do, and the reason is the markup. A
97
+ * `<ul>` whose children are positioning wrappers is not a list any
98
+ * more; the cards stop being `<li>`, and the structure a screen
99
+ * reader walks becomes a fiction maintained by ARIA roles.
100
+ *
101
+ * So there are no row elements at all. One real CSS grid holds the
102
+ * visible items as ordinary `<li>` children, and the thousands of
103
+ * rows above and below it are two numbers:
104
+ * `padding-block-start` for everything scrolled past and
105
+ * `padding-block-end` for everything still to come. The grid then
106
+ * does its own job — tracks on the inline axis, rows sized to
107
+ * their tallest item — instead of being reimplemented in
108
+ * `transform`s.
109
+ *
110
+ * ### How a row gets measured without existing
111
+ *
112
+ * A CSS grid stretches every cell in a row to the row's height
113
+ * (`align-items: stretch`, which is the default and is not
114
+ * overridden here). So **any** cell in a row is exactly as tall as
115
+ * the row, and measuring the first one measures the row. That is
116
+ * what `data-index` and the `measureElement` ref are doing on the
117
+ * leading cell of each row, and it is why tile heights are allowed
118
+ * to vary — a two-line title, a wrapped pair of buttons, a badge
119
+ * only some items carry.
120
+ *
121
+ * The row gap sits between two measured boxes and so is in
122
+ * neither. `measureRow` adds it back, which keeps the virtualizer's
123
+ * idea of the distance from one row to the next and the browser's
124
+ * the same number.
125
+ *
126
+ * ### Why the window and not a scroll box of its own
127
+ *
128
+ * `useWindowVirtualizer`, so the page scrolls the way every other
129
+ * page in the fleet scrolls — the header leaves, the scrollbar is
130
+ * the browser's, `Ctrl+End` works. A component that grew its own
131
+ * `overflow: auto` well would trap the wheel and strand the page
132
+ * header above it. The cost is `scrollMargin`: the virtualizer has
133
+ * to be told how far down the document the grid starts, which is
134
+ * measured below.
135
+ *
136
+ * ### What windowing costs, and what is done about it
137
+ *
138
+ * The true length is stated rather than implied — `aria-setsize` on
139
+ * every cell carries the full count and `aria-posinset` its real
140
+ * position, so a reader announces "3 of 2,162" instead of "3 of
141
+ * 40". Two costs have no fix at this layer and are the caller's to
142
+ * answer: the browser's `Ctrl+F` only searches what is mounted, and
143
+ * so does "select all". A page that needs either owes its users a
144
+ * search field of its own.
145
+ */
146
+ export declare const VirtualizedGrid: <Item>({ blockSizeResolver, chromeBlockSize, className, columns, gap, getItemKey, itemBlockSize, items, label, maxColumns, minColumnInlineSize, overscanRows, renderItem, storageKey, }: VirtualizedGridProps<Item>) => ReactNode;
147
+ //# sourceMappingURL=VirtualizedGrid.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"VirtualizedGrid.d.ts","sourceRoot":"","sources":["../../src/VirtualizedGrid/VirtualizedGrid.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAStC,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,uCAAuC,CAAA;AAK9E,MAAM,MAAM,oBAAoB,CAAC,IAAI,IAAI;IACvC;;;;OAIG;IACH,iBAAiB,CAAC,EAAE,iBAAiB,CAAA;IACrC;;;;OAIG;IACH,eAAe,CAAC,EAAE,MAAM,CAAA;IACxB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB;;;;OAIG;IACH,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,kDAAkD;IAClD,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ;;;;;OAKG;IACH,UAAU,CAAC,EAAE,CACX,IAAI,EAAE,IAAI,EACV,KAAK,EAAE,MAAM,KACV,MAAM,GAAG,MAAM,CAAA;IACpB;;;;;;;;OAQG;IACH,aAAa,EAAE,MAAM,CAAA;IACrB,kCAAkC;IAClC,KAAK,EAAE,SAAS,IAAI,EAAE,CAAA;IACtB;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,uDAAuD;IACvD,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,gDAAgD;IAChD,mBAAmB,CAAC,EAAE,MAAM,CAAA;IAC5B;;;;;;;;OAQG;IACH,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,qBAAqB;IACrB,UAAU,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,KAAK,SAAS,CAAA;IACpD;;;;OAIG;IACH,UAAU,CAAC,EAAE,MAAM,CAAA;CACpB,CAAA;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyEG;AACH,eAAO,MAAM,eAAe,GAAI,IAAI,EAAG,kLAepC,oBAAoB,CAAC,IAAI,CAAC,KAAG,SAkK/B,CAAA"}
@@ -0,0 +1,177 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { useWindowVirtualizer } from "@tanstack/react-virtual";
3
+ import { useCallback, useLayoutEffect, useRef, useState, } from "react";
4
+ import { getContentMaxInlineSize } from "../AdaptiveGrid/chooseColumns.js";
5
+ import { useAdaptiveColumns } from "../AdaptiveGrid/useAdaptiveColumns.js";
6
+ import { toClassName } from "../toClassName.js";
7
+ import { DEFAULT_GRID_GAP_PX } from "./gridGap.js";
8
+ /**
9
+ * `AdaptiveGrid`'s layout, with only the rows you can see mounted.
10
+ *
11
+ * The fleet's grids render every item they are given. That is the
12
+ * right default, and it stops being right somewhere in the low
13
+ * thousands: QueuePilot's Pending page put **2,162** tiles on one
14
+ * screen — 19,933 DOM nodes, 2,162 `<img>`, 4,371 `<button>`, 7.8
15
+ * seconds to settle, and roughly 43fps while scrolling on a machine
16
+ * with no GPU to lose. Nothing about that page was wrong except how
17
+ * much of it existed at once.
18
+ *
19
+ * ### It is the same grid, and deliberately so
20
+ *
21
+ * Columns come from `useAdaptiveColumns` — the identical
22
+ * height-first rule `AdaptiveGrid` uses, with the identical two-box
23
+ * structure protecting it (an uncapped outer box is measured, an
24
+ * inner box carries the cap). Windowing is the only difference. A
25
+ * second column heuristic that windowed lists followed and flow
26
+ * lists did not would be a fleet where the same content lays out
27
+ * two ways depending on how many of it there are.
28
+ *
29
+ * ### The window is padding, not absolute positioning
30
+ *
31
+ * The obvious build — absolutely position a row per visible row —
32
+ * is the one this does not do, and the reason is the markup. A
33
+ * `<ul>` whose children are positioning wrappers is not a list any
34
+ * more; the cards stop being `<li>`, and the structure a screen
35
+ * reader walks becomes a fiction maintained by ARIA roles.
36
+ *
37
+ * So there are no row elements at all. One real CSS grid holds the
38
+ * visible items as ordinary `<li>` children, and the thousands of
39
+ * rows above and below it are two numbers:
40
+ * `padding-block-start` for everything scrolled past and
41
+ * `padding-block-end` for everything still to come. The grid then
42
+ * does its own job — tracks on the inline axis, rows sized to
43
+ * their tallest item — instead of being reimplemented in
44
+ * `transform`s.
45
+ *
46
+ * ### How a row gets measured without existing
47
+ *
48
+ * A CSS grid stretches every cell in a row to the row's height
49
+ * (`align-items: stretch`, which is the default and is not
50
+ * overridden here). So **any** cell in a row is exactly as tall as
51
+ * the row, and measuring the first one measures the row. That is
52
+ * what `data-index` and the `measureElement` ref are doing on the
53
+ * leading cell of each row, and it is why tile heights are allowed
54
+ * to vary — a two-line title, a wrapped pair of buttons, a badge
55
+ * only some items carry.
56
+ *
57
+ * The row gap sits between two measured boxes and so is in
58
+ * neither. `measureRow` adds it back, which keeps the virtualizer's
59
+ * idea of the distance from one row to the next and the browser's
60
+ * the same number.
61
+ *
62
+ * ### Why the window and not a scroll box of its own
63
+ *
64
+ * `useWindowVirtualizer`, so the page scrolls the way every other
65
+ * page in the fleet scrolls — the header leaves, the scrollbar is
66
+ * the browser's, `Ctrl+End` works. A component that grew its own
67
+ * `overflow: auto` well would trap the wheel and strand the page
68
+ * header above it. The cost is `scrollMargin`: the virtualizer has
69
+ * to be told how far down the document the grid starts, which is
70
+ * measured below.
71
+ *
72
+ * ### What windowing costs, and what is done about it
73
+ *
74
+ * The true length is stated rather than implied — `aria-setsize` on
75
+ * every cell carries the full count and `aria-posinset` its real
76
+ * position, so a reader announces "3 of 2,162" instead of "3 of
77
+ * 40". Two costs have no fix at this layer and are the caller's to
78
+ * answer: the browser's `Ctrl+F` only searches what is mounted, and
79
+ * so does "select all". A page that needs either owes its users a
80
+ * search field of its own.
81
+ */
82
+ export const VirtualizedGrid = ({ blockSizeResolver, chromeBlockSize, className, columns, gap = DEFAULT_GRID_GAP_PX, getItemKey, itemBlockSize, items, label, maxColumns, minColumnInlineSize, overscanRows = 4, renderItem, storageKey, }) => {
83
+ const layout = useAdaptiveColumns({
84
+ blockSizeResolver,
85
+ chromeBlockSize,
86
+ itemBlockSize,
87
+ itemCount: items.length,
88
+ maxAutoColumns: maxColumns,
89
+ minColumnInlineSize,
90
+ storageKey,
91
+ });
92
+ const drawnColumns = columns ?? layout.columns;
93
+ // Folded from what is DRAWN rather than read off the hook, so an
94
+ // override widens the page cap with it — the same rule
95
+ // `AdaptiveGrid` follows, and wrong in the same way if it does
96
+ // not.
97
+ const contentMaxInlineSize = getContentMaxInlineSize({
98
+ columns: drawnColumns,
99
+ });
100
+ const rowCount = Math.ceil(items.length / drawnColumns);
101
+ /**
102
+ * How far down the document the grid starts.
103
+ *
104
+ * `useWindowVirtualizer` measures against the document, so
105
+ * without this every row is placed as though the grid began at
106
+ * the top of the page, and the whole list sits shifted by the
107
+ * height of the header above it.
108
+ *
109
+ * State and not a ref, because it feeds `scrollMargin` and a
110
+ * change has to re-render. Measured on every commit rather than
111
+ * on a dependency list: a filter row that grows a line moves the
112
+ * grid down the page, and nothing in this component's own props
113
+ * would report that.
114
+ */
115
+ const gridElement = useRef(null);
116
+ const [scrollMargin, setScrollMargin] = useState(0);
117
+ useLayoutEffect(() => {
118
+ const element = gridElement.current;
119
+ if (!element) {
120
+ return;
121
+ }
122
+ const next = element.getBoundingClientRect().top + window.scrollY;
123
+ setScrollMargin((current) => current === next ? current : next);
124
+ });
125
+ /**
126
+ * A row's height, plus the gap that follows it.
127
+ *
128
+ * The gap is added here rather than left to the estimate because
129
+ * it is real distance the next row starts after: leave it out
130
+ * and the virtualizer's offsets drift by one gap per row, which
131
+ * on a list of two thousand is a scrollbar off by half a page.
132
+ */
133
+ const measureRow = useCallback((element) => element.getBoundingClientRect().height + gap, [gap]);
134
+ const rowVirtualizer = useWindowVirtualizer({
135
+ count: rowCount,
136
+ estimateSize: () => itemBlockSize + gap,
137
+ measureElement: measureRow,
138
+ overscan: overscanRows,
139
+ scrollMargin,
140
+ });
141
+ const virtualRows = rowVirtualizer.getVirtualItems();
142
+ const firstRow = virtualRows[0];
143
+ const lastRow = virtualRows[virtualRows.length - 1];
144
+ // Everything scrolled past, and everything still to come. The two
145
+ // numbers that stand in for the rows that do not exist.
146
+ const paddingBlockStart = firstRow?.start ?? 0;
147
+ const paddingBlockEnd = lastRow
148
+ ? Math.max(0, rowVirtualizer.getTotalSize() - lastRow.end)
149
+ : 0;
150
+ return (_jsx("div", { className: toClassName("flex justify-center", className), ref: layout.containerRef, children: _jsx("ul", { "aria-label": label, className: "grid w-full list-none p-0 [&>*]:min-w-0", ref: gridElement, style: {
151
+ gap: `${gap}px`,
152
+ gridTemplateColumns: `repeat(${drawnColumns}, minmax(0, 1fr))`,
153
+ maxInlineSize: contentMaxInlineSize,
154
+ // Offset by `scrollMargin` because `start` is measured
155
+ // from the top of the document, and this padding is
156
+ // measured from the top of the grid.
157
+ paddingBlockEnd: `${paddingBlockEnd}px`,
158
+ paddingBlockStart: `${Math.max(0, paddingBlockStart - scrollMargin)}px`,
159
+ }, children: virtualRows.flatMap((row) => {
160
+ const firstIndex = row.index * drawnColumns;
161
+ return items
162
+ .slice(firstIndex, firstIndex + drawnColumns)
163
+ .map((item, offset) => {
164
+ const index = firstIndex + offset;
165
+ return (_jsx("li", { "aria-posinset": index + 1, "aria-setsize": items.length, "data-index": row.index,
166
+ // Measured on the leading cell alone. A CSS grid
167
+ // stretches every cell to its row's height, so
168
+ // one is enough — and measuring all of them
169
+ // would have the virtualizer record the same row
170
+ // once per column.
171
+ ref: offset === 0
172
+ ? rowVirtualizer.measureElement
173
+ : undefined, children: renderItem(item, index) }, getItemKey?.(item, index) ?? index));
174
+ });
175
+ }) }) }));
176
+ };
177
+ //# sourceMappingURL=VirtualizedGrid.js.map
@@ -0,0 +1 @@
1
+ {"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,EAAE,KAAK,CAAC,IAZnB,UAAU,EAAE,CAAC,IAAI,EAAE,KAAK,CAAC,IAAI,KAAK,CAapC,CACN,CAAA;gBACH,CAAC,CAAC,CAAA;YACN,CAAC,CAAC,GACC,GACD,CACP,CAAA;AACH,CAAC,CAAA"}
@@ -0,0 +1,20 @@
1
+ /**
2
+ * The gap between tracks and between rows in a wrapping grid, in
3
+ * CSS px.
4
+ *
5
+ * `AdaptiveGrid` spells this `gap-4` and never has to know the
6
+ * number: it lays out in flow, so the browser owns the spacing.
7
+ * `VirtualizedGrid` does have to know it. The space between two
8
+ * rows falls outside the box either of them measures, and the rows
9
+ * above and below the window are arithmetic rather than layout, so
10
+ * a gap the component cannot name is a gap its scrollbar is wrong
11
+ * by — once per row, which on a list of two thousand is half a
12
+ * page.
13
+ *
14
+ * `4` on Tailwind's spacing scale is `1rem`, and `1rem` is 16px at
15
+ * the fleet's root size. Exported so a caller measuring its own
16
+ * `itemBlockSize` off a running page can account for it rather
17
+ * than rediscovering the number.
18
+ */
19
+ export declare const DEFAULT_GRID_GAP_PX = 16;
20
+ //# sourceMappingURL=gridGap.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"gridGap.d.ts","sourceRoot":"","sources":["../../src/VirtualizedGrid/gridGap.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AACH,eAAO,MAAM,mBAAmB,KAAK,CAAA"}
@@ -0,0 +1,20 @@
1
+ /**
2
+ * The gap between tracks and between rows in a wrapping grid, in
3
+ * CSS px.
4
+ *
5
+ * `AdaptiveGrid` spells this `gap-4` and never has to know the
6
+ * number: it lays out in flow, so the browser owns the spacing.
7
+ * `VirtualizedGrid` does have to know it. The space between two
8
+ * rows falls outside the box either of them measures, and the rows
9
+ * above and below the window are arithmetic rather than layout, so
10
+ * a gap the component cannot name is a gap its scrollbar is wrong
11
+ * by — once per row, which on a list of two thousand is half a
12
+ * page.
13
+ *
14
+ * `4` on Tailwind's spacing scale is `1rem`, and `1rem` is 16px at
15
+ * the fleet's root size. Exported so a caller measuring its own
16
+ * `itemBlockSize` off a running page can account for it rather
17
+ * than rediscovering the number.
18
+ */
19
+ export const DEFAULT_GRID_GAP_PX = 16;
20
+ //# sourceMappingURL=gridGap.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"gridGap.js","sourceRoot":"","sources":["../../src/VirtualizedGrid/gridGap.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG,EAAE,CAAA"}
package/dist/index.d.ts CHANGED
@@ -170,6 +170,9 @@ export { Toolbar } from "./Toolbar/Toolbar.tsx";
170
170
  export type { TooltipProps } from "./Tooltip/Tooltip.tsx";
171
171
  export { Tooltip } from "./Tooltip/Tooltip.tsx";
172
172
  export { toClassName } from "./toClassName.ts";
173
+ export { DEFAULT_GRID_GAP_PX } from "./VirtualizedGrid/gridGap.ts";
174
+ export type { VirtualizedGridProps } from "./VirtualizedGrid/VirtualizedGrid.tsx";
175
+ export { VirtualizedGrid } from "./VirtualizedGrid/VirtualizedGrid.tsx";
173
176
  export type { VisuallyHiddenProps } from "./VisuallyHidden/VisuallyHidden.tsx";
174
177
  export { VisuallyHidden } from "./VisuallyHidden/VisuallyHidden.tsx";
175
178
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AAEH,YAAY,EACV,qBAAqB,EACrB,aAAa,EACb,cAAc,GACf,MAAM,2BAA2B,CAAA;AAClC,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAA;AACrD,YAAY,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAA;AACxE,OAAO,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAA;AAC9D,YAAY,EAAE,YAAY,EAAE,MAAM,iCAAiC,C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AAqC,CAAA;AAC9E,OAAO,EAAE,cAAc,EAAE,MAAM,qCAAqC,CAAA"}
package/dist/index.js CHANGED
@@ -102,5 +102,7 @@ export { chooseVisibleCount } from "./Toolbar/chooseVisibleCount.js";
102
102
  export { Toolbar } from "./Toolbar/Toolbar.js";
103
103
  export { Tooltip } from "./Tooltip/Tooltip.js";
104
104
  export { toClassName } from "./toClassName.js";
105
+ export { DEFAULT_GRID_GAP_PX } from "./VirtualizedGrid/gridGap.js";
106
+ export { VirtualizedGrid } from "./VirtualizedGrid/VirtualizedGrid.js";
105
107
  export { VisuallyHidden } from "./VisuallyHidden/VisuallyHidden.js";
106
108
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AAOH,OAAO,EAAE,SAAS,EAAE,MAAM,0BAA2B,CAAA;AAErD,OAAO,EAAE,YAAY,EAAE,MAAM,gCAAiC,CAAA;AAE9D,OAAO,EACL,aAAa,EACb,wBAAwB,EACxB,0BAA0B,EAC1B,iCAAiC,EACjC,gBAAgB,EAChB,uBAAuB,GACxB,MAAM,iCAAiC,CAAA;AAKxC,OAAO,EACL,6BAA6B,EAC7B,gBAAgB,EAChB,kBAAkB,EAClB,yBAAyB,GAC1B,MAAM,sCAAsC,CAAA;AAK7C,OAAO,EAAE,KAAK,EAAE,MAAM,kBAAmB,CAAA;AAEzC,OAAO,EAAE,KAAK,EAAE,MAAM,kBAAmB,CAAA;AAKzC,OAAO,EAAE,KAAK,EAAE,MAAM,kBAAmB,CAAA;AASzC,OAAO,EACL,eAAe,EACf,gBAAgB,EAChB,YAAY,EACZ,mBAAmB,EACnB,cAAc,GACf,MAAM,sBAAsB,CAAA;AAE7B,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAqB,CAAA;AAE5C,OAAO,EAAE,UAAU,EAAE,MAA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 export type SlotProps = Pick<InputHTMLAttributes<HTMLElement>, "aria-describedby
116
116
  * inner one won. The outer panel had no anchor and rendered in the
117
117
  * corner of the viewport — no error, no failing test, and it looks
118
118
  * like a CSS bug.
119
+ *
120
+ * ### A wrapping component uses it too, and keeps its own prop type
121
+ *
122
+ * `receivedProps` is generic in `ReceivedProps extends SlotProps`
123
+ * rather than plain `SlotProps`, so the return type carries whatever
124
+ * the caller actually holds instead of narrowing it to the five keys.
125
+ * `FieldGroup` is the reason: it does not clone, its rest props land
126
+ * on its own `<fieldset>`, and it writes an `aria-describedby` that
127
+ * has to **join** a caller's rather than replace it. Narrowing to
128
+ * `SlotProps` on the way out would have dropped `disabled`, `form`,
129
+ * `name` and every `data-*` from the type of the object it spreads
130
+ * onto that element — the props would still arrive at runtime, and
131
+ * only the type would have lied.
119
132
  */
120
- export declare const mergeSlotProps: <OwnProps extends Record<string, unknown>>(receivedProps: SlotProps, ownProps: OwnProps) => OwnProps & SlotProps;
133
+ export declare const mergeSlotProps: <ReceivedProps extends SlotProps, OwnProps extends Record<string, unknown>>(receivedProps: ReceivedProps, ownProps: OwnProps) => OwnProps & ReceivedProps;
121
134
  //# sourceMappingURL=slotProps.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"slotProps.d.ts","sourceRoot":"","sources":["../src/slotProps.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,OAAO,CAAA;AAIhD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiFG;AACH,MAAM,MAAM,SAAS,GAAG,IAAI,CAC1B,mBAAmB,CAAC,WAAW,CAAC,EAC9B,kBAAkB,GAClB,cAAc,GACd,eAAe,GACf,IAAI,GACJ,UAAU,CACb,CAAA;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AACH,eAAO,MAAM,cAAc,GACzB,QAAQ,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAExC,eAAe,SAAS,EACxB,UAAU,QAAQ,KACjB,QAAQ,GAAG,SA2Bb,CAAA"}
1
+ {"version":3,"file":"slotProps.d.ts","sourceRoot":"","sources":["../src/slotProps.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,OAAO,CAAA;AAIhD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiFG;AACH,MAAM,MAAM,SAAS,GAAG,IAAI,CAC1B,mBAAmB,CAAC,WAAW,CAAC,EAC9B,kBAAkB,GAClB,cAAc,GACd,eAAe,GACf,IAAI,GACJ,UAAU,CACb,CAAA;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+CG;AACH,eAAO,MAAM,cAAc,GACzB,aAAa,SAAS,SAAS,EAC/B,QAAQ,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAExC,eAAe,aAAa,EAC5B,UAAU,QAAQ,KACjB,QAAQ,GAAG,aA2Bb,CAAA"}
package/dist/slotProps.js CHANGED
@@ -33,6 +33,19 @@ import { mergeSlotWiring } from "./slotWiring.js";
33
33
  * inner one won. The outer panel had no anchor and rendered in the
34
34
  * corner of the viewport — no error, no failing test, and it looks
35
35
  * like a CSS bug.
36
+ *
37
+ * ### A wrapping component uses it too, and keeps its own prop type
38
+ *
39
+ * `receivedProps` is generic in `ReceivedProps extends SlotProps`
40
+ * rather than plain `SlotProps`, so the return type carries whatever
41
+ * the caller actually holds instead of narrowing it to the five keys.
42
+ * `FieldGroup` is the reason: it does not clone, its rest props land
43
+ * on its own `<fieldset>`, and it writes an `aria-describedby` that
44
+ * has to **join** a caller's rather than replace it. Narrowing to
45
+ * `SlotProps` on the way out would have dropped `disabled`, `form`,
46
+ * `name` and every `data-*` from the type of the object it spreads
47
+ * onto that element — the props would still arrive at runtime, and
48
+ * only the type would have lied.
36
49
  */
37
50
  export const mergeSlotProps = (receivedProps, ownProps) => {
38
51
  const definedOwnProps = Object.fromEntries(Object.entries(ownProps).filter(([, value]) => value !== undefined));
@@ -1 +1 @@
1
- {"version":3,"file":"slotProps.js","sourceRoot":"","sources":["../src/slotProps.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;AA6FjD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG,CAG5B,aAAwB,EACxB,QAAkB,EACI,EAAE;IACxB,MAAM,eAAe,GAAG,MAAM,CAAC,WAAW,CACxC,MAAM,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,MAAM,CAC7B,CAAC,CAAC,EAAE,KAAK,CAAC,EAAE,EAAE,CAAC,KAAK,KAAK,SAAS,CACnC,CACU,CAAA;IAEb,MAAM,WAAW,GAAG;QAClB,aAAa,CAAC,kBAAkB,CAAC;QACjC,QAAQ,CAAC,kBAAkB,CAAC;KAC7B;SACE,MAAM,CAAC,OAAO,CAAC;SACf,IAAI,CAAC,GAAG,CAAC,CAAA;IAEZ,OAAO;QACL,GAAG,aAAa;QAChB,GAAG,eAAe;QAClB,kBAAkB,EAChB,WAAW,KAAK,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,WAAW;QAC9C,sDAAsD;QACtD,6DAA6D;QAC7D,8BAA8B;QAC9B,GAAG,eAAe,CAChB,aAAwC,EACxC,eAAe,CAChB;KACF,CAAA;AACH,CAAC,CAAA"}
1
+ {"version":3,"file":"slotProps.js","sourceRoot":"","sources":["../src/slotProps.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;AA6FjD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+CG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG,CAI5B,aAA4B,EAC5B,QAAkB,EACQ,EAAE;IAC5B,MAAM,eAAe,GAAG,MAAM,CAAC,WAAW,CACxC,MAAM,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,MAAM,CAC7B,CAAC,CAAC,EAAE,KAAK,CAAC,EAAE,EAAE,CAAC,KAAK,KAAK,SAAS,CACnC,CACU,CAAA;IAEb,MAAM,WAAW,GAAG;QAClB,aAAa,CAAC,kBAAkB,CAAC;QACjC,QAAQ,CAAC,kBAAkB,CAAC;KAC7B;SACE,MAAM,CAAC,OAAO,CAAC;SACf,IAAI,CAAC,GAAG,CAAC,CAAA;IAEZ,OAAO;QACL,GAAG,aAAa;QAChB,GAAG,eAAe;QAClB,kBAAkB,EAChB,WAAW,KAAK,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,WAAW;QAC9C,sDAAsD;QACtD,6DAA6D;QAC7D,8BAA8B;QAC9B,GAAG,eAAe,CAChB,aAAwC,EACxC,eAAe,CAChB;KACF,CAAA;AACH,CAAC,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@charcuterie/ui",
3
- "version": "3.6.0",
3
+ "version": "3.8.0",
4
4
  "description": "The Charcuterie components. Tokens for look, @charcuterie/logic for state, ARIA that agents can actually drive.",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -86,6 +86,38 @@ does not become one. `isChecked` still seeds the box, `onChange` still reports a
86
86
 
87
87
  <Canvas of={CheckboxStories.WithValues} />
88
88
 
89
+ ## A hint follows the box
90
+
91
+ `description` is standing help bound with `aria-describedby`, so a screen reader reads it
92
+ **with** the control rather than announcing it from nowhere — the same slot, the same words
93
+ and the same announcement order as [`Field`](/docs/components-field--docs)'s.
94
+
95
+ `Field` has had one since it shipped and this component had none, which is a gap you only
96
+ feel in a mixed box: a hint after a checkbox had to be the app's own paragraph while the
97
+ hint after the `Field` two rows down came from the library, and the two disagreed about how
98
+ big a hint is. One control's help looking unlike its neighbour's, in the same editor.
99
+
100
+ The hint renders **outside** the `<label>`, which is the only place it can go. A `<label>`'s
101
+ text content *is* the control's accessible name, so a hint inside it would be announced
102
+ twice — once inside the name, once again as the description — and a pointer press on a
103
+ sentence of explanation would toggle the box. So the `<label>` is no longer the outermost
104
+ element this component renders: a `<div>` holds the row and the hint, and `className` moves
105
+ out to it, because `className` is the outermost box a component renders and that rule does
106
+ not bend for this one.
107
+
108
+ Two smaller decisions inside it:
109
+
110
+ - **`opacity-60` stays on the `<label>`** and does not reach the hint. axe exempts a
111
+ disabled control and its own label from the colour-contrast rule and exempts nothing else,
112
+ so dimming the hint with the box measures **3.77:1** on `midnight` against a 4.5
113
+ threshold. A hint nobody can read is worse than a hint that does not dim, and a turned-off
114
+ box is exactly when that sentence gets read.
115
+ - **There is no `error` to go with it.** `Field` derives `aria-invalid` from its error, and a
116
+ lone boolean is almost never the invalid thing — a *group* of them is, and a group's error
117
+ belongs on the `FieldGroup` around it, described rather than asserted.
118
+
119
+ <Canvas of={CheckboxStories.WithDescriptions} />
120
+
89
121
  ## Checkbox or `Switch`
90
122
 
91
123
  Same state kind, different meaning. A checkbox is a value you **submit** — "delete