@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
package/CHANGELOG.md CHANGED
@@ -3,6 +3,31 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [1.14.2](https://github.com/okta/odyssey/compare/v1.14.1...v1.14.2) (2024-02-27)
7
+
8
+ ### Bug Fixes
9
+
10
+ - removed OdysseyCacheProvider from OdysseyThemeProvider ([#2110](https://github.com/okta/odyssey/issues/2110)) ([9106341](https://github.com/okta/odyssey/commit/9106341d37fc57d8c2edf57db9683acdb065c73e))
11
+
12
+ ## [1.14.1](https://github.com/okta/odyssey/compare/v1.14.0...v1.14.1) (2024-02-26)
13
+
14
+ **Note:** Version bump only for package @okta/odyssey-react-mui
15
+
16
+ ## [1.14.0](https://github.com/okta/odyssey/compare/v1.13.12...v1.14.0) (2024-02-26)
17
+
18
+ ### Features
19
+
20
+ - add drawer component ([563655c](https://github.com/okta/odyssey/commit/563655c793968734aa2bbde1f5bf359267526404))
21
+
22
+ ### Bug Fixes
23
+
24
+ - updates based on PR feedback ([9496a99](https://github.com/okta/odyssey/commit/9496a990797a61c023e9ef0420f71c977ccf696c))
25
+ - Upgrade every package ([#2136](https://github.com/okta/odyssey/issues/2136)) ([89b6534](https://github.com/okta/odyssey/commit/89b65342755a30d0e947f5ffb75e6bbe00268442))
26
+
27
+ ## [1.13.12](https://github.com/okta/odyssey/compare/v1.13.11...v1.13.12) (2024-02-16)
28
+
29
+ **Note:** Version bump only for package @okta/odyssey-react-mui
30
+
6
31
  ## [1.13.11](https://github.com/okta/odyssey/compare/v1.13.10...v1.13.11) (2024-02-15)
7
32
 
8
33
  **Note:** Version bump only for package @okta/odyssey-react-mui
@@ -0,0 +1,2 @@
1
+
2
+ //# sourceMappingURL=properties.d.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"properties.d.js","names":[],"sources":["../../src/@types/properties.d.ts"],"sourcesContent":["/*!\n * Copyright (c) 2024-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *\n * See the License for the specific language governing permissions and limitations under the License.\n */\n\n/* eslint-disable @typescript-eslint/no-explicit-any */\n\n/**\n * Copied this in from a PR that will hopefully get merged:\n * @see https://github.com/gagle/node-properties/pull/35\n */\ndeclare module \"properties\" {\n export interface ParseOptions {\n /**\n * By default `parse()` reads a String.\n * If you want to read a file, set this option to true.\n * If this option is used, the callback is mandatory.\n * It gets 2 parameters, a possible error and the object with all the properties.\n */\n path?: boolean;\n\n /**\n * Allows you to add additional comment tokens.\n * The token must be a single printable non-whitespae ascii character.\n * If the `strict` option is not set, the tokens `#` and `!` are parsed as comment tokens.\n *\n * @example\n * comments: \";\"\n * @example\n * comments: [\";\", \"@\"]\n */\n comments?: string | string[];\n\n /**\n * Allows you to add additional separator tokens.\n * The token must be a single printable non-whitespae ascii character.\n * If the `strict` option is not set, the tokens `=` and `:` are parsed as comment tokens.\n *\n * @example\n * separators: \"-\"\n * @example\n * separators: [\"-\", \">\"]\n */\n separators?: string | string[];\n\n /**\n * This option can be used with the `comments` and `separators` options.\n * If true, **only** the tokens specified in these options are used to parse comments and separators.\n */\n strict?: boolean;\n\n /**\n * Parses INI sections.\n * Read the INI section for further details.\n *\n * @link https://www.npmjs.com/package/properties#ini\n */\n sections?: boolean;\n\n /**\n * Parses dot separated keys as JavaScript objects.\n *\n * Look at the namespaces section for further details.\n * @link https://www.npmjs.com/package/properties#namespaces\n */\n namespaces?: boolean;\n\n /**\n * Allows you to read the value of a key while the file is being parsed.\n *\n * Look at the variables section for further details.\n * @link https://www.npmjs.com/package/properties#variables\n */\n variables?: boolean;\n\n /**\n * External variables can be passed to the file if the variables option is enabled.\n *\n * Look at the variables section for further details.\n * @link https://www.npmjs.com/package/properties#variables\n */\n vars?: boolean;\n\n /**\n * Files can be linked and imported with the include key.\n * If this option is used, the callback is mandatory.\n *\n * Look at the include section for further details.\n * @link https://www.npmjs.com/package/properties#include\n */\n include?: boolean;\n\n /**\n * Each property or section can be removed or modified from the final object.\n * It's similar to the reviver of the `JSON.parse()` function.\n *\n * The reviver it's exactly the same as the replacer from `stringify()`.\n * The same function can be reused.\n *\n * The callback gets 3 parameters: key, value and section.\n *\n * A property has a key and a value and can belong to a section.\n * If it's a global property, the section is set to null.\n * If **undefined** is returned, the property will be removed from the final object, otherwise the returned value will be used as the property value.\n *\n * If the key and the value are set to null, then it's a section line.\n * If it returns a falsy value, it won't be added to the final object, the entire section _including all the properties_ will be discarded.\n * If it returns a truthy value, the section is parsed.\n *\n * For your convenience, to know whether the line is a property or section you can access to `this.isProperty` and `this.isSection` from inside the replacer function.\n * Also, `this.assert()` can be used to return the default value, the unmodified value that will be used to parse the line.\n *\n * Look at the reviver example for further details.\n * @link https://github.com/gagle/node-properties/blob/master/examples/reviver/reviver.js\n */\n reviver?: (this: Context, key: any, value: any) => any;\n }\n\n export interface Context {\n assert(): any;\n }\n\n /**\n * Parses a .properties string.\n *\n * @param data\n * @param options\n */\n export function parse(data: string, options?: ParseOptions): object;\n\n /**\n * Parses a .properties string.\n *\n * If a callback is given, the result is returned as the second parameter. Some options will require a callback.\n *\n * @param data\n * @param cb\n */\n export function parse(\n data: string,\n cb: (err: Error, result: { [key: string]: unknown } | undefined) => void,\n ): void;\n\n /**\n * Parses a .properties string.\n *\n * If a callback is given, the result is returned as the second parameter. Some options will require a callback.\n *\n * @param data\n * @param options\n * @param cb\n */\n export function parse(\n data: string,\n options: ParseOptions | undefined,\n cb: (err: Error, result: { [key: string]: unknown } | undefined) => void,\n ): void;\n\n export interface StringifyOptions {\n /**\n * By default `stringify()` returns a string.\n * If you want to write it to a file, use this option and pass the path of a file.\n * If this option is used, the callback is mandatory.\n * It gets two parameters, a possible error and the string.\n */\n path?: string;\n\n /**\n * The token to use to write comments.\n * It must be a single printable non-whitespace ascii character.\n * @default `#`\n */\n comment?: string;\n\n /**\n * The token to use to separate keys from values.\n * It must be a single printable non-whitespace ascii character.\n * @default `=`\n */\n separator?: string;\n\n /**\n * The .properties specification uses iso 8859-1 (latin-1) as a default encoding.\n * In the other hand, Node.js has a utf8 default encoding.\n * This means that if you want a full compatibility with Java, that is, you are generating a .properties file that is going to be read by a Java program, then set this option to true.\n * This will encode all ascii extended and multibyte characters to their unicode string representation (`\\uXXXX`).\n *\n * Non-printable control codes (control sets 0 and 1) are always encoded as unicode strings except `\\t`, `\\n`, `\\f` and `\\r`.\n *\n * If you are in a platform that can handle utf8 strings, e.g. Node.js, you don't need to use this option.\n */\n unicode?: boolean;\n\n /**\n * Each property or section can be removed or modified from the final string.\n * It's similar to the replacer of the `JSON.stringify()` function.\n *\n * The replacer it's exatcly the same as the reviver from `parse()`.\n * The same function can be reused.\n *\n * The callback gets three parameters: key, value and section.\n *\n * A property has a key and a value and can belong to a section.\n * If it's a global property, the section is set to null.\n * If **undefined** is returned, the property won't be stringified, otherwise the returned value will be used as the property value.\n *\n * If the key and the value are set to null, then it's a section line.\n * If it returns a falsy value, it won't be added to the final string, the entire section _including all the properties_ will be discarded.\n * If it returns a truthy value, the section is stringified.\n *\n * For your convenience, to know whether the line is a property or section you can access to `this.isProperty` and `this.isSection` from inside the replacer function.\n * Also, `this.assert()` can be used to return the default value, the unmodified value that will be used to stringify the line.\n *\n * Look at the replacer example for further details.\n * @link https://github.com/gagle/node-properties/blob/master/examples/replacer.js\n */\n replacer?: (this: Context, key: string, value: any) => any;\n }\n\n /**\n * Stringifies an `object` or a `Stringifier`.\n *\n * If you don't need to add sections or comments simply pass an object, otherwise use a `Stringifier`.\n *\n * @param obj\n * @param options\n */\n export function stringify(obj: object, options?: StringifyOptions): string;\n\n /**\n * Stringifies an `object` or a `Stringifier`.\n *\n * If you don't need to add sections or comments simply pass an object, otherwise use a `Stringifier`.\n *\n * The callback is only necessary when the `path` option is used.\n *\n * @param obj\n * @param options\n * @param cb\n */\n export function stringify(\n obj: object,\n options: StringifyOptions | undefined,\n cb: (err: Error, result: string) => void,\n ): void;\n\n /**\n * This class is used when you want to add sections or comments to the final string.\n *\n * To create a Stringifier use the `createStringifier()` function.\n *\n * Look at the stringify-ini example for further details.\n * @link https://github.com/gagle/node-properties/blob/master/examples/ini/stringify-ini.js\n */\n export interface Stringifier {\n /**\n * Writes a header comment.\n * It will be written to the top of the final string.\n * Returns the Stringifier being used.\n */\n header(comment: string): this;\n\n /**\n * Writes a property line.\n * It takes an object with three options: `key`, `value` and comment.\n * Both the key and the value are converted into a string automatically.\n * Returns the Stringifier being used.\n */\n property(obj: { key?: string; value?: string; comment?: string }): this;\n\n /**\n * Writes a section line.\n * It gets an object with two options: `name` and `comment`.\n * The name is converted into a string.\n * If you don't need to write a comment, you can pass the name instead of an object.\n * Returns the stringifier being used.\n */\n section(obj: string | { name: string; comment?: string }): this;\n }\n\n /**\n * Returns a new `Stringifier` instance.\n */\n export function createStringifier(): Stringifier;\n}\n"],"mappings":""}
@@ -1 +1 @@
1
- {"version":3,"file":"Accordion.js","names":["memo","ChevronDownIcon","Support","useUniqueId","jsx","_jsx","jsxs","_jsxs","Accordion","children","label","id","idOverride","isDefaultExpanded","isDisabled","isExpanded","onChange","translate","headerId","contentId","_Accordion","defaultExpanded","disabled","disableGutters","expanded","_AccordionSummary","expandIcon","component","_AccordionDetails","MemoizedAccordion","displayName"],"sources":["../src/Accordion.tsx"],"sourcesContent":["/*!\n * Copyright (c) 2023-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *\n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport { ReactNode, memo } from \"react\";\nimport type { HtmlProps } from \"./HtmlProps\";\nimport {\n Accordion as MuiAccordion,\n AccordionDetails as MuiAccordionDetails,\n AccordionSummary as MuiAccordionSummary,\n AccordionProps as MuiAccordionProps,\n} from \"@mui/material\";\nimport { ChevronDownIcon } from \"./icons.generated\";\nimport { Support } from \"./Typography\";\nimport { useUniqueId } from \"./useUniqueId\";\n\nexport type AccordionProps = {\n /**\n * The content of the Accordion itself\n */\n children: ReactNode;\n /**\n * Defines IDs for the header and the content of the Accordion\n */\n id?: string;\n /**\n * The label text for the AccordionSummary\n */\n label: string;\n /**\n * Whether the item is expanded by default\n */\n isDefaultExpanded?: boolean;\n /**\n * Whether the item is disabled\n */\n isDisabled?: boolean;\n /**\n * Whether the item is expanded\n */\n isExpanded?: boolean;\n /**\n * Event fired when the expansion state of the accordion is changed\n */\n onChange?: MuiAccordionProps[\"onChange\"];\n} & (\n | {\n isExpanded: boolean;\n isDefaultExpanded?: never;\n }\n | {\n isDefaultExpanded?: boolean;\n isExpanded?: never;\n }\n) &\n HtmlProps;\n\nconst Accordion = ({\n children,\n label,\n id: idOverride,\n isDefaultExpanded,\n isDisabled,\n isExpanded,\n onChange,\n translate,\n}: AccordionProps) => {\n const id = useUniqueId(idOverride);\n const headerId = `${id}-header`;\n const contentId = `${id}-content`;\n return (\n <MuiAccordion\n defaultExpanded={isDefaultExpanded}\n disabled={isDisabled}\n disableGutters\n expanded={isExpanded}\n onChange={onChange}\n >\n <MuiAccordionSummary\n aria-controls={contentId}\n expandIcon={<ChevronDownIcon />}\n id={headerId}\n >\n <Support component=\"div\" translate={translate}>\n {label}\n </Support>\n </MuiAccordionSummary>\n <MuiAccordionDetails aria-labelledby={headerId}>\n {children}\n </MuiAccordionDetails>\n </MuiAccordion>\n );\n};\n\nconst MemoizedAccordion = memo(Accordion);\nMemoizedAccordion.displayName = \"Accordion\";\n\nexport { MemoizedAccordion as Accordion };\n"],"mappings":";;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAAoBA,IAAI,QAAQ,OAAO;AAAC,SAQ/BC,eAAe;AAAA,SACfC,OAAO;AAAA,SACPC,WAAW;AAAA,SAAAC,GAAA,IAAAC,IAAA;AAAA,SAAAC,IAAA,IAAAC,KAAA;AA2CpB,MAAMC,SAAS,GAAGA,CAAC;EACjBC,QAAQ;EACRC,KAAK;EACLC,EAAE,EAAEC,UAAU;EACdC,iBAAiB;EACjBC,UAAU;EACVC,UAAU;EACVC,QAAQ;EACRC;AACc,CAAC,KAAK;EACpB,MAAMN,EAAE,GAAGR,WAAW,CAACS,UAAU,CAAC;EAClC,MAAMM,QAAQ,GAAI,GAAEP,EAAG,SAAQ;EAC/B,MAAMQ,SAAS,GAAI,GAAER,EAAG,UAAS;EACjC,OACEJ,KAAA,CAAAa,UAAA;IACEC,eAAe,EAAER,iBAAkB;IACnCS,QAAQ,EAAER,UAAW;IACrBS,cAAc;IACdC,QAAQ,EAAET,UAAW;IACrBC,QAAQ,EAAEA,QAAS;IAAAP,QAAA,GAEnBJ,IAAA,CAAAoB,iBAAA;MACE,iBAAeN,SAAU;MACzBO,UAAU,EAAErB,IAAA,CAACJ,eAAe,IAAE,CAAE;MAChCU,EAAE,EAAEO,QAAS;MAAAT,QAAA,EAEbJ,IAAA,CAACH,OAAO;QAACyB,SAAS,EAAC,KAAK;QAACV,SAAS,EAAEA,SAAU;QAAAR,QAAA,EAC3CC;MAAK,CACC;IAAC,CACS,CAAC,EACtBL,IAAA,CAAAuB,iBAAA;MAAqB,mBAAiBV,QAAS;MAAAT,QAAA,EAC5CA;IAAQ,CACU,CAAC;EAAA,CACV,CAAC;AAEnB,CAAC;AAED,MAAMoB,iBAAiB,GAAG7B,IAAI,CAACQ,SAAS,CAAC;AACzCqB,iBAAiB,CAACC,WAAW,GAAG,WAAW;AAE3C,SAASD,iBAAiB,IAAIrB,SAAS"}
1
+ {"version":3,"file":"Accordion.js","names":["memo","ChevronDownIcon","Support","useUniqueId","jsx","_jsx","jsxs","_jsxs","Accordion","children","label","id","idOverride","isDefaultExpanded","isDisabled","isExpanded","onChange","translate","headerId","contentId","_Accordion","defaultExpanded","disabled","disableGutters","expanded","_AccordionSummary","expandIcon","component","_AccordionDetails","MemoizedAccordion","displayName"],"sources":["../src/Accordion.tsx"],"sourcesContent":["/*!\n * Copyright (c) 2023-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *\n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport { ReactNode, memo } from \"react\";\nimport type { HtmlProps } from \"./HtmlProps\";\nimport {\n Accordion as MuiAccordion,\n AccordionDetails as MuiAccordionDetails,\n AccordionSummary as MuiAccordionSummary,\n AccordionProps as MuiAccordionProps,\n} from \"@mui/material\";\nimport { ChevronDownIcon } from \"./icons.generated\";\nimport { Support } from \"./Typography\";\nimport { useUniqueId } from \"./useUniqueId\";\n\nexport type AccordionProps = {\n /**\n * The content of the Accordion itself\n */\n children: ReactNode;\n /**\n * Defines IDs for the header and the content of the Accordion\n */\n id?: string;\n /**\n * The label text for the AccordionSummary\n */\n label: string;\n /**\n * Whether the item is expanded by default\n */\n isDefaultExpanded?: boolean;\n /**\n * Whether the item is disabled\n */\n isDisabled?: boolean;\n /**\n * Whether the item is expanded\n */\n isExpanded?: boolean;\n /**\n * Event fired when the expansion state of the accordion is changed\n */\n onChange?: MuiAccordionProps[\"onChange\"];\n} & (\n | {\n isExpanded: boolean;\n isDefaultExpanded?: never;\n }\n | {\n isDefaultExpanded?: boolean;\n isExpanded?: never;\n }\n) &\n Pick<HtmlProps, \"testId\" | \"translate\">;\n\nconst Accordion = ({\n children,\n label,\n id: idOverride,\n isDefaultExpanded,\n isDisabled,\n isExpanded,\n onChange,\n translate,\n}: AccordionProps) => {\n const id = useUniqueId(idOverride);\n const headerId = `${id}-header`;\n const contentId = `${id}-content`;\n return (\n <MuiAccordion\n defaultExpanded={isDefaultExpanded}\n disabled={isDisabled}\n disableGutters\n expanded={isExpanded}\n onChange={onChange}\n >\n <MuiAccordionSummary\n aria-controls={contentId}\n expandIcon={<ChevronDownIcon />}\n id={headerId}\n >\n <Support component=\"div\" translate={translate}>\n {label}\n </Support>\n </MuiAccordionSummary>\n <MuiAccordionDetails aria-labelledby={headerId}>\n {children}\n </MuiAccordionDetails>\n </MuiAccordion>\n );\n};\n\nconst MemoizedAccordion = memo(Accordion);\nMemoizedAccordion.displayName = \"Accordion\";\n\nexport { MemoizedAccordion as Accordion };\n"],"mappings":";;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAAoBA,IAAI,QAAQ,OAAO;AAAC,SAQ/BC,eAAe;AAAA,SACfC,OAAO;AAAA,SACPC,WAAW;AAAA,SAAAC,GAAA,IAAAC,IAAA;AAAA,SAAAC,IAAA,IAAAC,KAAA;AA2CpB,MAAMC,SAAS,GAAGA,CAAC;EACjBC,QAAQ;EACRC,KAAK;EACLC,EAAE,EAAEC,UAAU;EACdC,iBAAiB;EACjBC,UAAU;EACVC,UAAU;EACVC,QAAQ;EACRC;AACc,CAAC,KAAK;EACpB,MAAMN,EAAE,GAAGR,WAAW,CAACS,UAAU,CAAC;EAClC,MAAMM,QAAQ,GAAI,GAAEP,EAAG,SAAQ;EAC/B,MAAMQ,SAAS,GAAI,GAAER,EAAG,UAAS;EACjC,OACEJ,KAAA,CAAAa,UAAA;IACEC,eAAe,EAAER,iBAAkB;IACnCS,QAAQ,EAAER,UAAW;IACrBS,cAAc;IACdC,QAAQ,EAAET,UAAW;IACrBC,QAAQ,EAAEA,QAAS;IAAAP,QAAA,GAEnBJ,IAAA,CAAAoB,iBAAA;MACE,iBAAeN,SAAU;MACzBO,UAAU,EAAErB,IAAA,CAACJ,eAAe,IAAE,CAAE;MAChCU,EAAE,EAAEO,QAAS;MAAAT,QAAA,EAEbJ,IAAA,CAACH,OAAO;QAACyB,SAAS,EAAC,KAAK;QAACV,SAAS,EAAEA,SAAU;QAAAR,QAAA,EAC3CC;MAAK,CACC;IAAC,CACS,CAAC,EACtBL,IAAA,CAAAuB,iBAAA;MAAqB,mBAAiBV,QAAS;MAAAT,QAAA,EAC5CA;IAAQ,CACU,CAAC;EAAA,CACV,CAAC;AAEnB,CAAC;AAED,MAAMoB,iBAAiB,GAAG7B,IAAI,CAACQ,SAAS,CAAC;AACzCqB,iBAAiB,CAACC,WAAW,GAAG,WAAW;AAE3C,SAASD,iBAAiB,IAAIrB,SAAS"}
@@ -1 +1 @@
1
- {"version":3,"file":"Autocomplete.js","names":["memo","useCallback","useMemo","useRef","Field","ComponentControlledState","useInputValues","getControlState","jsx","_jsx","Autocomplete","ariaDescribedBy","defaultValue","errorMessage","errorMessageList","hasMultipleChoices","id","idOverride","inputValue","isCustomValueAllowed","isDisabled","isFullWidth","isLoading","isOptional","isReadOnly","hint","HintLinkComponent","label","name","nameOverride","onBlur","onChange","onChangeProp","onInputChange","onInputChangeProp","onFocus","options","value","getIsOptionEqualToValue","testId","translate","controlledStateRef","controlledValue","uncontrolledValue","defaultValueProp","undefined","valueProps","controlState","current","inputValueProp","CONTROLLED","renderInput","InputLabelProps","InputProps","params","fieldType","hasVisibleLabel","htmlFor","renderFieldComponent","errorMessageElementId","labelElementId","_InputBase","inputProps","required","event","reason","details","_Autocomplete","disableCloseOnSelect","disabled","freeSolo","filterSelectedOptions","fullWidth","loading","multiple","readOnly","isOptionEqualToValue","MemoizedAutocomplete","displayName"],"sources":["../src/Autocomplete.tsx"],"sourcesContent":["/*!\n * Copyright (c) 2023-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *\n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport {\n Autocomplete as MuiAutocomplete,\n AutocompleteProps as MuiAutocompleteProps,\n InputBase,\n UseAutocompleteProps,\n AutocompleteValue,\n} from \"@mui/material\";\nimport { memo, useCallback, useMemo, useRef } from \"react\";\n\nimport { Field } from \"./Field\";\nimport { FieldComponentProps } from \"./FieldComponentProps\";\nimport type { HtmlProps } from \"./HtmlProps\";\nimport {\n ComponentControlledState,\n useInputValues,\n getControlState,\n} from \"./inputUtils\";\n\nexport type AutocompleteProps<\n OptionType,\n HasMultipleChoices extends boolean | undefined,\n IsCustomValueAllowed extends boolean | undefined\n> = {\n /**\n * The default value. Use when the component is not controlled.\n */\n defaultValue?: UseAutocompleteProps<\n OptionType,\n HasMultipleChoices,\n undefined,\n IsCustomValueAllowed\n >[\"defaultValue\"];\n /**\n * Enables multiple choice selection\n */\n hasMultipleChoices?: MuiAutocompleteProps<\n OptionType,\n HasMultipleChoices,\n undefined,\n IsCustomValueAllowed\n >[\"multiple\"];\n /**\n * The value for the input\n */\n inputValue?: UseAutocompleteProps<\n OptionType,\n HasMultipleChoices,\n undefined,\n IsCustomValueAllowed\n >[\"inputValue\"];\n /**\n * Allows the input of custom values\n */\n isCustomValueAllowed?: MuiAutocompleteProps<\n OptionType,\n HasMultipleChoices,\n undefined,\n IsCustomValueAllowed\n >[\"freeSolo\"];\n /**\n * Disables the Autocomplete input\n */\n isDisabled?: MuiAutocompleteProps<\n OptionType,\n HasMultipleChoices,\n undefined,\n IsCustomValueAllowed\n >[\"disabled\"];\n /**\n * Displays a loading indicator\n */\n isLoading?: MuiAutocompleteProps<\n OptionType,\n HasMultipleChoices,\n undefined,\n IsCustomValueAllowed\n >[\"loading\"];\n /**\n * Makes the Autocomplete input read-only\n */\n isReadOnly?: MuiAutocompleteProps<\n OptionType,\n HasMultipleChoices,\n undefined,\n IsCustomValueAllowed\n >[\"readOnly\"];\n /**\n * The label text for the autocomplete input\n */\n label: string;\n /**\n * Callback fired when the autocomplete loses focus.\n */\n onBlur?: MuiAutocompleteProps<\n OptionType,\n HasMultipleChoices,\n undefined,\n IsCustomValueAllowed\n >[\"onBlur\"];\n /**\n * Callback fired when a selection is made.\n */\n onChange?: UseAutocompleteProps<\n OptionType,\n HasMultipleChoices,\n undefined,\n IsCustomValueAllowed\n >[\"onChange\"];\n /**\n * Callback fired when the textbox receives typed characters.\n */\n onInputChange?: MuiAutocompleteProps<\n OptionType,\n HasMultipleChoices,\n undefined,\n IsCustomValueAllowed\n >[\"onInputChange\"];\n /**\n * Callback fired when the autocomplete gains focus.\n */\n onFocus?: MuiAutocompleteProps<\n OptionType,\n HasMultipleChoices,\n undefined,\n IsCustomValueAllowed\n >[\"onFocus\"];\n /**\n * The options for the Autocomplete input\n */\n options: ReadonlyArray<OptionType>;\n /**\n * The value of the Autocomplete input\n */\n value?: UseAutocompleteProps<\n OptionType,\n HasMultipleChoices,\n undefined,\n IsCustomValueAllowed\n >[\"value\"];\n\n /**\n * Used to determine if the option represents the given value. Uses strict equality by default if none provided.\n * Both arguments need to be handled, an option can only match with one value.\n * option: the option to test\n * value: the value to test against\n *\n * You will need to implement this function if your `option` items are objects.\n */\n getIsOptionEqualToValue?: (option: OptionType, value: OptionType) => boolean;\n} & Pick<\n FieldComponentProps,\n | \"ariaDescribedBy\"\n | \"errorMessage\"\n | \"errorMessageList\"\n | \"hint\"\n | \"HintLinkComponent\"\n | \"id\"\n | \"isFullWidth\"\n | \"isOptional\"\n | \"name\"\n> &\n HtmlProps;\n\nconst Autocomplete = <\n OptionType,\n HasMultipleChoices extends boolean | undefined,\n IsCustomValueAllowed extends boolean | undefined\n>({\n ariaDescribedBy,\n defaultValue,\n errorMessage,\n errorMessageList,\n hasMultipleChoices,\n id: idOverride,\n inputValue,\n isCustomValueAllowed,\n isDisabled,\n isFullWidth = false,\n isLoading,\n isOptional = false,\n isReadOnly,\n hint,\n HintLinkComponent,\n label,\n name: nameOverride,\n onBlur,\n onChange: onChangeProp,\n onInputChange: onInputChangeProp,\n onFocus,\n options,\n value,\n getIsOptionEqualToValue,\n testId,\n translate,\n}: AutocompleteProps<OptionType, HasMultipleChoices, IsCustomValueAllowed>) => {\n const controlledStateRef = useRef(\n getControlState({ controlledValue: value, uncontrolledValue: defaultValue })\n );\n const defaultValueProp = useMemo<\n | AutocompleteValue<\n OptionType,\n HasMultipleChoices,\n undefined,\n IsCustomValueAllowed\n >\n | undefined\n >(() => {\n if (hasMultipleChoices) {\n if (value === undefined) {\n return defaultValue;\n }\n return [] as AutocompleteValue<\n OptionType,\n HasMultipleChoices,\n undefined,\n IsCustomValueAllowed\n >;\n }\n return value === undefined ? defaultValue : undefined;\n }, [defaultValue, hasMultipleChoices, value]);\n\n const valueProps = useInputValues({\n defaultValue: defaultValueProp,\n value: value,\n controlState: controlledStateRef.current,\n });\n\n const inputValueProp = useMemo(() => {\n if (controlledStateRef.current === ComponentControlledState.CONTROLLED) {\n return { inputValue };\n }\n return undefined;\n }, [inputValue]);\n\n const renderInput = useCallback(\n ({ InputLabelProps, InputProps, ...params }) => (\n <Field\n ariaDescribedBy={ariaDescribedBy}\n errorMessage={errorMessage}\n errorMessageList={errorMessageList}\n fieldType=\"single\"\n hasVisibleLabel\n id={InputLabelProps.htmlFor}\n hint={hint}\n HintLinkComponent={HintLinkComponent}\n label={label}\n isOptional={isOptional}\n renderFieldComponent={({\n ariaDescribedBy,\n id,\n errorMessageElementId,\n labelElementId,\n }) => (\n <InputBase\n {...params}\n {...InputProps}\n inputProps={{\n ...params.inputProps,\n \"aria-errormessage\": errorMessageElementId,\n \"aria-labelledby\": labelElementId,\n \"data-se\": testId,\n }}\n aria-describedby={ariaDescribedBy}\n id={id}\n name={nameOverride ?? id}\n required={!isOptional}\n />\n )}\n />\n ),\n [\n ariaDescribedBy,\n errorMessage,\n errorMessageList,\n hint,\n HintLinkComponent,\n isOptional,\n label,\n nameOverride,\n testId,\n ]\n );\n const onChange = useCallback<\n NonNullable<\n UseAutocompleteProps<\n OptionType,\n HasMultipleChoices,\n undefined,\n IsCustomValueAllowed\n >[\"onChange\"]\n >\n >(\n (event, value, reason, details) => {\n onChangeProp?.(event, value, reason, details);\n },\n [onChangeProp]\n );\n\n const onInputChange = useCallback<\n NonNullable<\n UseAutocompleteProps<\n OptionType,\n HasMultipleChoices,\n undefined,\n IsCustomValueAllowed\n >[\"onInputChange\"]\n >\n >(\n (event, value, reason) => {\n onInputChangeProp?.(event, value, reason);\n },\n [onInputChangeProp]\n );\n\n return (\n <MuiAutocomplete\n {...valueProps}\n {...inputValueProp}\n // AutoComplete is wrapped in a div within MUI which does not get the disabled attr. So this aria-disabled gets set in the div\n aria-disabled={isDisabled}\n disableCloseOnSelect={hasMultipleChoices}\n disabled={isDisabled}\n freeSolo={isCustomValueAllowed}\n filterSelectedOptions={true}\n id={idOverride}\n fullWidth={isFullWidth}\n loading={isLoading}\n multiple={hasMultipleChoices}\n onBlur={onBlur}\n onChange={onChange}\n onInputChange={onInputChange}\n onFocus={onFocus}\n options={options}\n readOnly={isReadOnly}\n renderInput={renderInput}\n isOptionEqualToValue={getIsOptionEqualToValue}\n translate={translate}\n />\n );\n};\n\n// Need the `typeof Autocomplete` because generics don't get passed through\nconst MemoizedAutocomplete = memo(Autocomplete) as typeof Autocomplete;\n// @ts-expect-error displayName is expected to not be on `typeof Autocomplete`\nMemoizedAutocomplete.displayName = \"Autocomplete\";\n\nexport { MemoizedAutocomplete as Autocomplete };\n"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AASA,SAASA,IAAI,EAAEC,WAAW,EAAEC,OAAO,EAAEC,MAAM,QAAQ,OAAO;AAAC,SAElDC,KAAK;AAAA,SAIZC,wBAAwB,EACxBC,cAAc,EACdC,eAAe;AAAA,SAAAC,GAAA,IAAAC,IAAA;AAoJjB,MAAMC,YAAY,GAAGA,CAInB;EAC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,CAU/B,CAAC+D,KAAK,EAAE3B,KAAK,EAAE4B,MAAM,KAAK;IACxB/B,iBAAiB,GAAG8B,KAAK,EAAE3B,KAAK,EAAE4B,MAAM,CAAC;EAC3C,CAAC,EACD,CAAC/B,iBAAiB,CACpB,CAAC;EAED,OACEzB,IAAA,CAAA0D,aAAA;IAAA,GACMrB,UAAU;IAAA,GACVG,cAAc;IAElB,iBAAe7B,UAAW;IAC1BgD,oBAAoB,EAAErD,kBAAmB;IACzCsD,QAAQ,EAAEjD,UAAW;IACrBkD,QAAQ,EAAEnD,oBAAqB;IAC/BoD,qBAAqB,EAAE,IAAK;IAC5BvD,EAAE,EAAEC,UAAW;IACfuD,SAAS,EAAEnD,WAAY;IACvBoD,OAAO,EAAEnD,SAAU;IACnBoD,QAAQ,EAAE3D,kBAAmB;IAC7Be,MAAM,EAAEA,MAAO;IACfC,QAAQ,EAAEA,QAAS;IACnBE,aAAa,EAAEA,aAAc;IAC7BE,OAAO,EAAEA,OAAQ;IACjBC,OAAO,EAAEA,OAAQ;IACjBuC,QAAQ,EAAEnD,UAAW;IACrB2B,WAAW,EAAEA,WAAY;IACzByB,oBAAoB,EAAEtC,uBAAwB;IAC9CE,SAAS,EAAEA;EAAU,CACtB,CAAC;AAEN,CAAC;AAGD,MAAMqC,oBAAoB,GAAG7E,IAAI,CAACU,YAAY,CAAwB;AAEtEmE,oBAAoB,CAACC,WAAW,GAAG,cAAc;AAEjD,SAASD,oBAAoB,IAAInE,YAAY"}
1
+ {"version":3,"file":"Autocomplete.js","names":["memo","useCallback","useMemo","useRef","Field","ComponentControlledState","useInputValues","getControlState","jsx","_jsx","Autocomplete","ariaDescribedBy","defaultValue","errorMessage","errorMessageList","hasMultipleChoices","id","idOverride","inputValue","isCustomValueAllowed","isDisabled","isFullWidth","isLoading","isOptional","isReadOnly","hint","HintLinkComponent","label","name","nameOverride","onBlur","onChange","onChangeProp","onInputChange","onInputChangeProp","onFocus","options","value","getIsOptionEqualToValue","testId","translate","controlledStateRef","controlledValue","uncontrolledValue","defaultValueProp","undefined","valueProps","controlState","current","inputValueProp","CONTROLLED","renderInput","InputLabelProps","InputProps","params","fieldType","hasVisibleLabel","htmlFor","renderFieldComponent","errorMessageElementId","labelElementId","_InputBase","inputProps","required","event","reason","details","_Autocomplete","disableCloseOnSelect","disabled","freeSolo","filterSelectedOptions","fullWidth","loading","multiple","readOnly","isOptionEqualToValue","MemoizedAutocomplete","displayName"],"sources":["../src/Autocomplete.tsx"],"sourcesContent":["/*!\n * Copyright (c) 2023-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *\n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport {\n Autocomplete as MuiAutocomplete,\n AutocompleteProps as MuiAutocompleteProps,\n InputBase,\n UseAutocompleteProps,\n AutocompleteValue,\n AutocompleteRenderInputParams,\n} from \"@mui/material\";\nimport { memo, useCallback, useMemo, useRef } from \"react\";\n\nimport { Field } from \"./Field\";\nimport { FieldComponentProps } from \"./FieldComponentProps\";\nimport type { HtmlProps } from \"./HtmlProps\";\nimport {\n ComponentControlledState,\n useInputValues,\n getControlState,\n} from \"./inputUtils\";\n\nexport type AutocompleteProps<\n OptionType,\n HasMultipleChoices extends boolean | undefined,\n IsCustomValueAllowed extends boolean | undefined,\n> = {\n /**\n * The default value. Use when the component is not controlled.\n */\n defaultValue?: UseAutocompleteProps<\n OptionType,\n HasMultipleChoices,\n undefined,\n IsCustomValueAllowed\n >[\"defaultValue\"];\n /**\n * Enables multiple choice selection\n */\n hasMultipleChoices?: MuiAutocompleteProps<\n OptionType,\n HasMultipleChoices,\n undefined,\n IsCustomValueAllowed\n >[\"multiple\"];\n /**\n * The value for the input\n */\n inputValue?: UseAutocompleteProps<\n OptionType,\n HasMultipleChoices,\n undefined,\n IsCustomValueAllowed\n >[\"inputValue\"];\n /**\n * Allows the input of custom values\n */\n isCustomValueAllowed?: MuiAutocompleteProps<\n OptionType,\n HasMultipleChoices,\n undefined,\n IsCustomValueAllowed\n >[\"freeSolo\"];\n /**\n * Disables the Autocomplete input\n */\n isDisabled?: MuiAutocompleteProps<\n OptionType,\n HasMultipleChoices,\n undefined,\n IsCustomValueAllowed\n >[\"disabled\"];\n /**\n * Displays a loading indicator\n */\n isLoading?: MuiAutocompleteProps<\n OptionType,\n HasMultipleChoices,\n undefined,\n IsCustomValueAllowed\n >[\"loading\"];\n /**\n * Makes the Autocomplete input read-only\n */\n isReadOnly?: MuiAutocompleteProps<\n OptionType,\n HasMultipleChoices,\n undefined,\n IsCustomValueAllowed\n >[\"readOnly\"];\n /**\n * The label text for the autocomplete input\n */\n label: string;\n /**\n * Callback fired when the autocomplete loses focus.\n */\n onBlur?: MuiAutocompleteProps<\n OptionType,\n HasMultipleChoices,\n undefined,\n IsCustomValueAllowed\n >[\"onBlur\"];\n /**\n * Callback fired when a selection is made.\n */\n onChange?: UseAutocompleteProps<\n OptionType,\n HasMultipleChoices,\n undefined,\n IsCustomValueAllowed\n >[\"onChange\"];\n /**\n * Callback fired when the textbox receives typed characters.\n */\n onInputChange?: MuiAutocompleteProps<\n OptionType,\n HasMultipleChoices,\n undefined,\n IsCustomValueAllowed\n >[\"onInputChange\"];\n /**\n * Callback fired when the autocomplete gains focus.\n */\n onFocus?: MuiAutocompleteProps<\n OptionType,\n HasMultipleChoices,\n undefined,\n IsCustomValueAllowed\n >[\"onFocus\"];\n /**\n * The options for the Autocomplete input\n */\n options: ReadonlyArray<OptionType>;\n /**\n * The value of the Autocomplete input\n */\n value?: UseAutocompleteProps<\n OptionType,\n HasMultipleChoices,\n undefined,\n IsCustomValueAllowed\n >[\"value\"];\n\n /**\n * Used to determine if the option represents the given value. Uses strict equality by default if none provided.\n * Both arguments need to be handled, an option can only match with one value.\n * option: the option to test\n * value: the value to test against\n *\n * You will need to implement this function if your `option` items are objects.\n */\n getIsOptionEqualToValue?: (option: OptionType, value: OptionType) => boolean;\n} & Pick<\n FieldComponentProps,\n | \"errorMessage\"\n | \"errorMessageList\"\n | \"hint\"\n | \"HintLinkComponent\"\n | \"id\"\n | \"isFullWidth\"\n | \"isOptional\"\n | \"name\"\n> &\n Pick<HtmlProps, \"ariaDescribedBy\" | \"testId\" | \"translate\">;\n\nconst Autocomplete = <\n OptionType,\n HasMultipleChoices extends boolean | undefined,\n IsCustomValueAllowed extends boolean | undefined,\n>({\n ariaDescribedBy,\n defaultValue,\n errorMessage,\n errorMessageList,\n hasMultipleChoices,\n id: idOverride,\n inputValue,\n isCustomValueAllowed,\n isDisabled,\n isFullWidth = false,\n isLoading,\n isOptional = false,\n isReadOnly,\n hint,\n HintLinkComponent,\n label,\n name: nameOverride,\n onBlur,\n onChange: onChangeProp,\n onInputChange: onInputChangeProp,\n onFocus,\n options,\n value,\n getIsOptionEqualToValue,\n testId,\n translate,\n}: AutocompleteProps<OptionType, HasMultipleChoices, IsCustomValueAllowed>) => {\n const controlledStateRef = useRef(\n getControlState({\n controlledValue: value,\n uncontrolledValue: defaultValue,\n }),\n );\n const defaultValueProp = useMemo<\n | AutocompleteValue<\n OptionType,\n HasMultipleChoices,\n undefined,\n IsCustomValueAllowed\n >\n | undefined\n >(() => {\n if (hasMultipleChoices) {\n if (value === undefined) {\n return defaultValue;\n }\n return [] as AutocompleteValue<\n OptionType,\n HasMultipleChoices,\n undefined,\n IsCustomValueAllowed\n >;\n }\n return value === undefined ? defaultValue : undefined;\n }, [defaultValue, hasMultipleChoices, value]);\n\n const valueProps = useInputValues({\n defaultValue: defaultValueProp,\n value: value,\n controlState: controlledStateRef.current,\n });\n\n const inputValueProp = useMemo(() => {\n if (controlledStateRef.current === ComponentControlledState.CONTROLLED) {\n return { inputValue };\n }\n return undefined;\n }, [inputValue]);\n\n const renderInput = useCallback(\n ({\n InputLabelProps,\n InputProps,\n ...params\n }: AutocompleteRenderInputParams) => (\n <Field\n ariaDescribedBy={ariaDescribedBy}\n errorMessage={errorMessage}\n errorMessageList={errorMessageList}\n fieldType=\"single\"\n hasVisibleLabel\n //@ts-expect-error htmlFor does not exist ont he InputLabelProps for autocomplete\n id={InputLabelProps.htmlFor}\n hint={hint}\n HintLinkComponent={HintLinkComponent}\n label={label}\n isOptional={isOptional}\n renderFieldComponent={({\n ariaDescribedBy,\n id,\n errorMessageElementId,\n labelElementId,\n }) => (\n <InputBase\n {...params}\n {...InputProps}\n inputProps={{\n ...params.inputProps,\n \"aria-errormessage\": errorMessageElementId,\n \"aria-labelledby\": labelElementId,\n \"data-se\": testId,\n }}\n aria-describedby={ariaDescribedBy}\n id={id}\n name={nameOverride ?? id}\n required={!isOptional}\n />\n )}\n />\n ),\n [\n ariaDescribedBy,\n errorMessage,\n errorMessageList,\n hint,\n HintLinkComponent,\n isOptional,\n label,\n nameOverride,\n testId,\n ],\n );\n const onChange = useCallback<\n NonNullable<\n UseAutocompleteProps<\n OptionType,\n HasMultipleChoices,\n undefined,\n IsCustomValueAllowed\n >[\"onChange\"]\n >\n >(\n (event, value, reason, details) => {\n onChangeProp?.(event, value, reason, details);\n },\n [onChangeProp],\n );\n\n const onInputChange = useCallback<\n NonNullable<\n UseAutocompleteProps<\n OptionType,\n HasMultipleChoices,\n undefined,\n IsCustomValueAllowed\n >[\"onInputChange\"]\n >\n >(\n (event, value, reason) => {\n onInputChangeProp?.(event, value, reason);\n },\n [onInputChangeProp],\n );\n\n return (\n <MuiAutocomplete\n {...valueProps}\n {...inputValueProp}\n // AutoComplete is wrapped in a div within MUI which does not get the disabled attr. So this aria-disabled gets set in the div\n aria-disabled={isDisabled}\n disableCloseOnSelect={hasMultipleChoices}\n disabled={isDisabled}\n freeSolo={isCustomValueAllowed}\n filterSelectedOptions={true}\n id={idOverride}\n fullWidth={isFullWidth}\n loading={isLoading}\n multiple={hasMultipleChoices}\n onBlur={onBlur}\n onChange={onChange}\n onInputChange={onInputChange}\n onFocus={onFocus}\n options={options}\n readOnly={isReadOnly}\n renderInput={renderInput}\n isOptionEqualToValue={getIsOptionEqualToValue}\n translate={translate}\n />\n );\n};\n\n// Need the `typeof Autocomplete` because generics don't get passed through\nconst MemoizedAutocomplete = memo(Autocomplete) as typeof Autocomplete;\n// @ts-expect-error displayName is expected to not be on `typeof Autocomplete`\nMemoizedAutocomplete.displayName = \"Autocomplete\";\n\nexport { MemoizedAutocomplete as Autocomplete };\n"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAUA,SAASA,IAAI,EAAEC,WAAW,EAAEC,OAAO,EAAEC,MAAM,QAAQ,OAAO;AAAC,SAElDC,KAAK;AAAA,SAIZC,wBAAwB,EACxBC,cAAc,EACdC,eAAe;AAAA,SAAAC,GAAA,IAAAC,IAAA;AAmJjB,MAAMC,YAAY,GAAGA,CAInB;EACAC,eAAe;EACfC,YAAY;EACZC,YAAY;EACZC,gBAAgB;EAChBC,kBAAkB;EAClBC,EAAE,EAAEC,UAAU;EACdC,UAAU;EACVC,oBAAoB;EACpBC,UAAU;EACVC,WAAW,GAAG,KAAK;EACnBC,SAAS;EACTC,UAAU,GAAG,KAAK;EAClBC,UAAU;EACVC,IAAI;EACJC,iBAAiB;EACjBC,KAAK;EACLC,IAAI,EAAEC,YAAY;EAClBC,MAAM;EACNC,QAAQ,EAAEC,YAAY;EACtBC,aAAa,EAAEC,iBAAiB;EAChCC,OAAO;EACPC,OAAO;EACPC,KAAK;EACLC,uBAAuB;EACvBC,MAAM;EACNC;AACuE,CAAC,KAAK;EAC7E,MAAMC,kBAAkB,GAAGtC,MAAM,CAC/BI,eAAe,CAAC;IACdmC,eAAe,EAAEL,KAAK;IACtBM,iBAAiB,EAAE/B;EACrB,CAAC,CACH,CAAC;EACD,MAAMgC,gBAAgB,GAAG1C,OAAO,CAQ9B,MAAM;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Q;IACjBC,OAAO,EAAEA,OAAQ;IACjBuC,QAAQ,EAAEnD,UAAW;IACrB2B,WAAW,EAAEA,WAAY;IACzByB,oBAAoB,EAAEtC,uBAAwB;IAC9CE,SAAS,EAAEA;EAAU,CACtB,CAAC;AAEN,CAAC;AAGD,MAAMqC,oBAAoB,GAAG7E,IAAI,CAACU,YAAY,CAAwB;AAEtEmE,oBAAoB,CAACC,WAAW,GAAG,cAAc;AAEjD,SAASD,oBAAoB,IAAInE,YAAY"}
package/dist/Badge.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"Badge.js","names":["memo","useMemo","useOdysseyDesignTokens","Box","jsx","_jsx","badgeTypeValues","badgeTypeColors","odysseyTokens","default","background","HueNeutral200","font","TypographyColorBody","attention","PalettePrimaryMain","TypographyColorInverse","danger","PaletteDangerMain","Badge","badgeContent","badgeContentMax","testId","translate","type","odysseyDesignTokens","renderBadge","greaterThanZeroContentMax","threeDigitLimitedMax","isOverContentMax","overContentMaxMessage","formattedContent","toString","badgeStyles","display","alignItems","justifyContent","minWidth","Spacing4","Spacing1","height","minHeight","padding","backgroundColor","color","borderRadius","length","BorderRadiusOuter","fontSize","TypographyScale0","fontFamily","TypographyFamilyMono","fontWeight","TypographyWeightBodyBold","lineHeight","transitionDuration","TransitionDurationMain","transitionProperty","hasNotificationCount","sx","children","MemoizedBadge","displayName"],"sources":["../src/Badge.tsx"],"sourcesContent":["/*!\n * Copyright (c) 2023-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *\n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport { CSSProperties, memo, useMemo } from \"react\";\n\nimport {\n useOdysseyDesignTokens,\n DesignTokens,\n} from \"./OdysseyDesignTokensContext\";\nimport { Box } from \"./Box\";\nimport type { HtmlProps } from \"./HtmlProps\";\n\nexport type BadgeContentMax = 10 | 20 | 30 | 40 | 50 | 60 | 70 | 80 | 90 | 100;\n\nexport const badgeTypeValues = [\"default\", \"attention\", \"danger\"] as const;\n\nexport type BadgeProps = {\n badgeContent: number;\n badgeContentMax?: BadgeContentMax;\n type?: (typeof badgeTypeValues)[number];\n} & HtmlProps;\n\nconst badgeTypeColors = (odysseyTokens: DesignTokens) => ({\n default: {\n background: odysseyTokens.HueNeutral200,\n font: odysseyTokens.TypographyColorBody,\n },\n attention: {\n background: odysseyTokens.PalettePrimaryMain,\n font: odysseyTokens.TypographyColorInverse,\n },\n danger: {\n background: odysseyTokens.PaletteDangerMain,\n font: odysseyTokens.TypographyColorInverse,\n },\n});\n\nconst Badge = ({\n badgeContent,\n badgeContentMax = 100,\n testId,\n translate,\n type = \"default\",\n}: BadgeProps) => {\n const odysseyDesignTokens = useOdysseyDesignTokens();\n\n const renderBadge = useMemo(() => {\n const greaterThanZeroContentMax = badgeContentMax > 0 ? badgeContentMax : 1;\n const threeDigitLimitedMax =\n greaterThanZeroContentMax > 999 ? 999 : greaterThanZeroContentMax;\n const isOverContentMax = badgeContent > threeDigitLimitedMax;\n const overContentMaxMessage = `${greaterThanZeroContentMax}+`;\n const formattedContent = isOverContentMax\n ? overContentMaxMessage\n : badgeContent.toString();\n\n const badgeStyles: CSSProperties = {\n display: \"inline-flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n minWidth: `calc(${odysseyDesignTokens.Spacing4} + ${odysseyDesignTokens.Spacing1})`,\n height: `calc(${odysseyDesignTokens.Spacing4} + ${odysseyDesignTokens.Spacing1})`,\n minHeight: `calc(${odysseyDesignTokens.Spacing4} + ${odysseyDesignTokens.Spacing1})`,\n // 6px horizontal padding per design requirements\n padding: \"0 6px\",\n backgroundColor: badgeTypeColors(odysseyDesignTokens)[type].background,\n color: badgeTypeColors(odysseyDesignTokens)[type].font,\n borderRadius:\n formattedContent.length > 1\n ? `${odysseyDesignTokens.BorderRadiusOuter}`\n : \"50%\",\n fontSize: `${odysseyDesignTokens.TypographyScale0}`,\n fontFamily: `${odysseyDesignTokens.TypographyFamilyMono}`,\n fontWeight: `${odysseyDesignTokens.TypographyWeightBodyBold}`,\n lineHeight: 1,\n transitionDuration: `${odysseyDesignTokens.TransitionDurationMain}`,\n transitionProperty: `background-color, color`,\n };\n\n const hasNotificationCount = badgeContent && badgeContent > 0;\n\n return hasNotificationCount ? (\n <Box sx={badgeStyles} data-se={testId} translate={translate}>\n {formattedContent}\n </Box>\n ) : null;\n }, [\n badgeContent,\n badgeContentMax,\n odysseyDesignTokens,\n testId,\n translate,\n type,\n ]);\n\n return renderBadge;\n};\n\nconst MemoizedBadge = memo(Badge);\nMemoizedBadge.displayName = \"Badge\";\n\nexport { MemoizedBadge as Badge };\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAAwBA,IAAI,EAAEC,OAAO,QAAQ,OAAO;AAAC,SAGnDC,sBAAsB;AAAA,SAGfC,GAAG;AAAA,SAAAC,GAAA,IAAAC,IAAA;AAKZ,OAAO,MAAMC,eAAe,GAAG,CAAC,SAAS,EAAE,WAAW,EAAE,QAAQ,CAAU;AAQ1E,MAAMC,eAAe,GAAIC,aAA2B,KAAM;EACxDC,OAAO,EAAE;IACPC,UAAU,EAAEF,aAAa,CAACG,aAAa;IACvCC,IAAI,EAAEJ,aAAa,CAACK;EACtB,CAAC;EACDC,SAAS,EAAE;IACTJ,UAAU,EAAEF,aAAa,CAACO,kBAAkB;IAC5CH,IAAI,EAAEJ,aAAa,CAACQ;EACtB,CAAC;EACDC,MAAM,EAAE;IACNP,UAAU,EAAEF,aAAa,CAACU,iBAAiB;IAC3CN,IAAI,EAAEJ,aAAa,CAACQ;EACtB;AACF,CAAC,CAAC;AAEF,MAAMG,KAAK,GAAGA,CA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,gBAAiB,EAAC;MACnDC,UAAU,EAAG,GAAEzB,mBAAmB,CAAC0B,oBAAqB,EAAC;MACzDC,UAAU,EAAG,GAAE3B,mBAAmB,CAAC4B,wBAAyB,EAAC;MAC7DC,UAAU,EAAE,CAAC;MACbC,kBAAkB,EAAG,GAAE9B,mBAAmB,CAAC+B,sBAAuB,EAAC;MACnEC,kBAAkB,EAAG;IACvB,CAAC;IAED,MAAMC,oBAAoB,GAAGtC,YAAY,IAAIA,YAAY,GAAG,CAAC;IAE7D,OAAOsC,oBAAoB,GACzBrD,IAAA,CAACF,GAAG;MAACwD,EAAE,EAAE1B,WAAY;MAAC,WAASX,MAAO;MAACC,SAAS,EAAEA,SAAU;MAAAqC,QAAA,EACzD7B;IAAgB,CACd,CAAC,GACJ,IAAI;EACV,CAAC,EAAE,CACDX,YAAY,EACZC,eAAe,EACfI,mBAAmB,EACnBH,MAAM,EACNC,SAAS,EACTC,IAAI,CACL,CAAC;EAEF,OAAOE,WAAW;AACpB,CAAC;AAED,MAAMmC,aAAa,GAAG7D,IAAI,CAACmB,KAAK,CAAC;AACjC0C,aAAa,CAACC,WAAW,GAAG,OAAO;AAEnC,SAASD,aAAa,IAAI1C,KAAK"}
1
+ {"version":3,"file":"Badge.js","names":["memo","useMemo","useOdysseyDesignTokens","Box","jsx","_jsx","badgeTypeValues","badgeTypeColors","odysseyTokens","default","background","HueNeutral200","font","TypographyColorBody","attention","PalettePrimaryMain","TypographyColorInverse","danger","PaletteDangerMain","Badge","badgeContent","badgeContentMax","testId","translate","type","odysseyDesignTokens","renderBadge","greaterThanZeroContentMax","threeDigitLimitedMax","isOverContentMax","overContentMaxMessage","formattedContent","toString","badgeStyles","display","alignItems","justifyContent","minWidth","Spacing4","Spacing1","height","minHeight","padding","backgroundColor","color","borderRadius","length","BorderRadiusOuter","fontSize","TypographyScale0","fontFamily","TypographyFamilyMono","fontWeight","TypographyWeightBodyBold","lineHeight","transitionDuration","TransitionDurationMain","transitionProperty","hasNotificationCount","sx","children","MemoizedBadge","displayName"],"sources":["../src/Badge.tsx"],"sourcesContent":["/*!\n * Copyright (c) 2023-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *\n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport { CSSProperties, memo, useMemo } from \"react\";\n\nimport {\n useOdysseyDesignTokens,\n DesignTokens,\n} from \"./OdysseyDesignTokensContext\";\nimport { Box } from \"./Box\";\nimport type { HtmlProps } from \"./HtmlProps\";\n\nexport type BadgeContentMax = 10 | 20 | 30 | 40 | 50 | 60 | 70 | 80 | 90 | 100;\n\nexport const badgeTypeValues = [\"default\", \"attention\", \"danger\"] as const;\n\nexport type BadgeProps = {\n badgeContent: number;\n badgeContentMax?: BadgeContentMax;\n type?: (typeof badgeTypeValues)[number];\n} & Pick<HtmlProps, \"testId\" | \"translate\">;\n\nconst badgeTypeColors = (odysseyTokens: DesignTokens) => ({\n default: {\n background: odysseyTokens.HueNeutral200,\n font: odysseyTokens.TypographyColorBody,\n },\n attention: {\n background: odysseyTokens.PalettePrimaryMain,\n font: odysseyTokens.TypographyColorInverse,\n },\n danger: {\n background: odysseyTokens.PaletteDangerMain,\n font: odysseyTokens.TypographyColorInverse,\n },\n});\n\nconst Badge = ({\n badgeContent,\n badgeContentMax = 100,\n testId,\n translate,\n type = \"default\",\n}: BadgeProps) => {\n const odysseyDesignTokens = useOdysseyDesignTokens();\n\n const renderBadge = useMemo(() => {\n const greaterThanZeroContentMax = badgeContentMax > 0 ? badgeContentMax : 1;\n const threeDigitLimitedMax =\n greaterThanZeroContentMax > 999 ? 999 : greaterThanZeroContentMax;\n const isOverContentMax = badgeContent > threeDigitLimitedMax;\n const overContentMaxMessage = `${greaterThanZeroContentMax}+`;\n const formattedContent = isOverContentMax\n ? overContentMaxMessage\n : badgeContent.toString();\n\n const badgeStyles: CSSProperties = {\n display: \"inline-flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n minWidth: `calc(${odysseyDesignTokens.Spacing4} + ${odysseyDesignTokens.Spacing1})`,\n height: `calc(${odysseyDesignTokens.Spacing4} + ${odysseyDesignTokens.Spacing1})`,\n minHeight: `calc(${odysseyDesignTokens.Spacing4} + ${odysseyDesignTokens.Spacing1})`,\n // 6px horizontal padding per design requirements\n padding: \"0 6px\",\n backgroundColor: badgeTypeColors(odysseyDesignTokens)[type].background,\n color: badgeTypeColors(odysseyDesignTokens)[type].font,\n borderRadius:\n formattedContent.length > 1\n ? `${odysseyDesignTokens.BorderRadiusOuter}`\n : \"50%\",\n fontSize: `${odysseyDesignTokens.TypographyScale0}`,\n fontFamily: `${odysseyDesignTokens.TypographyFamilyMono}`,\n fontWeight: `${odysseyDesignTokens.TypographyWeightBodyBold}`,\n lineHeight: 1,\n transitionDuration: `${odysseyDesignTokens.TransitionDurationMain}`,\n transitionProperty: `background-color, color`,\n };\n\n const hasNotificationCount = badgeContent && badgeContent > 0;\n\n return hasNotificationCount ? (\n <Box sx={badgeStyles} data-se={testId} translate={translate}>\n {formattedContent}\n </Box>\n ) : null;\n }, [\n badgeContent,\n badgeContentMax,\n odysseyDesignTokens,\n testId,\n translate,\n type,\n ]);\n\n return renderBadge;\n};\n\nconst MemoizedBadge = memo(Badge);\nMemoizedBadge.displayName = \"Badge\";\n\nexport { MemoizedBadge as Badge };\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAAwBA,IAAI,EAAEC,OAAO,QAAQ,OAAO;AAAC,SAGnDC,sBAAsB;AAAA,SAGfC,GAAG;AAAA,SAAAC,GAAA,IAAAC,IAAA;AAKZ,OAAO,MAAMC,eAAe,GAAG,CAAC,SAAS,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Text","memo","useTranslation","jsxs","_jsxs","jsx","_jsx","bannerRoleValues","bannerSeverityValues","Banner","linkUrl","linkText","onClose","role","severity","text","testId","translate","t","_Alert","variant","children","_AlertTitle","href","MemoizedBanner","displayName"],"sources":["../src/Banner.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 { Alert, AlertColor, AlertTitle, AlertProps } from \"@mui/material\";\nimport { Link } from \"./Link\";\nimport { ScreenReaderText } from \"./ScreenReaderText\";\nimport { memo } from \"react\";\nimport { useTranslation } from \"react-i18next\";\n\nimport type { HtmlProps } from \"./HtmlProps\";\n\nexport const bannerRoleValues = [\"status\", \"alert\"] as const;\nexport const bannerSeverityValues: AlertColor[] = [\n \"success\",\n \"info\",\n \"warning\",\n \"error\",\n];\n\nexport type BannerProps = {\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 alert will include a link to the URL\n */\n linkUrl?: string;\n /**\n * The function that's fired when the user clicks the close button. If undefined,\n * the close button will not be shown.\n */\n onClose?: AlertProps[\"onClose\"];\n /**\n * Sets the ARIA role of the alert\n * (\"status\" for something that dynamically updates, \"alert\" for errors, null for something\n * unchanging)\n */\n role?: (typeof bannerRoleValues)[number];\n /**\n * Determine the color and icon of the alert\n */\n severity: (typeof bannerSeverityValues)[number];\n /**\n * The text content of the alert\n */\n text: string;\n} & HtmlProps;\n\nconst Banner = ({\n linkUrl,\n linkText,\n onClose,\n role,\n severity,\n text,\n testId,\n translate,\n}: BannerProps) => {\n const { t } = useTranslation();\n\n return (\n <Alert\n data-se={testId}\n onClose={onClose}\n role={role}\n severity={severity}\n variant=\"banner\"\n >\n <ScreenReaderText translate={translate}>\n {t(`severity.${severity}`)}:\n </ScreenReaderText>\n <AlertTitle translate={translate}>{text}</AlertTitle>\n {linkUrl && (\n <Link href={linkUrl} variant=\"monochrome\" translate={translate}>\n {linkText}\n </Link>\n )}\n </Alert>\n );\n};\n\nconst MemoizedBanner = memo(Banner);\nMemoizedBanner.displayName = \"Banner\";\n\nexport { MemoizedBanner as Banner };\n"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAVA,SAaSA,IAAI;AAAA,SACJC,gBAAgB;AACzB,SAASC,IAAI,QAAQ,OAAO;AAC5B,SAASC,cAAc,QAAQ,eAAe;AAAC,SAAAC,IAAA,IAAAC,KAAA;AAAA,SAAAC,GAAA,IAAAC,IAAA;AAI/C,OAAO,MAAMC,gBAAgB,GAAG,CAAC,QAAQ,EAAE,OAAO,CAAU;AAC5D,OAAO,MAAMC,oBAAkC,GAAG,CAChD,SAAS,EACT,MAAM,EACN,SAAS,EACT,OAAO,CACR;AAkCD,MAAMC,MAAM,GAAGA,CAAC;EACdC,OAAO;EACPC,QAAQ;EACRC,OAAO;EACPC,IAAI;EACJC,QAAQ;EACRC,IAAI;EACJC,MAAM;EACNC;AACW,CAAC,KAAK;EACjB,MAAM;IAAEC;EAAE,CAAC,GAAGhB,cAAc,CAAC,CAAC;EAE9B,OACEE,KAAA,CAAAe,MAAA;IACE,WAASH,MAAO;IAChBJ,OAAO,EAAEA,OAAQ;IACjBC,IAAI,EAAEA,IAAK;IACXC,QAAQ,EAAEA,QAAS;IACnBM,OAAO,EAAC,QAAQ;IAAAC,QAAA,GAEhBjB,KAAA,CAACJ,gBAAgB;MAACiB,SAAS,EAAEA,SAAU;MAAAI,QAAA,GACpCH,CAAC,CAAE,YAAWJ,QAAS,EAAC,CAAC,EAAC,GAC7B;IAAA,CAAkB,CAAC,EACnBR,IAAA,CAAAgB,WAAA;MAAYL,SAAS,EAAEA,SAAU;MAAAI,QAAA,EAAEN;IAAI,CAAa,CAAC,EACpDL,OAAO,IACNJ,IAAA,CAACP,IAAI;MAACwB,IAAI,EAAEb,OAAQ;MAACU,OAAO,EAAC,YAAY;MAACH,SAAS,EAAEA,SAAU;MAAAI,QAAA,EAC5DV;IAAQ,CACL,CACP;EAAA,CACI,CAAC;AAEZ,CAAC;AAED,MAAMa,cAAc,GAAGvB,IAAI,CAACQ,MAAM,CAAC;AACnCe,cAAc,CAACC,WAAW,GAAG,QAAQ;AAErC,SAASD,cAAc,IAAIf,MAAM"}
1
+ {"version":3,"file":"Banner.js","names":["Link","ScreenReaderText","memo","useTranslation","jsxs","_jsxs","jsx","_jsx","bannerRoleValues","bannerSeverityValues","Banner","linkUrl","linkText","onClose","role","severity","text","testId","translate","t","_Alert","variant","children","_AlertTitle","href","MemoizedBanner","displayName"],"sources":["../src/Banner.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 { Alert, AlertColor, AlertTitle, AlertProps } from \"@mui/material\";\nimport { Link } from \"./Link\";\nimport { ScreenReaderText } from \"./ScreenReaderText\";\nimport { memo } from \"react\";\nimport { useTranslation } from \"react-i18next\";\n\nimport type { HtmlProps } from \"./HtmlProps\";\n\nexport const bannerRoleValues = [\"status\", \"alert\"] as const;\nexport const bannerSeverityValues: AlertColor[] = [\n \"success\",\n \"info\",\n \"warning\",\n \"error\",\n];\n\nexport type BannerProps = {\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 alert will include a link to the URL\n */\n linkUrl?: string;\n /**\n * The function that's fired when the user clicks the close button. If undefined,\n * the close button will not be shown.\n */\n onClose?: AlertProps[\"onClose\"];\n /**\n * Sets the ARIA role of the alert\n * (\"status\" for something that dynamically updates, \"alert\" for errors, null for something\n * unchanging)\n */\n role?: (typeof bannerRoleValues)[number];\n /**\n * Determine the color and icon of the alert\n */\n severity: (typeof bannerSeverityValues)[number];\n /**\n * The text content of the alert\n */\n text: string;\n} & Pick<HtmlProps, \"testId\" | \"translate\">;\n\nconst Banner = ({\n linkUrl,\n linkText,\n onClose,\n role,\n severity,\n text,\n testId,\n translate,\n}: BannerProps) => {\n const { t } = useTranslation();\n\n return (\n <Alert\n data-se={testId}\n onClose={onClose}\n role={role}\n severity={severity}\n variant=\"banner\"\n >\n <ScreenReaderText translate={translate}>\n {t(`severity.${severity}`)}:\n </ScreenReaderText>\n <AlertTitle translate={translate}>{text}</AlertTitle>\n {linkUrl && (\n <Link href={linkUrl} variant=\"monochrome\" translate={translate}>\n {linkText}\n </Link>\n )}\n </Alert>\n );\n};\n\nconst MemoizedBanner = memo(Banner);\nMemoizedBanner.displayName = \"Banner\";\n\nexport { MemoizedBanner as Banner };\n"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAVA,SAaSA,IAAI;AAAA,SACJC,gBAAgB;AACzB,SAASC,IAAI,QAAQ,OAAO;AAC5B,SAASC,cAAc,QAAQ,eAAe;AAAC,SAAAC,IAAA,IAAAC,KAAA;AAAA,SAAAC,GAAA,IAAAC,IAAA;AAI/C,OAAO,MAAMC,gBAAgB,GAAG,CAAC,QAAQ,EAAE,OAAO,CAAU;AAC5D,OAAO,MAAMC,oBAAkC,GAAG,CAChD,SAAS,EACT,MAAM,EACN,SAAS,EACT,OAAO,CACR;AAkCD,MAAMC,MAAM,GAAGA,CAAC;EACdC,OAAO;EACPC,QAAQ;EACRC,OAAO;EACPC,IAAI;EACJC,QAAQ;EACRC,IAAI;EACJC,MAAM;EACNC;AACW,CAAC,KAAK;EACjB,MAAM;IAAEC;EAAE,CAAC,GAAGhB,cAAc,CAAC,CAAC;EAE9B,OACEE,KAAA,CAAAe,MAAA;IACE,WAASH,MAAO;IAChBJ,OAAO,EAAEA,OAAQ;IACjBC,IAAI,EAAEA,IAAK;IACXC,QAAQ,EAAEA,QAAS;IACnBM,OAAO,EAAC,QAAQ;IAAAC,QAAA,GAEhBjB,KAAA,CAACJ,gBAAgB;MAACiB,SAAS,EAAEA,SAAU;MAAAI,QAAA,GACpCH,CAAC,CAAE,YAAWJ,QAAS,EAAC,CAAC,EAAC,GAC7B;IAAA,CAAkB,CAAC,EACnBR,IAAA,CAAAgB,WAAA;MAAYL,SAAS,EAAEA,SAAU;MAAAI,QAAA,EAAEN;IAAI,CAAa,CAAC,EACpDL,OAAO,IACNJ,IAAA,CAACP,IAAI;MAACwB,IAAI,EAAEb,OAAQ;MAACU,OAAO,EAAC,YAAY;MAACH,SAAS,EAAEA,SAAU;MAAAI,QAAA,EAC5DV;IAAQ,CACL,CACP;EAAA,CACI,CAAC;AAEZ,CAAC;AAED,MAAMa,cAAc,GAAGvB,IAAI,CAACQ,MAAM,CAAC;AACnCe,cAAc,CAACC,WAAW,GAAG,QAAQ;AAErC,SAASD,cAAc,IAAIf,MAAM"}
package/dist/Box.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"Box.js","names":["forwardRef","memo","jsx","_jsx","Box","children","component","id","sx","testId","translate","ref","_Box","MemoizedBox","displayName"],"sources":["../src/Box.tsx"],"sourcesContent":["/*!\n * Copyright (c) 2023-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *\n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport { Box as MuiBox, BoxProps as MuiBoxProps } from \"@mui/material\";\nimport { ReactNode, forwardRef, memo } from \"react\";\n\nimport type { HtmlProps } from \"./HtmlProps\";\n\nexport type BoxProps = {\n children?: ReactNode;\n component?: MuiBoxProps[\"component\"];\n id?: MuiBoxProps[\"id\"];\n sx?: MuiBoxProps[\"sx\"];\n} & HtmlProps;\n\nconst Box = forwardRef<HTMLElement, BoxProps>(\n ({ children, component, id, sx, testId, translate }, ref) => (\n <MuiBox\n ref={ref}\n children={children}\n component={component}\n data-se={testId}\n id={id}\n sx={sx}\n translate={translate}\n />\n )\n);\n\nconst MemoizedBox = memo(Box);\nMemoizedBox.displayName = \"Box\";\n\nexport { MemoizedBox as Box };\n"],"mappings":";AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAGA,SAAoBA,UAAU,EAAEC,IAAI,QAAQ,OAAO;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAWpD,MAAMC,GAAG,GAAGJ,UAAU,CACpB,CAAC;EAAEK,QAAQ;EAAEC,SAAS;EAAEC,EAAE;EAAEC,EAAE;EAAEC,MAAM;EAAEC;AAAU,CAAC,EAAEC,GAAG,KACtDR,IAAA,CAAAS,IAAA;EACED,GAAG,EAAEA,GAAI;EACTN,QAAQ,EAAEA,QAAS;EACnBC,SAAS,EAAEA,SAAU;EACrB,WAASG,MAAO;EAChBF,EAAE,EAAEA,EAAG;EACPC,EAAE,EAAEA,EAAG;EACPE,SAAS,EAAEA;AAAU,CACtB,CAEL,CAAC;AAED,MAAMG,WAAW,GAAGZ,IAAI,CAACG,GAAG,CAAC;AAC7BS,WAAW,CAACC,WAAW,GAAG,KAAK;AAE/B,SAASD,WAAW,IAAIT,GAAG"}
1
+ {"version":3,"file":"Box.js","names":["forwardRef","memo","jsx","_jsx","Box","children","component","id","sx","testId","translate","ref","_Box","MemoizedBox","displayName"],"sources":["../src/Box.tsx"],"sourcesContent":["/*!\n * Copyright (c) 2023-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *\n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport { Box as MuiBox, BoxProps as MuiBoxProps } from \"@mui/material\";\nimport { ReactNode, forwardRef, memo } from \"react\";\n\nimport type { HtmlProps } from \"./HtmlProps\";\n\nexport type BoxProps = {\n children?: ReactNode;\n component?: MuiBoxProps[\"component\"];\n id?: MuiBoxProps[\"id\"];\n sx?: MuiBoxProps[\"sx\"];\n} & Pick<HtmlProps, \"testId\" | \"translate\">;\n\nconst Box = forwardRef<HTMLElement, BoxProps>(\n ({ children, component, id, sx, testId, translate }, ref) => (\n <MuiBox\n ref={ref}\n children={children}\n component={component}\n data-se={testId}\n id={id}\n sx={sx}\n translate={translate}\n />\n ),\n);\n\nconst MemoizedBox = memo(Box);\nMemoizedBox.displayName = \"Box\";\n\nexport { MemoizedBox as Box };\n"],"mappings":";AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAGA,SAAoBA,UAAU,EAAEC,IAAI,QAAQ,OAAO;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAWpD,MAAMC,GAAG,GAAGJ,UAAU,CACpB,CAAC;EAAEK,QAAQ;EAAEC,SAAS;EAAEC,EAAE;EAAEC,EAAE;EAAEC,MAAM;EAAEC;AAAU,CAAC,EAAEC,GAAG,KACtDR,IAAA,CAAAS,IAAA;EACED,GAAG,EAAEA,GAAI;EACTN,QAAQ,EAAEA,QAAS;EACnBC,SAAS,EAAEA,SAAU;EACrB,WAASG,MAAO;EAChBF,EAAE,EAAEA,EAAG;EACPC,EAAE,EAAEA,EAAG;EACPE,SAAS,EAAEA;AAAU,CACtB,CAEL,CAAC;AAED,MAAMG,WAAW,GAAGZ,IAAI,CAACG,GAAG,CAAC;AAC7BS,WAAW,CAACC,WAAW,GAAG,KAAK;AAE/B,SAASD,WAAW,IAAIT,GAAG"}
@@ -1 +1 @@
1
- {"version":3,"file":"Breadcrumbs.js","names":["createContext","memo","useCallback","useContext","useMemo","useState","GroupIcon","HomeIcon","UserIcon","Subordinate","useTranslation","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","BreadcrumbContext","breadcrumbType","Breadcrumb","children","href","iconName","breadcrumbContent","_MenuItem","color","_ButtonBase","breadcrumbProviderValue","currentPage","listItem","menuItem","defaultTruncationValue","BreadcrumbList","homeHref","maxVisibleItems","testId","translate","t","anchorEl","setAnchorEl","breadcrumbSections","length","beforeMenu","insideMenu","remainingBreadcrumbs","menuStart","Math","floor","menuLength","slice","onMenuButtonClick","event","currentTarget","onCloseMenu","_Breadcrumbs","maxItems","map","breadcrumb","Provider","value","onClick","_Menu","open","Boolean","onClose","anchorOrigin","horizontal","vertical","MenuListProps","sx","minWidth","i","MemoizedBreadcrumbList","displayName"],"sources":["../src/Breadcrumbs.tsx"],"sourcesContent":["/*!\n * Copyright (c) 2023-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *\n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport {\n ButtonBase,\n Menu,\n MenuItem,\n Breadcrumbs as MuiBreadcrumbs,\n} from \"@mui/material\";\nimport {\n MouseEventHandler,\n ReactElement,\n createContext,\n memo,\n useCallback,\n useContext,\n useMemo,\n useState,\n} from \"react\";\nimport { GroupIcon, HomeIcon, UserIcon } from \"./icons.generated\";\nimport { Subordinate } from \"./Typography\";\nimport { useTranslation } from \"react-i18next\";\nimport { HtmlProps } from \"./HtmlProps\";\n\nexport type BreadcrumbType = \"listItem\" | \"menuItem\" | \"currentPage\";\n\nexport type BreadcrumbProps = {\n children?: string;\n href: string;\n iconName?: \"user\" | \"group\";\n};\n\nexport type BreadcrumbsProps = {\n children: ReactElement<typeof Breadcrumb>[];\n homeHref?: string;\n maxVisibleItems?: number;\n} & HtmlProps;\n\nexport type BreadcrumbContextType = {\n breadcrumbType: BreadcrumbType;\n};\n\nexport const BreadcrumbContext = createContext<BreadcrumbContextType>({\n breadcrumbType: \"listItem\",\n});\n\nexport const Breadcrumb = ({ children, href, iconName }: BreadcrumbProps) => {\n const { breadcrumbType } = useContext(BreadcrumbContext);\n\n const breadcrumbContent = (\n <>\n {iconName === \"group\" ? (\n <GroupIcon />\n ) : iconName === \"user\" ? (\n <UserIcon />\n ) : null}\n {children}\n </>\n );\n\n if (breadcrumbType === \"menuItem\") {\n return <MenuItem href={href}>{breadcrumbContent}</MenuItem>;\n }\n\n if (breadcrumbType === \"currentPage\") {\n return <Subordinate color=\"textPrimary\">{breadcrumbContent}</Subordinate>;\n }\n\n // breadcrumbType === \"listItem\" is the default\n // Provided here without a conditional to get TS to be quiet\n // about potential undefined returns\n return <ButtonBase href={href}>{breadcrumbContent}</ButtonBase>;\n};\n\nconst breadcrumbProviderValue: Record<\n BreadcrumbType,\n { breadcrumbType: BreadcrumbType }\n> = {\n currentPage: {\n breadcrumbType: \"currentPage\",\n },\n listItem: {\n breadcrumbType: \"listItem\",\n },\n menuItem: {\n breadcrumbType: \"menuItem\",\n },\n};\n\nconst defaultTruncationValue = 5;\n\nconst BreadcrumbList = ({\n children,\n homeHref,\n maxVisibleItems = defaultTruncationValue,\n testId,\n translate,\n}: BreadcrumbsProps) => {\n const { t } = useTranslation();\n\n const [anchorEl, setAnchorEl] = useState<HTMLElement | null>(null);\n\n const breadcrumbSections = useMemo(() => {\n if (children.length <= maxVisibleItems) {\n return {\n beforeMenu: [],\n insideMenu: [],\n remainingBreadcrumbs: children,\n };\n } else {\n const menuStart = Math.floor(maxVisibleItems / 2);\n const menuLength = children.length - maxVisibleItems;\n\n return {\n beforeMenu: children.slice(0, menuStart),\n insideMenu: children.slice(menuStart, menuStart + menuLength),\n remainingBreadcrumbs: children.slice(menuStart + menuLength),\n };\n }\n }, [children, maxVisibleItems]);\n\n const onMenuButtonClick = useCallback<MouseEventHandler<HTMLButtonElement>>(\n (event) => setAnchorEl(event.currentTarget),\n []\n );\n const onCloseMenu = useCallback(() => {\n setAnchorEl(null);\n }, []);\n\n return (\n <MuiBreadcrumbs\n maxItems={children.length + 1}\n aria-label={t(\"breadcrumbs.label.text\")}\n data-se={testId}\n translate={translate}\n >\n {homeHref && (\n <ButtonBase href={homeHref} aria-label={t(\"breadcrumbs.home.text\")}>\n <HomeIcon />\n </ButtonBase>\n )}\n\n {breadcrumbSections.beforeMenu.map((breadcrumb) => (\n <BreadcrumbContext.Provider value={breadcrumbProviderValue.listItem}>\n {breadcrumb}\n </BreadcrumbContext.Provider>\n ))}\n\n {breadcrumbSections.insideMenu && (\n <>\n <ButtonBase onClick={onMenuButtonClick}>...</ButtonBase>\n <Menu\n open={Boolean(anchorEl)}\n onClose={onCloseMenu}\n anchorEl={anchorEl}\n anchorOrigin={{ horizontal: \"left\", vertical: \"bottom\" }}\n MenuListProps={{\n sx: {\n minWidth: 180,\n },\n }}\n >\n <BreadcrumbContext.Provider\n value={breadcrumbProviderValue.menuItem}\n >\n {breadcrumbSections.insideMenu}\n </BreadcrumbContext.Provider>\n </Menu>\n </>\n )}\n\n {breadcrumbSections.remainingBreadcrumbs.map((breadcrumb, i) => {\n if (i === breadcrumbSections.remainingBreadcrumbs.length - 1) {\n return (\n <BreadcrumbContext.Provider\n value={breadcrumbProviderValue.currentPage}\n >\n {breadcrumb}\n </BreadcrumbContext.Provider>\n );\n }\n return (\n <BreadcrumbContext.Provider value={breadcrumbProviderValue.listItem}>\n {breadcrumb}\n </BreadcrumbContext.Provider>\n );\n })}\n </MuiBreadcrumbs>\n );\n};\n\nconst MemoizedBreadcrumbList = memo(BreadcrumbList);\nMemoizedBreadcrumbList.displayName = \"BreadcrumbList\";\n\nexport { MemoizedBreadcrumbList as BreadcrumbList };\n"],"mappings":";;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAQA,SAGEA,aAAa,EACbC,IAAI,EACJC,WAAW,EACXC,UAAU,EACVC,OAAO,EACPC,QAAQ,QACH,OAAO;AAAC,SACNC,SAAS,EAAEC,QAAQ,EAAEC,QAAQ;AAAA,SAC7BC,WAAW;AACpB,SAASC,cAAc,QAAQ,eAAe;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAAA,SAAAC,QAAA,IAAAC,SAAA;AAAA,SAAAC,IAAA,IAAAC,KAAA;AAqB/C,OAAO,MAAMC,iBAAiB,GAAGjB,aAAa,CAAwB;EACpEkB,cAAc,EAAE;AAClB,CAAC,CAAC;AAEF,OAAO,MAAMC,UAAU,GAAGA,CAAC;EAAEC,QAAQ;EAAEC,IAAI;EAAEC;AAA0B,CAAC,KAAK;EAC3E,MAAM;IAAEJ;EAAe,CAAC,GAAGf,UAAU,CAACc,iBAAiB,CAAC;EAExD,MAAMM,iBAAiB,GACrBP,KAAA,CAAAF,SAAA;IAAAM,QAAA,GACGE,QAAQ,KAAK,OAAO,GACnBV,IAAA,CAACN,SAAS,IAAE,CAAC,GACXgB,QAAQ,KAAK,MAAM,GACrBV,IAAA,CAACJ,QAAQ,IAAE,CAAC,GACV,IAAI,EACPY,QAAQ;EAAA,CACT,CACH;EAED,IAAIF,cAAc,KAAK,UAAU,EAAE;IAC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AA;QACEC,IAAI,EAAEC,OAAO,CAACzB,QAAQ,CAAE;QACxB0B,OAAO,EAAEX,WAAY;QACrBf,QAAQ,EAAEA,QAAS;QACnB2B,YAAY,EAAE;UAAEC,UAAU,EAAE,MAAM;UAAEC,QAAQ,EAAE;QAAS,CAAE;QACzDC,aAAa,EAAE;UACbC,EAAE,EAAE;YACFC,QAAQ,EAAE;UACZ;QACF,CAAE;QAAAlD,QAAA,EAEFR,IAAA,CAACK,iBAAiB,CAACyC,QAAQ;UACzBC,KAAK,EAAEhC,uBAAuB,CAACG,QAAS;UAAAV,QAAA,EAEvCoB,kBAAkB,CAACG;QAAU,CACJ;MAAC,CACzB,CAAC;IAAA,CACP,CACH,EAEAH,kBAAkB,CAACI,oBAAoB,CAACY,GAAG,CAAC,CAACC,UAAU,EAAEc,CAAC,KAAK;MAC9D,IAAIA,CAAC,KAAK/B,kBAAkB,CAACI,oBAAoB,CAACH,MAAM,GAAG,CAAC,EAAE;QAC5D,OACE7B,IAAA,CAACK,iBAAiB,CAACyC,QAAQ;UACzBC,KAAK,EAAEhC,uBAAuB,CAACC,WAAY;UAAAR,QAAA,EAE1CqC;QAAU,CACe,CAAC;MAEjC;MACA,OACE7C,IAAA,CAACK,iBAAiB,CAACyC,QAAQ;QAACC,KAAK,EAAEhC,uBAAuB,CAACE,QAAS;QAAAT,QAAA,EACjEqC;MAAU,CACe,CAAC;IAEjC,CAAC,CAAC;EAAA,CACY,CAAC;AAErB,CAAC;AAED,MAAMe,sBAAsB,GAAGvE,IAAI,CAAC+B,cAAc,CAAC;AACnDwC,sBAAsB,CAACC,WAAW,GAAG,gBAAgB;AAErD,SAASD,sBAAsB,IAAIxC,cAAc"}
1
+ {"version":3,"file":"Breadcrumbs.js","names":["createContext","memo","useCallback","useContext","useMemo","useState","GroupIcon","HomeIcon","UserIcon","Subordinate","useTranslation","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","BreadcrumbContext","breadcrumbType","Breadcrumb","children","href","iconName","breadcrumbContent","_MenuItem","color","_ButtonBase","breadcrumbProviderValue","currentPage","listItem","menuItem","defaultTruncationValue","BreadcrumbList","homeHref","maxVisibleItems","testId","translate","t","anchorEl","setAnchorEl","breadcrumbSections","length","beforeMenu","insideMenu","remainingBreadcrumbs","menuStart","Math","floor","menuLength","slice","onMenuButtonClick","event","currentTarget","onCloseMenu","_Breadcrumbs","maxItems","map","breadcrumb","Provider","value","onClick","_Menu","open","Boolean","onClose","anchorOrigin","horizontal","vertical","MenuListProps","sx","minWidth","i","MemoizedBreadcrumbList","displayName"],"sources":["../src/Breadcrumbs.tsx"],"sourcesContent":["/*!\n * Copyright (c) 2023-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *\n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport {\n ButtonBase,\n Menu,\n MenuItem,\n Breadcrumbs as MuiBreadcrumbs,\n} from \"@mui/material\";\nimport {\n MouseEventHandler,\n ReactElement,\n createContext,\n memo,\n useCallback,\n useContext,\n useMemo,\n useState,\n} from \"react\";\nimport { GroupIcon, HomeIcon, UserIcon } from \"./icons.generated\";\nimport { Subordinate } from \"./Typography\";\nimport { useTranslation } from \"react-i18next\";\nimport { HtmlProps } from \"./HtmlProps\";\n\nexport type BreadcrumbType = \"listItem\" | \"menuItem\" | \"currentPage\";\n\nexport type BreadcrumbProps = {\n children?: string;\n href: string;\n iconName?: \"user\" | \"group\";\n};\n\nexport type BreadcrumbsProps = {\n children: ReactElement<typeof Breadcrumb>[];\n homeHref?: string;\n maxVisibleItems?: number;\n} & Pick<HtmlProps, \"testId\" | \"translate\">;\n\nexport type BreadcrumbContextType = {\n breadcrumbType: BreadcrumbType;\n};\n\nexport const BreadcrumbContext = createContext<BreadcrumbContextType>({\n breadcrumbType: \"listItem\",\n});\n\nexport const Breadcrumb = ({ children, href, iconName }: BreadcrumbProps) => {\n const { breadcrumbType } = useContext(BreadcrumbContext);\n\n const breadcrumbContent = (\n <>\n {iconName === \"group\" ? (\n <GroupIcon />\n ) : iconName === \"user\" ? (\n <UserIcon />\n ) : null}\n {children}\n </>\n );\n\n if (breadcrumbType === \"menuItem\") {\n return <MenuItem href={href}>{breadcrumbContent}</MenuItem>;\n }\n\n if (breadcrumbType === \"currentPage\") {\n return <Subordinate color=\"textPrimary\">{breadcrumbContent}</Subordinate>;\n }\n\n // breadcrumbType === \"listItem\" is the default\n // Provided here without a conditional to get TS to be quiet\n // about potential undefined returns\n return <ButtonBase href={href}>{breadcrumbContent}</ButtonBase>;\n};\n\nconst breadcrumbProviderValue: Record<\n BreadcrumbType,\n { breadcrumbType: BreadcrumbType }\n> = {\n currentPage: {\n breadcrumbType: \"currentPage\",\n },\n listItem: {\n breadcrumbType: \"listItem\",\n },\n menuItem: {\n breadcrumbType: \"menuItem\",\n },\n};\n\nconst defaultTruncationValue = 5;\n\nconst BreadcrumbList = ({\n children,\n homeHref,\n maxVisibleItems = defaultTruncationValue,\n testId,\n translate,\n}: BreadcrumbsProps) => {\n const { t } = useTranslation();\n\n const [anchorEl, setAnchorEl] = useState<HTMLElement | null>(null);\n\n const breadcrumbSections = useMemo(() => {\n if (children.length <= maxVisibleItems) {\n return {\n beforeMenu: [],\n insideMenu: [],\n remainingBreadcrumbs: children,\n };\n } else {\n const menuStart = Math.floor(maxVisibleItems / 2);\n const menuLength = children.length - maxVisibleItems;\n\n return {\n beforeMenu: children.slice(0, menuStart),\n insideMenu: children.slice(menuStart, menuStart + menuLength),\n remainingBreadcrumbs: children.slice(menuStart + menuLength),\n };\n }\n }, [children, maxVisibleItems]);\n\n const onMenuButtonClick = useCallback<MouseEventHandler<HTMLButtonElement>>(\n (event) => setAnchorEl(event.currentTarget),\n [],\n );\n const onCloseMenu = useCallback(() => {\n setAnchorEl(null);\n }, []);\n\n return (\n <MuiBreadcrumbs\n maxItems={children.length + 1}\n aria-label={t(\"breadcrumbs.label.text\")}\n data-se={testId}\n translate={translate}\n >\n {homeHref && (\n <ButtonBase href={homeHref} aria-label={t(\"breadcrumbs.home.text\")}>\n <HomeIcon />\n </ButtonBase>\n )}\n\n {breadcrumbSections.beforeMenu.map((breadcrumb) => (\n <BreadcrumbContext.Provider value={breadcrumbProviderValue.listItem}>\n {breadcrumb}\n </BreadcrumbContext.Provider>\n ))}\n\n {breadcrumbSections.insideMenu && (\n <>\n <ButtonBase onClick={onMenuButtonClick}>...</ButtonBase>\n <Menu\n open={Boolean(anchorEl)}\n onClose={onCloseMenu}\n anchorEl={anchorEl}\n anchorOrigin={{ horizontal: \"left\", vertical: \"bottom\" }}\n MenuListProps={{\n sx: {\n minWidth: 180,\n },\n }}\n >\n <BreadcrumbContext.Provider\n value={breadcrumbProviderValue.menuItem}\n >\n {breadcrumbSections.insideMenu}\n </BreadcrumbContext.Provider>\n </Menu>\n </>\n )}\n\n {breadcrumbSections.remainingBreadcrumbs.map((breadcrumb, i) => {\n if (i === breadcrumbSections.remainingBreadcrumbs.length - 1) {\n return (\n <BreadcrumbContext.Provider\n value={breadcrumbProviderValue.currentPage}\n >\n {breadcrumb}\n </BreadcrumbContext.Provider>\n );\n }\n return (\n <BreadcrumbContext.Provider value={breadcrumbProviderValue.listItem}>\n {breadcrumb}\n </BreadcrumbContext.Provider>\n );\n })}\n </MuiBreadcrumbs>\n );\n};\n\nconst MemoizedBreadcrumbList = memo(BreadcrumbList);\nMemoizedBreadcrumbList.displayName = \"BreadcrumbList\";\n\nexport { MemoizedBreadcrumbList as BreadcrumbList };\n"],"mappings":";;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAQA,SAGEA,aAAa,EACbC,IAAI,EACJC,WAAW,EACXC,UAAU,EACVC,OAAO,EACPC,QA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Ec,CAAC,KAAK;MAC9D,IAAIA,CAAC,KAAK/B,kBAAkB,CAACI,oBAAoB,CAACH,MAAM,GAAG,CAAC,EAAE;QAC5D,OACE7B,IAAA,CAACK,iBAAiB,CAACyC,QAAQ;UACzBC,KAAK,EAAEhC,uBAAuB,CAACC,WAAY;UAAAR,QAAA,EAE1CqC;QAAU,CACe,CAAC;MAEjC;MACA,OACE7C,IAAA,CAACK,iBAAiB,CAACyC,QAAQ;QAACC,KAAK,EAAEhC,uBAAuB,CAACE,QAAS;QAAAT,QAAA,EACjEqC;MAAU,CACe,CAAC;IAEjC,CAAC,CAAC;EAAA,CACY,CAAC;AAErB,CAAC;AAED,MAAMe,sBAAsB,GAAGvE,IAAI,CAAC+B,cAAc,CAAC;AACnDwC,sBAAsB,CAACC,WAAW,GAAG,gBAAgB;AAErD,SAASD,sBAAsB,IAAIxC,cAAc"}
package/dist/Button.js CHANGED
@@ -11,9 +11,9 @@ import _Button from "@mui/material/Button";
11
11
  * See the License for the specific language governing permissions and limitations under the License.
12
12
  */
13
13
  import { memo, useCallback, useImperativeHandle, useMemo, useRef } from "react";
14
+ import { useButton } from "./ButtonContext.js";
14
15
  import { MuiPropsContext, useMuiProps } from "./MuiPropsContext.js";
15
16
  import { Tooltip } from "./Tooltip.js";
16
- import { useButton } from "./ButtonContext.js";
17
17
  import { jsx as _jsx } from "react/jsx-runtime";
18
18
  export const buttonSizeValues = ["small", "medium", "large"];
19
19
  export const buttonTypeValues = ["button", "submit", "reset"];
@@ -66,7 +66,7 @@ const Button = ({
66
66
  "data-se": testId,
67
67
  disabled: isDisabled,
68
68
  endIcon: endIcon,
69
- fullWidth: isFullWidth,
69
+ fullWidth: buttonContext.isFullWidth ?? isFullWidth,
70
70
  id: id,
71
71
  onClick: onClick,
72
72
  ref: localButtonRef,
@@ -78,7 +78,7 @@ const Button = ({
78
78
  variant: variant,
79
79
  children: label
80
80
  });
81
- }, [ariaControls, ariaDescribedBy, ariaExpanded, ariaHasPopup, ariaLabel, ariaLabelledBy, endIcon, id, isDisabled, isFullWidth, label, onClick, size, startIcon, tabIndex, testId, translate, type, variant]);
81
+ }, [ariaControls, ariaDescribedBy, ariaExpanded, ariaHasPopup, ariaLabel, ariaLabelledBy, endIcon, id, isDisabled, isFullWidth, buttonContext.isFullWidth, label, onClick, size, startIcon, tabIndex, testId, translate, type, variant]);
82
82
  if (tooltipText) {
83
83
  return _jsx(Tooltip, {
84
84
  ariaType: "description",
@@ -1 +1 @@
1
- {"version":3,"file":"Button.js","names":["memo","useCallback","useImperativeHandle","useMemo","useRef","MuiPropsContext","useMuiProps","Tooltip","useButton","jsx","_jsx","buttonSizeValues","buttonTypeValues","buttonVariantValues","Button","ariaControls","ariaDescribedBy","ariaExpanded","ariaHasPopup","ariaLabel","ariaLabelledBy","buttonRef","endIcon","id","isDisabled","isFullWidth","isFullWidthProp","label","onClick","size","startIcon","tabIndex","testId","tooltipText","translate","type","variant","variantProp","muiProps","localButtonRef","buttonContext","focus","current","renderButton","ref","_Button","disabled","fullWidth","children","ariaType","placement","text","Consumer","MemoizedButton","displayName"],"sources":["../src/Button.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 { Button as MuiButton } from \"@mui/material\";\nimport type { ButtonProps as MuiButtonProps } from \"@mui/material\";\nimport {\n ComponentProps,\n HTMLAttributes,\n memo,\n ReactElement,\n useCallback,\n useImperativeHandle,\n useMemo,\n useRef,\n} from \"react\";\n\nimport { MuiPropsContext, useMuiProps } from \"./MuiPropsContext\";\nimport { Tooltip } from \"./Tooltip\";\nimport type { HtmlProps } from \"./HtmlProps\";\nimport { FocusHandle } from \"./inputUtils\";\nimport { useButton } from \"./ButtonContext\";\n\nexport const buttonSizeValues = [\"small\", \"medium\", \"large\"] as const;\nexport const buttonTypeValues = [\"button\", \"submit\", \"reset\"] as const;\nexport const buttonVariantValues = [\n \"primary\",\n \"secondary\",\n \"danger\",\n \"floating\",\n] as const;\n\nexport type ButtonProps = {\n /**\n * The global `aria-controls` property identifies the element (or elements) whose contents or presence are controlled by the element on which this attribute is set.\n *\n * value: A space-separated list of one or more ID values referencing the elements being controlled by the current element\n */\n ariaControls?: ComponentProps<\"button\">[\"aria-controls\"];\n /**\n * The `aria-expanded` attribute is set on an element to indicate if a control is expanded or collapsed, and whether or not the controlled elements are displayed or hidden.\n */\n ariaExpanded?: ComponentProps<\"button\">[\"aria-expanded\"];\n /**\n * The `aria-haspopup` attribute indicates the availability and type of interactive popup element that can be triggered by the element on which the attribute is set.\n */\n ariaHasPopup?: ComponentProps<\"button\">[\"aria-haspopup\"];\n /**\n * The ARIA label for the Button\n */\n ariaLabel?: string;\n /**\n * The ID of the element that labels the Button\n */\n ariaLabelledBy?: string;\n /**\n * The ID of the element that describes the Button\n */\n ariaDescribedBy?: string;\n /**\n * The ref forwarded to the Button\n */\n buttonRef?: React.RefObject<FocusHandle>;\n /**\n * The icon element to display at the end of the Button\n */\n endIcon?: ReactElement;\n /**\n * The ID of the Button\n */\n id?: string;\n /**\n * Determines whether the Button is disabled\n */\n isDisabled?: boolean;\n /**\n * Determines whether the Button should take up the full available width\n */\n isFullWidth?: boolean;\n /**\n * The text content of the Button\n */\n label?: string;\n /**\n * The click event handler for the Button\n */\n onClick?: MuiButtonProps[\"onClick\"];\n /**\n * The size of the button\n */\n size?: (typeof buttonSizeValues)[number];\n /**\n * The icon element to display at the start of the Button\n */\n startIcon?: ReactElement;\n tabIndex?: HTMLAttributes<HTMLElement>[\"tabIndex\"];\n /**\n * The tooltip text for the Button if it's icon-only\n */\n tooltipText?: string;\n /**\n * The type of the HTML button element\n */\n type?: (typeof buttonTypeValues)[number];\n /**\n * The variant of the Button\n */\n variant: (typeof buttonVariantValues)[number] | \"tertiary\";\n} & (\n | {\n endIcon?: ReactElement;\n label: string;\n startIcon?: ReactElement;\n }\n | {\n endIcon?: ReactElement;\n label?: \"\" | undefined;\n startIcon: ReactElement;\n }\n | {\n endIcon: ReactElement;\n label?: \"\" | undefined;\n startIcon?: ReactElement;\n }\n) &\n HtmlProps;\n\nconst Button = ({\n ariaControls,\n ariaDescribedBy,\n ariaExpanded,\n ariaHasPopup,\n ariaLabel,\n ariaLabelledBy,\n buttonRef,\n endIcon,\n id,\n isDisabled,\n isFullWidth: isFullWidthProp,\n label = \"\",\n onClick,\n size = \"medium\",\n startIcon,\n tabIndex,\n testId,\n tooltipText,\n translate,\n type = \"button\",\n variant: variantProp,\n}: ButtonProps) => {\n const muiProps = useMuiProps();\n\n // We're deprecating the \"tertiary\" variant, so map it to\n // \"secondary\" in lieu of making a breaking change\n const variant = variantProp === \"tertiary\" ? \"secondary\" : variantProp;\n const localButtonRef = useRef<HTMLButtonElement>(null);\n const buttonContext = useButton();\n const isFullWidth = useMemo(\n () =>\n buttonContext.isFullWidth ? buttonContext.isFullWidth : isFullWidthProp,\n [buttonContext, isFullWidthProp]\n );\n\n useImperativeHandle(\n buttonRef,\n () => {\n return {\n focus: () => {\n localButtonRef.current?.focus();\n },\n };\n },\n []\n );\n\n const renderButton = useCallback(\n (muiProps) => {\n muiProps?.ref?.(localButtonRef.current);\n\n return (\n <MuiButton\n {...muiProps}\n aria-controls={ariaControls}\n aria-describedby={ariaDescribedBy}\n aria-expanded={ariaExpanded}\n aria-haspopup={ariaHasPopup}\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledBy}\n data-se={testId}\n disabled={isDisabled}\n endIcon={endIcon}\n fullWidth={isFullWidth}\n id={id}\n onClick={onClick}\n ref={localButtonRef}\n size={size}\n startIcon={startIcon}\n tabIndex={tabIndex}\n translate={translate}\n type={type}\n variant={variant}\n >\n {label}\n </MuiButton>\n );\n },\n [\n ariaControls,\n ariaDescribedBy,\n ariaExpanded,\n ariaHasPopup,\n ariaLabel,\n ariaLabelledBy,\n endIcon,\n id,\n isDisabled,\n isFullWidth,\n label,\n onClick,\n size,\n startIcon,\n tabIndex,\n testId,\n translate,\n type,\n variant,\n ]\n );\n\n if (tooltipText) {\n return (\n <Tooltip ariaType=\"description\" placement=\"top\" text={tooltipText}>\n <MuiPropsContext.Consumer>{renderButton}</MuiPropsContext.Consumer>\n </Tooltip>\n );\n }\n\n return renderButton(muiProps);\n};\n\nconst MemoizedButton = memo(Button);\nMemoizedButton.displayName = \"Button\";\n\nexport { MemoizedButton as Button };\n"],"mappings":";AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAIA,SAGEA,IAAI,EAEJC,WAAW,EACXC,mBAAmB,EACnBC,OAAO,EACPC,MAAM,QACD,OAAO;AAAC,SAENC,eAAe,EAAEC,WAAW;AAAA,SAC5BC,OAAO;AAAA,SAGPC,SAAS;AAAA,SAAAC,GAAA,IAAAC,IAAA;AAElB,OAAO,MAAMC,gBAAgB,GAAG,CAAC,OAAO,EAAE,QAAQ,EAAE,OAAO,CAAU;AACrE,OAAO,MAAMC,gBAAgB,GAAG,CAAC,QAAQ,EAAE,QAAQ,EAAE,OAAO,CAAU;AACtE,OAAO,MAAMC,mBAAmB,GAAG,CACjC,SAAS,EACT,WAAW,EACX,QAAQ,EACR,UAAU,CACF;AAiGV,MAAMC,MAAM,GAAGA,CAAC;EACdC,YAAY;EACZC,eAAe;EACfC,YAAY;EACZC,YAAY;EACZC,SAAS;EACTC,cAAc;EACdC,SAAS;EACTC,OAAO;EACPC,EAAE;EACFC,UAAU;EACVC,WAAW,EAAEC,eAAe;EAC5BC,KAAK,GAAG,EAAE;EACVC,OAAO;EACPC,IAAI,GAAG,QAAQ;EACfC,SAAS;EACTC,QAAQ;EACRC,MAAM;EACNC,WAAW;EACXC,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,EAAEA,OAAQ;MAAAY,QAAA,EAEhBrB;IAAK,CACG,CAAC;EAEhB,CAAC,EACD,CACEZ,YAAY,EACZC,eAAe,EACfC,YAAY,EACZC,YAAY,EACZC,SAAS,EACTC,cAAc,EACdE,OAAO,EACPC,EAAE,EACFC,UAAU,EACVC,WAAW,EACXE,KAAK,EACLC,OAAO,EACPC,IAAI,EACJC,SAAS,EACTC,QAAQ,EACRC,MAAM,EACNE,SAAS,EACTC,IAAI,EACJC,OAAO,CAEX,CAAC;EAED,IAAIH,WAAW,EAAE;IACf,OACEvB,IAAA,CAACH,OAAO;MAAC0C,QAAQ,EAAC,aAAa;MAACC,SAAS,EAAC,KAAK;MAACC,IAAI,EAAElB,WAAY;MAAAe,QAAA,EAChEtC,IAAA,CAACL,eAAe,CAAC+C,QAAQ;QAAAJ,QAAA,EAAEL;MAAY,CAA2B;IAAC,CAC5D,CAAC;EAEd;EAEA,OAAOA,YAAY,CAACL,QAAQ,CAAC;AAC/B,CAAC;AAED,MAAMe,cAAc,GAAGrD,IAAI,CAACc,MAAM,CAAC;AACnCuC,cAAc,CAACC,WAAW,GAAG,QAAQ;AAErC,SAASD,cAAc,IAAIvC,MAAM"}
1
+ {"version":3,"file":"Button.js","names":["memo","useCallback","useImperativeHandle","useMemo","useRef","useButton","MuiPropsContext","useMuiProps","Tooltip","jsx","_jsx","buttonSizeValues","buttonTypeValues","buttonVariantValues","Button","ariaControls","ariaDescribedBy","ariaExpanded","ariaHasPopup","ariaLabel","ariaLabelledBy","buttonRef","endIcon","id","isDisabled","isFullWidth","isFullWidthProp","label","onClick","size","startIcon","tabIndex","testId","tooltipText","translate","type","variant","variantProp","muiProps","localButtonRef","buttonContext","focus","current","renderButton","ref","_Button","disabled","fullWidth","children","ariaType","placement","text","Consumer","MemoizedButton","displayName"],"sources":["../src/Button.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 { Button as MuiButton } from \"@mui/material\";\nimport type { ButtonProps as MuiButtonProps } from \"@mui/material\";\nimport {\n memo,\n ReactElement,\n useCallback,\n useImperativeHandle,\n useMemo,\n useRef,\n} from \"react\";\n\nimport { useButton } from \"./ButtonContext\";\nimport type { HtmlProps } from \"./HtmlProps\";\nimport { FocusHandle } from \"./inputUtils\";\nimport {\n MuiPropsContext,\n MuiPropsContextType,\n useMuiProps,\n} from \"./MuiPropsContext\";\nimport { Tooltip } from \"./Tooltip\";\n\nexport const buttonSizeValues = [\"small\", \"medium\", \"large\"] as const;\nexport const buttonTypeValues = [\"button\", \"submit\", \"reset\"] as const;\nexport const buttonVariantValues = [\n \"primary\",\n \"secondary\",\n \"danger\",\n \"floating\",\n] as const;\n\nexport type ButtonProps = {\n /**\n * The ref forwarded to the Button\n */\n buttonRef?: React.RefObject<FocusHandle>;\n /**\n * The icon element to display at the end of the Button\n */\n endIcon?: ReactElement;\n /**\n * The ID of the Button\n */\n id?: string;\n /**\n * Determines whether the Button is disabled\n */\n isDisabled?: boolean;\n /**\n * Determines whether the Button should take up the full available width\n */\n isFullWidth?: boolean;\n /**\n * The text content of the Button\n */\n label?: string;\n /**\n * The click event handler for the Button\n */\n onClick?: MuiButtonProps[\"onClick\"];\n /**\n * The size of the button\n */\n size?: (typeof buttonSizeValues)[number];\n /**\n * The icon element to display at the start of the Button\n */\n startIcon?: ReactElement;\n /**\n * The tooltip text for the Button if it's icon-only\n */\n tooltipText?: string;\n /**\n * The type of the HTML button element\n */\n type?: (typeof buttonTypeValues)[number];\n /**\n * The variant of the Button\n */\n variant: (typeof buttonVariantValues)[number] | \"tertiary\";\n} & (\n | {\n endIcon?: ReactElement;\n label: string;\n startIcon?: ReactElement;\n }\n | {\n endIcon?: ReactElement;\n label?: \"\" | undefined;\n startIcon: ReactElement;\n }\n | {\n endIcon: ReactElement;\n label?: \"\" | undefined;\n startIcon?: ReactElement;\n }\n) &\n Pick<\n HtmlProps,\n | \"ariaControls\"\n | \"ariaDescribedBy\"\n | \"ariaExpanded\"\n | \"ariaHasPopup\"\n | \"ariaLabel\"\n | \"ariaLabelledBy\"\n | \"tabIndex\"\n | \"testId\"\n | \"translate\"\n >;\n\nconst Button = ({\n ariaControls,\n ariaDescribedBy,\n ariaExpanded,\n ariaHasPopup,\n ariaLabel,\n ariaLabelledBy,\n buttonRef,\n endIcon,\n id,\n isDisabled,\n isFullWidth: isFullWidthProp,\n label = \"\",\n onClick,\n size = \"medium\",\n startIcon,\n tabIndex,\n testId,\n tooltipText,\n translate,\n type = \"button\",\n variant: variantProp,\n}: ButtonProps) => {\n const muiProps = useMuiProps();\n\n // We're deprecating the \"tertiary\" variant, so map it to\n // \"secondary\" in lieu of making a breaking change\n const variant = variantProp === \"tertiary\" ? \"secondary\" : variantProp;\n const localButtonRef = useRef<HTMLButtonElement>(null);\n const buttonContext = useButton();\n const isFullWidth = useMemo(\n () =>\n buttonContext.isFullWidth ? buttonContext.isFullWidth : isFullWidthProp,\n [buttonContext, isFullWidthProp],\n );\n\n useImperativeHandle(\n buttonRef,\n () => {\n return {\n focus: () => {\n localButtonRef.current?.focus();\n },\n };\n },\n [],\n );\n\n const renderButton = useCallback(\n (muiProps: MuiPropsContextType) => {\n //@ts-expect-error ref is not an optional prop on the props context type\n muiProps?.ref?.(localButtonRef.current);\n\n return (\n <MuiButton\n {...muiProps}\n aria-controls={ariaControls}\n aria-describedby={ariaDescribedBy}\n aria-expanded={ariaExpanded}\n aria-haspopup={ariaHasPopup}\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledBy}\n data-se={testId}\n disabled={isDisabled}\n endIcon={endIcon}\n fullWidth={buttonContext.isFullWidth ?? isFullWidth}\n id={id}\n onClick={onClick}\n ref={localButtonRef}\n size={size}\n startIcon={startIcon}\n tabIndex={tabIndex}\n translate={translate}\n type={type}\n variant={variant}\n >\n {label}\n </MuiButton>\n );\n },\n [\n ariaControls,\n ariaDescribedBy,\n ariaExpanded,\n ariaHasPopup,\n ariaLabel,\n ariaLabelledBy,\n endIcon,\n id,\n isDisabled,\n isFullWidth,\n buttonContext.isFullWidth,\n label,\n onClick,\n size,\n startIcon,\n tabIndex,\n testId,\n translate,\n type,\n variant,\n ],\n );\n\n if (tooltipText) {\n return (\n <Tooltip ariaType=\"description\" placement=\"top\" text={tooltipText}>\n <MuiPropsContext.Consumer>{renderButton}</MuiPropsContext.Consumer>\n </Tooltip>\n );\n }\n\n return renderButton(muiProps);\n};\n\nconst MemoizedButton = memo(Button);\nMemoizedButton.displayName = \"Button\";\n\nexport { MemoizedButton as Button };\n"],"mappings":";AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAIA,SACEA,IAAI,EAEJC,WAAW,EACXC,mBAAmB,EACnBC,OAAO,EACPC,MAAM,QACD,OAAO;AAAC,SAENC,SAAS;AAAA,SAIhBC,eAAe,EAEfC,WAAW;AAAA,SAEJC,OAAO;AAAA,SAAAC,GAAA,IAAAC,IAAA;AAEhB,OAAO,MAAMC,gBAAgB,GAAG,CAAC,OAAO,EAAE,QAAQ,EAAE,OAAO,CAAU;AACrE,OAAO,MAAMC,gBAAgB,GAAG,CAAC,QAAQ,EAAE,QAAQ,EAAE,OAAO,CAAU;AACtE,OAAO,MAAMC,mBAAmB,GAAG,CACjC,SAAS,EACT,WAAW,EACX,QAAQ,EACR,UAAU,CACF;AAiFV,MAAMC,MAAM,GAAGA,CAAC;EACdC,YAAY;EACZC,eAAe;EACfC,YAAY;EACZC,YAAY;EACZC,SAAS;EACTC,cAAc;EACdC,SAAS;EACTC,OAAO;EACPC,EAAE;EACFC,UAAU;EACVC,WAAW,EAA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AAEL,cAAe;MACpBV,IAAI,EAAEA,IAAK;MACXC,SAAS,EAAEA,SAAU;MACrBC,QAAQ,EAAEA,QAAS;MACnBG,SAAS,EAAEA,SAAU;MACrBC,IAAI,EAAEA,IAAK;MACXC,OAAO,EAAEA,OAAQ;MAAAY,QAAA,EAEhBrB;IAAK,CACG,CAAC;EAEhB,CAAC,EACD,CACEZ,YAAY,EACZC,eAAe,EACfC,YAAY,EACZC,YAAY,EACZC,SAAS,EACTC,cAAc,EACdE,OAAO,EACPC,EAAE,EACFC,UAAU,EACVC,WAAW,EACXe,aAAa,CAACf,WAAW,EACzBE,KAAK,EACLC,OAAO,EACPC,IAAI,EACJC,SAAS,EACTC,QAAQ,EACRC,MAAM,EACNE,SAAS,EACTC,IAAI,EACJC,OAAO,CAEX,CAAC;EAED,IAAIH,WAAW,EAAE;IACf,OACEvB,IAAA,CAACF,OAAO;MAACyC,QAAQ,EAAC,aAAa;MAACC,SAAS,EAAC,KAAK;MAACC,IAAI,EAAElB,WAAY;MAAAe,QAAA,EAChEtC,IAAA,CAACJ,eAAe,CAAC8C,QAAQ;QAAAJ,QAAA,EAAEL;MAAY,CAA2B;IAAC,CAC5D,CAAC;EAEd;EAEA,OAAOA,YAAY,CAACL,QAAQ,CAAC;AAC/B,CAAC;AAED,MAAMe,cAAc,GAAGrD,IAAI,CAACc,MAAM,CAAC;AACnCuC,cAAc,CAACC,WAAW,GAAG,QAAQ;AAErC,SAASD,cAAc,IAAIvC,MAAM"}
@@ -1 +1 @@
1
- {"version":3,"file":"Callout.js","names":["memo","ScreenReaderText","useTranslation","Link","Paragraph","jsx","_jsx","jsxs","_jsxs","calloutRoleValues","calloutSeverityValues","Callout","children","linkText","linkUrl","role","severity","testId","text","title","translate","t","_Alert","variant","_AlertTitle","_Box","component","href","MemoizedCallout","displayName"],"sources":["../src/Callout.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, ReactNode } from \"react\";\nimport { Alert, AlertTitle, Box } from \"@mui/material\";\nimport { ScreenReaderText } from \"./ScreenReaderText\";\nimport { useTranslation } from \"react-i18next\";\n\nimport type { HtmlProps } from \"./HtmlProps\";\nimport { Link } from \"./Link\";\nimport { Paragraph } from \"./Typography\";\n\nexport const calloutRoleValues = [\"status\", \"alert\"] as const;\nexport const calloutSeverityValues = [\n \"success\",\n \"info\",\n \"warning\",\n \"error\",\n] as const;\n\nexport type CalloutProps = {\n /**\n * The contents of the Callout\n */\n children?: ReactNode;\n /**\n * Sets the ARIA role of the Callout\n * (\"status\" for something that dynamically updates, \"alert\" for errors, null for something\n * unchanging)\n */\n role?: (typeof calloutRoleValues)[number];\n /**\n * Determine the color and icon of the Callout\n */\n severity: (typeof calloutSeverityValues)[number];\n /**\n * The text content of the Callout\n */\n text?: string;\n /**\n * The title of the Callout\n */\n title?: string;\n} & (\n | {\n text: string;\n children?: never;\n }\n | {\n text?: never;\n children: ReactNode;\n }\n) &\n (\n | {\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 linkUrl: string;\n /**\n * If defined, the Toast will include a link to the URL\n */\n linkText: string;\n }\n | {\n linkUrl?: never;\n linkText?: never;\n }\n ) &\n HtmlProps;\n\nconst Callout = ({\n children,\n linkText,\n linkUrl,\n role,\n severity,\n testId,\n text,\n title,\n translate,\n}: CalloutProps) => {\n const { t } = useTranslation();\n\n return (\n <Alert data-se={testId} role={role} severity={severity} variant=\"callout\">\n <ScreenReaderText translate={translate}>\n {t(`severity.${severity}`)}\n </ScreenReaderText>\n {title && <AlertTitle translate={translate}>{title}</AlertTitle>}\n {children && <Box component=\"div\">{children}</Box>}\n {text && <Paragraph>{text}</Paragraph>}\n {linkUrl && (\n <Link href={linkUrl} variant=\"monochrome\">\n {linkText}\n </Link>\n )}\n </Alert>\n );\n};\n\nconst MemoizedCallout = memo(Callout);\nMemoizedCallout.displayName = \"Callout\";\n\nexport { MemoizedCallout as Callout };\n"],"mappings":";;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,IAAI,QAAmB,OAAO;AAAC,SAE/BC,gBAAgB;AACzB,SAASC,cAAc,QAAQ,eAAe;AAAC,SAGtCC,IAAI;AAAA,SACJC,SAAS;AAAA,SAAAC,GAAA,IAAAC,IAAA;AAAA,SAAAC,IAAA,IAAAC,KAAA;AAElB,OAAO,MAAMC,iBAAiB,GAAG,CAAC,QAAQ,EAAE,OAAO,CAAU;AAC7D,OAAO,MAAMC,qBAAqB,GAAG,CACnC,SAAS,EACT,MAAM,EACN,SAAS,EACT,OAAO,CACC;AAuDV,MAAMC,OAAO,GAAGA,CAAC;EACfC,QAAQ;EACRC,QAAQ;EACRC,OAAO;EACPC,IAAI;EACJC,QAAQ;EACRC,MAAM;EACNC,IAAI;EACJC,KAAK;EACLC;AACY,CAAC,KAAK;EAClB,MAAM;IAAEC;EAAE,CAAC,GAAGnB,cAAc,CAAC,CAAC;EAE9B,OACEM,KAAA,CAAAc,MAAA;IAAO,WAASL,MAAO;IAACF,IAAI,EAAEA,IAAK;IAACC,QAAQ,EAAEA,QAAS;IAACO,OAAO,EAAC,SAAS;IAAAX,QAAA,GACvEN,IAAA,CAACL,gBAAgB;MAACmB,SAAS,EAAEA,SAAU;MAAAR,QAAA,EACpCS,CAAC,CAAE,YAAWL,QAAS,EAAC;IAAC,CACV,CAAC,EAClBG,KAAK,IAAIb,IAAA,CAAAkB,WAAA;MAAYJ,SAAS,EAAEA,SAAU;MAAAR,QAAA,EAAEO;IAAK,CAAa,CAAC,EAC/DP,QAAQ,IAAIN,IAAA,CAAAmB,IAAA;MAAKC,SAAS,EAAC,KAAK;MAAAd,QAAA,EAAEA;IAAQ,CAAM,CAAC,EACjDM,IAAI,IAAIZ,IAAA,CAACF,SAAS;MAAAQ,QAAA,EAAEM;IAAI,CAAY,CAAC,EACrCJ,OAAO,IACNR,IAAA,CAACH,IAAI;MAACwB,IAAI,EAAEb,OAAQ;MAACS,OAAO,EAAC,YAAY;MAAAX,QAAA,EACtCC;IAAQ,CACL,CACP;EAAA,CACI,CAAC;AAEZ,CAAC;AAED,MAAMe,eAAe,GAAG5B,IAAI,CAACW,OAAO,CAAC;AACrCiB,eAAe,CAACC,WAAW,GAAG,SAAS;AAEvC,SAASD,eAAe,IAAIjB,OAAO"}
1
+ {"version":3,"file":"Callout.js","names":["memo","ScreenReaderText","useTranslation","Link","Paragraph","jsx","_jsx","jsxs","_jsxs","calloutRoleValues","calloutSeverityValues","Callout","children","linkText","linkUrl","role","severity","testId","text","title","translate","t","_Alert","variant","_AlertTitle","_Box","component","href","MemoizedCallout","displayName"],"sources":["../src/Callout.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, ReactNode } from \"react\";\nimport { Alert, AlertTitle, Box } from \"@mui/material\";\nimport { ScreenReaderText } from \"./ScreenReaderText\";\nimport { useTranslation } from \"react-i18next\";\n\nimport type { HtmlProps } from \"./HtmlProps\";\nimport { Link } from \"./Link\";\nimport { Paragraph } from \"./Typography\";\n\nexport const calloutRoleValues = [\"status\", \"alert\"] as const;\nexport const calloutSeverityValues = [\n \"success\",\n \"info\",\n \"warning\",\n \"error\",\n] as const;\n\nexport type CalloutProps = {\n /**\n * The contents of the Callout\n */\n children?: ReactNode;\n /**\n * Sets the ARIA role of the Callout\n * (\"status\" for something that dynamically updates, \"alert\" for errors, null for something\n * unchanging)\n */\n role?: (typeof calloutRoleValues)[number];\n /**\n * Determine the color and icon of the Callout\n */\n severity: (typeof calloutSeverityValues)[number];\n /**\n * The text content of the Callout\n */\n text?: string;\n /**\n * The title of the Callout\n */\n title?: string;\n} & (\n | {\n text: string;\n children?: never;\n }\n | {\n text?: never;\n children: ReactNode;\n }\n) &\n (\n | {\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 linkUrl: string;\n /**\n * If defined, the Toast will include a link to the URL\n */\n linkText: string;\n }\n | {\n linkUrl?: never;\n linkText?: never;\n }\n ) &\n Pick<HtmlProps, \"testId\" | \"translate\">;\n\nconst Callout = ({\n children,\n linkText,\n linkUrl,\n role,\n severity,\n testId,\n text,\n title,\n translate,\n}: CalloutProps) => {\n const { t } = useTranslation();\n\n return (\n <Alert data-se={testId} role={role} severity={severity} variant=\"callout\">\n <ScreenReaderText translate={translate}>\n {t(`severity.${severity}`)}\n </ScreenReaderText>\n {title && <AlertTitle translate={translate}>{title}</AlertTitle>}\n {children && <Box component=\"div\">{children}</Box>}\n {text && <Paragraph>{text}</Paragraph>}\n {linkUrl && (\n <Link href={linkUrl} variant=\"monochrome\">\n {linkText}\n </Link>\n )}\n </Alert>\n );\n};\n\nconst MemoizedCallout = memo(Callout);\nMemoizedCallout.displayName = \"Callout\";\n\nexport { MemoizedCallout as Callout };\n"],"mappings":";;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,IAAI,QAAmB,OAAO;AAAC,SAE/BC,gBAAgB;AACzB,SAASC,cA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AACW,OAAO,CAAC;AACrCiB,eAAe,CAACC,WAAW,GAAG,SAAS;AAEvC,SAASD,eAAe,IAAIjB,OAAO"}
@@ -1 +1 @@
1
- {"version":3,"file":"Checkbox.js","names":["useTranslation","memo","useCallback","useMemo","useRef","useImperativeHandle","ComponentControlledState","getControlState","Typography","jsxs","_jsxs","Fragment","_Fragment","jsx","_jsx","checkboxValidityValues","Checkbox","ariaLabel","ariaLabelledBy","id","idOverride","inputRef","isChecked","isDefaultChecked","isDisabled","isIndeterminate","isRequired","label","labelProp","hint","name","nameOverride","onChange","onChangeProp","onBlur","onBlurProp","testId","translate","validity","value","t","controlledStateRef","controlledValue","uncontrolledValue","inputValues","current","CONTROLLED","checked","defaultChecked","localInputRef","focus","children","component","color","_FormHelperText","event","_FormControlLabel","sx","alignItems","className","control","_Checkbox","indeterminate","required","inputProps","marginBlockStart","disabled","MemoizedCheckbox","displayName"],"sources":["../src/Checkbox.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 { useTranslation } from \"react-i18next\";\nimport { memo, useCallback, useMemo, useRef, useImperativeHandle } from \"react\";\nimport {\n Checkbox as MuiCheckbox,\n CheckboxProps as MuiCheckboxProps,\n FormControlLabel,\n FormControlLabelProps as MuiFormControlLabelProps,\n FormHelperText,\n} from \"@mui/material\";\n\nimport { FieldComponentProps } from \"./FieldComponentProps\";\nimport { CheckedFieldProps } from \"./FormCheckedProps\";\nimport type { HtmlProps } from \"./HtmlProps\";\nimport {\n ComponentControlledState,\n FocusHandle,\n getControlState,\n} from \"./inputUtils\";\nimport { Typography } from \"./Typography\";\n\nexport const checkboxValidityValues = [\"valid\", \"invalid\", \"inherit\"] as const;\n\nexport type CheckboxProps = {\n /**\n * The ARIA label for the Checkbox\n */\n ariaLabel?: string;\n /**\n * The ID of the element that labels the Checkbox\n */\n ariaLabelledBy?: string;\n /**\n * The id of the `input` element.\n */\n id?: string;\n /**\n * The ref forwarded to the Checkbox\n */\n inputRef?: React.RefObject<FocusHandle>;\n /**\n * Determines whether the Checkbox is disabled\n */\n isDisabled?: boolean;\n /**\n * Determines whether the Checkbox is in an indeterminate state\n */\n isIndeterminate?: boolean;\n /**\n * Determines whether the Checkbox is required\n */\n isRequired?: boolean;\n /**\n * The label text for the Checkbox\n */\n label?: string;\n /**\n * The helper text content\n */\n hint?: string;\n /**\n * The checkbox validity, if different from its enclosing group. Defaults to \"inherit\".\n */\n validity?: (typeof checkboxValidityValues)[number];\n /**\n * The value attribute of the Checkbox\n */\n value?: string;\n /**\n * Callback fired when the blur event happens. Provides event value.\n */\n onBlur?: MuiFormControlLabelProps[\"onBlur\"];\n} & Pick<FieldComponentProps, \"id\" | \"isDisabled\" | \"name\"> &\n CheckedFieldProps<MuiCheckboxProps> &\n HtmlProps;\n\nconst Checkbox = ({\n ariaLabel,\n ariaLabelledBy,\n id: idOverride,\n inputRef,\n isChecked,\n isDefaultChecked,\n isDisabled,\n isIndeterminate,\n isRequired,\n label: labelProp,\n hint,\n name: nameOverride,\n onChange: onChangeProp,\n onBlur: onBlurProp,\n testId,\n translate,\n validity = \"inherit\",\n value,\n}: CheckboxProps) => {\n const { t } = useTranslation();\n const controlledStateRef = useRef(\n getControlState({\n controlledValue: isChecked,\n uncontrolledValue: isDefaultChecked,\n })\n );\n const inputValues = useMemo(() => {\n if (controlledStateRef.current === ComponentControlledState.CONTROLLED) {\n return { checked: isChecked };\n }\n return { defaultChecked: isDefaultChecked };\n }, [isDefaultChecked, isChecked]);\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 label = useMemo(() => {\n return (\n <>\n {labelProp}\n {isRequired && (\n <>\n {\" \"}\n <Typography component=\"span\" color=\"textSecondary\">\n ({t(\"fieldlabel.required.text\")})\n </Typography>\n </>\n )}\n {hint && <FormHelperText translate={translate}>{hint}</FormHelperText>}\n </>\n );\n }, [isRequired, labelProp, hint, t, translate]);\n\n const onChange = useCallback<NonNullable<MuiCheckboxProps[\"onChange\"]>>(\n (event, checked) => {\n onChangeProp?.(event, checked);\n },\n [onChangeProp]\n );\n\n const onBlur = useCallback<NonNullable<MuiFormControlLabelProps[\"onBlur\"]>>(\n (event) => {\n onBlurProp?.(event);\n },\n [onBlurProp]\n );\n\n return (\n <FormControlLabel\n sx={{ alignItems: \"flex-start\" }}\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledBy}\n className={\n validity === \"invalid\"\n ? \"Mui-error\"\n : validity === \"valid\"\n ? \"Mui-valid\"\n : \"\"\n }\n control={\n <MuiCheckbox\n {...inputValues}\n indeterminate={isIndeterminate}\n onChange={onChange}\n required={isRequired}\n inputProps={{\n \"data-se\": testId,\n }}\n inputRef={localInputRef}\n sx={() => ({\n marginBlockStart: \"2px\",\n })}\n />\n }\n disabled={isDisabled}\n id={idOverride}\n label={label}\n name={nameOverride ?? idOverride}\n value={value}\n required={isRequired}\n onBlur={onBlur}\n translate={translate}\n />\n );\n};\n\nconst MemoizedCheckbox = memo(Checkbox);\nMemoizedCheckbox.displayName = \"Checkbox\";\n\nexport { MemoizedCheckbox as Checkbox };\n"],"mappings":";;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,cAAc,QAAQ,eAAe;AAC9C,SAASC,IAAI,EAAEC,WAAW,EAAEC,OAAO,EAAEC,MAAM,EAAEC,mBAAmB,QAAQ,OAAO;AAAC,SAa9EC,wBAAwB,EAExBC,eAAe;AAAA,SAER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AAW;MACrBsC,UAAU,EAAE;QACV,SAAS,EAAE5B;MACb,CAAE;MACFf,QAAQ,EAAE4B,aAAc;MACxBQ,EAAE,EAAEA,CAAA,MAAO;QACTQ,gBAAgB,EAAE;MACpB,CAAC;IAAE,CACJ,CACF;IACDC,QAAQ,EAAE1C,UAAW;IACrBL,EAAE,EAAEC,UAAW;IACfO,KAAK,EAAEA,KAAM;IACbG,IAAI,EAAEC,YAAY,IAAIX,UAAW;IACjCmB,KAAK,EAAEA,KAAM;IACbwB,QAAQ,EAAErC,UAAW;IACrBQ,MAAM,EAAEA,MAAO;IACfG,SAAS,EAAEA;EAAU,CACtB,CAAC;AAEN,CAAC;AAED,MAAM8B,gBAAgB,GAAGlE,IAAI,CAACe,QAAQ,CAAC;AACvCmD,gBAAgB,CAACC,WAAW,GAAG,UAAU;AAEzC,SAASD,gBAAgB,IAAInD,QAAQ"}
1
+ {"version":3,"file":"Checkbox.js","names":["useTranslation","memo","useCallback","useMemo","useRef","useImperativeHandle","ComponentControlledState","getControlState","Typography","jsxs","_jsxs","Fragment","_Fragment","jsx","_jsx","checkboxValidityValues","Checkbox","ariaLabel","ariaLabelledBy","id","idOverride","inputRef","isChecked","isDefaultChecked","isDisabled","isIndeterminate","isRequired","label","labelProp","hint","name","nameOverride","onChange","onChangeProp","onBlur","onBlurProp","testId","translate","validity","value","t","controlledStateRef","controlledValue","uncontrolledValue","inputValues","current","CONTROLLED","checked","defaultChecked","localInputRef","focus","children","component","color","_FormHelperText","event","_FormControlLabel","sx","alignItems","className","control","_Checkbox","indeterminate","required","inputProps","marginBlockStart","disabled","MemoizedCheckbox","displayName"],"sources":["../src/Checkbox.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 { useTranslation } from \"react-i18next\";\nimport { memo, useCallback, useMemo, useRef, useImperativeHandle } from \"react\";\nimport {\n Checkbox as MuiCheckbox,\n CheckboxProps as MuiCheckboxProps,\n FormControlLabel,\n FormControlLabelProps as MuiFormControlLabelProps,\n FormHelperText,\n} from \"@mui/material\";\n\nimport { CheckedFieldProps } from \"./FormCheckedProps\";\nimport type { HtmlProps } from \"./HtmlProps\";\nimport {\n ComponentControlledState,\n FocusHandle,\n getControlState,\n} from \"./inputUtils\";\nimport { FieldComponentProps } from \"./FieldComponentProps\";\nimport { Typography } from \"./Typography\";\n\nexport const checkboxValidityValues = [\"valid\", \"invalid\", \"inherit\"] as const;\n\nexport type CheckboxProps = {\n /**\n * The ref forwarded to the Checkbox\n */\n inputRef?: React.RefObject<FocusHandle>;\n /**\n * Determines whether the Checkbox is in an indeterminate state\n */\n isIndeterminate?: boolean;\n /**\n * Determines whether the Checkbox is required\n */\n isRequired?: boolean;\n /**\n * The label text for the Checkbox\n */\n label?: string;\n /**\n * The checkbox validity, if different from its enclosing group. Defaults to \"inherit\".\n */\n validity?: (typeof checkboxValidityValues)[number];\n /**\n * The value attribute of the Checkbox\n */\n value?: string;\n /**\n * Callback fired when the blur event happens. Provides event value.\n */\n onBlur?: MuiFormControlLabelProps[\"onBlur\"];\n} & Pick<FieldComponentProps, \"hint\" | \"id\" | \"isDisabled\" | \"name\"> &\n CheckedFieldProps<MuiCheckboxProps> &\n Pick<HtmlProps, \"ariaLabel\" | \"ariaLabelledBy\" | \"testId\" | \"translate\">;\n\nconst Checkbox = ({\n ariaLabel,\n ariaLabelledBy,\n id: idOverride,\n inputRef,\n isChecked,\n isDefaultChecked,\n isDisabled,\n isIndeterminate,\n isRequired,\n label: labelProp,\n hint,\n name: nameOverride,\n onChange: onChangeProp,\n onBlur: onBlurProp,\n testId,\n translate,\n validity = \"inherit\",\n value,\n}: CheckboxProps) => {\n const { t } = useTranslation();\n const controlledStateRef = useRef(\n getControlState({\n controlledValue: isChecked,\n uncontrolledValue: isDefaultChecked,\n }),\n );\n const inputValues = useMemo(() => {\n if (controlledStateRef.current === ComponentControlledState.CONTROLLED) {\n return { checked: isChecked };\n }\n return { defaultChecked: isDefaultChecked };\n }, [isDefaultChecked, isChecked]);\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 label = useMemo(() => {\n return (\n <>\n {labelProp}\n {isRequired && (\n <>\n {\" \"}\n <Typography component=\"span\" color=\"textSecondary\">\n ({t(\"fieldlabel.required.text\")})\n </Typography>\n </>\n )}\n {hint && <FormHelperText translate={translate}>{hint}</FormHelperText>}\n </>\n );\n }, [isRequired, labelProp, hint, t, translate]);\n\n const onChange = useCallback<NonNullable<MuiCheckboxProps[\"onChange\"]>>(\n (event, checked) => {\n onChangeProp?.(event, checked);\n },\n [onChangeProp],\n );\n\n const onBlur = useCallback<NonNullable<MuiFormControlLabelProps[\"onBlur\"]>>(\n (event) => {\n onBlurProp?.(event);\n },\n [onBlurProp],\n );\n\n return (\n <FormControlLabel\n sx={{ alignItems: \"flex-start\" }}\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledBy}\n className={\n validity === \"invalid\"\n ? \"Mui-error\"\n : validity === \"valid\"\n ? \"Mui-valid\"\n : \"\"\n }\n control={\n <MuiCheckbox\n {...inputValues}\n indeterminate={isIndeterminate}\n onChange={onChange}\n required={isRequired}\n inputProps={{\n \"data-se\": testId,\n }}\n inputRef={localInputRef}\n sx={() => ({\n marginBlockStart: \"2px\",\n })}\n />\n }\n disabled={isDisabled}\n id={idOverride}\n label={label}\n name={nameOverride ?? idOverride}\n value={value}\n required={isRequired}\n onBlur={onBlur}\n translate={translate}\n />\n );\n};\n\nconst Memo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E;MAAEC,UAAU,EAAE;IAAa,CAAE;IACjC,cAAYzC,SAAU;IACtB,mBAAiBC,cAAe;IAChCyC,SAAS,EACPrB,QAAQ,KAAK,SAAS,GAClB,WAAW,GACXA,QAAQ,KAAK,OAAO,GAClB,WAAW,GACX,EACP;IACDsB,OAAO,EACL9C,IAAA,CAAA+C,SAAA;MAAA,GACMjB,WAAW;MACfkB,aAAa,EAAErC,eAAgB;MAC/BO,QAAQ,EAAEA,QAAS;MACnB+B,QAAQ,EAAErC,UAAW;MACrBsC,UAAU,EAAE;QACV,SAAS,EAAE5B;MACb,CAAE;MACFf,QAAQ,EAAE4B,aAAc;MACxBQ,EAAE,EAAEA,CAAA,MAAO;QACTQ,gBAAgB,EAAE;MACpB,CAAC;IAAE,CACJ,CACF;IACDC,QAAQ,EAAE1C,UAAW;IACrBL,EAAE,EAAEC,UAAW;IACfO,KAAK,EAAEA,KAAM;IACbG,IAAI,EAAEC,YAAY,IAAIX,UAAW;IACjCmB,KAAK,EAAEA,KAAM;IACbwB,QAAQ,EAAErC,UAAW;IACrBQ,MAAM,EAAEA,MAAO;IACfG,SAAS,EAAEA;EAAU,CACtB,CAAC;AAEN,CAAC;AAED,MAAM8B,gBAAgB,GAAGlE,IAAI,CAACe,QAAQ,CAAC;AACvCmD,gBAAgB,CAACC,WAAW,GAAG,UAAU;AAEzC,SAASD,gBAAgB,IAAInD,QAAQ"}
@@ -1 +1 @@
1
- {"version":3,"file":"CheckboxGroup.js","names":["memo","useCallback","Field","jsx","_jsx","CheckboxGroup","ariaDescribedBy","children","errorMessage","errorMessageList","hint","HintLinkComponent","id","idOverride","isDisabled","isRequired","label","testId","translate","renderFieldComponent","errorMessageElementId","labelElementId","_FormGroup","fieldType","hasVisibleLabel","isOptional","MemoizedCheckboxGroup","displayName"],"sources":["../src/CheckboxGroup.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 { FormGroup as MuiFormGroup } from \"@mui/material\";\nimport { memo, ReactElement, useCallback } from \"react\";\n\nimport { Checkbox } from \"./Checkbox\";\nimport { Field } from \"./Field\";\nimport { FieldComponentProps } from \"./FieldComponentProps\";\nimport type { HtmlProps } from \"./HtmlProps\";\n\nexport type CheckboxGroupProps = {\n /**\n * A single Checkbox element or an array of Checkbox elements\n */\n children:\n | ReactElement<typeof Checkbox>\n | Array<ReactElement<typeof Checkbox>>;\n /**\n * If `true`, the CheckboxGroup is required\n */\n isRequired?: boolean;\n /**\n * The label text for the CheckboxGroup\n */\n label: string;\n} & Pick<\n FieldComponentProps,\n | \"ariaDescribedBy\"\n | \"errorMessage\"\n | \"errorMessageList\"\n | \"hint\"\n | \"HintLinkComponent\"\n | \"id\"\n | \"isDisabled\"\n> &\n HtmlProps;\n\nconst CheckboxGroup = ({\n ariaDescribedBy,\n children,\n errorMessage,\n errorMessageList,\n hint,\n HintLinkComponent,\n id: idOverride,\n isDisabled,\n isRequired = false,\n label,\n testId,\n translate,\n}: CheckboxGroupProps) => {\n const renderFieldComponent = useCallback(\n ({ ariaDescribedBy, errorMessageElementId, id, labelElementId }) => (\n <MuiFormGroup\n aria-describedby={ariaDescribedBy}\n aria-errormessage={errorMessageElementId}\n aria-labelledby={labelElementId}\n data-se={testId}\n id={id}\n translate={translate}\n >\n {children}\n </MuiFormGroup>\n ),\n [children, testId, translate]\n );\n\n return (\n <Field\n ariaDescribedBy={ariaDescribedBy}\n errorMessage={errorMessage}\n errorMessageList={errorMessageList}\n fieldType=\"group\"\n hasVisibleLabel={true}\n hint={hint}\n HintLinkComponent={HintLinkComponent}\n id={idOverride}\n isDisabled={isDisabled}\n isOptional={!isRequired}\n label={label}\n renderFieldComponent={renderFieldComponent}\n />\n );\n};\n\nconst MemoizedCheckboxGroup = memo(CheckboxGroup);\nMemoizedCheckboxGroup.displayName = \"CheckboxGroup\";\n\nexport { MemoizedCheckboxGroup as CheckboxGroup };\n"],"mappings":";AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAGA,SAASA,IAAI,EAAgBC,WAAW,QAAQ,OAAO;AAAC,SAG/CC,KAAK;AAAA,SAAAC,GAAA,IAAAC,IAAA;AA+Bd,MAAMC,aAAa,GAAGA,CAAC;EACrBC,eAAe;EACfC,QAAQ;EACRC,YAAY;EACZC,gBAAgB;EAChBC,IAAI;EACJC,iBAAiB;EACjBC,EAAE,EAAEC,UAAU;EACdC,UAAU;EACVC,UAAU,GAAG,KAAK;EAClBC,KAAK;EACLC,MAAM;EACNC;AACkB,CAAC,KAAK;EACxB,MAAMC,oBAAoB,GAAGlB,WAAW,CACtC,CAAC;IAAEK,eAAe;IAAEc,qBAAqB;IAAER,EAAE;IAAES;EAAe,CAAC,KAC7DjB,IAAA,CAAAkB,UAAA;IACE,oBAAkBhB,eAAgB;IAClC,qBAAmBc,qBAAsB;IACzC,mBAAiBC,cAAe;IAChC,WAASJ,MAAO;IAChBL,EAAE,EAAEA,EAAG;IACPM,SAAS,EAAEA,SAAU;IAAAX,QAAA,EAEpBA;EAAQ,CACG,CACf,EACD,CAACA,QAAQ,EAAEU,MAAM,EAAEC,SAAS,CAC9B,CAAC;EAED,OACEd,IAAA,CAACF,KAAK;IACJI,eAAe,EAAEA,eAAgB;IACjCE,YAAY,EAAEA,YAAa;IAC3BC,gBAAgB,EAAEA,gBAAiB;IACnCc,SAAS,EAAC,OAAO;IACjBC,eAAe,EAAE,IAAK;IACtBd,IAAI,EAAEA,IAAK;IACXC,iBAAiB,EAAEA,iBAAkB;IACrCC,EAAE,EAAEC,UAAW;IACfC,UAAU,EAAEA,UAAW;IACvBW,UAAU,EAAE,CAACV,UAAW;IACxBC,KAAK,EAAEA,KAAM;IACbG,oBAAoB,EAAEA;EAAqB,CAC5C,CAAC;AAEN,CAAC;AAED,MAAMO,qBAAqB,GAAG1B,IAAI,CAACK,aAAa,CAAC;AACjDqB,qBAAqB,CAACC,WAAW,GAAG,eAAe;AAEnD,SAASD,qBAAqB,IAAIrB,aAAa"}
1
+ {"version":3,"file":"CheckboxGroup.js","names":["memo","useCallback","Field","jsx","_jsx","CheckboxGroup","ariaDescribedBy","children","errorMessage","errorMessageList","hint","HintLinkComponent","id","idOverride","isDisabled","isRequired","label","testId","translate","renderFieldComponent","errorMessageElementId","labelElementId","_FormGroup","fieldType","hasVisibleLabel","isOptional","MemoizedCheckboxGroup","displayName"],"sources":["../src/CheckboxGroup.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 { FormGroup as MuiFormGroup } from \"@mui/material\";\nimport { memo, ReactElement, useCallback } from \"react\";\n\nimport { Checkbox } from \"./Checkbox\";\nimport { Field } from \"./Field\";\nimport {\n FieldComponentProps,\n FieldComponentRenderProps,\n} from \"./FieldComponentProps\";\nimport type { HtmlProps } from \"./HtmlProps\";\n\nexport type CheckboxGroupProps = {\n /**\n * A single Checkbox element or an array of Checkbox elements\n */\n children:\n | ReactElement<typeof Checkbox>\n | Array<ReactElement<typeof Checkbox>>;\n /**\n * If `true`, the CheckboxGroup is required\n */\n isRequired?: boolean;\n /**\n * The label text for the CheckboxGroup\n */\n label: string;\n} & Pick<\n FieldComponentProps,\n | \"errorMessage\"\n | \"errorMessageList\"\n | \"hint\"\n | \"HintLinkComponent\"\n | \"id\"\n | \"isDisabled\"\n> &\n Pick<HtmlProps, \"ariaDescribedBy\" | \"testId\" | \"translate\">;\n\ntype CheckboxGroupRenderProps = Pick<\n FieldComponentRenderProps,\n \"id\" | \"labelElementId\"\n> &\n Partial<\n Pick<FieldComponentRenderProps, \"ariaDescribedBy\" | \"errorMessageElementId\">\n >;\n\nconst CheckboxGroup = ({\n ariaDescribedBy,\n children,\n errorMessage,\n errorMessageList,\n hint,\n HintLinkComponent,\n id: idOverride,\n isDisabled,\n isRequired = false,\n label,\n testId,\n translate,\n}: CheckboxGroupProps) => {\n const renderFieldComponent = useCallback(\n ({\n ariaDescribedBy,\n errorMessageElementId,\n id,\n labelElementId,\n }: CheckboxGroupRenderProps) => (\n <MuiFormGroup\n aria-describedby={ariaDescribedBy}\n aria-errormessage={errorMessageElementId}\n aria-labelledby={labelElementId}\n data-se={testId}\n id={id}\n translate={translate}\n >\n {children}\n </MuiFormGroup>\n ),\n [children, testId, translate],\n );\n\n return (\n <Field\n ariaDescribedBy={ariaDescribedBy}\n errorMessage={errorMessage}\n errorMessageList={errorMessageList}\n fieldType=\"group\"\n hasVisibleLabel={true}\n hint={hint}\n HintLinkComponent={HintLinkComponent}\n id={idOverride}\n isDisabled={isDisabled}\n isOptional={!isRequired}\n label={label}\n renderFieldComponent={renderFieldComponent}\n />\n );\n};\n\nconst MemoizedCheckboxGroup = memo(CheckboxGroup);\nMemoizedCheckboxGroup.displayName = \"CheckboxGroup\";\n\nexport { MemoizedCheckboxGroup as CheckboxGroup };\n"],"mappings":";AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAGA,SAASA,IAAI,EAAgBC,WAAW,QAAQ,OAAO;AAAC,SAG/CC,KAAK;AAAA,SAAAC,GAAA,IAAAC,IAAA;AAyCd,MAAMC,aAAa,GAAGA,CAAC;EACrBC,eAAe;EACfC,QAAQ;EACRC,YAAY;EACZC,gBAAgB;EAChBC,IAAI;EACJC,iBAAiB;EACjBC,EAAE,EAAEC,UAAU;EACdC,UAAU;EACVC,UAAU,GAAG,KAAK;EAClBC,KAAK;EACLC,MAAM;EACNC;AACkB,CAAC,KAAK;EACxB,MAAMC,oBAAoB,GAAGlB,WAAW,CACtC,CAAC;IACCK,eAAe;IACfc,qBAAqB;IACrBR,EAAE;IACFS;EACwB,CAAC,KACzBjB,IAAA,CAAAkB,UAAA;IACE,oBAAkBhB,eAAgB;IAClC,qBAAmBc,qBAAsB;IACzC,mBAAiBC,cAAe;IAChC,WAASJ,MAAO;IAChBL,EAAE,EAAEA,EAAG;IACPM,SAAS,EAAEA,SAAU;IAAAX,QAAA,EAEpBA;EAAQ,CACG,CACf,EACD,CAACA,QAAQ,EAAEU,MAAM,EAAEC,SAAS,CAC9B,CAAC;EAED,OACEd,IAAA,CAACF,KAAK;IACJI,eAAe,EAAEA,eAAgB;IACjCE,YAAY,EAAEA,YAAa;IAC3BC,gBAAgB,EAAEA,gBAAiB;IACnCc,SAAS,EAAC,OAAO;IACjBC,eAAe,EAAE,IAAK;IACtBd,IAAI,EAAEA,IAAK;IACXC,iBAAiB,EAAEA,iBAAkB;IACrCC,EAAE,EAAEC,UAAW;IACfC,UAAU,EAAEA,UAAW;IACvBW,UAAU,EAAE,CAACV,UAAW;IACxBC,KAAK,EAAEA,KAAM;IACbG,oBAAoB,EAAEA;EAAqB,CAC5C,CAAC;AAEN,CAAC;AAED,MAAMO,qBAAqB,GAAG1B,IAAI,CAACK,aAAa,CAAC;AACjDqB,qBAAqB,CAACC,WAAW,GAAG,eAAe;AAEnD,SAASD,qBAAqB,IAAIrB,aAAa"}
@@ -1 +1 @@
1
- {"version":3,"file":"CircularProgress.js","names":["memo","jsx","_jsx","CircularProgress","ariaLabel","testId","value","_CircularProgress","variant","MemoizedCircularProgress","displayName"],"sources":["../src/CircularProgress.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 { CircularProgress as MuiCircularProgress } from \"@mui/material\";\n\nimport type { HtmlProps } from \"./HtmlProps\";\n\nexport type CircularProgressProps = {\n /**\n * The ARIA label for the progress spinner\n */\n ariaLabel?: string;\n /**\n * The percentage filled the spinner should be, as an integer.\n * If undefined, the spinner will spin perpetually.\n */\n value?: number;\n} & HtmlProps;\n\nconst CircularProgress = ({\n ariaLabel,\n testId,\n value,\n}: CircularProgressProps) => (\n <MuiCircularProgress\n data-se={testId}\n value={value}\n variant={value ? \"determinate\" : \"indeterminate\"}\n aria-label={ariaLabel}\n />\n);\n\nconst MemoizedCircularProgress = memo(CircularProgress);\nMemoizedCircularProgress.displayName = \"CircularProgress\";\n\nexport { MemoizedCircularProgress as CircularProgress };\n"],"mappings":";AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,IAAI,QAAQ,OAAO;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAiB7B,MAAMC,gBAAgB,GAAGA,CAAC;EACxBC,SAAS;EACTC,MAAM;EACNC;AACqB,CAAC,KACtBJ,IAAA,CAAAK,iBAAA;EACE,WAASF,MAAO;EAChBC,KAAK,EAAEA,KAAM;EACbE,OAAO,EAAEF,KAAK,GAAG,aAAa,GAAG,eAAgB;EACjD,cAAYF;AAAU,CACvB,CACF;AAED,MAAMK,wBAAwB,GAAGT,IAAI,CAACG,gBAAgB,CAAC;AACvDM,wBAAwB,CAACC,WAAW,GAAG,kBAAkB;AAEzD,SAASD,wBAAwB,IAAIN,gBAAgB"}
1
+ {"version":3,"file":"CircularProgress.js","names":["memo","jsx","_jsx","CircularProgress","ariaLabel","testId","value","_CircularProgress","variant","MemoizedCircularProgress","displayName"],"sources":["../src/CircularProgress.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 { CircularProgress as MuiCircularProgress } from \"@mui/material\";\n\nimport type { HtmlProps } from \"./HtmlProps\";\n\nexport type CircularProgressProps = {\n /**\n * The percentage filled the spinner should be, as an integer.\n * If undefined, the spinner will spin perpetually.\n */\n value?: number;\n} & Pick<HtmlProps, \"ariaLabel\" | \"testId\">;\n\nconst CircularProgress = ({\n ariaLabel,\n testId,\n value,\n}: CircularProgressProps) => (\n <MuiCircularProgress\n data-se={testId}\n value={value}\n variant={value ? \"determinate\" : \"indeterminate\"}\n aria-label={ariaLabel}\n />\n);\n\nconst MemoizedCircularProgress = memo(CircularProgress);\nMemoizedCircularProgress.displayName = \"CircularProgress\";\n\nexport { MemoizedCircularProgress as CircularProgress };\n"],"mappings":";AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,IAAI,QAAQ,OAAO;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAa7B,MAAMC,gBAAgB,GAAGA,CAAC;EACxBC,SAAS;EACTC,MAAM;EACNC;AACqB,CAAC,KACtBJ,IAAA,CAAAK,iBAAA;EACE,WAASF,MAAO;EAChBC,KAAK,EAAEA,KAAM;EACbE,OAAO,EAAEF,KAAK,GAAG,aAAa,GAAG,eAAgB;EACjD,cAAYF;AAAU,CACvB,CACF;AAED,MAAMK,wBAAwB,GAAGT,IAAI,CAACG,gBAAgB,CAAC;AACvDM,wBAAwB,CAACC,WAAW,GAAG,kBAAkB;AAEzD,SAASD,wBAAwB,IAAIN,gBAAgB"}
package/dist/Dialog.js CHANGED
@@ -22,9 +22,9 @@ import { memo, useState, useEffect, useRef } from "react";
22
22
  import { jsx as _jsx } from "react/jsx-runtime";
23
23
  import { jsxs as _jsxs } from "react/jsx-runtime";
24
24
  const Dialog = ({
25
- callToActionFirstComponent,
26
- callToActionSecondComponent,
27
- callToActionLastComponent,
25
+ primaryCallToActionComponent,
26
+ secondaryCallToActionComponent,
27
+ tertiaryCallToActionComponent,
28
28
  children,
29
29
  isOpen,
30
30
  onClose,
@@ -42,6 +42,7 @@ const Dialog = ({
42
42
  const handleContentScroll = () => {
43
43
  const dialogContentElement = dialogContentRef.current;
44
44
  if (dialogContentElement) {
45
+ cancelAnimationFrame(frameId);
45
46
  setIsContentScrollable(dialogContentElement.scrollHeight > dialogContentElement.clientHeight);
46
47
  }
47
48
  frameId = requestAnimationFrame(handleContentScroll);
@@ -64,21 +65,20 @@ const Dialog = ({
64
65
  translate: translate,
65
66
  children: [title, _jsx(Button, {
66
67
  ariaLabel: t("close.text"),
67
- label: "",
68
68
  onClick: onClose,
69
69
  size: "small",
70
70
  startIcon: _jsx(CloseIcon, {}),
71
71
  variant: "floating"
72
72
  })]
73
73
  }), _jsx(_DialogContent, {
74
- dividers: isContentScrollable,
75
- ref: dialogContentRef,
76
74
  ...(isContentScrollable && {
77
75
  tabIndex: 0
78
76
  }),
77
+ dividers: isContentScrollable,
78
+ ref: dialogContentRef,
79
79
  children: content
80
- }), (callToActionFirstComponent || callToActionSecondComponent || callToActionLastComponent) && _jsxs(_DialogActions, {
81
- children: [callToActionLastComponent, callToActionSecondComponent, callToActionFirstComponent]
80
+ }), (primaryCallToActionComponent || secondaryCallToActionComponent || tertiaryCallToActionComponent) && _jsxs(_DialogActions, {
81
+ children: [tertiaryCallToActionComponent, secondaryCallToActionComponent, primaryCallToActionComponent]
82
82
  })]
83
83
  });
84
84
  };