@krizaka/ui 2.10.0 → 3.1.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 (264) hide show
  1. package/README.md +4 -2
  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/form/server.d.ts +96 -0
  20. package/dist/form/server.js +82 -0
  21. package/dist/form/server.js.map +1 -0
  22. package/dist/form.d.ts +503 -0
  23. package/dist/form.js +760 -0
  24. package/dist/form.js.map +1 -0
  25. package/dist/image-cropper.js +1 -1
  26. package/dist/media-capture.js +1 -1
  27. package/dist/native/form.d.ts +376 -0
  28. package/dist/native/form.js +650 -0
  29. package/dist/native/form.js.map +1 -0
  30. package/dist/native/list.d.ts +95 -0
  31. package/dist/native/list.js +135 -0
  32. package/dist/native/list.js.map +1 -0
  33. package/dist/native.d.ts +113 -2
  34. package/dist/native.js +618 -388
  35. package/dist/native.js.map +1 -1
  36. package/dist/search-field.js +6 -160
  37. package/dist/search-field.js.map +1 -1
  38. package/dist/tag-input.js +2 -2
  39. package/dist/video-player.js +1 -1
  40. package/dist/video-trimmer.js +1 -1
  41. package/dist/virtual.d.ts +140 -0
  42. package/dist/virtual.js +19 -0
  43. package/dist/virtual.js.map +1 -0
  44. package/package.json +111 -8
  45. package/registry/achievement.json +1 -1
  46. package/registry/action-bar.json +1 -1
  47. package/registry/alert.json +1 -1
  48. package/registry/app-shell.json +1 -1
  49. package/registry/argument-card.json +1 -1
  50. package/registry/audio-player.json +1 -1
  51. package/registry/auth-layout.json +1 -1
  52. package/registry/avatar.json +1 -1
  53. package/registry/badge.json +1 -1
  54. package/registry/button.json +1 -1
  55. package/registry/card-grid.json +1 -1
  56. package/registry/card.json +1 -1
  57. package/registry/catalogue-page.json +1 -1
  58. package/registry/changelog-page.json +1 -1
  59. package/registry/checkbox.json +89 -4
  60. package/registry/chip-link.json +1 -1
  61. package/registry/chip.json +1 -1
  62. package/registry/choice-grid.json +1 -1
  63. package/registry/code-block.json +1 -1
  64. package/registry/combobox.json +1 -1
  65. package/registry/command.json +1 -1
  66. package/registry/component-page.json +1 -1
  67. package/registry/confirm-button.json +1 -1
  68. package/registry/contact-page.json +1 -1
  69. package/registry/continue-prompt.json +1 -1
  70. package/registry/countdown.json +1 -1
  71. package/registry/cta-panel.json +1 -1
  72. package/registry/dashboard-layout.json +1 -1
  73. package/registry/data-table.json +643 -49
  74. package/registry/date-picker.json +142 -4
  75. package/registry/decision-list.json +1 -1
  76. package/registry/detail-layout.json +1 -1
  77. package/registry/dialog.json +1 -1
  78. package/registry/docs-article-page.json +1 -1
  79. package/registry/docs-hub-page.json +1 -1
  80. package/registry/docs-layout.json +1 -1
  81. package/registry/dropdown-menu.json +1 -1
  82. package/registry/empty-state.json +1 -1
  83. package/registry/error-page.json +1 -1
  84. package/registry/examples/checkbox/native/terms.d.ts +4 -0
  85. package/registry/examples/checkbox/native/terms.dark.png +0 -0
  86. package/registry/examples/checkbox/native/terms.js +26 -0
  87. package/registry/examples/checkbox/native/terms.light.png +0 -0
  88. package/registry/examples/checkbox/native/terms.tsx +28 -0
  89. package/registry/examples/data-table/details.d.ts +4 -0
  90. package/registry/examples/data-table/details.js +33 -0
  91. package/registry/examples/data-table/details.tsx +31 -0
  92. package/registry/examples/data-table/filters.d.ts +4 -0
  93. package/registry/examples/data-table/filters.js +40 -0
  94. package/registry/examples/data-table/filters.tsx +40 -0
  95. package/registry/examples/data-table/grouped.d.ts +4 -0
  96. package/registry/examples/data-table/grouped.js +24 -0
  97. package/registry/examples/data-table/grouped.tsx +23 -0
  98. package/registry/examples/data-table/paginated.d.ts +4 -0
  99. package/registry/examples/data-table/paginated.js +23 -0
  100. package/registry/examples/data-table/paginated.tsx +22 -0
  101. package/registry/examples/data-table/pinned.d.ts +4 -0
  102. package/registry/examples/data-table/pinned.js +26 -0
  103. package/registry/examples/data-table/pinned.tsx +25 -0
  104. package/registry/examples/data-table/server.d.ts +4 -0
  105. package/registry/examples/data-table/server.js +40 -0
  106. package/registry/examples/data-table/server.tsx +40 -0
  107. package/registry/examples/data-table/virtualized.js +2 -2
  108. package/registry/examples/data-table/virtualized.tsx +3 -3
  109. package/registry/examples/date-picker/native/birth-date.d.ts +4 -0
  110. package/registry/examples/date-picker/native/birth-date.dark.png +0 -0
  111. package/registry/examples/date-picker/native/birth-date.js +30 -0
  112. package/registry/examples/date-picker/native/birth-date.light.png +0 -0
  113. package/registry/examples/date-picker/native/birth-date.tsx +27 -0
  114. package/registry/examples/field/native/default.d.ts +4 -0
  115. package/registry/examples/field/native/default.dark.png +0 -0
  116. package/registry/examples/field/native/default.js +29 -0
  117. package/registry/examples/field/native/default.light.png +0 -0
  118. package/registry/examples/field/native/default.tsx +23 -0
  119. package/registry/examples/form/amount.d.ts +4 -0
  120. package/registry/examples/form/amount.js +30 -0
  121. package/registry/examples/form/amount.tsx +36 -0
  122. package/registry/examples/form/audience.d.ts +4 -0
  123. package/registry/examples/form/audience.js +29 -0
  124. package/registry/examples/form/audience.tsx +31 -0
  125. package/registry/examples/form/native/amount.d.ts +4 -0
  126. package/registry/examples/form/native/amount.dark.png +0 -0
  127. package/registry/examples/form/native/amount.js +26 -0
  128. package/registry/examples/form/native/amount.light.png +0 -0
  129. package/registry/examples/form/native/amount.tsx +30 -0
  130. package/registry/examples/form/native/audience.d.ts +4 -0
  131. package/registry/examples/form/native/audience.dark.png +0 -0
  132. package/registry/examples/form/native/audience.js +24 -0
  133. package/registry/examples/form/native/audience.light.png +0 -0
  134. package/registry/examples/form/native/audience.tsx +24 -0
  135. package/registry/examples/form/native/profile.d.ts +4 -0
  136. package/registry/examples/form/native/profile.dark.png +0 -0
  137. package/registry/examples/form/native/profile.js +33 -0
  138. package/registry/examples/form/native/profile.light.png +0 -0
  139. package/registry/examples/form/native/profile.tsx +36 -0
  140. package/registry/examples/form/native/settings.d.ts +4 -0
  141. package/registry/examples/form/native/settings.dark.png +0 -0
  142. package/registry/examples/form/native/settings.js +25 -0
  143. package/registry/examples/form/native/settings.light.png +0 -0
  144. package/registry/examples/form/native/settings.tsx +23 -0
  145. package/registry/examples/form/native/sign-up.d.ts +4 -0
  146. package/registry/examples/form/native/sign-up.dark.png +0 -0
  147. package/registry/examples/form/native/sign-up.js +38 -0
  148. package/registry/examples/form/native/sign-up.light.png +0 -0
  149. package/registry/examples/form/native/sign-up.tsx +34 -0
  150. package/registry/examples/form/native/upload.d.ts +4 -0
  151. package/registry/examples/form/native/upload.dark.png +0 -0
  152. package/registry/examples/form/native/upload.js +23 -0
  153. package/registry/examples/form/native/upload.light.png +0 -0
  154. package/registry/examples/form/native/upload.tsx +22 -0
  155. package/registry/examples/form/profile.d.ts +4 -0
  156. package/registry/examples/form/profile.js +35 -0
  157. package/registry/examples/form/profile.tsx +40 -0
  158. package/registry/examples/form/report.d.ts +4 -0
  159. package/registry/examples/form/report.js +30 -0
  160. package/registry/examples/form/report.tsx +30 -0
  161. package/registry/examples/form/settings.d.ts +4 -0
  162. package/registry/examples/form/settings.js +30 -0
  163. package/registry/examples/form/settings.tsx +31 -0
  164. package/registry/examples/form/sign-up.d.ts +4 -0
  165. package/registry/examples/form/sign-up.js +38 -0
  166. package/registry/examples/form/sign-up.tsx +37 -0
  167. package/registry/examples/form/upload.d.ts +4 -0
  168. package/registry/examples/form/upload.js +32 -0
  169. package/registry/examples/form/upload.tsx +32 -0
  170. package/registry/examples/list/native/default.d.ts +4 -0
  171. package/registry/examples/list/native/default.dark.png +0 -0
  172. package/registry/examples/list/native/default.js +33 -0
  173. package/registry/examples/list/native/default.light.png +0 -0
  174. package/registry/examples/list/native/default.tsx +31 -0
  175. package/registry/examples/list/native/infinite.d.ts +4 -0
  176. package/registry/examples/list/native/infinite.dark.png +0 -0
  177. package/registry/examples/list/native/infinite.js +30 -0
  178. package/registry/examples/list/native/infinite.light.png +0 -0
  179. package/registry/examples/list/native/infinite.tsx +35 -0
  180. package/registry/examples/list/native/states.d.ts +4 -0
  181. package/registry/examples/list/native/states.dark.png +0 -0
  182. package/registry/examples/list/native/states.js +26 -0
  183. package/registry/examples/list/native/states.light.png +0 -0
  184. package/registry/examples/list/native/states.tsx +21 -0
  185. package/registry/examples/virtual/feed.d.ts +4 -0
  186. package/registry/examples/virtual/feed.js +26 -0
  187. package/registry/examples/virtual/feed.tsx +24 -0
  188. package/registry/examples/virtual/gallery.d.ts +4 -0
  189. package/registry/examples/virtual/gallery.js +31 -0
  190. package/registry/examples/virtual/gallery.tsx +28 -0
  191. package/registry/examples/virtual/messages.d.ts +4 -0
  192. package/registry/examples/virtual/messages.js +28 -0
  193. package/registry/examples/virtual/messages.tsx +28 -0
  194. package/registry/field.json +104 -4
  195. package/registry/file-upload.json +1 -1
  196. package/registry/filter-bar.json +1 -1
  197. package/registry/form.json +2940 -0
  198. package/registry/gallery-page.json +1 -1
  199. package/registry/glow-card.json +1 -1
  200. package/registry/goal-gauge.json +1 -1
  201. package/registry/how-it-works-page.json +1 -1
  202. package/registry/image-cropper.json +1 -1
  203. package/registry/index.json +86 -11
  204. package/registry/iso.json +1 -1
  205. package/registry/kbd.json +1 -1
  206. package/registry/landing-page.json +1 -1
  207. package/registry/landscape.json +1 -1
  208. package/registry/legal-page.json +1 -1
  209. package/registry/link-card.json +1 -1
  210. package/registry/list.json +249 -0
  211. package/registry/loader.json +1 -1
  212. package/registry/longform-page.json +1 -1
  213. package/registry/marketing-layout.json +1 -1
  214. package/registry/marquee.json +1 -1
  215. package/registry/mascot-quote.json +1 -1
  216. package/registry/mascot-state.json +2 -2
  217. package/registry/mascots.json +2 -2
  218. package/registry/media-capture.json +1 -1
  219. package/registry/meter.json +1 -1
  220. package/registry/nav-bar.json +1 -1
  221. package/registry/number-ticker.json +1 -1
  222. package/registry/page-header.json +1 -1
  223. package/registry/page-hero.json +1 -1
  224. package/registry/page.json +1 -1
  225. package/registry/pagination.json +1 -1
  226. package/registry/pointer-light.json +1 -1
  227. package/registry/popover.json +1 -1
  228. package/registry/pricing-page.json +1 -1
  229. package/registry/product-page.json +1 -1
  230. package/registry/profile-card.json +1 -1
  231. package/registry/progress.json +1 -1
  232. package/registry/promise-card.json +1 -1
  233. package/registry/radio-group.json +1 -1
  234. package/registry/scroll-stage.json +1 -1
  235. package/registry/search-field.json +1 -1
  236. package/registry/section-backdrop.json +1 -1
  237. package/registry/separator.json +1 -1
  238. package/registry/settings-layout.json +1 -1
  239. package/registry/skeleton.json +1 -1
  240. package/registry/slider.json +1 -1
  241. package/registry/slot.json +1 -1
  242. package/registry/spinner.json +1 -1
  243. package/registry/split-view.json +1 -1
  244. package/registry/stage-banner.json +1 -1
  245. package/registry/stat.json +1 -1
  246. package/registry/status-page.json +1 -1
  247. package/registry/stepper.json +1 -1
  248. package/registry/switch.json +1 -1
  249. package/registry/tabs.json +1 -1
  250. package/registry/tag-input.json +1 -1
  251. package/registry/terminal-replay.json +1 -1
  252. package/registry/theme.json +1 -1
  253. package/registry/toast.json +1 -1
  254. package/registry/toc.json +1 -1
  255. package/registry/tooltip.json +1 -1
  256. package/registry/video-player.json +1 -1
  257. package/registry/video-trimmer.json +1 -1
  258. package/registry/virtual.json +569 -0
  259. package/skills/data-table/SKILL.md +56 -0
  260. package/skills/form/SKILL.md +44 -0
  261. package/skills/native-list/SKILL.md +39 -0
  262. package/skills/virtual/SKILL.md +35 -0
  263. /package/dist/{chunk-EUPTXKH7.js.map → chunk-BRKMQ6JV.js.map} +0 -0
  264. /package/dist/{chunk-X6TW3X6Y.js.map → chunk-LCZXS6AK.js.map} +0 -0
@@ -176,7 +176,7 @@
176
176
  },
177
177
  {
178
178
  "path": "meta.ts",
179
- "content": "// The documentation of a component, carried by its code: each primitive has a `meta.ts` beside its source\n// (`src/<name>/meta.ts`; a component that exists only in React Native: `src/native/meta/<name>.ts`). Never built into\n// the package: `scripts/build-registry.mjs` reads them into `registry/<name>.json`, which krizaka.com renders as\n// /docs/ui/<name>, and `scripts/registry.test.mjs` fails when one is missing or incomplete.\n//\n// Why a typed module and not JSDoc tags: the fields are lists and links (`related`, `whenNotToUse[].use`, examples),\n// which a type checks and a comment does not; the file is plain data (erasable TypeScript), so Node reads it without a\n// compiler, and an editor completes it.\n\n/** Every documented component: the web primitives (one entry of the package each) and the native-only ones. */\nexport type ComponentName =\n | \"achievement\"\n | \"action-bar\"\n | \"alert\"\n | \"app-shell\"\n | \"argument-card\"\n | \"audio-player\"\n | \"auth-layout\"\n | \"avatar\"\n | \"badge\"\n | \"button\"\n | \"card\"\n | \"card-grid\"\n | \"catalogue-page\"\n | \"changelog-page\"\n | \"checkbox\"\n | \"chip\"\n | \"chip-link\"\n | \"choice-grid\"\n | \"cn\"\n | \"code-block\"\n | \"combobox\"\n | \"command\"\n | \"component-page\"\n | \"confirm-button\"\n | \"contact-page\"\n | \"continue-prompt\"\n | \"countdown\"\n | \"cta-panel\"\n | \"dashboard-layout\"\n | \"data-table\"\n | \"date-picker\"\n | \"decision-list\"\n | \"detail-layout\"\n | \"dialog\"\n | \"docs-article-page\"\n | \"docs-hub-page\"\n | \"docs-layout\"\n | \"dropdown-menu\"\n | \"empty-state\"\n | \"error-page\"\n | \"field\"\n | \"file-upload\"\n | \"filter-bar\"\n | \"gallery-page\"\n | \"glow-card\"\n | \"goal-gauge\"\n | \"how-it-works-page\"\n | \"image-cropper\"\n | \"iso\"\n | \"kbd\"\n | \"landing-page\"\n | \"landscape\"\n | \"legal-page\"\n | \"link-card\"\n | \"loader\"\n | \"longform-page\"\n | \"marketing-layout\"\n | \"marquee\"\n | \"mascot-quote\"\n | \"mascot-state\"\n | \"mascots\"\n | \"media-capture\"\n | \"meter\"\n | \"nav-bar\"\n | \"number-ticker\"\n | \"page\"\n | \"page-header\"\n | \"page-hero\"\n | \"pagination\"\n | \"pointer-light\"\n | \"popover\"\n | \"pricing-page\"\n | \"product-page\"\n | \"profile-card\"\n | \"progress\"\n | \"promise-card\"\n | \"radio-group\"\n | \"scroll-stage\"\n | \"search-field\"\n | \"section-backdrop\"\n | \"segmented\"\n | \"separator\"\n | \"settings-layout\"\n | \"skeleton\"\n | \"slider\"\n | \"slot\"\n | \"spinner\"\n | \"split-view\"\n | \"stage-banner\"\n | \"stat\"\n | \"status-page\"\n | \"stepper\"\n | \"switch\"\n | \"tabs\"\n | \"tag-input\"\n | \"terminal-replay\"\n | \"theme\"\n | \"toast\"\n | \"toc\"\n | \"tooltip\"\n | \"txt\"\n | \"video-player\"\n | \"video-trimmer\";\n\n/** Where a component exists: `@krizaka/ui/<name>` (web), `@krizaka/ui/native` (React Native), or both. */\nexport type Platform = \"web\" | \"native\" | \"both\";\n\n/** `stable`: its API only changes in a major. `beta`: it may still change in a minor. */\nexport type Status = \"stable\" | \"beta\";\n\n/**\n * The group of the catalogue. `media`: video, sound, camera, files, cropping. `blocks`: the page blocks — the frame,\n * the hero, sections, cards that lead or argue, decisions, code, calls to act — that every page of a site is made of.\n * `layouts`: the shells of whole screens — an application, a dashboard, settings, sign-in, an object, a list and its\n * item, a site's page, a documentation page — each with its screens. `templates`: the page templates — whole pages of a\n * site (a landing, a product, a docs hub, a long read, a changelog, pricing, status, an error…), each a distinct\n * composition of the blocks, words and content as props.\n */\nexport type Category = \"actions\" | \"forms\" | \"navigation\" | \"overlays\" | \"feedback\" | \"data-display\" | \"media\" | \"blocks\" | \"layouts\" | \"templates\" | \"layout\" | \"foundations\";\n\n/**\n * A named example: the file `registry/examples/<component>/<name>.tsx` (web) or\n * `registry/examples/<component>/native/<name>.tsx` (React Native) — at most 40 lines, imported by the stories and\n * shown (live, with its code) by the documentation.\n */\nexport interface Example {\n /** The file name, kebab-case (`primary`, `icon-button`). */\n readonly name: string;\n /** A short title (`Primary`, `Icon button`). */\n readonly title: string;\n /** One or two sentences: when this variant is the right one. */\n readonly description: string;\n /**\n * A template: a whole screen of a product composed from the platform (a layout and its blocks, real words, its phone\n * version thought out), copied as a starting point — at most 160 lines, listed on krizaka.com/docs/ui/templates.\n */\n readonly template?: boolean;\n}\n\n/** One platform's side of a component. */\nexport interface PlatformDocs {\n /** The names to import (`[\"Button\", \"IconButton\"]`): from `@krizaka/ui/<name>` on the web, `@krizaka/ui/native` in React Native. */\n readonly imports: readonly string[];\n /** The examples, in reading order; the first one is the component's preview. */\n readonly examples: readonly Example[];\n}\n\n/** The React Native side: the same concept, and what differs from the web API. */\nexport interface NativeDocs extends PlatformDocs {\n /**\n * The entry to import from when it is not `@krizaka/ui/native`: a component that needs an Expo module (an optional\n * peer) has its own, `@krizaka/ui/native/<name>`, so an app that does not use it never installs the module.\n */\n readonly entry?: string;\n /** What differs from the web API (`label` instead of children…); empty for a native-only component. */\n readonly differences: readonly string[];\n}\n\nexport interface KeyboardInteraction {\n /** The keys, as written on a keyboard: `Space`, `Enter`, `Arrow keys`, `Esc`, `Tab`. */\n readonly keys: string;\n /** What they do. */\n readonly action: string;\n}\n\nexport interface ComponentMeta {\n /** The display name: `Button`, `Dropdown menu`. */\n readonly title: string;\n /** One sentence: what it is. */\n readonly summary: string;\n readonly status: Status;\n readonly category: Category;\n /** Must match the sides below: `both` ⇔ `web` and `native`. */\n readonly platforms: Platform;\n /** When to reach for it: concrete situations, one per item. */\n readonly whenToUse: readonly string[];\n /** When not to — and what to use instead (`use`), when another component is the answer. */\n readonly whenNotToUse: readonly { readonly when: string; readonly use?: ComponentName }[];\n /** How to use it well: wording, placement, composition. */\n readonly bestPractices: readonly string[];\n readonly accessibility: {\n /** The keyboard, when it does more than Tab and Enter. */\n readonly keyboard: readonly KeyboardInteraction[];\n /** Roles, names and announcements: what the component does, what the app must provide. */\n readonly notes: readonly string[];\n };\n /** The components a reader of this page should know about. */\n readonly related: readonly ComponentName[];\n readonly web?: PlatformDocs;\n readonly native?: NativeDocs;\n}\n"
179
+ "content": "// The documentation of a component, carried by its code: each primitive has a `meta.ts` beside its source\n// (`src/<name>/meta.ts`; a component that exists only in React Native: `src/native/meta/<name>.ts`). Never built into\n// the package: `scripts/build-registry.mjs` reads them into `registry/<name>.json`, which krizaka.com renders as\n// /docs/ui/<name>, and `scripts/registry.test.mjs` fails when one is missing or incomplete.\n//\n// Why a typed module and not JSDoc tags: the fields are lists and links (`related`, `whenNotToUse[].use`, examples),\n// which a type checks and a comment does not; the file is plain data (erasable TypeScript), so Node reads it without a\n// compiler, and an editor completes it.\n\n/** Every documented component: the web primitives (one entry of the package each) and the native-only ones. */\nexport type ComponentName =\n | \"achievement\"\n | \"action-bar\"\n | \"alert\"\n | \"app-shell\"\n | \"argument-card\"\n | \"audio-player\"\n | \"auth-layout\"\n | \"avatar\"\n | \"badge\"\n | \"button\"\n | \"card\"\n | \"card-grid\"\n | \"catalogue-page\"\n | \"changelog-page\"\n | \"checkbox\"\n | \"chip\"\n | \"chip-link\"\n | \"choice-grid\"\n | \"cn\"\n | \"code-block\"\n | \"combobox\"\n | \"command\"\n | \"component-page\"\n | \"confirm-button\"\n | \"contact-page\"\n | \"continue-prompt\"\n | \"countdown\"\n | \"cta-panel\"\n | \"dashboard-layout\"\n | \"data-table\"\n | \"date-picker\"\n | \"decision-list\"\n | \"detail-layout\"\n | \"dialog\"\n | \"docs-article-page\"\n | \"docs-hub-page\"\n | \"docs-layout\"\n | \"dropdown-menu\"\n | \"empty-state\"\n | \"error-page\"\n | \"field\"\n | \"file-upload\"\n | \"filter-bar\"\n | \"form\"\n | \"gallery-page\"\n | \"glow-card\"\n | \"goal-gauge\"\n | \"how-it-works-page\"\n | \"image-cropper\"\n | \"iso\"\n | \"kbd\"\n | \"landing-page\"\n | \"landscape\"\n | \"legal-page\"\n | \"link-card\"\n | \"list\"\n | \"loader\"\n | \"longform-page\"\n | \"marketing-layout\"\n | \"marquee\"\n | \"mascot-quote\"\n | \"mascot-state\"\n | \"mascots\"\n | \"media-capture\"\n | \"meter\"\n | \"nav-bar\"\n | \"number-ticker\"\n | \"page\"\n | \"page-header\"\n | \"page-hero\"\n | \"pagination\"\n | \"pointer-light\"\n | \"popover\"\n | \"pricing-page\"\n | \"product-page\"\n | \"profile-card\"\n | \"progress\"\n | \"promise-card\"\n | \"radio-group\"\n | \"scroll-stage\"\n | \"search-field\"\n | \"section-backdrop\"\n | \"segmented\"\n | \"separator\"\n | \"settings-layout\"\n | \"skeleton\"\n | \"slider\"\n | \"slot\"\n | \"spinner\"\n | \"split-view\"\n | \"stage-banner\"\n | \"stat\"\n | \"status-page\"\n | \"stepper\"\n | \"switch\"\n | \"tabs\"\n | \"tag-input\"\n | \"terminal-replay\"\n | \"theme\"\n | \"toast\"\n | \"toc\"\n | \"tooltip\"\n | \"txt\"\n | \"video-player\"\n | \"video-trimmer\"\n | \"virtual\";\n\n/** Where a component exists: `@krizaka/ui/<name>` (web), `@krizaka/ui/native` (React Native), or both. */\nexport type Platform = \"web\" | \"native\" | \"both\";\n\n/** `stable`: its API only changes in a major. `beta`: it may still change in a minor. */\nexport type Status = \"stable\" | \"beta\";\n\n/**\n * The group of the catalogue. `media`: video, sound, camera, files, cropping. `blocks`: the page blocks — the frame,\n * the hero, sections, cards that lead or argue, decisions, code, calls to act — that every page of a site is made of.\n * `layouts`: the shells of whole screens — an application, a dashboard, settings, sign-in, an object, a list and its\n * item, a site's page, a documentation page — each with its screens. `templates`: the page templates — whole pages of a\n * site (a landing, a product, a docs hub, a long read, a changelog, pricing, status, an error…), each a distinct\n * composition of the blocks, words and content as props.\n */\nexport type Category = \"actions\" | \"forms\" | \"navigation\" | \"overlays\" | \"feedback\" | \"data-display\" | \"media\" | \"blocks\" | \"layouts\" | \"templates\" | \"layout\" | \"foundations\";\n\n/**\n * A named example: the file `registry/examples/<component>/<name>.tsx` (web) or\n * `registry/examples/<component>/native/<name>.tsx` (React Native) — at most 40 lines, imported by the stories and\n * shown (live, with its code) by the documentation.\n */\nexport interface Example {\n /** The file name, kebab-case (`primary`, `icon-button`). */\n readonly name: string;\n /** A short title (`Primary`, `Icon button`). */\n readonly title: string;\n /** One or two sentences: when this variant is the right one. */\n readonly description: string;\n /**\n * A template: a whole screen of a product composed from the platform (a layout and its blocks, real words, its phone\n * version thought out), copied as a starting point — at most 160 lines, listed on krizaka.com/docs/ui/templates.\n */\n readonly template?: boolean;\n}\n\n/** One platform's side of a component. */\nexport interface PlatformDocs {\n /** The names to import (`[\"Button\", \"IconButton\"]`): from `@krizaka/ui/<name>` on the web, `@krizaka/ui/native` in React Native. */\n readonly imports: readonly string[];\n /** The examples, in reading order; the first one is the component's preview. */\n readonly examples: readonly Example[];\n}\n\n/** The React Native side: the same concept, and what differs from the web API. */\nexport interface NativeDocs extends PlatformDocs {\n /**\n * The entry to import from when it is not `@krizaka/ui/native`: a component that needs an Expo module (an optional\n * peer) has its own, `@krizaka/ui/native/<name>`, so an app that does not use it never installs the module.\n */\n readonly entry?: string;\n /** What differs from the web API (`label` instead of children…); empty for a native-only component. */\n readonly differences: readonly string[];\n}\n\nexport interface KeyboardInteraction {\n /** The keys, as written on a keyboard: `Space`, `Enter`, `Arrow keys`, `Esc`, `Tab`. */\n readonly keys: string;\n /** What they do. */\n readonly action: string;\n}\n\nexport interface ComponentMeta {\n /** The display name: `Button`, `Dropdown menu`. */\n readonly title: string;\n /** One sentence: what it is. */\n readonly summary: string;\n readonly status: Status;\n readonly category: Category;\n /** Must match the sides below: `both` ⇔ `web` and `native`. */\n readonly platforms: Platform;\n /** When to reach for it: concrete situations, one per item. */\n readonly whenToUse: readonly string[];\n /** When not to — and what to use instead (`use`), when another component is the answer. */\n readonly whenNotToUse: readonly { readonly when: string; readonly use?: ComponentName }[];\n /** How to use it well: wording, placement, composition. */\n readonly bestPractices: readonly string[];\n readonly accessibility: {\n /** The keyboard, when it does more than Tab and Enter. */\n readonly keyboard: readonly KeyboardInteraction[];\n /** Roles, names and announcements: what the component does, what the app must provide. */\n readonly notes: readonly string[];\n };\n /** The components a reader of this page should know about. */\n readonly related: readonly ComponentName[];\n readonly web?: PlatformDocs;\n readonly native?: NativeDocs;\n}\n"
180
180
  }
181
181
  ],
182
182
  "dependencies": [
@@ -119,7 +119,7 @@
119
119
  },
120
120
  {
121
121
  "path": "meta.ts",
122
- "content": "// The documentation of a component, carried by its code: each primitive has a `meta.ts` beside its source\n// (`src/<name>/meta.ts`; a component that exists only in React Native: `src/native/meta/<name>.ts`). Never built into\n// the package: `scripts/build-registry.mjs` reads them into `registry/<name>.json`, which krizaka.com renders as\n// /docs/ui/<name>, and `scripts/registry.test.mjs` fails when one is missing or incomplete.\n//\n// Why a typed module and not JSDoc tags: the fields are lists and links (`related`, `whenNotToUse[].use`, examples),\n// which a type checks and a comment does not; the file is plain data (erasable TypeScript), so Node reads it without a\n// compiler, and an editor completes it.\n\n/** Every documented component: the web primitives (one entry of the package each) and the native-only ones. */\nexport type ComponentName =\n | \"achievement\"\n | \"action-bar\"\n | \"alert\"\n | \"app-shell\"\n | \"argument-card\"\n | \"audio-player\"\n | \"auth-layout\"\n | \"avatar\"\n | \"badge\"\n | \"button\"\n | \"card\"\n | \"card-grid\"\n | \"catalogue-page\"\n | \"changelog-page\"\n | \"checkbox\"\n | \"chip\"\n | \"chip-link\"\n | \"choice-grid\"\n | \"cn\"\n | \"code-block\"\n | \"combobox\"\n | \"command\"\n | \"component-page\"\n | \"confirm-button\"\n | \"contact-page\"\n | \"continue-prompt\"\n | \"countdown\"\n | \"cta-panel\"\n | \"dashboard-layout\"\n | \"data-table\"\n | \"date-picker\"\n | \"decision-list\"\n | \"detail-layout\"\n | \"dialog\"\n | \"docs-article-page\"\n | \"docs-hub-page\"\n | \"docs-layout\"\n | \"dropdown-menu\"\n | \"empty-state\"\n | \"error-page\"\n | \"field\"\n | \"file-upload\"\n | \"filter-bar\"\n | \"gallery-page\"\n | \"glow-card\"\n | \"goal-gauge\"\n | \"how-it-works-page\"\n | \"image-cropper\"\n | \"iso\"\n | \"kbd\"\n | \"landing-page\"\n | \"landscape\"\n | \"legal-page\"\n | \"link-card\"\n | \"loader\"\n | \"longform-page\"\n | \"marketing-layout\"\n | \"marquee\"\n | \"mascot-quote\"\n | \"mascot-state\"\n | \"mascots\"\n | \"media-capture\"\n | \"meter\"\n | \"nav-bar\"\n | \"number-ticker\"\n | \"page\"\n | \"page-header\"\n | \"page-hero\"\n | \"pagination\"\n | \"pointer-light\"\n | \"popover\"\n | \"pricing-page\"\n | \"product-page\"\n | \"profile-card\"\n | \"progress\"\n | \"promise-card\"\n | \"radio-group\"\n | \"scroll-stage\"\n | \"search-field\"\n | \"section-backdrop\"\n | \"segmented\"\n | \"separator\"\n | \"settings-layout\"\n | \"skeleton\"\n | \"slider\"\n | \"slot\"\n | \"spinner\"\n | \"split-view\"\n | \"stage-banner\"\n | \"stat\"\n | \"status-page\"\n | \"stepper\"\n | \"switch\"\n | \"tabs\"\n | \"tag-input\"\n | \"terminal-replay\"\n | \"theme\"\n | \"toast\"\n | \"toc\"\n | \"tooltip\"\n | \"txt\"\n | \"video-player\"\n | \"video-trimmer\";\n\n/** Where a component exists: `@krizaka/ui/<name>` (web), `@krizaka/ui/native` (React Native), or both. */\nexport type Platform = \"web\" | \"native\" | \"both\";\n\n/** `stable`: its API only changes in a major. `beta`: it may still change in a minor. */\nexport type Status = \"stable\" | \"beta\";\n\n/**\n * The group of the catalogue. `media`: video, sound, camera, files, cropping. `blocks`: the page blocks — the frame,\n * the hero, sections, cards that lead or argue, decisions, code, calls to act — that every page of a site is made of.\n * `layouts`: the shells of whole screens — an application, a dashboard, settings, sign-in, an object, a list and its\n * item, a site's page, a documentation page — each with its screens. `templates`: the page templates — whole pages of a\n * site (a landing, a product, a docs hub, a long read, a changelog, pricing, status, an error…), each a distinct\n * composition of the blocks, words and content as props.\n */\nexport type Category = \"actions\" | \"forms\" | \"navigation\" | \"overlays\" | \"feedback\" | \"data-display\" | \"media\" | \"blocks\" | \"layouts\" | \"templates\" | \"layout\" | \"foundations\";\n\n/**\n * A named example: the file `registry/examples/<component>/<name>.tsx` (web) or\n * `registry/examples/<component>/native/<name>.tsx` (React Native) — at most 40 lines, imported by the stories and\n * shown (live, with its code) by the documentation.\n */\nexport interface Example {\n /** The file name, kebab-case (`primary`, `icon-button`). */\n readonly name: string;\n /** A short title (`Primary`, `Icon button`). */\n readonly title: string;\n /** One or two sentences: when this variant is the right one. */\n readonly description: string;\n /**\n * A template: a whole screen of a product composed from the platform (a layout and its blocks, real words, its phone\n * version thought out), copied as a starting point — at most 160 lines, listed on krizaka.com/docs/ui/templates.\n */\n readonly template?: boolean;\n}\n\n/** One platform's side of a component. */\nexport interface PlatformDocs {\n /** The names to import (`[\"Button\", \"IconButton\"]`): from `@krizaka/ui/<name>` on the web, `@krizaka/ui/native` in React Native. */\n readonly imports: readonly string[];\n /** The examples, in reading order; the first one is the component's preview. */\n readonly examples: readonly Example[];\n}\n\n/** The React Native side: the same concept, and what differs from the web API. */\nexport interface NativeDocs extends PlatformDocs {\n /**\n * The entry to import from when it is not `@krizaka/ui/native`: a component that needs an Expo module (an optional\n * peer) has its own, `@krizaka/ui/native/<name>`, so an app that does not use it never installs the module.\n */\n readonly entry?: string;\n /** What differs from the web API (`label` instead of children…); empty for a native-only component. */\n readonly differences: readonly string[];\n}\n\nexport interface KeyboardInteraction {\n /** The keys, as written on a keyboard: `Space`, `Enter`, `Arrow keys`, `Esc`, `Tab`. */\n readonly keys: string;\n /** What they do. */\n readonly action: string;\n}\n\nexport interface ComponentMeta {\n /** The display name: `Button`, `Dropdown menu`. */\n readonly title: string;\n /** One sentence: what it is. */\n readonly summary: string;\n readonly status: Status;\n readonly category: Category;\n /** Must match the sides below: `both` ⇔ `web` and `native`. */\n readonly platforms: Platform;\n /** When to reach for it: concrete situations, one per item. */\n readonly whenToUse: readonly string[];\n /** When not to — and what to use instead (`use`), when another component is the answer. */\n readonly whenNotToUse: readonly { readonly when: string; readonly use?: ComponentName }[];\n /** How to use it well: wording, placement, composition. */\n readonly bestPractices: readonly string[];\n readonly accessibility: {\n /** The keyboard, when it does more than Tab and Enter. */\n readonly keyboard: readonly KeyboardInteraction[];\n /** Roles, names and announcements: what the component does, what the app must provide. */\n readonly notes: readonly string[];\n };\n /** The components a reader of this page should know about. */\n readonly related: readonly ComponentName[];\n readonly web?: PlatformDocs;\n readonly native?: NativeDocs;\n}\n"
122
+ "content": "// The documentation of a component, carried by its code: each primitive has a `meta.ts` beside its source\n// (`src/<name>/meta.ts`; a component that exists only in React Native: `src/native/meta/<name>.ts`). Never built into\n// the package: `scripts/build-registry.mjs` reads them into `registry/<name>.json`, which krizaka.com renders as\n// /docs/ui/<name>, and `scripts/registry.test.mjs` fails when one is missing or incomplete.\n//\n// Why a typed module and not JSDoc tags: the fields are lists and links (`related`, `whenNotToUse[].use`, examples),\n// which a type checks and a comment does not; the file is plain data (erasable TypeScript), so Node reads it without a\n// compiler, and an editor completes it.\n\n/** Every documented component: the web primitives (one entry of the package each) and the native-only ones. */\nexport type ComponentName =\n | \"achievement\"\n | \"action-bar\"\n | \"alert\"\n | \"app-shell\"\n | \"argument-card\"\n | \"audio-player\"\n | \"auth-layout\"\n | \"avatar\"\n | \"badge\"\n | \"button\"\n | \"card\"\n | \"card-grid\"\n | \"catalogue-page\"\n | \"changelog-page\"\n | \"checkbox\"\n | \"chip\"\n | \"chip-link\"\n | \"choice-grid\"\n | \"cn\"\n | \"code-block\"\n | \"combobox\"\n | \"command\"\n | \"component-page\"\n | \"confirm-button\"\n | \"contact-page\"\n | \"continue-prompt\"\n | \"countdown\"\n | \"cta-panel\"\n | \"dashboard-layout\"\n | \"data-table\"\n | \"date-picker\"\n | \"decision-list\"\n | \"detail-layout\"\n | \"dialog\"\n | \"docs-article-page\"\n | \"docs-hub-page\"\n | \"docs-layout\"\n | \"dropdown-menu\"\n | \"empty-state\"\n | \"error-page\"\n | \"field\"\n | \"file-upload\"\n | \"filter-bar\"\n | \"form\"\n | \"gallery-page\"\n | \"glow-card\"\n | \"goal-gauge\"\n | \"how-it-works-page\"\n | \"image-cropper\"\n | \"iso\"\n | \"kbd\"\n | \"landing-page\"\n | \"landscape\"\n | \"legal-page\"\n | \"link-card\"\n | \"list\"\n | \"loader\"\n | \"longform-page\"\n | \"marketing-layout\"\n | \"marquee\"\n | \"mascot-quote\"\n | \"mascot-state\"\n | \"mascots\"\n | \"media-capture\"\n | \"meter\"\n | \"nav-bar\"\n | \"number-ticker\"\n | \"page\"\n | \"page-header\"\n | \"page-hero\"\n | \"pagination\"\n | \"pointer-light\"\n | \"popover\"\n | \"pricing-page\"\n | \"product-page\"\n | \"profile-card\"\n | \"progress\"\n | \"promise-card\"\n | \"radio-group\"\n | \"scroll-stage\"\n | \"search-field\"\n | \"section-backdrop\"\n | \"segmented\"\n | \"separator\"\n | \"settings-layout\"\n | \"skeleton\"\n | \"slider\"\n | \"slot\"\n | \"spinner\"\n | \"split-view\"\n | \"stage-banner\"\n | \"stat\"\n | \"status-page\"\n | \"stepper\"\n | \"switch\"\n | \"tabs\"\n | \"tag-input\"\n | \"terminal-replay\"\n | \"theme\"\n | \"toast\"\n | \"toc\"\n | \"tooltip\"\n | \"txt\"\n | \"video-player\"\n | \"video-trimmer\"\n | \"virtual\";\n\n/** Where a component exists: `@krizaka/ui/<name>` (web), `@krizaka/ui/native` (React Native), or both. */\nexport type Platform = \"web\" | \"native\" | \"both\";\n\n/** `stable`: its API only changes in a major. `beta`: it may still change in a minor. */\nexport type Status = \"stable\" | \"beta\";\n\n/**\n * The group of the catalogue. `media`: video, sound, camera, files, cropping. `blocks`: the page blocks — the frame,\n * the hero, sections, cards that lead or argue, decisions, code, calls to act — that every page of a site is made of.\n * `layouts`: the shells of whole screens — an application, a dashboard, settings, sign-in, an object, a list and its\n * item, a site's page, a documentation page — each with its screens. `templates`: the page templates — whole pages of a\n * site (a landing, a product, a docs hub, a long read, a changelog, pricing, status, an error…), each a distinct\n * composition of the blocks, words and content as props.\n */\nexport type Category = \"actions\" | \"forms\" | \"navigation\" | \"overlays\" | \"feedback\" | \"data-display\" | \"media\" | \"blocks\" | \"layouts\" | \"templates\" | \"layout\" | \"foundations\";\n\n/**\n * A named example: the file `registry/examples/<component>/<name>.tsx` (web) or\n * `registry/examples/<component>/native/<name>.tsx` (React Native) — at most 40 lines, imported by the stories and\n * shown (live, with its code) by the documentation.\n */\nexport interface Example {\n /** The file name, kebab-case (`primary`, `icon-button`). */\n readonly name: string;\n /** A short title (`Primary`, `Icon button`). */\n readonly title: string;\n /** One or two sentences: when this variant is the right one. */\n readonly description: string;\n /**\n * A template: a whole screen of a product composed from the platform (a layout and its blocks, real words, its phone\n * version thought out), copied as a starting point — at most 160 lines, listed on krizaka.com/docs/ui/templates.\n */\n readonly template?: boolean;\n}\n\n/** One platform's side of a component. */\nexport interface PlatformDocs {\n /** The names to import (`[\"Button\", \"IconButton\"]`): from `@krizaka/ui/<name>` on the web, `@krizaka/ui/native` in React Native. */\n readonly imports: readonly string[];\n /** The examples, in reading order; the first one is the component's preview. */\n readonly examples: readonly Example[];\n}\n\n/** The React Native side: the same concept, and what differs from the web API. */\nexport interface NativeDocs extends PlatformDocs {\n /**\n * The entry to import from when it is not `@krizaka/ui/native`: a component that needs an Expo module (an optional\n * peer) has its own, `@krizaka/ui/native/<name>`, so an app that does not use it never installs the module.\n */\n readonly entry?: string;\n /** What differs from the web API (`label` instead of children…); empty for a native-only component. */\n readonly differences: readonly string[];\n}\n\nexport interface KeyboardInteraction {\n /** The keys, as written on a keyboard: `Space`, `Enter`, `Arrow keys`, `Esc`, `Tab`. */\n readonly keys: string;\n /** What they do. */\n readonly action: string;\n}\n\nexport interface ComponentMeta {\n /** The display name: `Button`, `Dropdown menu`. */\n readonly title: string;\n /** One sentence: what it is. */\n readonly summary: string;\n readonly status: Status;\n readonly category: Category;\n /** Must match the sides below: `both` ⇔ `web` and `native`. */\n readonly platforms: Platform;\n /** When to reach for it: concrete situations, one per item. */\n readonly whenToUse: readonly string[];\n /** When not to — and what to use instead (`use`), when another component is the answer. */\n readonly whenNotToUse: readonly { readonly when: string; readonly use?: ComponentName }[];\n /** How to use it well: wording, placement, composition. */\n readonly bestPractices: readonly string[];\n readonly accessibility: {\n /** The keyboard, when it does more than Tab and Enter. */\n readonly keyboard: readonly KeyboardInteraction[];\n /** Roles, names and announcements: what the component does, what the app must provide. */\n readonly notes: readonly string[];\n };\n /** The components a reader of this page should know about. */\n readonly related: readonly ComponentName[];\n readonly web?: PlatformDocs;\n readonly native?: NativeDocs;\n}\n"
123
123
  }
124
124
  ],
125
125
  "dependencies": [],
@@ -0,0 +1,4 @@
1
+ import type { ComponentType } from "react";
2
+ /** A named example of the @krizaka/ui registry; `defaultOpen` opens what it opens (a dialog, a menu, toasts) at load. */
3
+ declare const Example: ComponentType<{ defaultOpen?: boolean }>;
4
+ export default Example;
@@ -0,0 +1,26 @@
1
+ "use client";
2
+
3
+ // registry/examples/checkbox/native/terms.tsx
4
+ import { Checkbox, Txt } from "@krizaka/ui/native";
5
+ import * as React from "react";
6
+ import { View } from "react-native";
7
+ import { jsx, jsxs } from "react/jsx-runtime";
8
+ function NativeCheckboxTerms() {
9
+ const [adult, setAdult] = React.useState(true);
10
+ const [terms, setTerms] = React.useState(false);
11
+ return /* @__PURE__ */ jsxs(View, { style: { gap: 4, width: 296 }, children: [
12
+ /* @__PURE__ */ jsx(Checkbox, { checked: adult, onCheckedChange: setAdult, children: "I am 18 or older" }),
13
+ /* @__PURE__ */ jsx(Checkbox, { checked: terms, onCheckedChange: setTerms, label: "I accept the terms and the privacy policy", error: terms ? void 0 : "Accept the terms to create your account.", children: /* @__PURE__ */ jsxs(Txt, { children: [
14
+ "I accept the",
15
+ " ",
16
+ /* @__PURE__ */ jsx(Txt, { tone: "accent", role: "link", style: { textDecorationLine: "underline" }, onPress: () => void 0, children: "terms" }),
17
+ " ",
18
+ "and the",
19
+ " ",
20
+ /* @__PURE__ */ jsx(Txt, { tone: "accent", role: "link", style: { textDecorationLine: "underline" }, onPress: () => void 0, children: "privacy policy" })
21
+ ] }) })
22
+ ] });
23
+ }
24
+ export {
25
+ NativeCheckboxTerms as default
26
+ };
@@ -0,0 +1,28 @@
1
+ import { Checkbox, Txt } from "@krizaka/ui/native";
2
+ import * as React from "react";
3
+ import { View } from "react-native";
4
+
5
+ // The two boxes of a sign-up: the second is a sentence with links, named by `label`, in error until it is ticked.
6
+ export default function NativeCheckboxTerms() {
7
+ const [adult, setAdult] = React.useState(true);
8
+ const [terms, setTerms] = React.useState(false);
9
+ return (
10
+ <View style={{ gap: 4, width: 296 }}>
11
+ <Checkbox checked={adult} onCheckedChange={setAdult}>
12
+ I am 18 or older
13
+ </Checkbox>
14
+ <Checkbox checked={terms} onCheckedChange={setTerms} label="I accept the terms and the privacy policy" error={terms ? undefined : "Accept the terms to create your account."}>
15
+ <Txt>
16
+ I accept the{" "}
17
+ <Txt tone="accent" role="link" style={{ textDecorationLine: "underline" }} onPress={() => undefined}>
18
+ terms
19
+ </Txt>{" "}
20
+ and the{" "}
21
+ <Txt tone="accent" role="link" style={{ textDecorationLine: "underline" }} onPress={() => undefined}>
22
+ privacy policy
23
+ </Txt>
24
+ </Txt>
25
+ </Checkbox>
26
+ </View>
27
+ );
28
+ }
@@ -0,0 +1,4 @@
1
+ import type { ComponentType } from "react";
2
+ /** A named example of the @krizaka/ui registry; `defaultOpen` opens what it opens (a dialog, a menu, toasts) at load. */
3
+ declare const Example: ComponentType<{ defaultOpen?: boolean }>;
4
+ export default Example;
@@ -0,0 +1,33 @@
1
+ "use client";
2
+
3
+ // registry/examples/data-table/details.tsx
4
+ import { Badge } from "@krizaka/ui/badge";
5
+ import { DataTable } from "@krizaka/ui/data-table";
6
+ import { jsx } from "react/jsx-runtime";
7
+ var requests = [
8
+ { id: "v-1042", creator: "Elena Varga", kind: "Identity check", status: "pending", note: "Passport, expires 2031. Selfie matches." },
9
+ { id: "v-1041", creator: "Noah Petit", kind: "Payout account", status: "pending", note: "IBAN FR76 \u2022\u2022\u2022\u2022 0412, holder name matches." },
10
+ { id: "v-1039", creator: "Maya Chen", kind: "Identity check", status: "approved", note: "Approved by Sam on Oct 11." }
11
+ ];
12
+ var columns = [
13
+ { id: "creator", header: "Creator", card: "title" },
14
+ { id: "kind", header: "Request" },
15
+ { id: "status", header: "Status", cell: (r) => /* @__PURE__ */ jsx(Badge, { tone: r.status === "pending" ? "warning" : "success", children: r.status }) }
16
+ ];
17
+ function DataTableDetails() {
18
+ return /* @__PURE__ */ jsx(
19
+ DataTable,
20
+ {
21
+ caption: "Verification requests",
22
+ rows: requests,
23
+ columns,
24
+ getRowId: (r) => r.id,
25
+ rowLabel: (r) => r.creator,
26
+ defaultExpanded: { "v-1042": true },
27
+ renderDetail: (r) => /* @__PURE__ */ jsx("p", { className: "text-sm text-fg-secondary", children: r.note })
28
+ }
29
+ );
30
+ }
31
+ export {
32
+ DataTableDetails as default
33
+ };
@@ -0,0 +1,31 @@
1
+ "use client";
2
+
3
+ import { Badge } from "@krizaka/ui/badge";
4
+ import { DataTable, type DataTableColumn } from "@krizaka/ui/data-table";
5
+
6
+ type Request = { id: string; creator: string; kind: string; status: "pending" | "approved"; note: string };
7
+ const requests: Request[] = [
8
+ { id: "v-1042", creator: "Elena Varga", kind: "Identity check", status: "pending", note: "Passport, expires 2031. Selfie matches." },
9
+ { id: "v-1041", creator: "Noah Petit", kind: "Payout account", status: "pending", note: "IBAN FR76 •••• 0412, holder name matches." },
10
+ { id: "v-1039", creator: "Maya Chen", kind: "Identity check", status: "approved", note: "Approved by Sam on Oct 11." },
11
+ ];
12
+ const columns: DataTableColumn<Request>[] = [
13
+ { id: "creator", header: "Creator", card: "title" },
14
+ { id: "kind", header: "Request" },
15
+ { id: "status", header: "Status", cell: (r) => <Badge tone={r.status === "pending" ? "warning" : "success"}>{r.status}</Badge> },
16
+ ];
17
+
18
+ // A button per row opens a panel under it: the details, without leaving the list.
19
+ export default function DataTableDetails() {
20
+ return (
21
+ <DataTable
22
+ caption="Verification requests"
23
+ rows={requests}
24
+ columns={columns}
25
+ getRowId={(r) => r.id}
26
+ rowLabel={(r) => r.creator}
27
+ defaultExpanded={{ "v-1042": true }}
28
+ renderDetail={(r) => <p className="text-sm text-fg-secondary">{r.note}</p>}
29
+ />
30
+ );
31
+ }
@@ -0,0 +1,4 @@
1
+ import type { ComponentType } from "react";
2
+ /** A named example of the @krizaka/ui registry; `defaultOpen` opens what it opens (a dialog, a menu, toasts) at load. */
3
+ declare const Example: ComponentType<{ defaultOpen?: boolean }>;
4
+ export default Example;
@@ -0,0 +1,40 @@
1
+ "use client";
2
+
3
+ // registry/examples/data-table/filters.tsx
4
+ import { DataTable, DataTableColumnsMenu, DataTableExport, DataTableFilters } from "@krizaka/ui/data-table";
5
+ import { jsx, jsxs } from "react/jsx-runtime";
6
+ var videos = Array.from({ length: 36 }, (_, i) => ({
7
+ id: `v${i + 1}`,
8
+ title: ["Sunset over Montr\xE9al", "Behind the scenes", "Studio tour", "Live Q&A replay"][i % 4] + ` #${i + 1}`,
9
+ creator: ["Elena Varga", "Noah Petit", "Maya Chen"][i % 3],
10
+ status: ["Public", "Followers", "Draft"][i % 3 === 2 ? 2 : i % 2],
11
+ views: i * 7919 % 2e4
12
+ }));
13
+ var columns = [
14
+ { id: "title", header: "Title", sortable: true, card: "title", filter: "text" },
15
+ { id: "creator", header: "Creator", filter: "facet" },
16
+ { id: "status", header: "Visibility", filter: "facet" },
17
+ { id: "views", header: "Views", sortable: true, align: "end", filter: "range", cell: (v) => v.views.toLocaleString("en") }
18
+ ];
19
+ function DataTableFiltersExample() {
20
+ return /* @__PURE__ */ jsx(
21
+ DataTable,
22
+ {
23
+ caption: "Videos",
24
+ rows: videos,
25
+ columns,
26
+ getRowId: (v) => v.id,
27
+ defaultPageSize: 8,
28
+ toolbar: /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-3", children: [
29
+ /* @__PURE__ */ jsx(DataTableFilters, {}),
30
+ /* @__PURE__ */ jsxs("div", { className: "flex justify-end gap-2", children: [
31
+ /* @__PURE__ */ jsx(DataTableColumnsMenu, {}),
32
+ /* @__PURE__ */ jsx(DataTableExport, { filename: "videos.csv" })
33
+ ] })
34
+ ] })
35
+ }
36
+ );
37
+ }
38
+ export {
39
+ DataTableFiltersExample as default
40
+ };
@@ -0,0 +1,40 @@
1
+ "use client";
2
+
3
+ import { DataTable, type DataTableColumn, DataTableColumnsMenu, DataTableExport, DataTableFilters } from "@krizaka/ui/data-table";
4
+
5
+ type Video = { id: string; title: string; creator: string; status: string; views: number };
6
+ const videos: Video[] = Array.from({ length: 36 }, (_, i) => ({
7
+ id: `v${i + 1}`,
8
+ title: ["Sunset over Montréal", "Behind the scenes", "Studio tour", "Live Q&A replay"][i % 4]! + ` #${i + 1}`,
9
+ creator: ["Elena Varga", "Noah Petit", "Maya Chen"][i % 3]!,
10
+ status: ["Public", "Followers", "Draft"][i % 3 === 2 ? 2 : i % 2]!,
11
+ views: (i * 7919) % 20_000,
12
+ }));
13
+ const columns: DataTableColumn<Video>[] = [
14
+ { id: "title", header: "Title", sortable: true, card: "title", filter: "text" },
15
+ { id: "creator", header: "Creator", filter: "facet" },
16
+ { id: "status", header: "Visibility", filter: "facet" },
17
+ { id: "views", header: "Views", sortable: true, align: "end", filter: "range", cell: (v) => v.views.toLocaleString("en") },
18
+ ];
19
+
20
+ // A search, facets with their counts, a range, the filters as chips; hide columns, export what is shown.
21
+ export default function DataTableFiltersExample() {
22
+ return (
23
+ <DataTable
24
+ caption="Videos"
25
+ rows={videos}
26
+ columns={columns}
27
+ getRowId={(v) => v.id}
28
+ defaultPageSize={8}
29
+ toolbar={
30
+ <div className="flex flex-col gap-3">
31
+ <DataTableFilters />
32
+ <div className="flex justify-end gap-2">
33
+ <DataTableColumnsMenu />
34
+ <DataTableExport filename="videos.csv" />
35
+ </div>
36
+ </div>
37
+ }
38
+ />
39
+ );
40
+ }
@@ -0,0 +1,4 @@
1
+ import type { ComponentType } from "react";
2
+ /** A named example of the @krizaka/ui registry; `defaultOpen` opens what it opens (a dialog, a menu, toasts) at load. */
3
+ declare const Example: ComponentType<{ defaultOpen?: boolean }>;
4
+ export default Example;
@@ -0,0 +1,24 @@
1
+ "use client";
2
+
3
+ // registry/examples/data-table/grouped.tsx
4
+ import { DataTable } from "@krizaka/ui/data-table";
5
+ import { jsx } from "react/jsx-runtime";
6
+ var tips = [
7
+ { id: "t1", creator: "Elena Varga", fan: "marco_v", cents: 500 },
8
+ { id: "t2", creator: "Elena Varga", fan: "ana.lu", cents: 1500 },
9
+ { id: "t3", creator: "Noah Petit", fan: "kenji", cents: 300 },
10
+ { id: "t4", creator: "Maya Chen", fan: "marco_v", cents: 2e3 },
11
+ { id: "t5", creator: "Noah Petit", fan: "zoe", cents: 700 }
12
+ ];
13
+ var money = (cents) => (cents / 100).toLocaleString("en", { style: "currency", currency: "USD" });
14
+ var columns = [
15
+ { id: "creator", header: "Creator", groupable: true, card: "title" },
16
+ { id: "fan", header: "From" },
17
+ { id: "cents", header: "Amount", align: "end", cell: (t) => money(t.cents), aggregate: (rows) => money(rows.reduce((sum, t) => sum + t.cents, 0)) }
18
+ ];
19
+ function DataTableGrouped() {
20
+ return /* @__PURE__ */ jsx(DataTable, { caption: "Tips this week", rows: tips, columns, getRowId: (t) => t.id, defaultGroupBy: ["creator"], defaultExpanded: { "creator:Elena Varga": true } });
21
+ }
22
+ export {
23
+ DataTableGrouped as default
24
+ };
@@ -0,0 +1,23 @@
1
+ "use client";
2
+
3
+ import { DataTable, type DataTableColumn } from "@krizaka/ui/data-table";
4
+
5
+ type Tip = { id: string; creator: string; fan: string; cents: number };
6
+ const tips: Tip[] = [
7
+ { id: "t1", creator: "Elena Varga", fan: "marco_v", cents: 500 },
8
+ { id: "t2", creator: "Elena Varga", fan: "ana.lu", cents: 1500 },
9
+ { id: "t3", creator: "Noah Petit", fan: "kenji", cents: 300 },
10
+ { id: "t4", creator: "Maya Chen", fan: "marco_v", cents: 2000 },
11
+ { id: "t5", creator: "Noah Petit", fan: "zoe", cents: 700 },
12
+ ];
13
+ const money = (cents: number) => (cents / 100).toLocaleString("en", { style: "currency", currency: "USD" });
14
+ const columns: DataTableColumn<Tip>[] = [
15
+ { id: "creator", header: "Creator", groupable: true, card: "title" },
16
+ { id: "fan", header: "From" },
17
+ { id: "cents", header: "Amount", align: "end", cell: (t) => money(t.cents), aggregate: (rows) => money(rows.reduce((sum, t) => sum + t.cents, 0)) },
18
+ ];
19
+
20
+ // Grouped by creator: a row per group with its count and its total, opened to see the tips.
21
+ export default function DataTableGrouped() {
22
+ return <DataTable caption="Tips this week" rows={tips} columns={columns} getRowId={(t) => t.id} defaultGroupBy={["creator"]} defaultExpanded={{ "creator:Elena Varga": true }} />;
23
+ }
@@ -0,0 +1,4 @@
1
+ import type { ComponentType } from "react";
2
+ /** A named example of the @krizaka/ui registry; `defaultOpen` opens what it opens (a dialog, a menu, toasts) at load. */
3
+ declare const Example: ComponentType<{ defaultOpen?: boolean }>;
4
+ export default Example;
@@ -0,0 +1,23 @@
1
+ "use client";
2
+
3
+ // registry/examples/data-table/paginated.tsx
4
+ import { DataTable } from "@krizaka/ui/data-table";
5
+ import { jsx } from "react/jsx-runtime";
6
+ var invoices = Array.from({ length: 87 }, (_, i) => ({
7
+ id: `INV-2026-${String(i + 1).padStart(4, "0")}`,
8
+ customer: ["Atelier Lumen", "Northwind Studio", "Caf\xE9 Br\xFBl\xE9", "Kite & Co"][i % 4],
9
+ issued: `2026-${String(1 + i % 9).padStart(2, "0")}-${String(1 + i % 27).padStart(2, "0")}`,
10
+ total: i * 4111 % 12e4 / 100
11
+ }));
12
+ var columns = [
13
+ { id: "id", header: "Invoice", sortable: true, card: "title" },
14
+ { id: "customer", header: "Customer", sortable: true },
15
+ { id: "issued", header: "Issued", sortable: true },
16
+ { id: "total", header: "Total", sortable: true, align: "end", cell: (r) => `\u20AC${r.total.toFixed(2)}` }
17
+ ];
18
+ function DataTablePaginated() {
19
+ return /* @__PURE__ */ jsx(DataTable, { caption: "Invoices", rows: invoices, columns, getRowId: (r) => r.id, defaultPageSize: 10, pageSizeOptions: [10, 25, 50] });
20
+ }
21
+ export {
22
+ DataTablePaginated as default
23
+ };
@@ -0,0 +1,22 @@
1
+ "use client";
2
+
3
+ import { DataTable, type DataTableColumn } from "@krizaka/ui/data-table";
4
+
5
+ type Invoice = { id: string; customer: string; issued: string; total: number };
6
+ const invoices: Invoice[] = Array.from({ length: 87 }, (_, i) => ({
7
+ id: `INV-2026-${String(i + 1).padStart(4, "0")}`,
8
+ customer: ["Atelier Lumen", "Northwind Studio", "Café Brûlé", "Kite & Co"][i % 4]!,
9
+ issued: `2026-${String(1 + (i % 9)).padStart(2, "0")}-${String(1 + (i % 27)).padStart(2, "0")}`,
10
+ total: ((i * 4111) % 120_000) / 100,
11
+ }));
12
+ const columns: DataTableColumn<Invoice>[] = [
13
+ { id: "id", header: "Invoice", sortable: true, card: "title" },
14
+ { id: "customer", header: "Customer", sortable: true },
15
+ { id: "issued", header: "Issued", sortable: true },
16
+ { id: "total", header: "Total", sortable: true, align: "end", cell: (r) => `€${r.total.toFixed(2)}` },
17
+ ];
18
+
19
+ // Pages in the browser: the pagination under the table, the rows per page to choose; a sort goes back to page 1.
20
+ export default function DataTablePaginated() {
21
+ return <DataTable caption="Invoices" rows={invoices} columns={columns} getRowId={(r) => r.id} defaultPageSize={10} pageSizeOptions={[10, 25, 50]} />;
22
+ }
@@ -0,0 +1,4 @@
1
+ import type { ComponentType } from "react";
2
+ /** A named example of the @krizaka/ui registry; `defaultOpen` opens what it opens (a dialog, a menu, toasts) at load. */
3
+ declare const Example: ComponentType<{ defaultOpen?: boolean }>;
4
+ export default Example;
@@ -0,0 +1,26 @@
1
+ "use client";
2
+
3
+ // registry/examples/data-table/pinned.tsx
4
+ import { DataTable } from "@krizaka/ui/data-table";
5
+ import { jsx } from "react/jsx-runtime";
6
+ var models = [
7
+ { id: "m1", name: "Llama 3.3 70B", provider: "Self-hosted", input: 0.23, output: 0.4, context: 128, latency: 420, region: "eu-west" },
8
+ { id: "m2", name: "Mistral Large", provider: "Mistral", input: 2, output: 6, context: 128, latency: 380, region: "eu-west" },
9
+ { id: "m3", name: "Qwen 2.5 Coder", provider: "Self-hosted", input: 0.12, output: 0.2, context: 32, latency: 210, region: "eu-central" }
10
+ ];
11
+ var usd = (n) => `$${n.toFixed(2)}`;
12
+ var columns = [
13
+ { id: "name", header: "Model", width: 180, card: "title" },
14
+ { id: "provider", header: "Provider", width: 140 },
15
+ { id: "input", header: "Input / 1M", width: 130, align: "end", cell: (m) => usd(m.input) },
16
+ { id: "output", header: "Output / 1M", width: 130, align: "end", cell: (m) => usd(m.output) },
17
+ { id: "context", header: "Context", width: 110, align: "end", cell: (m) => `${m.context}k` },
18
+ { id: "latency", header: "Latency", width: 110, align: "end", cell: (m) => `${m.latency} ms` },
19
+ { id: "region", header: "Region", width: 130 }
20
+ ];
21
+ function DataTablePinned() {
22
+ return /* @__PURE__ */ jsx(DataTable, { caption: "Model pricing", rows: models, columns, getRowId: (m) => m.id, pinning: { start: ["name"] }, resizing: true, layout: "table" });
23
+ }
24
+ export {
25
+ DataTablePinned as default
26
+ };
@@ -0,0 +1,25 @@
1
+ "use client";
2
+
3
+ import { DataTable, type DataTableColumn } from "@krizaka/ui/data-table";
4
+
5
+ type Model = { id: string; name: string; provider: string; input: number; output: number; context: number; latency: number; region: string };
6
+ const models: Model[] = [
7
+ { id: "m1", name: "Llama 3.3 70B", provider: "Self-hosted", input: 0.23, output: 0.4, context: 128, latency: 420, region: "eu-west" },
8
+ { id: "m2", name: "Mistral Large", provider: "Mistral", input: 2, output: 6, context: 128, latency: 380, region: "eu-west" },
9
+ { id: "m3", name: "Qwen 2.5 Coder", provider: "Self-hosted", input: 0.12, output: 0.2, context: 32, latency: 210, region: "eu-central" },
10
+ ];
11
+ const usd = (n: number) => `$${n.toFixed(2)}`;
12
+ const columns: DataTableColumn<Model>[] = [
13
+ { id: "name", header: "Model", width: 180, card: "title" },
14
+ { id: "provider", header: "Provider", width: 140 },
15
+ { id: "input", header: "Input / 1M", width: 130, align: "end", cell: (m) => usd(m.input) },
16
+ { id: "output", header: "Output / 1M", width: 130, align: "end", cell: (m) => usd(m.output) },
17
+ { id: "context", header: "Context", width: 110, align: "end", cell: (m) => `${m.context}k` },
18
+ { id: "latency", header: "Latency", width: 110, align: "end", cell: (m) => `${m.latency} ms` },
19
+ { id: "region", header: "Region", width: 130 },
20
+ ];
21
+
22
+ // A wide table: the name stays at the start while it scrolls sideways; drag (or ← →) a header's edge to resize.
23
+ export default function DataTablePinned() {
24
+ return <DataTable caption="Model pricing" rows={models} columns={columns} getRowId={(m) => m.id} pinning={{ start: ["name"] }} resizing layout="table" />;
25
+ }
@@ -0,0 +1,4 @@
1
+ import type { ComponentType } from "react";
2
+ /** A named example of the @krizaka/ui registry; `defaultOpen` opens what it opens (a dialog, a menu, toasts) at load. */
3
+ declare const Example: ComponentType<{ defaultOpen?: boolean }>;
4
+ export default Example;
@@ -0,0 +1,40 @@
1
+ "use client";
2
+
3
+ // registry/examples/data-table/server.tsx
4
+ import { configureKrizakaFetch, defineKeys, keepPreviousData, krizakaFetch, KrizakaQueryProvider, useQuery } from "@krizaka/query";
5
+ import { DataTable, DataTableFilters } from "@krizaka/ui/data-table";
6
+ import { useState } from "react";
7
+ import { jsx } from "react/jsx-runtime";
8
+ var ALL = Array.from({ length: 240 }, (_, i) => ({ id: `po-${1e3 + i}`, creator: ["Elena Varga", "Noah Petit", "Maya Chen"][i % 3], status: ["paid", "pending", "failed"][i % 4 % 3], amount: i * 7919 % 9e4 / 100 }));
9
+ async function fakeApi(input) {
10
+ const q = new URL(String(input), "https://api.example").searchParams;
11
+ const [by, dir] = (q.get("sort") ?? "id:ascending").split(":");
12
+ const rows = ALL.filter((p) => !q.get("status") || q.get("status").split(",").includes(p.status)).sort((a, b) => (a[by] > b[by] ? 1 : -1) * (dir === "descending" ? -1 : 1));
13
+ const [page, size] = [Number(q.get("page")), Number(q.get("size"))];
14
+ return Response.json({ rows: rows.slice((page - 1) * size, page * size), total: rows.length });
15
+ }
16
+ var payoutKeys = defineKeys("payouts", { list: (query) => [query] });
17
+ var columns = [
18
+ { id: "id", header: "Payout", sortable: true, card: "title" },
19
+ { id: "creator", header: "Creator", sortable: true },
20
+ { id: "status", header: "Status", filter: "facet", options: [{ value: "paid", label: "Paid" }, { value: "pending", label: "Pending" }, { value: "failed", label: "Failed" }] },
21
+ { id: "amount", header: "Amount", sortable: true, align: "end", cell: (p) => `$${p.amount.toFixed(2)}` }
22
+ ];
23
+ var NONE = [];
24
+ function Payouts() {
25
+ const [query, setQuery] = useState({ sort: null, filters: {}, page: 1, pageSize: 10 });
26
+ const { data, isPending, error } = useQuery({
27
+ queryKey: payoutKeys.list(query),
28
+ queryFn: ({ signal }) => krizakaFetch("/api/payouts", { signal, query: { sort: query.sort && `${query.sort.column}:${query.sort.direction}`, status: query.filters.status, page: query.page, size: query.pageSize } }),
29
+ placeholderData: keepPreviousData,
30
+ meta: { list: true }
31
+ });
32
+ return /* @__PURE__ */ jsx(DataTable, { caption: "Payouts", rows: data?.rows ?? NONE, columns, getRowId: (p) => p.id, manual: { sorting: true, filtering: true, pagination: true }, rowCount: data?.total, defaultPageSize: 10, onStateChange: setQuery, loading: isPending, error: error?.message, toolbar: /* @__PURE__ */ jsx(DataTableFilters, {}) });
33
+ }
34
+ function DataTableServer() {
35
+ useState(() => configureKrizakaFetch({ fetch: fakeApi }));
36
+ return /* @__PURE__ */ jsx(KrizakaQueryProvider, { children: /* @__PURE__ */ jsx(Payouts, {}) });
37
+ }
38
+ export {
39
+ DataTableServer as default
40
+ };
@@ -0,0 +1,40 @@
1
+ "use client";
2
+
3
+ import { configureKrizakaFetch, defineKeys, keepPreviousData, krizakaFetch, KrizakaQueryProvider, useQuery } from "@krizaka/query";
4
+ import { DataTable, type DataTableColumn, DataTableFilters, type DataTableQuery } from "@krizaka/ui/data-table";
5
+ import { useState } from "react";
6
+
7
+ type Payout = { id: string; creator: string; status: string; amount: number };
8
+ const ALL: Payout[] = Array.from({ length: 240 }, (_, i) => ({ id: `po-${1000 + i}`, creator: ["Elena Varga", "Noah Petit", "Maya Chen"][i % 3]!, status: ["paid", "pending", "failed"][i % 4 % 3]!, amount: ((i * 7919) % 90_000) / 100 }));
9
+ // The API, faked in the page: it sorts, filters and pages — the table shows what it answers.
10
+ async function fakeApi(input: RequestInfo | URL) {
11
+ const q = new URL(String(input), "https://api.example").searchParams;
12
+ const [by, dir] = (q.get("sort") ?? "id:ascending").split(":") as [keyof Payout, string];
13
+ const rows = ALL.filter((p) => !q.get("status") || q.get("status")!.split(",").includes(p.status)).sort((a, b) => (a[by] > b[by] ? 1 : -1) * (dir === "descending" ? -1 : 1));
14
+ const [page, size] = [Number(q.get("page")), Number(q.get("size"))];
15
+ return Response.json({ rows: rows.slice((page - 1) * size, page * size), total: rows.length });
16
+ }
17
+ const payoutKeys = defineKeys("payouts", { list: (query: DataTableQuery) => [query] });
18
+ const columns: DataTableColumn<Payout>[] = [
19
+ { id: "id", header: "Payout", sortable: true, card: "title" },
20
+ { id: "creator", header: "Creator", sortable: true },
21
+ { id: "status", header: "Status", filter: "facet", options: [{ value: "paid", label: "Paid" }, { value: "pending", label: "Pending" }, { value: "failed", label: "Failed" }] },
22
+ { id: "amount", header: "Amount", sortable: true, align: "end", cell: (p) => `$${p.amount.toFixed(2)}` },
23
+ ];
24
+ const NONE: Payout[] = [];
25
+ function Payouts() {
26
+ const [query, setQuery] = useState<DataTableQuery>({ sort: null, filters: {}, page: 1, pageSize: 10 });
27
+ const { data, isPending, error } = useQuery({
28
+ queryKey: payoutKeys.list(query),
29
+ queryFn: ({ signal }) => krizakaFetch("/api/payouts", { signal, query: { sort: query.sort && `${query.sort.column}:${query.sort.direction}`, status: query.filters.status as string[] | undefined, page: query.page, size: query.pageSize } }) as Promise<{ rows: Payout[]; total: number }>,
30
+ placeholderData: keepPreviousData,
31
+ meta: { list: true },
32
+ });
33
+ return <DataTable caption="Payouts" rows={data?.rows ?? NONE} columns={columns} getRowId={(p) => p.id} manual={{ sorting: true, filtering: true, pagination: true }} rowCount={data?.total} defaultPageSize={10} onStateChange={setQuery} loading={isPending} error={error?.message} toolbar={<DataTableFilters />} />;
34
+ }
35
+
36
+ // Server mode: sort, filters and page go to the API (krizakaFetch, keys from defineKeys); the previous page stays while the next loads.
37
+ export default function DataTableServer() {
38
+ useState(() => configureKrizakaFetch({ fetch: fakeApi as typeof fetch }));
39
+ return <KrizakaQueryProvider><Payouts /></KrizakaQueryProvider>;
40
+ }
@@ -3,7 +3,7 @@
3
3
  // registry/examples/data-table/virtualized.tsx
4
4
  import { DataTable } from "@krizaka/ui/data-table";
5
5
  import { jsx } from "react/jsx-runtime";
6
- var events = Array.from({ length: 5e3 }, (_, i) => ({
6
+ var events = Array.from({ length: 5e4 }, (_, i) => ({
7
7
  id: `evt-${i + 1}`,
8
8
  kind: ["view", "tip", "follow", "comment"][i % 4],
9
9
  at: `2026-10-${String(1 + i % 11).padStart(2, "0")} ${String(i % 24).padStart(2, "0")}:00`
@@ -14,7 +14,7 @@ var columns = [
14
14
  { id: "at", header: "At", align: "end" }
15
15
  ];
16
16
  function DataTableVirtualized() {
17
- return /* @__PURE__ */ jsx(DataTable, { caption: "Events", rows: events, columns, getRowId: (e) => e.id, virtualize: { rowHeight: 44, height: 320 }, density: "compact" });
17
+ return /* @__PURE__ */ jsx(DataTable, { caption: "Events", rows: events, columns, getRowId: (e) => e.id, virtualized: { height: 320, estimateRowHeight: 37 }, density: "compact" });
18
18
  }
19
19
  export {
20
20
  DataTableVirtualized as default