@okta/odyssey-react-mui 1.52.1 → 1.54.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (420) hide show
  1. package/CHANGELOG.md +4 -0
  2. package/dist/appswitcher/admin-app-default.svg +6 -0
  3. package/dist/appswitcher/admin-app-selected.svg +6 -0
  4. package/dist/appswitcher/aerial-default.svg +7 -0
  5. package/dist/appswitcher/aerial-selected.svg +7 -0
  6. package/dist/appswitcher/okta-dashboard-default.svg +7 -0
  7. package/dist/appswitcher/okta-dashboard-selected.svg +7 -0
  8. package/dist/appswitcher/privileged-access-default.svg +4 -0
  9. package/dist/appswitcher/privileged-access-selected.svg +4 -0
  10. package/dist/appswitcher/workflows-default.svg +5 -0
  11. package/dist/appswitcher/workflows-selected.svg +5 -0
  12. package/dist/assets/Accordion-Daq3txl_.js +1 -0
  13. package/dist/assets/Accordion.stories-B10VjLUt.js +85 -0
  14. package/dist/assets/AccordionSummary-CIeS6mZS.js +1 -0
  15. package/dist/assets/AddCircle-g6Yk-xuy.js +1 -0
  16. package/dist/assets/AlertTitle-D3upwBLV.js +1 -0
  17. package/dist/assets/AppSwitcher-BgQqDA5V.js +21 -0
  18. package/dist/assets/AppSwitcher.stories-CCbXDr-y.js +100 -0
  19. package/dist/assets/AppTile.stories-DDx8nWOn.js +136 -0
  20. package/dist/assets/ArrowDropDown-C5eUsI_E.js +1 -0
  21. package/dist/assets/ArrowLeft-BbZaO7Hg.js +1 -0
  22. package/dist/assets/ArrowRight-BdyE6fQu.js +1 -0
  23. package/dist/assets/Autocomplete-CRpfgiy9.js +1 -0
  24. package/dist/assets/Autocomplete-DCgA5sTf.js +1 -0
  25. package/dist/assets/Autocomplete.stories-CfdgUTKv.js +316 -0
  26. package/dist/assets/Badge-BEFvMQKq.js +11 -0
  27. package/dist/assets/Banner-CB8Hoj01.js +1 -0
  28. package/dist/assets/Banner.stories-4cloYih2.js +96 -0
  29. package/dist/assets/BaseButton-BMsK9NzI.js +11 -0
  30. package/dist/assets/BaseMenuButton-aaW8V_or.js +1 -0
  31. package/dist/assets/Box-BN2_CPSm.js +11 -0
  32. package/dist/assets/Box-DcPUBV1N.js +1 -0
  33. package/dist/assets/Box-GItunEmH.js +1 -0
  34. package/dist/assets/Box-QXROWmcY.js +1 -0
  35. package/dist/assets/Box.stories-DM_1V94P.js +38 -0
  36. package/dist/assets/Breadcrumb.stories-Vw9TE_V3.js +19 -0
  37. package/dist/assets/BreadcrumbList.stories-BI-DHs4m.js +81 -0
  38. package/dist/assets/Breadcrumbs-D_1mZ41I.js +6 -0
  39. package/dist/assets/Bug-Do-FQ2IL.js +1 -0
  40. package/dist/assets/Button-BRROMbQe.js +11 -0
  41. package/dist/assets/Button-BsIMaHFP.js +11 -0
  42. package/dist/assets/Button-D7yZg2t7.js +31 -0
  43. package/dist/assets/Button-DU6-loxu.js +1 -0
  44. package/dist/assets/Button.stories-Dtw31FkJ.js +271 -0
  45. package/dist/assets/Button.stories-MNavRNfY.js +133 -0
  46. package/dist/assets/ButtonBase-CKEbMwnW.js +74 -0
  47. package/dist/assets/Calendar-DXY28HTO.js +1 -0
  48. package/dist/assets/Call-z0I5v6Vn.js +1 -0
  49. package/dist/assets/Callout-yZ41kUV3.js +1 -0
  50. package/dist/assets/Callout.stories-D3VC5gnC.js +322 -0
  51. package/dist/assets/Card-B57MWbcR.js +8 -0
  52. package/dist/assets/Card-DjR7rkSG.js +1 -0
  53. package/dist/assets/Card.stories-D5ZGOkxo.js +56 -0
  54. package/dist/assets/CardActionArea-Dz07RUxL.js +1 -0
  55. package/dist/assets/CardActions-UHqxcz4J.js +1 -0
  56. package/dist/assets/Checkbox-BuEVtAbr.js +1 -0
  57. package/dist/assets/Checkbox-DFbGo8vE.js +1 -0
  58. package/dist/assets/Checkbox.stories-DIjMiY6R.js +113 -0
  59. package/dist/assets/CheckboxGroup-DNGXrxzU.js +1 -0
  60. package/dist/assets/CheckboxGroup.stories-B_8Duwnd.js +89 -0
  61. package/dist/assets/ChevronRight-CKfvqSM2.js +1 -0
  62. package/dist/assets/ChevronUp-CKd8_YJW.js +1 -0
  63. package/dist/assets/Chip-CHLAMh3i.js +1 -0
  64. package/dist/assets/CircularProgress-B51XjcW0.js +1 -0
  65. package/dist/assets/CircularProgress-CEHxaweC.js +28 -0
  66. package/dist/assets/CircularProgress.stories-CtnWCbpX.js +44 -0
  67. package/dist/assets/Clock-Di2hCnJ3.js +1 -0
  68. package/dist/assets/Close-Dcbwwr41.js +1 -0
  69. package/dist/assets/Code Styling Guidelines-C7MLVafs.js +13 -0
  70. package/dist/assets/Collapse-C5U5l6uF.js +1 -0
  71. package/dist/assets/Color-ASIRERSW-QSPaKXki.js +1 -0
  72. package/dist/assets/CssBaseline-BXXNXkh7.js +191 -0
  73. package/dist/assets/CssBaseline.stories-DtpQcH9S.js +364 -0
  74. package/dist/assets/Custom Theming-DubIG-fQ.js +135 -0
  75. package/dist/assets/Custom Theming.stories-Djl5PVv7.js +95 -0
  76. package/dist/assets/DataFilters-DugPV4vD.js +55 -0
  77. package/dist/assets/DataFilters-tMQx4AVH.js +1 -0
  78. package/dist/assets/DataFilters.stories-BKYL9wtK.js +31 -0
  79. package/dist/assets/DataTable-BUMJHmNl.js +495 -0
  80. package/dist/assets/DataTable-CDjFRZZh.js +21 -0
  81. package/dist/assets/DataTable-D8n9AkQH.js +41 -0
  82. package/dist/assets/DataTable.stories-Csvzcqth.js +21 -0
  83. package/dist/assets/DataTable.stories-FbmdYJq5.js +438 -0
  84. package/dist/assets/DataView-BDHLgztj.js +91 -0
  85. package/dist/assets/DataView-DlHiEpmH.js +332 -0
  86. package/dist/assets/DataView.stories-By2H6RbW.js +646 -0
  87. package/dist/assets/DataView.stories-JA-ZvSHf.js +439 -0
  88. package/dist/assets/DatePicker-BEUwPtkD.js +11 -0
  89. package/dist/assets/DatePicker-DAwf6UZa.js +1 -0
  90. package/dist/assets/DatePicker.stories-D64W45yC.js +133 -0
  91. package/dist/assets/DateTimePicker-CqM7OMZL.js +1 -0
  92. package/dist/assets/DateTimePicker.stories-DC0WM79l.js +158 -0
  93. package/dist/assets/DebugMenu-BW3w2pGy.js +1 -0
  94. package/dist/assets/Design Tokens-BKt0fWJK.js +4 -0
  95. package/dist/assets/Dialog-BSKCThdx.js +1 -0
  96. package/dist/assets/Dialog.stories-D1n0EJWm.js +207 -0
  97. package/dist/assets/Dialog.stories-DjyJMQNC.js +352 -0
  98. package/dist/assets/DialogContent-BZZC3ZPL.js +1 -0
  99. package/dist/assets/DialogContentText-BrVYVEvg.js +1 -0
  100. package/dist/assets/DialogTitle-CBL5DhvK.js +1 -0
  101. package/dist/assets/Divider-Cz7bC_1D.js +1 -0
  102. package/dist/assets/Divider.stories-DQWfbxL3.js +5 -0
  103. package/dist/assets/DocsRenderer-GHJI37HO-B2LukYLM.js +2 -0
  104. package/dist/assets/Documentation-RjgHsfAb.js +1 -0
  105. package/dist/assets/Download-BcTe1ZU8.js +1 -0
  106. package/dist/assets/Drawer-Bw4XHP_g.js +33 -0
  107. package/dist/assets/Drawer.stories-CKqlYMGT.js +95 -0
  108. package/dist/assets/EmptyState-Jcfpbtt-.js +11 -0
  109. package/dist/assets/EmptyState.stories-BPqPn_5g.js +127 -0
  110. package/dist/assets/EmptyState.stories-IiRZjDbr.js +11 -0
  111. package/dist/assets/ExampleButton.stories-DQwAyfmw.js +11 -0
  112. package/dist/assets/Extending Translations-5r-hPzv-.js +147 -0
  113. package/dist/assets/ExternalLink-BEu8BCu0.js +1 -0
  114. package/dist/assets/Fade-DrCoA42j.js +1 -0
  115. package/dist/assets/Field-BYLEUHch.js +11 -0
  116. package/dist/assets/FieldHint-Cw2XBNxH.js +1 -0
  117. package/dist/assets/Fieldset-iW7Xph9x.js +11 -0
  118. package/dist/assets/Fieldset.stories-CSWrlIxx.js +15 -0
  119. package/dist/assets/FileUploader.stories-CWzLUIaN.js +58 -0
  120. package/dist/assets/Filter-Wswbc_gt.js +1 -0
  121. package/dist/assets/Folder-jR_3li1K.js +1 -0
  122. package/dist/assets/Form Field Accessibility-Cm_d_9mv.js +17 -0
  123. package/dist/assets/Form-BnTT3ykb.js +11 -0
  124. package/dist/assets/Form.stories-DAfJRunc.js +69 -0
  125. package/dist/assets/FormControlLabel-rwZvAjIk.js +1 -0
  126. package/dist/assets/FormGroup--1q97kW5.js +1 -0
  127. package/dist/assets/FormHelperText-C8Jvf7bP.js +1 -0
  128. package/dist/assets/FormLabel-MF6CzxjN.js +1 -0
  129. package/dist/assets/FullScreenOverlay-BJrXEpo4.js +11 -0
  130. package/dist/assets/Generating Icons-BLWsWSK4.js +15 -0
  131. package/dist/assets/Globe-FAvybPgY.js +1 -0
  132. package/dist/assets/Grid-6HD5fC0r.js +1 -0
  133. package/dist/assets/Group-Cp6vHli3.js +1 -0
  134. package/dist/assets/GroupPicker.stories-Dhpygnxg.js +33 -0
  135. package/dist/assets/Grow-BpzgBh-I.js +1 -0
  136. package/dist/assets/Hide-B8GBii5B.js +1 -0
  137. package/dist/assets/Hint-g9-xnSB5.js +11 -0
  138. package/dist/assets/HintLink.stories-DCO620e2.js +44 -0
  139. package/dist/assets/Home-BXRcLQe_.js +1 -0
  140. package/dist/assets/Icon.stories-B-WWum_N.js +16 -0
  141. package/dist/assets/IconButton-CY54VTm3.js +1 -0
  142. package/dist/assets/IconWithTooltip.stories-DXTdDuRk.js +19 -0
  143. package/dist/assets/IgaComponentsOdysseyStorybookThemeDecorator-yVsUtNYk.js +269 -0
  144. package/dist/assets/InformationCircle-Dg6oiOPA.js +1 -0
  145. package/dist/assets/InputAdornment-B5kJtHOQ.js +1 -0
  146. package/dist/assets/InputBase-C9_GkGNE.js +2 -0
  147. package/dist/assets/Installing odyssey-react-mui-Dl4SPWpo.js +216 -0
  148. package/dist/assets/Introduction-gCxd6_tc.js +46 -0
  149. package/dist/assets/Layout-Cl3Pe9fw.js +11 -0
  150. package/dist/assets/Layout.stories-BmKiRHa7.js +285 -0
  151. package/dist/assets/Legacy Migrations-FSGiv6gt.js +85 -0
  152. package/dist/assets/LinearProgress-Due1Z-ms.js +54 -0
  153. package/dist/assets/Link-BVJyfG5Z.js +1 -0
  154. package/dist/assets/Link-D-2xfQL8.js +1 -0
  155. package/dist/assets/Link-DBfYgyqI.js +1 -0
  156. package/dist/assets/Link-DhNitPJh.js +11 -0
  157. package/dist/assets/Link.stories-Dq3qgFlT.js +38 -0
  158. package/dist/assets/List-BSVKZ0wr.js +1 -0
  159. package/dist/assets/List-DyCjsxv2.js +1 -0
  160. package/dist/assets/ListItem-nLG-781o.js +1 -0
  161. package/dist/assets/ListSubheader-DROGdpSN.js +1 -0
  162. package/dist/assets/ListSubheader.stories-CxR2xD4x.js +5 -0
  163. package/dist/assets/Menu-CAnOJYGy.js +1 -0
  164. package/dist/assets/MenuButton-JLuPodYU.js +31 -0
  165. package/dist/assets/MenuButton-XKYLHmS4.js +11 -0
  166. package/dist/assets/MenuButton.stories-MUOIPnkF.js +246 -0
  167. package/dist/assets/MenuButton.stories-yDQct2na.js +75 -0
  168. package/dist/assets/MenuContext-ZAp67kRJ.js +11 -0
  169. package/dist/assets/MenuItem-C24Kmcql.js +1 -0
  170. package/dist/assets/MenuItem-DxqkPhH4.js +1 -0
  171. package/dist/assets/MenuItem-DyRmIfqo.js +1 -0
  172. package/dist/assets/MenuItem.stories-6GN__5Ea.js +22 -0
  173. package/dist/assets/MenuItem.stories-COVg8d6W.js +38 -0
  174. package/dist/assets/MenuList-De-H5WYL.js +1 -0
  175. package/dist/assets/Modal-C2qslhip.js +1 -0
  176. package/dist/assets/More-C9jx0DT3.js +1 -0
  177. package/dist/assets/MuiPropsContext-Bg_x6l7d.js +11 -0
  178. package/dist/assets/MuiPropsContext-H20tOLmR.js +11 -0
  179. package/dist/assets/NativeSelect.stories-CtknOfaK.js +114 -0
  180. package/dist/assets/Notification-CZG5fzUR.js +1 -0
  181. package/dist/assets/OdysseyProvider-CMlA-CeS.js +197 -0
  182. package/dist/assets/OdysseyProvider-CVwRS5Sq.js +76 -0
  183. package/dist/assets/OdysseyStorybookThemeDecorator-B7y7aS60.js +1 -0
  184. package/dist/assets/OdysseyThemeProvider-CCwl8LYd.js +174 -0
  185. package/dist/assets/PageHeader-mQcQQKJ2.js +6 -0
  186. package/dist/assets/PageHeader.stories-6suF8RgO.js +364 -0
  187. package/dist/assets/PageHeader.stories-Bk8tYReg.js +364 -0
  188. package/dist/assets/PageHeader.stories-Bx4vlXfy.js +17 -0
  189. package/dist/assets/PageTemplate-CooiV4KC.js +21 -0
  190. package/dist/assets/PageTemplate-W9dzsIZk.js +8 -0
  191. package/dist/assets/PageTemplate.stories-32o76pgm.js +205 -0
  192. package/dist/assets/PageTemplate.stories-Bl1I3kw4.js +306 -0
  193. package/dist/assets/PageTemplate.stories-y3VCe0pC.js +205 -0
  194. package/dist/assets/PaginatedTable.stories-Bv7r4mF8.js +65 -0
  195. package/dist/assets/Paper-Bv-8rqJG.js +1 -0
  196. package/dist/assets/PasswordField.stories-RlpYEesu.js +121 -0
  197. package/dist/assets/Picker.stories-BzNZYpEc.js +44 -0
  198. package/dist/assets/PickerWithOptionAdornment.stories-DUuxsL3s.js +93 -0
  199. package/dist/assets/PlaceholderLogo-BQYeqJ_d.js +11 -0
  200. package/dist/assets/Popper-DAO3a_fx.js +1 -0
  201. package/dist/assets/Portal-Be1GH4ah.js +1 -0
  202. package/dist/assets/ProgressBar.stories-BEYS_PFg.js +20 -0
  203. package/dist/assets/Radio-DmSXm_7d.js +1 -0
  204. package/dist/assets/Radio-mhEI_Lft.js +1 -0
  205. package/dist/assets/Radio.stories-CVBgcKIq.js +63 -0
  206. package/dist/assets/RadioGroup-Cwl9fB9Q.js +10 -0
  207. package/dist/assets/RadioGroup-DbKGawnM.js +1 -0
  208. package/dist/assets/RadioGroup-DokX7ODU.js +1 -0
  209. package/dist/assets/RadioGroup.stories-CLphGkYm.js +138 -0
  210. package/dist/assets/Refresh-CASA72Vm.js +1 -0
  211. package/dist/assets/ResourceAccessPolicyComponentsStorybookThemeDecorator-8FjQBMSw.js +212 -0
  212. package/dist/assets/Right-to-Left (RTL)-jz_GTPNz.js +61 -0
  213. package/dist/assets/ScopedCssBaseline-DLzkuFGv.js +1 -0
  214. package/dist/assets/ScreenReaderText-6hJD_NSR.js +1 -0
  215. package/dist/assets/ScreenReaderText-uyKsLgZb.js +15 -0
  216. package/dist/assets/ScreenReaderText.stories-CzCZ0hf2.js +8 -0
  217. package/dist/assets/Search-BSCrQGJG.js +1 -0
  218. package/dist/assets/SearchDropdown.stories-CLn7XX8C.js +53 -0
  219. package/dist/assets/SearchField-BezuuZAt.js +1 -0
  220. package/dist/assets/SearchField.stories-DlIHk877.js +37 -0
  221. package/dist/assets/Select-Cia8mIUa.js +1 -0
  222. package/dist/assets/Select-DmM1YYIG.js +15 -0
  223. package/dist/assets/Select.stories-BJdbQiAn.js +233 -0
  224. package/dist/assets/Server-BCLxvuXN.js +1 -0
  225. package/dist/assets/Settings-D7DZLft8.js +1 -0
  226. package/dist/assets/Setup-CTxCAdah.js +6 -0
  227. package/dist/assets/Shadow DOM-StxMEsiC.js +63 -0
  228. package/dist/assets/Show-CPDqp9eP.js +1 -0
  229. package/dist/assets/SideNav-6XrbY_-H.js +131 -0
  230. package/dist/assets/SideNav-DOEshqiu.js +85 -0
  231. package/dist/assets/SideNav.stories-CZTfc6tR.js +207 -0
  232. package/dist/assets/Skeleton-B4juUFkj.js +51 -0
  233. package/dist/assets/Snackbar-BtyFsRaP.js +1 -0
  234. package/dist/assets/Stack-BlNTLl9F.js +1 -0
  235. package/dist/assets/Stack-Ds5ITe5E.js +1 -0
  236. package/dist/assets/Stack.stories-CZjN_nbA.js +1 -0
  237. package/dist/assets/StaticTable.stories-DBW5rOOn.js +34 -0
  238. package/dist/assets/Status-BzfvgnE8.js +1 -0
  239. package/dist/assets/Status.stories-D-5uelAK.js +66 -0
  240. package/dist/assets/Stepper.stories-DBWEGGw0.js +486 -0
  241. package/dist/assets/Surface-DiOLp-IF.js +1 -0
  242. package/dist/assets/Switch.stories-DutmBO0q.js +72 -0
  243. package/dist/assets/SwitchBase-DFhbxMFU.js +1 -0
  244. package/dist/assets/Sync-DRzWBzLb.js +1 -0
  245. package/dist/assets/Tabs-CzBTAREX.js +1 -0
  246. package/dist/assets/Tabs-DixvwYji.js +23 -0
  247. package/dist/assets/Tabs.stories-DW1zbBKp.js +100 -0
  248. package/dist/assets/Tag-c92hpyWa.js +11 -0
  249. package/dist/assets/Tag.stories-D84h0Ctd.js +96 -0
  250. package/dist/assets/TagList-BzCEw4W6.js +1 -0
  251. package/dist/assets/TextField-C_OR_Dhs.js +1 -0
  252. package/dist/assets/TextField.stories-CB4JnkHg.js +177 -0
  253. package/dist/assets/Toast.stories-BkXY915Y.js +164 -0
  254. package/dist/assets/ToastManager.stories-1c6d94Wr.js +195 -0
  255. package/dist/assets/Tooltip-CtMQ7ejP.js +11 -0
  256. package/dist/assets/Tooltip-DoyRbWb9.js +1 -0
  257. package/dist/assets/Tooltip.stories-CY8HtzZN.js +68 -0
  258. package/dist/assets/TopNav-BBaI7wBA.js +11 -0
  259. package/dist/assets/TopNav.stories-BonEcWsg.js +13 -0
  260. package/dist/assets/TransitionGroupContext-FeNnDXqj.js +1 -0
  261. package/dist/assets/Typography-B7LPQ65D.js +1 -0
  262. package/dist/assets/Typography-CAaRogW8.js +1 -0
  263. package/dist/assets/Typography-avG8-lGj.js +1 -0
  264. package/dist/assets/Typography-vFph2crD.js +9 -0
  265. package/dist/assets/Typography.stories-BdpTOvow.js +73 -0
  266. package/dist/assets/Typography.stories-Bhg4Hpj7.js +139 -0
  267. package/dist/assets/Typography.stories-CqHoB4eE.js +73 -0
  268. package/dist/assets/UDComponentsStorybookThemeDecorator-CUrY30iv.js +239 -0
  269. package/dist/assets/UiShell.stories-CqHTAwmz.js +569 -0
  270. package/dist/assets/UiShellProvider-BnHvOMpD.js +31 -0
  271. package/dist/assets/Upload-DXb67X9X.js +1 -0
  272. package/dist/assets/User-CgytLiqa.js +1 -0
  273. package/dist/assets/UserProfile-CH1CH7s6.js +11 -0
  274. package/dist/assets/UserProfile.stories-CZKfgysp.js +14 -0
  275. package/dist/assets/UserProfileMenuButton.stories-DXHL4TiM.js +30 -0
  276. package/dist/assets/Video-CkI57iP_.js +1 -0
  277. package/dist/assets/WarningFilled-qIqi4h0v.js +1 -0
  278. package/dist/assets/WithTooltip-IO6J4KBT-izYKYgZb.js +9 -0
  279. package/dist/assets/WorkflowsComponentsStorybookThemeDecorator-CfGk2U4j.js +1 -0
  280. package/dist/assets/WpComponentsStorybookThemeDecorator-BfUB6Fji.js +1 -0
  281. package/dist/assets/ariaDisabledStyles-BnD13Dho.js +11 -0
  282. package/dist/assets/axe-CZ-24O2A.js +30 -0
  283. package/dist/assets/axeRun-QswtvkOz.js +11 -0
  284. package/dist/assets/blocks-CtYZtf3a.js +162 -0
  285. package/dist/assets/colorManipulator-DlY4JhNG.js +1 -0
  286. package/dist/assets/constants-CGUp4oSR.js +11 -0
  287. package/dist/assets/createChainedFunction-BO_9K8Jh.js +1 -0
  288. package/dist/assets/createStyled-C3GEIcOd.js +1 -0
  289. package/dist/assets/createSvgIcon-DMOOI9wR.js +1 -0
  290. package/dist/assets/createUniqueId-BHjR7HQF.js +11 -0
  291. package/dist/assets/debounce-Be36O1Ab.js +1 -0
  292. package/dist/assets/dialogActionsClasses-BlWxTtt7.js +1 -0
  293. package/dist/assets/fieldComponentPropsMetaData-C9gCwuus.js +11 -0
  294. package/dist/assets/formatter-QJ4M4OGQ-Bz0pvfL5.js +1 -0
  295. package/dist/assets/getScrollbarSize-Bqq2hMjQ.js +1 -0
  296. package/dist/assets/i18next-7SyOfhCu.js +1 -0
  297. package/dist/assets/iconUtils-BUsEqJnv.js +11 -0
  298. package/dist/assets/iframe-DE4RuJrv.js +1672 -0
  299. package/dist/assets/index-BAELNoi-.js +39 -0
  300. package/dist/assets/index-CMrI_MV3.js +1 -0
  301. package/dist/assets/index-DBPVAcBX.js +1 -0
  302. package/dist/assets/index-DvA7jsks.js +1 -0
  303. package/dist/assets/index.esm-BZBFx5zE.js +1 -0
  304. package/dist/assets/index.esm-DPEH-2Dd.js +85 -0
  305. package/dist/assets/index.modern-dR7HgQex.js +14 -0
  306. package/dist/assets/inputUtils-DtvLbmm9.js +11 -0
  307. package/dist/assets/isHostComponent-DVu5iVWx.js +1 -0
  308. package/dist/assets/matchers-DMFSMG2O-CAdg16Fl.js +14 -0
  309. package/dist/assets/ownerDocument-DW-IO8s5.js +1 -0
  310. package/dist/assets/ownerWindow-HkKU3E4x.js +1 -0
  311. package/dist/assets/personData-CLoFzEp9.js +21 -0
  312. package/dist/assets/personData-WNkbjNZy.js +1 -0
  313. package/dist/assets/pickerComponentPropsMetaData-BPcY4jWd.js +75 -0
  314. package/dist/assets/preload-helper-Dp1pzeXC.js +1 -0
  315. package/dist/assets/pxToRem-BrMhKUxS.js +11 -0
  316. package/dist/assets/react-18-Cgo9p-UD.js +1 -0
  317. package/dist/assets/renderUiShell.stories-CZwFE9fh.js +902 -0
  318. package/dist/assets/resolveComponentProps-DH5wuSot.js +1 -0
  319. package/dist/assets/syntaxhighlighter-IQDEPFLK-DllV8wKq.js +6 -0
  320. package/dist/assets/tableRowClasses-SdduqaRI.js +9 -0
  321. package/dist/assets/tableSortLabelClasses-Btt1VxyW.js +1 -0
  322. package/dist/assets/uiShellSharedConstants-CvCey4L_.js +11 -0
  323. package/dist/assets/useAutocomplete-NsoONBGQ.js +11 -0
  324. package/dist/assets/useControlled-0vpPKndq.js +1 -0
  325. package/dist/assets/useIsFocusVisible-DEbTNWvz.js +1 -0
  326. package/dist/assets/useMobilePicker-BzwZRuUY.js +6 -0
  327. package/dist/assets/useMountLifecycleEffect-BQjBLWpH.js +11 -0
  328. package/dist/assets/useOdysseyDateFields-CcTWyzYw.js +61 -0
  329. package/dist/assets/useScrollIndication-iOp--772.js +41 -0
  330. package/dist/assets/useSlot-CxZuq7zC.js +1 -0
  331. package/dist/assets/useStoryArgOrLocalState-CRQAGSTX.js +11 -0
  332. package/dist/assets/useThemeProps-BDmyOQ5c.js +1 -0
  333. package/dist/assets/useThemeProps-DjFwRijR.js +1 -0
  334. package/dist/assets/useUniqueId-ej4W3xOJ.js +11 -0
  335. package/dist/assets/utilities.esm-B9jaZcpU.js +5 -0
  336. package/dist/assets/utils-DAOaxsLc.js +1 -0
  337. package/dist/assets/visuallyHidden-Dan1xhjv.js +1 -0
  338. package/dist/cjs/Field.cjs +2 -4
  339. package/dist/cjs/Field.cjs.map +1 -1
  340. package/dist/cjs/FullScreenOverlayContext.cjs +8 -2
  341. package/dist/cjs/FullScreenOverlayContext.cjs.map +1 -1
  342. package/dist/cjs/OdysseyProvider.cjs +2 -0
  343. package/dist/cjs/OdysseyProvider.cjs.map +1 -1
  344. package/dist/cjs/index.cjs.map +1 -1
  345. package/dist/cjs/labs/DataView/DataView.cjs +17 -4
  346. package/dist/cjs/labs/DataView/DataView.cjs.map +1 -1
  347. package/dist/cjs/labs/OdysseyPickers/Picker.cjs +2 -0
  348. package/dist/cjs/labs/OdysseyPickers/Picker.cjs.map +1 -1
  349. package/dist/cjs/labs/OdysseyPickers/PickerWithOptionAdornment.cjs.map +1 -1
  350. package/dist/cjs/ui-shell/UiShell.cjs +1 -0
  351. package/dist/cjs/ui-shell/UiShell.cjs.map +1 -1
  352. package/dist/cjs/web-component/odysseyWebComponentVersion.generated.cjs +1 -1
  353. package/dist/cjs/web-component/odysseyWebComponentVersion.generated.cjs.map +1 -1
  354. package/dist/esm/Field.js +4 -6
  355. package/dist/esm/Field.js.map +1 -1
  356. package/dist/esm/FullScreenOverlayContext.js +8 -2
  357. package/dist/esm/FullScreenOverlayContext.js.map +1 -1
  358. package/dist/esm/OdysseyProvider.js +2 -0
  359. package/dist/esm/OdysseyProvider.js.map +1 -1
  360. package/dist/esm/index.js.map +1 -1
  361. package/dist/esm/labs/DataView/DataView.js +17 -4
  362. package/dist/esm/labs/DataView/DataView.js.map +1 -1
  363. package/dist/esm/labs/OdysseyPickers/Picker.js +2 -0
  364. package/dist/esm/labs/OdysseyPickers/Picker.js.map +1 -1
  365. package/dist/esm/labs/OdysseyPickers/PickerWithOptionAdornment.js.map +1 -1
  366. package/dist/esm/ui-shell/UiShell.js +1 -0
  367. package/dist/esm/ui-shell/UiShell.js.map +1 -1
  368. package/dist/esm/web-component/odysseyWebComponentVersion.generated.js +1 -1
  369. package/dist/esm/web-component/odysseyWebComponentVersion.generated.js.map +1 -1
  370. package/dist/favicon-wrapper.svg +46 -0
  371. package/dist/favicon.svg +1 -0
  372. package/dist/iframe.html +768 -0
  373. package/dist/index.cjs +1 -1
  374. package/dist/index.d.ts +21 -232
  375. package/dist/index.d.ts.map +1 -0
  376. package/dist/index.html +173 -0
  377. package/dist/index.js +25 -0
  378. package/dist/index.json +1 -0
  379. package/dist/index.mjs +1 -1
  380. package/dist/index.scss +1 -1
  381. package/dist/nunito-sans-bold-italic.woff2 +0 -0
  382. package/dist/nunito-sans-bold.woff2 +0 -0
  383. package/dist/nunito-sans-italic.woff2 +0 -0
  384. package/dist/nunito-sans-regular.woff2 +0 -0
  385. package/dist/project.json +1 -0
  386. package/dist/sb-addons/a11y-3/manager-bundle.js +5 -0
  387. package/dist/sb-addons/docs-1/manager-bundle.js +3 -0
  388. package/dist/sb-addons/links-2/manager-bundle.js +3 -0
  389. package/dist/sb-addons/rtl-4/manager-bundle.js +3 -0
  390. package/dist/sb-addons/storybook-6/manager-bundle.js +786 -0
  391. package/dist/sb-addons/storybook-core-server-presets-0/common-manager-bundle.js +628 -0
  392. package/dist/sb-addons/tag-badges-5/manager-bundle.js +35 -0
  393. package/dist/sb-common-assets/favicon-wrapper.svg +46 -0
  394. package/dist/sb-common-assets/favicon.svg +1 -0
  395. package/dist/sb-common-assets/nunito-sans-bold-italic.woff2 +0 -0
  396. package/dist/sb-common-assets/nunito-sans-bold.woff2 +0 -0
  397. package/dist/sb-common-assets/nunito-sans-italic.woff2 +0 -0
  398. package/dist/sb-common-assets/nunito-sans-regular.woff2 +0 -0
  399. package/dist/sb-manager/globals-runtime.js +75605 -0
  400. package/dist/sb-manager/globals.js +24 -0
  401. package/dist/sb-manager/manager-stores.js +23 -0
  402. package/dist/sb-manager/runtime.js +19717 -0
  403. package/dist/tsconfig.production.tsbuildinfo +1 -1
  404. package/dist/tsconfig.tsbuildinfo +1 -0
  405. package/dist/types/Field.d.ts.map +1 -1
  406. package/dist/types/FullScreenOverlayContext.d.ts +5 -1
  407. package/dist/types/FullScreenOverlayContext.d.ts.map +1 -1
  408. package/dist/types/OdysseyProvider.d.ts +1 -1
  409. package/dist/types/OdysseyProvider.d.ts.map +1 -1
  410. package/dist/types/index.d.ts +1 -0
  411. package/dist/types/index.d.ts.map +1 -1
  412. package/dist/types/labs/DataView/DataView.d.ts.map +1 -1
  413. package/dist/types/labs/OdysseyPickers/Picker.d.ts +4 -5
  414. package/dist/types/labs/OdysseyPickers/Picker.d.ts.map +1 -1
  415. package/dist/types/labs/OdysseyPickers/PickerWithOptionAdornment.d.ts +7 -5
  416. package/dist/types/labs/OdysseyPickers/PickerWithOptionAdornment.d.ts.map +1 -1
  417. package/dist/types/ui-shell/UiShell.d.ts.map +1 -1
  418. package/dist/types/web-component/odysseyWebComponentVersion.generated.d.ts +1 -1
  419. package/dist/vite-inject-mocker-entry.js +18 -0
  420. package/package.json +9 -7
@@ -1 +1 @@
1
- {"version":3,"file":"Picker.cjs","names":["_styled","_interopRequireDefault","require","_react","_OdysseyDesignTokensContext","_Typography","_ComposablePicker","_jsxRuntime","e","__esModule","default","StyledOption","exports","styled","li","hasAdornment","display","OptionLabelContainer","shouldForwardProp","prop","p","margin","OptionDescription","odysseyDesignTokens","Spacing1","color","TypographyColorSubordinate","OptionDetails","gap","Spacing3","marginBlockStart","Spacing2","OptionDetail","alignItems","svg","width","Spacing4","HueNeutral400","Option","children","muiProps","key","props","createElement","OptionMetadataComponent","metaData","jsx","map","meta","index","detailText","icon","jsxs","OptionDescriptionComponent","description","OptionLabelOnlyComponent","option","label","Paragraph","OptionLabelDescription","Heading6","component","OptionLabelDescriptionMetadata","Picker","ariaDescribedBy","defaultValue","emptyOptionsText","errorMessage","errorMessageList","getIsOptionEqualToValue","hasMultipleChoices","id","idOverride","inputValue","isCustomValueAllowed","isDisabled","isFullWidth","isLoading","isOptional","isReadOnly","isVirtualized","isVirtualizedProp","hint","HintLinkComponent","name","nameOverride","onBlur","onChange","onChangeProp","onInputChange","onInputChangeProp","onFocus","options","value","testId","translate","useOdysseyDesignTokens","customOptionRender","useCallback","hasDescription","hasMetadata","isLabelOnly","Fragment","ComposablePicker","renderOption","MemoizedPicker","memo","displayName"],"sources":["../../../../src/labs/OdysseyPickers/Picker.tsx"],"sourcesContent":["/*!\n * Copyright (c) 2023-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *\n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport styled from \"@emotion/styled\";\nimport { AutocompleteProps as MuiAutocompleteProps } from \"@mui/material\";\nimport {\n Fragment,\n memo,\n PropsWithChildren,\n ReactElement,\n ReactNode,\n useCallback,\n} from \"react\";\n\nimport {\n DesignTokens,\n useOdysseyDesignTokens,\n} from \"../../OdysseyDesignTokensContext.js\";\nimport { Heading6, Paragraph } from \"../../Typography.js\";\nimport {\n type BasePickerProps,\n type BasePickerType,\n type BaseRenderOptionProps,\n ComposablePicker,\n} from \"./ComposablePicker.js\";\n\nexport const StyledOption = styled.li<{ hasAdornment?: boolean }>(\n ({ hasAdornment }) => ({\n ...(!hasAdornment && {\n display: \"block !important\",\n }),\n }),\n);\n\nexport const OptionLabelContainer = styled(\"div\", {\n shouldForwardProp: (prop) => prop !== \"odysseyDesignTokens\",\n})<{ odysseyDesignTokens: DesignTokens }>(() => ({\n p: {\n margin: 0,\n },\n}));\n\nexport const OptionDescription = styled(\"p\", {\n shouldForwardProp: (prop) => prop !== \"odysseyDesignTokens\",\n})<{ odysseyDesignTokens: DesignTokens }>(({ odysseyDesignTokens }) => ({\n margin: `${odysseyDesignTokens.Spacing1} 0 0 !important`,\n color: odysseyDesignTokens.TypographyColorSubordinate,\n}));\n\nexport const OptionDetails = styled(\"div\", {\n shouldForwardProp: (prop) => prop !== \"odysseyDesignTokens\",\n})<{ odysseyDesignTokens: DesignTokens }>(({ odysseyDesignTokens }) => ({\n display: \"flex\",\n gap: odysseyDesignTokens.Spacing3,\n marginBlockStart: odysseyDesignTokens.Spacing2,\n}));\n\nexport const OptionDetail = styled(\"div\", {\n shouldForwardProp: (prop) => prop !== \"odysseyDesignTokens\",\n})<{ odysseyDesignTokens: DesignTokens }>(({ odysseyDesignTokens }) => ({\n display: \"flex\",\n alignItems: \"center\",\n gap: odysseyDesignTokens.Spacing1,\n\n svg: {\n width: odysseyDesignTokens.Spacing4,\n color: odysseyDesignTokens.HueNeutral400,\n },\n}));\n\nexport type BaseOptionProps = {\n muiProps: BaseRenderOptionProps;\n odysseyDesignTokens: DesignTokens;\n};\n\ntype OptionComponentProps = {\n hasAdornment?: boolean;\n muiProps: BaseOptionProps[\"muiProps\"];\n};\n\nexport const Option = ({\n children,\n hasAdornment = false,\n muiProps,\n}: PropsWithChildren<OptionComponentProps>) => {\n const { key, ...props } = muiProps;\n return (\n <StyledOption {...props} hasAdornment={hasAdornment} key={key}>\n {children}\n </StyledOption>\n );\n};\n\nexport const OptionMetadataComponent = ({\n metaData,\n odysseyDesignTokens,\n}: {\n metaData: OptionMetadata[];\n odysseyDesignTokens: DesignTokens;\n}) => {\n return (\n <OptionDetails odysseyDesignTokens={odysseyDesignTokens}>\n {metaData.map((meta: OptionMetadata, index: number) => {\n const { detailText, icon } = meta;\n return (\n <OptionDetail\n key={`${detailText}-${index}`}\n odysseyDesignTokens={odysseyDesignTokens}\n >\n {icon}\n {detailText}\n </OptionDetail>\n );\n })}\n </OptionDetails>\n );\n};\n\nexport const OptionDescriptionComponent = ({\n description,\n odysseyDesignTokens,\n}: {\n description?: LabelDescription[\"description\"];\n odysseyDesignTokens: DesignTokens;\n}) => {\n return (\n description && (\n <OptionDescription odysseyDesignTokens={odysseyDesignTokens}>\n {description}\n </OptionDescription>\n )\n );\n};\n\nexport type OptionProps<OptionType> = {\n option: OptionType;\n};\n\nexport const OptionLabelOnlyComponent = <OptionType extends OptionLabelOnly>({\n muiProps,\n odysseyDesignTokens,\n option,\n}: BaseOptionProps & OptionProps<OptionType>) => {\n const { label } = option;\n\n return (\n <Option muiProps={muiProps}>\n <OptionLabelContainer odysseyDesignTokens={odysseyDesignTokens}>\n <Paragraph>{label}</Paragraph>\n </OptionLabelContainer>\n </Option>\n );\n};\n\nconst OptionLabelDescription = <OptionType extends LabelDescription>({\n muiProps,\n odysseyDesignTokens,\n option,\n}: BaseOptionProps & OptionProps<OptionType>) => {\n const { description, label } = option;\n\n return (\n <Option muiProps={muiProps}>\n <OptionLabelContainer odysseyDesignTokens={odysseyDesignTokens}>\n <Heading6 component=\"p\">{label}</Heading6>\n <OptionDescriptionComponent\n description={description}\n odysseyDesignTokens={odysseyDesignTokens}\n />\n </OptionLabelContainer>\n </Option>\n );\n};\n\nconst OptionLabelDescriptionMetadata = <\n OptionType extends LabelDescriptionMetadata,\n>({\n muiProps,\n odysseyDesignTokens,\n option,\n}: BaseOptionProps & OptionProps<OptionType>) => {\n const { description, label, metaData } = option;\n\n return (\n <Option muiProps={muiProps}>\n <OptionLabelContainer odysseyDesignTokens={odysseyDesignTokens}>\n <Heading6 component=\"p\">{label}</Heading6>\n <OptionDescriptionComponent\n description={description}\n odysseyDesignTokens={odysseyDesignTokens}\n />\n </OptionLabelContainer>\n <OptionMetadataComponent\n metaData={metaData}\n odysseyDesignTokens={odysseyDesignTokens}\n />\n </Option>\n );\n};\n\nexport type OptionMetadata = {\n detailText: string | number;\n icon: ReactElement;\n};\n\nexport type OptionGroupType = { group?: string };\nexport type OptionValueType = { value: string | number };\nexport type OptionLabelType = { label: string };\nexport type BaseOptionType = OptionValueType &\n OptionGroupType &\n OptionLabelType;\nexport type Metadata = {\n metaData: OptionMetadata[];\n};\n\nexport type OptionLabelOnly = BaseOptionType;\nexport type LabelDescription = BaseOptionType & { description?: string };\nexport type LabelDescriptionMetadata = LabelDescription & Metadata;\n\nexport type PickerProps<\n OptionType extends LabelDescription | LabelDescriptionMetadata,\n HasMultipleChoices extends boolean | undefined,\n IsCustomValueAllowed extends boolean | undefined,\n> = BasePickerProps<OptionType, HasMultipleChoices, IsCustomValueAllowed>;\n\nexport type PickerComponentType = {\n <\n OptionType extends OptionLabelOnly,\n HasMultipleChoices extends boolean | undefined,\n IsCustomValueAllowed extends boolean | undefined,\n >(\n props: PickerProps<OptionType, HasMultipleChoices, IsCustomValueAllowed>,\n ): ReactNode;\n <\n OptionType extends LabelDescriptionMetadata,\n HasMultipleChoices extends boolean | undefined,\n IsCustomValueAllowed extends boolean | undefined,\n >(\n props: PickerProps<OptionType, HasMultipleChoices, IsCustomValueAllowed>,\n ): ReactNode;\n <\n OptionType extends LabelDescription,\n HasMultipleChoices extends boolean | undefined,\n IsCustomValueAllowed extends boolean | undefined,\n >(\n props: PickerProps<OptionType, HasMultipleChoices, IsCustomValueAllowed>,\n ): ReactNode;\n <\n OptionType extends LabelDescriptionMetadata,\n HasMultipleChoices extends boolean | undefined,\n IsCustomValueAllowed extends boolean | undefined,\n >(\n props: PickerProps<OptionType, HasMultipleChoices, IsCustomValueAllowed>,\n ): ReactNode;\n};\n\nconst Picker: PickerComponentType = <\n OptionType extends\n | OptionLabelOnly\n | LabelDescription\n | LabelDescriptionMetadata,\n HasMultipleChoices extends boolean | undefined,\n IsCustomValueAllowed extends boolean | undefined,\n>({\n ariaDescribedBy,\n defaultValue,\n emptyOptionsText,\n errorMessage,\n errorMessageList,\n getIsOptionEqualToValue,\n hasMultipleChoices,\n id: idOverride,\n inputValue,\n isCustomValueAllowed,\n isDisabled,\n isFullWidth = false,\n isLoading,\n isOptional = false,\n isReadOnly,\n isVirtualized: isVirtualizedProp = false,\n hint,\n HintLinkComponent,\n label,\n name: nameOverride,\n onBlur,\n onChange: onChangeProp,\n onInputChange: onInputChangeProp,\n onFocus,\n options,\n value,\n testId,\n translate,\n}: PickerProps<OptionType, HasMultipleChoices, IsCustomValueAllowed>) => {\n const odysseyDesignTokens = useOdysseyDesignTokens();\n\n const customOptionRender = useCallback<\n NonNullable<\n MuiAutocompleteProps<\n OptionType,\n HasMultipleChoices,\n undefined,\n IsCustomValueAllowed\n >[\"renderOption\"]\n >\n >(\n (muiProps, option) => {\n const hasDescription = \"description\" in option && option.description;\n const hasMetadata = \"metaData\" in option && option.metaData;\n const isLabelOnly = !hasMetadata && !hasDescription;\n\n return (\n <Fragment key={option.value}>\n {isLabelOnly ? (\n <OptionLabelOnlyComponent\n muiProps={muiProps}\n odysseyDesignTokens={odysseyDesignTokens}\n option={option}\n />\n ) : hasMetadata ? (\n <OptionLabelDescriptionMetadata\n muiProps={muiProps}\n odysseyDesignTokens={odysseyDesignTokens}\n option={option}\n />\n ) : (\n <OptionLabelDescription\n muiProps={muiProps}\n odysseyDesignTokens={odysseyDesignTokens}\n option={option}\n />\n )}\n </Fragment>\n );\n },\n [odysseyDesignTokens],\n );\n\n return (\n <ComposablePicker<OptionType, HasMultipleChoices, IsCustomValueAllowed>\n ariaDescribedBy={ariaDescribedBy}\n defaultValue={defaultValue}\n emptyOptionsText={emptyOptionsText}\n errorMessage={errorMessage}\n errorMessageList={errorMessageList}\n getIsOptionEqualToValue={getIsOptionEqualToValue}\n hasMultipleChoices={hasMultipleChoices}\n hint={hint}\n HintLinkComponent={HintLinkComponent}\n id={idOverride}\n inputValue={inputValue}\n isCustomValueAllowed={isCustomValueAllowed}\n isDisabled={isDisabled}\n isFullWidth={isFullWidth}\n isLoading={isLoading}\n isOptional={isOptional}\n isReadOnly={isReadOnly}\n isVirtualized={isVirtualizedProp}\n label={label}\n name={nameOverride}\n onBlur={onBlur}\n onChange={onChangeProp}\n onFocus={onFocus}\n onInputChange={onInputChangeProp}\n options={options}\n renderOption={customOptionRender}\n testId={testId}\n translate={translate}\n value={value}\n />\n );\n};\n\n// Need the `as BasePickerType` because generics don't get passed through\nconst MemoizedPicker = memo(Picker) as BasePickerType;\n\nMemoizedPicker.displayName = \"Picker\";\n\nexport { MemoizedPicker as Picker };\n"],"mappings":";;;;;;AAYA,IAAAA,OAAA,GAAAC,sBAAA,CAAAC,OAAA;AAEA,IAAAC,MAAA,GAAAD,OAAA;AASA,IAAAE,2BAAA,GAAAF,OAAA;AAIA,IAAAG,WAAA,GAAAH,OAAA;AACA,IAAAI,iBAAA,GAAAJ,OAAA;AAK+B,IAAAK,WAAA,GAAAL,OAAA;AAAA,SAAAD,uBAAAO,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAjC/B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAyBO,MAAMG,YAAY,GAAAC,OAAA,CAAAD,YAAA,GAAGE,eAAM,CAACC,EAAE,CACnC,CAAC;EAAEC;AAAa,CAAC,MAAM;EACrB,IAAI,CAACA,YAAY,IAAI;IACnBC,OAAO,EAAE;EACX,CAAC;AACH,CAAC,CACH,CAAC;AAEM,MAAMC,oBAAoB,GAAAL,OAAA,CAAAK,oBAAA,GAAG,IAAAJ,eAAM,EAAC,KAAK,EAAE;EAChDK,iBAAiB,EAAGC,IAAI,IAAKA,IAAI,KAAK;AACxC,CAAC,CAAC,CAAwC,OAAO;EAC/CC,CAAC,EAAE;IACDC,MAAM,EAAE;EACV;AACF,CAAC,CAAC,CAAC;AAEI,MAAMC,iBAAiB,GAAAV,OAAA,CAAAU,iBAAA,GAAG,IAAAT,eAAM,EAAC,GAAG,EAAE;EAC3CK,iBAAiB,EAAGC,IAAI,IAAKA,IA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EC,YAAa;IACnBC,MAAM,EAAEA,MAAO;IACfC,QAAQ,EAAEC,YAAa;IACvBG,OAAO,EAAEA,OAAQ;IACjBF,aAAa,EAAEC,iBAAkB;IACjCE,OAAO,EAAEA,OAAQ;IACjBY,YAAY,EAAEP,kBAAmB;IACjCH,MAAM,EAAEA,MAAO;IACfC,SAAS,EAAEA,SAAU;IACrBF,KAAK,EAAEA;EAAM,CACd,CAAC;AAEN,CAAC;AAGD,MAAMY,cAAc,GAAA7F,OAAA,CAAAmD,MAAA,GAAG,IAAA2C,WAAI,EAAC3C,MAAM,CAAmB;AAErD0C,cAAc,CAACE,WAAW,GAAG,QAAQ","ignoreList":[]}
1
+ {"version":3,"file":"Picker.cjs","names":["_styled","_interopRequireDefault","require","_react","_OdysseyDesignTokensContext","_Typography","_ComposablePicker","_jsxRuntime","e","__esModule","default","StyledOption","exports","styled","li","hasAdornment","display","OptionLabelContainer","shouldForwardProp","prop","p","margin","OptionDescription","odysseyDesignTokens","Spacing1","color","TypographyColorSubordinate","OptionDetails","gap","Spacing3","marginBlockStart","Spacing2","OptionDetail","alignItems","svg","width","Spacing4","HueNeutral400","Option","children","muiProps","key","props","createElement","OptionMetadataComponent","metaData","jsx","map","meta","index","detailText","icon","jsxs","OptionDescriptionComponent","description","OptionLabelOnlyComponent","option","label","Paragraph","OptionLabelDescription","Heading6","component","OptionLabelDescriptionMetadata","Picker","ariaDescribedBy","defaultValue","emptyOptionsText","errorMessage","errorMessageList","getIsOptionEqualToValue","groupOptionsBy","hasMultipleChoices","id","idOverride","inputValue","isCustomValueAllowed","isDisabled","isFullWidth","isLoading","isOptional","isReadOnly","isVirtualized","isVirtualizedProp","hint","HintLinkComponent","name","nameOverride","onBlur","onChange","onChangeProp","onInputChange","onInputChangeProp","onFocus","options","value","testId","translate","useOdysseyDesignTokens","customOptionRender","useCallback","hasDescription","hasMetadata","isLabelOnly","Fragment","ComposablePicker","renderOption","MemoizedPicker","memo","displayName"],"sources":["../../../../src/labs/OdysseyPickers/Picker.tsx"],"sourcesContent":["/*!\n * Copyright (c) 2023-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *\n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport styled from \"@emotion/styled\";\nimport { AutocompleteProps as MuiAutocompleteProps } from \"@mui/material\";\nimport {\n FC,\n Fragment,\n memo,\n PropsWithChildren,\n ReactElement,\n ReactNode,\n useCallback,\n} from \"react\";\n\nimport {\n DesignTokens,\n useOdysseyDesignTokens,\n} from \"../../OdysseyDesignTokensContext.js\";\nimport { Heading6, Paragraph } from \"../../Typography.js\";\nimport {\n type BasePickerProps,\n type BaseRenderOptionProps,\n ComposablePicker,\n} from \"./ComposablePicker.js\";\n\nexport const StyledOption = styled.li<{ hasAdornment?: boolean }>(\n ({ hasAdornment }) => ({\n ...(!hasAdornment && {\n display: \"block !important\",\n }),\n }),\n);\n\nexport const OptionLabelContainer = styled(\"div\", {\n shouldForwardProp: (prop) => prop !== \"odysseyDesignTokens\",\n})<{ odysseyDesignTokens: DesignTokens }>(() => ({\n p: {\n margin: 0,\n },\n}));\n\nexport const OptionDescription = styled(\"p\", {\n shouldForwardProp: (prop) => prop !== \"odysseyDesignTokens\",\n})<{ odysseyDesignTokens: DesignTokens }>(({ odysseyDesignTokens }) => ({\n margin: `${odysseyDesignTokens.Spacing1} 0 0 !important`,\n color: odysseyDesignTokens.TypographyColorSubordinate,\n}));\n\nexport const OptionDetails = styled(\"div\", {\n shouldForwardProp: (prop) => prop !== \"odysseyDesignTokens\",\n})<{ odysseyDesignTokens: DesignTokens }>(({ odysseyDesignTokens }) => ({\n display: \"flex\",\n gap: odysseyDesignTokens.Spacing3,\n marginBlockStart: odysseyDesignTokens.Spacing2,\n}));\n\nexport const OptionDetail = styled(\"div\", {\n shouldForwardProp: (prop) => prop !== \"odysseyDesignTokens\",\n})<{ odysseyDesignTokens: DesignTokens }>(({ odysseyDesignTokens }) => ({\n display: \"flex\",\n alignItems: \"center\",\n gap: odysseyDesignTokens.Spacing1,\n\n svg: {\n width: odysseyDesignTokens.Spacing4,\n color: odysseyDesignTokens.HueNeutral400,\n },\n}));\n\nexport type BaseOptionProps = {\n muiProps: BaseRenderOptionProps;\n odysseyDesignTokens: DesignTokens;\n};\n\ntype OptionComponentProps = {\n hasAdornment?: boolean;\n muiProps: BaseOptionProps[\"muiProps\"];\n};\n\nexport const Option = ({\n children,\n hasAdornment = false,\n muiProps,\n}: PropsWithChildren<OptionComponentProps>) => {\n const { key, ...props } = muiProps;\n return (\n <StyledOption {...props} hasAdornment={hasAdornment} key={key}>\n {children}\n </StyledOption>\n );\n};\n\nexport const OptionMetadataComponent = ({\n metaData,\n odysseyDesignTokens,\n}: {\n metaData: OptionMetadata[];\n odysseyDesignTokens: DesignTokens;\n}) => {\n return (\n <OptionDetails odysseyDesignTokens={odysseyDesignTokens}>\n {metaData.map((meta: OptionMetadata, index: number) => {\n const { detailText, icon } = meta;\n return (\n <OptionDetail\n key={`${detailText}-${index}`}\n odysseyDesignTokens={odysseyDesignTokens}\n >\n {icon}\n {detailText}\n </OptionDetail>\n );\n })}\n </OptionDetails>\n );\n};\n\nexport const OptionDescriptionComponent = ({\n description,\n odysseyDesignTokens,\n}: {\n description?: LabelDescription[\"description\"];\n odysseyDesignTokens: DesignTokens;\n}) => {\n return (\n description && (\n <OptionDescription odysseyDesignTokens={odysseyDesignTokens}>\n {description}\n </OptionDescription>\n )\n );\n};\n\nexport type OptionProps<OptionType> = {\n option: OptionType;\n};\n\nexport const OptionLabelOnlyComponent = <OptionType extends OptionLabelOnly>({\n muiProps,\n odysseyDesignTokens,\n option,\n}: BaseOptionProps & OptionProps<OptionType>) => {\n const { label } = option;\n\n return (\n <Option muiProps={muiProps}>\n <OptionLabelContainer odysseyDesignTokens={odysseyDesignTokens}>\n <Paragraph>{label}</Paragraph>\n </OptionLabelContainer>\n </Option>\n );\n};\n\nconst OptionLabelDescription = <OptionType extends LabelDescription>({\n muiProps,\n odysseyDesignTokens,\n option,\n}: BaseOptionProps & OptionProps<OptionType>) => {\n const { description, label } = option;\n\n return (\n <Option muiProps={muiProps}>\n <OptionLabelContainer odysseyDesignTokens={odysseyDesignTokens}>\n <Heading6 component=\"p\">{label}</Heading6>\n <OptionDescriptionComponent\n description={description}\n odysseyDesignTokens={odysseyDesignTokens}\n />\n </OptionLabelContainer>\n </Option>\n );\n};\n\nconst OptionLabelDescriptionMetadata = <\n OptionType extends LabelDescriptionMetadata,\n>({\n muiProps,\n odysseyDesignTokens,\n option,\n}: BaseOptionProps & OptionProps<OptionType>) => {\n const { description, label, metaData } = option;\n\n return (\n <Option muiProps={muiProps}>\n <OptionLabelContainer odysseyDesignTokens={odysseyDesignTokens}>\n <Heading6 component=\"p\">{label}</Heading6>\n <OptionDescriptionComponent\n description={description}\n odysseyDesignTokens={odysseyDesignTokens}\n />\n </OptionLabelContainer>\n <OptionMetadataComponent\n metaData={metaData}\n odysseyDesignTokens={odysseyDesignTokens}\n />\n </Option>\n );\n};\n\nexport type OptionMetadata = {\n detailText: string | number;\n icon: ReactElement;\n};\n\nexport type OptionGroupType = { group?: string };\nexport type OptionValueType = { value: string | number };\nexport type OptionLabelType = { label: string };\nexport type BaseOptionType = OptionValueType &\n OptionGroupType &\n OptionLabelType;\nexport type Metadata = {\n metaData: OptionMetadata[];\n};\n\nexport type OptionLabelOnly = BaseOptionType;\nexport type LabelDescription = BaseOptionType & { description?: string };\nexport type LabelDescriptionMetadata = LabelDescription & Metadata;\n\nexport type PickerProps<\n OptionType extends\n | OptionLabelOnly\n | LabelDescription\n | LabelDescriptionMetadata,\n HasMultipleChoices extends boolean | undefined,\n IsCustomValueAllowed extends boolean | undefined,\n> = Omit<\n BasePickerProps<OptionType, HasMultipleChoices, IsCustomValueAllowed>,\n \"adornmentSize\" | \"getOptionLabel\" | \"noOptionsText\"\n>;\n\nexport type PickerComponentType = {\n <\n OptionType extends OptionLabelOnly,\n HasMultipleChoices extends boolean | undefined,\n IsCustomValueAllowed extends boolean | undefined,\n >(\n props: PickerProps<OptionType, HasMultipleChoices, IsCustomValueAllowed>,\n ): ReactNode;\n <\n OptionType extends LabelDescription,\n HasMultipleChoices extends boolean | undefined,\n IsCustomValueAllowed extends boolean | undefined,\n >(\n props: PickerProps<OptionType, HasMultipleChoices, IsCustomValueAllowed>,\n ): ReactNode;\n <\n OptionType extends LabelDescriptionMetadata,\n HasMultipleChoices extends boolean | undefined,\n IsCustomValueAllowed extends boolean | undefined,\n >(\n props: PickerProps<OptionType, HasMultipleChoices, IsCustomValueAllowed>,\n ): ReactNode;\n};\n\nconst Picker: PickerComponentType = <\n OptionType extends\n | OptionLabelOnly\n | LabelDescription\n | LabelDescriptionMetadata,\n HasMultipleChoices extends boolean | undefined,\n IsCustomValueAllowed extends boolean | undefined,\n>({\n ariaDescribedBy,\n defaultValue,\n emptyOptionsText,\n errorMessage,\n errorMessageList,\n getIsOptionEqualToValue,\n groupOptionsBy,\n hasMultipleChoices,\n id: idOverride,\n inputValue,\n isCustomValueAllowed,\n isDisabled,\n isFullWidth = false,\n isLoading,\n isOptional = false,\n isReadOnly,\n isVirtualized: isVirtualizedProp = false,\n hint,\n HintLinkComponent,\n label,\n name: nameOverride,\n onBlur,\n onChange: onChangeProp,\n onInputChange: onInputChangeProp,\n onFocus,\n options,\n value,\n testId,\n translate,\n}: PickerProps<OptionType, HasMultipleChoices, IsCustomValueAllowed>) => {\n const odysseyDesignTokens = useOdysseyDesignTokens();\n\n const customOptionRender = useCallback<\n NonNullable<\n MuiAutocompleteProps<\n OptionType,\n HasMultipleChoices,\n undefined,\n IsCustomValueAllowed\n >[\"renderOption\"]\n >\n >(\n (muiProps, option) => {\n const hasDescription = \"description\" in option && option.description;\n const hasMetadata = \"metaData\" in option && option.metaData;\n const isLabelOnly = !hasMetadata && !hasDescription;\n\n return (\n <Fragment key={option.value}>\n {isLabelOnly ? (\n <OptionLabelOnlyComponent\n muiProps={muiProps}\n odysseyDesignTokens={odysseyDesignTokens}\n option={option}\n />\n ) : hasMetadata ? (\n <OptionLabelDescriptionMetadata\n muiProps={muiProps}\n odysseyDesignTokens={odysseyDesignTokens}\n option={option}\n />\n ) : (\n <OptionLabelDescription\n muiProps={muiProps}\n odysseyDesignTokens={odysseyDesignTokens}\n option={option}\n />\n )}\n </Fragment>\n );\n },\n [odysseyDesignTokens],\n );\n\n return (\n <ComposablePicker<OptionType, HasMultipleChoices, IsCustomValueAllowed>\n ariaDescribedBy={ariaDescribedBy}\n defaultValue={defaultValue}\n emptyOptionsText={emptyOptionsText}\n errorMessage={errorMessage}\n errorMessageList={errorMessageList}\n getIsOptionEqualToValue={getIsOptionEqualToValue}\n groupOptionsBy={groupOptionsBy}\n hasMultipleChoices={hasMultipleChoices}\n hint={hint}\n HintLinkComponent={HintLinkComponent}\n id={idOverride}\n inputValue={inputValue}\n isCustomValueAllowed={isCustomValueAllowed}\n isDisabled={isDisabled}\n isFullWidth={isFullWidth}\n isLoading={isLoading}\n isOptional={isOptional}\n isReadOnly={isReadOnly}\n isVirtualized={isVirtualizedProp}\n label={label}\n name={nameOverride}\n onBlur={onBlur}\n onChange={onChangeProp}\n onFocus={onFocus}\n onInputChange={onInputChangeProp}\n options={options}\n renderOption={customOptionRender}\n testId={testId}\n translate={translate}\n value={value}\n />\n );\n};\n\nconst MemoizedPicker = memo(Picker) as PickerComponentType &\n Pick<FC, \"displayName\">;\nMemoizedPicker.displayName = \"Picker\";\n\nexport { MemoizedPicker as Picker };\n"],"mappings":";;;;;;AAYA,IAAAA,OAAA,GAAAC,sBAAA,CAAAC,OAAA;AAEA,IAAAC,MAAA,GAAAD,OAAA;AAUA,IAAAE,2BAAA,GAAAF,OAAA;AAIA,IAAAG,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GAAG,QAAQ","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"PickerWithOptionAdornment.cjs","names":["_styled","_interopRequireDefault","require","_react","_Box","_OdysseyDesignTokensContext","_Tag","_pxToRem","_Typography","_ComposablePicker","_Picker","_jsxRuntime","e","__esModule","default","OptionAdornmentContainer","styled","shouldForwardProp","prop","adornmentSize","isTagContainer","odysseyDesignTokens","position","bottom","alignSelf","width","Spacing5","height","overflow","marginInlineEnd","Spacing3","flexShrink","svg","img","top","left","transform","Spacing8","Spacing4","maxHeight","Spacing2","pxToRem","display","OptionAdornment","adornment","isImageAdornment","jsx","children","alt","role","src","OptionWithLabelDescriptionOnly","muiProps","option","description","label","value","jsxs","Option","hasAdornment","OptionLabelContainer","Heading6","component","OptionDescriptionComponent","OptionWithLabelDescriptionMetadata","metaData","OptionMetadataComponent","TagAdornment","useOdysseyDesignTokens","PickerWithOptionAdornment","ariaDescribedBy","defaultValue","emptyOptionsText","errorMessage","errorMessageList","getIsOptionEqualToValue","groupOptionsBy","hasMultipleChoices","id","idOverride","inputValue","isCustomValueAllowed","isDisabled","isFullWidth","isLoading","isOptional","isReadOnly","isVirtualized","isVirtualizedProp","hint","HintLinkComponent","name","nameOverride","onBlur","onChange","onChangeProp","onInputChange","onInputChangeProp","onFocus","options","testId","translate","customTagRender","useCallback","values","getTagProps","map","index","key","onDelete","Box","sx","margin","Spacing1","Tag","icon","onRemove","customOptionRender","hasMetadata","Fragment","ComposablePicker","renderOption","renderTags","MemoizedPickerWithOptionAdornment","exports","memo","displayName"],"sources":["../../../../src/labs/OdysseyPickers/PickerWithOptionAdornment.tsx"],"sourcesContent":["/*!\n * Copyright (c) 2023-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *\n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport styled from \"@emotion/styled\";\nimport { AutocompleteProps as MuiAutocompleteProps } from \"@mui/material\";\nimport { Fragment, memo, ReactNode, useCallback } from \"react\";\n\nimport { Box } from \"../../Box.js\";\nimport {\n DesignTokens,\n useOdysseyDesignTokens,\n} from \"../../OdysseyDesignTokensContext.js\";\nimport { Tag } from \"../../Tag.js\";\nimport { pxToRem } from \"../../theme/pxToRem.js\";\nimport { Heading6 } from \"../../Typography.js\";\nimport {\n type AdornmentSize,\n type BasePickerProps,\n type BasePickerType,\n ComposablePicker,\n ComposablePickerProps,\n} from \"./ComposablePicker.js\";\nimport {\n type BaseOptionProps,\n type LabelDescription,\n type Metadata,\n Option,\n OptionDescriptionComponent,\n OptionLabelContainer,\n OptionMetadataComponent,\n OptionProps,\n} from \"./Picker.js\";\n\ntype Adornment = ReactNode | string;\n\ntype AdornmentLabelDescription = LabelDescription & {\n adornment: Adornment;\n};\n\ntype AdornmentLabelDescriptionMetadata = AdornmentLabelDescription & Metadata;\n\nexport type AdornmentOptionType =\n | AdornmentLabelDescription\n | AdornmentLabelDescriptionMetadata;\n\nconst OptionAdornmentContainer = styled(\"div\", {\n shouldForwardProp: (prop) =>\n prop !== \"odysseyDesignTokens\" &&\n prop !== \"adornmentSize\" &&\n prop !== \"isTagContainer\",\n})<{\n adornmentSize?: AdornmentSize;\n isTagContainer?: boolean;\n odysseyDesignTokens: DesignTokens;\n}>(\n ({\n adornmentSize = \"small\",\n isTagContainer = false,\n odysseyDesignTokens,\n }) => ({\n position: \"relative\",\n // push icon up by one px for better visual alignment\n bottom: \"1px\",\n alignSelf: \"flex-start\",\n width: odysseyDesignTokens.Spacing5,\n height: odysseyDesignTokens.Spacing5,\n overflow: \"hidden\",\n marginInlineEnd: odysseyDesignTokens.Spacing3,\n flexShrink: 0,\n\n svg: {\n width: \"100%\",\n height: \"auto\",\n },\n\n img: {\n position: \"absolute\",\n top: \"50%\",\n left: \"50%\",\n width: \"100%\",\n transform: \"translate(-50%, -50%)\",\n },\n\n ...(adornmentSize === \"large\" &&\n !isTagContainer && {\n bottom: 0,\n width: odysseyDesignTokens.Spacing8,\n height: odysseyDesignTokens.Spacing8,\n }),\n\n ...(isTagContainer && {\n bottom: 0,\n alignSelf: \"center\",\n width: odysseyDesignTokens.Spacing4,\n height: \"auto\",\n maxHeight: odysseyDesignTokens.Spacing4,\n marginInlineEnd: odysseyDesignTokens.Spacing2,\n\n \"&:has(> img)\": {\n height: `${pxToRem(16)}rem`,\n },\n\n svg: {\n display: \"flex\",\n width: \"100%\",\n height: \"auto\",\n },\n }),\n }),\n);\n\ntype OptionAdornmentProps = {\n adornment: Adornment;\n adornmentSize: AdornmentSize;\n odysseyDesignTokens: DesignTokens;\n};\n\nconst OptionAdornment = ({\n adornment,\n adornmentSize,\n odysseyDesignTokens,\n}: OptionAdornmentProps) => {\n const isImageAdornment = typeof adornment === \"string\";\n\n if (isImageAdornment) {\n return (\n <OptionAdornmentContainer\n adornmentSize={adornmentSize}\n odysseyDesignTokens={odysseyDesignTokens}\n >\n {/* NOTE: Intentionally leaving alt as an empty string here so screen readers will ignore this image */}\n {/* Image should be sufficiently described by the adjacent title and/or description of the option */}\n <img alt=\"\" role=\"presentation\" src={adornment} />\n </OptionAdornmentContainer>\n );\n } else {\n return (\n <OptionAdornmentContainer\n adornmentSize={adornmentSize}\n odysseyDesignTokens={odysseyDesignTokens}\n >\n {adornment}\n </OptionAdornmentContainer>\n );\n }\n};\n\nconst OptionWithLabelDescriptionOnly = <\n OptionType extends AdornmentLabelDescription,\n>({\n adornmentSize,\n muiProps,\n odysseyDesignTokens,\n option,\n}: BaseOptionProps &\n OptionProps<OptionType> & { adornmentSize: AdornmentSize }) => {\n const { adornment, description, label, value } = option;\n return (\n <Option hasAdornment key={value} muiProps={muiProps}>\n <OptionAdornment\n adornment={adornment}\n adornmentSize={adornmentSize}\n odysseyDesignTokens={odysseyDesignTokens}\n />\n <OptionLabelContainer odysseyDesignTokens={odysseyDesignTokens}>\n <Heading6 component=\"p\">{label}</Heading6>\n <OptionDescriptionComponent\n description={description}\n odysseyDesignTokens={odysseyDesignTokens}\n />\n </OptionLabelContainer>\n </Option>\n );\n};\n\nconst OptionWithLabelDescriptionMetadata = <\n OptionType extends AdornmentLabelDescriptionMetadata,\n>({\n adornmentSize,\n muiProps,\n odysseyDesignTokens,\n option,\n}: BaseOptionProps &\n OptionProps<OptionType> & {\n adornmentSize: AdornmentSize;\n }) => {\n const { adornment, description, label, metaData, value } = option;\n\n return (\n <Option hasAdornment key={value} muiProps={muiProps}>\n <OptionAdornment\n adornment={adornment}\n adornmentSize={adornmentSize}\n odysseyDesignTokens={odysseyDesignTokens}\n />\n <div>\n <OptionLabelContainer odysseyDesignTokens={odysseyDesignTokens}>\n <Heading6 component=\"p\">{label}</Heading6>\n <OptionDescriptionComponent\n description={description}\n odysseyDesignTokens={odysseyDesignTokens}\n />\n </OptionLabelContainer>\n <OptionMetadataComponent\n metaData={metaData}\n odysseyDesignTokens={odysseyDesignTokens}\n />\n </div>\n </Option>\n );\n};\n\ntype TagAdornmentProps = {\n adornment: Adornment;\n};\n\nconst TagAdornment = ({ adornment }: TagAdornmentProps) => {\n const odysseyDesignTokens = useOdysseyDesignTokens();\n const isImageAdornment = typeof adornment === \"string\";\n\n if (isImageAdornment) {\n return (\n <OptionAdornmentContainer\n isTagContainer\n odysseyDesignTokens={odysseyDesignTokens}\n >\n <img alt=\"\" role=\"presentation\" src={adornment} />\n </OptionAdornmentContainer>\n );\n }\n\n return (\n <OptionAdornmentContainer\n isTagContainer\n odysseyDesignTokens={odysseyDesignTokens}\n >\n {adornment}\n </OptionAdornmentContainer>\n );\n};\n\nexport type PickerWithOptionAdornmentProps<\n OptionType extends AdornmentOptionType,\n HasMultipleChoices extends boolean | undefined,\n IsCustomValueAllowed extends boolean | undefined,\n> = BasePickerProps<OptionType, HasMultipleChoices, IsCustomValueAllowed> & {\n adornmentSize?: AdornmentSize;\n};\n\ntype PickerWithOptionAdornmentComponentType = {\n <\n OptionType extends AdornmentLabelDescription,\n HasMultipleChoices extends boolean | undefined,\n IsCustomValueAllowed extends boolean | undefined,\n >(\n props: PickerWithOptionAdornmentProps<\n OptionType,\n HasMultipleChoices,\n IsCustomValueAllowed\n >,\n ): ReactNode;\n <\n OptionType extends AdornmentLabelDescriptionMetadata,\n HasMultipleChoices extends boolean | undefined,\n IsCustomValueAllowed extends boolean | undefined,\n >(\n props: PickerWithOptionAdornmentProps<\n OptionType,\n HasMultipleChoices,\n IsCustomValueAllowed\n >,\n ): ReactNode;\n};\n\nconst PickerWithOptionAdornment: PickerWithOptionAdornmentComponentType = <\n OptionType extends AdornmentOptionType,\n HasMultipleChoices extends boolean | undefined,\n IsCustomValueAllowed extends boolean | undefined,\n>({\n adornmentSize = \"small\",\n ariaDescribedBy,\n defaultValue,\n emptyOptionsText,\n errorMessage,\n errorMessageList,\n getIsOptionEqualToValue,\n groupOptionsBy,\n hasMultipleChoices,\n id: idOverride,\n inputValue,\n isCustomValueAllowed,\n isDisabled,\n isFullWidth = false,\n isLoading,\n isOptional = false,\n isReadOnly,\n isVirtualized: isVirtualizedProp = false,\n hint,\n HintLinkComponent,\n label,\n name: nameOverride,\n onBlur,\n onChange: onChangeProp,\n onInputChange: onInputChangeProp,\n onFocus,\n options,\n value,\n testId,\n translate,\n}: PickerWithOptionAdornmentProps<\n OptionType,\n HasMultipleChoices,\n IsCustomValueAllowed\n>) => {\n const odysseyDesignTokens = useOdysseyDesignTokens();\n\n const customTagRender = useCallback<\n NonNullable<\n ComposablePickerProps<\n OptionType,\n HasMultipleChoices,\n IsCustomValueAllowed\n >[\"renderTags\"]\n >\n >(\n (values, getTagProps) =>\n values.map((value, index) => {\n const { key, onDelete } = getTagProps({ index });\n const { adornment, label } = value;\n\n return (\n <Box\n key={key}\n sx={{\n margin: odysseyDesignTokens.Spacing1,\n marginInlineEnd: 0,\n }}\n >\n <Tag\n icon={<TagAdornment adornment={adornment} />}\n label={label}\n onRemove={onDelete}\n />\n </Box>\n );\n }),\n [odysseyDesignTokens],\n );\n\n const customOptionRender = useCallback<\n NonNullable<\n MuiAutocompleteProps<\n OptionType,\n HasMultipleChoices,\n undefined,\n IsCustomValueAllowed\n >[\"renderOption\"]\n >\n >(\n (muiProps, option) => {\n const hasMetadata = \"metaData\" in option && option.metaData;\n\n return (\n <Fragment key={option.value}>\n {hasMetadata ? (\n <OptionWithLabelDescriptionMetadata\n adornmentSize={adornmentSize}\n muiProps={muiProps}\n odysseyDesignTokens={odysseyDesignTokens}\n option={option}\n />\n ) : (\n <OptionWithLabelDescriptionOnly\n adornmentSize={adornmentSize}\n muiProps={muiProps}\n odysseyDesignTokens={odysseyDesignTokens}\n option={option}\n />\n )}\n </Fragment>\n );\n },\n [adornmentSize, odysseyDesignTokens],\n );\n\n return (\n <ComposablePicker<OptionType, HasMultipleChoices, IsCustomValueAllowed>\n ariaDescribedBy={ariaDescribedBy}\n defaultValue={defaultValue}\n emptyOptionsText={emptyOptionsText}\n errorMessage={errorMessage}\n errorMessageList={errorMessageList}\n getIsOptionEqualToValue={getIsOptionEqualToValue}\n groupOptionsBy={groupOptionsBy}\n hasMultipleChoices={hasMultipleChoices}\n hint={hint}\n HintLinkComponent={HintLinkComponent}\n id={idOverride}\n inputValue={inputValue}\n isCustomValueAllowed={isCustomValueAllowed}\n isDisabled={isDisabled}\n isFullWidth={isFullWidth}\n isLoading={isLoading}\n isOptional={isOptional}\n isReadOnly={isReadOnly}\n isVirtualized={isVirtualizedProp}\n label={label}\n name={nameOverride}\n onBlur={onBlur}\n onChange={onChangeProp}\n onFocus={onFocus}\n onInputChange={onInputChangeProp}\n options={options}\n renderOption={customOptionRender}\n renderTags={customTagRender}\n testId={testId}\n translate={translate}\n value={value}\n />\n );\n};\n\n// Need the `as BasePickerType` because generics don't get passed through\nconst MemoizedPickerWithOptionAdornment = memo(\n PickerWithOptionAdornment,\n) as BasePickerType;\n\nMemoizedPickerWithOptionAdornment.displayName = \"PickerWithOptionAdornment\";\n\nexport { MemoizedPickerWithOptionAdornment as PickerWithOptionAdornment };\n"],"mappings":";;;;;;AAYA,IAAAA,OAAA,GAAAC,sBAAA,CAAAC,OAAA;AAEA,IAAAC,MAAA,GAAAD,OAAA;AAEA,IAAAE,IAAA,GAAAF,OAAA;AACA,IAAAG,2BAAA,GAAAH,OAAA;AAIA,IAAAI,IAAA,GAAAJ,OAAA;AACA,IAAAK,QAAA,GAAAL,OAAA;AACA,IAAAM,WAAA,GAAAN,OAAA;AACA,IAAAO,iBAAA,GAAAP,OAAA;AAOA,IAAAQ,OAAA,GAAAR,OAAA;AASqB,IAAAS,WAAA,GAAAT,OAAA;AAAA,SAAAD,uBAAAW,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAxCrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AA4CA,MAAMG,wBAAwB,GAAG,IAAAC,eAAM,EAAC,KAAK,EAAE;EAC7CC,iBAAiB,EAAGC,IAAI,IACtBA,IAAI,KAAK,qBAAqB,IAC9BA,IAAI,KAAK,eAAe,IACxBA,IAAI,KAAK;AACb,CAAC,CAAC,CAKA,CAAC;EACCC,aAAa,GAAG,OAAO;EACvBC,cAAc,GAAG,KAAK;EACtBC;AACF,CAAC,MAAM;EACLC,QAAQ,EAAE,UAAU;EAEpBC,MAAM,EAAE,KAAK;EACbC,SAAS,EAAE,YAAY;EACvBC,KAAK,EAAEJ,mBAAmB,CAACK,QAAQ;EACnCC,MAAM,EAAEN,mBAAmB,CAACK,QAAQ;EACpCE,QAAQ,EAAE,QAAQ;EAClBC,eAAe,EAAER,mBAAmB,CAACS,QAAQ;EAC7CC,UAAU,EAAE,CAAC;EAEbC,GAAG,EAAE;IACHP,KAAK,EAAE,MAAM;IACbE,MAAM,EAAE;EACV,CAAC;EAE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eAAe,EAAEA,eAAgB;IACjCC,YAAY,EAAEA,YAAa;IAC3BC,gBAAgB,EAAEA,gBAAiB;IACnCC,YAAY,EAAEA,YAAa;IAC3BC,gBAAgB,EAAEA,gBAAiB;IACnCC,uBAAuB,EAAEA,uBAAwB;IACjDC,cAAc,EAAEA,cAAe;IAC/BC,kBAAkB,EAAEA,kBAAmB;IACvCY,IAAI,EAAEA,IAAK;IACXC,iBAAiB,EAAEA,iBAAkB;IACrCZ,EAAE,EAAEC,UAAW;IACfC,UAAU,EAAEA,UAAW;IACvBC,oBAAoB,EAAEA,oBAAqB;IAC3CC,UAAU,EAAEA,UAAW;IACvBC,WAAW,EAAEA,WAAY;IACzBC,SAAS,EAAEA,SAAU;IACrBC,UAAU,EAAEA,UAAW;IACvBC,UAAU,EAAEA,UAAW;IACvBC,aAAa,EAAEC,iBAAkB;IACjCjC,KAAK,EAAEA,KAAM;IACboC,IAAI,EAAEC,YAAa;IACnBC,MAAM,EAAEA,MAAO;IACfC,QAAQ,EAAEC,YAAa;IACvBG,OAAO,EAAEA,OAAQ;IACjBF,aAAa,EAAEC,iBAAkB;IACjCE,OAAO,EAAEA,OAAQ;IACjBsB,YAAY,EAAEJ,kBAAmB;IACjCK,UAAU,EAAEpB,eAAgB;IAC5BF,MAAM,EAAEA,MAAO;IACfC,SAAS,EAAEA,SAAU;IACrB7C,KAAK,EAAEA;EAAM,CACd,CAAC;AAEN,CAAC;AAGD,MAAMmE,iCAAiC,GAAAC,OAAA,CAAAvD,yBAAA,GAAG,IAAAwD,WAAI,EAC5CxD,yBACF,CAAmB;AAEnBsD,iCAAiC,CAACG,WAAW,GAAG,2BAA2B","ignoreList":[]}
1
+ {"version":3,"file":"PickerWithOptionAdornment.cjs","names":["_styled","_interopRequireDefault","require","_react","_Box","_OdysseyDesignTokensContext","_Tag","_pxToRem","_Typography","_ComposablePicker","_Picker","_jsxRuntime","e","__esModule","default","OptionAdornmentContainer","styled","shouldForwardProp","prop","adornmentSize","isTagContainer","odysseyDesignTokens","position","bottom","alignSelf","width","Spacing5","height","overflow","marginInlineEnd","Spacing3","flexShrink","svg","img","top","left","transform","Spacing8","Spacing4","maxHeight","Spacing2","pxToRem","display","OptionAdornment","adornment","isImageAdornment","jsx","children","alt","role","src","OptionWithLabelDescriptionOnly","muiProps","option","description","label","value","jsxs","Option","hasAdornment","OptionLabelContainer","Heading6","component","OptionDescriptionComponent","OptionWithLabelDescriptionMetadata","metaData","OptionMetadataComponent","TagAdornment","useOdysseyDesignTokens","PickerWithOptionAdornment","ariaDescribedBy","defaultValue","emptyOptionsText","errorMessage","errorMessageList","getIsOptionEqualToValue","groupOptionsBy","hasMultipleChoices","id","idOverride","inputValue","isCustomValueAllowed","isDisabled","isFullWidth","isLoading","isOptional","isReadOnly","isVirtualized","isVirtualizedProp","hint","HintLinkComponent","name","nameOverride","onBlur","onChange","onChangeProp","onInputChange","onInputChangeProp","onFocus","options","testId","translate","customTagRender","useCallback","values","getTagProps","map","index","key","onDelete","Box","sx","margin","Spacing1","Tag","icon","onRemove","customOptionRender","hasMetadata","Fragment","ComposablePicker","renderOption","renderTags","MemoizedPickerWithOptionAdornment","exports","memo","displayName"],"sources":["../../../../src/labs/OdysseyPickers/PickerWithOptionAdornment.tsx"],"sourcesContent":["/*!\n * Copyright (c) 2023-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *\n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport styled from \"@emotion/styled\";\nimport { AutocompleteProps as MuiAutocompleteProps } from \"@mui/material\";\nimport { FC, Fragment, memo, ReactNode, useCallback } from \"react\";\n\nimport { Box } from \"../../Box.js\";\nimport {\n DesignTokens,\n useOdysseyDesignTokens,\n} from \"../../OdysseyDesignTokensContext.js\";\nimport { Tag } from \"../../Tag.js\";\nimport { pxToRem } from \"../../theme/pxToRem.js\";\nimport { Heading6 } from \"../../Typography.js\";\nimport {\n type AdornmentSize,\n type BasePickerProps,\n ComposablePicker,\n ComposablePickerProps,\n} from \"./ComposablePicker.js\";\nimport {\n type BaseOptionProps,\n type LabelDescription,\n type Metadata,\n Option,\n OptionDescriptionComponent,\n OptionLabelContainer,\n OptionMetadataComponent,\n OptionProps,\n} from \"./Picker.js\";\n\ntype Adornment = ReactNode | string;\n\ntype AdornmentLabelDescription = LabelDescription & {\n adornment: Adornment;\n};\n\ntype AdornmentLabelDescriptionMetadata = AdornmentLabelDescription & Metadata;\n\nexport type AdornmentOptionType =\n | AdornmentLabelDescription\n | AdornmentLabelDescriptionMetadata;\n\nconst OptionAdornmentContainer = styled(\"div\", {\n shouldForwardProp: (prop) =>\n prop !== \"odysseyDesignTokens\" &&\n prop !== \"adornmentSize\" &&\n prop !== \"isTagContainer\",\n})<{\n adornmentSize?: AdornmentSize;\n isTagContainer?: boolean;\n odysseyDesignTokens: DesignTokens;\n}>(\n ({\n adornmentSize = \"small\",\n isTagContainer = false,\n odysseyDesignTokens,\n }) => ({\n position: \"relative\",\n // push icon up by one px for better visual alignment\n bottom: \"1px\",\n alignSelf: \"flex-start\",\n width: odysseyDesignTokens.Spacing5,\n height: odysseyDesignTokens.Spacing5,\n overflow: \"hidden\",\n marginInlineEnd: odysseyDesignTokens.Spacing3,\n flexShrink: 0,\n\n svg: {\n width: \"100%\",\n height: \"auto\",\n },\n\n img: {\n position: \"absolute\",\n top: \"50%\",\n left: \"50%\",\n width: \"100%\",\n transform: \"translate(-50%, -50%)\",\n },\n\n ...(adornmentSize === \"large\" &&\n !isTagContainer && {\n bottom: 0,\n width: odysseyDesignTokens.Spacing8,\n height: odysseyDesignTokens.Spacing8,\n }),\n\n ...(isTagContainer && {\n bottom: 0,\n alignSelf: \"center\",\n width: odysseyDesignTokens.Spacing4,\n height: \"auto\",\n maxHeight: odysseyDesignTokens.Spacing4,\n marginInlineEnd: odysseyDesignTokens.Spacing2,\n\n \"&:has(> img)\": {\n height: `${pxToRem(16)}rem`,\n },\n\n svg: {\n display: \"flex\",\n width: \"100%\",\n height: \"auto\",\n },\n }),\n }),\n);\n\ntype OptionAdornmentProps = {\n adornment: Adornment;\n adornmentSize: AdornmentSize;\n odysseyDesignTokens: DesignTokens;\n};\n\nconst OptionAdornment = ({\n adornment,\n adornmentSize,\n odysseyDesignTokens,\n}: OptionAdornmentProps) => {\n const isImageAdornment = typeof adornment === \"string\";\n\n if (isImageAdornment) {\n return (\n <OptionAdornmentContainer\n adornmentSize={adornmentSize}\n odysseyDesignTokens={odysseyDesignTokens}\n >\n {/* NOTE: Intentionally leaving alt as an empty string here so screen readers will ignore this image */}\n {/* Image should be sufficiently described by the adjacent title and/or description of the option */}\n <img alt=\"\" role=\"presentation\" src={adornment} />\n </OptionAdornmentContainer>\n );\n } else {\n return (\n <OptionAdornmentContainer\n adornmentSize={adornmentSize}\n odysseyDesignTokens={odysseyDesignTokens}\n >\n {adornment}\n </OptionAdornmentContainer>\n );\n }\n};\n\nconst OptionWithLabelDescriptionOnly = <\n OptionType extends AdornmentLabelDescription,\n>({\n adornmentSize,\n muiProps,\n odysseyDesignTokens,\n option,\n}: BaseOptionProps &\n OptionProps<OptionType> & { adornmentSize: AdornmentSize }) => {\n const { adornment, description, label, value } = option;\n return (\n <Option hasAdornment key={value} muiProps={muiProps}>\n <OptionAdornment\n adornment={adornment}\n adornmentSize={adornmentSize}\n odysseyDesignTokens={odysseyDesignTokens}\n />\n <OptionLabelContainer odysseyDesignTokens={odysseyDesignTokens}>\n <Heading6 component=\"p\">{label}</Heading6>\n <OptionDescriptionComponent\n description={description}\n odysseyDesignTokens={odysseyDesignTokens}\n />\n </OptionLabelContainer>\n </Option>\n );\n};\n\nconst OptionWithLabelDescriptionMetadata = <\n OptionType extends AdornmentLabelDescriptionMetadata,\n>({\n adornmentSize,\n muiProps,\n odysseyDesignTokens,\n option,\n}: BaseOptionProps &\n OptionProps<OptionType> & {\n adornmentSize: AdornmentSize;\n }) => {\n const { adornment, description, label, metaData, value } = option;\n\n return (\n <Option hasAdornment key={value} muiProps={muiProps}>\n <OptionAdornment\n adornment={adornment}\n adornmentSize={adornmentSize}\n odysseyDesignTokens={odysseyDesignTokens}\n />\n <div>\n <OptionLabelContainer odysseyDesignTokens={odysseyDesignTokens}>\n <Heading6 component=\"p\">{label}</Heading6>\n <OptionDescriptionComponent\n description={description}\n odysseyDesignTokens={odysseyDesignTokens}\n />\n </OptionLabelContainer>\n <OptionMetadataComponent\n metaData={metaData}\n odysseyDesignTokens={odysseyDesignTokens}\n />\n </div>\n </Option>\n );\n};\n\ntype TagAdornmentProps = {\n adornment: Adornment;\n};\n\nconst TagAdornment = ({ adornment }: TagAdornmentProps) => {\n const odysseyDesignTokens = useOdysseyDesignTokens();\n const isImageAdornment = typeof adornment === \"string\";\n\n if (isImageAdornment) {\n return (\n <OptionAdornmentContainer\n isTagContainer\n odysseyDesignTokens={odysseyDesignTokens}\n >\n <img alt=\"\" role=\"presentation\" src={adornment} />\n </OptionAdornmentContainer>\n );\n }\n\n return (\n <OptionAdornmentContainer\n isTagContainer\n odysseyDesignTokens={odysseyDesignTokens}\n >\n {adornment}\n </OptionAdornmentContainer>\n );\n};\n\nexport type PickerWithOptionAdornmentProps<\n OptionType extends AdornmentOptionType,\n HasMultipleChoices extends boolean | undefined,\n IsCustomValueAllowed extends boolean | undefined,\n> = Omit<\n BasePickerProps<OptionType, HasMultipleChoices, IsCustomValueAllowed>,\n \"getOptionLabel\" | \"noOptionsText\"\n>;\n\ntype PickerWithOptionAdornmentComponentType = {\n <\n OptionType extends AdornmentLabelDescription,\n HasMultipleChoices extends boolean | undefined,\n IsCustomValueAllowed extends boolean | undefined,\n >(\n props: PickerWithOptionAdornmentProps<\n OptionType,\n HasMultipleChoices,\n IsCustomValueAllowed\n >,\n ): ReactNode;\n <\n OptionType extends AdornmentLabelDescriptionMetadata,\n HasMultipleChoices extends boolean | undefined,\n IsCustomValueAllowed extends boolean | undefined,\n >(\n props: PickerWithOptionAdornmentProps<\n OptionType,\n HasMultipleChoices,\n IsCustomValueAllowed\n >,\n ): ReactNode;\n};\n\nconst PickerWithOptionAdornment: PickerWithOptionAdornmentComponentType = <\n OptionType extends AdornmentOptionType,\n HasMultipleChoices extends boolean | undefined,\n IsCustomValueAllowed extends boolean | undefined,\n>({\n adornmentSize = \"small\",\n ariaDescribedBy,\n defaultValue,\n emptyOptionsText,\n errorMessage,\n errorMessageList,\n getIsOptionEqualToValue,\n groupOptionsBy,\n hasMultipleChoices,\n id: idOverride,\n inputValue,\n isCustomValueAllowed,\n isDisabled,\n isFullWidth = false,\n isLoading,\n isOptional = false,\n isReadOnly,\n isVirtualized: isVirtualizedProp = false,\n hint,\n HintLinkComponent,\n label,\n name: nameOverride,\n onBlur,\n onChange: onChangeProp,\n onInputChange: onInputChangeProp,\n onFocus,\n options,\n value,\n testId,\n translate,\n}: PickerWithOptionAdornmentProps<\n OptionType,\n HasMultipleChoices,\n IsCustomValueAllowed\n>) => {\n const odysseyDesignTokens = useOdysseyDesignTokens();\n\n const customTagRender = useCallback<\n NonNullable<\n ComposablePickerProps<\n OptionType,\n HasMultipleChoices,\n IsCustomValueAllowed\n >[\"renderTags\"]\n >\n >(\n (values, getTagProps) =>\n values.map((value, index) => {\n const { key, onDelete } = getTagProps({ index });\n const { adornment, label } = value;\n\n return (\n <Box\n key={key}\n sx={{\n margin: odysseyDesignTokens.Spacing1,\n marginInlineEnd: 0,\n }}\n >\n <Tag\n icon={<TagAdornment adornment={adornment} />}\n label={label}\n onRemove={onDelete}\n />\n </Box>\n );\n }),\n [odysseyDesignTokens],\n );\n\n const customOptionRender = useCallback<\n NonNullable<\n MuiAutocompleteProps<\n OptionType,\n HasMultipleChoices,\n undefined,\n IsCustomValueAllowed\n >[\"renderOption\"]\n >\n >(\n (muiProps, option) => {\n const hasMetadata = \"metaData\" in option && option.metaData;\n\n return (\n <Fragment key={option.value}>\n {hasMetadata ? (\n <OptionWithLabelDescriptionMetadata\n adornmentSize={adornmentSize}\n muiProps={muiProps}\n odysseyDesignTokens={odysseyDesignTokens}\n option={option}\n />\n ) : (\n <OptionWithLabelDescriptionOnly\n adornmentSize={adornmentSize}\n muiProps={muiProps}\n odysseyDesignTokens={odysseyDesignTokens}\n option={option}\n />\n )}\n </Fragment>\n );\n },\n [adornmentSize, odysseyDesignTokens],\n );\n\n return (\n <ComposablePicker<OptionType, HasMultipleChoices, IsCustomValueAllowed>\n ariaDescribedBy={ariaDescribedBy}\n defaultValue={defaultValue}\n emptyOptionsText={emptyOptionsText}\n errorMessage={errorMessage}\n errorMessageList={errorMessageList}\n getIsOptionEqualToValue={getIsOptionEqualToValue}\n groupOptionsBy={groupOptionsBy}\n hasMultipleChoices={hasMultipleChoices}\n hint={hint}\n HintLinkComponent={HintLinkComponent}\n id={idOverride}\n inputValue={inputValue}\n isCustomValueAllowed={isCustomValueAllowed}\n isDisabled={isDisabled}\n isFullWidth={isFullWidth}\n isLoading={isLoading}\n isOptional={isOptional}\n isReadOnly={isReadOnly}\n isVirtualized={isVirtualizedProp}\n label={label}\n name={nameOverride}\n onBlur={onBlur}\n onChange={onChangeProp}\n onFocus={onFocus}\n onInputChange={onInputChangeProp}\n options={options}\n renderOption={customOptionRender}\n renderTags={customTagRender}\n testId={testId}\n translate={translate}\n value={value}\n />\n );\n};\n\nconst MemoizedPickerWithOptionAdornment = memo(\n PickerWithOptionAdornment,\n) as PickerWithOptionAdornmentComponentType & Pick<FC, \"displayName\">;\nMemoizedPickerWithOptionAdornment.displayName = \"PickerWithOptionAdornment\";\n\nexport { MemoizedPickerWithOptionAdornment as PickerWithOptionAdornment };\n"],"mappings":";;;;;;AAYA,IAAAA,OAAA,GAAAC,sBAAA,CAAAC,OAAA;AAEA,IAAAC,MAAA,GAAAD,OAAA;AAEA,IAAAE,IAAA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;IACvCY,IAAI,EAAEA,IAAK;IACXC,iBAAiB,EAAEA,iBAAkB;IACrCZ,EAAE,EAAEC,UAAW;IACfC,UAAU,EAAEA,UAAW;IACvBC,oBAAoB,EAAEA,oBAAqB;IAC3CC,UAAU,EAAEA,UAAW;IACvBC,WAAW,EAAEA,WAAY;IACzBC,SAAS,EAAEA,SAAU;IACrBC,UAAU,EAAEA,UAAW;IACvBC,UAAU,EAAEA,UAAW;IACvBC,aAAa,EAAEC,iBAAkB;IACjCjC,KAAK,EAAEA,KAAM;IACboC,IAAI,EAAEC,YAAa;IACnBC,MAAM,EAAEA,MAAO;IACfC,QAAQ,EAAEC,YAAa;IACvBG,OAAO,EAAEA,OAAQ;IACjBF,aAAa,EAAEC,iBAAkB;IACjCE,OAAO,EAAEA,OAAQ;IACjBsB,YAAY,EAAEJ,kBAAmB;IACjCK,UAAU,EAAEpB,eAAgB;IAC5BF,MAAM,EAAEA,MAAO;IACfC,SAAS,EAAEA,SAAU;IACrB7C,KAAK,EAAEA;EAAM,CACd,CAAC;AAEN,CAAC;AAED,MAAMmE,iCAAiC,GAAAC,OAAA,CAAAvD,yBAAA,GAAG,IAAAwD,WAAI,EAC5CxD,yBACF,CAAqE;AACrEsD,iCAAiC,CAACG,WAAW,GAAG,2BAA2B","ignoreList":[]}
@@ -71,6 +71,7 @@ const UiShell = ({
71
71
  onError: onError,
72
72
  children: (0, _jsxRuntime.jsx)(_OdysseyProvider.OdysseyProvider, {
73
73
  emotionRootElement: uiShellStylesElement,
74
+ fullScreenOverlayId: "odyssey-react-overlay-component-render-ui-shell",
74
75
  hasCssBaseline: true,
75
76
  shadowRootElement: uiShellAppElement,
76
77
  children: (0, _jsxRuntime.jsx)(_reactErrorBoundary.ErrorBoundary, {
@@ -1 +1 @@
1
- {"version":3,"file":"UiShell.cjs","names":["_react","require","_reactErrorBoundary","_OdysseyProvider","_NarrowUiShellContent","_UiShellProvider","_useUiShellBreakpoints","_WideUiShellContent","_jsxRuntime","defaultComponentProps","exports","sideNavProps","undefined","topNavProps","errorComponent","jsx","UiShell","appBackgroundColor","appBackgroundContrastMode","appElement","appElementScrollingMode","breakpointConfig","closeSideNavMenu","hasStandardAppContentPadding","initialVisibleSections","onError","console","error","onSubscriptionCreated","optionalComponents","sideNavBackgroundColor","sideNavBackgroundContrastColor","subscribeToCloseRightSideMenu","subscribeToCloseSideNavMenu","subscribeToPropChanges","topNavBackgroundColor","uiShellAppElement","uiShellStylesElement","componentProps","setComponentProps","useState","activeBreakpoint","useUiShellBreakpoints","logoProps","Error","useEffect","unsubscribe","ErrorBoundary","fallback","children","OdysseyProvider","emotionRootElement","hasCssBaseline","shadowRootElement","jsxs","UiShellProvider","NarrowUiShellContent","hasSideNavProps","Boolean","WideUiShellContent","hasSessionStorageState","isCollapsed","isCollapsible","MemoizedUiShell","memo","displayName"],"sources":["../../../src/ui-shell/UiShell.tsx"],"sourcesContent":["/*!\n * Copyright (c) 2024-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *\n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport { memo, type SetStateAction, useEffect, useState } from \"react\";\nimport { ErrorBoundary } from \"react-error-boundary\";\n\nimport { OdysseyProvider } from \"../OdysseyProvider.js\";\nimport { MessageBus } from \"../tools/createMessageBus.js\";\nimport { type ReactRootElements } from \"../web-component/createReactRootElements.js\";\nimport { NarrowUiShellContent } from \"./NarrowUiShellContent.js\";\nimport {\n UiShellContentProps,\n UiShellNavComponentProps,\n} from \"./uiShellContentTypes.js\";\nimport { UiShellProvider, UiShellProviderProps } from \"./UiShellProvider.js\";\nimport {\n UiShellBreakpointConfig,\n useUiShellBreakpoints,\n} from \"./useUiShellBreakpoints.js\";\nimport { WideUiShellContent } from \"./WideUiShellContent.js\";\n\nexport const defaultComponentProps: UiShellNavComponentProps = {\n sideNavProps: undefined,\n topNavProps: undefined,\n} as const;\n\nconst errorComponent = <div data-error />;\n\nexport type UiShellProps = {\n /**\n * Customized breakpoints for UI Shell.\n *\n * The defaults are set for you. Pass these only if your app doesn't work properly with the defaults (like Admin).\n */\n breakpointConfig?: UiShellBreakpointConfig;\n /**\n * Notifies when subscribed to prop changes.\n *\n * UI Shell listens to prop updates, and it won't subscribe synchronously. Because of that, this callback notifies when that subscription is ready.\n */\n onSubscriptionCreated: () => void;\n /**\n * This is a callback that provides a subscriber callback to listen for changes to state.\n * It allows UI Shell to listen for state changes.\n *\n * The props coming in this callback go directly to a React state; therefore, it shares the same signature and provides a previous state.\n */\n subscribeToPropChanges: MessageBus<\n SetStateAction<UiShellNavComponentProps>\n >[\"subscribe\"];\n /**\n * Element inside UI Shell's React root component renders into. If using a web component, this is going to exist inside it.\n */\n uiShellAppElement: ReactRootElements[\"appRootElement\"];\n /**\n * Typically, this is your `<head>` element. If using a web component, you need to create one yourself as Shadow DOM's don't have a `<head>`.\n */\n uiShellStylesElement: ReactRootElements[\"stylesRootElement\"];\n} & UiShellProviderProps &\n Pick<\n UiShellContentProps,\n | \"appElement\"\n | \"appElementScrollingMode\"\n | \"hasStandardAppContentPadding\"\n | \"initialVisibleSections\"\n | \"onError\"\n | \"optionalComponents\"\n >;\n\n/**\n * Our new Unified Platform UI Shell.\n *\n * This includes the top and side navigation as well as the footer and provides a spot for your app to render into.\n *\n * If an error occurs, this will revert to only showing the app.\n */\nconst UiShell = ({\n appBackgroundColor,\n appBackgroundContrastMode,\n appElement,\n appElementScrollingMode,\n breakpointConfig,\n closeSideNavMenu,\n hasStandardAppContentPadding,\n initialVisibleSections,\n onError = console.error,\n onSubscriptionCreated,\n optionalComponents,\n sideNavBackgroundColor,\n sideNavBackgroundContrastColor,\n subscribeToCloseRightSideMenu,\n subscribeToCloseSideNavMenu,\n subscribeToPropChanges,\n topNavBackgroundColor,\n uiShellAppElement,\n uiShellStylesElement,\n}: UiShellProps) => {\n const [componentProps, setComponentProps] = useState(defaultComponentProps);\n\n const activeBreakpoint = useUiShellBreakpoints(breakpointConfig);\n\n if (componentProps.sideNavProps?.logoProps && componentProps.logoProps) {\n throw new Error(\n \"Unified UI Shell: You passed both `logoProps` and `sideNavProps.logoProps` as component props. Please only use the top-level `logoProps` instead.\",\n );\n }\n\n useEffect(() => {\n const unsubscribe = subscribeToPropChanges((componentProps) => {\n // If for some reason nothing is passed as `componentProps`, we fallback on `defaultComponentProps` as a safety mechanism to ensure nothing breaks.\n setComponentProps(componentProps || defaultComponentProps);\n });\n\n onSubscriptionCreated();\n\n return () => {\n unsubscribe();\n };\n }, [onSubscriptionCreated, subscribeToPropChanges]);\n\n return activeBreakpoint === \"none\" ? null : (\n <ErrorBoundary fallback={errorComponent} onError={onError}>\n <OdysseyProvider\n emotionRootElement={uiShellStylesElement}\n hasCssBaseline\n shadowRootElement={uiShellAppElement}\n >\n <ErrorBoundary fallback={errorComponent} onError={onError}>\n <UiShellProvider\n appBackgroundColor={appBackgroundColor}\n appBackgroundContrastMode={appBackgroundContrastMode}\n closeSideNavMenu={closeSideNavMenu}\n sideNavBackgroundColor={sideNavBackgroundColor}\n sideNavBackgroundContrastColor={sideNavBackgroundContrastColor}\n subscribeToCloseRightSideMenu={subscribeToCloseRightSideMenu}\n subscribeToCloseSideNavMenu={subscribeToCloseSideNavMenu}\n topNavBackgroundColor={topNavBackgroundColor}\n >\n {activeBreakpoint === \"narrow\" && (\n <NarrowUiShellContent\n {...componentProps}\n appElement={appElement}\n appElementScrollingMode={appElementScrollingMode}\n hasSideNavProps={Boolean(componentProps.sideNavProps)}\n hasStandardAppContentPadding={hasStandardAppContentPadding}\n initialVisibleSections={initialVisibleSections}\n onError={onError}\n optionalComponents={optionalComponents}\n />\n )}\n\n {(activeBreakpoint === \"medium\" || activeBreakpoint === \"wide\") && (\n <WideUiShellContent\n {...{\n ...componentProps,\n ...{\n sideNavProps: {\n ...componentProps.sideNavProps,\n hasSessionStorageState: activeBreakpoint === \"wide\",\n isCollapsed:\n activeBreakpoint === \"medium\" ||\n componentProps.sideNavProps?.isCollapsed,\n isCollapsible:\n activeBreakpoint === \"medium\" ||\n componentProps.sideNavProps?.isCollapsible,\n logoProps:\n componentProps.sideNavProps?.logoProps ||\n componentProps.logoProps,\n } as typeof componentProps.sideNavProps, // We have to use `as` because sideNavProps expects you to have `sideNavItems` defined even though it had to be passed in `...componentProps.sideNavProps`.\n },\n }}\n appElement={appElement}\n appElementScrollingMode={appElementScrollingMode}\n hasSideNavProps={Boolean(componentProps.sideNavProps)}\n hasStandardAppContentPadding={hasStandardAppContentPadding}\n initialVisibleSections={initialVisibleSections}\n onError={onError}\n optionalComponents={optionalComponents}\n />\n )}\n </UiShellProvider>\n </ErrorBoundary>\n </OdysseyProvider>\n </ErrorBoundary>\n );\n};\n\nconst MemoizedUiShell = memo(UiShell);\nMemoizedUiShell.displayName = \"UiShell\";\n\nexport { MemoizedUiShell as UiShell };\n"],"mappings":";;;;;;AAYA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,mBAAA,GAAAD,OAAA;AAEA,IAAAE,gBAAA,GAAAF,OAAA;AAGA,IAAAG,qBAAA,GAAAH,OAAA;AAKA,IAAAI,gBAAA,GAAAJ,OAAA;AACA,IAAAK,sBAAA,GAAAL,OAAA;AAIA,IAAAM,mBAAA,GAAAN,OAAA;AAA6D,IAAAO,WAAA,GAAAP,OAAA;AA5B7D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAoBO,MAAMQ,qBAA+C,GAAAC,OAAA,CAAAD,qBAAA,GAAG;EAC7DE,YAAY,EAAEC,SAAS;EACvBC,WAAW,EAAED;AACf,CAAU;AAEV,MAAME,cAAc,GAAG,IAAAN,WAAA,CAAAO,GAAA;EAAK;AAAU,CAAE,CAAC;AAkDzC,MA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B,gBAAgB,KAAK,QAAQ,IAC7BH,cAAc,CAAC3B,YAAY,EAAEmD,aAAa;gBAC5CnB,SAAS,EACPL,cAAc,CAAC3B,YAAY,EAAEgC,SAAS,IACtCL,cAAc,CAACK;cACnB;YACF,CAAC;YAEHxB,UAAU,EAAEA,UAAW;YACvBC,uBAAuB,EAAEA,uBAAwB;YACjDqC,eAAe,EAAEC,OAAO,CAACpB,cAAc,CAAC3B,YAAY,CAAE;YACtDY,4BAA4B,EAAEA,4BAA6B;YAC3DC,sBAAsB,EAAEA,sBAAuB;YAC/CC,OAAO,EAAEA,OAAQ;YACjBI,kBAAkB,EAAEA;UAAmB,CACxC,CACF;QAAA,CACc;MAAC,CACL;IAAC,CACD;EAAC,CACL,CAChB;AACH,CAAC;AAED,MAAMkC,eAAe,GAAArD,OAAA,CAAAM,OAAA,GAAG,IAAAgD,WAAI,EAAChD,OAAO,CAAC;AACrC+C,eAAe,CAACE,WAAW,GAAG,SAAS","ignoreList":[]}
1
+ {"version":3,"file":"UiShell.cjs","names":["_react","require","_reactErrorBoundary","_OdysseyProvider","_NarrowUiShellContent","_UiShellProvider","_useUiShellBreakpoints","_WideUiShellContent","_jsxRuntime","defaultComponentProps","exports","sideNavProps","undefined","topNavProps","errorComponent","jsx","UiShell","appBackgroundColor","appBackgroundContrastMode","appElement","appElementScrollingMode","breakpointConfig","closeSideNavMenu","hasStandardAppContentPadding","initialVisibleSections","onError","console","error","onSubscriptionCreated","optionalComponents","sideNavBackgroundColor","sideNavBackgroundContrastColor","subscribeToCloseRightSideMenu","subscribeToCloseSideNavMenu","subscribeToPropChanges","topNavBackgroundColor","uiShellAppElement","uiShellStylesElement","componentProps","setComponentProps","useState","activeBreakpoint","useUiShellBreakpoints","logoProps","Error","useEffect","unsubscribe","ErrorBoundary","fallback","children","OdysseyProvider","emotionRootElement","fullScreenOverlayId","hasCssBaseline","shadowRootElement","jsxs","UiShellProvider","NarrowUiShellContent","hasSideNavProps","Boolean","WideUiShellContent","hasSessionStorageState","isCollapsed","isCollapsible","MemoizedUiShell","memo","displayName"],"sources":["../../../src/ui-shell/UiShell.tsx"],"sourcesContent":["/*!\n * Copyright (c) 2024-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *\n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport { memo, type SetStateAction, useEffect, useState } from \"react\";\nimport { ErrorBoundary } from \"react-error-boundary\";\n\nimport { OdysseyProvider } from \"../OdysseyProvider.js\";\nimport { MessageBus } from \"../tools/createMessageBus.js\";\nimport { type ReactRootElements } from \"../web-component/createReactRootElements.js\";\nimport { NarrowUiShellContent } from \"./NarrowUiShellContent.js\";\nimport {\n UiShellContentProps,\n UiShellNavComponentProps,\n} from \"./uiShellContentTypes.js\";\nimport { UiShellProvider, UiShellProviderProps } from \"./UiShellProvider.js\";\nimport {\n UiShellBreakpointConfig,\n useUiShellBreakpoints,\n} from \"./useUiShellBreakpoints.js\";\nimport { WideUiShellContent } from \"./WideUiShellContent.js\";\n\nexport const defaultComponentProps: UiShellNavComponentProps = {\n sideNavProps: undefined,\n topNavProps: undefined,\n} as const;\n\nconst errorComponent = <div data-error />;\n\nexport type UiShellProps = {\n /**\n * Customized breakpoints for UI Shell.\n *\n * The defaults are set for you. Pass these only if your app doesn't work properly with the defaults (like Admin).\n */\n breakpointConfig?: UiShellBreakpointConfig;\n /**\n * Notifies when subscribed to prop changes.\n *\n * UI Shell listens to prop updates, and it won't subscribe synchronously. Because of that, this callback notifies when that subscription is ready.\n */\n onSubscriptionCreated: () => void;\n /**\n * This is a callback that provides a subscriber callback to listen for changes to state.\n * It allows UI Shell to listen for state changes.\n *\n * The props coming in this callback go directly to a React state; therefore, it shares the same signature and provides a previous state.\n */\n subscribeToPropChanges: MessageBus<\n SetStateAction<UiShellNavComponentProps>\n >[\"subscribe\"];\n /**\n * Element inside UI Shell's React root component renders into. If using a web component, this is going to exist inside it.\n */\n uiShellAppElement: ReactRootElements[\"appRootElement\"];\n /**\n * Typically, this is your `<head>` element. If using a web component, you need to create one yourself as Shadow DOM's don't have a `<head>`.\n */\n uiShellStylesElement: ReactRootElements[\"stylesRootElement\"];\n} & UiShellProviderProps &\n Pick<\n UiShellContentProps,\n | \"appElement\"\n | \"appElementScrollingMode\"\n | \"hasStandardAppContentPadding\"\n | \"initialVisibleSections\"\n | \"onError\"\n | \"optionalComponents\"\n >;\n\n/**\n * Our new Unified Platform UI Shell.\n *\n * This includes the top and side navigation as well as the footer and provides a spot for your app to render into.\n *\n * If an error occurs, this will revert to only showing the app.\n */\nconst UiShell = ({\n appBackgroundColor,\n appBackgroundContrastMode,\n appElement,\n appElementScrollingMode,\n breakpointConfig,\n closeSideNavMenu,\n hasStandardAppContentPadding,\n initialVisibleSections,\n onError = console.error,\n onSubscriptionCreated,\n optionalComponents,\n sideNavBackgroundColor,\n sideNavBackgroundContrastColor,\n subscribeToCloseRightSideMenu,\n subscribeToCloseSideNavMenu,\n subscribeToPropChanges,\n topNavBackgroundColor,\n uiShellAppElement,\n uiShellStylesElement,\n}: UiShellProps) => {\n const [componentProps, setComponentProps] = useState(defaultComponentProps);\n\n const activeBreakpoint = useUiShellBreakpoints(breakpointConfig);\n\n if (componentProps.sideNavProps?.logoProps && componentProps.logoProps) {\n throw new Error(\n \"Unified UI Shell: You passed both `logoProps` and `sideNavProps.logoProps` as component props. Please only use the top-level `logoProps` instead.\",\n );\n }\n\n useEffect(() => {\n const unsubscribe = subscribeToPropChanges((componentProps) => {\n // If for some reason nothing is passed as `componentProps`, we fallback on `defaultComponentProps` as a safety mechanism to ensure nothing breaks.\n setComponentProps(componentProps || defaultComponentProps);\n });\n\n onSubscriptionCreated();\n\n return () => {\n unsubscribe();\n };\n }, [onSubscriptionCreated, subscribeToPropChanges]);\n\n return activeBreakpoint === \"none\" ? null : (\n <ErrorBoundary fallback={errorComponent} onError={onError}>\n <OdysseyProvider\n emotionRootElement={uiShellStylesElement}\n fullScreenOverlayId=\"odyssey-react-overlay-component-render-ui-shell\"\n hasCssBaseline\n shadowRootElement={uiShellAppElement}\n >\n <ErrorBoundary fallback={errorComponent} onError={onError}>\n <UiShellProvider\n appBackgroundColor={appBackgroundColor}\n appBackgroundContrastMode={appBackgroundContrastMode}\n closeSideNavMenu={closeSideNavMenu}\n sideNavBackgroundColor={sideNavBackgroundColor}\n sideNavBackgroundContrastColor={sideNavBackgroundContrastColor}\n subscribeToCloseRightSideMenu={subscribeToCloseRightSideMenu}\n subscribeToCloseSideNavMenu={subscribeToCloseSideNavMenu}\n topNavBackgroundColor={topNavBackgroundColor}\n >\n {activeBreakpoint === \"narrow\" && (\n <NarrowUiShellContent\n {...componentProps}\n appElement={appElement}\n appElementScrollingMode={appElementScrollingMode}\n hasSideNavProps={Boolean(componentProps.sideNavProps)}\n hasStandardAppContentPadding={hasStandardAppContentPadding}\n initialVisibleSections={initialVisibleSections}\n onError={onError}\n optionalComponents={optionalComponents}\n />\n )}\n\n {(activeBreakpoint === \"medium\" || activeBreakpoint === \"wide\") && (\n <WideUiShellContent\n {...{\n ...componentProps,\n ...{\n sideNavProps: {\n ...componentProps.sideNavProps,\n hasSessionStorageState: activeBreakpoint === \"wide\",\n isCollapsed:\n activeBreakpoint === \"medium\" ||\n componentProps.sideNavProps?.isCollapsed,\n isCollapsible:\n activeBreakpoint === \"medium\" ||\n componentProps.sideNavProps?.isCollapsible,\n logoProps:\n componentProps.sideNavProps?.logoProps ||\n componentProps.logoProps,\n } as typeof componentProps.sideNavProps, // We have to use `as` because sideNavProps expects you to have `sideNavItems` defined even though it had to be passed in `...componentProps.sideNavProps`.\n },\n }}\n appElement={appElement}\n appElementScrollingMode={appElementScrollingMode}\n hasSideNavProps={Boolean(componentProps.sideNavProps)}\n hasStandardAppContentPadding={hasStandardAppContentPadding}\n initialVisibleSections={initialVisibleSections}\n onError={onError}\n optionalComponents={optionalComponents}\n />\n )}\n </UiShellProvider>\n </ErrorBoundary>\n </OdysseyProvider>\n </ErrorBoundary>\n );\n};\n\nconst MemoizedUiShell = memo(UiShell);\nMemoizedUiShell.displayName = \"UiShell\";\n\nexport { MemoizedUiShell as UiShell };\n"],"mappings":";;;;;;AAYA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,mBAAA,GAAAD,OAAA;AAEA,IAAAE,gBAAA,GAAAF,OAAA;AAGA,IAAAG,qBAAA,GAAAH,OAAA;AAKA,IAAAI,gBAAA,GAAAJ,OAAA;AACA,IAAAK,sBAAA,GAAAL,OAAA;AAIA,IAAAM,mBAAA,GAAAN,OAAA;AAA6D,IAAAO,WAAA,GAAAP,OAAA;AA5B7D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAoBO,MAAMQ,qBAA+C,GAAAC,OAAA,CAAAD,qBAAA,GAAG;EAC7DE,YAAY,EAAEC,SAAS;EACvBC,WAAW,EAAED;AACf,CAAU;AAEV,MAAME,cAAc,GAAG,IAAAN,WAAA,CAAAO,GAAA;EAAK;AAAU,CAAE,CAAC;AAkDzC,MAAMC,OAAO,GAAGA,CAAC;EACfC,kBAAkB;EAClBC,yBAAyB;EACzBC,UAAU;EACVC,uBAAuB;EACvBC,gBAAgB;EAChBC,gBAAgB;EAChBC,4BAA4B;EAC5BC,sBAAsB;EACtBC,OAAO,GAAGC,OAAO,CAACC,KAAK;EACvBC,qBAAqB;EACrBC,kBAAkB;EAClBC,sBAAsB;EACtBC,8BAA8B;EAC9BC,6BAA6B;EAC7BC,2BAA2B;EAC3BC,sBAAsB;EACtBC,qBAAqB;EACrBC,iBAAiB;EACjBC;AACY,CAAC,KAAK;EAClB,MAAM,CAACC,cAAc,EAAEC,iBAAiB,CAAC,GAAG,IAAAC,eAAQ,EAAC/B,q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AAmB,CACxC,CACF;QAAA,CACc;MAAC,CACL;IAAC,CACD;EAAC,CACL,CAChB;AACH,CAAC;AAED,MAAMmC,eAAe,GAAAtD,OAAA,CAAAM,OAAA,GAAG,IAAAiD,WAAI,EAACjD,OAAO,CAAC;AACrCgD,eAAe,CAACE,WAAW,GAAG,SAAS","ignoreList":[]}
@@ -15,5 +15,5 @@ exports.default = void 0;
15
15
  *
16
16
  * See the License for the specific language governing permissions and limitations under the License.
17
17
  */
18
- var _default = exports.default = "1-52-1";
18
+ var _default = exports.default = "1-54-0";
19
19
  //# sourceMappingURL=odysseyWebComponentVersion.generated.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"odysseyWebComponentVersion.generated.cjs","names":["_default","exports","default"],"sources":["../../../src/web-component/odysseyWebComponentVersion.generated.ts"],"sourcesContent":["/*!\n * Copyright (c) 2024-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *\n * See the License for the specific language governing permissions and limitations under the License.\n */\n\n/**\n * DO NOT UPDATE THIS FILE MANUALLY\n * This file is managed by scripts/updateWebComponentVersion.ts and any changes made will be overwritten\n * This script only needs to be run during release, and shouldn't be used during local development.\n */\n\nexport default \"1-52-1\";\n"],"mappings":";;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAVA,IAAAA,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAkBe,QAAQ","ignoreList":[]}
1
+ {"version":3,"file":"odysseyWebComponentVersion.generated.cjs","names":["_default","exports","default"],"sources":["../../../src/web-component/odysseyWebComponentVersion.generated.ts"],"sourcesContent":["/*!\n * Copyright (c) 2024-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *\n * See the License for the specific language governing permissions and limitations under the License.\n */\n\n/**\n * DO NOT UPDATE THIS FILE MANUALLY\n * This file is managed by scripts/updateWebComponentVersion.ts and any changes made will be overwritten\n * This script only needs to be run during release, and shouldn't be used during local development.\n */\n\nexport default \"1-54-0\";\n"],"mappings":";;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAVA,IAAAA,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAkBe,QAAQ","ignoreList":[]}
package/dist/esm/Field.js CHANGED
@@ -17,9 +17,9 @@ import { FieldHint } from "./FieldHint.js";
17
17
  import { FieldLabel } from "./FieldLabel.js";
18
18
  import { useFieldset } from "./FieldsetContext.js";
19
19
  import { useTranslation } from "./i18n.generated/i18n.js";
20
- import { Typography } from "./Typography.js";
20
+ import { Subordinate } from "./Typography.js";
21
21
  import { useUniqueId } from "./useUniqueId.js";
22
- import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
22
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
23
23
  export const fieldTypeValues = ["single", "group"];
24
24
  const Field = ({
25
25
  ariaDescribedBy,
@@ -59,10 +59,8 @@ const Field = ({
59
59
  children: [fieldType === "group" ? _jsxs(_FormLabel, {
60
60
  component: "legend",
61
61
  id: labelElementId,
62
- children: [label, " ", isOptional && label && _jsxs(Typography, {
63
- color: "textSecondary",
64
- component: "span",
65
- children: ["(", t("fieldlabel.optional.text"), ")"]
62
+ children: [label, " ", isOptional && label && _jsx(Subordinate, {
63
+ children: t("fieldlabel.optional.text")
66
64
  })]
67
65
  }) : _jsx(FieldLabel, {
68
66
  hasVisibleLabel: hasVisibleLabel,
@@ -1 +1 @@
1
- {"version":3,"file":"Field.js","names":["memo","useMemo","FieldError","FieldHint","FieldLabel","useFieldset","useTranslation","Typography","useUniqueId","jsxs","_jsxs","jsx","_jsx","fieldTypeValues","Field","ariaDescribedBy","errorMessage","errorMessageList","fieldType","hasVisibleLabel","hint","HintLinkComponent","id","idOverride","isDisabled","isDisabledProp","isFullWidth","isRadioGroup","isOptional","isReadOnly","label","renderFieldComponent","t","hintId","undefined","errorMessageElementId","labelElementId","localAriaDescribedBy","join","trim","isFieldsetDisabled","_FormControl","component","disabled","error","Boolean","Array","isArray","length","fullWidth","role","children","_FormLabel","color","inputId","text","LinkComponent","message","messageList","MemoizedField","displayName"],"sources":["../../src/Field.tsx"],"sourcesContent":["/*!\n * Copyright (c) 2022-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *\n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport {\n FormControl as MuiFormControl,\n FormLabel as MuiFormLabel,\n} from \"@mui/material\";\nimport { memo, ReactElement, useMemo } from \"react\";\n\nimport { FieldComponentProps } from \"./FieldComponentProps.js\";\nimport { FieldError } from \"./FieldError.js\";\nimport { FieldHint } from \"./FieldHint.js\";\nimport { FieldLabel } from \"./FieldLabel.js\";\nimport { useFieldset } from \"./FieldsetContext.js\";\nimport { HtmlProps } from \"./HtmlProps.js\";\nimport { useTranslation } from \"./i18n.generated/i18n.js\";\nimport { Typography } from \"./Typography.js\";\nimport { useUniqueId } from \"./useUniqueId.js\";\n\nexport const fieldTypeValues = [\"single\", \"group\"] as const;\n\nexport type RenderFieldComponentProps = {\n ariaDescribedBy?: string;\n dataSe?: string;\n errorMessageElementId?: string;\n id: string;\n isReadOnly?: boolean;\n labelElementId: string;\n};\n\nexport type FieldProps = {\n /**\n * If `error` is not undefined, the `input` will indicate an error.\n */\n errorMessageList?: string[];\n /**\n * The field type determines how ARIA components are setup. It's important to use this to denote if you expect only one component (like a text field) or multiple (like a radio group).\n */\n fieldType: (typeof fieldTypeValues)[number];\n /**\n * If `true`, the Field label will be shown\n */\n hasVisibleLabel: boolean;\n /**\n * Important for determining if children inherit error state\n */\n isCheckboxGroup?: boolean;\n /**\n * Important for narrowing down the `fieldset` role to \"radiogroup\".\n */\n isRadioGroup?: boolean;\n /**\n * The label for the `input` element.\n */\n label: string;\n /**\n * The short hint displayed in the `input` before the user enters a value.\n */\n placeholder?: string;\n /**\n * Render-props function that sends back ARIA props to your field component.\n */\n renderFieldComponent: ({\n ariaDescribedBy,\n dataSe,\n errorMessageElementId,\n id,\n labelElementId,\n isReadOnly,\n }: RenderFieldComponentProps) => ReactElement;\n};\n\nconst Field = ({\n ariaDescribedBy,\n errorMessage,\n errorMessageList,\n fieldType,\n hasVisibleLabel,\n hint,\n HintLinkComponent,\n id: idOverride,\n isDisabled: isDisabledProp = false,\n isFullWidth = false,\n isRadioGroup = false,\n isOptional = false,\n isReadOnly = false,\n label,\n renderFieldComponent,\n}: FieldProps &\n Pick<\n FieldComponentProps,\n | \"errorMessage\"\n | \"errorMessageList\"\n | \"hint\"\n | \"HintLinkComponent\"\n | \"id\"\n | \"isDisabled\"\n | \"isFullWidth\"\n | \"isOptional\"\n | \"isReadOnly\"\n > &\n Pick<HtmlProps, \"ariaDescribedBy\">) => {\n const { t } = useTranslation();\n\n const id = useUniqueId(idOverride);\n const hintId = hint ? `${id}-hint` : undefined;\n const errorMessageElementId =\n errorMessage || errorMessageList ? `${id}-error` : undefined;\n const labelElementId = `${id}-label`;\n\n const localAriaDescribedBy = useMemo(\n () =>\n [hintId, errorMessageElementId, ariaDescribedBy].join(\" \").trim() ||\n undefined,\n [ariaDescribedBy, errorMessageElementId, hintId],\n );\n\n const { isDisabled: isFieldsetDisabled } = useFieldset();\n\n const isDisabled = useMemo(\n () => isDisabledProp || isFieldsetDisabled,\n [isDisabledProp, isFieldsetDisabled],\n );\n\n return (\n <MuiFormControl\n component={fieldType === \"group\" ? \"fieldset\" : \"div\"}\n disabled={isDisabled}\n error={\n Boolean(errorMessage) ||\n (Array.isArray(errorMessageList) && errorMessageList.length > 0)\n }\n fullWidth={isFullWidth}\n role={isRadioGroup ? \"radiogroup\" : undefined}\n >\n {fieldType === \"group\" ? (\n <MuiFormLabel component=\"legend\" id={labelElementId}>\n {label}{\" \"}\n {isOptional && label && (\n <Typography color=\"textSecondary\" component=\"span\">\n ({t(\"fieldlabel.optional.text\")})\n </Typography>\n )}\n </MuiFormLabel>\n ) : (\n <FieldLabel\n hasVisibleLabel={hasVisibleLabel}\n id={labelElementId}\n inputId={id}\n isOptional={isOptional}\n text={label}\n />\n )}\n\n {hint && (\n <FieldHint id={hintId} LinkComponent={HintLinkComponent} text={hint} />\n )}\n\n {renderFieldComponent({\n ariaDescribedBy: localAriaDescribedBy,\n errorMessageElementId,\n id,\n labelElementId,\n isReadOnly,\n })}\n\n {(errorMessage || errorMessageList) && (\n <FieldError\n id={errorMessageElementId}\n message={errorMessage}\n messageList={errorMessageList}\n />\n )}\n </MuiFormControl>\n );\n};\n\nconst MemoizedField = memo(Field);\nMemoizedField.displayName = \"Field\";\n\nexport { MemoizedField as Field };\n"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAMA,SAASA,IAAI,EAAgBC,OAAO,QAAQ,OAAO;AAGnD,SAASC,UAAU,QAAQ,iBAAiB;AAC5C,SAASC,SAAS,QAAQ,gBAAgB;AAC1C,SAASC,UAAU,QAAQ,iBAAiB;AAC5C,SAASC,WAAW,QAAQ,sBAAsB;AAElD,SAASC,cAAc,QAAQ,0BAA0B;AACzD,SAASC,UAAU,QAA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AAO,EAAEzC,YAAa;MACtB0C,WAAW,EAAEzC;IAAiB,CAC/B,CACF;EAAA,CACa,CAAC;AAErB,CAAC;AAED,MAAM0C,aAAa,GAAG3D,IAAI,CAACc,KAAK,CAAC;AACjC6C,aAAa,CAACC,WAAW,GAAG,OAAO;AAEnC,SAASD,aAAa,IAAI7C,KAAK","ignoreList":[]}
1
+ {"version":3,"file":"Field.js","names":["memo","useMemo","FieldError","FieldHint","FieldLabel","useFieldset","useTranslation","Subordinate","useUniqueId","jsx","_jsx","jsxs","_jsxs","fieldTypeValues","Field","ariaDescribedBy","errorMessage","errorMessageList","fieldType","hasVisibleLabel","hint","HintLinkComponent","id","idOverride","isDisabled","isDisabledProp","isFullWidth","isRadioGroup","isOptional","isReadOnly","label","renderFieldComponent","t","hintId","undefined","errorMessageElementId","labelElementId","localAriaDescribedBy","join","trim","isFieldsetDisabled","_FormControl","component","disabled","error","Boolean","Array","isArray","length","fullWidth","role","children","_FormLabel","inputId","text","LinkComponent","message","messageList","MemoizedField","displayName"],"sources":["../../src/Field.tsx"],"sourcesContent":["/*!\n * Copyright (c) 2022-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *\n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport {\n FormControl as MuiFormControl,\n FormLabel as MuiFormLabel,\n} from \"@mui/material\";\nimport { memo, ReactElement, useMemo } from \"react\";\n\nimport { FieldComponentProps } from \"./FieldComponentProps.js\";\nimport { FieldError } from \"./FieldError.js\";\nimport { FieldHint } from \"./FieldHint.js\";\nimport { FieldLabel } from \"./FieldLabel.js\";\nimport { useFieldset } from \"./FieldsetContext.js\";\nimport { HtmlProps } from \"./HtmlProps.js\";\nimport { useTranslation } from \"./i18n.generated/i18n.js\";\nimport { Subordinate } from \"./Typography.js\";\nimport { useUniqueId } from \"./useUniqueId.js\";\n\nexport const fieldTypeValues = [\"single\", \"group\"] as const;\n\nexport type RenderFieldComponentProps = {\n ariaDescribedBy?: string;\n dataSe?: string;\n errorMessageElementId?: string;\n id: string;\n isReadOnly?: boolean;\n labelElementId: string;\n};\n\nexport type FieldProps = {\n /**\n * If `error` is not undefined, the `input` will indicate an error.\n */\n errorMessageList?: string[];\n /**\n * The field type determines how ARIA components are setup. It's important to use this to denote if you expect only one component (like a text field) or multiple (like a radio group).\n */\n fieldType: (typeof fieldTypeValues)[number];\n /**\n * If `true`, the Field label will be shown\n */\n hasVisibleLabel: boolean;\n /**\n * Important for determining if children inherit error state\n */\n isCheckboxGroup?: boolean;\n /**\n * Important for narrowing down the `fieldset` role to \"radiogroup\".\n */\n isRadioGroup?: boolean;\n /**\n * The label for the `input` element.\n */\n label: string;\n /**\n * The short hint displayed in the `input` before the user enters a value.\n */\n placeholder?: string;\n /**\n * Render-props function that sends back ARIA props to your field component.\n */\n renderFieldComponent: ({\n ariaDescribedBy,\n dataSe,\n errorMessageElementId,\n id,\n labelElementId,\n isReadOnly,\n }: RenderFieldComponentProps) => ReactElement;\n};\n\nconst Field = ({\n ariaDescribedBy,\n errorMessage,\n errorMessageList,\n fieldType,\n hasVisibleLabel,\n hint,\n HintLinkComponent,\n id: idOverride,\n isDisabled: isDisabledProp = false,\n isFullWidth = false,\n isRadioGroup = false,\n isOptional = false,\n isReadOnly = false,\n label,\n renderFieldComponent,\n}: FieldProps &\n Pick<\n FieldComponentProps,\n | \"errorMessage\"\n | \"errorMessageList\"\n | \"hint\"\n | \"HintLinkComponent\"\n | \"id\"\n | \"isDisabled\"\n | \"isFullWidth\"\n | \"isOptional\"\n | \"isReadOnly\"\n > &\n Pick<HtmlProps, \"ariaDescribedBy\">) => {\n const { t } = useTranslation();\n\n const id = useUniqueId(idOverride);\n const hintId = hint ? `${id}-hint` : undefined;\n const errorMessageElementId =\n errorMessage || errorMessageList ? `${id}-error` : undefined;\n const labelElementId = `${id}-label`;\n\n const localAriaDescribedBy = useMemo(\n () =>\n [hintId, errorMessageElementId, ariaDescribedBy].join(\" \").trim() ||\n undefined,\n [ariaDescribedBy, errorMessageElementId, hintId],\n );\n\n const { isDisabled: isFieldsetDisabled } = useFieldset();\n\n const isDisabled = useMemo(\n () => isDisabledProp || isFieldsetDisabled,\n [isDisabledProp, isFieldsetDisabled],\n );\n\n return (\n <MuiFormControl\n component={fieldType === \"group\" ? \"fieldset\" : \"div\"}\n disabled={isDisabled}\n error={\n Boolean(errorMessage) ||\n (Array.isArray(errorMessageList) && errorMessageList.length > 0)\n }\n fullWidth={isFullWidth}\n role={isRadioGroup ? \"radiogroup\" : undefined}\n >\n {fieldType === \"group\" ? (\n <MuiFormLabel component=\"legend\" id={labelElementId}>\n {label}{\" \"}\n {isOptional && label && (\n <Subordinate>{t(\"fieldlabel.optional.text\")}</Subordinate>\n )}\n </MuiFormLabel>\n ) : (\n <FieldLabel\n hasVisibleLabel={hasVisibleLabel}\n id={labelElementId}\n inputId={id}\n isOptional={isOptional}\n text={label}\n />\n )}\n\n {hint && (\n <FieldHint id={hintId} LinkComponent={HintLinkComponent} text={hint} />\n )}\n\n {renderFieldComponent({\n ariaDescribedBy: localAriaDescribedBy,\n errorMessageElementId,\n id,\n labelElementId,\n isReadOnly,\n })}\n\n {(errorMessage || errorMessageList) && (\n <FieldError\n id={errorMessageElementId}\n message={errorMessage}\n messageList={errorMessageList}\n />\n )}\n </MuiFormControl>\n );\n};\n\nconst MemoizedField = memo(Field);\nMemoizedField.displayName = \"Field\";\n\nexport { MemoizedField as Field };\n"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAMA,SAASA,IAAI,EAAgBC,OAAO,QAAQ,OAAO;AAGnD,SAASC,UAAU,QAAQ,iBAAiB;AAC5C,SAASC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gB,KAChCP,IAAA,CAACR,UAAU;MACToB,EAAE,EAAEa,qBAAsB;MAC1BqB,OAAO,EAAExC,YAAa;MACtByC,WAAW,EAAExC;IAAiB,CAC/B,CACF;EAAA,CACa,CAAC;AAErB,CAAC;AAED,MAAMyC,aAAa,GAAG1D,IAAI,CAACc,KAAK,CAAC;AACjC4C,aAAa,CAACC,WAAW,GAAG,OAAO;AAEnC,SAASD,aAAa,IAAI5C,KAAK","ignoreList":[]}
@@ -24,7 +24,8 @@ const FullScreenOverlayProvider = ({
24
24
  children,
25
25
  hasShadowDom,
26
26
  overlayParentElement: overlayParentElementProp,
27
- overlayType = "default"
27
+ overlayType = "default",
28
+ fullScreenOverlayId
28
29
  }) => {
29
30
  const {
30
31
  overlayEmotionRootElement,
@@ -51,13 +52,18 @@ const FullScreenOverlayProvider = ({
51
52
  }, [hasShadowDom, overlayParentElementProp]);
52
53
  useEffect(() => {
53
54
  if (overlayParentElement) {
55
+ if (fullScreenOverlayId) {
56
+ overlayParentElement.id = fullScreenOverlayId;
57
+ } else {
58
+ overlayParentElement.removeAttribute("id");
59
+ }
54
60
  overlayParentElement.setAttribute(OVERLAY_DATA_ATTRIBUTES[overlayType], "");
55
61
  document.body.append(overlayParentElement);
56
62
  }
57
63
  return () => {
58
64
  overlayParentElement.remove();
59
65
  };
60
- }, [overlayParentElement, overlayType]);
66
+ }, [fullScreenOverlayId, overlayParentElement, overlayType]);
61
67
  const providerValue = useMemo(() => ({
62
68
  overlayEmotionRootElement,
63
69
  overlayShadowRootElement
@@ -1 +1 @@
1
- {"version":3,"file":"FullScreenOverlayContext.js","names":["createContext","memo","useContext","useEffect","useMemo","createShadowDomElements","jsx","_jsx","FullScreenOverlayContext","useFullScreenOverlayContext","OVERLAY_DATA_ATTRIBUTES","dialog","drawer","default","FullScreenOverlayProvider","children","hasShadowDom","overlayParentElement","overlayParentElementProp","overlayType","overlayEmotionRootElement","overlayShadowRootElement","document","createElement","emotionRootElement","shadowRootElement","undefined","setAttribute","body","append","remove","providerValue","Provider","value","MemoizedFullScreenOverlayProvider","displayName"],"sources":["../../src/FullScreenOverlayContext.tsx"],"sourcesContent":["/*!\n * Copyright (c) 2025-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *\n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport {\n createContext,\n memo,\n type ReactNode,\n useContext,\n useEffect,\n useMemo,\n} from \"react\";\n\nimport { createShadowDomElements } from \"./web-component/createShadowDomElements.js\";\n\nexport type FullScreenOverlayContextType = {\n overlayEmotionRootElement?: HTMLDivElement | HTMLElement;\n overlayShadowRootElement?: HTMLDivElement | HTMLElement;\n};\n\nexport const FullScreenOverlayContext =\n createContext<FullScreenOverlayContextType>({});\n\nexport const useFullScreenOverlayContext = () =>\n useContext(FullScreenOverlayContext);\n\nexport const OVERLAY_DATA_ATTRIBUTES = {\n dialog: \"data-odyssey-react-dialog-overlay-component\",\n drawer: \"data-odyssey-react-drawer-overlay-component\",\n default: \"data-odyssey-react-overlay-component\",\n} as const;\n\nexport type OverlayType = keyof typeof OVERLAY_DATA_ATTRIBUTES;\n\nexport type FullScreenOverlayProviderProps = {\n children: ReactNode;\n hasShadowDom?: boolean;\n /**\n * @experimental This is the element overlays will render into. By default, it's set to `document.body`.\n *\n * If you specify this value , it will render overlays into this container, such as the `shadowRootElement` over the document body. Most likely, you don't need to change this value, but you might run into strange issues related iframes and other shadow roots. This is here as a safeguard; not meant to be used.\n */\n overlayParentElement?: HTMLDivElement | HTMLElement;\n /**\n * Type of overlay being rendered. This controls the data attribute set on the overlay parent element.\n * @default \"default\"\n */\n overlayType?: OverlayType;\n};\n\nconst FullScreenOverlayProvider = ({\n children,\n hasShadowDom,\n overlayParentElement: overlayParentElementProp,\n overlayType = \"default\",\n}: FullScreenOverlayProviderProps) => {\n const {\n overlayEmotionRootElement,\n overlayParentElement,\n overlayShadowRootElement,\n } = useMemo(() => {\n const overlayParentElement =\n overlayParentElementProp || document.createElement(\"div\");\n\n if (hasShadowDom) {\n const { emotionRootElement, shadowRootElement } =\n createShadowDomElements(overlayParentElement);\n\n return {\n overlayEmotionRootElement: emotionRootElement,\n overlayParentElement,\n overlayShadowRootElement: shadowRootElement,\n };\n }\n\n return {\n overlayEmotionRootElement: undefined,\n overlayParentElement,\n overlayShadowRootElement: undefined,\n };\n }, [hasShadowDom, overlayParentElementProp]);\n\n useEffect(() => {\n if (overlayParentElement) {\n overlayParentElement.setAttribute(\n OVERLAY_DATA_ATTRIBUTES[overlayType],\n \"\",\n );\n document.body.append(overlayParentElement);\n }\n\n return () => {\n overlayParentElement.remove();\n };\n }, [overlayParentElement, overlayType]);\n\n const providerValue = useMemo(\n () => ({\n overlayEmotionRootElement,\n overlayShadowRootElement,\n }),\n [overlayEmotionRootElement, overlayShadowRootElement],\n );\n\n return (\n <FullScreenOverlayContext.Provider value={providerValue}>\n {children}\n </FullScreenOverlayContext.Provider>\n );\n};\n\nconst MemoizedFullScreenOverlayProvider = memo(FullScreenOverlayProvider);\nMemoizedFullScreenOverlayProvider.displayName = \"FullScreenOverlayProvider\";\n\nexport { MemoizedFullScreenOverlayProvider as FullScreenOverlayProvider };\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SACEA,aAAa,EACbC,IAAI,EAEJC,UAAU,EACVC,SAAS,EACTC,OAAO,QACF,OAAO;AAEd,SAASC,uBAAuB,QAAQ,4CAA4C;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAOrF,OAAO,MAAMC,wBAAwB,GACnCR,aAAa,CAA+B,CAAC,CAAC,CAAC;AAEjD,OAAO,MAAMS,2BAA2B,GAAGA,CA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,EACF,CAACD,yBAAyB,EAAEC,wBAAwB,CACtD,CAAC;EAED,OACEd,IAAA,CAACC,wBAAwB,CAACwB,QAAQ;IAACC,KAAK,EAAEF,aAAc;IAAAhB,QAAA,EACrDA;EAAQ,CACwB,CAAC;AAExC,CAAC;AAED,MAAMmB,iCAAiC,GAAGjC,IAAI,CAACa,yBAAyB,CAAC;AACzEoB,iCAAiC,CAACC,WAAW,GAAG,2BAA2B;AAE3E,SAASD,iCAAiC,IAAIpB,yBAAyB","ignoreList":[]}
1
+ {"version":3,"file":"FullScreenOverlayContext.js","names":["createContext","memo","useContext","useEffect","useMemo","createShadowDomElements","jsx","_jsx","FullScreenOverlayContext","useFullScreenOverlayContext","OVERLAY_DATA_ATTRIBUTES","dialog","drawer","default","FullScreenOverlayProvider","children","hasShadowDom","overlayParentElement","overlayParentElementProp","overlayType","fullScreenOverlayId","overlayEmotionRootElement","overlayShadowRootElement","document","createElement","emotionRootElement","shadowRootElement","undefined","id","removeAttribute","setAttribute","body","append","remove","providerValue","Provider","value","MemoizedFullScreenOverlayProvider","displayName"],"sources":["../../src/FullScreenOverlayContext.tsx"],"sourcesContent":["/*!\n * Copyright (c) 2025-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *\n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport {\n createContext,\n memo,\n type ReactNode,\n useContext,\n useEffect,\n useMemo,\n} from \"react\";\n\nimport { createShadowDomElements } from \"./web-component/createShadowDomElements.js\";\n\nexport type FullScreenOverlayContextType = {\n overlayEmotionRootElement?: HTMLDivElement | HTMLElement;\n overlayShadowRootElement?: HTMLDivElement | HTMLElement;\n};\n\nexport const FullScreenOverlayContext =\n createContext<FullScreenOverlayContextType>({});\n\nexport const useFullScreenOverlayContext = () =>\n useContext(FullScreenOverlayContext);\n\nexport const OVERLAY_DATA_ATTRIBUTES = {\n dialog: \"data-odyssey-react-dialog-overlay-component\",\n drawer: \"data-odyssey-react-drawer-overlay-component\",\n default: \"data-odyssey-react-overlay-component\",\n} as const;\n\nexport type OverlayType = keyof typeof OVERLAY_DATA_ATTRIBUTES;\n\nexport type FullScreenOverlayProviderProps = {\n children: ReactNode;\n /**\n * An optional HTML `id` attribute to be applied to the overlay's container element.\n */\n fullScreenOverlayId?: string;\n hasShadowDom?: boolean;\n /**\n * @experimental This is the element overlays will render into. By default, it's set to `document.body`.\n *\n * If you specify this value , it will render overlays into this container, such as the `shadowRootElement` over the document body. Most likely, you don't need to change this value, but you might run into strange issues related iframes and other shadow roots. This is here as a safeguard; not meant to be used.\n */\n overlayParentElement?: HTMLDivElement | HTMLElement;\n /**\n * Type of overlay being rendered. This controls the data attribute set on the overlay parent element.\n * @default \"default\"\n */\n overlayType?: OverlayType;\n};\n\nconst FullScreenOverlayProvider = ({\n children,\n hasShadowDom,\n overlayParentElement: overlayParentElementProp,\n overlayType = \"default\",\n fullScreenOverlayId,\n}: FullScreenOverlayProviderProps) => {\n const {\n overlayEmotionRootElement,\n overlayParentElement,\n overlayShadowRootElement,\n } = useMemo(() => {\n const overlayParentElement =\n overlayParentElementProp || document.createElement(\"div\");\n\n if (hasShadowDom) {\n const { emotionRootElement, shadowRootElement } =\n createShadowDomElements(overlayParentElement);\n\n return {\n overlayEmotionRootElement: emotionRootElement,\n overlayParentElement,\n overlayShadowRootElement: shadowRootElement,\n };\n }\n\n return {\n overlayEmotionRootElement: undefined,\n overlayParentElement,\n overlayShadowRootElement: undefined,\n };\n }, [hasShadowDom, overlayParentElementProp]);\n\n useEffect(() => {\n if (overlayParentElement) {\n if (fullScreenOverlayId) {\n overlayParentElement.id = fullScreenOverlayId;\n } else {\n overlayParentElement.removeAttribute(\"id\");\n }\n overlayParentElement.setAttribute(\n OVERLAY_DATA_ATTRIBUTES[overlayType],\n \"\",\n );\n document.body.append(overlayParentElement);\n }\n\n return () => {\n overlayParentElement.remove();\n };\n }, [fullScreenOverlayId, overlayParentElement, overlayType]);\n\n const providerValue = useMemo(\n () => ({\n overlayEmotionRootElement,\n overlayShadowRootElement,\n }),\n [overlayEmotionRootElement, overlayShadowRootElement],\n );\n\n return (\n <FullScreenOverlayContext.Provider value={providerValue}>\n {children}\n </FullScreenOverlayContext.Provider>\n );\n};\n\nconst MemoizedFullScreenOverlayProvider = memo(FullScreenOverlayProvider);\nMemoizedFullScreenOverlayProvider.displayName = \"FullScreenOverlayProvider\";\n\nexport { MemoizedFullScreenOverlayProvider as FullScreenOverlayProvider };\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SACEA,aAAa,EACbC,IAAI,EAEJC,UAAU,EACVC,SAAS,EACTC,OAAO,QACF,OAAO;AAEd,SAASC,uBAAuB,QAAQ,4CAA4C;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAOrF,OAAO,MAAMC,wBAAwB,GACnCR,aAAa,CAA+B,CAAC,CAAC,CAAC;AAEjD,OAAO,MAAMS,2BAA2B,GAAGA,CAAA,KACzCP,UAAU,CAACM,wBAAwB,CAAC;AAEtC,OAAO,MAAME,uBAAuB,GAAG;EACrCC,MAAM,EAAE,6CAA6C;EACrDC,MAAM,EAAE,6CAA6C;EACrDC,OAAO,EAAE;AACX,CAAU;AAwBV,MAAMC,yBAAyB,GAAGA,CAAC;EACjCC,QAAQ;EACRC,YAAY;EACZC,oBAAoB,EAAEC,wBAAwB;EAC9CC,WAAW,GAAG,SAAS;EACvBC;AAC8B,CAAC,KAAK;EACpC,MAAM;IACJC,yBAAyB;IACzBJ,oBAAoB;IACpBK;EACF,CAAC,GAAGlB,OAAO,CAAC,MAAM;IAChB,MAAMa,oBAAoB,GACxBC,wBAAwB,IAAIK,QAAQ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AA2B;AAE3E,SAASD,iCAAiC,IAAIvB,yBAAyB","ignoreList":[]}
@@ -27,6 +27,7 @@ const OdysseyProvider = ({
27
27
  designTokensOverride,
28
28
  emotionRoot,
29
29
  emotionRootElement,
30
+ fullScreenOverlayId,
30
31
  hasCssBaseline: hasGlobalCss,
31
32
  hasScopedCssBaseline = true,
32
33
  hasTranslationProvider = true,
@@ -60,6 +61,7 @@ const OdysseyProvider = ({
60
61
  isWrapped: hasTranslationProvider,
61
62
  Wrapper: TranslationWrapper,
62
63
  children: _jsxs(FullScreenOverlayProvider, {
64
+ fullScreenOverlayId: fullScreenOverlayId,
63
65
  hasShadowDom: Boolean(shadowRootElement || shadowDomElement),
64
66
  overlayParentElement: overlayParentElement,
65
67
  overlayType: overlayType,
@@ -1 +1 @@
1
- {"version":3,"file":"OdysseyProvider.js","names":["memo","useMemo","ConditionalWrapper","CssBaseline","FullScreenOverlayProvider","TranslationProvider","OdysseyTranslationProvider","OdysseyCacheProvider","OdysseyThemeProvider","jsx","_jsx","jsxs","_jsxs","scopedCssBaselineStyles","height","OdysseyProvider","children","contrastMode","designTokensOverride","emotionRoot","emotionRootElement","hasCssBaseline","hasGlobalCss","hasScopedCssBaseline","hasTranslationProvider","hasWrapperElement","languageCode","nonce","overlayParentElement","overlayType","shadowDomElement","shadowRootElement","stylisPlugins","themeOverride","translationOverrides","TranslationWrapper","isWrapped","Wrapper","hasShadowDom","Boolean","_ScopedCssBaseline","sx","MemoizedOdysseyProvider","displayName"],"sources":["../../src/OdysseyProvider.tsx"],"sourcesContent":["/*!\n * Copyright (c) 2022-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *\n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport { ScopedCssBaseline } from \"@mui/material\";\nimport { memo, ReactNode, useMemo } from \"react\";\n\nimport {\n ConditionalWrapper,\n ConditionalWrapperProps,\n} from \"./ConditionalWrapper.js\";\nimport { CssBaseline } from \"./CssBaseline.js\";\nimport {\n FullScreenOverlayProvider,\n FullScreenOverlayProviderProps,\n} from \"./FullScreenOverlayContext.js\";\nimport {\n type DefaultSupportedLanguages,\n TranslationProvider as OdysseyTranslationProvider,\n type TranslationProviderProps as OdysseyTranslationProviderProps,\n} from \"./i18n.generated/i18n.js\";\nimport {\n OdysseyCacheProvider,\n OdysseyCacheProviderProps,\n} from \"./OdysseyCacheProvider.js\";\nimport {\n OdysseyThemeProvider,\n OdysseyThemeProviderProps,\n} from \"./OdysseyThemeProvider.js\";\n\nconst scopedCssBaselineStyles = {\n height: \"inherit\",\n};\n\nexport type OdysseyProviderProps<\n SupportedLanguages extends string = DefaultSupportedLanguages,\n> = Omit<OdysseyCacheProviderProps, \"hasShadowDom\"> &\n FullScreenOverlayProviderProps &\n OdysseyThemeProviderProps &\n OdysseyTranslationProviderProps<SupportedLanguages> & {\n children: ReactNode;\n /**\n * Whether to emit the ScopedCssBaseline. Defaults to true.\n */\n hasCssBaseline?: boolean;\n /**\n * Adds the `ScopedCssBaseline` wrapper. This also adds a `div`, so it might not be what you want.\n */\n hasScopedCssBaseline?: boolean;\n /**\n * If `true`, the `OdysseyTranslationProvider` wrapper will be added. Defaults to `true`.\n * This should only be set to `false` if there exists an OdysseyTranslationProvider higher up in the tree.\n * @default true\n */\n hasTranslationProvider?: boolean;\n };\n\nconst OdysseyProvider = <SupportedLanguages extends string>({\n children,\n contrastMode,\n designTokensOverride,\n emotionRoot,\n emotionRootElement,\n hasCssBaseline: hasGlobalCss,\n hasScopedCssBaseline = true,\n hasTranslationProvider = true,\n hasWrapperElement,\n languageCode,\n nonce,\n overlayParentElement,\n overlayType,\n shadowDomElement,\n shadowRootElement,\n stylisPlugins,\n themeOverride,\n translationOverrides,\n}: OdysseyProviderProps<SupportedLanguages>) => {\n const TranslationWrapper = useMemo<ConditionalWrapperProps[\"Wrapper\"]>(\n () => (children) => (\n <OdysseyTranslationProvider<SupportedLanguages>\n languageCode={languageCode}\n translationOverrides={translationOverrides}\n >\n {children}\n </OdysseyTranslationProvider>\n ),\n [languageCode, translationOverrides],\n );\n\n return (\n <OdysseyCacheProvider\n emotionRootElement={emotionRootElement || emotionRoot}\n nonce={nonce}\n stylisPlugins={stylisPlugins}\n >\n <OdysseyThemeProvider\n contrastMode={contrastMode}\n designTokensOverride={designTokensOverride}\n hasWrapperElement={hasWrapperElement}\n shadowRootElement={shadowRootElement ?? shadowDomElement}\n themeOverride={themeOverride}\n >\n <ConditionalWrapper\n isWrapped={hasTranslationProvider}\n Wrapper={TranslationWrapper}\n >\n <FullScreenOverlayProvider\n hasShadowDom={Boolean(shadowRootElement || shadowDomElement)}\n overlayParentElement={overlayParentElement}\n overlayType={overlayType}\n >\n {hasGlobalCss && <CssBaseline />}\n\n {hasScopedCssBaseline ? (\n <ScopedCssBaseline sx={scopedCssBaselineStyles}>\n {children}\n </ScopedCssBaseline>\n ) : (\n children\n )}\n </FullScreenOverlayProvider>\n </ConditionalWrapper>\n </OdysseyThemeProvider>\n </OdysseyCacheProvider>\n );\n};\n\nconst MemoizedOdysseyProvider = memo(OdysseyProvider);\nMemoizedOdysseyProvider.displayName = \"OdysseyProvider\";\n\nexport { MemoizedOdysseyProvider as OdysseyProvider };\n"],"mappings":";AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAGA,SAASA,IAAI,EAAaC,OAAO,QAAQ,OAAO;AAEhD,SACEC,kBAAkB,QAEb,yBAAyB;AAChC,SAASC,WAAW,QAAQ,kBAAkB;AAC9C,SACEC,yBAAyB,QAEpB,+BAA+B;AACtC,SAEEC,mBAAmB,IAAIC,0BAA0B,QAE5C,0BAA0B;AACjC,SACEC,oBAAoB,QAEf,2B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AAEC,OAAO,CAACR,iBAAiB,IAAID,gBAAgB,CAAE;UAC7DF,oBAAoB,EAAEA,oBAAqB;UAC3CC,WAAW,EAAEA,WAAY;UAAAb,QAAA,GAExBM,YAAY,IAAIZ,IAAA,CAACP,WAAW,IAAE,CAAC,EAE/BoB,oBAAoB,GACnBb,IAAA,CAAA8B,kBAAA;YAAmBC,EAAE,EAAE5B,uBAAwB;YAAAG,QAAA,EAC5CA;UAAQ,CACQ,CAAC,GAEpBA,QACD;QAAA,CACwB;MAAC,CACV;IAAC,CACD;EAAC,CACH,CAAC;AAE3B,CAAC;AAED,MAAM0B,uBAAuB,GAAG1C,IAAI,CAACe,eAAe,CAAC;AACrD2B,uBAAuB,CAACC,WAAW,GAAG,iBAAiB;AAEvD,SAASD,uBAAuB,IAAI3B,eAAe","ignoreList":[]}
1
+ {"version":3,"file":"OdysseyProvider.js","names":["memo","useMemo","ConditionalWrapper","CssBaseline","FullScreenOverlayProvider","TranslationProvider","OdysseyTranslationProvider","OdysseyCacheProvider","OdysseyThemeProvider","jsx","_jsx","jsxs","_jsxs","scopedCssBaselineStyles","height","OdysseyProvider","children","contrastMode","designTokensOverride","emotionRoot","emotionRootElement","fullScreenOverlayId","hasCssBaseline","hasGlobalCss","hasScopedCssBaseline","hasTranslationProvider","hasWrapperElement","languageCode","nonce","overlayParentElement","overlayType","shadowDomElement","shadowRootElement","stylisPlugins","themeOverride","translationOverrides","TranslationWrapper","isWrapped","Wrapper","hasShadowDom","Boolean","_ScopedCssBaseline","sx","MemoizedOdysseyProvider","displayName"],"sources":["../../src/OdysseyProvider.tsx"],"sourcesContent":["/*!\n * Copyright (c) 2022-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *\n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport { ScopedCssBaseline } from \"@mui/material\";\nimport { memo, ReactNode, useMemo } from \"react\";\n\nimport {\n ConditionalWrapper,\n ConditionalWrapperProps,\n} from \"./ConditionalWrapper.js\";\nimport { CssBaseline } from \"./CssBaseline.js\";\nimport {\n FullScreenOverlayProvider,\n FullScreenOverlayProviderProps,\n} from \"./FullScreenOverlayContext.js\";\nimport {\n type DefaultSupportedLanguages,\n TranslationProvider as OdysseyTranslationProvider,\n type TranslationProviderProps as OdysseyTranslationProviderProps,\n} from \"./i18n.generated/i18n.js\";\nimport {\n OdysseyCacheProvider,\n OdysseyCacheProviderProps,\n} from \"./OdysseyCacheProvider.js\";\nimport {\n OdysseyThemeProvider,\n OdysseyThemeProviderProps,\n} from \"./OdysseyThemeProvider.js\";\n\nconst scopedCssBaselineStyles = {\n height: \"inherit\",\n};\n\nexport type OdysseyProviderProps<\n SupportedLanguages extends string = DefaultSupportedLanguages,\n> = Omit<OdysseyCacheProviderProps, \"hasShadowDom\"> &\n FullScreenOverlayProviderProps &\n OdysseyThemeProviderProps &\n OdysseyTranslationProviderProps<SupportedLanguages> & {\n children: ReactNode;\n /**\n * Whether to emit the ScopedCssBaseline. Defaults to true.\n */\n hasCssBaseline?: boolean;\n /**\n * Adds the `ScopedCssBaseline` wrapper. This also adds a `div`, so it might not be what you want.\n */\n hasScopedCssBaseline?: boolean;\n /**\n * If `true`, the `OdysseyTranslationProvider` wrapper will be added. Defaults to `true`.\n * This should only be set to `false` if there exists an OdysseyTranslationProvider higher up in the tree.\n * @default true\n */\n hasTranslationProvider?: boolean;\n };\n\nconst OdysseyProvider = <SupportedLanguages extends string>({\n children,\n contrastMode,\n designTokensOverride,\n emotionRoot,\n emotionRootElement,\n fullScreenOverlayId,\n hasCssBaseline: hasGlobalCss,\n hasScopedCssBaseline = true,\n hasTranslationProvider = true,\n hasWrapperElement,\n languageCode,\n nonce,\n overlayParentElement,\n overlayType,\n shadowDomElement,\n shadowRootElement,\n stylisPlugins,\n themeOverride,\n translationOverrides,\n}: OdysseyProviderProps<SupportedLanguages>) => {\n const TranslationWrapper = useMemo<ConditionalWrapperProps[\"Wrapper\"]>(\n () => (children) => (\n <OdysseyTranslationProvider<SupportedLanguages>\n languageCode={languageCode}\n translationOverrides={translationOverrides}\n >\n {children}\n </OdysseyTranslationProvider>\n ),\n [languageCode, translationOverrides],\n );\n\n return (\n <OdysseyCacheProvider\n emotionRootElement={emotionRootElement || emotionRoot}\n nonce={nonce}\n stylisPlugins={stylisPlugins}\n >\n <OdysseyThemeProvider\n contrastMode={contrastMode}\n designTokensOverride={designTokensOverride}\n hasWrapperElement={hasWrapperElement}\n shadowRootElement={shadowRootElement ?? shadowDomElement}\n themeOverride={themeOverride}\n >\n <ConditionalWrapper\n isWrapped={hasTranslationProvider}\n Wrapper={TranslationWrapper}\n >\n <FullScreenOverlayProvider\n fullScreenOverlayId={fullScreenOverlayId}\n hasShadowDom={Boolean(shadowRootElement || shadowDomElement)}\n overlayParentElement={overlayParentElement}\n overlayType={overlayType}\n >\n {hasGlobalCss && <CssBaseline />}\n\n {hasScopedCssBaseline ? (\n <ScopedCssBaseline sx={scopedCssBaselineStyles}>\n {children}\n </ScopedCssBaseline>\n ) : (\n children\n )}\n </FullScreenOverlayProvider>\n </ConditionalWrapper>\n </OdysseyThemeProvider>\n </OdysseyCacheProvider>\n );\n};\n\nconst MemoizedOdysseyProvider = memo(OdysseyProvider);\nMemoizedOdysseyProvider.displayName = \"OdysseyProvider\";\n\nexport { MemoizedOdysseyProvider as OdysseyProvider };\n"],"mappings":";AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAGA,SAASA,IAAI,EAAaC,OAAO,QAAQ,OAAO;AAEhD,SACEC,kBAAkB,QAEb,yBAAyB;AAChC,SAASC,WAAW,QAAQ,kBAAkB;AAC9C,SACEC,yBAAyB,QAEpB,+BAA+B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