@nlabs/gothamui 1.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (426) hide show
  1. package/LICENSE +21 -0
  2. package/MIGRATION.md +36 -0
  3. package/README.md +768 -0
  4. package/docs/assets/gothamui-app-architecture.svg +159 -0
  5. package/docs/assets/gothamui-logo.png +0 -0
  6. package/docs/assets/gothamui-logo.svg +42 -0
  7. package/docs/render-performance.md +34 -0
  8. package/lib/actions/GothamActions.d.ts +42 -0
  9. package/lib/actions/GothamActions.js +67 -0
  10. package/lib/actions/MarkdownActions.d.ts +4 -0
  11. package/lib/actions/MarkdownActions.js +48 -0
  12. package/lib/app.d.ts +1 -0
  13. package/lib/app.js +198 -0
  14. package/lib/components/Alert/Alert.d.ts +8 -0
  15. package/lib/components/Alert/Alert.js +24 -0
  16. package/lib/components/Alert/Alert.stories.js +59 -0
  17. package/lib/components/AuthRoute/AuthRoute.d.ts +3 -0
  18. package/lib/components/AuthRoute/AuthRoute.js +21 -0
  19. package/lib/components/AuthRoute/AuthRoute.stories.js +45 -0
  20. package/lib/components/AutocompleteField/AutocompleteField.d.ts +24 -0
  21. package/lib/components/AutocompleteField/AutocompleteField.js +148 -0
  22. package/lib/components/AutocompleteField/AutocompleteField.stories.js +62 -0
  23. package/lib/components/Avatar/Avatar.d.ts +29 -0
  24. package/lib/components/Avatar/Avatar.js +154 -0
  25. package/lib/components/Avatar/Avatar.stories.js +105 -0
  26. package/lib/components/Badge/Badge.d.ts +9 -0
  27. package/lib/components/Badge/Badge.js +22 -0
  28. package/lib/components/Badge/Badge.stories.js +53 -0
  29. package/lib/components/Breadcrumbs/Breadcrumbs.d.ts +19 -0
  30. package/lib/components/Breadcrumbs/Breadcrumbs.js +74 -0
  31. package/lib/components/Breadcrumbs/Breadcrumbs.stories.js +95 -0
  32. package/lib/components/Button/Button.d.ts +25 -0
  33. package/lib/components/Button/Button.js +157 -0
  34. package/lib/components/Button/Button.stories.js +119 -0
  35. package/lib/components/Card/Card.d.ts +8 -0
  36. package/lib/components/Card/Card.js +39 -0
  37. package/lib/components/Card/Card.stories.js +60 -0
  38. package/lib/components/CategoryGrid/CategoryGrid.d.ts +15 -0
  39. package/lib/components/CategoryGrid/CategoryGrid.js +42 -0
  40. package/lib/components/CategoryGrid/CategoryGrid.stories.js +35 -0
  41. package/lib/components/Chat/AudioMessage/AudioMessage.css +1 -0
  42. package/lib/components/Chat/AudioMessage/AudioMessage.d.ts +3 -0
  43. package/lib/components/Chat/AudioMessage/AudioMessage.js +28 -0
  44. package/lib/components/Chat/Avatar/Avatar.css +1 -0
  45. package/lib/components/Chat/Avatar/Avatar.d.ts +3 -0
  46. package/lib/components/Chat/Avatar/Avatar.js +72 -0
  47. package/lib/components/Chat/Button/Button.css +1 -0
  48. package/lib/components/Chat/Button/Button.d.ts +3 -0
  49. package/lib/components/Chat/Button/Button.js +37 -0
  50. package/lib/components/Chat/Chat.stories.js +688 -0
  51. package/lib/components/Chat/ChatItem/ChatItem.css +1 -0
  52. package/lib/components/Chat/ChatItem/ChatItem.d.ts +3 -0
  53. package/lib/components/Chat/ChatItem/ChatItem.js +183 -0
  54. package/lib/components/Chat/ChatList/ChatList.css +1 -0
  55. package/lib/components/Chat/ChatList/ChatList.d.ts +3 -0
  56. package/lib/components/Chat/ChatList/ChatList.js +84 -0
  57. package/lib/components/Chat/Circle/Circle.d.ts +3 -0
  58. package/lib/components/Chat/Circle/Circle.js +27 -0
  59. package/lib/components/Chat/Dropdown/Dropdown.css +1 -0
  60. package/lib/components/Chat/Dropdown/Dropdown.d.ts +3 -0
  61. package/lib/components/Chat/Dropdown/Dropdown.js +66 -0
  62. package/lib/components/Chat/FileMessage/FileMessage.css +1 -0
  63. package/lib/components/Chat/FileMessage/FileMessage.d.ts +3 -0
  64. package/lib/components/Chat/FileMessage/FileMessage.js +77 -0
  65. package/lib/components/Chat/Input/Input.css +1 -0
  66. package/lib/components/Chat/Input/Input.d.ts +3 -0
  67. package/lib/components/Chat/Input/Input.js +108 -0
  68. package/lib/components/Chat/LocationMessage/LocationMessage.css +1 -0
  69. package/lib/components/Chat/LocationMessage/LocationMessage.d.ts +3 -0
  70. package/lib/components/Chat/LocationMessage/LocationMessage.js +36 -0
  71. package/lib/components/Chat/MeetingItem/MeetingItem.css +1 -0
  72. package/lib/components/Chat/MeetingItem/MeetingItem.d.ts +3 -0
  73. package/lib/components/Chat/MeetingItem/MeetingItem.js +106 -0
  74. package/lib/components/Chat/MeetingLink/MeetingLink.css +1 -0
  75. package/lib/components/Chat/MeetingLink/MeetingLink.d.ts +3 -0
  76. package/lib/components/Chat/MeetingLink/MeetingLink.js +26 -0
  77. package/lib/components/Chat/MeetingList/MeetingList.css +1 -0
  78. package/lib/components/Chat/MeetingList/MeetingList.d.ts +3 -0
  79. package/lib/components/Chat/MeetingList/MeetingList.js +52 -0
  80. package/lib/components/Chat/MeetingMessage/MeetingMessage.css +1 -0
  81. package/lib/components/Chat/MeetingMessage/MeetingMessage.d.ts +3 -0
  82. package/lib/components/Chat/MeetingMessage/MeetingMessage.js +227 -0
  83. package/lib/components/Chat/MessageBox/MessageBox.css +1 -0
  84. package/lib/components/Chat/MessageBox/MessageBox.d.ts +3 -0
  85. package/lib/components/Chat/MessageBox/MessageBox.js +263 -0
  86. package/lib/components/Chat/MessageList/MessageList.css +1 -0
  87. package/lib/components/Chat/MessageList/MessageList.d.ts +2 -0
  88. package/lib/components/Chat/MessageList/MessageList.js +196 -0
  89. package/lib/components/Chat/Navbar/Navbar.css +1 -0
  90. package/lib/components/Chat/Navbar/Navbar.d.ts +3 -0
  91. package/lib/components/Chat/Navbar/Navbar.js +21 -0
  92. package/lib/components/Chat/PhotoMessage/PhotoMessage.css +1 -0
  93. package/lib/components/Chat/PhotoMessage/PhotoMessage.d.ts +3 -0
  94. package/lib/components/Chat/PhotoMessage/PhotoMessage.js +73 -0
  95. package/lib/components/Chat/Popup/Popup.css +1 -0
  96. package/lib/components/Chat/Popup/Popup.d.ts +3 -0
  97. package/lib/components/Chat/Popup/Popup.js +45 -0
  98. package/lib/components/Chat/README.md +50 -0
  99. package/lib/components/Chat/ReplyMessage/ReplyMessage.css +1 -0
  100. package/lib/components/Chat/ReplyMessage/ReplyMessage.d.ts +3 -0
  101. package/lib/components/Chat/ReplyMessage/ReplyMessage.js +42 -0
  102. package/lib/components/Chat/SideBar/SideBar.css +1 -0
  103. package/lib/components/Chat/SideBar/SideBar.d.ts +3 -0
  104. package/lib/components/Chat/SideBar/SideBar.js +21 -0
  105. package/lib/components/Chat/SpotifyMessage/SpotifyMessage.css +1 -0
  106. package/lib/components/Chat/SpotifyMessage/SpotifyMessage.d.ts +3 -0
  107. package/lib/components/Chat/SpotifyMessage/SpotifyMessage.js +28 -0
  108. package/lib/components/Chat/SystemMessage/SystemMessage.css +1 -0
  109. package/lib/components/Chat/SystemMessage/SystemMessage.d.ts +3 -0
  110. package/lib/components/Chat/SystemMessage/SystemMessage.js +14 -0
  111. package/lib/components/Chat/VideoMessage/VideoMessage.css +1 -0
  112. package/lib/components/Chat/VideoMessage/VideoMessage.d.ts +3 -0
  113. package/lib/components/Chat/VideoMessage/VideoMessage.js +88 -0
  114. package/lib/components/Chat/assets/img/leftArrow.svg +6 -0
  115. package/lib/components/Chat/assets/img/rightArrow.svg +6 -0
  116. package/lib/components/Chat/index.d.ts +25 -0
  117. package/lib/components/Chat/index.js +27 -0
  118. package/lib/components/Chat/type.d.js +52 -0
  119. package/lib/components/Chat/utils/formatRelativeDate.d.ts +4 -0
  120. package/lib/components/Chat/utils/formatRelativeDate.js +110 -0
  121. package/lib/components/Checkbox/Checkbox.d.ts +15 -0
  122. package/lib/components/Checkbox/Checkbox.js +106 -0
  123. package/lib/components/Checkbox/Checkbox.stories.js +51 -0
  124. package/lib/components/ComponentUtils/renderWithAsChild.d.ts +9 -0
  125. package/lib/components/ComponentUtils/renderWithAsChild.js +27 -0
  126. package/lib/components/Container/Container.d.ts +7 -0
  127. package/lib/components/Container/Container.js +16 -0
  128. package/lib/components/Container/Container.stories.js +36 -0
  129. package/lib/components/DateField/DateField.d.ts +22 -0
  130. package/lib/components/DateField/DateField.js +145 -0
  131. package/lib/components/DateField/DateField.stories.js +125 -0
  132. package/lib/components/DateField/DatePicker.d.ts +9 -0
  133. package/lib/components/DateField/DatePicker.js +205 -0
  134. package/lib/components/DateField/DatePicker.stories.js +33 -0
  135. package/lib/components/DescriptionList/DescriptionList.d.ts +4 -0
  136. package/lib/components/DescriptionList/DescriptionList.js +19 -0
  137. package/lib/components/DescriptionList/DescriptionList.stories.js +34 -0
  138. package/lib/components/Dialog/Dialog.d.ts +25 -0
  139. package/lib/components/Dialog/Dialog.js +66 -0
  140. package/lib/components/Dialog/Dialog.stories.js +88 -0
  141. package/lib/components/DropUpload/DropUpload.d.ts +37 -0
  142. package/lib/components/DropUpload/DropUpload.js +323 -0
  143. package/lib/components/DropUpload/DropUpload.stories.js +48 -0
  144. package/lib/components/Empty/Empty.d.ts +11 -0
  145. package/lib/components/Empty/Empty.js +39 -0
  146. package/lib/components/Empty/Empty.stories.js +52 -0
  147. package/lib/components/EmptyState/EmptyState.d.ts +15 -0
  148. package/lib/components/EmptyState/EmptyState.js +44 -0
  149. package/lib/components/EmptyState/EmptyState.stories.js +36 -0
  150. package/lib/components/ErrorMessage/ErrorMessage.d.ts +7 -0
  151. package/lib/components/ErrorMessage/ErrorMessage.js +20 -0
  152. package/lib/components/ErrorMessage/ErrorMessage.stories.js +25 -0
  153. package/lib/components/FaqSection/FaqSection.d.ts +14 -0
  154. package/lib/components/FaqSection/FaqSection.js +37 -0
  155. package/lib/components/FaqSection/FaqSection.stories.js +31 -0
  156. package/lib/components/Fieldset/Fieldset.d.ts +21 -0
  157. package/lib/components/Fieldset/Fieldset.js +39 -0
  158. package/lib/components/Fieldset/Fieldset.stories.js +42 -0
  159. package/lib/components/Footer/Footer.d.ts +26 -0
  160. package/lib/components/Footer/Footer.js +119 -0
  161. package/lib/components/Footer/Footer.stories.js +184 -0
  162. package/lib/components/Form/Form.d.ts +42 -0
  163. package/lib/components/Form/Form.js +198 -0
  164. package/lib/components/Form/Form.stories.js +65 -0
  165. package/lib/components/Form/FormContext.d.ts +35 -0
  166. package/lib/components/Form/FormContext.js +71 -0
  167. package/lib/components/GothamRoute/GothamRoute.d.ts +0 -0
  168. package/lib/components/GothamRoute/GothamRoute.js +56 -0
  169. package/lib/components/GothamRouter/GothamRouter.d.ts +0 -0
  170. package/lib/components/GothamRouter/GothamRouter.js +52 -0
  171. package/lib/components/Heading/Heading.d.ts +7 -0
  172. package/lib/components/Heading/Heading.js +20 -0
  173. package/lib/components/Heading/Heading.stories.js +51 -0
  174. package/lib/components/IncentiveGrid/IncentiveGrid.d.ts +15 -0
  175. package/lib/components/IncentiveGrid/IncentiveGrid.js +34 -0
  176. package/lib/components/IncentiveGrid/IncentiveGrid.stories.js +41 -0
  177. package/lib/components/InputField/InputField.d.ts +25 -0
  178. package/lib/components/InputField/InputField.js +68 -0
  179. package/lib/components/InputField/InputField.stories.js +58 -0
  180. package/lib/components/Item/Item.d.ts +25 -0
  181. package/lib/components/Item/Item.js +79 -0
  182. package/lib/components/Item/Item.stories.js +94 -0
  183. package/lib/components/Kbd/Kbd.d.ts +2 -0
  184. package/lib/components/Kbd/Kbd.js +9 -0
  185. package/lib/components/Kbd/Kbd.stories.js +24 -0
  186. package/lib/components/Label/Label.d.ts +11 -0
  187. package/lib/components/Label/Label.js +23 -0
  188. package/lib/components/Label/Label.stories.js +38 -0
  189. package/lib/components/Link/Link.d.ts +7 -0
  190. package/lib/components/Link/Link.js +13 -0
  191. package/lib/components/Link/Link.stories.js +28 -0
  192. package/lib/components/ListContainer/ListContainer.d.ts +8 -0
  193. package/lib/components/ListContainer/ListContainer.js +14 -0
  194. package/lib/components/ListContainer/ListContainer.stories.js +45 -0
  195. package/lib/components/Loader/Loader.d.ts +9 -0
  196. package/lib/components/Loader/Loader.js +36 -0
  197. package/lib/components/Loader/Loader.stories.js +94 -0
  198. package/lib/components/LogoCloud/LogoCloud.d.ts +15 -0
  199. package/lib/components/LogoCloud/LogoCloud.js +43 -0
  200. package/lib/components/LogoCloud/LogoCloud.stories.js +28 -0
  201. package/lib/components/Markdown/Markdown.d.ts +8 -0
  202. package/lib/components/Markdown/Markdown.js +64 -0
  203. package/lib/components/Markdown/Markdown.stories.js +34 -0
  204. package/lib/components/MediaLightbox/MediaLightbox.d.ts +22 -0
  205. package/lib/components/MediaLightbox/MediaLightbox.js +80 -0
  206. package/lib/components/MediaObject/MediaObject.d.ts +8 -0
  207. package/lib/components/MediaObject/MediaObject.js +37 -0
  208. package/lib/components/MediaObject/MediaObject.stories.js +28 -0
  209. package/lib/components/Navbar/Navbar.d.ts +43 -0
  210. package/lib/components/Navbar/Navbar.js +213 -0
  211. package/lib/components/Navbar/Navbar.stories.js +235 -0
  212. package/lib/components/NotFound/NotFound.d.ts +34 -0
  213. package/lib/components/NotFound/NotFound.js +351 -0
  214. package/lib/components/NotFound/NotFound.stories.js +80 -0
  215. package/lib/components/Notify/Notify.d.ts +18 -0
  216. package/lib/components/Notify/Notify.js +178 -0
  217. package/lib/components/Notify/Notify.stories.js +148 -0
  218. package/lib/components/Notify/NotifyExample.d.ts +1 -0
  219. package/lib/components/Notify/NotifyExample.js +174 -0
  220. package/lib/components/Notify/README.md +103 -0
  221. package/lib/components/Pagination/Pagination.d.ts +18 -0
  222. package/lib/components/Pagination/Pagination.js +225 -0
  223. package/lib/components/Pagination/Pagination.stories.js +69 -0
  224. package/lib/components/PasswordStrengthMeter/PasswordStrengthMeter.d.ts +12 -0
  225. package/lib/components/PasswordStrengthMeter/PasswordStrengthMeter.js +88 -0
  226. package/lib/components/PasswordStrengthMeter/PasswordStrengthMeter.stories.js +16 -0
  227. package/lib/components/PaymentMethodPanel/PaymentMethodPanel.d.ts +18 -0
  228. package/lib/components/PaymentMethodPanel/PaymentMethodPanel.js +113 -0
  229. package/lib/components/PaymentMethodPanel/PaymentMethodPanel.stories.js +88 -0
  230. package/lib/components/Pricing/Pricing.d.ts +78 -0
  231. package/lib/components/Pricing/Pricing.js +764 -0
  232. package/lib/components/Pricing/Pricing.stories.js +146 -0
  233. package/lib/components/ProductGrid/ProductGrid.d.ts +23 -0
  234. package/lib/components/ProductGrid/ProductGrid.js +79 -0
  235. package/lib/components/ProductGrid/ProductGrid.stories.js +50 -0
  236. package/lib/components/ProgressSteps/ProgressSteps.d.ts +13 -0
  237. package/lib/components/ProgressSteps/ProgressSteps.js +51 -0
  238. package/lib/components/ProgressSteps/ProgressSteps.stories.js +35 -0
  239. package/lib/components/RadioField/RadioField.d.ts +16 -0
  240. package/lib/components/RadioField/RadioField.js +63 -0
  241. package/lib/components/RadioField/RadioField.stories.js +140 -0
  242. package/lib/components/ReviewList/ReviewList.d.ts +15 -0
  243. package/lib/components/ReviewList/ReviewList.js +51 -0
  244. package/lib/components/ReviewList/ReviewList.stories.js +29 -0
  245. package/lib/components/SectionHeader/SectionHeader.d.ts +9 -0
  246. package/lib/components/SectionHeader/SectionHeader.js +36 -0
  247. package/lib/components/SectionHeader/SectionHeader.stories.js +35 -0
  248. package/lib/components/SelectField/SelectField.d.ts +18 -0
  249. package/lib/components/SelectField/SelectField.js +145 -0
  250. package/lib/components/SelectField/SelectField.stories.js +155 -0
  251. package/lib/components/SelectField/SelectOption.d.ts +13 -0
  252. package/lib/components/SelectField/SelectOption.js +40 -0
  253. package/lib/components/SelectField/SelectOption.stories.js +40 -0
  254. package/lib/components/Separator/Separator.d.ts +6 -0
  255. package/lib/components/Separator/Separator.js +13 -0
  256. package/lib/components/Separator/Separator.stories.js +70 -0
  257. package/lib/components/Skeleton/Skeleton.d.ts +2 -0
  258. package/lib/components/Skeleton/Skeleton.js +9 -0
  259. package/lib/components/Skeleton/Skeleton.stories.js +24 -0
  260. package/lib/components/Svg/Svg.d.ts +9 -0
  261. package/lib/components/Svg/Svg.js +25 -0
  262. package/lib/components/Svg/Svg.stories.js +34 -0
  263. package/lib/components/Switch/Switch.d.ts +12 -0
  264. package/lib/components/Switch/Switch.js +54 -0
  265. package/lib/components/Switch/Switch.stories.js +61 -0
  266. package/lib/components/Table/Table.d.ts +18 -0
  267. package/lib/components/Table/Table.js +99 -0
  268. package/lib/components/Table/Table.stories.js +79 -0
  269. package/lib/components/Tabs/Tabs.d.ts +17 -0
  270. package/lib/components/Tabs/Tabs.js +85 -0
  271. package/lib/components/Tabs/Tabs.stories.js +45 -0
  272. package/lib/components/Text/Text.d.ts +5 -0
  273. package/lib/components/Text/Text.js +24 -0
  274. package/lib/components/Text/Text.stories.js +35 -0
  275. package/lib/components/TextField/TextField.d.ts +31 -0
  276. package/lib/components/TextField/TextField.js +91 -0
  277. package/lib/components/TextField/TextField.stories.js +158 -0
  278. package/lib/components/Textarea/Textarea.d.ts +5 -0
  279. package/lib/components/Textarea/Textarea.js +10 -0
  280. package/lib/components/Textarea/Textarea.stories.js +32 -0
  281. package/lib/components/index.d.ts +60 -0
  282. package/lib/components/index.js +62 -0
  283. package/lib/config/appConfig.d.ts +5 -0
  284. package/lib/config/appConfig.js +20 -0
  285. package/lib/constants/AuthConstants.d.ts +8 -0
  286. package/lib/constants/AuthConstants.js +9 -0
  287. package/lib/constants/GothamConstants.d.ts +24 -0
  288. package/lib/constants/GothamConstants.js +25 -0
  289. package/lib/constants/MarkdownConstants.d.ts +8 -0
  290. package/lib/constants/MarkdownConstants.js +9 -0
  291. package/lib/constants/MessageConstants.d.ts +10 -0
  292. package/lib/constants/MessageConstants.js +11 -0
  293. package/lib/docs/analytics.md +231 -0
  294. package/lib/docs/api-reference.md +364 -0
  295. package/lib/docs/comparison.md +83 -0
  296. package/lib/docs/containers.md +11 -0
  297. package/lib/docs/gettingStarted.md +338 -0
  298. package/lib/docs/payments.md +79 -0
  299. package/lib/editor/CodeEditor.d.ts +11 -0
  300. package/lib/editor/CodeEditor.js +15 -0
  301. package/lib/editor/CodeEditor.stories.js +24 -0
  302. package/lib/editor/index.d.ts +1 -0
  303. package/lib/editor/index.js +3 -0
  304. package/lib/errors/UserError.d.ts +8 -0
  305. package/lib/errors/UserError.js +12 -0
  306. package/lib/examples/OptimizedFormExample.d.ts +1 -0
  307. package/lib/examples/OptimizedFormExample.js +130 -0
  308. package/lib/form/index.d.ts +11 -0
  309. package/lib/form/index.js +13 -0
  310. package/lib/hooks/useIsMobile.d.ts +1 -0
  311. package/lib/hooks/useIsMobile.js +12 -0
  312. package/lib/i18n/index.d.ts +8 -0
  313. package/lib/i18n/index.js +7 -0
  314. package/lib/icons/Dual Ring-1s-100px.svg +1 -0
  315. package/lib/icons/gotham-logo.svg +17 -0
  316. package/lib/icons/gotham.svg +8 -0
  317. package/lib/icons/index.d.ts +5 -0
  318. package/lib/icons/index.js +6 -0
  319. package/lib/icons/pencil.svg +6 -0
  320. package/lib/img/arkhamjs-logo.png +0 -0
  321. package/lib/img/logo.png +0 -0
  322. package/lib/index.d.ts +25 -0
  323. package/lib/index.js +25 -0
  324. package/lib/router/index.d.ts +5 -0
  325. package/lib/router/index.js +6 -0
  326. package/lib/stores/GothamAppStore.d.ts +35 -0
  327. package/lib/stores/GothamAppStore.js +70 -0
  328. package/lib/stories/Button.d.ts +28 -0
  329. package/lib/stories/Button.js +22 -0
  330. package/lib/stories/Header.d.ts +12 -0
  331. package/lib/stories/Header.js +78 -0
  332. package/lib/stories/Page.d.ts +3 -0
  333. package/lib/stories/Page.js +108 -0
  334. package/lib/stories/assets/accessibility.png +0 -0
  335. package/lib/stories/assets/accessibility.svg +5 -0
  336. package/lib/stories/assets/addon-library.png +0 -0
  337. package/lib/stories/assets/assets.png +0 -0
  338. package/lib/stories/assets/context.png +0 -0
  339. package/lib/stories/assets/discord.svg +15 -0
  340. package/lib/stories/assets/docs.png +0 -0
  341. package/lib/stories/assets/figma-plugin.png +0 -0
  342. package/lib/stories/assets/github.svg +3 -0
  343. package/lib/stories/assets/share.png +0 -0
  344. package/lib/stories/assets/styling.png +0 -0
  345. package/lib/stories/assets/testing.png +0 -0
  346. package/lib/stories/assets/theming.png +0 -0
  347. package/lib/stories/assets/tutorials.svg +12 -0
  348. package/lib/stories/assets/youtube.svg +4 -0
  349. package/lib/stories/button.css +1 -0
  350. package/lib/stories/header.css +1 -0
  351. package/lib/stories/page.css +1 -0
  352. package/lib/styles/chat.css +1 -0
  353. package/lib/styles/index.css +2 -0
  354. package/lib/styles/tailwind.css +1 -0
  355. package/lib/types/assets.d.js +2 -0
  356. package/lib/types/gotham.d.ts +12 -0
  357. package/lib/types/gotham.js +3 -0
  358. package/lib/types/vitest-globals.d.js +3 -0
  359. package/lib/utils/GothamContext.d.ts +14 -0
  360. package/lib/utils/GothamContext.js +14 -0
  361. package/lib/utils/awsRum.d.ts +23 -0
  362. package/lib/utils/awsRum.js +50 -0
  363. package/lib/utils/colorUtils.d.ts +20 -0
  364. package/lib/utils/colorUtils.js +499 -0
  365. package/lib/utils/contentUtils.d.ts +2 -0
  366. package/lib/utils/contentUtils.js +18 -0
  367. package/lib/utils/i18nUtil.d.ts +1 -0
  368. package/lib/utils/i18nUtil.js +7 -0
  369. package/lib/utils/imageUtils.d.ts +5 -0
  370. package/lib/utils/imageUtils.js +48 -0
  371. package/lib/utils/interactionAnalytics.d.ts +10 -0
  372. package/lib/utils/interactionAnalytics.js +142 -0
  373. package/lib/utils/navEventQueue.d.ts +6 -0
  374. package/lib/utils/navEventQueue.js +50 -0
  375. package/lib/utils/refUtils.d.ts +2 -0
  376. package/lib/utils/refUtils.js +11 -0
  377. package/lib/utils/routeUtils.d.ts +12 -0
  378. package/lib/utils/routeUtils.js +109 -0
  379. package/lib/utils/sizeUtils.d.ts +5 -0
  380. package/lib/utils/sizeUtils.js +6 -0
  381. package/lib/utils/storyInteractions.d.ts +6 -0
  382. package/lib/utils/storyInteractions.js +45 -0
  383. package/lib/utils/storyUtils.d.ts +1 -0
  384. package/lib/utils/storyUtils.js +11 -0
  385. package/lib/utils/testUtils.d.ts +3 -0
  386. package/lib/utils/testUtils.js +56 -0
  387. package/lib/utils/timer.d.ts +21 -0
  388. package/lib/utils/timer.js +38 -0
  389. package/lib/utils/useBreakpoint.d.ts +6 -0
  390. package/lib/utils/useBreakpoint.js +56 -0
  391. package/lib/utils/viewPerformance.d.ts +34 -0
  392. package/lib/utils/viewPerformance.js +103 -0
  393. package/lib/utils/viewUtils.d.ts +9 -0
  394. package/lib/utils/viewUtils.js +44 -0
  395. package/lib/views/AuthSignInView/AuthSignInView.d.ts +20 -0
  396. package/lib/views/AuthSignInView/AuthSignInView.js +107 -0
  397. package/lib/views/AuthSignInView/AuthSignInView.stories.js +29 -0
  398. package/lib/views/AuthSignUpView/AuthSignUpView.d.ts +21 -0
  399. package/lib/views/AuthSignUpView/AuthSignUpView.js +146 -0
  400. package/lib/views/AuthSignUpView/AuthSignUpView.stories.js +30 -0
  401. package/lib/views/AuthView/AuthView.d.ts +16 -0
  402. package/lib/views/AuthView/AuthView.js +60 -0
  403. package/lib/views/AuthView/AuthView.stories.js +34 -0
  404. package/lib/views/DefaultView/DefaultView.d.ts +5 -0
  405. package/lib/views/DefaultView/DefaultView.js +134 -0
  406. package/lib/views/Gotham/Gotham.d.ts +44 -0
  407. package/lib/views/Gotham/Gotham.js +24 -0
  408. package/lib/views/Gotham/Gotham.stories.js +31 -0
  409. package/lib/views/Gotham/GothamListeners.d.ts +0 -0
  410. package/lib/views/Gotham/GothamListeners.js +2 -0
  411. package/lib/views/Gotham/GothamProvider.d.ts +43 -0
  412. package/lib/views/Gotham/GothamProvider.js +217 -0
  413. package/lib/views/Gotham/GothamRoot.d.ts +6 -0
  414. package/lib/views/Gotham/GothamRoot.js +69 -0
  415. package/lib/views/HomeView/HomeView.d.ts +10 -0
  416. package/lib/views/HomeView/HomeView.js +134 -0
  417. package/lib/views/LoaderView/LoaderView.d.ts +8 -0
  418. package/lib/views/LoaderView/LoaderView.js +30 -0
  419. package/lib/views/MenuView/MenuView.d.ts +13 -0
  420. package/lib/views/MenuView/MenuView.js +305 -0
  421. package/lib/views/NotFoundView/NotFoundView.d.ts +2 -0
  422. package/lib/views/NotFoundView/NotFoundView.js +12 -0
  423. package/lib/views/index.d.ts +11 -0
  424. package/lib/views/index.js +13 -0
  425. package/package.json +202 -0
  426. package/styles/tailwind.css +1 -0
package/README.md ADDED
@@ -0,0 +1,768 @@
1
+ # GothamUI: The Complete Front-End UI Framework
2
+
3
+ > **GothamJS is now GothamUI.** Install `@nlabs/gothamui`. Existing component APIs and subpath exports are preserved. See the [migration guide](MIGRATION.md).
4
+
5
+ ![GothamUI lowercase g logo](docs/assets/gothamui-logo.png)
6
+
7
+ ## Seamlessly integrating components, routing, state management, and transitions
8
+
9
+ > A comprehensive front-end UI framework that handles everything from component rendering to routing and smooth transitions with minimal configuration.
10
+
11
+ [![npm version](https://img.shields.io/npm/v/@nlabs/gothamui.svg?style=flat-square)](https://www.npmjs.com/package/@nlabs/gothamui)
12
+ [![npm downloads](https://img.shields.io/npm/dm/@nlabs/gothamui.svg?style=flat-square)](https://www.npmjs.com/package/@nlabs/gothamui)
13
+ [![Documentation](https://img.shields.io/badge/docs-gothamui.nitrogenx.co-6d28d9?style=flat-square)](https://gothamui.nitrogenx.co)
14
+ [![Issues](http://img.shields.io/github/issues/nitrogenlabs/gothamui.svg?style=flat-square)](https://github.com/nitrogenlabs/gothamui/issues)
15
+ [![TypeScript](https://badges.frapsoft.com/typescript/version/typescript-next.svg?v=101)](https://github.com/ellerbrock/typescript-badges/)
16
+ [![MIT license](http://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square)](http://opensource.org/licenses/MIT)
17
+ [![Chat](https://img.shields.io/discord/446122412715802649.svg)](https://discord.gg/Ttgev58)
18
+
19
+ GothamUI is an all-inclusive React framework that unifies UI components, navigation, state management, and transitions into one cohesive system. Built by Nitrogen Labs, GothamUI eliminates the need to piece together multiple libraries, providing developers with a consistent, integrated solution for all front-end UI needs.
20
+
21
+ ## How GothamUI fits into your app
22
+
23
+ Your application keeps ownership of its routes, configuration, domain logic, and data. GothamUI turns those inputs into a cohesive presentation layer with components, navigation, state, forms, responsive styling, localization, and telemetry built in.
24
+
25
+ ![GothamUI architecture showing how a React app flows through the GothamUI presentation layer into a complete user experience](docs/assets/gothamui-app-architecture.svg)
26
+
27
+ ## Key Features
28
+
29
+ - **Unified Component Library**: Beautifully designed, fully customizable UI components with consistent styling and behavior
30
+ - **Seamless Routing & Transitions**: Built-in navigation system with smooth page transitions and animations
31
+ - **Integrated State Management**: Flux-based state handling that connects directly to your UI components
32
+ - **Form System**: Complete form components with validation, error handling, and accessibility features
33
+ - **Theming & Styling**: Light/dark mode support and customizable design system based on Tailwind CSS
34
+ - **Responsive Design**: Mobile-first components that adapt beautifully to any screen size
35
+ - **Internationalization**: Built-in i18n support for multilingual applications
36
+ - **Authentication Flows**: Ready-to-use authentication UI components and routing guards
37
+ - **Icon Library**: Complete Lucide React icon set available for use throughout your application
38
+
39
+ ## Getting Started
40
+
41
+ ```bash
42
+ # Install GothamUI
43
+ npm install @nlabs/gothamui
44
+
45
+ # Or with yarn
46
+ yarn add @nlabs/gothamui
47
+ ```
48
+
49
+ Create your first GothamUI application:
50
+
51
+ ```jsx
52
+ import {createRoot} from 'react-dom/client';
53
+ import {Gotham} from '@nlabs/gothamui';
54
+
55
+ // Define your application configuration
56
+ const config = {
57
+ app: {
58
+ name: 'my-awesome-app',
59
+ title: 'My Awesome App'
60
+ },
61
+ routes: [
62
+ {
63
+ path: '/',
64
+ element: <HomePage />,
65
+ props: {
66
+ topBar: {
67
+ logo: <img src="/logo.png" alt="Logo" />,
68
+ menu: [
69
+ { label: 'Sign In', url: '/signin' },
70
+ { label: 'Sign Up', url: '/signup' }
71
+ ]
72
+ }
73
+ }
74
+ }
75
+ ]
76
+ };
77
+
78
+ // Render your application
79
+ const root = createRoot(document.getElementById('app'));
80
+ root.render(<Gotham config={config} />);
81
+ ```
82
+
83
+ ## CSS and Styling
84
+
85
+ GothamUI uses Tailwind CSS with custom theme variables for consistent styling. To use GothamUI components with proper styling in your project, you need to import the GothamUI theme CSS.
86
+
87
+ ### Importing GothamUI Styles
88
+
89
+ ```css
90
+ /* Import GothamUI theme CSS in your main CSS file */
91
+ @import '@nlabs/gothamui/styles/tailwind.css';
92
+ ```
93
+
94
+ ### Tailwind CSS v4 Configuration
95
+
96
+ Since GothamUI uses Tailwind CSS v4, configuration is done via CSS custom properties instead of a `tailwind.config.js` file. The GothamUI theme CSS already includes all the necessary color variables.
97
+
98
+ If you need to customize the theme further, you can override the CSS custom properties in your own CSS:
99
+
100
+ ```css
101
+ /* In your main CSS file, after importing GothamUI styles */
102
+ @import '@nlabs/gothamui/styles/tailwind.css';
103
+
104
+ /* Override GothamUI theme variables */
105
+ @theme {
106
+ --color-primary: #your-custom-primary;
107
+ --color-secondary: #your-custom-secondary;
108
+ }
109
+ ```
110
+
111
+ ### Source Detection (Tailwind v4.2)
112
+
113
+ Tailwind v4.2 uses source detection instead of `content` arrays in JavaScript config.
114
+ GothamUI already includes `@source` for its own components, and your app can add sources in CSS when needed:
115
+
116
+ ```css
117
+ /* src/styles/main.css */
118
+ @import '@nlabs/gothamui/styles/tailwind.css';
119
+
120
+ /* Optional: explicit app source paths (useful in monorepos/non-standard layouts) */
121
+ @source "../**/*.{js,jsx,ts,tsx}";
122
+ ```
123
+
124
+ For PostCSS, use the Tailwind v4 plugin package (`@tailwindcss/postcss`):
125
+
126
+ #### Webpack Configuration
127
+
128
+ ```js
129
+ // webpack.config.js
130
+ module.exports = {
131
+ // ... other webpack config
132
+ module: {
133
+ rules: [
134
+ {
135
+ test: /\.css$/,
136
+ use: [
137
+ 'style-loader',
138
+ 'css-loader',
139
+ {
140
+ loader: 'postcss-loader',
141
+ options: {
142
+ postcssOptions: {
143
+ plugins: [
144
+ require('@tailwindcss/postcss')
145
+ ]
146
+ }
147
+ }
148
+ }
149
+ ]
150
+ }
151
+ ]
152
+ }
153
+ };
154
+ ```
155
+
156
+ #### Lex Configuration
157
+
158
+ ```js
159
+ // lex.config.mjs
160
+ export default {
161
+ // ... other config
162
+ tailwindCssPath: './src/styles/main.css'
163
+ };
164
+ ```
165
+
166
+ #### Vite Configuration
167
+
168
+ ```js
169
+ // vite.config.js
170
+ export default {
171
+ css: {
172
+ postcss: {
173
+ plugins: [
174
+ require('@tailwindcss/postcss')
175
+ ]
176
+ }
177
+ }
178
+ }
179
+ ```
180
+
181
+ ### What Gets Imported
182
+
183
+ The GothamUI theme CSS includes:
184
+
185
+ - **Custom Color Palette**: Primary, secondary, neutral, success, error, warning, and info colors
186
+ - **Dark Mode Support**: Automatic dark mode variants for all colors
187
+ - **Typography**: Inter font family with proper font weights
188
+ - **Autofill Styles**: Browser autofill styling fixes for form inputs
189
+ - **Base Styles**: Essential CSS resets and utilities
190
+
191
+ ### Using GothamUI Colors in Your Components
192
+
193
+ ```jsx
194
+ // GothamUI colors are available as Tailwind classes
195
+ <div className="bg-primary text-white dark:bg-primary-dark dark:text-black-dark">
196
+ Styled with GothamUI theme
197
+ </div>
198
+
199
+ // Or use them in custom CSS
200
+ .my-component {
201
+ background-color: var(--color-primary);
202
+ color: var(--color-white);
203
+ }
204
+ ```
205
+
206
+ ## Components
207
+
208
+ GothamUI provides a rich set of components to accelerate your development:
209
+
210
+ ### Chat Components
211
+
212
+ GothamUI now includes a first-party chat UI module based on the `react-chat-elements` component set.
213
+
214
+ ```tsx
215
+ // Option 1: Namespace import from root package
216
+ import {Chat} from '@nlabs/gothamui';
217
+
218
+ // Option 2: Direct chat subpath import
219
+ import {ChatList, MessageBox, MessageList} from '@nlabs/gothamui/chat';
220
+ ```
221
+
222
+ Chat components inherit their runtime styles from GothamUI's Tailwind v4 stylesheet, so import [`@nlabs/gothamui/styles/tailwind.css`](#installation) once at your app entrypoint.
223
+
224
+ ### Icons
225
+
226
+ GothamUI includes the complete [Lucide React](https://lucide.dev/) icon library, providing you with over 1000+ beautifully designed, customizable icons that follow a consistent design language.
227
+
228
+ #### Why Lucide React?
229
+
230
+ - **Consistent Design**: All icons follow the same design principles and stroke width
231
+ - **Customizable**: Easy to customize size, color, stroke width, and other properties
232
+ - **Accessible**: Built with accessibility in mind, including proper ARIA attributes
233
+ - **Tree Shakeable**: Only the icons you import are included in your bundle
234
+ - **TypeScript Support**: Full type definitions for all icons
235
+ - **Active Development**: Regularly updated with new icons and improvements
236
+
237
+ #### Quick Reference
238
+
239
+ - **Icon Gallery**: [Browse all available icons](https://lucide.dev/icons/)
240
+ - **Documentation**: [Lucide React documentation](https://lucide.dev/guide/packages/lucide-react)
241
+ - **GitHub**: [Lucide project on GitHub](https://github.com/lucide-icons/lucide)
242
+
243
+ #### Usage
244
+
245
+ ```jsx
246
+ import { Camera, Heart, Star, Settings, LucideLoader } from '@nlabs/gothamui/icons';
247
+
248
+ const MyComponent = () => (
249
+ <div>
250
+ <Camera size={24} />
251
+ <Heart size={24} color="red" />
252
+ <Star size={24} fill="yellow" />
253
+ <Settings size={24} />
254
+ <LucideLoader size={24} /> {/* Use LucideLoader to avoid conflict with GothamUI Loader component */}
255
+ </div>
256
+ );
257
+ ```
258
+
259
+ #### Icon Properties
260
+
261
+ All Lucide React icons support these common properties:
262
+
263
+ ```jsx
264
+ <Camera
265
+ size={24} // Icon size in pixels
266
+ color="currentColor" // Icon color
267
+ strokeWidth={2} // Stroke width
268
+ fill="none" // Fill color
269
+ className="my-icon" // CSS classes
270
+ />
271
+ ```
272
+
273
+ > **Note**: The `Loader` icon from Lucide React is exported as `LucideLoader` to avoid conflicts with GothamUI's `Loader` component.
274
+
275
+ ### Optimized Form Components
276
+
277
+ GothamUI provides optimized form components with automatic validation, accessibility features, and performance optimizations:
278
+
279
+ ```jsx
280
+ import { Button, Form, TextField } from '@nlabs/gothamui';
281
+ import { z } from 'zod';
282
+
283
+ // Define your form schema with Zod
284
+ const loginSchema = z.object({
285
+ email: z.string().email('Please enter a valid email'),
286
+ password: z.string().min(8, 'Password must be at least 8 characters')
287
+ });
288
+
289
+ const LoginForm = () => (
290
+ <Form
291
+ schema={loginSchema}
292
+ onSubmit={handleSubmit}
293
+ showErrors={true} // Show form-level errors at top
294
+ mode="onBlur" // Validate on blur for better UX
295
+ >
296
+ {({isSubmitting, disabled}) => (
297
+ <>
298
+ <TextField
299
+ name="email"
300
+ label="Email"
301
+ type="email"
302
+ placeholder="Enter your email"
303
+ required
304
+ />
305
+ <TextField
306
+ name="password"
307
+ label="Password"
308
+ type="password"
309
+ placeholder="Enter your password"
310
+ required
311
+ />
312
+ <Button
313
+ type="submit"
314
+ variant="contained"
315
+ color="primary"
316
+ label="Sign In"
317
+ disabled={isSubmitting}
318
+ isLoading={isSubmitting}
319
+ />
320
+ </>
321
+ )}
322
+ </Form>
323
+ );
324
+ ```
325
+
326
+ #### Optimized Form Features
327
+
328
+ - **Automatic Validation**: Integrated Zod schema validation with react-hook-form
329
+ - **Performance Optimized**: Efficient re-rendering and validation triggering
330
+ - **Accessibility**: Proper ARIA attributes and form structure
331
+ - **Loading States**: Use `Button` with `disabled` and `isLoading` during form submission
332
+ - **Error Handling**: Both field-level and form-level error display
333
+ - **Type Safety**: Full TypeScript support with inferred types
334
+
335
+ ### Legacy Form Components
336
+
337
+ ```jsx
338
+ import { Form, TextField, Button } from '@nlabs/gothamui';
339
+ import { z } from 'zod';
340
+
341
+ // Define your form schema with Zod
342
+ const loginSchema = z.object({
343
+ email: z.string().email('Please enter a valid email'),
344
+ password: z.string().min(8, 'Password must be at least 8 characters')
345
+ });
346
+
347
+ const LoginForm = () => (
348
+ <Form
349
+ schema={loginSchema}
350
+ onSubmit={(data) => console.log('Form submitted:', data)}
351
+ >
352
+ <TextField
353
+ name="email"
354
+ label="Email"
355
+ placeholder="Enter your email"
356
+ />
357
+ <TextField
358
+ name="password"
359
+ type="password"
360
+ label="Password"
361
+ placeholder="Enter your password"
362
+ />
363
+ <Button
364
+ type="submit"
365
+ variant="contained"
366
+ color="primary"
367
+ label="Sign In"
368
+ />
369
+ </Form>
370
+ );
371
+ ```
372
+
373
+ ### Payment Method Panel
374
+
375
+ `PaymentMethodPanel` displays an empty or masked saved-payment state while your application owns the provider integration. It never collects or stores card credentials.
376
+
377
+ ```tsx
378
+ import {PaymentMethodPanel} from '@nlabs/gothamui';
379
+
380
+ <PaymentMethodPanel
381
+ brand="Visa"
382
+ last4="4242"
383
+ onAdd={openPaymentProvider}
384
+ onRemove={removePaymentMethod}
385
+ />
386
+ ```
387
+
388
+ Use `isAdding` and `isRemoving` to represent provider operations. See the [payment-method documentation](./src/docs/payments.md) for empty states, customization, props, and the security boundary.
389
+
390
+ ### UI Components
391
+
392
+ ```jsx
393
+ import { Button, Notify, Loader } from '@nlabs/gothamui';
394
+
395
+ // Stylish button with multiple variants
396
+ <Button
397
+ variant="contained" // 'contained', 'outlined', or 'text'
398
+ color="primary" // 'primary', 'secondary', 'success', 'error', etc.
399
+ size="md" // 'sm', 'md', or 'lg'
400
+ onClick={handleClick}
401
+ >
402
+ Click Me
403
+ </Button>
404
+
405
+ // Show notifications
406
+ <Notify
407
+ message="Operation completed successfully!"
408
+ severity="success" // 'success', 'info', 'warning', or 'error'
409
+ autoHideDuration={5000}
410
+ />
411
+
412
+ // Loading indicator
413
+ <Loader size="md" />
414
+ ```
415
+
416
+ ### Markdown
417
+
418
+ `Markdown` is a lightweight wrapper around `react-markdown` for rendering inline or remote Markdown with optional template values:
419
+
420
+ ```tsx
421
+ import {Markdown} from '@nlabs/gothamui';
422
+
423
+ <Markdown
424
+ content="# GothamUI {{version}}\nAll UI components are publicly exported."
425
+ values={{version: '1.5.4'}}
426
+ />
427
+ ```
428
+
429
+ ### Code Editor
430
+
431
+ `CodeEditor` is GothamUI's shared Monaco editor integration. Import it from the dedicated editor entry point so applications that do not use Monaco keep it out of their normal component imports:
432
+
433
+ ```tsx
434
+ import {CodeEditor} from '@nlabs/gothamui/editor';
435
+
436
+ <CodeEditor
437
+ height="400px"
438
+ language="json"
439
+ options={{minimap: {enabled: false}, wordWrap: 'on'}}
440
+ value="{}"
441
+ />
442
+ ```
443
+
444
+ ### Public Views
445
+
446
+ Every GothamUI view is part of the public package API. Import views from the package root or from the dedicated `views` entry point:
447
+
448
+ ```tsx
449
+ import {DefaultView, Markdown} from '@nlabs/gothamui';
450
+ // Or: import {DefaultView} from '@nlabs/gothamui/views';
451
+
452
+ const ReleaseNotes = () => (
453
+ <DefaultView title="Release notes">
454
+ <Markdown content="# Release notes" />
455
+ </DefaultView>
456
+ );
457
+ ```
458
+
459
+ The public view exports are `AuthSignInView`, `AuthSignUpView`, `AuthView`, `DefaultView`, `Gotham`, `GothamProvider`, `GothamRoot`, `HomeView`, `LoaderView`, `MenuView`, and `NotFoundView`.
460
+
461
+ ## State Management
462
+
463
+ GothamUI uses ArkhamJS, a Flux implementation, for state management:
464
+
465
+ ```jsx
466
+ import {useFlux} from '@nlabs/arkhamjs-utils-react';
467
+ import {GothamActions} from '@nlabs/gothamui';
468
+
469
+ const MyComponent = () => {
470
+ const flux = useFlux();
471
+
472
+ // Navigate to a new route
473
+ const handleNavigation = () => {
474
+ GothamActions.navGoto('/dashboard');
475
+ };
476
+
477
+ // Show a notification
478
+ const showNotification = () => {
479
+ GothamActions.notify({
480
+ message: 'This is a notification',
481
+ severity: 'info'
482
+ });
483
+ };
484
+
485
+ // Show/hide loading indicator
486
+ const startLoading = () => {
487
+ GothamActions.loading(true, 'Loading data...');
488
+
489
+ // After operation completes
490
+ setTimeout(() => {
491
+ GothamActions.loading(false);
492
+ }, 2000);
493
+ };
494
+
495
+ return (
496
+ <div>
497
+ <Button onClick={handleNavigation} label="Go to Dashboard" />
498
+ <Button onClick={showNotification} label="Show Notification" />
499
+ <Button onClick={startLoading} label="Start Loading" />
500
+ </div>
501
+ );
502
+ };
503
+ ```
504
+
505
+ ## Routing
506
+
507
+ GothamUI simplifies routing with React Router integration:
508
+
509
+ ```jsx
510
+ const config = {
511
+ routes: [
512
+ {
513
+ path: '/',
514
+ element: <HomeView />,
515
+ props: {
516
+ // Props passed to the component
517
+ }
518
+ },
519
+ {
520
+ path: '/dashboard',
521
+ element: <DashboardView />,
522
+ authenticate: true, // Requires authentication
523
+ children: [
524
+ {
525
+ path: 'profile',
526
+ element: <ProfileView />
527
+ },
528
+ {
529
+ path: 'settings',
530
+ element: <SettingsView />
531
+ }
532
+ ]
533
+ }
534
+ ]
535
+ };
536
+ ```
537
+
538
+ ## Authentication
539
+
540
+ GothamUI provides built-in authentication support:
541
+
542
+ ```jsx
543
+ const config = {
544
+ // Define authentication check function
545
+ isAuth: () => Boolean(localStorage.getItem('token')),
546
+ routes: [
547
+ {
548
+ path: '/protected',
549
+ element: <ProtectedView />,
550
+ authenticate: true // This route requires authentication
551
+ }
552
+ ]
553
+ };
554
+ ```
555
+
556
+ ## Internationalization
557
+
558
+ Easy internationalization with i18next:
559
+
560
+ ```jsx
561
+ const config = {
562
+ translations: {
563
+ en: {
564
+ greeting: 'Hello, {{name}}!',
565
+ buttons: {
566
+ submit: 'Submit'
567
+ }
568
+ },
569
+ es: {
570
+ greeting: '¡Hola, {{name}}!',
571
+ buttons: {
572
+ submit: 'Enviar'
573
+ }
574
+ }
575
+ }
576
+ };
577
+
578
+ // In your component
579
+ import {useTranslation} from '@nlabs/gothamui';
580
+
581
+ const MyComponent = () => {
582
+ const { t } = useTranslation();
583
+
584
+ return (
585
+ <div>
586
+ <h1>{t('greeting', { name: 'User' })}</h1>
587
+ <Button label={t('buttons.submit')} />
588
+ </div>
589
+ );
590
+ };
591
+ ```
592
+
593
+ ## Analytics
594
+
595
+ GothamUI can emit provider-neutral page views and UI events through an injected `awsRum` client. When paired with MetropolisJS, events are deduplicated, batched, and sent to a shared Reaktor analytics app.
596
+
597
+ ```tsx
598
+ import {useAwsRum} from '@nlabs/gothamui';
599
+
600
+ const MyComponent = () => {
601
+ const awsRum = useAwsRum();
602
+
603
+ return (
604
+ <button onClick={() => awsRum?.track({name: 'signup', type: 'click'})}>
605
+ Sign up
606
+ </button>
607
+ );
608
+ };
609
+ ```
610
+
611
+ Learn more in the [Analytics documentation](./src/docs/analytics.md).
612
+
613
+ ## Theming
614
+
615
+ GothamUI supports light/dark mode and custom themes:
616
+
617
+ ```jsx
618
+ const config = {
619
+ displayMode: 'dark', // 'light' or 'dark'
620
+ theme: {
621
+ // Custom theme properties
622
+ colors: {
623
+ primary: '#3f51b5',
624
+ secondary: '#f50057'
625
+ }
626
+ }
627
+ };
628
+ ```
629
+
630
+ ## Configuration
631
+
632
+ GothamUI is highly configurable:
633
+
634
+ ```jsx
635
+ const config = {
636
+ app: {
637
+ name: 'my-app',
638
+ title: 'My Application',
639
+ logo: '/logo.svg',
640
+ titleBarSeparator: '|'
641
+ },
642
+ baseUrl: '',
643
+ storageType: 'local', // 'local' or 'session'
644
+ middleware: [customMiddleware],
645
+ stores: [customStore],
646
+ onInit: () => {
647
+ // Custom initialization logic
648
+ console.log('App initialized');
649
+ }
650
+ };
651
+ ```
652
+
653
+ ## Why Choose GothamUI?
654
+
655
+ - **UI Consistency**: Create visually cohesive applications with a unified design language
656
+ - **Developer Experience**: Spend less time wiring up libraries and more time building features
657
+ - **Reduced Bundle Size**: One framework instead of multiple libraries means optimized bundle size
658
+ - **Seamless Transitions**: Built-in animations and transitions between routes and UI states
659
+ - **Accessibility**: Components designed with accessibility in mind from the start
660
+ - **Rapid Development**: Go from concept to production with significantly less boilerplate code
661
+ - **TypeScript Support**: Full type definitions for enhanced developer experience
662
+
663
+ ## Learn More
664
+
665
+ Visit our [official documentation](https://gothamui.nitrogenx.co) for comprehensive guides, API references, and examples.
666
+
667
+ ## Using with Lex
668
+
669
+ GothamUI works seamlessly with [Lex](https://github.com/nitrogenlabs/lex), Nitrogen Labs' build and development toolkit. Lex provides optimized building, testing, and development workflows for projects using GothamUI.
670
+
671
+ ### Installation
672
+
673
+ ```bash
674
+ # Install Lex globally
675
+ npm install -g @nlabs/lex
676
+
677
+ # Or install locally in your project
678
+ npm install --save-dev @nlabs/lex
679
+ ```
680
+
681
+ ### Lex Project Configuration
682
+
683
+ Create a `lex.config.mjs` file in your project root:
684
+
685
+ ```js
686
+ export default {
687
+ entryJs: 'src/index.tsx', // Your main entry point
688
+ outputPath: './dist', // Build output directory
689
+ useTypescript: true, // Enable TypeScript support
690
+ jest: {
691
+ setupFilesAfterEnv: ['<rootDir>/jest.setup.js'],
692
+ testEnvironment: 'jsdom'
693
+ }
694
+ };
695
+ ```
696
+
697
+ ### Development Workflow
698
+
699
+ ```bash
700
+ # Start development server with hot reload
701
+ lex dev
702
+
703
+ # Build for production
704
+ lex compile
705
+
706
+ # Run tests
707
+ lex test
708
+
709
+ # Lint and fix code
710
+ lex lint --fix
711
+
712
+ # Update dependencies
713
+ lex update --interactive
714
+ ```
715
+
716
+ ### Integration with GothamUI
717
+
718
+ Lex automatically detects GothamUI projects and configures Tailwind CSS integration. Your `lex.config.mjs` will include:
719
+
720
+ ```js
721
+ export default {
722
+ // ... other config
723
+ tailwindCssPath: './src/styles/main.css', // Your main CSS file
724
+ };
725
+ ```
726
+
727
+ ### Build Optimization
728
+
729
+ Lex optimizes GothamUI builds by:
730
+
731
+ - **Tree Shaking**: Removes unused GothamUI components from your bundle
732
+ - **CSS Optimization**: Processes Tailwind CSS with GothamUI theme variables
733
+ - **TypeScript Compilation**: Optimized compilation with proper type checking
734
+ - **Asset Handling**: Automatic copying of GothamUI assets and fonts
735
+
736
+ ### Example Project Structure
737
+
738
+ ```text
739
+ my-gothamui-app/
740
+ ├── src/
741
+ │ ├── index.tsx
742
+ │ ├── App.tsx
743
+ │ ├── styles/
744
+ │ │ └── main.css
745
+ │ └── components/
746
+ ├── lex.config.mjs
747
+ ├── package.json
748
+ └── tsconfig.json
749
+ ```
750
+
751
+ ### CSS Setup with Lex
752
+
753
+ In your `src/styles/main.css`:
754
+
755
+ ```css
756
+ @import '@nlabs/gothamui/styles/tailwind.css';
757
+
758
+ /* Your custom styles */
759
+ @theme {
760
+ /* Override GothamUI theme variables if needed */
761
+ }
762
+ ```
763
+
764
+ Lex will automatically process this CSS file and include it in your build output.
765
+
766
+ ## License
767
+
768
+ GothamUI is [MIT licensed](./LICENSE).