@memori.ai/ui 1.0.0-alpha

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 (274) hide show
  1. package/README.md +105 -0
  2. package/dist/components/Alert/Alert.d.ts +18 -0
  3. package/dist/components/Alert/index.d.ts +2 -0
  4. package/dist/components/Button/Button.d.ts +27 -0
  5. package/dist/components/Button/index.d.ts +2 -0
  6. package/dist/components/ButtonBase/ButtonBase.d.ts +28 -0
  7. package/dist/components/ButtonBase/index.d.ts +3 -0
  8. package/dist/components/Card/Card.d.ts +13 -0
  9. package/dist/components/Card/index.d.ts +2 -0
  10. package/dist/components/Checkbox/Checkbox.d.ts +11 -0
  11. package/dist/components/Checkbox/index.d.ts +2 -0
  12. package/dist/components/ConfirmDialog/ConfirmDialog.d.ts +12 -0
  13. package/dist/components/ConfirmDialog/index.d.ts +2 -0
  14. package/dist/components/Drawer/Drawer.d.ts +32 -0
  15. package/dist/components/Drawer/index.d.ts +2 -0
  16. package/dist/components/Dropdown/Dropdown.d.ts +11 -0
  17. package/dist/components/Dropdown/index.d.ts +2 -0
  18. package/dist/components/Expandable/Expandable.d.ts +15 -0
  19. package/dist/components/Expandable/helpers.d.ts +3 -0
  20. package/dist/components/Expandable/index.d.ts +2 -0
  21. package/dist/components/InputBase/InputBase.d.ts +49 -0
  22. package/dist/components/InputBase/index.d.ts +3 -0
  23. package/dist/components/Modal/Modal.d.ts +16 -0
  24. package/dist/components/Modal/index.d.ts +2 -0
  25. package/dist/components/Select/Select.d.ts +16 -0
  26. package/dist/components/Select/index.d.ts +2 -0
  27. package/dist/components/Slider/Slider.d.ts +12 -0
  28. package/dist/components/Slider/index.d.ts +2 -0
  29. package/dist/components/Spin/Spin.d.ts +9 -0
  30. package/dist/components/Spin/index.d.ts +2 -0
  31. package/dist/components/Tooltip/Tooltip.d.ts +11 -0
  32. package/dist/components/Tooltip/index.d.ts +2 -0
  33. package/dist/i18n/I18nWrapper.d.ts +6 -0
  34. package/dist/icons/AI.d.ts +5 -0
  35. package/dist/icons/Alert.d.ts +5 -0
  36. package/dist/icons/ArrowUp.d.ts +5 -0
  37. package/dist/icons/Bug.d.ts +5 -0
  38. package/dist/icons/Chat.d.ts +5 -0
  39. package/dist/icons/ChevronDown.d.ts +5 -0
  40. package/dist/icons/ChevronLeft.d.ts +5 -0
  41. package/dist/icons/ChevronRight.d.ts +5 -0
  42. package/dist/icons/ChevronUp.d.ts +5 -0
  43. package/dist/icons/Clear.d.ts +5 -0
  44. package/dist/icons/Close.d.ts +6 -0
  45. package/dist/icons/Code.d.ts +5 -0
  46. package/dist/icons/Copy.d.ts +5 -0
  47. package/dist/icons/DeepThought.d.ts +5 -0
  48. package/dist/icons/Delete.d.ts +5 -0
  49. package/dist/icons/Document.d.ts +5 -0
  50. package/dist/icons/Download.d.ts +5 -0
  51. package/dist/icons/Edit.d.ts +5 -0
  52. package/dist/icons/Expand.d.ts +5 -0
  53. package/dist/icons/Eye.d.ts +5 -0
  54. package/dist/icons/EyeInvisible.d.ts +5 -0
  55. package/dist/icons/Facebook.d.ts +5 -0
  56. package/dist/icons/Feedback.d.ts +5 -0
  57. package/dist/icons/File.d.ts +5 -0
  58. package/dist/icons/FileExcel.d.ts +5 -0
  59. package/dist/icons/FilePdf.d.ts +5 -0
  60. package/dist/icons/FileWord.d.ts +5 -0
  61. package/dist/icons/Fullscreen.d.ts +5 -0
  62. package/dist/icons/FullscreenExit.d.ts +5 -0
  63. package/dist/icons/Group.d.ts +5 -0
  64. package/dist/icons/History.d.ts +6 -0
  65. package/dist/icons/Image.d.ts +4 -0
  66. package/dist/icons/Info.d.ts +5 -0
  67. package/dist/icons/Link.d.ts +5 -0
  68. package/dist/icons/Linkedin.d.ts +5 -0
  69. package/dist/icons/Loading.d.ts +6 -0
  70. package/dist/icons/Logout.d.ts +5 -0
  71. package/dist/icons/Mail.d.ts +5 -0
  72. package/dist/icons/MapMarker.d.ts +5 -0
  73. package/dist/icons/MenuHorizontal.d.ts +6 -0
  74. package/dist/icons/MenuVertical.d.ts +6 -0
  75. package/dist/icons/Message.d.ts +5 -0
  76. package/dist/icons/Microphone.d.ts +5 -0
  77. package/dist/icons/Minus.d.ts +5 -0
  78. package/dist/icons/MinusCircle.d.ts +5 -0
  79. package/dist/icons/PaperClip.d.ts +5 -0
  80. package/dist/icons/Picture.d.ts +5 -0
  81. package/dist/icons/Plus.d.ts +5 -0
  82. package/dist/icons/Preview.d.ts +4 -0
  83. package/dist/icons/Print.d.ts +6 -0
  84. package/dist/icons/QuestionHelp.d.ts +5 -0
  85. package/dist/icons/Refresh.d.ts +5 -0
  86. package/dist/icons/SelectIcon.d.ts +5 -0
  87. package/dist/icons/Send.d.ts +5 -0
  88. package/dist/icons/Setting.d.ts +5 -0
  89. package/dist/icons/Share.d.ts +5 -0
  90. package/dist/icons/Sound.d.ts +5 -0
  91. package/dist/icons/SoundDeactivated.d.ts +5 -0
  92. package/dist/icons/Telegram.d.ts +5 -0
  93. package/dist/icons/ThumbDown.d.ts +5 -0
  94. package/dist/icons/ThumbUp.d.ts +5 -0
  95. package/dist/icons/Translation.d.ts +5 -0
  96. package/dist/icons/Twitter.d.ts +5 -0
  97. package/dist/icons/Upload.d.ts +4 -0
  98. package/dist/icons/User.d.ts +5 -0
  99. package/dist/icons/Warning.d.ts +5 -0
  100. package/dist/icons/WhatsApp.d.ts +5 -0
  101. package/dist/index.d.ts +13 -0
  102. package/dist/memori-ai-ui.css +2 -0
  103. package/dist/memori-ai-ui.es.js +6400 -0
  104. package/dist/memori-ai-ui.umd.js +23 -0
  105. package/package.json +97 -0
  106. package/src/components/Alert/Alert.css +95 -0
  107. package/src/components/Alert/Alert.stories.tsx +156 -0
  108. package/src/components/Alert/Alert.test.tsx +122 -0
  109. package/src/components/Alert/Alert.tsx +124 -0
  110. package/src/components/Alert/__snapshots__/Alert.test.tsx.snap +67 -0
  111. package/src/components/Alert/index.tsx +2 -0
  112. package/src/components/Button/Button.css +173 -0
  113. package/src/components/Button/Button.stories.tsx +173 -0
  114. package/src/components/Button/Button.test.tsx +80 -0
  115. package/src/components/Button/Button.tsx +104 -0
  116. package/src/components/Button/__snapshots__/Button.test.tsx.snap +204 -0
  117. package/src/components/Button/index.tsx +2 -0
  118. package/src/components/ButtonBase/ButtonBase.stories.tsx +194 -0
  119. package/src/components/ButtonBase/ButtonBase.tsx +84 -0
  120. package/src/components/ButtonBase/index.tsx +3 -0
  121. package/src/components/ButtonBase/styles.module.css +135 -0
  122. package/src/components/Card/Card.css +67 -0
  123. package/src/components/Card/Card.stories.tsx +104 -0
  124. package/src/components/Card/Card.test.tsx +67 -0
  125. package/src/components/Card/Card.tsx +58 -0
  126. package/src/components/Card/__snapshots__/Card.test.tsx.snap +321 -0
  127. package/src/components/Card/index.tsx +2 -0
  128. package/src/components/Checkbox/Checkbox.css +114 -0
  129. package/src/components/Checkbox/Checkbox.stories.tsx +77 -0
  130. package/src/components/Checkbox/Checkbox.test.tsx +50 -0
  131. package/src/components/Checkbox/Checkbox.tsx +61 -0
  132. package/src/components/Checkbox/__snapshots__/Checkbox.test.tsx.snap +131 -0
  133. package/src/components/Checkbox/index.tsx +2 -0
  134. package/src/components/ConfirmDialog/ConfirmDialog.css +44 -0
  135. package/src/components/ConfirmDialog/ConfirmDialog.stories.tsx +235 -0
  136. package/src/components/ConfirmDialog/ConfirmDialog.test.tsx +129 -0
  137. package/src/components/ConfirmDialog/ConfirmDialog.tsx +73 -0
  138. package/src/components/ConfirmDialog/__snapshots__/ConfirmDialog.test.tsx.snap +11 -0
  139. package/src/components/ConfirmDialog/index.tsx +2 -0
  140. package/src/components/Details/Details.css +66 -0
  141. package/src/components/Details/Details.stories.tsx +67 -0
  142. package/src/components/Drawer/Drawer.css +210 -0
  143. package/src/components/Drawer/Drawer.stories.tsx +275 -0
  144. package/src/components/Drawer/Drawer.test.tsx +158 -0
  145. package/src/components/Drawer/Drawer.tsx +242 -0
  146. package/src/components/Drawer/__snapshots__/Drawer.test.tsx.snap +21 -0
  147. package/src/components/Drawer/index.tsx +2 -0
  148. package/src/components/Dropdown/Dropdown.css +177 -0
  149. package/src/components/Dropdown/Dropdown.stories.tsx +73 -0
  150. package/src/components/Dropdown/Dropdown.test.tsx +88 -0
  151. package/src/components/Dropdown/Dropdown.tsx +88 -0
  152. package/src/components/Dropdown/__snapshots__/Dropdown.test.tsx.snap +141 -0
  153. package/src/components/Dropdown/index.tsx +2 -0
  154. package/src/components/Expandable/Expandable.css +15 -0
  155. package/src/components/Expandable/Expandable.stories.tsx +196 -0
  156. package/src/components/Expandable/Expandable.test.tsx +143 -0
  157. package/src/components/Expandable/Expandable.tsx +122 -0
  158. package/src/components/Expandable/__snapshots__/Expandable.test.tsx.snap +199 -0
  159. package/src/components/Expandable/helpers.ts +16 -0
  160. package/src/components/Expandable/index.tsx +2 -0
  161. package/src/components/InputBase/InputBase.stories.tsx +237 -0
  162. package/src/components/InputBase/InputBase.tsx +105 -0
  163. package/src/components/InputBase/index.tsx +3 -0
  164. package/src/components/InputBase/styles.module.css +96 -0
  165. package/src/components/Modal/Modal.css +95 -0
  166. package/src/components/Modal/Modal.stories.tsx +184 -0
  167. package/src/components/Modal/Modal.test.tsx +129 -0
  168. package/src/components/Modal/Modal.tsx +124 -0
  169. package/src/components/Modal/__snapshots__/Modal.test.tsx.snap +17 -0
  170. package/src/components/Modal/index.tsx +2 -0
  171. package/src/components/Select/Select.css +134 -0
  172. package/src/components/Select/Select.stories.tsx +85 -0
  173. package/src/components/Select/Select.test.tsx +85 -0
  174. package/src/components/Select/Select.tsx +84 -0
  175. package/src/components/Select/__snapshots__/Select.test.tsx.snap +261 -0
  176. package/src/components/Select/index.tsx +2 -0
  177. package/src/components/Slider/Slider.css +194 -0
  178. package/src/components/Slider/Slider.stories.tsx +85 -0
  179. package/src/components/Slider/Slider.test.tsx +55 -0
  180. package/src/components/Slider/Slider.tsx +157 -0
  181. package/src/components/Slider/__snapshots__/Slider.test.tsx.snap +419 -0
  182. package/src/components/Slider/index.tsx +2 -0
  183. package/src/components/Spin/Spin.css +31 -0
  184. package/src/components/Spin/Spin.stories.tsx +65 -0
  185. package/src/components/Spin/Spin.test.tsx +47 -0
  186. package/src/components/Spin/Spin.tsx +34 -0
  187. package/src/components/Spin/__snapshots__/Spin.test.tsx.snap +193 -0
  188. package/src/components/Spin/index.tsx +2 -0
  189. package/src/components/Table/Table.css +130 -0
  190. package/src/components/Table/Table.stories.tsx +274 -0
  191. package/src/components/Tooltip/Tooltip.css +160 -0
  192. package/src/components/Tooltip/Tooltip.stories.tsx +136 -0
  193. package/src/components/Tooltip/Tooltip.test.tsx +110 -0
  194. package/src/components/Tooltip/Tooltip.tsx +46 -0
  195. package/src/components/Tooltip/__snapshots__/Tooltip.test.tsx.snap +163 -0
  196. package/src/components/Tooltip/index.tsx +2 -0
  197. package/src/components/definitions.stories.tsx +150 -0
  198. package/src/i18n/I18nWrapper.tsx +13 -0
  199. package/src/i18n/i18n.ts +34 -0
  200. package/src/icons/AI.tsx +38 -0
  201. package/src/icons/Alert.tsx +31 -0
  202. package/src/icons/ArrowUp.tsx +28 -0
  203. package/src/icons/Bug.tsx +81 -0
  204. package/src/icons/Chat.tsx +30 -0
  205. package/src/icons/ChevronDown.tsx +26 -0
  206. package/src/icons/ChevronLeft.tsx +28 -0
  207. package/src/icons/ChevronRight.tsx +28 -0
  208. package/src/icons/ChevronUp.tsx +24 -0
  209. package/src/icons/Clear.tsx +23 -0
  210. package/src/icons/Close.tsx +30 -0
  211. package/src/icons/Code.tsx +30 -0
  212. package/src/icons/Copy.tsx +30 -0
  213. package/src/icons/DeepThought.tsx +38 -0
  214. package/src/icons/Delete.tsx +23 -0
  215. package/src/icons/Document.tsx +52 -0
  216. package/src/icons/Download.tsx +23 -0
  217. package/src/icons/Edit.tsx +17 -0
  218. package/src/icons/Expand.tsx +23 -0
  219. package/src/icons/Eye.tsx +17 -0
  220. package/src/icons/EyeInvisible.tsx +24 -0
  221. package/src/icons/Facebook.tsx +23 -0
  222. package/src/icons/Feedback.tsx +27 -0
  223. package/src/icons/File.tsx +17 -0
  224. package/src/icons/FileExcel.tsx +23 -0
  225. package/src/icons/FilePdf.tsx +23 -0
  226. package/src/icons/FileWord.tsx +23 -0
  227. package/src/icons/Fullscreen.tsx +23 -0
  228. package/src/icons/FullscreenExit.tsx +23 -0
  229. package/src/icons/Group.tsx +30 -0
  230. package/src/icons/History.tsx +33 -0
  231. package/src/icons/Image.tsx +37 -0
  232. package/src/icons/Info.tsx +37 -0
  233. package/src/icons/Link.tsx +17 -0
  234. package/src/icons/Linkedin.tsx +23 -0
  235. package/src/icons/Loading.tsx +28 -0
  236. package/src/icons/Logout.tsx +33 -0
  237. package/src/icons/Mail.tsx +17 -0
  238. package/src/icons/MapMarker.tsx +26 -0
  239. package/src/icons/MenuHorizontal.tsx +29 -0
  240. package/src/icons/MenuVertical.tsx +29 -0
  241. package/src/icons/Message.tsx +23 -0
  242. package/src/icons/Microphone.tsx +23 -0
  243. package/src/icons/Minus.tsx +23 -0
  244. package/src/icons/MinusCircle.tsx +24 -0
  245. package/src/icons/PaperClip.tsx +23 -0
  246. package/src/icons/Picture.tsx +23 -0
  247. package/src/icons/Plus.tsx +18 -0
  248. package/src/icons/Preview.tsx +31 -0
  249. package/src/icons/Print.tsx +37 -0
  250. package/src/icons/QuestionHelp.tsx +34 -0
  251. package/src/icons/Refresh.tsx +30 -0
  252. package/src/icons/SelectIcon.tsx +28 -0
  253. package/src/icons/Send.tsx +17 -0
  254. package/src/icons/Setting.tsx +23 -0
  255. package/src/icons/Share.tsx +23 -0
  256. package/src/icons/Sound.tsx +23 -0
  257. package/src/icons/SoundDeactivated.tsx +27 -0
  258. package/src/icons/Telegram.tsx +26 -0
  259. package/src/icons/ThumbDown.tsx +29 -0
  260. package/src/icons/ThumbUp.tsx +29 -0
  261. package/src/icons/Translation.tsx +24 -0
  262. package/src/icons/Twitter.tsx +23 -0
  263. package/src/icons/Upload.tsx +34 -0
  264. package/src/icons/User.tsx +17 -0
  265. package/src/icons/Warning.tsx +27 -0
  266. package/src/icons/WhatsApp.tsx +24 -0
  267. package/src/icons/icons.stories.css +5 -0
  268. package/src/icons/icons.stories.tsx +110 -0
  269. package/src/icons/loading.css +14 -0
  270. package/src/index.ts +15 -0
  271. package/src/styles/utils.css +17 -0
  272. package/src/styles.css +4 -0
  273. package/src/theme/variables.css +110 -0
  274. package/src/vite-env.d.ts +6 -0
@@ -0,0 +1,199 @@
1
+ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
2
+
3
+ exports[`renders Expandable unchanged 1`] = `
4
+ <div>
5
+ <div
6
+ class="memori-expandable"
7
+ >
8
+ <div
9
+ class="memori-expandable--inner"
10
+ style="max-height: 9999px;"
11
+ >
12
+ Test
13
+ </div>
14
+ </div>
15
+ </div>
16
+ `;
17
+
18
+ exports[`renders Expandable with JSX markup unchanged 1`] = `
19
+ <div>
20
+ <div
21
+ class="memori-expandable"
22
+ >
23
+ <div
24
+ class="memori-expandable--inner"
25
+ style="max-height: 16px;"
26
+ >
27
+ <h1>
28
+ Lorem ipsum
29
+ </h1>
30
+ <p>
31
+ Suspendisse a sodales nulla, sed semper nisi.
32
+ </p>
33
+ <h2>
34
+ Suspendisse a sodales nulla, sed semper nisi.
35
+ </h2>
36
+ <p>
37
+ Suspendisse a sodales nulla, sed semper nisi.
38
+ </p>
39
+ <p>
40
+ Suspendisse a sodales nulla, sed semper nisi.
41
+ </p>
42
+ <button>
43
+ Dolor sit amet
44
+ </button>
45
+ <p>
46
+ Suspendisse a sodales nulla, sed semper nisi.
47
+ </p>
48
+ <p>
49
+ Suspendisse a sodales nulla, sed semper nisi.
50
+ </p>
51
+ </div>
52
+ <button
53
+ class="memori-button memori-button--ghost memori-button--rounded"
54
+ >
55
+ ...
56
+ </button>
57
+ </div>
58
+ </div>
59
+ `;
60
+
61
+ exports[`renders Expandable with custom button CSS class unchanged 1`] = `
62
+ <div>
63
+ <div
64
+ class="memori-expandable"
65
+ >
66
+ <div
67
+ class="memori-expandable--inner"
68
+ style="max-height: 16px;"
69
+ >
70
+ Suspendisse a sodales nulla, sed semper nisi. Suspendisse a sodales nulla, sed semper nisi. Suspendisse a sodales nulla, sed semper nisi. Suspendisse a sodales nulla, sed semper nisi. Suspendisse a sodales nulla, sed semper nisi.
71
+ </div>
72
+ <button
73
+ class="memori-button memori-button--ghost memori-button--rounded test"
74
+ >
75
+ ...
76
+ </button>
77
+ </div>
78
+ </div>
79
+ `;
80
+
81
+ exports[`renders Expandable with custom collapse symbol unchanged 1`] = `
82
+ <div>
83
+ <div
84
+ class="memori-expandable"
85
+ >
86
+ <div
87
+ class="memori-expandable--inner"
88
+ style="max-height: 9999px;"
89
+ >
90
+ Suspendisse a sodales nulla, sed semper nisi. Suspendisse a sodales nulla, sed semper nisi. Suspendisse a sodales nulla, sed semper nisi. Suspendisse a sodales nulla, sed semper nisi. Suspendisse a sodales nulla, sed semper nisi.
91
+ </div>
92
+ <button
93
+ class="memori-button memori-button--ghost memori-button--rounded"
94
+ >
95
+ test collapse
96
+ </button>
97
+ </div>
98
+ </div>
99
+ `;
100
+
101
+ exports[`renders Expandable with custom expand symbol unchanged 1`] = `
102
+ <div>
103
+ <div
104
+ class="memori-expandable"
105
+ >
106
+ <div
107
+ class="memori-expandable--inner"
108
+ style="max-height: 16px;"
109
+ >
110
+ Suspendisse a sodales nulla, sed semper nisi. Suspendisse a sodales nulla, sed semper nisi. Suspendisse a sodales nulla, sed semper nisi. Suspendisse a sodales nulla, sed semper nisi. Suspendisse a sodales nulla, sed semper nisi.
111
+ </div>
112
+ <button
113
+ class="memori-button memori-button--ghost memori-button--rounded"
114
+ >
115
+ test
116
+ </button>
117
+ </div>
118
+ </div>
119
+ `;
120
+
121
+ exports[`renders Expandable with custom inner CSS class unchanged 1`] = `
122
+ <div>
123
+ <div
124
+ class="memori-expandable"
125
+ >
126
+ <div
127
+ class="memori-expandable--inner test"
128
+ style="max-height: 16px;"
129
+ >
130
+ Suspendisse a sodales nulla, sed semper nisi. Suspendisse a sodales nulla, sed semper nisi. Suspendisse a sodales nulla, sed semper nisi. Suspendisse a sodales nulla, sed semper nisi. Suspendisse a sodales nulla, sed semper nisi.
131
+ </div>
132
+ <button
133
+ class="memori-button memori-button--ghost memori-button--rounded"
134
+ >
135
+ ...
136
+ </button>
137
+ </div>
138
+ </div>
139
+ `;
140
+
141
+ exports[`renders Expandable with custom wrapper CSS class unchanged 1`] = `
142
+ <div>
143
+ <div
144
+ class="memori-expandable test"
145
+ >
146
+ <div
147
+ class="memori-expandable--inner"
148
+ style="max-height: 16px;"
149
+ >
150
+ Suspendisse a sodales nulla, sed semper nisi. Suspendisse a sodales nulla, sed semper nisi. Suspendisse a sodales nulla, sed semper nisi. Suspendisse a sodales nulla, sed semper nisi. Suspendisse a sodales nulla, sed semper nisi.
151
+ </div>
152
+ <button
153
+ class="memori-button memori-button--ghost memori-button--rounded"
154
+ >
155
+ ...
156
+ </button>
157
+ </div>
158
+ </div>
159
+ `;
160
+
161
+ exports[`renders Expandable with long text unchanged 1`] = `
162
+ <div>
163
+ <div
164
+ class="memori-expandable"
165
+ >
166
+ <div
167
+ class="memori-expandable--inner"
168
+ style="max-height: 16px;"
169
+ >
170
+ Suspendisse a sodales nulla, sed semper nisi. Suspendisse a sodales nulla, sed semper nisi. Suspendisse a sodales nulla, sed semper nisi. Suspendisse a sodales nulla, sed semper nisi. Suspendisse a sodales nulla, sed semper nisi.
171
+ </div>
172
+ <button
173
+ class="memori-button memori-button--ghost memori-button--rounded"
174
+ >
175
+ ...
176
+ </button>
177
+ </div>
178
+ </div>
179
+ `;
180
+
181
+ exports[`renders Expandable with multiple rows unchanged 1`] = `
182
+ <div>
183
+ <div
184
+ class="memori-expandable"
185
+ >
186
+ <div
187
+ class="memori-expandable--inner"
188
+ style="max-height: 48px;"
189
+ >
190
+ Suspendisse a sodales nulla, sed semper nisi. Suspendisse a sodales nulla, sed semper nisi. Suspendisse a sodales nulla, sed semper nisi. Suspendisse a sodales nulla, sed semper nisi. Suspendisse a sodales nulla, sed semper nisi.
191
+ </div>
192
+ <button
193
+ class="memori-button memori-button--ghost memori-button--rounded"
194
+ >
195
+ ...
196
+ </button>
197
+ </div>
198
+ </div>
199
+ `;
@@ -0,0 +1,16 @@
1
+ export const MAX_MSG_CHARS = 4000
2
+ export const MAX_MSG_WORDS = 300
3
+
4
+ export const truncateMessage = (message: string) => {
5
+ let truncatedMessage = message
6
+ if (message.length > MAX_MSG_CHARS) {
7
+ truncatedMessage = `${message.slice(0, MAX_MSG_CHARS)}\n<br />...`
8
+ }
9
+ if (truncatedMessage.split(' ').length > MAX_MSG_WORDS) {
10
+ truncatedMessage = truncatedMessage
11
+ .split(' ')
12
+ .slice(0, MAX_MSG_WORDS)
13
+ .join(' ')
14
+ }
15
+ return truncatedMessage
16
+ }
@@ -0,0 +1,2 @@
1
+ import Expandable from './Expandable'
2
+ export { Expandable }
@@ -0,0 +1,237 @@
1
+ import React from 'react'
2
+ import type { Meta, StoryObj } from '@storybook/react-vite'
3
+ import { InputBase } from './InputBase'
4
+ import { fn } from 'storybook/test'
5
+
6
+ const meta = {
7
+ title: 'UI/InputBase',
8
+ component: InputBase,
9
+ tags: ['autodocs'],
10
+ argTypes: {
11
+ variant: {
12
+ control: {
13
+ type: 'select',
14
+ },
15
+ options: ['default', 'error', 'disabled'],
16
+ description: 'Input variant style',
17
+ },
18
+ size: {
19
+ control: {
20
+ type: 'select',
21
+ },
22
+ options: ['sm', 'md', 'lg'],
23
+ description: 'Input size',
24
+ },
25
+ fullWidth: {
26
+ control: {
27
+ type: 'boolean',
28
+ },
29
+ description: 'Whether the input should take full width',
30
+ },
31
+ disabled: {
32
+ control: {
33
+ type: 'boolean',
34
+ },
35
+ description: 'Whether the input is disabled',
36
+ },
37
+ placeholder: {
38
+ control: {
39
+ type: 'text',
40
+ },
41
+ description: 'Placeholder text',
42
+ },
43
+ value: {
44
+ control: {
45
+ type: 'text',
46
+ },
47
+ description: 'Input value (controlled)',
48
+ },
49
+ defaultValue: {
50
+ control: {
51
+ type: 'text',
52
+ },
53
+ description: 'Default value (uncontrolled)',
54
+ },
55
+ type: {
56
+ control: {
57
+ type: 'text',
58
+ },
59
+ description: 'Input type',
60
+ },
61
+ onValueChange: {
62
+ description: 'Callback fired when the value changes',
63
+ },
64
+ },
65
+ parameters: {
66
+ controls: { expanded: true },
67
+ },
68
+ args: {
69
+ onValueChange: fn(),
70
+ },
71
+ } satisfies Meta<typeof InputBase>
72
+
73
+ export default meta
74
+
75
+ type Story = StoryObj<typeof meta>
76
+
77
+ /**
78
+ * Default input variant with standard styling.
79
+ */
80
+ export const Default: Story = {
81
+ args: {
82
+ placeholder: 'Enter text...',
83
+ variant: 'default',
84
+ },
85
+ }
86
+
87
+ /**
88
+ * Error variant indicates validation errors.
89
+ */
90
+ export const Error: Story = {
91
+ args: {
92
+ placeholder: 'This field has an error',
93
+ variant: 'error',
94
+ defaultValue: 'Invalid input',
95
+ },
96
+ }
97
+
98
+ /**
99
+ * Disabled input state.
100
+ */
101
+ export const Disabled: Story = {
102
+ args: {
103
+ placeholder: 'Disabled input',
104
+ variant: 'disabled',
105
+ defaultValue: 'Cannot edit',
106
+ },
107
+ }
108
+
109
+ /**
110
+ * Small size input.
111
+ */
112
+ export const Small: Story = {
113
+ args: {
114
+ placeholder: 'Small input',
115
+ variant: 'default',
116
+ size: 'sm',
117
+ },
118
+ }
119
+
120
+ /**
121
+ * Medium size input (default).
122
+ */
123
+ export const Medium: Story = {
124
+ args: {
125
+ placeholder: 'Medium input',
126
+ variant: 'default',
127
+ size: 'md',
128
+ },
129
+ }
130
+
131
+ /**
132
+ * Large size input.
133
+ */
134
+ export const Large: Story = {
135
+ args: {
136
+ placeholder: 'Large input',
137
+ variant: 'default',
138
+ size: 'lg',
139
+ },
140
+ }
141
+
142
+ /**
143
+ * Full width input.
144
+ */
145
+ export const FullWidth: Story = {
146
+ args: {
147
+ placeholder: 'Full width input',
148
+ variant: 'default',
149
+ fullWidth: true,
150
+ },
151
+ }
152
+
153
+ /**
154
+ * Controlled input example.
155
+ */
156
+ export const Controlled: Story = {
157
+ render: () => {
158
+ const [value, setValue] = React.useState('')
159
+ return (
160
+ <InputBase
161
+ value={value}
162
+ onValueChange={setValue}
163
+ placeholder="Type something..."
164
+ />
165
+ )
166
+ },
167
+ }
168
+
169
+ /**
170
+ * Different input types.
171
+ */
172
+ export const InputTypes: Story = {
173
+ render: () => (
174
+ <div style={{ display: 'flex', flexDirection: 'column', gap: '16px' }}>
175
+ <InputBase
176
+ type="text"
177
+ placeholder="Text input"
178
+ />
179
+ <InputBase
180
+ type="email"
181
+ placeholder="Email input"
182
+ />
183
+ <InputBase
184
+ type="password"
185
+ placeholder="Password input"
186
+ />
187
+ <InputBase
188
+ type="number"
189
+ placeholder="Number input"
190
+ />
191
+ </div>
192
+ ),
193
+ }
194
+
195
+ /**
196
+ * All variants displayed together for comparison.
197
+ */
198
+ export const AllVariants: Story = {
199
+ render: () => (
200
+ <div style={{ display: 'flex', flexDirection: 'column', gap: '16px' }}>
201
+ <InputBase
202
+ placeholder="Default variant"
203
+ variant="default"
204
+ />
205
+ <InputBase
206
+ placeholder="Error variant"
207
+ variant="error"
208
+ />
209
+ <InputBase
210
+ placeholder="Disabled variant"
211
+ variant="disabled"
212
+ />
213
+ </div>
214
+ ),
215
+ }
216
+
217
+ /**
218
+ * All sizes displayed together for comparison.
219
+ */
220
+ export const AllSizes: Story = {
221
+ render: () => (
222
+ <div style={{ display: 'flex', flexDirection: 'column', gap: '16px' }}>
223
+ <InputBase
224
+ placeholder="Small input"
225
+ size="sm"
226
+ />
227
+ <InputBase
228
+ placeholder="Medium input"
229
+ size="md"
230
+ />
231
+ <InputBase
232
+ placeholder="Large input"
233
+ size="lg"
234
+ />
235
+ </div>
236
+ ),
237
+ }
@@ -0,0 +1,105 @@
1
+ import React from 'react'
2
+ import { Input as BaseInput } from '@base-ui/react/input'
3
+ import type { InputProps as BaseInputProps } from '@base-ui/react/input'
4
+ import cx from 'classnames'
5
+ import styles from './styles.module.css'
6
+
7
+ export interface InputBaseProps
8
+ extends Omit<BaseInputProps, 'className' | 'size'> {
9
+ /**
10
+ * Input variant
11
+ * @default 'default'
12
+ */
13
+ variant?: 'default' | 'error' | 'disabled'
14
+ /**
15
+ * Input size
16
+ * @default 'md'
17
+ */
18
+ size?: 'sm' | 'md' | 'lg'
19
+ /**
20
+ * Whether the input should take full width
21
+ */
22
+ fullWidth?: boolean
23
+ /**
24
+ * Additional CSS class name
25
+ */
26
+ className?: string
27
+ /**
28
+ * Placeholder text
29
+ */
30
+ placeholder?: string
31
+ /**
32
+ * Input value
33
+ */
34
+ value?: string
35
+ /**
36
+ * Default value for uncontrolled input
37
+ */
38
+ defaultValue?: string
39
+ /**
40
+ * Callback fired when the value changes
41
+ */
42
+ onValueChange?: (value: string) => void
43
+ /**
44
+ * Whether the input is disabled
45
+ */
46
+ disabled?: boolean
47
+ /**
48
+ * Input type
49
+ * @default 'text'
50
+ */
51
+ type?: string
52
+ }
53
+
54
+ export const InputBase = React.forwardRef<HTMLInputElement, InputBaseProps>(
55
+ (
56
+ {
57
+ variant = 'default',
58
+ size = 'md',
59
+ fullWidth = false,
60
+ className,
61
+ disabled,
62
+ ...props
63
+ },
64
+ ref,
65
+ ) => {
66
+ const isDisabled = disabled || variant === 'disabled'
67
+
68
+ const variantClass =
69
+ variant === 'error'
70
+ ? styles['input--error']
71
+ : variant === 'disabled'
72
+ ? styles['input--disabled']
73
+ : styles['input--default']
74
+
75
+ const sizeClass =
76
+ size === 'sm'
77
+ ? styles['input--sm']
78
+ : size === 'lg'
79
+ ? styles['input--lg']
80
+ : styles['input--md']
81
+
82
+ const fullWidthClass = fullWidth ? styles['input--full-width'] : undefined
83
+ const disabledClass = isDisabled ? styles['input--disabled'] : undefined
84
+
85
+ return (
86
+ <BaseInput
87
+ ref={ref}
88
+ disabled={isDisabled}
89
+ className={cx(
90
+ styles.input,
91
+ variantClass,
92
+ sizeClass,
93
+ fullWidthClass,
94
+ disabledClass,
95
+ className,
96
+ )}
97
+ {...props}
98
+ />
99
+ )
100
+ },
101
+ )
102
+
103
+ InputBase.displayName = 'InputBase'
104
+
105
+ export default InputBase
@@ -0,0 +1,3 @@
1
+ export { InputBase } from './InputBase'
2
+ export type { InputBaseProps } from './InputBase'
3
+ export { InputBase as default } from './InputBase'
@@ -0,0 +1,96 @@
1
+ .input {
2
+ display: inline-flex;
3
+ width: 100%;
4
+ box-sizing: border-box;
5
+ border: 1px solid var(--color-neutral-400);
6
+ border-radius: var(--border-radius-sm);
7
+ background-color: var(--color-neutral-white);
8
+ color: var(--color-neutral-800);
9
+ font-family: var(--typography-font-family-base);
10
+ font-weight: var(--typography-font-weight-regular);
11
+ line-height: var(--typography-line-height-normal);
12
+ outline: none;
13
+ transition: all 0.2s cubic-bezier(0.645, 0.045, 0.355, 1);
14
+ }
15
+
16
+ .input::placeholder {
17
+ color: var(--color-neutral-500);
18
+ }
19
+
20
+ .input:focus {
21
+ border-color: var(--color-primary-500);
22
+ box-shadow: 0 0 0 2px var(--color-primary-100);
23
+ }
24
+
25
+ /* ============================================
26
+ VARIANTS
27
+ ============================================ */
28
+
29
+ /* Default Variant */
30
+ .input--default {
31
+ border-color: var(--color-neutral-400);
32
+ }
33
+
34
+ .input--default:hover:not(:disabled) {
35
+ border-color: var(--color-neutral-600);
36
+ }
37
+
38
+ /* Error Variant */
39
+ .input--error {
40
+ border-color: var(--color-semantic-error-base);
41
+ background-color: var(--color-semantic-error-light);
42
+ }
43
+
44
+ .input--error:focus {
45
+ border-color: var(--color-semantic-error-base);
46
+ box-shadow: 0 0 0 2px var(--color-semantic-error-light);
47
+ }
48
+
49
+ .input--error::placeholder {
50
+ color: var(--color-semantic-error-dark);
51
+ }
52
+
53
+ /* Disabled Variant */
54
+ .input--disabled,
55
+ .input:disabled {
56
+ border-color: var(--color-neutral-400);
57
+ background-color: var(--color-neutral-200);
58
+ color: var(--color-neutral-500);
59
+ cursor: not-allowed;
60
+ opacity: 0.6;
61
+ }
62
+
63
+ .input--disabled::placeholder,
64
+ .input:disabled::placeholder {
65
+ color: var(--color-neutral-500);
66
+ }
67
+
68
+ /* ============================================
69
+ SIZES
70
+ ============================================ */
71
+
72
+ .input--sm {
73
+ min-height: 32px;
74
+ padding: var(--spacing-xs) var(--spacing-sm);
75
+ font-size: var(--typography-font-size-sm);
76
+ }
77
+
78
+ .input--md {
79
+ min-height: 40px;
80
+ padding: var(--spacing-sm) var(--spacing-md);
81
+ font-size: var(--typography-font-size-base);
82
+ }
83
+
84
+ .input--lg {
85
+ min-height: 48px;
86
+ padding: var(--spacing-md) var(--spacing-lg);
87
+ font-size: var(--typography-font-size-lg);
88
+ }
89
+
90
+ /* ============================================
91
+ STATES
92
+ ============================================ */
93
+
94
+ .input--full-width {
95
+ width: 100%;
96
+ }