nexus-shared 1.1.21 → 3.0.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 (376) hide show
  1. package/CHANGELOG.md +262 -0
  2. package/LICENSE +21 -0
  3. package/README.md +1000 -0
  4. package/dist/Client.Index.d.ts +55 -0
  5. package/dist/Client.Index.js +60 -0
  6. package/dist/Components/Chats/Chat.d.ts +28 -0
  7. package/dist/Components/Chats/Chat.js +19 -0
  8. package/dist/Components/Chats/ChatButton.d.ts +26 -0
  9. package/dist/Components/Chats/ChatButton.js +41 -0
  10. package/dist/Components/Chats/ChatComposer.d.ts +41 -0
  11. package/dist/Components/Chats/ChatComposer.js +177 -0
  12. package/dist/Components/Chats/ChatConversations.d.ts +35 -0
  13. package/dist/Components/Chats/ChatConversations.js +38 -0
  14. package/dist/Components/Chats/ChatPanel.d.ts +66 -0
  15. package/dist/Components/Chats/ChatPanel.js +94 -0
  16. package/dist/Components/Chats/ChatParts.d.ts +87 -0
  17. package/dist/Components/Chats/ChatParts.js +100 -0
  18. package/dist/Components/Chats/ChatThread.d.ts +22 -0
  19. package/dist/Components/Chats/ChatThread.js +96 -0
  20. package/dist/Components/Documents/Button.d.ts +29 -0
  21. package/dist/Components/Documents/Button.js +11 -0
  22. package/dist/Components/Documents/Menu.d.ts +102 -0
  23. package/dist/Components/Documents/Menu.js +242 -0
  24. package/dist/Components/Documents/SplitButton.d.ts +64 -0
  25. package/dist/Components/Documents/SplitButton.js +129 -0
  26. package/dist/Components/Documents/TabButtons.d.ts +80 -0
  27. package/dist/Components/Documents/TabButtons.js +38 -0
  28. package/dist/Components/Forms/ApiForm.d.ts +23 -0
  29. package/dist/Components/Forms/ApiForm.js +100 -0
  30. package/dist/Components/Forms/Crud.d.ts +17 -0
  31. package/dist/Components/Forms/Crud.js +708 -0
  32. package/dist/Components/Forms/CrudParts.d.ts +15 -0
  33. package/dist/Components/Forms/CrudParts.js +36 -0
  34. package/dist/Components/Forms/ExcelImport.d.ts +42 -0
  35. package/dist/Components/Forms/ExcelImport.js +190 -0
  36. package/dist/Components/Forms/Form.d.ts +52 -0
  37. package/dist/Components/Forms/Form.js +323 -0
  38. package/dist/Components/Forms/SubmitForm.d.ts +65 -0
  39. package/dist/Components/Forms/SubmitForm.js +198 -0
  40. package/dist/Components/Inputs/Calendar.d.ts +69 -0
  41. package/dist/Components/Inputs/Calendar.js +258 -0
  42. package/dist/Components/Inputs/CheckBox.d.ts +53 -0
  43. package/dist/Components/Inputs/CheckBox.js +87 -0
  44. package/dist/Components/Inputs/CheckBoxGroup.d.ts +20 -0
  45. package/dist/Components/Inputs/CheckBoxGroup.js +80 -0
  46. package/dist/Components/Inputs/ChoiceField.d.ts +122 -0
  47. package/dist/Components/Inputs/ChoiceField.js +169 -0
  48. package/dist/Components/Inputs/DatePicker.d.ts +54 -0
  49. package/dist/Components/Inputs/DatePicker.js +246 -0
  50. package/dist/Components/Inputs/DateRangePicker.d.ts +62 -0
  51. package/dist/Components/Inputs/DateRangePicker.js +283 -0
  52. package/dist/Components/Inputs/DateTimePicker.d.ts +75 -0
  53. package/dist/Components/Inputs/DateTimePicker.js +400 -0
  54. package/dist/Components/Inputs/Dropdown.d.ts +117 -0
  55. package/dist/Components/Inputs/Dropdown.js +839 -0
  56. package/dist/Components/Inputs/DropdownParts.d.ts +84 -0
  57. package/dist/Components/Inputs/DropdownParts.js +102 -0
  58. package/dist/Components/Inputs/EditorShell.d.ts +45 -0
  59. package/dist/Components/Inputs/EditorShell.js +214 -0
  60. package/dist/Components/Inputs/Field.d.ts +53 -0
  61. package/dist/Components/Inputs/Field.js +16 -0
  62. package/dist/Components/Inputs/GroupForm.d.ts +20 -0
  63. package/dist/Components/Inputs/GroupForm.js +172 -0
  64. package/dist/Components/Inputs/InputField.d.ts +59 -0
  65. package/dist/Components/Inputs/InputField.js +169 -0
  66. package/dist/Components/Inputs/InputRenderer.d.ts +37 -0
  67. package/dist/Components/Inputs/InputRenderer.js +99 -0
  68. package/dist/Components/Inputs/MarkdownEditor.d.ts +67 -0
  69. package/dist/Components/Inputs/MarkdownEditor.js +289 -0
  70. package/dist/Components/Inputs/NumberBox.d.ts +53 -0
  71. package/dist/Components/Inputs/NumberBox.js +228 -0
  72. package/dist/Components/Inputs/RadioGroup.d.ts +20 -0
  73. package/dist/Components/Inputs/RadioGroup.js +43 -0
  74. package/dist/Components/Inputs/ReadOnlyNotice.d.ts +36 -0
  75. package/dist/Components/Inputs/ReadOnlyNotice.js +117 -0
  76. package/dist/Components/Inputs/RichTextEditor.d.ts +103 -0
  77. package/dist/Components/Inputs/RichTextEditor.js +1170 -0
  78. package/dist/Components/Inputs/RichTextParts.d.ts +63 -0
  79. package/dist/Components/Inputs/RichTextParts.js +157 -0
  80. package/dist/Components/Inputs/RowsInput.d.ts +115 -0
  81. package/dist/Components/Inputs/RowsInput.js +308 -0
  82. package/dist/Components/Inputs/Slider.d.ts +87 -0
  83. package/dist/Components/Inputs/Slider.js +216 -0
  84. package/dist/Components/Inputs/TabularForm.d.ts +27 -0
  85. package/dist/Components/Inputs/TabularForm.js +348 -0
  86. package/dist/Components/Inputs/TextArea.d.ts +43 -0
  87. package/dist/Components/Inputs/TextArea.js +31 -0
  88. package/dist/Components/Inputs/TextBox.d.ts +52 -0
  89. package/dist/Components/Inputs/TextBox.js +58 -0
  90. package/dist/Components/Inputs/TextField.d.ts +31 -0
  91. package/dist/Components/Inputs/TextField.js +35 -0
  92. package/dist/Components/Inputs/TimePanel.d.ts +34 -0
  93. package/dist/Components/Inputs/TimePanel.js +288 -0
  94. package/dist/Components/Inputs/TimePicker.d.ts +54 -0
  95. package/dist/Components/Inputs/TimePicker.js +240 -0
  96. package/dist/Components/Inputs/TreeView.d.ts +160 -0
  97. package/dist/Components/Inputs/TreeView.js +947 -0
  98. package/dist/Components/Layouts/MessageBox.d.ts +71 -0
  99. package/dist/Components/Layouts/MessageBox.js +104 -0
  100. package/dist/Components/Layouts/Popup.d.ts +92 -0
  101. package/dist/Components/Layouts/Popup.js +376 -0
  102. package/dist/Components/Layouts/PopupContext.d.ts +2 -0
  103. package/dist/Components/Layouts/PopupContext.js +4 -0
  104. package/dist/Components/Layouts/PopupDock.d.ts +22 -0
  105. package/dist/Components/Layouts/PopupDock.js +121 -0
  106. package/dist/Components/Layouts/PopupHost.d.ts +56 -0
  107. package/dist/Components/Layouts/PopupHost.js +163 -0
  108. package/dist/Components/Layouts/PopupRules.d.ts +30 -0
  109. package/dist/Components/Layouts/PopupRules.js +63 -0
  110. package/dist/Components/Layouts/ThemePicker.d.ts +13 -0
  111. package/dist/Components/Layouts/ThemePicker.js +22 -0
  112. package/dist/Components/Layouts/ThemeScript.d.ts +14 -0
  113. package/dist/Components/Layouts/ThemeScript.js +13 -0
  114. package/dist/Components/Layouts/ThemeSwitcher.d.ts +13 -0
  115. package/dist/Components/Layouts/ThemeSwitcher.js +49 -0
  116. package/dist/Components/Layouts/Toaster.d.ts +76 -0
  117. package/dist/Components/Layouts/Toaster.js +172 -0
  118. package/dist/Components/Viewers/DataTable.d.ts +25 -0
  119. package/dist/Components/Viewers/DataTable.js +596 -0
  120. package/dist/Components/Viewers/DataTableColumns.d.ts +28 -0
  121. package/dist/Components/Viewers/DataTableColumns.js +243 -0
  122. package/dist/Components/Viewers/DataTableParts.d.ts +138 -0
  123. package/dist/Components/Viewers/DataTableParts.js +157 -0
  124. package/dist/Components/Viewers/MarkdownView.d.ts +26 -0
  125. package/dist/Components/Viewers/MarkdownView.js +79 -0
  126. package/dist/Components/Viewers/RichTextView.d.ts +18 -0
  127. package/dist/Components/Viewers/RichTextView.js +17 -0
  128. package/dist/Helpers/AnimationHelpers.d.ts +6 -0
  129. package/dist/Helpers/AnimationHelpers.js +35 -0
  130. package/dist/Helpers/ApiClient.d.ts +96 -0
  131. package/dist/Helpers/ApiClient.js +200 -0
  132. package/dist/Helpers/ApiFormHelpers.d.ts +49 -0
  133. package/dist/Helpers/ApiFormHelpers.js +120 -0
  134. package/dist/Helpers/ApiModules.d.ts +131 -0
  135. package/dist/Helpers/ApiModules.js +195 -0
  136. package/dist/Helpers/ApiResponses.d.ts +51 -0
  137. package/dist/Helpers/ApiResponses.js +250 -0
  138. package/dist/Helpers/ApiRoutes.d.ts +140 -0
  139. package/dist/Helpers/ApiRoutes.js +183 -0
  140. package/dist/Helpers/ApiToasts.d.ts +21 -0
  141. package/dist/Helpers/ApiToasts.js +22 -0
  142. package/dist/Helpers/ChatBackend.d.ts +134 -0
  143. package/dist/Helpers/ChatBackend.js +332 -0
  144. package/dist/Helpers/ChatHelpers.d.ts +189 -0
  145. package/dist/Helpers/ChatHelpers.js +486 -0
  146. package/dist/Helpers/ChatHooks.d.ts +81 -0
  147. package/dist/Helpers/ChatHooks.js +175 -0
  148. package/dist/Helpers/ChatStore.d.ts +132 -0
  149. package/dist/Helpers/ChatStore.js +394 -0
  150. package/dist/Helpers/ChatSummaries.d.ts +39 -0
  151. package/dist/Helpers/ChatSummaries.js +118 -0
  152. package/dist/Helpers/ClassHelpers.d.ts +3 -0
  153. package/dist/Helpers/ClassHelpers.js +4 -0
  154. package/dist/Helpers/CrudBackend.d.ts +98 -0
  155. package/dist/Helpers/CrudBackend.js +214 -0
  156. package/dist/Helpers/CrudHelpers.d.ts +111 -0
  157. package/dist/Helpers/CrudHelpers.js +267 -0
  158. package/dist/Helpers/DateHelpers.d.ts +88 -0
  159. package/dist/Helpers/DateHelpers.js +363 -0
  160. package/dist/Helpers/DatePreferences.d.ts +14 -0
  161. package/dist/Helpers/DatePreferences.js +94 -0
  162. package/dist/Helpers/DateTimeHelpers.d.ts +87 -0
  163. package/dist/Helpers/DateTimeHelpers.js +286 -0
  164. package/dist/Helpers/DragHelpers.d.ts +129 -0
  165. package/dist/Helpers/DragHelpers.js +281 -0
  166. package/dist/Helpers/DropdownHelpers.d.ts +56 -0
  167. package/dist/Helpers/DropdownHelpers.js +180 -0
  168. package/dist/Helpers/ExcelBackend.d.ts +106 -0
  169. package/dist/Helpers/ExcelBackend.js +290 -0
  170. package/dist/Helpers/ExcelHelpers.d.ts +98 -0
  171. package/dist/Helpers/ExcelHelpers.js +302 -0
  172. package/dist/Helpers/FormDrafts.d.ts +18 -0
  173. package/dist/Helpers/FormDrafts.js +76 -0
  174. package/dist/Helpers/FormStore.d.ts +233 -0
  175. package/dist/Helpers/FormStore.js +752 -0
  176. package/dist/Helpers/InputParamsHelpers.d.ts +79 -0
  177. package/dist/Helpers/InputParamsHelpers.js +388 -0
  178. package/dist/Helpers/MarkdownEditing.d.ts +27 -0
  179. package/dist/Helpers/MarkdownEditing.js +250 -0
  180. package/dist/Helpers/MarkdownHelpers.d.ts +82 -0
  181. package/dist/Helpers/MarkdownHelpers.js +775 -0
  182. package/dist/Helpers/MessageBuilder.d.ts +74 -0
  183. package/dist/Helpers/MessageBuilder.js +252 -0
  184. package/dist/Helpers/NepaliCalendar.d.ts +25 -0
  185. package/dist/Helpers/NepaliCalendar.js +107 -0
  186. package/dist/Helpers/NumberHelpers.d.ts +71 -0
  187. package/dist/Helpers/NumberHelpers.js +202 -0
  188. package/dist/Helpers/Permissions.d.ts +62 -0
  189. package/dist/Helpers/Permissions.js +133 -0
  190. package/dist/Helpers/PopoverHelpers.d.ts +68 -0
  191. package/dist/Helpers/PopoverHelpers.js +195 -0
  192. package/dist/Helpers/RichTextHelpers.d.ts +77 -0
  193. package/dist/Helpers/RichTextHelpers.js +1072 -0
  194. package/dist/Helpers/RowsStore.d.ts +166 -0
  195. package/dist/Helpers/RowsStore.js +606 -0
  196. package/dist/Helpers/TableColumns.d.ts +47 -0
  197. package/dist/Helpers/TableColumns.js +282 -0
  198. package/dist/Helpers/TableExport.d.ts +30 -0
  199. package/dist/Helpers/TableExport.js +97 -0
  200. package/dist/Helpers/TableHelpers.d.ts +110 -0
  201. package/dist/Helpers/TableHelpers.js +301 -0
  202. package/dist/Helpers/TableStore.d.ts +142 -0
  203. package/dist/Helpers/TableStore.js +530 -0
  204. package/dist/Helpers/ThemeHelpers.d.ts +15 -0
  205. package/dist/Helpers/ThemeHelpers.js +16 -0
  206. package/dist/Helpers/TimeHelpers.d.ts +73 -0
  207. package/dist/Helpers/TimeHelpers.js +253 -0
  208. package/dist/Helpers/TreeStore.d.ts +188 -0
  209. package/dist/Helpers/TreeStore.js +577 -0
  210. package/dist/Helpers/ValidationHelpers.d.ts +124 -0
  211. package/dist/Helpers/ValidationHelpers.js +301 -0
  212. package/dist/Interfaces/ApiInterfaces.d.ts +174 -0
  213. package/dist/Interfaces/ApiInterfaces.js +30 -0
  214. package/dist/Interfaces/ChatInterfaces.d.ts +240 -0
  215. package/{src/sso-client.tsx → dist/Interfaces/ChatInterfaces.js} +1 -1
  216. package/dist/Interfaces/CrudInterfaces.d.ts +232 -0
  217. package/dist/Interfaces/CrudInterfaces.js +1 -0
  218. package/dist/Interfaces/DateInterfaces.d.ts +154 -0
  219. package/dist/Interfaces/DateInterfaces.js +29 -0
  220. package/dist/Interfaces/ExcelInterfaces.d.ts +215 -0
  221. package/dist/Interfaces/ExcelInterfaces.js +45 -0
  222. package/dist/Interfaces/FormInterfaces.d.ts +402 -0
  223. package/dist/Interfaces/FormInterfaces.js +1 -0
  224. package/dist/Interfaces/InputInterfaces.d.ts +141 -0
  225. package/dist/Interfaces/InputInterfaces.js +1 -0
  226. package/dist/Interfaces/MessageInterfaces.d.ts +111 -0
  227. package/dist/Interfaces/MessageInterfaces.js +5 -0
  228. package/dist/Interfaces/TableInterfaces.d.ts +351 -0
  229. package/dist/Interfaces/TableInterfaces.js +1 -0
  230. package/dist/Interfaces/ThemeInterfaces.d.ts +17 -0
  231. package/dist/Interfaces/ThemeInterfaces.js +17 -0
  232. package/dist/Interfaces/TypeInterfaces.d.ts +4 -0
  233. package/dist/Interfaces/TypeInterfaces.js +1 -0
  234. package/dist/Server.Index.d.ts +2 -0
  235. package/dist/Server.Index.js +5 -0
  236. package/dist/Services/ApiProxy.d.ts +32 -0
  237. package/dist/Services/ApiProxy.js +111 -0
  238. package/dist/Services/BrowserApi.d.ts +95 -0
  239. package/dist/Services/BrowserApi.js +129 -0
  240. package/dist/Services/ChatApi.d.ts +37 -0
  241. package/dist/Services/ChatApi.js +98 -0
  242. package/dist/Services/ExcelApi.d.ts +46 -0
  243. package/dist/Services/ExcelApi.js +196 -0
  244. package/dist/Services/ServerApi.d.ts +54 -0
  245. package/dist/Services/ServerApi.js +78 -0
  246. package/dist/Services/ThemeService.d.ts +17 -0
  247. package/dist/Services/ThemeService.js +83 -0
  248. package/dist/Shared.Index.d.ts +51 -0
  249. package/dist/Shared.Index.js +55 -0
  250. package/package.json +85 -33
  251. package/src/Styles/Nexus.Base.css +70 -0
  252. package/src/Styles/Nexus.Button.css +153 -0
  253. package/src/Styles/Nexus.Calendar.css +275 -0
  254. package/src/Styles/Nexus.Chat.css +1489 -0
  255. package/src/Styles/Nexus.Choice.css +345 -0
  256. package/src/Styles/Nexus.Crud.css +161 -0
  257. package/src/Styles/Nexus.DateTime.css +81 -0
  258. package/src/Styles/Nexus.Dropdown.css +774 -0
  259. package/src/Styles/Nexus.Editor.css +297 -0
  260. package/src/Styles/Nexus.Excel.css +370 -0
  261. package/src/Styles/Nexus.Form.css +321 -0
  262. package/src/Styles/Nexus.Index.css +36 -0
  263. package/src/Styles/Nexus.Input.css +637 -0
  264. package/src/Styles/Nexus.Markdown.css +265 -0
  265. package/src/Styles/Nexus.Menu.css +259 -0
  266. package/src/Styles/Nexus.Popup.css +731 -0
  267. package/src/Styles/Nexus.RichText.css +463 -0
  268. package/src/Styles/Nexus.Rows.css +596 -0
  269. package/src/Styles/Nexus.Slider.css +278 -0
  270. package/src/Styles/Nexus.Tab.Buttons.css +419 -0
  271. package/src/Styles/Nexus.Table.css +1296 -0
  272. package/src/Styles/Nexus.Theme.Picker.css +232 -0
  273. package/src/Styles/Nexus.Themes.css +194 -0
  274. package/src/Styles/Nexus.Time.css +147 -0
  275. package/src/Styles/Nexus.Toast.css +265 -0
  276. package/src/Styles/Nexus.Tokens.css +72 -0
  277. package/src/Styles/Nexus.Tree.css +435 -0
  278. package/src/api-services/authentication-service.tsx +0 -23
  279. package/src/api-services/preference-service.tsx +0 -5
  280. package/src/api-services/system-service.tsx +0 -29
  281. package/src/client.ts +0 -31
  282. package/src/components/documents/button.tsx +0 -133
  283. package/src/components/documents/icon-box.tsx +0 -93
  284. package/src/components/documents/page-title.tsx +0 -7
  285. package/src/components/documents/tab-button.tsx +0 -172
  286. package/src/components/documents/tag.tsx +0 -30
  287. package/src/components/index.js +0 -0
  288. package/src/components/inputs/checkbox-input.tsx +0 -66
  289. package/src/components/inputs/input-box.tsx +0 -48
  290. package/src/components/inputs/input-element.tsx +0 -65
  291. package/src/components/inputs/input-form.tsx +0 -164
  292. package/src/components/inputs/input.tsx +0 -181
  293. package/src/components/inputs/number-input.tsx +0 -108
  294. package/src/components/inputs/radiobox-input.tsx +0 -53
  295. package/src/components/inputs/textarea-input.tsx +0 -47
  296. package/src/components/inputs/textbox-input.tsx +0 -45
  297. package/src/components/layouts/global-dialogbox.tsx +0 -431
  298. package/src/components/layouts/global-layout.tsx +0 -64
  299. package/src/components/layouts/layout-helpers.tsx +0 -20
  300. package/src/components/layouts/panels/user-panel.tsx +0 -112
  301. package/src/components/layouts/utility-menu.tsx +0 -49
  302. package/src/components/panels/theme-panel.tsx +0 -46
  303. package/src/helpers/bitwise-helpers.tsx +0 -11
  304. package/src/helpers/browser-helpers.tsx +0 -156
  305. package/src/helpers/datasource-helpers.tsx +0 -99
  306. package/src/helpers/element-helpers.tsx +0 -123
  307. package/src/helpers/input-helpers.tsx +0 -74
  308. package/src/helpers/string-helpers.tsx +0 -28
  309. package/src/helpers/utility-helpers.tsx +0 -45
  310. package/src/helpers/validation-helpers.tsx +0 -302
  311. package/src/index.ts +0 -26
  312. package/src/interface.ts +0 -19
  313. package/src/interfaces/auth-token-interfaces.tsx +0 -6
  314. package/src/interfaces/browser-interfaces.tsx +0 -36
  315. package/src/interfaces/button-interfaces.tsx +0 -63
  316. package/src/interfaces/datasource-interfaces.tsx +0 -22
  317. package/src/interfaces/datatable-interfaces.tsx +0 -25
  318. package/src/interfaces/dialogbox-interfaces.tsx +0 -5
  319. package/src/interfaces/exception-interfaces.tsx +0 -99
  320. package/src/interfaces/http-interfaces.tsx +0 -129
  321. package/src/interfaces/icon-interfaces.tsx +0 -129
  322. package/src/interfaces/input-interfaces.tsx +0 -410
  323. package/src/interfaces/layout-interfaces.tsx +0 -191
  324. package/src/interfaces/menu-interfaces.tsx +0 -53
  325. package/src/interfaces/message-interfaces.tsx +0 -32
  326. package/src/interfaces/permission-interfaces.tsx +0 -9
  327. package/src/interfaces/storage-interfaces.tsx +0 -5
  328. package/src/interfaces/system-interfaces.tsx +0 -22
  329. package/src/interfaces/theme-interfaces.tsx +0 -123
  330. package/src/interfaces/type-interfaces.tsx +0 -28
  331. package/src/interfaces/user-interfaces.tsx +0 -47
  332. package/src/nexus-client.tsx +0 -21
  333. package/src/nexus.environments.tsx +0 -66
  334. package/src/proxy-api/proxy-backend.tsx +0 -60
  335. package/src/proxy-api/proxy-constants.tsx +0 -28
  336. package/src/proxy-api/proxy-helpers.tsx +0 -91
  337. package/src/proxy-api-client.tsx +0 -1
  338. package/src/proxy-api-server.tsx +0 -2
  339. package/src/services/http-client-services.tsx +0 -75
  340. package/src/services/http-services.tsx +0 -158
  341. package/src/services/loader-service.tsx +0 -185
  342. package/src/services/localstorage-service.tsx +0 -119
  343. package/src/services/message-services.tsx +0 -383
  344. package/src/services/theme-service.tsx +0 -163
  345. package/src/services/user-services.tsx +0 -10
  346. package/src/sso-config/auth-token-validation.ts +0 -16
  347. package/src/sso-config/callback-route.tsx +0 -35
  348. package/src/sso-config/cookie-encryption.ts +0 -51
  349. package/src/sso-config/cookie-helpers.tsx +0 -102
  350. package/src/sso-config/forgot-password-route.tsx +0 -36
  351. package/src/sso-config/oauth-callback-state.ts +0 -61
  352. package/src/sso-config/pkce-helpers.ts +0 -9
  353. package/src/sso-config/provider-complete-route.tsx +0 -18
  354. package/src/sso-config/redirect-context-actions.tsx +0 -45
  355. package/src/sso-config/redirect-context-helpers.tsx +0 -159
  356. package/src/sso-config/redirect-context-persist.tsx +0 -18
  357. package/src/sso-config/redirect-context-route.tsx +0 -45
  358. package/src/sso-config/refresh-route.tsx +0 -23
  359. package/src/sso-config/sign-in-route.tsx +0 -74
  360. package/src/sso-config/sign-out-route.tsx +0 -57
  361. package/src/sso-config/sign-up-route.tsx +0 -57
  362. package/src/sso-config/sso-backend-flow.ts +0 -38
  363. package/src/sso-config/sso-complete-route.tsx +0 -50
  364. package/src/sso-config/sso-config.ts +0 -59
  365. package/src/sso-config/sso-interfaces.tsx +0 -99
  366. package/src/sso-config/sso-response-helpers.tsx +0 -20
  367. package/src/sso-server.tsx +0 -21
  368. package/src/styles/nexus.animation.css +0 -269
  369. package/src/styles/nexus.core.css +0 -119
  370. package/src/styles/nexus.dialog.css +0 -144
  371. package/src/styles/nexus.grid-view.css +0 -42
  372. package/src/styles/nexus.icon.css +0 -51
  373. package/src/styles/nexus.input.css +0 -207
  374. package/src/styles/nexus.loader.css +0 -11
  375. package/src/styles/nexus.logic.css +0 -47
  376. package/src/styles/nexus.utility.css +0 -347
@@ -0,0 +1,87 @@
1
+ import { type ChangeEvent, type ComponentPropsWithRef, type CSSProperties, type ReactNode } from "react";
2
+ import type { NumberFormatOptions, SliderMark, ValidateOn } from "../../Interfaces/InputInterfaces.ts";
3
+ import type { Size } from "../../Interfaces/TypeInterfaces.ts";
4
+ interface SliderBaseProps extends NumberFormatOptions {
5
+ label?: ReactNode;
6
+ /** Help text under the slider. An error takes its place. */
7
+ hint?: ReactNode;
8
+ /** An error from outside, such as a server message. */
9
+ error?: string | null;
10
+ /** Default `md`. */
11
+ size?: Size;
12
+ /** Default 0. */
13
+ min?: number;
14
+ /** Default 100. */
15
+ max?: number;
16
+ /** Default 1. */
17
+ step?: number;
18
+ /** Text before the shown value, e.g. "Rs ". Include a space if one is wanted. */
19
+ prefix?: string;
20
+ /** Text after the shown value, e.g. "%" or " nights". */
21
+ suffix?: string;
22
+ /** Writes the shown value; replaces the number format, `prefix`, and `suffix`. For example, hours as "14:30". */
23
+ format?: (value: number) => string;
24
+ /** Shows the value beside the label. Default true. */
25
+ showValue?: boolean;
26
+ /** Shows the value above the thumb while it is hovered, focused, or dragged. Best with `showValue={false}`. */
27
+ tooltip?: boolean;
28
+ /** Labelled points under the track. */
29
+ marks?: readonly SliderMark[];
30
+ disabled?: boolean;
31
+ /** Can be focused but not moved; the value is still sent with a form. A lock follows the label, and a try to move it shows a note. */
32
+ readOnly?: boolean;
33
+ /** What a read-only slider says when someone tries to move it. Default "Read-only: this value cannot be changed." ("this range" for a range slider). */
34
+ readOnlyMessage?: string;
35
+ /** Form field name. A range slider sends two values under it: start, then end. */
36
+ name?: string;
37
+ id?: string;
38
+ /** Name used in messages. Default: the label, when it is text. */
39
+ fieldName?: string;
40
+ /** When a `validate` message shows. Default `blur`; submitting a form always shows it. */
41
+ validateOn?: ValidateOn;
42
+ className?: string;
43
+ style?: CSSProperties;
44
+ }
45
+ type NativeInputProps = Omit<ComponentPropsWithRef<"input">, keyof SliderBaseProps | "type" | "value" | "defaultValue" | "onChange" | "children">;
46
+ export interface SliderProps extends SliderBaseProps, NativeInputProps {
47
+ value?: number;
48
+ /** Default: `min`. */
49
+ defaultValue?: number;
50
+ /** Returns a message to fail, e.g. a deposit below a minimum. */
51
+ validate?: (value: number) => string | null | undefined;
52
+ /** Every change while dragging or stepping. */
53
+ onValueChange?: (value: number, event: ChangeEvent<HTMLElement>) => void;
54
+ /** Once the thumb is released or a key step ends: the moment to call an API. */
55
+ onValueCommit?: (value: number) => void;
56
+ inputClassName?: string;
57
+ }
58
+ export interface RangeSliderProps extends SliderBaseProps {
59
+ /** `[start, end]`. With `value`, the slider is controlled. */
60
+ value?: readonly [number, number];
61
+ /** Default: `[min, max]`. */
62
+ defaultValue?: readonly [number, number];
63
+ /** Smallest gap between start and end. Default 0. */
64
+ minDistance?: number;
65
+ /** Names of the two thumbs for screen readers, after the label. Default `["minimum", "maximum"]`. */
66
+ thumbLabels?: readonly [string, string];
67
+ validate?: (value: [number, number]) => string | null | undefined;
68
+ onValueChange?: (value: [number, number], event: ChangeEvent<HTMLElement>) => void;
69
+ onValueCommit?: (value: [number, number]) => void;
70
+ "aria-label"?: string;
71
+ }
72
+ /**
73
+ * Pick a number by dragging, with the arrow keys (Page Up and Page Down for bigger steps, Home and End for the
74
+ * limits), or by clicking a mark. A native range input, so touch and screen readers work as usual. Dragging writes
75
+ * the fill and the shown value straight to the DOM: nothing re-renders.
76
+ *
77
+ * @example <Slider name="discount" label="Discount" max={50} suffix="%" defaultValue={10} />
78
+ */
79
+ export declare function Slider({ value, defaultValue, validate, onValueChange, onValueCommit, inputClassName, ...props }: SliderProps): import("react").JSX.Element;
80
+ /**
81
+ * Pick a range with two thumbs, such as a price filter. Clicking the track moves the nearer thumb, and the thumbs
82
+ * keep `minDistance` apart.
83
+ *
84
+ * @example <RangeSlider name="price" label="Price per night" min={1000} max={30000} step={500} prefix="Rs " grouping />
85
+ */
86
+ export declare function RangeSlider({ value, defaultValue, minDistance, thumbLabels, validate, onValueChange, onValueCommit, ...props }: RangeSliderProps): import("react").JSX.Element;
87
+ export {};
@@ -0,0 +1,216 @@
1
+ "use client";
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import { Fragment, useEffect, useEffectEvent, useRef, } from "react";
4
+ import { cx } from "../../Helpers/ClassHelpers.js";
5
+ import { clampNumber, countDecimals, formatNumber, roundDecimal } from "../../Helpers/NumberHelpers.js";
6
+ import { GroupFooter, leavesField, OPTION_ATTRIBUTE, useChoiceField } from "./ChoiceField.js";
7
+ import { hasContent } from "./Field.js";
8
+ import { setInputValue } from "./InputField.js";
9
+ import { useReadOnlyNotice } from "./ReadOnlyNotice.js";
10
+ /**
11
+ * Pick a number by dragging, with the arrow keys (Page Up and Page Down for bigger steps, Home and End for the
12
+ * limits), or by clicking a mark. A native range input, so touch and screen readers work as usual. Dragging writes
13
+ * the fill and the shown value straight to the DOM: nothing re-renders.
14
+ *
15
+ * @example <Slider name="discount" label="Discount" max={50} suffix="%" defaultValue={10} />
16
+ */
17
+ export function Slider({ value, defaultValue, validate, onValueChange, onValueCommit, inputClassName, ...props }) {
18
+ const base = pickBase(props);
19
+ const inputProps = omitBase(props);
20
+ return (_jsx(SliderField, { ...base, values: value === undefined ? undefined : [value], defaultValues: [defaultValue ?? base.min ?? 0], validate: validate && (values => validate(values[0])), onValues: onValueChange && ((values, event) => onValueChange(values[0], event)), onCommit: onValueCommit && (values => onValueCommit(values[0])), inputProps: inputProps, inputClassName: inputClassName }));
21
+ }
22
+ /**
23
+ * Pick a range with two thumbs, such as a price filter. Clicking the track moves the nearer thumb, and the thumbs
24
+ * keep `minDistance` apart.
25
+ *
26
+ * @example <RangeSlider name="price" label="Price per night" min={1000} max={30000} step={500} prefix="Rs " grouping />
27
+ */
28
+ export function RangeSlider({ value, defaultValue, minDistance = 0, thumbLabels = ["minimum", "maximum"], validate, onValueChange, onValueCommit, ...props }) {
29
+ const base = pickBase(props);
30
+ const min = base.min ?? 0;
31
+ const max = base.max ?? 100;
32
+ const start = defaultValue ?? [min, max];
33
+ return (_jsx(SliderField, { ...base, range: true, values: value, defaultValues: [Math.min(start[0], start[1]), Math.max(start[0], start[1])], minDistance: minDistance, thumbLabels: thumbLabels, validate: validate && (values => validate([values[0], values[1]])), onValues: onValueChange && ((values, event) => onValueChange([values[0], values[1]], event)), onCommit: onValueCommit && (values => onValueCommit([values[0], values[1]])), inputProps: { "aria-label": props["aria-label"] } }));
34
+ }
35
+ const BASE_KEYS = [
36
+ "label", "hint", "error", "size", "min", "max", "step", "prefix", "suffix", "format", "showValue", "tooltip", "marks", "disabled", "readOnly", "readOnlyMessage",
37
+ "name", "id", "fieldName", "validateOn", "className", "style", "decimals", "fixedDecimals", "grouping", "locale",
38
+ ];
39
+ function pickBase(props) {
40
+ const base = {};
41
+ for (const key of BASE_KEYS)
42
+ if (key in props)
43
+ base[key] = props[key];
44
+ return base;
45
+ }
46
+ function omitBase(props) {
47
+ const rest = { ...props };
48
+ for (const key of BASE_KEYS)
49
+ delete rest[key];
50
+ return rest;
51
+ }
52
+ function SliderField(props) {
53
+ const { label, hint, size = "md", min = 0, max = 100, step = 1, prefix, suffix, format, showValue = true, tooltip = false, marks, disabled = false, readOnly = false, name, fieldName, className, style, decimals, fixedDecimals, grouping, locale, range = false, values, defaultValues, minDistance = 0, thumbLabels = [], validate, onValues, onCommit, inputProps, inputClassName, } = props;
54
+ const { readOnlyMessage = range ? "Read-only: this range cannot be changed." : "Read-only: this value cannot be changed." } = props;
55
+ const span = max - min || 1;
56
+ const initial = (values ?? defaultValues).map(value => clampNumber(value, min, max));
57
+ const text = (value) => (format ? format(value) : `${prefix ?? ""}${formatNumber(value, { decimals, fixedDecimals, grouping, locale })}${suffix ?? ""}`);
58
+ const fraction = (value) => (clampNumber(value, min, max) - min) / span;
59
+ const controlRef = useRef(null);
60
+ const valueRef = useRef(null);
61
+ const tooltipRefs = useRef([]);
62
+ // The last values, so a read-only slider can put a moved thumb straight back.
63
+ const lastRef = useRef(initial);
64
+ const field = useChoiceField(props, {
65
+ check: inputs => validate?.(read(inputs)) || null,
66
+ checkKeys: [values?.join(), validate, min, max],
67
+ sync,
68
+ });
69
+ const read = (inputs) => inputs.map(input => Number(input.value));
70
+ // A read-only slider puts a moved thumb straight back: a lock after the label, and a note under the track, say why.
71
+ const readOnlyNotice = useReadOnlyNotice(readOnly && !disabled, field.containerRef, readOnlyMessage, {
72
+ anchor: target => target.closest(".nx-slider__control"),
73
+ typing: false,
74
+ keys: ["ArrowLeft", "ArrowRight", "ArrowUp", "ArrowDown", "PageUp", "PageDown", "Home", "End"],
75
+ lock: "label",
76
+ });
77
+ /** Writes the fill, the shown value, the tooltips, and each thumb's spoken value straight to the DOM. */
78
+ function sync(inputs) {
79
+ const current = read(inputs);
80
+ const control = controlRef.current;
81
+ if (!control || current.length === 0)
82
+ return;
83
+ control.style.setProperty("--nx-slider-start", String(range ? fraction(current[0]) : 0));
84
+ control.style.setProperty("--nx-slider-end", String(fraction(current[current.length - 1])));
85
+ inputs.forEach((input, index) => {
86
+ const valueText = text(current[index]);
87
+ input.setAttribute("aria-valuetext", valueText);
88
+ const bubble = tooltipRefs.current[index];
89
+ if (bubble) {
90
+ bubble.textContent = valueText;
91
+ bubble.style.setProperty("--nx-slider-at", String(fraction(current[index])));
92
+ }
93
+ });
94
+ if (valueRef.current)
95
+ valueRef.current.textContent = current.map(text).join(" – ");
96
+ lastRef.current = current;
97
+ }
98
+ function handleChange(event) {
99
+ const input = event.target;
100
+ if (!(input instanceof HTMLInputElement) || !input.hasAttribute(OPTION_ATTRIBUTE))
101
+ return;
102
+ const index = Number(input.getAttribute(OPTION_ATTRIBUTE));
103
+ if (readOnly) {
104
+ input.value = String(lastRef.current[index]);
105
+ return;
106
+ }
107
+ const inputs = field.inputs();
108
+ if (range && inputs.length === 2) {
109
+ // The thumbs never cross, and keep minDistance apart.
110
+ const [start, end] = inputs;
111
+ if (index === 0 && Number(start.value) > Number(end.value) - minDistance)
112
+ start.value = String(Math.max(min, Number(end.value) - minDistance));
113
+ if (index === 1 && Number(end.value) < Number(start.value) + minDistance)
114
+ end.value = String(Math.min(max, Number(start.value) + minDistance));
115
+ controlRef.current?.setAttribute("data-active", String(index));
116
+ }
117
+ field.onChange();
118
+ onValues?.(read(inputs), event);
119
+ }
120
+ // A released thumb, or a finished key step, fires the native change event.
121
+ const commit = useEffectEvent(() => onCommit?.(read(field.inputs())));
122
+ useEffect(() => {
123
+ const control = controlRef.current;
124
+ if (!control)
125
+ return;
126
+ const onNativeChange = () => commit();
127
+ control.addEventListener("change", onNativeChange);
128
+ return () => control.removeEventListener("change", onNativeChange);
129
+ }, []);
130
+ /** The value under a pointer's x position, on the step grid. */
131
+ function valueAt(clientX) {
132
+ const control = controlRef.current;
133
+ const rect = control.getBoundingClientRect();
134
+ const thumb = parseFloat(getComputedStyle(control).getPropertyValue("--nx-slider-thumb")) || 16;
135
+ const position = clampNumber((clientX - rect.left - thumb / 2) / Math.max(1, rect.width - thumb), 0, 1);
136
+ const stepped = min + Math.round((position * span) / step) * step;
137
+ return clampNumber(roundDecimal(stepped, Math.max(countDecimals(step), countDecimals(min))), min, max);
138
+ }
139
+ /** Moves the thumb nearest to a value there, as a click on the track or on a mark does. */
140
+ function moveTo(value, focus = true) {
141
+ const input = nearestInput(value);
142
+ if (disabled || readOnly || !input)
143
+ return null;
144
+ if (focus)
145
+ input.focus();
146
+ setInputValue(input, String(value));
147
+ return input;
148
+ }
149
+ /** The thumb a press at a value would move: the only one, or the nearer of two. */
150
+ function nearestInput(value) {
151
+ const inputs = field.inputs();
152
+ if (inputs.length < 2)
153
+ return inputs[0];
154
+ const [start, end] = read(inputs);
155
+ return inputs[value <= start ? 0 : value >= end ? 1 : value - start <= end - value ? 0 : 1];
156
+ }
157
+ function commitInput(input) {
158
+ input.dispatchEvent(new Event("change", { bubbles: true }));
159
+ }
160
+ function handleControlPointerDown(event) {
161
+ if (!readOnly) {
162
+ if (range)
163
+ handleTrackPointerDown(event);
164
+ return;
165
+ }
166
+ // A press on a range slider's track focuses the nearer thumb, as when editable, so focus stays in the slider
167
+ // and the note stays up.
168
+ if (range && event.button === 0 && !(event.target instanceof HTMLInputElement)) {
169
+ event.preventDefault();
170
+ nearestInput(valueAt(event.clientX))?.focus();
171
+ }
172
+ readOnlyNotice.show(event.currentTarget);
173
+ }
174
+ function handleBlur(event) {
175
+ if (leavesField(event))
176
+ readOnlyNotice.hide();
177
+ field.onBlur(event);
178
+ }
179
+ // A range slider's inputs only take pointer events on their thumbs, so a press on the track lands here.
180
+ function handleTrackPointerDown(event) {
181
+ if (event.button !== 0 || event.target instanceof HTMLInputElement)
182
+ return;
183
+ const input = moveTo(valueAt(event.clientX));
184
+ if (!input)
185
+ return;
186
+ event.preventDefault();
187
+ const control = event.currentTarget;
188
+ control.setPointerCapture(event.pointerId);
189
+ const move = (moveEvent) => setInputValue(input, String(valueAt(moveEvent.clientX)));
190
+ const end = () => {
191
+ control.removeEventListener("pointermove", move);
192
+ control.removeEventListener("lostpointercapture", end);
193
+ commitInput(input);
194
+ };
195
+ control.addEventListener("pointermove", move);
196
+ control.addEventListener("lostpointercapture", end);
197
+ }
198
+ const labelId = `${field.fieldId}-label`;
199
+ const inputId = (index) => (index === 0 ? field.fieldId : `${field.fieldId}-${index}`);
200
+ const describedBy = field.error || hint ? field.messageId : undefined;
201
+ const nameText = fieldName ?? (typeof label === "string" ? label : undefined);
202
+ const controlStyle = { "--nx-slider-start": range ? fraction(initial[0]) : 0, "--nx-slider-end": fraction(initial[initial.length - 1]) };
203
+ return (_jsxs("div", { ref: field.containerRef, role: range ? "group" : undefined, "aria-labelledby": range && hasContent(label) ? labelId : undefined, className: cx("nx-slider", `nx-slider--${size}`, range && "nx-slider--range", className), style: style, "data-invalid": field.error ? true : undefined, "data-disabled": disabled || undefined, "data-readonly": readOnly || undefined, onChange: handleChange, onKeyDown: readOnlyNotice.onKeyDown, onBlur: handleBlur, children: [(hasContent(label) || showValue) && (_jsxs("div", { className: "nx-slider__head", children: [hasContent(label) &&
204
+ (range ? (_jsxs("span", { id: labelId, className: "nx-field__label", children: [label, readOnlyNotice.lock] })) : (_jsxs("label", { id: labelId, htmlFor: field.fieldId, className: "nx-field__label", children: [label, readOnlyNotice.lock] }))), showValue && (_jsx("output", { ref: valueRef, className: "nx-slider__value", htmlFor: initial.map((_, index) => inputId(index)).join(" "), "aria-hidden": "true", children: initial.map(text).join(" – ") }))] })), _jsxs("div", { ref: controlRef, className: "nx-slider__control", style: controlStyle, onPointerDown: range || readOnly ? handleControlPointerDown : undefined, children: [_jsx("span", { className: "nx-slider__track", "aria-hidden": "true", children: _jsx("span", { className: "nx-slider__fill" }) }), initial.map((value, index) => (_jsxs(Fragment, { children: [_jsx("input", { ...(index === 0 ? inputProps : undefined), [OPTION_ATTRIBUTE]: index, id: inputId(index), type: "range", className: cx("nx-slider__input", inputClassName), name: name, min: min, max: max, step: step, value: values ? value : undefined, defaultValue: values ? undefined : value, disabled: disabled, "aria-label": range ? [nameText, thumbLabels[index]].filter(Boolean).join(" ") || undefined : inputProps["aria-label"], "aria-readonly": readOnly || undefined, "aria-invalid": field.error ? true : undefined, "aria-describedby": describedBy, "aria-valuetext": text(value), onInvalid: field.onInvalid,
205
+ // A controlled value changes through onValueChange; this silences React's missing-onChange warning.
206
+ onChange: values ? noop : undefined }), tooltip && (_jsx("span", { ref: node => {
207
+ tooltipRefs.current[index] = node;
208
+ }, className: "nx-slider__tooltip", style: { "--nx-slider-at": fraction(value) }, "aria-hidden": "true", children: text(value) }))] }, index)))] }), marks && marks.length > 0 && (_jsx("div", { className: "nx-slider__marks", "aria-hidden": "true", children: marks.map(mark => (_jsx("button", { type: "button", tabIndex: -1, className: "nx-slider__mark", style: { "--nx-slider-at": fraction(mark.value) }, "data-edge": mark.value <= min ? "start" : mark.value >= max ? "end" : undefined, disabled: disabled, onClick: () => {
209
+ const input = moveTo(mark.value);
210
+ if (input)
211
+ commitInput(input);
212
+ else
213
+ readOnlyNotice.show(controlRef.current);
214
+ }, children: mark.label ?? text(mark.value) }, mark.value))) })), _jsx(GroupFooter, { id: field.messageId, hint: hint, error: field.error }), readOnlyNotice.notice] }));
215
+ }
216
+ function noop() { }
@@ -0,0 +1,27 @@
1
+ import type { RowValue, TabularFormProps } from "../../Interfaces/FormInterfaces.ts";
2
+ /**
3
+ * Rows of inputs in a table, one column per input: a person's emails or addresses, invoice lines, a salary sheet. The
4
+ * value is an array of row objects, one value per input, with any other fields the rows came with (such as ids). Inputs
5
+ * come as params, the same objects a form takes, so the same list can show as sections in a `GroupForm`.
6
+ *
7
+ * Only the rows in view are on the page, so a sheet of thousands of rows opens and types as fast as a short one; the
8
+ * values live in a store outside React, and typing renders nothing. The header and the numbered column stay in place
9
+ * while the table scrolls. Each row has one control, beside its number and never in its place: a menu of insert,
10
+ * duplicate, move and remove. Enter in a text or number cell moves down the column, and on the last row adds a row.
11
+ *
12
+ * Every row is one line high, whatever it holds, so nothing shifts as the table is used; a column generated for every
13
+ * row (`cellReadOnly`) says so once on its header rather than on each of its cells; and `maxHeight` is brought down
14
+ * to whole rows, because a scroller that cuts the last one in half reads as broken rather than as scrollable.
15
+ *
16
+ * Inside a `<form>`, the rows are sent as JSON under `name`; a row with a problem blocks submit, and the first one
17
+ * scrolls into view with focus.
18
+ *
19
+ * @example
20
+ * <TabularForm name="emails" label="Emails" itemLabel="Email" max={5} unique={["email"]} inputs={[
21
+ * { type: "email", name: "email", label: "Email", required: true, pattern: TEXT_PATTERNS.email },
22
+ * { type: "dropdown", name: "type", label: "Type", options: EMAIL_TYPES },
23
+ * { type: "checkbox", name: "isVerified", label: "Verified" },
24
+ * { type: "radio", name: "isPrimary", label: "Primary", required: true },
25
+ * ]} />
26
+ */
27
+ export declare function TabularForm<TRow extends RowValue = RowValue>(props: TabularFormProps<TRow>): import("react").JSX.Element;