@krizaka/ui 3.4.0 → 3.5.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 (244) hide show
  1. package/dist/argument-card.js +3 -3
  2. package/dist/chat.d.ts +187 -0
  3. package/dist/chat.js +132 -0
  4. package/dist/chat.js.map +1 -0
  5. package/dist/chunk-ECSCA3CN.js +128 -0
  6. package/dist/chunk-ECSCA3CN.js.map +1 -0
  7. package/dist/chunk-F2GKFIYK.js +47 -0
  8. package/dist/chunk-F2GKFIYK.js.map +1 -0
  9. package/dist/data-table.js +20 -134
  10. package/dist/data-table.js.map +1 -1
  11. package/dist/match-dialog.d.ts +30 -0
  12. package/dist/match-dialog.js +146 -0
  13. package/dist/match-dialog.js.map +1 -0
  14. package/dist/native.d.ts +421 -106
  15. package/dist/native.js +1535 -973
  16. package/dist/native.js.map +1 -1
  17. package/dist/page-hero.js +3 -3
  18. package/dist/photo-grid.d.ts +122 -0
  19. package/dist/photo-grid.js +94 -0
  20. package/dist/photo-grid.js.map +1 -0
  21. package/dist/step-progress.d.ts +20 -0
  22. package/dist/step-progress.js +17 -0
  23. package/dist/step-progress.js.map +1 -0
  24. package/dist/swipe-deck.d.ts +183 -0
  25. package/dist/swipe-deck.js +144 -0
  26. package/dist/swipe-deck.js.map +1 -0
  27. package/dist/tag-selector.d.ts +26 -0
  28. package/dist/tag-selector.js +21 -0
  29. package/dist/tag-selector.js.map +1 -0
  30. package/dist/verified-badge.d.ts +16 -0
  31. package/dist/verified-badge.js +23 -0
  32. package/dist/verified-badge.js.map +1 -0
  33. package/package.json +105 -7
  34. package/registry/achievement.json +1 -1
  35. package/registry/action-bar.json +1 -1
  36. package/registry/activity-feed.json +1 -1
  37. package/registry/alert.json +1 -1
  38. package/registry/app-shell.json +1 -1
  39. package/registry/argument-card.json +1 -1
  40. package/registry/audio-player.json +1 -1
  41. package/registry/auth-layout.json +1 -1
  42. package/registry/avatar.json +1 -1
  43. package/registry/badge.json +1 -1
  44. package/registry/button.json +1 -1
  45. package/registry/card-grid.json +1 -1
  46. package/registry/card.json +1 -1
  47. package/registry/catalogue-page.json +1 -1
  48. package/registry/changelog-page.json +1 -1
  49. package/registry/chat.json +917 -0
  50. package/registry/checkbox.json +1 -1
  51. package/registry/chip-link.json +1 -1
  52. package/registry/chip.json +1 -1
  53. package/registry/choice-grid.json +1 -1
  54. package/registry/code-block.json +1 -1
  55. package/registry/combobox.json +1 -1
  56. package/registry/command.json +1 -1
  57. package/registry/component-page.json +1 -1
  58. package/registry/confirm-button.json +1 -1
  59. package/registry/contact-page.json +1 -1
  60. package/registry/continue-prompt.json +1 -1
  61. package/registry/countdown.json +1 -1
  62. package/registry/cta-panel.json +1 -1
  63. package/registry/dashboard-layout.json +1 -1
  64. package/registry/data-table.json +1 -1
  65. package/registry/date-picker.json +1 -1
  66. package/registry/decision-list.json +1 -1
  67. package/registry/description-list.json +1 -1
  68. package/registry/detail-layout.json +1 -1
  69. package/registry/dialog.json +1 -1
  70. package/registry/docs-article-page.json +1 -1
  71. package/registry/docs-hub-page.json +1 -1
  72. package/registry/docs-layout.json +1 -1
  73. package/registry/dropdown-menu.json +1 -1
  74. package/registry/empty-state.json +1 -1
  75. package/registry/error-page.json +1 -1
  76. package/registry/examples/chat/conversation.d.ts +4 -0
  77. package/registry/examples/chat/conversation.js +22 -0
  78. package/registry/examples/chat/conversation.tsx +21 -0
  79. package/registry/examples/chat/inbox.d.ts +4 -0
  80. package/registry/examples/chat/inbox.js +15 -0
  81. package/registry/examples/chat/inbox.tsx +12 -0
  82. package/registry/examples/chat/native/conversation.d.ts +4 -0
  83. package/registry/examples/chat/native/conversation.dark.png +0 -0
  84. package/registry/examples/chat/native/conversation.js +23 -0
  85. package/registry/examples/chat/native/conversation.light.png +0 -0
  86. package/registry/examples/chat/native/conversation.tsx +20 -0
  87. package/registry/examples/chat/native/inbox.d.ts +4 -0
  88. package/registry/examples/chat/native/inbox.dark.png +0 -0
  89. package/registry/examples/chat/native/inbox.js +16 -0
  90. package/registry/examples/chat/native/inbox.light.png +0 -0
  91. package/registry/examples/chat/native/inbox.tsx +13 -0
  92. package/registry/examples/match-dialog/its-a-match.d.ts +4 -0
  93. package/registry/examples/match-dialog/its-a-match.js +29 -0
  94. package/registry/examples/match-dialog/its-a-match.tsx +25 -0
  95. package/registry/examples/match-dialog/native/its-a-match.d.ts +4 -0
  96. package/registry/examples/match-dialog/native/its-a-match.dark.png +0 -0
  97. package/registry/examples/match-dialog/native/its-a-match.js +28 -0
  98. package/registry/examples/match-dialog/native/its-a-match.light.png +0 -0
  99. package/registry/examples/match-dialog/native/its-a-match.tsx +22 -0
  100. package/registry/examples/photo-grid/native/profile-photos.d.ts +4 -0
  101. package/registry/examples/photo-grid/native/profile-photos.dark.png +0 -0
  102. package/registry/examples/photo-grid/native/profile-photos.js +27 -0
  103. package/registry/examples/photo-grid/native/profile-photos.light.png +0 -0
  104. package/registry/examples/photo-grid/native/profile-photos.tsx +24 -0
  105. package/registry/examples/photo-grid/profile-photos.d.ts +4 -0
  106. package/registry/examples/photo-grid/profile-photos.js +28 -0
  107. package/registry/examples/photo-grid/profile-photos.tsx +25 -0
  108. package/registry/examples/screen/native/app-shell.d.ts +4 -0
  109. package/registry/examples/screen/native/app-shell.dark.png +0 -0
  110. package/registry/examples/screen/native/app-shell.js +25 -0
  111. package/registry/examples/screen/native/app-shell.light.png +0 -0
  112. package/registry/examples/screen/native/app-shell.tsx +33 -0
  113. package/registry/examples/screen/native/auth.d.ts +4 -0
  114. package/registry/examples/screen/native/auth.dark.png +0 -0
  115. package/registry/examples/screen/native/auth.js +24 -0
  116. package/registry/examples/screen/native/auth.light.png +0 -0
  117. package/registry/examples/screen/native/auth.tsx +20 -0
  118. package/registry/examples/screen/native/chat.d.ts +4 -0
  119. package/registry/examples/screen/native/chat.dark.png +0 -0
  120. package/registry/examples/screen/native/chat.js +27 -0
  121. package/registry/examples/screen/native/chat.light.png +0 -0
  122. package/registry/examples/screen/native/chat.tsx +22 -0
  123. package/registry/examples/screen/native/feed.d.ts +4 -0
  124. package/registry/examples/screen/native/feed.dark.png +0 -0
  125. package/registry/examples/screen/native/feed.js +24 -0
  126. package/registry/examples/screen/native/feed.light.png +0 -0
  127. package/registry/examples/screen/native/feed.tsx +34 -0
  128. package/registry/examples/screen/native/profile.d.ts +4 -0
  129. package/registry/examples/screen/native/profile.dark.png +0 -0
  130. package/registry/examples/screen/native/profile.js +29 -0
  131. package/registry/examples/screen/native/profile.light.png +0 -0
  132. package/registry/examples/screen/native/profile.tsx +27 -0
  133. package/registry/examples/screen/native/settings.d.ts +4 -0
  134. package/registry/examples/screen/native/settings.dark.png +0 -0
  135. package/registry/examples/screen/native/settings.js +20 -0
  136. package/registry/examples/screen/native/settings.light.png +0 -0
  137. package/registry/examples/screen/native/settings.tsx +19 -0
  138. package/registry/examples/step-progress/native/sign-up.d.ts +4 -0
  139. package/registry/examples/step-progress/native/sign-up.dark.png +0 -0
  140. package/registry/examples/step-progress/native/sign-up.js +12 -0
  141. package/registry/examples/step-progress/native/sign-up.light.png +0 -0
  142. package/registry/examples/step-progress/native/sign-up.tsx +11 -0
  143. package/registry/examples/step-progress/sign-up.d.ts +4 -0
  144. package/registry/examples/step-progress/sign-up.js +22 -0
  145. package/registry/examples/step-progress/sign-up.tsx +16 -0
  146. package/registry/examples/swipe-deck/discover.d.ts +4 -0
  147. package/registry/examples/swipe-deck/discover.js +41 -0
  148. package/registry/examples/swipe-deck/discover.tsx +37 -0
  149. package/registry/examples/swipe-deck/native/discover.d.ts +4 -0
  150. package/registry/examples/swipe-deck/native/discover.dark.png +0 -0
  151. package/registry/examples/swipe-deck/native/discover.js +39 -0
  152. package/registry/examples/swipe-deck/native/discover.light.png +0 -0
  153. package/registry/examples/swipe-deck/native/discover.tsx +35 -0
  154. package/registry/examples/tag-selector/interests.d.ts +4 -0
  155. package/registry/examples/tag-selector/interests.js +14 -0
  156. package/registry/examples/tag-selector/interests.tsx +12 -0
  157. package/registry/examples/tag-selector/native/interests.d.ts +4 -0
  158. package/registry/examples/tag-selector/native/interests.dark.png +0 -0
  159. package/registry/examples/tag-selector/native/interests.js +15 -0
  160. package/registry/examples/tag-selector/native/interests.light.png +0 -0
  161. package/registry/examples/tag-selector/native/interests.tsx +15 -0
  162. package/registry/examples/verified-badge/native/verified.d.ts +4 -0
  163. package/registry/examples/verified-badge/native/verified.dark.png +0 -0
  164. package/registry/examples/verified-badge/native/verified.js +18 -0
  165. package/registry/examples/verified-badge/native/verified.light.png +0 -0
  166. package/registry/examples/verified-badge/native/verified.tsx +15 -0
  167. package/registry/examples/verified-badge/verified.d.ts +4 -0
  168. package/registry/examples/verified-badge/verified.js +17 -0
  169. package/registry/examples/verified-badge/verified.tsx +13 -0
  170. package/registry/field.json +1 -1
  171. package/registry/file-upload.json +1 -1
  172. package/registry/filter-bar.json +1 -1
  173. package/registry/form.json +1 -1
  174. package/registry/gallery-page.json +1 -1
  175. package/registry/glow-card.json +1 -1
  176. package/registry/goal-gauge.json +1 -1
  177. package/registry/how-it-works-page.json +1 -1
  178. package/registry/image-cropper.json +1 -1
  179. package/registry/index.json +144 -2
  180. package/registry/iso.json +1 -1
  181. package/registry/kanban.json +1 -1
  182. package/registry/kbd.json +1 -1
  183. package/registry/landing-page.json +1 -1
  184. package/registry/landscape.json +1 -1
  185. package/registry/legal-page.json +1 -1
  186. package/registry/link-card.json +1 -1
  187. package/registry/list.json +1 -1
  188. package/registry/loader.json +1 -1
  189. package/registry/longform-page.json +1 -1
  190. package/registry/map.json +2 -2
  191. package/registry/marketing-layout.json +1 -1
  192. package/registry/marquee.json +1 -1
  193. package/registry/mascot-quote.json +1 -1
  194. package/registry/mascot-state.json +1 -1
  195. package/registry/mascots.json +1 -1
  196. package/registry/match-dialog.json +300 -0
  197. package/registry/media-capture.json +1 -1
  198. package/registry/meter.json +1 -1
  199. package/registry/nav-bar.json +1 -1
  200. package/registry/number-ticker.json +1 -1
  201. package/registry/page-header.json +1 -1
  202. package/registry/page-hero.json +1 -1
  203. package/registry/page.json +1 -1
  204. package/registry/pagination.json +1 -1
  205. package/registry/photo-grid.json +302 -0
  206. package/registry/pointer-light.json +1 -1
  207. package/registry/popover.json +1 -1
  208. package/registry/pricing-page.json +1 -1
  209. package/registry/product-page.json +1 -1
  210. package/registry/profile-card.json +1 -1
  211. package/registry/progress.json +1 -1
  212. package/registry/promise-card.json +1 -1
  213. package/registry/radio-group.json +1 -1
  214. package/registry/screen.json +184 -0
  215. package/registry/scroll-stage.json +1 -1
  216. package/registry/search-field.json +1 -1
  217. package/registry/section-backdrop.json +1 -1
  218. package/registry/separator.json +1 -1
  219. package/registry/settings-layout.json +1 -1
  220. package/registry/skeleton.json +1 -1
  221. package/registry/slider.json +1 -1
  222. package/registry/slot.json +1 -1
  223. package/registry/spinner.json +1 -1
  224. package/registry/split-view.json +1 -1
  225. package/registry/stage-banner.json +1 -1
  226. package/registry/stat.json +1 -1
  227. package/registry/status-page.json +1 -1
  228. package/registry/step-progress.json +255 -0
  229. package/registry/stepper.json +1 -1
  230. package/registry/swipe-deck.json +512 -0
  231. package/registry/switch.json +1 -1
  232. package/registry/tabs.json +1 -1
  233. package/registry/tag-input.json +1 -1
  234. package/registry/tag-selector.json +276 -0
  235. package/registry/terminal-replay.json +1 -1
  236. package/registry/theme.json +1 -1
  237. package/registry/toast.json +1 -1
  238. package/registry/toc.json +1 -1
  239. package/registry/tooltip.json +1 -1
  240. package/registry/tree-view.json +1 -1
  241. package/registry/verified-badge.json +202 -0
  242. package/registry/video-player.json +1 -1
  243. package/registry/video-trimmer.json +1 -1
  244. package/registry/virtual.json +1 -1
@@ -0,0 +1,917 @@
1
+ {
2
+ "name": "chat",
3
+ "type": "primitive",
4
+ "title": "Chat",
5
+ "summary": "A conversation's parts — `MessageBubble` (time, receipt, retry), `TypingIndicator`, `MessageComposer`, `ConversationItem` — the same API on the web and React Native.",
6
+ "description": "A conversation's parts — `MessageBubble` (time, receipt, retry), `TypingIndicator`, `MessageComposer`, `ConversationItem` — the same API on the web and React Native.",
7
+ "status": "beta",
8
+ "category": "data-display",
9
+ "platforms": "both",
10
+ "whenToUse": [
11
+ "Orochia's Messages, a dating app's chats, support threads.",
12
+ "An inbox of conversations with presence and unread counts."
13
+ ],
14
+ "whenNotToUse": [
15
+ {
16
+ "when": "For a comments thread under a post.",
17
+ "use": "list"
18
+ },
19
+ {
20
+ "when": "For notifications.",
21
+ "use": "toast"
22
+ }
23
+ ],
24
+ "bestPractices": [
25
+ "Group the runs of one sender (`grouped`); show the receipt under the last message of yours only.",
26
+ "Keep the server's order and merge (the app's), the bubble only draws.",
27
+ "The composer never clears itself: clear the draft once the message is sent."
28
+ ],
29
+ "accessibility": {
30
+ "keyboard": [
31
+ {
32
+ "keys": "Enter / Shift+Enter",
33
+ "action": "In the web composer: send, or a new line."
34
+ }
35
+ ],
36
+ "notes": [
37
+ "Each bubble is read with its time; a failed one says so and offers a retry.",
38
+ "The typing dots are announced politely by their words.",
39
+ "A conversation row reads name, presence, last message, time and unread count."
40
+ ]
41
+ },
42
+ "related": [
43
+ "avatar",
44
+ "list",
45
+ "toast"
46
+ ],
47
+ "web": {
48
+ "entry": "@krizaka/ui/chat",
49
+ "import": "import { MessageBubble, TypingIndicator, MessageComposer, ConversationItem } from \"@krizaka/ui/chat\";",
50
+ "props": [
51
+ {
52
+ "component": "ConversationItem",
53
+ "description": "A conversation in the list: avatar, name, the last message or typing, the time, the unread count.",
54
+ "props": [
55
+ {
56
+ "name": "name",
57
+ "type": "string",
58
+ "default": null,
59
+ "description": "The other person's name.",
60
+ "required": true
61
+ },
62
+ {
63
+ "name": "preview",
64
+ "type": "string",
65
+ "default": null,
66
+ "description": "The last message, or “typing…”.",
67
+ "required": true
68
+ },
69
+ {
70
+ "name": "avatar",
71
+ "type": "string | null",
72
+ "default": null,
73
+ "description": "Their avatar's URL.",
74
+ "required": false
75
+ },
76
+ {
77
+ "name": "className",
78
+ "type": "string",
79
+ "default": null,
80
+ "description": "Classes merged on the row.",
81
+ "required": false
82
+ },
83
+ {
84
+ "name": "href",
85
+ "type": "string",
86
+ "default": null,
87
+ "description": "Opens the conversation (a link).",
88
+ "required": false
89
+ },
90
+ {
91
+ "name": "online",
92
+ "type": "boolean",
93
+ "default": null,
94
+ "description": "Before the name: a presence dot (online).",
95
+ "required": false
96
+ },
97
+ {
98
+ "name": "onlineLabel",
99
+ "type": "string",
100
+ "default": null,
101
+ "description": "The presence in words (“online”).",
102
+ "required": false
103
+ },
104
+ {
105
+ "name": "onSelect",
106
+ "type": "(() => void)",
107
+ "default": null,
108
+ "description": "Opens the conversation (a button).",
109
+ "required": false
110
+ },
111
+ {
112
+ "name": "time",
113
+ "type": "string",
114
+ "default": null,
115
+ "description": "When (“14:02”, “Mon”).",
116
+ "required": false
117
+ },
118
+ {
119
+ "name": "typing",
120
+ "type": "boolean",
121
+ "default": null,
122
+ "description": "The preview is the typing signal: in the accent.",
123
+ "required": false
124
+ },
125
+ {
126
+ "name": "unread",
127
+ "type": "number",
128
+ "default": "0",
129
+ "description": "Unread messages: a count, the name in bold.",
130
+ "required": false
131
+ },
132
+ {
133
+ "name": "unreadLabel",
134
+ "type": "string",
135
+ "default": null,
136
+ "description": "The unread count in words (“3 unread”).",
137
+ "required": false
138
+ }
139
+ ]
140
+ },
141
+ {
142
+ "component": "MessageBubble",
143
+ "description": "A message: yours in the accent on the right, theirs on the left, the time inside, the receipt under the last of yours.",
144
+ "props": [
145
+ {
146
+ "name": "text",
147
+ "type": "string",
148
+ "default": null,
149
+ "description": "The text.",
150
+ "required": true
151
+ },
152
+ {
153
+ "name": "className",
154
+ "type": "string",
155
+ "default": null,
156
+ "description": "Classes merged on the row.",
157
+ "required": false
158
+ },
159
+ {
160
+ "name": "context",
161
+ "type": "string",
162
+ "default": null,
163
+ "description": "A line above the text: what it answers.",
164
+ "required": false
165
+ },
166
+ {
167
+ "name": "grouped",
168
+ "type": "\"middle\" | \"first\" | \"last\" | \"single\"",
169
+ "default": "single",
170
+ "description": "Part of a run of the same sender: the corner towards the next one is tighter.",
171
+ "required": false
172
+ },
173
+ {
174
+ "name": "labels",
175
+ "type": "MessageBubbleLabels",
176
+ "default": null,
177
+ "description": "The words, passed translated.",
178
+ "required": false
179
+ },
180
+ {
181
+ "name": "mine",
182
+ "type": "boolean",
183
+ "default": null,
184
+ "description": "Yours (right, in the accent) or theirs (left).",
185
+ "required": false
186
+ },
187
+ {
188
+ "name": "onRetry",
189
+ "type": "(() => void)",
190
+ "default": null,
191
+ "description": "Sends a failed message again (a button under it).",
192
+ "required": false
193
+ },
194
+ {
195
+ "name": "showStatus",
196
+ "type": "boolean",
197
+ "default": null,
198
+ "description": "Show the status under the bubble (the last message of yours).",
199
+ "required": false
200
+ },
201
+ {
202
+ "name": "status",
203
+ "type": "MessageStatus",
204
+ "default": null,
205
+ "description": "Where a message of yours stands; shown when `showStatus`.",
206
+ "required": false
207
+ },
208
+ {
209
+ "name": "time",
210
+ "type": "string",
211
+ "default": null,
212
+ "description": "The time, written by the app (“14:02”).",
213
+ "required": false
214
+ }
215
+ ]
216
+ },
217
+ {
218
+ "component": "MessageComposer",
219
+ "description": "Where a message is written: a growing textarea (Enter sends, Shift+Enter a new line), an attach slot, a send button.",
220
+ "props": [
221
+ {
222
+ "name": "onSend",
223
+ "type": "() => void",
224
+ "default": null,
225
+ "description": "Sends the draft (Enter, or the button); Shift+Enter adds a line.",
226
+ "required": true
227
+ },
228
+ {
229
+ "name": "onValueChange",
230
+ "type": "(text: string) => void",
231
+ "default": null,
232
+ "description": "Called on every key.",
233
+ "required": true
234
+ },
235
+ {
236
+ "name": "placeholder",
237
+ "type": "string",
238
+ "default": null,
239
+ "description": "The input's name and placeholder (“Message”).",
240
+ "required": true
241
+ },
242
+ {
243
+ "name": "sendLabel",
244
+ "type": "string",
245
+ "default": null,
246
+ "description": "The send button's name (“Send”).",
247
+ "required": true
248
+ },
249
+ {
250
+ "name": "value",
251
+ "type": "string",
252
+ "default": null,
253
+ "description": "The draft (controlled).",
254
+ "required": true
255
+ },
256
+ {
257
+ "name": "className",
258
+ "type": "string",
259
+ "default": null,
260
+ "description": "Classes merged on the root.",
261
+ "required": false
262
+ },
263
+ {
264
+ "name": "disabledReason",
265
+ "type": "string",
266
+ "default": null,
267
+ "description": "Cannot write: the reason in its place.",
268
+ "required": false
269
+ },
270
+ {
271
+ "name": "leading",
272
+ "type": "ReactNode",
273
+ "default": null,
274
+ "description": "Before the input: an attach button.",
275
+ "required": false
276
+ },
277
+ {
278
+ "name": "maxLength",
279
+ "type": "number",
280
+ "default": "4000",
281
+ "description": "The longest message. Default 4000.",
282
+ "required": false
283
+ }
284
+ ]
285
+ },
286
+ {
287
+ "component": "TypingIndicator",
288
+ "description": "Three dots that breathe while the other person types, announced politely; still under reduced motion.",
289
+ "props": [
290
+ {
291
+ "name": "label",
292
+ "type": "string",
293
+ "default": null,
294
+ "description": "What is read and shown beside the dots (“Elena is typing”) — passed translated.",
295
+ "required": true
296
+ },
297
+ {
298
+ "name": "className",
299
+ "type": "string",
300
+ "default": null,
301
+ "description": "Classes merged on the root.",
302
+ "required": false
303
+ },
304
+ {
305
+ "name": "showLabel",
306
+ "type": "boolean",
307
+ "default": null,
308
+ "description": "Show the words beside the dots.",
309
+ "required": false
310
+ }
311
+ ]
312
+ }
313
+ ],
314
+ "examples": [
315
+ {
316
+ "name": "conversation",
317
+ "title": "Conversation",
318
+ "description": "Grouped runs, a read receipt, typing, the composer.",
319
+ "path": "examples/chat/conversation.tsx",
320
+ "module": "@krizaka/ui/registry/examples/chat/conversation",
321
+ "code": "\"use client\";\n\nimport { MessageBubble, MessageComposer, TypingIndicator } from \"@krizaka/ui/chat\";\nimport { useState } from \"react\";\n\n// A conversation: runs grouped, the time inside, the receipt under the last of yours, typing, the composer.\nexport default function ChatConversation() {\n const [draft, setDraft] = useState(\"\");\n return (\n <div className=\"flex max-w-md flex-col overflow-hidden rounded-xl border border-border-default bg-surface-0\">\n <div className=\"flex flex-col gap-1 p-3\">\n <MessageBubble text=\"Hey! Loved your sunset photo 🌅\" time=\"19:02\" grouped=\"first\" />\n <MessageBubble text=\"Was it Cabo da Roca?\" time=\"19:02\" grouped=\"last\" />\n <MessageBubble mine text=\"It was! Have you been?\" time=\"19:05\" grouped=\"first\" />\n <MessageBubble mine text=\"We should go this weekend\" time=\"19:05\" grouped=\"last\" status=\"read\" showStatus />\n <TypingIndicator label=\"Elena is typing\" />\n </div>\n <MessageComposer value={draft} onValueChange={setDraft} onSend={() => setDraft(\"\")} placeholder=\"Message\" sendLabel=\"Send\" />\n </div>\n );\n}\n"
322
+ },
323
+ {
324
+ "name": "inbox",
325
+ "title": "Inbox",
326
+ "description": "Online, typing, unread counts.",
327
+ "path": "examples/chat/inbox.tsx",
328
+ "module": "@krizaka/ui/registry/examples/chat/inbox",
329
+ "code": "import { ConversationItem } from \"@krizaka/ui/chat\";\n\n// The inbox: online, the last message or “typing…”, the time, the unread count.\nexport default function ChatInbox() {\n return (\n <div className=\"flex max-w-md flex-col rounded-xl border border-border-default bg-surface-0 py-1\">\n <ConversationItem name=\"Elena\" online onlineLabel=\"online\" preview=\"typing…\" typing time=\"19:06\" unread={2} unreadLabel=\"2 unread\" href=\"#/chats/elena\" />\n <ConversationItem name=\"Noah\" preview=\"See you Saturday then!\" time=\"Mon\" href=\"#/chats/noah\" />\n <ConversationItem name=\"Mina\" preview=\"You: haha same\" time=\"Sun\" href=\"#/chats/mina\" />\n </div>\n );\n}\n"
330
+ }
331
+ ]
332
+ },
333
+ "native": {
334
+ "entry": "@krizaka/ui/native",
335
+ "import": "import { MessageBubble, TypingIndicator, MessageComposer, ConversationItem } from \"@krizaka/ui/native\";",
336
+ "differences": [
337
+ "The composer keeps clear of the home indicator; the send button plays a light tap.",
338
+ "A failed bubble is itself the retry button.",
339
+ "`ConversationItem` takes `presence` (a dot on the avatar) instead of `online`."
340
+ ],
341
+ "props": [
342
+ {
343
+ "component": "MessageBubble",
344
+ "description": "A message: yours in the accent on the right, theirs on the left, the time inside, the receipt under the last of yours.",
345
+ "props": [
346
+ {
347
+ "name": "text",
348
+ "type": "string",
349
+ "default": null,
350
+ "description": "The text.",
351
+ "required": true
352
+ },
353
+ {
354
+ "name": "context",
355
+ "type": "string",
356
+ "default": null,
357
+ "description": "A line above the text: what it answers (“Replied to your story”).",
358
+ "required": false
359
+ },
360
+ {
361
+ "name": "grouped",
362
+ "type": "\"middle\" | \"first\" | \"last\" | \"single\"",
363
+ "default": "single",
364
+ "description": "Part of a run of the same sender: the corner towards the next one is tighter.",
365
+ "required": false
366
+ },
367
+ {
368
+ "name": "labels",
369
+ "type": "MessageBubbleLabels",
370
+ "default": null,
371
+ "description": "The words, passed translated.",
372
+ "required": false
373
+ },
374
+ {
375
+ "name": "mine",
376
+ "type": "boolean",
377
+ "default": null,
378
+ "description": "Yours (right, in the accent) or theirs (left).",
379
+ "required": false
380
+ },
381
+ {
382
+ "name": "onRetry",
383
+ "type": "(() => void)",
384
+ "default": null,
385
+ "description": "Called when a failed message is pressed: send it again.",
386
+ "required": false
387
+ },
388
+ {
389
+ "name": "showStatus",
390
+ "type": "boolean",
391
+ "default": null,
392
+ "description": "Show the status under the bubble (the last message of yours).",
393
+ "required": false
394
+ },
395
+ {
396
+ "name": "status",
397
+ "type": "MessageStatus",
398
+ "default": null,
399
+ "description": "Where a message of yours stands; shown when `showStatus`.",
400
+ "required": false
401
+ },
402
+ {
403
+ "name": "style",
404
+ "type": "StyleProp<ViewStyle>",
405
+ "default": null,
406
+ "description": "Styles merged last.",
407
+ "required": false
408
+ },
409
+ {
410
+ "name": "time",
411
+ "type": "string",
412
+ "default": null,
413
+ "description": "The time, written by the app (“14:02”).",
414
+ "required": false
415
+ }
416
+ ]
417
+ },
418
+ {
419
+ "component": "TypingIndicator",
420
+ "description": "Three dots that breathe in a bubble while the other person types; still under reduced motion.",
421
+ "props": [
422
+ {
423
+ "name": "label",
424
+ "type": "string",
425
+ "default": null,
426
+ "description": "What is said to screen readers and shown beside the dots (“Elena is typing”) — passed translated.",
427
+ "required": true
428
+ },
429
+ {
430
+ "name": "showLabel",
431
+ "type": "boolean",
432
+ "default": null,
433
+ "description": "Show the words beside the dots. Default false.",
434
+ "required": false
435
+ },
436
+ {
437
+ "name": "style",
438
+ "type": "StyleProp<ViewStyle>",
439
+ "default": null,
440
+ "description": "Styles merged last.",
441
+ "required": false
442
+ }
443
+ ]
444
+ },
445
+ {
446
+ "component": "MessageComposer",
447
+ "description": "Where a message is written: a growing input, an attach slot, a send button that wakes when there is something to send.",
448
+ "props": [
449
+ {
450
+ "name": "onSend",
451
+ "type": "() => void",
452
+ "default": null,
453
+ "description": "Sends the draft; the composer does not clear it — the app does once sent.",
454
+ "required": true
455
+ },
456
+ {
457
+ "name": "onValueChange",
458
+ "type": "(text: string) => void",
459
+ "default": null,
460
+ "description": "Called on every key (send the typing signal from here).",
461
+ "required": true
462
+ },
463
+ {
464
+ "name": "placeholder",
465
+ "type": "string",
466
+ "default": null,
467
+ "description": "The input's name and placeholder (“Message”) — passed translated.",
468
+ "required": true
469
+ },
470
+ {
471
+ "name": "sendLabel",
472
+ "type": "string",
473
+ "default": null,
474
+ "description": "The send button's name (“Send”).",
475
+ "required": true
476
+ },
477
+ {
478
+ "name": "value",
479
+ "type": "string",
480
+ "default": null,
481
+ "description": "The draft (controlled).",
482
+ "required": true
483
+ },
484
+ {
485
+ "name": "disabledReason",
486
+ "type": "string",
487
+ "default": null,
488
+ "description": "Cannot write (blocked, read-only): the reason in its place.",
489
+ "required": false
490
+ },
491
+ {
492
+ "name": "leading",
493
+ "type": "ReactNode",
494
+ "default": null,
495
+ "description": "Before the input: an attach button.",
496
+ "required": false
497
+ },
498
+ {
499
+ "name": "maxLength",
500
+ "type": "number",
501
+ "default": "4000",
502
+ "description": "The longest message. Default 4000.",
503
+ "required": false
504
+ },
505
+ {
506
+ "name": "style",
507
+ "type": "StyleProp<ViewStyle>",
508
+ "default": null,
509
+ "description": "Styles merged last.",
510
+ "required": false
511
+ }
512
+ ]
513
+ },
514
+ {
515
+ "component": "ConversationItem",
516
+ "description": "A conversation in the list: avatar and presence, name, the last message or typing, the time, the unread count.",
517
+ "props": [
518
+ {
519
+ "name": "name",
520
+ "type": "string",
521
+ "default": null,
522
+ "description": "The other person's name.",
523
+ "required": true
524
+ },
525
+ {
526
+ "name": "preview",
527
+ "type": "string",
528
+ "default": null,
529
+ "description": "The last message, or “typing…”.",
530
+ "required": true
531
+ },
532
+ {
533
+ "name": "avatar",
534
+ "type": "string | null",
535
+ "default": null,
536
+ "description": "Their avatar's URI.",
537
+ "required": false
538
+ },
539
+ {
540
+ "name": "onPress",
541
+ "type": "(() => void)",
542
+ "default": null,
543
+ "description": "Opens the conversation.",
544
+ "required": false
545
+ },
546
+ {
547
+ "name": "presence",
548
+ "type": "\"online\" | \"away\" | \"busy\" | \"offline\"",
549
+ "default": null,
550
+ "description": "Their presence (a dot on the avatar).",
551
+ "required": false
552
+ },
553
+ {
554
+ "name": "presenceLabel",
555
+ "type": "string",
556
+ "default": null,
557
+ "description": "The presence in words (“online”).",
558
+ "required": false
559
+ },
560
+ {
561
+ "name": "style",
562
+ "type": "StyleProp<ViewStyle>",
563
+ "default": null,
564
+ "description": "Styles merged last.",
565
+ "required": false
566
+ },
567
+ {
568
+ "name": "time",
569
+ "type": "string",
570
+ "default": null,
571
+ "description": "When (“14:02”, “Mon”).",
572
+ "required": false
573
+ },
574
+ {
575
+ "name": "typing",
576
+ "type": "boolean",
577
+ "default": null,
578
+ "description": "The preview is the typing signal: in the accent.",
579
+ "required": false
580
+ },
581
+ {
582
+ "name": "unread",
583
+ "type": "number",
584
+ "default": "0",
585
+ "description": "Unread messages: a count in the accent, the name in bold.",
586
+ "required": false
587
+ },
588
+ {
589
+ "name": "unreadLabel",
590
+ "type": "string",
591
+ "default": null,
592
+ "description": "The unread count in words (“3 unread”).",
593
+ "required": false
594
+ }
595
+ ]
596
+ }
597
+ ],
598
+ "examples": [
599
+ {
600
+ "name": "conversation",
601
+ "title": "Conversation",
602
+ "description": "Grouped runs, a read receipt, typing, the composer.",
603
+ "path": "examples/chat/native/conversation.tsx",
604
+ "module": "@krizaka/ui/registry/examples/chat/native/conversation",
605
+ "code": "import { MessageBubble, MessageComposer, TypingIndicator } from \"@krizaka/ui/native\";\nimport { useState } from \"react\";\nimport { View } from \"react-native\";\n\n// A conversation: runs grouped, the time inside, the receipt under the last of yours, the typing dots, the composer.\nexport default function NativeChatConversation() {\n const [draft, setDraft] = useState(\"\");\n return (\n <View style={{ width: 360, gap: 4 }}>\n <View style={{ padding: 12, gap: 4 }}>\n <MessageBubble text=\"Hey! Loved your sunset photo 🌅\" time=\"19:02\" grouped=\"first\" />\n <MessageBubble text=\"Was it Cabo da Roca?\" time=\"19:02\" grouped=\"last\" />\n <MessageBubble mine text=\"It was! Have you been?\" time=\"19:05\" grouped=\"first\" />\n <MessageBubble mine text=\"We should go this weekend\" time=\"19:05\" grouped=\"last\" status=\"read\" showStatus labels={{ status: { read: \"Read\" } }} />\n <TypingIndicator label=\"Elena is typing\" />\n </View>\n <MessageComposer value={draft} onValueChange={setDraft} onSend={() => setDraft(\"\")} placeholder=\"Message\" sendLabel=\"Send\" />\n </View>\n );\n}\n",
606
+ "screenshots": {
607
+ "dark": "examples/chat/native/conversation.dark.png",
608
+ "light": "examples/chat/native/conversation.light.png"
609
+ }
610
+ },
611
+ {
612
+ "name": "inbox",
613
+ "title": "Inbox",
614
+ "description": "Presence, typing, unread counts.",
615
+ "path": "examples/chat/native/inbox.tsx",
616
+ "module": "@krizaka/ui/registry/examples/chat/native/inbox",
617
+ "code": "import { ConversationItem } from \"@krizaka/ui/native\";\nimport { View } from \"react-native\";\n\n// The inbox: presence, the last message or “typing…”, the time, the unread count.\nexport default function NativeChatInbox() {\n return (\n <View style={{ width: 360 }}>\n <ConversationItem name=\"Elena\" presence=\"online\" presenceLabel=\"online\" preview=\"typing…\" typing time=\"19:06\" unread={2} unreadLabel=\"2 unread\" />\n <ConversationItem name=\"Noah\" presence=\"away\" presenceLabel=\"away\" preview=\"See you Saturday then!\" time=\"Mon\" />\n <ConversationItem name=\"Mina\" preview=\"You: haha same\" time=\"Sun\" />\n </View>\n );\n}\n",
618
+ "screenshots": {
619
+ "dark": "examples/chat/native/inbox.dark.png",
620
+ "light": "examples/chat/native/inbox.light.png"
621
+ }
622
+ }
623
+ ]
624
+ },
625
+ "files": [
626
+ {
627
+ "path": "chat/chat.tsx",
628
+ "content": "// Client (the composer's draft). A conversation's parts — the bubble with its time and receipt, the typing dots, the\n// composer, a conversation in a list — the same API as React Native. Words are props.\nimport * as React from \"react\";\nimport { tv } from \"tailwind-variants\";\n\nimport { Avatar } from \"../avatar\";\n\nexport const chat = tv({\n slots: {\n row: \"flex flex-col gap-0.5\",\n bubble: \"max-w-[80%] rounded-2xl px-3 py-2 text-sm leading-snug\",\n context: \"mb-0.5 block text-xs opacity-85\",\n time: \"mt-0.5 block text-right text-[11px] tabular-nums\",\n status: \"flex items-center gap-1 text-xs text-fg-secondary data-[status=failed]:text-fg-danger [&>svg]:h-3.5 [&>svg]:w-3.5\",\n typing: \"inline-flex items-center gap-1 self-start rounded-2xl bg-surface-2 px-3.5 py-3\",\n dot: \"h-[7px] w-[7px] rounded-full bg-fg-secondary motion-safe:animate-[kz-typing_1.2s_ease-in-out_infinite]\",\n composer: \"flex items-end gap-2 border-t border-border-subtle bg-surface-0 px-3 py-2\",\n input:\n \"max-h-32 min-h-10 flex-1 resize-none rounded-2xl border border-border-default bg-surface-1 px-3.5 py-2.5 text-sm text-fg placeholder:text-fg-muted \" +\n \"focus-visible:border-accent focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring\",\n send:\n \"inline-flex h-10 w-10 shrink-0 items-center justify-center rounded-full bg-accent text-on-accent hover:bg-accent-hover focus-visible:outline-hidden \" +\n \"focus-visible:ring-2 focus-visible:ring-ring disabled:bg-surface-3 disabled:text-fg-muted [&>svg]:h-[18px] [&>svg]:w-[18px]\",\n item: \"flex w-full items-center gap-3 px-4 py-2.5 text-left hover:bg-surface-2 focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring\",\n count: \"inline-flex h-5 min-w-5 items-center justify-center rounded-full bg-accent px-1.5 text-xs font-extrabold text-on-accent\",\n },\n});\n\nexport type MessageStatus = \"sending\" | \"sent\" | \"delivered\" | \"read\" | \"failed\";\n\nexport type MessageBubbleLabels = {\n /** The words of each status, shown under the last message of yours. */\n status?: Partial<Record<MessageStatus, string>>;\n /** A failed message's retry button (“Retry”). */\n retry?: string;\n};\n\nconst STATUS: Record<MessageStatus, string> = { sending: \"Sending\", sent: \"Sent\", delivered: \"Delivered\", read: \"Read\", failed: \"Not sent\" };\n\nexport type MessageBubbleProps = {\n /** The text. */\n text: string;\n /** Yours (right, in the accent) or theirs (left). */\n mine?: boolean;\n /** The time, written by the app (“14:02”). */\n time?: string;\n /** Where a message of yours stands; shown when `showStatus`. */\n status?: MessageStatus;\n /** Show the status under the bubble (the last message of yours). */\n showStatus?: boolean;\n /** A line above the text: what it answers. */\n context?: string;\n /** Sends a failed message again (a button under it). */\n onRetry?: () => void;\n /** Part of a run of the same sender: the corner towards the next one is tighter. */\n grouped?: \"first\" | \"middle\" | \"last\" | \"single\";\n /** The words, passed translated. */\n labels?: MessageBubbleLabels;\n /** Classes merged on the row. */\n className?: string;\n};\n\nconst CORNERS = {\n mine: { first: \"rounded-br-md\", middle: \"rounded-r-md\", last: \"rounded-tr-md\", single: \"\" },\n theirs: { first: \"rounded-bl-md\", middle: \"rounded-l-md\", last: \"rounded-tl-md\", single: \"\" },\n} as const;\n\n/** A message: yours in the accent on the right, theirs on the left, the time inside, the receipt under the last of yours. */\nexport function MessageBubble({ text, mine, time, status, showStatus, context, onRetry, grouped = \"single\", labels, className }: MessageBubbleProps) {\n const s = chat();\n const words = { ...STATUS, ...labels?.status };\n return (\n <div className={s.row({ className: [mine ? \"items-end\" : \"items-start\", className].filter(Boolean).join(\" \") })}>\n <p\n className={s.bubble({\n className: [mine ? \"bg-accent text-on-accent\" : \"bg-surface-2 text-fg\", CORNERS[mine ? \"mine\" : \"theirs\"][grouped], status === \"failed\" ? \"ring-2 ring-danger\" : \"\", status === \"sending\" ? \"opacity-70\" : \"\"].join(\" \"),\n })}\n >\n {context ? <span className={s.context()}>{context}</span> : null}\n {text}\n {time ? <span className={s.time()}>{time}</span> : null}\n </p>\n {showStatus && status ? (\n <p className={s.status()} data-status={status}>\n {status === \"sent\" || status === \"delivered\" || status === \"read\" ? (\n <svg viewBox=\"0 0 24 24\" fill=\"none\" strokeWidth=\"2.2\" strokeLinecap=\"round\" strokeLinejoin=\"round\" aria-hidden className={status === \"read\" ? \"stroke-accent\" : \"stroke-fg-secondary\"}>\n <path d={status === \"sent\" ? \"M5 12.5l4.5 4.5L19 7.5\" : \"M2 12.5l4.5 4.5L16 7.5M9 15l2 2 9.5-9.5\"} />\n </svg>\n ) : null}\n {words[status]}\n {status === \"failed\" && onRetry ? (\n <button type=\"button\" onClick={onRetry} className=\"ml-1 font-semibold text-fg underline underline-offset-2 focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring\">\n {labels?.retry ?? \"Retry\"}\n </button>\n ) : null}\n </p>\n ) : null}\n </div>\n );\n}\n\nexport type TypingIndicatorProps = {\n /** What is read and shown beside the dots (“Elena is typing”) — passed translated. */\n label: string;\n /** Show the words beside the dots. */\n showLabel?: boolean;\n /** Classes merged on the root. */\n className?: string;\n};\n\n/** Three dots that breathe while the other person types, announced politely; still under reduced motion. */\nexport function TypingIndicator({ label, showLabel, className }: TypingIndicatorProps) {\n const s = chat();\n return (\n <div role=\"status\" className={[\"flex items-center gap-2\", className].filter(Boolean).join(\" \")}>\n <style href=\"krizaka-typing\" precedence=\"default\">{\"@keyframes kz-typing{0%,60%,100%{opacity:.35;transform:none}30%{opacity:1;transform:translateY(-2px)}}\"}</style>\n <span className={s.typing()} aria-hidden>\n {[0, 1, 2].map((i) => (\n <span key={i} className={s.dot()} style={{ animationDelay: `${i * 0.18}s` }} />\n ))}\n </span>\n <span className={showLabel ? \"text-xs text-fg-secondary\" : \"sr-only\"}>{label}</span>\n </div>\n );\n}\n\nexport type MessageComposerProps = {\n /** The draft (controlled). */\n value: string;\n /** Called on every key. */\n onValueChange: (text: string) => void;\n /** Sends the draft (Enter, or the button); Shift+Enter adds a line. */\n onSend: () => void;\n /** The input's name and placeholder (“Message”). */\n placeholder: string;\n /** The send button's name (“Send”). */\n sendLabel: string;\n /** Before the input: an attach button. */\n leading?: React.ReactNode;\n /** Cannot write: the reason in its place. */\n disabledReason?: string;\n /** The longest message. Default 4000. */\n maxLength?: number;\n /** Classes merged on the root. */\n className?: string;\n};\n\n/** Where a message is written: a growing textarea (Enter sends, Shift+Enter a new line), an attach slot, a send button. */\nexport function MessageComposer({ value, onValueChange, onSend, placeholder, sendLabel, leading, disabledReason, maxLength = 4000, className }: MessageComposerProps) {\n const s = chat();\n const ready = value.trim().length > 0;\n return (\n <form\n className={s.composer({ className })}\n onSubmit={(e) => {\n e.preventDefault();\n if (ready) onSend();\n }}\n >\n {disabledReason ? (\n <p className=\"m-0 flex-1 py-2 text-sm text-fg-secondary\">{disabledReason}</p>\n ) : (\n <>\n {leading}\n <textarea\n aria-label={placeholder}\n placeholder={placeholder}\n rows={1}\n maxLength={maxLength}\n value={value}\n onChange={(e) => onValueChange(e.target.value)}\n onKeyDown={(e) => {\n if (e.key === \"Enter\" && !e.shiftKey && !e.nativeEvent.isComposing) {\n e.preventDefault();\n if (ready) onSend();\n }\n }}\n className={s.input()}\n style={{ fieldSizing: \"content\" } as React.CSSProperties}\n />\n <button type=\"submit\" aria-label={sendLabel} disabled={!ready} className={s.send()}>\n <svg viewBox=\"0 0 24 24\" fill=\"currentColor\" aria-hidden>\n <path d=\"M4 12l16-8-6 16-2.5-6.5L4 12z\" />\n </svg>\n </button>\n </>\n )}\n </form>\n );\n}\n\nexport type ConversationItemProps = {\n /** The other person's name. */\n name: string;\n /** Their avatar's URL. */\n avatar?: string | null;\n /** The last message, or “typing…”. */\n preview: string;\n /** The preview is the typing signal: in the accent. */\n typing?: boolean;\n /** When (“14:02”, “Mon”). */\n time?: string;\n /** Unread messages: a count, the name in bold. */\n unread?: number;\n /** The unread count in words (“3 unread”). */\n unreadLabel?: string;\n /** Before the name: a presence dot (online). */\n online?: boolean;\n /** The presence in words (“online”). */\n onlineLabel?: string;\n /** Opens the conversation (a link). */\n href?: string;\n /** Opens the conversation (a button). */\n onSelect?: () => void;\n /** Classes merged on the row. */\n className?: string;\n};\n\n/** A conversation in the list: avatar, name, the last message or typing, the time, the unread count. */\nexport function ConversationItem({ name, avatar, preview, typing, time, unread = 0, unreadLabel, online, onlineLabel, href, onSelect, className }: ConversationItemProps) {\n const s = chat();\n const body = (\n <>\n <span className=\"relative shrink-0\">\n <Avatar src={avatar ?? null} alt=\"\" fallback={name.charAt(0)} size=\"lg\" />\n {online ? <span aria-hidden className=\"absolute bottom-0 right-0 h-3 w-3 rounded-full bg-success ring-2 ring-surface-0\" /> : null}\n </span>\n <span className=\"flex min-w-0 flex-1 flex-col\">\n <span className=\"flex items-center gap-2\">\n <span className={[\"min-w-0 flex-1 truncate text-sm text-fg\", unread > 0 ? \"font-extrabold\" : \"font-semibold\"].join(\" \")}>\n {name}\n {online && onlineLabel ? <span className=\"sr-only\">{`, ${onlineLabel}`}</span> : null}\n </span>\n {time ? <span className={[\"shrink-0 text-xs tabular-nums\", unread > 0 ? \"text-fg-accent\" : \"text-fg-secondary\"].join(\" \")}>{time}</span> : null}\n </span>\n <span className=\"flex items-center gap-2\">\n <span className={[\"min-w-0 flex-1 truncate text-xs\", typing ? \"text-fg-accent\" : unread > 0 ? \"text-fg\" : \"text-fg-secondary\"].join(\" \")}>{preview}</span>\n {unread > 0 ? (\n <span className={s.count()}>\n <span aria-hidden>{unread > 99 ? \"99+\" : unread}</span>\n <span className=\"sr-only\">{unreadLabel ?? String(unread)}</span>\n </span>\n ) : null}\n </span>\n </span>\n </>\n );\n return href ? (\n <a href={href} className={s.item({ className })}>\n {body}\n </a>\n ) : (\n <button type=\"button\" onClick={onSelect} className={s.item({ className })}>\n {body}\n </button>\n );\n}\n"
629
+ },
630
+ {
631
+ "path": "chat/index.ts",
632
+ "content": "/** @krizaka/ui/chat — `MessageBubble`, `TypingIndicator`, `MessageComposer`, `ConversationItem`: a conversation's parts. */\nexport { chat, ConversationItem, type ConversationItemProps, MessageBubble, type MessageBubbleLabels, type MessageBubbleProps, MessageComposer, type MessageComposerProps, type MessageStatus, TypingIndicator, type TypingIndicatorProps } from \"./chat\";\n"
633
+ },
634
+ {
635
+ "path": "chat/meta.ts",
636
+ "content": "import type { ComponentMeta } from \"../meta\";\n\nexport const meta = {\n title: \"Chat\",\n summary: \"A conversation's parts — `MessageBubble` (time, receipt, retry), `TypingIndicator`, `MessageComposer`, `ConversationItem` — the same API on the web and React Native.\",\n status: \"beta\",\n category: \"data-display\",\n platforms: \"both\",\n whenToUse: [\"Orochia's Messages, a dating app's chats, support threads.\", \"An inbox of conversations with presence and unread counts.\"],\n whenNotToUse: [\n { when: \"For a comments thread under a post.\", use: \"list\" },\n { when: \"For notifications.\", use: \"toast\" },\n ],\n bestPractices: [\"Group the runs of one sender (`grouped`); show the receipt under the last message of yours only.\", \"Keep the server's order and merge (the app's), the bubble only draws.\", \"The composer never clears itself: clear the draft once the message is sent.\"],\n accessibility: {\n keyboard: [{ keys: \"Enter / Shift+Enter\", action: \"In the web composer: send, or a new line.\" }],\n notes: [\"Each bubble is read with its time; a failed one says so and offers a retry.\", \"The typing dots are announced politely by their words.\", \"A conversation row reads name, presence, last message, time and unread count.\"],\n },\n related: [\"avatar\", \"list\", \"toast\"],\n web: {\n imports: [\"MessageBubble\", \"TypingIndicator\", \"MessageComposer\", \"ConversationItem\"],\n examples: [\n { name: \"conversation\", title: \"Conversation\", description: \"Grouped runs, a read receipt, typing, the composer.\" },\n { name: \"inbox\", title: \"Inbox\", description: \"Online, typing, unread counts.\" },\n ],\n },\n native: {\n imports: [\"MessageBubble\", \"TypingIndicator\", \"MessageComposer\", \"ConversationItem\"],\n differences: [\"The composer keeps clear of the home indicator; the send button plays a light tap.\", \"A failed bubble is itself the retry button.\", \"`ConversationItem` takes `presence` (a dot on the avatar) instead of `online`.\"],\n examples: [\n { name: \"conversation\", title: \"Conversation\", description: \"Grouped runs, a read receipt, typing, the composer.\" },\n { name: \"inbox\", title: \"Inbox\", description: \"Presence, typing, unread counts.\" },\n ],\n },\n} satisfies ComponentMeta;\n"
637
+ },
638
+ {
639
+ "path": "meta.ts",
640
+ "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 | \"activity-feed\"\n | \"action-sheet\"\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 | \"chat\"\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 | \"description-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 | \"fab\"\n | \"field\"\n | \"file-upload\"\n | \"filter-bar\"\n | \"form\"\n | \"gallery-page\"\n | \"glow-card\"\n | \"goal-gauge\"\n | \"header\"\n | \"how-it-works-page\"\n | \"image-cropper\"\n | \"image-viewer\"\n | \"iso\"\n | \"kanban\"\n | \"kbd\"\n | \"landing-page\"\n | \"landscape\"\n | \"legal-page\"\n | \"link-card\"\n | \"list\"\n | \"loader\"\n | \"map\"\n | \"longform-page\"\n | \"marketing-layout\"\n | \"marquee\"\n | \"mascot-quote\"\n | \"mascot-state\"\n | \"mascots\"\n | \"match-dialog\"\n | \"media-capture\"\n | \"media-picker\"\n | \"meter\"\n | \"nav-bar\"\n | \"number-ticker\"\n | \"onboarding\"\n | \"otp-input\"\n | \"page\"\n | \"page-header\"\n | \"page-hero\"\n | \"pagination\"\n | \"permission-prompt\"\n | \"photo-grid\"\n | \"pointer-light\"\n | \"popover\"\n | \"pricing-page\"\n | \"product-page\"\n | \"profile-card\"\n | \"progress\"\n | \"promise-card\"\n | \"pull-to-refresh\"\n | \"radio-group\"\n | \"screen\"\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 | \"step-progress\"\n | \"stepper\"\n | \"swipe-deck\"\n | \"swipeable-row\"\n | \"switch\"\n | \"tab-bar\"\n | \"tabs\"\n | \"tag-input\"\n | \"tag-selector\"\n | \"terminal-replay\"\n | \"theme\"\n | \"toast\"\n | \"toc\"\n | \"tooltip\"\n | \"tree-view\"\n | \"txt\"\n | \"verified-badge\"\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"
641
+ }
642
+ ],
643
+ "dependencies": [
644
+ "tailwind-variants@^3.3.1"
645
+ ],
646
+ "registryDependencies": [
647
+ "avatar"
648
+ ],
649
+ "demo": {
650
+ "path": "examples/chat/conversation.tsx",
651
+ "content": "\"use client\";\n\nimport { MessageBubble, MessageComposer, TypingIndicator } from \"@krizaka/ui/chat\";\nimport { useState } from \"react\";\n\n// A conversation: runs grouped, the time inside, the receipt under the last of yours, typing, the composer.\nexport default function ChatConversation() {\n const [draft, setDraft] = useState(\"\");\n return (\n <div className=\"flex max-w-md flex-col overflow-hidden rounded-xl border border-border-default bg-surface-0\">\n <div className=\"flex flex-col gap-1 p-3\">\n <MessageBubble text=\"Hey! Loved your sunset photo 🌅\" time=\"19:02\" grouped=\"first\" />\n <MessageBubble text=\"Was it Cabo da Roca?\" time=\"19:02\" grouped=\"last\" />\n <MessageBubble mine text=\"It was! Have you been?\" time=\"19:05\" grouped=\"first\" />\n <MessageBubble mine text=\"We should go this weekend\" time=\"19:05\" grouped=\"last\" status=\"read\" showStatus />\n <TypingIndicator label=\"Elena is typing\" />\n </div>\n <MessageComposer value={draft} onValueChange={setDraft} onSend={() => setDraft(\"\")} placeholder=\"Message\" sendLabel=\"Send\" />\n </div>\n );\n}\n"
652
+ },
653
+ "props": [
654
+ {
655
+ "component": "ConversationItem",
656
+ "description": "A conversation in the list: avatar, name, the last message or typing, the time, the unread count.",
657
+ "props": [
658
+ {
659
+ "name": "name",
660
+ "type": "string",
661
+ "default": null,
662
+ "description": "The other person's name.",
663
+ "required": true
664
+ },
665
+ {
666
+ "name": "preview",
667
+ "type": "string",
668
+ "default": null,
669
+ "description": "The last message, or “typing…”.",
670
+ "required": true
671
+ },
672
+ {
673
+ "name": "avatar",
674
+ "type": "string | null",
675
+ "default": null,
676
+ "description": "Their avatar's URL.",
677
+ "required": false
678
+ },
679
+ {
680
+ "name": "className",
681
+ "type": "string",
682
+ "default": null,
683
+ "description": "Classes merged on the row.",
684
+ "required": false
685
+ },
686
+ {
687
+ "name": "href",
688
+ "type": "string",
689
+ "default": null,
690
+ "description": "Opens the conversation (a link).",
691
+ "required": false
692
+ },
693
+ {
694
+ "name": "online",
695
+ "type": "boolean",
696
+ "default": null,
697
+ "description": "Before the name: a presence dot (online).",
698
+ "required": false
699
+ },
700
+ {
701
+ "name": "onlineLabel",
702
+ "type": "string",
703
+ "default": null,
704
+ "description": "The presence in words (“online”).",
705
+ "required": false
706
+ },
707
+ {
708
+ "name": "onSelect",
709
+ "type": "(() => void)",
710
+ "default": null,
711
+ "description": "Opens the conversation (a button).",
712
+ "required": false
713
+ },
714
+ {
715
+ "name": "time",
716
+ "type": "string",
717
+ "default": null,
718
+ "description": "When (“14:02”, “Mon”).",
719
+ "required": false
720
+ },
721
+ {
722
+ "name": "typing",
723
+ "type": "boolean",
724
+ "default": null,
725
+ "description": "The preview is the typing signal: in the accent.",
726
+ "required": false
727
+ },
728
+ {
729
+ "name": "unread",
730
+ "type": "number",
731
+ "default": "0",
732
+ "description": "Unread messages: a count, the name in bold.",
733
+ "required": false
734
+ },
735
+ {
736
+ "name": "unreadLabel",
737
+ "type": "string",
738
+ "default": null,
739
+ "description": "The unread count in words (“3 unread”).",
740
+ "required": false
741
+ }
742
+ ]
743
+ },
744
+ {
745
+ "component": "MessageBubble",
746
+ "description": "A message: yours in the accent on the right, theirs on the left, the time inside, the receipt under the last of yours.",
747
+ "props": [
748
+ {
749
+ "name": "text",
750
+ "type": "string",
751
+ "default": null,
752
+ "description": "The text.",
753
+ "required": true
754
+ },
755
+ {
756
+ "name": "className",
757
+ "type": "string",
758
+ "default": null,
759
+ "description": "Classes merged on the row.",
760
+ "required": false
761
+ },
762
+ {
763
+ "name": "context",
764
+ "type": "string",
765
+ "default": null,
766
+ "description": "A line above the text: what it answers.",
767
+ "required": false
768
+ },
769
+ {
770
+ "name": "grouped",
771
+ "type": "\"middle\" | \"first\" | \"last\" | \"single\"",
772
+ "default": "single",
773
+ "description": "Part of a run of the same sender: the corner towards the next one is tighter.",
774
+ "required": false
775
+ },
776
+ {
777
+ "name": "labels",
778
+ "type": "MessageBubbleLabels",
779
+ "default": null,
780
+ "description": "The words, passed translated.",
781
+ "required": false
782
+ },
783
+ {
784
+ "name": "mine",
785
+ "type": "boolean",
786
+ "default": null,
787
+ "description": "Yours (right, in the accent) or theirs (left).",
788
+ "required": false
789
+ },
790
+ {
791
+ "name": "onRetry",
792
+ "type": "(() => void)",
793
+ "default": null,
794
+ "description": "Sends a failed message again (a button under it).",
795
+ "required": false
796
+ },
797
+ {
798
+ "name": "showStatus",
799
+ "type": "boolean",
800
+ "default": null,
801
+ "description": "Show the status under the bubble (the last message of yours).",
802
+ "required": false
803
+ },
804
+ {
805
+ "name": "status",
806
+ "type": "MessageStatus",
807
+ "default": null,
808
+ "description": "Where a message of yours stands; shown when `showStatus`.",
809
+ "required": false
810
+ },
811
+ {
812
+ "name": "time",
813
+ "type": "string",
814
+ "default": null,
815
+ "description": "The time, written by the app (“14:02”).",
816
+ "required": false
817
+ }
818
+ ]
819
+ },
820
+ {
821
+ "component": "MessageComposer",
822
+ "description": "Where a message is written: a growing textarea (Enter sends, Shift+Enter a new line), an attach slot, a send button.",
823
+ "props": [
824
+ {
825
+ "name": "onSend",
826
+ "type": "() => void",
827
+ "default": null,
828
+ "description": "Sends the draft (Enter, or the button); Shift+Enter adds a line.",
829
+ "required": true
830
+ },
831
+ {
832
+ "name": "onValueChange",
833
+ "type": "(text: string) => void",
834
+ "default": null,
835
+ "description": "Called on every key.",
836
+ "required": true
837
+ },
838
+ {
839
+ "name": "placeholder",
840
+ "type": "string",
841
+ "default": null,
842
+ "description": "The input's name and placeholder (“Message”).",
843
+ "required": true
844
+ },
845
+ {
846
+ "name": "sendLabel",
847
+ "type": "string",
848
+ "default": null,
849
+ "description": "The send button's name (“Send”).",
850
+ "required": true
851
+ },
852
+ {
853
+ "name": "value",
854
+ "type": "string",
855
+ "default": null,
856
+ "description": "The draft (controlled).",
857
+ "required": true
858
+ },
859
+ {
860
+ "name": "className",
861
+ "type": "string",
862
+ "default": null,
863
+ "description": "Classes merged on the root.",
864
+ "required": false
865
+ },
866
+ {
867
+ "name": "disabledReason",
868
+ "type": "string",
869
+ "default": null,
870
+ "description": "Cannot write: the reason in its place.",
871
+ "required": false
872
+ },
873
+ {
874
+ "name": "leading",
875
+ "type": "ReactNode",
876
+ "default": null,
877
+ "description": "Before the input: an attach button.",
878
+ "required": false
879
+ },
880
+ {
881
+ "name": "maxLength",
882
+ "type": "number",
883
+ "default": "4000",
884
+ "description": "The longest message. Default 4000.",
885
+ "required": false
886
+ }
887
+ ]
888
+ },
889
+ {
890
+ "component": "TypingIndicator",
891
+ "description": "Three dots that breathe while the other person types, announced politely; still under reduced motion.",
892
+ "props": [
893
+ {
894
+ "name": "label",
895
+ "type": "string",
896
+ "default": null,
897
+ "description": "What is read and shown beside the dots (“Elena is typing”) — passed translated.",
898
+ "required": true
899
+ },
900
+ {
901
+ "name": "className",
902
+ "type": "string",
903
+ "default": null,
904
+ "description": "Classes merged on the root.",
905
+ "required": false
906
+ },
907
+ {
908
+ "name": "showLabel",
909
+ "type": "boolean",
910
+ "default": null,
911
+ "description": "Show the words beside the dots.",
912
+ "required": false
913
+ }
914
+ ]
915
+ }
916
+ ]
917
+ }