@krizaka/ui 3.0.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 (184) hide show
  1. package/README.md +1 -1
  2. package/dist/form/server.d.ts +96 -0
  3. package/dist/form/server.js +82 -0
  4. package/dist/form/server.js.map +1 -0
  5. package/dist/form.d.ts +503 -0
  6. package/dist/form.js +760 -0
  7. package/dist/form.js.map +1 -0
  8. package/dist/native/form.d.ts +376 -0
  9. package/dist/native/form.js +650 -0
  10. package/dist/native/form.js.map +1 -0
  11. package/dist/native.d.ts +113 -2
  12. package/dist/native.js +618 -388
  13. package/dist/native.js.map +1 -1
  14. package/package.json +48 -5
  15. package/registry/achievement.json +1 -1
  16. package/registry/action-bar.json +1 -1
  17. package/registry/alert.json +1 -1
  18. package/registry/app-shell.json +1 -1
  19. package/registry/argument-card.json +1 -1
  20. package/registry/audio-player.json +1 -1
  21. package/registry/auth-layout.json +1 -1
  22. package/registry/avatar.json +1 -1
  23. package/registry/badge.json +1 -1
  24. package/registry/button.json +1 -1
  25. package/registry/card-grid.json +1 -1
  26. package/registry/card.json +1 -1
  27. package/registry/catalogue-page.json +1 -1
  28. package/registry/changelog-page.json +1 -1
  29. package/registry/checkbox.json +89 -4
  30. package/registry/chip-link.json +1 -1
  31. package/registry/chip.json +1 -1
  32. package/registry/choice-grid.json +1 -1
  33. package/registry/code-block.json +1 -1
  34. package/registry/combobox.json +1 -1
  35. package/registry/command.json +1 -1
  36. package/registry/component-page.json +1 -1
  37. package/registry/confirm-button.json +1 -1
  38. package/registry/contact-page.json +1 -1
  39. package/registry/continue-prompt.json +1 -1
  40. package/registry/countdown.json +1 -1
  41. package/registry/cta-panel.json +1 -1
  42. package/registry/dashboard-layout.json +1 -1
  43. package/registry/data-table.json +1 -1
  44. package/registry/date-picker.json +142 -4
  45. package/registry/decision-list.json +1 -1
  46. package/registry/detail-layout.json +1 -1
  47. package/registry/dialog.json +1 -1
  48. package/registry/docs-article-page.json +1 -1
  49. package/registry/docs-hub-page.json +1 -1
  50. package/registry/docs-layout.json +1 -1
  51. package/registry/dropdown-menu.json +1 -1
  52. package/registry/empty-state.json +1 -1
  53. package/registry/error-page.json +1 -1
  54. package/registry/examples/checkbox/native/terms.d.ts +4 -0
  55. package/registry/examples/checkbox/native/terms.dark.png +0 -0
  56. package/registry/examples/checkbox/native/terms.js +26 -0
  57. package/registry/examples/checkbox/native/terms.light.png +0 -0
  58. package/registry/examples/checkbox/native/terms.tsx +28 -0
  59. package/registry/examples/date-picker/native/birth-date.d.ts +4 -0
  60. package/registry/examples/date-picker/native/birth-date.dark.png +0 -0
  61. package/registry/examples/date-picker/native/birth-date.js +30 -0
  62. package/registry/examples/date-picker/native/birth-date.light.png +0 -0
  63. package/registry/examples/date-picker/native/birth-date.tsx +27 -0
  64. package/registry/examples/field/native/default.d.ts +4 -0
  65. package/registry/examples/field/native/default.dark.png +0 -0
  66. package/registry/examples/field/native/default.js +29 -0
  67. package/registry/examples/field/native/default.light.png +0 -0
  68. package/registry/examples/field/native/default.tsx +23 -0
  69. package/registry/examples/form/amount.d.ts +4 -0
  70. package/registry/examples/form/amount.js +30 -0
  71. package/registry/examples/form/amount.tsx +36 -0
  72. package/registry/examples/form/audience.d.ts +4 -0
  73. package/registry/examples/form/audience.js +29 -0
  74. package/registry/examples/form/audience.tsx +31 -0
  75. package/registry/examples/form/native/amount.d.ts +4 -0
  76. package/registry/examples/form/native/amount.dark.png +0 -0
  77. package/registry/examples/form/native/amount.js +26 -0
  78. package/registry/examples/form/native/amount.light.png +0 -0
  79. package/registry/examples/form/native/amount.tsx +30 -0
  80. package/registry/examples/form/native/audience.d.ts +4 -0
  81. package/registry/examples/form/native/audience.dark.png +0 -0
  82. package/registry/examples/form/native/audience.js +24 -0
  83. package/registry/examples/form/native/audience.light.png +0 -0
  84. package/registry/examples/form/native/audience.tsx +24 -0
  85. package/registry/examples/form/native/profile.d.ts +4 -0
  86. package/registry/examples/form/native/profile.dark.png +0 -0
  87. package/registry/examples/form/native/profile.js +33 -0
  88. package/registry/examples/form/native/profile.light.png +0 -0
  89. package/registry/examples/form/native/profile.tsx +36 -0
  90. package/registry/examples/form/native/settings.d.ts +4 -0
  91. package/registry/examples/form/native/settings.dark.png +0 -0
  92. package/registry/examples/form/native/settings.js +25 -0
  93. package/registry/examples/form/native/settings.light.png +0 -0
  94. package/registry/examples/form/native/settings.tsx +23 -0
  95. package/registry/examples/form/native/sign-up.d.ts +4 -0
  96. package/registry/examples/form/native/sign-up.dark.png +0 -0
  97. package/registry/examples/form/native/sign-up.js +38 -0
  98. package/registry/examples/form/native/sign-up.light.png +0 -0
  99. package/registry/examples/form/native/sign-up.tsx +34 -0
  100. package/registry/examples/form/native/upload.d.ts +4 -0
  101. package/registry/examples/form/native/upload.dark.png +0 -0
  102. package/registry/examples/form/native/upload.js +23 -0
  103. package/registry/examples/form/native/upload.light.png +0 -0
  104. package/registry/examples/form/native/upload.tsx +22 -0
  105. package/registry/examples/form/profile.d.ts +4 -0
  106. package/registry/examples/form/profile.js +35 -0
  107. package/registry/examples/form/profile.tsx +40 -0
  108. package/registry/examples/form/report.d.ts +4 -0
  109. package/registry/examples/form/report.js +30 -0
  110. package/registry/examples/form/report.tsx +30 -0
  111. package/registry/examples/form/settings.d.ts +4 -0
  112. package/registry/examples/form/settings.js +30 -0
  113. package/registry/examples/form/settings.tsx +31 -0
  114. package/registry/examples/form/sign-up.d.ts +4 -0
  115. package/registry/examples/form/sign-up.js +38 -0
  116. package/registry/examples/form/sign-up.tsx +37 -0
  117. package/registry/examples/form/upload.d.ts +4 -0
  118. package/registry/examples/form/upload.js +32 -0
  119. package/registry/examples/form/upload.tsx +32 -0
  120. package/registry/field.json +104 -4
  121. package/registry/file-upload.json +1 -1
  122. package/registry/filter-bar.json +1 -1
  123. package/registry/form.json +2940 -0
  124. package/registry/gallery-page.json +1 -1
  125. package/registry/glow-card.json +1 -1
  126. package/registry/goal-gauge.json +1 -1
  127. package/registry/how-it-works-page.json +1 -1
  128. package/registry/image-cropper.json +1 -1
  129. package/registry/index.json +39 -7
  130. package/registry/iso.json +1 -1
  131. package/registry/kbd.json +1 -1
  132. package/registry/landing-page.json +1 -1
  133. package/registry/landscape.json +1 -1
  134. package/registry/legal-page.json +1 -1
  135. package/registry/link-card.json +1 -1
  136. package/registry/loader.json +1 -1
  137. package/registry/longform-page.json +1 -1
  138. package/registry/marketing-layout.json +1 -1
  139. package/registry/marquee.json +1 -1
  140. package/registry/mascot-quote.json +1 -1
  141. package/registry/mascot-state.json +2 -2
  142. package/registry/mascots.json +2 -2
  143. package/registry/media-capture.json +1 -1
  144. package/registry/meter.json +1 -1
  145. package/registry/nav-bar.json +1 -1
  146. package/registry/number-ticker.json +1 -1
  147. package/registry/page-header.json +1 -1
  148. package/registry/page-hero.json +1 -1
  149. package/registry/page.json +1 -1
  150. package/registry/pagination.json +1 -1
  151. package/registry/pointer-light.json +1 -1
  152. package/registry/popover.json +1 -1
  153. package/registry/pricing-page.json +1 -1
  154. package/registry/product-page.json +1 -1
  155. package/registry/profile-card.json +1 -1
  156. package/registry/progress.json +1 -1
  157. package/registry/promise-card.json +1 -1
  158. package/registry/radio-group.json +1 -1
  159. package/registry/scroll-stage.json +1 -1
  160. package/registry/search-field.json +1 -1
  161. package/registry/section-backdrop.json +1 -1
  162. package/registry/separator.json +1 -1
  163. package/registry/settings-layout.json +1 -1
  164. package/registry/skeleton.json +1 -1
  165. package/registry/slider.json +1 -1
  166. package/registry/slot.json +1 -1
  167. package/registry/spinner.json +1 -1
  168. package/registry/split-view.json +1 -1
  169. package/registry/stage-banner.json +1 -1
  170. package/registry/stat.json +1 -1
  171. package/registry/status-page.json +1 -1
  172. package/registry/stepper.json +1 -1
  173. package/registry/switch.json +1 -1
  174. package/registry/tabs.json +1 -1
  175. package/registry/tag-input.json +1 -1
  176. package/registry/terminal-replay.json +1 -1
  177. package/registry/theme.json +1 -1
  178. package/registry/toast.json +1 -1
  179. package/registry/toc.json +1 -1
  180. package/registry/tooltip.json +1 -1
  181. package/registry/video-player.json +1 -1
  182. package/registry/video-trimmer.json +1 -1
  183. package/registry/virtual.json +1 -1
  184. package/skills/form/SKILL.md +44 -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 | \"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"
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 | \"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"
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,30 @@
1
+ "use client";
2
+
3
+ // registry/examples/date-picker/native/birth-date.tsx
4
+ import { DateField } from "@krizaka/ui/native";
5
+ import * as React from "react";
6
+ import { View } from "react-native";
7
+ import { jsx } from "react/jsx-runtime";
8
+ var latestAdult = () => {
9
+ const today = /* @__PURE__ */ new Date();
10
+ return new Date(Date.UTC(today.getFullYear() - 18, today.getMonth(), today.getDate())).toISOString().slice(0, 10);
11
+ };
12
+ function NativeDateFieldBirthDate() {
13
+ const [birth, setBirth] = React.useState("2015-03-27");
14
+ const minor = /^\d{4}-\d{2}-\d{2}$/.test(birth) && birth > latestAdult();
15
+ return /* @__PURE__ */ jsx(View, { style: { width: 296 }, children: /* @__PURE__ */ jsx(
16
+ DateField,
17
+ {
18
+ label: "Date of birth",
19
+ locale: "en-GB",
20
+ autoComplete: "bday",
21
+ value: birth,
22
+ onValueChange: setBirth,
23
+ hint: "Private, never shown. For example, 27 3 1990.",
24
+ error: minor ? "You must be 18 or older to create an account." : void 0
25
+ }
26
+ ) });
27
+ }
28
+ export {
29
+ NativeDateFieldBirthDate as default
30
+ };
@@ -0,0 +1,27 @@
1
+ import { DateField } from "@krizaka/ui/native";
2
+ import * as React from "react";
3
+ import { View } from "react-native";
4
+
5
+ const latestAdult = () => {
6
+ const today = new Date();
7
+ return new Date(Date.UTC(today.getFullYear() - 18, today.getMonth(), today.getDate())).toISOString().slice(0, 10);
8
+ };
9
+
10
+ // A date of birth typed as day, month and year, in the locale's order; an under-18 date is refused at once.
11
+ export default function NativeDateFieldBirthDate() {
12
+ const [birth, setBirth] = React.useState("2015-03-27");
13
+ const minor = /^\d{4}-\d{2}-\d{2}$/.test(birth) && birth > latestAdult();
14
+ return (
15
+ <View style={{ width: 296 }}>
16
+ <DateField
17
+ label="Date of birth"
18
+ locale="en-GB"
19
+ autoComplete="bday"
20
+ value={birth}
21
+ onValueChange={setBirth}
22
+ hint="Private, never shown. For example, 27 3 1990."
23
+ error={minor ? "You must be 18 or older to create an account." : undefined}
24
+ />
25
+ </View>
26
+ );
27
+ }
@@ -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,29 @@
1
+ "use client";
2
+
3
+ // registry/examples/field/native/default.tsx
4
+ import { TextField } 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 NativeFieldDefault() {
9
+ const [email, setEmail] = React.useState("eric@example.com");
10
+ const [password, setPassword] = React.useState("hunter");
11
+ return /* @__PURE__ */ jsxs(View, { style: { gap: 16, width: 296 }, children: [
12
+ /* @__PURE__ */ jsx(TextField, { label: "E-mail", value: email, onValueChange: setEmail, keyboardType: "email-address", autoComplete: "email", autoCapitalize: "none", textContentType: "emailAddress", hint: "We send a link to confirm it." }),
13
+ /* @__PURE__ */ jsx(
14
+ TextField,
15
+ {
16
+ label: "Password",
17
+ value: password,
18
+ onValueChange: setPassword,
19
+ secureTextEntry: true,
20
+ autoComplete: "new-password",
21
+ textContentType: "newPassword",
22
+ error: password.length < 8 ? "Use at least 8 characters." : void 0
23
+ }
24
+ )
25
+ ] });
26
+ }
27
+ export {
28
+ NativeFieldDefault as default
29
+ };
@@ -0,0 +1,23 @@
1
+ import { TextField } from "@krizaka/ui/native";
2
+ import * as React from "react";
3
+ import { View } from "react-native";
4
+
5
+ // The e-mail and the password of a sign-up: the right keyboards and autofill, a hint, then an error in its place.
6
+ export default function NativeFieldDefault() {
7
+ const [email, setEmail] = React.useState("eric@example.com");
8
+ const [password, setPassword] = React.useState("hunter");
9
+ return (
10
+ <View style={{ gap: 16, width: 296 }}>
11
+ <TextField label="E-mail" value={email} onValueChange={setEmail} keyboardType="email-address" autoComplete="email" autoCapitalize="none" textContentType="emailAddress" hint="We send a link to confirm it." />
12
+ <TextField
13
+ label="Password"
14
+ value={password}
15
+ onValueChange={setPassword}
16
+ secureTextEntry
17
+ autoComplete="new-password"
18
+ textContentType="newPassword"
19
+ error={password.length < 8 ? "Use at least 8 characters." : undefined}
20
+ />
21
+ </View>
22
+ );
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,30 @@
1
+ "use client";
2
+
3
+ // registry/examples/form/amount.tsx
4
+ import { Chip } from "@krizaka/ui/chip";
5
+ import { createKrizakaForm } from "@krizaka/ui/form";
6
+ import { z } from "zod";
7
+ import { jsx, jsxs } from "react/jsx-runtime";
8
+ var tip = createKrizakaForm({
9
+ schema: z.object({
10
+ amount: z.number({ message: "tip.amount.invalid" }).int().min(100, "tip.amount.min").max(5e4, "tip.amount.max"),
11
+ message: z.string().max(140),
12
+ anonymous: z.boolean()
13
+ }),
14
+ defaultValues: { amount: 500, message: "", anonymous: false },
15
+ i18n: { t: (key) => ({ "tip.amount.invalid": "Enter an amount.", "tip.amount.min": "At least $1.", "tip.amount.max": "At most $500." })[key] }
16
+ });
17
+ var PRESETS = [200, 500, 1e3];
18
+ function FormAmount() {
19
+ const form = tip.useForm({ onSubmit: (values) => new Promise((done) => setTimeout(() => done(values), 400)) });
20
+ return /* @__PURE__ */ jsxs(form.Form, { "aria-label": "Send a tip", className: "flex w-80 flex-col gap-4", children: [
21
+ /* @__PURE__ */ jsx(form.Money, { name: "amount", label: "Amount", currency: "USD", hint: "Between $1 and $500." }),
22
+ /* @__PURE__ */ jsx(form.Watch, { name: "amount", children: (amount) => /* @__PURE__ */ jsx("div", { className: "flex gap-2", role: "group", "aria-label": "Suggested amounts", children: PRESETS.map((cents) => /* @__PURE__ */ jsx(Chip, { selected: amount === cents, onSelectedChange: () => form.setValue("amount", cents), children: `$${cents / 100}` }, cents)) }) }),
23
+ /* @__PURE__ */ jsx(form.TextArea, { name: "message", label: "A word for the creator", rows: 2, maxLength: 140 }),
24
+ /* @__PURE__ */ jsx(form.Checkbox, { name: "anonymous", label: "Send it anonymously" }),
25
+ /* @__PURE__ */ jsx(form.Submit, { children: "Send the tip" })
26
+ ] });
27
+ }
28
+ export {
29
+ FormAmount as default
30
+ };
@@ -0,0 +1,36 @@
1
+ "use client";
2
+
3
+ import { Chip } from "@krizaka/ui/chip";
4
+ import { createKrizakaForm } from "@krizaka/ui/form";
5
+ import { z } from "zod";
6
+
7
+ const tip = createKrizakaForm({
8
+ schema: z.object({
9
+ amount: z.number({ message: "tip.amount.invalid" }).int().min(100, "tip.amount.min").max(50_000, "tip.amount.max"),
10
+ message: z.string().max(140),
11
+ anonymous: z.boolean(),
12
+ }),
13
+ defaultValues: { amount: 500, message: "", anonymous: false },
14
+ i18n: { t: (key) => ({ "tip.amount.invalid": "Enter an amount.", "tip.amount.min": "At least $1.", "tip.amount.max": "At most $500." })[key] },
15
+ });
16
+ const PRESETS = [200, 500, 1000];
17
+
18
+ // A tip in cents: typed the locale's way (`12.50`), never a float; presets set the field from outside.
19
+ export default function FormAmount() {
20
+ const form = tip.useForm({ onSubmit: (values) => new Promise((done) => setTimeout(() => done(values), 400)) });
21
+ return (
22
+ <form.Form aria-label="Send a tip" className="flex w-80 flex-col gap-4">
23
+ <form.Money name="amount" label="Amount" currency="USD" hint="Between $1 and $500." />
24
+ <form.Watch name="amount">
25
+ {(amount) => (
26
+ <div className="flex gap-2" role="group" aria-label="Suggested amounts">
27
+ {PRESETS.map((cents) => <Chip key={cents} selected={amount === cents} onSelectedChange={() => form.setValue("amount", cents)}>{`$${cents / 100}`}</Chip>)}
28
+ </div>
29
+ )}
30
+ </form.Watch>
31
+ <form.TextArea name="message" label="A word for the creator" rows={2} maxLength={140} />
32
+ <form.Checkbox name="anonymous" label="Send it anonymously" />
33
+ <form.Submit>Send the tip</form.Submit>
34
+ </form.Form>
35
+ );
36
+ }
@@ -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,29 @@
1
+ "use client";
2
+
3
+ // registry/examples/form/audience.tsx
4
+ import { createKrizakaForm } from "@krizaka/ui/form";
5
+ import { z } from "zod";
6
+ import { jsx, jsxs } from "react/jsx-runtime";
7
+ var audience = createKrizakaForm({
8
+ schema: z.object({ audience: z.enum(["everyone", "followers", "subscribers"]), price: z.number().int().nullable(), publishOn: z.iso.date().or(z.literal("")), comments: z.boolean() }).refine((v) => v.audience !== "subscribers" || (v.price ?? 0) >= 100, { path: ["price"], message: "audience.price.min" }),
9
+ defaultValues: { audience: "subscribers", price: 499, publishOn: "", comments: true },
10
+ i18n: { t: (key) => key === "audience.price.min" ? "Subscribers pay at least $1." : void 0 }
11
+ });
12
+ var AUDIENCES = [
13
+ { value: "everyone", label: "Everyone", description: "Free, in the feed" },
14
+ { value: "followers", label: "Followers", description: "Free, for them" },
15
+ { value: "subscribers", label: "Subscribers", description: "Paid, once" }
16
+ ];
17
+ function FormAudience() {
18
+ const form = audience.useForm({ onSubmit: (values) => new Promise((done) => setTimeout(() => done(values), 400)) });
19
+ return /* @__PURE__ */ jsxs(form.Form, { "aria-label": "Audience", className: "flex w-[28rem] max-w-full flex-col gap-4", children: [
20
+ /* @__PURE__ */ jsx(form.RadioGroup, { name: "audience", label: "Who can watch", variant: "cards", options: AUDIENCES }),
21
+ /* @__PURE__ */ jsx(form.Watch, { name: "audience", children: (value) => value === "subscribers" ? /* @__PURE__ */ jsx(form.Money, { name: "price", label: "Price", currency: "USD" }) : null }),
22
+ /* @__PURE__ */ jsx(form.DateField, { name: "publishOn", label: "Publish on", hint: "Empty: at once." }),
23
+ /* @__PURE__ */ jsx(form.Switch, { name: "comments", label: "Comments", hint: "Viewers can comment under the video." }),
24
+ /* @__PURE__ */ jsx(form.Submit, { children: "Save" })
25
+ ] });
26
+ }
27
+ export {
28
+ FormAudience as default
29
+ };
@@ -0,0 +1,31 @@
1
+ "use client";
2
+
3
+ import { createKrizakaForm } from "@krizaka/ui/form";
4
+ import { z } from "zod";
5
+
6
+ const audience = createKrizakaForm({
7
+ schema: z
8
+ .object({ audience: z.enum(["everyone", "followers", "subscribers"]), price: z.number().int().nullable(), publishOn: z.iso.date().or(z.literal("")), comments: z.boolean() })
9
+ .refine((v) => v.audience !== "subscribers" || (v.price ?? 0) >= 100, { path: ["price"], message: "audience.price.min" }),
10
+ defaultValues: { audience: "subscribers" as "everyone" | "followers" | "subscribers", price: 499 as number | null, publishOn: "", comments: true },
11
+ i18n: { t: (key) => (key === "audience.price.min" ? "Subscribers pay at least $1." : undefined) },
12
+ });
13
+ const AUDIENCES = [
14
+ { value: "everyone", label: "Everyone", description: "Free, in the feed" },
15
+ { value: "followers", label: "Followers", description: "Free, for them" },
16
+ { value: "subscribers", label: "Subscribers", description: "Paid, once" },
17
+ ];
18
+
19
+ // Who sees a video: cards to choose from, the price only when it is for subscribers, a publication date.
20
+ export default function FormAudience() {
21
+ const form = audience.useForm({ onSubmit: (values) => new Promise((done) => setTimeout(() => done(values), 400)) });
22
+ return (
23
+ <form.Form aria-label="Audience" className="flex w-[28rem] max-w-full flex-col gap-4">
24
+ <form.RadioGroup name="audience" label="Who can watch" variant="cards" options={AUDIENCES} />
25
+ <form.Watch name="audience">{(value) => (value === "subscribers" ? <form.Money name="price" label="Price" currency="USD" /> : null)}</form.Watch>
26
+ <form.DateField name="publishOn" label="Publish on" hint="Empty: at once." />
27
+ <form.Switch name="comments" label="Comments" hint="Viewers can comment under the video." />
28
+ <form.Submit>Save</form.Submit>
29
+ </form.Form>
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,26 @@
1
+ "use client";
2
+
3
+ // registry/examples/form/native/amount.tsx
4
+ import { Chip } from "@krizaka/ui/native";
5
+ import { createKrizakaForm } from "@krizaka/ui/native/form";
6
+ import { z } from "zod";
7
+ import { jsx, jsxs } from "react/jsx-runtime";
8
+ var tip = createKrizakaForm({
9
+ schema: z.object({ amount: z.number({ message: "tip.amount.invalid" }).int().min(100, "tip.amount.min").max(5e4, "tip.amount.max"), message: z.string().max(140), anonymous: z.boolean() }),
10
+ defaultValues: { amount: 500, message: "", anonymous: false },
11
+ i18n: { t: (key) => ({ "tip.amount.invalid": "Enter an amount.", "tip.amount.min": "At least \u20AC1.", "tip.amount.max": "At most \u20AC500." })[key], locale: "fr-FR" }
12
+ });
13
+ var PRESETS = [200, 500, 1e3];
14
+ function NativeFormAmount() {
15
+ const form = tip.useForm({ onSubmit: (values) => new Promise((done) => setTimeout(() => done(values), 400)) });
16
+ return /* @__PURE__ */ jsxs(form.Form, { "aria-label": "Send a tip", style: { width: 312 }, children: [
17
+ /* @__PURE__ */ jsx(form.Money, { name: "amount", label: "Amount", currency: "EUR", hint: "Between \u20AC1 and \u20AC500." }),
18
+ /* @__PURE__ */ jsx(form.Watch, { name: "amount", children: (amount) => /* @__PURE__ */ jsx(Chip.Group, { type: "single", "aria-label": "Suggested amounts", value: String(amount), onValueChange: (v) => form.setValue("amount", Number(v)), children: PRESETS.map((cents) => /* @__PURE__ */ jsx(Chip, { value: String(cents), children: `${cents / 100} \u20AC` }, cents)) }) }),
19
+ /* @__PURE__ */ jsx(form.TextArea, { name: "message", label: "A word for the creator", maxLength: 140 }),
20
+ /* @__PURE__ */ jsx(form.Checkbox, { name: "anonymous", label: "Send it anonymously" }),
21
+ /* @__PURE__ */ jsx(form.Submit, { label: "Send the tip" })
22
+ ] });
23
+ }
24
+ export {
25
+ NativeFormAmount as default
26
+ };
@@ -0,0 +1,30 @@
1
+ import { Chip } from "@krizaka/ui/native";
2
+ import { createKrizakaForm } from "@krizaka/ui/native/form";
3
+ import { z } from "zod";
4
+
5
+ const tip = createKrizakaForm({
6
+ schema: z.object({ amount: z.number({ message: "tip.amount.invalid" }).int().min(100, "tip.amount.min").max(50_000, "tip.amount.max"), message: z.string().max(140), anonymous: z.boolean() }),
7
+ defaultValues: { amount: 500, message: "", anonymous: false },
8
+ i18n: { t: (key) => ({ "tip.amount.invalid": "Enter an amount.", "tip.amount.min": "At least €1.", "tip.amount.max": "At most €500." })[key], locale: "fr-FR" },
9
+ });
10
+ const PRESETS = [200, 500, 1000];
11
+
12
+ // A tip in cents on the decimal keypad, typed the locale's way (`12,50` in French); presets set the field from outside.
13
+ export default function NativeFormAmount() {
14
+ const form = tip.useForm({ onSubmit: (values) => new Promise((done) => setTimeout(() => done(values), 400)) });
15
+ return (
16
+ <form.Form aria-label="Send a tip" style={{ width: 312 }}>
17
+ <form.Money name="amount" label="Amount" currency="EUR" hint="Between €1 and €500." />
18
+ <form.Watch name="amount">
19
+ {(amount) => (
20
+ <Chip.Group type="single" aria-label="Suggested amounts" value={String(amount)} onValueChange={(v) => form.setValue("amount", Number(v))}>
21
+ {PRESETS.map((cents) => <Chip key={cents} value={String(cents)}>{`${cents / 100} €`}</Chip>)}
22
+ </Chip.Group>
23
+ )}
24
+ </form.Watch>
25
+ <form.TextArea name="message" label="A word for the creator" maxLength={140} />
26
+ <form.Checkbox name="anonymous" label="Send it anonymously" />
27
+ <form.Submit label="Send the tip" />
28
+ </form.Form>
29
+ );
30
+ }
@@ -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/form/native/audience.tsx
4
+ import { createKrizakaForm } from "@krizaka/ui/native/form";
5
+ import { z } from "zod";
6
+ import { jsx, jsxs } from "react/jsx-runtime";
7
+ var audience = createKrizakaForm({
8
+ schema: z.object({ audience: z.enum(["everyone", "followers", "subscribers"]), price: z.number().int().nullable(), comments: z.boolean() }).refine((v) => v.audience !== "subscribers" || (v.price ?? 0) >= 100, { path: ["price"], message: "audience.price.min" }),
9
+ defaultValues: { audience: "subscribers", price: 499, comments: true },
10
+ i18n: { t: (key) => key === "audience.price.min" ? "Subscribers pay at least $1." : void 0 }
11
+ });
12
+ var AUDIENCES = [{ value: "everyone", label: "Everyone" }, { value: "followers", label: "Followers" }, { value: "subscribers", label: "Subscribers" }];
13
+ function NativeFormAudience() {
14
+ const form = audience.useForm({ onSubmit: (values) => new Promise((done) => setTimeout(() => done(values), 400)) });
15
+ return /* @__PURE__ */ jsxs(form.Form, { "aria-label": "Audience", style: { width: 312 }, children: [
16
+ /* @__PURE__ */ jsx(form.RadioGroup, { name: "audience", label: "Who can watch", options: AUDIENCES }),
17
+ /* @__PURE__ */ jsx(form.Watch, { name: "audience", children: (value) => value === "subscribers" ? /* @__PURE__ */ jsx(form.Money, { name: "price", label: "Price", currency: "USD" }) : null }),
18
+ /* @__PURE__ */ jsx(form.Switch, { name: "comments", label: "Comments", hint: "Viewers can comment under the video." }),
19
+ /* @__PURE__ */ jsx(form.Submit, { label: "Save" })
20
+ ] });
21
+ }
22
+ export {
23
+ NativeFormAudience as default
24
+ };
@@ -0,0 +1,24 @@
1
+ import { createKrizakaForm } from "@krizaka/ui/native/form";
2
+ import { z } from "zod";
3
+
4
+ const audience = createKrizakaForm({
5
+ schema: z
6
+ .object({ audience: z.enum(["everyone", "followers", "subscribers"]), price: z.number().int().nullable(), comments: z.boolean() })
7
+ .refine((v) => v.audience !== "subscribers" || (v.price ?? 0) >= 100, { path: ["price"], message: "audience.price.min" }),
8
+ defaultValues: { audience: "subscribers" as "everyone" | "followers" | "subscribers", price: 499 as number | null, comments: true },
9
+ i18n: { t: (key) => (key === "audience.price.min" ? "Subscribers pay at least $1." : undefined) },
10
+ });
11
+ const AUDIENCES = [{ value: "everyone", label: "Everyone" }, { value: "followers", label: "Followers" }, { value: "subscribers", label: "Subscribers" }];
12
+
13
+ // Who sees a video: the price only when it is for subscribers (`Watch`), comments on or off.
14
+ export default function NativeFormAudience() {
15
+ const form = audience.useForm({ onSubmit: (values) => new Promise((done) => setTimeout(() => done(values), 400)) });
16
+ return (
17
+ <form.Form aria-label="Audience" style={{ width: 312 }}>
18
+ <form.RadioGroup name="audience" label="Who can watch" options={AUDIENCES} />
19
+ <form.Watch name="audience">{(value) => (value === "subscribers" ? <form.Money name="price" label="Price" currency="USD" /> : null)}</form.Watch>
20
+ <form.Switch name="comments" label="Comments" hint="Viewers can comment under the video." />
21
+ <form.Submit label="Save" />
22
+ </form.Form>
23
+ );
24
+ }
@@ -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;