@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
@@ -0,0 +1,231 @@
1
+ # AWS RUM Analytics
2
+
3
+ GothamUI emits analytics through its browser analytics channel by default. When an application is wrapped by both Gotham and Metropolis, Metropolis automatically receives these events and delivers them to Reaktor. Gotham does not load an analytics SDK or send network requests by itself.
4
+
5
+ For local demos or troubleshooting, use the debug adapter to inspect the exact event passed to the analytics client:
6
+
7
+ ```tsx
8
+ import {createAwsRumDebugClient} from '@nlabs/gothamui';
9
+
10
+ const awsRum = createAwsRumDebugClient({
11
+ enabled: import.meta.env.DEV,
12
+ target: metropolisAwsRum
13
+ });
14
+ ```
15
+
16
+ When enabled, the adapter logs `[GothamUI] awsRum.track` and the event object. If a `target` is supplied, the same object is then forwarded for Metropolis delivery. Omitting `target` is useful for a console-only component demo.
17
+
18
+ ## Plug-and-play configuration
19
+
20
+ ```tsx
21
+ import {Gotham} from '@nlabs/gothamui';
22
+ import {Metropolis} from '@nlabs/metropolisjs';
23
+
24
+ root.render(
25
+ <Metropolis config={metropolisConfig}>
26
+ <Gotham config={{routes}} />
27
+ </Metropolis>
28
+ );
29
+ ```
30
+
31
+ Set an application name and the shared Reaktor endpoint in Metropolis. The application name becomes the default analytics `appId`; `app.rum.appId` can override it:
32
+
33
+ ```ts
34
+ const metropolisConfig = {
35
+ production: {
36
+ app: {
37
+ api: {
38
+ rum: 'https://analytics.example.com/public'
39
+ },
40
+ name: 'my-app',
41
+ rum: {
42
+ respectPrivacySignals: true
43
+ }
44
+ }
45
+ }
46
+ };
47
+ ```
48
+
49
+ If `app.api.rum` is omitted, Metropolis uses its configured public endpoint. Every application uses the same endpoint and supplies its own `appId`. This allows a future dashboard to filter the shared log collection by application.
50
+
51
+ ## Page views
52
+
53
+ Gotham automatically calls `awsRum.track()` once when the route changes. Add stable analytics metadata so dynamic identifiers and titles never become dimensions:
54
+
55
+ ```tsx
56
+ const routes = [{
57
+ analytics: {route: '/stories/:storyId', title: 'Story', viewId: 'story.detail'},
58
+ element: <StoryView />,
59
+ path: 'stories/:storyId'
60
+ }];
61
+ ```
62
+
63
+ ## View performance
64
+
65
+ Use one terminal measurement instead of separate start/end beacons. A measurement starts when a view begins loading and finishes with exactly one outcome: `success`, `failure`, `timeout`, or `cancelled`. Gotham emits the resulting `view_performance` event; Metropolis handles delivery.
66
+
67
+ ### React views
68
+
69
+ Call `useViewPerformance()` inside the view being measured. Keep its status `pending` while required content is loading, then change it to `success` or `failure` when the view reaches a terminal state.
70
+
71
+ ```tsx
72
+ import {useViewPerformance} from '@nlabs/gothamui';
73
+
74
+ interface StoryViewProps {
75
+ readonly error?: Error;
76
+ readonly loading: boolean;
77
+ }
78
+
79
+ export const StoryView = ({error, loading}: StoryViewProps) => {
80
+ useViewPerformance({
81
+ route: '/stories/:storyId',
82
+ status: error ? 'failure' : loading ? 'pending' : 'success',
83
+ title: 'Story',
84
+ viewId: 'story.detail'
85
+ });
86
+
87
+ if(error) {
88
+ return <p>Unable to load this story.</p>;
89
+ }
90
+
91
+ if(loading) {
92
+ return <p>Loading story…</p>;
93
+ }
94
+
95
+ return <article>Story content</article>;
96
+ };
97
+ ```
98
+
99
+ Options:
100
+
101
+ - `viewId` is required. Use a stable product identifier such as `story.detail`, never a database ID or URL.
102
+ - `status` is required and must be `pending`, `success`, or `failure`.
103
+ - `route` should be a stable route template such as `/stories/:storyId`, not the current dynamic pathname.
104
+ - `title` is an optional stable display name for the view.
105
+ - `timeoutMs` defaults to 30 seconds. Set it to `0` or a negative value to disable the automatic timeout.
106
+
107
+ The hook starts a new measurement when `awsRum`, `route`, `timeoutMs`, `title`, or `viewId` changes. It reports `cancelled` if the view unmounts or one of those values changes before completion. Once a measurement finishes, later status changes cannot emit a second event.
108
+
109
+ ### Non-React lifecycles
110
+
111
+ `startView()` only measures time; it does not send analytics by itself. Supply an `onComplete` callback and pass the completed measurement to `reportViewPerformance()`:
112
+
113
+ ```ts
114
+ import {
115
+ createAwsRumBrowserClient,
116
+ reportViewPerformance,
117
+ startView
118
+ } from '@nlabs/gothamui';
119
+
120
+ const awsRum = createAwsRumBrowserClient();
121
+
122
+ export const loadStory = async () => {
123
+ const view = startView({
124
+ onComplete: (measurement) => reportViewPerformance(awsRum, measurement),
125
+ route: '/stories/:storyId',
126
+ timeoutMs: 10_000,
127
+ title: 'Story',
128
+ viewId: 'story.detail'
129
+ });
130
+
131
+ try {
132
+ const story = await loadStoryData();
133
+ view.succeed();
134
+ return story;
135
+ } catch(error) {
136
+ view.fail();
137
+ throw error;
138
+ }
139
+ };
140
+ ```
141
+
142
+ The returned handle provides four terminal methods:
143
+
144
+ - `succeed()` records `success`.
145
+ - `fail()` records `failure`.
146
+ - `timeout()` records `timeout` immediately; the configured timer does this automatically when it expires.
147
+ - `cancel()` records `cancelled`, typically when navigation abandons unfinished work.
148
+
149
+ Only the first terminal method has an effect. Later calls are ignored and the timeout is cleared.
150
+
151
+ ### Event payload
152
+
153
+ Gotham sends the completed measurement in this shape:
154
+
155
+ ```ts
156
+ {
157
+ name: 'view_performance',
158
+ path: '/stories/:storyId',
159
+ properties: {
160
+ durationMs: 842,
161
+ outcome: 'success',
162
+ viewId: 'story.detail',
163
+ viewTitle: 'Story'
164
+ },
165
+ type: 'view_performance'
166
+ }
167
+ ```
168
+
169
+ `path` and `viewTitle` are omitted when `route` and `title` are not supplied. `durationMs` is rounded to a non-negative whole number. Keep all identifiers stable and free of names, account IDs, query strings, or other identifying information.
170
+
171
+ ## Automatic interaction tracking
172
+
173
+ Gotham automatically tracks semantic interactive elements rendered anywhere in the document while `GothamProvider` is mounted. This includes links, buttons, form controls, sliders, switches, tabs, menu items, editable regions, and keyboard-only form submissions. Delegated listeners also cover elements rendered later or in portals.
174
+
175
+ Interaction events contain only the control type, interaction type, and current pathname. Gotham never reads visible text, URLs, query strings, or control values. Give important interactions a stable event name with `data-analytics-name`:
176
+
177
+ ```tsx
178
+ <button data-analytics-name="checkout_started">Checkout</button>
179
+ <input data-analytics-name="volume_changed" type="range" />
180
+ ```
181
+
182
+ Use `data-analytics-track="false"` on a control or container for a private region that must not emit interaction events:
183
+
184
+ ```tsx
185
+ <section data-analytics-track="false">...</section>
186
+ ```
187
+
188
+ Automatic interaction tracking is enabled by default. It can be disabled application-wide when an application provides its own delegated tracker:
189
+
190
+ ```tsx
191
+ <Gotham config={{analytics: {interactions: false}}} />
192
+ ```
193
+
194
+ ## Custom events
195
+
196
+ Use `useAwsRum()` for domain events that need additional stable properties:
197
+
198
+ ```tsx
199
+ import {useAwsRum} from '@nlabs/gothamui';
200
+
201
+ export const SignupButton = () => {
202
+ const awsRum = useAwsRum();
203
+
204
+ const onClick = () => {
205
+ awsRum?.track({
206
+ name: 'signup_started',
207
+ path: window.location.pathname,
208
+ properties: {placement: 'header'},
209
+ type: 'click'
210
+ });
211
+ };
212
+
213
+ return <button onClick={onClick}>Sign up</button>;
214
+ };
215
+ ```
216
+
217
+ Properties must be strings, numbers, or booleans. Do not include names, email addresses, form values, account IDs, query strings, or other identifying information.
218
+
219
+ ## Delivery behavior
220
+
221
+ Metropolis:
222
+
223
+ - Generates a memory-only journey ID that resets with the application runtime.
224
+ - Adds an event ID, timestamp, and sequence number.
225
+ - Suppresses identical events during the deduplication window.
226
+ - Debounces events into batches.
227
+ - Throttles requests to the shared endpoint.
228
+ - Sends JSON through Rip-Hunter.
229
+ - Dispatches `AWS_RUM_TRACK_QUEUED`, `AWS_RUM_TRACK_SUCCESS`, and `AWS_RUM_TRACK_ERROR` Flux events.
230
+
231
+ The shared Reaktor mutation stores standalone `logs` documents. Each document contains `appId`; no graph edge is required.
@@ -0,0 +1,364 @@
1
+ # GothamUI API Reference
2
+
3
+ This document provides detailed information about the components and APIs available in GothamUI.
4
+
5
+ ## Core Components
6
+
7
+ ### `<Gotham>`
8
+
9
+ The main component that bootstraps your GothamUI application.
10
+
11
+ **Props:**
12
+
13
+ | Prop | Type | Default | Description |
14
+ |------|------|---------|-------------|
15
+ | `config` | `GothamConfiguration` | `{}` | Configuration object for the application |
16
+ | `children` | `ReactNode` | - | Optional child components |
17
+ | `classes` | `Record<string, string>` | - | Custom CSS classes |
18
+ | `isAuth` | `() => boolean` | - | Authentication check function |
19
+
20
+ **Example:**
21
+
22
+ ```jsx
23
+ import { Gotham } from '@nlabs/gothamui';
24
+
25
+ const config = {
26
+ app: {
27
+ name: 'my-app',
28
+ title: 'My Application'
29
+ },
30
+ routes: [
31
+ // Your routes
32
+ ]
33
+ };
34
+
35
+ const App = () => (
36
+ <Gotham config={config} />
37
+ );
38
+ ```
39
+
40
+ ### `<GothamProvider>`
41
+
42
+ Provider component that sets up the GothamUI context.
43
+
44
+ **Props:**
45
+
46
+ | Prop | Type | Default | Description |
47
+ |------|------|---------|-------------|
48
+ | `config` | `GothamConfiguration` | Required | Configuration object for the application |
49
+ | `children` | `ReactNode` | - | Child components |
50
+ | `session` | `Record<string, unknown>` | `{}` | Initial session data |
51
+
52
+ ## Public Views
53
+
54
+ All GothamUI views are public from both `@nlabs/gothamui` and `@nlabs/gothamui/views`.
55
+
56
+ | View | Purpose |
57
+ |------|---------|
58
+ | `AuthSignInView` | Complete sign-in screen built on `AuthView` |
59
+ | `AuthSignUpView` | Complete account-registration screen built on `AuthView` |
60
+ | `AuthView` | Shared authentication layout |
61
+ | `DefaultView` | Responsive application shell with standard navigation |
62
+ | `Gotham` | GothamUI application bootstrap component |
63
+ | `GothamProvider` | Configuration, session, and Flux provider |
64
+ | `GothamRoot` | Root route outlet with notifications, loading state, and analytics |
65
+ | `HomeView` | Responsive home-page shell |
66
+ | `LoaderView` | Flux-connected full-screen loading state |
67
+ | `MenuView` | Responsive sidebar application shell |
68
+ | `NotFoundView` | Full-page missing-route view |
69
+
70
+ ## Form Components
71
+
72
+ ### `<Form>`
73
+
74
+ Form component with built-in validation using Zod.
75
+
76
+ **Props:**
77
+
78
+ | Prop | Type | Default | Description |
79
+ |------|------|---------|-------------|
80
+ | `children` | `ReactNode` | Required | Form fields and controls |
81
+ | `className` | `string` | - | Custom CSS class |
82
+ | `defaultValues` | `Record<string, unknown>` | `{}` | Default form values |
83
+ | `mode` | `'onSubmit'` \| `'onBlur'` \| `'onChange'` \| `'onTouched'` \| `'all'` | `'onBlur'` | Form validation mode |
84
+ | `name` | `string` | `'default'` | Form name (used for test IDs) |
85
+ | `onChange` | `(data: unknown) => void` | - | Change handler |
86
+ | `onSubmit` | `(data: unknown, event: BaseSyntheticEvent, setError: (field: string, error: { type: string; message: string }) => void) => void` | Required | Submit handler |
87
+ | `schema` | `z.ZodSchema<Record<string, unknown>>` | - | Zod validation schema |
88
+ | `validate` | `(data: unknown) => void` | - | Custom validation function |
89
+ | `validateOnBlur` | `boolean` | - | Whether to validate on blur |
90
+
91
+ **Example:**
92
+
93
+ ```jsx
94
+ import { Form, TextField, Button } from '@nlabs/gothamui';
95
+ import { z } from 'zod';
96
+
97
+ const schema = z.object({
98
+ email: z.string().email(),
99
+ password: z.string().min(8)
100
+ });
101
+
102
+ const LoginForm = () => (
103
+ <Form
104
+ schema={schema}
105
+ onSubmit={(data) => console.log(data)}
106
+ defaultValues={{ email: '', password: '' }}
107
+ >
108
+ <TextField name="email" label="Email" />
109
+ <TextField name="password" type="password" label="Password" />
110
+ <Button type="submit" label="Submit" />
111
+ </Form>
112
+ );
113
+ ```
114
+
115
+ ### `<TextField>`
116
+
117
+ Text input component.
118
+
119
+ **Props:**
120
+
121
+ | Prop | Type | Default | Description |
122
+ |------|------|---------|-------------|
123
+ | `className` | `string` | - | Custom CSS class |
124
+ | `disabled` | `boolean` | `false` | Whether the field is disabled |
125
+ | `error` | `string` | - | Error message |
126
+ | `id` | `string` | - | Field ID |
127
+ | `label` | `string` | - | Field label |
128
+ | `name` | `string` | Required | Field name |
129
+ | `onChange` | `(event: ChangeEvent<HTMLInputElement>) => void` | - | Change handler |
130
+ | `placeholder` | `string` | - | Placeholder text |
131
+ | `required` | `boolean` | `false` | Whether the field is required |
132
+ | `type` | `'text'` \| `'password'` \| `'email'` \| `'number'` \| `'tel'` | `'text'` | Input type |
133
+ | `value` | `string` | - | Field value |
134
+
135
+ ### `<SelectField>`
136
+
137
+ Dropdown select component.
138
+
139
+ **Props:**
140
+
141
+ | Prop | Type | Default | Description |
142
+ |------|------|---------|-------------|
143
+ | `className` | `string` | - | Custom CSS class |
144
+ | `disabled` | `boolean` | `false` | Whether the field is disabled |
145
+ | `error` | `string` | - | Error message |
146
+ | `id` | `string` | - | Field ID |
147
+ | `label` | `string` | - | Field label |
148
+ | `name` | `string` | Required | Field name |
149
+ | `onChange` | `(event: ChangeEvent<HTMLSelectElement>) => void` | - | Change handler |
150
+ | `options` | `Array<{ label: string; value: string }>` | `[]` | Select options |
151
+ | `placeholder` | `string` | - | Placeholder text |
152
+ | `required` | `boolean` | `false` | Whether the field is required |
153
+ | `value` | `string` | - | Field value |
154
+
155
+ ### `<RadioField>`
156
+
157
+ Radio button group component.
158
+
159
+ **Props:**
160
+
161
+ | Prop | Type | Default | Description |
162
+ |------|------|---------|-------------|
163
+ | `className` | `string` | - | Custom CSS class |
164
+ | `disabled` | `boolean` | `false` | Whether the field is disabled |
165
+ | `error` | `string` | - | Error message |
166
+ | `id` | `string` | - | Field ID |
167
+ | `label` | `string` | - | Field label |
168
+ | `name` | `string` | Required | Field name |
169
+ | `onChange` | `(event: ChangeEvent<HTMLInputElement>) => void` | - | Change handler |
170
+ | `options` | `Array<{ label: string; value: string }>` | `[]` | Radio options |
171
+ | `required` | `boolean` | `false` | Whether the field is required |
172
+ | `value` | `string` | - | Field value |
173
+
174
+ ### `<DateField>`
175
+
176
+ Date picker component.
177
+
178
+ **Props:**
179
+
180
+ | Prop | Type | Default | Description |
181
+ |------|------|---------|-------------|
182
+ | `className` | `string` | - | Custom CSS class |
183
+ | `disabled` | `boolean` | `false` | Whether the field is disabled |
184
+ | `error` | `string` | - | Error message |
185
+ | `id` | `string` | - | Field ID |
186
+ | `label` | `string` | - | Field label |
187
+ | `name` | `string` | Required | Field name |
188
+ | `onChange` | `(date: Date) => void` | - | Change handler |
189
+ | `placeholder` | `string` | - | Placeholder text |
190
+ | `required` | `boolean` | `false` | Whether the field is required |
191
+ | `value` | `Date` | - | Field value |
192
+
193
+ ## UI Components
194
+
195
+ ### `<Markdown>`
196
+
197
+ Renders Markdown through `react-markdown` while providing GothamUI container styling, remote content loading, and template values.
198
+
199
+ ```tsx
200
+ import {Markdown} from '@nlabs/gothamui';
201
+
202
+ <Markdown
203
+ className="prose"
204
+ content="# Welcome, {{name}}"
205
+ values={{name: 'Bruce'}}
206
+ />
207
+ ```
208
+
209
+ | Prop | Type | Default | Description |
210
+ |------|------|---------|-------------|
211
+ | `className` | `string` | `''` | Additional class names for the Markdown container |
212
+ | `content` | `string` | - | Inline Markdown content |
213
+ | `url` | `string` | - | URL whose response supplies the Markdown content |
214
+ | `values` | `Record<string, unknown>` | `{}` | Values substituted into the Markdown template |
215
+
216
+ ### `<PaymentMethodPanel>`
217
+
218
+ Displays an empty or masked saved-payment state and delegates add, replace, and remove workflows to application callbacks. It does not collect or store payment credentials.
219
+
220
+ | Prop | Type | Default | Description |
221
+ |------|------|---------|-------------|
222
+ | `brand` | `string` | `''` | Display-safe payment brand |
223
+ | `isAdding` | `boolean` | `false` | Shows add or replace progress and disables actions |
224
+ | `isRemoving` | `boolean` | `false` | Shows removal progress and disables actions |
225
+ | `last4` | `string` | `''` | Last four display digits |
226
+ | `onAdd` | `() => void` | Required | Starts the provider-owned add or replace flow |
227
+ | `onRemove` | `() => void` | `undefined` | Starts removal and controls whether the remove action is shown |
228
+
229
+ See [Payment methods](./payments.md) for all props, examples, loading states, and security guidance.
230
+
231
+ ### `<Button>`
232
+
233
+ Button component with multiple variants and states.
234
+
235
+ **Props:**
236
+
237
+ | Prop | Type | Default | Description |
238
+ |------|------|---------|-------------|
239
+ | `children` | `ReactNode` | - | Button content |
240
+ | `className` | `string` | - | Custom CSS class |
241
+ | `color` | `GothamColor` | `'primary'` | Button color |
242
+ | `disabled` | `boolean` | `false` | Whether the button is disabled |
243
+ | `hasNotification` | `boolean` | `false` | Show notification indicator |
244
+ | `hasShadow` | `boolean` | `false` | Show shadow effect |
245
+ | `icon` | `ReactNode` | - | Button icon |
246
+ | `isLoading` | `boolean` | `false` | Show loading spinner |
247
+ | `label` | `string` | `''` | Button label (used if children not provided) |
248
+ | `onClick` | `(event?: unknown) => void` | `() => {}` | Click handler |
249
+ | `size` | `'sm'` \| `'md'` \| `'lg'` | `'md'` | Button size |
250
+ | `tabIndex` | `number` | - | Tab index |
251
+ | `type` | `'button'` \| `'reset'` \| `'submit'` | `'button'` | Button type |
252
+ | `variant` | `'text'` \| `'contained'` \| `'outlined'` | - | Button variant |
253
+
254
+ ### `<Loader>`
255
+
256
+ Loading indicator component.
257
+
258
+ **Props:**
259
+
260
+ | Prop | Type | Default | Description |
261
+ |------|------|---------|-------------|
262
+ | `className` | `string` | - | Custom CSS class |
263
+ | `color` | `string` | `'primary'` | Loader color |
264
+ | `content` | `string` | - | Loading message |
265
+ | `size` | `'sm'` \| `'md'` \| `'lg'` | `'md'` | Loader size |
266
+
267
+ ### `<Notify>`
268
+
269
+ Notification component for displaying alerts and messages.
270
+
271
+ **Props:**
272
+
273
+ | Prop | Type | Default | Description |
274
+ |------|------|---------|-------------|
275
+ | `actions` | `Array<{ label: string; onClick: () => void }>` | `[]` | Action buttons |
276
+ | `anchorOrigin` | `{ horizontal: 'left' \| 'center' \| 'right', vertical: 'top' \| 'bottom' }` | `{ horizontal: 'center', vertical: 'bottom' }` | Position of the notification |
277
+ | `autoHideDuration` | `number` | `5000` | Auto-hide duration in milliseconds |
278
+ | `className` | `string` | - | Custom CSS class |
279
+ | `isOpen` | `boolean` | `false` | Whether the notification is open |
280
+ | `message` | `string` | Required | Notification message |
281
+ | `onClose` | `() => void` | - | Close handler |
282
+ | `severity` | `'success'` \| `'info'` \| `'warning'` \| `'error'` | `'info'` | Notification severity |
283
+
284
+ ### `<Svg>`
285
+
286
+ SVG icon component.
287
+
288
+ **Props:**
289
+
290
+ | Prop | Type | Default | Description |
291
+ |------|------|---------|-------------|
292
+ | `className` | `string` | - | Custom CSS class |
293
+ | `color` | `string` | - | Icon color |
294
+ | `height` | `number` | - | Icon height |
295
+ | `name` | `string` | Required | Icon name |
296
+ | `width` | `number` | - | Icon width |
297
+
298
+ ## Navigation Components
299
+
300
+ ### `<GothamRoute>`
301
+
302
+ Route component for defining routes with authentication.
303
+
304
+ **Props:**
305
+
306
+ | Prop | Type | Default | Description |
307
+ |------|------|---------|-------------|
308
+ | `authenticate` | `boolean` | `false` | Whether the route requires authentication |
309
+ | `element` | `ReactElement` | Required | Component to render |
310
+ | `path` | `string` | Required | Route path |
311
+
312
+ ### `<AuthRoute>`
313
+
314
+ Route component that handles authentication redirects.
315
+
316
+ **Props:**
317
+
318
+ | Prop | Type | Default | Description |
319
+ |------|------|---------|-------------|
320
+ | `authenticate` | `boolean` | `false` | Whether the route requires authentication |
321
+ | `element` | `ReactElement` | Required | Component to render |
322
+ | `path` | `string` | Required | Route path |
323
+
324
+ ## Configuration Types
325
+
326
+ ### `GothamConfiguration`
327
+
328
+ Configuration object for GothamUI applications.
329
+
330
+ | Property | Type | Default | Description |
331
+ |----------|------|---------|-------------|
332
+ | `app` | `{ logo?: string; name?: string; title?: string; titleBarSeparator?: string; }` | `{ name: 'gotham', title: 'GothamUI' }` | Application metadata |
333
+ | `baseUrl` | `string` | `''` | Base URL for the application |
334
+ | `config` | `FluxOptions` | - | Flux configuration options |
335
+ | `displayMode` | `'light'` \| `'dark'` | - | Theme display mode |
336
+ | `flux` | `FluxFramework` | - | Custom Flux instance |
337
+ | `isAuth` | `() => boolean` | `() => false` | Authentication check function |
338
+ | `middleware` | `FluxMiddlewareType[]` | `[]` | Flux middleware |
339
+ | `onInit` | `() => void` | - | Initialization callback |
340
+ | `routes` | `GothamRouteData[]` | `[]` | Application routes |
341
+ | `storageType` | `'local'` \| `'session'` | `'session'` | Storage type for persisted state |
342
+ | `stores` | `unknown[]` | `[]` | Additional Flux stores |
343
+ | `theme` | `Record<string, unknown>` | `{}` | Theme configuration |
344
+ | `translations` | `Record<string, unknown>` | `{ translation: {} }` | i18n translations |
345
+
346
+ ## Actions
347
+
348
+ ### `GothamActions`
349
+
350
+ Action creators for common operations.
351
+
352
+ | Method | Parameters | Description |
353
+ |--------|------------|-------------|
354
+ | `init` | `() => Promise<FluxAction>` | Initialize the application |
355
+ | `loading` | `(isLoading: boolean, content?: string) => Promise<FluxAction>` | Show/hide loading indicator |
356
+ | `navBack` | `() => Promise<FluxAction>` | Navigate back |
357
+ | `navForward` | `() => Promise<FluxAction>` | Navigate forward |
358
+ | `navGoto` | `(path: string, params?: Record<string, unknown>) => Promise<FluxAction>` | Navigate to a path |
359
+ | `navReplace` | `(path: string, params?: Record<string, unknown>) => Promise<FluxAction>` | Replace current route |
360
+ | `notify` | `(params: GothamNotifyParams) => Promise<FluxAction>` | Show notification |
361
+ | `notifyClose` | `() => Promise<FluxAction>` | Close notification |
362
+ | `setConfig` | `(config: GothamConfiguration) => Promise<FluxAction>` | Update configuration |
363
+ | `signOut` | `() => Promise<FluxAction>` | Sign out user |
364
+ | `updateTitle` | `(title: string, separator?: string) => Promise<FluxAction>` | Update page title |
@@ -0,0 +1,83 @@
1
+ # GothamUI vs Other Frameworks
2
+
3
+ This comparison highlights the key differences between GothamUI and other popular React frameworks.
4
+
5
+ ## Feature Comparison
6
+
7
+ | Feature | GothamUI | Next.js | Create React App | Gatsby |
8
+ |---------|----------|---------|-----------------|--------|
9
+ | **Setup Complexity** | Low | Medium | Low | Medium |
10
+ | **Routing** | Built-in (React Router) | Built-in (File-based) | Requires react-router | Built-in (Gatsby Router) |
11
+ | **State Management** | Built-in (ArkhamJS/Flux) | External (Redux, etc.) | External (Redux, etc.) | External (Redux, etc.) |
12
+ | **Form Handling** | Built-in (React Hook Form + Zod) | External | External | External |
13
+ | **UI Components** | Built-in | External | External | External |
14
+ | **Internationalization** | Built-in (i18next) | External | External | External |
15
+ | **Authentication** | Built-in | External | External | External |
16
+ | **Notifications** | Built-in | External | External | External |
17
+ | **SSR/SSG Support** | No | Yes | No | Yes |
18
+ | **Development Experience** | Streamlined | Comprehensive | Basic | Comprehensive |
19
+ | **Bundle Size** | Medium | Large | Small | Large |
20
+ | **Learning Curve** | Gentle | Steep | Gentle | Steep |
21
+ | **Customization** | High | High | Medium | Medium |
22
+ | **Community Size** | Small | Very Large | Very Large | Large |
23
+
24
+ ## When to Choose GothamUI
25
+
26
+ ### Choose GothamUI when:
27
+
28
+ - You want a complete, ready-to-use React framework with minimal configuration
29
+ - You prefer a Flux-based state management approach
30
+ - You need built-in form handling with validation
31
+ - You want a consistent UI component library out of the box
32
+ - You're building a client-side application with authentication needs
33
+ - You value developer experience and want to minimize boilerplate code
34
+
35
+ ### Choose Next.js when:
36
+
37
+ - You need server-side rendering (SSR) or static site generation (SSG)
38
+ - You want file-based routing
39
+ - You need advanced deployment options (Vercel integration)
40
+ - You're building a large-scale application with a large team
41
+ - You need API routes built into your application
42
+
43
+ ### Choose Create React App when:
44
+
45
+ - You want a minimal React setup with maximum flexibility
46
+ - You prefer to add libraries as needed
47
+ - You're building a simple client-side application
48
+ - You're learning React and want to start with the basics
49
+
50
+ ### Choose Gatsby when:
51
+
52
+ - You're building a static website or blog
53
+ - You need excellent image optimization
54
+ - You want to use GraphQL for data fetching
55
+ - You need a large plugin ecosystem
56
+ - You're building a content-heavy site
57
+
58
+ ## Migration Path
59
+
60
+ If you're considering migrating to GothamUI from another framework, here's what you need to know:
61
+
62
+ ### From Create React App to GothamUI
63
+
64
+ 1. Install GothamUI and its dependencies
65
+ 2. Replace your root component with `<Gotham>`
66
+ 3. Configure your routes in the GothamUI config object
67
+ 4. Migrate your state management to ArkhamJS
68
+ 5. Replace form components with GothamUI form components
69
+ 6. Replace UI components with GothamUI components
70
+
71
+ ### From Next.js to GothamUI
72
+
73
+ 1. Install GothamUI and its dependencies
74
+ 2. Convert file-based routing to GothamUI route configuration
75
+ 3. Migrate server-side logic to API endpoints or serverless functions
76
+ 4. Migrate state management to ArkhamJS
77
+ 5. Replace UI components with GothamUI components
78
+
79
+ ## Conclusion
80
+
81
+ GothamUI offers a comprehensive solution for React applications with a focus on developer experience and productivity. While it may not have the large ecosystem of Next.js or the SSR capabilities of Gatsby, it excels at providing a complete, ready-to-use framework for client-side applications with minimal configuration.
82
+
83
+ By combining routing, state management, form handling, and UI components in a single package, GothamUI allows developers to focus on building features rather than configuring tools and libraries.
@@ -0,0 +1,11 @@
1
+ # Containers
2
+
3
+ There are 2 included containers to choose from:
4
+
5
+ *default*
6
+
7
+ Has a top bar with logo and menu. The top bar is transparent and turns translucent with a backdrop blur when scrolling down. Use `transparentScrollBackdropFilter` to customize the blur while keeping the top state transparent.
8
+
9
+ *menu*
10
+
11
+ A side bar on the left.