@okta/odyssey-react-mui 0.21.4 → 0.23.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 (321) hide show
  1. package/CHANGELOG.md +41 -0
  2. package/dist/Autocomplete.js +62 -0
  3. package/dist/Autocomplete.js.map +1 -0
  4. package/dist/Banner.js +3 -3
  5. package/dist/Banner.js.map +1 -1
  6. package/dist/Button.js +46 -0
  7. package/dist/Button.js.map +1 -0
  8. package/dist/CheckboxGroup.js +23 -35
  9. package/dist/CheckboxGroup.js.map +1 -1
  10. package/dist/Dialog.js +68 -0
  11. package/dist/Dialog.js.map +1 -0
  12. package/dist/Field.js +72 -0
  13. package/dist/Field.js.map +1 -0
  14. package/dist/FieldError.js +34 -0
  15. package/dist/FieldError.js.map +1 -0
  16. package/dist/FieldHint.js +29 -0
  17. package/dist/FieldHint.js.map +1 -0
  18. package/dist/FieldLabel.js +32 -0
  19. package/dist/FieldLabel.js.map +1 -0
  20. package/dist/Icon.js +7 -6
  21. package/dist/Icon.js.map +1 -1
  22. package/dist/Infobox.js +1 -1
  23. package/dist/Infobox.js.map +1 -1
  24. package/dist/Link.js +5 -2
  25. package/dist/Link.js.map +1 -1
  26. package/dist/MenuButton.js +5 -4
  27. package/dist/MenuButton.js.map +1 -1
  28. package/dist/MenuItem.js +0 -1
  29. package/dist/MenuItem.js.map +1 -1
  30. package/dist/MuiPropsChild.js +30 -0
  31. package/dist/MuiPropsChild.js.map +1 -0
  32. package/dist/MuiPropsContext.js +14 -0
  33. package/dist/MuiPropsContext.js.map +1 -0
  34. package/dist/PasswordField.js +73 -0
  35. package/dist/PasswordField.js.map +1 -0
  36. package/dist/RadioGroup.js +25 -26
  37. package/dist/RadioGroup.js.map +1 -1
  38. package/dist/SearchField.js +56 -0
  39. package/dist/SearchField.js.map +1 -0
  40. package/dist/Status.js.map +1 -1
  41. package/dist/Tag.js +28 -0
  42. package/dist/Tag.js.map +1 -0
  43. package/dist/TagList.js +26 -0
  44. package/dist/TagList.js.map +1 -0
  45. package/dist/TagListContext.js +16 -0
  46. package/dist/TagListContext.js.map +1 -0
  47. package/dist/TextField.js +36 -62
  48. package/dist/TextField.js.map +1 -1
  49. package/dist/Toast.js +72 -0
  50. package/dist/Toast.js.map +1 -0
  51. package/dist/ToastStack.js +33 -0
  52. package/dist/ToastStack.js.map +1 -0
  53. package/dist/Tooltip.js +20 -0
  54. package/dist/Tooltip.js.map +1 -0
  55. package/dist/iconDictionary/Add.js +4 -4
  56. package/dist/iconDictionary/Add.js.map +1 -1
  57. package/dist/iconDictionary/AddCircle.js +4 -4
  58. package/dist/iconDictionary/AddCircle.js.map +1 -1
  59. package/dist/iconDictionary/AlertCircle.js +4 -4
  60. package/dist/iconDictionary/AlertCircle.js.map +1 -1
  61. package/dist/iconDictionary/AlertCircleFilled.js +4 -4
  62. package/dist/iconDictionary/AlertCircleFilled.js.map +1 -1
  63. package/dist/iconDictionary/AlertTriangleFilled.js +4 -4
  64. package/dist/iconDictionary/AlertTriangleFilled.js.map +1 -1
  65. package/dist/iconDictionary/Anchor.js +5 -5
  66. package/dist/iconDictionary/Anchor.js.map +1 -1
  67. package/dist/iconDictionary/ArrowDown.js +4 -4
  68. package/dist/iconDictionary/ArrowDown.js.map +1 -1
  69. package/dist/iconDictionary/ArrowLeft.js +4 -4
  70. package/dist/iconDictionary/ArrowLeft.js.map +1 -1
  71. package/dist/iconDictionary/ArrowRight.js +4 -4
  72. package/dist/iconDictionary/ArrowRight.js.map +1 -1
  73. package/dist/iconDictionary/ArrowUp.js +4 -4
  74. package/dist/iconDictionary/ArrowUp.js.map +1 -1
  75. package/dist/iconDictionary/ArrowUpDown.js +4 -4
  76. package/dist/iconDictionary/ArrowUpDown.js.map +1 -1
  77. package/dist/iconDictionary/Calendar.js +4 -4
  78. package/dist/iconDictionary/Calendar.js.map +1 -1
  79. package/dist/iconDictionary/Check.js +4 -4
  80. package/dist/iconDictionary/Check.js.map +1 -1
  81. package/dist/iconDictionary/CheckCircleFilled.js +4 -4
  82. package/dist/iconDictionary/CheckCircleFilled.js.map +1 -1
  83. package/dist/iconDictionary/ChevronDown.js +4 -4
  84. package/dist/iconDictionary/ChevronDown.js.map +1 -1
  85. package/dist/iconDictionary/ChevronUp.js +4 -4
  86. package/dist/iconDictionary/ChevronUp.js.map +1 -1
  87. package/dist/iconDictionary/Close.js +4 -4
  88. package/dist/iconDictionary/Close.js.map +1 -1
  89. package/dist/iconDictionary/CloseCircleFilled.js +4 -4
  90. package/dist/iconDictionary/CloseCircleFilled.js.map +1 -1
  91. package/dist/iconDictionary/Copy.js +4 -4
  92. package/dist/iconDictionary/Copy.js.map +1 -1
  93. package/dist/iconDictionary/Delete.js +4 -4
  94. package/dist/iconDictionary/Delete.js.map +1 -1
  95. package/dist/iconDictionary/Download.js +4 -4
  96. package/dist/iconDictionary/Download.js.map +1 -1
  97. package/dist/iconDictionary/DragHandle.js +4 -4
  98. package/dist/iconDictionary/DragHandle.js.map +1 -1
  99. package/dist/iconDictionary/Edit.js +4 -4
  100. package/dist/iconDictionary/Edit.js.map +1 -1
  101. package/dist/iconDictionary/ExternalLink.js +4 -4
  102. package/dist/iconDictionary/ExternalLink.js.map +1 -1
  103. package/dist/iconDictionary/Eye.js +4 -4
  104. package/dist/iconDictionary/Eye.js.map +1 -1
  105. package/dist/iconDictionary/EyeOff.js +4 -4
  106. package/dist/iconDictionary/EyeOff.js.map +1 -1
  107. package/dist/iconDictionary/Filter.js +4 -4
  108. package/dist/iconDictionary/Filter.js.map +1 -1
  109. package/dist/iconDictionary/Globe.js +4 -4
  110. package/dist/iconDictionary/Globe.js.map +1 -1
  111. package/dist/iconDictionary/Home.js +4 -4
  112. package/dist/iconDictionary/Home.js.map +1 -1
  113. package/dist/iconDictionary/InformationCircle.js +4 -4
  114. package/dist/iconDictionary/InformationCircle.js.map +1 -1
  115. package/dist/iconDictionary/InformationCircleFilled.js +4 -4
  116. package/dist/iconDictionary/InformationCircleFilled.js.map +1 -1
  117. package/dist/iconDictionary/Notification.js +4 -4
  118. package/dist/iconDictionary/Notification.js.map +1 -1
  119. package/dist/iconDictionary/OverflowVertical.js +4 -4
  120. package/dist/iconDictionary/OverflowVertical.js.map +1 -1
  121. package/dist/iconDictionary/QuestionCircle.js +4 -4
  122. package/dist/iconDictionary/QuestionCircle.js.map +1 -1
  123. package/dist/iconDictionary/QuestionCircleFilled.js +4 -4
  124. package/dist/iconDictionary/QuestionCircleFilled.js.map +1 -1
  125. package/dist/iconDictionary/Search.js +4 -4
  126. package/dist/iconDictionary/Search.js.map +1 -1
  127. package/dist/iconDictionary/Settings.js +3 -3
  128. package/dist/iconDictionary/Settings.js.map +1 -1
  129. package/dist/iconDictionary/Subtract.js +4 -4
  130. package/dist/iconDictionary/Subtract.js.map +1 -1
  131. package/dist/iconDictionary/User.js +4 -4
  132. package/dist/iconDictionary/User.js.map +1 -1
  133. package/dist/iconDictionary/UserGroup.js +4 -4
  134. package/dist/iconDictionary/UserGroup.js.map +1 -1
  135. package/dist/iconDictionary/index.js.map +1 -1
  136. package/dist/index.js +11 -2
  137. package/dist/index.js.map +1 -1
  138. package/dist/src/Autocomplete.d.ts +28 -0
  139. package/dist/src/Autocomplete.d.ts.map +1 -0
  140. package/dist/src/Banner.d.ts +19 -19
  141. package/dist/src/Banner.d.ts.map +1 -1
  142. package/dist/src/Button.d.ts +32 -0
  143. package/dist/src/Button.d.ts.map +1 -0
  144. package/dist/src/CheckboxGroup.d.ts +7 -4
  145. package/dist/src/CheckboxGroup.d.ts.map +1 -1
  146. package/dist/src/Dialog.d.ts +25 -0
  147. package/dist/src/Dialog.d.ts.map +1 -0
  148. package/dist/src/Field.d.ts +65 -0
  149. package/dist/src/Field.d.ts.map +1 -0
  150. package/dist/src/FieldError.d.ts +19 -0
  151. package/dist/src/FieldError.d.ts.map +1 -0
  152. package/dist/src/FieldHint.d.ts +19 -0
  153. package/dist/src/FieldHint.d.ts.map +1 -0
  154. package/dist/src/FieldLabel.d.ts +23 -0
  155. package/dist/src/FieldLabel.d.ts.map +1 -0
  156. package/dist/src/Icon.d.ts +6 -7
  157. package/dist/src/Icon.d.ts.map +1 -1
  158. package/dist/src/Infobox.d.ts +7 -7
  159. package/dist/src/Infobox.d.ts.map +1 -1
  160. package/dist/src/Link.d.ts +9 -4
  161. package/dist/src/Link.d.ts.map +1 -1
  162. package/dist/src/MenuButton.d.ts +7 -3
  163. package/dist/src/MenuButton.d.ts.map +1 -1
  164. package/dist/src/MenuItem.d.ts +1 -1
  165. package/dist/src/MenuItem.d.ts.map +1 -1
  166. package/dist/src/MuiPropsChild.d.ts +18 -0
  167. package/dist/src/MuiPropsChild.d.ts.map +1 -0
  168. package/dist/src/MuiPropsContext.d.ts +15 -0
  169. package/dist/src/MuiPropsContext.d.ts.map +1 -0
  170. package/dist/src/PasswordField.d.ts +75 -0
  171. package/dist/src/PasswordField.d.ts.map +1 -0
  172. package/dist/src/RadioGroup.d.ts +8 -8
  173. package/dist/src/RadioGroup.d.ts.map +1 -1
  174. package/dist/src/SearchField.d.ts +59 -0
  175. package/dist/src/SearchField.d.ts.map +1 -0
  176. package/dist/src/Status.d.ts +2 -2
  177. package/dist/src/Status.d.ts.map +1 -1
  178. package/dist/src/Tag.d.ts +22 -0
  179. package/dist/src/Tag.d.ts.map +1 -0
  180. package/dist/src/TagList.d.ts +19 -0
  181. package/dist/src/TagList.d.ts.map +1 -0
  182. package/dist/src/TagListContext.d.ts +18 -0
  183. package/dist/src/TagListContext.d.ts.map +1 -0
  184. package/dist/src/TextField.d.ts +16 -20
  185. package/dist/src/TextField.d.ts.map +1 -1
  186. package/dist/src/Toast.d.ts +60 -0
  187. package/dist/src/Toast.d.ts.map +1 -0
  188. package/dist/src/ToastStack.d.ts +19 -0
  189. package/dist/src/ToastStack.d.ts.map +1 -0
  190. package/dist/src/Tooltip.d.ts +21 -0
  191. package/dist/src/Tooltip.d.ts.map +1 -0
  192. package/dist/src/iconDictionary/Add.d.ts +2 -2
  193. package/dist/src/iconDictionary/AddCircle.d.ts +2 -2
  194. package/dist/src/iconDictionary/AlertCircle.d.ts +2 -2
  195. package/dist/src/iconDictionary/AlertCircleFilled.d.ts +2 -2
  196. package/dist/src/iconDictionary/AlertTriangleFilled.d.ts +2 -2
  197. package/dist/src/iconDictionary/Anchor.d.ts +2 -2
  198. package/dist/src/iconDictionary/ArrowDown.d.ts +2 -2
  199. package/dist/src/iconDictionary/ArrowLeft.d.ts +2 -2
  200. package/dist/src/iconDictionary/ArrowRight.d.ts +2 -2
  201. package/dist/src/iconDictionary/ArrowUp.d.ts +2 -2
  202. package/dist/src/iconDictionary/ArrowUpDown.d.ts +2 -2
  203. package/dist/src/iconDictionary/Calendar.d.ts +2 -2
  204. package/dist/src/iconDictionary/Check.d.ts +2 -2
  205. package/dist/src/iconDictionary/CheckCircleFilled.d.ts +2 -2
  206. package/dist/src/iconDictionary/ChevronDown.d.ts +2 -2
  207. package/dist/src/iconDictionary/ChevronUp.d.ts +2 -2
  208. package/dist/src/iconDictionary/Close.d.ts +2 -2
  209. package/dist/src/iconDictionary/CloseCircleFilled.d.ts +2 -2
  210. package/dist/src/iconDictionary/Copy.d.ts +2 -2
  211. package/dist/src/iconDictionary/Delete.d.ts +2 -2
  212. package/dist/src/iconDictionary/Download.d.ts +2 -2
  213. package/dist/src/iconDictionary/DragHandle.d.ts +2 -2
  214. package/dist/src/iconDictionary/Edit.d.ts +2 -2
  215. package/dist/src/iconDictionary/ExternalLink.d.ts +2 -2
  216. package/dist/src/iconDictionary/Eye.d.ts +2 -2
  217. package/dist/src/iconDictionary/EyeOff.d.ts +2 -2
  218. package/dist/src/iconDictionary/Filter.d.ts +2 -2
  219. package/dist/src/iconDictionary/Globe.d.ts +2 -2
  220. package/dist/src/iconDictionary/Home.d.ts +2 -2
  221. package/dist/src/iconDictionary/InformationCircle.d.ts +2 -2
  222. package/dist/src/iconDictionary/InformationCircleFilled.d.ts +2 -2
  223. package/dist/src/iconDictionary/Notification.d.ts +2 -2
  224. package/dist/src/iconDictionary/OverflowVertical.d.ts +2 -2
  225. package/dist/src/iconDictionary/QuestionCircle.d.ts +2 -2
  226. package/dist/src/iconDictionary/QuestionCircleFilled.d.ts +2 -2
  227. package/dist/src/iconDictionary/Search.d.ts +2 -2
  228. package/dist/src/iconDictionary/Settings.d.ts +2 -2
  229. package/dist/src/iconDictionary/Subtract.d.ts +2 -2
  230. package/dist/src/iconDictionary/User.d.ts +2 -2
  231. package/dist/src/iconDictionary/UserGroup.d.ts +2 -2
  232. package/dist/src/iconDictionary/index.d.ts +40 -40
  233. package/dist/src/index.d.ts +14 -5
  234. package/dist/src/index.d.ts.map +1 -1
  235. package/dist/src/theme/components.d.ts.map +1 -1
  236. package/dist/src/theme/components.types.d.ts +0 -8
  237. package/dist/src/theme/components.types.d.ts.map +1 -1
  238. package/dist/theme/components.js +249 -136
  239. package/dist/theme/components.js.map +1 -1
  240. package/dist/theme/components.types.js.map +1 -1
  241. package/dist/tsconfig.production.tsbuildinfo +1 -1
  242. package/package.json +3 -3
  243. package/src/Autocomplete.tsx +141 -0
  244. package/src/Banner.tsx +21 -21
  245. package/src/Button.tsx +95 -0
  246. package/src/CheckboxGroup.tsx +27 -34
  247. package/src/Dialog.tsx +110 -0
  248. package/src/Field.tsx +135 -0
  249. package/src/FieldError.tsx +34 -0
  250. package/src/FieldHint.tsx +28 -0
  251. package/src/FieldLabel.tsx +57 -0
  252. package/src/Icon.test.tsx +1 -1
  253. package/src/Icon.tsx +24 -7
  254. package/src/Infobox.tsx +7 -7
  255. package/src/Link.tsx +14 -6
  256. package/src/MenuButton.tsx +10 -6
  257. package/src/MenuItem.tsx +0 -1
  258. package/src/MuiPropsChild.tsx +41 -0
  259. package/src/MuiPropsContext.ts +17 -0
  260. package/src/OdysseyCacheProvider.test.tsx +1 -1
  261. package/src/PasswordField.tsx +180 -0
  262. package/src/RadioGroup.tsx +31 -46
  263. package/src/SearchField.tsx +138 -0
  264. package/src/Status.tsx +2 -2
  265. package/src/Tag.tsx +41 -0
  266. package/src/TagList.tsx +43 -0
  267. package/src/TagListContext.tsx +23 -0
  268. package/src/TextField.tsx +64 -111
  269. package/src/Toast.tsx +138 -0
  270. package/src/ToastStack.tsx +33 -0
  271. package/src/Tooltip.tsx +39 -0
  272. package/src/iconDictionary/Add.tsx +3 -3
  273. package/src/iconDictionary/AddCircle.tsx +3 -3
  274. package/src/iconDictionary/AlertCircle.tsx +3 -3
  275. package/src/iconDictionary/AlertCircleFilled.tsx +3 -3
  276. package/src/iconDictionary/AlertTriangleFilled.tsx +3 -3
  277. package/src/iconDictionary/Anchor.tsx +3 -3
  278. package/src/iconDictionary/ArrowDown.tsx +3 -3
  279. package/src/iconDictionary/ArrowLeft.tsx +3 -3
  280. package/src/iconDictionary/ArrowRight.tsx +3 -3
  281. package/src/iconDictionary/ArrowUp.tsx +3 -3
  282. package/src/iconDictionary/ArrowUpDown.tsx +3 -3
  283. package/src/iconDictionary/Calendar.tsx +3 -3
  284. package/src/iconDictionary/Check.tsx +3 -3
  285. package/src/iconDictionary/CheckCircleFilled.tsx +3 -3
  286. package/src/iconDictionary/ChevronDown.tsx +3 -3
  287. package/src/iconDictionary/ChevronUp.tsx +3 -3
  288. package/src/iconDictionary/Close.tsx +3 -3
  289. package/src/iconDictionary/CloseCircleFilled.tsx +3 -3
  290. package/src/iconDictionary/Copy.tsx +3 -3
  291. package/src/iconDictionary/Delete.tsx +3 -3
  292. package/src/iconDictionary/Download.tsx +3 -3
  293. package/src/iconDictionary/DragHandle.tsx +3 -3
  294. package/src/iconDictionary/Edit.tsx +3 -3
  295. package/src/iconDictionary/ExternalLink.tsx +3 -3
  296. package/src/iconDictionary/Eye.tsx +3 -3
  297. package/src/iconDictionary/EyeOff.tsx +3 -3
  298. package/src/iconDictionary/Filter.tsx +3 -3
  299. package/src/iconDictionary/Globe.tsx +3 -3
  300. package/src/iconDictionary/Home.tsx +3 -3
  301. package/src/iconDictionary/InformationCircle.tsx +3 -3
  302. package/src/iconDictionary/InformationCircleFilled.tsx +3 -3
  303. package/src/iconDictionary/Notification.tsx +3 -3
  304. package/src/iconDictionary/OverflowVertical.tsx +3 -3
  305. package/src/iconDictionary/QuestionCircle.tsx +3 -3
  306. package/src/iconDictionary/QuestionCircleFilled.tsx +3 -3
  307. package/src/iconDictionary/Search.tsx +3 -3
  308. package/src/iconDictionary/Settings.tsx +2 -2
  309. package/src/iconDictionary/Subtract.tsx +3 -3
  310. package/src/iconDictionary/User.tsx +3 -3
  311. package/src/iconDictionary/UserGroup.tsx +3 -3
  312. package/src/iconDictionary/index.ts +1 -1
  313. package/src/index.ts +10 -14
  314. package/src/theme/components.tsx +119 -27
  315. package/src/theme/components.types.ts +0 -8
  316. package/dist/PasswordInput.js +0 -87
  317. package/dist/PasswordInput.js.map +0 -1
  318. package/dist/src/PasswordInput.d.ts +0 -21
  319. package/dist/src/PasswordInput.d.ts.map +0 -1
  320. package/src/PasswordInput.test.tsx +0 -51
  321. package/src/PasswordInput.tsx +0 -111
package/dist/Icon.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"Icon.js","names":["forwardRef","iconDictionary","Icon","ref","name","titleAccess","rest","NamedIcon","displayName"],"sources":["../src/Icon.tsx"],"sourcesContent":["/*!\n * Copyright (c) 2021-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 { forwardRef } from \"react\";\nimport type { SvgIconNoChildrenProps } from \"./iconDictionary/types\";\nimport { iconDictionary } from \"./iconDictionary\";\n\nexport interface IconProps extends SvgIconNoChildrenProps {\n /**\n * Name of the icon to render\n */\n name: keyof typeof iconDictionary;\n}\n\n/**\n * A system of icons which establishes a visual language\n * that can be easily understood regardless of age, language or culture.\n * This component includes all icon data as static imports. Favor individual\n * icon component imports where possible to keep your bundle size smaller.\n */\nexport const Icon = forwardRef<SVGSVGElement, IconProps>(\n ({ name, titleAccess, ...rest }, ref) => {\n if (!(name in iconDictionary)) return null;\n\n const NamedIcon = iconDictionary[name];\n\n return <NamedIcon titleAccess={titleAccess} ref={ref} {...rest} />;\n }\n);\n\nIcon.displayName = \"Icon\";\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA,SAASA,UAAT,QAA2B,OAA3B;SAESC,c;;AAeT,OAAO,MAAMC,IAAI,GAAGF,UAAU,CAC5B,OAAiCG,GAAjC,KAAyC;EAAA,IAAxC;IAAEC,IAAF;IAAQC,WAAR;IAAqB,GAAGC;EAAxB,CAAwC;EACvC,IAAI,EAAEF,IAAI,IAAIH,cAAV,CAAJ,EAA+B,OAAO,IAAP;EAE/B,MAAMM,SAAS,GAAGN,cAAc,CAACG,IAAD,CAAhC;EAEA,OAAO,KAAC,SAAD;IAAW,WAAW,EAAEC,WAAxB;IAAqC,GAAG,EAAEF,GAA1C;IAAA,GAAmDG;EAAnD,EAAP;AACD,CAP2B,CAAvB;AAUPJ,IAAI,CAACM,WAAL,GAAmB,MAAnB"}
1
+ {"version":3,"file":"Icon.js","names":["forwardRef","iconDictionary","Icon","ariaLabelledby","label","name","size","NamedIcon","displayName"],"sources":["../src/Icon.tsx"],"sourcesContent":["/*!\n * Copyright (c) 2021-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 { forwardRef } from \"react\";\nimport { iconDictionary } from \"./iconDictionary\";\n\nexport type IconProps = {\n /*\n ** The element whose text describes the icon, if it exists\n */\n ariaLabelledby?: string;\n /*\n ** Text that describes the icon\n */\n label: string;\n /*\n ** Name of the icon to render\n */\n name: keyof typeof iconDictionary;\n /*\n ** The size of the icon\n */\n size: \"small\" | \"medium\" | \"large\";\n};\n\n/**\n * A system of icons which establishes a visual language\n * that can be easily understood regardless of age, language or culture.\n * This component includes all icon data as static imports. Favor individual\n * icon component imports where possible to keep your bundle size smaller.\n */\nexport const Icon = forwardRef<SVGSVGElement, IconProps>(\n ({ ariaLabelledby, label, name, size }) => {\n if (!(name in iconDictionary)) return null;\n\n const NamedIcon = iconDictionary[name];\n\n return (\n <NamedIcon\n aria-labelledby={ariaLabelledby}\n fontSize={size}\n titleAccess={label}\n />\n );\n }\n);\n\nIcon.displayName = \"Icon\";\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA,SAASA,UAAT,QAA2B,OAA3B;SACSC,c;;AA2BT,OAAO,MAAMC,IAAI,GAAGF,UAAU,CAC5B,QAA2C;EAAA,IAA1C;IAAEG,cAAF;IAAkBC,KAAlB;IAAyBC,IAAzB;IAA+BC;EAA/B,CAA0C;EACzC,IAAI,EAAED,IAAI,IAAIJ,cAAV,CAAJ,EAA+B,OAAO,IAAP;EAE/B,MAAMM,SAAS,GAAGN,cAAc,CAACI,IAAD,CAAhC;EAEA,OACE,KAAC,SAAD;IACE,mBAAiBF,cADnB;IAEE,QAAQ,EAAEG,IAFZ;IAGE,WAAW,EAAEF;EAHf,EADF;AAOD,CAb2B,CAAvB;AAgBPF,IAAI,CAACM,WAAL,GAAmB,MAAnB"}
package/dist/Infobox.js CHANGED
@@ -17,8 +17,8 @@ import { jsx as _jsx } from "react/jsx-runtime";
17
17
  const Infobox = _ref => {
18
18
  let {
19
19
  children,
20
- severity,
21
20
  role,
21
+ severity,
22
22
  title
23
23
  } = _ref;
24
24
  return _jsxs(Alert, {
@@ -1 +1 @@
1
- {"version":3,"file":"Infobox.js","names":["memo","Alert","AlertTitle","ScreenReaderText","Infobox","children","severity","role","title","MemoizedInfobox"],"sources":["../src/Infobox.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 { AlertColor } from \"@mui/material\";\nimport { memo, ReactNode } from \"react\";\nimport { Alert, AlertTitle, ScreenReaderText } from \".\";\n\nexport interface InfoboxProps {\n /**\n * The contents of the alert\n */\n children: ReactNode;\n /**\n * Determine the color and icon of the alert\n */\n severity: AlertColor;\n /**\n * Sets the ARIA role of the alert\n * (\"status\" for something that dynamically updates, \"alert\" for errors, null for something\n * unchanging)\n */\n role?: \"status\" | \"alert\";\n /**\n * The title of the alert\n */\n title?: string;\n}\n\nconst Infobox = ({ children, severity, role, title }: InfoboxProps) => (\n <Alert role={role} severity={severity} variant=\"infobox\">\n <ScreenReaderText>{severity}: </ScreenReaderText>\n {title && <AlertTitle>{title}</AlertTitle>}\n {children}\n </Alert>\n);\n\nconst MemoizedInfobox = memo(Infobox);\n\nexport { MemoizedInfobox as Infobox };\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAGA,SAASA,IAAT,QAAgC,OAAhC;SACSC,K,EAAOC,U,EAAYC,gB;;;;AAuB5B,MAAMC,OAAO,GAAG;EAAA,IAAC;IAAEC,QAAF;IAAYC,QAAZ;IAAsBC,IAAtB;IAA4BC;EAA5B,CAAD;EAAA,OACd,MAAC,KAAD;IAAO,IAAI,EAAED,IAAb;IAAmB,QAAQ,EAAED,QAA7B;IAAuC,OAAO,EAAC,SAA/C;IAAA,WACE,MAAC,gBAAD;MAAA,WAAmBA,QAAnB;IAAA,EADF,EAEGE,KAAK,IAAI,KAAC,UAAD;MAAA,UAAaA;IAAb,EAFZ,EAGGH,QAHH;EAAA,EADc;AAAA,CAAhB;;AAQA,MAAMI,eAAe,GAAGT,IAAI,CAACI,OAAD,CAA5B;AAEA,SAASK,eAAe,IAAIL,OAA5B"}
1
+ {"version":3,"file":"Infobox.js","names":["memo","Alert","AlertTitle","ScreenReaderText","Infobox","children","role","severity","title","MemoizedInfobox"],"sources":["../src/Infobox.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 { AlertColor } from \"@mui/material\";\nimport { memo, ReactNode } from \"react\";\nimport { Alert, AlertTitle, ScreenReaderText } from \".\";\n\nexport type InfoboxProps = {\n /**\n * The contents of the alert\n */\n children: ReactNode;\n /**\n * Sets the ARIA role of the alert\n * (\"status\" for something that dynamically updates, \"alert\" for errors, null for something\n * unchanging)\n */\n role?: \"status\" | \"alert\";\n /**\n * Determine the color and icon of the alert\n */\n severity: AlertColor;\n /**\n * The title of the alert\n */\n title?: string;\n};\n\nconst Infobox = ({ children, role, severity, title }: InfoboxProps) => (\n <Alert role={role} severity={severity} variant=\"infobox\">\n <ScreenReaderText>{severity}: </ScreenReaderText>\n {title && <AlertTitle>{title}</AlertTitle>}\n {children}\n </Alert>\n);\n\nconst MemoizedInfobox = memo(Infobox);\n\nexport { MemoizedInfobox as Infobox };\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAGA,SAASA,IAAT,QAAgC,OAAhC;SACSC,K,EAAOC,U,EAAYC,gB;;;;AAuB5B,MAAMC,OAAO,GAAG;EAAA,IAAC;IAAEC,QAAF;IAAYC,IAAZ;IAAkBC,QAAlB;IAA4BC;EAA5B,CAAD;EAAA,OACd,MAAC,KAAD;IAAO,IAAI,EAAEF,IAAb;IAAmB,QAAQ,EAAEC,QAA7B;IAAuC,OAAO,EAAC,SAA/C;IAAA,WACE,MAAC,gBAAD;MAAA,WAAmBA,QAAnB;IAAA,EADF,EAEGC,KAAK,IAAI,KAAC,UAAD;MAAA,UAAaA;IAAb,EAFZ,EAGGH,QAHH;EAAA,EADc;AAAA,CAAhB;;AAQA,MAAMI,eAAe,GAAGT,IAAI,CAACI,OAAD,CAA5B;AAEA,SAASK,eAAe,IAAIL,OAA5B"}
package/dist/Link.js CHANGED
@@ -19,10 +19,13 @@ export const Link = forwardRef((props, ref) => {
19
19
  const {
20
20
  icon,
21
21
  children,
22
- target
22
+ target,
23
+ variant
23
24
  } = props;
24
- return _jsxs(_Link, { ...props,
25
+ return _jsxs(_Link, {
25
26
  ref: ref,
27
+ variant: variant,
28
+ target: target,
26
29
  children: [icon && _jsx("span", {
27
30
  className: "Link-icon",
28
31
  children: icon
package/dist/Link.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"Link.js","names":["forwardRef","Link","props","ref","icon","children","target"],"sources":["../src/Link.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 { forwardRef, ReactElement } from \"react\";\n\nimport { Link as MuiLink, SvgIcon } from \"@mui/material\";\nimport type { LinkProps as MuiLinkProps } from \"@mui/material\";\n\nexport interface LinkProps extends MuiLinkProps {\n icon?: ReactElement;\n}\n\nexport const Link = forwardRef<HTMLAnchorElement, LinkProps>((props, ref) => {\n const { icon, children, target } = props;\n return (\n <MuiLink {...props} ref={ref}>\n {icon && <span className=\"Link-icon\">{icon}</span>}\n {children}\n {target === \"_blank\" && (\n <span className=\"Link-indicator\" role=\"presentation\">\n <SvgIcon viewBox=\"0 0 16 16\">\n <path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M13.2929 2H7.99998V1H14.5C14.7761 1 15 1.22386 15 1.5V8H14V2.70711L6.35353 10.3536L5.64642 9.64645L13.2929 2ZM1.5 4H1V4.5V14.5V15H1.5H11.5H12V14.5V8H11V14H2V5H8V4H1.5Z\"\n fill=\"currentColor\"\n />\n </SvgIcon>\n </span>\n )}\n </MuiLink>\n );\n});\n"],"mappings":";;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA,SAASA,UAAT,QAAyC,OAAzC;;;AASA,OAAO,MAAMC,IAAI,GAAGD,UAAU,CAA+B,CAACE,KAAD,EAAQC,GAAR,KAAgB;EAC3E,MAAM;IAAEC,IAAF;IAAQC,QAAR;IAAkBC;EAAlB,IAA6BJ,KAAnC;EACA,OACE,kBAAaA,KAAb;IAAoB,GAAG,EAAEC,GAAzB;IAAA,WACGC,IAAI,IAAI;MAAM,SAAS,EAAC,WAAhB;MAAA,UAA6BA;IAA7B,EADX,EAEGC,QAFH,EAGGC,MAAM,KAAK,QAAX,IACC;MAAM,SAAS,EAAC,gBAAhB;MAAiC,IAAI,EAAC,cAAtC;MAAA,UACE;QAAS,OAAO,EAAC,WAAjB;QAAA,UACE;UACE,QAAQ,EAAC,SADX;UAEE,QAAQ,EAAC,SAFX;UAGE,CAAC,EAAC,yKAHJ;UAIE,IAAI,EAAC;QAJP;MADF;IADF,EAJJ;EAAA,EADF;AAkBD,CApB6B,CAAvB"}
1
+ {"version":3,"file":"Link.js","names":["forwardRef","Link","props","ref","icon","children","target","variant"],"sources":["../src/Link.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 { forwardRef, ReactElement } from \"react\";\n\nimport {\n Link as MuiLink,\n LinkProps as MuiLinkProps,\n SvgIcon,\n} from \"@mui/material\";\n\nexport type LinkProps = {\n children: React.ReactNode;\n href: string;\n icon?: ReactElement;\n rel?: string;\n target?: \"_self\" | \"_blank\" | \"_parent\" | \"_top\" | string;\n variant?: MuiLinkProps[\"variant\"];\n};\n\nexport const Link = forwardRef<HTMLAnchorElement, LinkProps>((props, ref) => {\n const { icon, children, target, variant } = props;\n return (\n <MuiLink ref={ref} variant={variant} target={target}>\n {icon && <span className=\"Link-icon\">{icon}</span>}\n {children}\n {target === \"_blank\" && (\n <span className=\"Link-indicator\" role=\"presentation\">\n <SvgIcon viewBox=\"0 0 16 16\">\n <path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M13.2929 2H7.99998V1H14.5C14.7761 1 15 1.22386 15 1.5V8H14V2.70711L6.35353 10.3536L5.64642 9.64645L13.2929 2ZM1.5 4H1V4.5V14.5V15H1.5H11.5H12V14.5V8H11V14H2V5H8V4H1.5Z\"\n fill=\"currentColor\"\n />\n </SvgIcon>\n </span>\n )}\n </MuiLink>\n );\n});\n"],"mappings":";;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA,SAASA,UAAT,QAAyC,OAAzC;;;AAiBA,OAAO,MAAMC,IAAI,GAAGD,UAAU,CAA+B,CAACE,KAAD,EAAQC,GAAR,KAAgB;EAC3E,MAAM;IAAEC,IAAF;IAAQC,QAAR;IAAkBC,MAAlB;IAA0BC;EAA1B,IAAsCL,KAA5C;EACA,OACE;IAAS,GAAG,EAAEC,GAAd;IAAmB,OAAO,EAAEI,OAA5B;IAAqC,MAAM,EAAED,MAA7C;IAAA,WACGF,IAAI,IAAI;MAAM,SAAS,EAAC,WAAhB;MAAA,UAA6BA;IAA7B,EADX,EAEGC,QAFH,EAGGC,MAAM,KAAK,QAAX,IACC;MAAM,SAAS,EAAC,gBAAhB;MAAiC,IAAI,EAAC,cAAtC;MAAA,UACE;QAAS,OAAO,EAAC,WAAjB;QAAA,UACE;UACE,QAAQ,EAAC,SADX;UAEE,QAAQ,EAAC,SAFX;UAGE,CAAC,EAAC,yKAHJ;UAIE,IAAI,EAAC;QAJP;MADF;IADF,EAJJ;EAAA,EADF;AAkBD,CApB6B,CAAvB"}
@@ -19,7 +19,8 @@ const MenuButton = _ref => {
19
19
  buttonLabel = "",
20
20
  children,
21
21
  buttonEndIcon = _jsx(ChevronDownIcon, {}),
22
- buttonVariant = "secondary"
22
+ buttonVariant = "secondary",
23
+ id: idOverride
23
24
  } = _ref;
24
25
  const [anchorEl, setAnchorEl] = useState(null);
25
26
  const open = Boolean(anchorEl);
@@ -32,7 +33,7 @@ const MenuButton = _ref => {
32
33
  setAnchorEl(null);
33
34
  };
34
35
 
35
- const uniqueId = useUniqueId();
36
+ const uniqueId = useUniqueId(idOverride);
36
37
  const menuListProps = useMemo(() => ({
37
38
  "aria-labelledby": `${uniqueId}-button`
38
39
  }), [uniqueId]);
@@ -44,8 +45,8 @@ const MenuButton = _ref => {
44
45
  "aria-haspopup": "true",
45
46
  "aria-expanded": open ? "true" : undefined,
46
47
  onClick: handleClick,
47
- variant: buttonVariant,
48
- children: buttonLabel
48
+ text: buttonLabel,
49
+ variant: buttonVariant
49
50
  }), _jsx(Menu, {
50
51
  id: `${uniqueId}-menu`,
51
52
  anchorEl: anchorEl,
@@ -1 +1 @@
1
- {"version":3,"file":"MenuButton.js","names":["Button","ChevronDownIcon","Menu","useUniqueId","memo","useMemo","useState","MenuButton","buttonLabel","children","buttonEndIcon","buttonVariant","anchorEl","setAnchorEl","open","Boolean","handleClick","event","currentTarget","handleClose","uniqueId","menuListProps","undefined","MemoizedMenuButton"],"sources":["../src/MenuButton.tsx"],"sourcesContent":["/*!\n * Copyright (c) 2022-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *\n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport {\n Button,\n ButtonProps,\n ChevronDownIcon,\n Divider,\n ListSubheader,\n Menu,\n MenuItem,\n useUniqueId,\n} from \"./\";\nimport { memo, MouseEvent, ReactElement, useMemo, useState } from \"react\";\n\nexport interface MenuButtonProps {\n /**\n * The <MenuItem> components within the Menu.\n */\n children: Array<\n ReactElement<typeof MenuItem | typeof Divider | typeof ListSubheader>\n >;\n /**\n * The end Icon on the trigggering Button\n */\n buttonEndIcon?: ReactElement;\n /**\n * The label on the triggering Button\n */\n buttonLabel?: string;\n /**\n * The variant of the triggering Button\n */\n buttonVariant?: ButtonProps[\"variant\"];\n}\n\nconst MenuButton = ({\n buttonLabel = \"\",\n children,\n buttonEndIcon = <ChevronDownIcon />,\n buttonVariant = \"secondary\",\n}: MenuButtonProps) => {\n const [anchorEl, setAnchorEl] = useState<null | HTMLElement>(null);\n\n const open = Boolean(anchorEl);\n\n const handleClick = (event: MouseEvent<HTMLButtonElement>) => {\n setAnchorEl(event.currentTarget);\n };\n\n const handleClose = () => {\n setAnchorEl(null);\n };\n\n const uniqueId = useUniqueId();\n\n const menuListProps = useMemo(\n () => ({ \"aria-labelledby\": `${uniqueId}-button` }),\n [uniqueId]\n );\n\n return (\n <div>\n <Button\n endIcon={buttonEndIcon}\n id={`${uniqueId}-button`}\n aria-controls={open ? `${uniqueId}-menu` : undefined}\n aria-haspopup=\"true\"\n aria-expanded={open ? \"true\" : undefined}\n onClick={handleClick}\n variant={buttonVariant}\n >\n {buttonLabel}\n </Button>\n <Menu\n id={`${uniqueId}-menu`}\n anchorEl={anchorEl}\n open={open}\n onClose={handleClose}\n MenuListProps={menuListProps}\n >\n {children}\n </Menu>\n </div>\n );\n};\n\nconst MemoizedMenuButton = memo(MenuButton);\n\nexport { MemoizedMenuButton as MenuButton };\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;SAGEA,M,EAEAC,e,EAGAC,I,EAEAC,W;AAEF,SAASC,IAAT,EAAyCC,OAAzC,EAAkDC,QAAlD,QAAkE,OAAlE;;;;AAuBA,MAAMC,UAAU,GAAG,QAKI;EAAA,IALH;IAClBC,WAAW,GAAG,EADI;IAElBC,QAFkB;IAGlBC,aAAa,GAAG,KAAC,eAAD,KAHE;IAIlBC,aAAa,GAAG;EAJE,CAKG;EACrB,MAAM,CAACC,QAAD,EAAWC,WAAX,IAA0BP,QAAQ,CAAqB,IAArB,CAAxC;EAEA,MAAMQ,IAAI,GAAGC,OAAO,CAACH,QAAD,CAApB;;EAEA,MAAMI,WAAW,GAAIC,KAAD,IAA0C;IAC5DJ,WAAW,CAACI,KAAK,CAACC,aAAP,CAAX;EACD,CAFD;;EAIA,MAAMC,WAAW,GAAG,MAAM;IACxBN,WAAW,CAAC,IAAD,CAAX;EACD,CAFD;;EAIA,MAAMO,QAAQ,GAAGjB,WAAW,EAA5B;EAEA,MAAMkB,aAAa,GAAGhB,OAAO,CAC3B,OAAO;IAAE,mBAAoB,GAAEe,QAAS;EAAjC,CAAP,CAD2B,EAE3B,CAACA,QAAD,CAF2B,CAA7B;EAKA,OACE;IAAA,WACE,KAAC,MAAD;MACE,OAAO,EAAEV,aADX;MAEE,EAAE,EAAG,GAAEU,QAAS,SAFlB;MAGE,iBAAeN,IAAI,GAAI,GAAEM,QAAS,OAAf,GAAwBE,SAH7C;MAIE,iBAAc,MAJhB;MAKE,iBAAeR,IAAI,GAAG,MAAH,GAAYQ,SALjC;MAME,OAAO,EAAEN,WANX;MAOE,OAAO,EAAEL,aAPX;MAAA,UASGH;IATH,EADF,EAYE,KAAC,IAAD;MACE,EAAE,EAAG,GAAEY,QAAS,OADlB;MAEE,QAAQ,EAAER,QAFZ;MAGE,IAAI,EAAEE,IAHR;MAIE,OAAO,EAAEK,WAJX;MAKE,aAAa,EAAEE,aALjB;MAAA,UAOGZ;IAPH,EAZF;EAAA,EADF;AAwBD,CAjDD;;AAmDA,MAAMc,kBAAkB,GAAGnB,IAAI,CAACG,UAAD,CAA/B;AAEA,SAASgB,kBAAkB,IAAIhB,UAA/B"}
1
+ {"version":3,"file":"MenuButton.js","names":["Button","ChevronDownIcon","Menu","useUniqueId","memo","useMemo","useState","MenuButton","buttonLabel","children","buttonEndIcon","buttonVariant","id","idOverride","anchorEl","setAnchorEl","open","Boolean","handleClick","event","currentTarget","handleClose","uniqueId","menuListProps","undefined","MemoizedMenuButton"],"sources":["../src/MenuButton.tsx"],"sourcesContent":["/*!\n * Copyright (c) 2022-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *\n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport {\n Button,\n ButtonProps,\n ChevronDownIcon,\n Divider,\n ListSubheader,\n Menu,\n MenuItem,\n useUniqueId,\n} from \"./\";\nimport { memo, MouseEvent, ReactElement, useMemo, useState } from \"react\";\n\nexport type MenuButtonProps = {\n /**\n * The <MenuItem> components within the Menu.\n */\n children: Array<\n ReactElement<typeof MenuItem | typeof Divider | typeof ListSubheader>\n >;\n /**\n * The end Icon on the trigggering Button\n */\n buttonEndIcon?: ReactElement;\n /**\n * The label on the triggering Button\n */\n buttonLabel?: string;\n /**\n * The variant of the triggering Button\n */\n buttonVariant?: ButtonProps[\"variant\"];\n /**\n * The id of the `input` element.\n */\n id?: string;\n};\n\nconst MenuButton = ({\n buttonLabel = \"\",\n children,\n buttonEndIcon = <ChevronDownIcon />,\n buttonVariant = \"secondary\",\n id: idOverride,\n}: MenuButtonProps) => {\n const [anchorEl, setAnchorEl] = useState<null | HTMLElement>(null);\n\n const open = Boolean(anchorEl);\n\n const handleClick = (event: MouseEvent<HTMLButtonElement>) => {\n setAnchorEl(event.currentTarget);\n };\n\n const handleClose = () => {\n setAnchorEl(null);\n };\n\n const uniqueId = useUniqueId(idOverride);\n\n const menuListProps = useMemo(\n () => ({ \"aria-labelledby\": `${uniqueId}-button` }),\n [uniqueId]\n );\n\n return (\n <div>\n <Button\n endIcon={buttonEndIcon}\n id={`${uniqueId}-button`}\n aria-controls={open ? `${uniqueId}-menu` : undefined}\n aria-haspopup=\"true\"\n aria-expanded={open ? \"true\" : undefined}\n onClick={handleClick}\n text={buttonLabel}\n variant={buttonVariant}\n />\n <Menu\n id={`${uniqueId}-menu`}\n anchorEl={anchorEl}\n open={open}\n onClose={handleClose}\n MenuListProps={menuListProps}\n >\n {children}\n </Menu>\n </div>\n );\n};\n\nconst MemoizedMenuButton = memo(MenuButton);\n\nexport { MemoizedMenuButton as MenuButton };\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;SAGEA,M,EAEAC,e,EAGAC,I,EAEAC,W;AAEF,SAASC,IAAT,EAAyCC,OAAzC,EAAkDC,QAAlD,QAAkE,OAAlE;;;;AA2BA,MAAMC,UAAU,GAAG,QAMI;EAAA,IANH;IAClBC,WAAW,GAAG,EADI;IAElBC,QAFkB;IAGlBC,aAAa,GAAG,KAAC,eAAD,KAHE;IAIlBC,aAAa,GAAG,WAJE;IAKlBC,EAAE,EAAEC;EALc,CAMG;EACrB,MAAM,CAACC,QAAD,EAAWC,WAAX,IAA0BT,QAAQ,CAAqB,IAArB,CAAxC;EAEA,MAAMU,IAAI,GAAGC,OAAO,CAACH,QAAD,CAApB;;EAEA,MAAMI,WAAW,GAAIC,KAAD,IAA0C;IAC5DJ,WAAW,CAACI,KAAK,CAACC,aAAP,CAAX;EACD,CAFD;;EAIA,MAAMC,WAAW,GAAG,MAAM;IACxBN,WAAW,CAAC,IAAD,CAAX;EACD,CAFD;;EAIA,MAAMO,QAAQ,GAAGnB,WAAW,CAACU,UAAD,CAA5B;EAEA,MAAMU,aAAa,GAAGlB,OAAO,CAC3B,OAAO;IAAE,mBAAoB,GAAEiB,QAAS;EAAjC,CAAP,CAD2B,EAE3B,CAACA,QAAD,CAF2B,CAA7B;EAKA,OACE;IAAA,WACE,KAAC,MAAD;MACE,OAAO,EAAEZ,aADX;MAEE,EAAE,EAAG,GAAEY,QAAS,SAFlB;MAGE,iBAAeN,IAAI,GAAI,GAAEM,QAAS,OAAf,GAAwBE,SAH7C;MAIE,iBAAc,MAJhB;MAKE,iBAAeR,IAAI,GAAG,MAAH,GAAYQ,SALjC;MAME,OAAO,EAAEN,WANX;MAOE,IAAI,EAAEV,WAPR;MAQE,OAAO,EAAEG;IARX,EADF,EAWE,KAAC,IAAD;MACE,EAAE,EAAG,GAAEW,QAAS,OADlB;MAEE,QAAQ,EAAER,QAFZ;MAGE,IAAI,EAAEE,IAHR;MAIE,OAAO,EAAEK,WAJX;MAKE,aAAa,EAAEE,aALjB;MAAA,UAOGd;IAPH,EAXF;EAAA,EADF;AAuBD,CAjDD;;AAmDA,MAAMgB,kBAAkB,GAAGrB,IAAI,CAACG,UAAD,CAA/B;AAEA,SAASkB,kBAAkB,IAAIlB,UAA/B"}
package/dist/MenuItem.js CHANGED
@@ -26,6 +26,5 @@ const MenuItem = forwardRef((_ref, ref) => {
26
26
  });
27
27
  });
28
28
  const MemoizedMenuItem = memo(MenuItem);
29
- MemoizedMenuItem.displayName = "MenuItem";
30
29
  export { MemoizedMenuItem as MenuItem };
31
30
  //# sourceMappingURL=MenuItem.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"MenuItem.js","names":["memo","forwardRef","menuItemClasses","MenuItem","ref","isDestructive","props","root","undefined","children","MemoizedMenuItem","displayName"],"sources":["../src/MenuItem.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, forwardRef } from \"react\";\nimport { MenuItem as MuiMenuItem } from \"@mui/material\";\nimport { menuItemClasses } from \"@mui/material/MenuItem\";\nimport type { MenuItemProps as MuiMenuItemProps } from \"@mui/material\";\n\nexport interface MenuItemProps\n extends Omit<\n MuiMenuItemProps,\n | \"component\"\n | \"dense\"\n | \"disableGutters\"\n | \"divider\"\n | \"focusVisibleClassName\"\n > {\n /**\n * Toggles whether or not the MenuItem represents a destructive action.\n */\n isDestructive?: boolean;\n}\n\nconst MenuItem = forwardRef<HTMLLIElement, MenuItemProps>(\n ({ isDestructive, ...props }, ref) => (\n <MuiMenuItem\n {...props}\n ref={ref}\n className={\n isDestructive ? `${menuItemClasses.root}-destructive` : undefined\n }\n >\n {props.children}\n </MuiMenuItem>\n )\n);\n\nconst MemoizedMenuItem = memo(MenuItem);\nMemoizedMenuItem.displayName = \"MenuItem\";\n\nexport { MemoizedMenuItem as MenuItem };\n"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA,SAASA,IAAT,EAAeC,UAAf,QAAiC,OAAjC;AAEA,SAASC,eAAT,QAAgC,wBAAhC;;AAkBA,MAAMC,QAAQ,GAAGF,UAAU,CACzB,OAA8BG,GAA9B;EAAA,IAAC;IAAEC,aAAF;IAAiB,GAAGC;EAApB,CAAD;EAAA,OACE,qBACMA,KADN;IAEE,GAAG,EAAEF,GAFP;IAGE,SAAS,EACPC,aAAa,GAAI,GAAEH,eAAe,CAACK,IAAK,cAA3B,GAA2CC,SAJ5D;IAAA,UAOGF,KAAK,CAACG;EAPT,EADF;AAAA,CADyB,CAA3B;AAcA,MAAMC,gBAAgB,GAAGV,IAAI,CAACG,QAAD,CAA7B;AACAO,gBAAgB,CAACC,WAAjB,GAA+B,UAA/B;AAEA,SAASD,gBAAgB,IAAIP,QAA7B"}
1
+ {"version":3,"file":"MenuItem.js","names":["memo","forwardRef","menuItemClasses","MenuItem","ref","isDestructive","props","root","undefined","children","MemoizedMenuItem"],"sources":["../src/MenuItem.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, forwardRef } from \"react\";\nimport { MenuItem as MuiMenuItem } from \"@mui/material\";\nimport { menuItemClasses } from \"@mui/material/MenuItem\";\nimport type { MenuItemProps as MuiMenuItemProps } from \"@mui/material\";\n\nexport interface MenuItemProps\n extends Omit<\n MuiMenuItemProps,\n | \"component\"\n | \"dense\"\n | \"disableGutters\"\n | \"divider\"\n | \"focusVisibleClassName\"\n > {\n /**\n * Toggles whether or not the MenuItem represents a destructive action.\n */\n isDestructive?: boolean;\n}\n\nconst MenuItem = forwardRef<HTMLLIElement, MenuItemProps>(\n ({ isDestructive, ...props }, ref) => (\n <MuiMenuItem\n {...props}\n ref={ref}\n className={\n isDestructive ? `${menuItemClasses.root}-destructive` : undefined\n }\n >\n {props.children}\n </MuiMenuItem>\n )\n);\n\nconst MemoizedMenuItem = memo(MenuItem);\n\nexport { MemoizedMenuItem as MenuItem };\n"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA,SAASA,IAAT,EAAeC,UAAf,QAAiC,OAAjC;AAEA,SAASC,eAAT,QAAgC,wBAAhC;;AAkBA,MAAMC,QAAQ,GAAGF,UAAU,CACzB,OAA8BG,GAA9B;EAAA,IAAC;IAAEC,aAAF;IAAiB,GAAGC;EAApB,CAAD;EAAA,OACE,qBACMA,KADN;IAEE,GAAG,EAAEF,GAFP;IAGE,SAAS,EACPC,aAAa,GAAI,GAAEH,eAAe,CAACK,IAAK,cAA3B,GAA2CC,SAJ5D;IAAA,UAOGF,KAAK,CAACG;EAPT,EADF;AAAA,CADyB,CAA3B;AAcA,MAAMC,gBAAgB,GAAGV,IAAI,CAACG,QAAD,CAA7B;AAEA,SAASO,gBAAgB,IAAIP,QAA7B"}
@@ -0,0 +1,30 @@
1
+ /*!
2
+ * Copyright (c) 2023-present, Okta, Inc. and/or its affiliates. All rights reserved.
3
+ * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the "License.")
4
+ *
5
+ * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.
6
+ * Unless required by applicable law or agreed to in writing, software
7
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
8
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
9
+ *
10
+ * See the License for the specific language governing permissions and limitations under the License.
11
+ */
12
+ import { forwardRef, memo, useMemo } from "react";
13
+ import { MuiPropsContext } from "./MuiPropsContext.js";
14
+ import { jsx as _jsx } from "react/jsx-runtime";
15
+ const MuiPropsChild = forwardRef((_ref, ref) => {
16
+ let {
17
+ children,
18
+ ...muiProps
19
+ } = _ref;
20
+ const providerValue = useMemo(() => ({ ...muiProps,
21
+ ref
22
+ }), [muiProps, ref]);
23
+ return _jsx(MuiPropsContext.Provider, {
24
+ value: providerValue,
25
+ children: children
26
+ });
27
+ });
28
+ const MemoizedMuiPropsChild = memo(MuiPropsChild);
29
+ export { MemoizedMuiPropsChild as MuiPropsChild };
30
+ //# sourceMappingURL=MuiPropsChild.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MuiPropsChild.js","names":["forwardRef","memo","useMemo","MuiPropsContext","MuiPropsChild","ref","children","muiProps","providerValue","MemoizedMuiPropsChild"],"sources":["../src/MuiPropsChild.tsx"],"sourcesContent":["/*!\n * Copyright (c) 2023-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *\n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport { forwardRef, memo, ReactNode, useMemo } from \"react\";\n\nimport { MuiPropsContext, MuiPropsContextType } from \"./MuiPropsContext\";\n\nexport type MuiPropsChildProps = {\n children: ReactNode;\n};\n\nconst MuiPropsChild = forwardRef<HTMLElement, MuiPropsChildProps>(\n ({ children, ...muiProps }, ref) => {\n const providerValue = useMemo<MuiPropsContextType>(\n () => ({\n ...muiProps,\n ref,\n }),\n [muiProps, ref]\n );\n\n return (\n <MuiPropsContext.Provider value={providerValue}>\n {children}\n </MuiPropsContext.Provider>\n );\n }\n);\n\nconst MemoizedMuiPropsChild = memo(MuiPropsChild);\n\nexport { MemoizedMuiPropsChild as MuiPropsChild };\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA,SAASA,UAAT,EAAqBC,IAArB,EAAsCC,OAAtC,QAAqD,OAArD;SAESC,e;;AAMT,MAAMC,aAAa,GAAGJ,UAAU,CAC9B,OAA4BK,GAA5B,KAAoC;EAAA,IAAnC;IAAEC,QAAF;IAAY,GAAGC;EAAf,CAAmC;EAClC,MAAMC,aAAa,GAAGN,OAAO,CAC3B,OAAO,EACL,GAAGK,QADE;IAELF;EAFK,CAAP,CAD2B,EAK3B,CAACE,QAAD,EAAWF,GAAX,CAL2B,CAA7B;EAQA,OACE,KAAC,eAAD,CAAiB,QAAjB;IAA0B,KAAK,EAAEG,aAAjC;IAAA,UACGF;EADH,EADF;AAKD,CAf6B,CAAhC;AAkBA,MAAMG,qBAAqB,GAAGR,IAAI,CAACG,aAAD,CAAlC;AAEA,SAASK,qBAAqB,IAAIL,aAAlC"}
@@ -0,0 +1,14 @@
1
+ /*!
2
+ * Copyright (c) 2023-present, Okta, Inc. and/or its affiliates. All rights reserved.
3
+ * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the "License.")
4
+ *
5
+ * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.
6
+ * Unless required by applicable law or agreed to in writing, software
7
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
8
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
9
+ *
10
+ * See the License for the specific language governing permissions and limitations under the License.
11
+ */
12
+ import { createContext } from "react";
13
+ export const MuiPropsContext = createContext({});
14
+ //# sourceMappingURL=MuiPropsContext.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MuiPropsContext.js","names":["createContext","MuiPropsContext"],"sources":["../src/MuiPropsContext.ts"],"sourcesContent":["/*!\n * Copyright (c) 2023-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *\n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport { createContext } from \"react\";\n\nexport type MuiPropsContextType = Record<string, unknown>;\n\nexport const MuiPropsContext = createContext<MuiPropsContextType>({});\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA,SAASA,aAAT,QAA8B,OAA9B;AAIA,OAAO,MAAMC,eAAe,GAAGD,aAAa,CAAsB,EAAtB,CAArC"}
@@ -0,0 +1,73 @@
1
+ import _InputBase from "@mui/material/InputBase";
2
+ import _InputAdornment from "@mui/material/InputAdornment";
3
+ import { forwardRef, memo, useCallback, useState } from "react";
4
+ import { EyeIcon, EyeOffIcon, IconButton } from "./index.js";
5
+ import { Field } from "./Field.js";
6
+ import { jsx as _jsx } from "react/jsx-runtime";
7
+ const PasswordField = forwardRef((_ref, ref) => {
8
+ let {
9
+ autoCompleteType,
10
+ errorMessage,
11
+ hasInitialFocus,
12
+ hint,
13
+ id: idOverride,
14
+ isDisabled = false,
15
+ isOptional = false,
16
+ isReadOnly,
17
+ label,
18
+ onChange,
19
+ onFocus,
20
+ onBlur,
21
+ placeholder,
22
+ value
23
+ } = _ref;
24
+ const [inputType, setInputType] = useState("password");
25
+ const togglePasswordVisibility = useCallback(() => {
26
+ setInputType(inputType => inputType === "password" ? "text" : "password");
27
+ }, []);
28
+ const renderFieldComponent = useCallback(_ref2 => {
29
+ let {
30
+ ariaDescribedBy,
31
+ id
32
+ } = _ref2;
33
+ return _jsx(_InputBase, {
34
+ "aria-describedby": ariaDescribedBy,
35
+ autoComplete: autoCompleteType,
36
+ autoFocus: hasInitialFocus,
37
+ endAdornment: _jsx(_InputAdornment, {
38
+ position: "end",
39
+ children: _jsx(IconButton, {
40
+ "aria-label": "toggle password visibility",
41
+ edge: "end",
42
+ onClick: togglePasswordVisibility,
43
+ children: inputType === "password" ? _jsx(EyeIcon, {}) : _jsx(EyeOffIcon, {})
44
+ })
45
+ }),
46
+ id: id,
47
+ name: id,
48
+ onChange: onChange,
49
+ onFocus: onFocus,
50
+ onBlur: onBlur,
51
+ placeholder: placeholder,
52
+ readOnly: isReadOnly,
53
+ ref: ref,
54
+ required: !isOptional,
55
+ type: inputType,
56
+ value: value
57
+ });
58
+ }, [autoCompleteType, hasInitialFocus, togglePasswordVisibility, inputType, onChange, onFocus, onBlur, placeholder, isOptional, isReadOnly, ref, value]);
59
+ return _jsx(Field, {
60
+ errorMessage: errorMessage,
61
+ fieldType: "single",
62
+ hasVisibleLabel: true,
63
+ hint: hint,
64
+ id: idOverride,
65
+ isDisabled: isDisabled,
66
+ isOptional: isOptional,
67
+ label: label,
68
+ renderFieldComponent: renderFieldComponent
69
+ });
70
+ });
71
+ const MemoizedPasswordField = memo(PasswordField);
72
+ export { MemoizedPasswordField as PasswordField };
73
+ //# sourceMappingURL=PasswordField.js.map
@@ -0,0 +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,8 +1,7 @@
1
1
  import _RadioGroup from "@mui/material/RadioGroup";
2
- import { memo, useMemo } from "react";
3
- import { FormControl, FormLabel, FormHelperText, ScreenReaderText, useUniqueId } from "./index.js";
2
+ import { memo, useCallback } from "react";
3
+ import { Field } from "./Field.js";
4
4
  import { jsx as _jsx } from "react/jsx-runtime";
5
- import { jsxs as _jsxs } from "react/jsx-runtime";
6
5
 
7
6
  const RadioGroup = _ref => {
8
7
  let {
@@ -10,36 +9,36 @@ const RadioGroup = _ref => {
10
9
  defaultValue,
11
10
  errorMessage,
12
11
  hint,
12
+ id: idOverride,
13
13
  isDisabled,
14
14
  label,
15
- name,
16
- onChange
15
+ onChange,
16
+ value
17
17
  } = _ref;
18
- const ariaDescribedBy = useMemo(() => errorMessage || hint ? [hint && `${name}-hint`, errorMessage && `${name}-error`].filter(Boolean).join(" ") : undefined, [errorMessage, hint, name]);
19
- const uniqueName = useUniqueId(name);
20
- return _jsxs(FormControl, {
21
- component: "fieldset",
22
- disabled: isDisabled,
23
- error: Boolean(errorMessage),
24
- children: [_jsx(FormLabel, {
25
- component: "legend",
26
- children: label
27
- }), hint && _jsx(FormHelperText, {
28
- id: `${uniqueName}-hint`,
29
- children: hint
30
- }), _jsx(_RadioGroup, {
18
+ const renderFieldComponent = useCallback(_ref2 => {
19
+ let {
20
+ ariaDescribedBy,
21
+ id
22
+ } = _ref2;
23
+ return _jsx(_RadioGroup, {
31
24
  "aria-describedby": ariaDescribedBy,
32
25
  defaultValue: defaultValue,
33
- name: uniqueName,
26
+ id: id,
27
+ name: id,
34
28
  onChange: onChange,
29
+ value: value,
35
30
  children: children
36
- }), errorMessage && _jsxs(FormHelperText, {
37
- id: `${uniqueName}-error`,
38
- error: true,
39
- children: [_jsx(ScreenReaderText, {
40
- children: "Error:"
41
- }), " ", errorMessage]
42
- })]
31
+ });
32
+ }, [children, defaultValue, onChange, value]);
33
+ return _jsx(Field, {
34
+ errorMessage: errorMessage,
35
+ fieldType: "group",
36
+ hasVisibleLabel: false,
37
+ hint: hint,
38
+ id: idOverride,
39
+ isDisabled: isDisabled,
40
+ label: label,
41
+ renderFieldComponent: renderFieldComponent
43
42
  });
44
43
  };
45
44
 
@@ -1 +1 @@
1
- {"version":3,"file":"RadioGroup.js","names":["memo","useMemo","FormControl","FormLabel","FormHelperText","ScreenReaderText","useUniqueId","RadioGroup","children","defaultValue","errorMessage","hint","isDisabled","label","name","onChange","ariaDescribedBy","filter","Boolean","join","undefined","uniqueName","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, useMemo } from \"react\";\n\nimport {\n FormControl,\n FormLabel,\n FormHelperText,\n Radio,\n ScreenReaderText,\n useUniqueId,\n RadioProps,\n} from \".\";\n\nexport interface 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 * Disables the whole radio group\n */\n isDisabled?: boolean;\n /**\n * The text label for the radio group\n */\n label: string;\n /**\n * The name of the radio group, which only needs to be changed if there are multiple radio groups on the same screen\n */\n name?: 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 isDisabled,\n label,\n name,\n onChange,\n}: RadioGroupProps) => {\n const ariaDescribedBy = useMemo(\n () =>\n errorMessage || hint\n ? [hint && `${name}-hint`, errorMessage && `${name}-error`]\n .filter(Boolean)\n .join(\" \")\n : undefined,\n [errorMessage, hint, name]\n );\n\n const uniqueName = useUniqueId(name);\n\n return (\n <FormControl\n component=\"fieldset\"\n disabled={isDisabled}\n error={Boolean(errorMessage)}\n >\n <FormLabel component=\"legend\">{label}</FormLabel>\n {hint && (\n <FormHelperText id={`${uniqueName}-hint`}>{hint}</FormHelperText>\n )}\n <MuiRadioGroup\n aria-describedby={ariaDescribedBy}\n defaultValue={defaultValue}\n name={uniqueName}\n onChange={onChange}\n >\n {children}\n </MuiRadioGroup>\n {errorMessage && (\n <FormHelperText id={`${uniqueName}-error`} error>\n <ScreenReaderText>Error:</ScreenReaderText> {errorMessage}\n </FormHelperText>\n )}\n </FormControl>\n );\n};\n\nconst MemoizedRadioGroup = memo(RadioGroup);\n\nexport { MemoizedRadioGroup as RadioGroup };\n"],"mappings":";AAaA,SAA6BA,IAA7B,EAAiDC,OAAjD,QAAgE,OAAhE;SAGEC,W,EACAC,S,EACAC,c,EAEAC,gB,EACAC,W;;;;AA2CF,MAAMC,UAAU,GAAG,QASI;EAAA,IATH;IAClBC,QADkB;IAElBC,YAFkB;IAGlBC,YAHkB;IAIlBC,IAJkB;IAKlBC,UALkB;IAMlBC,KANkB;IAOlBC,IAPkB;IAQlBC;EARkB,CASG;EACrB,MAAMC,eAAe,GAAGf,OAAO,CAC7B,MACES,YAAY,IAAIC,IAAhB,GACI,CAACA,IAAI,IAAK,GAAEG,IAAK,OAAjB,EAAyBJ,YAAY,IAAK,GAAEI,IAAK,QAAjD,EACGG,MADH,CACUC,OADV,EAEGC,IAFH,CAEQ,GAFR,CADJ,GAIIC,SANuB,EAO7B,CAACV,YAAD,EAAeC,IAAf,EAAqBG,IAArB,CAP6B,CAA/B;EAUA,MAAMO,UAAU,GAAGf,WAAW,CAACQ,IAAD,CAA9B;EAEA,OACE,MAAC,WAAD;IACE,SAAS,EAAC,UADZ;IAEE,QAAQ,EAAEF,UAFZ;IAGE,KAAK,EAAEM,OAAO,CAACR,YAAD,CAHhB;IAAA,WAKE,KAAC,SAAD;MAAW,SAAS,EAAC,QAArB;MAAA,UAA+BG;IAA/B,EALF,EAMGF,IAAI,IACH,KAAC,cAAD;MAAgB,EAAE,EAAG,GAAEU,UAAW,OAAlC;MAAA,UAA2CV;IAA3C,EAPJ,EASE;MACE,oBAAkBK,eADpB;MAEE,YAAY,EAAEP,YAFhB;MAGE,IAAI,EAAEY,UAHR;MAIE,QAAQ,EAAEN,QAJZ;MAAA,UAMGP;IANH,EATF,EAiBGE,YAAY,IACX,MAAC,cAAD;MAAgB,EAAE,EAAG,GAAEW,UAAW,QAAlC;MAA2C,KAAK,MAAhD;MAAA,WACE,KAAC,gBAAD;QAAA;MAAA,EADF,OAC+CX,YAD/C;IAAA,EAlBJ;EAAA,EADF;AAyBD,CA/CD;;AAiDA,MAAMY,kBAAkB,GAAGtB,IAAI,CAACO,UAAD,CAA/B;AAEA,SAASe,kBAAkB,IAAIf,UAA/B"}
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"}
@@ -0,0 +1,56 @@
1
+ import _InputBase from "@mui/material/InputBase";
2
+ import _InputAdornment from "@mui/material/InputAdornment";
3
+ import { forwardRef, memo, useCallback } from "react";
4
+ import { SearchIcon } from "./index.js";
5
+ import { Field } from "./Field.js";
6
+ import { jsx as _jsx } from "react/jsx-runtime";
7
+ const SearchField = forwardRef((_ref, ref) => {
8
+ let {
9
+ autoCompleteType,
10
+ hasInitialFocus,
11
+ id: idOverride,
12
+ isDisabled = false,
13
+ label,
14
+ onChange,
15
+ onFocus,
16
+ onBlur,
17
+ placeholder,
18
+ value
19
+ } = _ref;
20
+ const renderFieldComponent = useCallback(_ref2 => {
21
+ let {
22
+ ariaDescribedBy,
23
+ id
24
+ } = _ref2;
25
+ return _jsx(_InputBase, {
26
+ "aria-describedby": ariaDescribedBy,
27
+ autoComplete: autoCompleteType,
28
+ autoFocus: hasInitialFocus,
29
+ id: id,
30
+ name: id,
31
+ onChange: onChange,
32
+ onFocus: onFocus,
33
+ onBlur: onBlur,
34
+ placeholder: placeholder,
35
+ ref: ref,
36
+ startAdornment: _jsx(_InputAdornment, {
37
+ position: "start",
38
+ children: _jsx(SearchIcon, {})
39
+ }),
40
+ type: "search",
41
+ value: value
42
+ });
43
+ }, [autoCompleteType, hasInitialFocus, onChange, onFocus, onBlur, placeholder, ref, value]);
44
+ return _jsx(Field, {
45
+ fieldType: "single",
46
+ hasVisibleLabel: false,
47
+ id: idOverride,
48
+ isDisabled: isDisabled,
49
+ isOptional: true,
50
+ label: label,
51
+ renderFieldComponent: renderFieldComponent
52
+ });
53
+ });
54
+ const MemoizedSearchField = memo(SearchField);
55
+ export { MemoizedSearchField as SearchField };
56
+ //# sourceMappingURL=SearchField.js.map
@@ -0,0 +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 +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 interface 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","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"}
package/dist/Tag.js ADDED
@@ -0,0 +1,28 @@
1
+ import _Chip from "@mui/material/Chip";
2
+ import { memo, useContext } from "react";
3
+ import { TagListContext } from "./TagListContext.js";
4
+ import { jsx as _jsx } from "react/jsx-runtime";
5
+
6
+ const Tag = _ref => {
7
+ let {
8
+ isDisabled,
9
+ label,
10
+ onClick,
11
+ onRemove
12
+ } = _ref;
13
+ const {
14
+ chipElementType
15
+ } = useContext(TagListContext);
16
+ return _jsx(_Chip, {
17
+ label: label,
18
+ clickable: onClick ? true : false,
19
+ component: chipElementType,
20
+ disabled: isDisabled,
21
+ onClick: onClick,
22
+ onDelete: onRemove
23
+ });
24
+ };
25
+
26
+ const MemoizedTag = memo(Tag);
27
+ export { MemoizedTag as Tag };
28
+ //# sourceMappingURL=Tag.js.map
@@ -0,0 +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"}
@@ -0,0 +1,26 @@
1
+ import _Stack from "@mui/material/Stack";
2
+ import { memo, useMemo } from "react";
3
+ import { TagListContext } from "./TagListContext.js";
4
+ import { jsx as _jsx } from "react/jsx-runtime";
5
+
6
+ const TagList = _ref => {
7
+ let {
8
+ children
9
+ } = _ref;
10
+ const providerValue = useMemo(() => ({
11
+ chipElementType: "li"
12
+ }), []);
13
+ return _jsx(_Stack, {
14
+ component: "ul",
15
+ direction: "row",
16
+ spacing: 2,
17
+ children: _jsx(TagListContext.Provider, {
18
+ value: providerValue,
19
+ children: children
20
+ })
21
+ });
22
+ };
23
+
24
+ const MemoizedTagList = memo(TagList);
25
+ export { MemoizedTagList as TagList };
26
+ //# sourceMappingURL=TagList.js.map
@@ -0,0 +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"}
@@ -0,0 +1,16 @@
1
+ /*!
2
+ * Copyright (c) 2022-present, Okta, Inc. and/or its affiliates. All rights reserved.
3
+ * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the "License.")
4
+ *
5
+ * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.
6
+ * Unless required by applicable law or agreed to in writing, software
7
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
8
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
9
+ *
10
+ * See the License for the specific language governing permissions and limitations under the License.
11
+ */
12
+ import { createContext } from "react";
13
+ export const TagListContext = createContext({
14
+ chipElementType: "div"
15
+ });
16
+ //# sourceMappingURL=TagListContext.js.map
@@ -0,0 +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"}