@thunderid/nextjs 0.2.1 → 0.2.2

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 (349) hide show
  1. package/dist/{types/ThunderIDNextClient.d.ts → ThunderIDNextClient.d.ts} +1 -7
  2. package/dist/ThunderIDNextClient.d.ts.map +1 -0
  3. package/dist/ThunderIDNextClient.js +161 -0
  4. package/dist/ThunderIDNextClient.js.map +1 -0
  5. package/dist/cjs/ThunderIDNextClient.cjs +163 -0
  6. package/dist/cjs/ThunderIDNextClient.cjs.map +1 -0
  7. package/dist/cjs/_virtual/rolldown_runtime.cjs +25 -0
  8. package/dist/cjs/client/components/actions/SignInButton/SignInButton.cjs +79 -0
  9. package/dist/cjs/client/components/actions/SignInButton/SignInButton.cjs.map +1 -0
  10. package/dist/cjs/client/components/actions/SignOutButton/SignOutButton.cjs +61 -0
  11. package/dist/cjs/client/components/actions/SignOutButton/SignOutButton.cjs.map +1 -0
  12. package/dist/cjs/client/components/actions/SignUpButton/SignUpButton.cjs +91 -0
  13. package/dist/cjs/client/components/actions/SignUpButton/SignUpButton.cjs.map +1 -0
  14. package/dist/cjs/client/components/control/SignedIn/SignedIn.cjs +34 -0
  15. package/dist/cjs/client/components/control/SignedIn/SignedIn.cjs.map +1 -0
  16. package/dist/cjs/client/components/control/SignedOut/SignedOut.cjs +34 -0
  17. package/dist/cjs/client/components/control/SignedOut/SignedOut.cjs.map +1 -0
  18. package/dist/cjs/client/components/presentation/SignIn/SignIn.cjs +37 -0
  19. package/dist/cjs/client/components/presentation/SignIn/SignIn.cjs.map +1 -0
  20. package/dist/cjs/client/components/presentation/SignUp/SignUp.cjs +79 -0
  21. package/dist/cjs/client/components/presentation/SignUp/SignUp.cjs.map +1 -0
  22. package/dist/cjs/client/components/presentation/User/User.cjs +49 -0
  23. package/dist/cjs/client/components/presentation/User/User.cjs.map +1 -0
  24. package/dist/cjs/client/components/presentation/UserDropdown/UserDropdown.cjs +114 -0
  25. package/dist/cjs/client/components/presentation/UserDropdown/UserDropdown.cjs.map +1 -0
  26. package/dist/cjs/client/components/presentation/UserProfile/UserProfile.cjs +52 -0
  27. package/dist/cjs/client/components/presentation/UserProfile/UserProfile.cjs.map +1 -0
  28. package/dist/cjs/client/contexts/ThunderID/ThunderIDContext.cjs +34 -0
  29. package/dist/cjs/client/contexts/ThunderID/ThunderIDContext.cjs.map +1 -0
  30. package/dist/cjs/client/contexts/ThunderID/ThunderIDProvider.cjs +165 -0
  31. package/dist/cjs/client/contexts/ThunderID/ThunderIDProvider.cjs.map +1 -0
  32. package/dist/cjs/client/contexts/ThunderID/useThunderID.cjs +19 -0
  33. package/dist/cjs/client/contexts/ThunderID/useThunderID.cjs.map +1 -0
  34. package/dist/cjs/client/index.cjs +11 -0
  35. package/dist/cjs/constants/sessionConstants.cjs +55 -0
  36. package/dist/cjs/constants/sessionConstants.cjs.map +1 -0
  37. package/dist/cjs/index.cjs +35 -990
  38. package/dist/cjs/server/ThunderIDProvider.cjs +114 -0
  39. package/dist/cjs/server/ThunderIDProvider.cjs.map +1 -0
  40. package/dist/cjs/server/actions/clearSession.cjs +41 -0
  41. package/dist/cjs/server/actions/clearSession.cjs.map +1 -0
  42. package/dist/cjs/server/actions/getAccessToken.cjs +27 -0
  43. package/dist/cjs/server/actions/getAccessToken.cjs.map +1 -0
  44. package/dist/cjs/server/actions/getClientOrigin.cjs +18 -0
  45. package/dist/cjs/server/actions/getClientOrigin.cjs.map +1 -0
  46. package/dist/cjs/server/actions/getSessionId.cjs +28 -0
  47. package/dist/cjs/server/actions/getSessionId.cjs.map +1 -0
  48. package/dist/cjs/server/actions/getSessionPayload.cjs +29 -0
  49. package/dist/cjs/server/actions/getSessionPayload.cjs.map +1 -0
  50. package/dist/cjs/server/actions/getUserAction.cjs +30 -0
  51. package/dist/cjs/server/actions/getUserAction.cjs.map +1 -0
  52. package/dist/cjs/server/actions/getUserProfileAction.cjs +34 -0
  53. package/dist/cjs/server/actions/getUserProfileAction.cjs.map +1 -0
  54. package/dist/cjs/server/actions/handleOAuthCallbackAction.cjs +89 -0
  55. package/dist/cjs/server/actions/handleOAuthCallbackAction.cjs.map +1 -0
  56. package/dist/cjs/server/actions/isSignedIn.cjs +40 -0
  57. package/dist/cjs/server/actions/isSignedIn.cjs.map +1 -0
  58. package/dist/cjs/server/actions/refreshToken.cjs +61 -0
  59. package/dist/cjs/server/actions/refreshToken.cjs.map +1 -0
  60. package/dist/cjs/server/actions/signInAction.cjs +95 -0
  61. package/dist/cjs/server/actions/signInAction.cjs.map +1 -0
  62. package/dist/cjs/server/actions/signOutAction.cjs +57 -0
  63. package/dist/cjs/server/actions/signOutAction.cjs.map +1 -0
  64. package/dist/cjs/server/actions/signUpAction.cjs +27 -0
  65. package/dist/cjs/server/actions/signUpAction.cjs.map +1 -0
  66. package/dist/cjs/server/actions/updateUserProfileAction.cjs +30 -0
  67. package/dist/cjs/server/actions/updateUserProfileAction.cjs.map +1 -0
  68. package/dist/cjs/server/getClient.cjs +19 -0
  69. package/dist/cjs/server/getClient.cjs.map +1 -0
  70. package/dist/cjs/server/index.cjs +9 -0
  71. package/dist/cjs/server/proxy/createRouteMatcher.cjs +36 -0
  72. package/dist/cjs/server/proxy/createRouteMatcher.cjs.map +1 -0
  73. package/dist/cjs/server/proxy/thunderIDProxy.cjs +182 -0
  74. package/dist/cjs/server/proxy/thunderIDProxy.cjs.map +1 -0
  75. package/dist/cjs/server/thunderid.cjs +27 -0
  76. package/dist/cjs/server/thunderid.cjs.map +1 -0
  77. package/dist/cjs/utils/SessionManager.cjs +150 -0
  78. package/dist/cjs/utils/SessionManager.cjs.map +1 -0
  79. package/dist/cjs/utils/decorateConfigWithNextEnv.cjs +28 -0
  80. package/dist/cjs/utils/decorateConfigWithNextEnv.cjs.map +1 -0
  81. package/dist/cjs/utils/handleRefreshToken.cjs +62 -0
  82. package/dist/cjs/utils/handleRefreshToken.cjs.map +1 -0
  83. package/dist/cjs/utils/logger.cjs +11 -0
  84. package/dist/cjs/utils/logger.cjs.map +1 -0
  85. package/dist/cjs/utils/sessionUtils.cjs +40 -0
  86. package/dist/cjs/utils/sessionUtils.cjs.map +1 -0
  87. package/dist/client/components/actions/SignInButton/SignInButton.d.ts.map +1 -0
  88. package/dist/client/components/actions/SignInButton/SignInButton.js +73 -0
  89. package/dist/client/components/actions/SignInButton/SignInButton.js.map +1 -0
  90. package/dist/client/components/actions/SignOutButton/SignOutButton.d.ts.map +1 -0
  91. package/dist/client/components/actions/SignOutButton/SignOutButton.js +57 -0
  92. package/dist/client/components/actions/SignOutButton/SignOutButton.js.map +1 -0
  93. package/dist/client/components/actions/SignUpButton/SignUpButton.d.ts.map +1 -0
  94. package/dist/client/components/actions/SignUpButton/SignUpButton.js +85 -0
  95. package/dist/client/components/actions/SignUpButton/SignUpButton.js.map +1 -0
  96. package/dist/client/components/control/Loading/Loading.d.ts.map +1 -0
  97. package/dist/client/components/control/SignedIn/SignedIn.d.ts.map +1 -0
  98. package/dist/client/components/control/SignedIn/SignedIn.js +32 -0
  99. package/dist/client/components/control/SignedIn/SignedIn.js.map +1 -0
  100. package/dist/client/components/control/SignedOut/SignedOut.d.ts.map +1 -0
  101. package/dist/client/components/control/SignedOut/SignedOut.js +32 -0
  102. package/dist/client/components/control/SignedOut/SignedOut.js.map +1 -0
  103. package/dist/client/components/presentation/SignIn/SignIn.d.ts.map +1 -0
  104. package/dist/client/components/presentation/SignIn/SignIn.js +33 -0
  105. package/dist/client/components/presentation/SignIn/SignIn.js.map +1 -0
  106. package/dist/client/components/presentation/SignUp/SignUp.d.ts.map +1 -0
  107. package/dist/client/components/presentation/SignUp/SignUp.js +75 -0
  108. package/dist/client/components/presentation/SignUp/SignUp.js.map +1 -0
  109. package/dist/client/components/presentation/User/User.d.ts.map +1 -0
  110. package/dist/client/components/presentation/User/User.js +46 -0
  111. package/dist/client/components/presentation/User/User.js.map +1 -0
  112. package/dist/client/components/presentation/UserDropdown/UserDropdown.d.ts.map +1 -0
  113. package/dist/client/components/presentation/UserDropdown/UserDropdown.js +110 -0
  114. package/dist/client/components/presentation/UserDropdown/UserDropdown.js.map +1 -0
  115. package/dist/client/components/presentation/UserProfile/UserProfile.d.ts.map +1 -0
  116. package/dist/client/components/presentation/UserProfile/UserProfile.js +49 -0
  117. package/dist/client/components/presentation/UserProfile/UserProfile.js.map +1 -0
  118. package/dist/client/contexts/ThunderID/ThunderIDContext.d.ts.map +1 -0
  119. package/dist/client/contexts/ThunderID/ThunderIDContext.js +32 -0
  120. package/dist/client/contexts/ThunderID/ThunderIDContext.js.map +1 -0
  121. package/dist/{types/client → client}/contexts/ThunderID/ThunderIDProvider.d.ts +1 -8
  122. package/dist/client/contexts/ThunderID/ThunderIDProvider.d.ts.map +1 -0
  123. package/dist/client/contexts/ThunderID/ThunderIDProvider.js +159 -0
  124. package/dist/client/contexts/ThunderID/ThunderIDProvider.js.map +1 -0
  125. package/dist/client/contexts/ThunderID/useThunderID.d.ts.map +1 -0
  126. package/dist/client/contexts/ThunderID/useThunderID.js +17 -0
  127. package/dist/client/contexts/ThunderID/useThunderID.js.map +1 -0
  128. package/dist/{types/client → client}/index.d.ts +2 -10
  129. package/dist/client/index.d.ts.map +1 -0
  130. package/dist/client/index.js +13 -0
  131. package/dist/configs/InternalAuthAPIRoutesConfig.d.ts.map +1 -0
  132. package/dist/constants/sessionConstants.d.ts.map +1 -0
  133. package/dist/constants/sessionConstants.js +53 -0
  134. package/dist/constants/sessionConstants.js.map +1 -0
  135. package/dist/index.d.ts.map +1 -0
  136. package/dist/index.js +20 -934
  137. package/dist/models/api.d.ts.map +1 -0
  138. package/dist/models/config.d.ts.map +1 -0
  139. package/dist/server/ThunderIDProvider.d.ts.map +1 -0
  140. package/dist/server/ThunderIDProvider.js +111 -0
  141. package/dist/server/ThunderIDProvider.js.map +1 -0
  142. package/dist/server/actions/clearSession.d.ts.map +1 -0
  143. package/dist/server/actions/clearSession.js +39 -0
  144. package/dist/server/actions/clearSession.js.map +1 -0
  145. package/dist/server/actions/getAccessToken.d.ts.map +1 -0
  146. package/dist/{getAccessToken-oRxArjVC.js → server/actions/getAccessToken.js} +8 -5
  147. package/dist/server/actions/getAccessToken.js.map +1 -0
  148. package/dist/server/actions/getClientOrigin.d.ts.map +1 -0
  149. package/dist/server/actions/getClientOrigin.js +16 -0
  150. package/dist/server/actions/getClientOrigin.js.map +1 -0
  151. package/dist/server/actions/getSessionId.d.ts.map +1 -0
  152. package/dist/{getSessionId-_7hj8QSX.js → server/actions/getSessionId.js} +8 -5
  153. package/dist/server/actions/getSessionId.js.map +1 -0
  154. package/dist/server/actions/getSessionPayload.d.ts.map +1 -0
  155. package/dist/server/actions/getSessionPayload.js +27 -0
  156. package/dist/server/actions/getSessionPayload.js.map +1 -0
  157. package/dist/server/actions/getUserAction.d.ts.map +1 -0
  158. package/dist/server/actions/getUserAction.js +30 -0
  159. package/dist/server/actions/getUserAction.js.map +1 -0
  160. package/dist/server/actions/getUserProfileAction.d.ts.map +1 -0
  161. package/dist/server/actions/getUserProfileAction.js +34 -0
  162. package/dist/server/actions/getUserProfileAction.js.map +1 -0
  163. package/dist/server/actions/handleOAuthCallbackAction.d.ts.map +1 -0
  164. package/dist/server/actions/handleOAuthCallbackAction.js +87 -0
  165. package/dist/server/actions/handleOAuthCallbackAction.js.map +1 -0
  166. package/dist/server/actions/isSignedIn.d.ts.map +1 -0
  167. package/dist/server/actions/isSignedIn.js +40 -0
  168. package/dist/server/actions/isSignedIn.js.map +1 -0
  169. package/dist/server/actions/refreshToken.d.ts.map +1 -0
  170. package/dist/server/actions/refreshToken.js +58 -0
  171. package/dist/server/actions/refreshToken.js.map +1 -0
  172. package/dist/server/actions/signInAction.d.ts.map +1 -0
  173. package/dist/server/actions/signInAction.js +92 -0
  174. package/dist/server/actions/signInAction.js.map +1 -0
  175. package/dist/server/actions/signOutAction.d.ts.map +1 -0
  176. package/dist/server/actions/signOutAction.js +55 -0
  177. package/dist/server/actions/signOutAction.js.map +1 -0
  178. package/dist/server/actions/signUpAction.d.ts.map +1 -0
  179. package/dist/server/actions/signUpAction.js +27 -0
  180. package/dist/server/actions/signUpAction.js.map +1 -0
  181. package/dist/server/actions/updateUserProfileAction.d.ts.map +1 -0
  182. package/dist/server/actions/updateUserProfileAction.js +30 -0
  183. package/dist/server/actions/updateUserProfileAction.js.map +1 -0
  184. package/dist/server/getClient.d.ts.map +1 -0
  185. package/dist/server/getClient.js +19 -0
  186. package/dist/server/getClient.js.map +1 -0
  187. package/dist/{types/server → server}/index.d.ts +3 -0
  188. package/dist/server/index.d.ts.map +1 -0
  189. package/dist/server/index.js +6 -0
  190. package/dist/server/proxy/createRouteMatcher.d.ts.map +1 -0
  191. package/dist/server/proxy/createRouteMatcher.js +35 -0
  192. package/dist/server/proxy/createRouteMatcher.js.map +1 -0
  193. package/dist/{types/server/middleware/thunderIDMiddleware.d.ts → server/proxy/thunderIDProxy.d.ts} +13 -13
  194. package/dist/server/proxy/thunderIDProxy.d.ts.map +1 -0
  195. package/dist/server/proxy/thunderIDProxy.js +180 -0
  196. package/dist/server/proxy/thunderIDProxy.js.map +1 -0
  197. package/dist/server/thunderid.d.ts.map +1 -0
  198. package/dist/server/thunderid.js +27 -0
  199. package/dist/server/thunderid.js.map +1 -0
  200. package/dist/utils/SessionManager.d.ts.map +1 -0
  201. package/dist/utils/SessionManager.js +147 -0
  202. package/dist/utils/SessionManager.js.map +1 -0
  203. package/dist/utils/createRouteMatcher.d.ts.map +1 -0
  204. package/dist/utils/decorateConfigWithNextEnv.d.ts.map +1 -0
  205. package/dist/utils/decorateConfigWithNextEnv.js +27 -0
  206. package/dist/utils/decorateConfigWithNextEnv.js.map +1 -0
  207. package/dist/utils/handleRefreshToken.d.ts.map +1 -0
  208. package/dist/utils/handleRefreshToken.js +62 -0
  209. package/dist/utils/handleRefreshToken.js.map +1 -0
  210. package/dist/utils/logger.d.ts.map +1 -0
  211. package/dist/utils/logger.js +9 -0
  212. package/dist/utils/logger.js.map +1 -0
  213. package/dist/utils/sessionUtils.d.ts.map +1 -0
  214. package/dist/utils/sessionUtils.js +39 -0
  215. package/dist/utils/sessionUtils.js.map +1 -0
  216. package/package.json +6 -16
  217. package/dist/SessionManager-BvmZ19QF.js +0 -1384
  218. package/dist/cache-DOmEIb7_.js +0 -6329
  219. package/dist/cjs/SessionManager-x03qrCM_.js +0 -1397
  220. package/dist/cjs/cache-Bw8u7jYk.js +0 -6332
  221. package/dist/cjs/dynamic-rendering-DY0EUx64.js +0 -1510
  222. package/dist/cjs/getAccessToken-eJk739AD.js +0 -22
  223. package/dist/cjs/getSessionId-BXqdO0BZ.js +0 -28
  224. package/dist/cjs/getSessionId-j-ERy_WP.js +0 -5
  225. package/dist/cjs/index2.cjs +0 -8
  226. package/dist/cjs/middleware.cjs +0 -5151
  227. package/dist/cjs/segment-CViTHaAn.js +0 -52
  228. package/dist/cjs/server-ABSmm73r.js +0 -2426
  229. package/dist/dynamic-rendering-CXn-s32e.js +0 -1429
  230. package/dist/getSessionId-6IipYdCB.js +0 -5
  231. package/dist/index2.js +0 -7
  232. package/dist/middleware.js +0 -5152
  233. package/dist/segment-DRUZ6e3T.js +0 -47
  234. package/dist/server-BUNp5d6D.js +0 -2376
  235. package/dist/types/ThunderIDNextClient.d.ts.map +0 -1
  236. package/dist/types/client/components/actions/SignInButton/SignInButton.d.ts.map +0 -1
  237. package/dist/types/client/components/actions/SignOutButton/SignOutButton.d.ts.map +0 -1
  238. package/dist/types/client/components/actions/SignUpButton/SignUpButton.d.ts.map +0 -1
  239. package/dist/types/client/components/control/Loading/Loading.d.ts.map +0 -1
  240. package/dist/types/client/components/control/SignedIn/SignedIn.d.ts.map +0 -1
  241. package/dist/types/client/components/control/SignedOut/SignedOut.d.ts.map +0 -1
  242. package/dist/types/client/components/presentation/CreateOrganization/CreateOrganization.d.ts +0 -68
  243. package/dist/types/client/components/presentation/CreateOrganization/CreateOrganization.d.ts.map +0 -1
  244. package/dist/types/client/components/presentation/Organization/Organization.d.ts +0 -67
  245. package/dist/types/client/components/presentation/Organization/Organization.d.ts.map +0 -1
  246. package/dist/types/client/components/presentation/OrganizationList/OrganizationList.d.ts +0 -93
  247. package/dist/types/client/components/presentation/OrganizationList/OrganizationList.d.ts.map +0 -1
  248. package/dist/types/client/components/presentation/OrganizationProfile/OrganizationProfile.d.ts +0 -120
  249. package/dist/types/client/components/presentation/OrganizationProfile/OrganizationProfile.d.ts.map +0 -1
  250. package/dist/types/client/components/presentation/OrganizationSwitcher/OrganizationSwitcher.d.ts +0 -72
  251. package/dist/types/client/components/presentation/OrganizationSwitcher/OrganizationSwitcher.d.ts.map +0 -1
  252. package/dist/types/client/components/presentation/SignIn/SignIn.d.ts.map +0 -1
  253. package/dist/types/client/components/presentation/SignUp/SignUp.d.ts.map +0 -1
  254. package/dist/types/client/components/presentation/User/User.d.ts.map +0 -1
  255. package/dist/types/client/components/presentation/UserDropdown/UserDropdown.d.ts.map +0 -1
  256. package/dist/types/client/components/presentation/UserProfile/UserProfile.d.ts.map +0 -1
  257. package/dist/types/client/contexts/ThunderID/ThunderIDContext.d.ts.map +0 -1
  258. package/dist/types/client/contexts/ThunderID/ThunderIDProvider.d.ts.map +0 -1
  259. package/dist/types/client/contexts/ThunderID/useThunderID.d.ts.map +0 -1
  260. package/dist/types/client/index.d.ts.map +0 -1
  261. package/dist/types/configs/InternalAuthAPIRoutesConfig.d.ts.map +0 -1
  262. package/dist/types/constants/sessionConstants.d.ts.map +0 -1
  263. package/dist/types/index.d.ts.map +0 -1
  264. package/dist/types/middleware.d.ts +0 -35
  265. package/dist/types/middleware.d.ts.map +0 -1
  266. package/dist/types/models/api.d.ts.map +0 -1
  267. package/dist/types/models/config.d.ts.map +0 -1
  268. package/dist/types/server/ThunderIDProvider.d.ts.map +0 -1
  269. package/dist/types/server/actions/clearSession.d.ts.map +0 -1
  270. package/dist/types/server/actions/createOrganization.d.ts +0 -24
  271. package/dist/types/server/actions/createOrganization.d.ts.map +0 -1
  272. package/dist/types/server/actions/getAccessToken.d.ts.map +0 -1
  273. package/dist/types/server/actions/getAllOrganizations.d.ts +0 -24
  274. package/dist/types/server/actions/getAllOrganizations.d.ts.map +0 -1
  275. package/dist/types/server/actions/getBrandingPreference.d.ts +0 -24
  276. package/dist/types/server/actions/getBrandingPreference.d.ts.map +0 -1
  277. package/dist/types/server/actions/getClientOrigin.d.ts.map +0 -1
  278. package/dist/types/server/actions/getCurrentOrganizationAction.d.ts +0 -31
  279. package/dist/types/server/actions/getCurrentOrganizationAction.d.ts.map +0 -1
  280. package/dist/types/server/actions/getMyOrganizations.d.ts +0 -24
  281. package/dist/types/server/actions/getMyOrganizations.d.ts.map +0 -1
  282. package/dist/types/server/actions/getOrganizationAction.d.ts +0 -31
  283. package/dist/types/server/actions/getOrganizationAction.d.ts.map +0 -1
  284. package/dist/types/server/actions/getSessionId.d.ts.map +0 -1
  285. package/dist/types/server/actions/getSessionPayload.d.ts.map +0 -1
  286. package/dist/types/server/actions/getUserAction.d.ts.map +0 -1
  287. package/dist/types/server/actions/getUserProfileAction.d.ts.map +0 -1
  288. package/dist/types/server/actions/handleOAuthCallbackAction.d.ts.map +0 -1
  289. package/dist/types/server/actions/isSignedIn.d.ts.map +0 -1
  290. package/dist/types/server/actions/refreshToken.d.ts.map +0 -1
  291. package/dist/types/server/actions/signInAction.d.ts.map +0 -1
  292. package/dist/types/server/actions/signOutAction.d.ts.map +0 -1
  293. package/dist/types/server/actions/signUpAction.d.ts.map +0 -1
  294. package/dist/types/server/actions/switchOrganization.d.ts +0 -24
  295. package/dist/types/server/actions/switchOrganization.d.ts.map +0 -1
  296. package/dist/types/server/actions/updateUserProfileAction.d.ts.map +0 -1
  297. package/dist/types/server/getClient.d.ts.map +0 -1
  298. package/dist/types/server/index.d.ts.map +0 -1
  299. package/dist/types/server/middleware/createRouteMatcher.d.ts.map +0 -1
  300. package/dist/types/server/middleware/thunderIDMiddleware.d.ts.map +0 -1
  301. package/dist/types/server/thunderid.d.ts.map +0 -1
  302. package/dist/types/utils/SessionManager.d.ts.map +0 -1
  303. package/dist/types/utils/createRouteMatcher.d.ts.map +0 -1
  304. package/dist/types/utils/decorateConfigWithNextEnv.d.ts.map +0 -1
  305. package/dist/types/utils/handleRefreshToken.d.ts.map +0 -1
  306. package/dist/types/utils/logger.d.ts.map +0 -1
  307. package/dist/types/utils/sessionUtils.d.ts.map +0 -1
  308. /package/dist/{types/client → client}/components/actions/SignInButton/SignInButton.d.ts +0 -0
  309. /package/dist/{types/client → client}/components/actions/SignOutButton/SignOutButton.d.ts +0 -0
  310. /package/dist/{types/client → client}/components/actions/SignUpButton/SignUpButton.d.ts +0 -0
  311. /package/dist/{types/client → client}/components/control/Loading/Loading.d.ts +0 -0
  312. /package/dist/{types/client → client}/components/control/SignedIn/SignedIn.d.ts +0 -0
  313. /package/dist/{types/client → client}/components/control/SignedOut/SignedOut.d.ts +0 -0
  314. /package/dist/{types/client → client}/components/presentation/SignIn/SignIn.d.ts +0 -0
  315. /package/dist/{types/client → client}/components/presentation/SignUp/SignUp.d.ts +0 -0
  316. /package/dist/{types/client → client}/components/presentation/User/User.d.ts +0 -0
  317. /package/dist/{types/client → client}/components/presentation/UserDropdown/UserDropdown.d.ts +0 -0
  318. /package/dist/{types/client → client}/components/presentation/UserProfile/UserProfile.d.ts +0 -0
  319. /package/dist/{types/client → client}/contexts/ThunderID/ThunderIDContext.d.ts +0 -0
  320. /package/dist/{types/client → client}/contexts/ThunderID/useThunderID.d.ts +0 -0
  321. /package/dist/{types/configs → configs}/InternalAuthAPIRoutesConfig.d.ts +0 -0
  322. /package/dist/{types/constants → constants}/sessionConstants.d.ts +0 -0
  323. /package/dist/{types/index.d.ts → index.d.ts} +0 -0
  324. /package/dist/{types/models → models}/api.d.ts +0 -0
  325. /package/dist/{types/models → models}/config.d.ts +0 -0
  326. /package/dist/{types/server → server}/ThunderIDProvider.d.ts +0 -0
  327. /package/dist/{types/server → server}/actions/clearSession.d.ts +0 -0
  328. /package/dist/{types/server → server}/actions/getAccessToken.d.ts +0 -0
  329. /package/dist/{types/server → server}/actions/getClientOrigin.d.ts +0 -0
  330. /package/dist/{types/server → server}/actions/getSessionId.d.ts +0 -0
  331. /package/dist/{types/server → server}/actions/getSessionPayload.d.ts +0 -0
  332. /package/dist/{types/server → server}/actions/getUserAction.d.ts +0 -0
  333. /package/dist/{types/server → server}/actions/getUserProfileAction.d.ts +0 -0
  334. /package/dist/{types/server → server}/actions/handleOAuthCallbackAction.d.ts +0 -0
  335. /package/dist/{types/server → server}/actions/isSignedIn.d.ts +0 -0
  336. /package/dist/{types/server → server}/actions/refreshToken.d.ts +0 -0
  337. /package/dist/{types/server → server}/actions/signInAction.d.ts +0 -0
  338. /package/dist/{types/server → server}/actions/signOutAction.d.ts +0 -0
  339. /package/dist/{types/server → server}/actions/signUpAction.d.ts +0 -0
  340. /package/dist/{types/server → server}/actions/updateUserProfileAction.d.ts +0 -0
  341. /package/dist/{types/server → server}/getClient.d.ts +0 -0
  342. /package/dist/{types/server/middleware → server/proxy}/createRouteMatcher.d.ts +0 -0
  343. /package/dist/{types/server → server}/thunderid.d.ts +0 -0
  344. /package/dist/{types/utils → utils}/SessionManager.d.ts +0 -0
  345. /package/dist/{types/utils → utils}/createRouteMatcher.d.ts +0 -0
  346. /package/dist/{types/utils → utils}/decorateConfigWithNextEnv.d.ts +0 -0
  347. /package/dist/{types/utils → utils}/handleRefreshToken.d.ts +0 -0
  348. /package/dist/{types/utils → utils}/logger.d.ts +0 -0
  349. /package/dist/{types/utils → utils}/sessionUtils.d.ts +0 -0
@@ -0,0 +1,91 @@
1
+ 'use client';
2
+
3
+
4
+ const require_rolldown_runtime = require('../../../../_virtual/rolldown_runtime.cjs');
5
+ const require_useThunderID = require('../../../contexts/ThunderID/useThunderID.cjs');
6
+ let __thunderid_node = require("@thunderid/node");
7
+ __thunderid_node = require_rolldown_runtime.__toESM(__thunderid_node);
8
+ let __thunderid_react = require("@thunderid/react");
9
+ __thunderid_react = require_rolldown_runtime.__toESM(__thunderid_react);
10
+ let next_navigation = require("next/navigation");
11
+ next_navigation = require_rolldown_runtime.__toESM(next_navigation);
12
+ let react = require("react");
13
+ react = require_rolldown_runtime.__toESM(react);
14
+ let react_jsx_runtime = require("react/jsx-runtime");
15
+ react_jsx_runtime = require_rolldown_runtime.__toESM(react_jsx_runtime);
16
+
17
+ //#region src/client/components/actions/SignUpButton/SignUpButton.tsx
18
+ /**
19
+ * SignUpButton component that supports both render props and traditional props patterns.
20
+ * It redirects the user to the ThunderID sign-up page configured for the application.
21
+ *
22
+ * @remarks This component is only supported in browser based React applications (CSR).
23
+ *
24
+ * @example Using render props pattern
25
+ * ```tsx
26
+ * <SignUpButton>
27
+ * {({ signUp, isLoading }) => (
28
+ * <button onClick={signUp} disabled={isLoading}>
29
+ * {isLoading ? 'Creating Account...' : 'Create Account'}
30
+ * </button>
31
+ * )}
32
+ * </SignUpButton>
33
+ * ```
34
+ *
35
+ * @example Using traditional props pattern
36
+ * ```tsx
37
+ * <SignUpButton className="custom-button">Create Account</SignUpButton>
38
+ * ```
39
+ *
40
+ * @example Using component-level preferences
41
+ * ```tsx
42
+ * <SignUpButton
43
+ * preferences={{
44
+ * i18n: {
45
+ * bundles: {
46
+ * 'en-US': {
47
+ * translations: {
48
+ * 'buttons.signUp': 'Custom Sign Up Text'
49
+ * }
50
+ * }
51
+ * }
52
+ * }
53
+ * }}
54
+ * >
55
+ * Custom Sign Up
56
+ * </SignUpButton>
57
+ * ```
58
+ */
59
+ const SignUpButton = (0, react.forwardRef)(({ children, onClick, preferences,...rest }, ref) => {
60
+ const { signUp, signUpUrl } = require_useThunderID.default();
61
+ const router = (0, next_navigation.useRouter)();
62
+ const { t } = (0, __thunderid_react.useTranslation)(preferences?.i18n);
63
+ const [isLoading, setIsLoading] = (0, react.useState)(false);
64
+ const handleSignUp = async (e) => {
65
+ try {
66
+ setIsLoading(true);
67
+ if (signUpUrl) router.push(signUpUrl);
68
+ else if (signUp) await signUp();
69
+ if (onClick) onClick(e);
70
+ } catch (error) {
71
+ throw new __thunderid_node.ThunderIDRuntimeError(`Sign up failed: ${error instanceof Error ? error.message : String(error)}`, "SignUpButton-handleSignUp-RuntimeError-001", "nextjs", "Something went wrong while trying to sign up. Please try again later.");
72
+ } finally {
73
+ setIsLoading(false);
74
+ }
75
+ };
76
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__thunderid_react.BaseSignUpButton, {
77
+ ref,
78
+ onClick: handleSignUp,
79
+ isLoading,
80
+ signUp: handleSignUp,
81
+ preferences,
82
+ ...rest,
83
+ children: children ?? t("elements.buttons.signup.text")
84
+ });
85
+ });
86
+ SignUpButton.displayName = "SignUpButton";
87
+ var SignUpButton_default = SignUpButton;
88
+
89
+ //#endregion
90
+ exports.default = SignUpButton_default;
91
+ //# sourceMappingURL=SignUpButton.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SignUpButton.cjs","names":["SignUpButton: ForwardRefExoticComponent<SignUpButtonProps & RefAttributes<HTMLButtonElement>>","useThunderID","router: AppRouterInstance","ThunderIDRuntimeError","BaseSignUpButton"],"sources":["../../../../../../src/client/components/actions/SignUpButton/SignUpButton.tsx"],"sourcesContent":["/**\n * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\n'use client';\n\nimport {ThunderIDRuntimeError} from '@thunderid/node';\nimport {BaseSignUpButton, BaseSignUpButtonProps, useTranslation} from '@thunderid/react';\nimport {AppRouterInstance} from 'next/dist/shared/lib/app-router-context.shared-runtime';\nimport {useRouter} from 'next/navigation';\nimport {forwardRef, ForwardRefExoticComponent, MouseEvent, ReactElement, Ref, RefAttributes, useState} from 'react';\nimport useThunderID from '../../../contexts/ThunderID/useThunderID';\n\n/**\n * Props interface of {@link SignUpButton}\n */\nexport type SignUpButtonProps = BaseSignUpButtonProps;\n\n/**\n * SignUpButton component that supports both render props and traditional props patterns.\n * It redirects the user to the ThunderID sign-up page configured for the application.\n *\n * @remarks This component is only supported in browser based React applications (CSR).\n *\n * @example Using render props pattern\n * ```tsx\n * <SignUpButton>\n * {({ signUp, isLoading }) => (\n * <button onClick={signUp} disabled={isLoading}>\n * {isLoading ? 'Creating Account...' : 'Create Account'}\n * </button>\n * )}\n * </SignUpButton>\n * ```\n *\n * @example Using traditional props pattern\n * ```tsx\n * <SignUpButton className=\"custom-button\">Create Account</SignUpButton>\n * ```\n *\n * @example Using component-level preferences\n * ```tsx\n * <SignUpButton\n * preferences={{\n * i18n: {\n * bundles: {\n * 'en-US': {\n * translations: {\n * 'buttons.signUp': 'Custom Sign Up Text'\n * }\n * }\n * }\n * }\n * }}\n * >\n * Custom Sign Up\n * </SignUpButton>\n * ```\n */\nconst SignUpButton: ForwardRefExoticComponent<SignUpButtonProps & RefAttributes<HTMLButtonElement>> = forwardRef<\n HTMLButtonElement,\n SignUpButtonProps\n>(({children, onClick, preferences, ...rest}: SignUpButtonProps, ref: Ref<HTMLButtonElement>): ReactElement => {\n const {signUp, signUpUrl} = useThunderID();\n const router: AppRouterInstance = useRouter();\n const {t} = useTranslation(preferences?.i18n);\n\n const [isLoading, setIsLoading] = useState(false);\n\n const handleSignUp = async (e?: MouseEvent<HTMLButtonElement>): Promise<void> => {\n try {\n setIsLoading(true);\n\n // If a custom `signUpUrl` is provided, use it for navigation.\n if (signUpUrl) {\n router.push(signUpUrl);\n } else if (signUp) {\n await signUp();\n }\n\n if (onClick) {\n onClick(e!);\n }\n } catch (error) {\n throw new ThunderIDRuntimeError(\n `Sign up failed: ${error instanceof Error ? error.message : String(error)}`,\n 'SignUpButton-handleSignUp-RuntimeError-001',\n 'nextjs',\n 'Something went wrong while trying to sign up. Please try again later.',\n );\n } finally {\n setIsLoading(false);\n }\n };\n\n return (\n <BaseSignUpButton\n ref={ref}\n onClick={handleSignUp}\n isLoading={isLoading}\n signUp={handleSignUp}\n preferences={preferences}\n {...rest}\n >\n {children ?? t('elements.buttons.signup.text')}\n </BaseSignUpButton>\n );\n});\n\nSignUpButton.displayName = 'SignUpButton';\n\nexport default SignUpButton;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAyEA,MAAMA,sCAGH,EAAC,UAAU,SAAS,YAAa,GAAG,QAA0B,QAA8C;CAC7G,MAAM,EAAC,QAAQ,cAAaC,8BAAc;CAC1C,MAAMC,yCAAuC;CAC7C,MAAM,EAAC,4CAAoB,aAAa,KAAK;CAE7C,MAAM,CAAC,WAAW,oCAAyB,MAAM;CAEjD,MAAM,eAAe,OAAO,MAAqD;AAC/E,MAAI;AACF,gBAAa,KAAK;AAGlB,OAAI,UACF,QAAO,KAAK,UAAU;YACb,OACT,OAAM,QAAQ;AAGhB,OAAI,QACF,SAAQ,EAAG;WAEN,OAAO;AACd,SAAM,IAAIC,uCACR,mBAAmB,iBAAiB,QAAQ,MAAM,UAAU,OAAO,MAAM,IACzE,8CACA,UACA,wEACD;YACO;AACR,gBAAa,MAAM;;;AAIvB,QACE,2CAACC;EACM;EACL,SAAS;EACE;EACX,QAAQ;EACK;EACb,GAAI;YAEH,YAAY,EAAE,+BAA+B;GAC7B;EAErB;AAEF,aAAa,cAAc;AAE3B,2BAAe"}
@@ -0,0 +1,34 @@
1
+ 'use client';
2
+
3
+
4
+ const require_rolldown_runtime = require('../../../../_virtual/rolldown_runtime.cjs');
5
+ const require_useThunderID = require('../../../contexts/ThunderID/useThunderID.cjs');
6
+ let react_jsx_runtime = require("react/jsx-runtime");
7
+ react_jsx_runtime = require_rolldown_runtime.__toESM(react_jsx_runtime);
8
+
9
+ //#region src/client/components/control/SignedIn/SignedIn.tsx
10
+ /**
11
+ * A component that only renders its children when the user is signed in.
12
+ *
13
+ * @example
14
+ * ```tsx
15
+ * import { SignedIn } from '@thunderid/auth-next';
16
+ *
17
+ * const App = () => {
18
+ * return (
19
+ * <SignedIn fallback={<p>Please sign in to continue</p>}>
20
+ * <p>Welcome! You are signed in.</p>
21
+ * </SignedIn>
22
+ * );
23
+ * }
24
+ * ```
25
+ */
26
+ const SignedIn = ({ children, fallback = null }) => {
27
+ const { isSignedIn } = require_useThunderID.default();
28
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react_jsx_runtime.Fragment, { children: isSignedIn ? children : fallback });
29
+ };
30
+ var SignedIn_default = SignedIn;
31
+
32
+ //#endregion
33
+ exports.default = SignedIn_default;
34
+ //# sourceMappingURL=SignedIn.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SignedIn.cjs","names":["SignedIn: FC<PropsWithChildren<SignedInProps>>","useThunderID"],"sources":["../../../../../../src/client/components/control/SignedIn/SignedIn.tsx"],"sourcesContent":["/**\n * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\n'use client';\n\nimport {FC, PropsWithChildren, ReactNode} from 'react';\nimport useThunderID from '../../../contexts/ThunderID/useThunderID';\n\n/**\n * Props interface of {@link SignedIn}\n */\nexport interface SignedInProps {\n /**\n * Content to show when the user is not signed in.\n */\n fallback?: ReactNode;\n}\n\n/**\n * A component that only renders its children when the user is signed in.\n *\n * @example\n * ```tsx\n * import { SignedIn } from '@thunderid/auth-next';\n *\n * const App = () => {\n * return (\n * <SignedIn fallback={<p>Please sign in to continue</p>}>\n * <p>Welcome! You are signed in.</p>\n * </SignedIn>\n * );\n * }\n * ```\n */\nconst SignedIn: FC<PropsWithChildren<SignedInProps>> = ({\n children,\n fallback = null,\n}: PropsWithChildren<SignedInProps>) => {\n const {isSignedIn} = useThunderID();\n\n return <>{isSignedIn ? children : fallback}</>;\n};\n\nexport default SignedIn;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAiDA,MAAMA,YAAkD,EACtD,UACA,WAAW,WAC2B;CACtC,MAAM,EAAC,eAAcC,8BAAc;AAEnC,QAAO,mFAAG,aAAa,WAAW,WAAY;;AAGhD,uBAAe"}
@@ -0,0 +1,34 @@
1
+ 'use client';
2
+
3
+
4
+ const require_rolldown_runtime = require('../../../../_virtual/rolldown_runtime.cjs');
5
+ const require_useThunderID = require('../../../contexts/ThunderID/useThunderID.cjs');
6
+ let react_jsx_runtime = require("react/jsx-runtime");
7
+ react_jsx_runtime = require_rolldown_runtime.__toESM(react_jsx_runtime);
8
+
9
+ //#region src/client/components/control/SignedOut/SignedOut.tsx
10
+ /**
11
+ * A component that only renders its children when the user is signed out.
12
+ *
13
+ * @example
14
+ * ```tsx
15
+ * import { SignedOut } from '@thunderid/auth-next';
16
+ *
17
+ * const App = () => {
18
+ * return (
19
+ * <SignedOut fallback={<p>Please sign out to continue</p>}>
20
+ * <p>Welcome! You are signed out.</p>
21
+ * </SignedOut>
22
+ * );
23
+ * }
24
+ * ```
25
+ */
26
+ const SignedOut = ({ children, fallback = null }) => {
27
+ const { isSignedIn } = require_useThunderID.default();
28
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react_jsx_runtime.Fragment, { children: !isSignedIn ? children : fallback });
29
+ };
30
+ var SignedOut_default = SignedOut;
31
+
32
+ //#endregion
33
+ exports.default = SignedOut_default;
34
+ //# sourceMappingURL=SignedOut.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SignedOut.cjs","names":["SignedOut: FC<PropsWithChildren<SignedOutProps>>","useThunderID"],"sources":["../../../../../../src/client/components/control/SignedOut/SignedOut.tsx"],"sourcesContent":["/**\n * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\n'use client';\n\nimport {FC, PropsWithChildren, ReactNode} from 'react';\nimport useThunderID from '../../../contexts/ThunderID/useThunderID';\n\n/**\n * Props interface of {@link SignedOut}\n */\nexport interface SignedOutProps {\n /**\n * Content to show when the user is not signed-out.\n */\n fallback?: ReactNode;\n}\n\n/**\n * A component that only renders its children when the user is signed out.\n *\n * @example\n * ```tsx\n * import { SignedOut } from '@thunderid/auth-next';\n *\n * const App = () => {\n * return (\n * <SignedOut fallback={<p>Please sign out to continue</p>}>\n * <p>Welcome! You are signed out.</p>\n * </SignedOut>\n * );\n * }\n * ```\n */\nconst SignedOut: FC<PropsWithChildren<SignedOutProps>> = ({\n children,\n fallback = null,\n}: PropsWithChildren<SignedOutProps>) => {\n const {isSignedIn} = useThunderID();\n\n return <>{!isSignedIn ? children : fallback}</>;\n};\n\nexport default SignedOut;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAiDA,MAAMA,aAAoD,EACxD,UACA,WAAW,WAC4B;CACvC,MAAM,EAAC,eAAcC,8BAAc;AAEnC,QAAO,mFAAG,CAAC,aAAa,WAAW,WAAY;;AAGjD,wBAAe"}
@@ -0,0 +1,37 @@
1
+ 'use client';
2
+
3
+
4
+ const require_rolldown_runtime = require('../../../../_virtual/rolldown_runtime.cjs');
5
+ const require_useThunderID = require('../../../contexts/ThunderID/useThunderID.cjs');
6
+ let __thunderid_node = require("@thunderid/node");
7
+ __thunderid_node = require_rolldown_runtime.__toESM(__thunderid_node);
8
+ let __thunderid_react = require("@thunderid/react");
9
+ __thunderid_react = require_rolldown_runtime.__toESM(__thunderid_react);
10
+ let react_jsx_runtime = require("react/jsx-runtime");
11
+ react_jsx_runtime = require_rolldown_runtime.__toESM(react_jsx_runtime);
12
+
13
+ //#region src/client/components/presentation/SignIn/SignIn.tsx
14
+ /**
15
+ * A SignIn component for Next.js that provides native authentication flow.
16
+ * This component delegates to the BaseSignIn from @thunderid/react and requires
17
+ * the API functions to be provided as props.
18
+ */
19
+ const SignIn = ({ size = "medium", variant = "outlined",...rest }) => {
20
+ const { signIn } = require_useThunderID.default();
21
+ const handleOnSubmit = async (payload, request) => {
22
+ if (!signIn) throw new __thunderid_node.ThunderIDRuntimeError("`signIn` function is not available.", "SignIn-handleOnSubmit-RuntimeError-001", "nextjs");
23
+ await signIn(payload, request);
24
+ };
25
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__thunderid_react.BaseSignIn, {
26
+ onSubmit: handleOnSubmit,
27
+ size,
28
+ variant,
29
+ ...rest
30
+ });
31
+ };
32
+ SignIn.displayName = "SignIn";
33
+ var SignIn_default = SignIn;
34
+
35
+ //#endregion
36
+ exports.default = SignIn_default;
37
+ //# sourceMappingURL=SignIn.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SignIn.cjs","names":["SignIn: FC<SignInProps>","useThunderID","ThunderIDRuntimeError","BaseSignIn"],"sources":["../../../../../../src/client/components/presentation/SignIn/SignIn.tsx"],"sourcesContent":["/**\n * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\n'use client';\n\nimport {ThunderIDRuntimeError} from '@thunderid/node';\nimport {BaseSignIn, BaseSignInProps} from '@thunderid/react';\nimport {FC} from 'react';\nimport useThunderID from '../../../contexts/ThunderID/useThunderID';\n\n/**\n * Props for the SignIn component.\n * Extends BaseSignInProps for full compatibility with the React BaseSignIn component\n */\nexport type SignInProps = Pick<BaseSignInProps, 'className' | 'onSuccess' | 'onError' | 'variant' | 'size'>;\n\n/**\n * A SignIn component for Next.js that provides native authentication flow.\n * This component delegates to the BaseSignIn from @thunderid/react and requires\n * the API functions to be provided as props.\n */\nconst SignIn: FC<SignInProps> = ({size = 'medium', variant = 'outlined', ...rest}: SignInProps) => {\n const {signIn} = useThunderID();\n\n const handleOnSubmit = async (payload: any, request: any): Promise<void> => {\n if (!signIn) {\n throw new ThunderIDRuntimeError(\n '`signIn` function is not available.',\n 'SignIn-handleOnSubmit-RuntimeError-001',\n 'nextjs',\n );\n }\n\n await signIn(payload, request);\n };\n\n return (\n <BaseSignIn\n // isLoading={isLoading || !isInitialized}\n onSubmit={handleOnSubmit}\n size={size}\n variant={variant}\n {...rest}\n />\n );\n};\n\nSignIn.displayName = 'SignIn';\n\nexport default SignIn;\n"],"mappings":";;;;;;;;;;;;;;;;;;AAoCA,MAAMA,UAA2B,EAAC,OAAO,UAAU,UAAU,WAAY,GAAG,WAAuB;CACjG,MAAM,EAAC,WAAUC,8BAAc;CAE/B,MAAM,iBAAiB,OAAO,SAAc,YAAgC;AAC1E,MAAI,CAAC,OACH,OAAM,IAAIC,uCACR,uCACA,0CACA,SACD;AAGH,QAAM,OAAO,SAAS,QAAQ;;AAGhC,QACE,2CAACC;EAEC,UAAU;EACJ;EACG;EACT,GAAI;GACJ;;AAIN,OAAO,cAAc;AAErB,qBAAe"}
@@ -0,0 +1,79 @@
1
+ 'use client';
2
+
3
+
4
+ const require_rolldown_runtime = require('../../../../_virtual/rolldown_runtime.cjs');
5
+ const require_useThunderID = require('../../../contexts/ThunderID/useThunderID.cjs');
6
+ let __thunderid_node = require("@thunderid/node");
7
+ __thunderid_node = require_rolldown_runtime.__toESM(__thunderid_node);
8
+ let __thunderid_react = require("@thunderid/react");
9
+ __thunderid_react = require_rolldown_runtime.__toESM(__thunderid_react);
10
+ let react_jsx_runtime = require("react/jsx-runtime");
11
+ react_jsx_runtime = require_rolldown_runtime.__toESM(react_jsx_runtime);
12
+
13
+ //#region src/client/components/presentation/SignUp/SignUp.tsx
14
+ /**
15
+ * A styled SignUp component that provides embedded sign-up flow with pre-built styling.
16
+ * This component handles the API calls for sign-up and delegates UI logic to BaseSignUp.
17
+ *
18
+ * @example
19
+ * ```tsx
20
+ * import { SignUp } from '@thunderid/react';
21
+ *
22
+ * const App = () => {
23
+ * return (
24
+ * <SignUp
25
+ * onSuccess={(response) => {
26
+ * console.log('Sign-up successful:', response);
27
+ * // Handle successful sign-up (e.g., redirect, show confirmation)
28
+ * }}
29
+ * onError={(error) => {
30
+ * console.error('Sign-up failed:', error);
31
+ * }}
32
+ * onComplete={(redirectUrl) => {
33
+ * // Platform-specific redirect handling (e.g., Next.js router.push)
34
+ * router.push(redirectUrl); // or window.location.href = redirectUrl
35
+ * }}
36
+ * size="medium"
37
+ * variant="outlined"
38
+ * afterSignUpUrl="/welcome"
39
+ * />
40
+ * );
41
+ * };
42
+ * ```
43
+ */
44
+ const SignUp = ({ className, size = "medium", variant = "outlined", afterSignUpUrl, onError }) => {
45
+ const { signUp, applicationId: contextApplicationId, scopes } = require_useThunderID.default();
46
+ /**
47
+ * Initialize the sign-up flow.
48
+ */
49
+ const handleInitialize = async (payload) => {
50
+ if (!signUp) throw new __thunderid_node.ThunderIDRuntimeError("`signUp` function is not available.", "SignUp-handleInitialize-RuntimeError-001", "nextjs");
51
+ return await signUp(payload || {
52
+ flowType: __thunderid_node.EmbeddedFlowType.Registration,
53
+ ...contextApplicationId && { applicationId: contextApplicationId },
54
+ ...scopes && { scopes }
55
+ });
56
+ };
57
+ /**
58
+ * Handle sign-up steps.
59
+ */
60
+ const handleOnSubmit = async (payload) => {
61
+ if (!signUp) throw new __thunderid_node.ThunderIDRuntimeError("`signUp` function is not available.", "SignUp-handleOnSubmit-RuntimeError-001", "nextjs");
62
+ return await signUp(payload);
63
+ };
64
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__thunderid_react.BaseSignUp, {
65
+ afterSignUpUrl,
66
+ onInitialize: handleInitialize,
67
+ onSubmit: handleOnSubmit,
68
+ onError,
69
+ className,
70
+ size,
71
+ variant,
72
+ isInitialized: true
73
+ });
74
+ };
75
+ var SignUp_default = SignUp;
76
+
77
+ //#endregion
78
+ exports.default = SignUp_default;
79
+ //# sourceMappingURL=SignUp.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SignUp.cjs","names":["SignUp: FC<SignUpProps>","useThunderID","ThunderIDRuntimeError","EmbeddedFlowType","BaseSignUp"],"sources":["../../../../../../src/client/components/presentation/SignUp/SignUp.tsx"],"sourcesContent":["/**\n * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\n'use client';\n\nimport {ThunderIDRuntimeError, EmbeddedFlowType} from '@thunderid/node';\nimport {BaseSignUp, BaseSignUpProps} from '@thunderid/react';\nimport {FC} from 'react';\nimport useThunderID from '../../../contexts/ThunderID/useThunderID';\n\n/**\n * Props for the SignUp component.\n */\nexport type SignUpProps = BaseSignUpProps;\n\n/**\n * A styled SignUp component that provides embedded sign-up flow with pre-built styling.\n * This component handles the API calls for sign-up and delegates UI logic to BaseSignUp.\n *\n * @example\n * ```tsx\n * import { SignUp } from '@thunderid/react';\n *\n * const App = () => {\n * return (\n * <SignUp\n * onSuccess={(response) => {\n * console.log('Sign-up successful:', response);\n * // Handle successful sign-up (e.g., redirect, show confirmation)\n * }}\n * onError={(error) => {\n * console.error('Sign-up failed:', error);\n * }}\n * onComplete={(redirectUrl) => {\n * // Platform-specific redirect handling (e.g., Next.js router.push)\n * router.push(redirectUrl); // or window.location.href = redirectUrl\n * }}\n * size=\"medium\"\n * variant=\"outlined\"\n * afterSignUpUrl=\"/welcome\"\n * />\n * );\n * };\n * ```\n */\nconst SignUp: FC<SignUpProps> = ({\n className,\n size = 'medium',\n variant = 'outlined',\n afterSignUpUrl,\n onError,\n}: SignUpProps) => {\n const {signUp, applicationId: contextApplicationId, scopes} = useThunderID();\n\n /**\n * Initialize the sign-up flow.\n */\n const handleInitialize = async (payload?: any): Promise<any> => {\n if (!signUp) {\n throw new ThunderIDRuntimeError(\n '`signUp` function is not available.',\n 'SignUp-handleInitialize-RuntimeError-001',\n 'nextjs',\n );\n }\n\n return (await signUp(\n payload || {\n flowType: EmbeddedFlowType.Registration,\n ...(contextApplicationId && {applicationId: contextApplicationId}),\n ...(scopes && {scopes}),\n },\n )) as unknown as Promise<any>;\n };\n\n /**\n * Handle sign-up steps.\n */\n const handleOnSubmit = async (payload: any): Promise<any> => {\n if (!signUp) {\n throw new ThunderIDRuntimeError(\n '`signUp` function is not available.',\n 'SignUp-handleOnSubmit-RuntimeError-001',\n 'nextjs',\n );\n }\n\n return (await signUp(payload)) as unknown as Promise<any>;\n };\n\n return (\n <BaseSignUp\n afterSignUpUrl={afterSignUpUrl}\n onInitialize={handleInitialize}\n onSubmit={handleOnSubmit}\n onError={onError}\n className={className}\n size={size}\n variant={variant}\n isInitialized={true}\n />\n );\n};\n\nexport default SignUp;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4DA,MAAMA,UAA2B,EAC/B,WACA,OAAO,UACP,UAAU,YACV,gBACA,cACiB;CACjB,MAAM,EAAC,QAAQ,eAAe,sBAAsB,WAAUC,8BAAc;;;;CAK5E,MAAM,mBAAmB,OAAO,YAAgC;AAC9D,MAAI,CAAC,OACH,OAAM,IAAIC,uCACR,uCACA,4CACA,SACD;AAGH,SAAQ,MAAM,OACZ,WAAW;GACT,UAAUC,kCAAiB;GAC3B,GAAI,wBAAwB,EAAC,eAAe,sBAAqB;GACjE,GAAI,UAAU,EAAC,QAAO;GACvB,CACF;;;;;CAMH,MAAM,iBAAiB,OAAO,YAA+B;AAC3D,MAAI,CAAC,OACH,OAAM,IAAID,uCACR,uCACA,0CACA,SACD;AAGH,SAAQ,MAAM,OAAO,QAAQ;;AAG/B,QACE,2CAACE;EACiB;EAChB,cAAc;EACd,UAAU;EACD;EACE;EACL;EACG;EACT,eAAe;GACf;;AAIN,qBAAe"}
@@ -0,0 +1,49 @@
1
+ 'use client';
2
+
3
+
4
+ const require_rolldown_runtime = require('../../../../_virtual/rolldown_runtime.cjs');
5
+ const require_useThunderID = require('../../../contexts/ThunderID/useThunderID.cjs');
6
+ let __thunderid_react = require("@thunderid/react");
7
+ __thunderid_react = require_rolldown_runtime.__toESM(__thunderid_react);
8
+ let react_jsx_runtime = require("react/jsx-runtime");
9
+ react_jsx_runtime = require_rolldown_runtime.__toESM(react_jsx_runtime);
10
+
11
+ //#region src/client/components/presentation/User/User.tsx
12
+ /**
13
+ * A component that uses render props to expose the authenticated user object.
14
+ * This component automatically retrieves the user from ThunderID context.
15
+ *
16
+ * @remarks This component is only supported in browser based React applications (CSR).
17
+ *
18
+ * @example
19
+ * ```tsx
20
+ * import { User } from '@thunderid/auth-react';
21
+ *
22
+ * const App = () => {
23
+ * return (
24
+ * <User fallback={<p>Please sign in</p>}>
25
+ * {(user) => (
26
+ * <div>
27
+ * <h1>Welcome, {user.displayName}!</h1>
28
+ * <p>Email: {user.email}</p>
29
+ * </div>
30
+ * )}
31
+ * </User>
32
+ * );
33
+ * }
34
+ * ```
35
+ */
36
+ const User = ({ children, fallback = null }) => {
37
+ const { user } = require_useThunderID.default();
38
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__thunderid_react.BaseUser, {
39
+ user,
40
+ fallback,
41
+ children
42
+ });
43
+ };
44
+ User.displayName = "User";
45
+ var User_default = User;
46
+
47
+ //#endregion
48
+ exports.default = User_default;
49
+ //# sourceMappingURL=User.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"User.cjs","names":["User: FC<UserProps>","useThunderID","BaseUser"],"sources":["../../../../../../src/client/components/presentation/User/User.tsx"],"sourcesContent":["/**\n * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\n'use client';\n\nimport {BaseUser, BaseUserProps} from '@thunderid/react';\nimport {FC, ReactElement, ReactNode} from 'react';\nimport useThunderID from '../../../contexts/ThunderID/useThunderID';\n\n/**\n * Props for the User component.\n * Extends BaseUserProps but makes the user prop optional since it will be obtained from useThunderID\n */\nexport interface UserProps extends Omit<BaseUserProps, 'user'> {\n /**\n * Render prop that takes the user object and returns a ReactNode.\n * @param user - The authenticated user object from ThunderID.\n * @returns A ReactNode to render.\n */\n children: (user: any | null) => ReactNode;\n\n /**\n * Optional element to render when no user is signed in.\n */\n fallback?: ReactNode;\n}\n\n/**\n * A component that uses render props to expose the authenticated user object.\n * This component automatically retrieves the user from ThunderID context.\n *\n * @remarks This component is only supported in browser based React applications (CSR).\n *\n * @example\n * ```tsx\n * import { User } from '@thunderid/auth-react';\n *\n * const App = () => {\n * return (\n * <User fallback={<p>Please sign in</p>}>\n * {(user) => (\n * <div>\n * <h1>Welcome, {user.displayName}!</h1>\n * <p>Email: {user.email}</p>\n * </div>\n * )}\n * </User>\n * );\n * }\n * ```\n */\nconst User: FC<UserProps> = ({children, fallback = null}: UserProps): ReactElement => {\n const {user} = useThunderID();\n\n return (\n <BaseUser user={user} fallback={fallback}>\n {children}\n </BaseUser>\n );\n};\n\nUser.displayName = 'User';\n\nexport default User;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkEA,MAAMA,QAAuB,EAAC,UAAU,WAAW,WAAmC;CACpF,MAAM,EAAC,SAAQC,8BAAc;AAE7B,QACE,2CAACC;EAAe;EAAgB;EAC7B;GACQ;;AAIf,KAAK,cAAc;AAEnB,mBAAe"}
@@ -0,0 +1,114 @@
1
+ 'use client';
2
+
3
+
4
+ const require_rolldown_runtime = require('../../../../_virtual/rolldown_runtime.cjs');
5
+ const require_useThunderID = require('../../../contexts/ThunderID/useThunderID.cjs');
6
+ const require_UserProfile = require('../UserProfile/UserProfile.cjs');
7
+ let __thunderid_react = require("@thunderid/react");
8
+ __thunderid_react = require_rolldown_runtime.__toESM(__thunderid_react);
9
+ let react = require("react");
10
+ react = require_rolldown_runtime.__toESM(react);
11
+ let react_jsx_runtime = require("react/jsx-runtime");
12
+ react_jsx_runtime = require_rolldown_runtime.__toESM(react_jsx_runtime);
13
+
14
+ //#region src/client/components/presentation/UserDropdown/UserDropdown.tsx
15
+ /**
16
+ * UserDropdown component displays a user avatar with a dropdown menu.
17
+ * When clicked, it shows a popover with customizable menu items.
18
+ * This component is the React-specific implementation that uses the BaseUserDropdown
19
+ * and automatically retrieves the user data from ThunderID context.
20
+ *
21
+ * Supports render props for complete customization of the dropdown appearance and behavior.
22
+ *
23
+ * @example
24
+ * ```tsx
25
+ * // Basic usage - will use user from ThunderID context
26
+ * <UserDropdown menuItems={[
27
+ * { label: 'Profile', onClick: () => {} },
28
+ * { label: 'Settings', href: '/settings' },
29
+ * { label: 'Sign Out', onClick: () => {} }
30
+ * ]} />
31
+ *
32
+ * // With custom configuration
33
+ * <UserDropdown
34
+ * showTriggerLabel={true}
35
+ * avatarSize={40}
36
+ * fallback={<div>Please sign in</div>}
37
+ * />
38
+ *
39
+ * // Using render props for complete customization
40
+ * <UserDropdown>
41
+ * {({ user, isLoading, openProfile, signOut }) => (
42
+ * <div>
43
+ * <button onClick={openProfile}>
44
+ * {user?.name || 'Loading...'}
45
+ * </button>
46
+ * <button onClick={signOut}>Logout</button>
47
+ * </div>
48
+ * )}
49
+ * </UserDropdown>
50
+ *
51
+ * // Using partial render props
52
+ * <UserDropdown
53
+ * renderTrigger={({ user, openProfile }) => (
54
+ * <button onClick={openProfile} className="custom-trigger">
55
+ * Welcome, {user?.name}!
56
+ * </button>
57
+ * )}
58
+ * />
59
+ * ```
60
+ */
61
+ const UserDropdown = ({ children, renderTrigger, renderDropdown, onSignOut,...rest }) => {
62
+ const { user, isLoading, signOut } = require_useThunderID.default();
63
+ const [isProfileOpen, setIsProfileOpen] = (0, react.useState)(false);
64
+ const handleManageProfile = () => {
65
+ setIsProfileOpen(true);
66
+ };
67
+ const handleSignOut = () => {
68
+ signOut();
69
+ if (onSignOut) onSignOut();
70
+ };
71
+ const closeProfile = () => {
72
+ setIsProfileOpen(false);
73
+ };
74
+ const renderProps = {
75
+ closeProfile,
76
+ isLoading,
77
+ isProfileOpen,
78
+ openProfile: handleManageProfile,
79
+ signOut: handleSignOut,
80
+ user
81
+ };
82
+ if (children) return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [children(renderProps), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_UserProfile.default, {
83
+ mode: "popup",
84
+ open: isProfileOpen,
85
+ onOpenChange: setIsProfileOpen
86
+ })] });
87
+ if (renderTrigger || renderDropdown) return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [renderTrigger ? renderTrigger(renderProps) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__thunderid_react.BaseUserDropdown, {
88
+ user,
89
+ isLoading,
90
+ onManageProfile: handleManageProfile,
91
+ onSignOut: handleSignOut,
92
+ ...rest
93
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_UserProfile.default, {
94
+ mode: "popup",
95
+ open: isProfileOpen,
96
+ onOpenChange: setIsProfileOpen
97
+ })] });
98
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(__thunderid_react.BaseUserDropdown, {
99
+ user,
100
+ isLoading,
101
+ onManageProfile: handleManageProfile,
102
+ onSignOut: handleSignOut,
103
+ ...rest
104
+ }), isProfileOpen && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_UserProfile.default, {
105
+ mode: "popup",
106
+ open: isProfileOpen,
107
+ onOpenChange: setIsProfileOpen
108
+ })] });
109
+ };
110
+ var UserDropdown_default = UserDropdown;
111
+
112
+ //#endregion
113
+ exports.default = UserDropdown_default;
114
+ //# sourceMappingURL=UserDropdown.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"UserDropdown.cjs","names":["UserDropdown: FC<UserDropdownProps>","useThunderID","renderProps: UserDropdownRenderProps","UserProfile","BaseUserDropdown"],"sources":["../../../../../../src/client/components/presentation/UserDropdown/UserDropdown.tsx"],"sourcesContent":["/**\n * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\n'use client';\n\nimport {BaseUserDropdown, BaseUserDropdownProps} from '@thunderid/react';\nimport {FC, ReactElement, ReactNode, useState} from 'react';\nimport useThunderID from '../../../contexts/ThunderID/useThunderID';\nimport UserProfile from '../UserProfile/UserProfile.js';\n\n/**\n * Render props data passed to the children function\n */\nexport interface UserDropdownRenderProps {\n /** Function to close the profile dialog */\n closeProfile: () => void;\n /** Whether user data is currently loading */\n isLoading: boolean;\n /** Whether the profile dialog is currently open */\n isProfileOpen: boolean;\n /** Function to open the user profile dialog */\n openProfile: () => void;\n /** Function to sign out the user */\n signOut: () => void;\n /** The authenticated user object */\n user: any;\n}\n\n/**\n * Props for the UserDropdown component.\n * Extends BaseUserDropdownProps but excludes user, onManageProfile, and onSignOut since they're handled internally\n */\nexport type UserDropdownProps = Omit<BaseUserDropdownProps, 'user' | 'onManageProfile'> & {\n /**\n * Render prop function that receives user state and actions.\n * When provided, this completely replaces the default dropdown rendering.\n */\n children?: (props: UserDropdownRenderProps) => ReactNode;\n /**\n * Custom render function for the dropdown content.\n * When provided, this replaces just the dropdown content while keeping the trigger.\n */\n renderDropdown?: (props: UserDropdownRenderProps) => ReactNode;\n /**\n * Custom render function for the trigger button.\n * When provided, this replaces just the trigger button while keeping the dropdown.\n */\n renderTrigger?: (props: UserDropdownRenderProps) => ReactNode;\n};\n\n/**\n * UserDropdown component displays a user avatar with a dropdown menu.\n * When clicked, it shows a popover with customizable menu items.\n * This component is the React-specific implementation that uses the BaseUserDropdown\n * and automatically retrieves the user data from ThunderID context.\n *\n * Supports render props for complete customization of the dropdown appearance and behavior.\n *\n * @example\n * ```tsx\n * // Basic usage - will use user from ThunderID context\n * <UserDropdown menuItems={[\n * { label: 'Profile', onClick: () => {} },\n * { label: 'Settings', href: '/settings' },\n * { label: 'Sign Out', onClick: () => {} }\n * ]} />\n *\n * // With custom configuration\n * <UserDropdown\n * showTriggerLabel={true}\n * avatarSize={40}\n * fallback={<div>Please sign in</div>}\n * />\n *\n * // Using render props for complete customization\n * <UserDropdown>\n * {({ user, isLoading, openProfile, signOut }) => (\n * <div>\n * <button onClick={openProfile}>\n * {user?.name || 'Loading...'}\n * </button>\n * <button onClick={signOut}>Logout</button>\n * </div>\n * )}\n * </UserDropdown>\n *\n * // Using partial render props\n * <UserDropdown\n * renderTrigger={({ user, openProfile }) => (\n * <button onClick={openProfile} className=\"custom-trigger\">\n * Welcome, {user?.name}!\n * </button>\n * )}\n * />\n * ```\n */\nconst UserDropdown: FC<UserDropdownProps> = ({\n children,\n renderTrigger,\n renderDropdown,\n onSignOut,\n ...rest\n}: UserDropdownProps): ReactElement => {\n const {user, isLoading, signOut} = useThunderID();\n const [isProfileOpen, setIsProfileOpen] = useState(false);\n\n const handleManageProfile = (): void => {\n setIsProfileOpen(true);\n };\n\n const handleSignOut = (): void => {\n signOut();\n if (onSignOut) {\n onSignOut();\n }\n };\n\n const closeProfile = (): void => {\n setIsProfileOpen(false);\n };\n\n // Prepare render props data\n const renderProps: UserDropdownRenderProps = {\n closeProfile,\n isLoading: isLoading!,\n isProfileOpen,\n openProfile: handleManageProfile,\n signOut: handleSignOut,\n user,\n };\n\n // If children render prop is provided, use it for complete customization\n if (children) {\n return (\n <>\n {children(renderProps)}\n <UserProfile mode=\"popup\" open={isProfileOpen} onOpenChange={setIsProfileOpen} />\n </>\n );\n }\n\n // If partial render props are provided, customize specific parts\n if (renderTrigger || renderDropdown) {\n // This would require significant changes to BaseUserDropdown to support partial customization\n // For now, we'll provide a simple implementation that shows how it could work\n return (\n <>\n {renderTrigger ? (\n renderTrigger(renderProps)\n ) : (\n <BaseUserDropdown\n user={user}\n isLoading={isLoading}\n onManageProfile={handleManageProfile}\n onSignOut={handleSignOut}\n {...rest}\n />\n )}\n {/* Note: renderDropdown would need BaseUserDropdown modifications to implement properly */}\n <UserProfile mode=\"popup\" open={isProfileOpen} onOpenChange={setIsProfileOpen} />\n </>\n );\n }\n\n // Default behavior - use BaseUserDropdown as before\n return (\n <>\n <BaseUserDropdown\n user={user}\n isLoading={isLoading}\n onManageProfile={handleManageProfile}\n onSignOut={handleSignOut}\n {...rest}\n />\n {isProfileOpen && <UserProfile mode=\"popup\" open={isProfileOpen} onOpenChange={setIsProfileOpen} />}\n </>\n );\n};\n\nexport default UserDropdown;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA+GA,MAAMA,gBAAuC,EAC3C,UACA,eACA,gBACA,UACA,GAAG,WACkC;CACrC,MAAM,EAAC,MAAM,WAAW,YAAWC,8BAAc;CACjD,MAAM,CAAC,eAAe,wCAA6B,MAAM;CAEzD,MAAM,4BAAkC;AACtC,mBAAiB,KAAK;;CAGxB,MAAM,sBAA4B;AAChC,WAAS;AACT,MAAI,UACF,YAAW;;CAIf,MAAM,qBAA2B;AAC/B,mBAAiB,MAAM;;CAIzB,MAAMC,cAAuC;EAC3C;EACW;EACX;EACA,aAAa;EACb,SAAS;EACT;EACD;AAGD,KAAI,SACF,QACE,qFACG,SAAS,YAAY,EACtB,2CAACC;EAAY,MAAK;EAAQ,MAAM;EAAe,cAAc;GAAoB,IAChF;AAKP,KAAI,iBAAiB,eAGnB,QACE,qFACG,gBACC,cAAc,YAAY,GAE1B,2CAACC;EACO;EACK;EACX,iBAAiB;EACjB,WAAW;EACX,GAAI;GACJ,EAGJ,2CAACD;EAAY,MAAK;EAAQ,MAAM;EAAe,cAAc;GAAoB,IAChF;AAKP,QACE,qFACE,2CAACC;EACO;EACK;EACX,iBAAiB;EACjB,WAAW;EACX,GAAI;GACJ,EACD,iBAAiB,2CAACD;EAAY,MAAK;EAAQ,MAAM;EAAe,cAAc;GAAoB,IAClG;;AAIP,2BAAe"}
@@ -0,0 +1,52 @@
1
+ 'use client';
2
+
3
+
4
+ const require_rolldown_runtime = require('../../../../_virtual/rolldown_runtime.cjs');
5
+ const require_getSessionId = require('../../../../server/actions/getSessionId.cjs');
6
+ let __thunderid_react = require("@thunderid/react");
7
+ __thunderid_react = require_rolldown_runtime.__toESM(__thunderid_react);
8
+ let react_jsx_runtime = require("react/jsx-runtime");
9
+ react_jsx_runtime = require_rolldown_runtime.__toESM(react_jsx_runtime);
10
+
11
+ //#region src/client/components/presentation/UserProfile/UserProfile.tsx
12
+ /**
13
+ * UserProfile component displays the authenticated user's profile information in a
14
+ * structured and styled format. It shows user details such as display name, email,
15
+ * username, and other available profile information from ThunderID.
16
+ *
17
+ * This component is the React-specific implementation that uses the BaseUserProfile
18
+ * and automatically retrieves the user data from ThunderID context if not provided.
19
+ *
20
+ * @example
21
+ * ```tsx
22
+ * // Basic usage - will use user from ThunderID context
23
+ * <UserProfile />
24
+ *
25
+ * // With explicit user data
26
+ * <UserProfile user={specificUser} />
27
+ *
28
+ * // With card layout and custom fallback
29
+ * <UserProfile
30
+ * cardLayout={true}
31
+ * fallback={<div>Please sign in to view your profile</div>}
32
+ * />
33
+ * ```
34
+ */
35
+ const UserProfile = ({ ...rest }) => {
36
+ const { profile, flattenedProfile, schemas, onUpdateProfile, updateProfile } = (0, __thunderid_react.useUser)();
37
+ const handleProfileUpdate = async (payload) => {
38
+ onUpdateProfile((await updateProfile(payload, await require_getSessionId.default()))?.data?.user);
39
+ };
40
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__thunderid_react.BaseUserProfile, {
41
+ profile,
42
+ flattenedProfile,
43
+ schemas,
44
+ onUpdate: handleProfileUpdate,
45
+ ...rest
46
+ });
47
+ };
48
+ var UserProfile_default = UserProfile;
49
+
50
+ //#endregion
51
+ exports.default = UserProfile_default;
52
+ //# sourceMappingURL=UserProfile.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"UserProfile.cjs","names":["UserProfile: FC<UserProfileProps>","getSessionId","BaseUserProfile"],"sources":["../../../../../../src/client/components/presentation/UserProfile/UserProfile.tsx"],"sourcesContent":["/**\n * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\n'use client';\n\nimport {Schema, User} from '@thunderid/node';\nimport {BaseUserProfile, BaseUserProfileProps, useUser} from '@thunderid/react';\nimport {FC, ReactElement} from 'react';\nimport getSessionId from '../../../../server/actions/getSessionId';\n\n/**\n * Props for the UserProfile component.\n * Extends BaseUserProfileProps but makes the user prop optional since it will be obtained from useThunderID\n */\nexport type UserProfileProps = Omit<BaseUserProfileProps, 'user' | 'profile' | 'flattenedProfile' | 'schemas'>;\n\n/**\n * UserProfile component displays the authenticated user's profile information in a\n * structured and styled format. It shows user details such as display name, email,\n * username, and other available profile information from ThunderID.\n *\n * This component is the React-specific implementation that uses the BaseUserProfile\n * and automatically retrieves the user data from ThunderID context if not provided.\n *\n * @example\n * ```tsx\n * // Basic usage - will use user from ThunderID context\n * <UserProfile />\n *\n * // With explicit user data\n * <UserProfile user={specificUser} />\n *\n * // With card layout and custom fallback\n * <UserProfile\n * cardLayout={true}\n * fallback={<div>Please sign in to view your profile</div>}\n * />\n * ```\n */\nconst UserProfile: FC<UserProfileProps> = ({...rest}: UserProfileProps): ReactElement => {\n const {profile, flattenedProfile, schemas, onUpdateProfile, updateProfile} = useUser();\n\n const handleProfileUpdate = async (payload: any): Promise<void> => {\n const result: {data: {user: User}; error: string; success: boolean} = await updateProfile(\n payload,\n await getSessionId(),\n );\n onUpdateProfile(result?.data?.user);\n };\n\n return (\n <BaseUserProfile\n profile={profile!}\n flattenedProfile={flattenedProfile!}\n schemas={schemas!}\n onUpdate={handleProfileUpdate}\n {...rest}\n />\n );\n};\n\nexport default UserProfile;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAsDA,MAAMA,eAAqC,EAAC,GAAG,WAA0C;CACvF,MAAM,EAAC,SAAS,kBAAkB,SAAS,iBAAiB,kDAA0B;CAEtF,MAAM,sBAAsB,OAAO,YAAgC;AAKjE,mBAJsE,MAAM,cAC1E,SACA,MAAMC,8BAAc,CACrB,GACuB,MAAM,KAAK;;AAGrC,QACE,2CAACC;EACU;EACS;EACT;EACT,UAAU;EACV,GAAI;GACJ;;AAIN,0BAAe"}
@@ -0,0 +1,34 @@
1
+ 'use client';
2
+
3
+
4
+ const require_rolldown_runtime = require('../../../_virtual/rolldown_runtime.cjs');
5
+ let react = require("react");
6
+ react = require_rolldown_runtime.__toESM(react);
7
+
8
+ //#region src/client/contexts/ThunderID/ThunderIDContext.ts
9
+ /**
10
+ * Context object for managing the Authentication flow builder core context.
11
+ */
12
+ const ThunderIDContext = (0, react.createContext)({
13
+ afterSignInUrl: void 0,
14
+ applicationId: void 0,
15
+ baseUrl: void 0,
16
+ clearSession: () => Promise.resolve(),
17
+ isInitialized: false,
18
+ isLoading: true,
19
+ isSignedIn: false,
20
+ organizationHandle: void 0,
21
+ refreshToken: () => Promise.resolve({ expiresAt: 0 }),
22
+ signIn: () => Promise.resolve({}),
23
+ signInUrl: void 0,
24
+ signOut: () => Promise.resolve({}),
25
+ signUp: () => Promise.resolve({}),
26
+ signUpUrl: void 0,
27
+ user: null
28
+ });
29
+ ThunderIDContext.displayName = "ThunderIDContext";
30
+ var ThunderIDContext_default = ThunderIDContext;
31
+
32
+ //#endregion
33
+ exports.default = ThunderIDContext_default;
34
+ //# sourceMappingURL=ThunderIDContext.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ThunderIDContext.cjs","names":["ThunderIDContext: Context<ThunderIDContextProps | null>"],"sources":["../../../../../src/client/contexts/ThunderID/ThunderIDContext.ts"],"sourcesContent":["/**\n * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\n'use client';\n\nimport {ThunderIDContextProps as ReactContextProps} from '@thunderid/react';\nimport {Context, createContext} from 'react';\nimport {RefreshResult} from '../../../server/actions/refreshToken';\n\n/**\n * Props interface of {@link ThunderIDContext}\n */\nexport type ThunderIDContextProps = Partial<ReactContextProps> & {\n clearSession?: () => Promise<void>;\n refreshToken?: () => Promise<RefreshResult>;\n};\n\n/**\n * Context object for managing the Authentication flow builder core context.\n */\nconst ThunderIDContext: Context<ThunderIDContextProps | null> = createContext<null | ThunderIDContextProps>({\n afterSignInUrl: undefined,\n applicationId: undefined,\n baseUrl: undefined,\n clearSession: () => Promise.resolve(),\n isInitialized: false,\n isLoading: true,\n isSignedIn: false,\n organizationHandle: undefined,\n refreshToken: () => Promise.resolve({expiresAt: 0}),\n signIn: () => Promise.resolve({} as any),\n signInUrl: undefined,\n signOut: () => Promise.resolve({} as any),\n signUp: () => Promise.resolve({} as any),\n signUpUrl: undefined,\n user: null,\n});\n\nThunderIDContext.displayName = 'ThunderIDContext';\n\nexport default ThunderIDContext;\n"],"mappings":";;;;;;;;;;;AAmCA,MAAMA,4CAAsG;CAC1G,gBAAgB;CAChB,eAAe;CACf,SAAS;CACT,oBAAoB,QAAQ,SAAS;CACrC,eAAe;CACf,WAAW;CACX,YAAY;CACZ,oBAAoB;CACpB,oBAAoB,QAAQ,QAAQ,EAAC,WAAW,GAAE,CAAC;CACnD,cAAc,QAAQ,QAAQ,EAAE,CAAQ;CACxC,WAAW;CACX,eAAe,QAAQ,QAAQ,EAAE,CAAQ;CACzC,cAAc,QAAQ,QAAQ,EAAE,CAAQ;CACxC,WAAW;CACX,MAAM;CACP,CAAC;AAEF,iBAAiB,cAAc;AAE/B,+BAAe"}