@okta/odyssey-react-mui 1.13.11 → 1.14.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (684) hide show
  1. package/CHANGELOG.md +25 -0
  2. package/dist/@types/properties.d.js +2 -0
  3. package/dist/@types/properties.d.js.map +1 -0
  4. package/dist/Accordion.js.map +1 -1
  5. package/dist/Autocomplete.js.map +1 -1
  6. package/dist/Badge.js.map +1 -1
  7. package/dist/Banner.js.map +1 -1
  8. package/dist/Box.js.map +1 -1
  9. package/dist/Breadcrumbs.js.map +1 -1
  10. package/dist/Button.js +3 -3
  11. package/dist/Button.js.map +1 -1
  12. package/dist/Callout.js.map +1 -1
  13. package/dist/Checkbox.js.map +1 -1
  14. package/dist/CheckboxGroup.js.map +1 -1
  15. package/dist/CircularProgress.js.map +1 -1
  16. package/dist/Dialog.js +8 -8
  17. package/dist/Dialog.js.map +1 -1
  18. package/dist/ErrorMessageList.js.map +1 -1
  19. package/dist/Field.js +1 -0
  20. package/dist/Field.js.map +1 -1
  21. package/dist/FieldComponentProps.js.map +1 -1
  22. package/dist/FieldError.js.map +1 -1
  23. package/dist/FieldHint.js.map +1 -1
  24. package/dist/FieldLabel.js.map +1 -1
  25. package/dist/Fieldset.js.map +1 -1
  26. package/dist/Form.js.map +1 -1
  27. package/dist/FormCheckedProps.js.map +1 -1
  28. package/dist/HintLink.js.map +1 -1
  29. package/dist/HtmlProps.js.map +1 -1
  30. package/dist/Link.js.map +1 -1
  31. package/dist/MenuButton.js.map +1 -1
  32. package/dist/MenuItem.js.map +1 -1
  33. package/dist/MuiPropsChild.js.map +1 -1
  34. package/dist/NativeSelect.js.map +1 -1
  35. package/dist/OdysseyProvider.js +0 -2
  36. package/dist/OdysseyProvider.js.map +1 -1
  37. package/dist/OdysseyThemeProvider.js +1 -28
  38. package/dist/OdysseyThemeProvider.js.map +1 -1
  39. package/dist/OdysseyTranslationProvider.js.map +1 -1
  40. package/dist/PasswordField.js.map +1 -1
  41. package/dist/Radio.js.map +1 -1
  42. package/dist/RadioGroup.js.map +1 -1
  43. package/dist/ScreenReaderText.js.map +1 -1
  44. package/dist/SearchField.js +6 -2
  45. package/dist/SearchField.js.map +1 -1
  46. package/dist/Select.js +144 -44
  47. package/dist/Select.js.map +1 -1
  48. package/dist/Status.js +6 -1
  49. package/dist/Status.js.map +1 -1
  50. package/dist/Tabs.js +1 -1
  51. package/dist/Tabs.js.map +1 -1
  52. package/dist/Tag.js.map +1 -1
  53. package/dist/TagList.js.map +1 -1
  54. package/dist/TextField.js.map +1 -1
  55. package/dist/Tile.js +53 -39
  56. package/dist/Tile.js.map +1 -1
  57. package/dist/Toast.js.map +1 -1
  58. package/dist/Tooltip.js.map +1 -1
  59. package/dist/Typography.js +11 -10
  60. package/dist/Typography.js.map +1 -1
  61. package/dist/createShadowRootElement.js.map +1 -1
  62. package/dist/getTypedObjectKeys.js.map +1 -1
  63. package/dist/icons.generated/AddCircle.js.map +1 -1
  64. package/dist/icons.generated/Apps.js.map +1 -1
  65. package/dist/icons.generated/ArrowBottom.js.map +1 -1
  66. package/dist/icons.generated/ArrowDown.js.map +1 -1
  67. package/dist/icons.generated/ArrowLeft.js.map +1 -1
  68. package/dist/icons.generated/ArrowRight.js.map +1 -1
  69. package/dist/icons.generated/ArrowTop.js.map +1 -1
  70. package/dist/icons.generated/ArrowUp.js.map +1 -1
  71. package/dist/icons.generated/Calendar.js.map +1 -1
  72. package/dist/icons.generated/Call.js.map +1 -1
  73. package/dist/icons.generated/Chat.js.map +1 -1
  74. package/dist/icons.generated/Check.js.map +1 -1
  75. package/dist/icons.generated/ChevronDown.js.map +1 -1
  76. package/dist/icons.generated/ChevronLeft.js.map +1 -1
  77. package/dist/icons.generated/ChevronUp.js.map +1 -1
  78. package/dist/icons.generated/Clock.js.map +1 -1
  79. package/dist/icons.generated/Close.js.map +1 -1
  80. package/dist/icons.generated/Copy.js.map +1 -1
  81. package/dist/icons.generated/Delete.js.map +1 -1
  82. package/dist/icons.generated/Deny.js.map +1 -1
  83. package/dist/icons.generated/Devices.js.map +1 -1
  84. package/dist/icons.generated/Directory.js.map +1 -1
  85. package/dist/icons.generated/Download.js.map +1 -1
  86. package/dist/icons.generated/Edit.js.map +1 -1
  87. package/dist/icons.generated/ExpandLeft.js.map +1 -1
  88. package/dist/icons.generated/ExpandRight.js.map +1 -1
  89. package/dist/icons.generated/Filter.js.map +1 -1
  90. package/dist/icons.generated/Folder.js.map +1 -1
  91. package/dist/icons.generated/Globe.js.map +1 -1
  92. package/dist/icons.generated/Grid.js.map +1 -1
  93. package/dist/icons.generated/Group.js.map +1 -1
  94. package/dist/icons.generated/Hide.js.map +1 -1
  95. package/dist/icons.generated/Home.js.map +1 -1
  96. package/dist/icons.generated/Link.js.map +1 -1
  97. package/dist/icons.generated/List.js.map +1 -1
  98. package/dist/icons.generated/Lock.js.map +1 -1
  99. package/dist/icons.generated/More.js.map +1 -1
  100. package/dist/icons.generated/Pause.js.map +1 -1
  101. package/dist/icons.generated/Refresh.js.map +1 -1
  102. package/dist/icons.generated/Reset.js.map +1 -1
  103. package/dist/icons.generated/Resume.js.map +1 -1
  104. package/dist/icons.generated/Search.js.map +1 -1
  105. package/dist/icons.generated/Server.js.map +1 -1
  106. package/dist/icons.generated/Settings.js.map +1 -1
  107. package/dist/icons.generated/Show.js.map +1 -1
  108. package/dist/icons.generated/Subtract.js.map +1 -1
  109. package/dist/icons.generated/Sync.js.map +1 -1
  110. package/dist/icons.generated/Unlock.js.map +1 -1
  111. package/dist/icons.generated/Upload.js.map +1 -1
  112. package/dist/icons.generated/User.js.map +1 -1
  113. package/dist/icons.generated/Video.js.map +1 -1
  114. package/dist/icons.generated/Warning.js.map +1 -1
  115. package/dist/icons.generated/index.js +1 -1
  116. package/dist/icons.generated/index.js.map +1 -1
  117. package/dist/index.js.map +1 -1
  118. package/dist/labs/DataFilters.js.map +1 -1
  119. package/dist/labs/DataTable.js.map +1 -1
  120. package/dist/labs/DatePicker.js.map +1 -1
  121. package/dist/labs/Drawer.js +172 -0
  122. package/dist/labs/Drawer.js.map +1 -0
  123. package/dist/labs/GroupPicker.js.map +1 -1
  124. package/dist/labs/PaginatedTable.js.map +1 -1
  125. package/dist/labs/StaticTable.js.map +1 -1
  126. package/dist/labs/Switch.js.map +1 -1
  127. package/dist/labs/VirtualizedAutocomplete.js.map +1 -1
  128. package/dist/labs/datePickerTheme.js.map +1 -1
  129. package/dist/labs/index.js +1 -0
  130. package/dist/labs/index.js.map +1 -1
  131. package/dist/labs/materialReactTableTypes.js.map +1 -1
  132. package/dist/properties/ts/odyssey-react-mui_cs.js +4 -2
  133. package/dist/properties/ts/odyssey-react-mui_cs.js.map +1 -1
  134. package/dist/properties/ts/odyssey-react-mui_da.js +4 -2
  135. package/dist/properties/ts/odyssey-react-mui_da.js.map +1 -1
  136. package/dist/properties/ts/odyssey-react-mui_de.js +4 -2
  137. package/dist/properties/ts/odyssey-react-mui_de.js.map +1 -1
  138. package/dist/properties/ts/odyssey-react-mui_el.js +4 -2
  139. package/dist/properties/ts/odyssey-react-mui_el.js.map +1 -1
  140. package/dist/properties/ts/odyssey-react-mui_es.js +4 -2
  141. package/dist/properties/ts/odyssey-react-mui_es.js.map +1 -1
  142. package/dist/properties/ts/odyssey-react-mui_fi.js +4 -2
  143. package/dist/properties/ts/odyssey-react-mui_fi.js.map +1 -1
  144. package/dist/properties/ts/odyssey-react-mui_fr.js +4 -2
  145. package/dist/properties/ts/odyssey-react-mui_fr.js.map +1 -1
  146. package/dist/properties/ts/odyssey-react-mui_hu.js +4 -2
  147. package/dist/properties/ts/odyssey-react-mui_hu.js.map +1 -1
  148. package/dist/properties/ts/odyssey-react-mui_id.js +4 -2
  149. package/dist/properties/ts/odyssey-react-mui_id.js.map +1 -1
  150. package/dist/properties/ts/odyssey-react-mui_it.js +4 -2
  151. package/dist/properties/ts/odyssey-react-mui_it.js.map +1 -1
  152. package/dist/properties/ts/odyssey-react-mui_ja.js +4 -2
  153. package/dist/properties/ts/odyssey-react-mui_ja.js.map +1 -1
  154. package/dist/properties/ts/odyssey-react-mui_ko.js +4 -2
  155. package/dist/properties/ts/odyssey-react-mui_ko.js.map +1 -1
  156. package/dist/properties/ts/odyssey-react-mui_ms.js +4 -2
  157. package/dist/properties/ts/odyssey-react-mui_ms.js.map +1 -1
  158. package/dist/properties/ts/odyssey-react-mui_nb.js +4 -2
  159. package/dist/properties/ts/odyssey-react-mui_nb.js.map +1 -1
  160. package/dist/properties/ts/odyssey-react-mui_nl_NL.js +4 -2
  161. package/dist/properties/ts/odyssey-react-mui_nl_NL.js.map +1 -1
  162. package/dist/properties/ts/odyssey-react-mui_pl.js +4 -2
  163. package/dist/properties/ts/odyssey-react-mui_pl.js.map +1 -1
  164. package/dist/properties/ts/odyssey-react-mui_pt_BR.js +4 -2
  165. package/dist/properties/ts/odyssey-react-mui_pt_BR.js.map +1 -1
  166. package/dist/properties/ts/odyssey-react-mui_ro.js +4 -2
  167. package/dist/properties/ts/odyssey-react-mui_ro.js.map +1 -1
  168. package/dist/properties/ts/odyssey-react-mui_ru.js +4 -2
  169. package/dist/properties/ts/odyssey-react-mui_ru.js.map +1 -1
  170. package/dist/properties/ts/odyssey-react-mui_sv.js +4 -2
  171. package/dist/properties/ts/odyssey-react-mui_sv.js.map +1 -1
  172. package/dist/properties/ts/odyssey-react-mui_th.js +4 -2
  173. package/dist/properties/ts/odyssey-react-mui_th.js.map +1 -1
  174. package/dist/properties/ts/odyssey-react-mui_tr.js +4 -2
  175. package/dist/properties/ts/odyssey-react-mui_tr.js.map +1 -1
  176. package/dist/properties/ts/odyssey-react-mui_uk.js +4 -2
  177. package/dist/properties/ts/odyssey-react-mui_uk.js.map +1 -1
  178. package/dist/properties/ts/odyssey-react-mui_vi.js +4 -2
  179. package/dist/properties/ts/odyssey-react-mui_vi.js.map +1 -1
  180. package/dist/properties/ts/odyssey-react-mui_zh_CN.js +4 -2
  181. package/dist/properties/ts/odyssey-react-mui_zh_CN.js.map +1 -1
  182. package/dist/properties/ts/odyssey-react-mui_zh_TW.js +4 -2
  183. package/dist/properties/ts/odyssey-react-mui_zh_TW.js.map +1 -1
  184. package/dist/scripts/properties-to-ts.d.ts +14 -0
  185. package/dist/scripts/properties-to-ts.d.ts.map +1 -0
  186. package/dist/src/Accordion.d.ts +2 -2
  187. package/dist/src/Accordion.d.ts.map +1 -1
  188. package/dist/src/Autocomplete.d.ts +2 -2
  189. package/dist/src/Autocomplete.d.ts.map +1 -1
  190. package/dist/src/Badge.d.ts +2 -2
  191. package/dist/src/Badge.d.ts.map +1 -1
  192. package/dist/src/Banner.d.ts +2 -2
  193. package/dist/src/Banner.d.ts.map +1 -1
  194. package/dist/src/Box.d.ts +2 -2
  195. package/dist/src/Box.d.ts.map +1 -1
  196. package/dist/src/Breadcrumbs.d.ts +3 -3
  197. package/dist/src/Breadcrumbs.d.ts.map +1 -1
  198. package/dist/src/Button.d.ts +3 -30
  199. package/dist/src/Button.d.ts.map +1 -1
  200. package/dist/src/Callout.d.ts +2 -2
  201. package/dist/src/Callout.d.ts.map +1 -1
  202. package/dist/src/Checkbox.d.ts +3 -23
  203. package/dist/src/Checkbox.d.ts.map +1 -1
  204. package/dist/src/CheckboxGroup.d.ts +2 -2
  205. package/dist/src/CheckboxGroup.d.ts.map +1 -1
  206. package/dist/src/CircularProgress.d.ts +2 -6
  207. package/dist/src/CircularProgress.d.ts.map +1 -1
  208. package/dist/src/CssBaseline.d.ts +1 -1
  209. package/dist/src/CssBaseline.d.ts.map +1 -1
  210. package/dist/src/Dialog.d.ts +5 -5
  211. package/dist/src/Dialog.d.ts.map +1 -1
  212. package/dist/src/ErrorMessageList.d.ts +1 -1
  213. package/dist/src/ErrorMessageList.d.ts.map +1 -1
  214. package/dist/src/Field.d.ts +2 -5
  215. package/dist/src/Field.d.ts.map +1 -1
  216. package/dist/src/FieldComponentProps.d.ts +7 -4
  217. package/dist/src/FieldComponentProps.d.ts.map +1 -1
  218. package/dist/src/FieldError.d.ts +2 -2
  219. package/dist/src/FieldError.d.ts.map +1 -1
  220. package/dist/src/FieldHint.d.ts +2 -2
  221. package/dist/src/FieldHint.d.ts.map +1 -1
  222. package/dist/src/FieldLabel.d.ts +2 -2
  223. package/dist/src/FieldLabel.d.ts.map +1 -1
  224. package/dist/src/Fieldset.d.ts +2 -2
  225. package/dist/src/Fieldset.d.ts.map +1 -1
  226. package/dist/src/Form.d.ts +2 -2
  227. package/dist/src/Form.d.ts.map +1 -1
  228. package/dist/src/HintLink.d.ts +1 -1
  229. package/dist/src/HintLink.d.ts.map +1 -1
  230. package/dist/src/HtmlProps.d.ts +59 -0
  231. package/dist/src/HtmlProps.d.ts.map +1 -1
  232. package/dist/src/Link.d.ts +2 -6
  233. package/dist/src/Link.d.ts.map +1 -1
  234. package/dist/src/MenuButton.d.ts +5 -23
  235. package/dist/src/MenuButton.d.ts.map +1 -1
  236. package/dist/src/MenuItem.d.ts +2 -2
  237. package/dist/src/MenuItem.d.ts.map +1 -1
  238. package/dist/src/NativeSelect.d.ts +2 -2
  239. package/dist/src/NativeSelect.d.ts.map +1 -1
  240. package/dist/src/OdysseyCacheProvider.d.ts +1 -1
  241. package/dist/src/OdysseyCacheProvider.d.ts.map +1 -1
  242. package/dist/src/OdysseyProvider.d.ts +1 -1
  243. package/dist/src/OdysseyProvider.d.ts.map +1 -1
  244. package/dist/src/OdysseyThemeProvider.d.ts +1 -3
  245. package/dist/src/OdysseyThemeProvider.d.ts.map +1 -1
  246. package/dist/src/OdysseyTranslationProvider.d.ts +2 -2
  247. package/dist/src/OdysseyTranslationProvider.d.ts.map +1 -1
  248. package/dist/src/PasswordField.d.ts +2 -2
  249. package/dist/src/PasswordField.d.ts.map +1 -1
  250. package/dist/src/Radio.d.ts +2 -2
  251. package/dist/src/Radio.d.ts.map +1 -1
  252. package/dist/src/RadioGroup.d.ts +2 -2
  253. package/dist/src/RadioGroup.d.ts.map +1 -1
  254. package/dist/src/ScreenReaderText.d.ts +2 -2
  255. package/dist/src/ScreenReaderText.d.ts.map +1 -1
  256. package/dist/src/SearchField.d.ts +11 -2
  257. package/dist/src/SearchField.d.ts.map +1 -1
  258. package/dist/src/Select.d.ts +2 -2
  259. package/dist/src/Select.d.ts.map +1 -1
  260. package/dist/src/Status.d.ts +4 -2
  261. package/dist/src/Status.d.ts.map +1 -1
  262. package/dist/src/Tabs.d.ts +2 -6
  263. package/dist/src/Tabs.d.ts.map +1 -1
  264. package/dist/src/Tag.d.ts +2 -2
  265. package/dist/src/Tag.d.ts.map +1 -1
  266. package/dist/src/TagList.d.ts +2 -2
  267. package/dist/src/TagList.d.ts.map +1 -1
  268. package/dist/src/TextField.d.ts +3 -3
  269. package/dist/src/TextField.d.ts.map +1 -1
  270. package/dist/src/Tile.d.ts +32 -11
  271. package/dist/src/Tile.d.ts.map +1 -1
  272. package/dist/src/Toast.d.ts +2 -2
  273. package/dist/src/Toast.d.ts.map +1 -1
  274. package/dist/src/ToastStack.d.ts +1 -1
  275. package/dist/src/ToastStack.d.ts.map +1 -1
  276. package/dist/src/Tooltip.d.ts +2 -2
  277. package/dist/src/Tooltip.d.ts.map +1 -1
  278. package/dist/src/Typography.d.ts +13 -25
  279. package/dist/src/Typography.d.ts.map +1 -1
  280. package/dist/src/icons.generated/Add.d.ts +1 -1
  281. package/dist/src/icons.generated/Add.d.ts.map +1 -1
  282. package/dist/src/icons.generated/AddCircle.d.ts +1 -1
  283. package/dist/src/icons.generated/AddCircle.d.ts.map +1 -1
  284. package/dist/src/icons.generated/Apps.d.ts +1 -1
  285. package/dist/src/icons.generated/Apps.d.ts.map +1 -1
  286. package/dist/src/icons.generated/ArrowBottom.d.ts +1 -1
  287. package/dist/src/icons.generated/ArrowBottom.d.ts.map +1 -1
  288. package/dist/src/icons.generated/ArrowDown.d.ts +1 -1
  289. package/dist/src/icons.generated/ArrowDown.d.ts.map +1 -1
  290. package/dist/src/icons.generated/ArrowLeft.d.ts +1 -1
  291. package/dist/src/icons.generated/ArrowLeft.d.ts.map +1 -1
  292. package/dist/src/icons.generated/ArrowLowerLeft.d.ts +1 -1
  293. package/dist/src/icons.generated/ArrowLowerLeft.d.ts.map +1 -1
  294. package/dist/src/icons.generated/ArrowLowerRight.d.ts +1 -1
  295. package/dist/src/icons.generated/ArrowLowerRight.d.ts.map +1 -1
  296. package/dist/src/icons.generated/ArrowRight.d.ts +1 -1
  297. package/dist/src/icons.generated/ArrowRight.d.ts.map +1 -1
  298. package/dist/src/icons.generated/ArrowTop.d.ts +1 -1
  299. package/dist/src/icons.generated/ArrowTop.d.ts.map +1 -1
  300. package/dist/src/icons.generated/ArrowUnsorted.d.ts +1 -1
  301. package/dist/src/icons.generated/ArrowUnsorted.d.ts.map +1 -1
  302. package/dist/src/icons.generated/ArrowUp.d.ts +1 -1
  303. package/dist/src/icons.generated/ArrowUp.d.ts.map +1 -1
  304. package/dist/src/icons.generated/ArrowUpperLeft.d.ts +1 -1
  305. package/dist/src/icons.generated/ArrowUpperLeft.d.ts.map +1 -1
  306. package/dist/src/icons.generated/ArrowUpperRight.d.ts +1 -1
  307. package/dist/src/icons.generated/ArrowUpperRight.d.ts.map +1 -1
  308. package/dist/src/icons.generated/Bug.d.ts +1 -1
  309. package/dist/src/icons.generated/Bug.d.ts.map +1 -1
  310. package/dist/src/icons.generated/Calendar.d.ts +1 -1
  311. package/dist/src/icons.generated/Calendar.d.ts.map +1 -1
  312. package/dist/src/icons.generated/Call.d.ts +1 -1
  313. package/dist/src/icons.generated/Call.d.ts.map +1 -1
  314. package/dist/src/icons.generated/Chat.d.ts +1 -1
  315. package/dist/src/icons.generated/Chat.d.ts.map +1 -1
  316. package/dist/src/icons.generated/Check.d.ts +1 -1
  317. package/dist/src/icons.generated/Check.d.ts.map +1 -1
  318. package/dist/src/icons.generated/CheckCircleFilled.d.ts +1 -1
  319. package/dist/src/icons.generated/CheckCircleFilled.d.ts.map +1 -1
  320. package/dist/src/icons.generated/ChevronDown.d.ts +1 -1
  321. package/dist/src/icons.generated/ChevronDown.d.ts.map +1 -1
  322. package/dist/src/icons.generated/ChevronLeft.d.ts +1 -1
  323. package/dist/src/icons.generated/ChevronLeft.d.ts.map +1 -1
  324. package/dist/src/icons.generated/ChevronRight.d.ts +1 -1
  325. package/dist/src/icons.generated/ChevronRight.d.ts.map +1 -1
  326. package/dist/src/icons.generated/ChevronUp.d.ts +1 -1
  327. package/dist/src/icons.generated/ChevronUp.d.ts.map +1 -1
  328. package/dist/src/icons.generated/Clock.d.ts +1 -1
  329. package/dist/src/icons.generated/Clock.d.ts.map +1 -1
  330. package/dist/src/icons.generated/Close.d.ts +1 -1
  331. package/dist/src/icons.generated/Close.d.ts.map +1 -1
  332. package/dist/src/icons.generated/CloseCircleFilled.d.ts +1 -1
  333. package/dist/src/icons.generated/CloseCircleFilled.d.ts.map +1 -1
  334. package/dist/src/icons.generated/CollapseLeft.d.ts +1 -1
  335. package/dist/src/icons.generated/CollapseLeft.d.ts.map +1 -1
  336. package/dist/src/icons.generated/CollapseRight.d.ts +1 -1
  337. package/dist/src/icons.generated/CollapseRight.d.ts.map +1 -1
  338. package/dist/src/icons.generated/Copy.d.ts +1 -1
  339. package/dist/src/icons.generated/Copy.d.ts.map +1 -1
  340. package/dist/src/icons.generated/DangerDiamond.d.ts +1 -1
  341. package/dist/src/icons.generated/DangerDiamond.d.ts.map +1 -1
  342. package/dist/src/icons.generated/DangerDiamondFilled.d.ts +1 -1
  343. package/dist/src/icons.generated/DangerDiamondFilled.d.ts.map +1 -1
  344. package/dist/src/icons.generated/Delete.d.ts +1 -1
  345. package/dist/src/icons.generated/Delete.d.ts.map +1 -1
  346. package/dist/src/icons.generated/Deny.d.ts +1 -1
  347. package/dist/src/icons.generated/Deny.d.ts.map +1 -1
  348. package/dist/src/icons.generated/Devices.d.ts +1 -1
  349. package/dist/src/icons.generated/Devices.d.ts.map +1 -1
  350. package/dist/src/icons.generated/Directory.d.ts +1 -1
  351. package/dist/src/icons.generated/Directory.d.ts.map +1 -1
  352. package/dist/src/icons.generated/Documentation.d.ts +1 -1
  353. package/dist/src/icons.generated/Documentation.d.ts.map +1 -1
  354. package/dist/src/icons.generated/Download.d.ts +1 -1
  355. package/dist/src/icons.generated/Download.d.ts.map +1 -1
  356. package/dist/src/icons.generated/DragIndicator.d.ts +1 -1
  357. package/dist/src/icons.generated/DragIndicator.d.ts.map +1 -1
  358. package/dist/src/icons.generated/Edit.d.ts +1 -1
  359. package/dist/src/icons.generated/Edit.d.ts.map +1 -1
  360. package/dist/src/icons.generated/ExpandLeft.d.ts +1 -1
  361. package/dist/src/icons.generated/ExpandLeft.d.ts.map +1 -1
  362. package/dist/src/icons.generated/ExpandRight.d.ts +1 -1
  363. package/dist/src/icons.generated/ExpandRight.d.ts.map +1 -1
  364. package/dist/src/icons.generated/ExternalLink.d.ts +1 -1
  365. package/dist/src/icons.generated/ExternalLink.d.ts.map +1 -1
  366. package/dist/src/icons.generated/Filter.d.ts +1 -1
  367. package/dist/src/icons.generated/Filter.d.ts.map +1 -1
  368. package/dist/src/icons.generated/Folder.d.ts +1 -1
  369. package/dist/src/icons.generated/Folder.d.ts.map +1 -1
  370. package/dist/src/icons.generated/Globe.d.ts +1 -1
  371. package/dist/src/icons.generated/Globe.d.ts.map +1 -1
  372. package/dist/src/icons.generated/Grid.d.ts +1 -1
  373. package/dist/src/icons.generated/Grid.d.ts.map +1 -1
  374. package/dist/src/icons.generated/Group.d.ts +1 -1
  375. package/dist/src/icons.generated/Group.d.ts.map +1 -1
  376. package/dist/src/icons.generated/Hide.d.ts +1 -1
  377. package/dist/src/icons.generated/Hide.d.ts.map +1 -1
  378. package/dist/src/icons.generated/Home.d.ts +1 -1
  379. package/dist/src/icons.generated/Home.d.ts.map +1 -1
  380. package/dist/src/icons.generated/InformationCircle.d.ts +1 -1
  381. package/dist/src/icons.generated/InformationCircle.d.ts.map +1 -1
  382. package/dist/src/icons.generated/InformationCircleFilled.d.ts +1 -1
  383. package/dist/src/icons.generated/InformationCircleFilled.d.ts.map +1 -1
  384. package/dist/src/icons.generated/Link.d.ts +1 -1
  385. package/dist/src/icons.generated/Link.d.ts.map +1 -1
  386. package/dist/src/icons.generated/List.d.ts +1 -1
  387. package/dist/src/icons.generated/List.d.ts.map +1 -1
  388. package/dist/src/icons.generated/Lock.d.ts +1 -1
  389. package/dist/src/icons.generated/Lock.d.ts.map +1 -1
  390. package/dist/src/icons.generated/More.d.ts +1 -1
  391. package/dist/src/icons.generated/More.d.ts.map +1 -1
  392. package/dist/src/icons.generated/Notification.d.ts +1 -1
  393. package/dist/src/icons.generated/Notification.d.ts.map +1 -1
  394. package/dist/src/icons.generated/Pause.d.ts +1 -1
  395. package/dist/src/icons.generated/Pause.d.ts.map +1 -1
  396. package/dist/src/icons.generated/QuestionCircle.d.ts +1 -1
  397. package/dist/src/icons.generated/QuestionCircle.d.ts.map +1 -1
  398. package/dist/src/icons.generated/QuestionCircleFilled.d.ts +1 -1
  399. package/dist/src/icons.generated/QuestionCircleFilled.d.ts.map +1 -1
  400. package/dist/src/icons.generated/Refresh.d.ts +1 -1
  401. package/dist/src/icons.generated/Refresh.d.ts.map +1 -1
  402. package/dist/src/icons.generated/Reset.d.ts +1 -1
  403. package/dist/src/icons.generated/Reset.d.ts.map +1 -1
  404. package/dist/src/icons.generated/Resume.d.ts +1 -1
  405. package/dist/src/icons.generated/Resume.d.ts.map +1 -1
  406. package/dist/src/icons.generated/Search.d.ts +1 -1
  407. package/dist/src/icons.generated/Search.d.ts.map +1 -1
  408. package/dist/src/icons.generated/Server.d.ts +1 -1
  409. package/dist/src/icons.generated/Server.d.ts.map +1 -1
  410. package/dist/src/icons.generated/Settings.d.ts +1 -1
  411. package/dist/src/icons.generated/Settings.d.ts.map +1 -1
  412. package/dist/src/icons.generated/Show.d.ts +1 -1
  413. package/dist/src/icons.generated/Show.d.ts.map +1 -1
  414. package/dist/src/icons.generated/Subtract.d.ts +1 -1
  415. package/dist/src/icons.generated/Subtract.d.ts.map +1 -1
  416. package/dist/src/icons.generated/Sync.d.ts +1 -1
  417. package/dist/src/icons.generated/Sync.d.ts.map +1 -1
  418. package/dist/src/icons.generated/Unlock.d.ts +1 -1
  419. package/dist/src/icons.generated/Unlock.d.ts.map +1 -1
  420. package/dist/src/icons.generated/Upload.d.ts +1 -1
  421. package/dist/src/icons.generated/Upload.d.ts.map +1 -1
  422. package/dist/src/icons.generated/User.d.ts +1 -1
  423. package/dist/src/icons.generated/User.d.ts.map +1 -1
  424. package/dist/src/icons.generated/Video.d.ts +1 -1
  425. package/dist/src/icons.generated/Video.d.ts.map +1 -1
  426. package/dist/src/icons.generated/Warning.d.ts +1 -1
  427. package/dist/src/icons.generated/Warning.d.ts.map +1 -1
  428. package/dist/src/icons.generated/WarningFilled.d.ts +1 -1
  429. package/dist/src/icons.generated/WarningFilled.d.ts.map +1 -1
  430. package/dist/src/icons.generated/index.d.ts +1 -1
  431. package/dist/src/index.d.ts.map +1 -1
  432. package/dist/src/labs/DataFilters.d.ts +1 -1
  433. package/dist/src/labs/DataFilters.d.ts.map +1 -1
  434. package/dist/src/labs/DataTable.d.ts +1 -1
  435. package/dist/src/labs/DataTable.d.ts.map +1 -1
  436. package/dist/src/labs/DataTablePagination.d.ts +1 -1
  437. package/dist/src/labs/DataTablePagination.d.ts.map +1 -1
  438. package/dist/src/labs/DatePicker.d.ts +1 -1
  439. package/dist/src/labs/DatePicker.d.ts.map +1 -1
  440. package/dist/src/labs/Drawer.d.ts +56 -0
  441. package/dist/src/labs/Drawer.d.ts.map +1 -0
  442. package/dist/src/labs/GroupPicker.d.ts +1 -1
  443. package/dist/src/labs/GroupPicker.d.ts.map +1 -1
  444. package/dist/src/labs/PaginatedTable.d.ts +1 -1
  445. package/dist/src/labs/PaginatedTable.d.ts.map +1 -1
  446. package/dist/src/labs/StaticTable.d.ts +1 -1
  447. package/dist/src/labs/StaticTable.d.ts.map +1 -1
  448. package/dist/src/labs/Switch.d.ts +2 -2
  449. package/dist/src/labs/Switch.d.ts.map +1 -1
  450. package/dist/src/labs/VirtualizedAutocomplete.d.ts +2 -2
  451. package/dist/src/labs/VirtualizedAutocomplete.d.ts.map +1 -1
  452. package/dist/src/labs/datePickerTheme.d.ts.map +1 -1
  453. package/dist/src/labs/index.d.ts +1 -0
  454. package/dist/src/labs/index.d.ts.map +1 -1
  455. package/dist/src/properties/ts/odyssey-react-mui_cs.d.ts +3 -1
  456. package/dist/src/properties/ts/odyssey-react-mui_cs.d.ts.map +1 -1
  457. package/dist/src/properties/ts/odyssey-react-mui_da.d.ts +3 -1
  458. package/dist/src/properties/ts/odyssey-react-mui_da.d.ts.map +1 -1
  459. package/dist/src/properties/ts/odyssey-react-mui_de.d.ts +3 -1
  460. package/dist/src/properties/ts/odyssey-react-mui_de.d.ts.map +1 -1
  461. package/dist/src/properties/ts/odyssey-react-mui_el.d.ts +3 -1
  462. package/dist/src/properties/ts/odyssey-react-mui_el.d.ts.map +1 -1
  463. package/dist/src/properties/ts/odyssey-react-mui_es.d.ts +3 -1
  464. package/dist/src/properties/ts/odyssey-react-mui_es.d.ts.map +1 -1
  465. package/dist/src/properties/ts/odyssey-react-mui_fi.d.ts +3 -1
  466. package/dist/src/properties/ts/odyssey-react-mui_fi.d.ts.map +1 -1
  467. package/dist/src/properties/ts/odyssey-react-mui_fr.d.ts +3 -1
  468. package/dist/src/properties/ts/odyssey-react-mui_fr.d.ts.map +1 -1
  469. package/dist/src/properties/ts/odyssey-react-mui_hu.d.ts +3 -1
  470. package/dist/src/properties/ts/odyssey-react-mui_hu.d.ts.map +1 -1
  471. package/dist/src/properties/ts/odyssey-react-mui_id.d.ts +3 -1
  472. package/dist/src/properties/ts/odyssey-react-mui_id.d.ts.map +1 -1
  473. package/dist/src/properties/ts/odyssey-react-mui_it.d.ts +3 -1
  474. package/dist/src/properties/ts/odyssey-react-mui_it.d.ts.map +1 -1
  475. package/dist/src/properties/ts/odyssey-react-mui_ja.d.ts +3 -1
  476. package/dist/src/properties/ts/odyssey-react-mui_ja.d.ts.map +1 -1
  477. package/dist/src/properties/ts/odyssey-react-mui_ko.d.ts +3 -1
  478. package/dist/src/properties/ts/odyssey-react-mui_ko.d.ts.map +1 -1
  479. package/dist/src/properties/ts/odyssey-react-mui_ms.d.ts +3 -1
  480. package/dist/src/properties/ts/odyssey-react-mui_ms.d.ts.map +1 -1
  481. package/dist/src/properties/ts/odyssey-react-mui_nb.d.ts +3 -1
  482. package/dist/src/properties/ts/odyssey-react-mui_nb.d.ts.map +1 -1
  483. package/dist/src/properties/ts/odyssey-react-mui_nl_NL.d.ts +3 -1
  484. package/dist/src/properties/ts/odyssey-react-mui_nl_NL.d.ts.map +1 -1
  485. package/dist/src/properties/ts/odyssey-react-mui_pl.d.ts +3 -1
  486. package/dist/src/properties/ts/odyssey-react-mui_pl.d.ts.map +1 -1
  487. package/dist/src/properties/ts/odyssey-react-mui_pt_BR.d.ts +3 -1
  488. package/dist/src/properties/ts/odyssey-react-mui_pt_BR.d.ts.map +1 -1
  489. package/dist/src/properties/ts/odyssey-react-mui_ro.d.ts +3 -1
  490. package/dist/src/properties/ts/odyssey-react-mui_ro.d.ts.map +1 -1
  491. package/dist/src/properties/ts/odyssey-react-mui_ru.d.ts +3 -1
  492. package/dist/src/properties/ts/odyssey-react-mui_ru.d.ts.map +1 -1
  493. package/dist/src/properties/ts/odyssey-react-mui_sv.d.ts +3 -1
  494. package/dist/src/properties/ts/odyssey-react-mui_sv.d.ts.map +1 -1
  495. package/dist/src/properties/ts/odyssey-react-mui_th.d.ts +3 -1
  496. package/dist/src/properties/ts/odyssey-react-mui_th.d.ts.map +1 -1
  497. package/dist/src/properties/ts/odyssey-react-mui_tr.d.ts +3 -1
  498. package/dist/src/properties/ts/odyssey-react-mui_tr.d.ts.map +1 -1
  499. package/dist/src/properties/ts/odyssey-react-mui_uk.d.ts +3 -1
  500. package/dist/src/properties/ts/odyssey-react-mui_uk.d.ts.map +1 -1
  501. package/dist/src/properties/ts/odyssey-react-mui_vi.d.ts +3 -1
  502. package/dist/src/properties/ts/odyssey-react-mui_vi.d.ts.map +1 -1
  503. package/dist/src/properties/ts/odyssey-react-mui_zh_CN.d.ts +3 -1
  504. package/dist/src/properties/ts/odyssey-react-mui_zh_CN.d.ts.map +1 -1
  505. package/dist/src/properties/ts/odyssey-react-mui_zh_TW.d.ts +3 -1
  506. package/dist/src/properties/ts/odyssey-react-mui_zh_TW.d.ts.map +1 -1
  507. package/dist/src/theme/components.d.ts.map +1 -1
  508. package/dist/theme/components.js +60 -8
  509. package/dist/theme/components.js.map +1 -1
  510. package/dist/tsconfig.production.tsbuildinfo +1 -1
  511. package/package.json +15 -15
  512. package/scripts/generateIconsIndex.ts +2 -2
  513. package/scripts/{properties-to-ts.js → properties-to-ts.ts} +55 -41
  514. package/src/@types/properties.d.ts +292 -0
  515. package/src/Accordion.tsx +1 -1
  516. package/src/Autocomplete.tsx +17 -9
  517. package/src/Badge.tsx +1 -1
  518. package/src/Banner.tsx +1 -1
  519. package/src/Box.tsx +2 -2
  520. package/src/Breadcrumbs.tsx +2 -2
  521. package/src/Button.tsx +26 -38
  522. package/src/Callout.tsx +1 -1
  523. package/src/Checkbox.tsx +9 -29
  524. package/src/CheckboxGroup.tsx +20 -5
  525. package/src/CircularProgress.tsx +1 -5
  526. package/src/Dialog.tsx +18 -17
  527. package/src/ErrorMessageList.tsx +1 -1
  528. package/src/Field.tsx +6 -9
  529. package/src/FieldComponentProps.ts +8 -4
  530. package/src/FieldError.tsx +2 -2
  531. package/src/FieldHint.tsx +1 -1
  532. package/src/FieldLabel.tsx +2 -2
  533. package/src/Fieldset.tsx +2 -2
  534. package/src/Form.tsx +1 -1
  535. package/src/FormCheckedProps.ts +3 -3
  536. package/src/HintLink.tsx +1 -1
  537. package/src/HtmlProps.ts +60 -0
  538. package/src/Link.tsx +2 -6
  539. package/src/MenuButton.tsx +21 -36
  540. package/src/MenuItem.tsx +2 -2
  541. package/src/MuiPropsChild.tsx +2 -2
  542. package/src/NativeSelect.tsx +24 -13
  543. package/src/OdysseyCacheProvider.test.tsx +3 -3
  544. package/src/OdysseyProvider.tsx +1 -3
  545. package/src/OdysseyThemeProvider.tsx +8 -35
  546. package/src/OdysseyTranslationProvider.test.tsx +6 -6
  547. package/src/OdysseyTranslationProvider.tsx +7 -7
  548. package/src/PasswordField.tsx +23 -10
  549. package/src/Radio.tsx +4 -4
  550. package/src/RadioGroup.tsx +22 -7
  551. package/src/ScreenReaderText.tsx +1 -1
  552. package/src/SearchField.tsx +25 -12
  553. package/src/Select.tsx +219 -77
  554. package/src/Status.tsx +8 -2
  555. package/src/Tabs.tsx +7 -11
  556. package/src/Tag.tsx +4 -4
  557. package/src/TagList.tsx +2 -2
  558. package/src/TextField.tsx +22 -9
  559. package/src/Tile.tsx +74 -43
  560. package/src/Toast.tsx +1 -1
  561. package/src/Tooltip.tsx +1 -1
  562. package/src/Typography.tsx +20 -28
  563. package/src/createShadowRootElement.ts +1 -1
  564. package/src/getTypedObjectKeys.ts +1 -1
  565. package/src/icons.generated/AddCircle.tsx +1 -1
  566. package/src/icons.generated/Apps.tsx +1 -1
  567. package/src/icons.generated/ArrowBottom.tsx +1 -1
  568. package/src/icons.generated/ArrowDown.tsx +1 -1
  569. package/src/icons.generated/ArrowLeft.tsx +1 -1
  570. package/src/icons.generated/ArrowRight.tsx +1 -1
  571. package/src/icons.generated/ArrowTop.tsx +1 -1
  572. package/src/icons.generated/ArrowUp.tsx +1 -1
  573. package/src/icons.generated/Calendar.tsx +1 -1
  574. package/src/icons.generated/Call.tsx +1 -1
  575. package/src/icons.generated/Chat.tsx +1 -1
  576. package/src/icons.generated/Check.tsx +1 -1
  577. package/src/icons.generated/ChevronDown.tsx +1 -1
  578. package/src/icons.generated/ChevronLeft.tsx +1 -1
  579. package/src/icons.generated/ChevronUp.tsx +1 -1
  580. package/src/icons.generated/Clock.tsx +1 -1
  581. package/src/icons.generated/Close.tsx +1 -1
  582. package/src/icons.generated/Copy.tsx +1 -1
  583. package/src/icons.generated/Delete.tsx +1 -1
  584. package/src/icons.generated/Deny.tsx +1 -1
  585. package/src/icons.generated/Devices.tsx +1 -1
  586. package/src/icons.generated/Directory.tsx +1 -1
  587. package/src/icons.generated/Download.tsx +1 -1
  588. package/src/icons.generated/Edit.tsx +1 -1
  589. package/src/icons.generated/ExpandLeft.tsx +1 -1
  590. package/src/icons.generated/ExpandRight.tsx +1 -1
  591. package/src/icons.generated/Filter.tsx +1 -1
  592. package/src/icons.generated/Folder.tsx +1 -1
  593. package/src/icons.generated/Globe.tsx +1 -1
  594. package/src/icons.generated/Grid.tsx +1 -1
  595. package/src/icons.generated/Group.tsx +1 -1
  596. package/src/icons.generated/Hide.tsx +1 -1
  597. package/src/icons.generated/Home.tsx +1 -1
  598. package/src/icons.generated/Link.tsx +1 -1
  599. package/src/icons.generated/List.tsx +1 -1
  600. package/src/icons.generated/Lock.tsx +1 -1
  601. package/src/icons.generated/More.tsx +1 -1
  602. package/src/icons.generated/Pause.tsx +1 -1
  603. package/src/icons.generated/Refresh.tsx +1 -1
  604. package/src/icons.generated/Reset.tsx +1 -1
  605. package/src/icons.generated/Resume.tsx +1 -1
  606. package/src/icons.generated/Search.tsx +1 -1
  607. package/src/icons.generated/Server.tsx +1 -1
  608. package/src/icons.generated/Settings.tsx +1 -1
  609. package/src/icons.generated/Show.tsx +1 -1
  610. package/src/icons.generated/Subtract.tsx +1 -1
  611. package/src/icons.generated/Sync.tsx +1 -1
  612. package/src/icons.generated/Unlock.tsx +1 -1
  613. package/src/icons.generated/Upload.tsx +1 -1
  614. package/src/icons.generated/User.tsx +1 -1
  615. package/src/icons.generated/Video.tsx +1 -1
  616. package/src/icons.generated/Warning.tsx +1 -1
  617. package/src/icons.generated/index.ts +1 -1
  618. package/src/index.ts +0 -1
  619. package/src/labs/DataFilters.tsx +36 -30
  620. package/src/labs/DataTable.tsx +20 -20
  621. package/src/labs/DatePicker.tsx +3 -1
  622. package/src/labs/Drawer.tsx +254 -0
  623. package/src/labs/GroupPicker.tsx +34 -15
  624. package/src/labs/PaginatedTable.tsx +12 -10
  625. package/src/labs/StaticTable.tsx +3 -3
  626. package/src/labs/Switch.tsx +5 -5
  627. package/src/labs/VirtualizedAutocomplete.tsx +19 -16
  628. package/src/labs/datePickerTheme.tsx +4 -2
  629. package/src/labs/index.ts +2 -0
  630. package/src/labs/materialReactTableTypes.tsx +1 -1
  631. package/src/properties/translations/odyssey-react-mui_cs.properties +3 -1
  632. package/src/properties/translations/odyssey-react-mui_da.properties +3 -1
  633. package/src/properties/translations/odyssey-react-mui_de.properties +3 -1
  634. package/src/properties/translations/odyssey-react-mui_el.properties +3 -1
  635. package/src/properties/translations/odyssey-react-mui_es.properties +3 -1
  636. package/src/properties/translations/odyssey-react-mui_fi.properties +3 -1
  637. package/src/properties/translations/odyssey-react-mui_fr.properties +3 -1
  638. package/src/properties/translations/odyssey-react-mui_hu.properties +3 -1
  639. package/src/properties/translations/odyssey-react-mui_id.properties +3 -1
  640. package/src/properties/translations/odyssey-react-mui_it.properties +3 -1
  641. package/src/properties/translations/odyssey-react-mui_ja.properties +3 -1
  642. package/src/properties/translations/odyssey-react-mui_ko.properties +3 -1
  643. package/src/properties/translations/odyssey-react-mui_ms.properties +3 -1
  644. package/src/properties/translations/odyssey-react-mui_nb.properties +3 -1
  645. package/src/properties/translations/odyssey-react-mui_nl_NL.properties +3 -1
  646. package/src/properties/translations/odyssey-react-mui_pl.properties +3 -1
  647. package/src/properties/translations/odyssey-react-mui_pt_BR.properties +3 -1
  648. package/src/properties/translations/odyssey-react-mui_ro.properties +3 -1
  649. package/src/properties/translations/odyssey-react-mui_ru.properties +3 -1
  650. package/src/properties/translations/odyssey-react-mui_sv.properties +3 -1
  651. package/src/properties/translations/odyssey-react-mui_th.properties +3 -1
  652. package/src/properties/translations/odyssey-react-mui_tr.properties +3 -1
  653. package/src/properties/translations/odyssey-react-mui_uk.properties +3 -1
  654. package/src/properties/translations/odyssey-react-mui_vi.properties +3 -1
  655. package/src/properties/translations/odyssey-react-mui_zh_CN.properties +3 -1
  656. package/src/properties/translations/odyssey-react-mui_zh_TW.properties +3 -1
  657. package/src/properties/ts/odyssey-react-mui_cs.ts +1 -1
  658. package/src/properties/ts/odyssey-react-mui_da.ts +1 -1
  659. package/src/properties/ts/odyssey-react-mui_de.ts +1 -1
  660. package/src/properties/ts/odyssey-react-mui_el.ts +1 -1
  661. package/src/properties/ts/odyssey-react-mui_es.ts +1 -1
  662. package/src/properties/ts/odyssey-react-mui_fi.ts +1 -1
  663. package/src/properties/ts/odyssey-react-mui_fr.ts +1 -1
  664. package/src/properties/ts/odyssey-react-mui_hu.ts +1 -1
  665. package/src/properties/ts/odyssey-react-mui_id.ts +1 -1
  666. package/src/properties/ts/odyssey-react-mui_it.ts +1 -1
  667. package/src/properties/ts/odyssey-react-mui_ja.ts +1 -1
  668. package/src/properties/ts/odyssey-react-mui_ko.ts +1 -1
  669. package/src/properties/ts/odyssey-react-mui_ms.ts +1 -1
  670. package/src/properties/ts/odyssey-react-mui_nb.ts +1 -1
  671. package/src/properties/ts/odyssey-react-mui_nl_NL.ts +1 -1
  672. package/src/properties/ts/odyssey-react-mui_pl.ts +1 -1
  673. package/src/properties/ts/odyssey-react-mui_pt_BR.ts +1 -1
  674. package/src/properties/ts/odyssey-react-mui_ro.ts +1 -1
  675. package/src/properties/ts/odyssey-react-mui_ru.ts +1 -1
  676. package/src/properties/ts/odyssey-react-mui_sv.ts +1 -1
  677. package/src/properties/ts/odyssey-react-mui_th.ts +1 -1
  678. package/src/properties/ts/odyssey-react-mui_tr.ts +1 -1
  679. package/src/properties/ts/odyssey-react-mui_uk.ts +1 -1
  680. package/src/properties/ts/odyssey-react-mui_vi.ts +1 -1
  681. package/src/properties/ts/odyssey-react-mui_zh_CN.ts +1 -1
  682. package/src/properties/ts/odyssey-react-mui_zh_TW.ts +1 -1
  683. package/src/theme/components.tsx +83 -16
  684. package/tsconfig.json +0 -3
@@ -1 +1 @@
1
- {"version":3,"file":"Select.js","names":["memo","useCallback","useEffect","useMemo","useRef","useState","useImperativeHandle","Field","CheckIcon","ComponentControlledState","useInputValues","getControlState","normalizedKey","jsx","_jsx","jsxs","_jsxs","CONTROLLED","Select","ariaDescribedBy","defaultValue","errorMessage","errorMessageList","hasMultipleChoices","hasMultipleChoicesProp","hint","HintLinkComponent","id","idOverride","inputRef","isDisabled","isFullWidth","isMultiSelect","isOptional","label","name","nameOverride","onBlur","onChange","onChangeProp","onFocus","options","testId","translate","value","undefined","controlledStateRef","controlledValue","uncontrolledValue","internalSelectedValues","setInternalSelectedValues","current","localInputRef","focus","inputValues","controlState","event","child","target","split","normalizedOptions","map","option","text","type","renderValue","selected","renderedChips","item","selectedOption","find","_Chip","filter","Boolean","length","_Box","children","index","_ListSubheader","_MenuItem","_Checkbox","checked","includes","_ListItemSecondaryAction","toString","renderFieldComponent","errorMessageElementId","labelElementId","_Select","displayEmpty","inputProps","labelId","multiple","fieldType","hasVisibleLabel","MemoizedSelect","displayName"],"sources":["../src/Select.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 memo,\n useCallback,\n useEffect,\n useMemo,\n useRef,\n useState,\n useImperativeHandle,\n} from \"react\";\nimport {\n Box,\n Checkbox as MuiCheckbox,\n Chip,\n ListItemSecondaryAction,\n ListSubheader,\n MenuItem,\n Select as MuiSelect,\n} from \"@mui/material\";\nimport { SelectProps as MuiSelectProps } from \"@mui/material\";\n\nimport { Field } from \"./Field\";\nimport { FieldComponentProps } from \"./FieldComponentProps\";\nimport { CheckIcon } from \"./icons.generated\";\nimport type { HtmlProps } from \"./HtmlProps\";\nimport {\n ComponentControlledState,\n FocusHandle,\n useInputValues,\n getControlState,\n} from \"./inputUtils\";\nimport { normalizedKey } from \"./useNormalizedKey\";\n\nexport type SelectOption = {\n text: string;\n type?: \"heading\" | \"option\";\n value?: string;\n};\n\nexport type SelectValueType<HasMultipleChoices> =\n HasMultipleChoices extends true ? string[] : string;\n\nexport type SelectProps<\n Value extends SelectValueType<HasMultipleChoices>,\n HasMultipleChoices extends boolean\n> = {\n /**\n * The default value. Use when the component is not controlled.\n */\n defaultValue?: MuiSelectProps<Value>[\"defaultValue\"];\n /**\n * If `true`, the Select allows multiple selections\n */\n hasMultipleChoices?: HasMultipleChoices;\n /**\n * The ref forwarded to the Select\n */\n inputRef?: React.RefObject<FocusHandle>;\n /**\n * @deprecated Use `hasMultipleChoices` instead.\n */\n /** **Deprecated:** use `hasMultipleChoices` */\n isMultiSelect?: HasMultipleChoices;\n /**\n * The label text for the Select\n */\n label: string;\n /**\n * Callback fired when the Select loses focus\n */\n onBlur?: MuiSelectProps<Value>[\"onBlur\"];\n /**\n * Callback fired when the value of the Select changes\n */\n onChange?: MuiSelectProps<Value>[\"onChange\"];\n /**\n * Callback fired when the Select gains focus\n */\n onFocus?: MuiSelectProps<Value>[\"onFocus\"];\n /**\n * The options for the Select\n */\n options: (string | SelectOption)[];\n /**\n * The value or values selected in the Select\n */\n value?: Value;\n} & Pick<\n FieldComponentProps,\n | \"ariaDescribedBy\"\n | \"errorMessage\"\n | \"errorMessageList\"\n | \"hint\"\n | \"HintLinkComponent\"\n | \"id\"\n | \"isDisabled\"\n | \"isFullWidth\"\n | \"isOptional\"\n | \"name\"\n> &\n HtmlProps;\n\n/**\n * Options in Odyssey <Select> are passed as an array, which can contain any combination\n * of the following:\n * - string — A simple string. The string will be both the text and the value of the resulting option.\n * <option value=\"string\">string</option>\n *\n * - { text: string } — Same as above, but the string is contained within an object.\n * <option value=\"text\">text</option>\n *\n * - { text: string, value: string } — The option text will be text, and the option value will be value.\n * <option value=\"value\">text</option>\n *\n * - { text: string, type: \"heading\" } — Used to display a group heading with the text\n */\n\nconst { CONTROLLED } = ComponentControlledState;\nconst Select = <\n Value extends SelectValueType<HasMultipleChoices>,\n HasMultipleChoices extends boolean\n>({\n ariaDescribedBy,\n defaultValue,\n errorMessage,\n errorMessageList,\n hasMultipleChoices: hasMultipleChoicesProp,\n hint,\n HintLinkComponent,\n id: idOverride,\n inputRef,\n isDisabled = false,\n isFullWidth = false,\n isMultiSelect,\n isOptional = false,\n label,\n name: nameOverride,\n onBlur,\n onChange: onChangeProp,\n onFocus,\n options,\n testId,\n translate,\n value,\n}: SelectProps<Value, HasMultipleChoices>) => {\n const hasMultipleChoices = useMemo(\n () =>\n hasMultipleChoicesProp === undefined\n ? isMultiSelect\n : hasMultipleChoicesProp,\n [hasMultipleChoicesProp, isMultiSelect]\n );\n const controlledStateRef = useRef(\n getControlState({ controlledValue: value, uncontrolledValue: defaultValue })\n );\n const [internalSelectedValues, setInternalSelectedValues] = useState(\n controlledStateRef.current === CONTROLLED ? value : defaultValue\n );\n const localInputRef = useRef<HTMLSelectElement>(null);\n\n useImperativeHandle(\n inputRef,\n () => {\n return {\n focus: () => {\n localInputRef.current?.focus();\n },\n };\n },\n []\n );\n\n useEffect(() => {\n if (controlledStateRef.current === CONTROLLED) {\n setInternalSelectedValues(value);\n }\n }, [value]);\n\n const inputValues = useInputValues({\n defaultValue,\n value,\n controlState: controlledStateRef.current,\n });\n\n const onChange = useCallback<NonNullable<MuiSelectProps<Value>[\"onChange\"]>>(\n (event, child) => {\n const {\n target: { value },\n } = event;\n if (controlledStateRef.current !== CONTROLLED) {\n setInternalSelectedValues(\n (typeof value === \"string\" ? value.split(\",\") : value) as Value\n );\n }\n onChangeProp?.(event, child);\n },\n [onChangeProp]\n );\n\n // Normalize the options array to accommodate the various\n // data types that might be passed\n const normalizedOptions = useMemo(\n () =>\n options.map((option) => {\n if (typeof option === \"object\") {\n /**\n * If the value of `option?.value is an empty string, we need to make sure that we\n * set an empty string to `value` in the normalized option so that the select component\n * can potentially set it as the selected one in the text input\n */\n const value =\n option?.value === \"\" ? option.value : option.value || option.text;\n return {\n text: option.text,\n value,\n type: option.type === \"heading\" ? \"heading\" : \"option\",\n };\n }\n return { text: option, value: option, type: \"option\" };\n }),\n [options]\n );\n\n const renderValue = useCallback(\n (selected: Value) => {\n // If the selected value isn't an array, then we don't need to display\n // chips and should fall back to the default render behavior\n if (typeof selected === \"string\") {\n return undefined;\n }\n\n // Convert the selected options array into <Chip>s\n const renderedChips = selected\n .map((item: string) => {\n const selectedOption = normalizedOptions.find(\n (option) => option.value === item\n );\n\n if (!selectedOption) {\n return null;\n }\n\n return <Chip key={item} label={selectedOption.text} />;\n })\n .filter(Boolean);\n\n if (renderedChips.length === 0) {\n return null;\n }\n\n // We need the <Box> to surround the <Chip>s for\n // proper styling\n return <Box>{renderedChips}</Box>;\n },\n [normalizedOptions]\n );\n\n // Convert the options into the ReactNode children\n // that will populate the <Select>\n const children = useMemo(\n () =>\n normalizedOptions.map((option, index) => {\n if (option.type === \"heading\") {\n return <ListSubheader key={option.text}>{option.text}</ListSubheader>;\n }\n return (\n <MenuItem\n key={normalizedKey(option.text, index.toString())}\n value={option.value}\n >\n {hasMultipleChoices && (\n <MuiCheckbox\n checked={\n option.value !== undefined &&\n internalSelectedValues?.includes(option.value)\n }\n />\n )}\n {option.text}\n {!hasMultipleChoices &&\n (internalSelectedValues?.includes(option.value) ||\n internalSelectedValues === option.value) && (\n <ListItemSecondaryAction>\n <CheckIcon />\n </ListItemSecondaryAction>\n )}\n </MenuItem>\n );\n }),\n [hasMultipleChoices, normalizedOptions, internalSelectedValues]\n );\n\n const renderFieldComponent = useCallback(\n ({ ariaDescribedBy, errorMessageElementId, id, labelElementId }) => (\n <MuiSelect\n {...inputValues}\n aria-describedby={ariaDescribedBy}\n aria-errormessage={errorMessageElementId}\n children={children}\n data-se={testId}\n displayEmpty={\n inputValues?.value === \"\" || inputValues?.defaultValue === \"\"\n }\n id={id}\n inputProps={{ \"data-se\": testId }}\n inputRef={localInputRef}\n labelId={labelElementId}\n multiple={hasMultipleChoices}\n name={nameOverride ?? id}\n onBlur={onBlur}\n onChange={onChange}\n onFocus={onFocus}\n renderValue={hasMultipleChoices ? renderValue : undefined}\n translate={translate}\n />\n ),\n [\n children,\n inputValues,\n hasMultipleChoices,\n nameOverride,\n onBlur,\n onChange,\n onFocus,\n renderValue,\n testId,\n translate,\n ]\n );\n\n return (\n <Field\n ariaDescribedBy={ariaDescribedBy}\n errorMessage={errorMessage}\n errorMessageList={errorMessageList}\n fieldType=\"single\"\n hasVisibleLabel\n hint={hint}\n HintLinkComponent={HintLinkComponent}\n id={idOverride}\n isDisabled={isDisabled}\n isFullWidth={isFullWidth}\n isOptional={isOptional}\n label={label}\n renderFieldComponent={renderFieldComponent}\n />\n );\n};\n\nconst MemoizedSelect = memo(Select);\nMemoizedSelect.displayName = \"Select\";\n\nexport { MemoizedSelect as Select };\n"],"mappings":";;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SACEA,IAAI,EACJC,WAAW,EACXC,SAAS,EACTC,OAAO,EACPC,MAAM,EACNC,QAAQ,EACRC,mBAAmB,QACd,OAAO;AAAC,SAYNC,KAAK;AAAA,SAELC,SAAS;AAAA,SAGhBC,wBAAwB,EAExBC,cAAc,EACdC,eAAe;AAAA,SAERC,aAAa;AAAA,SAAAC,GAAA,IAAAC,IAAA;AAAA,SAAAC,IAAA,IAAAC,KAAA;AAsFtB,MAAM;EAAEC;AAAW,CAAC,GAAGR,wBAAwB;AAC/C,MAAMS,MAAM,GAAGA,CAGb;EACAC,eAAe;EACfC,YAAY;EACZC,YAAY;EACZC,gBAAgB;EAChBC,kBAAkB,EAAEC,sBAAsB;EAC1CC,IAAI;EACJC,iBAAiB;EACjBC,EAAE,EAAEC,UAAU;EACdC,QAAQ;EACRC,UAAU,GAAG,KAAK;EAClBC,WAAW,GAAG,KAAK;EACnBC,aAAa;EACbC,UAAU,GAAG,KAAK;EAClBC,KAAK;EACLC,IAAI,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mD,oBAAoB,EAAEA;EAAqB,CAC5C,CAAC;AAEN,CAAC;AAED,MAAMU,cAAc,GAAG/F,IAAI,CAACkB,MAAM,CAAC;AACnC6E,cAAc,CAACC,WAAW,GAAG,QAAQ;AAErC,SAASD,cAAc,IAAI7E,MAAM"}
1
+ {"version":3,"file":"Select.js","names":["memo","useCallback","useEffect","useMemo","useRef","useState","useImperativeHandle","Field","CheckIcon","CloseCircleFilledIcon","ComponentControlledState","useInputValues","getControlState","normalizedKey","styled","useOdysseyDesignTokens","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","SelectContainer","div","ChipsPositioningContainer","shouldForwardProp","prop","odysseyDesignTokens","Spacing0","Spacing5","Spacing1","BorderWidthMain","NonInteractiveIcon","Spacing2","ChipsInnerContainer","_Box","isInteractive","ChipsSpacer","Spacing6","CONTROLLED","Select","ariaDescribedBy","defaultValue","errorMessage","errorMessageList","hasMultipleChoices","hasMultipleChoicesProp","hint","HintLinkComponent","id","idOverride","inputRef","isDisabled","isFullWidth","isMultiSelect","isOptional","label","name","nameOverride","onBlur","onChange","onChangeProp","onFocus","options","testId","translate","value","undefined","controlledStateRef","controlledValue","uncontrolledValue","internalSelectedValues","setInternalSelectedValues","current","localInputRef","focus","inputValues","controlState","event","child","target","split","normalizedOptions","map","option","text","type","Chips","selection","removeSelection","itemToRemove","Array","isArray","newValue","filter","item","syntheticEvent","stopPropagation","children","length","_Chip","tabIndex","onDelete","deleteIcon","sx","pointerEvents","onMouseDown","index","_ListSubheader","isSelected","includes","_MenuItem","selected","_Checkbox","checked","_ListItemSecondaryAction","toString","renderValue","renderFieldComponent","errorMessageElementId","labelElementId","_Select","inputProps","labelId","multiple","fieldType","hasVisibleLabel","MemoizedSelect","displayName"],"sources":["../src/Select.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 memo,\n useCallback,\n useEffect,\n useMemo,\n useRef,\n useState,\n useImperativeHandle,\n MouseEvent,\n} from \"react\";\nimport {\n Box as MuiBox,\n Checkbox as MuiCheckbox,\n Chip as MuiChip,\n ListItemSecondaryAction,\n ListSubheader,\n MenuItem as MuiMenuItem,\n Select as MuiSelect,\n SelectChangeEvent,\n} from \"@mui/material\";\nimport { SelectProps as MuiSelectProps } from \"@mui/material\";\n\nimport { Field } from \"./Field\";\nimport {\n FieldComponentProps,\n FieldComponentRenderProps,\n} from \"./FieldComponentProps\";\nimport { CheckIcon, CloseCircleFilledIcon } from \"./icons.generated\";\nimport type { HtmlProps } from \"./HtmlProps\";\nimport {\n ComponentControlledState,\n FocusHandle,\n useInputValues,\n getControlState,\n} from \"./inputUtils\";\nimport { normalizedKey } from \"./useNormalizedKey\";\nimport styled from \"@emotion/styled\";\n\nimport {\n useOdysseyDesignTokens,\n DesignTokens,\n} from \"./OdysseyDesignTokensContext\";\n\nexport type SelectOption = {\n text: string;\n type?: \"heading\" | \"option\";\n value?: string;\n};\n\nconst SelectContainer = styled.div`\n position: relative;\n width: 100%;\n display: flex;\n`;\n\nconst ChipsPositioningContainer = styled(\"div\", {\n shouldForwardProp: (prop) => prop !== \"odysseyDesignTokens\",\n})<{\n odysseyDesignTokens: DesignTokens;\n}>`\n display: flex;\n align-items: center;\n position: absolute;\n top: ${({ odysseyDesignTokens }) => odysseyDesignTokens.Spacing0};\n right: ${({ odysseyDesignTokens }) => odysseyDesignTokens.Spacing5};\n bottom: ${({ odysseyDesignTokens }) => odysseyDesignTokens.Spacing0};\n left: ${({ odysseyDesignTokens }) => odysseyDesignTokens.Spacing1};\n margin-inline-start: ${({ odysseyDesignTokens }) =>\n odysseyDesignTokens.BorderWidthMain};\n opacity: 1;\n pointer-events: none;\n`;\n\nconst NonInteractiveIcon = styled(CloseCircleFilledIcon, {\n shouldForwardProp: (prop) => prop !== \"odysseyDesignTokens\",\n})<{\n odysseyDesignTokens: DesignTokens;\n}>`\n font-size: 1em;\n margin-inline-start: ${({ odysseyDesignTokens }) =>\n odysseyDesignTokens.Spacing2};\n margin-inline-end: -${({ odysseyDesignTokens }) => odysseyDesignTokens.Spacing1};\n`;\n\nconst ChipsInnerContainer = styled(MuiBox, {\n shouldForwardProp: (prop) =>\n prop !== \"odysseyDesignTokens\" && prop !== \"isInteractive\",\n})<{\n isInteractive?: boolean;\n odysseyDesignTokens: DesignTokens;\n}>`\n display: flex;\n flex-wrap: wrap;\n gap: ${({ odysseyDesignTokens }) => odysseyDesignTokens.Spacing1};\n pointer-events: ${({ isInteractive }) => (isInteractive ? \"auto\" : \"none\")};\n opacity: ${({ isInteractive }) => (isInteractive ? 1 : 0)};\n`;\n\nconst ChipsSpacer = styled(\"div\", {\n shouldForwardProp: (prop) => prop !== \"odysseyDesignTokens\",\n})<{\n odysseyDesignTokens: DesignTokens;\n}>`\n display: inline-block;\n border-color: transparent;\n border-style: solid none;\n border-width: 1px;\n height: ${({ odysseyDesignTokens }) => odysseyDesignTokens.Spacing6};\n`;\n\nexport type SelectValueType<HasMultipleChoices> =\n HasMultipleChoices extends true ? string[] : string;\n\nexport type SelectProps<\n Value extends SelectValueType<HasMultipleChoices>,\n HasMultipleChoices extends boolean,\n> = {\n /**\n * The default value. Use when the component is not controlled.\n */\n defaultValue?: MuiSelectProps<Value>[\"defaultValue\"];\n /**\n * If `true`, the Select allows multiple selections\n */\n hasMultipleChoices?: HasMultipleChoices;\n /**\n * The ref forwarded to the Select\n */\n inputRef?: React.RefObject<FocusHandle>;\n /**\n * @deprecated Use `hasMultipleChoices` instead.\n */\n /** **Deprecated:** use `hasMultipleChoices` */\n isMultiSelect?: HasMultipleChoices;\n /**\n * The label text for the Select\n */\n label: string;\n /**\n * Callback fired when the Select loses focus\n */\n onBlur?: MuiSelectProps<Value>[\"onBlur\"];\n /**\n * Callback fired when the value of the Select changes\n */\n onChange?: MuiSelectProps<Value>[\"onChange\"];\n /**\n * Callback fired when the Select gains focus\n */\n onFocus?: MuiSelectProps<Value>[\"onFocus\"];\n /**\n * The options for the Select\n */\n options: (string | SelectOption)[];\n /**\n * The value or values selected in the Select\n */\n value?: Value;\n} & Pick<\n FieldComponentProps,\n | \"errorMessage\"\n | \"errorMessageList\"\n | \"hint\"\n | \"HintLinkComponent\"\n | \"id\"\n | \"isDisabled\"\n | \"isFullWidth\"\n | \"isOptional\"\n | \"name\"\n> &\n Pick<HtmlProps, \"ariaDescribedBy\" | \"testId\" | \"translate\">;\n\ntype SelectRenderProps = Partial<\n Pick<FieldComponentRenderProps, \"ariaDescribedBy\" | \"errorMessageElementId\">\n> &\n Pick<FieldComponentRenderProps, \"id\" | \"labelElementId\">;\n\n/**\n * Options in Odyssey <Select> are passed as an array, which can contain any combination\n * of the following:\n * - string — A simple string. The string will be both the text and the value of the resulting option.\n * <option value=\"string\">string</option>\n *\n * - { text: string } — Same as above, but the string is contained within an object.\n * <option value=\"text\">text</option>\n *\n * - { text: string, value: string } — The option text will be text, and the option value will be value.\n * <option value=\"value\">text</option>\n *\n * - { text: string, type: \"heading\" } — Used to display a group heading with the text\n */\n\nconst { CONTROLLED } = ComponentControlledState;\nconst Select = <\n Value extends SelectValueType<HasMultipleChoices>,\n HasMultipleChoices extends boolean,\n>({\n ariaDescribedBy,\n defaultValue,\n errorMessage,\n errorMessageList,\n hasMultipleChoices: hasMultipleChoicesProp,\n hint,\n HintLinkComponent,\n id: idOverride,\n inputRef,\n isDisabled = false,\n isFullWidth = false,\n isMultiSelect,\n isOptional = false,\n label,\n name: nameOverride,\n onBlur,\n onChange: onChangeProp,\n onFocus,\n options,\n testId,\n translate,\n value,\n}: SelectProps<Value, HasMultipleChoices>) => {\n const hasMultipleChoices = useMemo(\n () =>\n hasMultipleChoicesProp === undefined\n ? isMultiSelect\n : hasMultipleChoicesProp,\n [hasMultipleChoicesProp, isMultiSelect],\n );\n const controlledStateRef = useRef(\n getControlState({\n controlledValue: value,\n uncontrolledValue: defaultValue,\n }),\n );\n const [internalSelectedValues, setInternalSelectedValues] = useState(\n controlledStateRef.current === CONTROLLED ? value : defaultValue,\n );\n const localInputRef = useRef<HTMLSelectElement>(null);\n const odysseyDesignTokens = useOdysseyDesignTokens();\n\n useImperativeHandle(\n inputRef,\n () => {\n return {\n focus: () => {\n localInputRef.current?.focus();\n },\n };\n },\n [],\n );\n\n useEffect(() => {\n if (controlledStateRef.current === CONTROLLED) {\n setInternalSelectedValues(value);\n }\n }, [value]);\n\n const inputValues = useInputValues({\n defaultValue,\n value,\n controlState: controlledStateRef.current,\n });\n\n const onChange = useCallback<NonNullable<MuiSelectProps<Value>[\"onChange\"]>>(\n (event, child) => {\n const {\n target: { value },\n } = event;\n if (controlledStateRef.current !== CONTROLLED) {\n setInternalSelectedValues(\n (typeof value === \"string\" ? value.split(\",\") : value) as Value,\n );\n }\n onChangeProp?.(event, child);\n },\n [onChangeProp],\n );\n\n // Normalize the options array to accommodate the various\n // data types that might be passed\n const normalizedOptions = useMemo(\n () =>\n options.map((option) => {\n if (typeof option === \"object\") {\n /**\n * If the value of `option?.value is an empty string, we need to make sure that we\n * set an empty string to `value` in the normalized option so that the select component\n * can potentially set it as the selected one in the text input\n */\n const value =\n option?.value === \"\" ? option.value : option.value || option.text;\n return {\n text: option.text,\n value,\n type: option.type === \"heading\" ? \"heading\" : \"option\",\n };\n }\n return { text: option, value: option, type: \"option\" };\n }),\n [options],\n );\n\n const Chips = useCallback(\n ({\n selection,\n isInteractive,\n }: {\n selection: string[];\n isInteractive: boolean;\n }) => {\n const removeSelection = (itemToRemove: string) => {\n if (Array.isArray(internalSelectedValues)) {\n const newValue = internalSelectedValues.filter(\n (item: string) => item !== itemToRemove,\n );\n\n const syntheticEvent = {\n target: { value: newValue },\n } as SelectChangeEvent<Value>;\n\n onChange(syntheticEvent, null);\n }\n };\n\n const stopPropagation = (event: MouseEvent<SVGSVGElement>) =>\n event.stopPropagation();\n\n return (\n <ChipsInnerContainer\n isInteractive={isInteractive}\n odysseyDesignTokens={odysseyDesignTokens}\n >\n <ChipsSpacer odysseyDesignTokens={odysseyDesignTokens} />\n {selection.map(\n (item: string) =>\n item?.length > 0 && (\n <MuiChip\n key={item}\n label={\n <>\n {item}\n {!isInteractive &&\n controlledStateRef.current === CONTROLLED &&\n hasMultipleChoices && (\n <NonInteractiveIcon\n odysseyDesignTokens={odysseyDesignTokens}\n />\n )}\n </>\n }\n tabIndex={-1}\n onDelete={\n isInteractive && controlledStateRef.current === CONTROLLED\n ? () => removeSelection(item)\n : undefined\n }\n deleteIcon={\n <CloseCircleFilledIcon\n sx={{ pointerEvents: \"auto\" }}\n // We need to stop event propagation on mouse down to prevent the deletion\n // from being blocked by the Select list opening, and also ensure that\n // the pointerEvent is registered even when the parent's are not\n onMouseDown={stopPropagation}\n />\n }\n />\n ),\n )}\n </ChipsInnerContainer>\n );\n },\n [\n controlledStateRef,\n hasMultipleChoices,\n internalSelectedValues,\n odysseyDesignTokens,\n onChange,\n ],\n );\n\n // Convert the options into the ReactNode children\n // that will populate the <Select>\n const children = useMemo(\n () =>\n normalizedOptions.map((option, index) => {\n if (option.type === \"heading\") {\n return (\n <ListSubheader key={option.text}> {option.text} </ListSubheader>\n );\n }\n\n const isSelected = hasMultipleChoices\n ? internalSelectedValues?.includes(option.value)\n : internalSelectedValues === option.value;\n\n return (\n <MuiMenuItem\n key={normalizedKey(option.text, index.toString())}\n value={option.value}\n selected={isSelected}\n >\n {hasMultipleChoices && <MuiCheckbox checked={isSelected} />}\n {option.text}\n {!hasMultipleChoices &&\n (internalSelectedValues?.includes(option.value) ||\n internalSelectedValues === option.value) && (\n <ListItemSecondaryAction>\n <CheckIcon />\n </ListItemSecondaryAction>\n )}\n </MuiMenuItem>\n );\n }),\n [hasMultipleChoices, normalizedOptions, internalSelectedValues],\n );\n\n const renderValue = useCallback(\n (value: Value) =>\n Array.isArray(value) && <Chips selection={value} isInteractive={false} />,\n [Chips],\n );\n\n const renderFieldComponent = useCallback(\n ({\n ariaDescribedBy,\n errorMessageElementId,\n id,\n labelElementId,\n }: SelectRenderProps) => (\n <SelectContainer>\n <MuiSelect\n {...inputValues}\n aria-describedby={ariaDescribedBy}\n aria-errormessage={errorMessageElementId}\n children={children}\n id={id}\n inputProps={{ \"data-se\": testId }}\n inputRef={localInputRef}\n labelId={labelElementId}\n multiple={hasMultipleChoices}\n name={nameOverride ?? id}\n onBlur={onBlur}\n onChange={onChange}\n onFocus={onFocus}\n renderValue={hasMultipleChoices ? renderValue : undefined}\n translate={translate}\n />\n {hasMultipleChoices && Array.isArray(value) && (\n <ChipsPositioningContainer odysseyDesignTokens={odysseyDesignTokens}>\n <Chips selection={value} isInteractive={true} />\n </ChipsPositioningContainer>\n )}\n </SelectContainer>\n ),\n [\n children,\n Chips,\n inputValues,\n hasMultipleChoices,\n nameOverride,\n odysseyDesignTokens,\n onBlur,\n onChange,\n onFocus,\n renderValue,\n testId,\n translate,\n value,\n ],\n );\n\n return (\n <Field\n ariaDescribedBy={ariaDescribedBy}\n errorMessage={errorMessage}\n errorMessageList={errorMessageList}\n fieldType=\"single\"\n hasVisibleLabel\n hint={hint}\n HintLinkComponent={HintLinkComponent}\n id={idOverride}\n isDisabled={isDisabled}\n isFullWidth={isFullWidth}\n isOptional={isOptional}\n label={label}\n renderFieldComponent={renderFieldComponent}\n />\n );\n};\n\nconst MemoizedSelect = memo(Select);\nMemoizedSelect.displayName = \"Select\";\n\nexport { MemoizedSelect as Select };\n"],"mappings":";;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SACEA,IAAI,EACJC,WAAW,EACXC,SAAS,EACTC,OAAO,EACPC,MAAM,EACNC,QAAQ,EACRC,mBAAmB,QAEd,OAAO;AAA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
11
11
  * See the License for the specific language governing permissions and limitations under the License.
12
12
  */
13
+
14
+ import { memo } from "react";
13
15
  import { useMuiProps } from "./MuiPropsContext.js";
14
16
  import { jsx as _jsx } from "react/jsx-runtime";
15
17
  export const statusSeverityValues = ["default", "error", "success", "warning"];
16
- export const Status = ({
18
+ const Status = ({
17
19
  label,
18
20
  severity,
19
21
  testId,
@@ -29,4 +31,7 @@ export const Status = ({
29
31
  variant: "pill"
30
32
  });
31
33
  };
34
+ const MemoizedStatus = memo(Status);
35
+ MemoizedStatus.displayName = "Status";
36
+ export { MemoizedStatus as Status };
32
37
  //# sourceMappingURL=Status.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Status.js","names":["useMuiProps","jsx","_jsx","statusSeverityValues","Status","label","severity","testId","translate","muiProps","_Chip","color","variant"],"sources":["../src/Status.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 { Chip } from \"@mui/material\";\n\nimport { useMuiProps } from \"./MuiPropsContext\";\nimport type { HtmlProps } from \"./HtmlProps\";\n\nexport const statusSeverityValues = [\n \"default\",\n \"error\",\n \"success\",\n \"warning\",\n] as const;\n\nexport type StatusProps = {\n /**\n * The text content of the Status\n */\n label: string;\n /**\n * Determine the color and icon of the Status\n */\n severity: (typeof statusSeverityValues)[number];\n} & HtmlProps;\n\nexport const Status = ({ label, severity, testId, translate }: StatusProps) => {\n const muiProps = useMuiProps();\n\n return (\n <Chip\n {...muiProps}\n color={severity}\n data-se={testId}\n label={label}\n translate={translate}\n variant=\"pill\"\n />\n );\n};\n"],"mappings":";AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAVA,SAcSA,WAAW;AAAA,SAAAC,GAAA,IAAAC,IAAA;AAGpB,OAAO,MAAMC,oBAAoB,GAAG,CAClC,SAAS,EACT,OAAO,EACP,SAAS,EACT,SAAS,CACD;AAaV,OAAO,MAAMC,MAAM,GAAGA,CAAC;EAAEC,KAAK;EAAEC,QAAQ;EAAEC,MAAM;EAAEC;AAAuB,CAAC,KAAK;EAC7E,MAAMC,QAAQ,GAAGT,WAAW,CAAC,CAAC;EAE9B,OACEE,IAAA,CAAAQ,KAAA;IAAA,GACMD,QAAQ;IACZE,KAAK,EAAEL,QAAS;IAChB,WAASC,MAAO;IAChBF,KAAK,EAAEA,KAAM;IACbG,SAAS,EAAEA,SAAU;IACrBI,OAAO,EAAC;EAAM,CACf,CAAC;AAEN,CAAC"}
1
+ {"version":3,"file":"Status.js","names":["memo","useMuiProps","jsx","_jsx","statusSeverityValues","Status","label","severity","testId","translate","muiProps","_Chip","color","variant","MemoizedStatus","displayName"],"sources":["../src/Status.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 { memo } from \"react\";\nimport { Chip } from \"@mui/material\";\n\nimport { useMuiProps } from \"./MuiPropsContext\";\nimport type { HtmlProps } from \"./HtmlProps\";\n\nexport const statusSeverityValues = [\n \"default\",\n \"error\",\n \"success\",\n \"warning\",\n] as const;\n\nexport type StatusProps = {\n /**\n * The text content of the Status\n */\n label: string;\n /**\n * Determine the color and icon of the Status\n */\n severity: (typeof statusSeverityValues)[number];\n} & Pick<HtmlProps, \"testId\" | \"translate\">;\n\nconst Status = ({ label, severity, testId, translate }: StatusProps) => {\n const muiProps = useMuiProps();\n\n return (\n <Chip\n {...muiProps}\n color={severity}\n data-se={testId}\n label={label}\n translate={translate}\n variant=\"pill\"\n />\n );\n};\n\nconst MemoizedStatus = memo(Status);\nMemoizedStatus.displayName = \"Status\";\n\nexport { MemoizedStatus as Status };\n"],"mappings":";AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,IAAI,QAAQ,OAAO;AAAC,SAGpBC,WAAW;AAAA,SAAAC,GAAA,IAAAC,IAAA;AAGpB,OAAO,MAAMC,oBAAoB,GAAG,CAClC,SAAS,EACT,OAAO,EACP,SAAS,EACT,SAAS,CACD;AAaV,MAAMC,MAAM,GAAGA,CAAC;EAAEC,KAAK;EAAEC,QAAQ;EAAEC,MAAM;EAAEC;AAAuB,CAAC,KAAK;EACtE,MAAMC,QAAQ,GAAGT,WAAW,CAAC,CAAC;EAE9B,OACEE,IAAA,CAAAQ,KAAA;IAAA,GACMD,QAAQ;IACZE,KAAK,EAAEL,QAAS;IAChB,WAASC,MAAO;IAChBF,KAAK,EAAEA,KAAM;IACbG,SAAS,EAAEA,SAAU;IACrBI,OAAO,EAAC;EAAM,CACf,CAAC;AAEN,CAAC;AAED,MAAMC,cAAc,GAAGd,IAAI,CAACK,MAAM,CAAC;AACnCS,cAAc,CAACC,WAAW,GAAG,QAAQ;AAErC,SAASD,cAAc,IAAIT,MAAM"}
package/dist/Tabs.js CHANGED
@@ -13,9 +13,9 @@ import _Tab from "@mui/material/Tab";
13
13
 
14
14
  import { memo, useCallback, useEffect, useState } from "react";
15
15
  import { TabContext as MuiTabContext, TabList as MuiTabList, TabPanel as MuiTabPanel } from "@mui/lab";
16
- import { useOdysseyDesignTokens } from "./OdysseyDesignTokensContext.js";
17
16
  import { Badge } from "./Badge.js";
18
17
  import { Box } from "./Box.js";
18
+ import { useOdysseyDesignTokens } from "./OdysseyDesignTokensContext.js";
19
19
  import { jsx as _jsx } from "react/jsx-runtime";
20
20
  import { Fragment as _Fragment } from "react/jsx-runtime";
21
21
  import { jsxs as _jsxs } from "react/jsx-runtime";
package/dist/Tabs.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"Tabs.js","names":["memo","useCallback","useEffect","useState","TabContext","MuiTabContext","TabList","MuiTabList","TabPanel","MuiTabPanel","useOdysseyDesignTokens","Badge","Box","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","TabLabel","label","notificationCount","notificationCountMax","tabState","value","odysseyDesignTokens","children","undefined","sx","marginInlineStart","Spacing2","badgeContent","badgeContentMax","type","Tabs","ariaLabel","initialValue","tabs","onChange","onChangeProp","setTabState","event","renderTab","tab","index","testId","isDisabled","startIcon","_Tab","disabled","icon","tabIndex","toString","variant","map","MemoizedTabs","displayName"],"sources":["../src/Tabs.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 ReactElement,\n ReactNode,\n memo,\n useCallback,\n useEffect,\n useState,\n} from \"react\";\nimport {\n TabContext as MuiTabContext,\n TabList as MuiTabList,\n TabListProps as MuiTabListProps,\n TabPanel as MuiTabPanel,\n} from \"@mui/lab\";\nimport { Tab as MuiTab } from \"@mui/material\";\n\nimport { useOdysseyDesignTokens } from \"./OdysseyDesignTokensContext\";\nimport { Badge, BadgeProps } from \"./Badge\";\nimport { HtmlProps } from \"./HtmlProps\";\nimport { Box } from \"./Box\";\n\nexport type TabItemProps = {\n /**\n * The content of the Tab itself\n */\n children: ReactNode;\n /**\n * If `true`, the TabItem is disabled\n */\n isDisabled?: boolean;\n /**\n * The label text for the TabItem\n */\n label: string;\n /**\n * An optional icon to display at the start of the TabItem\n */\n startIcon?: ReactElement;\n /**\n * The value associated with the TabItem\n */\n value?: string;\n} & {\n notificationCount?: BadgeProps[\"badgeContent\"];\n notificationCountMax?: BadgeProps[\"badgeContentMax\"];\n} & HtmlProps;\n\nexport type TabsProps = {\n /**\n * The ARIA label for the full Tabs group\n */\n ariaLabel?: string;\n /**\n * @deprecated please use the `value` prop instead\n * When `value` is provided, `initialValue` isn't used.\n */\n initialValue?: string;\n /**\n * The TabItems to be included in the Tabs group\n */\n tabs: TabItemProps[];\n /**\n * Identifier for the selected tab.\n */\n value?: string;\n /**\n * Callback fired when the active tab is changed.\n */\n onChange?: MuiTabListProps[\"onChange\"];\n};\n\nconst TabLabel = ({\n label,\n notificationCount,\n notificationCountMax,\n tabState,\n value,\n}: Pick<\n TabItemProps,\n \"label\" | \"notificationCount\" | \"notificationCountMax\" | \"value\"\n> & {\n tabState: string;\n}) => {\n const odysseyDesignTokens = useOdysseyDesignTokens();\n\n return (\n <>\n {label}\n {notificationCount !== undefined && notificationCount > 0 && (\n <Box\n sx={{\n marginInlineStart: notificationCount\n ? odysseyDesignTokens.Spacing2\n : 0,\n }}\n >\n <Badge\n badgeContent={notificationCount}\n badgeContentMax={notificationCountMax}\n type={value === tabState ? \"attention\" : \"default\"}\n />\n </Box>\n )}\n </>\n );\n};\n\nconst Tabs = ({\n ariaLabel,\n initialValue,\n tabs,\n value,\n onChange: onChangeProp,\n}: TabsProps) => {\n const [tabState, setTabState] = useState(initialValue ?? value ?? \"0\");\n\n const onChange = useCallback<NonNullable<MuiTabListProps[\"onChange\"]>>(\n (event, value: string) => {\n setTabState(value);\n onChangeProp?.(event, value);\n },\n [onChangeProp]\n );\n\n useEffect(() => {\n if (value !== undefined) {\n setTabState(value);\n }\n }, [value]);\n\n const renderTab = useCallback(\n (tab, index) => {\n const {\n testId,\n isDisabled,\n label,\n startIcon,\n value,\n notificationCount,\n notificationCountMax,\n } = tab;\n\n return (\n <MuiTab\n data-se={testId}\n disabled={isDisabled}\n icon={startIcon}\n tabIndex={0}\n label={\n <TabLabel\n label={label}\n notificationCount={notificationCount}\n notificationCountMax={notificationCountMax}\n tabState={tabState}\n value={value}\n />\n }\n value={value ? value : index.toString()}\n key={value ? value : index.toString()}\n />\n );\n },\n [tabState]\n );\n\n return (\n <MuiTabContext value={tabState}>\n <MuiTabList\n onChange={onChange}\n aria-label={ariaLabel}\n variant=\"scrollable\"\n >\n {tabs.map((tab, index) => renderTab(tab, index))}\n </MuiTabList>\n {tabs.map((tab, index) => (\n <MuiTabPanel\n value={tab.value ? tab.value : index.toString()}\n key={tab.value ? tab.value : index.toString()}\n >\n {tab.children}\n </MuiTabPanel>\n ))}\n </MuiTabContext>\n );\n};\n\nconst MemoizedTabs = memo(Tabs);\nMemoizedTabs.displayName = \"Tabs\";\n\nexport { MemoizedTabs as Tabs };\n"],"mappings":";AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAGEA,IAAI,EACJC,WAAW,EACXC,SAAS,EACTC,QAAQ,QACH,OAAO;AACd,SACEC,UAAU,IAAIC,aAAa,EAC3BC,OAAO,IAAIC,UAAU,EAErBC,QAAQ,IAAIC,WAAW,QAClB,UAAU;AAAC,SAGTC,sBAAsB;AAAA,SACtBC,KAAK;AAAA,SAELC,GAAG;AAAA,SAAAC,GAAA,IAAAC,IAAA;AAAA,SAAAC,QAAA,IAAAC,SAAA;AAAA,SAAAC,IAAA,IAAAC,KAAA;AAoDZ,MAAMC,QAAQ,GAAGA,CAAC;EAChBC,KAAK;EACLC,iBAAiB;EACjBC,oBAAoB;EACpBC,QAAQ;EACRC;AAMF,CAAC,KAAK;EACJ,MAAMC,mBAAmB,GAAGf,sBAAsB,CAAC,CAAC;EAEpD,OACEQ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CAACC,WAAW,GAAG,MAAM;AAEjC,SAASD,YAAY,IAAIrB,IAAI"}
1
+ {"version":3,"file":"Tabs.js","names":["memo","useCallback","useEffect","useState","TabContext","MuiTabContext","TabList","MuiTabList","TabPanel","MuiTabPanel","Badge","Box","useOdysseyDesignTokens","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","TabLabel","label","notificationCount","notificationCountMax","tabState","value","odysseyDesignTokens","children","undefined","sx","marginInlineStart","Spacing2","badgeContent","badgeContentMax","type","Tabs","ariaLabel","initialValue","tabs","onChange","onChangeProp","setTabState","event","renderTab","tab","index","testId","isDisabled","startIcon","_Tab","disabled","icon","tabIndex","toString","variant","map","MemoizedTabs","displayName"],"sources":["../src/Tabs.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 ReactElement,\n ReactNode,\n memo,\n useCallback,\n useEffect,\n useState,\n} from \"react\";\nimport {\n TabContext as MuiTabContext,\n TabList as MuiTabList,\n TabListProps as MuiTabListProps,\n TabPanel as MuiTabPanel,\n} from \"@mui/lab\";\nimport { Tab as MuiTab } from \"@mui/material\";\n\nimport { Badge, BadgeProps } from \"./Badge\";\nimport { Box } from \"./Box\";\nimport { HtmlProps } from \"./HtmlProps\";\nimport { useOdysseyDesignTokens } from \"./OdysseyDesignTokensContext\";\n\nexport type TabItemProps = {\n /**\n * The content of the Tab itself\n */\n children: ReactNode;\n /**\n * If `true`, the TabItem is disabled\n */\n isDisabled?: boolean;\n /**\n * The label text for the TabItem\n */\n label: string;\n /**\n * An optional icon to display at the start of the TabItem\n */\n startIcon?: ReactElement;\n /**\n * The value associated with the TabItem\n */\n value?: string;\n} & {\n notificationCount?: BadgeProps[\"badgeContent\"];\n notificationCountMax?: BadgeProps[\"badgeContentMax\"];\n} & Pick<HtmlProps, \"testId\" | \"translate\">;\n\nexport type TabsProps = {\n /**\n * @deprecated please use the `value` prop instead\n * When `value` is provided, `initialValue` isn't used.\n */\n initialValue?: string;\n /**\n * The TabItems to be included in the Tabs group\n */\n tabs: TabItemProps[];\n /**\n * Identifier for the selected tab.\n */\n value?: string;\n /**\n * Callback fired when the active tab is changed.\n */\n onChange?: MuiTabListProps[\"onChange\"];\n};\n\nconst TabLabel = ({\n label,\n notificationCount,\n notificationCountMax,\n tabState,\n value,\n}: Pick<\n TabItemProps,\n \"label\" | \"notificationCount\" | \"notificationCountMax\" | \"value\"\n> & {\n tabState: string;\n}) => {\n const odysseyDesignTokens = useOdysseyDesignTokens();\n\n return (\n <>\n {label}\n {notificationCount !== undefined && notificationCount > 0 && (\n <Box\n sx={{\n marginInlineStart: notificationCount\n ? odysseyDesignTokens.Spacing2\n : 0,\n }}\n >\n <Badge\n badgeContent={notificationCount}\n badgeContentMax={notificationCountMax}\n type={value === tabState ? \"attention\" : \"default\"}\n />\n </Box>\n )}\n </>\n );\n};\n\nconst Tabs = ({\n ariaLabel,\n initialValue,\n tabs,\n value,\n onChange: onChangeProp,\n}: TabsProps & Pick<HtmlProps, \"ariaLabel\">) => {\n const [tabState, setTabState] = useState(initialValue ?? value ?? \"0\");\n\n const onChange = useCallback<NonNullable<MuiTabListProps[\"onChange\"]>>(\n (event, value: string) => {\n setTabState(value);\n onChangeProp?.(event, value);\n },\n [onChangeProp],\n );\n\n useEffect(() => {\n if (value !== undefined) {\n setTabState(value);\n }\n }, [value]);\n\n const renderTab = useCallback(\n (tab: TabItemProps, index: number) => {\n const {\n testId,\n isDisabled,\n label,\n startIcon,\n value,\n notificationCount,\n notificationCountMax,\n } = tab;\n\n return (\n <MuiTab\n data-se={testId}\n disabled={isDisabled}\n icon={startIcon}\n tabIndex={0}\n label={\n <TabLabel\n label={label}\n notificationCount={notificationCount}\n notificationCountMax={notificationCountMax}\n tabState={tabState}\n value={value}\n />\n }\n value={value ? value : index.toString()}\n key={value ? value : index.toString()}\n />\n );\n },\n [tabState],\n );\n\n return (\n <MuiTabContext value={tabState}>\n <MuiTabList\n onChange={onChange}\n aria-label={ariaLabel}\n variant=\"scrollable\"\n >\n {tabs.map((tab, index) => renderTab(tab, index))}\n </MuiTabList>\n {tabs.map((tab, index) => (\n <MuiTabPanel\n value={tab.value ? tab.value : index.toString()}\n key={tab.value ? tab.value : index.toString()}\n >\n {tab.children}\n </MuiTabPanel>\n ))}\n </MuiTabContext>\n );\n};\n\nconst MemoizedTabs = memo(Tabs);\nMemoizedTabs.displayName = \"Tabs\";\n\nexport { MemoizedTabs as Tabs };\n"],"mappings":";AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAGEA,IAAI,EACJC,WAAW,EACXC,SAAS,EACTC,QAAQ,QACH,OAAO;AACd,SACEC,UAAU,IAAIC,aAAa,EAC3BC,OAAO,IAAIC,UAAU,EAErBC,QAAQ,IAAIC,WAAW,QAClB,UAAU;AAAC,SAGTC,KAAK;AAAA,SACLC,GAAG;AAAA,SAEHC,sBAAsB;AAAA,SAAAC,GAAA,IAAAC,IAAA;AAAA,SAAAC,QAAA,IAAAC,SAAA;AAAA,SAAAC,IAAA,IAAAC,KAAA;AAgD/B,MAAMC,QAAQ,GAAGA,CAAC;EAChBC,KAAK;EACLC,iBAAiB;EACjBC,oBAAoB;EACpBC,QAAQ;EACRC;AAMF,CAAC,KAAK;EACJ,MAAMC,mBAAmB,GAAGb,sBAAsB,CAAC,CAAC;EAEpD,OACEM,KAAA,CAAAF,SAAA;IAAAU,QAAA,GACGN,KAAK,EACLC,iBAAiB,KAAKM,SAAS,IAAIN,iBAAiB,GAAG,CAAC,IACvDP,IAAA,CAACH,GAAG;MAC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":["memo","useCallback","useContext","TagListContext","MuiPropsContext","jsx","_jsx","Tag","icon","isDisabled","label","onClick","onRemove","testId","translate","chipElementType","renderTag","muiProps","_Chip","clickable","component","disabled","onDelete","Consumer","children","MemoizedTag","displayName"],"sources":["../src/Tag.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 { Chip as MuiChip, ChipProps as MuiChipProps } from \"@mui/material\";\nimport { memo, ReactElement, useCallback, useContext } from \"react\";\nimport { TagListContext } from \"./TagListContext\";\nimport { MuiPropsContext } from \"./MuiPropsContext\";\nimport { HtmlProps } from \"./HtmlProps\";\n\nexport type TagProps = {\n icon?: ReactElement;\n isDisabled?: boolean;\n /**\n * The label text for the Tag\n */\n label: string;\n /**\n * Callback fired when the Tag is clicked\n */\n onClick?: MuiChipProps[\"onClick\"];\n /**\n * Callback fired when the remove button of the Tag is clicked\n */\n onRemove?: MuiChipProps[\"onDelete\"];\n} & HtmlProps;\n\nconst Tag = ({\n icon,\n isDisabled,\n label,\n onClick,\n onRemove,\n testId,\n translate,\n}: TagProps) => {\n const { chipElementType } = useContext(TagListContext);\n\n const renderTag = useCallback(\n (muiProps) => (\n <MuiChip\n {...muiProps}\n aria-disabled={isDisabled}\n clickable={onClick ? true : false}\n component={chipElementType}\n data-se={testId}\n disabled={isDisabled}\n icon={icon}\n label={label}\n onClick={onClick}\n onDelete={onRemove}\n translate={translate}\n />\n ),\n [\n chipElementType,\n icon,\n isDisabled,\n label,\n onClick,\n onRemove,\n testId,\n translate,\n ]\n );\n\n return <MuiPropsContext.Consumer>{renderTag}</MuiPropsContext.Consumer>;\n};\n\nconst MemoizedTag = memo(Tag);\nMemoizedTag.displayName = \"Tag\";\n\nexport { MemoizedTag as Tag };\n"],"mappings":";AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAGA,SAASA,IAAI,EAAgBC,WAAW,EAAEC,UAAU,QAAQ,OAAO;AAAC,SAC3DC,cAAc;AAAA,SACdC,eAAe;AAAA,SAAAC,GAAA,IAAAC,IAAA;AAoBxB,MAAMC,GAAG,GAAGA,CAAC;EACXC,IAAI;EACJC,UAAU;EACVC,KAAK;EACLC,OAAO;EACPC,QAAQ;EACRC,MAAM;EACNC;AACQ,CAAC,KAAK;EACd,MAAM;IAAEC;EAAgB,CAAC,GAAGb,UAAU,CAACC,cAAc,CAAC;EAEtD,MAAMa,SAAS,GAAGf,WAAW,CAC1BgB,QAAQ,IACPX,IAAA,CAAAY,KAAA;IAAA,GACMD,QAAQ;IACZ,iBAAeR,UAAW;IAC1BU,SAAS,EAAER,OAAO,GAAG,IAAI,GAAG,KAAM;IAClCS,SAAS,EAAEL,eAAgB;IAC3B,WAASF,MAAO;IAChBQ,QAAQ,EAAEZ,UAAW;IACrBD,IAAI,EAAEA,IAAK;IACXE,KAAK,EAAEA,KAAM;IACbC,OAAO,EAAEA,OAAQ;IACjBW,QAAQ,EAAEV,QAAS;IACnBE,SAAS,EAAEA;EAAU,CACtB,CACF,EACD,CACEC,eAAe,EACfP,IAAI,EACJC,UAAU,EACVC,KAAK,EACLC,OAAO,EACPC,QAAQ,EACRC,MAAM,EACNC,SAAS,CAEb,CAAC;EAED,OAAOR,IAAA,CAACF,eAAe,CAACmB,QAAQ;IAAAC,QAAA,EAAER;EAAS,CAA2B,CAAC;AACzE,CAAC;AAED,MAAMS,WAAW,GAAGzB,IAAI,CAACO,GAAG,CAAC;AAC7BkB,WAAW,CAACC,WAAW,GAAG,KAAK;AAE/B,SAASD,WAAW,IAAIlB,GAAG"}
1
+ {"version":3,"file":"Tag.js","names":["memo","useCallback","useContext","TagListContext","MuiPropsContext","jsx","_jsx","Tag","icon","isDisabled","label","onClick","onRemove","testId","translate","chipElementType","renderTag","muiProps","_Chip","clickable","component","disabled","onDelete","Consumer","children","MemoizedTag","displayName"],"sources":["../src/Tag.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 { Chip as MuiChip, ChipProps as MuiChipProps } from \"@mui/material\";\nimport { memo, ReactElement, useCallback, useContext } from \"react\";\nimport { TagListContext } from \"./TagListContext\";\nimport { MuiPropsContext, MuiPropsContextType } from \"./MuiPropsContext\";\nimport { HtmlProps } from \"./HtmlProps\";\n\nexport type TagProps = {\n icon?: ReactElement;\n isDisabled?: boolean;\n /**\n * The label text for the Tag\n */\n label: string;\n /**\n * Callback fired when the Tag is clicked\n */\n onClick?: MuiChipProps[\"onClick\"];\n /**\n * Callback fired when the remove button of the Tag is clicked\n */\n onRemove?: MuiChipProps[\"onDelete\"];\n} & Pick<HtmlProps, \"testId\" | \"translate\">;\n\nconst Tag = ({\n icon,\n isDisabled,\n label,\n onClick,\n onRemove,\n testId,\n translate,\n}: TagProps) => {\n const { chipElementType } = useContext(TagListContext);\n\n const renderTag = useCallback(\n (muiProps: MuiPropsContextType) => (\n <MuiChip\n {...muiProps}\n aria-disabled={isDisabled}\n clickable={onClick ? true : false}\n component={chipElementType}\n data-se={testId}\n disabled={isDisabled}\n icon={icon}\n label={label}\n onClick={onClick}\n onDelete={onRemove}\n translate={translate}\n />\n ),\n [\n chipElementType,\n icon,\n isDisabled,\n label,\n onClick,\n onRemove,\n testId,\n translate,\n ],\n );\n\n return <MuiPropsContext.Consumer>{renderTag}</MuiPropsContext.Consumer>;\n};\n\nconst MemoizedTag = memo(Tag);\nMemoizedTag.displayName = \"Tag\";\n\nexport { MemoizedTag as Tag };\n"],"mappings":";AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAGA,SAASA,IAAI,EAAgBC,WAAW,EAAEC,UAAU,QAAQ,OAAO;AAAC,SAC3DC,cAAc;AAAA,SACdC,eAAe;AAAA,SAAAC,GAAA,IAAAC,IAAA;AAoBxB,MAAMC,GAAG,GAAGA,CAAC;EACXC,IAAI;EACJC,UAAU;EACVC,KAAK;EACLC,OAAO;EACPC,QAAQ;EACRC,MAAM;EACNC;AACQ,CAAC,KAAK;EACd,MAAM;IAAEC;EAAgB,CAAC,GAAGb,UAAU,CAACC,cAAc,CAAC;EAEtD,MAAMa,SAAS,GAAGf,WAAW,CAC1BgB,QAA6B,IAC5BX,IAAA,CAAAY,KAAA;IAAA,GACMD,QAAQ;IACZ,iBAAeR,UAAW;IAC1BU,SAAS,EAAER,OAAO,GAAG,IAAI,GAAG,KAAM;IAClCS,SAAS,EAAEL,eAAgB;IAC3B,WAASF,MAAO;IAChBQ,QAAQ,EAAEZ,UAAW;IACrBD,IAAI,EAAEA,IAAK;IACXE,KAAK,EAAEA,KAAM;IACbC,OAAO,EAAEA,OAAQ;IACjBW,QAAQ,EAAEV,QAAS;IACnBE,SAAS,EAAEA;EAAU,CACtB,CACF,EACD,CACEC,eAAe,EACfP,IAAI,EACJC,UAAU,EACVC,KAAK,EACLC,OAAO,EACPC,QAAQ,EACRC,MAAM,EACNC,SAAS,CAEb,CAAC;EAED,OAAOR,IAAA,CAACF,eAAe,CAACmB,QAAQ;IAAAC,QAAA,EAAER;EAAS,CAA2B,CAAC;AACzE,CAAC;AAED,MAAMS,WAAW,GAAGzB,IAAI,CAACO,GAAG,CAAC;AAC7BkB,WAAW,CAACC,WAAW,GAAG,KAAK;AAE/B,SAASD,WAAW,IAAIlB,GAAG"}
@@ -1 +1 @@
1
- {"version":3,"file":"TagList.js","names":["memo","useMemo","TagListContext","jsx","_jsx","TagList","children","testId","providerValue","chipElementType","_Stack","component","direction","spacing","useFlexGap","flexWrap","Provider","value","MemoizedTagList","displayName"],"sources":["../src/TagList.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 { Tag } from \"./Tag\";\nimport { Stack } from \"@mui/material\";\nimport { memo, ReactElement, useMemo } from \"react\";\nimport { ChipElementType, TagListContext } from \"./TagListContext\";\nimport { HtmlProps } from \"./HtmlProps\";\n\nexport type TagListProps = {\n /**\n * The Tag or array of Tags within the TagList\n */\n children: ReactElement<typeof Tag> | Array<ReactElement<typeof Tag>>;\n} & HtmlProps;\n\nconst TagList = ({ children, testId }: TagListProps) => {\n const providerValue = useMemo<{\n chipElementType: ChipElementType;\n }>(\n () => ({\n chipElementType: \"li\",\n }),\n []\n );\n\n return (\n <Stack\n component=\"ul\"\n data-se={testId}\n direction=\"row\"\n spacing={2}\n useFlexGap\n flexWrap=\"wrap\"\n >\n <TagListContext.Provider value={providerValue}>\n {children}\n </TagListContext.Provider>\n </Stack>\n );\n};\n\nconst MemoizedTagList = memo(TagList);\nMemoizedTagList.displayName = \"TagList\";\n\nexport { MemoizedTagList as TagList };\n"],"mappings":";AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAIA,SAASA,IAAI,EAAgBC,OAAO,QAAQ,OAAO;AAAC,SAC1BC,cAAc;AAAA,SAAAC,GAAA,IAAAC,IAAA;AAUxC,MAAMC,OAAO,GAAGA,CAAC;EAAEC,QAAQ;EAAEC;AAAqB,CAAC,KAAK;EACtD,MAAMC,aAAa,GAAGP,OAAO,CAG3B,OAAO;IACLQ,eAAe,EAAE;EACnB,CAAC,CAAC,EACF,EACF,CAAC;EAED,OACEL,IAAA,CAAAM,MAAA;IACEC,SAAS,EAAC,IAAI;IACd,WAASJ,MAAO;IAChBK,SAAS,EAAC,KAAK;IACfC,OAAO,EAAE,CAAE;IACXC,UAAU;IACVC,QAAQ,EAAC,MAAM;IAAAT,QAAA,EAEfF,IAAA,CAACF,cAAc,CAACc,QAAQ;MAACC,KAAK,EAAET,aAAc;MAAAF,QAAA,EAC3CA;IAAQ,CACc;EAAC,CACrB,CAAC;AAEZ,CAAC;AAED,MAAMY,eAAe,GAAGlB,IAAI,CAACK,OAAO,CAAC;AACrCa,eAAe,CAACC,WAAW,GAAG,SAAS;AAEvC,SAASD,eAAe,IAAIb,OAAO"}
1
+ {"version":3,"file":"TagList.js","names":["memo","useMemo","TagListContext","jsx","_jsx","TagList","children","testId","providerValue","chipElementType","_Stack","component","direction","spacing","useFlexGap","flexWrap","Provider","value","MemoizedTagList","displayName"],"sources":["../src/TagList.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 { Tag } from \"./Tag\";\nimport { Stack } from \"@mui/material\";\nimport { memo, ReactElement, useMemo } from \"react\";\nimport { ChipElementType, TagListContext } from \"./TagListContext\";\nimport { HtmlProps } from \"./HtmlProps\";\n\nexport type TagListProps = {\n /**\n * The Tag or array of Tags within the TagList\n */\n children: ReactElement<typeof Tag> | Array<ReactElement<typeof Tag>>;\n} & Pick<HtmlProps, \"testId\">;\n\nconst TagList = ({ children, testId }: TagListProps) => {\n const providerValue = useMemo<{\n chipElementType: ChipElementType;\n }>(\n () => ({\n chipElementType: \"li\",\n }),\n [],\n );\n\n return (\n <Stack\n component=\"ul\"\n data-se={testId}\n direction=\"row\"\n spacing={2}\n useFlexGap\n flexWrap=\"wrap\"\n >\n <TagListContext.Provider value={providerValue}>\n {children}\n </TagListContext.Provider>\n </Stack>\n );\n};\n\nconst MemoizedTagList = memo(TagList);\nMemoizedTagList.displayName = \"TagList\";\n\nexport { MemoizedTagList as TagList };\n"],"mappings":";AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAIA,SAASA,IAAI,EAAgBC,OAAO,QAAQ,OAAO;AAAC,SAC1BC,cAAc;AAAA,SAAAC,GAAA,IAAAC,IAAA;AAUxC,MAAMC,OAAO,GAAGA,CAAC;EAAEC,QAAQ;EAAEC;AAAqB,CAAC,KAAK;EACtD,MAAMC,aAAa,GAAGP,OAAO,CAG3B,OAAO;IACLQ,eAAe,EAAE;EACnB,CAAC,CAAC,EACF,EACF,CAAC;EAED,OACEL,IAAA,CAAAM,MAAA;IACEC,SAAS,EAAC,IAAI;IACd,WAASJ,MAAO;IAChBK,SAAS,EAAC,KAAK;IACfC,OAAO,EAAE,CAAE;IACXC,UAAU;IACVC,QAAQ,EAAC,MAAM;IAAAT,QAAA,EAEfF,IAAA,CAACF,cAAc,CAACc,QAAQ;MAACC,KAAK,EAAET,aAAc;MAAAF,QAAA,EAC3CA;IAAQ,CACc;EAAC,CACrB,CAAC;AAEZ,CAAC;AAED,MAAMY,eAAe,GAAGlB,IAAI,CAACK,OAAO,CAAC;AACrCa,eAAe,CAACC,WAAW,GAAG,SAAS;AAEvC,SAASD,eAAe,IAAIb,OAAO"}
@@ -1 +1 @@
1
- {"version":3,"file":"TextField.js","names":["forwardRef","memo","useCallback","useImperativeHandle","useRef","Field","useInputValues","getControlState","jsx","_jsx","textFieldTypeValues","TextField","ariaDescribedBy","autoCompleteType","defaultValue","hasInitialFocus","endAdornment","errorMessage","errorMessageList","hint","HintLinkComponent","id","idOverride","inputRef","inputMode","isDisabled","isFullWidth","isMultiline","isOptional","isReadOnly","label","name","nameOverride","onBlur","onChange","onChangeProp","onFocus","placeholder","startAdornment","testId","translate","type","value","ref","controlledStateRef","controlledValue","uncontrolledValue","inputValues","controlState","current","localInputRef","focus","event","renderFieldComponent","errorMessageElementId","labelElementId","_InputBase","autoComplete","autoFocus","_InputAdornment","position","children","inputProps","multiline","readOnly","required","fieldType","hasVisibleLabel","MemoizedTextField","displayName"],"sources":["../src/TextField.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 ChangeEventHandler,\n FocusEventHandler,\n forwardRef,\n InputHTMLAttributes,\n memo,\n ReactElement,\n useCallback,\n useImperativeHandle,\n useRef,\n} from \"react\";\nimport { InputAdornment, InputBase } from \"@mui/material\";\n\nimport { FieldComponentProps } from \"./FieldComponentProps\";\nimport { Field } from \"./Field\";\nimport { HtmlProps } from \"./HtmlProps\";\nimport { FocusHandle, useInputValues, getControlState } from \"./inputUtils\";\n\nexport const textFieldTypeValues = [\n \"email\",\n \"number\",\n \"tel\",\n \"text\",\n \"url\",\n] as const;\n\nexport type TextFieldProps = {\n /**\n * This prop helps users to fill forms faster, especially on mobile devices.\n * The name can be confusing, as it's more like an autofill.\n * @see https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#autofill\n */\n autoCompleteType?: InputHTMLAttributes<HTMLInputElement>[\"autoComplete\"];\n /**\n * The default value. Use when the component is not controlled.\n */\n defaultValue?: string;\n /**\n * End `InputAdornment` for this component.\n */\n endAdornment?: string | ReactElement;\n /**\n * If `true`, the component will receive focus automatically.\n */\n hasInitialFocus?: boolean;\n /**\n * The ref forwarded to the TextField\n */\n inputRef?: React.RefObject<FocusHandle>;\n /**\n * Hints at the type of data that might be entered by the user while editing the element or its contents\n * @see https://html.spec.whatwg.org/multipage/interaction.html#input-modalities:-the-inputmode-attribute\n */\n inputMode?: InputHTMLAttributes<HTMLInputElement>[\"inputMode\"];\n /**\n * If `true`, a [TextareaAutosize](/material-ui/react-textarea-autosize/) element is rendered.\n */\n isMultiline?: boolean;\n /**\n * The label for the `input` element.\n */\n label: string;\n /**\n * Callback fired when the `input` element loses focus.\n */\n onBlur?: FocusEventHandler<HTMLInputElement | HTMLTextAreaElement>;\n /**\n * Callback fired when the value is changed.\n */\n onChange?: ChangeEventHandler<HTMLTextAreaElement | HTMLInputElement>;\n /**\n * Callback fired when the `input` element get focus.\n */\n onFocus?: FocusEventHandler<HTMLInputElement | HTMLTextAreaElement>;\n /**\n * The short hint displayed in the `input` before the user enters a value.\n */\n placeholder?: string;\n /**\n * Start `InputAdornment` for this component.\n */\n startAdornment?: string | ReactElement;\n /**\n * Type of the `input` element. It should be [a valid HTML5 input type](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#Form_%3Cinput%3E_types).\n */\n type?: (typeof textFieldTypeValues)[number];\n /**\n * The value of the `input` element, required for a controlled component.\n */\n value?: string;\n} & FieldComponentProps &\n HtmlProps;\n\nconst TextField = forwardRef<HTMLInputElement, TextFieldProps>(\n (\n {\n ariaDescribedBy,\n autoCompleteType,\n defaultValue,\n hasInitialFocus,\n endAdornment,\n errorMessage,\n errorMessageList,\n hint,\n HintLinkComponent,\n id: idOverride,\n inputRef,\n inputMode,\n isDisabled = false,\n isFullWidth = false,\n isMultiline = false,\n isOptional = false,\n isReadOnly,\n label,\n name: nameOverride,\n onBlur,\n onChange: onChangeProp,\n onFocus,\n placeholder,\n startAdornment,\n testId,\n translate,\n type = \"text\",\n value: value,\n },\n ref\n ) => {\n const controlledStateRef = useRef(\n getControlState({\n controlledValue: value,\n uncontrolledValue: defaultValue,\n })\n );\n const inputValues = useInputValues({\n defaultValue,\n value,\n controlState: controlledStateRef.current,\n });\n\n const localInputRef = useRef<HTMLInputElement>(null);\n useImperativeHandle(\n inputRef,\n () => {\n return {\n focus: () => {\n localInputRef.current?.focus();\n },\n };\n },\n []\n );\n\n const onChange = useCallback<\n NonNullable<ChangeEventHandler<HTMLTextAreaElement | HTMLInputElement>>\n >(\n (event) => {\n onChangeProp?.(event);\n },\n [onChangeProp]\n );\n\n const renderFieldComponent = useCallback(\n ({ ariaDescribedBy, errorMessageElementId, id, labelElementId }) => (\n <InputBase\n {...inputValues}\n aria-describedby={ariaDescribedBy}\n autoComplete={autoCompleteType}\n /* eslint-disable-next-line jsx-a11y/no-autofocus */\n autoFocus={hasInitialFocus}\n endAdornment={\n endAdornment && (\n <InputAdornment position=\"end\" translate={translate}>\n {endAdornment}\n </InputAdornment>\n )\n }\n id={id}\n inputProps={{\n \"aria-errormessage\": errorMessageElementId,\n \"aria-labelledby\": labelElementId,\n \"data-se\": testId,\n inputMode,\n }}\n inputRef={localInputRef}\n multiline={isMultiline}\n name={nameOverride ?? id}\n onBlur={onBlur}\n onChange={onChange}\n onFocus={onFocus}\n placeholder={placeholder}\n readOnly={isReadOnly}\n ref={ref}\n required={!isOptional}\n startAdornment={\n startAdornment && (\n <InputAdornment position=\"start\" translate={translate}>\n {startAdornment}\n </InputAdornment>\n )\n }\n type={type}\n translate={translate}\n />\n ),\n [\n autoCompleteType,\n inputValues,\n hasInitialFocus,\n endAdornment,\n inputMode,\n isMultiline,\n nameOverride,\n onBlur,\n onChange,\n onFocus,\n placeholder,\n isOptional,\n isReadOnly,\n ref,\n startAdornment,\n testId,\n translate,\n type,\n ]\n );\n\n return (\n <Field\n ariaDescribedBy={ariaDescribedBy}\n errorMessage={errorMessage}\n errorMessageList={errorMessageList}\n fieldType=\"single\"\n hasVisibleLabel\n hint={hint}\n HintLinkComponent={HintLinkComponent}\n id={idOverride}\n isDisabled={isDisabled}\n isFullWidth={isFullWidth}\n isOptional={isOptional}\n label={label}\n renderFieldComponent={renderFieldComponent}\n />\n );\n }\n);\n\nconst MemoizedTextField = memo(TextField);\nMemoizedTextField.displayName = \"TextField\";\n\nexport { MemoizedTextField as TextField };\n"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAGEA,UAAU,EAEVC,IAAI,EAEJC,WAAW,EACXC,mBAAmB,EACnBC,MAAM,QACD,OAAO;AAAC,SAINC,KAAK;AAAA,SAEQC,cAAc,EAAEC,eAAe;AAAA,SAAAC,GAAA,IAAAC,IAAA;AAErD,OAAO,MAAMC,mBAAmB,GAAG,CACjC,OAAO,EACP,QAAQ,EACR,KAAK,EACL,MAAM,EACN,KAAK,CACG;AAqEV,MAAMC,SAAS,GAAGX,UAAU,CAC1B,CACE;EACEY,eAAe;EACfC,gBAAgB;EAChBC,YAAY;EACZC,eAAe;EACfC,YAAY;EACZC,YAAY;EACZC,gBAAgB;EAChBC,IAAI;EACJC,iBAAiB;EACjBC,EAAE,EAAEC,UAAU;EACdC,QAAQ;EACRC,SAAS;EACTC,UAAU,GAAG,KAAK;EAClBC,WAAW,GAAG,KAAK;EACnBC,WAAW,GAAG,KAAK;EACnBC,UAAU,GAAG,KAAK;EAClBC,UAAU;EACVC,KAAK;EACLC,IAAI,EAAEC,YAAY;EAClBC,MAAM;EACNC,QAAQ,EAAEC,YAAY;EACtBC,OAAO;EACPC,WAAW;EACXC,cAAc;EACdC,MAAM;EACNC,SAAS;EACTC,IAAI,GAAG,MAAM;EACbC,KA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D,SAAS"}
1
+ {"version":3,"file":"TextField.js","names":["forwardRef","memo","useCallback","useImperativeHandle","useRef","Field","useInputValues","getControlState","jsx","_jsx","textFieldTypeValues","TextField","ariaDescribedBy","autoCompleteType","defaultValue","hasInitialFocus","endAdornment","errorMessage","errorMessageList","hint","HintLinkComponent","id","idOverride","inputRef","inputMode","isDisabled","isFullWidth","isMultiline","isOptional","isReadOnly","label","name","nameOverride","onBlur","onChange","onChangeProp","onFocus","placeholder","startAdornment","testId","translate","type","value","ref","controlledStateRef","controlledValue","uncontrolledValue","inputValues","controlState","current","localInputRef","focus","event","renderFieldComponent","errorMessageElementId","labelElementId","_InputBase","autoComplete","autoFocus","_InputAdornment","position","children","inputProps","multiline","readOnly","required","fieldType","hasVisibleLabel","MemoizedTextField","displayName"],"sources":["../src/TextField.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 ChangeEventHandler,\n FocusEventHandler,\n forwardRef,\n InputHTMLAttributes,\n memo,\n ReactElement,\n useCallback,\n useImperativeHandle,\n useRef,\n} from \"react\";\nimport { InputAdornment, InputBase } from \"@mui/material\";\n\nimport {\n FieldComponentProps,\n FieldComponentRenderProps,\n} from \"./FieldComponentProps\";\nimport { Field } from \"./Field\";\nimport { HtmlProps } from \"./HtmlProps\";\nimport { FocusHandle, useInputValues, getControlState } from \"./inputUtils\";\n\nexport const textFieldTypeValues = [\n \"email\",\n \"number\",\n \"tel\",\n \"text\",\n \"url\",\n] as const;\n\nexport type TextFieldProps = {\n /**\n * This prop helps users to fill forms faster, especially on mobile devices.\n * The name can be confusing, as it's more like an autofill.\n * @see https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#autofill\n */\n autoCompleteType?: InputHTMLAttributes<HTMLInputElement>[\"autoComplete\"];\n /**\n * The default value. Use when the component is not controlled.\n */\n defaultValue?: string;\n /**\n * End `InputAdornment` for this component.\n */\n endAdornment?: string | ReactElement;\n /**\n * If `true`, the component will receive focus automatically.\n */\n hasInitialFocus?: boolean;\n /**\n * The ref forwarded to the TextField\n */\n inputRef?: React.RefObject<FocusHandle>;\n /**\n * Hints at the type of data that might be entered by the user while editing the element or its contents\n * @see https://html.spec.whatwg.org/multipage/interaction.html#input-modalities:-the-inputmode-attribute\n */\n inputMode?: InputHTMLAttributes<HTMLInputElement>[\"inputMode\"];\n /**\n * If `true`, a [TextareaAutosize](/material-ui/react-textarea-autosize/) element is rendered.\n */\n isMultiline?: boolean;\n /**\n * The label for the `input` element.\n */\n label: string;\n /**\n * Callback fired when the `input` element loses focus.\n */\n onBlur?: FocusEventHandler<HTMLInputElement | HTMLTextAreaElement>;\n /**\n * Callback fired when the value is changed.\n */\n onChange?: ChangeEventHandler<HTMLTextAreaElement | HTMLInputElement>;\n /**\n * Callback fired when the `input` element get focus.\n */\n onFocus?: FocusEventHandler<HTMLInputElement | HTMLTextAreaElement>;\n /**\n * The short hint displayed in the `input` before the user enters a value.\n */\n placeholder?: string;\n /**\n * Start `InputAdornment` for this component.\n */\n startAdornment?: string | ReactElement;\n /**\n * Type of the `input` element. It should be [a valid HTML5 input type](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#Form_%3Cinput%3E_types).\n */\n type?: (typeof textFieldTypeValues)[number];\n /**\n * The value of the `input` element, required for a controlled component.\n */\n value?: string;\n} & FieldComponentProps &\n Pick<HtmlProps, \"ariaDescribedBy\" | \"testId\" | \"translate\">;\n\ntype FieldRenderProps = Partial<\n Pick<FieldComponentRenderProps, \"ariaDescribedBy\" | \"errorMessageElementId\">\n> &\n Pick<FieldComponentRenderProps, \"id\" | \"labelElementId\">;\n\nconst TextField = forwardRef<HTMLInputElement, TextFieldProps>(\n (\n {\n ariaDescribedBy,\n autoCompleteType,\n defaultValue,\n hasInitialFocus,\n endAdornment,\n errorMessage,\n errorMessageList,\n hint,\n HintLinkComponent,\n id: idOverride,\n inputRef,\n inputMode,\n isDisabled = false,\n isFullWidth = false,\n isMultiline = false,\n isOptional = false,\n isReadOnly,\n label,\n name: nameOverride,\n onBlur,\n onChange: onChangeProp,\n onFocus,\n placeholder,\n startAdornment,\n testId,\n translate,\n type = \"text\",\n value: value,\n },\n ref,\n ) => {\n const controlledStateRef = useRef(\n getControlState({\n controlledValue: value,\n uncontrolledValue: defaultValue,\n }),\n );\n const inputValues = useInputValues({\n defaultValue,\n value,\n controlState: controlledStateRef.current,\n });\n\n const localInputRef = useRef<HTMLInputElement>(null);\n useImperativeHandle(\n inputRef,\n () => {\n return {\n focus: () => {\n localInputRef.current?.focus();\n },\n };\n },\n [],\n );\n\n const onChange = useCallback<\n NonNullable<ChangeEventHandler<HTMLTextAreaElement | HTMLInputElement>>\n >(\n (event) => {\n onChangeProp?.(event);\n },\n [onChangeProp],\n );\n\n const renderFieldComponent = useCallback(\n ({\n ariaDescribedBy,\n errorMessageElementId,\n id,\n labelElementId,\n }: FieldRenderProps) => (\n <InputBase\n {...inputValues}\n aria-describedby={ariaDescribedBy}\n autoComplete={autoCompleteType}\n /* eslint-disable-next-line jsx-a11y/no-autofocus */\n autoFocus={hasInitialFocus}\n endAdornment={\n endAdornment && (\n <InputAdornment position=\"end\" translate={translate}>\n {endAdornment}\n </InputAdornment>\n )\n }\n id={id}\n inputProps={{\n \"aria-errormessage\": errorMessageElementId,\n \"aria-labelledby\": labelElementId,\n \"data-se\": testId,\n inputMode,\n }}\n inputRef={localInputRef}\n multiline={isMultiline}\n name={nameOverride ?? id}\n onBlur={onBlur}\n onChange={onChange}\n onFocus={onFocus}\n placeholder={placeholder}\n readOnly={isReadOnly}\n ref={ref}\n required={!isOptional}\n startAdornment={\n startAdornment && (\n <InputAdornment position=\"start\" translate={translate}>\n {startAdornment}\n </InputAdornment>\n )\n }\n type={type}\n translate={translate}\n />\n ),\n [\n autoCompleteType,\n inputValues,\n hasInitialFocus,\n endAdornment,\n inputMode,\n isMultiline,\n nameOverride,\n onBlur,\n onChange,\n onFocus,\n placeholder,\n isOptional,\n isReadOnly,\n ref,\n startAdornment,\n testId,\n translate,\n type,\n ],\n );\n\n return (\n <Field\n ariaDescribedBy={ariaDescribedBy}\n errorMessage={errorMessage}\n errorMessageList={errorMessageList}\n fieldType=\"single\"\n hasVisibleLabel\n hint={hint}\n HintLinkComponent={HintLinkComponent}\n id={idOverride}\n isDisabled={isDisabled}\n isFullWidth={isFullWidth}\n isOptional={isOptional}\n label={label}\n renderFieldComponent={renderFieldComponent}\n />\n );\n },\n);\n\nconst MemoizedTextField = memo(TextField);\nMemoizedTextField.displayName = \"TextField\";\n\nexport { MemoizedTextField as TextField };\n"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAGEA,UAAU,EAEVC,IAAI,EAEJC,WAAW,EACXC,mBAAmB,EACnBC,MAAM,QACD,OAAO;AAAC,SAONC,KAAK;AAAA,SAEQC,cAAc,EAAEC,eAAe;AAAA,SAAAC,GAAA,IAAAC,IAAA;AAErD,OAAO,MAAMC,mBAAmB,GAAG,CACjC,OAAO,EACP,QAAQ,EACR,KAAK,EACL,MAAM,EACN,KAAK,CACG;AA0EV,MAAMC,SAAS,GAAGX,UAAU,CAC1B,CACE;EACEY,eAAe;EACfC,gBAAgB;EAChBC,YAAY;EACZC,eAAe;EACfC,YAAY;EACZC,YAAY;EACZC,gBAAgB;EAChBC,IAAI;EACJC,iBAAiB;EACjBC,EAAE,EAAEC,UAAU;EACdC,QAAQ;EACRC,SAAS;EACTC,UAAU,GAAG,KAAK;EAClBC,WAAW,GAAG,KAAK;EACnBC,WAAW,GAAG,KAAK;EACnBC,UAAU,G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A,KAAM;IACbuB,oBAAoB,EAAEA;EAAqB,CAC5C,CAAC;AAEN,CACF,CAAC;AAED,MAAMe,iBAAiB,GAAGnE,IAAI,CAACU,SAAS,CAAC;AACzCyD,iBAAiB,CAACC,WAAW,GAAG,WAAW;AAE3C,SAASD,iBAAiB,IAAIzD,SAAS"}
package/dist/Tile.js CHANGED
@@ -14,68 +14,81 @@ import _CardActions from "@mui/material/CardActions";
14
14
  */
15
15
 
16
16
  import { memo, useMemo } from "react";
17
+ import styled from "@emotion/styled";
17
18
  import { ButtonContext } from "./ButtonContext.js";
18
- import { Heading5, Paragraph, Support } from "./Typography.js";
19
19
  import { MoreIcon } from "./icons.generated/index.js";
20
- import styled from "@emotion/styled";
21
- import { useOdysseyDesignTokens } from "./OdysseyDesignTokensContext.js";
22
20
  import { MenuButton } from "./MenuButton.js";
21
+ import { useOdysseyDesignTokens } from "./OdysseyDesignTokensContext.js";
22
+ import { Heading5, Paragraph, Support } from "./Typography.js";
23
23
  import { jsx as _jsx } from "react/jsx-runtime";
24
24
  import { Fragment as _Fragment } from "react/jsx-runtime";
25
25
  import { jsxs as _jsxs } from "react/jsx-runtime";
26
- const ImageContainer = styled.div`
26
+ export const TILE_IMAGE_HEIGHT = "64px";
27
+ const ImageContainer = styled("div", {
28
+ shouldForwardProp: prop => prop !== "odysseyDesignTokens" && prop !== "hasMenuButtonChildren"
29
+ })`
27
30
  display: flex;
28
31
  align-items: flex-start;
29
- max-height: 64px;
30
- margin-block-end: ${props => props.odysseyDesignTokens.Spacing5};
31
- padding-right: ${props => props.hasMenuItems ? props.odysseyDesignTokens.Spacing5 : 0};
32
+ max-height: ${TILE_IMAGE_HEIGHT};
33
+ margin-block-end: ${({
34
+ odysseyDesignTokens
35
+ }) => odysseyDesignTokens.Spacing5};
36
+ padding-right: ${({
37
+ odysseyDesignTokens,
38
+ hasMenuButtonChildren
39
+ }) => hasMenuButtonChildren ? odysseyDesignTokens.Spacing5 : 0};
32
40
  `;
33
- const MenuButtonContainer = styled.div`
41
+ const MenuButtonContainer = styled("div", {
42
+ shouldForwardProp: prop => prop !== "odysseyDesignTokens"
43
+ })`
34
44
  position: absolute;
35
- right: ${props => props.odysseyDesignTokens.Spacing3};
36
- top: ${props => props.odysseyDesignTokens.Spacing3};
45
+ right: ${({
46
+ odysseyDesignTokens
47
+ }) => odysseyDesignTokens.Spacing3};
48
+ top: ${({
49
+ odysseyDesignTokens
50
+ }) => odysseyDesignTokens.Spacing3};
37
51
  `;
52
+ const buttonProviderValue = {
53
+ isFullWidth: true
54
+ };
38
55
  const Tile = ({
39
56
  button,
40
57
  description,
41
58
  image,
42
- menuItems,
59
+ menuButtonChildren,
43
60
  onClick,
44
61
  overline,
45
62
  title
46
63
  }) => {
47
64
  const odysseyDesignTokens = useOdysseyDesignTokens();
48
- const cardContent = useMemo(() => {
49
- return _jsxs(_Fragment, {
50
- children: [image && _jsx(ImageContainer, {
51
- odysseyDesignTokens: odysseyDesignTokens,
52
- hasMenuItems: Boolean(menuItems),
53
- children: image
54
- }), overline && _jsx(Support, {
55
- component: "div",
56
- children: overline
57
- }), title && _jsx(Heading5, {
58
- component: "div",
59
- children: title
60
- }), description && _jsx(Paragraph, {
61
- color: "textSecondary",
62
- children: description
63
- }), button && _jsx(_CardActions, {
64
- children: _jsx(ButtonContext.Provider, {
65
- value: {
66
- isFullWidth: true
67
- },
68
- children: button
69
- })
70
- })]
71
- });
72
- }, [button, description, image, menuItems, overline, title, odysseyDesignTokens]);
65
+ const cardContent = useMemo(() => _jsxs(_Fragment, {
66
+ children: [image && _jsx(ImageContainer, {
67
+ odysseyDesignTokens: odysseyDesignTokens,
68
+ hasMenuButtonChildren: Boolean(menuButtonChildren),
69
+ children: image
70
+ }), overline && _jsx(Support, {
71
+ component: "div",
72
+ children: overline
73
+ }), title && _jsx(Heading5, {
74
+ component: "div",
75
+ children: title
76
+ }), description && _jsx(Paragraph, {
77
+ color: "textSecondary",
78
+ children: description
79
+ }), button && _jsx(_CardActions, {
80
+ children: _jsx(ButtonContext.Provider, {
81
+ value: buttonProviderValue,
82
+ children: button
83
+ })
84
+ })]
85
+ }), [button, description, image, menuButtonChildren, overline, title, odysseyDesignTokens]);
73
86
  return _jsxs(_Card, {
74
87
  className: onClick ? "isClickable" : "",
75
- children: [onClick && _jsx(_CardActionArea, {
88
+ children: [onClick ? _jsx(_CardActionArea, {
76
89
  onClick: onClick,
77
90
  children: cardContent
78
- }), !onClick && cardContent, menuItems && _jsx(MenuButtonContainer, {
91
+ }) : cardContent, menuButtonChildren && _jsx(MenuButtonContainer, {
79
92
  odysseyDesignTokens: odysseyDesignTokens,
80
93
  children: _jsx(MenuButton, {
81
94
  endIcon: _jsx(MoreIcon, {}),
@@ -83,7 +96,8 @@ const Tile = ({
83
96
  buttonVariant: "floating",
84
97
  menuAlignment: "right",
85
98
  size: "small",
86
- children: menuItems
99
+ tooltipText: "Actions",
100
+ children: menuButtonChildren
87
101
  })
88
102
  })]
89
103
  });
package/dist/Tile.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"Tile.js","names":["memo","useMemo","ButtonContext","Heading5","Paragraph","Support","MoreIcon","styled","useOdysseyDesignTokens","MenuButton","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","ImageContainer","div","props","odysseyDesignTokens","Spacing5","hasMenuItems","MenuButtonContainer","Spacing3","Tile","button","description","image","menuItems","onClick","overline","title","cardContent","children","Boolean","component","color","_CardActions","Provider","value","isFullWidth","_Card","className","_CardActionArea","endIcon","ariaLabel","buttonVariant","menuAlignment","size","MemoizedTile","displayName"],"sources":["../src/Tile.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 { ReactElement, memo, useMemo } from \"react\";\n\nimport { NullElement } from \"./NullElement\";\nimport {\n Card as MuiCard,\n CardActions as MuiCardActions,\n CardActionArea as MuiCardActionArea,\n} from \"@mui/material\";\nimport { Button } from \"./Button\";\nimport { ButtonContext } from \"./ButtonContext\";\nimport { Heading5, Paragraph, Support } from \"./Typography\";\nimport { MoreIcon } from \"./icons.generated\";\nimport { HtmlProps } from \"./HtmlProps\";\nimport styled from \"@emotion/styled\";\nimport {\n DesignTokens,\n useOdysseyDesignTokens,\n} from \"./OdysseyDesignTokensContext\";\nimport { MenuButton } from \"./MenuButton\";\n\nexport type TileProps = {\n description?: string;\n image?: ReactElement | NullElement; // Icon or image\n menuItems?: ReactElement;\n overline?: string;\n title?: string;\n} & ( // You can't have actions and onClick at the same time\n | {\n onClick: () => void;\n button?: never;\n menuItems?: never;\n }\n | {\n onClick?: never;\n button?: ReactElement<typeof Button> | NullElement;\n menuItems?: ReactElement;\n }\n) &\n HtmlProps;\n\nconst ImageContainer = styled.div<{\n odysseyDesignTokens: DesignTokens;\n hasMenuItems: boolean;\n}>`\n display: flex;\n align-items: flex-start;\n max-height: 64px;\n margin-block-end: ${(props) => props.odysseyDesignTokens.Spacing5};\n padding-right: ${(props) =>\n props.hasMenuItems ? props.odysseyDesignTokens.Spacing5 : 0};\n`;\n\nconst MenuButtonContainer = styled.div<{ odysseyDesignTokens: DesignTokens }>`\n position: absolute;\n right: ${(props) => props.odysseyDesignTokens.Spacing3};\n top: ${(props) => props.odysseyDesignTokens.Spacing3};\n`;\n\nconst Tile = ({\n button,\n description,\n image,\n menuItems,\n onClick,\n overline,\n title,\n}: TileProps) => {\n const odysseyDesignTokens = useOdysseyDesignTokens();\n\n const cardContent = useMemo(() => {\n return (\n <>\n {image && (\n <ImageContainer\n odysseyDesignTokens={odysseyDesignTokens}\n hasMenuItems={Boolean(menuItems)}\n >\n {image}\n </ImageContainer>\n )}\n\n {overline && <Support component=\"div\">{overline}</Support>}\n {title && <Heading5 component=\"div\">{title}</Heading5>}\n {description && (\n <Paragraph color=\"textSecondary\">{description}</Paragraph>\n )}\n\n {button && (\n <MuiCardActions>\n <ButtonContext.Provider value={{ isFullWidth: true }}>\n {button}\n </ButtonContext.Provider>\n </MuiCardActions>\n )}\n </>\n );\n }, [\n button,\n description,\n image,\n menuItems,\n overline,\n title,\n odysseyDesignTokens,\n ]);\n\n return (\n <MuiCard className={onClick ? \"isClickable\" : \"\"}>\n {onClick && (\n <MuiCardActionArea onClick={onClick}>{cardContent}</MuiCardActionArea>\n )}\n\n {!onClick && cardContent}\n\n {menuItems && (\n <MenuButtonContainer odysseyDesignTokens={odysseyDesignTokens}>\n <MenuButton\n endIcon={<MoreIcon />}\n ariaLabel=\"Tile menu\"\n buttonVariant=\"floating\"\n menuAlignment=\"right\"\n size=\"small\"\n >\n {menuItems}\n </MenuButton>\n </MenuButtonContainer>\n )}\n </MuiCard>\n );\n};\n\nconst MemoizedTile = memo(Tile);\nMemoizedTile.displayName = \"Tile\";\n\nexport { MemoizedTile as Tile };\n"],"mappings":";;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAAuBA,IAAI,EAAEC,OAAO,QAAQ,OAAO;AAAC,SAS3CC,aAAa;AAAA,SACbC,QAAQ,EAAEC,SAAS,EAAEC,OAAO;AAAA,SAC5BC,QAAQ;AAEjB,OAAOC,MAAM,MAAM,iBAAiB;AAAC,SAGnCC,sBAAsB;AAAA,SAEfC,UAAU;AAAA,SAAAC,GAAA,IAAAC,IAAA;AAAA,SAAAC,QAAA,IAAAC,SAAA;AAAA,SAAAC,IAAA,IAAAC,KAAA;AAsBnB,MAAMC,cAAc,GAAGT,MAAM,CAACU,GAG3B;AACH;AACA;AACA;AACA,sBAAuBC,KAAK,IAAKA,KAAK,CAACC,mBAAmB,CAACC,QAAS;AACpE,mBAAoBF,KAAK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E,CACDA,MAAM,EACNC,WAAW,EACXC,KAAK,EACLC,SAAS,EACTE,QAAQ,EACRC,KAAK,EACLZ,mBAAmB,CACpB,CAAC;EAEF,OACEJ,KAAA,CAAA0B,KAAA;IAASC,SAAS,EAAEb,OAAO,GAAG,aAAa,GAAG,EAAG;IAAAI,QAAA,GAC9CJ,OAAO,IACNlB,IAAA,CAAAgC,eAAA;MAAmBd,OAAO,EAAEA,OAAQ;MAAAI,QAAA,EAAED;IAAW,CAAoB,CACtE,EAEA,CAACH,OAAO,IAAIG,WAAW,EAEvBJ,SAAS,IACRjB,IAAA,CAACW,mBAAmB;MAACH,mBAAmB,EAAEA,mBAAoB;MAAAc,QAAA,EAC5DtB,IAAA,CAACF,UAAU;QACTmC,OAAO,EAAEjC,IAAA,CAACL,QAAQ,IAAE,CAAE;QACtBuC,SAAS,EAAC,WAAW;QACrBC,aAAa,EAAC,UAAU;QACxBC,aAAa,EAAC,OAAO;QACrBC,IAAI,EAAC,OAAO;QAAAf,QAAA,EAEXL;MAAS,CACA;IAAC,CACM,CACtB;EAAA,CACM,CAAC;AAEd,CAAC;AAED,MAAMqB,YAAY,GAAGjD,IAAI,CAACwB,IAAI,CAAC;AAC/ByB,YAAY,CAACC,WAAW,GAAG,MAAM;AAEjC,SAASD,YAAY,IAAIzB,IAAI"}
1
+ {"version":3,"file":"Tile.js","names":["memo","useMemo","styled","ButtonContext","MoreIcon","MenuButton","useOdysseyDesignTokens","Heading5","Paragraph","Support","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","TILE_IMAGE_HEIGHT","ImageContainer","shouldForwardProp","prop","odysseyDesignTokens","Spacing5","hasMenuButtonChildren","MenuButtonContainer","Spacing3","buttonProviderValue","isFullWidth","Tile","button","description","image","menuButtonChildren","onClick","overline","title","cardContent","children","Boolean","component","color","_CardActions","Provider","value","_Card","className","_CardActionArea","endIcon","ariaLabel","buttonVariant","menuAlignment","size","tooltipText","MemoizedTile","displayName"],"sources":["../src/Tile.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 { MouseEventHandler, ReactElement, memo, useMemo } from \"react\";\n\nimport {\n Card as MuiCard,\n CardActions as MuiCardActions,\n CardActionArea as MuiCardActionArea,\n} from \"@mui/material\";\nimport styled from \"@emotion/styled\";\n\nimport { Button } from \"./Button\";\nimport { ButtonContext } from \"./ButtonContext\";\nimport { MoreIcon } from \"./icons.generated\";\nimport { MenuButton, MenuButtonProps } from \"./MenuButton\";\nimport {\n DesignTokens,\n useOdysseyDesignTokens,\n} from \"./OdysseyDesignTokensContext\";\nimport { Heading5, Paragraph, Support } from \"./Typography\";\n\nexport const TILE_IMAGE_HEIGHT = \"64px\";\n\nexport type TileProps = {\n /**\n * The body text of the tile. The consumer is responsible for truncating this string.\n */\n description?: string;\n /**\n * An optional image or icon at the top of the tile, preferably as an <img> or <svg> element.\n */\n image?: ReactElement; // Icon or image\n /**\n * The \"eyebrow\" text above the tile title.\n */\n overline?: string;\n /**\n * The heading of the tile.\n */\n title?: string;\n} & ( // You can't have actions and onClick at the same time\n | {\n /**\n * The event handler for when the user clicks the tile.\n */\n onClick: MouseEventHandler;\n button?: never;\n menuButtonChildren?: never;\n }\n | {\n onClick?: never;\n /**\n * The main action button for the tile. Not valid if the tile itself is clickable.\n */\n button?: ReactElement<typeof Button>;\n /**\n * Menu items to be rendered in the tile's optional menu button. If this prop is undefined, the\n * menu button will not be shown. Not valid if the tile itself is clickable.\n */\n menuButtonChildren?: MenuButtonProps[\"children\"];\n }\n);\n\nconst ImageContainer = styled(\"div\", {\n shouldForwardProp: (prop) =>\n prop !== \"odysseyDesignTokens\" && prop !== \"hasMenuButtonChildren\",\n})<{\n odysseyDesignTokens: DesignTokens;\n hasMenuButtonChildren: boolean;\n}>`\n display: flex;\n align-items: flex-start;\n max-height: ${TILE_IMAGE_HEIGHT};\n margin-block-end: ${({ odysseyDesignTokens }) =>\n odysseyDesignTokens.Spacing5};\n padding-right: ${({ odysseyDesignTokens, hasMenuButtonChildren }) =>\n hasMenuButtonChildren ? odysseyDesignTokens.Spacing5 : 0};\n`;\n\nconst MenuButtonContainer = styled(\"div\", {\n shouldForwardProp: (prop) => prop !== \"odysseyDesignTokens\",\n})<{ odysseyDesignTokens: DesignTokens }>`\n position: absolute;\n right: ${({ odysseyDesignTokens }) => odysseyDesignTokens.Spacing3};\n top: ${({ odysseyDesignTokens }) => odysseyDesignTokens.Spacing3};\n`;\n\nconst buttonProviderValue = { isFullWidth: true };\n\nconst Tile = ({\n button,\n description,\n image,\n menuButtonChildren,\n onClick,\n overline,\n title,\n}: TileProps) => {\n const odysseyDesignTokens = useOdysseyDesignTokens();\n\n const cardContent = useMemo(\n () => (\n <>\n {image && (\n <ImageContainer\n odysseyDesignTokens={odysseyDesignTokens}\n hasMenuButtonChildren={Boolean(menuButtonChildren)}\n >\n {image}\n </ImageContainer>\n )}\n\n {overline && <Support component=\"div\">{overline}</Support>}\n {title && <Heading5 component=\"div\">{title}</Heading5>}\n {description && (\n <Paragraph color=\"textSecondary\">{description}</Paragraph>\n )}\n\n {button && (\n <MuiCardActions>\n <ButtonContext.Provider value={buttonProviderValue}>\n {button}\n </ButtonContext.Provider>\n </MuiCardActions>\n )}\n </>\n ),\n [\n button,\n description,\n image,\n menuButtonChildren,\n overline,\n title,\n odysseyDesignTokens,\n ],\n );\n\n return (\n <MuiCard className={onClick ? \"isClickable\" : \"\"}>\n {onClick ? (\n <MuiCardActionArea onClick={onClick}>{cardContent}</MuiCardActionArea>\n ) : (\n cardContent\n )}\n\n {menuButtonChildren && (\n <MenuButtonContainer odysseyDesignTokens={odysseyDesignTokens}>\n <MenuButton\n endIcon={<MoreIcon />}\n ariaLabel=\"Tile menu\"\n buttonVariant=\"floating\"\n menuAlignment=\"right\"\n size=\"small\"\n tooltipText=\"Actions\"\n >\n {menuButtonChildren}\n </MenuButton>\n </MenuButtonContainer>\n )}\n </MuiCard>\n );\n};\n\nconst MemoizedTile = memo(Tile);\nMemoizedTile.displayName = \"Tile\";\n\nexport { MemoizedTile as Tile };\n"],"mappings":";;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAA0CA,IAAI,EAAEC,OAAO,QAAQ,OAAO;AAOtE,OAAOC,MAAM,MAAM,iBAAiB;AAAC,SAG5BC,aAAa;AAAA,SACbC,QAAQ;AAAA,SACRC,UAAU;AAAA,SAGjBC,sBAAsB;AAAA,SAEfC,QAAQ,EAAEC,SAAS,EAAEC,OAAO;AAAA,SAAAC,GAAA,IAAAC,IAAA;AAAA,SAAAC,QAAA,IAAAC,SAAA;AAAA,SAAAC,IAAA,IAAAC,KAAA;AAErC,OAAO,MAAMC,iBAAiB,GAAG,MAAM;AA0CvC,MAAMC,cAAc,GAAGf,MAAM,CAAC,KAAK,EAAE;EACnCgB,iBAAiB,EAAGC,IAAI,IACtBA,IAAI,KAAK,qBAAqB,IAAIA,IAAI,KAAK;AAC/C,CAAC,CAGE;AACH;AACA;AACA,gBAAgBH,iBAAkB;AAClC,sBAAsB,CAAC;EAAEI;AAAoB,CAAC,KAC1CA,mBAAmB,CAACC,QAAS;AACjC,mBAAmB,CAAC;EAAED,mBAAmB;EAAEE;AAAsB,CAAC,KAC9DA,qBAAqB,GAAGF,mBAAmB,CAACC,QAAQ,GAAG,CAAE;AAC7D,CAAC;AAED,MAAME,mBAAmB,GAAGrB,MAAM,CAAC,KAAK,EAAE;EACxCgB,iBAAiB,EAAGC,IAAI,IAAKA,IAAI,KAAK;AACxC,CAAC,CAAyC;AAC1C;AACA,WAAW,CAAC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AAA,CAAA4B,KAAA;IAASC,SAAS,EAAEZ,OAAO,GAAG,aAAa,GAAG,EAAG;IAAAI,QAAA,GAC9CJ,OAAO,GACNrB,IAAA,CAAAkC,eAAA;MAAmBb,OAAO,EAAEA,OAAQ;MAAAI,QAAA,EAAED;IAAW,CAAoB,CAAC,GAEtEA,WACD,EAEAJ,kBAAkB,IACjBpB,IAAA,CAACY,mBAAmB;MAACH,mBAAmB,EAAEA,mBAAoB;MAAAgB,QAAA,EAC5DzB,IAAA,CAACN,UAAU;QACTyC,OAAO,EAAEnC,IAAA,CAACP,QAAQ,IAAE,CAAE;QACtB2C,SAAS,EAAC,WAAW;QACrBC,aAAa,EAAC,UAAU;QACxBC,aAAa,EAAC,OAAO;QACrBC,IAAI,EAAC,OAAO;QACZC,WAAW,EAAC,SAAS;QAAAf,QAAA,EAEpBL;MAAkB,CACT;IAAC,CACM,CACtB;EAAA,CACM,CAAC;AAEd,CAAC;AAED,MAAMqB,YAAY,GAAGpD,IAAI,CAAC2B,IAAI,CAAC;AAC/ByB,YAAY,CAACC,WAAW,GAAG,MAAM;AAEjC,SAASD,YAAY,IAAIzB,IAAI"}
package/dist/Toast.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"Toast.js","names":["useEffect","memo","useState","useCallback","visuallyHidden","Link","CloseIcon","Button","useTranslation","jsx","_jsx","jsxs","_jsxs","toastRoleValues","toastSeverityValues","ClickAwayListenerProps","onClickAway","Toast","autoHideDuration","isDismissable","linkText","linkUrl","isVisible","isVisibleProp","onHide","onHideProp","role","severity","testId","text","translate","t","setIsVisible","_Snackbar","open","undefined","onClose","className","children","_Alert","action","ariaLabel","onClick","size","startIcon","variant","_AlertTitle","style","href","MemoizedToast","displayName"],"sources":["../src/Toast.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 { useEffect, memo, useState, useCallback } from \"react\";\nimport { Alert, AlertTitle, Snackbar } from \"@mui/material\";\nimport { visuallyHidden } from \"@mui/utils\";\nimport { Link } from \"./Link\";\nimport { CloseIcon } from \"./icons.generated\";\nimport { Button } from \"./Button\";\nimport { useTranslation } from \"react-i18next\";\nimport { HtmlProps } from \"./HtmlProps\";\n\nexport const toastRoleValues = [\"status\", \"alert\"] as const;\nexport const toastSeverityValues = [\n \"success\",\n \"info\",\n \"warning\",\n \"error\",\n] as const;\n\nexport type ToastProps = {\n /**\n * If set, this determines how long the Toast should appear before automatically disappearing in milliseconds.\n * It will only take effect if the Toast is not dismissible.\n * If left blank, it defaults to 6000.\n */\n autoHideDuration?: number;\n /**\n * If `true`, the Toast will include a close button.\n */\n isDismissable?: boolean;\n /**\n * If true, the Toast is visible\n */\n isVisible?: boolean;\n /**\n * If linkUrl is not undefined, this is the text of the link.\n * If left blank, it defaults to \"Learn more\".\n * Note that linkText does nothing if linkUrl is not defined\n */\n linkText?: string;\n /**\n * If defined, the Toast will include a link to the URL\n */\n linkUrl?: string;\n /**\n * An optional function to run when the Toast is closed.\n */\n onHide?: () => void;\n /**\n * Sets the ARIA role of the Toast\n * (\"status\" for something that dynamically updates, \"alert\" for errors, null for something\n * unchanging)\n */\n role?: (typeof toastRoleValues)[number];\n /**\n * Determine the color and icon of the Toast\n */\n severity: (typeof toastSeverityValues)[number];\n /**\n * The text content of the Toast\n */\n text: string;\n} & HtmlProps;\n\nconst ClickAwayListenerProps = { onClickAway: () => false };\n\nconst Toast = ({\n autoHideDuration = 6000,\n isDismissable,\n linkText,\n linkUrl,\n isVisible: isVisibleProp,\n onHide: onHideProp,\n role,\n severity,\n testId,\n text,\n translate,\n}: ToastProps) => {\n const { t } = useTranslation();\n\n const [isVisible, setIsVisible] = useState(isVisibleProp);\n\n useEffect(() => {\n setIsVisible(isVisibleProp);\n }, [isVisibleProp]);\n\n const onHide = useCallback(() => {\n setIsVisible(false);\n onHideProp?.();\n }, [onHideProp]);\n\n return (\n <Snackbar\n open={isVisible}\n autoHideDuration={\n isDismissable || autoHideDuration <= 0 ? undefined : autoHideDuration\n }\n onClose={onHide}\n className=\"Toast\"\n ClickAwayListenerProps={ClickAwayListenerProps}\n >\n <Alert\n action={\n isDismissable === true && (\n <Button\n ariaLabel={t(\"close.text\")}\n onClick={onHide}\n size=\"small\"\n startIcon={<CloseIcon />}\n variant=\"floating\"\n />\n )\n }\n data-se={testId}\n role={role}\n severity={severity}\n variant=\"toast\"\n >\n <AlertTitle translate={translate}>\n <span style={visuallyHidden}>{severity}:</span>\n {text}\n </AlertTitle>\n {linkUrl && (\n <Link href={linkUrl} variant=\"monochrome\" translate={translate}>\n {linkText}\n </Link>\n )}\n </Alert>\n </Snackbar>\n );\n};\n\nconst MemoizedToast = memo(Toast);\nMemoizedToast.displayName = \"Toast\";\n\nexport { MemoizedToast as Toast };\n"],"mappings":";;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,SAAS,EAAEC,IAAI,EAAEC,QAAQ,EAAEC,WAAW,QAAQ,OAAO;AAE9D,SAASC,cAAc,QAAQ,YAAY;AAAC,SACnCC,IAAI;AAAA,SACJC,SAAS;AAAA,SACTC,MAAM;AACf,SAASC,cAAc,QAAQ,eAAe;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAAA,SAAAC,IAAA,IAAAC,KAAA;AAG/C,OAAO,MAAMC,eAAe,GAAG,CAAC,QAAQ,EAAE,OAAO,CAAU;AAC3D,OAAO,MAAMC,mBAAmB,GAAG,CACjC,SAAS,EACT,MAAM,EACN,SAAS,EACT,OAAO,CACC;AA+CV,MAAMC,sBAAsB,GAAG;EAAE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Q,EAAEA,QAAS;MACnBkB,OAAO,EAAC,OAAO;MAAAP,QAAA,GAEf1B,KAAA,CAAAkC,WAAA;QAAYhB,SAAS,EAAEA,SAAU;QAAAQ,QAAA,GAC/B1B,KAAA;UAAMmC,KAAK,EAAE3C,cAAe;UAAAkC,QAAA,GAAEX,QAAQ,EAAC,GAAC;QAAA,CAAM,CAAC,EAC9CE,IAAI;MAAA,CACK,CAAC,EACZR,OAAO,IACNX,IAAA,CAACL,IAAI;QAAC2C,IAAI,EAAE3B,OAAQ;QAACwB,OAAO,EAAC,YAAY;QAACf,SAAS,EAAEA,SAAU;QAAAQ,QAAA,EAC5DlB;MAAQ,CACL,CACP;IAAA,CACI;EAAC,CACA,CAAC;AAEf,CAAC;AAED,MAAM6B,aAAa,GAAGhD,IAAI,CAACgB,KAAK,CAAC;AACjCgC,aAAa,CAACC,WAAW,GAAG,OAAO;AAEnC,SAASD,aAAa,IAAIhC,KAAK"}
1
+ {"version":3,"file":"Toast.js","names":["useEffect","memo","useState","useCallback","visuallyHidden","Link","CloseIcon","Button","useTranslation","jsx","_jsx","jsxs","_jsxs","toastRoleValues","toastSeverityValues","ClickAwayListenerProps","onClickAway","Toast","autoHideDuration","isDismissable","linkText","linkUrl","isVisible","isVisibleProp","onHide","onHideProp","role","severity","testId","text","translate","t","setIsVisible","_Snackbar","open","undefined","onClose","className","children","_Alert","action","ariaLabel","onClick","size","startIcon","variant","_AlertTitle","style","href","MemoizedToast","displayName"],"sources":["../src/Toast.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 { useEffect, memo, useState, useCallback } from \"react\";\nimport { Alert, AlertTitle, Snackbar } from \"@mui/material\";\nimport { visuallyHidden } from \"@mui/utils\";\nimport { Link } from \"./Link\";\nimport { CloseIcon } from \"./icons.generated\";\nimport { Button } from \"./Button\";\nimport { useTranslation } from \"react-i18next\";\nimport { HtmlProps } from \"./HtmlProps\";\n\nexport const toastRoleValues = [\"status\", \"alert\"] as const;\nexport const toastSeverityValues = [\n \"success\",\n \"info\",\n \"warning\",\n \"error\",\n] as const;\n\nexport type ToastProps = {\n /**\n * If set, this determines how long the Toast should appear before automatically disappearing in milliseconds.\n * It will only take effect if the Toast is not dismissible.\n * If left blank, it defaults to 6000.\n */\n autoHideDuration?: number;\n /**\n * If `true`, the Toast will include a close button.\n */\n isDismissable?: boolean;\n /**\n * If true, the Toast is visible\n */\n isVisible?: boolean;\n /**\n * If linkUrl is not undefined, this is the text of the link.\n * If left blank, it defaults to \"Learn more\".\n * Note that linkText does nothing if linkUrl is not defined\n */\n linkText?: string;\n /**\n * If defined, the Toast will include a link to the URL\n */\n linkUrl?: string;\n /**\n * An optional function to run when the Toast is closed.\n */\n onHide?: () => void;\n /**\n * Sets the ARIA role of the Toast\n * (\"status\" for something that dynamically updates, \"alert\" for errors, null for something\n * unchanging)\n */\n role?: (typeof toastRoleValues)[number];\n /**\n * Determine the color and icon of the Toast\n */\n severity: (typeof toastSeverityValues)[number];\n /**\n * The text content of the Toast\n */\n text: string;\n} & Pick<HtmlProps, \"testId\" | \"translate\">;\n\nconst ClickAwayListenerProps = { onClickAway: () => false };\n\nconst Toast = ({\n autoHideDuration = 6000,\n isDismissable,\n linkText,\n linkUrl,\n isVisible: isVisibleProp,\n onHide: onHideProp,\n role,\n severity,\n testId,\n text,\n translate,\n}: ToastProps) => {\n const { t } = useTranslation();\n\n const [isVisible, setIsVisible] = useState(isVisibleProp);\n\n useEffect(() => {\n setIsVisible(isVisibleProp);\n }, [isVisibleProp]);\n\n const onHide = useCallback(() => {\n setIsVisible(false);\n onHideProp?.();\n }, [onHideProp]);\n\n return (\n <Snackbar\n open={isVisible}\n autoHideDuration={\n isDismissable || autoHideDuration <= 0 ? undefined : autoHideDuration\n }\n onClose={onHide}\n className=\"Toast\"\n ClickAwayListenerProps={ClickAwayListenerProps}\n >\n <Alert\n action={\n isDismissable === true && (\n <Button\n ariaLabel={t(\"close.text\")}\n onClick={onHide}\n size=\"small\"\n startIcon={<CloseIcon />}\n variant=\"floating\"\n />\n )\n }\n data-se={testId}\n role={role}\n severity={severity}\n variant=\"toast\"\n >\n <AlertTitle translate={translate}>\n <span style={visuallyHidden}>{severity}:</span>\n {text}\n </AlertTitle>\n {linkUrl && (\n <Link href={linkUrl} variant=\"monochrome\" translate={translate}>\n {linkText}\n </Link>\n )}\n </Alert>\n </Snackbar>\n );\n};\n\nconst MemoizedToast = memo(Toast);\nMemoizedToast.displayName = \"Toast\";\n\nexport { MemoizedToast as Toast };\n"],"mappings":";;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,SAAS,EAAEC,IAAI,EAAEC,QAAQ,EAAEC,WAAW,QAAQ,OAAO;AAE9D,SAASC,cAAc,QAAQ,YAAY;AAAC,SACnCC,IAAI;AAAA,SACJC,SAAS;AAAA,SACTC,MAAM;AACf,SAASC,cAAc,QAAQ,eAAe;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAAA,SAAAC,IAAA,IAAAC,KAAA;AAG/C,OAAO,MAAMC,eAAe,GAAG,CAAC,QAAQ,EAAE,OAAO,CAAU;AAC3D,OAAO,MAAMC,mBAAmB,GAAG,CACjC,SAAS,EACT,MAAM,EACN,SAAS,EACT,OAAO,CACC;AA+CV,MAAMC,sBAAsB,GAAG;EAAEC,WAAW,EAAEA,CAAA,KAAM;AAAM,CAAC;AAE3D,MAAMC,KAAK,GAAGA,CAAC;EACbC,gBAAgB,GAAG,IAAI;EACvBC,aAAa;EACbC,QAAQ;EACRC,OAAO;E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AA;UAAMmC,KAAK,EAAE3C,cAAe;UAAAkC,QAAA,GAAEX,QAAQ,EAAC,GAAC;QAAA,CAAM,CAAC,EAC9CE,IAAI;MAAA,CACK,CAAC,EACZR,OAAO,IACNX,IAAA,CAACL,IAAI;QAAC2C,IAAI,EAAE3B,OAAQ;QAACwB,OAAO,EAAC,YAAY;QAACf,SAAS,EAAEA,SAAU;QAAAQ,QAAA,EAC5DlB;MAAQ,CACL,CACP;IAAA,CACI;EAAC,CACA,CAAC;AAEf,CAAC;AAED,MAAM6B,aAAa,GAAGhD,IAAI,CAACgB,KAAK,CAAC;AACjCgC,aAAa,CAACC,WAAW,GAAG,OAAO;AAEnC,SAASD,aAAa,IAAIhC,KAAK"}
@@ -1 +1 @@
1
- {"version":3,"file":"Tooltip.js","names":["MuiPropsChild","memo","jsx","_jsx","Tooltip","ariaType","children","placement","testId","text","translate","_Tooltip","describeChild","title","MemoizedTooltip","displayName"],"sources":["../src/Tooltip.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 { Tooltip as MuiTooltip } from \"@mui/material\";\nimport type { TooltipProps as MuiTooltipProps } from \"@mui/material\";\n\nimport { MuiPropsChild } from \"./MuiPropsChild\";\nimport { ReactElement, memo } from \"react\";\nimport { HtmlProps } from \"./HtmlProps\";\n\nexport type TooltipProps = {\n /**\n * The type of ARIA attribute to use\n */\n ariaType: \"description\" | \"label\";\n /**\n * The content that triggers the Tooltip when hovered\n */\n children: ReactElement;\n /**\n * The placement of the Tooltip\n */\n placement?: MuiTooltipProps[\"placement\"];\n /**\n * The text to display in the Tooltip\n */\n text: string;\n} & HtmlProps;\n\nconst Tooltip = ({\n ariaType,\n children,\n placement = \"top\",\n testId,\n text,\n translate,\n}: TooltipProps) => (\n <MuiTooltip\n data-se={testId}\n describeChild={ariaType === \"description\"}\n placement={placement}\n title={text}\n translate={translate}\n >\n <MuiPropsChild>{children}</MuiPropsChild>\n </MuiTooltip>\n);\n\nconst MemoizedTooltip = memo(Tooltip);\nMemoizedTooltip.displayName = \"Tooltip\";\n\nexport { MemoizedTooltip as Tooltip };\n"],"mappings":";AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAVA,SAeSA,aAAa;AACtB,SAAuBC,IAAI,QAAQ,OAAO;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAsB3C,MAAMC,OAAO,GAAGA,CAAC;EACfC,QAAQ;EACRC,QAAQ;EACRC,SAAS,GAAG,KAAK;EACjBC,MAAM;EACNC,IAAI;EACJC;AACY,CAAC,KACbP,IAAA,CAAAQ,QAAA;EACE,WAASH,MAAO;EAChBI,aAAa,EAAEP,QAAQ,KAAK,aAAc;EAC1CE,SAAS,EAAEA,SAAU;EACrBM,KAAK,EAAEJ,IAAK;EACZC,SAAS,EAAEA,SAAU;EAAAJ,QAAA,EAErBH,IAAA,CAACH,aAAa;IAAAM,QAAA,EAAEA;EAAQ,CAAgB;AAAC,CAC/B,CACb;AAED,MAAMQ,eAAe,GAAGb,IAAI,CAACG,OAAO,CAAC;AACrCU,eAAe,CAACC,WAAW,GAAG,SAAS;AAEvC,SAASD,eAAe,IAAIV,OAAO"}
1
+ {"version":3,"file":"Tooltip.js","names":["MuiPropsChild","memo","jsx","_jsx","Tooltip","ariaType","children","placement","testId","text","translate","_Tooltip","describeChild","title","MemoizedTooltip","displayName"],"sources":["../src/Tooltip.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 { Tooltip as MuiTooltip } from \"@mui/material\";\nimport type { TooltipProps as MuiTooltipProps } from \"@mui/material\";\n\nimport { MuiPropsChild } from \"./MuiPropsChild\";\nimport { ReactElement, memo } from \"react\";\nimport { HtmlProps } from \"./HtmlProps\";\n\nexport type TooltipProps = {\n /**\n * The type of ARIA attribute to use\n */\n ariaType: \"description\" | \"label\";\n /**\n * The content that triggers the Tooltip when hovered\n */\n children: ReactElement;\n /**\n * The placement of the Tooltip\n */\n placement?: MuiTooltipProps[\"placement\"];\n /**\n * The text to display in the Tooltip\n */\n text: string;\n} & Pick<HtmlProps, \"testId\" | \"translate\">;\n\nconst Tooltip = ({\n ariaType,\n children,\n placement = \"top\",\n testId,\n text,\n translate,\n}: TooltipProps) => (\n <MuiTooltip\n data-se={testId}\n describeChild={ariaType === \"description\"}\n placement={placement}\n title={text}\n translate={translate}\n >\n <MuiPropsChild>{children}</MuiPropsChild>\n </MuiTooltip>\n);\n\nconst MemoizedTooltip = memo(Tooltip);\nMemoizedTooltip.displayName = \"Tooltip\";\n\nexport { MemoizedTooltip as Tooltip };\n"],"mappings":";AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAVA,SAeSA,aAAa;AACtB,SAAuBC,IAAI,QAAQ,OAAO;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAsB3C,MAAMC,OAAO,GAAGA,CAAC;EACfC,QAAQ;EACRC,QAAQ;EACRC,SAAS,GAAG,KAAK;EACjBC,MAAM;EACNC,IAAI;EACJC;AACY,CAAC,KACbP,IAAA,CAAAQ,QAAA;EACE,WAASH,MAAO;EAChBI,aAAa,EAAEP,QAAQ,KAAK,aAAc;EAC1CE,SAAS,EAAEA,SAAU;EACrBM,KAAK,EAAEJ,IAAK;EACZC,SAAS,EAAEA,SAAU;EAAAJ,QAAA,EAErBH,IAAA,CAACH,aAAa;IAAAM,QAAA,EAAEA;EAAQ,CAAgB;AAAC,CAC/B,CACb;AAED,MAAMQ,eAAe,GAAGb,IAAI,CAACG,OAAO,CAAC;AACrCU,eAAe,CAACC,WAAW,GAAG,SAAS;AAEvC,SAASD,eAAe,IAAIV,OAAO"}