@thunderid/react 0.3.3 → 0.3.5

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 (255) hide show
  1. package/dist/ThunderIDReactClient.d.ts +1 -5
  2. package/dist/ThunderIDReactClient.d.ts.map +1 -1
  3. package/dist/ThunderIDReactClient.js +1 -68
  4. package/dist/ThunderIDReactClient.js.map +1 -1
  5. package/dist/cjs/ThunderIDReactClient.cjs +0 -67
  6. package/dist/cjs/ThunderIDReactClient.cjs.map +1 -1
  7. package/dist/cjs/components/presentation/LanguageSwitcher/BaseLanguageSwitcher.cjs +1 -1
  8. package/dist/cjs/components/presentation/UserAvatar/BaseUserAvatar.cjs +57 -0
  9. package/dist/cjs/components/presentation/UserAvatar/BaseUserAvatar.cjs.map +1 -0
  10. package/dist/cjs/components/presentation/UserAvatar/UserAvatar.cjs +36 -0
  11. package/dist/cjs/components/presentation/UserAvatar/UserAvatar.cjs.map +1 -0
  12. package/dist/cjs/components/presentation/UserDropdown/BaseUserDropdown.cjs +6 -5
  13. package/dist/cjs/components/presentation/UserDropdown/BaseUserDropdown.cjs.map +1 -1
  14. package/dist/cjs/components/presentation/auth/AuthOptionFactory.cjs +3 -15
  15. package/dist/cjs/components/presentation/auth/AuthOptionFactory.cjs.map +1 -1
  16. package/dist/cjs/contexts/Theme/ThemeContext.cjs.map +1 -1
  17. package/dist/cjs/contexts/Theme/ThemeProvider.cjs +2 -5
  18. package/dist/cjs/contexts/Theme/ThemeProvider.cjs.map +1 -1
  19. package/dist/cjs/contexts/ThunderID/ThunderIDContext.cjs +0 -2
  20. package/dist/cjs/contexts/ThunderID/ThunderIDContext.cjs.map +1 -1
  21. package/dist/cjs/contexts/ThunderID/ThunderIDProvider.cjs +14 -90
  22. package/dist/cjs/contexts/ThunderID/ThunderIDProvider.cjs.map +1 -1
  23. package/dist/cjs/index.cjs +6 -51
  24. package/dist/components/presentation/LanguageSwitcher/BaseLanguageSwitcher.js +1 -1
  25. package/dist/components/presentation/UserAvatar/BaseUserAvatar.d.ts +50 -0
  26. package/dist/components/presentation/UserAvatar/BaseUserAvatar.d.ts.map +1 -0
  27. package/dist/components/presentation/UserAvatar/BaseUserAvatar.js +55 -0
  28. package/dist/components/presentation/UserAvatar/BaseUserAvatar.js.map +1 -0
  29. package/dist/components/presentation/UserAvatar/UserAvatar.d.ts +46 -0
  30. package/dist/components/presentation/UserAvatar/UserAvatar.d.ts.map +1 -0
  31. package/dist/components/presentation/UserAvatar/UserAvatar.js +34 -0
  32. package/dist/components/presentation/UserAvatar/UserAvatar.js.map +1 -0
  33. package/dist/components/presentation/UserDropdown/BaseUserDropdown.d.ts.map +1 -1
  34. package/dist/components/presentation/UserDropdown/BaseUserDropdown.js +6 -5
  35. package/dist/components/presentation/UserDropdown/BaseUserDropdown.js.map +1 -1
  36. package/dist/components/presentation/auth/AuthOptionFactory.d.ts +2 -2
  37. package/dist/components/presentation/auth/AuthOptionFactory.d.ts.map +1 -1
  38. package/dist/components/presentation/auth/AuthOptionFactory.js +3 -15
  39. package/dist/components/presentation/auth/AuthOptionFactory.js.map +1 -1
  40. package/dist/contexts/Theme/ThemeContext.d.ts +0 -12
  41. package/dist/contexts/Theme/ThemeContext.d.ts.map +1 -1
  42. package/dist/contexts/Theme/ThemeContext.js.map +1 -1
  43. package/dist/contexts/Theme/ThemeProvider.d.ts +0 -4
  44. package/dist/contexts/Theme/ThemeProvider.d.ts.map +1 -1
  45. package/dist/contexts/Theme/ThemeProvider.js +2 -5
  46. package/dist/contexts/Theme/ThemeProvider.js.map +1 -1
  47. package/dist/contexts/ThunderID/ThunderIDContext.d.ts +2 -3
  48. package/dist/contexts/ThunderID/ThunderIDContext.d.ts.map +1 -1
  49. package/dist/contexts/ThunderID/ThunderIDContext.js +0 -2
  50. package/dist/contexts/ThunderID/ThunderIDContext.js.map +1 -1
  51. package/dist/contexts/ThunderID/ThunderIDProvider.d.ts.map +1 -1
  52. package/dist/contexts/ThunderID/ThunderIDProvider.js +15 -91
  53. package/dist/contexts/ThunderID/ThunderIDProvider.js.map +1 -1
  54. package/dist/index.d.ts +4 -40
  55. package/dist/index.d.ts.map +1 -1
  56. package/dist/index.js +5 -27
  57. package/package.json +2 -2
  58. package/dist/api/createOrganization.d.ts +0 -86
  59. package/dist/api/createOrganization.d.ts.map +0 -1
  60. package/dist/api/createOrganization.js +0 -80
  61. package/dist/api/createOrganization.js.map +0 -1
  62. package/dist/api/getAllOrganizations.d.ts +0 -78
  63. package/dist/api/getAllOrganizations.d.ts.map +0 -1
  64. package/dist/api/getAllOrganizations.js +0 -71
  65. package/dist/api/getAllOrganizations.js.map +0 -1
  66. package/dist/api/getMeOrganizations.d.ts +0 -82
  67. package/dist/api/getMeOrganizations.d.ts.map +0 -1
  68. package/dist/api/getMeOrganizations.js +0 -75
  69. package/dist/api/getMeOrganizations.js.map +0 -1
  70. package/dist/api/getOrganization.d.ts +0 -74
  71. package/dist/api/getOrganization.d.ts.map +0 -1
  72. package/dist/api/getOrganization.js +0 -67
  73. package/dist/api/getOrganization.js.map +0 -1
  74. package/dist/api/getSchemas.d.ts +0 -72
  75. package/dist/api/getSchemas.d.ts.map +0 -1
  76. package/dist/api/getSchemas.js +0 -65
  77. package/dist/api/getSchemas.js.map +0 -1
  78. package/dist/api/updateOrganization.d.ts +0 -81
  79. package/dist/api/updateOrganization.d.ts.map +0 -1
  80. package/dist/api/updateOrganization.js +0 -74
  81. package/dist/api/updateOrganization.js.map +0 -1
  82. package/dist/cjs/api/createOrganization.cjs +0 -82
  83. package/dist/cjs/api/createOrganization.cjs.map +0 -1
  84. package/dist/cjs/api/getAllOrganizations.cjs +0 -73
  85. package/dist/cjs/api/getAllOrganizations.cjs.map +0 -1
  86. package/dist/cjs/api/getMeOrganizations.cjs +0 -77
  87. package/dist/cjs/api/getMeOrganizations.cjs.map +0 -1
  88. package/dist/cjs/api/getOrganization.cjs +0 -69
  89. package/dist/cjs/api/getOrganization.cjs.map +0 -1
  90. package/dist/cjs/api/getSchemas.cjs +0 -67
  91. package/dist/cjs/api/getSchemas.cjs.map +0 -1
  92. package/dist/cjs/api/updateOrganization.cjs +0 -76
  93. package/dist/cjs/api/updateOrganization.cjs.map +0 -1
  94. package/dist/cjs/components/control/OrganizationContext/OrganizationContext.cjs +0 -34
  95. package/dist/cjs/components/control/OrganizationContext/OrganizationContext.cjs.map +0 -1
  96. package/dist/cjs/components/control/OrganizationContext/OrganizationContextController.cjs +0 -58
  97. package/dist/cjs/components/control/OrganizationContext/OrganizationContextController.cjs.map +0 -1
  98. package/dist/cjs/components/presentation/CreateOrganization/BaseCreateOrganization.cjs +0 -183
  99. package/dist/cjs/components/presentation/CreateOrganization/BaseCreateOrganization.cjs.map +0 -1
  100. package/dist/cjs/components/presentation/CreateOrganization/BaseCreateOrganization.styles.cjs +0 -150
  101. package/dist/cjs/components/presentation/CreateOrganization/BaseCreateOrganization.styles.cjs.map +0 -1
  102. package/dist/cjs/components/presentation/CreateOrganization/CreateOrganization.cjs +0 -90
  103. package/dist/cjs/components/presentation/CreateOrganization/CreateOrganization.cjs.map +0 -1
  104. package/dist/cjs/components/presentation/Organization/BaseOrganization.cjs +0 -41
  105. package/dist/cjs/components/presentation/Organization/BaseOrganization.cjs.map +0 -1
  106. package/dist/cjs/components/presentation/Organization/Organization.cjs +0 -49
  107. package/dist/cjs/components/presentation/Organization/Organization.cjs.map +0 -1
  108. package/dist/cjs/components/presentation/OrganizationList/BaseOrganizationList.cjs +0 -257
  109. package/dist/cjs/components/presentation/OrganizationList/BaseOrganizationList.cjs.map +0 -1
  110. package/dist/cjs/components/presentation/OrganizationList/BaseOrganizationList.styles.cjs +0 -236
  111. package/dist/cjs/components/presentation/OrganizationList/BaseOrganizationList.styles.cjs.map +0 -1
  112. package/dist/cjs/components/presentation/OrganizationList/OrganizationList.cjs +0 -86
  113. package/dist/cjs/components/presentation/OrganizationList/OrganizationList.cjs.map +0 -1
  114. package/dist/cjs/components/presentation/OrganizationList/OrganizationList.styles.cjs +0 -75
  115. package/dist/cjs/components/presentation/OrganizationList/OrganizationList.styles.cjs.map +0 -1
  116. package/dist/cjs/components/presentation/OrganizationProfile/BaseOrganizationProfile.cjs +0 -328
  117. package/dist/cjs/components/presentation/OrganizationProfile/BaseOrganizationProfile.cjs.map +0 -1
  118. package/dist/cjs/components/presentation/OrganizationProfile/BaseOrganizationProfile.styles.cjs +0 -166
  119. package/dist/cjs/components/presentation/OrganizationProfile/BaseOrganizationProfile.styles.cjs.map +0 -1
  120. package/dist/cjs/components/presentation/OrganizationProfile/OrganizationProfile.cjs +0 -126
  121. package/dist/cjs/components/presentation/OrganizationProfile/OrganizationProfile.cjs.map +0 -1
  122. package/dist/cjs/components/presentation/OrganizationSwitcher/BaseOrganizationSwitcher.cjs +0 -288
  123. package/dist/cjs/components/presentation/OrganizationSwitcher/BaseOrganizationSwitcher.cjs.map +0 -1
  124. package/dist/cjs/components/presentation/OrganizationSwitcher/BaseOrganizationSwitcher.styles.cjs +0 -237
  125. package/dist/cjs/components/presentation/OrganizationSwitcher/BaseOrganizationSwitcher.styles.cjs.map +0 -1
  126. package/dist/cjs/components/presentation/OrganizationSwitcher/OrganizationSwitcher.cjs +0 -127
  127. package/dist/cjs/components/presentation/OrganizationSwitcher/OrganizationSwitcher.cjs.map +0 -1
  128. package/dist/cjs/components/presentation/auth/OrganizationUnitPicker/OrganizationUnitPicker.cjs +0 -183
  129. package/dist/cjs/components/presentation/auth/OrganizationUnitPicker/OrganizationUnitPicker.cjs.map +0 -1
  130. package/dist/cjs/components/presentation/auth/OrganizationUnitPicker/OrganizationUnitPicker.styles.cjs +0 -128
  131. package/dist/cjs/components/presentation/auth/OrganizationUnitPicker/OrganizationUnitPicker.styles.cjs.map +0 -1
  132. package/dist/cjs/components/primitives/Icons/Building.cjs +0 -75
  133. package/dist/cjs/components/primitives/Icons/Building.cjs.map +0 -1
  134. package/dist/cjs/contexts/Branding/BrandingContext.cjs +0 -12
  135. package/dist/cjs/contexts/Branding/BrandingContext.cjs.map +0 -1
  136. package/dist/cjs/contexts/Branding/BrandingProvider.cjs +0 -96
  137. package/dist/cjs/contexts/Branding/BrandingProvider.cjs.map +0 -1
  138. package/dist/cjs/contexts/Branding/useBrandingContext.cjs +0 -40
  139. package/dist/cjs/contexts/Branding/useBrandingContext.cjs.map +0 -1
  140. package/dist/cjs/contexts/Organization/OrganizationContext.cjs +0 -27
  141. package/dist/cjs/contexts/Organization/OrganizationContext.cjs.map +0 -1
  142. package/dist/cjs/contexts/Organization/OrganizationProvider.cjs +0 -97
  143. package/dist/cjs/contexts/Organization/OrganizationProvider.cjs.map +0 -1
  144. package/dist/cjs/contexts/Organization/useOrganization.cjs +0 -100
  145. package/dist/cjs/contexts/Organization/useOrganization.cjs.map +0 -1
  146. package/dist/cjs/hooks/useBranding.cjs +0 -71
  147. package/dist/cjs/hooks/useBranding.cjs.map +0 -1
  148. package/dist/components/control/OrganizationContext/OrganizationContext.d.ts +0 -40
  149. package/dist/components/control/OrganizationContext/OrganizationContext.d.ts.map +0 -1
  150. package/dist/components/control/OrganizationContext/OrganizationContext.js +0 -32
  151. package/dist/components/control/OrganizationContext/OrganizationContext.js.map +0 -1
  152. package/dist/components/control/OrganizationContext/OrganizationContextController.d.ts +0 -35
  153. package/dist/components/control/OrganizationContext/OrganizationContextController.d.ts.map +0 -1
  154. package/dist/components/control/OrganizationContext/OrganizationContextController.js +0 -55
  155. package/dist/components/control/OrganizationContext/OrganizationContextController.js.map +0 -1
  156. package/dist/components/presentation/CreateOrganization/BaseCreateOrganization.d.ts +0 -60
  157. package/dist/components/presentation/CreateOrganization/BaseCreateOrganization.d.ts.map +0 -1
  158. package/dist/components/presentation/CreateOrganization/BaseCreateOrganization.js +0 -178
  159. package/dist/components/presentation/CreateOrganization/BaseCreateOrganization.js.map +0 -1
  160. package/dist/components/presentation/CreateOrganization/BaseCreateOrganization.styles.d.ts +0 -27
  161. package/dist/components/presentation/CreateOrganization/BaseCreateOrganization.styles.d.ts.map +0 -1
  162. package/dist/components/presentation/CreateOrganization/BaseCreateOrganization.styles.js +0 -147
  163. package/dist/components/presentation/CreateOrganization/BaseCreateOrganization.styles.js.map +0 -1
  164. package/dist/components/presentation/CreateOrganization/CreateOrganization.d.ts +0 -68
  165. package/dist/components/presentation/CreateOrganization/CreateOrganization.d.ts.map +0 -1
  166. package/dist/components/presentation/CreateOrganization/CreateOrganization.js +0 -87
  167. package/dist/components/presentation/CreateOrganization/CreateOrganization.js.map +0 -1
  168. package/dist/components/presentation/Organization/BaseOrganization.d.ts +0 -67
  169. package/dist/components/presentation/Organization/BaseOrganization.d.ts.map +0 -1
  170. package/dist/components/presentation/Organization/BaseOrganization.js +0 -39
  171. package/dist/components/presentation/Organization/BaseOrganization.js.map +0 -1
  172. package/dist/components/presentation/Organization/Organization.d.ts +0 -67
  173. package/dist/components/presentation/Organization/Organization.d.ts.map +0 -1
  174. package/dist/components/presentation/Organization/Organization.js +0 -47
  175. package/dist/components/presentation/Organization/Organization.js.map +0 -1
  176. package/dist/components/presentation/OrganizationList/BaseOrganizationList.d.ts +0 -135
  177. package/dist/components/presentation/OrganizationList/BaseOrganizationList.d.ts.map +0 -1
  178. package/dist/components/presentation/OrganizationList/BaseOrganizationList.js +0 -252
  179. package/dist/components/presentation/OrganizationList/BaseOrganizationList.js.map +0 -1
  180. package/dist/components/presentation/OrganizationList/BaseOrganizationList.styles.d.ts +0 -27
  181. package/dist/components/presentation/OrganizationList/BaseOrganizationList.styles.d.ts.map +0 -1
  182. package/dist/components/presentation/OrganizationList/BaseOrganizationList.styles.js +0 -233
  183. package/dist/components/presentation/OrganizationList/BaseOrganizationList.styles.js.map +0 -1
  184. package/dist/components/presentation/OrganizationList/OrganizationList.d.ts +0 -93
  185. package/dist/components/presentation/OrganizationList/OrganizationList.d.ts.map +0 -1
  186. package/dist/components/presentation/OrganizationList/OrganizationList.js +0 -82
  187. package/dist/components/presentation/OrganizationList/OrganizationList.js.map +0 -1
  188. package/dist/components/presentation/OrganizationList/OrganizationList.styles.d.ts +0 -27
  189. package/dist/components/presentation/OrganizationList/OrganizationList.styles.d.ts.map +0 -1
  190. package/dist/components/presentation/OrganizationList/OrganizationList.styles.js +0 -72
  191. package/dist/components/presentation/OrganizationList/OrganizationList.styles.js.map +0 -1
  192. package/dist/components/presentation/OrganizationProfile/BaseOrganizationProfile.d.ts +0 -160
  193. package/dist/components/presentation/OrganizationProfile/BaseOrganizationProfile.d.ts.map +0 -1
  194. package/dist/components/presentation/OrganizationProfile/BaseOrganizationProfile.js +0 -323
  195. package/dist/components/presentation/OrganizationProfile/BaseOrganizationProfile.js.map +0 -1
  196. package/dist/components/presentation/OrganizationProfile/BaseOrganizationProfile.styles.d.ts +0 -27
  197. package/dist/components/presentation/OrganizationProfile/BaseOrganizationProfile.styles.d.ts.map +0 -1
  198. package/dist/components/presentation/OrganizationProfile/BaseOrganizationProfile.styles.js +0 -163
  199. package/dist/components/presentation/OrganizationProfile/BaseOrganizationProfile.styles.js.map +0 -1
  200. package/dist/components/presentation/OrganizationProfile/OrganizationProfile.d.ts +0 -120
  201. package/dist/components/presentation/OrganizationProfile/OrganizationProfile.d.ts.map +0 -1
  202. package/dist/components/presentation/OrganizationProfile/OrganizationProfile.js +0 -122
  203. package/dist/components/presentation/OrganizationProfile/OrganizationProfile.js.map +0 -1
  204. package/dist/components/presentation/OrganizationSwitcher/BaseOrganizationSwitcher.d.ts +0 -149
  205. package/dist/components/presentation/OrganizationSwitcher/BaseOrganizationSwitcher.d.ts.map +0 -1
  206. package/dist/components/presentation/OrganizationSwitcher/BaseOrganizationSwitcher.js +0 -282
  207. package/dist/components/presentation/OrganizationSwitcher/BaseOrganizationSwitcher.js.map +0 -1
  208. package/dist/components/presentation/OrganizationSwitcher/BaseOrganizationSwitcher.styles.d.ts +0 -27
  209. package/dist/components/presentation/OrganizationSwitcher/BaseOrganizationSwitcher.styles.d.ts.map +0 -1
  210. package/dist/components/presentation/OrganizationSwitcher/BaseOrganizationSwitcher.styles.js +0 -234
  211. package/dist/components/presentation/OrganizationSwitcher/BaseOrganizationSwitcher.styles.js.map +0 -1
  212. package/dist/components/presentation/OrganizationSwitcher/OrganizationSwitcher.d.ts +0 -71
  213. package/dist/components/presentation/OrganizationSwitcher/OrganizationSwitcher.d.ts.map +0 -1
  214. package/dist/components/presentation/OrganizationSwitcher/OrganizationSwitcher.js +0 -124
  215. package/dist/components/presentation/OrganizationSwitcher/OrganizationSwitcher.js.map +0 -1
  216. package/dist/components/presentation/auth/OrganizationUnitPicker/OrganizationUnitPicker.d.ts +0 -30
  217. package/dist/components/presentation/auth/OrganizationUnitPicker/OrganizationUnitPicker.d.ts.map +0 -1
  218. package/dist/components/presentation/auth/OrganizationUnitPicker/OrganizationUnitPicker.js +0 -179
  219. package/dist/components/presentation/auth/OrganizationUnitPicker/OrganizationUnitPicker.js.map +0 -1
  220. package/dist/components/presentation/auth/OrganizationUnitPicker/OrganizationUnitPicker.styles.d.ts +0 -21
  221. package/dist/components/presentation/auth/OrganizationUnitPicker/OrganizationUnitPicker.styles.d.ts.map +0 -1
  222. package/dist/components/presentation/auth/OrganizationUnitPicker/OrganizationUnitPicker.styles.js +0 -125
  223. package/dist/components/presentation/auth/OrganizationUnitPicker/OrganizationUnitPicker.styles.js.map +0 -1
  224. package/dist/components/presentation/auth/OrganizationUnitPicker/index.d.ts +0 -20
  225. package/dist/components/presentation/auth/OrganizationUnitPicker/index.d.ts.map +0 -1
  226. package/dist/components/primitives/Icons/Building.js +0 -73
  227. package/dist/components/primitives/Icons/Building.js.map +0 -1
  228. package/dist/contexts/Branding/BrandingContext.d.ts +0 -53
  229. package/dist/contexts/Branding/BrandingContext.d.ts.map +0 -1
  230. package/dist/contexts/Branding/BrandingContext.js +0 -10
  231. package/dist/contexts/Branding/BrandingContext.js.map +0 -1
  232. package/dist/contexts/Branding/BrandingProvider.d.ts +0 -89
  233. package/dist/contexts/Branding/BrandingProvider.d.ts.map +0 -1
  234. package/dist/contexts/Branding/BrandingProvider.js +0 -92
  235. package/dist/contexts/Branding/BrandingProvider.js.map +0 -1
  236. package/dist/contexts/Branding/useBrandingContext.d.ts +0 -45
  237. package/dist/contexts/Branding/useBrandingContext.d.ts.map +0 -1
  238. package/dist/contexts/Branding/useBrandingContext.js +0 -38
  239. package/dist/contexts/Branding/useBrandingContext.js.map +0 -1
  240. package/dist/contexts/Organization/OrganizationContext.d.ts +0 -41
  241. package/dist/contexts/Organization/OrganizationContext.d.ts.map +0 -1
  242. package/dist/contexts/Organization/OrganizationContext.js +0 -25
  243. package/dist/contexts/Organization/OrganizationContext.js.map +0 -1
  244. package/dist/contexts/Organization/OrganizationProvider.d.ts +0 -94
  245. package/dist/contexts/Organization/OrganizationProvider.d.ts.map +0 -1
  246. package/dist/contexts/Organization/OrganizationProvider.js +0 -93
  247. package/dist/contexts/Organization/OrganizationProvider.js.map +0 -1
  248. package/dist/contexts/Organization/useOrganization.d.ts +0 -105
  249. package/dist/contexts/Organization/useOrganization.d.ts.map +0 -1
  250. package/dist/contexts/Organization/useOrganization.js +0 -98
  251. package/dist/contexts/Organization/useOrganization.js.map +0 -1
  252. package/dist/hooks/useBranding.d.ts +0 -128
  253. package/dist/hooks/useBranding.d.ts.map +0 -1
  254. package/dist/hooks/useBranding.js +0 -69
  255. package/dist/hooks/useBranding.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"BaseUserDropdown.cjs","names":["BaseUserDropdown: FC<BaseUserDropdownProps>","useTheme","styles: Record<string, string>","useStyles","autoUpdate","mergedMappings: Record<string, string | string[]>","defaultMenuItems: MenuItem[]","User","LogOut","allMenuItems: MenuItem[]","Button","Avatar","getMappedUserProfileValue","getDisplayName","Typography","FloatingPortal","FloatingFocusManager"],"sources":["../../../../../src/components/presentation/UserDropdown/BaseUserDropdown.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\nimport {cx} from '@emotion/css';\nimport {\n useFloating,\n autoUpdate,\n offset,\n flip,\n shift,\n useClick,\n useDismiss,\n useRole,\n useInteractions,\n FloatingFocusManager,\n FloatingPortal,\n} from '@floating-ui/react';\nimport {withVendorCSSClassPrefix} from '@thunderid/browser';\nimport {FC, ReactElement, ReactNode, useState} from 'react';\nimport useStyles from './BaseUserDropdown.styles';\nimport useTheme from '../../../contexts/Theme/useTheme';\nimport getDisplayName from '../../../utils/getDisplayName';\nimport getMappedUserProfileValue from '../../../utils/getMappedUserProfileValue';\nimport {Avatar} from '../../primitives/Avatar/Avatar';\nimport Button from '../../primitives/Button/Button';\nimport LogOut from '../../primitives/Icons/LogOut';\nimport User from '../../primitives/Icons/User';\nimport Typography from '../../primitives/Typography/Typography';\n\ninterface MenuItem {\n href?: string;\n icon?: ReactNode;\n label: ReactNode;\n onClick?: () => void;\n}\n\nexport interface BaseUserDropdownProps {\n /**\n * Mapping of component attribute names to identity provider field names.\n * Allows customizing which user profile fields should be used for each attribute.\n */\n attributeMapping?: {\n [key: string]: string | string[] | undefined;\n firstName?: string | string[];\n lastName?: string | string[];\n picture?: string | string[];\n username?: string | string[];\n };\n /**\n * Optional size for the avatar\n */\n avatarSize?: number;\n /**\n * Optional className for the dropdown container.\n */\n className?: string;\n /**\n * Optional element to render when no user is signed in.\n */\n fallback?: ReactElement | null;\n /**\n * Whether the user data is currently loading\n */\n isLoading?: boolean;\n /**\n * Menu items to display in the dropdown\n */\n menuItems?: MenuItem[];\n /**\n * Callback function for \"Manage Profile\" action\n */\n onManageProfile?: () => void;\n /**\n * Callback function for \"Sign Out\" action\n */\n onSignOut?: () => void;\n /**\n * The HTML element ID where the portal should be mounted\n */\n portalId?: string;\n /**\n * Show dropdown header with user information\n */\n showDropdownHeader?: boolean;\n /**\n * Show user's display name next to avatar in the trigger button\n */\n showTriggerLabel?: boolean;\n /**\n * The user object containing profile information\n */\n user: any;\n}\n\n/**\n * BaseUserDropdown component displays a user avatar with a dropdown menu.\n * When clicked, it shows a popover with customizable menu items.\n * This component serves as the base for framework-specific implementations.\n */\nexport const BaseUserDropdown: FC<BaseUserDropdownProps> = ({\n fallback = null,\n className = '',\n user,\n isLoading = false,\n portalId = 'thunderid-user-dropdown',\n menuItems = [],\n showTriggerLabel = false,\n avatarSize = 32,\n onManageProfile,\n onSignOut,\n attributeMapping = {},\n}: BaseUserDropdownProps): ReactElement | null => {\n const {theme, colorScheme} = useTheme();\n const styles: Record<string, string> = useStyles(theme, colorScheme);\n const [isOpen, setIsOpen] = useState(false);\n const [hoveredItemIndex, setHoveredItemIndex] = useState<number | null>(null);\n\n const {refs, floatingStyles, context} = useFloating({\n middleware: [offset(5), flip({fallbackAxisSideDirection: 'end'}), shift({padding: 5})],\n onOpenChange: setIsOpen,\n open: isOpen,\n placement: 'bottom-end',\n whileElementsMounted: autoUpdate,\n });\n\n const click: any = useClick(context);\n const dismiss: any = useDismiss(context);\n const role: any = useRole(context);\n\n const {getReferenceProps, getFloatingProps} = useInteractions([click, dismiss, role]);\n\n const defaultAttributeMappings: Record<string, string | string[]> = {\n email: ['emails'],\n firstName: ['name.givenName', 'given_name'],\n lastName: ['name.familyName', 'family_name'],\n picture: ['profile', 'profileUrl', 'picture', 'URL'],\n username: ['userName', 'username', 'user_name'],\n };\n\n const mergedMappings: Record<string, string | string[]> = Object.fromEntries(\n Object.entries({...defaultAttributeMappings, ...attributeMapping}).filter(\n (entry): entry is [string, string | string[]] => entry[1] !== undefined,\n ),\n );\n\n if (fallback && !user && !isLoading) {\n return fallback;\n }\n\n const handleMenuItemClick = (item: MenuItem): void => {\n if (item.onClick) {\n item.onClick();\n }\n setIsOpen(false);\n };\n\n const defaultMenuItems: MenuItem[] = [];\n\n if (onManageProfile) {\n defaultMenuItems.push({\n icon: <User width=\"16\" height=\"16\" />,\n label: 'Manage Profile',\n onClick: onManageProfile,\n });\n }\n\n if (onSignOut) {\n defaultMenuItems.push({\n icon: <LogOut width=\"16\" height=\"16\" />,\n label: 'Sign Out',\n onClick: onSignOut,\n });\n }\n\n const allMenuItems: MenuItem[] = [...menuItems];\n\n if (defaultMenuItems.length > 0) {\n if (menuItems.length > 0) {\n allMenuItems.push({label: '', onClick: undefined});\n }\n\n allMenuItems.push(...defaultMenuItems);\n }\n\n return (\n <div className={cx(withVendorCSSClassPrefix('user-dropdown'), className)}>\n <Button\n ref={refs.setReference}\n className={cx(withVendorCSSClassPrefix('user-dropdown__trigger'), styles['trigger'])}\n color=\"tertiary\"\n variant=\"text\"\n size=\"medium\"\n data-testid=\"thunderid-user-dropdown-trigger\"\n {...getReferenceProps()}\n >\n <Avatar\n imageUrl={getMappedUserProfileValue('picture', mergedMappings, user)}\n name={getDisplayName(mergedMappings, user)}\n size={avatarSize}\n alt={`${getDisplayName(mergedMappings, user)}'s avatar`}\n />\n {showTriggerLabel && (\n <Typography\n variant=\"body2\"\n className={cx(withVendorCSSClassPrefix('user-dropdown__trigger-label'), styles['userName'])}\n >\n {getDisplayName(mergedMappings, user)}\n </Typography>\n )}\n </Button>\n\n {isOpen && (\n <FloatingPortal id={portalId}>\n <FloatingFocusManager context={context} modal={false} initialFocus={-1}>\n <div\n ref={refs.setFloating}\n className={cx(withVendorCSSClassPrefix('user-dropdown__content'), styles['dropdownContent'])}\n style={{\n ...floatingStyles,\n // Floating UI doesn't set a z-index by default, so we set a high value to ensure the dropdown appears above other elements.\n // https://floating-ui.com/docs/misc#z-index-stacking\n zIndex: 9999,\n }}\n {...getFloatingProps()}\n >\n <div className={cx(withVendorCSSClassPrefix('user-dropdown__header'), styles['dropdownHeader'])}>\n <Avatar\n imageUrl={getMappedUserProfileValue('picture', mergedMappings, user)}\n name={getDisplayName(mergedMappings, user)}\n size={avatarSize * 1.25}\n alt={`${getDisplayName(mergedMappings, user)}'s avatar`}\n />\n <div className={cx(withVendorCSSClassPrefix('user-dropdown__header-info'), styles['headerInfo'])}>\n <Typography\n noWrap\n className={withVendorCSSClassPrefix('user-dropdown__header-name')}\n variant=\"body1\"\n fontWeight=\"medium\"\n >\n {getDisplayName(mergedMappings, user)}\n </Typography>\n <Typography\n noWrap\n className={withVendorCSSClassPrefix('user-dropdown__header-email')}\n variant=\"caption\"\n color=\"secondary\"\n >\n {getMappedUserProfileValue('username', mergedMappings, user) ||\n getMappedUserProfileValue('email', mergedMappings, user)}\n </Typography>\n </div>\n </div>\n <div className={cx(withVendorCSSClassPrefix('user-dropdown__menu'), styles['dropdownMenu'])}>\n {allMenuItems.map((item: any, index: number) => (\n <div key={index}>\n {((): ReactElement => {\n if (item.label === '') {\n return (\n <div\n className={cx(withVendorCSSClassPrefix('user-dropdown__menu-divider'), styles['divider'])}\n />\n );\n }\n if (item.href) {\n return (\n <a\n href={item.href}\n style={{\n backgroundColor:\n hoveredItemIndex === index ? theme.vars.colors.action?.hover : 'transparent',\n }}\n className={cx(\n withVendorCSSClassPrefix('user-dropdown__menu-item'),\n styles['menuItemAnchor'],\n )}\n onMouseEnter={(): void => setHoveredItemIndex(index)}\n onMouseLeave={(): void => setHoveredItemIndex(null)}\n onFocus={(): void => setHoveredItemIndex(index)}\n onBlur={(): void => setHoveredItemIndex(null)}\n >\n {item.icon}\n <span>{item.label}</span>\n </a>\n );\n }\n return (\n <Button\n onClick={(): void => handleMenuItemClick(item)}\n style={{\n backgroundColor:\n hoveredItemIndex === index ? theme.vars.colors.action?.hover : 'transparent',\n }}\n className={cx(withVendorCSSClassPrefix('user-dropdown__menu-item'), styles['menuItem'])}\n color=\"tertiary\"\n variant=\"text\"\n size=\"small\"\n startIcon={item.icon}\n onMouseEnter={(): void => setHoveredItemIndex(index)}\n onMouseLeave={(): void => setHoveredItemIndex(null)}\n >\n {item.label}\n </Button>\n );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1
+ {"version":3,"file":"BaseUserDropdown.cjs","names":["BaseUserDropdown: FC<BaseUserDropdownProps>","useTheme","styles: Record<string, string>","useStyles","autoUpdate","mergedMappings: Record<string, string | string[]>","defaultMenuItems: MenuItem[]","User","LogOut","allMenuItems: MenuItem[]","Button","Avatar","getMappedUserProfileValue","getDisplayName","Typography","FloatingPortal","FloatingFocusManager"],"sources":["../../../../../src/components/presentation/UserDropdown/BaseUserDropdown.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\nimport {cx} from '@emotion/css';\nimport {\n useFloating,\n autoUpdate,\n offset,\n flip,\n shift,\n useClick,\n useDismiss,\n useRole,\n useInteractions,\n FloatingFocusManager,\n FloatingPortal,\n} from '@floating-ui/react';\nimport {withVendorCSSClassPrefix} from '@thunderid/browser';\nimport {FC, ReactElement, ReactNode, useState} from 'react';\nimport useStyles from './BaseUserDropdown.styles';\nimport useTheme from '../../../contexts/Theme/useTheme';\nimport getDisplayName from '../../../utils/getDisplayName';\nimport getMappedUserProfileValue from '../../../utils/getMappedUserProfileValue';\nimport {Avatar} from '../../primitives/Avatar/Avatar';\nimport Button from '../../primitives/Button/Button';\nimport LogOut from '../../primitives/Icons/LogOut';\nimport User from '../../primitives/Icons/User';\nimport Typography from '../../primitives/Typography/Typography';\n\ninterface MenuItem {\n href?: string;\n icon?: ReactNode;\n label: ReactNode;\n onClick?: () => void;\n}\n\nexport interface BaseUserDropdownProps {\n /**\n * Mapping of component attribute names to identity provider field names.\n * Allows customizing which user profile fields should be used for each attribute.\n */\n attributeMapping?: {\n [key: string]: string | string[] | undefined;\n firstName?: string | string[];\n lastName?: string | string[];\n picture?: string | string[];\n username?: string | string[];\n };\n /**\n * Optional size for the avatar\n */\n avatarSize?: number;\n /**\n * Optional className for the dropdown container.\n */\n className?: string;\n /**\n * Optional element to render when no user is signed in.\n */\n fallback?: ReactElement | null;\n /**\n * Whether the user data is currently loading\n */\n isLoading?: boolean;\n /**\n * Menu items to display in the dropdown\n */\n menuItems?: MenuItem[];\n /**\n * Callback function for \"Manage Profile\" action\n */\n onManageProfile?: () => void;\n /**\n * Callback function for \"Sign Out\" action\n */\n onSignOut?: () => void;\n /**\n * The HTML element ID where the portal should be mounted\n */\n portalId?: string;\n /**\n * Show dropdown header with user information\n */\n showDropdownHeader?: boolean;\n /**\n * Show user's display name next to avatar in the trigger button\n */\n showTriggerLabel?: boolean;\n /**\n * The user object containing profile information\n */\n user: any;\n}\n\n/**\n * BaseUserDropdown component displays a user avatar with a dropdown menu.\n * When clicked, it shows a popover with customizable menu items.\n * This component serves as the base for framework-specific implementations.\n */\nexport const BaseUserDropdown: FC<BaseUserDropdownProps> = ({\n fallback = null,\n className = '',\n user,\n isLoading = false,\n portalId = 'thunderid-user-dropdown',\n menuItems = [],\n showTriggerLabel = false,\n avatarSize = 32,\n onManageProfile,\n onSignOut,\n attributeMapping = {},\n}: BaseUserDropdownProps): ReactElement | null => {\n const {theme, colorScheme} = useTheme();\n const styles: Record<string, string> = useStyles(theme, colorScheme);\n const [isOpen, setIsOpen] = useState(false);\n const [hoveredItemIndex, setHoveredItemIndex] = useState<number | null>(null);\n\n const {refs, floatingStyles, context} = useFloating({\n middleware: [offset(5), flip({fallbackAxisSideDirection: 'end'}), shift({padding: 5})],\n onOpenChange: setIsOpen,\n open: isOpen,\n placement: 'bottom-end',\n whileElementsMounted: autoUpdate,\n });\n\n const click: any = useClick(context);\n const dismiss: any = useDismiss(context);\n const role: any = useRole(context);\n\n const {getReferenceProps, getFloatingProps} = useInteractions([click, dismiss, role]);\n\n const defaultAttributeMappings: Record<string, string | string[]> = {\n email: ['emails'],\n firstName: ['name.givenName', 'given_name'],\n lastName: ['name.familyName', 'family_name'],\n picture: ['profile', 'profileUrl', 'picture', 'URL'],\n username: ['userName', 'username', 'user_name'],\n };\n\n const mergedMappings: Record<string, string | string[]> = Object.fromEntries(\n Object.entries({...defaultAttributeMappings, ...attributeMapping}).filter(\n (entry): entry is [string, string | string[]] => entry[1] !== undefined,\n ),\n );\n\n if (fallback && !user && !isLoading) {\n return fallback;\n }\n\n const handleMenuItemClick = (item: MenuItem): void => {\n if (item.onClick) {\n item.onClick();\n }\n setIsOpen(false);\n };\n\n const defaultMenuItems: MenuItem[] = [];\n\n if (onManageProfile) {\n defaultMenuItems.push({\n icon: <User width=\"16\" height=\"16\" />,\n label: 'Manage Profile',\n onClick: onManageProfile,\n });\n }\n\n if (onSignOut) {\n defaultMenuItems.push({\n icon: <LogOut width=\"16\" height=\"16\" />,\n label: 'Sign Out',\n onClick: onSignOut,\n });\n }\n\n const allMenuItems: MenuItem[] = [...menuItems];\n\n if (defaultMenuItems.length > 0) {\n if (menuItems.length > 0) {\n allMenuItems.push({label: '', onClick: undefined});\n }\n\n allMenuItems.push(...defaultMenuItems);\n }\n\n return (\n <div className={cx(withVendorCSSClassPrefix('user-dropdown'), className)}>\n <Button\n ref={refs.setReference}\n className={cx(withVendorCSSClassPrefix('user-dropdown__trigger'), styles['trigger'])}\n color=\"tertiary\"\n variant=\"text\"\n size=\"medium\"\n data-testid=\"thunderid-user-dropdown-trigger\"\n startIcon={\n <Avatar\n imageUrl={getMappedUserProfileValue('picture', mergedMappings, user)}\n name={getDisplayName(mergedMappings, user)}\n size={avatarSize}\n alt={`${getDisplayName(mergedMappings, user)}'s avatar`}\n />\n }\n {...getReferenceProps()}\n >\n {showTriggerLabel && (\n <Typography\n variant=\"body2\"\n className={cx(withVendorCSSClassPrefix('user-dropdown__trigger-label'), styles['userName'])}\n >\n {getDisplayName(mergedMappings, user)}\n </Typography>\n )}\n </Button>\n\n {isOpen && (\n <FloatingPortal id={portalId}>\n <FloatingFocusManager context={context} modal={false} initialFocus={-1}>\n <div\n ref={refs.setFloating}\n className={cx(withVendorCSSClassPrefix('user-dropdown__content'), styles['dropdownContent'])}\n style={{\n ...floatingStyles,\n // Floating UI doesn't set a z-index by default, so we set a high value to ensure the dropdown appears above other elements.\n // https://floating-ui.com/docs/misc#z-index-stacking\n zIndex: 9999,\n }}\n {...getFloatingProps()}\n >\n <div className={cx(withVendorCSSClassPrefix('user-dropdown__header'), styles['dropdownHeader'])}>\n <Avatar\n imageUrl={getMappedUserProfileValue('picture', mergedMappings, user)}\n name={getDisplayName(mergedMappings, user)}\n size={avatarSize * 1.25}\n alt={`${getDisplayName(mergedMappings, user)}'s avatar`}\n />\n <div className={cx(withVendorCSSClassPrefix('user-dropdown__header-info'), styles['headerInfo'])}>\n <Typography\n noWrap\n className={withVendorCSSClassPrefix('user-dropdown__header-name')}\n variant=\"body1\"\n fontWeight=\"medium\"\n >\n {getDisplayName(mergedMappings, user)}\n </Typography>\n <Typography\n noWrap\n className={withVendorCSSClassPrefix('user-dropdown__header-email')}\n variant=\"caption\"\n color=\"secondary\"\n >\n {getMappedUserProfileValue('username', mergedMappings, user) ||\n getMappedUserProfileValue('email', mergedMappings, user)}\n </Typography>\n </div>\n </div>\n <div className={cx(withVendorCSSClassPrefix('user-dropdown__menu'), styles['dropdownMenu'])}>\n {allMenuItems.map((item: any, index: number) => (\n <div key={index}>\n {((): ReactElement => {\n if (item.label === '') {\n return (\n <div\n className={cx(withVendorCSSClassPrefix('user-dropdown__menu-divider'), styles['divider'])}\n />\n );\n }\n if (item.href) {\n return (\n <a\n href={item.href}\n style={{\n backgroundColor:\n hoveredItemIndex === index ? theme.vars.colors.action?.hover : 'transparent',\n }}\n className={cx(\n withVendorCSSClassPrefix('user-dropdown__menu-item'),\n styles['menuItemAnchor'],\n )}\n onMouseEnter={(): void => setHoveredItemIndex(index)}\n onMouseLeave={(): void => setHoveredItemIndex(null)}\n onFocus={(): void => setHoveredItemIndex(index)}\n onBlur={(): void => setHoveredItemIndex(null)}\n >\n {item.icon}\n <span>{item.label}</span>\n </a>\n );\n }\n return (\n <Button\n onClick={(): void => handleMenuItemClick(item)}\n style={{\n backgroundColor:\n hoveredItemIndex === index ? theme.vars.colors.action?.hover : 'transparent',\n }}\n className={cx(withVendorCSSClassPrefix('user-dropdown__menu-item'), styles['menuItem'])}\n color=\"tertiary\"\n variant=\"text\"\n size=\"small\"\n startIcon={item.icon}\n onMouseEnter={(): void => setHoveredItemIndex(index)}\n onMouseLeave={(): void => setHoveredItemIndex(null)}\n >\n {item.label}\n </Button>\n );\n })()}\n </div>\n ))}\n </div>\n </div>\n </FloatingFocusManager>\n </FloatingPortal>\n )}\n </div>\n );\n};\n\nexport default BaseUserDropdown;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAkHA,MAAaA,oBAA+C,EAC1D,WAAW,MACX,YAAY,IACZ,MACA,YAAY,OACZ,WAAW,2BACX,YAAY,EAAE,EACd,mBAAmB,OACnB,aAAa,IACb,iBACA,WACA,mBAAmB,EAAE,OAC2B;CAChD,MAAM,EAAC,OAAO,gBAAeC,0BAAU;CACvC,MAAMC,SAAiCC,wCAAU,OAAO,YAAY;CACpE,MAAM,CAAC,QAAQ,iCAAsB,MAAM;CAC3C,MAAM,CAAC,kBAAkB,2CAA+C,KAAK;CAE7E,MAAM,EAAC,MAAM,gBAAgB,iDAAuB;EAClD,YAAY;mCAAQ,EAAE;iCAAO,EAAC,2BAA2B,OAAM,CAAC;kCAAQ,EAAC,SAAS,GAAE,CAAC;GAAC;EACtF,cAAc;EACd,MAAM;EACN,WAAW;EACX,sBAAsBC;EACvB,CAAC;CAMF,MAAM,EAAC,mBAAmB,8DAAoC;oCAJlC,QAAQ;sCACJ,QAAQ;mCACd,QAAQ;EAEkD,CAAC;CAUrF,MAAMC,iBAAoD,OAAO,YAC/D,OAAO,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,MAAM;QAC/C,cAAoB,oBAAoB,KAAK;mBAE5C,KAAK,MACN,2CAAC,oBAAM,KAAK,QAAa;SACvB;AAGR,cACE,2CAACF;QACC,eAAqB,oBAAoB,KAAK;QAC9C,OAAO,EACL,iBACE,qBAAqB,QAAQ,MAAM,KAAK,OAAO,QAAQ,QAAQ,eAClE;QACD,mFAAuC,2BAA2B,EAAE,OAAO,YAAY;QACvF,OAAM;QACN,SAAQ;QACR,MAAK;QACL,WAAW,KAAK;QAChB,oBAA0B,oBAAoB,MAAM;QACpD,oBAA0B,oBAAoB,KAAK;kBAElD,KAAK;SACC;UAET,IAjDI,MAkDJ,CACN;OACE;MACF;KACe;IACR;GAEf;;AAIV,+BAAe"}
@@ -1,7 +1,6 @@
1
1
  const require_rolldown_runtime = require('../../../_virtual/rolldown_runtime.cjs');
2
2
  const require_Button = require('../../primitives/Button/Button.cjs');
3
3
  const require_Typography = require('../../primitives/Typography/Typography.cjs');
4
- const require_OrganizationUnitPicker = require('./OrganizationUnitPicker/OrganizationUnitPicker.cjs');
5
4
  const require_Divider = require('../../primitives/Divider/Divider.cjs');
6
5
  const require_ConsentCheckboxList = require('../../adapters/ConsentCheckboxList.cjs');
7
6
  const require_Consent = require('../../adapters/Consent.cjs');
@@ -316,20 +315,9 @@ const createAuthComponentFromFlow = (component, formValues, touchedFields, formE
316
315
  className: options.inputClassName
317
316
  }, key);
318
317
  }
319
- case __thunderid_browser.EmbeddedFlowComponentType.OuSelect: {
320
- const identifier = component.ref ?? component.id;
321
- const rootOuId = options.additionalData?.["rootOuId"];
322
- if (!rootOuId || !options.fetchOrganizationUnitChildren) {
323
- logger.warn("OU_SELECT requires additionalData.rootOuId and fetchOrganizationUnitChildren. Skipping render.");
324
- return null;
325
- }
326
- return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_OrganizationUnitPicker.default, {
327
- rootOuId,
328
- selectedOuId: formValues[identifier] || null,
329
- onSelect: (ouId) => onInputChange(identifier, ouId),
330
- fetchChildren: options.fetchOrganizationUnitChildren
331
- }, key);
332
- }
318
+ case __thunderid_browser.EmbeddedFlowComponentType.OuSelect:
319
+ logger.warn("OU_SELECT component type is not supported. Skipping render.");
320
+ return null;
333
321
  case __thunderid_browser.EmbeddedFlowComponentType.Block:
334
322
  if (component.components && component.components.length > 0) {
335
323
  const formStyles = {
@@ -1 +1 @@
1
- {"version":3,"file":"AuthOptionFactory.cjs","names":["logger: ReturnType<typeof createPackageComponentLogger>","richTextClass: string","EmbeddedFlowComponentType","FieldType","providerId: any","providerMatches: any","theme: any","customRenderers: ComponentRendererMap","key: string | number","customRenderer: ComponentRenderer | undefined","identifier: string","value: string","error: string","fieldType: string","createField","actionId: string","eventType: string","buttonText: string","componentVariant: string","shouldSkipValidation: boolean","EmbeddedFlowEventType","formData: Record<string, any>","consentPrompt: ConsentPromptData | undefined","isDeny: boolean","decisions: ConsentDecisions","getConsentOptionalKey","GoogleButton","GitHubButton","FacebookButton","MicrosoftButton","LinkedInButton","SignInWithEthereumButton","SmsOtpButton","startIconEl: ReactElement | null","endIconEl: ReactElement | null","Button","Typography","Divider","selectOptions: any","Select","DatePicker","rootOuId: string | undefined","OrganizationUnitPicker","formStyles: CSSProperties","blockComponents: any","DOMPurify","explicitHeight: string","explicitWidth: string","ImageComponent","iconName: string","IconComponent: any","flowIconRegistry","direction: string","gap: number","align: string","justify: string","consentPromptRawData: ConsentPromptData | string | undefined","Consent","textTemplate: string","timeoutMs: number","FlowTimer","sourceKey: string | undefined","CopyableText"],"sources":["../../../../../src/components/presentation/auth/AuthOptionFactory.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\nimport {css} from '@emotion/css';\nimport {\n FieldType,\n FlowMetadataResponse,\n OrganizationUnitListResponse,\n EmbeddedFlowComponent,\n EmbeddedFlowComponentType,\n EmbeddedFlowTextVariant,\n EmbeddedFlowEventType,\n createPackageComponentLogger,\n resolveFlowTemplateLiterals,\n resolveEmojiUrisInHtml,\n ConsentPurposeData,\n ConsentPromptData,\n ConsentDecisions,\n ConsentPurposeDecision,\n ConsentAttributeElement,\n} from '@thunderid/browser';\nimport DOMPurify from 'dompurify';\nimport {cloneElement, CSSProperties, ReactElement} from 'react';\nimport {OrganizationUnitPicker} from './OrganizationUnitPicker';\nimport {\n ComponentRenderer,\n ComponentRenderContext,\n ComponentRendererMap,\n} from '../../../contexts/ComponentRenderer/ComponentRendererContext';\nimport {UseTranslation} from '../../../hooks/useTranslation';\nimport Consent from '../../adapters/Consent';\nimport {getConsentOptionalKey} from '../../adapters/ConsentCheckboxList';\nimport FacebookButton from '../../adapters/FacebookButton';\nimport FlowTimer from '../../adapters/FlowTimer';\nimport GitHubButton from '../../adapters/GitHubButton';\nimport GoogleButton from '../../adapters/GoogleButton';\nimport ImageComponent from '../../adapters/ImageComponent';\nimport LinkedInButton from '../../adapters/LinkedInButton';\nimport MicrosoftButton from '../../adapters/MicrosoftButton';\nimport SignInWithEthereumButton from '../../adapters/SignInWithEthereumButton';\nimport SmsOtpButton from '../../adapters/SmsOtpButton';\nimport {createField} from '../../factories/FieldFactory';\nimport Button from '../../primitives/Button/Button';\nimport CopyableText from '../../primitives/CopyableText/CopyableText';\nimport DatePicker from '../../primitives/DatePicker/DatePicker';\nimport Divider from '../../primitives/Divider/Divider';\nimport flowIconRegistry from '../../primitives/Icons/flowIconRegistry';\nimport Select from '../../primitives/Select/Select';\nimport Typography from '../../primitives/Typography/Typography';\nimport {TypographyVariant} from '../../primitives/Typography/Typography.styles';\n\nconst logger: ReturnType<typeof createPackageComponentLogger> = createPackageComponentLogger(\n '@thunderid/react',\n 'AuthOptionFactory',\n);\n\n/**\n * Replaces `emoji:` URIs embedded in HTML before DOMPurify sanitization.\n *\n * DOMPurify strips unknown URI schemes from attributes (e.g. `src=\"emoji:🦊\"` → `src=\"\"`).\n * This function converts:\n * - `<img src=\"emoji:X\" alt=\"Y\">` → `<span role=\"img\" aria-label=\"Y\">X</span>`\n * - Any remaining `emoji:X` text occurrences → `X`\n */\n\n/** Ensures rich-text content (including all inner elements from the server) always word-wraps. */\nconst richTextClass: string = css`\n overflow-wrap: anywhere;\n & * {\n overflow-wrap: anywhere;\n word-break: break-word;\n }\n & .rich-text-align-left {\n text-align: left;\n }\n & .rich-text-align-center {\n text-align: center;\n }\n & .rich-text-align-right {\n text-align: right;\n }\n & .rich-text-align-justify {\n text-align: justify;\n }\n & a,\n & .rich-text-link {\n text-decoration: underline;\n }\n & span[role='img'] {\n display: inline-block;\n }\n`;\n\nexport type AuthType = 'signin' | 'signup' | 'recovery';\n\n/**\n * Get the appropriate FieldType for an input component.\n */\nconst getFieldType = (variant: EmbeddedFlowComponentType): FieldType => {\n switch (variant) {\n case EmbeddedFlowComponentType.EmailInput:\n return FieldType.Email;\n case EmbeddedFlowComponentType.PhoneInput:\n return FieldType.Tel;\n case EmbeddedFlowComponentType.PasswordInput:\n return FieldType.Password;\n case EmbeddedFlowComponentType.TextInput:\n default:\n return FieldType.Text;\n }\n};\n\n/**\n * Get typography variant from component variant.\n */\nconst getTypographyVariant = (variant: string): any => {\n const variantMap: Record<EmbeddedFlowTextVariant, TypographyVariant> = {\n BODY_1: 'body1',\n BODY_2: 'body2',\n BUTTON_TEXT: 'button',\n CAPTION: 'caption',\n HEADING_1: 'h1',\n HEADING_2: 'h2',\n HEADING_3: 'h3',\n HEADING_4: 'h4',\n HEADING_5: 'h5',\n HEADING_6: 'h6',\n OVERLINE: 'overline',\n SUBTITLE_1: 'subtitle1',\n SUBTITLE_2: 'subtitle2',\n };\n\n return variantMap[variant] || 'h3';\n};\n\n/**\n * Check if a button text or action matches a social provider.\n */\nconst matchesSocialProvider = (\n actionId: string,\n eventType: string,\n buttonText: string,\n provider: string,\n authType: AuthType,\n /* eslint-disable-next-line @typescript-eslint/no-unused-vars */\n _componentVariant?: string,\n): boolean => {\n const providerId: any = `${provider}_auth`;\n const providerMatches: any = actionId === providerId || eventType === providerId;\n\n // Social buttons usually have \"Sign in with X\" or \"Continue with X\" text,\n // so also check button text for the provider name to increase chances of correct detection (especially for signup flows where action IDs are less standardized)\n if (buttonText.toLowerCase().includes(provider)) {\n return true;\n }\n\n // For signup, also check button text\n if (authType === 'signup') {\n return providerMatches || buttonText.toLowerCase().includes(provider);\n }\n\n return providerMatches;\n};\n\n/**\n * Create an auth component from flow component configuration.\n */\nconst createAuthComponentFromFlow = (\n component: EmbeddedFlowComponent,\n formValues: Record<string, string>,\n touchedFields: Record<string, boolean>,\n formErrors: Record<string, string>,\n isLoading: boolean,\n isFormValid: boolean,\n onInputChange: (name: string, value: string) => void,\n authType: AuthType,\n options: {\n /** @internal Passed from the host React component so hooks aren't called inside a loop. */\n _customRenderers?: ComponentRendererMap;\n /** @internal Passed from the host React component so hooks aren't called inside a loop. */\n _theme?: any;\n /** Additional data from the flow response, used for different dynamic data */\n additionalData?: Record<string, any>;\n buttonClassName?: string;\n /** Current consent purpose being rendered. Set by CONSENT_PURPOSE block iteration. */\n currentConsentPurpose?: ConsentPurposeData;\n /** Function to fetch child organization units. Used by OU_SELECT component type. */\n fetchOrganizationUnitChildren?: (\n parentId: string,\n limit: number,\n offset: number,\n ) => Promise<OrganizationUnitListResponse>;\n inStack?: boolean;\n inputClassName?: string;\n /** Flag to determine if the step timeline has expired */\n isTimeoutDisabled?: boolean;\n key?: string | number;\n /** Flow metadata for resolving {{meta(...)}} expressions at render time */\n meta?: FlowMetadataResponse | null;\n onInputBlur?: (name: string) => void;\n onSubmit?: (component: EmbeddedFlowComponent, data?: Record<string, any>, skipValidation?: boolean) => void;\n size?: 'small' | 'medium' | 'large';\n /** Translation function for resolving {{t(...)}} expressions at render time */\n t?: UseTranslation['t'];\n variant?: any;\n } = {},\n): ReactElement | null => {\n const theme: any = options._theme;\n const customRenderers: ComponentRendererMap = options._customRenderers ?? {};\n\n const key: string | number = options.key || component.id;\n\n const customRenderer: ComponentRenderer | undefined =\n customRenderers[component.id] ?? customRenderers[component.type];\n if (customRenderer) {\n const renderCtx: ComponentRenderContext = {\n additionalData: options.additionalData,\n authType,\n formErrors,\n formValues,\n isFormValid,\n isLoading,\n meta: options.meta,\n onInputBlur: options.onInputBlur,\n onInputChange,\n onSubmit: options.onSubmit,\n touchedFields,\n };\n return customRenderer(component, renderCtx);\n }\n\n /** Resolve any remaining {{t()}} or {{meta()}} template expressions in a string at render time. */\n const resolve = (text: string | undefined): string => {\n if (!text || (!options.t && !options.meta)) {\n return text || '';\n }\n return resolveFlowTemplateLiterals(text, {meta: options.meta, t: options.t || ((k: string): string => k)});\n };\n\n switch (component.type) {\n case EmbeddedFlowComponentType.TextInput:\n case EmbeddedFlowComponentType.PasswordInput:\n case EmbeddedFlowComponentType.EmailInput:\n case EmbeddedFlowComponentType.PhoneInput: {\n const identifier: string = component.ref!;\n const value: string = formValues[identifier] || '';\n const isTouched: boolean = touchedFields[identifier] || false;\n const error: string = isTouched ? formErrors[identifier] : undefined!;\n const fieldType: string = getFieldType(component.type);\n\n const field: any = createField({\n className: options.inputClassName,\n error,\n label: resolve(component.label) || '',\n name: identifier,\n onBlur: () => options.onInputBlur?.(identifier),\n onChange: (newValue: string) => onInputChange(identifier, newValue),\n placeholder: resolve(component.placeholder) || '',\n required: component.required || false,\n type: fieldType as FieldType,\n value,\n });\n\n return cloneElement(field, {key});\n }\n\n case EmbeddedFlowComponentType.OtpInput: {\n const identifier: string = component.ref!;\n const value: string = formValues[identifier] || '';\n const isTouched: boolean = touchedFields[identifier] || false;\n const error: string = isTouched ? formErrors[identifier] : undefined!;\n\n const field: any = createField({\n className: options.inputClassName,\n error,\n label: resolve(component.label) || '',\n name: identifier,\n onBlur: () => options.onInputBlur?.(identifier),\n onChange: (newValue: string) => onInputChange(identifier, newValue),\n placeholder: resolve(component.placeholder) || '',\n required: component.required || false,\n type: FieldType.Otp,\n value,\n });\n\n return cloneElement(field, {key});\n }\n\n case EmbeddedFlowComponentType.Action: {\n const actionId: string = component.id;\n const eventType: string = component.eventType || '';\n const buttonText: string = resolve(component.label);\n const componentVariant: string = component.variant || '';\n\n // Only validate on submit type events.\n const shouldSkipValidation: boolean = eventType.toUpperCase() === EmbeddedFlowEventType.Trigger;\n\n const handleClick = (): any => {\n if (options.onSubmit) {\n const formData: Record<string, any> = {};\n Object.keys(formValues).forEach((field: any) => {\n // Include all values, even empty strings, to ensure proper submission\n formData[field] = formValues[field];\n });\n\n // For consent actions, build the consent_decisions JSON from the form values.\n // The allow action captures per-attribute choices; the deny action sends\n // all purposes as rejected so the backend ConsentExecutor can fail the flow.\n const consentPrompt: ConsentPromptData | undefined = options.additionalData?.['consentPrompt'] as\n | ConsentPromptData\n | undefined;\n if (consentPrompt && eventType.toUpperCase() === EmbeddedFlowEventType.Submit) {\n const isDeny: boolean = componentVariant.toLowerCase() !== 'primary';\n const decisions: ConsentDecisions = {\n purposes: consentPrompt.purposes.map(\n (p: ConsentPurposeData): ConsentPurposeDecision => ({\n approved: !isDeny,\n elements: [\n ...p.essential.map((e): ConsentAttributeElement => ({approved: !isDeny, name: e.name})),\n ...p.optional.map(\n (e): ConsentAttributeElement => ({\n approved: isDeny ? false : formValues[getConsentOptionalKey(p.purposeId, e.name)] !== 'false',\n name: e.name,\n }),\n ),\n ],\n purposeName: p.purposeName!,\n }),\n ),\n };\n formData['consent_decisions'] = JSON.stringify(decisions);\n }\n\n options.onSubmit(component, formData, shouldSkipValidation);\n }\n };\n\n // Render branded social login buttons for known action IDs\n\n if (matchesSocialProvider(actionId, eventType, buttonText, 'google', authType, componentVariant)) {\n return <GoogleButton key={key} onClick={handleClick} className={options.buttonClassName} />;\n }\n if (matchesSocialProvider(actionId, eventType, buttonText, 'github', authType, componentVariant)) {\n return <GitHubButton key={key} onClick={handleClick} className={options.buttonClassName} />;\n }\n if (matchesSocialProvider(actionId, eventType, buttonText, 'facebook', authType, componentVariant)) {\n return <FacebookButton key={key} onClick={handleClick} className={options.buttonClassName} />;\n }\n if (matchesSocialProvider(actionId, eventType, buttonText, 'microsoft', authType, componentVariant)) {\n return <MicrosoftButton key={key} onClick={handleClick} className={options.buttonClassName} />;\n }\n if (matchesSocialProvider(actionId, eventType, buttonText, 'linkedin', authType, componentVariant)) {\n return <LinkedInButton key={key} onClick={handleClick} className={options.buttonClassName} />;\n }\n if (matchesSocialProvider(actionId, eventType, buttonText, 'ethereum', authType, componentVariant)) {\n return <SignInWithEthereumButton key={key} onClick={handleClick} className={options.buttonClassName} />;\n }\n if (actionId === 'prompt_mobile' || eventType === 'prompt_mobile') {\n return <SmsOtpButton key={key} onClick={handleClick} className={options.buttonClassName} />;\n }\n\n const startIconEl: ReactElement | null = component.startIcon ? (\n <img\n src={component.startIcon}\n alt=\"\"\n aria-hidden=\"true\"\n style={{height: '1.25em', objectFit: 'contain', width: '1.25em'}}\n />\n ) : null;\n\n const endIconEl: ReactElement | null = component.endIcon ? (\n <img\n src={component.endIcon}\n alt=\"\"\n aria-hidden=\"true\"\n style={{height: '1.25em', objectFit: 'contain', width: '1.25em'}}\n />\n ) : null;\n\n return (\n <Button\n fullWidth\n key={key}\n onClick={handleClick}\n disabled={\n isLoading ||\n (!isFormValid && !shouldSkipValidation) ||\n options.isTimeoutDisabled ||\n (component as any).config?.disabled\n }\n className={options.buttonClassName}\n data-testid=\"thunderid-signin-submit\"\n variant={component.variant?.toLowerCase() === 'primary' ? 'solid' : 'outline'}\n color={component.variant?.toLowerCase() === 'primary' ? 'primary' : 'secondary'}\n startIcon={startIconEl}\n endIcon={endIconEl}\n >\n {buttonText || 'Submit'}\n </Button>\n );\n }\n\n case EmbeddedFlowComponentType.Text: {\n const variant: any = getTypographyVariant(component.variant!);\n return (\n <Typography\n key={key}\n variant={variant}\n style={{\n marginBottom: 2,\n textAlign:\n typeof component?.align === 'string' ? (component.align as React.CSSProperties['textAlign']) : 'left',\n }}\n >\n {resolve(component.label)}\n </Typography>\n );\n }\n\n case EmbeddedFlowComponentType.Divider: {\n return <Divider key={key}>{resolve(component.label) || ''}</Divider>;\n }\n\n case EmbeddedFlowComponentType.Select: {\n const identifier: string = component.ref!;\n const value: string = formValues[identifier] || '';\n const isTouched: boolean = touchedFields[identifier] || false;\n const error: string = isTouched ? formErrors[identifier] : undefined!;\n\n // Options are pre-sanitized by flowTransformer to {value: string, label: string} format\n const selectOptions: any = (component.options || []).map((opt: any) => ({\n label: typeof opt === 'string' ? opt : String(opt.label ?? opt.value ?? ''),\n value: typeof opt === 'string' ? opt : String(opt.value ?? ''),\n }));\n\n return (\n <Select\n key={key}\n name={identifier}\n label={resolve(component.label) || ''}\n placeholder={resolve(component.placeholder)}\n required={component.required}\n options={selectOptions}\n value={value}\n error={error}\n onChange={(e: any): void => onInputChange(identifier, e.target.value)}\n onBlur={(): any => options.onInputBlur?.(identifier)}\n className={options.inputClassName}\n />\n );\n }\n\n case EmbeddedFlowComponentType.DateInput: {\n const identifier: string = component.ref!;\n const value: string = formValues[identifier] || '';\n const isTouched: boolean = touchedFields[identifier] || false;\n const error: string = isTouched ? formErrors[identifier] : undefined!;\n\n return (\n <DatePicker\n key={key}\n name={identifier}\n label={resolve(component.label) || ''}\n placeholder={resolve(component.placeholder)}\n required={component.required}\n dateFormat={component.dateFormat}\n value={value}\n error={error}\n onChange={(e: any): void => onInputChange(identifier, e.target.value)}\n onBlur={(): any => options.onInputBlur?.(identifier)}\n className={options.inputClassName}\n />\n );\n }\n\n case EmbeddedFlowComponentType.OuSelect: {\n const identifier: string = component.ref ?? component.id;\n const rootOuId: string | undefined = options.additionalData?.['rootOuId'] as string | undefined;\n\n if (!rootOuId || !options.fetchOrganizationUnitChildren) {\n logger.warn('OU_SELECT requires additionalData.rootOuId and fetchOrganizationUnitChildren. Skipping render.');\n return null;\n }\n\n return (\n <OrganizationUnitPicker\n key={key}\n rootOuId={rootOuId}\n selectedOuId={formValues[identifier] || null}\n onSelect={(ouId: string) => onInputChange(identifier, ouId)}\n fetchChildren={options.fetchOrganizationUnitChildren}\n />\n );\n }\n\n case EmbeddedFlowComponentType.Block: {\n if (component.components && component.components.length > 0) {\n const formStyles: CSSProperties = {\n display: 'flex',\n flexDirection: 'column',\n gap: `calc(${theme?.vars?.spacing?.unit ?? '4px'} * 2)`,\n };\n\n const blockComponents: any = component.components\n .map((childComponent: any, index: any) =>\n createAuthComponentFromFlow(\n childComponent,\n formValues,\n touchedFields,\n formErrors,\n isLoading,\n isFormValid,\n onInputChange,\n authType,\n {\n ...options,\n key: childComponent.id || `${component.id}_${index}`,\n },\n ),\n )\n .filter(Boolean);\n\n return (\n <form id={component.id} key={key} style={formStyles}>\n {blockComponents}\n </form>\n );\n }\n return null;\n }\n\n case EmbeddedFlowComponentType.RichText: {\n return (\n <div\n key={key}\n className={richTextClass}\n // Manually sanitizes with `DOMPurify`.\n // IMPORTANT: DO NOT REMOVE OR MODIFY THIS SANITIZATION STEP.\n dangerouslySetInnerHTML={{__html: DOMPurify.sanitize(resolveEmojiUrisInHtml(resolve(component.label)))}}\n />\n );\n }\n\n case EmbeddedFlowComponentType.Image: {\n const explicitHeight: string = resolve(component.height?.toString());\n const explicitWidth: string = resolve(component.width?.toString());\n return (\n <ImageComponent\n key={key}\n component={\n {\n config: {\n alt: resolve(component.alt) || resolve(component.label) || 'Image',\n height: explicitHeight || (options.inStack ? '50' : 'auto'),\n src: resolve(component.src),\n width: explicitWidth || (options.inStack ? '50' : '100%'),\n },\n } as any\n }\n formErrors={undefined!}\n formValues={undefined!}\n isFormValid={false}\n isLoading={false}\n onInputChange={(): void => {\n throw new Error('Function not implemented.');\n }}\n touchedFields={undefined!}\n />\n );\n }\n\n case EmbeddedFlowComponentType.Icon: {\n const iconName: string = component.name || '';\n const IconComponent: any = flowIconRegistry[iconName];\n if (!IconComponent) {\n logger.warn(`Unknown icon name: \"${iconName}\". Skipping render.`);\n return null;\n }\n return <IconComponent key={key} size={component.size || 24} color={component.color || 'currentColor'} />;\n }\n\n case EmbeddedFlowComponentType.Stack: {\n const direction: string = (component as any).direction || 'row';\n const gap: number = (component as any).gap ?? 2;\n const align: string = (component as any).align || 'center';\n const justify: string = (component as any).justify || 'flex-start';\n\n const stackStyle: CSSProperties = {\n alignItems: align,\n display: 'flex',\n flexDirection: direction as CSSProperties['flexDirection'],\n flexWrap: 'wrap',\n gap: `${gap * 0.5}rem`,\n justifyContent: justify,\n };\n\n const stackChildren: (ReactElement | null)[] = component.components\n ? component.components.map((childComponent: any, index: number) =>\n createAuthComponentFromFlow(\n childComponent,\n formValues,\n touchedFields,\n formErrors,\n isLoading,\n isFormValid,\n onInputChange,\n authType,\n {\n ...options,\n inStack: true,\n key: childComponent.id || `${component.id}_${index}`,\n },\n ),\n )\n : [];\n\n return (\n <div key={key} style={stackStyle}>\n {stackChildren}\n </div>\n );\n }\n\n case EmbeddedFlowComponentType.Consent: {\n const consentPromptRawData: ConsentPromptData | string | undefined = options.additionalData?.['consentPrompt'];\n\n return (\n <Consent\n key={key}\n consentData={consentPromptRawData as any}\n formValues={formValues}\n onInputChange={onInputChange}\n />\n );\n }\n\n case EmbeddedFlowComponentType.Timer: {\n const textTemplate: string = resolve((component as any).label) || 'Time remaining: {time}';\n const timeoutMs: number = Number(options.additionalData?.['stepTimeout']) || 0;\n const expiresIn: number = timeoutMs > 0 ? Math.max(0, Math.floor((timeoutMs - Date.now()) / 1000)) : 0;\n\n return <FlowTimer key={key} expiresIn={expiresIn} textTemplate={textTemplate} />;\n }\n\n case EmbeddedFlowComponentType.CopyableText: {\n const sourceKey: string | undefined = (component as any).source;\n const value: string = sourceKey && options.additionalData ? String(options.additionalData[sourceKey] ?? '') : '';\n const labelText: string | undefined = resolve((component as any).label) || undefined;\n\n return <CopyableText key={key} label={labelText} value={value} />;\n }\n\n default:\n // Gracefully handle unsupported component types by returning null\n logger.warn(`Unsupported component type: ${component.type}. Skipping render.`);\n return null;\n }\n};\n\n/**\n * Processes an array of components and renders them as React elements for sign-in.\n */\nexport const renderSignInComponents = (\n components: EmbeddedFlowComponent[],\n formValues: Record<string, string>,\n touchedFields: Record<string, boolean>,\n formErrors: Record<string, string>,\n isLoading: boolean,\n isFormValid: boolean,\n onInputChange: (name: string, value: string) => void,\n options?: {\n /** @internal */\n _customRenderers?: ComponentRendererMap;\n /** @internal */\n _theme?: any;\n /** Additional data from the flow response */\n additionalData?: Record<string, any>;\n buttonClassName?: string;\n inputClassName?: string;\n /** Flag to determine if the step timeline has expired */\n isTimeoutDisabled?: boolean;\n /** Flow metadata for resolving {{meta(...)}} expressions at render time */\n meta?: FlowMetadataResponse | null;\n onInputBlur?: (name: string) => void;\n onSubmit?: (component: EmbeddedFlowComponent, data?: Record<string, any>, skipValidation?: boolean) => void;\n size?: 'small' | 'medium' | 'large';\n /** Translation function for resolving {{t(...)}} expressions at render time */\n t?: UseTranslation['t'];\n variant?: any;\n },\n): ReactElement[] =>\n components\n .map((component: any, index: any) =>\n createAuthComponentFromFlow(\n component,\n formValues,\n touchedFields,\n formErrors,\n isLoading,\n isFormValid,\n onInputChange,\n 'signin',\n {\n ...options,\n key: component.id || index,\n },\n ),\n )\n .filter((x): x is ReactElement => x !== null);\n\n/**\n * Processes an array of components and renders them as React elements for sign-up.\n */\nexport const renderSignUpComponents = (\n components: EmbeddedFlowComponent[],\n formValues: Record<string, string>,\n touchedFields: Record<string, boolean>,\n formErrors: Record<string, string>,\n isLoading: boolean,\n isFormValid: boolean,\n onInputChange: (name: string, value: string) => void,\n options?: {\n /** @internal */\n _customRenderers?: ComponentRendererMap;\n /** @internal */\n _theme?: any;\n /** Additional data from the flow response */\n additionalData?: Record<string, any>;\n buttonClassName?: string;\n inputClassName?: string;\n /** Flow metadata for resolving {{meta(...)}} expressions at render time */\n meta?: FlowMetadataResponse | null;\n onInputBlur?: (name: string) => void;\n onSubmit?: (component: EmbeddedFlowComponent, data?: Record<string, any>, skipValidation?: boolean) => void;\n size?: 'small' | 'medium' | 'large';\n /** Translation function for resolving {{t(...)}} expressions at render time */\n t?: UseTranslation['t'];\n variant?: any;\n },\n): ReactElement[] =>\n components\n .map((component: any, index: any) =>\n createAuthComponentFromFlow(\n component,\n formValues,\n touchedFields,\n formErrors,\n isLoading,\n isFormValid,\n onInputChange,\n 'signup',\n {\n ...options,\n key: component.id || index,\n },\n ),\n )\n .filter((x): x is ReactElement => x !== null);\n\n/**\n * Processes an array of components and renders them as React elements for recovery flow.\n */\nexport const renderRecoveryComponents = (\n components: EmbeddedFlowComponent[],\n formValues: Record<string, string>,\n touchedFields: Record<string, boolean>,\n formErrors: Record<string, string>,\n isLoading: boolean,\n isFormValid: boolean,\n onInputChange: (name: string, value: string) => void,\n options?: {\n /** @internal */\n _customRenderers?: ComponentRendererMap;\n /** @internal */\n _theme?: any;\n /** Additional data from the flow response */\n additionalData?: Record<string, any>;\n buttonClassName?: string;\n inputClassName?: string;\n /** Flag to determine if the step timeline has expired */\n isTimeoutDisabled?: boolean;\n /** Flow metadata for resolving {{meta(...)}} expressions at render time */\n meta?: FlowMetadataResponse | null;\n onInputBlur?: (name: string) => void;\n onSubmit?: (component: EmbeddedFlowComponent, data?: Record<string, any>, skipValidation?: boolean) => void;\n size?: 'small' | 'medium' | 'large';\n /** Translation function for resolving {{t(...)}} expressions at render time */\n t?: UseTranslation['t'];\n variant?: any;\n },\n): ReactElement[] =>\n components\n .map((component: any, index: any) =>\n createAuthComponentFromFlow(\n component,\n formValues,\n touchedFields,\n formErrors,\n isLoading,\n isFormValid,\n onInputChange,\n 'recovery',\n {\n ...options,\n key: component.id || index,\n },\n ),\n )\n .filter((x): x is ReactElement => x !== null);\n\n/**\n * Processes an array of components and renders them as React elements for invite user.\n * This is used by both InviteUser and AcceptInvite components.\n */\nexport const renderInviteUserComponents = (\n components: EmbeddedFlowComponent[],\n formValues: Record<string, string>,\n touchedFields: Record<string, boolean>,\n formErrors: Record<string, string>,\n isLoading: boolean,\n isFormValid: boolean,\n onInputChange: (name: string, value: string) => void,\n options?: {\n /** @internal */\n _customRenderers?: ComponentRendererMap;\n /** @internal */\n _theme?: any;\n /** Additional data from the flow response */\n additionalData?: Record<string, any>;\n buttonClassName?: string;\n /** Function to fetch child organization units. Used by OU_SELECT component type. */\n fetchOrganizationUnitChildren?: (\n parentId: string,\n limit: number,\n offset: number,\n ) => Promise<OrganizationUnitListResponse>;\n inputClassName?: string;\n /** Flow metadata for resolving {{meta(...)}} expressions at render time */\n meta?: FlowMetadataResponse | null;\n onInputBlur?: (name: string) => void;\n onSubmit?: (component: EmbeddedFlowComponent, data?: Record<string, any>, skipValidation?: boolean) => void;\n size?: 'small' | 'medium' | 'large';\n /** Translation function for resolving {{t(...)}} expressions at render time */\n t?: UseTranslation['t'];\n variant?: any;\n },\n): ReactElement[] =>\n components\n .map((component: any, index: any) =>\n createAuthComponentFromFlow(\n component,\n formValues,\n touchedFields,\n formErrors,\n isLoading,\n isFormValid,\n onInputChange,\n 'signup',\n {\n ...options,\n key: component.id || index,\n },\n ),\n )\n .filter((x): x is ReactElement => x !== null);\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkEA,MAAMA,+DACJ,oBACA,oBACD;;;;;;;;;;AAYD,MAAMC,gBAAwB,iBAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgCjC,MAAM,gBAAgB,YAAkD;AACtE,SAAQ,SAAR;EACE,KAAKC,8CAA0B,WAC7B,QAAOC,8BAAU;EACnB,KAAKD,8CAA0B,WAC7B,QAAOC,8BAAU;EACnB,KAAKD,8CAA0B,cAC7B,QAAOC,8BAAU;EACnB,KAAKD,8CAA0B;EAC/B,QACE,QAAOC,8BAAU;;;;;;AAOvB,MAAM,wBAAwB,YAAyB;AAiBrD,QAhBuE;EACrE,QAAQ;EACR,QAAQ;EACR,aAAa;EACb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H,KAAK,UAAU,MAAM;CACtB,CACF,CACF,CACA,QAAQ,MAAyB,MAAM,KAAK;;;;AAKjD,MAAa,0BACX,YACA,YACA,eACA,YACA,WACA,aACA,eACA,YAmBA,WACG,KAAK,WAAgB,UACpB,4BACE,WACA,YACA,eACA,YACA,WACA,aACA,eACA,UACA;CACE,GAAG;CACH,KAAK,UAAU,MAAM;CACtB,CACF,CACF,CACA,QAAQ,MAAyB,MAAM,KAAK;;;;AAKjD,MAAa,4BACX,YACA,YACA,eACA,YACA,WACA,aACA,eACA,YAqBA,WACG,KAAK,WAAgB,UACpB,4BACE,WACA,YACA,eACA,YACA,WACA,aACA,eACA,YACA;CACE,GAAG;CACH,KAAK,UAAU,MAAM;CACtB,CACF,CACF,CACA,QAAQ,MAAyB,MAAM,KAAK;;;;;AAMjD,MAAa,8BACX,YACA,YACA,eACA,YACA,WACA,aACA,eACA,YAyBA,WACG,KAAK,WAAgB,UACpB,4BACE,WACA,YACA,eACA,YACA,WACA,aACA,eACA,UACA;CACE,GAAG;CACH,KAAK,UAAU,MAAM;CACtB,CACF,CACF,CACA,QAAQ,MAAyB,MAAM,KAAK"}
1
+ {"version":3,"file":"AuthOptionFactory.cjs","names":["logger: ReturnType<typeof createPackageComponentLogger>","richTextClass: string","EmbeddedFlowComponentType","FieldType","providerId: any","providerMatches: any","theme: any","customRenderers: ComponentRendererMap","key: string | number","customRenderer: ComponentRenderer | undefined","identifier: string","value: string","error: string","fieldType: string","createField","actionId: string","eventType: string","buttonText: string","componentVariant: string","shouldSkipValidation: boolean","EmbeddedFlowEventType","formData: Record<string, any>","consentPrompt: ConsentPromptData | undefined","isDeny: boolean","decisions: ConsentDecisions","getConsentOptionalKey","GoogleButton","GitHubButton","FacebookButton","MicrosoftButton","LinkedInButton","SignInWithEthereumButton","SmsOtpButton","startIconEl: ReactElement | null","endIconEl: ReactElement | null","Button","Typography","Divider","selectOptions: any","Select","DatePicker","formStyles: CSSProperties","blockComponents: any","DOMPurify","explicitHeight: string","explicitWidth: string","ImageComponent","iconName: string","IconComponent: any","flowIconRegistry","direction: string","gap: number","align: string","justify: string","consentPromptRawData: ConsentPromptData | string | undefined","Consent","textTemplate: string","timeoutMs: number","FlowTimer","sourceKey: string | undefined","CopyableText"],"sources":["../../../../../src/components/presentation/auth/AuthOptionFactory.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\nimport {css} from '@emotion/css';\nimport {\n FieldType,\n FlowMetadataResponse,\n EmbeddedFlowComponent,\n EmbeddedFlowComponentType,\n EmbeddedFlowTextVariant,\n EmbeddedFlowEventType,\n createPackageComponentLogger,\n resolveFlowTemplateLiterals,\n resolveEmojiUrisInHtml,\n ConsentPurposeData,\n ConsentPromptData,\n ConsentDecisions,\n ConsentPurposeDecision,\n ConsentAttributeElement,\n OrganizationUnitListResponse,\n} from '@thunderid/browser';\nimport DOMPurify from 'dompurify';\nimport {cloneElement, CSSProperties, ReactElement} from 'react';\nimport {\n ComponentRenderer,\n ComponentRenderContext,\n ComponentRendererMap,\n} from '../../../contexts/ComponentRenderer/ComponentRendererContext';\nimport {UseTranslation} from '../../../hooks/useTranslation';\nimport Consent from '../../adapters/Consent';\nimport {getConsentOptionalKey} from '../../adapters/ConsentCheckboxList';\nimport FacebookButton from '../../adapters/FacebookButton';\nimport FlowTimer from '../../adapters/FlowTimer';\nimport GitHubButton from '../../adapters/GitHubButton';\nimport GoogleButton from '../../adapters/GoogleButton';\nimport ImageComponent from '../../adapters/ImageComponent';\nimport LinkedInButton from '../../adapters/LinkedInButton';\nimport MicrosoftButton from '../../adapters/MicrosoftButton';\nimport SignInWithEthereumButton from '../../adapters/SignInWithEthereumButton';\nimport SmsOtpButton from '../../adapters/SmsOtpButton';\nimport {createField} from '../../factories/FieldFactory';\nimport Button from '../../primitives/Button/Button';\nimport CopyableText from '../../primitives/CopyableText/CopyableText';\nimport DatePicker from '../../primitives/DatePicker/DatePicker';\nimport Divider from '../../primitives/Divider/Divider';\nimport flowIconRegistry from '../../primitives/Icons/flowIconRegistry';\nimport Select from '../../primitives/Select/Select';\nimport Typography from '../../primitives/Typography/Typography';\nimport {TypographyVariant} from '../../primitives/Typography/Typography.styles';\n\nconst logger: ReturnType<typeof createPackageComponentLogger> = createPackageComponentLogger(\n '@thunderid/react',\n 'AuthOptionFactory',\n);\n\n/**\n * Replaces `emoji:` URIs embedded in HTML before DOMPurify sanitization.\n *\n * DOMPurify strips unknown URI schemes from attributes (e.g. `src=\"emoji:🦊\"` → `src=\"\"`).\n * This function converts:\n * - `<img src=\"emoji:X\" alt=\"Y\">` → `<span role=\"img\" aria-label=\"Y\">X</span>`\n * - Any remaining `emoji:X` text occurrences → `X`\n */\n\n/** Ensures rich-text content (including all inner elements from the server) always word-wraps. */\nconst richTextClass: string = css`\n overflow-wrap: anywhere;\n & * {\n overflow-wrap: anywhere;\n word-break: break-word;\n }\n & .rich-text-align-left {\n text-align: left;\n }\n & .rich-text-align-center {\n text-align: center;\n }\n & .rich-text-align-right {\n text-align: right;\n }\n & .rich-text-align-justify {\n text-align: justify;\n }\n & a,\n & .rich-text-link {\n text-decoration: underline;\n }\n & span[role='img'] {\n display: inline-block;\n }\n`;\n\nexport type AuthType = 'signin' | 'signup' | 'recovery';\n\n/**\n * Get the appropriate FieldType for an input component.\n */\nconst getFieldType = (variant: EmbeddedFlowComponentType): FieldType => {\n switch (variant) {\n case EmbeddedFlowComponentType.EmailInput:\n return FieldType.Email;\n case EmbeddedFlowComponentType.PhoneInput:\n return FieldType.Tel;\n case EmbeddedFlowComponentType.PasswordInput:\n return FieldType.Password;\n case EmbeddedFlowComponentType.TextInput:\n default:\n return FieldType.Text;\n }\n};\n\n/**\n * Get typography variant from component variant.\n */\nconst getTypographyVariant = (variant: string): any => {\n const variantMap: Record<EmbeddedFlowTextVariant, TypographyVariant> = {\n BODY_1: 'body1',\n BODY_2: 'body2',\n BUTTON_TEXT: 'button',\n CAPTION: 'caption',\n HEADING_1: 'h1',\n HEADING_2: 'h2',\n HEADING_3: 'h3',\n HEADING_4: 'h4',\n HEADING_5: 'h5',\n HEADING_6: 'h6',\n OVERLINE: 'overline',\n SUBTITLE_1: 'subtitle1',\n SUBTITLE_2: 'subtitle2',\n };\n\n return variantMap[variant] || 'h3';\n};\n\n/**\n * Check if a button text or action matches a social provider.\n */\nconst matchesSocialProvider = (\n actionId: string,\n eventType: string,\n buttonText: string,\n provider: string,\n authType: AuthType,\n /* eslint-disable-next-line @typescript-eslint/no-unused-vars */\n _componentVariant?: string,\n): boolean => {\n const providerId: any = `${provider}_auth`;\n const providerMatches: any = actionId === providerId || eventType === providerId;\n\n // Social buttons usually have \"Sign in with X\" or \"Continue with X\" text,\n // so also check button text for the provider name to increase chances of correct detection (especially for signup flows where action IDs are less standardized)\n if (buttonText.toLowerCase().includes(provider)) {\n return true;\n }\n\n // For signup, also check button text\n if (authType === 'signup') {\n return providerMatches || buttonText.toLowerCase().includes(provider);\n }\n\n return providerMatches;\n};\n\n/**\n * Create an auth component from flow component configuration.\n */\nconst createAuthComponentFromFlow = (\n component: EmbeddedFlowComponent,\n formValues: Record<string, string>,\n touchedFields: Record<string, boolean>,\n formErrors: Record<string, string>,\n isLoading: boolean,\n isFormValid: boolean,\n onInputChange: (name: string, value: string) => void,\n authType: AuthType,\n options: {\n /** @internal Passed from the host React component so hooks aren't called inside a loop. */\n _customRenderers?: ComponentRendererMap;\n /** @internal Passed from the host React component so hooks aren't called inside a loop. */\n _theme?: any;\n /** Additional data from the flow response, used for different dynamic data */\n additionalData?: Record<string, any>;\n buttonClassName?: string;\n /** Current consent purpose being rendered. Set by CONSENT_PURPOSE block iteration. */\n currentConsentPurpose?: ConsentPurposeData;\n inStack?: boolean;\n inputClassName?: string;\n /** Flag to determine if the step timeline has expired */\n isTimeoutDisabled?: boolean;\n key?: string | number;\n /** Flow metadata for resolving {{meta(...)}} expressions at render time */\n meta?: FlowMetadataResponse | null;\n onInputBlur?: (name: string) => void;\n onSubmit?: (component: EmbeddedFlowComponent, data?: Record<string, any>, skipValidation?: boolean) => void;\n size?: 'small' | 'medium' | 'large';\n /** Translation function for resolving {{t(...)}} expressions at render time */\n t?: UseTranslation['t'];\n variant?: any;\n } = {},\n): ReactElement | null => {\n const theme: any = options._theme;\n const customRenderers: ComponentRendererMap = options._customRenderers ?? {};\n\n const key: string | number = options.key || component.id;\n\n const customRenderer: ComponentRenderer | undefined =\n customRenderers[component.id] ?? customRenderers[component.type];\n if (customRenderer) {\n const renderCtx: ComponentRenderContext = {\n additionalData: options.additionalData,\n authType,\n formErrors,\n formValues,\n isFormValid,\n isLoading,\n meta: options.meta,\n onInputBlur: options.onInputBlur,\n onInputChange,\n onSubmit: options.onSubmit,\n touchedFields,\n };\n return customRenderer(component, renderCtx);\n }\n\n /** Resolve any remaining {{t()}} or {{meta()}} template expressions in a string at render time. */\n const resolve = (text: string | undefined): string => {\n if (!text || (!options.t && !options.meta)) {\n return text || '';\n }\n return resolveFlowTemplateLiterals(text, {meta: options.meta, t: options.t || ((k: string): string => k)});\n };\n\n switch (component.type) {\n case EmbeddedFlowComponentType.TextInput:\n case EmbeddedFlowComponentType.PasswordInput:\n case EmbeddedFlowComponentType.EmailInput:\n case EmbeddedFlowComponentType.PhoneInput: {\n const identifier: string = component.ref!;\n const value: string = formValues[identifier] || '';\n const isTouched: boolean = touchedFields[identifier] || false;\n const error: string = isTouched ? formErrors[identifier] : undefined!;\n const fieldType: string = getFieldType(component.type);\n\n const field: any = createField({\n className: options.inputClassName,\n error,\n label: resolve(component.label) || '',\n name: identifier,\n onBlur: () => options.onInputBlur?.(identifier),\n onChange: (newValue: string) => onInputChange(identifier, newValue),\n placeholder: resolve(component.placeholder) || '',\n required: component.required || false,\n type: fieldType as FieldType,\n value,\n });\n\n return cloneElement(field, {key});\n }\n\n case EmbeddedFlowComponentType.OtpInput: {\n const identifier: string = component.ref!;\n const value: string = formValues[identifier] || '';\n const isTouched: boolean = touchedFields[identifier] || false;\n const error: string = isTouched ? formErrors[identifier] : undefined!;\n\n const field: any = createField({\n className: options.inputClassName,\n error,\n label: resolve(component.label) || '',\n name: identifier,\n onBlur: () => options.onInputBlur?.(identifier),\n onChange: (newValue: string) => onInputChange(identifier, newValue),\n placeholder: resolve(component.placeholder) || '',\n required: component.required || false,\n type: FieldType.Otp,\n value,\n });\n\n return cloneElement(field, {key});\n }\n\n case EmbeddedFlowComponentType.Action: {\n const actionId: string = component.id;\n const eventType: string = component.eventType || '';\n const buttonText: string = resolve(component.label);\n const componentVariant: string = component.variant || '';\n\n // Only validate on submit type events.\n const shouldSkipValidation: boolean = eventType.toUpperCase() === EmbeddedFlowEventType.Trigger;\n\n const handleClick = (): any => {\n if (options.onSubmit) {\n const formData: Record<string, any> = {};\n Object.keys(formValues).forEach((field: any) => {\n // Include all values, even empty strings, to ensure proper submission\n formData[field] = formValues[field];\n });\n\n // For consent actions, build the consent_decisions JSON from the form values.\n // The allow action captures per-attribute choices; the deny action sends\n // all purposes as rejected so the backend ConsentExecutor can fail the flow.\n const consentPrompt: ConsentPromptData | undefined = options.additionalData?.['consentPrompt'] as\n | ConsentPromptData\n | undefined;\n if (consentPrompt && eventType.toUpperCase() === EmbeddedFlowEventType.Submit) {\n const isDeny: boolean = componentVariant.toLowerCase() !== 'primary';\n const decisions: ConsentDecisions = {\n purposes: consentPrompt.purposes.map(\n (p: ConsentPurposeData): ConsentPurposeDecision => ({\n approved: !isDeny,\n elements: [\n ...p.essential.map((e): ConsentAttributeElement => ({approved: !isDeny, name: e.name})),\n ...p.optional.map(\n (e): ConsentAttributeElement => ({\n approved: isDeny ? false : formValues[getConsentOptionalKey(p.purposeId, e.name)] !== 'false',\n name: e.name,\n }),\n ),\n ],\n purposeName: p.purposeName!,\n }),\n ),\n };\n formData['consent_decisions'] = JSON.stringify(decisions);\n }\n\n options.onSubmit(component, formData, shouldSkipValidation);\n }\n };\n\n // Render branded social login buttons for known action IDs\n\n if (matchesSocialProvider(actionId, eventType, buttonText, 'google', authType, componentVariant)) {\n return <GoogleButton key={key} onClick={handleClick} className={options.buttonClassName} />;\n }\n if (matchesSocialProvider(actionId, eventType, buttonText, 'github', authType, componentVariant)) {\n return <GitHubButton key={key} onClick={handleClick} className={options.buttonClassName} />;\n }\n if (matchesSocialProvider(actionId, eventType, buttonText, 'facebook', authType, componentVariant)) {\n return <FacebookButton key={key} onClick={handleClick} className={options.buttonClassName} />;\n }\n if (matchesSocialProvider(actionId, eventType, buttonText, 'microsoft', authType, componentVariant)) {\n return <MicrosoftButton key={key} onClick={handleClick} className={options.buttonClassName} />;\n }\n if (matchesSocialProvider(actionId, eventType, buttonText, 'linkedin', authType, componentVariant)) {\n return <LinkedInButton key={key} onClick={handleClick} className={options.buttonClassName} />;\n }\n if (matchesSocialProvider(actionId, eventType, buttonText, 'ethereum', authType, componentVariant)) {\n return <SignInWithEthereumButton key={key} onClick={handleClick} className={options.buttonClassName} />;\n }\n if (actionId === 'prompt_mobile' || eventType === 'prompt_mobile') {\n return <SmsOtpButton key={key} onClick={handleClick} className={options.buttonClassName} />;\n }\n\n const startIconEl: ReactElement | null = component.startIcon ? (\n <img\n src={component.startIcon}\n alt=\"\"\n aria-hidden=\"true\"\n style={{height: '1.25em', objectFit: 'contain', width: '1.25em'}}\n />\n ) : null;\n\n const endIconEl: ReactElement | null = component.endIcon ? (\n <img\n src={component.endIcon}\n alt=\"\"\n aria-hidden=\"true\"\n style={{height: '1.25em', objectFit: 'contain', width: '1.25em'}}\n />\n ) : null;\n\n return (\n <Button\n fullWidth\n key={key}\n onClick={handleClick}\n disabled={\n isLoading ||\n (!isFormValid && !shouldSkipValidation) ||\n options.isTimeoutDisabled ||\n (component as any).config?.disabled\n }\n className={options.buttonClassName}\n data-testid=\"thunderid-signin-submit\"\n variant={component.variant?.toLowerCase() === 'primary' ? 'solid' : 'outline'}\n color={component.variant?.toLowerCase() === 'primary' ? 'primary' : 'secondary'}\n startIcon={startIconEl}\n endIcon={endIconEl}\n >\n {buttonText || 'Submit'}\n </Button>\n );\n }\n\n case EmbeddedFlowComponentType.Text: {\n const variant: any = getTypographyVariant(component.variant!);\n return (\n <Typography\n key={key}\n variant={variant}\n style={{\n marginBottom: 2,\n textAlign:\n typeof component?.align === 'string' ? (component.align as React.CSSProperties['textAlign']) : 'left',\n }}\n >\n {resolve(component.label)}\n </Typography>\n );\n }\n\n case EmbeddedFlowComponentType.Divider: {\n return <Divider key={key}>{resolve(component.label) || ''}</Divider>;\n }\n\n case EmbeddedFlowComponentType.Select: {\n const identifier: string = component.ref!;\n const value: string = formValues[identifier] || '';\n const isTouched: boolean = touchedFields[identifier] || false;\n const error: string = isTouched ? formErrors[identifier] : undefined!;\n\n // Options are pre-sanitized by flowTransformer to {value: string, label: string} format\n const selectOptions: any = (component.options || []).map((opt: any) => ({\n label: typeof opt === 'string' ? opt : String(opt.label ?? opt.value ?? ''),\n value: typeof opt === 'string' ? opt : String(opt.value ?? ''),\n }));\n\n return (\n <Select\n key={key}\n name={identifier}\n label={resolve(component.label) || ''}\n placeholder={resolve(component.placeholder)}\n required={component.required}\n options={selectOptions}\n value={value}\n error={error}\n onChange={(e: any): void => onInputChange(identifier, e.target.value)}\n onBlur={(): any => options.onInputBlur?.(identifier)}\n className={options.inputClassName}\n />\n );\n }\n\n case EmbeddedFlowComponentType.DateInput: {\n const identifier: string = component.ref!;\n const value: string = formValues[identifier] || '';\n const isTouched: boolean = touchedFields[identifier] || false;\n const error: string = isTouched ? formErrors[identifier] : undefined!;\n\n return (\n <DatePicker\n key={key}\n name={identifier}\n label={resolve(component.label) || ''}\n placeholder={resolve(component.placeholder)}\n required={component.required}\n dateFormat={component.dateFormat}\n value={value}\n error={error}\n onChange={(e: any): void => onInputChange(identifier, e.target.value)}\n onBlur={(): any => options.onInputBlur?.(identifier)}\n className={options.inputClassName}\n />\n );\n }\n\n case EmbeddedFlowComponentType.OuSelect: {\n logger.warn('OU_SELECT component type is not supported. Skipping render.');\n return null;\n }\n\n case EmbeddedFlowComponentType.Block: {\n if (component.components && component.components.length > 0) {\n const formStyles: CSSProperties = {\n display: 'flex',\n flexDirection: 'column',\n gap: `calc(${theme?.vars?.spacing?.unit ?? '4px'} * 2)`,\n };\n\n const blockComponents: any = component.components\n .map((childComponent: any, index: any) =>\n createAuthComponentFromFlow(\n childComponent,\n formValues,\n touchedFields,\n formErrors,\n isLoading,\n isFormValid,\n onInputChange,\n authType,\n {\n ...options,\n key: childComponent.id || `${component.id}_${index}`,\n },\n ),\n )\n .filter(Boolean);\n\n return (\n <form id={component.id} key={key} style={formStyles}>\n {blockComponents}\n </form>\n );\n }\n return null;\n }\n\n case EmbeddedFlowComponentType.RichText: {\n return (\n <div\n key={key}\n className={richTextClass}\n // Manually sanitizes with `DOMPurify`.\n // IMPORTANT: DO NOT REMOVE OR MODIFY THIS SANITIZATION STEP.\n dangerouslySetInnerHTML={{__html: DOMPurify.sanitize(resolveEmojiUrisInHtml(resolve(component.label)))}}\n />\n );\n }\n\n case EmbeddedFlowComponentType.Image: {\n const explicitHeight: string = resolve(component.height?.toString());\n const explicitWidth: string = resolve(component.width?.toString());\n return (\n <ImageComponent\n key={key}\n component={\n {\n config: {\n alt: resolve(component.alt) || resolve(component.label) || 'Image',\n height: explicitHeight || (options.inStack ? '50' : 'auto'),\n src: resolve(component.src),\n width: explicitWidth || (options.inStack ? '50' : '100%'),\n },\n } as any\n }\n formErrors={undefined!}\n formValues={undefined!}\n isFormValid={false}\n isLoading={false}\n onInputChange={(): void => {\n throw new Error('Function not implemented.');\n }}\n touchedFields={undefined!}\n />\n );\n }\n\n case EmbeddedFlowComponentType.Icon: {\n const iconName: string = component.name || '';\n const IconComponent: any = flowIconRegistry[iconName];\n if (!IconComponent) {\n logger.warn(`Unknown icon name: \"${iconName}\". Skipping render.`);\n return null;\n }\n return <IconComponent key={key} size={component.size || 24} color={component.color || 'currentColor'} />;\n }\n\n case EmbeddedFlowComponentType.Stack: {\n const direction: string = (component as any).direction || 'row';\n const gap: number = (component as any).gap ?? 2;\n const align: string = (component as any).align || 'center';\n const justify: string = (component as any).justify || 'flex-start';\n\n const stackStyle: CSSProperties = {\n alignItems: align,\n display: 'flex',\n flexDirection: direction as CSSProperties['flexDirection'],\n flexWrap: 'wrap',\n gap: `${gap * 0.5}rem`,\n justifyContent: justify,\n };\n\n const stackChildren: (ReactElement | null)[] = component.components\n ? component.components.map((childComponent: any, index: number) =>\n createAuthComponentFromFlow(\n childComponent,\n formValues,\n touchedFields,\n formErrors,\n isLoading,\n isFormValid,\n onInputChange,\n authType,\n {\n ...options,\n inStack: true,\n key: childComponent.id || `${component.id}_${index}`,\n },\n ),\n )\n : [];\n\n return (\n <div key={key} style={stackStyle}>\n {stackChildren}\n </div>\n );\n }\n\n case EmbeddedFlowComponentType.Consent: {\n const consentPromptRawData: ConsentPromptData | string | undefined = options.additionalData?.['consentPrompt'];\n\n return (\n <Consent\n key={key}\n consentData={consentPromptRawData as any}\n formValues={formValues}\n onInputChange={onInputChange}\n />\n );\n }\n\n case EmbeddedFlowComponentType.Timer: {\n const textTemplate: string = resolve((component as any).label) || 'Time remaining: {time}';\n const timeoutMs: number = Number(options.additionalData?.['stepTimeout']) || 0;\n const expiresIn: number = timeoutMs > 0 ? Math.max(0, Math.floor((timeoutMs - Date.now()) / 1000)) : 0;\n\n return <FlowTimer key={key} expiresIn={expiresIn} textTemplate={textTemplate} />;\n }\n\n case EmbeddedFlowComponentType.CopyableText: {\n const sourceKey: string | undefined = (component as any).source;\n const value: string = sourceKey && options.additionalData ? String(options.additionalData[sourceKey] ?? '') : '';\n const labelText: string | undefined = resolve((component as any).label) || undefined;\n\n return <CopyableText key={key} label={labelText} value={value} />;\n }\n\n default:\n // Gracefully handle unsupported component types by returning null\n logger.warn(`Unsupported component type: ${component.type}. Skipping render.`);\n return null;\n }\n};\n\n/**\n * Processes an array of components and renders them as React elements for sign-in.\n */\nexport const renderSignInComponents = (\n components: EmbeddedFlowComponent[],\n formValues: Record<string, string>,\n touchedFields: Record<string, boolean>,\n formErrors: Record<string, string>,\n isLoading: boolean,\n isFormValid: boolean,\n onInputChange: (name: string, value: string) => void,\n options?: {\n /** @internal */\n _customRenderers?: ComponentRendererMap;\n /** @internal */\n _theme?: any;\n /** Additional data from the flow response */\n additionalData?: Record<string, any>;\n buttonClassName?: string;\n inputClassName?: string;\n /** Flag to determine if the step timeline has expired */\n isTimeoutDisabled?: boolean;\n /** Flow metadata for resolving {{meta(...)}} expressions at render time */\n meta?: FlowMetadataResponse | null;\n onInputBlur?: (name: string) => void;\n onSubmit?: (component: EmbeddedFlowComponent, data?: Record<string, any>, skipValidation?: boolean) => void;\n size?: 'small' | 'medium' | 'large';\n /** Translation function for resolving {{t(...)}} expressions at render time */\n t?: UseTranslation['t'];\n variant?: any;\n },\n): ReactElement[] =>\n components\n .map((component: any, index: any) =>\n createAuthComponentFromFlow(\n component,\n formValues,\n touchedFields,\n formErrors,\n isLoading,\n isFormValid,\n onInputChange,\n 'signin',\n {\n ...options,\n key: component.id || index,\n },\n ),\n )\n .filter((x): x is ReactElement => x !== null);\n\n/**\n * Processes an array of components and renders them as React elements for sign-up.\n */\nexport const renderSignUpComponents = (\n components: EmbeddedFlowComponent[],\n formValues: Record<string, string>,\n touchedFields: Record<string, boolean>,\n formErrors: Record<string, string>,\n isLoading: boolean,\n isFormValid: boolean,\n onInputChange: (name: string, value: string) => void,\n options?: {\n /** @internal */\n _customRenderers?: ComponentRendererMap;\n /** @internal */\n _theme?: any;\n /** Additional data from the flow response */\n additionalData?: Record<string, any>;\n buttonClassName?: string;\n inputClassName?: string;\n /** Flow metadata for resolving {{meta(...)}} expressions at render time */\n meta?: FlowMetadataResponse | null;\n onInputBlur?: (name: string) => void;\n onSubmit?: (component: EmbeddedFlowComponent, data?: Record<string, any>, skipValidation?: boolean) => void;\n size?: 'small' | 'medium' | 'large';\n /** Translation function for resolving {{t(...)}} expressions at render time */\n t?: UseTranslation['t'];\n variant?: any;\n },\n): ReactElement[] =>\n components\n .map((component: any, index: any) =>\n createAuthComponentFromFlow(\n component,\n formValues,\n touchedFields,\n formErrors,\n isLoading,\n isFormValid,\n onInputChange,\n 'signup',\n {\n ...options,\n key: component.id || index,\n },\n ),\n )\n .filter((x): x is ReactElement => x !== null);\n\n/**\n * Processes an array of components and renders them as React elements for recovery flow.\n */\nexport const renderRecoveryComponents = (\n components: EmbeddedFlowComponent[],\n formValues: Record<string, string>,\n touchedFields: Record<string, boolean>,\n formErrors: Record<string, string>,\n isLoading: boolean,\n isFormValid: boolean,\n onInputChange: (name: string, value: string) => void,\n options?: {\n /** @internal */\n _customRenderers?: ComponentRendererMap;\n /** @internal */\n _theme?: any;\n /** Additional data from the flow response */\n additionalData?: Record<string, any>;\n buttonClassName?: string;\n inputClassName?: string;\n /** Flag to determine if the step timeline has expired */\n isTimeoutDisabled?: boolean;\n /** Flow metadata for resolving {{meta(...)}} expressions at render time */\n meta?: FlowMetadataResponse | null;\n onInputBlur?: (name: string) => void;\n onSubmit?: (component: EmbeddedFlowComponent, data?: Record<string, any>, skipValidation?: boolean) => void;\n size?: 'small' | 'medium' | 'large';\n /** Translation function for resolving {{t(...)}} expressions at render time */\n t?: UseTranslation['t'];\n variant?: any;\n },\n): ReactElement[] =>\n components\n .map((component: any, index: any) =>\n createAuthComponentFromFlow(\n component,\n formValues,\n touchedFields,\n formErrors,\n isLoading,\n isFormValid,\n onInputChange,\n 'recovery',\n {\n ...options,\n key: component.id || index,\n },\n ),\n )\n .filter((x): x is ReactElement => x !== null);\n\n/**\n * Processes an array of components and renders them as React elements for invite user.\n * This is used by both InviteUser and AcceptInvite components.\n */\nexport const renderInviteUserComponents = (\n components: EmbeddedFlowComponent[],\n formValues: Record<string, string>,\n touchedFields: Record<string, boolean>,\n formErrors: Record<string, string>,\n isLoading: boolean,\n isFormValid: boolean,\n onInputChange: (name: string, value: string) => void,\n options?: {\n /** @internal */\n _customRenderers?: ComponentRendererMap;\n /** @internal */\n _theme?: any;\n /** Additional data from the flow response */\n additionalData?: Record<string, any>;\n buttonClassName?: string;\n /** Function to fetch child organization units for OU_SELECT components. */\n fetchOrganizationUnitChildren?: (\n parentId: string,\n limit: number,\n offset: number,\n ) => Promise<OrganizationUnitListResponse>;\n inputClassName?: string;\n /** Flow metadata for resolving {{meta(...)}} expressions at render time */\n meta?: FlowMetadataResponse | null;\n onInputBlur?: (name: string) => void;\n onSubmit?: (component: EmbeddedFlowComponent, data?: Record<string, any>, skipValidation?: boolean) => void;\n size?: 'small' | 'medium' | 'large';\n /** Translation function for resolving {{t(...)}} expressions at render time */\n t?: UseTranslation['t'];\n variant?: any;\n },\n): ReactElement[] =>\n components\n .map((component: any, index: any) =>\n createAuthComponentFromFlow(\n component,\n formValues,\n touchedFields,\n formErrors,\n isLoading,\n isFormValid,\n onInputChange,\n 'signup',\n {\n ...options,\n key: component.id || index,\n },\n ),\n )\n .filter((x): x is ReactElement => x !== null);\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiEA,MAAMA,+DACJ,oBACA,oBACD;;;;;;;;;;AAYD,MAAMC,gBAAwB,iBAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgCjC,MAAM,gBAAgB,YAAkD;AACtE,SAAQ,SAAR;EACE,KAAKC,8CAA0B,WAC7B,QAAOC,8BAAU;EACnB,KAAKD,8CAA0B,WAC7B,QAAOC,8BAAU;EACnB,KAAKD,8CAA0B,cAC7B,QAAOC,8BAAU;EACnB,KAAKD,8CAA0B;EAC/B,QACE,QAAOC,8BAAU;;;;;;AAOvB,MAAM,wBAAwB,YAAyB;AAiBrD,QAhBuE;EACrE,QAAQ;EACR,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AM;CACtB,CACF,CACF,CACA,QAAQ,MAAyB,MAAM,KAAK;;;;AAKjD,MAAa,4BACX,YACA,YACA,eACA,YACA,WACA,aACA,eACA,YAqBA,WACG,KAAK,WAAgB,UACpB,4BACE,WACA,YACA,eACA,YACA,WACA,aACA,eACA,YACA;CACE,GAAG;CACH,KAAK,UAAU,MAAM;CACtB,CACF,CACF,CACA,QAAQ,MAAyB,MAAM,KAAK;;;;;AAMjD,MAAa,8BACX,YACA,YACA,eACA,YACA,WACA,aACA,eACA,YAyBA,WACG,KAAK,WAAgB,UACpB,4BACE,WACA,YACA,eACA,YACA,WACA,aACA,eACA,UACA;CACE,GAAG;CACH,KAAK,UAAU,MAAM;CACtB,CACF,CACF,CACA,QAAQ,MAAyB,MAAM,KAAK"}
@@ -1 +1 @@
1
- {"version":3,"file":"ThemeContext.cjs","names":["ThemeContext: Context<ThemeContextValue | null>"],"sources":["../../../../src/contexts/Theme/ThemeContext.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\nimport {Theme} from '@thunderid/browser';\nimport {Context, createContext} from 'react';\n\nexport interface ThemeContextValue {\n /**\n * Error from branding theme fetch, if any\n */\n brandingError?: Error | null;\n colorScheme: 'light' | 'dark';\n /**\n * The text direction for the UI.\n */\n direction: 'ltr' | 'rtl';\n /**\n * Whether branding inheritance is enabled\n */\n inheritFromBranding?: boolean;\n /**\n * Whether branding theme is currently loading\n */\n isBrandingLoading?: boolean;\n theme: Theme;\n toggleTheme: () => void;\n}\n\nconst ThemeContext: Context<ThemeContextValue | null> = createContext<ThemeContextValue | null>(null);\n\nThemeContext.displayName = 'ThemeContext';\n\nexport default ThemeContext;\n"],"mappings":";;;;;AA2CA,MAAMA,wCAA0F,KAAK;AAErG,aAAa,cAAc;AAE3B,2BAAe"}
1
+ {"version":3,"file":"ThemeContext.cjs","names":["ThemeContext: Context<ThemeContextValue | null>"],"sources":["../../../../src/contexts/Theme/ThemeContext.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\nimport {Theme} from '@thunderid/browser';\nimport {Context, createContext} from 'react';\n\nexport interface ThemeContextValue {\n colorScheme: 'light' | 'dark';\n /**\n * The text direction for the UI.\n */\n direction: 'ltr' | 'rtl';\n theme: Theme;\n toggleTheme: () => void;\n}\n\nconst ThemeContext: Context<ThemeContextValue | null> = createContext<ThemeContextValue | null>(null);\n\nThemeContext.displayName = 'ThemeContext';\n\nexport default ThemeContext;\n"],"mappings":";;;;;AA+BA,MAAMA,wCAA0F,KAAK;AAErG,aAAa,cAAc;AAE3B,2BAAe"}
@@ -45,8 +45,8 @@ const ThemeProvider = ({ children, theme: themeOverrideProp }) => {
45
45
  const themeOverride = require_normalizeThemeConfig.default(themeOverrideProp);
46
46
  const flowMetaContext = (0, react.useContext)(require_FlowMetaContext.default);
47
47
  const flowMetaTheme = flowMetaContext?.meta?.design?.theme ?? null;
48
- const isLoading = flowMetaContext?.isLoading ?? false;
49
- const error = flowMetaContext?.error ?? null;
48
+ flowMetaContext?.isLoading;
49
+ flowMetaContext?.error;
50
50
  const [colorScheme, setColorScheme] = (0, react.useState)(() => flowMetaTheme?.defaultColorScheme ?? "light");
51
51
  (0, react.useEffect)(() => {
52
52
  if (flowMetaTheme?.defaultColorScheme) setColorScheme(flowMetaTheme.defaultColorScheme);
@@ -88,11 +88,8 @@ const ThemeProvider = ({ children, theme: themeOverrideProp }) => {
88
88
  if (typeof document !== "undefined") document.documentElement.dir = direction;
89
89
  }, [direction]);
90
90
  const value = {
91
- brandingError: error,
92
91
  colorScheme,
93
92
  direction,
94
- inheritFromBranding: false,
95
- isBrandingLoading: isLoading,
96
93
  theme,
97
94
  toggleTheme
98
95
  };
@@ -1 +1 @@
1
- {"version":3,"file":"ThemeProvider.cjs","names":["ThemeProvider: FC<PropsWithChildren<ThemeProviderProps>>","themeOverride: RecursivePartial<ThemeConfig> | undefined","normalizeThemeConfig","flowMetaContext: FlowMetaContextValue | null","FlowMetaContext","flowMetaTheme: FlowMetaTheme | null","isLoading: boolean","error: Error | null","toggleTheme: () => void","finalThemeConfig: RecursivePartial<ThemeConfig> | undefined","metaConfig: RecursivePartial<ThemeConfig>","buildThemeConfigFromFlowMeta","theme: Theme","direction: 'ltr' | 'rtl'","value: any","ThemeContext"],"sources":["../../../../src/contexts/Theme/ThemeProvider.tsx"],"sourcesContent":["/**\n * Copyright (c) 2026, 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\nimport {createTheme, Theme, ThemeConfig, ThemeMode, RecursivePartial, FlowMetaTheme} from '@thunderid/browser';\nimport {FC, PropsWithChildren, ReactElement, useCallback, useContext, useEffect, useMemo, useState} from 'react';\nimport ThemeContext from './ThemeContext';\nimport applyThemeToDOM from '../../utils/applyThemeToDOM';\nimport buildThemeConfigFromFlowMeta from '../../utils/buildThemeConfigFromFlowMeta';\nimport normalizeThemeConfig from '../../utils/normalizeThemeConfig';\nimport FlowMetaContext, {FlowMetaContextValue} from '../FlowMeta/FlowMetaContext';\n\nexport interface ThemeProviderProps {\n /**\n * When true, seeds the theme from the nearest BrandingContext if no flow meta theme is available.\n */\n inheritFromBranding?: boolean;\n\n /**\n * Initial color scheme override. Overrides the server default when provided.\n */\n mode?: ThemeMode;\n\n /**\n * Optional theme overrides merged on top of the server-side flow meta theme.\n * User-supplied values take highest precedence.\n */\n theme?: RecursivePartial<ThemeConfig>;\n}\n\n/**\n * ThemeProvider is the v2 drop-in replacement for `ThemeProvider`.\n *\n * It reads the design theme from the nearest `FlowMetaContext` (provided by\n * `FlowMetaProvider`) and publishes a resolved `Theme` object through the\n * **same** `ThemeContext` that `useTheme` consumes. This means all existing\n * components that call `useTheme` continue to work without any changes.\n *\n * The `defaultColorScheme` field returned by the server is used to seed the\n * active color scheme; the user can still toggle it locally via the\n * `toggleTheme` value exposed in the context.\n *\n * @example\n * ```tsx\n * <FlowMetaProvider config={{ baseUrl, type: FlowMetaType.App, id: appId }}>\n * <ThemeProvider>\n * <App /> {/* useTheme() works here as usual *\\/}\n * </ThemeProvider>\n * </FlowMetaProvider>\n * ```\n *\n * @example\n * With user theme overrides (user values win over server values):\n * ```tsx\n * <ThemeProvider theme={{ colors: { primary: { main: '#ff0000' } } }}>\n * <App />\n * </ThemeProvider>\n * ```\n */\nconst ThemeProvider: FC<PropsWithChildren<ThemeProviderProps>> = ({\n children,\n theme: themeOverrideProp,\n}: PropsWithChildren<ThemeProviderProps>): ReactElement => {\n const themeOverride: RecursivePartial<ThemeConfig> | undefined = normalizeThemeConfig(themeOverrideProp);\n const flowMetaContext: FlowMetaContextValue | null = useContext(FlowMetaContext);\n\n const flowMetaTheme: FlowMetaTheme | null = flowMetaContext?.meta?.design?.theme ?? null;\n const isLoading: boolean = flowMetaContext?.isLoading ?? false;\n const error: Error | null = flowMetaContext?.error ?? null;\n\n // Seed the color scheme from the server's defaultColorScheme; allow local toggling.\n const [colorScheme, setColorScheme] = useState<'light' | 'dark'>(() => flowMetaTheme?.defaultColorScheme ?? 'light');\n\n // When meta finishes loading, sync the color scheme with the server default.\n useEffect(() => {\n if (flowMetaTheme?.defaultColorScheme) {\n setColorScheme(flowMetaTheme.defaultColorScheme);\n }\n }, [flowMetaTheme?.defaultColorScheme]);\n\n const toggleTheme: () => void = useCallback(() => {\n setColorScheme((prev: 'light' | 'dark') => (prev === 'light' ? 'dark' : 'light'));\n }, []);\n\n // Build the resolved ThemeConfig: flow meta base → user overrides on top.\n const finalThemeConfig: RecursivePartial<ThemeConfig> | undefined = useMemo(() => {\n if (!flowMetaTheme) {\n return themeOverride;\n }\n\n const metaConfig: RecursivePartial<ThemeConfig> = buildThemeConfigFromFlowMeta(flowMetaTheme, colorScheme);\n\n if (!themeOverride) {\n return metaConfig;\n }\n\n return {\n ...metaConfig,\n ...themeOverride,\n borderRadius: {\n ...metaConfig.borderRadius,\n ...themeOverride.borderRadius,\n },\n colors: {\n ...metaConfig.colors,\n ...themeOverride.colors,\n },\n ...(metaConfig.typography || themeOverride.typography\n ? {\n typography: {\n ...(metaConfig as any).typography,\n ...themeOverride.typography,\n },\n }\n : {}),\n };\n }, [flowMetaTheme, colorScheme, themeOverride]);\n\n const theme: Theme = useMemo(\n () => createTheme(finalThemeConfig, colorScheme === 'dark'),\n [finalThemeConfig, colorScheme],\n );\n\n const direction: 'ltr' | 'rtl' = flowMetaTheme?.direction ?? 'ltr';\n\n // Apply CSS variables to the document root.\n useEffect(() => {\n applyThemeToDOM(theme);\n }, [theme]);\n\n // Apply text direction to the document root.\n useEffect(() => {\n if (typeof document !== 'undefined') {\n document.documentElement.dir = direction;\n }\n }, [direction]);\n\n const value: any = {\n brandingError: error,\n colorScheme,\n direction,\n inheritFromBranding: false,\n isBrandingLoading: isLoading,\n theme,\n toggleTheme,\n };\n\n return <ThemeContext.Provider value={value}>{children}</ThemeContext.Provider>;\n};\n\nexport default ThemeProvider;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAyEA,MAAMA,iBAA4D,EAChE,UACA,OAAO,wBACkD;CACzD,MAAMC,gBAA2DC,qCAAqB,kBAAkB;CACxG,MAAMC,wCAA0DC,gCAAgB;CAEhF,MAAMC,gBAAsC,iBAAiB,MAAM,QAAQ,SAAS;CACpF,MAAMC,YAAqB,iBAAiB,aAAa;CACzD,MAAMC,QAAsB,iBAAiB,SAAS;CAGtD,MAAM,CAAC,aAAa,4CAAmD,eAAe,sBAAsB,QAAQ;AAGpH,4BAAgB;AACd,MAAI,eAAe,mBACjB,gBAAe,cAAc,mBAAmB;IAEjD,CAAC,eAAe,mBAAmB,CAAC;CAEvC,MAAMC,2CAA4C;AAChD,kBAAgB,SAA4B,SAAS,UAAU,SAAS,QAAS;IAChF,EAAE,CAAC;CAGN,MAAMC,4CAA4E;AAChF,MAAI,CAAC,cACH,QAAO;EAGT,MAAMC,aAA4CC,6CAA6B,eAAe,YAAY;AAE1G,MAAI,CAAC,cACH,QAAO;AAGT,SAAO;GACL,GAAG;GACH,GAAG;GACH,cAAc;IACZ,GAAG,WAAW;IACd,GAAG,cAAc;IAClB;GACD,QAAQ;IACN,GAAG,WAAW;IACd,GAAG,cAAc;IAClB;GACD,GAAI,WAAW,cAAc,cAAc,aACvC,EACE,YAAY;IACV,GAAI,WAAmB;IACvB,GAAG,cAAc;IAClB,EACF,GACD,EAAE;GACP;IACA;EAAC;EAAe;EAAa;EAAc,CAAC;CAE/C,MAAMC,sEACc,kBAAkB,gBAAgB,OAAO,EAC3D,CAAC,kBAAkB,YAAY,CAChC;CAED,MAAMC,YAA2B,eAAe,aAAa;AAG7D,4BAAgB;AACd,kCAAgB,MAAM;IACrB,CAAC,MAAM,CAAC;AAGX,4BAAgB;AACd,MAAI,OAAO,aAAa,YACtB,UAAS,gBAAgB,MAAM;IAEhC,CAAC,UAAU,CAAC;CAEf,MAAMC,QAAa;EACjB,eAAe;EACf;EACA;EACA,qBAAqB;EACrB,mBAAmB;EACnB;EACA;EACD;AAED,QAAO,2CAACC,6BAAa;EAAgB;EAAQ;GAAiC;;AAGhF,4BAAe"}
1
+ {"version":3,"file":"ThemeProvider.cjs","names":["ThemeProvider: FC<PropsWithChildren<ThemeProviderProps>>","themeOverride: RecursivePartial<ThemeConfig> | undefined","normalizeThemeConfig","flowMetaContext: FlowMetaContextValue | null","FlowMetaContext","flowMetaTheme: FlowMetaTheme | null","toggleTheme: () => void","finalThemeConfig: RecursivePartial<ThemeConfig> | undefined","metaConfig: RecursivePartial<ThemeConfig>","buildThemeConfigFromFlowMeta","theme: Theme","direction: 'ltr' | 'rtl'","value: any","ThemeContext"],"sources":["../../../../src/contexts/Theme/ThemeProvider.tsx"],"sourcesContent":["/**\n * Copyright (c) 2026, 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\nimport {createTheme, Theme, ThemeConfig, ThemeMode, RecursivePartial, FlowMetaTheme} from '@thunderid/browser';\nimport {FC, PropsWithChildren, ReactElement, useCallback, useContext, useEffect, useMemo, useState} from 'react';\nimport ThemeContext from './ThemeContext';\nimport applyThemeToDOM from '../../utils/applyThemeToDOM';\nimport buildThemeConfigFromFlowMeta from '../../utils/buildThemeConfigFromFlowMeta';\nimport normalizeThemeConfig from '../../utils/normalizeThemeConfig';\nimport FlowMetaContext, {FlowMetaContextValue} from '../FlowMeta/FlowMetaContext';\n\nexport interface ThemeProviderProps {\n /**\n * Initial color scheme override. Overrides the server default when provided.\n */\n mode?: ThemeMode;\n\n /**\n * Optional theme overrides merged on top of the server-side flow meta theme.\n * User-supplied values take highest precedence.\n */\n theme?: RecursivePartial<ThemeConfig>;\n}\n\n/**\n * ThemeProvider is the v2 drop-in replacement for `ThemeProvider`.\n *\n * It reads the design theme from the nearest `FlowMetaContext` (provided by\n * `FlowMetaProvider`) and publishes a resolved `Theme` object through the\n * **same** `ThemeContext` that `useTheme` consumes. This means all existing\n * components that call `useTheme` continue to work without any changes.\n *\n * The `defaultColorScheme` field returned by the server is used to seed the\n * active color scheme; the user can still toggle it locally via the\n * `toggleTheme` value exposed in the context.\n *\n * @example\n * ```tsx\n * <FlowMetaProvider config={{ baseUrl, type: FlowMetaType.App, id: appId }}>\n * <ThemeProvider>\n * <App /> {/* useTheme() works here as usual *\\/}\n * </ThemeProvider>\n * </FlowMetaProvider>\n * ```\n *\n * @example\n * With user theme overrides (user values win over server values):\n * ```tsx\n * <ThemeProvider theme={{ colors: { primary: { main: '#ff0000' } } }}>\n * <App />\n * </ThemeProvider>\n * ```\n */\nconst ThemeProvider: FC<PropsWithChildren<ThemeProviderProps>> = ({\n children,\n theme: themeOverrideProp,\n}: PropsWithChildren<ThemeProviderProps>): ReactElement => {\n const themeOverride: RecursivePartial<ThemeConfig> | undefined = normalizeThemeConfig(themeOverrideProp);\n const flowMetaContext: FlowMetaContextValue | null = useContext(FlowMetaContext);\n\n const flowMetaTheme: FlowMetaTheme | null = flowMetaContext?.meta?.design?.theme ?? null;\n const isLoading: boolean = flowMetaContext?.isLoading ?? false;\n const error: Error | null = flowMetaContext?.error ?? null;\n\n // Seed the color scheme from the server's defaultColorScheme; allow local toggling.\n const [colorScheme, setColorScheme] = useState<'light' | 'dark'>(() => flowMetaTheme?.defaultColorScheme ?? 'light');\n\n // When meta finishes loading, sync the color scheme with the server default.\n useEffect(() => {\n if (flowMetaTheme?.defaultColorScheme) {\n setColorScheme(flowMetaTheme.defaultColorScheme);\n }\n }, [flowMetaTheme?.defaultColorScheme]);\n\n const toggleTheme: () => void = useCallback(() => {\n setColorScheme((prev: 'light' | 'dark') => (prev === 'light' ? 'dark' : 'light'));\n }, []);\n\n // Build the resolved ThemeConfig: flow meta base → user overrides on top.\n const finalThemeConfig: RecursivePartial<ThemeConfig> | undefined = useMemo(() => {\n if (!flowMetaTheme) {\n return themeOverride;\n }\n\n const metaConfig: RecursivePartial<ThemeConfig> = buildThemeConfigFromFlowMeta(flowMetaTheme, colorScheme);\n\n if (!themeOverride) {\n return metaConfig;\n }\n\n return {\n ...metaConfig,\n ...themeOverride,\n borderRadius: {\n ...metaConfig.borderRadius,\n ...themeOverride.borderRadius,\n },\n colors: {\n ...metaConfig.colors,\n ...themeOverride.colors,\n },\n ...(metaConfig.typography || themeOverride.typography\n ? {\n typography: {\n ...(metaConfig as any).typography,\n ...themeOverride.typography,\n },\n }\n : {}),\n };\n }, [flowMetaTheme, colorScheme, themeOverride]);\n\n const theme: Theme = useMemo(\n () => createTheme(finalThemeConfig, colorScheme === 'dark'),\n [finalThemeConfig, colorScheme],\n );\n\n const direction: 'ltr' | 'rtl' = flowMetaTheme?.direction ?? 'ltr';\n\n // Apply CSS variables to the document root.\n useEffect(() => {\n applyThemeToDOM(theme);\n }, [theme]);\n\n // Apply text direction to the document root.\n useEffect(() => {\n if (typeof document !== 'undefined') {\n document.documentElement.dir = direction;\n }\n }, [direction]);\n\n const value: any = {\n colorScheme,\n direction,\n theme,\n toggleTheme,\n };\n\n return <ThemeContext.Provider value={value}>{children}</ThemeContext.Provider>;\n};\n\nexport default ThemeProvider;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoEA,MAAMA,iBAA4D,EAChE,UACA,OAAO,wBACkD;CACzD,MAAMC,gBAA2DC,qCAAqB,kBAAkB;CACxG,MAAMC,wCAA0DC,gCAAgB;CAEhF,MAAMC,gBAAsC,iBAAiB,MAAM,QAAQ,SAAS;AACzD,kBAAiB;AAChB,kBAAiB;CAG7C,MAAM,CAAC,aAAa,4CAAmD,eAAe,sBAAsB,QAAQ;AAGpH,4BAAgB;AACd,MAAI,eAAe,mBACjB,gBAAe,cAAc,mBAAmB;IAEjD,CAAC,eAAe,mBAAmB,CAAC;CAEvC,MAAMC,2CAA4C;AAChD,kBAAgB,SAA4B,SAAS,UAAU,SAAS,QAAS;IAChF,EAAE,CAAC;CAGN,MAAMC,4CAA4E;AAChF,MAAI,CAAC,cACH,QAAO;EAGT,MAAMC,aAA4CC,6CAA6B,eAAe,YAAY;AAE1G,MAAI,CAAC,cACH,QAAO;AAGT,SAAO;GACL,GAAG;GACH,GAAG;GACH,cAAc;IACZ,GAAG,WAAW;IACd,GAAG,cAAc;IAClB;GACD,QAAQ;IACN,GAAG,WAAW;IACd,GAAG,cAAc;IAClB;GACD,GAAI,WAAW,cAAc,cAAc,aACvC,EACE,YAAY;IACV,GAAI,WAAmB;IACvB,GAAG,cAAc;IAClB,EACF,GACD,EAAE;GACP;IACA;EAAC;EAAe;EAAa;EAAc,CAAC;CAE/C,MAAMC,sEACc,kBAAkB,gBAAgB,OAAO,EAC3D,CAAC,kBAAkB,YAAY,CAChC;CAED,MAAMC,YAA2B,eAAe,aAAa;AAG7D,4BAAgB;AACd,kCAAgB,MAAM;IACrB,CAAC,MAAM,CAAC;AAGX,4BAAgB;AACd,MAAI,OAAO,aAAa,YACtB,UAAS,gBAAgB,MAAM;IAEhC,CAAC,UAAU,CAAC;CAEf,MAAMC,QAAa;EACjB;EACA;EACA;EACA;EACD;AAED,QAAO,2CAACC,6BAAa;EAAgB;EAAQ;GAAiC;;AAGhF,4BAAe"}
@@ -29,7 +29,6 @@ const ThunderIDContext = (0, react.createContext)({
29
29
  isMetaLoading: false,
30
30
  isSignedIn: false,
31
31
  meta: null,
32
- organization: null,
33
32
  organizationHandle: void 0,
34
33
  reInitialize: null,
35
34
  recover: () => Promise.resolve({}),
@@ -40,7 +39,6 @@ const ThunderIDContext = (0, react.createContext)({
40
39
  signOut: () => Promise.resolve({}),
41
40
  signUp: () => Promise.resolve({}),
42
41
  signUpUrl: void 0,
43
- switchOrganization: null,
44
42
  user: null
45
43
  });
46
44
  ThunderIDContext.displayName = "ThunderIDContext";
@@ -1 +1 @@
1
- {"version":3,"file":"ThunderIDContext.cjs","names":["ThunderIDContext: Context<ThunderIDContextProps | null>"],"sources":["../../../../src/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\nimport {\n FlowMetadataResponse,\n HttpRequestConfig,\n HttpResponse,\n IdToken,\n OIDCDiscoveryApiResponse,\n Organization,\n SignInOptions,\n TokenExchangeRequestConfig,\n TokenResponse,\n} from '@thunderid/browser';\nimport {Context, createContext} from 'react';\nimport {ThunderIDReactConfig} from '../../models/config';\nimport ThunderIDReactClient from '../../ThunderIDReactClient';\n\n/**\n * Props interface of {@link ThunderIDContext}\n */\nexport type ThunderIDContextProps = {\n afterSignInUrl: string | undefined;\n applicationId: string | undefined;\n baseUrl: string | undefined;\n clientId: string | undefined;\n scopes: string | string[] | undefined;\n /**\n * OIDC discovery data.\n */\n discovery: {\n /**\n * The response from the `.well-known/openid-configuration` endpoint.\n * Contains server capabilities, supported endpoints, and metadata.\n * `null` while loading or when discovery has not been fetched.\n */\n wellKnown: OIDCDiscoveryApiResponse | null;\n };\n /**\n * Swaps the current access token with a new one based on the provided configuration (with a grant type).\n * @param config - Configuration for the token exchange request.\n * @returns A promise that resolves to the token response or the raw response.\n */\n exchangeToken: (config: TokenExchangeRequestConfig) => Promise<TokenResponse | Response>;\n /**\n * Retrieves the access token stored in the storage.\n * This function retrieves the access token and returns it.\n * @remarks This does not work in the `webWorker` or any other worker environment.\n * @returns A promise that resolves to the access token.\n */\n getAccessToken: () => Promise<string>;\n /**\n * Function to retrieve the decoded ID token.\n * This function decodes the ID token and returns its payload.\n * It can be used to access user claims and other information contained in the ID token.\n *\n * @returns A promise that resolves to the decoded ID token payload.\n */\n getDecodedIdToken: () => Promise<IdToken>;\n /**\n * Function to retrieve the ID token.\n * This function retrieves the ID token and returns it.\n *\n * @returns A promise that resolves to the ID token.\n */\n getIdToken: () => Promise<string>;\n /**\n * Returns the underlying StorageManager instance for reading and writing SDK-managed storage.\n */\n getStorageManager: () => Promise<any>;\n /**\n * HTTP request function to make API calls.\n * @param requestConfig - Configuration for the HTTP request.\n * @returns A promise that resolves to the HTTP response.\n */\n http: {\n /**\n * Makes an HTTP request using the provided configuration.\n * @param requestConfig - Configuration for the HTTP request.\n * @returns A promise that resolves to the HTTP response.\n */\n request: (requestConfig?: HttpRequestConfig) => Promise<HttpResponse<any>>;\n /**\n * Makes multiple HTTP requests based on the provided configuration.\n * @param requestConfigs - Set of configurations for the HTTP requests.\n * @returns A promise that resolves to an array of HTTP responses.\n */\n requestAll: (requestConfigs?: HttpRequestConfig[]) => Promise<HttpResponse<any>[]>;\n };\n /**\n * Instance ID for multi-instance support.\n */\n instanceId: number;\n isInitialized: boolean;\n /**\n * Flag indicating whether the SDK is working in the background.\n */\n isLoading: boolean;\n /**\n * Flag indicating whether flow metadata is currently being fetched.\n */\n isMetaLoading: boolean;\n /**\n * Flag indicating whether the user is signed in or not.\n */\n isSignedIn: boolean;\n\n /**\n * Flow metadata returned by `GET /flow/meta` (v2 platform only).\n * `null` while loading or when `resolveFromMeta` is disabled.\n */\n meta: FlowMetadataResponse | null;\n\n organization: Organization;\n\n organizationHandle: string | undefined;\n\n /**\n * Re-initializes the client with a new configuration.\n *\n * @remarks\n * This can be partial configuration to update only specific fields.\n *\n * @param config - New configuration to re-initialize the client with.\n * @returns Promise resolving to boolean indicating success.\n */\n reInitialize: (config: Partial<ThunderIDReactConfig>) => Promise<boolean>;\n\n /**\n * Recovery function to initiate the account/password recovery flow.\n */\n recover: (...args: any[]) => Promise<any>;\n\n /**\n * Resolves `{{ t(key) }}` and `{{ meta(path) }}` template expressions in a string,\n * using the current i18n translation function and flow metadata from context.\n *\n * Useful in render-props patterns where consumers need to expand template strings\n * that come from the server (e.g. component labels, placeholders, headings).\n *\n * @example\n * const {resolveFlowTemplateLiterals} = useThunderID();\n * resolveFlowTemplateLiterals('{{ t(signin.heading.label) }}') // → 'Sign In'\n * resolveFlowTemplateLiterals('Login to {{ meta(application.name) }}') // → 'Login to My App'\n */\n resolveFlowTemplateLiterals: (text: string | undefined) => string;\n\n /**\n * Sign-in function to initiate the authentication process.\n * @remark This is the programmatic version of the `SignInButton` component.\n * TODO: Fix the types.\n */\n signIn: (...args: any) => Promise<any>;\n\n /**\n * Optional additional parameters to be sent in the sign-in request.\n * This can include custom parameters that your authorization server supports.\n * These parameters will be included in the authorization request sent to the server.\n * If not provided, no additional parameters will be sent.\n *\n * @example\n * signInOptions: { prompt: \"login\", fidp: \"OrganizationSSO\" }\n */\n signInOptions?: SignInOptions;\n\n /**\n * Optional token request configuration. params are appended to the token endpoint POST body.\n *\n * @example\n * tokenRequest: { params: { resource: \"https://api.example.com\" } }\n */\n tokenRequest?: {\n params?: Record<string, unknown>;\n };\n\n /**\n * Silent sign-in function to re-authenticate the user without user interaction.\n * @remark This is the programmatic version of the `SilentSignIn` component.\n */\n signInSilently: ThunderIDReactClient['signInSilently'];\n\n signInUrl: string | undefined;\n /**\n * Sign-out function to terminate the authentication session.\n * @remark This is the programmatic version of the `SignOutButton` component.\n * FIXME: Fix the types.\n */\n signOut: any;\n\n /**\n * Sign-up function to initiate the registration process.\n * @remark This is the programmatic version of the `SignUpButton` component.\n */\n signUp: (...args: any[]) => Promise<any>;\n\n signUpUrl: string | undefined;\n\n user: any;\n} & Pick<ThunderIDReactClient, 'clearSession' | 'switchOrganization'>;\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: () => {},\n clientId: undefined,\n scopes: undefined,\n discovery: {\n wellKnown: null,\n },\n exchangeToken: null as unknown as ThunderIDContextProps['exchangeToken'],\n getAccessToken: null as unknown as ThunderIDContextProps['getAccessToken'],\n getDecodedIdToken: null as unknown as ThunderIDContextProps['getDecodedIdToken'],\n getIdToken: null as unknown as ThunderIDContextProps['getIdToken'],\n getStorageManager: () => Promise.resolve(null),\n http: {\n request: () => null as unknown as Promise<HttpResponse<any>>,\n requestAll: () => null as unknown as Promise<HttpResponse<any>[]>,\n },\n instanceId: 0,\n isInitialized: false,\n isLoading: true,\n isMetaLoading: false,\n isSignedIn: false,\n meta: null,\n organization: null as unknown as Organization,\n organizationHandle: undefined,\n reInitialize: null as unknown as ThunderIDContextProps['reInitialize'],\n recover: () => Promise.resolve({} as any),\n resolveFlowTemplateLiterals: (text: string | undefined) => text ?? '',\n signIn: () => Promise.resolve({} as any),\n signInSilently: () => Promise.resolve({} as any),\n signInUrl: undefined,\n signOut: () => Promise.resolve({} as any),\n signUp: () => Promise.resolve({} as any),\n signUpUrl: undefined,\n switchOrganization: null as unknown as ThunderIDContextProps['switchOrganization'],\n user: null,\n});\n\nThunderIDContext.displayName = 'ThunderIDContext';\n\nexport default ThunderIDContext;\n"],"mappings":";;;;;;;;AA0NA,MAAMA,4CAAsG;CAC1G,gBAAgB;CAChB,eAAe;CACf,SAAS;CACT,oBAAoB;CACpB,UAAU;CACV,QAAQ;CACR,WAAW,EACT,WAAW,MACZ;CACD,eAAe;CACf,gBAAgB;CAChB,mBAAmB;CACnB,YAAY;CACZ,yBAAyB,QAAQ,QAAQ,KAAK;CAC9C,MAAM;EACJ,eAAe;EACf,kBAAkB;EACnB;CACD,YAAY;CACZ,eAAe;CACf,WAAW;CACX,eAAe;CACf,YAAY;CACZ,MAAM;CACN,cAAc;CACd,oBAAoB;CACpB,cAAc;CACd,eAAe,QAAQ,QAAQ,EAAE,CAAQ;CACzC,8BAA8B,SAA6B,QAAQ;CACnE,cAAc,QAAQ,QAAQ,EAAE,CAAQ;CACxC,sBAAsB,QAAQ,QAAQ,EAAE,CAAQ;CAChD,WAAW;CACX,eAAe,QAAQ,QAAQ,EAAE,CAAQ;CACzC,cAAc,QAAQ,QAAQ,EAAE,CAAQ;CACxC,WAAW;CACX,oBAAoB;CACpB,MAAM;CACP,CAAC;AAEF,iBAAiB,cAAc;AAE/B,+BAAe"}
1
+ {"version":3,"file":"ThunderIDContext.cjs","names":["ThunderIDContext: Context<ThunderIDContextProps | null>"],"sources":["../../../../src/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\nimport {\n FlowMetadataResponse,\n HttpRequestConfig,\n HttpResponse,\n IdToken,\n OIDCDiscoveryApiResponse,\n SignInOptions,\n TokenExchangeRequestConfig,\n TokenResponse,\n} from '@thunderid/browser';\nimport {Context, createContext} from 'react';\nimport {ThunderIDReactConfig} from '../../models/config';\nimport ThunderIDReactClient from '../../ThunderIDReactClient';\n\n/**\n * Props interface of {@link ThunderIDContext}\n */\nexport type ThunderIDContextProps = {\n afterSignInUrl: string | undefined;\n applicationId: string | undefined;\n baseUrl: string | undefined;\n clientId: string | undefined;\n scopes: string | string[] | undefined;\n /**\n * OIDC discovery data.\n */\n discovery: {\n /**\n * The response from the `.well-known/openid-configuration` endpoint.\n * Contains server capabilities, supported endpoints, and metadata.\n * `null` while loading or when discovery has not been fetched.\n */\n wellKnown: OIDCDiscoveryApiResponse | null;\n };\n /**\n * Swaps the current access token with a new one based on the provided configuration (with a grant type).\n * @param config - Configuration for the token exchange request.\n * @returns A promise that resolves to the token response or the raw response.\n */\n exchangeToken: (config: TokenExchangeRequestConfig) => Promise<TokenResponse | Response>;\n /**\n * Retrieves the access token stored in the storage.\n * This function retrieves the access token and returns it.\n * @remarks This does not work in the `webWorker` or any other worker environment.\n * @returns A promise that resolves to the access token.\n */\n getAccessToken: () => Promise<string>;\n /**\n * Function to retrieve the decoded ID token.\n * This function decodes the ID token and returns its payload.\n * It can be used to access user claims and other information contained in the ID token.\n *\n * @returns A promise that resolves to the decoded ID token payload.\n */\n getDecodedIdToken: () => Promise<IdToken>;\n /**\n * Function to retrieve the ID token.\n * This function retrieves the ID token and returns it.\n *\n * @returns A promise that resolves to the ID token.\n */\n getIdToken: () => Promise<string>;\n /**\n * Returns the underlying StorageManager instance for reading and writing SDK-managed storage.\n */\n getStorageManager: () => Promise<any>;\n /**\n * HTTP request function to make API calls.\n * @param requestConfig - Configuration for the HTTP request.\n * @returns A promise that resolves to the HTTP response.\n */\n http: {\n /**\n * Makes an HTTP request using the provided configuration.\n * @param requestConfig - Configuration for the HTTP request.\n * @returns A promise that resolves to the HTTP response.\n */\n request: (requestConfig?: HttpRequestConfig) => Promise<HttpResponse<any>>;\n /**\n * Makes multiple HTTP requests based on the provided configuration.\n * @param requestConfigs - Set of configurations for the HTTP requests.\n * @returns A promise that resolves to an array of HTTP responses.\n */\n requestAll: (requestConfigs?: HttpRequestConfig[]) => Promise<HttpResponse<any>[]>;\n };\n /**\n * Instance ID for multi-instance support.\n */\n instanceId: number;\n isInitialized: boolean;\n /**\n * Flag indicating whether the SDK is working in the background.\n */\n isLoading: boolean;\n /**\n * Flag indicating whether flow metadata is currently being fetched.\n */\n isMetaLoading: boolean;\n /**\n * Flag indicating whether the user is signed in or not.\n */\n isSignedIn: boolean;\n\n /**\n * Flow metadata returned by `GET /flow/meta` (v2 platform only).\n * `null` while loading or when `resolveFromMeta` is disabled.\n */\n meta: FlowMetadataResponse | null;\n\n organizationHandle: string | undefined;\n\n /**\n * Re-initializes the client with a new configuration.\n *\n * @remarks\n * This can be partial configuration to update only specific fields.\n *\n * @param config - New configuration to re-initialize the client with.\n * @returns Promise resolving to boolean indicating success.\n */\n reInitialize: (config: Partial<ThunderIDReactConfig>) => Promise<boolean>;\n\n /**\n * Recovery function to initiate the account/password recovery flow.\n */\n recover: (...args: any[]) => Promise<any>;\n\n /**\n * Resolves `{{ t(key) }}` and `{{ meta(path) }}` template expressions in a string,\n * using the current i18n translation function and flow metadata from context.\n *\n * Useful in render-props patterns where consumers need to expand template strings\n * that come from the server (e.g. component labels, placeholders, headings).\n *\n * @example\n * const {resolveFlowTemplateLiterals} = useThunderID();\n * resolveFlowTemplateLiterals('{{ t(signin.heading.label) }}') // → 'Sign In'\n * resolveFlowTemplateLiterals('Login to {{ meta(application.name) }}') // → 'Login to My App'\n */\n resolveFlowTemplateLiterals: (text: string | undefined) => string;\n\n /**\n * Sign-in function to initiate the authentication process.\n * @remark This is the programmatic version of the `SignInButton` component.\n * TODO: Fix the types.\n */\n signIn: (...args: any) => Promise<any>;\n\n /**\n * Optional additional parameters to be sent in the sign-in request.\n * This can include custom parameters that your authorization server supports.\n * These parameters will be included in the authorization request sent to the server.\n * If not provided, no additional parameters will be sent.\n *\n * @example\n * signInOptions: { prompt: \"login\", fidp: \"OrganizationSSO\" }\n */\n signInOptions?: SignInOptions;\n\n /**\n * Optional token request configuration. params are appended to the token endpoint POST body.\n *\n * @example\n * tokenRequest: { params: { resource: \"https://api.example.com\" } }\n */\n tokenRequest?: {\n params?: Record<string, unknown>;\n };\n\n /**\n * Silent sign-in function to re-authenticate the user without user interaction.\n * @remark This is the programmatic version of the `SilentSignIn` component.\n */\n signInSilently: ThunderIDReactClient['signInSilently'];\n\n signInUrl: string | undefined;\n /**\n * Sign-out function to terminate the authentication session.\n * @remark This is the programmatic version of the `SignOutButton` component.\n * FIXME: Fix the types.\n */\n signOut: any;\n\n /**\n * Sign-up function to initiate the registration process.\n * @remark This is the programmatic version of the `SignUpButton` component.\n */\n signUp: (...args: any[]) => Promise<any>;\n\n signUpUrl: string | undefined;\n\n user: any;\n} & Pick<ThunderIDReactClient, 'clearSession'>;\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: () => {},\n clientId: undefined,\n scopes: undefined,\n discovery: {\n wellKnown: null,\n },\n exchangeToken: null as unknown as ThunderIDContextProps['exchangeToken'],\n getAccessToken: null as unknown as ThunderIDContextProps['getAccessToken'],\n getDecodedIdToken: null as unknown as ThunderIDContextProps['getDecodedIdToken'],\n getIdToken: null as unknown as ThunderIDContextProps['getIdToken'],\n getStorageManager: () => Promise.resolve(null),\n http: {\n request: () => null as unknown as Promise<HttpResponse<any>>,\n requestAll: () => null as unknown as Promise<HttpResponse<any>[]>,\n },\n instanceId: 0,\n isInitialized: false,\n isLoading: true,\n isMetaLoading: false,\n isSignedIn: false,\n meta: null,\n organizationHandle: undefined,\n reInitialize: null as unknown as ThunderIDContextProps['reInitialize'],\n recover: () => Promise.resolve({} as any),\n resolveFlowTemplateLiterals: (text: string | undefined) => text ?? '',\n signIn: () => Promise.resolve({} as any),\n signInSilently: () => 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":";;;;;;;;AAuNA,MAAMA,4CAAsG;CAC1G,gBAAgB;CAChB,eAAe;CACf,SAAS;CACT,oBAAoB;CACpB,UAAU;CACV,QAAQ;CACR,WAAW,EACT,WAAW,MACZ;CACD,eAAe;CACf,gBAAgB;CAChB,mBAAmB;CACnB,YAAY;CACZ,yBAAyB,QAAQ,QAAQ,KAAK;CAC9C,MAAM;EACJ,eAAe;EACf,kBAAkB;EACnB;CACD,YAAY;CACZ,eAAe;CACf,WAAW;CACX,eAAe;CACf,YAAY;CACZ,MAAM;CACN,oBAAoB;CACpB,cAAc;CACd,eAAe,QAAQ,QAAQ,EAAE,CAAQ;CACzC,8BAA8B,SAA6B,QAAQ;CACnE,cAAc,QAAQ,QAAQ,EAAE,CAAQ;CACxC,sBAAsB,QAAQ,QAAQ,EAAE,CAAQ;CAChD,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"}