@open-mercato/core 0.7.1-develop.7203.1.9396450b78 → 0.8.1-develop.7204.1.83330e271e

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 (416) hide show
  1. package/.turbo/turbo-build.log +1 -1
  2. package/build.mjs +11 -0
  3. package/dist/modules/catalog/backend/catalog/products/[id]/page.js +23 -0
  4. package/dist/modules/catalog/backend/catalog/products/[id]/page.js.map +2 -2
  5. package/dist/modules/customers/backend/customers/companies/[id]/page.js +2 -1
  6. package/dist/modules/customers/backend/customers/companies/[id]/page.js.map +2 -2
  7. package/dist/modules/customers/backend/customers/companies-v2/[id]/page.js +2 -1
  8. package/dist/modules/customers/backend/customers/companies-v2/[id]/page.js.map +2 -2
  9. package/dist/modules/customers/backend/customers/people/[id]/page.js +2 -2
  10. package/dist/modules/customers/backend/customers/people/[id]/page.js.map +2 -2
  11. package/dist/modules/customers/backend/customers/people-v2/[id]/page.js +2 -1
  12. package/dist/modules/customers/backend/customers/people-v2/[id]/page.js.map +2 -2
  13. package/dist/modules/customers/lib/detailHelpers.js +4 -0
  14. package/dist/modules/customers/lib/detailHelpers.js.map +2 -2
  15. package/dist/modules/customers/lib/todoCompatibility.js +5 -0
  16. package/dist/modules/customers/lib/todoCompatibility.js.map +2 -2
  17. package/dist/modules/design_system/backend/design-system/page.meta.js +3 -2
  18. package/dist/modules/design_system/backend/design-system/page.meta.js.map +2 -2
  19. package/dist/modules/design_system/gallery/assets/ai-prompt-image.png +0 -0
  20. package/dist/modules/design_system/gallery/assets/avatar-illustration.png +0 -0
  21. package/dist/modules/design_system/gallery/assets/avatar-memoji.png +0 -0
  22. package/dist/modules/design_system/gallery/assets/avatar-photo.png +0 -0
  23. package/dist/modules/design_system/gallery/assets/blog-photo-0.png +0 -0
  24. package/dist/modules/design_system/gallery/assets/contact-support-portrait.png +0 -0
  25. package/dist/modules/design_system/gallery/assets/crypto-ada.png +0 -0
  26. package/dist/modules/design_system/gallery/assets/crypto-avax.png +0 -0
  27. package/dist/modules/design_system/gallery/assets/crypto-bnb.png +0 -0
  28. package/dist/modules/design_system/gallery/assets/crypto-brand.png +0 -0
  29. package/dist/modules/design_system/gallery/assets/crypto-btc.png +0 -0
  30. package/dist/modules/design_system/gallery/assets/crypto-clock.svg +3 -0
  31. package/dist/modules/design_system/gallery/assets/crypto-crown.svg +3 -0
  32. package/dist/modules/design_system/gallery/assets/crypto-dot.png +0 -0
  33. package/dist/modules/design_system/gallery/assets/crypto-eth.png +0 -0
  34. package/dist/modules/design_system/gallery/assets/crypto-hbar.png +0 -0
  35. package/dist/modules/design_system/gallery/assets/crypto-history.svg +3 -0
  36. package/dist/modules/design_system/gallery/assets/crypto-link.svg +3 -0
  37. package/dist/modules/design_system/gallery/assets/crypto-menu.svg +3 -0
  38. package/dist/modules/design_system/gallery/assets/crypto-metamask.png +0 -0
  39. package/dist/modules/design_system/gallery/assets/crypto-more.svg +3 -0
  40. package/dist/modules/design_system/gallery/assets/crypto-phantom.png +0 -0
  41. package/dist/modules/design_system/gallery/assets/crypto-rewards.svg +3 -0
  42. package/dist/modules/design_system/gallery/assets/crypto-sad-face.png +0 -0
  43. package/dist/modules/design_system/gallery/assets/crypto-sol.png +0 -0
  44. package/dist/modules/design_system/gallery/assets/crypto-star.svg +3 -0
  45. package/dist/modules/design_system/gallery/assets/crypto-status-cancelled.svg +3 -0
  46. package/dist/modules/design_system/gallery/assets/crypto-status-pending.svg +3 -0
  47. package/dist/modules/design_system/gallery/assets/crypto-status-success.svg +3 -0
  48. package/dist/modules/design_system/gallery/assets/crypto-status-warning.svg +3 -0
  49. package/dist/modules/design_system/gallery/assets/crypto-trx.png +0 -0
  50. package/dist/modules/design_system/gallery/assets/crypto-usdc.png +0 -0
  51. package/dist/modules/design_system/gallery/assets/crypto-usdt.png +0 -0
  52. package/dist/modules/design_system/gallery/assets/crypto-walletconnect.png +0 -0
  53. package/dist/modules/design_system/gallery/assets/crypto-wei.png +0 -0
  54. package/dist/modules/design_system/gallery/assets/crypto-xrp.png +0 -0
  55. package/dist/modules/design_system/gallery/assets/cryptocurrency-artwork.js +67 -0
  56. package/dist/modules/design_system/gallery/assets/cryptocurrency-artwork.js.map +7 -0
  57. package/dist/modules/design_system/gallery/assets/github-logo.png +0 -0
  58. package/dist/modules/design_system/gallery/assets/images.d.js +1 -0
  59. package/dist/modules/design_system/gallery/assets/images.d.js.map +7 -0
  60. package/dist/modules/design_system/gallery/assets/input-european-union.svg +18 -0
  61. package/dist/modules/design_system/gallery/assets/landing-teams-01.png +0 -0
  62. package/dist/modules/design_system/gallery/assets/marketing-artwork.js +83 -0
  63. package/dist/modules/design_system/gallery/assets/marketing-artwork.js.map +7 -0
  64. package/dist/modules/design_system/gallery/assets/menu-apex.svg +18 -0
  65. package/dist/modules/design_system/gallery/assets/menu-mastercard.svg +7 -0
  66. package/dist/modules/design_system/gallery/assets/menu-spotify.svg +4 -0
  67. package/dist/modules/design_system/gallery/assets/menu-united-states.svg +16 -0
  68. package/dist/modules/design_system/gallery/assets/select-google.png +0 -0
  69. package/dist/modules/design_system/gallery/assets/select-poland.png +0 -0
  70. package/dist/modules/design_system/gallery/assets/selection-artwork.js +5 -0
  71. package/dist/modules/design_system/gallery/assets/selection-artwork.js.map +7 -0
  72. package/dist/modules/design_system/gallery/assets/social-apple-filled.svg +4 -0
  73. package/dist/modules/design_system/gallery/assets/social-apple-stroke.svg +4 -0
  74. package/dist/modules/design_system/gallery/assets/social-dropbox-filled.svg +5 -0
  75. package/dist/modules/design_system/gallery/assets/social-dropbox-stroke.svg +5 -0
  76. package/dist/modules/design_system/gallery/assets/social-facebook-filled.svg +4 -0
  77. package/dist/modules/design_system/gallery/assets/social-facebook-stroke.svg +10 -0
  78. package/dist/modules/design_system/gallery/assets/social-github-filled.svg +4 -0
  79. package/dist/modules/design_system/gallery/assets/social-github-stroke.svg +4 -0
  80. package/dist/modules/design_system/gallery/assets/social-google-filled.svg +7 -0
  81. package/dist/modules/design_system/gallery/assets/social-google-stroke.svg +7 -0
  82. package/dist/modules/design_system/gallery/assets/social-linkedin-filled.svg +4 -0
  83. package/dist/modules/design_system/gallery/assets/social-linkedin-stroke.svg +4 -0
  84. package/dist/modules/design_system/gallery/assets/social-x-filled.svg +4 -0
  85. package/dist/modules/design_system/gallery/assets/social-x-stroke.svg +4 -0
  86. package/dist/modules/design_system/gallery/assets/style-studio-product.png +0 -0
  87. package/dist/modules/design_system/gallery/assets/upload-images.js +8 -0
  88. package/dist/modules/design_system/gallery/assets/upload-images.js.map +7 -0
  89. package/dist/modules/design_system/gallery/components/BrandStylePreview.js +74 -0
  90. package/dist/modules/design_system/gallery/components/BrandStylePreview.js.map +7 -0
  91. package/dist/modules/design_system/gallery/components/CodeSnippet.js +31 -31
  92. package/dist/modules/design_system/gallery/components/CodeSnippet.js.map +2 -2
  93. package/dist/modules/design_system/gallery/components/ColorPlayground.js +408 -0
  94. package/dist/modules/design_system/gallery/components/ColorPlayground.js.map +7 -0
  95. package/dist/modules/design_system/gallery/components/ColorStudioCompositions.js +166 -0
  96. package/dist/modules/design_system/gallery/components/ColorStudioCompositions.js.map +7 -0
  97. package/dist/modules/design_system/gallery/components/ColorStudioSpecimen.js +182 -0
  98. package/dist/modules/design_system/gallery/components/ColorStudioSpecimen.js.map +7 -0
  99. package/dist/modules/design_system/gallery/components/CompactEntrySpecimen.js +80 -0
  100. package/dist/modules/design_system/gallery/components/CompactEntrySpecimen.js.map +7 -0
  101. package/dist/modules/design_system/gallery/components/ComponentIndex.js +42 -0
  102. package/dist/modules/design_system/gallery/components/ComponentIndex.js.map +7 -0
  103. package/dist/modules/design_system/gallery/components/DesignSystemHome.js +69 -0
  104. package/dist/modules/design_system/gallery/components/DesignSystemHome.js.map +7 -0
  105. package/dist/modules/design_system/gallery/components/EntryCard.js +47 -41
  106. package/dist/modules/design_system/gallery/components/EntryCard.js.map +2 -2
  107. package/dist/modules/design_system/gallery/components/EntryHeader.js +68 -0
  108. package/dist/modules/design_system/gallery/components/EntryHeader.js.map +7 -0
  109. package/dist/modules/design_system/gallery/components/FamilyEntryPreview.js +19 -0
  110. package/dist/modules/design_system/gallery/components/FamilyEntryPreview.js.map +7 -0
  111. package/dist/modules/design_system/gallery/components/FoundationGuide.js +46 -0
  112. package/dist/modules/design_system/gallery/components/FoundationGuide.js.map +7 -0
  113. package/dist/modules/design_system/gallery/components/GalleryLink.js +21 -0
  114. package/dist/modules/design_system/gallery/components/GalleryLink.js.map +7 -0
  115. package/dist/modules/design_system/gallery/components/GalleryNavigation.js +82 -0
  116. package/dist/modules/design_system/gallery/components/GalleryNavigation.js.map +7 -0
  117. package/dist/modules/design_system/gallery/components/GalleryShell.js +147 -67
  118. package/dist/modules/design_system/gallery/components/GalleryShell.js.map +3 -3
  119. package/dist/modules/design_system/gallery/components/IconsBrowser.js +33 -0
  120. package/dist/modules/design_system/gallery/components/IconsBrowser.js.map +7 -0
  121. package/dist/modules/design_system/gallery/components/SourceLibrary.js +93 -0
  122. package/dist/modules/design_system/gallery/components/SourceLibrary.js.map +7 -0
  123. package/dist/modules/design_system/gallery/components/StyleAgents.js +139 -0
  124. package/dist/modules/design_system/gallery/components/StyleAgents.js.map +7 -0
  125. package/dist/modules/design_system/gallery/components/ThemeTokenReference.js +101 -0
  126. package/dist/modules/design_system/gallery/components/ThemeTokenReference.js.map +7 -0
  127. package/dist/modules/design_system/gallery/components/VariantPreview.js +2 -2
  128. package/dist/modules/design_system/gallery/components/VariantPreview.js.map +2 -2
  129. package/dist/modules/design_system/gallery/components/colorPreview.js +58 -0
  130. package/dist/modules/design_system/gallery/components/colorPreview.js.map +7 -0
  131. package/dist/modules/design_system/gallery/components/colorStudio.js +218 -0
  132. package/dist/modules/design_system/gallery/components/colorStudio.js.map +7 -0
  133. package/dist/modules/design_system/gallery/components/styleAgentBranding.js +46 -0
  134. package/dist/modules/design_system/gallery/components/styleAgentBranding.js.map +7 -0
  135. package/dist/modules/design_system/gallery/components/themeTokens.js +32 -0
  136. package/dist/modules/design_system/gallery/components/themeTokens.js.map +7 -0
  137. package/dist/modules/design_system/gallery/demos/ai-product-code.generated.js +194 -0
  138. package/dist/modules/design_system/gallery/demos/ai-product-code.generated.js.map +7 -0
  139. package/dist/modules/design_system/gallery/demos/ai-product.js +423 -0
  140. package/dist/modules/design_system/gallery/demos/ai-product.js.map +7 -0
  141. package/dist/modules/design_system/gallery/demos/buttons.js +289 -0
  142. package/dist/modules/design_system/gallery/demos/buttons.js.map +7 -0
  143. package/dist/modules/design_system/gallery/demos/cryptocurrency.js +1708 -0
  144. package/dist/modules/design_system/gallery/demos/cryptocurrency.js.map +7 -0
  145. package/dist/modules/design_system/gallery/demos/feeds-code.generated.js +92 -0
  146. package/dist/modules/design_system/gallery/demos/feeds-code.generated.js.map +7 -0
  147. package/dist/modules/design_system/gallery/demos/feeds.js +148 -0
  148. package/dist/modules/design_system/gallery/demos/feeds.js.map +7 -0
  149. package/dist/modules/design_system/gallery/demos/file-upload.js +72 -0
  150. package/dist/modules/design_system/gallery/demos/file-upload.js.map +7 -0
  151. package/dist/modules/design_system/gallery/demos/foundation-reference-data.js +4875 -0
  152. package/dist/modules/design_system/gallery/demos/foundation-reference-data.js.map +7 -0
  153. package/dist/modules/design_system/gallery/demos/foundation-references.js +188 -0
  154. package/dist/modules/design_system/gallery/demos/foundation-references.js.map +7 -0
  155. package/dist/modules/design_system/gallery/demos/key-components-code.generated.js +6 -0
  156. package/dist/modules/design_system/gallery/demos/key-components-code.generated.js.map +7 -0
  157. package/dist/modules/design_system/gallery/demos/key-components.js +127 -0
  158. package/dist/modules/design_system/gallery/demos/key-components.js.map +7 -0
  159. package/dist/modules/design_system/gallery/demos/marketing-controls-code.generated.js +98 -0
  160. package/dist/modules/design_system/gallery/demos/marketing-controls-code.generated.js.map +7 -0
  161. package/dist/modules/design_system/gallery/demos/marketing-controls.js +134 -0
  162. package/dist/modules/design_system/gallery/demos/marketing-controls.js.map +7 -0
  163. package/dist/modules/design_system/gallery/demos/marketing-widgets-code.generated.js +195 -0
  164. package/dist/modules/design_system/gallery/demos/marketing-widgets-code.generated.js.map +7 -0
  165. package/dist/modules/design_system/gallery/demos/marketing-widgets.js +586 -0
  166. package/dist/modules/design_system/gallery/demos/marketing-widgets.js.map +7 -0
  167. package/dist/modules/design_system/gallery/demos/menu-fixtures.js +40 -0
  168. package/dist/modules/design_system/gallery/demos/menu-fixtures.js.map +7 -0
  169. package/dist/modules/design_system/gallery/demos/menu-sources.js +295 -0
  170. package/dist/modules/design_system/gallery/demos/menu-sources.js.map +7 -0
  171. package/dist/modules/design_system/gallery/demos/menus.js +150 -0
  172. package/dist/modules/design_system/gallery/demos/menus.js.map +7 -0
  173. package/dist/modules/design_system/gallery/demos/rating-reviews.js +53 -0
  174. package/dist/modules/design_system/gallery/demos/rating-reviews.js.map +7 -0
  175. package/dist/modules/design_system/gallery/demos/registered-icons.js +104 -0
  176. package/dist/modules/design_system/gallery/demos/registered-icons.js.map +7 -0
  177. package/dist/modules/design_system/gallery/demos/selection-cards.js +99 -0
  178. package/dist/modules/design_system/gallery/demos/selection-cards.js.map +7 -0
  179. package/dist/modules/design_system/gallery/demos/shell-code.generated.js +189 -0
  180. package/dist/modules/design_system/gallery/demos/shell-code.generated.js.map +7 -0
  181. package/dist/modules/design_system/gallery/demos/shell.js +330 -0
  182. package/dist/modules/design_system/gallery/demos/shell.js.map +7 -0
  183. package/dist/modules/design_system/gallery/demos/source-artwork.js +120 -0
  184. package/dist/modules/design_system/gallery/demos/source-artwork.js.map +7 -0
  185. package/dist/modules/design_system/gallery/demos/source-filters-code.generated.js +125 -0
  186. package/dist/modules/design_system/gallery/demos/source-filters-code.generated.js.map +7 -0
  187. package/dist/modules/design_system/gallery/demos/source-filters.js +185 -0
  188. package/dist/modules/design_system/gallery/demos/source-filters.js.map +7 -0
  189. package/dist/modules/design_system/gallery/demos/source-icons.js +69 -0
  190. package/dist/modules/design_system/gallery/demos/source-icons.js.map +7 -0
  191. package/dist/modules/design_system/gallery/demos/table-cells-code.generated.js +150 -0
  192. package/dist/modules/design_system/gallery/demos/table-cells-code.generated.js.map +7 -0
  193. package/dist/modules/design_system/gallery/demos/table-cells.js +181 -0
  194. package/dist/modules/design_system/gallery/demos/table-cells.js.map +7 -0
  195. package/dist/modules/design_system/gallery/demos/text-inputs.js +113 -0
  196. package/dist/modules/design_system/gallery/demos/text-inputs.js.map +7 -0
  197. package/dist/modules/design_system/gallery/demos/time-picker-code.generated.js +41 -0
  198. package/dist/modules/design_system/gallery/demos/time-picker-code.generated.js.map +7 -0
  199. package/dist/modules/design_system/gallery/demos/time-picker.js +41 -0
  200. package/dist/modules/design_system/gallery/demos/time-picker.js.map +7 -0
  201. package/dist/modules/design_system/gallery/entries/banners.js +123 -60
  202. package/dist/modules/design_system/gallery/entries/banners.js.map +2 -2
  203. package/dist/modules/design_system/gallery/entries/buttons-snippets.js +433 -0
  204. package/dist/modules/design_system/gallery/entries/buttons-snippets.js.map +7 -0
  205. package/dist/modules/design_system/gallery/entries/buttons.js +127 -148
  206. package/dist/modules/design_system/gallery/entries/buttons.js.map +2 -2
  207. package/dist/modules/design_system/gallery/entries/charts.js +532 -186
  208. package/dist/modules/design_system/gallery/entries/charts.js.map +2 -2
  209. package/dist/modules/design_system/gallery/entries/dates.js +191 -3
  210. package/dist/modules/design_system/gallery/entries/dates.js.map +2 -2
  211. package/dist/modules/design_system/gallery/entries/detail.js +118 -77
  212. package/dist/modules/design_system/gallery/entries/detail.js.map +2 -2
  213. package/dist/modules/design_system/gallery/entries/display.js +1449 -240
  214. package/dist/modules/design_system/gallery/entries/display.js.map +2 -2
  215. package/dist/modules/design_system/gallery/entries/feedback.js +1058 -132
  216. package/dist/modules/design_system/gallery/entries/feedback.js.map +2 -2
  217. package/dist/modules/design_system/gallery/entries/filters.js +231 -103
  218. package/dist/modules/design_system/gallery/entries/filters.js.map +2 -2
  219. package/dist/modules/design_system/gallery/entries/foundations.js +368 -57
  220. package/dist/modules/design_system/gallery/entries/foundations.js.map +2 -2
  221. package/dist/modules/design_system/gallery/entries/icons.js +29 -91
  222. package/dist/modules/design_system/gallery/entries/icons.js.map +2 -2
  223. package/dist/modules/design_system/gallery/entries/inputs-snippets.js +154 -0
  224. package/dist/modules/design_system/gallery/entries/inputs-snippets.js.map +7 -0
  225. package/dist/modules/design_system/gallery/entries/inputs.js +2043 -306
  226. package/dist/modules/design_system/gallery/entries/inputs.js.map +2 -2
  227. package/dist/modules/design_system/gallery/entries/library.js +20 -0
  228. package/dist/modules/design_system/gallery/entries/library.js.map +7 -0
  229. package/dist/modules/design_system/gallery/entries/messages.js +121 -103
  230. package/dist/modules/design_system/gallery/entries/messages.js.map +2 -2
  231. package/dist/modules/design_system/gallery/entries/navigation.js +676 -103
  232. package/dist/modules/design_system/gallery/entries/navigation.js.map +2 -2
  233. package/dist/modules/design_system/gallery/entries/notifications.js +131 -78
  234. package/dist/modules/design_system/gallery/entries/notifications.js.map +2 -2
  235. package/dist/modules/design_system/gallery/entries/overlays.js +611 -203
  236. package/dist/modules/design_system/gallery/entries/overlays.js.map +2 -2
  237. package/dist/modules/design_system/gallery/entries/scaffolding.js +1175 -120
  238. package/dist/modules/design_system/gallery/entries/scaffolding.js.map +2 -2
  239. package/dist/modules/design_system/gallery/entries/schedule.js +79 -54
  240. package/dist/modules/design_system/gallery/entries/schedule.js.map +2 -2
  241. package/dist/modules/design_system/gallery/presentation.js +108 -0
  242. package/dist/modules/design_system/gallery/presentation.js.map +7 -0
  243. package/dist/modules/design_system/gallery/registry.js +8 -5
  244. package/dist/modules/design_system/gallery/registry.js.map +2 -2
  245. package/dist/modules/design_system/gallery/source-library.generated.js +5 -0
  246. package/dist/modules/design_system/gallery/source-library.generated.js.map +7 -0
  247. package/dist/modules/design_system/i18n/de.json +7167 -0
  248. package/dist/modules/design_system/i18n/en.json +7167 -0
  249. package/dist/modules/design_system/i18n/es.json +7167 -0
  250. package/dist/modules/design_system/i18n/ko.json +7167 -0
  251. package/dist/modules/design_system/i18n/pl.json +7167 -0
  252. package/dist/modules/push_notifications/lib/queue.js +1 -31
  253. package/dist/modules/push_notifications/lib/queue.js.map +2 -2
  254. package/jest.config.cjs +1 -0
  255. package/jest.mocks/image.js +1 -0
  256. package/package.json +8 -8
  257. package/src/modules/catalog/backend/catalog/products/[id]/page.tsx +50 -0
  258. package/src/modules/customers/backend/customers/companies/[id]/page.tsx +2 -1
  259. package/src/modules/customers/backend/customers/companies-v2/[id]/page.tsx +2 -1
  260. package/src/modules/customers/backend/customers/people/[id]/page.tsx +2 -2
  261. package/src/modules/customers/backend/customers/people-v2/[id]/page.tsx +2 -1
  262. package/src/modules/customers/lib/detailHelpers.ts +4 -0
  263. package/src/modules/customers/lib/todoCompatibility.ts +10 -0
  264. package/src/modules/design_system/backend/design-system/page.meta.ts +3 -2
  265. package/src/modules/design_system/gallery/assets/README.md +30 -0
  266. package/src/modules/design_system/gallery/assets/ai-prompt-image.png +0 -0
  267. package/src/modules/design_system/gallery/assets/avatar-illustration.png +0 -0
  268. package/src/modules/design_system/gallery/assets/avatar-memoji.png +0 -0
  269. package/src/modules/design_system/gallery/assets/avatar-photo.png +0 -0
  270. package/src/modules/design_system/gallery/assets/blog-photo-0.png +0 -0
  271. package/src/modules/design_system/gallery/assets/contact-support-portrait.png +0 -0
  272. package/src/modules/design_system/gallery/assets/crypto-ada.png +0 -0
  273. package/src/modules/design_system/gallery/assets/crypto-avax.png +0 -0
  274. package/src/modules/design_system/gallery/assets/crypto-bnb.png +0 -0
  275. package/src/modules/design_system/gallery/assets/crypto-brand.png +0 -0
  276. package/src/modules/design_system/gallery/assets/crypto-btc.png +0 -0
  277. package/src/modules/design_system/gallery/assets/crypto-clock.svg +3 -0
  278. package/src/modules/design_system/gallery/assets/crypto-crown.svg +3 -0
  279. package/src/modules/design_system/gallery/assets/crypto-dot.png +0 -0
  280. package/src/modules/design_system/gallery/assets/crypto-eth.png +0 -0
  281. package/src/modules/design_system/gallery/assets/crypto-hbar.png +0 -0
  282. package/src/modules/design_system/gallery/assets/crypto-history.svg +3 -0
  283. package/src/modules/design_system/gallery/assets/crypto-link.svg +3 -0
  284. package/src/modules/design_system/gallery/assets/crypto-menu.svg +3 -0
  285. package/src/modules/design_system/gallery/assets/crypto-metamask.png +0 -0
  286. package/src/modules/design_system/gallery/assets/crypto-more.svg +3 -0
  287. package/src/modules/design_system/gallery/assets/crypto-phantom.png +0 -0
  288. package/src/modules/design_system/gallery/assets/crypto-rewards.svg +3 -0
  289. package/src/modules/design_system/gallery/assets/crypto-sad-face.png +0 -0
  290. package/src/modules/design_system/gallery/assets/crypto-sol.png +0 -0
  291. package/src/modules/design_system/gallery/assets/crypto-star.svg +3 -0
  292. package/src/modules/design_system/gallery/assets/crypto-status-cancelled.svg +3 -0
  293. package/src/modules/design_system/gallery/assets/crypto-status-pending.svg +3 -0
  294. package/src/modules/design_system/gallery/assets/crypto-status-success.svg +3 -0
  295. package/src/modules/design_system/gallery/assets/crypto-status-warning.svg +3 -0
  296. package/src/modules/design_system/gallery/assets/crypto-trx.png +0 -0
  297. package/src/modules/design_system/gallery/assets/crypto-usdc.png +0 -0
  298. package/src/modules/design_system/gallery/assets/crypto-usdt.png +0 -0
  299. package/src/modules/design_system/gallery/assets/crypto-walletconnect.png +0 -0
  300. package/src/modules/design_system/gallery/assets/crypto-wei.png +0 -0
  301. package/src/modules/design_system/gallery/assets/crypto-xrp.png +0 -0
  302. package/src/modules/design_system/gallery/assets/cryptocurrency-artwork.ts +63 -0
  303. package/src/modules/design_system/gallery/assets/github-logo.png +0 -0
  304. package/src/modules/design_system/gallery/assets/images.d.ts +9 -0
  305. package/src/modules/design_system/gallery/assets/input-european-union.svg +18 -0
  306. package/src/modules/design_system/gallery/assets/landing-teams-01.png +0 -0
  307. package/src/modules/design_system/gallery/assets/marketing-artwork.ts +79 -0
  308. package/src/modules/design_system/gallery/assets/menu-apex.svg +18 -0
  309. package/src/modules/design_system/gallery/assets/menu-mastercard.svg +7 -0
  310. package/src/modules/design_system/gallery/assets/menu-spotify.svg +4 -0
  311. package/src/modules/design_system/gallery/assets/menu-united-states.svg +16 -0
  312. package/src/modules/design_system/gallery/assets/select-google.png +0 -0
  313. package/src/modules/design_system/gallery/assets/select-poland.png +0 -0
  314. package/src/modules/design_system/gallery/assets/selection-artwork.ts +1 -0
  315. package/src/modules/design_system/gallery/assets/social-apple-filled.svg +4 -0
  316. package/src/modules/design_system/gallery/assets/social-apple-stroke.svg +4 -0
  317. package/src/modules/design_system/gallery/assets/social-dropbox-filled.svg +5 -0
  318. package/src/modules/design_system/gallery/assets/social-dropbox-stroke.svg +5 -0
  319. package/src/modules/design_system/gallery/assets/social-facebook-filled.svg +4 -0
  320. package/src/modules/design_system/gallery/assets/social-facebook-stroke.svg +10 -0
  321. package/src/modules/design_system/gallery/assets/social-github-filled.svg +4 -0
  322. package/src/modules/design_system/gallery/assets/social-github-stroke.svg +4 -0
  323. package/src/modules/design_system/gallery/assets/social-google-filled.svg +7 -0
  324. package/src/modules/design_system/gallery/assets/social-google-stroke.svg +7 -0
  325. package/src/modules/design_system/gallery/assets/social-linkedin-filled.svg +4 -0
  326. package/src/modules/design_system/gallery/assets/social-linkedin-stroke.svg +4 -0
  327. package/src/modules/design_system/gallery/assets/social-x-filled.svg +4 -0
  328. package/src/modules/design_system/gallery/assets/social-x-stroke.svg +4 -0
  329. package/src/modules/design_system/gallery/assets/style-studio-product.png +0 -0
  330. package/src/modules/design_system/gallery/assets/upload-images.ts +5 -0
  331. package/src/modules/design_system/gallery/components/BrandStylePreview.tsx +94 -0
  332. package/src/modules/design_system/gallery/components/CodeSnippet.tsx +34 -34
  333. package/src/modules/design_system/gallery/components/ColorPlayground.tsx +324 -0
  334. package/src/modules/design_system/gallery/components/ColorStudioCompositions.tsx +96 -0
  335. package/src/modules/design_system/gallery/components/ColorStudioSpecimen.tsx +164 -0
  336. package/src/modules/design_system/gallery/components/CompactEntrySpecimen.tsx +65 -0
  337. package/src/modules/design_system/gallery/components/ComponentIndex.tsx +47 -0
  338. package/src/modules/design_system/gallery/components/DesignSystemHome.tsx +66 -0
  339. package/src/modules/design_system/gallery/components/EntryCard.tsx +52 -37
  340. package/src/modules/design_system/gallery/components/EntryHeader.tsx +80 -0
  341. package/src/modules/design_system/gallery/components/FamilyEntryPreview.tsx +22 -0
  342. package/src/modules/design_system/gallery/components/FoundationGuide.tsx +43 -0
  343. package/src/modules/design_system/gallery/components/GalleryLink.tsx +19 -0
  344. package/src/modules/design_system/gallery/components/GalleryNavigation.tsx +86 -0
  345. package/src/modules/design_system/gallery/components/GalleryShell.tsx +149 -63
  346. package/src/modules/design_system/gallery/components/IconsBrowser.tsx +40 -0
  347. package/src/modules/design_system/gallery/components/SourceLibrary.tsx +90 -0
  348. package/src/modules/design_system/gallery/components/StyleAgents.tsx +115 -0
  349. package/src/modules/design_system/gallery/components/ThemeTokenReference.tsx +76 -0
  350. package/src/modules/design_system/gallery/components/VariantPreview.tsx +2 -2
  351. package/src/modules/design_system/gallery/components/colorPreview.ts +63 -0
  352. package/src/modules/design_system/gallery/components/colorStudio.ts +260 -0
  353. package/src/modules/design_system/gallery/components/styleAgentBranding.ts +42 -0
  354. package/src/modules/design_system/gallery/components/themeTokens.ts +26 -0
  355. package/src/modules/design_system/gallery/demos/ai-product-code.generated.ts +3 -0
  356. package/src/modules/design_system/gallery/demos/ai-product.tsx +188 -0
  357. package/src/modules/design_system/gallery/demos/buttons.tsx +331 -0
  358. package/src/modules/design_system/gallery/demos/cryptocurrency.tsx +1943 -0
  359. package/src/modules/design_system/gallery/demos/feeds-code.generated.ts +4 -0
  360. package/src/modules/design_system/gallery/demos/feeds.tsx +82 -0
  361. package/src/modules/design_system/gallery/demos/file-upload.tsx +61 -0
  362. package/src/modules/design_system/gallery/demos/foundation-reference-data.ts +4872 -0
  363. package/src/modules/design_system/gallery/demos/foundation-references.tsx +140 -0
  364. package/src/modules/design_system/gallery/demos/key-components-code.generated.ts +3 -0
  365. package/src/modules/design_system/gallery/demos/key-components.tsx +106 -0
  366. package/src/modules/design_system/gallery/demos/marketing-controls-code.generated.ts +3 -0
  367. package/src/modules/design_system/gallery/demos/marketing-controls.tsx +92 -0
  368. package/src/modules/design_system/gallery/demos/marketing-widgets-code.generated.ts +3 -0
  369. package/src/modules/design_system/gallery/demos/marketing-widgets.tsx +189 -0
  370. package/src/modules/design_system/gallery/demos/menu-fixtures.tsx +48 -0
  371. package/src/modules/design_system/gallery/demos/menu-sources.ts +5 -0
  372. package/src/modules/design_system/gallery/demos/menus.tsx +122 -0
  373. package/src/modules/design_system/gallery/demos/rating-reviews.tsx +44 -0
  374. package/src/modules/design_system/gallery/demos/registered-icons.tsx +117 -0
  375. package/src/modules/design_system/gallery/demos/selection-cards.tsx +97 -0
  376. package/src/modules/design_system/gallery/demos/shell-code.generated.ts +3 -0
  377. package/src/modules/design_system/gallery/demos/shell.tsx +183 -0
  378. package/src/modules/design_system/gallery/demos/source-artwork.tsx +88 -0
  379. package/src/modules/design_system/gallery/demos/source-filters-code.generated.ts +3 -0
  380. package/src/modules/design_system/gallery/demos/source-filters.tsx +119 -0
  381. package/src/modules/design_system/gallery/demos/source-icons.tsx +62 -0
  382. package/src/modules/design_system/gallery/demos/table-cells-code.generated.ts +3 -0
  383. package/src/modules/design_system/gallery/demos/table-cells.tsx +144 -0
  384. package/src/modules/design_system/gallery/demos/text-inputs.tsx +90 -0
  385. package/src/modules/design_system/gallery/demos/time-picker-code.generated.ts +5 -0
  386. package/src/modules/design_system/gallery/demos/time-picker.tsx +31 -0
  387. package/src/modules/design_system/gallery/entries/banners.tsx +143 -94
  388. package/src/modules/design_system/gallery/entries/buttons-snippets.ts +432 -0
  389. package/src/modules/design_system/gallery/entries/buttons.tsx +125 -196
  390. package/src/modules/design_system/gallery/entries/charts.tsx +545 -233
  391. package/src/modules/design_system/gallery/entries/dates.tsx +171 -3
  392. package/src/modules/design_system/gallery/entries/detail.tsx +142 -115
  393. package/src/modules/design_system/gallery/entries/display.tsx +1691 -319
  394. package/src/modules/design_system/gallery/entries/feedback.tsx +1082 -169
  395. package/src/modules/design_system/gallery/entries/filters.tsx +238 -143
  396. package/src/modules/design_system/gallery/entries/foundations.tsx +404 -61
  397. package/src/modules/design_system/gallery/entries/icons.tsx +31 -117
  398. package/src/modules/design_system/gallery/entries/inputs-snippets.ts +156 -0
  399. package/src/modules/design_system/gallery/entries/inputs.tsx +2146 -503
  400. package/src/modules/design_system/gallery/entries/library.tsx +16 -0
  401. package/src/modules/design_system/gallery/entries/messages.tsx +114 -106
  402. package/src/modules/design_system/gallery/entries/navigation.tsx +782 -192
  403. package/src/modules/design_system/gallery/entries/notifications.tsx +145 -120
  404. package/src/modules/design_system/gallery/entries/overlays.tsx +696 -280
  405. package/src/modules/design_system/gallery/entries/scaffolding.tsx +1192 -158
  406. package/src/modules/design_system/gallery/entries/schedule.tsx +72 -58
  407. package/src/modules/design_system/gallery/presentation.ts +106 -0
  408. package/src/modules/design_system/gallery/registry.ts +8 -6
  409. package/src/modules/design_system/gallery/source-library.generated.ts +2 -0
  410. package/src/modules/design_system/i18n/de.json +7112 -3
  411. package/src/modules/design_system/i18n/en.json +7112 -3
  412. package/src/modules/design_system/i18n/es.json +7112 -3
  413. package/src/modules/design_system/i18n/ko.json +7112 -3
  414. package/src/modules/design_system/i18n/pl.json +7112 -3
  415. package/src/modules/push_notifications/AGENTS.md +9 -5
  416. package/src/modules/push_notifications/lib/queue.ts +15 -44
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../src/modules/design_system/gallery/demos/ai-product-code.generated.ts"],
4
+ "sourcesContent": ["// Generated by yarn storybook:generate from ai-product.tsx.\nconst source = \"import * as React from 'react'\\nimport { ArrowLeft, BookOpen, ChevronDown, ChevronRight, Folder, Mail, Menu, MoreHorizontal, MoreVertical, PanelLeft, Plus, Search, User, X, Zap } from 'lucide-react'\\nimport { useT } from '@open-mercato/shared/lib/i18n/context'\\nimport { cn } from '@open-mercato/shared/lib/utils'\\nimport { Button } from '@open-mercato/ui/primitives/button'\\nimport { Input } from '@open-mercato/ui/primitives/input'\\nimport { SearchInput } from '@open-mercato/ui/primitives/search-input'\\nimport { FieldLabel } from '@open-mercato/ui/primitives/label'\\nimport { HintText } from '@open-mercato/ui/primitives/hint-text'\\nimport { KeyIconGlyph } from '@open-mercato/ui/primitives/key-icon'\\nimport { DigitInput } from '@open-mercato/ui/primitives/digit-input'\\nimport { CounterInput } from '@open-mercato/ui/primitives/counter-input'\\nimport { Select, SelectTrigger, SelectContent, SelectItem, SelectValue } from '@open-mercato/ui/primitives/select'\\nimport { Popover, PopoverTrigger, PopoverContent } from '@open-mercato/ui/primitives/popover'\\nimport { CheckboxField } from '@open-mercato/ui/primitives/checkbox-field'\\nimport { SocialButton } from '@open-mercato/ui/primitives/social-button'\\nimport { Avatar } from '@open-mercato/ui/primitives/avatar'\\nimport { Badge } from '@open-mercato/ui/primitives/badge'\\nimport { Sidebar } from '@open-mercato/ui/primitives/sidebar'\\nimport { PromptArea } from '@open-mercato/ui/primitives/prompt-area'\\nimport { FileFormatIcon } from '@open-mercato/ui/primitives/file-format-icon'\\nimport { aiProductArtwork } from '@open-mercato/ui/assets/ai-product-artwork'\\nimport promptImage from '../assets/ai-prompt-image.png'\\nimport avatarPhoto from '../assets/avatar-photo.png'\\nimport googleIcon from '../assets/select-google.png'\\n\\ntype ButtonProps = React.ComponentProps<typeof Button>\\n\\nconst prefix = 'design_system.gallery.examples.aiProduct.'\\nconst source = (asset: string | { readonly src: string }) => typeof asset === 'string' ? asset : asset.src\\n\\nfunction AiIconButton({ size = 32, tone = 'default', appearance = 'plain', className, children, ...props }: Omit<ButtonProps, 'size'> & { size?: 20 | 24 | 28 | 32; tone?: 'default' | 'error'; appearance?: 'plain' | 'stroke' | 'lighter' }) {\\n const content = React.isValidElement<{ className?: string }>(children) && children.type !== 'img'\\n ? React.cloneElement(children, { className: cn(children.props.className, size === 24 ? 'size-4.5' : 'size-5') })\\n : children\\n return <Button type=\\\"button\\\" variant=\\\"ghost\\\" size=\\\"icon\\\" data-slot=\\\"ai-icon-button\\\" data-size={size} data-tone={tone} data-appearance={appearance} className={cn(\\n 'shrink-0 p-0',\\n size === 32 ? 'size-8 rounded-md' : size === 28 ? 'size-7 rounded-md' : size === 24 ? 'size-6 rounded-sm' : 'size-5 rounded-sm',\\n appearance !== 'plain' && 'rounded-ai-control',\\n appearance === 'stroke' ? 'bg-background shadow-xs ring-1 ring-inset ring-border' : appearance === 'lighter' ? 'bg-muted' : 'bg-background',\\n tone === 'error' ? 'text-status-error-text hover:bg-status-error-bg hover:text-status-error-text aria-pressed:bg-status-error-bg aria-pressed:text-status-error-text' : 'text-muted-foreground hover:bg-muted hover:text-foreground aria-pressed:bg-muted aria-pressed:text-foreground',\\n appearance !== 'plain' && 'aria-pressed:bg-primary aria-pressed:text-primary-foreground',\\n className,\\n )} {...props}>{content}</Button>\\n}\\n\\nfunction AiModelSelect({ value, onChange, compact = false, className }: { value: string; onChange: (value: string) => void; compact?: boolean; className?: string }) {\\n const t = useT()\\n return <Select value={value} onValueChange={onChange}><SelectTrigger aria-label={t(`${prefix}model`)} data-slot=\\\"ai-model-select\\\" className={cn('h-7 w-auto min-w-19.75 gap-1 rounded-ai-control border-0 bg-muted py-1 pl-2 pr-1 text-sm leading-5 shadow-none hover:bg-accent [&>svg]:size-5', compact && 'h-5 bg-transparent p-0', className)}><SelectValue /></SelectTrigger><SelectContent>{['GPT-4', 'GPT-3.5'].map(model => <SelectItem key={model} value={model}>{model}</SelectItem>)}</SelectContent></Select>\\n}\\n\\ntype PromptAttachment = { id: string; name: string; image?: string; objectUrl?: boolean }\\n\\nexport function AiPromptExample({ compact = false, attachment = 'none' }: { compact?: boolean; attachment?: 'none' | 'file' | 'image' }) {\\n const t = useT()\\n const [value, setValue] = React.useState('')\\n const [model, setModel] = React.useState('GPT-4')\\n const [lastPrompt, setLastPrompt] = React.useState('')\\n const [files, setFiles] = React.useState<PromptAttachment[]>(attachment === 'none' ? [] : [{ id: 'source', name: t(`${prefix}${attachment === 'image' ? 'imageName' : 'fileName'}`), image: attachment === 'image' ? source(promptImage) : undefined }])\\n const upload = React.useRef<HTMLInputElement>(null)\\n const attachmentId = React.useRef(0)\\n const objectUrls = React.useRef(new Set<string>())\\n React.useEffect(() => () => { for (const url of objectUrls.current) URL.revokeObjectURL(url) }, [])\\n const remove = (id: string) => setFiles(current => current.filter(file => {\\n if (file.id !== id) return true\\n if (file.objectUrl && file.image) { URL.revokeObjectURL(file.image); objectUrls.current.delete(file.image) }\\n return false\\n }))\\n const submit = (message: string) => { setLastPrompt(`${model}: ${message}`); setValue('') }\\n return <div className={cn('grid max-w-full gap-4', compact ? 'w-93.5' : 'w-175')}>\\n <PromptArea compact={compact} value={value} onValueChange={setValue} onSubmit={submit} inputLabel={t(`${prefix}prompt`)} submitLabel={t(`${prefix}saveDraft`)} placeholder={t(`${prefix}placeholder`)} information={<><Zap aria-hidden=\\\"true\\\" className=\\\"size-4 shrink-0\\\" /><span>{t(`${prefix}premium`)}</span><span aria-hidden=\\\"true\\\">\u00B7</span><Popover><PopoverTrigger asChild><Button type=\\\"button\\\" variant=\\\"ghost\\\" className=\\\"h-4 rounded-sm p-0 text-xs font-medium leading-4\\\">{t(`${prefix}upgrade`)}</Button></PopoverTrigger><PopoverContent className=\\\"text-sm\\\">{t(`${prefix}localOnly`)}</PopoverContent></Popover></>}\\n toolbar={<><AiIconButton size={28} appearance=\\\"lighter\\\" aria-label={t(`${prefix}addFile`)} onClick={() => upload.current?.click()}><Plus aria-hidden=\\\"true\\\" /></AiIconButton><AiModelSelect value={model} onChange={setModel} /></>}\\n attachments={files.length ? files.map(file => file.image ? <div key={file.id} className=\\\"relative size-24 shrink-0\\\"><img src={file.image} alt={file.name} className=\\\"size-24 rounded-xl object-cover\\\" /><AiIconButton size={20} aria-label={`${t(`${prefix}remove`)} ${file.name}`} className=\\\"absolute right-1.5 top-1.5 rounded-full bg-primary text-primary-foreground hover:bg-primary-hover hover:text-primary-foreground\\\" onClick={() => remove(file.id)}><X aria-hidden=\\\"true\\\" /></AiIconButton></div> : <div key={file.id} className=\\\"flex h-15 max-w-full items-center gap-3 rounded-xl bg-muted py-2.5 pl-3 pr-4\\\"><FileFormatIcon format={file.name.includes('.') ? file.name.split('.').pop()?.toUpperCase().slice(0, 5) ?? 'FILE' : 'FILE'} /><div className=\\\"grid min-w-0 gap-1\\\"><span className=\\\"truncate text-sm font-medium\\\">{file.name}</span><span className=\\\"text-xs text-muted-foreground\\\">{t(`${prefix}localFile`)}</span></div><AiIconButton size={20} aria-label={`${t(`${prefix}remove`)} ${file.name}`} onClick={() => remove(file.id)}><X aria-hidden=\\\"true\\\" /></AiIconButton></div>) : undefined} />\\n <input ref={upload} type=\\\"file\\\" className=\\\"sr-only\\\" tabIndex={-1} aria-label={t(`${prefix}attachmentInput`)} multiple onChange={event => { const selected = Array.from(event.target.files ?? []); setFiles(current => [...current, ...selected.map(file => { const image = file.type.startsWith('image/') ? URL.createObjectURL(file) : undefined; if (image) objectUrls.current.add(image); return { id: `attachment-${attachmentId.current++}`, name: file.name, image, objectUrl: Boolean(image) } })]); event.target.value = '' }} />\\n <p className=\\\"text-xs leading-4 text-muted-foreground\\\">{t(`${prefix}localOnly`)}</p>\\n {lastPrompt ? <output className=\\\"rounded-md border border-border p-3 text-sm\\\">{t(`${prefix}saved`)} {lastPrompt}</output> : null}\\n </div>\\n}\\n\\nexport function AiIconButtonExamples({ chat = false }: { chat?: boolean }) {\\n const t = useT()\\n const [active, setActive] = React.useState<string[]>([])\\n const toggle = (key: string) => setActive(items => items.includes(key) ? items.filter(item => item !== key) : [...items, key])\\n return <div className=\\\"grid gap-5\\\">{chat ? <div className=\\\"flex gap-5\\\">{(['stroke', 'lighter'] as const).map(appearance => <AiIconButton key={appearance} size={28} appearance={appearance} aria-label={`${t(`${prefix}toggleControl`)} ${appearance}`} aria-pressed={active.includes(appearance)} onClick={() => toggle(appearance)}><Plus aria-hidden=\\\"true\\\" /></AiIconButton>)}</div> : (['default', 'error'] as const).map(tone => <div key={tone} className=\\\"flex items-center gap-5\\\">{([32, 28, 24, 20] as const).map(size => <AiIconButton key={size} size={size} tone={tone} aria-label={`${t(`${prefix}${tone}`)} ${size}`} aria-pressed={active.includes(`${tone}-${size}`)} onClick={() => toggle(`${tone}-${size}`)}><ChevronDown aria-hidden=\\\"true\\\" /></AiIconButton>)}</div>)}</div>\\n}\\n\\nfunction AiNavItem({ children, icon = true, leading, mobile = false, active = false, className, ...props }: ButtonProps & { icon?: boolean; leading?: React.ReactNode; mobile?: boolean; active?: boolean }) {\\n return <Button type=\\\"button\\\" variant=\\\"ghost\\\" size=\\\"sm\\\" data-slot=\\\"ai-nav-item\\\" data-mobile={mobile} data-leading={icon} aria-current={active ? 'page' : undefined} className={cn('group h-8 w-61 max-w-full justify-start gap-2 rounded-md bg-background py-1.5 pl-1.5 pr-2 text-sm font-medium leading-5 text-muted-foreground hover:bg-muted hover:text-foreground', active && 'bg-muted text-foreground', !icon && 'hover:pl-2.5', !icon && active && 'pl-2.5', className)} {...props}>\\n {icon ? leading ?? <Folder aria-hidden=\\\"true\\\" className=\\\"size-5\\\" /> : null}<span className=\\\"min-w-0 flex-1 truncate text-left\\\">{children}</span>{icon ? <ChevronRight aria-hidden=\\\"true\\\" className={cn('size-4.5 shrink-0', !mobile && !active && 'hidden group-hover:block group-focus-visible:block')} /> : <MoreVertical aria-hidden=\\\"true\\\" className={cn('size-4.5 shrink-0', !mobile && (active ? 'hidden' : 'hidden group-hover:block group-focus-visible:block'))} />}\\n </Button>\\n}\\n\\nexport function AiNavigationExamples() {\\n const t = useT()\\n const [active, setActive] = React.useState<string[]>([])\\n return <div className=\\\"grid gap-4\\\">{[false, true].flatMap(mobile => [true, false].map(icon => { const key = `${mobile}-${icon}`; return <AiNavItem key={key} icon={icon} mobile={mobile} active={active.includes(key)} onClick={() => setActive(values => values.includes(key) ? values.filter(value => value !== key) : [...values, key])}>{t(`${prefix}projects`)}</AiNavItem> }))}</div>\\n}\\n\\nexport function AiSearchExamples() {\\n const t = useT()\\n const [query, setQuery] = React.useState('')\\n return <div className=\\\"grid w-64 max-w-full gap-4\\\">{(['default', 'sm'] as const).map(size => <SearchInput key={size} size={size} value={query} onChange={setQuery} clearable={false} aria-label={`${t(`${prefix}search`)} ${size}`} placeholder={t(`${prefix}searchPlaceholder`)} className={cn('rounded-lg border-0 px-2 shadow-none focus-within:bg-background [&>svg]:size-5', size === 'sm' ? 'bg-background hover:bg-muted' : 'bg-muted')} />)}<output className=\\\"text-xs text-muted-foreground\\\">{t(`${prefix}query`)} {query}</output></div>\\n}\\n\\nexport function AiAuthExamples({ kind = 'icons' }: { kind?: 'icons' | 'social' | 'text' | 'digits' }) {\\n const t = useT()\\n const [value, setValue] = React.useState('')\\n const [clicked, setClicked] = React.useState(false)\\n const id = React.useId()\\n if (kind === 'icons') return <div className=\\\"grid w-full max-w-lg grid-cols-2 gap-6 sm:grid-cols-4\\\">{(['signIn', 'signUp', 'reset', 'verification', 'signInGray', 'signUpGray', 'resetGray', 'verificationGray'] as const).map(key => <div key={key} className=\\\"grid justify-items-center gap-2\\\"><span className=\\\"flex size-14 items-center justify-center rounded-full border border-status-neutral-bg bg-background\\\"><img src={aiProductArtwork[key]} alt=\\\"\\\" className=\\\"size-8\\\" /></span><span className=\\\"text-xs text-muted-foreground\\\">{t(`${prefix}${key.replace('Gray', '')}`)}{key.endsWith('Gray') ? ` \u00B7 ${t(`${prefix}gray`)}` : ''}</span></div>)}</div>\\n if (kind === 'social') return <div className=\\\"grid gap-3\\\"><SocialButton type=\\\"button\\\" brand=\\\"google\\\" appearance=\\\"stroke\\\" className=\\\"h-auto min-h-10 w-fit max-w-full whitespace-normal py-2 text-left\\\" onClick={() => setClicked(true)}><img src={source(googleIcon)} alt=\\\"\\\" className=\\\"size-5 shrink-0\\\" /><span className=\\\"min-w-0\\\">{t(`${prefix}google`)}</span></SocialButton>{clicked ? <output className=\\\"max-w-sm text-xs text-muted-foreground\\\">{t(`${prefix}localOnly`)}</output> : null}</div>\\n if (kind === 'digits') return <div className=\\\"grid gap-4\\\">{[false, true].map(disabled => <DigitInput key={String(disabled)} length={4} value={disabled ? '1234' : value} onChange={setValue} disabled={disabled} aria-label={`${t(`${prefix}verification`)} ${disabled ? t(`${prefix}disabled`) : t(`${prefix}editable`)}`} cellClassName=\\\"size-12 sm:w-12 rounded-ai-input px-2 py-2.5 text-lg leading-6\\\" />)}<output className=\\\"text-xs text-muted-foreground\\\">{value}</output></div>\\n return <div className=\\\"grid w-83 max-w-full gap-5\\\">{[false, true].map(disabled => <div key={String(disabled)} data-slot=\\\"ai-text-input\\\" className=\\\"grid gap-1\\\"><FieldLabel htmlFor={`${id}-${disabled}`} disabled={disabled} required>{t(`${prefix}email`)}</FieldLabel><Input id={`${id}-${disabled}`} type=\\\"email\\\" value={disabled ? 'james@example.com' : value} onChange={event => setValue(event.target.value)} disabled={disabled} aria-required aria-describedby={`${id}-${disabled}-hint`} placeholder=\\\"hello@alignui.com\\\" leading={<Mail aria-hidden=\\\"true\\\" className=\\\"size-5 text-muted-foreground\\\" />} size=\\\"lg\\\" className=\\\"rounded-ai-input\\\" /><HintText id={`${id}-${disabled}-hint`} state={disabled ? 'disabled' : 'default'} leading={<KeyIconGlyph name=\\\"information\\\" />} className=\\\"pt-1\\\">{t(`${prefix}hint`)}</HintText></div>)}</div>\\n}\\n\\nexport function AiSettingsExamples() {\\n const t = useT()\\n const [tab, setTab] = React.useState('people')\\n const [size, setSize] = React.useState('medium')\\n const [count, setCount] = React.useState<number | null>(30)\\n const [model, setModel] = React.useState('GPT-4')\\n return <div className=\\\"grid gap-6\\\"><div className=\\\"grid gap-2\\\">{(['people', 'profile'] as const).map(value => <Button key={value} type=\\\"button\\\" variant=\\\"ghost\\\" data-slot=\\\"ai-settings-item\\\" aria-pressed={tab === value} className=\\\"h-auto min-h-10 w-56 max-w-full justify-start gap-2 rounded-lg bg-background px-3 py-2 text-sm text-muted-foreground hover:bg-muted aria-pressed:bg-muted aria-pressed:text-foreground\\\" onClick={() => setTab(value)}>{value === 'profile' ? <span aria-hidden=\\\"true\\\"><Avatar size={20} label=\\\"James Brown\\\" src={source(avatarPhoto)} /></span> : <User aria-hidden=\\\"true\\\" className=\\\"size-5\\\" />}<span className=\\\"min-w-0 flex-1 whitespace-normal text-left\\\">{value === 'profile' ? 'James Brown' : t(`${prefix}people`)}</span>{tab === value ? <ChevronRight aria-hidden=\\\"true\\\" className=\\\"size-4.5\\\" /> : null}</Button>)}</div><output className=\\\"text-sm text-muted-foreground\\\">{t(`${prefix}${tab}`)}</output>\\n <div className=\\\"flex flex-wrap items-center gap-5\\\"><Select value={size} onValueChange={setSize}><SelectTrigger data-slot=\\\"ai-size-select\\\" aria-label={t(`${prefix}responseLength`)} className=\\\"w-auto min-w-28 gap-2 rounded-lg [&>svg]:size-5\\\"><SelectValue /></SelectTrigger><SelectContent>{['small', 'medium', 'large'].map(value => <SelectItem key={value} value={value}>{t(`${prefix}${value}`)}</SelectItem>)}</SelectContent></Select><CounterInput data-slot=\\\"ai-counter\\\" value={count} min={0} max={99} onChange={setCount} size=\\\"default\\\" aria-label={t(`${prefix}historyLimit`)} decrementAriaLabel={t(`${prefix}decrease`)} incrementAriaLabel={t(`${prefix}increase`)} className=\\\"w-28 rounded-lg\\\" inputClassName=\\\"text-sm\\\" /><AiModelSelect value={model} onChange={setModel} className=\\\"h-9 px-3 py-2\\\" /></div>\\n </div>\\n}\\n\\nfunction AiNewChatButton({ onClick }: { onClick: () => void }) {\\n const t = useT()\\n return <Button type=\\\"button\\\" variant=\\\"ghost\\\" data-slot=\\\"ai-new-chat\\\" className=\\\"h-auto min-h-8 w-61 max-w-full justify-start gap-2 rounded-md p-1.5 text-sm text-status-success-text hover:bg-status-success-bg hover:text-status-success-text\\\" onClick={onClick}><span aria-hidden=\\\"true\\\" className=\\\"flex size-5 items-center justify-center rounded-full bg-status-success-solid text-status-success-solid-foreground\\\"><Plus className=\\\"size-3.5\\\" /></span><span className=\\\"min-w-0 whitespace-normal text-left\\\">{t(`${prefix}newChat`)}</span></Button>\\n}\\n\\nexport function AiNewChatExample() {\\n const t = useT()\\n const [draft, setDraft] = React.useState(0)\\n return <div className=\\\"grid gap-3\\\"><AiNewChatButton onClick={() => setDraft(value => value + 1)} /><output className=\\\"text-xs text-muted-foreground\\\">{t(`${prefix}draftNumber`, { number: draft })}</output></div>\\n}\\n\\nfunction AiDivider() {\\n return <div role=\\\"separator\\\" className=\\\"flex h-1 shrink-0 items-center px-1.5\\\"><span className=\\\"h-px w-full bg-border\\\" /></div>\\n}\\n\\nexport function AiSidebarExample({ search = '01', initialCollapsed = false }: { search?: '01' | '02' | '03'; initialCollapsed?: boolean }) {\\n const t = useT()\\n const [collapsed, setCollapsed] = React.useState(initialCollapsed)\\n const [query, setQuery] = React.useState('')\\n const [active, setActive] = React.useState('projects')\\n const [draft, setDraft] = React.useState(0)\\n const newChat = () => { setDraft(value => value + 1); setActive('newChat') }\\n const searchControl = <SearchInput value={query} onChange={setQuery} clearable={false} aria-label={t(`${prefix}search`)} placeholder={t(`${prefix}searchPlaceholder`)} className=\\\"h-9 w-61 max-w-full rounded-lg border-0 bg-muted px-2 shadow-none [&>svg]:size-5\\\" />\\n const searchPopover = <Popover><PopoverTrigger asChild><AiIconButton aria-label={t(`${prefix}search`)}><Search aria-hidden=\\\"true\\\" /></AiIconButton></PopoverTrigger><PopoverContent className=\\\"w-auto p-3\\\">{searchControl}<p className=\\\"mt-2 text-xs text-muted-foreground\\\">{t(`${prefix}query`)} {query}</p></PopoverContent></Popover>\\n const groups = [\\n { label: 'pinned', items: ['launchPlan', 'researchNotes', 'contentIdeas'], icon: true },\\n { label: 'recent', items: ['quarterlyReport', 'emailDraft', 'meetingNotes'], icon: false },\\n { label: 'yesterday', items: ['campaignIdeas', 'productBrief', 'supportReply', 'weeklyPlan', 'projectSummary'], icon: false },\\n ]\\n return <div className=\\\"flex max-w-full flex-wrap items-start gap-5\\\">\\n <Sidebar collapsed={collapsed} aria-label={t(`${prefix}sidebar`)} className={cn('max-w-full rounded-lg border border-border', collapsed ? 'w-18 gap-5 border-0 p-5' : 'w-68 gap-4 border-0 px-3.5 pb-3.5 pt-5')}>\\n <div className=\\\"flex shrink-0 flex-col gap-5\\\"><div className=\\\"flex h-8 items-center justify-between\\\">\\n {collapsed ? <AiIconButton aria-label={t(`${prefix}expand`)} onClick={() => setCollapsed(false)}><img src={aiProductArtwork.logo} alt=\\\"\\\" className=\\\"size-8\\\" /></AiIconButton> : <><img src={aiProductArtwork.logo} alt={t(`${prefix}brand`)} className=\\\"size-8\\\" /><div className=\\\"flex gap-1\\\">{search === '02' ? searchPopover : null}<AiIconButton aria-label={t(`${prefix}collapse`)} onClick={() => setCollapsed(true)}><PanelLeft aria-hidden=\\\"true\\\" /></AiIconButton></div></>}\\n </div>{!collapsed && search === '01' ? searchControl : null}</div>\\n {collapsed ? <><AiDivider /><div className=\\\"flex flex-1 flex-col gap-3\\\"><AiIconButton aria-label={t(`${prefix}newChat`)} onClick={newChat}><Plus aria-hidden=\\\"true\\\" /></AiIconButton><AiIconButton aria-label={t(`${prefix}projects`)} aria-pressed={active === 'projects'} onClick={() => setActive('projects')}><Folder aria-hidden=\\\"true\\\" /></AiIconButton><AiIconButton aria-label={t(`${prefix}library`)} aria-pressed={active === 'library'} onClick={() => setActive('library')}><BookOpen aria-hidden=\\\"true\\\" /></AiIconButton>{searchPopover}</div><AiDivider /></> : <>\\n <div className=\\\"grid shrink-0 gap-1\\\"><AiNewChatButton onClick={newChat} /><AiNavItem active={active === 'projects'} onClick={() => setActive('projects')}>{t(`${prefix}projects`)}</AiNavItem><AiNavItem leading={<BookOpen aria-hidden=\\\"true\\\" className=\\\"size-5\\\" />} active={active === 'library'} onClick={() => setActive('library')}>{t(`${prefix}library`)}</AiNavItem>{search === '03' ? <Popover><PopoverTrigger asChild><Button type=\\\"button\\\" variant=\\\"ghost\\\" className=\\\"h-8 justify-start gap-2 rounded-md p-1.5 text-sm text-muted-foreground\\\"><Search aria-hidden=\\\"true\\\" className=\\\"size-5\\\" />{t(`${prefix}search`)}</Button></PopoverTrigger><PopoverContent className=\\\"w-auto p-3\\\">{searchControl}</PopoverContent></Popover> : null}</div>\\n <AiDivider /><div className=\\\"flex min-h-0 flex-1 flex-col gap-4 overflow-auto\\\">\\n {groups.map((group, groupIndex) => <React.Fragment key={group.label}>{groupIndex === 1 ? <AiDivider /> : null}<div className=\\\"grid shrink-0 gap-2\\\"><h3 className=\\\"px-1.5 text-xs font-medium leading-4 text-muted-foreground\\\">{t(`${prefix}${group.label}`)}</h3><div className=\\\"grid gap-1\\\">{group.items.filter(item => t(`${prefix}${item}`).toLocaleLowerCase().includes(query.toLocaleLowerCase())).map(item => <AiNavItem key={item} icon={group.icon} active={active === item} onClick={() => setActive(item)}>{t(`${prefix}${item}`)}</AiNavItem>)}</div></div></React.Fragment>)}\\n </div><AiDivider />\\n </>}\\n <Popover><PopoverTrigger asChild><Button type=\\\"button\\\" variant=\\\"ghost\\\" aria-label={t(`${prefix}profile`)} data-slot=\\\"ai-sidebar-profile\\\" className={cn('shrink-0 justify-start rounded-md text-left', collapsed ? 'size-8 p-0' : 'h-13 gap-3 p-1.5')}><Avatar label=\\\"James Brown\\\" size={collapsed ? 32 : 40} />{!collapsed ? <><span className=\\\"flex min-w-0 flex-1 flex-col gap-1\\\"><span className=\\\"flex items-center gap-1 text-sm font-medium leading-5\\\">James Brown <Badge size={16} appearance=\\\"light\\\">Pro</Badge></span><span className=\\\"truncate text-xs font-normal leading-4 text-muted-foreground\\\">james@example.com</span></span><MoreVertical aria-hidden=\\\"true\\\" className=\\\"size-4.5\\\" /></> : null}</Button></PopoverTrigger><PopoverContent className=\\\"w-64 text-sm\\\"><p className=\\\"font-medium\\\">James Brown</p><p className=\\\"mt-2 text-muted-foreground\\\">{t(`${prefix}localOnly`)}</p></PopoverContent></Popover>\\n </Sidebar><output aria-live=\\\"polite\\\" className=\\\"grid max-w-xs gap-2 text-sm text-muted-foreground\\\"><span>{t(`${prefix}selected`)} {t(`${prefix}${active}`)}</span><span>{t(`${prefix}draftNumber`, { number: draft })}</span>{query ? <span>{t(`${prefix}query`)} {query}</span> : null}</output>\\n </div>\\n}\\n\\nexport function AiMobileNavigationExample({ kind = 'default' }: { kind?: 'default' | 'in-projects' | 'projects' | 'project-details' }) {\\n const t = useT()\\n const [model, setModel] = React.useState('GPT-4')\\n const [selected, setSelected] = React.useState('projects')\\n const [draft, setDraft] = React.useState(0)\\n const [project, setProject] = React.useState('')\\n const [name, setName] = React.useState('')\\n const [createOpen, setCreateOpen] = React.useState(false)\\n const [pinned, setPinned] = React.useState(false)\\n const id = React.useId()\\n const menu = <Popover><PopoverTrigger asChild><AiIconButton aria-label={t(`${prefix}menu`)}><Menu aria-hidden=\\\"true\\\" /></AiIconButton></PopoverTrigger><PopoverContent className=\\\"grid w-auto gap-1 p-2\\\">{['projects', 'library'].map(item => <AiNavItem key={item} mobile active={selected === item} onClick={() => setSelected(item)}>{t(`${prefix}${item}`)}</AiNavItem>)}</PopoverContent></Popover>\\n const more = <Popover><PopoverTrigger asChild><AiIconButton size={kind === 'project-details' ? 24 : 32} aria-label={t(`${prefix}more`)}><MoreHorizontal aria-hidden=\\\"true\\\" /></AiIconButton></PopoverTrigger><PopoverContent className=\\\"w-64\\\"><CheckboxField checked={pinned} onCheckedChange={value => setPinned(value === true)} label={t(`${prefix}pinProject`)} /></PopoverContent></Popover>\\n const create = () => { if (!name.trim()) return; setProject(name.trim()); setName(''); setCreateOpen(false) }\\n return <div className=\\\"grid w-full min-w-0 max-w-sm grid-cols-1 gap-4\\\"><header data-slot=\\\"ai-mobile-navigation\\\" data-kind={kind} className={cn('flex h-16 w-full min-w-0 items-center gap-2 bg-background px-2 py-3 sm:px-4', kind === 'project-details' ? 'sm:gap-2.5' : 'sm:gap-3.5')}>\\n {kind === 'project-details' ? <><AiIconButton size={20} aria-label={t(`${prefix}allProjects`)} onClick={() => setSelected('projects')}><ArrowLeft aria-hidden=\\\"true\\\" /></AiIconButton><span className=\\\"flex-1 text-sm font-medium\\\">{t(`${prefix}allProjects`)}</span><div className=\\\"flex gap-2\\\"><AiIconButton size={24} aria-label={t(`${prefix}newChat`)} onClick={() => setDraft(value => value + 1)}><Plus aria-hidden=\\\"true\\\" /></AiIconButton>{more}</div></> : <>{menu}{kind === 'projects' ? <div className=\\\"flex flex-1 justify-end\\\"><Popover open={createOpen} onOpenChange={setCreateOpen}><PopoverTrigger asChild><Button type=\\\"button\\\" size=\\\"sm\\\" variant=\\\"outline\\\" className=\\\"w-auto shrink-0 gap-2 rounded-lg\\\"><Plus aria-hidden=\\\"true\\\" className=\\\"size-5\\\" />{t(`${prefix}addProject`)}</Button></PopoverTrigger><PopoverContent className=\\\"w-72\\\"><form className=\\\"grid gap-3\\\" onSubmit={event => { event.preventDefault(); create() }} onKeyDown={event => { if (event.key === 'Enter' && (event.ctrlKey || event.metaKey)) { event.preventDefault(); create() } }}><FieldLabel htmlFor={id} required>{t(`${prefix}projectName`)}</FieldLabel><Input id={id} value={name} onChange={event => setName(event.target.value)} autoFocus /><Button type=\\\"submit\\\" size=\\\"sm\\\" disabled={!name.trim()}>{t(`${prefix}addProject`)}</Button></form></PopoverContent></Popover></div> : <><div className=\\\"flex min-w-0 flex-1 flex-col gap-1\\\"><AiModelSelect value={model} onChange={setModel} compact />{kind === 'in-projects' ? <span className=\\\"truncate text-xs leading-4 text-muted-foreground\\\">{t(`${prefix}launchPlan`)}</span> : null}</div><AiIconButton aria-label={t(`${prefix}newChat`)} onClick={() => setDraft(value => value + 1)}><Plus aria-hidden=\\\"true\\\" /></AiIconButton>{more}</>}</>}\\n </header><output aria-live=\\\"polite\\\" className=\\\"grid gap-1 text-xs text-muted-foreground\\\"><span>{t(`${prefix}selected`)} {t(`${prefix}${selected}`)}</span><span>{t(`${prefix}draftNumber`, { number: draft })}</span>{project ? <span>{t(`${prefix}createdProject`)} {project}</span> : null}{pinned ? <span>{t(`${prefix}pinProject`)}</span> : null}</output></div>\\n}\\n\"\nexport const aiProductExampleCode = (expression: string) => source + \"\\n\" + expression + \"\\n\"\n"],
5
+ "mappings": "AACA,MAAM,SAAS;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACR,MAAM,uBAAuB,CAAC,eAAuB,SAAS,OAAO,aAAa;",
6
+ "names": []
7
+ }
@@ -0,0 +1,423 @@
1
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
2
+ import * as React from "react";
3
+ import { ArrowLeft, BookOpen, ChevronDown, ChevronRight, Folder, Mail, Menu, MoreHorizontal, MoreVertical, PanelLeft, Plus, Search, User, X, Zap } from "lucide-react";
4
+ import { useT } from "@open-mercato/shared/lib/i18n/context";
5
+ import { cn } from "@open-mercato/shared/lib/utils";
6
+ import { Button } from "@open-mercato/ui/primitives/button";
7
+ import { Input } from "@open-mercato/ui/primitives/input";
8
+ import { SearchInput } from "@open-mercato/ui/primitives/search-input";
9
+ import { FieldLabel } from "@open-mercato/ui/primitives/label";
10
+ import { HintText } from "@open-mercato/ui/primitives/hint-text";
11
+ import { KeyIconGlyph } from "@open-mercato/ui/primitives/key-icon";
12
+ import { DigitInput } from "@open-mercato/ui/primitives/digit-input";
13
+ import { CounterInput } from "@open-mercato/ui/primitives/counter-input";
14
+ import { Select, SelectTrigger, SelectContent, SelectItem, SelectValue } from "@open-mercato/ui/primitives/select";
15
+ import { Popover, PopoverTrigger, PopoverContent } from "@open-mercato/ui/primitives/popover";
16
+ import { CheckboxField } from "@open-mercato/ui/primitives/checkbox-field";
17
+ import { SocialButton } from "@open-mercato/ui/primitives/social-button";
18
+ import { Avatar } from "@open-mercato/ui/primitives/avatar";
19
+ import { Badge } from "@open-mercato/ui/primitives/badge";
20
+ import { Sidebar } from "@open-mercato/ui/primitives/sidebar";
21
+ import { PromptArea } from "@open-mercato/ui/primitives/prompt-area";
22
+ import { FileFormatIcon } from "@open-mercato/ui/primitives/file-format-icon";
23
+ import { aiProductArtwork } from "@open-mercato/ui/assets/ai-product-artwork";
24
+ import promptImage from "../assets/ai-prompt-image.png";
25
+ import avatarPhoto from "../assets/avatar-photo.png";
26
+ import googleIcon from "../assets/select-google.png";
27
+ const prefix = "design_system.gallery.examples.aiProduct.";
28
+ const source = (asset) => typeof asset === "string" ? asset : asset.src;
29
+ function AiIconButton({ size = 32, tone = "default", appearance = "plain", className, children, ...props }) {
30
+ const content = React.isValidElement(children) && children.type !== "img" ? React.cloneElement(children, { className: cn(children.props.className, size === 24 ? "size-4.5" : "size-5") }) : children;
31
+ return /* @__PURE__ */ jsx(Button, { type: "button", variant: "ghost", size: "icon", "data-slot": "ai-icon-button", "data-size": size, "data-tone": tone, "data-appearance": appearance, className: cn(
32
+ "shrink-0 p-0",
33
+ size === 32 ? "size-8 rounded-md" : size === 28 ? "size-7 rounded-md" : size === 24 ? "size-6 rounded-sm" : "size-5 rounded-sm",
34
+ appearance !== "plain" && "rounded-ai-control",
35
+ appearance === "stroke" ? "bg-background shadow-xs ring-1 ring-inset ring-border" : appearance === "lighter" ? "bg-muted" : "bg-background",
36
+ tone === "error" ? "text-status-error-text hover:bg-status-error-bg hover:text-status-error-text aria-pressed:bg-status-error-bg aria-pressed:text-status-error-text" : "text-muted-foreground hover:bg-muted hover:text-foreground aria-pressed:bg-muted aria-pressed:text-foreground",
37
+ appearance !== "plain" && "aria-pressed:bg-primary aria-pressed:text-primary-foreground",
38
+ className
39
+ ), ...props, children: content });
40
+ }
41
+ function AiModelSelect({ value, onChange, compact = false, className }) {
42
+ const t = useT();
43
+ return /* @__PURE__ */ jsxs(Select, { value, onValueChange: onChange, children: [
44
+ /* @__PURE__ */ jsx(SelectTrigger, { "aria-label": t(`${prefix}model`), "data-slot": "ai-model-select", className: cn("h-7 w-auto min-w-19.75 gap-1 rounded-ai-control border-0 bg-muted py-1 pl-2 pr-1 text-sm leading-5 shadow-none hover:bg-accent [&>svg]:size-5", compact && "h-5 bg-transparent p-0", className), children: /* @__PURE__ */ jsx(SelectValue, {}) }),
45
+ /* @__PURE__ */ jsx(SelectContent, { children: ["GPT-4", "GPT-3.5"].map((model) => /* @__PURE__ */ jsx(SelectItem, { value: model, children: model }, model)) })
46
+ ] });
47
+ }
48
+ function AiPromptExample({ compact = false, attachment = "none" }) {
49
+ const t = useT();
50
+ const [value, setValue] = React.useState("");
51
+ const [model, setModel] = React.useState("GPT-4");
52
+ const [lastPrompt, setLastPrompt] = React.useState("");
53
+ const [files, setFiles] = React.useState(attachment === "none" ? [] : [{ id: "source", name: t(`${prefix}${attachment === "image" ? "imageName" : "fileName"}`), image: attachment === "image" ? source(promptImage) : void 0 }]);
54
+ const upload = React.useRef(null);
55
+ const attachmentId = React.useRef(0);
56
+ const objectUrls = React.useRef(/* @__PURE__ */ new Set());
57
+ React.useEffect(() => () => {
58
+ for (const url of objectUrls.current) URL.revokeObjectURL(url);
59
+ }, []);
60
+ const remove = (id) => setFiles((current) => current.filter((file) => {
61
+ if (file.id !== id) return true;
62
+ if (file.objectUrl && file.image) {
63
+ URL.revokeObjectURL(file.image);
64
+ objectUrls.current.delete(file.image);
65
+ }
66
+ return false;
67
+ }));
68
+ const submit = (message) => {
69
+ setLastPrompt(`${model}: ${message}`);
70
+ setValue("");
71
+ };
72
+ return /* @__PURE__ */ jsxs("div", { className: cn("grid max-w-full gap-4", compact ? "w-93.5" : "w-175"), children: [
73
+ /* @__PURE__ */ jsx(
74
+ PromptArea,
75
+ {
76
+ compact,
77
+ value,
78
+ onValueChange: setValue,
79
+ onSubmit: submit,
80
+ inputLabel: t(`${prefix}prompt`),
81
+ submitLabel: t(`${prefix}saveDraft`),
82
+ placeholder: t(`${prefix}placeholder`),
83
+ information: /* @__PURE__ */ jsxs(Fragment, { children: [
84
+ /* @__PURE__ */ jsx(Zap, { "aria-hidden": "true", className: "size-4 shrink-0" }),
85
+ /* @__PURE__ */ jsx("span", { children: t(`${prefix}premium`) }),
86
+ /* @__PURE__ */ jsx("span", { "aria-hidden": "true", children: "\xB7" }),
87
+ /* @__PURE__ */ jsxs(Popover, { children: [
88
+ /* @__PURE__ */ jsx(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsx(Button, { type: "button", variant: "ghost", className: "h-4 rounded-sm p-0 text-xs font-medium leading-4", children: t(`${prefix}upgrade`) }) }),
89
+ /* @__PURE__ */ jsx(PopoverContent, { className: "text-sm", children: t(`${prefix}localOnly`) })
90
+ ] })
91
+ ] }),
92
+ toolbar: /* @__PURE__ */ jsxs(Fragment, { children: [
93
+ /* @__PURE__ */ jsx(AiIconButton, { size: 28, appearance: "lighter", "aria-label": t(`${prefix}addFile`), onClick: () => upload.current?.click(), children: /* @__PURE__ */ jsx(Plus, { "aria-hidden": "true" }) }),
94
+ /* @__PURE__ */ jsx(AiModelSelect, { value: model, onChange: setModel })
95
+ ] }),
96
+ attachments: files.length ? files.map((file) => file.image ? /* @__PURE__ */ jsxs("div", { className: "relative size-24 shrink-0", children: [
97
+ /* @__PURE__ */ jsx("img", { src: file.image, alt: file.name, className: "size-24 rounded-xl object-cover" }),
98
+ /* @__PURE__ */ jsx(AiIconButton, { size: 20, "aria-label": `${t(`${prefix}remove`)} ${file.name}`, className: "absolute right-1.5 top-1.5 rounded-full bg-primary text-primary-foreground hover:bg-primary-hover hover:text-primary-foreground", onClick: () => remove(file.id), children: /* @__PURE__ */ jsx(X, { "aria-hidden": "true" }) })
99
+ ] }, file.id) : /* @__PURE__ */ jsxs("div", { className: "flex h-15 max-w-full items-center gap-3 rounded-xl bg-muted py-2.5 pl-3 pr-4", children: [
100
+ /* @__PURE__ */ jsx(FileFormatIcon, { format: file.name.includes(".") ? file.name.split(".").pop()?.toUpperCase().slice(0, 5) ?? "FILE" : "FILE" }),
101
+ /* @__PURE__ */ jsxs("div", { className: "grid min-w-0 gap-1", children: [
102
+ /* @__PURE__ */ jsx("span", { className: "truncate text-sm font-medium", children: file.name }),
103
+ /* @__PURE__ */ jsx("span", { className: "text-xs text-muted-foreground", children: t(`${prefix}localFile`) })
104
+ ] }),
105
+ /* @__PURE__ */ jsx(AiIconButton, { size: 20, "aria-label": `${t(`${prefix}remove`)} ${file.name}`, onClick: () => remove(file.id), children: /* @__PURE__ */ jsx(X, { "aria-hidden": "true" }) })
106
+ ] }, file.id)) : void 0
107
+ }
108
+ ),
109
+ /* @__PURE__ */ jsx("input", { ref: upload, type: "file", className: "sr-only", tabIndex: -1, "aria-label": t(`${prefix}attachmentInput`), multiple: true, onChange: (event) => {
110
+ const selected = Array.from(event.target.files ?? []);
111
+ setFiles((current) => [...current, ...selected.map((file) => {
112
+ const image = file.type.startsWith("image/") ? URL.createObjectURL(file) : void 0;
113
+ if (image) objectUrls.current.add(image);
114
+ return { id: `attachment-${attachmentId.current++}`, name: file.name, image, objectUrl: Boolean(image) };
115
+ })]);
116
+ event.target.value = "";
117
+ } }),
118
+ /* @__PURE__ */ jsx("p", { className: "text-xs leading-4 text-muted-foreground", children: t(`${prefix}localOnly`) }),
119
+ lastPrompt ? /* @__PURE__ */ jsxs("output", { className: "rounded-md border border-border p-3 text-sm", children: [
120
+ t(`${prefix}saved`),
121
+ " ",
122
+ lastPrompt
123
+ ] }) : null
124
+ ] });
125
+ }
126
+ function AiIconButtonExamples({ chat = false }) {
127
+ const t = useT();
128
+ const [active, setActive] = React.useState([]);
129
+ const toggle = (key) => setActive((items) => items.includes(key) ? items.filter((item) => item !== key) : [...items, key]);
130
+ return /* @__PURE__ */ jsx("div", { className: "grid gap-5", children: chat ? /* @__PURE__ */ jsx("div", { className: "flex gap-5", children: ["stroke", "lighter"].map((appearance) => /* @__PURE__ */ jsx(AiIconButton, { size: 28, appearance, "aria-label": `${t(`${prefix}toggleControl`)} ${appearance}`, "aria-pressed": active.includes(appearance), onClick: () => toggle(appearance), children: /* @__PURE__ */ jsx(Plus, { "aria-hidden": "true" }) }, appearance)) }) : ["default", "error"].map((tone) => /* @__PURE__ */ jsx("div", { className: "flex items-center gap-5", children: [32, 28, 24, 20].map((size) => /* @__PURE__ */ jsx(AiIconButton, { size, tone, "aria-label": `${t(`${prefix}${tone}`)} ${size}`, "aria-pressed": active.includes(`${tone}-${size}`), onClick: () => toggle(`${tone}-${size}`), children: /* @__PURE__ */ jsx(ChevronDown, { "aria-hidden": "true" }) }, size)) }, tone)) });
131
+ }
132
+ function AiNavItem({ children, icon = true, leading, mobile = false, active = false, className, ...props }) {
133
+ return /* @__PURE__ */ jsxs(Button, { type: "button", variant: "ghost", size: "sm", "data-slot": "ai-nav-item", "data-mobile": mobile, "data-leading": icon, "aria-current": active ? "page" : void 0, className: cn("group h-8 w-61 max-w-full justify-start gap-2 rounded-md bg-background py-1.5 pl-1.5 pr-2 text-sm font-medium leading-5 text-muted-foreground hover:bg-muted hover:text-foreground", active && "bg-muted text-foreground", !icon && "hover:pl-2.5", !icon && active && "pl-2.5", className), ...props, children: [
134
+ icon ? leading ?? /* @__PURE__ */ jsx(Folder, { "aria-hidden": "true", className: "size-5" }) : null,
135
+ /* @__PURE__ */ jsx("span", { className: "min-w-0 flex-1 truncate text-left", children }),
136
+ icon ? /* @__PURE__ */ jsx(ChevronRight, { "aria-hidden": "true", className: cn("size-4.5 shrink-0", !mobile && !active && "hidden group-hover:block group-focus-visible:block") }) : /* @__PURE__ */ jsx(MoreVertical, { "aria-hidden": "true", className: cn("size-4.5 shrink-0", !mobile && (active ? "hidden" : "hidden group-hover:block group-focus-visible:block")) })
137
+ ] });
138
+ }
139
+ function AiNavigationExamples() {
140
+ const t = useT();
141
+ const [active, setActive] = React.useState([]);
142
+ return /* @__PURE__ */ jsx("div", { className: "grid gap-4", children: [false, true].flatMap((mobile) => [true, false].map((icon) => {
143
+ const key = `${mobile}-${icon}`;
144
+ return /* @__PURE__ */ jsx(AiNavItem, { icon, mobile, active: active.includes(key), onClick: () => setActive((values) => values.includes(key) ? values.filter((value) => value !== key) : [...values, key]), children: t(`${prefix}projects`) }, key);
145
+ })) });
146
+ }
147
+ function AiSearchExamples() {
148
+ const t = useT();
149
+ const [query, setQuery] = React.useState("");
150
+ return /* @__PURE__ */ jsxs("div", { className: "grid w-64 max-w-full gap-4", children: [
151
+ ["default", "sm"].map((size) => /* @__PURE__ */ jsx(SearchInput, { size, value: query, onChange: setQuery, clearable: false, "aria-label": `${t(`${prefix}search`)} ${size}`, placeholder: t(`${prefix}searchPlaceholder`), className: cn("rounded-lg border-0 px-2 shadow-none focus-within:bg-background [&>svg]:size-5", size === "sm" ? "bg-background hover:bg-muted" : "bg-muted") }, size)),
152
+ /* @__PURE__ */ jsxs("output", { className: "text-xs text-muted-foreground", children: [
153
+ t(`${prefix}query`),
154
+ " ",
155
+ query
156
+ ] })
157
+ ] });
158
+ }
159
+ function AiAuthExamples({ kind = "icons" }) {
160
+ const t = useT();
161
+ const [value, setValue] = React.useState("");
162
+ const [clicked, setClicked] = React.useState(false);
163
+ const id = React.useId();
164
+ if (kind === "icons") return /* @__PURE__ */ jsx("div", { className: "grid w-full max-w-lg grid-cols-2 gap-6 sm:grid-cols-4", children: ["signIn", "signUp", "reset", "verification", "signInGray", "signUpGray", "resetGray", "verificationGray"].map((key) => /* @__PURE__ */ jsxs("div", { className: "grid justify-items-center gap-2", children: [
165
+ /* @__PURE__ */ jsx("span", { className: "flex size-14 items-center justify-center rounded-full border border-status-neutral-bg bg-background", children: /* @__PURE__ */ jsx("img", { src: aiProductArtwork[key], alt: "", className: "size-8" }) }),
166
+ /* @__PURE__ */ jsxs("span", { className: "text-xs text-muted-foreground", children: [
167
+ t(`${prefix}${key.replace("Gray", "")}`),
168
+ key.endsWith("Gray") ? ` \xB7 ${t(`${prefix}gray`)}` : ""
169
+ ] })
170
+ ] }, key)) });
171
+ if (kind === "social") return /* @__PURE__ */ jsxs("div", { className: "grid gap-3", children: [
172
+ /* @__PURE__ */ jsxs(SocialButton, { type: "button", brand: "google", appearance: "stroke", className: "h-auto min-h-10 w-fit max-w-full whitespace-normal py-2 text-left", onClick: () => setClicked(true), children: [
173
+ /* @__PURE__ */ jsx("img", { src: source(googleIcon), alt: "", className: "size-5 shrink-0" }),
174
+ /* @__PURE__ */ jsx("span", { className: "min-w-0", children: t(`${prefix}google`) })
175
+ ] }),
176
+ clicked ? /* @__PURE__ */ jsx("output", { className: "max-w-sm text-xs text-muted-foreground", children: t(`${prefix}localOnly`) }) : null
177
+ ] });
178
+ if (kind === "digits") return /* @__PURE__ */ jsxs("div", { className: "grid gap-4", children: [
179
+ [false, true].map((disabled) => /* @__PURE__ */ jsx(DigitInput, { length: 4, value: disabled ? "1234" : value, onChange: setValue, disabled, "aria-label": `${t(`${prefix}verification`)} ${disabled ? t(`${prefix}disabled`) : t(`${prefix}editable`)}`, cellClassName: "size-12 sm:w-12 rounded-ai-input px-2 py-2.5 text-lg leading-6" }, String(disabled))),
180
+ /* @__PURE__ */ jsx("output", { className: "text-xs text-muted-foreground", children: value })
181
+ ] });
182
+ return /* @__PURE__ */ jsx("div", { className: "grid w-83 max-w-full gap-5", children: [false, true].map((disabled) => /* @__PURE__ */ jsxs("div", { "data-slot": "ai-text-input", className: "grid gap-1", children: [
183
+ /* @__PURE__ */ jsx(FieldLabel, { htmlFor: `${id}-${disabled}`, disabled, required: true, children: t(`${prefix}email`) }),
184
+ /* @__PURE__ */ jsx(Input, { id: `${id}-${disabled}`, type: "email", value: disabled ? "james@example.com" : value, onChange: (event) => setValue(event.target.value), disabled, "aria-required": true, "aria-describedby": `${id}-${disabled}-hint`, placeholder: "hello@alignui.com", leading: /* @__PURE__ */ jsx(Mail, { "aria-hidden": "true", className: "size-5 text-muted-foreground" }), size: "lg", className: "rounded-ai-input" }),
185
+ /* @__PURE__ */ jsx(HintText, { id: `${id}-${disabled}-hint`, state: disabled ? "disabled" : "default", leading: /* @__PURE__ */ jsx(KeyIconGlyph, { name: "information" }), className: "pt-1", children: t(`${prefix}hint`) })
186
+ ] }, String(disabled))) });
187
+ }
188
+ function AiSettingsExamples() {
189
+ const t = useT();
190
+ const [tab, setTab] = React.useState("people");
191
+ const [size, setSize] = React.useState("medium");
192
+ const [count, setCount] = React.useState(30);
193
+ const [model, setModel] = React.useState("GPT-4");
194
+ return /* @__PURE__ */ jsxs("div", { className: "grid gap-6", children: [
195
+ /* @__PURE__ */ jsx("div", { className: "grid gap-2", children: ["people", "profile"].map((value) => /* @__PURE__ */ jsxs(Button, { type: "button", variant: "ghost", "data-slot": "ai-settings-item", "aria-pressed": tab === value, className: "h-auto min-h-10 w-56 max-w-full justify-start gap-2 rounded-lg bg-background px-3 py-2 text-sm text-muted-foreground hover:bg-muted aria-pressed:bg-muted aria-pressed:text-foreground", onClick: () => setTab(value), children: [
196
+ value === "profile" ? /* @__PURE__ */ jsx("span", { "aria-hidden": "true", children: /* @__PURE__ */ jsx(Avatar, { size: 20, label: "James Brown", src: source(avatarPhoto) }) }) : /* @__PURE__ */ jsx(User, { "aria-hidden": "true", className: "size-5" }),
197
+ /* @__PURE__ */ jsx("span", { className: "min-w-0 flex-1 whitespace-normal text-left", children: value === "profile" ? "James Brown" : t(`${prefix}people`) }),
198
+ tab === value ? /* @__PURE__ */ jsx(ChevronRight, { "aria-hidden": "true", className: "size-4.5" }) : null
199
+ ] }, value)) }),
200
+ /* @__PURE__ */ jsx("output", { className: "text-sm text-muted-foreground", children: t(`${prefix}${tab}`) }),
201
+ /* @__PURE__ */ jsxs("div", { className: "flex flex-wrap items-center gap-5", children: [
202
+ /* @__PURE__ */ jsxs(Select, { value: size, onValueChange: setSize, children: [
203
+ /* @__PURE__ */ jsx(SelectTrigger, { "data-slot": "ai-size-select", "aria-label": t(`${prefix}responseLength`), className: "w-auto min-w-28 gap-2 rounded-lg [&>svg]:size-5", children: /* @__PURE__ */ jsx(SelectValue, {}) }),
204
+ /* @__PURE__ */ jsx(SelectContent, { children: ["small", "medium", "large"].map((value) => /* @__PURE__ */ jsx(SelectItem, { value, children: t(`${prefix}${value}`) }, value)) })
205
+ ] }),
206
+ /* @__PURE__ */ jsx(CounterInput, { "data-slot": "ai-counter", value: count, min: 0, max: 99, onChange: setCount, size: "default", "aria-label": t(`${prefix}historyLimit`), decrementAriaLabel: t(`${prefix}decrease`), incrementAriaLabel: t(`${prefix}increase`), className: "w-28 rounded-lg", inputClassName: "text-sm" }),
207
+ /* @__PURE__ */ jsx(AiModelSelect, { value: model, onChange: setModel, className: "h-9 px-3 py-2" })
208
+ ] })
209
+ ] });
210
+ }
211
+ function AiNewChatButton({ onClick }) {
212
+ const t = useT();
213
+ return /* @__PURE__ */ jsxs(Button, { type: "button", variant: "ghost", "data-slot": "ai-new-chat", className: "h-auto min-h-8 w-61 max-w-full justify-start gap-2 rounded-md p-1.5 text-sm text-status-success-text hover:bg-status-success-bg hover:text-status-success-text", onClick, children: [
214
+ /* @__PURE__ */ jsx("span", { "aria-hidden": "true", className: "flex size-5 items-center justify-center rounded-full bg-status-success-solid text-status-success-solid-foreground", children: /* @__PURE__ */ jsx(Plus, { className: "size-3.5" }) }),
215
+ /* @__PURE__ */ jsx("span", { className: "min-w-0 whitespace-normal text-left", children: t(`${prefix}newChat`) })
216
+ ] });
217
+ }
218
+ function AiNewChatExample() {
219
+ const t = useT();
220
+ const [draft, setDraft] = React.useState(0);
221
+ return /* @__PURE__ */ jsxs("div", { className: "grid gap-3", children: [
222
+ /* @__PURE__ */ jsx(AiNewChatButton, { onClick: () => setDraft((value) => value + 1) }),
223
+ /* @__PURE__ */ jsx("output", { className: "text-xs text-muted-foreground", children: t(`${prefix}draftNumber`, { number: draft }) })
224
+ ] });
225
+ }
226
+ function AiDivider() {
227
+ return /* @__PURE__ */ jsx("div", { role: "separator", className: "flex h-1 shrink-0 items-center px-1.5", children: /* @__PURE__ */ jsx("span", { className: "h-px w-full bg-border" }) });
228
+ }
229
+ function AiSidebarExample({ search = "01", initialCollapsed = false }) {
230
+ const t = useT();
231
+ const [collapsed, setCollapsed] = React.useState(initialCollapsed);
232
+ const [query, setQuery] = React.useState("");
233
+ const [active, setActive] = React.useState("projects");
234
+ const [draft, setDraft] = React.useState(0);
235
+ const newChat = () => {
236
+ setDraft((value) => value + 1);
237
+ setActive("newChat");
238
+ };
239
+ const searchControl = /* @__PURE__ */ jsx(SearchInput, { value: query, onChange: setQuery, clearable: false, "aria-label": t(`${prefix}search`), placeholder: t(`${prefix}searchPlaceholder`), className: "h-9 w-61 max-w-full rounded-lg border-0 bg-muted px-2 shadow-none [&>svg]:size-5" });
240
+ const searchPopover = /* @__PURE__ */ jsxs(Popover, { children: [
241
+ /* @__PURE__ */ jsx(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsx(AiIconButton, { "aria-label": t(`${prefix}search`), children: /* @__PURE__ */ jsx(Search, { "aria-hidden": "true" }) }) }),
242
+ /* @__PURE__ */ jsxs(PopoverContent, { className: "w-auto p-3", children: [
243
+ searchControl,
244
+ /* @__PURE__ */ jsxs("p", { className: "mt-2 text-xs text-muted-foreground", children: [
245
+ t(`${prefix}query`),
246
+ " ",
247
+ query
248
+ ] })
249
+ ] })
250
+ ] });
251
+ const groups = [
252
+ { label: "pinned", items: ["launchPlan", "researchNotes", "contentIdeas"], icon: true },
253
+ { label: "recent", items: ["quarterlyReport", "emailDraft", "meetingNotes"], icon: false },
254
+ { label: "yesterday", items: ["campaignIdeas", "productBrief", "supportReply", "weeklyPlan", "projectSummary"], icon: false }
255
+ ];
256
+ return /* @__PURE__ */ jsxs("div", { className: "flex max-w-full flex-wrap items-start gap-5", children: [
257
+ /* @__PURE__ */ jsxs(Sidebar, { collapsed, "aria-label": t(`${prefix}sidebar`), className: cn("max-w-full rounded-lg border border-border", collapsed ? "w-18 gap-5 border-0 p-5" : "w-68 gap-4 border-0 px-3.5 pb-3.5 pt-5"), children: [
258
+ /* @__PURE__ */ jsxs("div", { className: "flex shrink-0 flex-col gap-5", children: [
259
+ /* @__PURE__ */ jsx("div", { className: "flex h-8 items-center justify-between", children: collapsed ? /* @__PURE__ */ jsx(AiIconButton, { "aria-label": t(`${prefix}expand`), onClick: () => setCollapsed(false), children: /* @__PURE__ */ jsx("img", { src: aiProductArtwork.logo, alt: "", className: "size-8" }) }) : /* @__PURE__ */ jsxs(Fragment, { children: [
260
+ /* @__PURE__ */ jsx("img", { src: aiProductArtwork.logo, alt: t(`${prefix}brand`), className: "size-8" }),
261
+ /* @__PURE__ */ jsxs("div", { className: "flex gap-1", children: [
262
+ search === "02" ? searchPopover : null,
263
+ /* @__PURE__ */ jsx(AiIconButton, { "aria-label": t(`${prefix}collapse`), onClick: () => setCollapsed(true), children: /* @__PURE__ */ jsx(PanelLeft, { "aria-hidden": "true" }) })
264
+ ] })
265
+ ] }) }),
266
+ !collapsed && search === "01" ? searchControl : null
267
+ ] }),
268
+ collapsed ? /* @__PURE__ */ jsxs(Fragment, { children: [
269
+ /* @__PURE__ */ jsx(AiDivider, {}),
270
+ /* @__PURE__ */ jsxs("div", { className: "flex flex-1 flex-col gap-3", children: [
271
+ /* @__PURE__ */ jsx(AiIconButton, { "aria-label": t(`${prefix}newChat`), onClick: newChat, children: /* @__PURE__ */ jsx(Plus, { "aria-hidden": "true" }) }),
272
+ /* @__PURE__ */ jsx(AiIconButton, { "aria-label": t(`${prefix}projects`), "aria-pressed": active === "projects", onClick: () => setActive("projects"), children: /* @__PURE__ */ jsx(Folder, { "aria-hidden": "true" }) }),
273
+ /* @__PURE__ */ jsx(AiIconButton, { "aria-label": t(`${prefix}library`), "aria-pressed": active === "library", onClick: () => setActive("library"), children: /* @__PURE__ */ jsx(BookOpen, { "aria-hidden": "true" }) }),
274
+ searchPopover
275
+ ] }),
276
+ /* @__PURE__ */ jsx(AiDivider, {})
277
+ ] }) : /* @__PURE__ */ jsxs(Fragment, { children: [
278
+ /* @__PURE__ */ jsxs("div", { className: "grid shrink-0 gap-1", children: [
279
+ /* @__PURE__ */ jsx(AiNewChatButton, { onClick: newChat }),
280
+ /* @__PURE__ */ jsx(AiNavItem, { active: active === "projects", onClick: () => setActive("projects"), children: t(`${prefix}projects`) }),
281
+ /* @__PURE__ */ jsx(AiNavItem, { leading: /* @__PURE__ */ jsx(BookOpen, { "aria-hidden": "true", className: "size-5" }), active: active === "library", onClick: () => setActive("library"), children: t(`${prefix}library`) }),
282
+ search === "03" ? /* @__PURE__ */ jsxs(Popover, { children: [
283
+ /* @__PURE__ */ jsx(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsxs(Button, { type: "button", variant: "ghost", className: "h-8 justify-start gap-2 rounded-md p-1.5 text-sm text-muted-foreground", children: [
284
+ /* @__PURE__ */ jsx(Search, { "aria-hidden": "true", className: "size-5" }),
285
+ t(`${prefix}search`)
286
+ ] }) }),
287
+ /* @__PURE__ */ jsx(PopoverContent, { className: "w-auto p-3", children: searchControl })
288
+ ] }) : null
289
+ ] }),
290
+ /* @__PURE__ */ jsx(AiDivider, {}),
291
+ /* @__PURE__ */ jsx("div", { className: "flex min-h-0 flex-1 flex-col gap-4 overflow-auto", children: groups.map((group, groupIndex) => /* @__PURE__ */ jsxs(React.Fragment, { children: [
292
+ groupIndex === 1 ? /* @__PURE__ */ jsx(AiDivider, {}) : null,
293
+ /* @__PURE__ */ jsxs("div", { className: "grid shrink-0 gap-2", children: [
294
+ /* @__PURE__ */ jsx("h3", { className: "px-1.5 text-xs font-medium leading-4 text-muted-foreground", children: t(`${prefix}${group.label}`) }),
295
+ /* @__PURE__ */ jsx("div", { className: "grid gap-1", children: group.items.filter((item) => t(`${prefix}${item}`).toLocaleLowerCase().includes(query.toLocaleLowerCase())).map((item) => /* @__PURE__ */ jsx(AiNavItem, { icon: group.icon, active: active === item, onClick: () => setActive(item), children: t(`${prefix}${item}`) }, item)) })
296
+ ] })
297
+ ] }, group.label)) }),
298
+ /* @__PURE__ */ jsx(AiDivider, {})
299
+ ] }),
300
+ /* @__PURE__ */ jsxs(Popover, { children: [
301
+ /* @__PURE__ */ jsx(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsxs(Button, { type: "button", variant: "ghost", "aria-label": t(`${prefix}profile`), "data-slot": "ai-sidebar-profile", className: cn("shrink-0 justify-start rounded-md text-left", collapsed ? "size-8 p-0" : "h-13 gap-3 p-1.5"), children: [
302
+ /* @__PURE__ */ jsx(Avatar, { label: "James Brown", size: collapsed ? 32 : 40 }),
303
+ !collapsed ? /* @__PURE__ */ jsxs(Fragment, { children: [
304
+ /* @__PURE__ */ jsxs("span", { className: "flex min-w-0 flex-1 flex-col gap-1", children: [
305
+ /* @__PURE__ */ jsxs("span", { className: "flex items-center gap-1 text-sm font-medium leading-5", children: [
306
+ "James Brown ",
307
+ /* @__PURE__ */ jsx(Badge, { size: 16, appearance: "light", children: "Pro" })
308
+ ] }),
309
+ /* @__PURE__ */ jsx("span", { className: "truncate text-xs font-normal leading-4 text-muted-foreground", children: "james@example.com" })
310
+ ] }),
311
+ /* @__PURE__ */ jsx(MoreVertical, { "aria-hidden": "true", className: "size-4.5" })
312
+ ] }) : null
313
+ ] }) }),
314
+ /* @__PURE__ */ jsxs(PopoverContent, { className: "w-64 text-sm", children: [
315
+ /* @__PURE__ */ jsx("p", { className: "font-medium", children: "James Brown" }),
316
+ /* @__PURE__ */ jsx("p", { className: "mt-2 text-muted-foreground", children: t(`${prefix}localOnly`) })
317
+ ] })
318
+ ] })
319
+ ] }),
320
+ /* @__PURE__ */ jsxs("output", { "aria-live": "polite", className: "grid max-w-xs gap-2 text-sm text-muted-foreground", children: [
321
+ /* @__PURE__ */ jsxs("span", { children: [
322
+ t(`${prefix}selected`),
323
+ " ",
324
+ t(`${prefix}${active}`)
325
+ ] }),
326
+ /* @__PURE__ */ jsx("span", { children: t(`${prefix}draftNumber`, { number: draft }) }),
327
+ query ? /* @__PURE__ */ jsxs("span", { children: [
328
+ t(`${prefix}query`),
329
+ " ",
330
+ query
331
+ ] }) : null
332
+ ] })
333
+ ] });
334
+ }
335
+ function AiMobileNavigationExample({ kind = "default" }) {
336
+ const t = useT();
337
+ const [model, setModel] = React.useState("GPT-4");
338
+ const [selected, setSelected] = React.useState("projects");
339
+ const [draft, setDraft] = React.useState(0);
340
+ const [project, setProject] = React.useState("");
341
+ const [name, setName] = React.useState("");
342
+ const [createOpen, setCreateOpen] = React.useState(false);
343
+ const [pinned, setPinned] = React.useState(false);
344
+ const id = React.useId();
345
+ const menu = /* @__PURE__ */ jsxs(Popover, { children: [
346
+ /* @__PURE__ */ jsx(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsx(AiIconButton, { "aria-label": t(`${prefix}menu`), children: /* @__PURE__ */ jsx(Menu, { "aria-hidden": "true" }) }) }),
347
+ /* @__PURE__ */ jsx(PopoverContent, { className: "grid w-auto gap-1 p-2", children: ["projects", "library"].map((item) => /* @__PURE__ */ jsx(AiNavItem, { mobile: true, active: selected === item, onClick: () => setSelected(item), children: t(`${prefix}${item}`) }, item)) })
348
+ ] });
349
+ const more = /* @__PURE__ */ jsxs(Popover, { children: [
350
+ /* @__PURE__ */ jsx(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsx(AiIconButton, { size: kind === "project-details" ? 24 : 32, "aria-label": t(`${prefix}more`), children: /* @__PURE__ */ jsx(MoreHorizontal, { "aria-hidden": "true" }) }) }),
351
+ /* @__PURE__ */ jsx(PopoverContent, { className: "w-64", children: /* @__PURE__ */ jsx(CheckboxField, { checked: pinned, onCheckedChange: (value) => setPinned(value === true), label: t(`${prefix}pinProject`) }) })
352
+ ] });
353
+ const create = () => {
354
+ if (!name.trim()) return;
355
+ setProject(name.trim());
356
+ setName("");
357
+ setCreateOpen(false);
358
+ };
359
+ return /* @__PURE__ */ jsxs("div", { className: "grid w-full min-w-0 max-w-sm grid-cols-1 gap-4", children: [
360
+ /* @__PURE__ */ jsx("header", { "data-slot": "ai-mobile-navigation", "data-kind": kind, className: cn("flex h-16 w-full min-w-0 items-center gap-2 bg-background px-2 py-3 sm:px-4", kind === "project-details" ? "sm:gap-2.5" : "sm:gap-3.5"), children: kind === "project-details" ? /* @__PURE__ */ jsxs(Fragment, { children: [
361
+ /* @__PURE__ */ jsx(AiIconButton, { size: 20, "aria-label": t(`${prefix}allProjects`), onClick: () => setSelected("projects"), children: /* @__PURE__ */ jsx(ArrowLeft, { "aria-hidden": "true" }) }),
362
+ /* @__PURE__ */ jsx("span", { className: "flex-1 text-sm font-medium", children: t(`${prefix}allProjects`) }),
363
+ /* @__PURE__ */ jsxs("div", { className: "flex gap-2", children: [
364
+ /* @__PURE__ */ jsx(AiIconButton, { size: 24, "aria-label": t(`${prefix}newChat`), onClick: () => setDraft((value) => value + 1), children: /* @__PURE__ */ jsx(Plus, { "aria-hidden": "true" }) }),
365
+ more
366
+ ] })
367
+ ] }) : /* @__PURE__ */ jsxs(Fragment, { children: [
368
+ menu,
369
+ kind === "projects" ? /* @__PURE__ */ jsx("div", { className: "flex flex-1 justify-end", children: /* @__PURE__ */ jsxs(Popover, { open: createOpen, onOpenChange: setCreateOpen, children: [
370
+ /* @__PURE__ */ jsx(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsxs(Button, { type: "button", size: "sm", variant: "outline", className: "w-auto shrink-0 gap-2 rounded-lg", children: [
371
+ /* @__PURE__ */ jsx(Plus, { "aria-hidden": "true", className: "size-5" }),
372
+ t(`${prefix}addProject`)
373
+ ] }) }),
374
+ /* @__PURE__ */ jsx(PopoverContent, { className: "w-72", children: /* @__PURE__ */ jsxs("form", { className: "grid gap-3", onSubmit: (event) => {
375
+ event.preventDefault();
376
+ create();
377
+ }, onKeyDown: (event) => {
378
+ if (event.key === "Enter" && (event.ctrlKey || event.metaKey)) {
379
+ event.preventDefault();
380
+ create();
381
+ }
382
+ }, children: [
383
+ /* @__PURE__ */ jsx(FieldLabel, { htmlFor: id, required: true, children: t(`${prefix}projectName`) }),
384
+ /* @__PURE__ */ jsx(Input, { id, value: name, onChange: (event) => setName(event.target.value), autoFocus: true }),
385
+ /* @__PURE__ */ jsx(Button, { type: "submit", size: "sm", disabled: !name.trim(), children: t(`${prefix}addProject`) })
386
+ ] }) })
387
+ ] }) }) : /* @__PURE__ */ jsxs(Fragment, { children: [
388
+ /* @__PURE__ */ jsxs("div", { className: "flex min-w-0 flex-1 flex-col gap-1", children: [
389
+ /* @__PURE__ */ jsx(AiModelSelect, { value: model, onChange: setModel, compact: true }),
390
+ kind === "in-projects" ? /* @__PURE__ */ jsx("span", { className: "truncate text-xs leading-4 text-muted-foreground", children: t(`${prefix}launchPlan`) }) : null
391
+ ] }),
392
+ /* @__PURE__ */ jsx(AiIconButton, { "aria-label": t(`${prefix}newChat`), onClick: () => setDraft((value) => value + 1), children: /* @__PURE__ */ jsx(Plus, { "aria-hidden": "true" }) }),
393
+ more
394
+ ] })
395
+ ] }) }),
396
+ /* @__PURE__ */ jsxs("output", { "aria-live": "polite", className: "grid gap-1 text-xs text-muted-foreground", children: [
397
+ /* @__PURE__ */ jsxs("span", { children: [
398
+ t(`${prefix}selected`),
399
+ " ",
400
+ t(`${prefix}${selected}`)
401
+ ] }),
402
+ /* @__PURE__ */ jsx("span", { children: t(`${prefix}draftNumber`, { number: draft }) }),
403
+ project ? /* @__PURE__ */ jsxs("span", { children: [
404
+ t(`${prefix}createdProject`),
405
+ " ",
406
+ project
407
+ ] }) : null,
408
+ pinned ? /* @__PURE__ */ jsx("span", { children: t(`${prefix}pinProject`) }) : null
409
+ ] })
410
+ ] });
411
+ }
412
+ export {
413
+ AiAuthExamples,
414
+ AiIconButtonExamples,
415
+ AiMobileNavigationExample,
416
+ AiNavigationExamples,
417
+ AiNewChatExample,
418
+ AiPromptExample,
419
+ AiSearchExamples,
420
+ AiSettingsExamples,
421
+ AiSidebarExample
422
+ };
423
+ //# sourceMappingURL=ai-product.js.map