@krizaka/ui 2.10.0 → 3.0.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 (184) hide show
  1. package/README.md +3 -1
  2. package/dist/audio-player.js +1 -1
  3. package/dist/{chunk-EUPTXKH7.js → chunk-BRKMQ6JV.js} +2 -1
  4. package/dist/chunk-FDCMBWUU.js +168 -0
  5. package/dist/chunk-FDCMBWUU.js.map +1 -0
  6. package/dist/chunk-HCNOOPZE.js +210 -0
  7. package/dist/chunk-HCNOOPZE.js.map +1 -0
  8. package/dist/{chunk-X6TW3X6Y.js → chunk-LCZXS6AK.js} +2 -2
  9. package/dist/chunk-OGJI5X4W.js +157 -0
  10. package/dist/chunk-OGJI5X4W.js.map +1 -0
  11. package/dist/combobox.js +2 -2
  12. package/dist/data-table.d.ts +284 -24
  13. package/dist/data-table.js +914 -121
  14. package/dist/data-table.js.map +1 -1
  15. package/dist/date-picker.js +1 -1
  16. package/dist/filter-bar.d.ts +12 -12
  17. package/dist/filter-bar.js +9 -145
  18. package/dist/filter-bar.js.map +1 -1
  19. package/dist/image-cropper.js +1 -1
  20. package/dist/media-capture.js +1 -1
  21. package/dist/native/list.d.ts +95 -0
  22. package/dist/native/list.js +135 -0
  23. package/dist/native/list.js.map +1 -0
  24. package/dist/search-field.js +6 -160
  25. package/dist/search-field.js.map +1 -1
  26. package/dist/tag-input.js +2 -2
  27. package/dist/video-player.js +1 -1
  28. package/dist/video-trimmer.js +1 -1
  29. package/dist/virtual.d.ts +140 -0
  30. package/dist/virtual.js +19 -0
  31. package/dist/virtual.js.map +1 -0
  32. package/package.json +66 -6
  33. package/registry/achievement.json +1 -1
  34. package/registry/action-bar.json +1 -1
  35. package/registry/alert.json +1 -1
  36. package/registry/app-shell.json +1 -1
  37. package/registry/argument-card.json +1 -1
  38. package/registry/audio-player.json +1 -1
  39. package/registry/auth-layout.json +1 -1
  40. package/registry/avatar.json +1 -1
  41. package/registry/badge.json +1 -1
  42. package/registry/button.json +1 -1
  43. package/registry/card-grid.json +1 -1
  44. package/registry/card.json +1 -1
  45. package/registry/catalogue-page.json +1 -1
  46. package/registry/changelog-page.json +1 -1
  47. package/registry/checkbox.json +1 -1
  48. package/registry/chip-link.json +1 -1
  49. package/registry/chip.json +1 -1
  50. package/registry/choice-grid.json +1 -1
  51. package/registry/code-block.json +1 -1
  52. package/registry/combobox.json +1 -1
  53. package/registry/command.json +1 -1
  54. package/registry/component-page.json +1 -1
  55. package/registry/confirm-button.json +1 -1
  56. package/registry/contact-page.json +1 -1
  57. package/registry/continue-prompt.json +1 -1
  58. package/registry/countdown.json +1 -1
  59. package/registry/cta-panel.json +1 -1
  60. package/registry/dashboard-layout.json +1 -1
  61. package/registry/data-table.json +643 -49
  62. package/registry/date-picker.json +1 -1
  63. package/registry/decision-list.json +1 -1
  64. package/registry/detail-layout.json +1 -1
  65. package/registry/dialog.json +1 -1
  66. package/registry/docs-article-page.json +1 -1
  67. package/registry/docs-hub-page.json +1 -1
  68. package/registry/docs-layout.json +1 -1
  69. package/registry/dropdown-menu.json +1 -1
  70. package/registry/empty-state.json +1 -1
  71. package/registry/error-page.json +1 -1
  72. package/registry/examples/data-table/details.d.ts +4 -0
  73. package/registry/examples/data-table/details.js +33 -0
  74. package/registry/examples/data-table/details.tsx +31 -0
  75. package/registry/examples/data-table/filters.d.ts +4 -0
  76. package/registry/examples/data-table/filters.js +40 -0
  77. package/registry/examples/data-table/filters.tsx +40 -0
  78. package/registry/examples/data-table/grouped.d.ts +4 -0
  79. package/registry/examples/data-table/grouped.js +24 -0
  80. package/registry/examples/data-table/grouped.tsx +23 -0
  81. package/registry/examples/data-table/paginated.d.ts +4 -0
  82. package/registry/examples/data-table/paginated.js +23 -0
  83. package/registry/examples/data-table/paginated.tsx +22 -0
  84. package/registry/examples/data-table/pinned.d.ts +4 -0
  85. package/registry/examples/data-table/pinned.js +26 -0
  86. package/registry/examples/data-table/pinned.tsx +25 -0
  87. package/registry/examples/data-table/server.d.ts +4 -0
  88. package/registry/examples/data-table/server.js +40 -0
  89. package/registry/examples/data-table/server.tsx +40 -0
  90. package/registry/examples/data-table/virtualized.js +2 -2
  91. package/registry/examples/data-table/virtualized.tsx +3 -3
  92. package/registry/examples/list/native/default.d.ts +4 -0
  93. package/registry/examples/list/native/default.dark.png +0 -0
  94. package/registry/examples/list/native/default.js +33 -0
  95. package/registry/examples/list/native/default.light.png +0 -0
  96. package/registry/examples/list/native/default.tsx +31 -0
  97. package/registry/examples/list/native/infinite.d.ts +4 -0
  98. package/registry/examples/list/native/infinite.dark.png +0 -0
  99. package/registry/examples/list/native/infinite.js +30 -0
  100. package/registry/examples/list/native/infinite.light.png +0 -0
  101. package/registry/examples/list/native/infinite.tsx +35 -0
  102. package/registry/examples/list/native/states.d.ts +4 -0
  103. package/registry/examples/list/native/states.dark.png +0 -0
  104. package/registry/examples/list/native/states.js +26 -0
  105. package/registry/examples/list/native/states.light.png +0 -0
  106. package/registry/examples/list/native/states.tsx +21 -0
  107. package/registry/examples/virtual/feed.d.ts +4 -0
  108. package/registry/examples/virtual/feed.js +26 -0
  109. package/registry/examples/virtual/feed.tsx +24 -0
  110. package/registry/examples/virtual/gallery.d.ts +4 -0
  111. package/registry/examples/virtual/gallery.js +31 -0
  112. package/registry/examples/virtual/gallery.tsx +28 -0
  113. package/registry/examples/virtual/messages.d.ts +4 -0
  114. package/registry/examples/virtual/messages.js +28 -0
  115. package/registry/examples/virtual/messages.tsx +28 -0
  116. package/registry/field.json +1 -1
  117. package/registry/file-upload.json +1 -1
  118. package/registry/filter-bar.json +1 -1
  119. package/registry/gallery-page.json +1 -1
  120. package/registry/glow-card.json +1 -1
  121. package/registry/goal-gauge.json +1 -1
  122. package/registry/how-it-works-page.json +1 -1
  123. package/registry/image-cropper.json +1 -1
  124. package/registry/index.json +48 -5
  125. package/registry/iso.json +1 -1
  126. package/registry/kbd.json +1 -1
  127. package/registry/landing-page.json +1 -1
  128. package/registry/landscape.json +1 -1
  129. package/registry/legal-page.json +1 -1
  130. package/registry/link-card.json +1 -1
  131. package/registry/list.json +249 -0
  132. package/registry/loader.json +1 -1
  133. package/registry/longform-page.json +1 -1
  134. package/registry/marketing-layout.json +1 -1
  135. package/registry/marquee.json +1 -1
  136. package/registry/mascot-quote.json +1 -1
  137. package/registry/mascot-state.json +1 -1
  138. package/registry/mascots.json +1 -1
  139. package/registry/media-capture.json +1 -1
  140. package/registry/meter.json +1 -1
  141. package/registry/nav-bar.json +1 -1
  142. package/registry/number-ticker.json +1 -1
  143. package/registry/page-header.json +1 -1
  144. package/registry/page-hero.json +1 -1
  145. package/registry/page.json +1 -1
  146. package/registry/pagination.json +1 -1
  147. package/registry/pointer-light.json +1 -1
  148. package/registry/popover.json +1 -1
  149. package/registry/pricing-page.json +1 -1
  150. package/registry/product-page.json +1 -1
  151. package/registry/profile-card.json +1 -1
  152. package/registry/progress.json +1 -1
  153. package/registry/promise-card.json +1 -1
  154. package/registry/radio-group.json +1 -1
  155. package/registry/scroll-stage.json +1 -1
  156. package/registry/search-field.json +1 -1
  157. package/registry/section-backdrop.json +1 -1
  158. package/registry/separator.json +1 -1
  159. package/registry/settings-layout.json +1 -1
  160. package/registry/skeleton.json +1 -1
  161. package/registry/slider.json +1 -1
  162. package/registry/slot.json +1 -1
  163. package/registry/spinner.json +1 -1
  164. package/registry/split-view.json +1 -1
  165. package/registry/stage-banner.json +1 -1
  166. package/registry/stat.json +1 -1
  167. package/registry/status-page.json +1 -1
  168. package/registry/stepper.json +1 -1
  169. package/registry/switch.json +1 -1
  170. package/registry/tabs.json +1 -1
  171. package/registry/tag-input.json +1 -1
  172. package/registry/terminal-replay.json +1 -1
  173. package/registry/theme.json +1 -1
  174. package/registry/toast.json +1 -1
  175. package/registry/toc.json +1 -1
  176. package/registry/tooltip.json +1 -1
  177. package/registry/video-player.json +1 -1
  178. package/registry/video-trimmer.json +1 -1
  179. package/registry/virtual.json +569 -0
  180. package/skills/data-table/SKILL.md +56 -0
  181. package/skills/native-list/SKILL.md +39 -0
  182. package/skills/virtual/SKILL.md +35 -0
  183. /package/dist/{chunk-EUPTXKH7.js.map → chunk-BRKMQ6JV.js.map} +0 -0
  184. /package/dist/{chunk-X6TW3X6Y.js.map → chunk-LCZXS6AK.js.map} +0 -0
package/README.md CHANGED
@@ -176,7 +176,8 @@ light or a product's — is a set of tokens.
176
176
  | `@krizaka/ui/iso` | the isometric kit: `IsoHub` (a hero driven by data: `layers`, `dome`, `satellites`, `highlight`), `IsoScene`, `IsoPrism`, `IsoStack`, `IsoDome`, `IsoTile`, `IsoLink`, `IsoNode`, `IsoLabel`, the projection helpers — static SVG animated by motion.css | server |
177
177
  | `@krizaka/ui/motion` | `MotionObserver` (reveal, off-screen pause, settle, spotlight, magnetism) and `RotatingWord` (no layout shift) | client |
178
178
  | `@krizaka/ui/pagination` | `Pagination` (pages: `page`, `pageCount`, `onPageChange` or `getHref` for links; cursor: `hasPrevious`/`hasNext`, `onPrevious`/`onNext`; `status`, `pageSize` + `pageSizeOptions`, `siblings`, `boundaries`, `labels`; folds into "Page 3 of 12" in a narrow container), `pageRange` | server |
179
- | `@krizaka/ui/data-table` | `DataTable` (`rows`, `columns` with `header`, `cell`, `value`, `sortable`, `align`, `card` title·label·hidden; `caption`, `sort`/`defaultSort` + `onSortChange`, `manualSort`, `selectable` + `selected`, `loading`, `empty`, `error`, `layout` auto·table·cards, `density`, `virtualize`, `footer`) | client |
179
+ | `@krizaka/ui/data-table` | **v2, on TanStack Table v9** (never imported by a product): `DataTable` (`rows`, `columns` with `header`, `cell`, `value`, `sortable`, `filter` text·facet·range + `options`, `groupable` + `aggregate`, `align`, `width`, `card`, `hideable`; `caption`, `sort`, `filters`, `selected` + `selectable`, `groupBy`, `columnVisibility`, `expanded` + `renderDetail` / `getSubRows`, `page` + `pageSize` / `pageSizeOptions`, each controlled or `default*`; `pinning`, `resizing`, `manual` sorting·filtering·pagination + `rowCount` + `onStateChange` (server mode), `virtualized`, `loading`, `empty`, `error`, `layout` auto·table·cards, `density`, `toolbar`, `footer`, `labels`), the toolbar `DataTableFilters` · `DataTableColumnsMenu` · `DataTableExport`, `useDataTable()` (the TanStack instance), `dataTableCsv` | client |
180
+ | `@krizaka/ui/virtual` | On TanStack Virtual v3: `VirtualList` (own region or `scroll="window"`, measured items, `onEndReached`, `ref.scrollToIndex`), `VirtualGrid` (columns that fit the width), `useVirtualizer` / `useWindowVirtualizer` through the facade | client |
180
181
  | `@krizaka/ui/filter-bar` | `FilterBar` (`label`, the controls as children, `active` chips, `onClearAll`, `results` announced), `FilterMenu` (checkboxes or radios with counts), `readFilterParams` / `writeFilterParams` (the filters in the address) | client |
181
182
  | `@krizaka/ui/combobox` | `Combobox` (ARIA 1.2: `options` or `onSearch(query, signal)` debounced, `multiple` chips + `maxSelected`, `creatable` + `onCreate`, `separators`, `hint`, `error`, `labels`) | client |
182
183
  | `@krizaka/ui/tag-input` | `TagInput` (free words as chips: `suggestions`, `normalize`, `validate`, `max`, `separators`, paste split) | client |
@@ -224,6 +225,7 @@ light or a product's — is a set of tokens.
224
225
  | `@krizaka/ui/error-page` | `ErrorPage` — a page template, see [Page templates](#page-templates) | server |
225
226
  | `@krizaka/ui/pricing-page` | `PricingPage` — a page template, see [Page templates](#page-templates) | server |
226
227
  | `@krizaka/ui/native/video-player` | React Native `VideoPlayer` on expo-video (optional peer) | native |
228
+ | `@krizaka/ui/native/list` | React Native `List` on FlashList v2 and `useInfiniteList` on `useInfiniteQuery` of `@krizaka/query` (optional peers): separators, skeleton rows, empty/error, pull to refresh, the next page near the end | native |
227
229
  | `@krizaka/ui/native/media-capture` | React Native `MediaCapture` on expo-camera (optional peer) | native |
228
230
  | `@krizaka/ui` | the marks, `MotionObserver`, `RotatingWord`, `cx` (unchanged) | client |
229
231
  | `@krizaka/ui/native` | React Native: `ThemeProvider`/`useTheme`, `Txt`, `Button`, `IconButton`, `Card.*`, `Badge`, `Chip` (+ `Group`), `Avatar` (+ `Group`), `Skeleton`, `EmptyState`, `Spinner`, `Countdown`, `Segmented`, `Progress`, `Toaster`/`toast`, `Pagination`, `SearchField`, the marks — see [React Native](#react-native) | native |
@@ -4,7 +4,7 @@ import {
4
4
  formatClock,
5
5
  playSafely,
6
6
  useInView
7
- } from "./chunk-EUPTXKH7.js";
7
+ } from "./chunk-BRKMQ6JV.js";
8
8
  import {
9
9
  PauseGlyph,
10
10
  PlayGlyph
@@ -87,9 +87,10 @@ export {
87
87
  formatClock,
88
88
  clamp,
89
89
  usePrefersReducedMotion,
90
+ useLatest,
90
91
  useInView,
91
92
  useDebouncedCallback,
92
93
  useControllable,
93
94
  playSafely
94
95
  };
95
- //# sourceMappingURL=chunk-EUPTXKH7.js.map
96
+ //# sourceMappingURL=chunk-BRKMQ6JV.js.map
@@ -0,0 +1,168 @@
1
+ "use client";
2
+ import {
3
+ useListbox
4
+ } from "./chunk-ZIXB33X7.js";
5
+ import {
6
+ useControllable,
7
+ useDebouncedCallback
8
+ } from "./chunk-BRKMQ6JV.js";
9
+ import {
10
+ CloseGlyph,
11
+ SearchGlyph
12
+ } from "./chunk-CPA5CF35.js";
13
+
14
+ // src/search-field/search-field.tsx
15
+ import * as React from "react";
16
+ import { tv as tv2 } from "tailwind-variants";
17
+
18
+ // src/kbd/kbd.tsx
19
+ import { tv } from "tailwind-variants";
20
+ import { jsx } from "react/jsx-runtime";
21
+ var kbdVariants = tv({
22
+ base: "inline-flex shrink-0 items-center justify-center rounded-md border border-border-default border-b-2 bg-surface-2 font-mono font-semibold text-fg-secondary",
23
+ variants: { size: { sm: "h-5 min-w-5 px-1 text-[10px]", md: "h-6 min-w-6 px-1.5 text-xs" } },
24
+ defaultVariants: { size: "md" }
25
+ });
26
+ function Kbd({ size, className, ...props }) {
27
+ return /* @__PURE__ */ jsx("kbd", { className: kbdVariants({ size, className }), ...props });
28
+ }
29
+
30
+ // src/search-field/search-field.tsx
31
+ import { jsx as jsx2, jsxs } from "react/jsx-runtime";
32
+ var searchField = tv2({
33
+ slots: {
34
+ root: "relative w-full",
35
+ control: "flex h-11 w-full items-center gap-2 rounded-lg border border-border-default bg-surface-2 pl-3 pr-1.5 text-sm text-fg transition-[border-color,box-shadow] focus-within:border-accent focus-within:ring-2 focus-within:ring-ring",
36
+ icon: "h-4 w-4 shrink-0 text-fg-secondary",
37
+ input: "h-full min-w-0 flex-1 bg-transparent text-sm text-fg outline-hidden placeholder:text-fg-muted [&::-webkit-search-cancel-button]:appearance-none",
38
+ clear: "inline-flex h-8 w-8 shrink-0 items-center justify-center rounded-md text-fg-secondary hover:bg-surface-3 hover:text-fg focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring",
39
+ shortcut: "hidden shrink-0 items-center gap-0.5 pr-1 sm:flex",
40
+ list: "absolute inset-x-0 top-full z-50 mt-1 max-h-72 overflow-y-auto rounded-lg border border-border-default bg-surface-2 p-1 shadow-lg",
41
+ option: "flex cursor-pointer select-none items-center gap-2.5 rounded-md px-2.5 py-2 text-sm text-fg data-[active]:bg-surface-3",
42
+ group: "px-2.5 pb-1 pt-2 text-[11px] font-semibold uppercase text-fg-muted"
43
+ },
44
+ variants: {
45
+ size: { md: {}, sm: { control: "h-9", clear: "h-7 w-7" } }
46
+ },
47
+ defaultVariants: { size: "md" }
48
+ });
49
+ var isApple = () => typeof navigator !== "undefined" && /Mac|iPhone|iPad/.test(navigator.platform || navigator.userAgent);
50
+ function SearchField({
51
+ label,
52
+ value: valueProp,
53
+ defaultValue = "",
54
+ onValueChange,
55
+ onSearch,
56
+ debounce = 250,
57
+ onSubmit,
58
+ shortcut = false,
59
+ suggestions,
60
+ suggestionsLabel,
61
+ onSuggestionSelect,
62
+ clearLabel = "Clear search",
63
+ landmark = true,
64
+ size,
65
+ className,
66
+ placeholder,
67
+ ...props
68
+ }) {
69
+ const s = searchField({ size });
70
+ const [value, setValue] = useControllable(valueProp, defaultValue, onValueChange);
71
+ const [open, setOpen] = React.useState(false);
72
+ const [apple, setApple] = React.useState(false);
73
+ const input = React.useRef(null);
74
+ const search = useDebouncedCallback((query) => onSearch?.(query), debounce);
75
+ const list = suggestions ?? [];
76
+ const pick = (i) => {
77
+ const suggestion = list[i];
78
+ if (!suggestion) return;
79
+ setOpen(false);
80
+ onSuggestionSelect?.(suggestion);
81
+ };
82
+ const listbox = useListbox({ count: list.length, onPick: pick, open: open && list.length > 0, setOpen });
83
+ React.useEffect(() => {
84
+ if (!shortcut) return;
85
+ setApple(isApple());
86
+ const onKey = (event) => {
87
+ if (event.key.toLowerCase() === shortcut.toLowerCase() && (event.metaKey || event.ctrlKey) && !event.altKey) {
88
+ event.preventDefault();
89
+ input.current?.focus();
90
+ input.current?.select();
91
+ }
92
+ };
93
+ window.addEventListener("keydown", onKey);
94
+ return () => window.removeEventListener("keydown", onKey);
95
+ }, [shortcut]);
96
+ const change = (query) => {
97
+ setValue(query);
98
+ search(query);
99
+ listbox.setActive(-1);
100
+ setOpen(true);
101
+ };
102
+ const field = /* @__PURE__ */ jsxs("div", { className: s.root({ className }), onBlur: (event) => !event.currentTarget.contains(event.relatedTarget) && setOpen(false), children: [
103
+ /* @__PURE__ */ jsxs("div", { className: s.control(), children: [
104
+ /* @__PURE__ */ jsx2(SearchGlyph, { className: s.icon() }),
105
+ /* @__PURE__ */ jsx2(
106
+ "input",
107
+ {
108
+ ref: input,
109
+ type: "search",
110
+ "aria-label": label,
111
+ enterKeyHint: "search",
112
+ autoComplete: "off",
113
+ ...list.length > 0 ? listbox.inputProps : {},
114
+ value,
115
+ placeholder,
116
+ className: s.input(),
117
+ onChange: (event) => change(event.target.value),
118
+ onFocus: () => setOpen(true),
119
+ onKeyDown: (event) => {
120
+ if (list.length > 0 && listbox.onKeyDown(event)) return;
121
+ if (event.key === "Enter") {
122
+ event.preventDefault();
123
+ search.cancel();
124
+ onSearch?.(value);
125
+ onSubmit?.(value);
126
+ setOpen(false);
127
+ } else if (event.key === "Escape" && value) {
128
+ event.preventDefault();
129
+ change("");
130
+ }
131
+ },
132
+ ...props
133
+ }
134
+ ),
135
+ value ? /* @__PURE__ */ jsx2(
136
+ "button",
137
+ {
138
+ type: "button",
139
+ "aria-label": clearLabel,
140
+ className: s.clear(),
141
+ onClick: () => {
142
+ change("");
143
+ input.current?.focus();
144
+ },
145
+ children: /* @__PURE__ */ jsx2(CloseGlyph, { className: "h-4 w-4" })
146
+ }
147
+ ) : shortcut ? /* @__PURE__ */ jsxs("span", { className: s.shortcut(), "aria-hidden": true, children: [
148
+ /* @__PURE__ */ jsx2(Kbd, { size: "sm", children: apple ? "\u2318" : "Ctrl" }),
149
+ /* @__PURE__ */ jsx2(Kbd, { size: "sm", children: shortcut.toUpperCase() })
150
+ ] }) : null
151
+ ] }),
152
+ list.length > 0 && /* @__PURE__ */ jsxs("div", { hidden: !open, className: s.list(), children: [
153
+ suggestionsLabel ? /* @__PURE__ */ jsx2("div", { "aria-hidden": true, className: s.group(), children: suggestionsLabel }) : null,
154
+ /* @__PURE__ */ jsx2("div", { id: listbox.listId, role: "listbox", "aria-label": suggestionsLabel ?? label, children: list.map((suggestion, i) => /* @__PURE__ */ jsxs("div", { ...listbox.optionProps(i, false), className: s.option(), children: [
155
+ /* @__PURE__ */ jsx2(SearchGlyph, { className: "h-3.5 w-3.5 shrink-0 text-fg-muted" }),
156
+ /* @__PURE__ */ jsx2("span", { className: "min-w-0 flex-1 truncate", children: suggestion.label }),
157
+ suggestion.meta ? /* @__PURE__ */ jsx2("span", { className: "shrink-0 text-xs text-fg-secondary", children: suggestion.meta }) : null
158
+ ] }, suggestion.value)) })
159
+ ] })
160
+ ] });
161
+ return landmark ? /* @__PURE__ */ jsx2("div", { role: "search", children: field }) : field;
162
+ }
163
+
164
+ export {
165
+ searchField,
166
+ SearchField
167
+ };
168
+ //# sourceMappingURL=chunk-FDCMBWUU.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/search-field/search-field.tsx","../src/kbd/kbd.tsx"],"sourcesContent":["// Client. A search input (`type=\"search\"` inside a `role=\"search\"` landmark when it stands alone): a leading glyph,\n// a clear button, a global shortcut that focuses it (⌘K on Apple devices, Ctrl+K elsewhere, shown as `Kbd`), and\n// optional suggestions through the shared combobox engine. `onSearch` is debounced; Enter submits.\nimport * as React from \"react\";\nimport { tv } from \"tailwind-variants\";\n\nimport { CloseGlyph, SearchGlyph } from \"../glyphs\";\nimport { Kbd } from \"../kbd\";\nimport { useListbox } from \"../listbox\";\nimport { useControllable, useDebouncedCallback } from \"../media\";\n\nexport const searchField = tv({\n slots: {\n root: \"relative w-full\",\n control:\n \"flex h-11 w-full items-center gap-2 rounded-lg border border-border-default bg-surface-2 pl-3 pr-1.5 text-sm text-fg \" +\n \"transition-[border-color,box-shadow] focus-within:border-accent focus-within:ring-2 focus-within:ring-ring\",\n icon: \"h-4 w-4 shrink-0 text-fg-secondary\",\n input:\n \"h-full min-w-0 flex-1 bg-transparent text-sm text-fg outline-hidden placeholder:text-fg-muted \" +\n \"[&::-webkit-search-cancel-button]:appearance-none\",\n clear:\n \"inline-flex h-8 w-8 shrink-0 items-center justify-center rounded-md text-fg-secondary hover:bg-surface-3 hover:text-fg \" +\n \"focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring\",\n shortcut: \"hidden shrink-0 items-center gap-0.5 pr-1 sm:flex\",\n list: \"absolute inset-x-0 top-full z-50 mt-1 max-h-72 overflow-y-auto rounded-lg border border-border-default bg-surface-2 p-1 shadow-lg\",\n option: \"flex cursor-pointer select-none items-center gap-2.5 rounded-md px-2.5 py-2 text-sm text-fg data-[active]:bg-surface-3\",\n group: \"px-2.5 pb-1 pt-2 text-[11px] font-semibold uppercase text-fg-muted\",\n },\n variants: {\n size: { md: {}, sm: { control: \"h-9\", clear: \"h-7 w-7\" } },\n },\n defaultVariants: { size: \"md\" },\n});\n\nexport type SearchSuggestion = {\n /** What `onSuggestionSelect` receives. */\n value: string;\n /** What the person reads. */\n label: string;\n /** A small text on the right (\"Creator\", \"12 videos\"). */\n meta?: string;\n};\n\nexport type SearchFieldProps = Omit<React.ComponentProps<\"input\">, \"value\" | \"defaultValue\" | \"onChange\" | \"onSubmit\" | \"size\" | \"type\"> & {\n /** The accessible name of the input (\"Search videos\"), passed translated. */\n label: string;\n /** The query (controlled). */\n value?: string;\n /** The query at first, uncontrolled. */\n defaultValue?: string;\n /** Called on every key with the query. */\n onValueChange?: (query: string) => void;\n /** Called with the query once typing pauses (`debounce` ms): fetch the results here. */\n onSearch?: (query: string) => void;\n /** The pause, in ms, before `onSearch`. Default 250. */\n debounce?: number;\n /** Called on Enter (no suggestion active) with the query: go to the results page. */\n onSubmit?: (query: string) => void;\n /** The global key that focuses the field with ⌘ / Ctrl (`\"k\"`), or `false` for none. Default `false`. */\n shortcut?: string | false;\n /** Suggestions under the field (recent searches, completions). */\n suggestions?: readonly SearchSuggestion[];\n /** A title above the suggestions (\"Recent searches\"). */\n suggestionsLabel?: string;\n /** Called with a suggestion picked (Enter on it, or a click). */\n onSuggestionSelect?: (suggestion: SearchSuggestion) => void;\n /** The clear button's name (\"Clear search\"), passed translated. */\n clearLabel?: string;\n /** Wraps the field in a `role=\"search\"` landmark (default) — `false` inside a form that already is one. */\n landmark?: boolean;\n /** md (default) · sm. */\n size?: \"md\" | \"sm\";\n};\n\nconst isApple = () => typeof navigator !== \"undefined\" && /Mac|iPhone|iPad/.test(navigator.platform || navigator.userAgent);\n\n/** A search box: clear, shortcut, debounced search, submit on Enter, suggestions with the keyboard. */\nexport function SearchField({\n label,\n value: valueProp,\n defaultValue = \"\",\n onValueChange,\n onSearch,\n debounce = 250,\n onSubmit,\n shortcut = false,\n suggestions,\n suggestionsLabel,\n onSuggestionSelect,\n clearLabel = \"Clear search\",\n landmark = true,\n size,\n className,\n placeholder,\n ...props\n}: SearchFieldProps) {\n const s = searchField({ size });\n const [value, setValue] = useControllable(valueProp, defaultValue, onValueChange);\n const [open, setOpen] = React.useState(false);\n const [apple, setApple] = React.useState(false);\n const input = React.useRef<HTMLInputElement>(null);\n const search = useDebouncedCallback((query: string) => onSearch?.(query), debounce);\n const list = suggestions ?? [];\n\n const pick = (i: number) => {\n const suggestion = list[i];\n if (!suggestion) return;\n setOpen(false);\n onSuggestionSelect?.(suggestion);\n };\n const listbox = useListbox({ count: list.length, onPick: pick, open: open && list.length > 0, setOpen });\n\n React.useEffect(() => {\n if (!shortcut) return;\n // eslint-disable-next-line react-hooks/set-state-in-effect -- the platform is only known in the browser (no hydration mismatch)\n setApple(isApple());\n const onKey = (event: KeyboardEvent) => {\n if (event.key.toLowerCase() === shortcut.toLowerCase() && (event.metaKey || event.ctrlKey) && !event.altKey) {\n event.preventDefault();\n input.current?.focus();\n input.current?.select();\n }\n };\n window.addEventListener(\"keydown\", onKey);\n return () => window.removeEventListener(\"keydown\", onKey);\n }, [shortcut]);\n\n const change = (query: string) => {\n setValue(query);\n search(query);\n listbox.setActive(-1);\n setOpen(true);\n };\n\n const field = (\n <div className={s.root({ className })} onBlur={(event) => !event.currentTarget.contains(event.relatedTarget as Node | null) && setOpen(false)}>\n <div className={s.control()}>\n <SearchGlyph className={s.icon()} />\n <input\n ref={input}\n type=\"search\"\n aria-label={label}\n enterKeyHint=\"search\"\n autoComplete=\"off\"\n {...(list.length > 0 ? listbox.inputProps : {})}\n value={value}\n placeholder={placeholder}\n className={s.input()}\n onChange={(event) => change(event.target.value)}\n onFocus={() => setOpen(true)}\n onKeyDown={(event) => {\n if (list.length > 0 && listbox.onKeyDown(event)) return;\n if (event.key === \"Enter\") {\n event.preventDefault();\n search.cancel();\n onSearch?.(value);\n onSubmit?.(value);\n setOpen(false);\n } else if (event.key === \"Escape\" && value) {\n event.preventDefault();\n change(\"\");\n }\n }}\n {...props}\n />\n {value ? (\n <button\n type=\"button\"\n aria-label={clearLabel}\n className={s.clear()}\n onClick={() => {\n change(\"\");\n input.current?.focus();\n }}\n >\n <CloseGlyph className=\"h-4 w-4\" />\n </button>\n ) : shortcut ? (\n <span className={s.shortcut()} aria-hidden>\n <Kbd size=\"sm\">{apple ? \"⌘\" : \"Ctrl\"}</Kbd>\n <Kbd size=\"sm\">{shortcut.toUpperCase()}</Kbd>\n </span>\n ) : null}\n </div>\n {list.length > 0 && (\n <div hidden={!open} className={s.list()}>\n {suggestionsLabel ? (\n <div aria-hidden className={s.group()}>\n {suggestionsLabel}\n </div>\n ) : null}\n <div id={listbox.listId} role=\"listbox\" aria-label={suggestionsLabel ?? label}>\n {list.map((suggestion, i) => (\n <div key={suggestion.value} {...listbox.optionProps(i, false)} className={s.option()}>\n <SearchGlyph className=\"h-3.5 w-3.5 shrink-0 text-fg-muted\" />\n <span className=\"min-w-0 flex-1 truncate\">{suggestion.label}</span>\n {suggestion.meta ? <span className=\"shrink-0 text-xs text-fg-secondary\">{suggestion.meta}</span> : null}\n </div>\n ))}\n </div>\n </div>\n )}\n </div>\n );\n return landmark ? <div role=\"search\">{field}</div> : field;\n}\n","// Server-safe. A key, or a shortcut of several (`<Kbd>⌘</Kbd><Kbd>K</Kbd>`).\nimport type * as React from \"react\";\nimport { tv, type VariantProps } from \"tailwind-variants\";\n\nexport const kbdVariants = tv({\n base:\n \"inline-flex shrink-0 items-center justify-center rounded-md border border-border-default border-b-2 bg-surface-2 \" +\n \"font-mono font-semibold text-fg-secondary\",\n variants: { size: { sm: \"h-5 min-w-5 px-1 text-[10px]\", md: \"h-6 min-w-6 px-1.5 text-xs\" } },\n defaultVariants: { size: \"md\" },\n});\n\nexport type KbdProps = React.ComponentProps<\"kbd\"> & {\n /**\n * sm · md.\n * @default \"md\"\n */\n size?: VariantProps<typeof kbdVariants>[\"size\"];\n};\n\nexport function Kbd({ size, className, ...props }: KbdProps) {\n return <kbd className={kbdVariants({ size, className })} {...props} />;\n}\n"],"mappings":";;;;;;;;;;;;;;AAGA,YAAY,WAAW;AACvB,SAAS,MAAAA,WAAU;;;ACFnB,SAAS,UAA6B;AAmB7B;AAjBF,IAAM,cAAc,GAAG;AAAA,EAC5B,MACE;AAAA,EAEF,UAAU,EAAE,MAAM,EAAE,IAAI,gCAAgC,IAAI,6BAA6B,EAAE;AAAA,EAC3F,iBAAi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AAC,SAA4B,GAAG,QAAQ,YAAY,GAAG,KAAK,GAAG,WAAW,EAAE,OAAO,GACjF;AAAA,wBAAAA,KAAC,eAAY,WAAU,sCAAqC;AAAA,QAC5D,gBAAAA,KAAC,UAAK,WAAU,2BAA2B,qBAAW,OAAM;AAAA,QAC3D,WAAW,OAAO,gBAAAA,KAAC,UAAK,WAAU,sCAAsC,qBAAW,MAAK,IAAU;AAAA,WAH3F,WAAW,KAIrB,CACD,GACH;AAAA,OACF;AAAA,KAEJ;AAEF,SAAO,WAAW,gBAAAA,KAAC,SAAI,MAAK,UAAU,iBAAM,IAAS;AACvD;","names":["tv","jsx","tv"]}
@@ -0,0 +1,210 @@
1
+ "use client";
2
+ import {
3
+ useLatest,
4
+ usePrefersReducedMotion
5
+ } from "./chunk-BRKMQ6JV.js";
6
+
7
+ // src/virtual/virtual.tsx
8
+ import {
9
+ measureElement as measureTanStack,
10
+ observeElementRect,
11
+ useVirtualizer as useTanStackVirtualizer,
12
+ useWindowVirtualizer as useTanStackWindowVirtualizer
13
+ } from "@tanstack/react-virtual";
14
+ import * as React from "react";
15
+ import { tv } from "tailwind-variants";
16
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
17
+ var virtual = tv({
18
+ slots: {
19
+ viewport: "relative w-full overflow-auto overscroll-contain rounded-xl focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring",
20
+ list: "relative w-full",
21
+ item: "absolute top-0 left-0 w-full",
22
+ row: "absolute top-0 left-0 grid w-full",
23
+ empty: "px-4 py-10 text-center text-sm text-fg-secondary"
24
+ }
25
+ });
26
+ var useWindowVirtualizer = useTanStackWindowVirtualizer;
27
+ var useVirtualizer = useTanStackVirtualizer;
28
+ var measureWithFallback = (estimate) => (element, entry, instance) => {
29
+ const size = measureTanStack(element, entry, instance);
30
+ return size > 0 ? size : estimate(Number(element.getAttribute("data-index") ?? 0));
31
+ };
32
+ function useLayoutFallbacks(height, estimate) {
33
+ const estimateOf = sizeOf(estimate);
34
+ const key = typeof estimate === "number" ? estimate : 0;
35
+ return React.useMemo(() => ({ observeElementRect: observeRectWithFallback(height), measureElement: measureWithFallback(estimateOf) }), [height, key]);
36
+ }
37
+ var observeRectWithFallback = (height) => (instance, callback) => observeElementRect(instance, (rect) => callback(rect.height > 0 ? rect : { width: rect.width, height }));
38
+ var sizeOf = (size) => typeof size === "number" ? () => size : size;
39
+ function useEndReached(items, count, threshold, onEndReached) {
40
+ const latest = useLatest(onEndReached);
41
+ const last = items.at(-1)?.index ?? -1;
42
+ const reached = count > 0 && last >= count - 1 - threshold;
43
+ const firedAt = React.useRef(-1);
44
+ React.useEffect(() => {
45
+ if (!reached || firedAt.current === count) return;
46
+ firedAt.current = count;
47
+ latest.current?.();
48
+ }, [reached, count, latest]);
49
+ }
50
+ function useHandle(ref, virtualizer, toIndex) {
51
+ const reduce = usePrefersReducedMotion();
52
+ React.useImperativeHandle(
53
+ ref,
54
+ () => ({ scrollToIndex: (index, align = "auto") => virtualizer.scrollToIndex(toIndex(index), { align, behavior: reduce ? "auto" : "smooth" }) }),
55
+ [virtualizer, reduce, toIndex]
56
+ );
57
+ }
58
+ function VirtualList({
59
+ items,
60
+ renderItem,
61
+ getKey,
62
+ estimateSize,
63
+ label,
64
+ scroll = "self",
65
+ height = 400,
66
+ overscan = 6,
67
+ gap = 0,
68
+ onEndReached,
69
+ endReachedThreshold = 5,
70
+ empty,
71
+ footer,
72
+ ref,
73
+ className
74
+ }) {
75
+ const s = virtual();
76
+ const viewport = React.useRef(null);
77
+ const list = React.useRef(null);
78
+ const [margin, setMargin] = React.useState(0);
79
+ const fallbacks = useLayoutFallbacks(typeof height === "number" ? height : 400, estimateSize);
80
+ const common = {
81
+ measureElement: fallbacks.measureElement,
82
+ count: items.length,
83
+ estimateSize: sizeOf(estimateSize),
84
+ overscan,
85
+ gap,
86
+ getItemKey: (index) => getKey ? getKey(items[index], index) : index
87
+ };
88
+ const self = useTanStackVirtualizer({
89
+ ...common,
90
+ getScrollElement: () => viewport.current,
91
+ initialRect: { width: 0, height: typeof height === "number" ? height : 400 },
92
+ observeElementRect: fallbacks.observeElementRect,
93
+ enabled: scroll === "self"
94
+ });
95
+ const page = useTanStackWindowVirtualizer({
96
+ ...common,
97
+ scrollMargin: margin,
98
+ initialRect: { width: 0, height: typeof window === "undefined" ? 800 : window.innerHeight },
99
+ enabled: scroll === "window"
100
+ });
101
+ const virtualizer = scroll === "window" ? page : self;
102
+ React.useLayoutEffect(() => {
103
+ if (scroll === "window" && list.current) setMargin(list.current.getBoundingClientRect().top + window.scrollY);
104
+ }, [scroll]);
105
+ const virtualItems = virtualizer.getVirtualItems();
106
+ useEndReached(virtualItems, items.length, endReachedThreshold, onEndReached);
107
+ useHandle(ref, virtualizer, React.useCallback((i) => i, []));
108
+ const offset = scroll === "window" ? virtualizer.options.scrollMargin : 0;
109
+ const body = items.length === 0 && empty ? /* @__PURE__ */ jsx("div", { className: s.empty(), children: empty }) : /* @__PURE__ */ jsx("div", { ref: list, role: "list", "aria-label": scroll === "window" ? label : void 0, className: s.list({ className: scroll === "window" ? className : void 0 }), style: { height: virtualizer.getTotalSize() }, children: virtualItems.map((item) => /* @__PURE__ */ jsx(
110
+ "div",
111
+ {
112
+ role: "listitem",
113
+ "data-index": item.index,
114
+ ref: virtualizer.measureElement,
115
+ "aria-setsize": items.length,
116
+ "aria-posinset": item.index + 1,
117
+ className: s.item(),
118
+ style: { transform: `translateY(${item.start - offset}px)` },
119
+ children: renderItem(items[item.index], item.index)
120
+ },
121
+ item.key
122
+ )) });
123
+ if (scroll === "window")
124
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
125
+ body,
126
+ footer
127
+ ] });
128
+ return (
129
+ // A scrolling region the keyboard can reach: Tab lands on it, the arrows and Page keys scroll it.
130
+ /* @__PURE__ */ jsxs("div", { ref: viewport, tabIndex: 0, role: "region", "aria-label": label, className: s.viewport({ className }), style: { height }, children: [
131
+ body,
132
+ footer
133
+ ] })
134
+ );
135
+ }
136
+ var columnsFor = (width, minItemWidth, gap) => Math.max(1, Math.floor((width + gap) / (minItemWidth + gap)));
137
+ function VirtualGrid({
138
+ items,
139
+ renderItem,
140
+ getKey,
141
+ estimateRowHeight,
142
+ label,
143
+ columns: fixed,
144
+ minItemWidth = 220,
145
+ height = 480,
146
+ gap = 16,
147
+ overscan = 3,
148
+ onEndReached,
149
+ empty,
150
+ footer,
151
+ ref,
152
+ className
153
+ }) {
154
+ const s = virtual();
155
+ const viewport = React.useRef(null);
156
+ const [width, setWidth] = React.useState(0);
157
+ React.useLayoutEffect(() => {
158
+ const element = viewport.current;
159
+ if (!element || fixed) return;
160
+ setWidth(element.clientWidth);
161
+ if (typeof ResizeObserver === "undefined") return;
162
+ const observer = new ResizeObserver(([entry]) => entry && setWidth(entry.contentRect.width));
163
+ observer.observe(element);
164
+ return () => observer.disconnect();
165
+ }, [fixed]);
166
+ const columns = fixed ?? (width > 0 ? columnsFor(width, minItemWidth, gap) : 1);
167
+ const rows = Math.ceil(items.length / columns);
168
+ const fallbacks = useLayoutFallbacks(typeof height === "number" ? height : 480, estimateRowHeight);
169
+ const virtualizer = useTanStackVirtualizer({
170
+ ...fallbacks,
171
+ count: rows,
172
+ estimateSize: () => estimateRowHeight,
173
+ overscan,
174
+ gap,
175
+ getScrollElement: () => viewport.current,
176
+ initialRect: { width: 0, height: typeof height === "number" ? height : 480 },
177
+ getItemKey: (row) => getKey && items[row * columns] !== void 0 ? getKey(items[row * columns], row * columns) : row
178
+ });
179
+ const virtualRows = virtualizer.getVirtualItems();
180
+ useEndReached(virtualRows, rows, 1, onEndReached);
181
+ useHandle(ref, virtualizer, React.useCallback((i) => Math.floor(i / columns), [columns]));
182
+ return /* @__PURE__ */ jsxs("div", { ref: viewport, tabIndex: 0, role: "region", "aria-label": label, className: s.viewport({ className }), style: { height }, children: [
183
+ items.length === 0 && empty ? /* @__PURE__ */ jsx("div", { className: s.empty(), children: empty }) : /* @__PURE__ */ jsx("div", { role: "list", className: s.list(), style: { height: virtualizer.getTotalSize() }, children: virtualRows.map((row) => /* @__PURE__ */ jsx(
184
+ "div",
185
+ {
186
+ "data-index": row.index,
187
+ ref: virtualizer.measureElement,
188
+ className: s.row(),
189
+ style: { transform: `translateY(${row.start}px)`, gridTemplateColumns: `repeat(${columns}, minmax(0, 1fr))`, gap },
190
+ children: items.slice(row.index * columns, row.index * columns + columns).map((item, i) => {
191
+ const index = row.index * columns + i;
192
+ return /* @__PURE__ */ jsx("div", { role: "listitem", "aria-setsize": items.length, "aria-posinset": index + 1, className: "min-w-0", children: renderItem(item, index) }, getKey ? getKey(item, index) : index);
193
+ })
194
+ },
195
+ row.key
196
+ )) }),
197
+ footer
198
+ ] });
199
+ }
200
+
201
+ export {
202
+ virtual,
203
+ useWindowVirtualizer,
204
+ useVirtualizer,
205
+ useLayoutFallbacks,
206
+ VirtualList,
207
+ columnsFor,
208
+ VirtualGrid
209
+ };
210
+ //# sourceMappingURL=chunk-HCNOOPZE.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/virtual/virtual.tsx"],"sourcesContent":["// Client (a scroll position, measured items). Long lists and galleries rendered by what is in view, on TanStack Virtual\n// v3 behind the Krizaka facade (ADR-001: a product imports `@krizaka/ui/virtual`, never `@tanstack/*`). A list is a\n// focusable scrolling region holding a `role=\"list\"` whose items say where they stand in the whole (`aria-setsize`,\n// `aria-posinset`), so a screen reader knows \"item 4,812 of 50,000\" though only twenty exist in the page.\nimport {\n measureElement as measureTanStack,\n observeElementRect,\n type ReactVirtualizer,\n useVirtualizer as useTanStackVirtualizer,\n useWindowVirtualizer as useTanStackWindowVirtualizer,\n type VirtualItem,\n type Virtualizer as TanStackVirtualizer,\n} from \"@tanstack/react-virtual\";\nimport * as React from \"react\";\nimport { tv } from \"tailwind-variants\";\n\nimport { useLatest, usePrefersReducedMotion } from \"../media\";\n\nexport type { VirtualItem };\n\nexport const virtual = tv({\n slots: {\n viewport:\n \"relative w-full overflow-auto overscroll-contain rounded-xl focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring\",\n list: \"relative w-full\",\n item: \"absolute top-0 left-0 w-full\",\n row: \"absolute top-0 left-0 grid w-full\",\n empty: \"px-4 py-10 text-center text-sm text-fg-secondary\",\n },\n});\n\n/** What a list or a grid can be asked to do from outside (`ref`). */\nexport type VirtualHandle = {\n /** Scrolls the item at `index` into view — smoothly, unless the person asked for less motion. */\n scrollToIndex: (index: number, align?: \"start\" | \"center\" | \"end\" | \"auto\") => void;\n};\n\n/** The window virtualizer of TanStack Virtual (a feed that scrolls the page), re-exported through the facade. */\nexport const useWindowVirtualizer = useTanStackWindowVirtualizer;\n/** The element virtualizer of TanStack Virtual (anything the components do not cover), re-exported through the facade. */\nexport const useVirtualizer = useTanStackVirtualizer;\nexport type Virtualizer<S extends Element | Window = Element, I extends Element = Element> = ReactVirtualizer<S, I>;\n\ntype Size = number | ((index: number) => number);\n\n/**\n * TanStack's observer of the scrolling element's size, falling back to the declared height while the element has no\n * layout (not yet in the page, in a hidden tab, under a DOM without layout such as a test): the rows of the first\n * screen are rendered at once instead of none.\n */\n/** TanStack's measure of an item, falling back to the estimate while it has no layout (0 px). */\nexport const measureWithFallback =\n (estimate: (index: number) => number) =>\n <S extends Element | Window, I extends Element>(element: I, entry: ResizeObserverEntry | undefined, instance: TanStackVirtualizer<S, I>) => {\n const size = measureTanStack(element, entry, instance);\n return size > 0 ? size : estimate(Number(element.getAttribute(\"data-index\") ?? 0));\n };\n\n/** The fallbacks as stable options (a new function at each render would re-observe the element at each render). */\nexport function useLayoutFallbacks(height: number, estimate: Size) {\n const estimateOf = sizeOf(estimate);\n const key = typeof estimate === \"number\" ? estimate : 0;\n // eslint-disable-next-line react-hooks/exhaustive-deps -- a function estimate is read through its latest value\n return React.useMemo(() => ({ observeElementRect: observeRectWithFallback(height), measureElement: measureWithFallback(estimateOf) }), [height, key]);\n}\n\nexport const observeRectWithFallback =\n (height: number) =>\n <S extends Element, I extends Element>(instance: TanStackVirtualizer<S, I>, callback: (rect: { width: number; height: number }) => void) =>\n observeElementRect(instance, (rect) => callback(rect.height > 0 ? rect : { width: rect.width, height }));\nconst sizeOf = (size: Size) => (typeof size === \"number\" ? () => size : size);\n\n/** Calls `onEndReached` once each time the last rendered item comes within `threshold` items of the end. */\nfunction useEndReached(items: readonly VirtualItem[], count: number, threshold: number, onEndReached: (() => void) | undefined) {\n const latest = useLatest(onEndReached);\n const last = items.at(-1)?.index ?? -1;\n const reached = count > 0 && last >= count - 1 - threshold;\n const firedAt = React.useRef(-1);\n React.useEffect(() => {\n if (!reached || firedAt.current === count) return;\n firedAt.current = count;\n latest.current?.();\n }, [reached, count, latest]);\n}\n\nfunction useHandle(ref: React.Ref<VirtualHandle> | undefined, virtualizer: { scrollToIndex: (index: number, options: { align: \"start\" | \"center\" | \"end\" | \"auto\"; behavior: ScrollBehavior }) => void }, toIndex: (i: number) => number) {\n const reduce = usePrefersReducedMotion();\n React.useImperativeHandle(\n ref,\n () => ({ scrollToIndex: (index, align = \"auto\") => virtualizer.scrollToIndex(toIndex(index), { align, behavior: reduce ? \"auto\" : \"smooth\" }) }),\n [virtualizer, reduce, toIndex],\n );\n}\n\nexport type VirtualListProps<T> = {\n /** The items, all of them: only those in view (and `overscan` around) are rendered. */\n items: readonly T[];\n /** Draws one item. */\n renderItem: (item: T, index: number) => React.ReactNode;\n /** A stable key per item (an id): keeps measurements on the right item when the list changes. Default: the index. */\n getKey?: (item: T, index: number) => string | number;\n /** The size of an item in px, or a guess per index; each item is then measured (dynamic sizes). */\n estimateSize: Size;\n /** The accessible name of the list (\"Messages\", \"Events\"), passed translated. */\n label: string;\n /** `self` (default): the list scrolls in its own region of `height`. `window`: the page scrolls (a feed). */\n scroll?: \"self\" | \"window\";\n /** The height of the scrolling region (`self`): px or any CSS length. Default 400. */\n height?: number | string;\n /** Items rendered beyond the visible ones, on each side. Default 6. */\n overscan?: number;\n /** Space between two items, in px. Default 0. */\n gap?: number;\n /** Called when the end comes near (load the next page): once per length of `items`. */\n onEndReached?: () => void;\n /** How many items before the end `onEndReached` fires. Default 5. */\n endReachedThreshold?: number;\n /** Shown instead of the list when there is no item. */\n empty?: React.ReactNode;\n /** Shown after the last item (a spinner while the next page loads). */\n footer?: React.ReactNode;\n /** `scrollToIndex` from outside. */\n ref?: React.Ref<VirtualHandle>;\n /** Classes merged on the scrolling region (`self`) or the list (`window`). */\n className?: string;\n};\n\n/**\n * A long list rendered by what is in view: fixed or measured sizes, its own scrolling region or the page's, the end\n * announced for infinite loading, items placed in the whole for assistive technology.\n */\nexport function VirtualList<T>({\n items,\n renderItem,\n getKey,\n estimateSize,\n label,\n scroll = \"self\",\n height = 400,\n overscan = 6,\n gap = 0,\n onEndReached,\n endReachedThreshold = 5,\n empty,\n footer,\n ref,\n className,\n}: VirtualListProps<T>) {\n const s = virtual();\n const viewport = React.useRef<HTMLDivElement>(null);\n const list = React.useRef<HTMLDivElement>(null);\n const [margin, setMargin] = React.useState(0);\n const fallbacks = useLayoutFallbacks(typeof height === \"number\" ? height : 400, estimateSize);\n const common = {\n measureElement: fallbacks.measureElement,\n count: items.length,\n estimateSize: sizeOf(estimateSize),\n overscan,\n gap,\n getItemKey: (index: number) => (getKey ? getKey(items[index] as T, index) : index),\n };\n // Both hooks run on every render (the rules of hooks); the unused one is disabled. TanStack Virtual's instance is\n // mutable by design: React Compiler skips this component, which re-renders on the virtualizer's own updates.\n // eslint-disable-next-line react-hooks/incompatible-library -- the virtualizer drives the renders of this component\n const self = useTanStackVirtualizer({\n ...common,\n getScrollElement: () => viewport.current,\n initialRect: { width: 0, height: typeof height === \"number\" ? height : 400 },\n observeElementRect: fallbacks.observeElementRect,\n enabled: scroll === \"self\",\n });\n const page = useTanStackWindowVirtualizer({\n ...common,\n scrollMargin: margin,\n initialRect: { width: 0, height: typeof window === \"undefined\" ? 800 : window.innerHeight },\n enabled: scroll === \"window\",\n });\n const virtualizer = scroll === \"window\" ? page : self;\n React.useLayoutEffect(() => {\n if (scroll === \"window\" && list.current) setMargin(list.current.getBoundingClientRect().top + window.scrollY);\n }, [scroll]);\n const virtualItems = virtualizer.getVirtualItems();\n useEndReached(virtualItems, items.length, endReachedThreshold, onEndReached);\n useHandle(ref, virtualizer, React.useCallback((i: number) => i, []));\n\n const offset = scroll === \"window\" ? virtualizer.options.scrollMargin : 0;\n const body =\n items.length === 0 && empty ? (\n <div className={s.empty()}>{empty}</div>\n ) : (\n <div ref={list} role=\"list\" aria-label={scroll === \"window\" ? label : undefined} className={s.list({ className: scroll === \"window\" ? className : undefined })} style={{ height: virtualizer.getTotalSize() }}>\n {virtualItems.map((item) => (\n <div\n role=\"listitem\"\n key={item.key}\n data-index={item.index}\n ref={virtualizer.measureElement}\n aria-setsize={items.length}\n aria-posinset={item.index + 1}\n className={s.item()}\n style={{ transform: `translateY(${item.start - offset}px)` }}\n >\n {renderItem(items[item.index] as T, item.index)}\n </div>\n ))}\n </div>\n );\n\n if (scroll === \"window\")\n return (\n <>\n {body}\n {footer}\n </>\n );\n return (\n // A scrolling region the keyboard can reach: Tab lands on it, the arrows and Page keys scroll it.\n <div ref={viewport} tabIndex={0} role=\"region\" aria-label={label} className={s.viewport({ className })} style={{ height }}>\n {body}\n {footer}\n </div>\n );\n}\n\nexport type VirtualGridProps<T> = {\n /** The items, all of them: only the rows in view are rendered. */\n items: readonly T[];\n /** Draws one cell (a card, a thumbnail). */\n renderItem: (item: T, index: number) => React.ReactNode;\n /** A stable key per item. Default: the index. */\n getKey?: (item: T, index: number) => string | number;\n /** The height of a row in px (a guess: rows are measured). */\n estimateRowHeight: number;\n /** The accessible name of the grid of items (\"Videos\"), passed translated. */\n label: string;\n /** A fixed number of columns. Without it, as many columns of at least `minItemWidth` as the width allows. */\n columns?: number;\n /** The narrowest a cell may be, in px, when `columns` is not set. Default 220. */\n minItemWidth?: number;\n /** The height of the scrolling region: px or any CSS length. Default 480. */\n height?: number | string;\n /** Space between cells, in px. Default 16. */\n gap?: number;\n /** Rows rendered beyond the visible ones. Default 3. */\n overscan?: number;\n /** Called when the last rows come near (load the next page). */\n onEndReached?: () => void;\n /** Shown instead of the grid when there is no item. */\n empty?: React.ReactNode;\n /** Shown after the last row. */\n footer?: React.ReactNode;\n /** `scrollToIndex` (of an item) from outside. */\n ref?: React.Ref<VirtualHandle>;\n /** Classes merged on the scrolling region. */\n className?: string;\n};\n\n/** The number of columns a width holds at `minItemWidth` each (at least one). */\nexport const columnsFor = (width: number, minItemWidth: number, gap: number) => Math.max(1, Math.floor((width + gap) / (minItemWidth + gap)));\n\n/** A gallery rendered by the rows in view: as many columns as the width allows (or a fixed number), measured rows. */\nexport function VirtualGrid<T>({\n items,\n renderItem,\n getKey,\n estimateRowHeight,\n label,\n columns: fixed,\n minItemWidth = 220,\n height = 480,\n gap = 16,\n overscan = 3,\n onEndReached,\n empty,\n footer,\n ref,\n className,\n}: VirtualGridProps<T>) {\n const s = virtual();\n const viewport = React.useRef<HTMLDivElement>(null);\n const [width, setWidth] = React.useState(0);\n React.useLayoutEffect(() => {\n const element = viewport.current;\n if (!element || fixed) return;\n setWidth(element.clientWidth);\n if (typeof ResizeObserver === \"undefined\") return;\n const observer = new ResizeObserver(([entry]) => entry && setWidth(entry.contentRect.width));\n observer.observe(element);\n return () => observer.disconnect();\n }, [fixed]);\n const columns = fixed ?? (width > 0 ? columnsFor(width, minItemWidth, gap) : 1);\n const rows = Math.ceil(items.length / columns);\n const fallbacks = useLayoutFallbacks(typeof height === \"number\" ? height : 480, estimateRowHeight);\n // eslint-disable-next-line react-hooks/incompatible-library -- the virtualizer drives the renders of this component\n const virtualizer = useTanStackVirtualizer({\n ...fallbacks,\n count: rows,\n estimateSize: () => estimateRowHeight,\n overscan,\n gap,\n getScrollElement: () => viewport.current,\n initialRect: { width: 0, height: typeof height === \"number\" ? height : 480 },\n getItemKey: (row) => (getKey && items[row * columns] !== undefined ? getKey(items[row * columns] as T, row * columns) : row),\n });\n const virtualRows = virtualizer.getVirtualItems();\n useEndReached(virtualRows, rows, 1, onEndReached);\n useHandle(ref, virtualizer, React.useCallback((i: number) => Math.floor(i / columns), [columns]));\n\n return (\n <div ref={viewport} tabIndex={0} role=\"region\" aria-label={label} className={s.viewport({ className })} style={{ height }}>\n {items.length === 0 && empty ? (\n <div className={s.empty()}>{empty}</div>\n ) : (\n <div role=\"list\" className={s.list()} style={{ height: virtualizer.getTotalSize() }}>\n {virtualRows.map((row) => (\n <div\n key={row.key}\n data-index={row.index}\n ref={virtualizer.measureElement}\n className={s.row()}\n style={{ transform: `translateY(${row.start}px)`, gridTemplateColumns: `repeat(${columns}, minmax(0, 1fr))`, gap }}\n >\n {items.slice(row.index * columns, row.index * columns + columns).map((item, i) => {\n const index = row.index * columns + i;\n return (\n <div role=\"listitem\" key={getKey ? getKey(item, index) : index} aria-setsize={items.length} aria-posinset={index + 1} className=\"min-w-0\">\n {renderItem(item, index)}\n </div>\n );\n })}\n </div>\n ))}\n </div>\n )}\n {footer}\n </div>\n );\n}\n"],"mappings":";;;;;;;AAIA;AAAA,EACE,kBAAkB;AAAA,EAClB;AAAA,EAEA,kBAAkB;AAAA,EAClB,wBAAwB;AAAA,OAGnB;AACP,YAAY,WAAW;AACvB,SAAS,UAAU;AA8Kb,SAsBA,UAtBA,KAsBA,YAtBA;AAxKC,IAAM,UAAU,GAAG;AAAA,EACxB,OAAO;AAAA,IACL,UACE;AAAA,IACF,MAAM;AAAA,IACN,MAAM;AAAA,IACN,KAAK;AAAA,IACL,OAAO;AAAA,EACT;AACF,CAAC;AASM,IAAM,uBAAuB;AAE7B,IAAM,iBAAiB;AAWvB,IAAM,sBACX,CAAC,aACD,CAAgD,SAAY,OAAwC,aAAwC;AAC1I,QAAM,OAAO,gBAAgB,SAAS,OAAO,QAAQ;AACrD,SAAO,OAAO,IAAI,OAAO,SAAS,OAAO,QAAQ,aAAa,YAAY,KAAK,CAAC,CAAC;AACnF;AAGK,SAAS,mBAAmB,QAAgB,UAAgB;AACjE,QAAM,aAAa,OAAO,QAAQ;AAClC,QAAM,MAAM,OAAO,aAAa,WAAW,WA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AAM,WAAW,KAAK,QACrB,oBAAC,SAAI,WAAW,EAAE,MAAM,GAAI,iBAAM,IAElC,oBAAC,SAAI,MAAK,QAAO,WAAW,EAAE,KAAK,GAAG,OAAO,EAAE,QAAQ,YAAY,aAAa,EAAE,GAC/E,sBAAY,IAAI,CAAC,QAChB;AAAA,MAAC;AAAA;AAAA,QAEC,cAAY,IAAI;AAAA,QAChB,KAAK,YAAY;AAAA,QACjB,WAAW,EAAE,IAAI;AAAA,QACjB,OAAO,EAAE,WAAW,cAAc,IAAI,KAAK,OAAO,qBAAqB,UAAU,OAAO,qBAAqB,IAAI;AAAA,QAEhH,gBAAM,MAAM,IAAI,QAAQ,SAAS,IAAI,QAAQ,UAAU,OAAO,EAAE,IAAI,CAAC,MAAM,MAAM;AAChF,gBAAM,QAAQ,IAAI,QAAQ,UAAU;AACpC,iBACE,oBAAC,SAAI,MAAK,YAAsD,gBAAc,MAAM,QAAQ,iBAAe,QAAQ,GAAG,WAAU,WAC7H,qBAAW,MAAM,KAAK,KADC,SAAS,OAAO,MAAM,KAAK,IAAI,KAEzD;AAAA,QAEJ,CAAC;AAAA;AAAA,MAbI,IAAI;AAAA,IAcX,CACD,GACH;AAAA,IAED;AAAA,KACH;AAEJ;","names":[]}
@@ -8,7 +8,7 @@ import {
8
8
  import {
9
9
  useControllable,
10
10
  useDebouncedCallback
11
- } from "./chunk-EUPTXKH7.js";
11
+ } from "./chunk-BRKMQ6JV.js";
12
12
  import {
13
13
  CheckGlyph,
14
14
  ChevronGlyph,
@@ -280,4 +280,4 @@ export {
280
280
  comboboxLabels,
281
281
  Combobox
282
282
  };
283
- //# sourceMappingURL=chunk-X6TW3X6Y.js.map
283
+ //# sourceMappingURL=chunk-LCZXS6AK.js.map