@okta/odyssey-react-mui 0.23.0 → 0.24.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (463) hide show
  1. package/CHANGELOG.md +20 -0
  2. package/README.md +43 -7
  3. package/dist/{src/ThemeProvider.d.ts → @types/i18next.d.js} +4 -7
  4. package/dist/@types/i18next.d.js.map +1 -0
  5. package/dist/Autocomplete.js +13 -3
  6. package/dist/Autocomplete.js.map +1 -1
  7. package/dist/Banner.js +6 -3
  8. package/dist/Banner.js.map +1 -1
  9. package/dist/Button.js +13 -3
  10. package/dist/Button.js.map +1 -1
  11. package/dist/Checkbox.js +44 -10
  12. package/dist/Checkbox.js.map +1 -1
  13. package/dist/CheckboxGroup.js +14 -3
  14. package/dist/CheckboxGroup.js.map +1 -1
  15. package/dist/CircularProgress.js +11 -0
  16. package/dist/CircularProgress.js.map +1 -1
  17. package/dist/Dialog.js +11 -7
  18. package/dist/Dialog.js.map +1 -1
  19. package/dist/Field.js +13 -8
  20. package/dist/Field.js.map +1 -1
  21. package/dist/FieldError.js +6 -3
  22. package/dist/FieldError.js.map +1 -1
  23. package/dist/FieldHint.js +1 -2
  24. package/dist/FieldHint.js.map +1 -1
  25. package/dist/FieldLabel.js +17 -5
  26. package/dist/FieldLabel.js.map +1 -1
  27. package/dist/Fieldset.js +55 -0
  28. package/dist/Fieldset.js.map +1 -0
  29. package/dist/Form.js +69 -0
  30. package/dist/Form.js.map +1 -0
  31. package/dist/Icon.js +2 -3
  32. package/dist/Icon.js.map +1 -1
  33. package/dist/Infobox.js +6 -3
  34. package/dist/Infobox.js.map +1 -1
  35. package/dist/Link.js +6 -2
  36. package/dist/Link.js.map +1 -1
  37. package/dist/MenuButton.js +0 -5
  38. package/dist/MenuButton.js.map +1 -1
  39. package/dist/MenuItem.js +4 -2
  40. package/dist/MenuItem.js.map +1 -1
  41. package/dist/MuiPropsChild.js +3 -1
  42. package/dist/MuiPropsChild.js.map +1 -1
  43. package/dist/MuiPropsContext.js +1 -0
  44. package/dist/MuiPropsContext.js.map +1 -1
  45. package/dist/NativeSelect.js +61 -0
  46. package/dist/NativeSelect.js.map +1 -0
  47. package/dist/OdysseyCacheProvider.js +1 -2
  48. package/dist/OdysseyCacheProvider.js.map +1 -1
  49. package/dist/OdysseyI18n.js +93 -0
  50. package/dist/OdysseyI18n.js.map +1 -0
  51. package/dist/{ThemeProvider.js → OdysseyProvider.js} +20 -8
  52. package/dist/OdysseyProvider.js.map +1 -0
  53. package/dist/OdysseyThemeProvider.js +11 -5
  54. package/dist/OdysseyThemeProvider.js.map +1 -1
  55. package/dist/OdysseyTranslationProvider.js +47 -0
  56. package/dist/OdysseyTranslationProvider.js.map +1 -0
  57. package/dist/OdysseyTranslationProvider.types.js +14 -0
  58. package/dist/OdysseyTranslationProvider.types.js.map +1 -0
  59. package/dist/PasswordField.js +12 -0
  60. package/dist/PasswordField.js.map +1 -1
  61. package/dist/Radio.js +11 -2
  62. package/dist/Radio.js.map +1 -1
  63. package/dist/RadioGroup.js +11 -2
  64. package/dist/RadioGroup.js.map +1 -1
  65. package/dist/ScreenReaderText.js +3 -3
  66. package/dist/ScreenReaderText.js.map +1 -1
  67. package/dist/SearchField.js +11 -0
  68. package/dist/SearchField.js.map +1 -1
  69. package/dist/Select.js +131 -0
  70. package/dist/Select.js.map +1 -0
  71. package/dist/Status.js.map +1 -1
  72. package/dist/Tabs.js +46 -0
  73. package/dist/Tabs.js.map +1 -0
  74. package/dist/Tag.js +11 -2
  75. package/dist/Tag.js.map +1 -1
  76. package/dist/TagList.js +11 -2
  77. package/dist/TagList.js.map +1 -1
  78. package/dist/TagListContext.js +1 -0
  79. package/dist/TagListContext.js.map +1 -1
  80. package/dist/TextField.js +12 -2
  81. package/dist/TextField.js.map +1 -1
  82. package/dist/Toast.js +10 -4
  83. package/dist/Toast.js.map +1 -1
  84. package/dist/ToastStack.js +1 -2
  85. package/dist/ToastStack.js.map +1 -1
  86. package/dist/Tooltip.js +11 -0
  87. package/dist/Tooltip.js.map +1 -1
  88. package/dist/a11yCheck.js +1 -2
  89. package/dist/a11yCheck.js.map +1 -1
  90. package/dist/createUniqueAlphabeticalId.js +1 -2
  91. package/dist/createUniqueAlphabeticalId.js.map +1 -1
  92. package/dist/createUniqueId.js +1 -2
  93. package/dist/createUniqueId.js.map +1 -1
  94. package/dist/iconDictionary/Add.js +1 -2
  95. package/dist/iconDictionary/Add.js.map +1 -1
  96. package/dist/iconDictionary/AddCircle.js +1 -2
  97. package/dist/iconDictionary/AddCircle.js.map +1 -1
  98. package/dist/iconDictionary/AlertCircle.js +1 -2
  99. package/dist/iconDictionary/AlertCircle.js.map +1 -1
  100. package/dist/iconDictionary/AlertCircleFilled.js +1 -2
  101. package/dist/iconDictionary/AlertCircleFilled.js.map +1 -1
  102. package/dist/iconDictionary/AlertTriangleFilled.js +1 -2
  103. package/dist/iconDictionary/AlertTriangleFilled.js.map +1 -1
  104. package/dist/iconDictionary/Anchor.js +1 -2
  105. package/dist/iconDictionary/Anchor.js.map +1 -1
  106. package/dist/iconDictionary/ArrowDown.js +1 -2
  107. package/dist/iconDictionary/ArrowDown.js.map +1 -1
  108. package/dist/iconDictionary/ArrowLeft.js +1 -2
  109. package/dist/iconDictionary/ArrowLeft.js.map +1 -1
  110. package/dist/iconDictionary/ArrowRight.js +1 -2
  111. package/dist/iconDictionary/ArrowRight.js.map +1 -1
  112. package/dist/iconDictionary/ArrowUp.js +1 -2
  113. package/dist/iconDictionary/ArrowUp.js.map +1 -1
  114. package/dist/iconDictionary/ArrowUpDown.js +1 -2
  115. package/dist/iconDictionary/ArrowUpDown.js.map +1 -1
  116. package/dist/iconDictionary/Calendar.js +1 -2
  117. package/dist/iconDictionary/Calendar.js.map +1 -1
  118. package/dist/iconDictionary/Check.js +1 -2
  119. package/dist/iconDictionary/Check.js.map +1 -1
  120. package/dist/iconDictionary/CheckCircleFilled.js +1 -2
  121. package/dist/iconDictionary/CheckCircleFilled.js.map +1 -1
  122. package/dist/iconDictionary/ChevronDown.js +1 -2
  123. package/dist/iconDictionary/ChevronDown.js.map +1 -1
  124. package/dist/iconDictionary/ChevronUp.js +1 -2
  125. package/dist/iconDictionary/ChevronUp.js.map +1 -1
  126. package/dist/iconDictionary/Close.js +1 -2
  127. package/dist/iconDictionary/Close.js.map +1 -1
  128. package/dist/iconDictionary/CloseCircleFilled.js +1 -2
  129. package/dist/iconDictionary/CloseCircleFilled.js.map +1 -1
  130. package/dist/iconDictionary/Copy.js +1 -2
  131. package/dist/iconDictionary/Copy.js.map +1 -1
  132. package/dist/iconDictionary/Delete.js +1 -2
  133. package/dist/iconDictionary/Delete.js.map +1 -1
  134. package/dist/iconDictionary/Download.js +1 -2
  135. package/dist/iconDictionary/Download.js.map +1 -1
  136. package/dist/iconDictionary/DragHandle.js +1 -2
  137. package/dist/iconDictionary/DragHandle.js.map +1 -1
  138. package/dist/iconDictionary/Edit.js +1 -2
  139. package/dist/iconDictionary/Edit.js.map +1 -1
  140. package/dist/iconDictionary/ExternalLink.js +1 -2
  141. package/dist/iconDictionary/ExternalLink.js.map +1 -1
  142. package/dist/iconDictionary/Eye.js +1 -2
  143. package/dist/iconDictionary/Eye.js.map +1 -1
  144. package/dist/iconDictionary/EyeOff.js +1 -2
  145. package/dist/iconDictionary/EyeOff.js.map +1 -1
  146. package/dist/iconDictionary/Filter.js +1 -2
  147. package/dist/iconDictionary/Filter.js.map +1 -1
  148. package/dist/iconDictionary/Globe.js +1 -2
  149. package/dist/iconDictionary/Globe.js.map +1 -1
  150. package/dist/iconDictionary/Home.js +1 -2
  151. package/dist/iconDictionary/Home.js.map +1 -1
  152. package/dist/iconDictionary/InformationCircle.js +1 -2
  153. package/dist/iconDictionary/InformationCircle.js.map +1 -1
  154. package/dist/iconDictionary/InformationCircleFilled.js +1 -2
  155. package/dist/iconDictionary/InformationCircleFilled.js.map +1 -1
  156. package/dist/iconDictionary/Notification.js +1 -2
  157. package/dist/iconDictionary/Notification.js.map +1 -1
  158. package/dist/iconDictionary/OverflowVertical.js +1 -2
  159. package/dist/iconDictionary/OverflowVertical.js.map +1 -1
  160. package/dist/iconDictionary/QuestionCircle.js +1 -2
  161. package/dist/iconDictionary/QuestionCircle.js.map +1 -1
  162. package/dist/iconDictionary/QuestionCircleFilled.js +1 -2
  163. package/dist/iconDictionary/QuestionCircleFilled.js.map +1 -1
  164. package/dist/iconDictionary/Search.js +1 -2
  165. package/dist/iconDictionary/Search.js.map +1 -1
  166. package/dist/iconDictionary/Settings.js +1 -2
  167. package/dist/iconDictionary/Settings.js.map +1 -1
  168. package/dist/iconDictionary/Subtract.js +1 -2
  169. package/dist/iconDictionary/Subtract.js.map +1 -1
  170. package/dist/iconDictionary/SvgIcon.js +1 -0
  171. package/dist/iconDictionary/SvgIcon.js.map +1 -1
  172. package/dist/iconDictionary/User.js +1 -2
  173. package/dist/iconDictionary/User.js.map +1 -1
  174. package/dist/iconDictionary/UserGroup.js +1 -2
  175. package/dist/iconDictionary/UserGroup.js.map +1 -1
  176. package/dist/iconDictionary/index.js.map +1 -1
  177. package/dist/index.js +9 -3
  178. package/dist/index.js.map +1 -1
  179. package/dist/properties/ts/odyssey-react-mui.js +11 -0
  180. package/dist/properties/ts/odyssey-react-mui.js.map +1 -0
  181. package/dist/properties/ts/odyssey-react-mui_cs.js +2 -0
  182. package/dist/properties/ts/odyssey-react-mui_cs.js.map +1 -0
  183. package/dist/properties/ts/odyssey-react-mui_da.js +2 -0
  184. package/dist/properties/ts/odyssey-react-mui_da.js.map +1 -0
  185. package/dist/properties/ts/odyssey-react-mui_de.js +2 -0
  186. package/dist/properties/ts/odyssey-react-mui_de.js.map +1 -0
  187. package/dist/properties/ts/odyssey-react-mui_el.js +2 -0
  188. package/dist/properties/ts/odyssey-react-mui_el.js.map +1 -0
  189. package/dist/properties/ts/odyssey-react-mui_es.js +2 -0
  190. package/dist/properties/ts/odyssey-react-mui_es.js.map +1 -0
  191. package/dist/properties/ts/odyssey-react-mui_fi.js +2 -0
  192. package/dist/properties/ts/odyssey-react-mui_fi.js.map +1 -0
  193. package/dist/properties/ts/odyssey-react-mui_fr.js +2 -0
  194. package/dist/properties/ts/odyssey-react-mui_fr.js.map +1 -0
  195. package/dist/properties/ts/odyssey-react-mui_hu.js +2 -0
  196. package/dist/properties/ts/odyssey-react-mui_hu.js.map +1 -0
  197. package/dist/properties/ts/odyssey-react-mui_id.js +2 -0
  198. package/dist/properties/ts/odyssey-react-mui_id.js.map +1 -0
  199. package/dist/properties/ts/odyssey-react-mui_it.js +2 -0
  200. package/dist/properties/ts/odyssey-react-mui_it.js.map +1 -0
  201. package/dist/properties/ts/odyssey-react-mui_ja.js +2 -0
  202. package/dist/properties/ts/odyssey-react-mui_ja.js.map +1 -0
  203. package/dist/properties/ts/odyssey-react-mui_ko.js +2 -0
  204. package/dist/properties/ts/odyssey-react-mui_ko.js.map +1 -0
  205. package/dist/properties/ts/odyssey-react-mui_ms.js +2 -0
  206. package/dist/properties/ts/odyssey-react-mui_ms.js.map +1 -0
  207. package/dist/properties/ts/odyssey-react-mui_nb.js +2 -0
  208. package/dist/properties/ts/odyssey-react-mui_nb.js.map +1 -0
  209. package/dist/properties/ts/odyssey-react-mui_nl-NL.js +2 -0
  210. package/dist/properties/ts/odyssey-react-mui_nl-NL.js.map +1 -0
  211. package/dist/properties/ts/odyssey-react-mui_pl.js +2 -0
  212. package/dist/properties/ts/odyssey-react-mui_pl.js.map +1 -0
  213. package/dist/properties/ts/odyssey-react-mui_pt-BR.js +2 -0
  214. package/dist/properties/ts/odyssey-react-mui_pt-BR.js.map +1 -0
  215. package/dist/properties/ts/odyssey-react-mui_ro.js +2 -0
  216. package/dist/properties/ts/odyssey-react-mui_ro.js.map +1 -0
  217. package/dist/properties/ts/odyssey-react-mui_ru.js +2 -0
  218. package/dist/properties/ts/odyssey-react-mui_ru.js.map +1 -0
  219. package/dist/properties/ts/odyssey-react-mui_sv.js +2 -0
  220. package/dist/properties/ts/odyssey-react-mui_sv.js.map +1 -0
  221. package/dist/properties/ts/odyssey-react-mui_th.js +2 -0
  222. package/dist/properties/ts/odyssey-react-mui_th.js.map +1 -0
  223. package/dist/properties/ts/odyssey-react-mui_tr.js +2 -0
  224. package/dist/properties/ts/odyssey-react-mui_tr.js.map +1 -0
  225. package/dist/properties/ts/odyssey-react-mui_uk.js +2 -0
  226. package/dist/properties/ts/odyssey-react-mui_uk.js.map +1 -0
  227. package/dist/properties/ts/odyssey-react-mui_zh-CN.js +2 -0
  228. package/dist/properties/ts/odyssey-react-mui_zh-CN.js.map +1 -0
  229. package/dist/properties/ts/odyssey-react-mui_zh-TW.js +2 -0
  230. package/dist/properties/ts/odyssey-react-mui_zh-TW.js.map +1 -0
  231. package/dist/src/Banner.d.ts.map +1 -1
  232. package/dist/src/Checkbox.d.ts +4 -2
  233. package/dist/src/Checkbox.d.ts.map +1 -1
  234. package/dist/src/CheckboxGroup.d.ts +2 -1
  235. package/dist/src/CheckboxGroup.d.ts.map +1 -1
  236. package/dist/src/Field.d.ts +5 -5
  237. package/dist/src/Field.d.ts.map +1 -1
  238. package/dist/src/FieldError.d.ts.map +1 -1
  239. package/dist/src/FieldLabel.d.ts +1 -2
  240. package/dist/src/FieldLabel.d.ts.map +1 -1
  241. package/dist/src/Fieldset.d.ts +42 -0
  242. package/dist/src/Fieldset.d.ts.map +1 -0
  243. package/dist/src/Form.d.ts +73 -0
  244. package/dist/src/Form.d.ts.map +1 -0
  245. package/dist/src/Icon.d.ts +4 -2
  246. package/dist/src/Icon.d.ts.map +1 -1
  247. package/dist/src/Infobox.d.ts.map +1 -1
  248. package/dist/src/MenuItem.d.ts +1 -1
  249. package/dist/src/MenuItem.d.ts.map +1 -1
  250. package/dist/src/NativeSelect.d.ts +36 -0
  251. package/dist/src/NativeSelect.d.ts.map +1 -0
  252. package/dist/src/OdysseyI18n.d.ts +54 -0
  253. package/dist/src/OdysseyI18n.d.ts.map +1 -0
  254. package/dist/src/OdysseyProvider.d.ts +27 -0
  255. package/dist/src/OdysseyProvider.d.ts.map +1 -0
  256. package/dist/src/OdysseyThemeProvider.d.ts +4 -2
  257. package/dist/src/OdysseyThemeProvider.d.ts.map +1 -1
  258. package/dist/src/OdysseyTranslationProvider.d.ts +25 -0
  259. package/dist/src/OdysseyTranslationProvider.d.ts.map +1 -0
  260. package/dist/src/OdysseyTranslationProvider.types.d.ts +14 -0
  261. package/dist/src/OdysseyTranslationProvider.types.d.ts.map +1 -0
  262. package/dist/src/PasswordField.d.ts.map +1 -1
  263. package/dist/src/Select.d.ts +35 -0
  264. package/dist/src/Select.d.ts.map +1 -0
  265. package/{src/ThemeProvider.tsx → dist/src/Tabs.d.ts} +16 -15
  266. package/dist/src/Tabs.d.ts.map +1 -0
  267. package/dist/src/TextField.d.ts +0 -4
  268. package/dist/src/TextField.d.ts.map +1 -1
  269. package/dist/src/Toast.d.ts +1 -1
  270. package/dist/src/Toast.d.ts.map +1 -1
  271. package/dist/src/index.d.ts +9 -5
  272. package/dist/src/index.d.ts.map +1 -1
  273. package/dist/src/properties/ts/odyssey-react-mui.d.ts +11 -0
  274. package/dist/src/properties/ts/odyssey-react-mui.d.ts.map +1 -0
  275. package/dist/src/properties/ts/odyssey-react-mui_cs.d.ts +2 -0
  276. package/dist/src/properties/ts/odyssey-react-mui_cs.d.ts.map +1 -0
  277. package/dist/src/properties/ts/odyssey-react-mui_da.d.ts +2 -0
  278. package/dist/src/properties/ts/odyssey-react-mui_da.d.ts.map +1 -0
  279. package/dist/src/properties/ts/odyssey-react-mui_de.d.ts +2 -0
  280. package/dist/src/properties/ts/odyssey-react-mui_de.d.ts.map +1 -0
  281. package/dist/src/properties/ts/odyssey-react-mui_el.d.ts +2 -0
  282. package/dist/src/properties/ts/odyssey-react-mui_el.d.ts.map +1 -0
  283. package/dist/src/properties/ts/odyssey-react-mui_es.d.ts +2 -0
  284. package/dist/src/properties/ts/odyssey-react-mui_es.d.ts.map +1 -0
  285. package/dist/src/properties/ts/odyssey-react-mui_fi.d.ts +2 -0
  286. package/dist/src/properties/ts/odyssey-react-mui_fi.d.ts.map +1 -0
  287. package/dist/src/properties/ts/odyssey-react-mui_fr.d.ts +2 -0
  288. package/dist/src/properties/ts/odyssey-react-mui_fr.d.ts.map +1 -0
  289. package/dist/src/properties/ts/odyssey-react-mui_hu.d.ts +2 -0
  290. package/dist/src/properties/ts/odyssey-react-mui_hu.d.ts.map +1 -0
  291. package/dist/src/properties/ts/odyssey-react-mui_id.d.ts +2 -0
  292. package/dist/src/properties/ts/odyssey-react-mui_id.d.ts.map +1 -0
  293. package/dist/src/properties/ts/odyssey-react-mui_it.d.ts +2 -0
  294. package/dist/src/properties/ts/odyssey-react-mui_it.d.ts.map +1 -0
  295. package/dist/src/properties/ts/odyssey-react-mui_ja.d.ts +2 -0
  296. package/dist/src/properties/ts/odyssey-react-mui_ja.d.ts.map +1 -0
  297. package/dist/src/properties/ts/odyssey-react-mui_ko.d.ts +2 -0
  298. package/dist/src/properties/ts/odyssey-react-mui_ko.d.ts.map +1 -0
  299. package/dist/src/properties/ts/odyssey-react-mui_ms.d.ts +2 -0
  300. package/dist/src/properties/ts/odyssey-react-mui_ms.d.ts.map +1 -0
  301. package/dist/src/properties/ts/odyssey-react-mui_nb.d.ts +2 -0
  302. package/dist/src/properties/ts/odyssey-react-mui_nb.d.ts.map +1 -0
  303. package/dist/src/properties/ts/odyssey-react-mui_nl-NL.d.ts +2 -0
  304. package/dist/src/properties/ts/odyssey-react-mui_nl-NL.d.ts.map +1 -0
  305. package/dist/src/properties/ts/odyssey-react-mui_pl.d.ts +2 -0
  306. package/dist/src/properties/ts/odyssey-react-mui_pl.d.ts.map +1 -0
  307. package/dist/src/properties/ts/odyssey-react-mui_pt-BR.d.ts +2 -0
  308. package/dist/src/properties/ts/odyssey-react-mui_pt-BR.d.ts.map +1 -0
  309. package/dist/src/properties/ts/odyssey-react-mui_ro.d.ts +2 -0
  310. package/dist/src/properties/ts/odyssey-react-mui_ro.d.ts.map +1 -0
  311. package/dist/src/properties/ts/odyssey-react-mui_ru.d.ts +2 -0
  312. package/dist/src/properties/ts/odyssey-react-mui_ru.d.ts.map +1 -0
  313. package/dist/src/properties/ts/odyssey-react-mui_sv.d.ts +2 -0
  314. package/dist/src/properties/ts/odyssey-react-mui_sv.d.ts.map +1 -0
  315. package/dist/src/properties/ts/odyssey-react-mui_th.d.ts +2 -0
  316. package/dist/src/properties/ts/odyssey-react-mui_th.d.ts.map +1 -0
  317. package/dist/src/properties/ts/odyssey-react-mui_tr.d.ts +2 -0
  318. package/dist/src/properties/ts/odyssey-react-mui_tr.d.ts.map +1 -0
  319. package/dist/src/properties/ts/odyssey-react-mui_uk.d.ts +2 -0
  320. package/dist/src/properties/ts/odyssey-react-mui_uk.d.ts.map +1 -0
  321. package/dist/src/properties/ts/odyssey-react-mui_zh-CN.d.ts +2 -0
  322. package/dist/src/properties/ts/odyssey-react-mui_zh-CN.d.ts.map +1 -0
  323. package/dist/src/properties/ts/odyssey-react-mui_zh-TW.d.ts +2 -0
  324. package/dist/src/properties/ts/odyssey-react-mui_zh-TW.d.ts.map +1 -0
  325. package/dist/src/theme/components.d.ts.map +1 -1
  326. package/dist/src/theme/index.d.ts +3 -1
  327. package/dist/src/theme/index.d.ts.map +1 -1
  328. package/dist/src/theme/mixins.d.ts +2 -1
  329. package/dist/src/theme/mixins.d.ts.map +1 -1
  330. package/dist/src/theme/palette.d.ts +2 -1
  331. package/dist/src/theme/palette.d.ts.map +1 -1
  332. package/dist/src/theme/shape.d.ts +2 -1
  333. package/dist/src/theme/shape.d.ts.map +1 -1
  334. package/dist/src/theme/spacing.d.ts +2 -1
  335. package/dist/src/theme/spacing.d.ts.map +1 -1
  336. package/dist/src/theme/theme.d.ts +3 -2
  337. package/dist/src/theme/theme.d.ts.map +1 -1
  338. package/dist/src/theme/typography.d.ts +2 -1
  339. package/dist/src/theme/typography.d.ts.map +1 -1
  340. package/dist/theme/components.js +91 -73
  341. package/dist/theme/components.js.map +1 -1
  342. package/dist/theme/components.types.js +1 -0
  343. package/dist/theme/components.types.js.map +1 -1
  344. package/dist/theme/index.js +1 -1
  345. package/dist/theme/index.js.map +1 -1
  346. package/dist/theme/mixins.js +8 -6
  347. package/dist/theme/mixins.js.map +1 -1
  348. package/dist/theme/mixins.types.js +1 -0
  349. package/dist/theme/mixins.types.js.map +1 -1
  350. package/dist/theme/palette.js +89 -86
  351. package/dist/theme/palette.js.map +1 -1
  352. package/dist/theme/palette.types.js +1 -0
  353. package/dist/theme/palette.types.js.map +1 -1
  354. package/dist/theme/shape.js +6 -4
  355. package/dist/theme/shape.js.map +1 -1
  356. package/dist/theme/spacing.js +4 -1
  357. package/dist/theme/spacing.js.map +1 -1
  358. package/dist/theme/temp.js +1 -0
  359. package/dist/theme/temp.js.map +1 -1
  360. package/dist/theme/theme.js +12 -9
  361. package/dist/theme/theme.js.map +1 -1
  362. package/dist/theme/typography.js +85 -83
  363. package/dist/theme/typography.js.map +1 -1
  364. package/dist/theme/typography.types.js +1 -0
  365. package/dist/theme/typography.types.js.map +1 -1
  366. package/dist/theme/useTheme.js +1 -0
  367. package/dist/theme/useTheme.js.map +1 -1
  368. package/dist/tsconfig.production.tsbuildinfo +1 -1
  369. package/dist/useUniqueAlphabeticalId.js +1 -0
  370. package/dist/useUniqueAlphabeticalId.js.map +1 -1
  371. package/dist/useUniqueId.js +1 -0
  372. package/dist/useUniqueId.js.map +1 -1
  373. package/i18n.config.json +8 -0
  374. package/package.json +9 -4
  375. package/scripts/properties-to-ts.js +103 -0
  376. package/src/@types/i18next.d.ts +22 -0
  377. package/src/Banner.tsx +16 -11
  378. package/src/Checkbox.tsx +47 -21
  379. package/src/CheckboxGroup.tsx +4 -1
  380. package/src/Field.tsx +16 -7
  381. package/src/FieldError.tsx +6 -1
  382. package/src/FieldLabel.tsx +7 -4
  383. package/src/Fieldset.tsx +95 -0
  384. package/src/Form.tsx +142 -0
  385. package/src/Icon.tsx +11 -14
  386. package/src/Infobox.tsx +12 -7
  387. package/src/Link.tsx +2 -2
  388. package/src/MenuItem.tsx +1 -0
  389. package/src/NativeSelect.tsx +107 -0
  390. package/src/OdysseyI18n.ts +101 -0
  391. package/src/OdysseyProvider.tsx +59 -0
  392. package/src/OdysseyThemeProvider.tsx +9 -3
  393. package/src/OdysseyTranslationProvider.test.tsx +63 -0
  394. package/src/OdysseyTranslationProvider.tsx +65 -0
  395. package/src/OdysseyTranslationProvider.types.ts +42 -0
  396. package/src/PasswordField.tsx +1 -0
  397. package/src/Select.tsx +226 -0
  398. package/src/Tabs.tsx +70 -0
  399. package/src/TextField.tsx +1 -6
  400. package/src/Toast.tsx +61 -59
  401. package/src/index.ts +7 -9
  402. package/src/properties/odyssey-react-mui.properties +8 -0
  403. package/src/properties/translations/odyssey-react-mui_cs.properties +0 -0
  404. package/src/properties/translations/odyssey-react-mui_da.properties +0 -0
  405. package/src/properties/translations/odyssey-react-mui_de.properties +0 -0
  406. package/src/properties/translations/odyssey-react-mui_el.properties +0 -0
  407. package/src/properties/translations/odyssey-react-mui_es.properties +0 -0
  408. package/src/properties/translations/odyssey-react-mui_fi.properties +0 -0
  409. package/src/properties/translations/odyssey-react-mui_fr.properties +0 -0
  410. package/src/properties/translations/odyssey-react-mui_hu.properties +0 -0
  411. package/src/properties/translations/odyssey-react-mui_id.properties +0 -0
  412. package/src/properties/translations/odyssey-react-mui_it.properties +0 -0
  413. package/src/properties/translations/odyssey-react-mui_ja.properties +0 -0
  414. package/src/properties/translations/odyssey-react-mui_ko.properties +0 -0
  415. package/src/properties/translations/odyssey-react-mui_ms.properties +0 -0
  416. package/src/properties/translations/odyssey-react-mui_nb.properties +0 -0
  417. package/src/properties/translations/odyssey-react-mui_nl-NL.properties +0 -0
  418. package/src/properties/translations/odyssey-react-mui_pl.properties +0 -0
  419. package/src/properties/translations/odyssey-react-mui_pt-BR.properties +0 -0
  420. package/src/properties/translations/odyssey-react-mui_ro.properties +0 -0
  421. package/src/properties/translations/odyssey-react-mui_ru.properties +0 -0
  422. package/src/properties/translations/odyssey-react-mui_sv.properties +0 -0
  423. package/src/properties/translations/odyssey-react-mui_th.properties +0 -0
  424. package/src/properties/translations/odyssey-react-mui_tr.properties +0 -0
  425. package/src/properties/translations/odyssey-react-mui_uk.properties +0 -0
  426. package/src/properties/translations/odyssey-react-mui_zh-CN.properties +0 -0
  427. package/src/properties/translations/odyssey-react-mui_zh-TW.properties +0 -0
  428. package/src/properties/ts/odyssey-react-mui.ts +1 -0
  429. package/src/properties/ts/odyssey-react-mui_cs.ts +1 -0
  430. package/src/properties/ts/odyssey-react-mui_da.ts +1 -0
  431. package/src/properties/ts/odyssey-react-mui_de.ts +1 -0
  432. package/src/properties/ts/odyssey-react-mui_el.ts +1 -0
  433. package/src/properties/ts/odyssey-react-mui_es.ts +1 -0
  434. package/src/properties/ts/odyssey-react-mui_fi.ts +1 -0
  435. package/src/properties/ts/odyssey-react-mui_fr.ts +1 -0
  436. package/src/properties/ts/odyssey-react-mui_hu.ts +1 -0
  437. package/src/properties/ts/odyssey-react-mui_id.ts +1 -0
  438. package/src/properties/ts/odyssey-react-mui_it.ts +1 -0
  439. package/src/properties/ts/odyssey-react-mui_ja.ts +1 -0
  440. package/src/properties/ts/odyssey-react-mui_ko.ts +1 -0
  441. package/src/properties/ts/odyssey-react-mui_ms.ts +1 -0
  442. package/src/properties/ts/odyssey-react-mui_nb.ts +1 -0
  443. package/src/properties/ts/odyssey-react-mui_nl-NL.ts +1 -0
  444. package/src/properties/ts/odyssey-react-mui_pl.ts +1 -0
  445. package/src/properties/ts/odyssey-react-mui_pt-BR.ts +1 -0
  446. package/src/properties/ts/odyssey-react-mui_ro.ts +1 -0
  447. package/src/properties/ts/odyssey-react-mui_ru.ts +1 -0
  448. package/src/properties/ts/odyssey-react-mui_sv.ts +1 -0
  449. package/src/properties/ts/odyssey-react-mui_th.ts +1 -0
  450. package/src/properties/ts/odyssey-react-mui_tr.ts +1 -0
  451. package/src/properties/ts/odyssey-react-mui_uk.ts +1 -0
  452. package/src/properties/ts/odyssey-react-mui_zh-CN.ts +1 -0
  453. package/src/properties/ts/odyssey-react-mui_zh-TW.ts +1 -0
  454. package/src/theme/components.tsx +12 -4
  455. package/src/theme/index.ts +5 -1
  456. package/src/theme/mixins.ts +10 -6
  457. package/src/theme/palette.ts +95 -88
  458. package/src/theme/shape.ts +12 -8
  459. package/src/theme/spacing.ts +17 -12
  460. package/src/theme/theme.ts +14 -10
  461. package/src/theme/typography.ts +87 -83
  462. package/dist/ThemeProvider.js.map +0 -1
  463. package/dist/src/ThemeProvider.d.ts.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"PasswordField.js","names":["forwardRef","memo","useCallback","useState","EyeIcon","EyeOffIcon","IconButton","Field","PasswordField","ref","autoCompleteType","errorMessage","hasInitialFocus","hint","id","idOverride","isDisabled","isOptional","isReadOnly","label","onChange","onFocus","onBlur","placeholder","value","inputType","setInputType","togglePasswordVisibility","renderFieldComponent","ariaDescribedBy","MemoizedPasswordField"],"sources":["../src/PasswordField.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 { InputAdornment, InputBase } from \"@mui/material\";\nimport {\n ChangeEventHandler,\n FocusEventHandler,\n forwardRef,\n memo,\n useCallback,\n useState,\n} from \"react\";\n\nimport { EyeIcon, EyeOffIcon, IconButton } from \"./\";\nimport { Field } from \"./Field\";\n\nexport type PasswordFieldProps = {\n /**\n * This prop helps users to fill forms faster, especially on mobile devices.\n * The name can be confusing, as it's more like an autofill.\n * You can learn more about it [following the specification](https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#autofill).\n */\n autoCompleteType?: \"current-password\" | \"new-password\";\n /**\n * If `error` is not undefined, the `input` will indicate an error.\n */\n errorMessage?: string;\n /**\n * If `true`, the component will receive focus automatically.\n */\n hasInitialFocus?: boolean;\n /**\n * The helper text content.\n */\n hint?: string;\n /**\n * The id of the `input` element.\n */\n id?: string;\n /**\n * If `true`, the component is disabled.\n */\n isDisabled?: boolean;\n /**\n * If `true`, the `input` element is not required.\n */\n isOptional?: boolean;\n /**\n * It prevents the user from changing the value of the field\n */\n isReadOnly?: boolean;\n /**\n * The label for the `input` element.\n */\n label: string;\n /**\n * Callback fired when the `input` element loses focus.\n */\n onBlur?: FocusEventHandler<HTMLInputElement | HTMLTextAreaElement>;\n /**\n * Callback fired when the value is changed.\n */\n onChange?: ChangeEventHandler<HTMLTextAreaElement | HTMLInputElement>;\n /**\n * Callback fired when the `input` element get focus.\n */\n onFocus?: FocusEventHandler<HTMLInputElement | HTMLTextAreaElement>;\n /**\n * The short hint displayed in the `input` before the user enters a value.\n */\n placeholder?: string;\n /**\n * The value of the `input` element, required for a controlled component.\n */\n value?: string;\n};\n\nconst PasswordField = forwardRef<HTMLInputElement, PasswordFieldProps>(\n (\n {\n autoCompleteType,\n errorMessage,\n hasInitialFocus,\n hint,\n id: idOverride,\n isDisabled = false,\n isOptional = false,\n isReadOnly,\n label,\n onChange,\n onFocus,\n onBlur,\n placeholder,\n value,\n },\n ref\n ) => {\n const [inputType, setInputType] = useState(\"password\");\n\n const togglePasswordVisibility = useCallback(() => {\n setInputType((inputType) =>\n inputType === \"password\" ? \"text\" : \"password\"\n );\n }, []);\n\n const renderFieldComponent = useCallback(\n ({ ariaDescribedBy, id }) => (\n <InputBase\n aria-describedby={ariaDescribedBy}\n autoComplete={autoCompleteType}\n /* eslint-disable-next-line jsx-a11y/no-autofocus */\n autoFocus={hasInitialFocus}\n endAdornment={\n <InputAdornment position=\"end\">\n <IconButton\n aria-label=\"toggle password visibility\"\n edge=\"end\"\n onClick={togglePasswordVisibility}\n >\n {inputType === \"password\" ? <EyeIcon /> : <EyeOffIcon />}\n </IconButton>\n </InputAdornment>\n }\n id={id}\n name={id}\n onChange={onChange}\n onFocus={onFocus}\n onBlur={onBlur}\n placeholder={placeholder}\n readOnly={isReadOnly}\n ref={ref}\n required={!isOptional}\n type={inputType}\n value={value}\n />\n ),\n [\n autoCompleteType,\n hasInitialFocus,\n togglePasswordVisibility,\n inputType,\n onChange,\n onFocus,\n onBlur,\n placeholder,\n isOptional,\n isReadOnly,\n ref,\n value,\n ]\n );\n\n return (\n <Field\n errorMessage={errorMessage}\n fieldType=\"single\"\n hasVisibleLabel\n hint={hint}\n id={idOverride}\n isDisabled={isDisabled}\n isOptional={isOptional}\n label={label}\n renderFieldComponent={renderFieldComponent}\n />\n );\n }\n);\n\nconst MemoizedPasswordField = memo(PasswordField);\n\nexport { MemoizedPasswordField as PasswordField };\n"],"mappings":";;AAaA,SAGEA,UAHF,EAIEC,IAJF,EAKEC,WALF,EAMEC,QANF,QAOO,OAPP;SASSC,O,EAASC,U,EAAYC,U;SACrBC,K;;AA+DT,MAAMC,aAAa,GAAGR,UAAU,CAC9B,OAiBES,GAjBF,KAkBK;EAAA,IAjBH;IACEC,gBADF;IAEEC,YAFF;IAGEC,eAHF;IAIEC,IAJF;IAKEC,EAAE,EAAEC,UALN;IAMEC,UAAU,GAAG,KANf;IAOEC,UAAU,GAAG,KAPf;IAQEC,UARF;IASEC,KATF;IAUEC,QAVF;IAWEC,OAXF;IAYEC,MAZF;IAaEC,WAbF;IAcEC;EAdF,CAiBG;EACH,MAAM,CAACC,SAAD,EAAYC,YAAZ,IAA4BvB,QAAQ,CAAC,UAAD,CAA1C;EAEA,MAAMwB,wBAAwB,GAAGzB,WAAW,CAAC,MAAM;IACjDwB,YAAY,CAAED,SAAD,IACXA,SAAS,KAAK,UAAd,GAA2B,MAA3B,GAAoC,UAD1B,CAAZ;EAGD,CAJ2C,EAIzC,EAJyC,CAA5C;EAMA,MAAMG,oBAAoB,GAAG1B,WAAW,CACtC;IAAA,IAAC;MAAE2B,eAAF;MAAmBf;IAAnB,CAAD;IAAA,OACE;MACE,oBAAkBe,eADpB;MAEE,YAAY,EAAEnB,gBAFhB;MAIE,SAAS,EAAEE,eAJb;MAKE,YAAY,EACV;QAAgB,QAAQ,EAAC,KAAzB;QAAA,UACE,KAAC,UAAD;UACE,cAAW,4BADb;UAEE,IAAI,EAAC,KAFP;UAGE,OAAO,EAAEe,wBAHX;UAAA,UAKGF,SAAS,KAAK,UAAd,GAA2B,KAAC,OAAD,KAA3B,GAAyC,KAAC,UAAD;QAL5C;MADF,EANJ;MAgBE,EAAE,EAAEX,EAhBN;MAiBE,IAAI,EAAEA,EAjBR;MAkBE,QAAQ,EAAEM,QAlBZ;MAmBE,OAAO,EAAEC,OAnBX;MAoBE,MAAM,EAAEC,MApBV;MAqBE,WAAW,EAAEC,WArBf;MAsBE,QAAQ,EAAEL,UAtBZ;MAuBE,GAAG,EAAET,GAvBP;MAwBE,QAAQ,EAAE,CAACQ,UAxBb;MAyBE,IAAI,EAAEQ,SAzBR;MA0BE,KAAK,EAAED;IA1BT,EADF;EAAA,CADsC,EA+BtC,CACEd,gBADF,EAEEE,eAFF,EAGEe,wBAHF,EAIEF,SAJF,EAKEL,QALF,EAMEC,OANF,EAOEC,MAPF,EAQEC,WARF,EASEN,UATF,EAUEC,UAVF,EAWET,GAXF,EAYEe,KAZF,CA/BsC,CAAxC;EA+CA,OACE,KAAC,KAAD;IACE,YAAY,EAAEb,YADhB;IAEE,SAAS,EAAC,QAFZ;IAGE,eAAe,MAHjB;IAIE,IAAI,EAAEE,IAJR;IAKE,EAAE,EAAEE,UALN;IAME,UAAU,EAAEC,UANd;IAOE,UAAU,EAAEC,UAPd;IAQE,KAAK,EAAEE,KART;IASE,oBAAoB,EAAES;EATxB,EADF;AAaD,CAxF6B,CAAhC;AA2FA,MAAME,qBAAqB,GAAG7B,IAAI,CAACO,aAAD,CAAlC;AAEA,SAASsB,qBAAqB,IAAItB,aAAlC"}
1
+ {"version":3,"file":"PasswordField.js","names":["forwardRef","memo","useCallback","useState","EyeIcon","EyeOffIcon","IconButton","Field","jsx","_jsx","PasswordField","_ref","ref","autoCompleteType","errorMessage","hasInitialFocus","hint","id","idOverride","isDisabled","isOptional","isReadOnly","label","onChange","onFocus","onBlur","placeholder","value","inputType","setInputType","togglePasswordVisibility","renderFieldComponent","_ref2","ariaDescribedBy","_InputBase","autoComplete","autoFocus","endAdornment","_InputAdornment","position","children","edge","onClick","name","readOnly","required","type","fieldType","hasVisibleLabel","MemoizedPasswordField","displayName"],"sources":["../src/PasswordField.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 { InputAdornment, InputBase } from \"@mui/material\";\nimport {\n ChangeEventHandler,\n FocusEventHandler,\n forwardRef,\n memo,\n useCallback,\n useState,\n} from \"react\";\n\nimport { EyeIcon, EyeOffIcon, IconButton } from \"./\";\nimport { Field } from \"./Field\";\n\nexport type PasswordFieldProps = {\n /**\n * This prop helps users to fill forms faster, especially on mobile devices.\n * The name can be confusing, as it's more like an autofill.\n * You can learn more about it [following the specification](https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#autofill).\n */\n autoCompleteType?: \"current-password\" | \"new-password\";\n /**\n * If `error` is not undefined, the `input` will indicate an error.\n */\n errorMessage?: string;\n /**\n * If `true`, the component will receive focus automatically.\n */\n hasInitialFocus?: boolean;\n /**\n * The helper text content.\n */\n hint?: string;\n /**\n * The id of the `input` element.\n */\n id?: string;\n /**\n * If `true`, the component is disabled.\n */\n isDisabled?: boolean;\n /**\n * If `true`, the `input` element is not required.\n */\n isOptional?: boolean;\n /**\n * It prevents the user from changing the value of the field\n */\n isReadOnly?: boolean;\n /**\n * The label for the `input` element.\n */\n label: string;\n /**\n * Callback fired when the `input` element loses focus.\n */\n onBlur?: FocusEventHandler<HTMLInputElement | HTMLTextAreaElement>;\n /**\n * Callback fired when the value is changed.\n */\n onChange?: ChangeEventHandler<HTMLTextAreaElement | HTMLInputElement>;\n /**\n * Callback fired when the `input` element get focus.\n */\n onFocus?: FocusEventHandler<HTMLInputElement | HTMLTextAreaElement>;\n /**\n * The short hint displayed in the `input` before the user enters a value.\n */\n placeholder?: string;\n /**\n * The value of the `input` element, required for a controlled component.\n */\n value?: string;\n};\n\nconst PasswordField = forwardRef<HTMLInputElement, PasswordFieldProps>(\n (\n {\n autoCompleteType,\n errorMessage,\n hasInitialFocus,\n hint,\n id: idOverride,\n isDisabled = false,\n isOptional = false,\n isReadOnly,\n label,\n onChange,\n onFocus,\n onBlur,\n placeholder,\n value,\n },\n ref\n ) => {\n const [inputType, setInputType] = useState(\"password\");\n\n const togglePasswordVisibility = useCallback(() => {\n setInputType((inputType) =>\n inputType === \"password\" ? \"text\" : \"password\"\n );\n }, []);\n\n const renderFieldComponent = useCallback(\n ({ ariaDescribedBy, id }) => (\n <InputBase\n aria-describedby={ariaDescribedBy}\n autoComplete={autoCompleteType}\n /* eslint-disable-next-line jsx-a11y/no-autofocus */\n autoFocus={hasInitialFocus}\n endAdornment={\n <InputAdornment position=\"end\">\n <IconButton\n aria-label=\"toggle password visibility\"\n edge=\"end\"\n onClick={togglePasswordVisibility}\n >\n {inputType === \"password\" ? <EyeIcon /> : <EyeOffIcon />}\n </IconButton>\n </InputAdornment>\n }\n id={id}\n name={id}\n onChange={onChange}\n onFocus={onFocus}\n onBlur={onBlur}\n placeholder={placeholder}\n readOnly={isReadOnly}\n ref={ref}\n required={!isOptional}\n type={inputType}\n value={value}\n />\n ),\n [\n autoCompleteType,\n hasInitialFocus,\n togglePasswordVisibility,\n inputType,\n onChange,\n onFocus,\n onBlur,\n placeholder,\n isOptional,\n isReadOnly,\n ref,\n value,\n ]\n );\n\n return (\n <Field\n errorMessage={errorMessage}\n fieldType=\"single\"\n hasVisibleLabel\n hint={hint}\n id={idOverride}\n isDisabled={isDisabled}\n isOptional={isOptional}\n label={label}\n renderFieldComponent={renderFieldComponent}\n />\n );\n }\n);\n\nconst MemoizedPasswordField = memo(PasswordField);\nMemoizedPasswordField.displayName = \"PasswordField\";\n\nexport { MemoizedPasswordField as PasswordField };\n"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAGA,SAGEA,UAAU,EACVC,IAAI,EACJC,WAAW,EACXC,QAAQ,QACH,OAAO;AAAC,SAENC,OAAO,EAAEC,UAAU,EAAEC,UAAU;AAAA,SAC/BC,KAAK;AAAA,SAAAC,GAAA,IAAAC,IAAA;AA+Dd,MAAMC,aAAa,GAAGV,UAAU,CAC9B,CAAAW,IAAA,EAiBEC,GAAG,KACA;EAAA,IAjBH;IACEC,gBAAgB;IAChBC,YAAY;IACZC,eAAe;IACfC,IAAI;IACJC,EAAE,EAAEC,UAAU;IACdC,UAAU,GAAG,KAAK;IAClBC,UAAU,GAAG,KAAK;IAClBC,UAAU;IACVC,KAAK;IACLC,QAAQ;IACRC,OAAO;IACPC,MAAM;IACNC,WAAW;IACXC;EACF,CAAC,GAAAhB,IAAA;EAGD,MAAM,CAACiB,SAAS,EAAEC,YAAY,CAAC,GAAG1B,QAAQ,CAAC,UAAU,CAAC;EAEtD,MAAM2B,wBAAwB,GAAG5B,WAAW,CAAC,MAAM;IACjD2B,YAAY,CAAED,SAAS,IACrBA,SAAS,KAAK,UAAU,GAAG,MAAM,GAAG,UACtC,CAAC;EACH,CAAC,EAAE,EAAE,CAAC;EAEN,MAAMG,oBAAoB,GAAG7B,WAAW,CACtC8B,KAAA;IAAA,IAAC;MAAEC,eAAe;MAAEhB;IAAG,CAAC,GAAAe,KAAA;IAAA,OACtBvB,IAAA,CAAAyB,UAAA;MACE,oBAAkBD,eAAgB;MAClCE,YAAY,EAAEtB,gBAAiB;MAE/BuB,SAAS,EAAErB,eAAgB;MAC3BsB,YAAY,EACV5B,IAAA,CAAA6B,eAAA;QAAgBC,QAAQ,EAAC,KAAK;QAAAC,QAAA,EAC5B/B,IAAA,CAACH,UAAU;UACT,cAAW,4BAA4B;UACvCmC,IAAI,EAAC,KAAK;UACVC,OAAO,EAAEZ,wBAAyB;UAAAU,QAAA,EAEjCZ,SAAS,KAAK,UAAU,GAAGnB,IAAA,CAACL,OAAO,IAAE,CAAC,GAAGK,IAAA,CAACJ,UAAU,IAAE;QAAC,CAC9C;MAAC,CACC,CACjB;MACDY,EAAE,EAAEA,EAAG;MACP0B,IAAI,EAAE1B,EAAG;MACTM,QAAQ,EAAEA,QAAS;MACnBC,OAAO,EAAEA,OAAQ;MACjBC,MAAM,EAAEA,MAAO;MACfC,WAAW,EAAEA,WAAY;MACzBkB,QAAQ,EAAEvB,UAAW;MACrBT,GAAG,EAAEA,GAAI;MACTiC,QAAQ,EAAE,CAACzB,UAAW;MACtB0B,IAAI,EAAElB,SAAU;MAChBD,KAAK,EAAEA;IAAM,CACd,CAAC;EAAA,CACH,EACD,CACEd,gBAAgB,EAChBE,eAAe,EACfe,wBAAwB,EACxBF,SAAS,EACTL,QAAQ,EACRC,OAAO,EACPC,MAAM,EACNC,WAAW,EACXN,UAAU,EACVC,UAAU,EACVT,GAAG,EACHe,KAAK,CAET,CAAC;EAED,OACElB,IAAA,CAACF,KAAK;IACJO,YAAY,EAAEA,YAAa;IAC3BiC,SAAS,EAAC,QAAQ;IAClBC,eAAe;IACfhC,IAAI,EAAEA,IAAK;IACXC,EAAE,EAAEC,UAAW;IACfC,UAAU,EAAEA,UAAW;IACvBC,UAAU,EAAEA,UAAW;IACvBE,KAAK,EAAEA,KAAM;IACbS,oBAAoB,EAAEA;EAAqB,CAC5C,CAAC;AAEN,CACF,CAAC;AAED,MAAMkB,qBAAqB,GAAGhD,IAAI,CAACS,aAAa,CAAC;AACjDuC,qBAAqB,CAACC,WAAW,GAAG,eAAe;AAEnD,SAASD,qBAAqB,IAAIvC,aAAa"}
package/dist/Radio.js CHANGED
@@ -1,8 +1,18 @@
1
1
  import _Radio from "@mui/material/Radio";
2
+ /*!
3
+ * Copyright (c) 2022-present, Okta, Inc. and/or its affiliates. All rights reserved.
4
+ * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the "License.")
5
+ *
6
+ * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.
7
+ * Unless required by applicable law or agreed to in writing, software
8
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
9
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10
+ *
11
+ * See the License for the specific language governing permissions and limitations under the License.
12
+ */
2
13
  import { memo } from "react";
3
14
  import { FormControlLabel } from "./index.js";
4
15
  import { jsx as _jsx } from "react/jsx-runtime";
5
-
6
16
  const Radio = _ref => {
7
17
  let {
8
18
  isChecked,
@@ -24,7 +34,6 @@ const Radio = _ref => {
24
34
  value: value
25
35
  });
26
36
  };
27
-
28
37
  const MemoizedRadio = memo(Radio);
29
38
  export { MemoizedRadio as Radio };
30
39
  //# sourceMappingURL=Radio.js.map
package/dist/Radio.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"Radio.js","names":["memo","FormControlLabel","Radio","isChecked","isDefaultChecked","isDisabled","hasError","label","name","value","MemoizedRadio"],"sources":["../src/Radio.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 { Radio as MuiRadio } from \"@mui/material\";\nimport { memo } from \"react\";\n\nimport { FormControlLabel } from \".\";\n\nexport type RadioProps = {\n isChecked?: boolean;\n isDefaultChecked?: boolean;\n isDisabled?: boolean;\n hasError?: boolean;\n label: string;\n name?: string;\n value: string;\n};\n\nconst Radio = ({\n isChecked,\n isDefaultChecked,\n isDisabled,\n hasError,\n label,\n name,\n value,\n}: RadioProps) => (\n <FormControlLabel\n checked={isChecked}\n className={hasError ? \"Mui-error\" : \"\"}\n control={<MuiRadio />}\n defaultChecked={isDefaultChecked}\n disabled={isDisabled}\n label={label}\n name={name}\n value={value}\n />\n);\n\nconst MemoizedRadio = memo(Radio);\n\nexport { MemoizedRadio as Radio };\n"],"mappings":";AAaA,SAASA,IAAT,QAAqB,OAArB;SAESC,gB;;;AAYT,MAAMC,KAAK,GAAG;EAAA,IAAC;IACbC,SADa;IAEbC,gBAFa;IAGbC,UAHa;IAIbC,QAJa;IAKbC,KALa;IAMbC,IANa;IAObC;EAPa,CAAD;EAAA,OASZ,KAAC,gBAAD;IACE,OAAO,EAAEN,SADX;IAEE,SAAS,EAAEG,QAAQ,GAAG,WAAH,GAAiB,EAFtC;IAGE,OAAO,EAAE,gBAHX;IAIE,cAAc,EAAEF,gBAJlB;IAKE,QAAQ,EAAEC,UALZ;IAME,KAAK,EAAEE,KANT;IAOE,IAAI,EAAEC,IAPR;IAQE,KAAK,EAAEC;EART,EATY;AAAA,CAAd;;AAqBA,MAAMC,aAAa,GAAGV,IAAI,CAACE,KAAD,CAA1B;AAEA,SAASQ,aAAa,IAAIR,KAA1B"}
1
+ {"version":3,"file":"Radio.js","names":["memo","FormControlLabel","jsx","_jsx","Radio","_ref","isChecked","isDefaultChecked","isDisabled","hasError","label","name","value","checked","className","control","_Radio","defaultChecked","disabled","MemoizedRadio"],"sources":["../src/Radio.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 { Radio as MuiRadio } from \"@mui/material\";\nimport { memo } from \"react\";\n\nimport { FormControlLabel } from \".\";\n\nexport type RadioProps = {\n isChecked?: boolean;\n isDefaultChecked?: boolean;\n isDisabled?: boolean;\n hasError?: boolean;\n label: string;\n name?: string;\n value: string;\n};\n\nconst Radio = ({\n isChecked,\n isDefaultChecked,\n isDisabled,\n hasError,\n label,\n name,\n value,\n}: RadioProps) => (\n <FormControlLabel\n checked={isChecked}\n className={hasError ? \"Mui-error\" : \"\"}\n control={<MuiRadio />}\n defaultChecked={isDefaultChecked}\n disabled={isDisabled}\n label={label}\n name={name}\n value={value}\n />\n);\n\nconst MemoizedRadio = memo(Radio);\n\nexport { MemoizedRadio as Radio };\n"],"mappings":";AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAGA,SAASA,IAAI,QAAQ,OAAO;AAAC,SAEpBC,gBAAgB;AAAA,SAAAC,GAAA,IAAAC,IAAA;AAYzB,MAAMC,KAAK,GAAGC,IAAA;EAAA,IAAC;IACbC,SAAS;IACTC,gBAAgB;IAChBC,UAAU;IACVC,QAAQ;IACRC,KAAK;IACLC,IAAI;IACJC;EACU,CAAC,GAAAP,IAAA;EAAA,OACXF,IAAA,CAACF,gBAAgB;IACfY,OAAO,EAAEP,SAAU;IACnBQ,SAAS,EAAEL,QAAQ,GAAG,WAAW,GAAG,EAAG;IACvCM,OAAO,EAAEZ,IAAA,CAAAa,MAAA,IAAW,CAAE;IACtBC,cAAc,EAAEV,gBAAiB;IACjCW,QAAQ,EAAEV,UAAW;IACrBE,KAAK,EAAEA,KAAM;IACbC,IAAI,EAAEA,IAAK;IACXC,KAAK,EAAEA;EAAM,CACd,CAAC;AAAA,CACH;AAED,MAAMO,aAAa,GAAGnB,IAAI,CAACI,KAAK,CAAC;AAEjC,SAASe,aAAa,IAAIf,KAAK"}
@@ -1,8 +1,18 @@
1
1
  import _RadioGroup from "@mui/material/RadioGroup";
2
+ /*!
3
+ * Copyright (c) 2022-present, Okta, Inc. and/or its affiliates. All rights reserved.
4
+ * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the "License.")
5
+ *
6
+ * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.
7
+ * Unless required by applicable law or agreed to in writing, software
8
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
9
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10
+ *
11
+ * See the License for the specific language governing permissions and limitations under the License.
12
+ */
2
13
  import { memo, useCallback } from "react";
3
14
  import { Field } from "./Field.js";
4
15
  import { jsx as _jsx } from "react/jsx-runtime";
5
-
6
16
  const RadioGroup = _ref => {
7
17
  let {
8
18
  children,
@@ -41,7 +51,6 @@ const RadioGroup = _ref => {
41
51
  renderFieldComponent: renderFieldComponent
42
52
  });
43
53
  };
44
-
45
54
  const MemoizedRadioGroup = memo(RadioGroup);
46
55
  export { MemoizedRadioGroup as RadioGroup };
47
56
  //# sourceMappingURL=RadioGroup.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"RadioGroup.js","names":["memo","useCallback","Field","RadioGroup","children","defaultValue","errorMessage","hint","id","idOverride","isDisabled","label","onChange","value","renderFieldComponent","ariaDescribedBy","MemoizedRadioGroup"],"sources":["../src/RadioGroup.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 { RadioGroup as MuiRadioGroup } from \"@mui/material\";\nimport { ChangeEventHandler, memo, ReactElement, useCallback } from \"react\";\n\nimport { Radio, RadioProps } from \"./Radio\";\nimport { Field } from \"./Field\";\n\nexport type RadioGroupProps = {\n /**\n * The <Radio> components within the group. Must include two or more.\n */\n children: Array<ReactElement<typeof Radio>>;\n /**\n * The text value of the radio that should be selected by default\n */\n defaultValue?: string;\n /**\n * The error text for an invalid group\n */\n errorMessage?: string;\n /**\n * Optional hint text\n */\n hint?: string;\n /**\n * The id of the `input` element. This will also be the input's `name` field.\n */\n id?: string;\n /**\n * Disables the whole radio group\n */\n isDisabled?: boolean;\n /**\n * The text label for the radio group\n */\n label: string;\n /**\n * Listen for changes in the browser that change `value`.\n */\n onChange?: ChangeEventHandler<EventTarget>;\n /**\n * The `value` on the selected radio button.\n */\n value?: RadioProps[\"value\"];\n};\n\nconst RadioGroup = ({\n children,\n defaultValue,\n errorMessage,\n hint,\n id: idOverride,\n isDisabled,\n label,\n onChange,\n value,\n}: RadioGroupProps) => {\n const renderFieldComponent = useCallback(\n ({ ariaDescribedBy, id }) => (\n <MuiRadioGroup\n aria-describedby={ariaDescribedBy}\n defaultValue={defaultValue}\n id={id}\n name={id}\n onChange={onChange}\n value={value}\n >\n {children}\n </MuiRadioGroup>\n ),\n [children, defaultValue, onChange, value]\n );\n\n return (\n <Field\n errorMessage={errorMessage}\n fieldType=\"group\"\n hasVisibleLabel={false}\n hint={hint}\n id={idOverride}\n isDisabled={isDisabled}\n label={label}\n renderFieldComponent={renderFieldComponent}\n />\n );\n};\n\nconst MemoizedRadioGroup = memo(RadioGroup);\n\nexport { MemoizedRadioGroup as RadioGroup };\n"],"mappings":";AAaA,SAA6BA,IAA7B,EAAiDC,WAAjD,QAAoE,OAApE;SAGSC,K;;;AAyCT,MAAMC,UAAU,GAAG,QAUI;EAAA,IAVH;IAClBC,QADkB;IAElBC,YAFkB;IAGlBC,YAHkB;IAIlBC,IAJkB;IAKlBC,EAAE,EAAEC,UALc;IAMlBC,UANkB;IAOlBC,KAPkB;IAQlBC,QARkB;IASlBC;EATkB,CAUG;EACrB,MAAMC,oBAAoB,GAAGb,WAAW,CACtC;IAAA,IAAC;MAAEc,eAAF;MAAmBP;IAAnB,CAAD;IAAA,OACE;MACE,oBAAkBO,eADpB;MAEE,YAAY,EAAEV,YAFhB;MAGE,EAAE,EAAEG,EAHN;MAIE,IAAI,EAAEA,EAJR;MAKE,QAAQ,EAAEI,QALZ;MAME,KAAK,EAAEC,KANT;MAAA,UAQGT;IARH,EADF;EAAA,CADsC,EAatC,CAACA,QAAD,EAAWC,YAAX,EAAyBO,QAAzB,EAAmCC,KAAnC,CAbsC,CAAxC;EAgBA,OACE,KAAC,KAAD;IACE,YAAY,EAAEP,YADhB;IAEE,SAAS,EAAC,OAFZ;IAGE,eAAe,EAAE,KAHnB;IAIE,IAAI,EAAEC,IAJR;IAKE,EAAE,EAAEE,UALN;IAME,UAAU,EAAEC,UANd;IAOE,KAAK,EAAEC,KAPT;IAQE,oBAAoB,EAAEG;EARxB,EADF;AAYD,CAvCD;;AAyCA,MAAME,kBAAkB,GAAGhB,IAAI,CAACG,UAAD,CAA/B;AAEA,SAASa,kBAAkB,IAAIb,UAA/B"}
1
+ {"version":3,"file":"RadioGroup.js","names":["memo","useCallback","Field","jsx","_jsx","RadioGroup","_ref","children","defaultValue","errorMessage","hint","id","idOverride","isDisabled","label","onChange","value","renderFieldComponent","_ref2","ariaDescribedBy","_RadioGroup","name","fieldType","hasVisibleLabel","MemoizedRadioGroup"],"sources":["../src/RadioGroup.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 { RadioGroup as MuiRadioGroup } from \"@mui/material\";\nimport { ChangeEventHandler, memo, ReactElement, useCallback } from \"react\";\n\nimport { Radio, RadioProps } from \"./Radio\";\nimport { Field } from \"./Field\";\n\nexport type RadioGroupProps = {\n /**\n * The <Radio> components within the group. Must include two or more.\n */\n children: Array<ReactElement<typeof Radio>>;\n /**\n * The text value of the radio that should be selected by default\n */\n defaultValue?: string;\n /**\n * The error text for an invalid group\n */\n errorMessage?: string;\n /**\n * Optional hint text\n */\n hint?: string;\n /**\n * The id of the `input` element. This will also be the input's `name` field.\n */\n id?: string;\n /**\n * Disables the whole radio group\n */\n isDisabled?: boolean;\n /**\n * The text label for the radio group\n */\n label: string;\n /**\n * Listen for changes in the browser that change `value`.\n */\n onChange?: ChangeEventHandler<EventTarget>;\n /**\n * The `value` on the selected radio button.\n */\n value?: RadioProps[\"value\"];\n};\n\nconst RadioGroup = ({\n children,\n defaultValue,\n errorMessage,\n hint,\n id: idOverride,\n isDisabled,\n label,\n onChange,\n value,\n}: RadioGroupProps) => {\n const renderFieldComponent = useCallback(\n ({ ariaDescribedBy, id }) => (\n <MuiRadioGroup\n aria-describedby={ariaDescribedBy}\n defaultValue={defaultValue}\n id={id}\n name={id}\n onChange={onChange}\n value={value}\n >\n {children}\n </MuiRadioGroup>\n ),\n [children, defaultValue, onChange, value]\n );\n\n return (\n <Field\n errorMessage={errorMessage}\n fieldType=\"group\"\n hasVisibleLabel={false}\n hint={hint}\n id={idOverride}\n isDisabled={isDisabled}\n label={label}\n renderFieldComponent={renderFieldComponent}\n />\n );\n};\n\nconst MemoizedRadioGroup = memo(RadioGroup);\n\nexport { MemoizedRadioGroup as RadioGroup };\n"],"mappings":";AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAGA,SAA6BA,IAAI,EAAgBC,WAAW,QAAQ,OAAO;AAAC,SAGnEC,KAAK;AAAA,SAAAC,GAAA,IAAAC,IAAA;AAyCd,MAAMC,UAAU,GAAGC,IAAA,IAUI;EAAA,IAVH;IAClBC,QAAQ;IACRC,YAAY;IACZC,YAAY;IACZC,IAAI;IACJC,EAAE,EAAEC,UAAU;IACdC,UAAU;IACVC,KAAK;IACLC,QAAQ;IACRC;EACe,CAAC,GAAAV,IAAA;EAChB,MAAMW,oBAAoB,GAAGhB,WAAW,CACtCiB,KAAA;IAAA,IAAC;MAAEC,eAAe;MAAER;IAAG,CAAC,GAAAO,KAAA;IAAA,OACtBd,IAAA,CAAAgB,WAAA;MACE,oBAAkBD,eAAgB;MAClCX,YAAY,EAAEA,YAAa;MAC3BG,EAAE,EAAEA,EAAG;MACPU,IAAI,EAAEV,EAAG;MACTI,QAAQ,EAAEA,QAAS;MACnBC,KAAK,EAAEA,KAAM;MAAAT,QAAA,EAEZA;IAAQ,CACI,CAAC;EAAA,CACjB,EACD,CAACA,QAAQ,EAAEC,YAAY,EAAEO,QAAQ,EAAEC,KAAK,CAC1C,CAAC;EAED,OACEZ,IAAA,CAACF,KAAK;IACJO,YAAY,EAAEA,YAAa;IAC3Ba,SAAS,EAAC,OAAO;IACjBC,eAAe,EAAE,KAAM;IACvBb,IAAI,EAAEA,IAAK;IACXC,EAAE,EAAEC,UAAW;IACfC,UAAU,EAAEA,UAAW;IACvBC,KAAK,EAAEA,KAAM;IACbG,oBAAoB,EAAEA;EAAqB,CAC5C,CAAC;AAEN,CAAC;AAED,MAAMO,kBAAkB,GAAGxB,IAAI,CAACK,UAAU,CAAC;AAE3C,SAASmB,kBAAkB,IAAInB,UAAU"}
@@ -9,12 +9,13 @@
9
9
  *
10
10
  * See the License for the specific language governing permissions and limitations under the License.
11
11
  */
12
+
12
13
  import { memo } from "react";
13
14
  import { Box, visuallyHidden } from "./index.js";
14
15
  import { jsx as _jsx } from "react/jsx-runtime";
15
- const style = { ...visuallyHidden
16
+ const style = {
17
+ ...visuallyHidden
16
18
  };
17
-
18
19
  const ScreenReaderText = _ref => {
19
20
  let {
20
21
  children
@@ -24,7 +25,6 @@ const ScreenReaderText = _ref => {
24
25
  children: children
25
26
  });
26
27
  };
27
-
28
28
  const MemoizedScreenReaderText = memo(ScreenReaderText);
29
29
  export { MemoizedScreenReaderText as ScreenReaderText };
30
30
  //# sourceMappingURL=ScreenReaderText.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ScreenReaderText.js","names":["memo","Box","visuallyHidden","style","ScreenReaderText","children","MemoizedScreenReaderText"],"sources":["../src/ScreenReaderText.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 { Box, visuallyHidden } from \"./\";\n\nexport type ScreenReaderTextProps = {\n /**\n * The visually-hidden text.\n */\n children: ReactNode;\n};\n\n/**\n * MUI sx expects you pass in a CSS object, not an object with CSS.\n * They seem identical, but only if you create a new object like this will MUI be happy with the type of visuallyHidden.\n * It's otherwise a regular object with CSS properties.\n */\nconst style = { ...visuallyHidden };\n\nconst ScreenReaderText = ({ children }: ScreenReaderTextProps) => (\n <Box sx={style}>{children}</Box>\n);\n\nconst MemoizedScreenReaderText = memo(ScreenReaderText);\n\nexport { MemoizedScreenReaderText as ScreenReaderText };\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA,SAASA,IAAT,QAAgC,OAAhC;SACSC,G,EAAKC,c;;AAcd,MAAMC,KAAK,GAAG,EAAE,GAAGD;AAAL,CAAd;;AAEA,MAAME,gBAAgB,GAAG;EAAA,IAAC;IAAEC;EAAF,CAAD;EAAA,OACvB,KAAC,GAAD;IAAK,EAAE,EAAEF,KAAT;IAAA,UAAiBE;EAAjB,EADuB;AAAA,CAAzB;;AAIA,MAAMC,wBAAwB,GAAGN,IAAI,CAACI,gBAAD,CAArC;AAEA,SAASE,wBAAwB,IAAIF,gBAArC"}
1
+ {"version":3,"file":"ScreenReaderText.js","names":["memo","Box","visuallyHidden","jsx","_jsx","style","ScreenReaderText","_ref","children","sx","MemoizedScreenReaderText"],"sources":["../src/ScreenReaderText.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 { Box, visuallyHidden } from \"./\";\n\nexport type ScreenReaderTextProps = {\n /**\n * The visually-hidden text.\n */\n children: ReactNode;\n};\n\n/**\n * MUI sx expects you pass in a CSS object, not an object with CSS.\n * They seem identical, but only if you create a new object like this will MUI be happy with the type of visuallyHidden.\n * It's otherwise a regular object with CSS properties.\n */\nconst style = { ...visuallyHidden };\n\nconst ScreenReaderText = ({ children }: ScreenReaderTextProps) => (\n <Box sx={style}>{children}</Box>\n);\n\nconst MemoizedScreenReaderText = memo(ScreenReaderText);\n\nexport { MemoizedScreenReaderText as ScreenReaderText };\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,IAAI,QAAmB,OAAO;AAAC,SAC/BC,GAAG,EAAEC,cAAc;AAAA,SAAAC,GAAA,IAAAC,IAAA;AAc5B,MAAMC,KAAK,GAAG;EAAE,GAAGH;AAAe,CAAC;AAEnC,MAAMI,gBAAgB,GAAGC,IAAA;EAAA,IAAC;IAAEC;EAAgC,CAAC,GAAAD,IAAA;EAAA,OAC3DH,IAAA,CAACH,GAAG;IAACQ,EAAE,EAAEJ,KAAM;IAAAG,QAAA,EAAEA;EAAQ,CAAM,CAAC;AAAA,CACjC;AAED,MAAME,wBAAwB,GAAGV,IAAI,CAACM,gBAAgB,CAAC;AAEvD,SAASI,wBAAwB,IAAIJ,gBAAgB"}
@@ -1,5 +1,16 @@
1
1
  import _InputBase from "@mui/material/InputBase";
2
2
  import _InputAdornment from "@mui/material/InputAdornment";
3
+ /*!
4
+ * Copyright (c) 2022-present, Okta, Inc. and/or its affiliates. All rights reserved.
5
+ * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the "License.")
6
+ *
7
+ * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.
8
+ * Unless required by applicable law or agreed to in writing, software
9
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
10
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11
+ *
12
+ * See the License for the specific language governing permissions and limitations under the License.
13
+ */
3
14
  import { forwardRef, memo, useCallback } from "react";
4
15
  import { SearchIcon } from "./index.js";
5
16
  import { Field } from "./Field.js";
@@ -1 +1 @@
1
- {"version":3,"file":"SearchField.js","names":["forwardRef","memo","useCallback","SearchIcon","Field","SearchField","ref","autoCompleteType","hasInitialFocus","id","idOverride","isDisabled","label","onChange","onFocus","onBlur","placeholder","value","renderFieldComponent","ariaDescribedBy","MemoizedSearchField"],"sources":["../src/SearchField.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 { InputAdornment, InputBase } from \"@mui/material\";\nimport {\n ChangeEventHandler,\n FocusEventHandler,\n forwardRef,\n InputHTMLAttributes,\n memo,\n useCallback,\n} from \"react\";\n\nimport { SearchIcon } from \"./\";\nimport { Field } from \"./Field\";\n\nexport type SearchFieldProps = {\n /**\n * This prop helps users to fill forms faster, especially on mobile devices.\n * The name can be confusing, as it's more like an autofill.\n * You can learn more about it [following the specification](https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#autofill).\n */\n autoCompleteType?: InputHTMLAttributes<HTMLInputElement>[\"autoComplete\"];\n /**\n * If `true`, the component will receive focus automatically.\n */\n hasInitialFocus?: boolean;\n /**\n * The id of the `input` element.\n */\n id?: string;\n /**\n * If `true`, the component is disabled.\n */\n isDisabled?: boolean;\n /**\n * This label won't show up visually, but it's required for accessibility.\n */\n label: string;\n /**\n * Callback fired when the `input` element loses focus.\n */\n onBlur?: FocusEventHandler<HTMLInputElement | HTMLTextAreaElement>;\n /**\n * Callback fired when the value is changed.\n */\n onChange?: ChangeEventHandler<HTMLTextAreaElement | HTMLInputElement>;\n /**\n * Callback fired when the `input` element get focus.\n */\n onFocus?: FocusEventHandler<HTMLInputElement | HTMLTextAreaElement>;\n /**\n * The short hint displayed in the `input` before the user enters a value.\n */\n placeholder?: string;\n /**\n * The value of the `input` element, required for a controlled component.\n */\n value?: string;\n};\n\nconst SearchField = forwardRef<HTMLInputElement, SearchFieldProps>(\n (\n {\n autoCompleteType,\n hasInitialFocus,\n id: idOverride,\n isDisabled = false,\n label,\n onChange,\n onFocus,\n onBlur,\n placeholder,\n value,\n },\n ref\n ) => {\n const renderFieldComponent = useCallback(\n ({ ariaDescribedBy, id }) => (\n <InputBase\n aria-describedby={ariaDescribedBy}\n autoComplete={autoCompleteType}\n /* eslint-disable-next-line jsx-a11y/no-autofocus */\n autoFocus={hasInitialFocus}\n id={id}\n name={id}\n onChange={onChange}\n onFocus={onFocus}\n onBlur={onBlur}\n placeholder={placeholder}\n ref={ref}\n startAdornment={\n <InputAdornment position=\"start\">\n <SearchIcon />\n </InputAdornment>\n }\n type=\"search\"\n value={value}\n />\n ),\n [\n autoCompleteType,\n hasInitialFocus,\n onChange,\n onFocus,\n onBlur,\n placeholder,\n ref,\n value,\n ]\n );\n\n return (\n <Field\n fieldType=\"single\"\n hasVisibleLabel={false}\n id={idOverride}\n isDisabled={isDisabled}\n isOptional={true}\n label={label}\n renderFieldComponent={renderFieldComponent}\n />\n );\n }\n);\n\nconst MemoizedSearchField = memo(SearchField);\n\nexport { MemoizedSearchField as SearchField };\n"],"mappings":";;AAaA,SAGEA,UAHF,EAKEC,IALF,EAMEC,WANF,QAOO,OAPP;SASSC,U;SACAC,K;;AA+CT,MAAMC,WAAW,GAAGL,UAAU,CAC5B,OAaEM,GAbF,KAcK;EAAA,IAbH;IACEC,gBADF;IAEEC,eAFF;IAGEC,EAAE,EAAEC,UAHN;IAIEC,UAAU,GAAG,KAJf;IAKEC,KALF;IAMEC,QANF;IAOEC,OAPF;IAQEC,MARF;IASEC,WATF;IAUEC;EAVF,CAaG;EACH,MAAMC,oBAAoB,GAAGhB,WAAW,CACtC;IAAA,IAAC;MAAEiB,eAAF;MAAmBV;IAAnB,CAAD;IAAA,OACE;MACE,oBAAkBU,eADpB;MAEE,YAAY,EAAEZ,gBAFhB;MAIE,SAAS,EAAEC,eAJb;MAKE,EAAE,EAAEC,EALN;MAME,IAAI,EAAEA,EANR;MAOE,QAAQ,EAAEI,QAPZ;MAQE,OAAO,EAAEC,OARX;MASE,MAAM,EAAEC,MATV;MAUE,WAAW,EAAEC,WAVf;MAWE,GAAG,EAAEV,GAXP;MAYE,cAAc,EACZ;QAAgB,QAAQ,EAAC,OAAzB;QAAA,UACE,KAAC,UAAD;MADF,EAbJ;MAiBE,IAAI,EAAC,QAjBP;MAkBE,KAAK,EAAEW;IAlBT,EADF;EAAA,CADsC,EAuBtC,CACEV,gBADF,EAEEC,eAFF,EAGEK,QAHF,EAIEC,OAJF,EAKEC,MALF,EAMEC,WANF,EAOEV,GAPF,EAQEW,KARF,CAvBsC,CAAxC;EAmCA,OACE,KAAC,KAAD;IACE,SAAS,EAAC,QADZ;IAEE,eAAe,EAAE,KAFnB;IAGE,EAAE,EAAEP,UAHN;IAIE,UAAU,EAAEC,UAJd;IAKE,UAAU,EAAE,IALd;IAME,KAAK,EAAEC,KANT;IAOE,oBAAoB,EAAEM;EAPxB,EADF;AAWD,CA9D2B,CAA9B;AAiEA,MAAME,mBAAmB,GAAGnB,IAAI,CAACI,WAAD,CAAhC;AAEA,SAASe,mBAAmB,IAAIf,WAAhC"}
1
+ {"version":3,"file":"SearchField.js","names":["forwardRef","memo","useCallback","SearchIcon","Field","jsx","_jsx","SearchField","_ref","ref","autoCompleteType","hasInitialFocus","id","idOverride","isDisabled","label","onChange","onFocus","onBlur","placeholder","value","renderFieldComponent","_ref2","ariaDescribedBy","_InputBase","autoComplete","autoFocus","name","startAdornment","_InputAdornment","position","children","type","fieldType","hasVisibleLabel","isOptional","MemoizedSearchField"],"sources":["../src/SearchField.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 { InputAdornment, InputBase } from \"@mui/material\";\nimport {\n ChangeEventHandler,\n FocusEventHandler,\n forwardRef,\n InputHTMLAttributes,\n memo,\n useCallback,\n} from \"react\";\n\nimport { SearchIcon } from \"./\";\nimport { Field } from \"./Field\";\n\nexport type SearchFieldProps = {\n /**\n * This prop helps users to fill forms faster, especially on mobile devices.\n * The name can be confusing, as it's more like an autofill.\n * You can learn more about it [following the specification](https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#autofill).\n */\n autoCompleteType?: InputHTMLAttributes<HTMLInputElement>[\"autoComplete\"];\n /**\n * If `true`, the component will receive focus automatically.\n */\n hasInitialFocus?: boolean;\n /**\n * The id of the `input` element.\n */\n id?: string;\n /**\n * If `true`, the component is disabled.\n */\n isDisabled?: boolean;\n /**\n * This label won't show up visually, but it's required for accessibility.\n */\n label: string;\n /**\n * Callback fired when the `input` element loses focus.\n */\n onBlur?: FocusEventHandler<HTMLInputElement | HTMLTextAreaElement>;\n /**\n * Callback fired when the value is changed.\n */\n onChange?: ChangeEventHandler<HTMLTextAreaElement | HTMLInputElement>;\n /**\n * Callback fired when the `input` element get focus.\n */\n onFocus?: FocusEventHandler<HTMLInputElement | HTMLTextAreaElement>;\n /**\n * The short hint displayed in the `input` before the user enters a value.\n */\n placeholder?: string;\n /**\n * The value of the `input` element, required for a controlled component.\n */\n value?: string;\n};\n\nconst SearchField = forwardRef<HTMLInputElement, SearchFieldProps>(\n (\n {\n autoCompleteType,\n hasInitialFocus,\n id: idOverride,\n isDisabled = false,\n label,\n onChange,\n onFocus,\n onBlur,\n placeholder,\n value,\n },\n ref\n ) => {\n const renderFieldComponent = useCallback(\n ({ ariaDescribedBy, id }) => (\n <InputBase\n aria-describedby={ariaDescribedBy}\n autoComplete={autoCompleteType}\n /* eslint-disable-next-line jsx-a11y/no-autofocus */\n autoFocus={hasInitialFocus}\n id={id}\n name={id}\n onChange={onChange}\n onFocus={onFocus}\n onBlur={onBlur}\n placeholder={placeholder}\n ref={ref}\n startAdornment={\n <InputAdornment position=\"start\">\n <SearchIcon />\n </InputAdornment>\n }\n type=\"search\"\n value={value}\n />\n ),\n [\n autoCompleteType,\n hasInitialFocus,\n onChange,\n onFocus,\n onBlur,\n placeholder,\n ref,\n value,\n ]\n );\n\n return (\n <Field\n fieldType=\"single\"\n hasVisibleLabel={false}\n id={idOverride}\n isDisabled={isDisabled}\n isOptional={true}\n label={label}\n renderFieldComponent={renderFieldComponent}\n />\n );\n }\n);\n\nconst MemoizedSearchField = memo(SearchField);\n\nexport { MemoizedSearchField as SearchField };\n"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAGA,SAGEA,UAAU,EAEVC,IAAI,EACJC,WAAW,QACN,OAAO;AAAC,SAENC,UAAU;AAAA,SACVC,KAAK;AAAA,SAAAC,GAAA,IAAAC,IAAA;AA+Cd,MAAMC,WAAW,GAAGP,UAAU,CAC5B,CAAAQ,IAAA,EAaEC,GAAG,KACA;EAAA,IAbH;IACEC,gBAAgB;IAChBC,eAAe;IACfC,EAAE,EAAEC,UAAU;IACdC,UAAU,GAAG,KAAK;IAClBC,KAAK;IACLC,QAAQ;IACRC,OAAO;IACPC,MAAM;IACNC,WAAW;IACXC;EACF,CAAC,GAAAZ,IAAA;EAGD,MAAMa,oBAAoB,GAAGnB,WAAW,CACtCoB,KAAA;IAAA,IAAC;MAAEC,eAAe;MAAEX;IAAG,CAAC,GAAAU,KAAA;IAAA,OACtBhB,IAAA,CAAAkB,UAAA;MACE,oBAAkBD,eAAgB;MAClCE,YAAY,EAAEf,gBAAiB;MAE/BgB,SAAS,EAAEf,eAAgB;MAC3BC,EAAE,EAAEA,EAAG;MACPe,IAAI,EAAEf,EAAG;MACTI,QAAQ,EAAEA,QAAS;MACnBC,OAAO,EAAEA,OAAQ;MACjBC,MAAM,EAAEA,MAAO;MACfC,WAAW,EAAEA,WAAY;MACzBV,GAAG,EAAEA,GAAI;MACTmB,cAAc,EACZtB,IAAA,CAAAuB,eAAA;QAAgBC,QAAQ,EAAC,OAAO;QAAAC,QAAA,EAC9BzB,IAAA,CAACH,UAAU,IAAE;MAAC,CACA,CACjB;MACD6B,IAAI,EAAC,QAAQ;MACbZ,KAAK,EAAEA;IAAM,CACd,CAAC;EAAA,CACH,EACD,CACEV,gBAAgB,EAChBC,eAAe,EACfK,QAAQ,EACRC,OAAO,EACPC,MAAM,EACNC,WAAW,EACXV,GAAG,EACHW,KAAK,CAET,CAAC;EAED,OACEd,IAAA,CAACF,KAAK;IACJ6B,SAAS,EAAC,QAAQ;IAClBC,eAAe,EAAE,KAAM;IACvBtB,EAAE,EAAEC,UAAW;IACfC,UAAU,EAAEA,UAAW;IACvBqB,UAAU,EAAE,IAAK;IACjBpB,KAAK,EAAEA,KAAM;IACbM,oBAAoB,EAAEA;EAAqB,CAC5C,CAAC;AAEN,CACF,CAAC;AAED,MAAMe,mBAAmB,GAAGnC,IAAI,CAACM,WAAW,CAAC;AAE7C,SAAS6B,mBAAmB,IAAI7B,WAAW"}
package/dist/Select.js ADDED
@@ -0,0 +1,131 @@
1
+ import _Select from "@mui/material/Select";
2
+ import _MenuItem from "@mui/material/MenuItem";
3
+ import _ListSubheader from "@mui/material/ListSubheader";
4
+ import _Box from "@mui/material/Box";
5
+ import _Chip from "@mui/material/Chip";
6
+ /*!
7
+ * Copyright (c) 2022-present, Okta, Inc. and/or its affiliates. All rights reserved.
8
+ * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the "License.")
9
+ *
10
+ * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ *
15
+ * See the License for the specific language governing permissions and limitations under the License.
16
+ */
17
+
18
+ import { forwardRef, memo, useCallback, useState } from "react";
19
+ import { Checkbox } from "./Checkbox.js";
20
+ import { Field } from "./Field.js";
21
+ import { jsx as _jsx } from "react/jsx-runtime";
22
+ import { jsxs as _jsxs } from "react/jsx-runtime";
23
+ const Select = forwardRef((_ref, ref) => {
24
+ let {
25
+ errorMessage,
26
+ hint,
27
+ id: idOverride,
28
+ isDisabled = false,
29
+ isMultiSelect = false,
30
+ isOptional = false,
31
+ label,
32
+ onBlur,
33
+ onChange: onChangeProp,
34
+ onFocus,
35
+ value,
36
+ options
37
+ } = _ref;
38
+ if (typeof value === "undefined") {
39
+ value = isMultiSelect ? [] : "";
40
+ }
41
+ const [selectedValue, setSelectedValue] = useState(value);
42
+ const onChange = useCallback((event, child) => {
43
+ const {
44
+ target: {
45
+ value
46
+ }
47
+ } = event;
48
+ if (isMultiSelect) {
49
+ setSelectedValue(typeof value === "string" ? value.split(",") : value);
50
+ } else {
51
+ setSelectedValue(value);
52
+ }
53
+ if (onChangeProp) {
54
+ onChangeProp(event, child);
55
+ }
56
+ }, [isMultiSelect, onChangeProp, setSelectedValue]);
57
+ const normalizedOptions = options.map(option => {
58
+ if (typeof option === "object") {
59
+ return {
60
+ text: option.text,
61
+ value: option.value || option.text,
62
+ type: option.type === "heading" ? "heading" : "option"
63
+ };
64
+ }
65
+ return {
66
+ text: option,
67
+ value: option,
68
+ type: "option"
69
+ };
70
+ });
71
+ const renderValue = useCallback(selected => {
72
+ if (typeof selected === "string") {
73
+ return undefined;
74
+ }
75
+ const renderedChips = selected.map(item => {
76
+ const selectedOption = normalizedOptions.find(option => option.value === item);
77
+ if (!selectedOption) {
78
+ return null;
79
+ }
80
+ return _jsx(_Chip, {
81
+ label: selectedOption.text
82
+ }, item);
83
+ }).filter(Boolean);
84
+ if (renderedChips.length === 0) {
85
+ return null;
86
+ }
87
+ return _jsx(_Box, {
88
+ children: renderedChips
89
+ });
90
+ }, [normalizedOptions]);
91
+ const children = normalizedOptions.map(option => {
92
+ if (option.type === "heading") {
93
+ return _jsx(_ListSubheader, {
94
+ children: option.text
95
+ }, option.text);
96
+ }
97
+ return _jsxs(_MenuItem, {
98
+ value: option.value,
99
+ children: [isMultiSelect && _jsx(Checkbox, {
100
+ isChecked: selectedValue.includes(option.value)
101
+ }), option.text]
102
+ }, option.value);
103
+ });
104
+ const renderFieldComponent = useCallback(() => _jsx(_Select, {
105
+ id: idOverride,
106
+ name: idOverride,
107
+ multiple: isMultiSelect,
108
+ onBlur: onBlur,
109
+ onChange: onChange,
110
+ onFocus: onFocus,
111
+ ref: ref,
112
+ children: children,
113
+ renderValue: isMultiSelect ? renderValue : undefined,
114
+ value: selectedValue
115
+ }), [idOverride, isMultiSelect, onBlur, onChange, onFocus, ref, children, renderValue, selectedValue]);
116
+ return _jsx(Field, {
117
+ errorMessage: errorMessage,
118
+ fieldType: "single",
119
+ hasVisibleLabel: true,
120
+ hint: hint,
121
+ id: idOverride,
122
+ isDisabled: isDisabled,
123
+ isOptional: isOptional,
124
+ label: label,
125
+ renderFieldComponent: renderFieldComponent
126
+ });
127
+ });
128
+ const MemoizedSelect = memo(Select);
129
+ MemoizedSelect.displayName = "Select";
130
+ export { MemoizedSelect as Select };
131
+ //# sourceMappingURL=Select.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Select.js","names":["forwardRef","memo","useCallback","useState","Checkbox","Field","jsx","_jsx","jsxs","_jsxs","Select","_ref","ref","errorMessage","hint","id","idOverride","isDisabled","isMultiSelect","isOptional","label","onBlur","onChange","onChangeProp","onFocus","value","options","selectedValue","setSelectedValue","event","child","target","split","normalizedOptions","map","option","text","type","renderValue","selected","undefined","renderedChips","item","selectedOption","find","_Chip","filter","Boolean","length","_Box","children","_ListSubheader","_MenuItem","isChecked","includes","renderFieldComponent","_Select","name","multiple","fieldType","hasVisibleLabel","MemoizedSelect","displayName"],"sources":["../src/Select.tsx"],"sourcesContent":["/*!\n * Copyright (c) 2022-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *\n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport { ReactNode, forwardRef, memo, useCallback, useState } from \"react\";\nimport {\n Box,\n Chip,\n ListSubheader,\n MenuItem,\n Select as MuiSelect,\n SelectChangeEvent,\n} from \"@mui/material\";\nimport { SelectProps as MuiSelectProps } from \"@mui/material\";\nimport { Checkbox } from \"./Checkbox\";\nimport { Field } from \"./Field\";\n\nexport type SelectOption = {\n text: string;\n value?: string;\n type?: \"heading\" | \"option\";\n};\n\nexport type SelectProps = {\n errorMessage?: string;\n hint?: string;\n id?: string;\n isDisabled?: boolean;\n isMultiSelect?: boolean;\n isOptional?: boolean;\n label: string;\n onBlur?: MuiSelectProps[\"onBlur\"];\n onChange?: MuiSelectProps[\"onChange\"];\n onFocus?: MuiSelectProps[\"onFocus\"];\n options: (string | SelectOption)[];\n value?: string | string[];\n};\n\n/**\n * Options in Odyssey <Select> are passed as an array, which can contain any combination\n * of the following:\n * - string — A simple string. The string will be both the text and the value of the resulting option.\n * <option value=\"string\">string</option>\n *\n * - { text: string } — Same as above, but the string is contained within an object.\n * <option value=\"text\">text</option>\n *\n * - { text: string, value: string } — The option text will be text, and the option value will be value.\n * <option value=\"value\">text</option>\n *\n * - { text: string, type: \"heading\" } — Used to display a group heading with the text\n */\n\nconst Select = forwardRef<HTMLSelectElement, SelectProps>(\n (\n {\n errorMessage,\n hint,\n id: idOverride,\n isDisabled = false,\n isMultiSelect = false,\n isOptional = false,\n label,\n onBlur,\n onChange: onChangeProp,\n onFocus,\n value,\n options,\n },\n ref\n ) => {\n // If there's no value set, we set it to a blank string (if it's a single-select)\n // or an empty array (if it's a multi-select)\n if (typeof value === \"undefined\") {\n value = isMultiSelect ? [] : \"\";\n }\n\n const [selectedValue, setSelectedValue] = useState<string | string[]>(\n value\n );\n\n const onChange = useCallback(\n (event: SelectChangeEvent<string | string[]>, child: ReactNode) => {\n const {\n target: { value },\n } = event;\n\n // Set the field value, with some additional logic to handle array values\n // for multi-selects\n if (isMultiSelect) {\n setSelectedValue(\n typeof value === \"string\" ? value.split(\",\") : value\n );\n } else {\n setSelectedValue(value);\n }\n\n // Trigger the onChange event, if one has been passed\n if (onChangeProp) {\n onChangeProp(event, child);\n }\n },\n [isMultiSelect, onChangeProp, setSelectedValue]\n );\n\n // Normalize the options array to accommodate the various\n // data types that might be passed\n const normalizedOptions = options.map((option) => {\n if (typeof option === \"object\") {\n return {\n text: option.text,\n value: option.value || option.text,\n type: option.type === \"heading\" ? \"heading\" : \"option\",\n };\n }\n\n return { text: option, value: option, type: \"option\" };\n });\n\n const renderValue = useCallback(\n (selected: string | string[]) => {\n // If the selected value isn't an array, then we don't need to display\n // chips and should fall back to the default render behavior\n if (typeof selected === \"string\") {\n return undefined;\n }\n\n // Convert the selected options array into <Chip>s\n const renderedChips = selected\n .map((item: string) => {\n const selectedOption = normalizedOptions.find(\n (option) => option.value === item\n );\n\n if (!selectedOption) {\n return null;\n }\n\n return <Chip key={item} label={selectedOption.text} />;\n })\n .filter(Boolean);\n\n if (renderedChips.length === 0) {\n return null;\n }\n\n // We need the <Box> to surround the <Chip>s for\n // proper styling\n return <Box>{renderedChips}</Box>;\n },\n [normalizedOptions]\n );\n\n // Convert the options into the ReactNode children\n // that will populate the <Select>\n const children = normalizedOptions.map((option) => {\n if (option.type === \"heading\") {\n return <ListSubheader key={option.text}>{option.text}</ListSubheader>;\n }\n\n return (\n <MenuItem key={option.value} value={option.value}>\n {isMultiSelect && (\n <Checkbox isChecked={selectedValue.includes(option.value)} />\n )}\n {option.text}\n </MenuItem>\n );\n });\n\n const renderFieldComponent = useCallback(\n () => (\n <MuiSelect\n id={idOverride}\n name={idOverride}\n multiple={isMultiSelect}\n onBlur={onBlur}\n onChange={onChange}\n onFocus={onFocus}\n ref={ref}\n children={children}\n renderValue={isMultiSelect ? renderValue : undefined}\n value={selectedValue}\n />\n ),\n [\n idOverride,\n isMultiSelect,\n onBlur,\n onChange,\n onFocus,\n ref,\n children,\n renderValue,\n selectedValue,\n ]\n );\n\n return (\n <Field\n errorMessage={errorMessage}\n fieldType=\"single\"\n hasVisibleLabel\n hint={hint}\n id={idOverride}\n isDisabled={isDisabled}\n isOptional={isOptional}\n label={label}\n renderFieldComponent={renderFieldComponent}\n />\n );\n }\n);\n\nconst MemoizedSelect = memo(Select);\nMemoizedSelect.displayName = \"Select\";\n\nexport { MemoizedSelect as Select };\n"],"mappings":";;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAAoBA,UAAU,EAAEC,IAAI,EAAEC,WAAW,EAAEC,QAAQ,QAAQ,OAAO;AAAC,SAUlEC,QAAQ;AAAA,SACRC,KAAK;AAAA,SAAAC,GAAA,IAAAC,IAAA;AAAA,SAAAC,IAAA,IAAAC,KAAA;AAsCd,MAAMC,MAAM,GAAGV,UAAU,CACvB,CAAAW,IAAA,EAeEC,GAAG,KACA;EAAA,IAfH;IACEC,YAAY;IACZC,IAAI;IACJC,EAAE,EAAEC,UAAU;IACdC,UAAU,GAAG,KAAK;IAClBC,aAAa,GAAG,KAAK;IACrBC,UAAU,GAAG,KAAK;IAClBC,KAAK;IACLC,MAAM;IACNC,QAAQ,EAAEC,YAAY;IACtBC,OAAO;IACPC,KAAK;IACLC;EACF,CAAC,GAAAf,IAAA;EAKD,IAAI,OAAOc,KAAK,KAAK,WAAW,EAAE;IAChCA,KAAK,GAAGP,aAAa,GAAG,EAAE,GAAG,EAAE;EACjC;EAEA,MAAM,CAACS,aAAa,EAAEC,gBAAgB,CAAC,GAAGzB,QAAQ,CAChDsB,KACF,CAAC;EAED,MAAMH,QAAQ,GAAGpB,WAAW,CAC1B,CAAC2B,KAA2C,EAAEC,KAAgB,KAAK;IACjE,MAAM;MACJC,MAAM,EAAE;QAAEN;MAAM;IAClB,CAAC,GAAGI,KAAK;IAIT,IAAIX,aAAa,EAAE;MACjBU,gBAAgB,CACd,OAAOH,KAAK,KAAK,QAAQ,GAAGA,KAAK,CAACO,KAAK,CAAC,GAAG,CAAC,GAAGP,KACjD,CAAC;IACH,CAAC,MAAM;MACLG,gBAAgB,CAACH,KAAK,CAAC;IACzB;IAGA,IAAIF,YAAY,EAAE;MAChBA,YAAY,CAACM,KAAK,EAAEC,KAAK,CAAC;IAC5B;EACF,CAAC,EACD,CAACZ,aAAa,EAAEK,YAAY,EAAEK,gBAAgB,CAChD,CAAC;EAID,MAAMK,iBAAiB,GAAGP,OAAO,CAACQ,GAAG,CAAEC,MAAM,IAAK;IAChD,IAAI,OAAOA,MAAM,KAAK,QAAQ,EAAE;MAC9B,OAAO;QACLC,IAAI,EAAED,MAAM,CAACC,IAAI;QACjBX,KAAK,EAAEU,MAAM,CAACV,KAAK,IAAIU,MAAM,CAACC,IAAI;QAClCC,IAAI,EAAEF,MAAM,CAACE,IAAI,KAAK,SAAS,GAAG,SAAS,GAAG;MAChD,CAAC;IACH;IAEA,OAAO;MAAED,IAAI,EAAED,MAAM;MAAEV,KAAK,EAAEU,MAAM;MAAEE,IAAI,EAAE;IAAS,CAAC;EACxD,CAAC,CAAC;EAEF,MAAMC,WAAW,GAAGpC,WAAW,CAC5BqC,QAA2B,IAAK;IAG/B,IAAI,OAAOA,QAAQ,KAAK,QAAQ,EAAE;MAChC,OAAOC,SAAS;IAClB;IAGA,MAAMC,aAAa,GAAGF,QAAQ,CAC3BL,GAAG,CAAEQ,IAAY,IAAK;MACrB,MAAMC,cAAc,GAAGV,iBAAiB,CAACW,IAAI,CAC1CT,MAAM,IAAKA,MAAM,CAACV,KAAK,KAAKiB,IAC/B,CAAC;MAED,IAAI,CAACC,cAAc,EAAE;QACnB,OAAO,IAAI;MACb;MAEA,OAAOpC,IAAA,CAAAsC,KAAA;QAAiBzB,KAAK,EAAEuB,cAAc,CAACP;MAAK,GAAjCM,IAAmC,CAAC;IACxD,CAAC,CAAC,CACDI,MAAM,CAACC,OAAO,CAAC;IAElB,IAAIN,aAAa,CAACO,MAAM,KAAK,CAAC,EAAE;MAC9B,OAAO,IAAI;IACb;IAIA,OAAOzC,IAAA,CAAA0C,IAAA;MAAAC,QAAA,EAAMT;IAAa,CAAM,CAAC;EACnC,CAAC,EACD,CAACR,iBAAiB,CACpB,CAAC;EAID,MAAMiB,QAAQ,GAAGjB,iBAAiB,CAACC,GAAG,CAAEC,MAAM,IAAK;IACjD,IAAIA,MAAM,CAACE,IAAI,KAAK,SAAS,EAAE;MAC7B,OAAO9B,IAAA,CAAA4C,cAAA;QAAAD,QAAA,EAAkCf,MAAM,CAACC;MAAI,GAAzBD,MAAM,CAACC,IAAkC,CAAC;IACvE;IAEA,OACE3B,KAAA,CAAA2C,SAAA;MAA6B3B,KAAK,EAAEU,MAAM,CAACV,KAAM;MAAAyB,QAAA,GAC9ChC,aAAa,IACZX,IAAA,CAACH,QAAQ;QAACiD,SAAS,EAAE1B,aAAa,CAAC2B,QAAQ,CAACnB,MAAM,CAACV,KAAK;MAAE,CAAE,CAC7D,EACAU,MAAM,CAACC,IAAI;IAAA,GAJCD,MAAM,CAACV,KAKZ,CAAC;EAEf,CAAC,CAAC;EAEF,MAAM8B,oBAAoB,GAAGrD,WAAW,CACtC,MACEK,IAAA,CAAAiD,OAAA;IACEzC,EAAE,EAAEC,UAAW;IACfyC,IAAI,EAAEzC,UAAW;IACjB0C,QAAQ,EAAExC,aAAc;IACxBG,MAAM,EAAEA,MAAO;IACfC,QAAQ,EAAEA,QAAS;IACnBE,OAAO,EAAEA,OAAQ;IACjBZ,GAAG,EAAEA,GAAI;IACTsC,QAAQ,EAAEA,QAAS;IACnBZ,WAAW,EAAEpB,aAAa,GAAGoB,WAAW,GAAGE,SAAU;IACrDf,KAAK,EAAEE;EAAc,CACtB,CACF,EACD,CACEX,UAAU,EACVE,aAAa,EACbG,MAAM,EACNC,QAAQ,EACRE,OAAO,EACPZ,GAAG,EACHsC,QAAQ,EACRZ,WAAW,EACXX,aAAa,CAEjB,CAAC;EAED,OACEpB,IAAA,CAACF,KAAK;IACJQ,YAAY,EAAEA,YAAa;IAC3B8C,SAAS,EAAC,QAAQ;IAClBC,eAAe;IACf9C,IAAI,EAAEA,IAAK;IACXC,EAAE,EAAEC,UAAW;IACfC,UAAU,EAAEA,UAAW;IACvBE,UAAU,EAAEA,UAAW;IACvBC,KAAK,EAAEA,KAAM;IACbmC,oBAAoB,EAAEA;EAAqB,CAC5C,CAAC;AAEN,CACF,CAAC;AAED,MAAMM,cAAc,GAAG5D,IAAI,CAACS,MAAM,CAAC;AACnCmD,cAAc,CAACC,WAAW,GAAG,QAAQ;AAErC,SAASD,cAAc,IAAInD,MAAM"}
@@ -1 +1 @@
1
- {"version":3,"file":"Status.js","names":["Chip","Status","severity","label"],"sources":["../src/Status.tsx"],"sourcesContent":["/*!\n * Copyright (c) 2022-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *\n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport { Chip } from \"./\";\n\nexport type StatusProps = {\n /**\n * Determine the color and icon of the alert\n */\n severity: \"default\" | \"error\" | \"info\" | \"success\" | \"warning\";\n\n /**\n * The text content of the status\n */\n label: string;\n};\n\nexport const Status = ({ severity, label }: StatusProps) => (\n <Chip label={label} color={severity} variant=\"status\" />\n);\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;SAESA,I;;AAcT,OAAO,MAAMC,MAAM,GAAG;EAAA,IAAC;IAAEC,QAAF;IAAYC;EAAZ,CAAD;EAAA,OACpB,KAAC,IAAD;IAAM,KAAK,EAAEA,KAAb;IAAoB,KAAK,EAAED,QAA3B;IAAqC,OAAO,EAAC;EAA7C,EADoB;AAAA,CAAf"}
1
+ {"version":3,"file":"Status.js","names":["Chip","jsx","_jsx","Status","_ref","severity","label","color","variant"],"sources":["../src/Status.tsx"],"sourcesContent":["/*!\n * Copyright (c) 2022-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *\n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport { Chip } from \"./\";\n\nexport type StatusProps = {\n /**\n * Determine the color and icon of the alert\n */\n severity: \"default\" | \"error\" | \"info\" | \"success\" | \"warning\";\n\n /**\n * The text content of the status\n */\n label: string;\n};\n\nexport const Status = ({ severity, label }: StatusProps) => (\n <Chip label={label} color={severity} variant=\"status\" />\n);\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAVA,SAYSA,IAAI;AAAA,SAAAC,GAAA,IAAAC,IAAA;AAcb,OAAO,MAAMC,MAAM,GAAGC,IAAA;EAAA,IAAC;IAAEC,QAAQ;IAAEC;EAAmB,CAAC,GAAAF,IAAA;EAAA,OACrDF,IAAA,CAACF,IAAI;IAACM,KAAK,EAAEA,KAAM;IAACC,KAAK,EAAEF,QAAS;IAACG,OAAO,EAAC;EAAQ,CAAE,CAAC;AAAA,CACzD"}
package/dist/Tabs.js ADDED
@@ -0,0 +1,46 @@
1
+ import _Tab from "@mui/material/Tab";
2
+ /*!
3
+ * Copyright (c) 2022-present, Okta, Inc. and/or its affiliates. All rights reserved.
4
+ * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the "License.")
5
+ *
6
+ * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.
7
+ * Unless required by applicable law or agreed to in writing, software
8
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
9
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10
+ *
11
+ * See the License for the specific language governing permissions and limitations under the License.
12
+ */
13
+
14
+ import React, { useCallback, useState } from "react";
15
+ import { TabList as MuiTabList, TabPanel as MuiTabPanel, TabContext as MuiTabContext } from "@mui/lab";
16
+ import { jsx as _jsx } from "react/jsx-runtime";
17
+ import { jsxs as _jsxs } from "react/jsx-runtime";
18
+ const Tabs = _ref => {
19
+ let {
20
+ ariaLabel,
21
+ tabs,
22
+ initialValue = "0"
23
+ } = _ref;
24
+ const [tabState, setTabState] = useState(initialValue);
25
+ const onChange = useCallback((_event, newState) => {
26
+ setTabState(newState);
27
+ }, []);
28
+ return _jsxs(MuiTabContext, {
29
+ value: tabState,
30
+ children: [_jsx(MuiTabList, {
31
+ onChange: onChange,
32
+ "aria-label": ariaLabel,
33
+ children: tabs.map((tab, index) => _jsx(_Tab, {
34
+ disabled: tab.isDisabled,
35
+ icon: tab.startIcon,
36
+ label: tab.label,
37
+ value: tab.value ? tab.value : index.toString()
38
+ }, tab.value ? tab.value : index.toString()))
39
+ }), tabs.map((tab, index) => _jsx(MuiTabPanel, {
40
+ value: tab.value ? tab.value : index.toString(),
41
+ children: tab.children
42
+ }, tab.value ? tab.value : index.toString()))]
43
+ });
44
+ };
45
+ export { Tabs };
46
+ //# sourceMappingURL=Tabs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Tabs.js","names":["React","useCallback","useState","TabList","MuiTabList","TabPanel","MuiTabPanel","TabContext","MuiTabContext","jsx","_jsx","jsxs","_jsxs","Tabs","_ref","ariaLabel","tabs","initialValue","tabState","setTabState","onChange","_event","newState","value","children","map","tab","index","_Tab","disabled","isDisabled","icon","startIcon","label","toString"],"sources":["../src/Tabs.tsx"],"sourcesContent":["/*!\n * Copyright (c) 2022-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *\n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport React, { ReactElement, ReactNode, useCallback, useState } from \"react\";\nimport { Tab as MuiTab } from \"@mui/material\";\nimport {\n TabList as MuiTabList,\n TabPanel as MuiTabPanel,\n TabContext as MuiTabContext,\n} from \"@mui/lab\";\n\nexport type TabItemProps = {\n children: ReactNode;\n startIcon?: ReactElement;\n label: string;\n isDisabled?: boolean;\n value?: string;\n};\n\nexport type TabsProps = {\n tabs: TabItemProps[];\n initialValue?: string;\n ariaLabel?: string;\n};\n\nconst Tabs = ({ ariaLabel, tabs, initialValue = \"0\" }: TabsProps) => {\n const [tabState, setTabState] = useState(initialValue);\n\n const onChange = useCallback(\n (_event: React.SyntheticEvent, newState: string) => {\n setTabState(newState);\n },\n []\n );\n\n return (\n <MuiTabContext value={tabState}>\n <MuiTabList onChange={onChange} aria-label={ariaLabel}>\n {tabs.map((tab, index) => (\n <MuiTab\n disabled={tab.isDisabled}\n icon={tab.startIcon}\n label={tab.label}\n value={tab.value ? tab.value : index.toString()}\n key={tab.value ? tab.value : index.toString()}\n />\n ))}\n </MuiTabList>\n {tabs.map((tab, index) => (\n <MuiTabPanel\n value={tab.value ? tab.value : index.toString()}\n key={tab.value ? tab.value : index.toString()}\n >\n {tab.children}\n </MuiTabPanel>\n ))}\n </MuiTabContext>\n );\n};\n\nexport { Tabs };\n"],"mappings":";AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,OAAOA,KAAK,IAA6BC,WAAW,EAAEC,QAAQ,QAAQ,OAAO;AAE7E,SACEC,OAAO,IAAIC,UAAU,EACrBC,QAAQ,IAAIC,WAAW,EACvBC,UAAU,IAAIC,aAAa,QACtB,UAAU;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAAA,SAAAC,IAAA,IAAAC,KAAA;AAgBlB,MAAMC,IAAI,GAAGC,IAAA,IAAwD;EAAA,IAAvD;IAAEC,SAAS;IAAEC,IAAI;IAAEC,YAAY,GAAG;EAAe,CAAC,GAAAH,IAAA;EAC9D,MAAM,CAACI,QAAQ,EAAEC,WAAW,CAAC,GAAGjB,QAAQ,CAACe,YAAY,CAAC;EAEtD,MAAMG,QAAQ,GAAGnB,WAAW,CAC1B,CAACoB,MAA4B,EAAEC,QAAgB,KAAK;IAClDH,WAAW,CAACG,QAAQ,CAAC;EACvB,CAAC,EACD,EACF,CAAC;EAED,OACEV,KAAA,CAACJ,aAAa;IAACe,KAAK,EAAEL,QAAS;IAAAM,QAAA,GAC7Bd,IAAA,CAACN,UAAU;MAACgB,QAAQ,EAAEA,QAAS;MAAC,cAAYL,SAAU;MAAAS,QAAA,EACnDR,IAAI,CAACS,GAAG,CAAC,CAACC,GAAG,EAAEC,KAAK,KACnBjB,IAAA,CAAAkB,IAAA;QACEC,QAAQ,EAAEH,GAAG,CAACI,UAAW;QACzBC,IAAI,EAAEL,GAAG,CAACM,SAAU;QACpBC,KAAK,EAAEP,GAAG,CAACO,KAAM;QACjBV,KAAK,EAAEG,GAAG,CAACH,KAAK,GAAGG,GAAG,CAACH,KAAK,GAAGI,KAAK,CAACO,QAAQ,CAAC;MAAE,GAC3CR,GAAG,CAACH,KAAK,GAAGG,GAAG,CAACH,KAAK,GAAGI,KAAK,CAACO,QAAQ,CAAC,CAC7C,CACF;IAAC,CACQ,CAAC,EACZlB,IAAI,CAACS,GAAG,CAAC,CAACC,GAAG,EAAEC,KAAK,KACnBjB,IAAA,CAACJ,WAAW;MACViB,KAAK,EAAEG,GAAG,CAACH,KAAK,GAAGG,GAAG,CAACH,KAAK,GAAGI,KAAK,CAACO,QAAQ,CAAC,CAAE;MAAAV,QAAA,EAG/CE,GAAG,CAACF;IAAQ,GAFRE,GAAG,CAACH,KAAK,GAAGG,GAAG,CAACH,KAAK,GAAGI,KAAK,CAACO,QAAQ,CAAC,CAGjC,CACd,CAAC;EAAA,CACW,CAAC;AAEpB,CAAC;AAED,SAASrB,IAAI"}
package/dist/Tag.js CHANGED
@@ -1,8 +1,18 @@
1
1
  import _Chip from "@mui/material/Chip";
2
+ /*!
3
+ * Copyright (c) 2022-present, Okta, Inc. and/or its affiliates. All rights reserved.
4
+ * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the "License.")
5
+ *
6
+ * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.
7
+ * Unless required by applicable law or agreed to in writing, software
8
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
9
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10
+ *
11
+ * See the License for the specific language governing permissions and limitations under the License.
12
+ */
2
13
  import { memo, useContext } from "react";
3
14
  import { TagListContext } from "./TagListContext.js";
4
15
  import { jsx as _jsx } from "react/jsx-runtime";
5
-
6
16
  const Tag = _ref => {
7
17
  let {
8
18
  isDisabled,
@@ -22,7 +32,6 @@ const Tag = _ref => {
22
32
  onDelete: onRemove
23
33
  });
24
34
  };
25
-
26
35
  const MemoizedTag = memo(Tag);
27
36
  export { MemoizedTag as Tag };
28
37
  //# sourceMappingURL=Tag.js.map
package/dist/Tag.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"Tag.js","names":["memo","useContext","TagListContext","Tag","isDisabled","label","onClick","onRemove","chipElementType","MemoizedTag"],"sources":["../src/Tag.tsx"],"sourcesContent":["/*!\n * Copyright (c) 2022-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *\n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport { Chip, ChipProps } from \"@mui/material\";\nimport { memo, useContext } from \"react\";\nimport { TagListContext } from \"./TagListContext\";\n\nexport type TagProps = {\n isDisabled?: boolean;\n label: string;\n onClick?: ChipProps[\"onClick\"];\n onRemove?: ChipProps[\"onDelete\"];\n};\n\nconst Tag = ({ isDisabled, label, onClick, onRemove }: TagProps) => {\n const { chipElementType } = useContext(TagListContext);\n\n return (\n <Chip\n label={label}\n clickable={onClick ? true : false}\n component={chipElementType}\n disabled={isDisabled}\n onClick={onClick}\n onDelete={onRemove}\n />\n );\n};\n\nconst MemoizedTag = memo(Tag);\n\nexport { MemoizedTag as Tag };\n"],"mappings":";AAaA,SAASA,IAAT,EAAeC,UAAf,QAAiC,OAAjC;SACSC,c;;;AAST,MAAMC,GAAG,GAAG,QAAwD;EAAA,IAAvD;IAAEC,UAAF;IAAcC,KAAd;IAAqBC,OAArB;IAA8BC;EAA9B,CAAuD;EAClE,MAAM;IAAEC;EAAF,IAAsBP,UAAU,CAACC,cAAD,CAAtC;EAEA,OACE;IACE,KAAK,EAAEG,KADT;IAEE,SAAS,EAAEC,OAAO,GAAG,IAAH,GAAU,KAF9B;IAGE,SAAS,EAAEE,eAHb;IAIE,QAAQ,EAAEJ,UAJZ;IAKE,OAAO,EAAEE,OALX;IAME,QAAQ,EAAEC;EANZ,EADF;AAUD,CAbD;;AAeA,MAAME,WAAW,GAAGT,IAAI,CAACG,GAAD,CAAxB;AAEA,SAASM,WAAW,IAAIN,GAAxB"}
1
+ {"version":3,"file":"Tag.js","names":["memo","useContext","TagListContext","jsx","_jsx","Tag","_ref","isDisabled","label","onClick","onRemove","chipElementType","_Chip","clickable","component","disabled","onDelete","MemoizedTag"],"sources":["../src/Tag.tsx"],"sourcesContent":["/*!\n * Copyright (c) 2022-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *\n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport { Chip, ChipProps } from \"@mui/material\";\nimport { memo, useContext } from \"react\";\nimport { TagListContext } from \"./TagListContext\";\n\nexport type TagProps = {\n isDisabled?: boolean;\n label: string;\n onClick?: ChipProps[\"onClick\"];\n onRemove?: ChipProps[\"onDelete\"];\n};\n\nconst Tag = ({ isDisabled, label, onClick, onRemove }: TagProps) => {\n const { chipElementType } = useContext(TagListContext);\n\n return (\n <Chip\n label={label}\n clickable={onClick ? true : false}\n component={chipElementType}\n disabled={isDisabled}\n onClick={onClick}\n onDelete={onRemove}\n />\n );\n};\n\nconst MemoizedTag = memo(Tag);\n\nexport { MemoizedTag as Tag };\n"],"mappings":";AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAGA,SAASA,IAAI,EAAEC,UAAU,QAAQ,OAAO;AAAC,SAChCC,cAAc;AAAA,SAAAC,GAAA,IAAAC,IAAA;AASvB,MAAMC,GAAG,GAAGC,IAAA,IAAwD;EAAA,IAAvD;IAAEC,UAAU;IAAEC,KAAK;IAAEC,OAAO;IAAEC;EAAmB,CAAC,GAAAJ,IAAA;EAC7D,MAAM;IAAEK;EAAgB,CAAC,GAAGV,UAAU,CAACC,cAAc,CAAC;EAEtD,OACEE,IAAA,CAAAQ,KAAA;IACEJ,KAAK,EAAEA,KAAM;IACbK,SAAS,EAAEJ,OAAO,GAAG,IAAI,GAAG,KAAM;IAClCK,SAAS,EAAEH,eAAgB;IAC3BI,QAAQ,EAAER,UAAW;IACrBE,OAAO,EAAEA,OAAQ;IACjBO,QAAQ,EAAEN;EAAS,CACpB,CAAC;AAEN,CAAC;AAED,MAAMO,WAAW,GAAGjB,IAAI,CAACK,GAAG,CAAC;AAE7B,SAASY,WAAW,IAAIZ,GAAG"}
package/dist/TagList.js CHANGED
@@ -1,8 +1,18 @@
1
1
  import _Stack from "@mui/material/Stack";
2
+ /*!
3
+ * Copyright (c) 2022-present, Okta, Inc. and/or its affiliates. All rights reserved.
4
+ * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the "License.")
5
+ *
6
+ * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.
7
+ * Unless required by applicable law or agreed to in writing, software
8
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
9
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10
+ *
11
+ * See the License for the specific language governing permissions and limitations under the License.
12
+ */
2
13
  import { memo, useMemo } from "react";
3
14
  import { TagListContext } from "./TagListContext.js";
4
15
  import { jsx as _jsx } from "react/jsx-runtime";
5
-
6
16
  const TagList = _ref => {
7
17
  let {
8
18
  children
@@ -20,7 +30,6 @@ const TagList = _ref => {
20
30
  })
21
31
  });
22
32
  };
23
-
24
33
  const MemoizedTagList = memo(TagList);
25
34
  export { MemoizedTagList as TagList };
26
35
  //# sourceMappingURL=TagList.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"TagList.js","names":["memo","useMemo","TagListContext","TagList","children","providerValue","chipElementType","MemoizedTagList"],"sources":["../src/TagList.tsx"],"sourcesContent":["/*!\n * Copyright (c) 2022-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *\n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport { Tag } from \"./\";\nimport { Stack } from \"@mui/material\";\nimport { memo, ReactElement, useMemo } from \"react\";\nimport { ChipElementType, TagListContext } from \"./TagListContext\";\n\nexport type TagListProps = {\n children: ReactElement<typeof Tag> | Array<ReactElement<typeof Tag>>;\n};\n\nconst TagList = ({ children }: TagListProps) => {\n const providerValue = useMemo<{\n chipElementType: ChipElementType;\n }>(\n () => ({\n chipElementType: \"li\",\n }),\n []\n );\n\n return (\n <Stack component=\"ul\" direction=\"row\" spacing={2}>\n <TagListContext.Provider value={providerValue}>\n {children}\n </TagListContext.Provider>\n </Stack>\n );\n};\n\nconst MemoizedTagList = memo(TagList);\n\nexport { MemoizedTagList as TagList };\n"],"mappings":";AAcA,SAASA,IAAT,EAA6BC,OAA7B,QAA4C,OAA5C;SAC0BC,c;;;AAM1B,MAAMC,OAAO,GAAG,QAAgC;EAAA,IAA/B;IAAEC;EAAF,CAA+B;EAC9C,MAAMC,aAAa,GAAGJ,OAAO,CAG3B,OAAO;IACLK,eAAe,EAAE;EADZ,CAAP,CAH2B,EAM3B,EAN2B,CAA7B;EASA,OACE;IAAO,SAAS,EAAC,IAAjB;IAAsB,SAAS,EAAC,KAAhC;IAAsC,OAAO,EAAE,CAA/C;IAAA,UACE,KAAC,cAAD,CAAgB,QAAhB;MAAyB,KAAK,EAAED,aAAhC;MAAA,UACGD;IADH;EADF,EADF;AAOD,CAjBD;;AAmBA,MAAMG,eAAe,GAAGP,IAAI,CAACG,OAAD,CAA5B;AAEA,SAASI,eAAe,IAAIJ,OAA5B"}
1
+ {"version":3,"file":"TagList.js","names":["memo","useMemo","TagListContext","jsx","_jsx","TagList","_ref","children","providerValue","chipElementType","_Stack","component","direction","spacing","Provider","value","MemoizedTagList"],"sources":["../src/TagList.tsx"],"sourcesContent":["/*!\n * Copyright (c) 2022-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *\n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport { Tag } from \"./\";\nimport { Stack } from \"@mui/material\";\nimport { memo, ReactElement, useMemo } from \"react\";\nimport { ChipElementType, TagListContext } from \"./TagListContext\";\n\nexport type TagListProps = {\n children: ReactElement<typeof Tag> | Array<ReactElement<typeof Tag>>;\n};\n\nconst TagList = ({ children }: TagListProps) => {\n const providerValue = useMemo<{\n chipElementType: ChipElementType;\n }>(\n () => ({\n chipElementType: \"li\",\n }),\n []\n );\n\n return (\n <Stack component=\"ul\" direction=\"row\" spacing={2}>\n <TagListContext.Provider value={providerValue}>\n {children}\n </TagListContext.Provider>\n </Stack>\n );\n};\n\nconst MemoizedTagList = memo(TagList);\n\nexport { MemoizedTagList as TagList };\n"],"mappings":";AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAIA,SAASA,IAAI,EAAgBC,OAAO,QAAQ,OAAO;AAAC,SAC1BC,cAAc;AAAA,SAAAC,GAAA,IAAAC,IAAA;AAMxC,MAAMC,OAAO,GAAGC,IAAA,IAAgC;EAAA,IAA/B;IAAEC;EAAuB,CAAC,GAAAD,IAAA;EACzC,MAAME,aAAa,GAAGP,OAAO,CAG3B,OAAO;IACLQ,eAAe,EAAE;EACnB,CAAC,CAAC,EACF,EACF,CAAC;EAED,OACEL,IAAA,CAAAM,MAAA;IAAOC,SAAS,EAAC,IAAI;IAACC,SAAS,EAAC,KAAK;IAACC,OAAO,EAAE,CAAE;IAAAN,QAAA,EAC/CH,IAAA,CAACF,cAAc,CAACY,QAAQ;MAACC,KAAK,EAAEP,aAAc;MAAAD,QAAA,EAC3CA;IAAQ,CACc;EAAC,CACrB,CAAC;AAEZ,CAAC;AAED,MAAMS,eAAe,GAAGhB,IAAI,CAACK,OAAO,CAAC;AAErC,SAASW,eAAe,IAAIX,OAAO"}
@@ -9,6 +9,7 @@
9
9
  *
10
10
  * See the License for the specific language governing permissions and limitations under the License.
11
11
  */
12
+
12
13
  import { createContext } from "react";
13
14
  export const TagListContext = createContext({
14
15
  chipElementType: "div"
@@ -1 +1 @@
1
- {"version":3,"file":"TagListContext.js","names":["createContext","TagListContext","chipElementType"],"sources":["../src/TagListContext.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 { createContext } from \"react\";\n\nexport type ChipElementType = \"li\" | \"div\";\n\nexport type TagListContextType = {\n chipElementType: ChipElementType;\n};\n\nexport const TagListContext = createContext<TagListContextType>({\n chipElementType: \"div\",\n});\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA,SAASA,aAAT,QAA8B,OAA9B;AAQA,OAAO,MAAMC,cAAc,GAAGD,aAAa,CAAqB;EAC9DE,eAAe,EAAE;AAD6C,CAArB,CAApC"}
1
+ {"version":3,"file":"TagListContext.js","names":["createContext","TagListContext","chipElementType"],"sources":["../src/TagListContext.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 { createContext } from \"react\";\n\nexport type ChipElementType = \"li\" | \"div\";\n\nexport type TagListContextType = {\n chipElementType: ChipElementType;\n};\n\nexport const TagListContext = createContext<TagListContextType>({\n chipElementType: \"div\",\n});\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,aAAa,QAAQ,OAAO;AAQrC,OAAO,MAAMC,cAAc,GAAGD,aAAa,CAAqB;EAC9DE,eAAe,EAAE;AACnB,CAAC,CAAC"}