@box-kite/react 2.3.0 → 2.4.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 (57) hide show
  1. package/.claude/rules/box-kite-rules.md +58 -92
  2. package/.claude/skills/box-kite/SKILL.md +81 -114
  3. package/.claude/skills/box-kite/references/components.md +1 -1
  4. package/.claude/skills/box-kite/references/patterns.md +1 -1
  5. package/.claude/skills/box-kite/references/rules.md +115 -0
  6. package/.claude/skills/box-kite/references/styling.md +2 -2
  7. package/.cursor/rules/box-kite.mdc +61 -95
  8. package/AGENTS.md +62 -96
  9. package/BOX_AI_CONTEXT.md +82 -78
  10. package/BOX_KITE_AI_CONTEXT.md +82 -78
  11. package/README.md +201 -716
  12. package/catalog.cjs +1 -1
  13. package/catalog.mjs +3 -0
  14. package/client.cjs +1 -1
  15. package/client.mjs +81 -81
  16. package/components/combobox/comboboxListbox.d.ts +2 -1
  17. package/components/combobox.cjs +1 -1
  18. package/components/combobox.d.ts +1 -1
  19. package/components/combobox.mjs +199 -188
  20. package/components/dataGrid/components/dataGridFooter.d.ts +6 -2
  21. package/components/dataGrid/contracts/dataGridContract.d.ts +2 -1
  22. package/components/dataGrid/models/gridModel.d.ts +21 -2
  23. package/components/dataGrid/models/groupRowModel.d.ts +1 -1
  24. package/components/dataGrid/models/rowModel.d.ts +1 -1
  25. package/components/dataGrid/models/sourceGroupRowModel.d.ts +5 -1
  26. package/components/dataGrid/models/sourceRowModel.d.ts +5 -1
  27. package/components/dataGrid/useListLayout.d.ts +1 -1
  28. package/components/dataGrid.cjs +3 -3
  29. package/components/dataGrid.mjs +732 -682
  30. package/components/radioGroup.cjs +1 -1
  31. package/components/radioGroup.mjs +1 -0
  32. package/components/semantics.d.ts +29 -29
  33. package/components/skeleton.cjs +1 -1
  34. package/components/skeleton.d.ts +1 -1
  35. package/components/skeleton.mjs +2 -1
  36. package/components/sortableList.cjs +1 -1
  37. package/components/sortableList.mjs +1 -1
  38. package/components/svg.d.ts +2 -2
  39. package/components/swipeItem.cjs +1 -1
  40. package/components/swipeItem.mjs +1 -1
  41. package/components/textarea.d.ts +1 -1
  42. package/components/textbox.d.ts +1 -1
  43. package/components/timeZoneSelect.d.ts +1 -1
  44. package/components/toaster.cjs +1 -1
  45. package/components/toaster.mjs +13 -14
  46. package/dataGridList.cjs +1 -1
  47. package/dataGridList.mjs +3 -5
  48. package/docs/a11y.md +1 -2
  49. package/docs/index.md +1 -1
  50. package/docs/props.md +43 -19
  51. package/effects.cjs +1 -1
  52. package/effects.mjs +2 -2
  53. package/identity.cjs +1 -1
  54. package/identity.mjs +5 -7
  55. package/package.json +12 -12
  56. package/react/effects.d.ts +5 -6
  57. package/react/identity/useIdentifier.d.ts +0 -3
@@ -48,11 +48,17 @@ export default class GridModel<TRow> {
48
48
  */
49
49
  rowVersion(row: RowModel<TRow> | GroupRowModel<TRow> | DetailRowModel<TRow>, index: number): string;
50
50
  private _selectionVersion;
51
+ private _layoutVersion;
51
52
  /**
52
- * What the memoized header compares: a grid-wide change, or the selection its checkbox shows. A focus move
53
- * re-renders the component holding the tab stop, and the header — filter row included — no longer with it.
53
+ * What the memoized header compares: a grid-wide change, the selection its checkbox shows, or a column width.
54
+ * A focus move re-renders the component holding the tab stop, and the header — filter row included — no longer with it.
54
55
  */
55
56
  get headerVersion(): string;
57
+ /**
58
+ * A width changed. A row reads its widths through the CSS variables `paintSizes` writes, so only the header
59
+ * (its resizers' values) redraws: a notify here re-rendered every row on each frame of a window drag.
60
+ */
61
+ notifyLayout: () => void;
56
62
  /**
57
63
  * Sync incoming props. Called during render by the framework adapter — clears
58
64
  * the affected memos but does NOT notify (no extra render cycle; memos recompute
@@ -123,6 +129,14 @@ export default class GridModel<TRow> {
123
129
  * Get filtered data (applies external, global, then column filters)
124
130
  */
125
131
  get filteredData(): TRow[];
132
+ /**
133
+ * Filtering and sorting are kept on the values they read rather than on the column models: an inline `def` is
134
+ * a new object every parent render, which rebuilt the columns and re-sorted 100,000 rows in 47ms each time.
135
+ */
136
+ private readonly _filtered;
137
+ private readonly _sorted;
138
+ private readonly _rowModels;
139
+ private static reuse;
126
140
  /** What the grid tells `Box.onInteraction` about a change no host callback carries; `content` names what a person typed. */
127
141
  reportInteraction(type: InteractionType<'datagrid'>, value: unknown, reason?: string, details?: Record<string, unknown>, content?: readonly string[]): void;
128
142
  /**
@@ -346,6 +360,11 @@ export default class GridModel<TRow> {
346
360
  /** Group rows shut by hand, which is what a `groupDefaultExpanded` grid needs to remember. */
347
361
  private _collapsedGroupRow;
348
362
  toggleGroupRow: (groupRowKey: Key, expanded?: boolean) => void;
363
+ /**
364
+ * Opening a row changes which rows are shown, not which rows there are: the filtered, sorted and grouped
365
+ * models stand, and only their flattening is redone. A datasource and a tree build the list from it.
366
+ */
367
+ private expansionChanged;
349
368
  /**
350
369
  * A tree row opened or shut. The walk over the rows is a different walk — and where the tree is lazy the
351
370
  * level just opened has not been asked for yet, which is what the bumped version tells the fetch effect.
@@ -8,7 +8,7 @@ export default class GroupRowModel<TRow> {
8
8
  readonly grid: GridModel<TRow>;
9
9
  readonly groupColumn: ColumnModel<TRow>;
10
10
  readonly rows: RowModel<TRow>[] | GroupRowModel<TRow>[];
11
- readonly rowIndex: number;
11
+ rowIndex: number;
12
12
  constructor(grid: GridModel<TRow>, groupColumn: ColumnModel<TRow>, rows: RowModel<TRow>[] | GroupRowModel<TRow>[], rowIndex: number, groupValue: Key);
13
13
  protected _groupValue: Key;
14
14
  /**
@@ -5,7 +5,7 @@ import { default as GridModel } from './gridModel';
5
5
  import { default as GroupRowModel } from './groupRowModel';
6
6
  export default class RowModel<TRow> {
7
7
  readonly grid: GridModel<TRow>;
8
- readonly rowIndex: number;
8
+ rowIndex: number;
9
9
  constructor(grid: GridModel<TRow>, data: TRow, rowIndex: number);
10
10
  protected _data: TRow;
11
11
  /**
@@ -14,7 +14,11 @@ import { default as SourceLevel } from './sourceLevel';
14
14
  */
15
15
  export default class SourceGroupRowModel<TRow> extends GroupRowModel<TRow> {
16
16
  private readonly level;
17
- constructor(grid: GridModel<TRow>, level: SourceLevel<TRow>, groupColumn: ColumnModel<TRow>, rowIndex: number);
17
+ /** Where it sits in that level's block cache; `rowIndex` is where it sits on screen (bug #327). */
18
+ private readonly levelIndex;
19
+ constructor(grid: GridModel<TRow>, level: SourceLevel<TRow>, groupColumn: ColumnModel<TRow>,
20
+ /** Where it sits in that level's block cache; `rowIndex` is where it sits on screen (bug #327). */
21
+ levelIndex: number, display?: number);
18
22
  private get row();
19
23
  /** The row the server sent for this group: its value, and whatever totals came with it. */
20
24
  get data(): TRow | undefined;
@@ -15,9 +15,13 @@ import { default as SourceLevel } from './sourceLevel';
15
15
  export default class SourceRowModel<TRow> extends RowModel<TRow> {
16
16
  /** The level it belongs to: the top one, or the group or tree row somebody opened. */
17
17
  protected readonly sourceLevel: SourceLevel<TRow>;
18
+ /** Where it sits in that level's block cache; `rowIndex` is where it sits on screen (bug #327). */
19
+ protected readonly levelIndex: number;
18
20
  constructor(grid: GridModel<TRow>,
19
21
  /** The level it belongs to: the top one, or the group or tree row somebody opened. */
20
- sourceLevel: SourceLevel<TRow>, rowIndex: number);
22
+ sourceLevel: SourceLevel<TRow>,
23
+ /** Where it sits in that level's block cache; `rowIndex` is where it sits on screen (bug #327). */
24
+ levelIndex: number, display?: number);
21
25
  private get row();
22
26
  get data(): TRow;
23
27
  get placeholder(): boolean;
@@ -7,7 +7,7 @@ type ListLayout = typeof DataGridList;
7
7
  export declare function loadListLayout(): Promise<ListLayout>;
8
8
  /**
9
9
  * The list layout's component once it has arrived, or `undefined` while the grid should go on drawing its
10
- * table. No `React.lazy`: a Suspense boundary is the one thing a React 16 or 17 server cannot render.
10
+ * table. No `React.lazy`: a boundary that suspends while hydrating throws the server's HTML away.
11
11
  */
12
12
  export default function useListLayout(active: boolean): ListLayout | undefined;
13
13
  export {};