@okta/odyssey-react-mui 1.37.0 → 1.38.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 (264) hide show
  1. package/dist/cjs/EmptyState.cjs +14 -4
  2. package/dist/cjs/EmptyState.cjs.map +1 -1
  3. package/dist/cjs/Pagination/Pagination.cjs +1 -0
  4. package/dist/cjs/Pagination/Pagination.cjs.map +1 -1
  5. package/dist/cjs/addSpecificity.cjs +22 -0
  6. package/dist/cjs/addSpecificity.cjs.map +1 -0
  7. package/dist/cjs/labs/DatePickers/DateTimePicker.cjs +7 -5
  8. package/dist/cjs/labs/DatePickers/DateTimePicker.cjs.map +1 -1
  9. package/dist/cjs/labs/DatePickers/dateTimePickerTheme.cjs +36 -2
  10. package/dist/cjs/labs/DatePickers/dateTimePickerTheme.cjs.map +1 -1
  11. package/dist/cjs/labs/OdysseyPickers/ComposablePicker.cjs +2 -0
  12. package/dist/cjs/labs/OdysseyPickers/ComposablePicker.cjs.map +1 -1
  13. package/dist/cjs/labs/OdysseyPickers/Picker.cjs +21 -27
  14. package/dist/cjs/labs/OdysseyPickers/Picker.cjs.map +1 -1
  15. package/dist/cjs/labs/OdysseyPickers/PickerWithOptionAdornment.cjs +11 -10
  16. package/dist/cjs/labs/OdysseyPickers/PickerWithOptionAdornment.cjs.map +1 -1
  17. package/dist/cjs/labs/PageTemplate/PageTemplate.cjs +1 -1
  18. package/dist/cjs/labs/PageTemplate/PageTemplate.cjs.map +1 -1
  19. package/dist/cjs/properties/ts/odyssey-react-mui_cs.cjs +1 -0
  20. package/dist/cjs/properties/ts/odyssey-react-mui_cs.cjs.map +1 -1
  21. package/dist/cjs/properties/ts/odyssey-react-mui_da.cjs +1 -0
  22. package/dist/cjs/properties/ts/odyssey-react-mui_da.cjs.map +1 -1
  23. package/dist/cjs/properties/ts/odyssey-react-mui_de.cjs +1 -0
  24. package/dist/cjs/properties/ts/odyssey-react-mui_de.cjs.map +1 -1
  25. package/dist/cjs/properties/ts/odyssey-react-mui_el.cjs +1 -0
  26. package/dist/cjs/properties/ts/odyssey-react-mui_el.cjs.map +1 -1
  27. package/dist/cjs/properties/ts/odyssey-react-mui_es.cjs +1 -0
  28. package/dist/cjs/properties/ts/odyssey-react-mui_es.cjs.map +1 -1
  29. package/dist/cjs/properties/ts/odyssey-react-mui_fi.cjs +1 -0
  30. package/dist/cjs/properties/ts/odyssey-react-mui_fi.cjs.map +1 -1
  31. package/dist/cjs/properties/ts/odyssey-react-mui_fr.cjs +1 -0
  32. package/dist/cjs/properties/ts/odyssey-react-mui_fr.cjs.map +1 -1
  33. package/dist/cjs/properties/ts/odyssey-react-mui_ht.cjs +1 -0
  34. package/dist/cjs/properties/ts/odyssey-react-mui_ht.cjs.map +1 -1
  35. package/dist/cjs/properties/ts/odyssey-react-mui_hu.cjs +1 -0
  36. package/dist/cjs/properties/ts/odyssey-react-mui_hu.cjs.map +1 -1
  37. package/dist/cjs/properties/ts/odyssey-react-mui_id.cjs +1 -0
  38. package/dist/cjs/properties/ts/odyssey-react-mui_id.cjs.map +1 -1
  39. package/dist/cjs/properties/ts/odyssey-react-mui_it.cjs +1 -0
  40. package/dist/cjs/properties/ts/odyssey-react-mui_it.cjs.map +1 -1
  41. package/dist/cjs/properties/ts/odyssey-react-mui_ja.cjs +1 -0
  42. package/dist/cjs/properties/ts/odyssey-react-mui_ja.cjs.map +1 -1
  43. package/dist/cjs/properties/ts/odyssey-react-mui_ko.cjs +1 -0
  44. package/dist/cjs/properties/ts/odyssey-react-mui_ko.cjs.map +1 -1
  45. package/dist/cjs/properties/ts/odyssey-react-mui_ms.cjs +1 -0
  46. package/dist/cjs/properties/ts/odyssey-react-mui_ms.cjs.map +1 -1
  47. package/dist/cjs/properties/ts/odyssey-react-mui_nb.cjs +1 -0
  48. package/dist/cjs/properties/ts/odyssey-react-mui_nb.cjs.map +1 -1
  49. package/dist/cjs/properties/ts/odyssey-react-mui_nl_NL.cjs +1 -0
  50. package/dist/cjs/properties/ts/odyssey-react-mui_nl_NL.cjs.map +1 -1
  51. package/dist/cjs/properties/ts/odyssey-react-mui_pl.cjs +1 -0
  52. package/dist/cjs/properties/ts/odyssey-react-mui_pl.cjs.map +1 -1
  53. package/dist/cjs/properties/ts/odyssey-react-mui_pt_BR.cjs +1 -0
  54. package/dist/cjs/properties/ts/odyssey-react-mui_pt_BR.cjs.map +1 -1
  55. package/dist/cjs/properties/ts/odyssey-react-mui_ro.cjs +1 -0
  56. package/dist/cjs/properties/ts/odyssey-react-mui_ro.cjs.map +1 -1
  57. package/dist/cjs/properties/ts/odyssey-react-mui_ru.cjs +1 -0
  58. package/dist/cjs/properties/ts/odyssey-react-mui_ru.cjs.map +1 -1
  59. package/dist/cjs/properties/ts/odyssey-react-mui_sv.cjs +1 -0
  60. package/dist/cjs/properties/ts/odyssey-react-mui_sv.cjs.map +1 -1
  61. package/dist/cjs/properties/ts/odyssey-react-mui_th.cjs +1 -0
  62. package/dist/cjs/properties/ts/odyssey-react-mui_th.cjs.map +1 -1
  63. package/dist/cjs/properties/ts/odyssey-react-mui_tr.cjs +1 -0
  64. package/dist/cjs/properties/ts/odyssey-react-mui_tr.cjs.map +1 -1
  65. package/dist/cjs/properties/ts/odyssey-react-mui_uk.cjs +1 -0
  66. package/dist/cjs/properties/ts/odyssey-react-mui_uk.cjs.map +1 -1
  67. package/dist/cjs/properties/ts/odyssey-react-mui_vi.cjs +1 -0
  68. package/dist/cjs/properties/ts/odyssey-react-mui_vi.cjs.map +1 -1
  69. package/dist/cjs/properties/ts/odyssey-react-mui_zh_CN.cjs +1 -0
  70. package/dist/cjs/properties/ts/odyssey-react-mui_zh_CN.cjs.map +1 -1
  71. package/dist/cjs/properties/ts/odyssey-react-mui_zh_TW.cjs +1 -0
  72. package/dist/cjs/properties/ts/odyssey-react-mui_zh_TW.cjs.map +1 -1
  73. package/dist/cjs/test-selectors/getByQuerySelector.cjs +2 -2
  74. package/dist/cjs/test-selectors/getByQuerySelector.cjs.map +1 -1
  75. package/dist/cjs/test-selectors/testSelector.cjs.map +1 -1
  76. package/dist/cjs/ui-shell/NarrowUiShellContent.cjs +3 -2
  77. package/dist/cjs/ui-shell/NarrowUiShellContent.cjs.map +1 -1
  78. package/dist/cjs/ui-shell/SideNav/SideNav.cjs +8 -4
  79. package/dist/cjs/ui-shell/SideNav/SideNav.cjs.map +1 -1
  80. package/dist/cjs/ui-shell/SideNav/types.cjs.map +1 -1
  81. package/dist/cjs/ui-shell/UiShell.cjs +5 -2
  82. package/dist/cjs/ui-shell/UiShell.cjs.map +1 -1
  83. package/dist/cjs/ui-shell/WideUiShellContent.cjs +3 -2
  84. package/dist/cjs/ui-shell/WideUiShellContent.cjs.map +1 -1
  85. package/dist/cjs/ui-shell/uiShellContentTypes.cjs.map +1 -1
  86. package/dist/cjs/web-component/odysseyWebComponentVersion.generated.cjs +1 -1
  87. package/dist/cjs/web-component/odysseyWebComponentVersion.generated.cjs.map +1 -1
  88. package/dist/esm/EmptyState.js +14 -4
  89. package/dist/esm/EmptyState.js.map +1 -1
  90. package/dist/esm/Pagination/Pagination.js +1 -0
  91. package/dist/esm/Pagination/Pagination.js.map +1 -1
  92. package/dist/esm/addSpecificity.js +15 -0
  93. package/dist/esm/addSpecificity.js.map +1 -0
  94. package/dist/esm/labs/DatePickers/DateTimePicker.js +6 -4
  95. package/dist/esm/labs/DatePickers/DateTimePicker.js.map +1 -1
  96. package/dist/esm/labs/DatePickers/dateTimePickerTheme.js +35 -1
  97. package/dist/esm/labs/DatePickers/dateTimePickerTheme.js.map +1 -1
  98. package/dist/esm/labs/OdysseyPickers/ComposablePicker.js +2 -0
  99. package/dist/esm/labs/OdysseyPickers/ComposablePicker.js.map +1 -1
  100. package/dist/esm/labs/OdysseyPickers/Picker.js +23 -29
  101. package/dist/esm/labs/OdysseyPickers/Picker.js.map +1 -1
  102. package/dist/esm/labs/OdysseyPickers/PickerWithOptionAdornment.js +12 -11
  103. package/dist/esm/labs/OdysseyPickers/PickerWithOptionAdornment.js.map +1 -1
  104. package/dist/esm/labs/PageTemplate/PageTemplate.js +2 -2
  105. package/dist/esm/labs/PageTemplate/PageTemplate.js.map +1 -1
  106. package/dist/esm/properties/ts/odyssey-react-mui_cs.js +1 -0
  107. package/dist/esm/properties/ts/odyssey-react-mui_cs.js.map +1 -1
  108. package/dist/esm/properties/ts/odyssey-react-mui_da.js +1 -0
  109. package/dist/esm/properties/ts/odyssey-react-mui_da.js.map +1 -1
  110. package/dist/esm/properties/ts/odyssey-react-mui_de.js +1 -0
  111. package/dist/esm/properties/ts/odyssey-react-mui_de.js.map +1 -1
  112. package/dist/esm/properties/ts/odyssey-react-mui_el.js +1 -0
  113. package/dist/esm/properties/ts/odyssey-react-mui_el.js.map +1 -1
  114. package/dist/esm/properties/ts/odyssey-react-mui_es.js +1 -0
  115. package/dist/esm/properties/ts/odyssey-react-mui_es.js.map +1 -1
  116. package/dist/esm/properties/ts/odyssey-react-mui_fi.js +1 -0
  117. package/dist/esm/properties/ts/odyssey-react-mui_fi.js.map +1 -1
  118. package/dist/esm/properties/ts/odyssey-react-mui_fr.js +1 -0
  119. package/dist/esm/properties/ts/odyssey-react-mui_fr.js.map +1 -1
  120. package/dist/esm/properties/ts/odyssey-react-mui_ht.js +1 -0
  121. package/dist/esm/properties/ts/odyssey-react-mui_ht.js.map +1 -1
  122. package/dist/esm/properties/ts/odyssey-react-mui_hu.js +1 -0
  123. package/dist/esm/properties/ts/odyssey-react-mui_hu.js.map +1 -1
  124. package/dist/esm/properties/ts/odyssey-react-mui_id.js +1 -0
  125. package/dist/esm/properties/ts/odyssey-react-mui_id.js.map +1 -1
  126. package/dist/esm/properties/ts/odyssey-react-mui_it.js +1 -0
  127. package/dist/esm/properties/ts/odyssey-react-mui_it.js.map +1 -1
  128. package/dist/esm/properties/ts/odyssey-react-mui_ja.js +1 -0
  129. package/dist/esm/properties/ts/odyssey-react-mui_ja.js.map +1 -1
  130. package/dist/esm/properties/ts/odyssey-react-mui_ko.js +1 -0
  131. package/dist/esm/properties/ts/odyssey-react-mui_ko.js.map +1 -1
  132. package/dist/esm/properties/ts/odyssey-react-mui_ms.js +1 -0
  133. package/dist/esm/properties/ts/odyssey-react-mui_ms.js.map +1 -1
  134. package/dist/esm/properties/ts/odyssey-react-mui_nb.js +1 -0
  135. package/dist/esm/properties/ts/odyssey-react-mui_nb.js.map +1 -1
  136. package/dist/esm/properties/ts/odyssey-react-mui_nl_NL.js +1 -0
  137. package/dist/esm/properties/ts/odyssey-react-mui_nl_NL.js.map +1 -1
  138. package/dist/esm/properties/ts/odyssey-react-mui_pl.js +1 -0
  139. package/dist/esm/properties/ts/odyssey-react-mui_pl.js.map +1 -1
  140. package/dist/esm/properties/ts/odyssey-react-mui_pt_BR.js +1 -0
  141. package/dist/esm/properties/ts/odyssey-react-mui_pt_BR.js.map +1 -1
  142. package/dist/esm/properties/ts/odyssey-react-mui_ro.js +1 -0
  143. package/dist/esm/properties/ts/odyssey-react-mui_ro.js.map +1 -1
  144. package/dist/esm/properties/ts/odyssey-react-mui_ru.js +1 -0
  145. package/dist/esm/properties/ts/odyssey-react-mui_ru.js.map +1 -1
  146. package/dist/esm/properties/ts/odyssey-react-mui_sv.js +1 -0
  147. package/dist/esm/properties/ts/odyssey-react-mui_sv.js.map +1 -1
  148. package/dist/esm/properties/ts/odyssey-react-mui_th.js +1 -0
  149. package/dist/esm/properties/ts/odyssey-react-mui_th.js.map +1 -1
  150. package/dist/esm/properties/ts/odyssey-react-mui_tr.js +1 -0
  151. package/dist/esm/properties/ts/odyssey-react-mui_tr.js.map +1 -1
  152. package/dist/esm/properties/ts/odyssey-react-mui_uk.js +1 -0
  153. package/dist/esm/properties/ts/odyssey-react-mui_uk.js.map +1 -1
  154. package/dist/esm/properties/ts/odyssey-react-mui_vi.js +1 -0
  155. package/dist/esm/properties/ts/odyssey-react-mui_vi.js.map +1 -1
  156. package/dist/esm/properties/ts/odyssey-react-mui_zh_CN.js +1 -0
  157. package/dist/esm/properties/ts/odyssey-react-mui_zh_CN.js.map +1 -1
  158. package/dist/esm/properties/ts/odyssey-react-mui_zh_TW.js +1 -0
  159. package/dist/esm/properties/ts/odyssey-react-mui_zh_TW.js.map +1 -1
  160. package/dist/esm/test-selectors/getByQuerySelector.js +1 -1
  161. package/dist/esm/test-selectors/getByQuerySelector.js.map +1 -1
  162. package/dist/esm/test-selectors/testSelector.js.map +1 -1
  163. package/dist/esm/ui-shell/NarrowUiShellContent.js +3 -2
  164. package/dist/esm/ui-shell/NarrowUiShellContent.js.map +1 -1
  165. package/dist/esm/ui-shell/SideNav/SideNav.js +8 -4
  166. package/dist/esm/ui-shell/SideNav/SideNav.js.map +1 -1
  167. package/dist/esm/ui-shell/SideNav/types.js.map +1 -1
  168. package/dist/esm/ui-shell/UiShell.js +5 -2
  169. package/dist/esm/ui-shell/UiShell.js.map +1 -1
  170. package/dist/esm/ui-shell/WideUiShellContent.js +3 -2
  171. package/dist/esm/ui-shell/WideUiShellContent.js.map +1 -1
  172. package/dist/esm/ui-shell/uiShellContentTypes.js.map +1 -1
  173. package/dist/esm/web-component/odysseyWebComponentVersion.generated.js +1 -1
  174. package/dist/esm/web-component/odysseyWebComponentVersion.generated.js.map +1 -1
  175. package/dist/index.cjs +1 -1
  176. package/dist/index.mjs +1 -1
  177. package/dist/index.scss +1 -1
  178. package/dist/tsconfig.production.tsbuildinfo +1 -1
  179. package/dist/types/EmptyState.d.ts.map +1 -1
  180. package/dist/types/Pagination/Pagination.d.ts +1 -0
  181. package/dist/types/Pagination/Pagination.d.ts.map +1 -1
  182. package/dist/types/addSpecificity.d.ts +38 -0
  183. package/dist/types/addSpecificity.d.ts.map +1 -0
  184. package/dist/types/i18n.d.ts +27 -0
  185. package/dist/types/i18n.d.ts.map +1 -1
  186. package/dist/types/labs/DatePickers/DateTimePicker.d.ts +3 -0
  187. package/dist/types/labs/DatePickers/DateTimePicker.d.ts.map +1 -1
  188. package/dist/types/labs/DatePickers/dateTimePickerTheme.d.ts.map +1 -1
  189. package/dist/types/labs/OdysseyPickers/ComposablePicker.d.ts +2 -1
  190. package/dist/types/labs/OdysseyPickers/ComposablePicker.d.ts.map +1 -1
  191. package/dist/types/labs/OdysseyPickers/Picker.d.ts +6 -7
  192. package/dist/types/labs/OdysseyPickers/Picker.d.ts.map +1 -1
  193. package/dist/types/labs/OdysseyPickers/PickerWithOptionAdornment.d.ts.map +1 -1
  194. package/dist/types/properties/ts/odyssey-react-mui_cs.d.ts +1 -0
  195. package/dist/types/properties/ts/odyssey-react-mui_cs.d.ts.map +1 -1
  196. package/dist/types/properties/ts/odyssey-react-mui_da.d.ts +1 -0
  197. package/dist/types/properties/ts/odyssey-react-mui_da.d.ts.map +1 -1
  198. package/dist/types/properties/ts/odyssey-react-mui_de.d.ts +1 -0
  199. package/dist/types/properties/ts/odyssey-react-mui_de.d.ts.map +1 -1
  200. package/dist/types/properties/ts/odyssey-react-mui_el.d.ts +1 -0
  201. package/dist/types/properties/ts/odyssey-react-mui_el.d.ts.map +1 -1
  202. package/dist/types/properties/ts/odyssey-react-mui_es.d.ts +1 -0
  203. package/dist/types/properties/ts/odyssey-react-mui_es.d.ts.map +1 -1
  204. package/dist/types/properties/ts/odyssey-react-mui_fi.d.ts +1 -0
  205. package/dist/types/properties/ts/odyssey-react-mui_fi.d.ts.map +1 -1
  206. package/dist/types/properties/ts/odyssey-react-mui_fr.d.ts +1 -0
  207. package/dist/types/properties/ts/odyssey-react-mui_fr.d.ts.map +1 -1
  208. package/dist/types/properties/ts/odyssey-react-mui_ht.d.ts +1 -0
  209. package/dist/types/properties/ts/odyssey-react-mui_ht.d.ts.map +1 -1
  210. package/dist/types/properties/ts/odyssey-react-mui_hu.d.ts +1 -0
  211. package/dist/types/properties/ts/odyssey-react-mui_hu.d.ts.map +1 -1
  212. package/dist/types/properties/ts/odyssey-react-mui_id.d.ts +1 -0
  213. package/dist/types/properties/ts/odyssey-react-mui_id.d.ts.map +1 -1
  214. package/dist/types/properties/ts/odyssey-react-mui_it.d.ts +1 -0
  215. package/dist/types/properties/ts/odyssey-react-mui_it.d.ts.map +1 -1
  216. package/dist/types/properties/ts/odyssey-react-mui_ja.d.ts +1 -0
  217. package/dist/types/properties/ts/odyssey-react-mui_ja.d.ts.map +1 -1
  218. package/dist/types/properties/ts/odyssey-react-mui_ko.d.ts +1 -0
  219. package/dist/types/properties/ts/odyssey-react-mui_ko.d.ts.map +1 -1
  220. package/dist/types/properties/ts/odyssey-react-mui_ms.d.ts +1 -0
  221. package/dist/types/properties/ts/odyssey-react-mui_ms.d.ts.map +1 -1
  222. package/dist/types/properties/ts/odyssey-react-mui_nb.d.ts +1 -0
  223. package/dist/types/properties/ts/odyssey-react-mui_nb.d.ts.map +1 -1
  224. package/dist/types/properties/ts/odyssey-react-mui_nl_NL.d.ts +1 -0
  225. package/dist/types/properties/ts/odyssey-react-mui_nl_NL.d.ts.map +1 -1
  226. package/dist/types/properties/ts/odyssey-react-mui_pl.d.ts +1 -0
  227. package/dist/types/properties/ts/odyssey-react-mui_pl.d.ts.map +1 -1
  228. package/dist/types/properties/ts/odyssey-react-mui_pt_BR.d.ts +1 -0
  229. package/dist/types/properties/ts/odyssey-react-mui_pt_BR.d.ts.map +1 -1
  230. package/dist/types/properties/ts/odyssey-react-mui_ro.d.ts +1 -0
  231. package/dist/types/properties/ts/odyssey-react-mui_ro.d.ts.map +1 -1
  232. package/dist/types/properties/ts/odyssey-react-mui_ru.d.ts +1 -0
  233. package/dist/types/properties/ts/odyssey-react-mui_ru.d.ts.map +1 -1
  234. package/dist/types/properties/ts/odyssey-react-mui_sv.d.ts +1 -0
  235. package/dist/types/properties/ts/odyssey-react-mui_sv.d.ts.map +1 -1
  236. package/dist/types/properties/ts/odyssey-react-mui_th.d.ts +1 -0
  237. package/dist/types/properties/ts/odyssey-react-mui_th.d.ts.map +1 -1
  238. package/dist/types/properties/ts/odyssey-react-mui_tr.d.ts +1 -0
  239. package/dist/types/properties/ts/odyssey-react-mui_tr.d.ts.map +1 -1
  240. package/dist/types/properties/ts/odyssey-react-mui_uk.d.ts +1 -0
  241. package/dist/types/properties/ts/odyssey-react-mui_uk.d.ts.map +1 -1
  242. package/dist/types/properties/ts/odyssey-react-mui_vi.d.ts +1 -0
  243. package/dist/types/properties/ts/odyssey-react-mui_vi.d.ts.map +1 -1
  244. package/dist/types/properties/ts/odyssey-react-mui_zh_CN.d.ts +1 -0
  245. package/dist/types/properties/ts/odyssey-react-mui_zh_CN.d.ts.map +1 -1
  246. package/dist/types/properties/ts/odyssey-react-mui_zh_TW.d.ts +1 -0
  247. package/dist/types/properties/ts/odyssey-react-mui_zh_TW.d.ts.map +1 -1
  248. package/dist/types/test-selectors/getByQuerySelector.d.ts +73 -73
  249. package/dist/types/test-selectors/getByQuerySelector.d.ts.map +1 -1
  250. package/dist/types/test-selectors/testSelector.d.ts +1 -1
  251. package/dist/types/test-selectors/testSelector.d.ts.map +1 -1
  252. package/dist/types/ui-shell/NarrowUiShellContent.d.ts +1 -1
  253. package/dist/types/ui-shell/NarrowUiShellContent.d.ts.map +1 -1
  254. package/dist/types/ui-shell/SideNav/SideNav.d.ts +1 -1
  255. package/dist/types/ui-shell/SideNav/SideNav.d.ts.map +1 -1
  256. package/dist/types/ui-shell/SideNav/types.d.ts +5 -1
  257. package/dist/types/ui-shell/SideNav/types.d.ts.map +1 -1
  258. package/dist/types/ui-shell/UiShell.d.ts.map +1 -1
  259. package/dist/types/ui-shell/WideUiShellContent.d.ts +1 -1
  260. package/dist/types/ui-shell/WideUiShellContent.d.ts.map +1 -1
  261. package/dist/types/ui-shell/uiShellContentTypes.d.ts +4 -0
  262. package/dist/types/ui-shell/uiShellContentTypes.d.ts.map +1 -1
  263. package/dist/types/web-component/odysseyWebComponentVersion.generated.d.ts +1 -1
  264. package/package.json +15 -15
@@ -1 +1 @@
1
- {"version":3,"file":"odysseyWebComponentVersion.generated.cjs","names":["_default","exports","default"],"sources":["../../../src/web-component/odysseyWebComponentVersion.generated.ts"],"sourcesContent":["/*!\n * Copyright (c) 2024-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *\n * See the License for the specific language governing permissions and limitations under the License.\n */\n\n/**\n * DO NOT UPDATE THIS FILE MANUALLY\n * This file is managed by scripts/updateWebComponentVersion.ts and any changes made will be overwritten\n * This script only needs to be run during release, and shouldn't be used during local development.\n */\nexport default \"1-37-0\";\n"],"mappings":";;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAVA,IAAAA,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAiBe,QAAQ","ignoreList":[]}
1
+ {"version":3,"file":"odysseyWebComponentVersion.generated.cjs","names":["_default","exports","default"],"sources":["../../../src/web-component/odysseyWebComponentVersion.generated.ts"],"sourcesContent":["/*!\n * Copyright (c) 2024-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *\n * See the License for the specific language governing permissions and limitations under the License.\n */\n\n/**\n * DO NOT UPDATE THIS FILE MANUALLY\n * This file is managed by scripts/updateWebComponentVersion.ts and any changes made will be overwritten\n * This script only needs to be run during release, and shouldn't be used during local development.\n */\nexport default \"1-38-0\";\n"],"mappings":";;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAVA,IAAAA,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAiBe,QAAQ","ignoreList":[]}
@@ -29,6 +29,13 @@ const EmptyContainer = styled("div", {
29
29
  width: "100%",
30
30
  alignItems: "center"
31
31
  }));
32
+ const TextContainer = styled("div", {
33
+ shouldForwardProp: prop => prop !== "odysseyDesignTokens"
34
+ })(({
35
+ odysseyDesignTokens
36
+ }) => ({
37
+ maxWidth: odysseyDesignTokens.TypographyLineLengthMax
38
+ }));
32
39
  const EmptyState = ({
33
40
  heading,
34
41
  description,
@@ -38,10 +45,13 @@ const EmptyState = ({
38
45
  const odysseyDesignTokens = useOdysseyDesignTokens();
39
46
  return _jsxs(EmptyContainer, {
40
47
  odysseyDesignTokens: odysseyDesignTokens,
41
- children: [_jsx(Heading4, {
42
- children: heading
43
- }), _jsx(Paragraph, {
44
- children: description
48
+ children: [_jsxs(TextContainer, {
49
+ odysseyDesignTokens: odysseyDesignTokens,
50
+ children: [_jsx(Heading4, {
51
+ children: heading
52
+ }), _jsx(Paragraph, {
53
+ children: description
54
+ })]
45
55
  }), (PrimaryCallToActionComponent || SecondaryCallToActionComponent) && _jsxs(Box, {
46
56
  sx: {
47
57
  marginBlockStart: 5
@@ -1 +1 @@
1
- {"version":3,"file":"EmptyState.js","names":["memo","Heading4","Paragraph","Box","styled","useOdysseyDesignTokens","jsx","_jsx","jsxs","_jsxs","EmptyContainer","shouldForwardProp","prop","odysseyDesignTokens","display","flexDirection","marginBlock","Spacing9","padding","Spacing5","textAlign","width","alignItems","EmptyState","heading","description","PrimaryCallToActionComponent","SecondaryCallToActionComponent","children","sx","marginBlockStart","MemoizedEmptyState","displayName","DataTableEmptyState"],"sources":["../../src/EmptyState.tsx"],"sourcesContent":["/*!\n * Copyright (c) 2024-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *\n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport { ReactNode, memo } from \"react\";\nimport { Heading4, Paragraph } from \"./Typography.js\";\nimport { Box } from \"./Box.js\";\nimport styled from \"@emotion/styled\";\nimport {\n useOdysseyDesignTokens,\n DesignTokens,\n} from \"./OdysseyDesignTokensContext.js\";\n\nconst EmptyContainer = styled(\"div\", {\n shouldForwardProp: (prop) => prop !== \"odysseyDesignTokens\",\n})<{ odysseyDesignTokens: DesignTokens }>(({ odysseyDesignTokens }) => ({\n display: \"flex\",\n flexDirection: \"column\",\n marginBlock: odysseyDesignTokens.Spacing9,\n padding: odysseyDesignTokens.Spacing5,\n textAlign: \"center\",\n width: \"100%\",\n alignItems: \"center\",\n}));\n\nexport type EmptyStateProps = {\n /**\n * Main heading of the empty state\n */\n heading: string;\n /**\n * A descriptive text explaining more context as to why we don't have data.\n */\n description: string;\n /**\n * Primary call to action\n */\n PrimaryCallToActionComponent?: ReactNode;\n /**\n * Secondary call to action\n */\n SecondaryCallToActionComponent?: ReactNode;\n};\n\nconst EmptyState = ({\n heading,\n description,\n PrimaryCallToActionComponent,\n SecondaryCallToActionComponent,\n}: EmptyStateProps) => {\n const odysseyDesignTokens = useOdysseyDesignTokens();\n\n return (\n <EmptyContainer odysseyDesignTokens={odysseyDesignTokens}>\n <Heading4>{heading}</Heading4>\n <Paragraph>{description}</Paragraph>\n {(PrimaryCallToActionComponent || SecondaryCallToActionComponent) && (\n <Box sx={{ marginBlockStart: 5 }}>\n {SecondaryCallToActionComponent}\n {PrimaryCallToActionComponent}\n </Box>\n )}\n </EmptyContainer>\n );\n};\n\nconst MemoizedEmptyState = memo(EmptyState);\nMemoizedEmptyState.displayName = \"EmptyState\";\n\nexport { MemoizedEmptyState as EmptyState };\nexport { MemoizedEmptyState as DataTableEmptyState };\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA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uB,UAAU,CAAC;AAC3CQ,kBAAkB,CAACC,WAAW,GAAG,YAAY;AAE7C,SAASD,kBAAkB,IAAIR,UAAU;AACzC,SAASQ,kBAAkB,IAAIE,mBAAmB","ignoreList":[]}
1
+ {"version":3,"file":"EmptyState.js","names":["memo","Heading4","Paragraph","Box","styled","useOdysseyDesignTokens","jsx","_jsx","jsxs","_jsxs","EmptyContainer","shouldForwardProp","prop","odysseyDesignTokens","display","flexDirection","marginBlock","Spacing9","padding","Spacing5","textAlign","width","alignItems","TextContainer","maxWidth","TypographyLineLengthMax","EmptyState","heading","description","PrimaryCallToActionComponent","SecondaryCallToActionComponent","children","sx","marginBlockStart","MemoizedEmptyState","displayName","DataTableEmptyState"],"sources":["../../src/EmptyState.tsx"],"sourcesContent":["/*!\n * Copyright (c) 2024-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *\n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport { ReactNode, memo } from \"react\";\nimport { Heading4, Paragraph } from \"./Typography.js\";\nimport { Box } from \"./Box.js\";\nimport styled from \"@emotion/styled\";\nimport {\n useOdysseyDesignTokens,\n DesignTokens,\n} from \"./OdysseyDesignTokensContext.js\";\n\nconst EmptyContainer = styled(\"div\", {\n shouldForwardProp: (prop) => prop !== \"odysseyDesignTokens\",\n})<{ odysseyDesignTokens: DesignTokens }>(({ odysseyDesignTokens }) => ({\n display: \"flex\",\n flexDirection: \"column\",\n marginBlock: odysseyDesignTokens.Spacing9,\n padding: odysseyDesignTokens.Spacing5,\n textAlign: \"center\",\n width: \"100%\",\n alignItems: \"center\",\n}));\n\nconst TextContainer = styled(\"div\", {\n shouldForwardProp: (prop) => prop !== \"odysseyDesignTokens\",\n})<{ odysseyDesignTokens: DesignTokens }>(({ odysseyDesignTokens }) => ({\n maxWidth: odysseyDesignTokens.TypographyLineLengthMax,\n}));\n\nexport type EmptyStateProps = {\n /**\n * Main heading of the empty state\n */\n heading: string;\n /**\n * A descriptive text explaining more context as to why we don't have data.\n */\n description: string;\n /**\n * Primary call to action\n */\n PrimaryCallToActionComponent?: ReactNode;\n /**\n * Secondary call to action\n */\n SecondaryCallToActionComponent?: ReactNode;\n};\n\nconst EmptyState = ({\n heading,\n description,\n PrimaryCallToActionComponent,\n SecondaryCallToActionComponent,\n}: EmptyStateProps) => {\n const odysseyDesignTokens = useOdysseyDesignTokens();\n\n return (\n <EmptyContainer odysseyDesignTokens={odysseyDesignTokens}>\n <TextContainer odysseyDesignTokens={odysseyDesignTokens}>\n <Heading4>{heading}</Heading4>\n <Paragraph>{description}</Paragraph>\n </TextContainer>\n {(PrimaryCallToActionComponent || SecondaryCallToActionComponent) && (\n <Box sx={{ marginBlockStart: 5 }}>\n {SecondaryCallToActionComponent}\n {PrimaryCallToActionComponent}\n </Box>\n )}\n </EmptyContainer>\n );\n};\n\nconst MemoizedEmptyState = memo(EmptyState);\nMemoizedEmptyState.displayName = \"EmptyState\";\n\nexport { MemoizedEmptyState as EmptyState };\nexport { MemoizedEmptyState as DataTableEmptyState };\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAAoBA,IAAI,QAAQ,OAAO;AACvC,SAASC,QAAQ,EAAEC,SAAS,QAAQ,iBAAiB;AACrD,SAASC,GAAG,QAAQ,UAAU;AAC9B,OAAOC,MAAM,MAAM,iBAAiB;AACpC,SACEC,sBAAsB,QAEjB,iCAAiC;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAEzC,MAAMC,cAAc,GAAGN,MAAM,CAAC,KAAK,EAAE;EACnCO,iBAAiB,EAAGC,IAAI,I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AAC;AAC3CQ,kBAAkB,CAACC,WAAW,GAAG,YAAY;AAE7C,SAASD,kBAAkB,IAAIR,UAAU;AACzC,SAASQ,kBAAkB,IAAIE,mBAAmB","ignoreList":[]}
@@ -20,6 +20,7 @@ import { ArrowLeftIcon, ArrowRightIcon } from "../icons.generated/index.js";
20
20
  import { useOdysseyDesignTokens } from "../OdysseyDesignTokensContext.js";
21
21
  import { usePagination } from "./usePagination.js";
22
22
  import { Paragraph } from "../Typography.js";
23
+ import "../i18n.js";
23
24
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
24
25
  const PaginationContainer = styled("nav")({
25
26
  display: "flex",
@@ -1 +1 @@
1
- {"version":3,"file":"Pagination.js","names":["styled","memo","useCallback","useEffect","useMemo","useRef","useState","useTranslation","Box","Button","ArrowLeftIcon","ArrowRightIcon","useOdysseyDesignTokens","usePagination","Paragraph","jsx","_jsx","jsxs","_jsxs","PaginationContainer","display","justifyContent","PaginationSegment","shouldForwardProp","prop","odysseyDesignTokens","alignItems","gap","Spacing4","Spacing2","PaginationInput","_InputBase","borderColor","HueNeutral200","borderRadius","BorderRadiusTight","height","Spacing6","width","HueNeutral400","PalettePrimaryMain","PaginationButtonContainer","marginInlineStart","Pagination","currentPageLabel","currentPageLabelProp","currentRowsCount","hasPageInput","hasRowCountInput","hasRowCountLabel","isDisabled","isMoreDisabled","lastRow","loadMoreLabel","loadMoreLabelProp","maxPageIndex","maxPageSize","nextLabel","nextLabelProp","onPaginationChange","onPaginationChangeProp","pageIndex","pageSize","previousLabel","previousLabelProp","rowsPerPageLabel","rowsPerPageLabelProp","totalRows","variant","t","page","setPage","rowsPerPage","setRowsPerPage","initialRowsPerPage","totalRowsLabel","handlePaginationChange","updatedPage","updatedRowsPerPage","Math","ceil","handlePageSubmit","event","key","parseInt","currentTarget","value","handleRowsPerPageSubmit","setPageFromEvent","min","target","setRowsPerPageFromEvent","max","handleLoadMore","current","handleNextButton","handlePreviousButton","loadMoreIsDisabled","nextButtonDisabled","previousButtonDisabled","rowsPerPageInputProps","currentPageInputProps","children","component","color","type","onChange","onBlur","onKeyDown","disabled","inputProps","startIcon","size","ariaLabel","onClick","endIcon","label","MemoizedPagination","displayName"],"sources":["../../../src/Pagination/Pagination.tsx"],"sourcesContent":["/*!\n * Copyright (c) 2023-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *\n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport styled from \"@emotion/styled\";\nimport { InputBase } from \"@mui/material\";\nimport { memo, useCallback, useEffect, useMemo, useRef, useState } from \"react\";\nimport { useTranslation } from \"react-i18next\";\n\nimport { Box } from \"../Box.js\";\nimport { Button } from \"../Buttons/index.js\";\nimport { paginationTypeValues } from \"./constants.js\";\nimport { ArrowLeftIcon, ArrowRightIcon } from \"../icons.generated/index.js\";\nimport {\n DesignTokens,\n useOdysseyDesignTokens,\n} from \"../OdysseyDesignTokensContext.js\";\nimport { usePagination } from \"./usePagination.js\";\nimport { Paragraph } from \"../Typography.js\";\n\nconst PaginationContainer = styled(\"nav\")({\n display: \"flex\",\n justifyContent: \"space-between\",\n});\n\nconst PaginationSegment = styled(\"div\", {\n shouldForwardProp: (prop) => prop !== \"odysseyDesignTokens\",\n})<{ odysseyDesignTokens: DesignTokens }>(({ odysseyDesignTokens }) => ({\n display: \"flex\",\n alignItems: \"center\",\n gap: odysseyDesignTokens.Spacing4,\n \"& > div\": {\n display: \"flex\",\n alignItems: \"center\",\n gap: odysseyDesignTokens.Spacing2,\n },\n}));\n\nconst PaginationInput = styled(InputBase, {\n shouldForwardProp: (prop) => prop !== \"odysseyDesignTokens\",\n})<{ odysseyDesignTokens: DesignTokens }>(({ odysseyDesignTokens }) => ({\n borderColor: odysseyDesignTokens.HueNeutral200,\n borderRadius: odysseyDesignTokens.BorderRadiusTight,\n height: odysseyDesignTokens.Spacing6,\n width: \"4.5714285714rem\", // This is a hardcoded value, keep as string\n \"&:hover\": {\n borderColor: odysseyDesignTokens.HueNeutral400,\n },\n \"&.Mui-focused:hover\": {\n borderColor: odysseyDesignTokens.PalettePrimaryMain,\n },\n}));\n\nconst PaginationButtonContainer = styled(\"div\")({\n \"& > *\": {\n marginInlineStart: `0 !important`,\n },\n});\n\nexport type PaginationProps = {\n /**\n * The labeled rendered for the current page index\n */\n currentPageLabel?: string;\n /**\n * The number of items currently visible on the page\n */\n currentRowsCount?: number;\n /**\n * If true, the page input will be visible and the user can directly manipulate which page\n * is visible.\n */\n hasPageInput?: boolean;\n /**\n * If true, the row count input will be visible and the user can directly manipulate how many rows\n * are visible.\n */\n hasRowCountInput?: boolean;\n /**\n * If true, the \"X - X of total X\" label will be visible\n */\n hasRowCountLabel?: boolean;\n /**\n * If true, the pagination controls will be disabled\n */\n isDisabled?: boolean;\n /**\n * If true, the next or Show More button will be disabled\n */\n isMoreDisabled?: boolean;\n /**\n * The current page last row index\n */\n lastRow?: number;\n /**\n * If the pagination is of \"loadMore\" variant, then this is the the load more label\n */\n loadMoreLabel?: string;\n /**\n * The max page\n */\n maxPageIndex?: number;\n /**\n * The max rows per page\n */\n maxPageSize?: number;\n /**\n * The label for the next control\n */\n nextLabel?: string;\n /**\n * Page index and page size setter\n */\n onPaginationChange: ({\n pageIndex,\n pageSize,\n }: {\n pageIndex: number;\n pageSize: number;\n }) => void;\n /**\n * The current page index\n */\n pageIndex: number;\n /**\n * The current page size\n */\n pageSize: number;\n /**\n * The label for the previous control\n */\n previousLabel?: string;\n /**\n * The label that shows how many results are rendered per page\n */\n rowsPerPageLabel?: string;\n /**\n * Total rows count\n */\n totalRows?: number;\n /**\n * The type of pagination controls shown. Defaults to next/prev buttons, but can be\n * set to a simple \"Load more\" button by setting to \"loadMore\".\n */\n variant?: (typeof paginationTypeValues)[number];\n};\n\nconst Pagination = ({\n currentPageLabel: currentPageLabelProp,\n currentRowsCount,\n hasPageInput = true,\n hasRowCountInput = true,\n hasRowCountLabel = true,\n isDisabled,\n isMoreDisabled,\n lastRow,\n loadMoreLabel: loadMoreLabelProp,\n maxPageIndex,\n maxPageSize,\n nextLabel: nextLabelProp,\n onPaginationChange: onPaginationChangeProp,\n pageIndex,\n pageSize,\n previousLabel: previousLabelProp,\n rowsPerPageLabel: rowsPerPageLabelProp,\n totalRows,\n variant,\n}: PaginationProps) => {\n const odysseyDesignTokens = useOdysseyDesignTokens();\n const { t } = useTranslation();\n\n const [page, setPage] = useState<number>(pageIndex);\n const [rowsPerPage, setRowsPerPage] = useState<number>(pageSize);\n const initialRowsPerPage = useRef<number>(pageSize);\n\n const currentPageLabel = currentPageLabelProp ?? t(\"pagination.page\");\n const loadMoreLabel = loadMoreLabelProp ?? t(\"pagination.loadmore\");\n const nextLabel = nextLabelProp ?? t(\"pagination.next\");\n const previousLabel = previousLabelProp ?? t(\"pagination.previous\");\n const rowsPerPageLabel = rowsPerPageLabelProp ?? t(\"pagination.rowsperpage\");\n\n useEffect(() => {\n setPage(pageIndex);\n setRowsPerPage(pageSize);\n }, [pageIndex, pageSize]);\n\n const onPaginationChange = useCallback(\n ({ pageIndex, pageSize }: { pageIndex: number; pageSize: number }) => {\n onPaginationChangeProp({ pageIndex, pageSize });\n },\n [onPaginationChangeProp],\n );\n\n const { totalRowsLabel } = usePagination({\n pageIndex,\n pageSize,\n currentRowsCount: currentRowsCount || 0,\n totalRows,\n });\n\n const handlePaginationChange = useCallback(() => {\n let updatedPage = page;\n let updatedRowsPerPage = rowsPerPage;\n\n if (totalRows) {\n const maxPageIndex = Math.ceil(totalRows / updatedRowsPerPage);\n\n // Ensure rowsPerPage does not exceed totalRows\n if (updatedRowsPerPage > totalRows) {\n updatedRowsPerPage = totalRows;\n }\n\n // Ensure page is within valid range\n if (updatedPage > maxPageIndex) {\n updatedPage = maxPageIndex;\n } else if (updatedPage < 1) {\n updatedPage = 1;\n }\n }\n\n onPaginationChange({\n pageIndex: updatedPage,\n pageSize: updatedRowsPerPage,\n });\n }, [page, rowsPerPage, onPaginationChange, totalRows]);\n\n // The following handlers use React.KeyboardEvent (rather than just KeyboardEvent) becuase React.KeyboardEvent\n // is generic, while plain KeyboardEvent is not. We need this generic so we can specify the HTMLInputElement,\n // which allows us to use currentTarget.value\n const handlePageSubmit = useCallback(\n (event: React.KeyboardEvent<HTMLInputElement | HTMLTextAreaElement>) => {\n if (event.key === \"Enter\") {\n onPaginationChange({\n pageIndex: parseInt(event.currentTarget.value),\n pageSize: rowsPerPage,\n });\n }\n },\n [rowsPerPage, onPaginationChange],\n );\n\n const handleRowsPerPageSubmit = useCallback(\n (event: React.KeyboardEvent<HTMLInputElement | HTMLTextAreaElement>) => {\n if (event.key === \"Enter\") {\n onPaginationChange({\n pageIndex: page,\n pageSize: parseInt(event.currentTarget.value),\n });\n }\n },\n [page, onPaginationChange],\n );\n\n const setPageFromEvent = useCallback(\n (event: React.ChangeEvent<HTMLInputElement>) => {\n const value = maxPageIndex\n ? Math.min(parseInt(event.target.value), maxPageIndex)\n : parseInt(event.target.value);\n setPage(value);\n },\n [setPage, maxPageIndex],\n );\n\n const setRowsPerPageFromEvent = useCallback(\n (event: React.ChangeEvent<HTMLInputElement>) => {\n const value = maxPageSize\n ? Math.min(parseInt(event.target.value), maxPageSize)\n : parseInt(event.target.value);\n\n // Ensure the value can't be less than 1\n setRowsPerPage(Math.max(1, value));\n },\n [setRowsPerPage, maxPageSize],\n );\n\n const handleLoadMore = useCallback(() => {\n onPaginationChange({\n pageIndex: 1,\n pageSize: rowsPerPage + initialRowsPerPage.current,\n });\n }, [rowsPerPage, onPaginationChange]);\n\n const handleNextButton = useCallback(() => {\n onPaginationChange({ pageIndex: page + 1, pageSize: rowsPerPage });\n }, [onPaginationChange, page, rowsPerPage]);\n\n const handlePreviousButton = useCallback(() => {\n onPaginationChange({ pageIndex: page - 1, pageSize: rowsPerPage });\n }, [onPaginationChange, page, rowsPerPage]);\n\n const loadMoreIsDisabled = useMemo(() => {\n return isMoreDisabled || (totalRows ? rowsPerPage >= totalRows : false);\n }, [isMoreDisabled, rowsPerPage, totalRows]);\n\n const nextButtonDisabled = useMemo(\n () =>\n isMoreDisabled ||\n (lastRow && (totalRows ? lastRow >= totalRows : false)) ||\n isDisabled,\n [isMoreDisabled, totalRows, lastRow, isDisabled],\n );\n\n const previousButtonDisabled = useMemo(\n () => pageIndex <= 1 || isDisabled,\n [pageIndex, isDisabled],\n );\n\n const rowsPerPageInputProps = useMemo(\n () => ({\n \"aria-label\": rowsPerPageLabel,\n max: maxPageSize || totalRows,\n }),\n [maxPageSize, rowsPerPageLabel, totalRows],\n );\n\n const currentPageInputProps = useMemo(\n () => ({\n \"aria-label\": currentPageLabel,\n max: maxPageIndex,\n }),\n [currentPageLabel, maxPageIndex],\n );\n\n return variant === \"paged\" ? (\n <PaginationContainer aria-label={t(\"pagination.label\")}>\n <PaginationSegment odysseyDesignTokens={odysseyDesignTokens}>\n {hasRowCountInput && (\n <Box>\n <Paragraph component=\"span\" color=\"textSecondary\">\n {rowsPerPageLabel}\n </Paragraph>\n <PaginationInput\n odysseyDesignTokens={odysseyDesignTokens}\n type=\"number\"\n value={rowsPerPage}\n onChange={setRowsPerPageFromEvent}\n onBlur={handlePaginationChange}\n onKeyDown={handleRowsPerPageSubmit}\n disabled={isDisabled}\n inputProps={rowsPerPageInputProps}\n />\n </Box>\n )}\n {hasRowCountLabel && (\n <Paragraph component=\"span\" color=\"textSecondary\">\n {totalRowsLabel}\n </Paragraph>\n )}\n </PaginationSegment>\n\n <PaginationSegment odysseyDesignTokens={odysseyDesignTokens}>\n {totalRows && hasPageInput && (\n <Box>\n <Paragraph component=\"span\" color=\"textSecondary\">\n {currentPageLabel}\n </Paragraph>\n <PaginationInput\n odysseyDesignTokens={odysseyDesignTokens}\n type=\"number\"\n value={page}\n onChange={setPageFromEvent}\n onBlur={handlePaginationChange}\n onKeyDown={handlePageSubmit}\n disabled={isDisabled}\n inputProps={currentPageInputProps}\n />\n </Box>\n )}\n <PaginationButtonContainer>\n <Button\n startIcon={<ArrowLeftIcon />}\n variant=\"floating\"\n size=\"small\"\n ariaLabel={previousLabel}\n onClick={handlePreviousButton}\n isDisabled={previousButtonDisabled}\n />\n <Button\n endIcon={<ArrowRightIcon />}\n variant=\"floating\"\n size=\"small\"\n ariaLabel={nextLabel}\n onClick={handleNextButton}\n isDisabled={nextButtonDisabled}\n />\n </PaginationButtonContainer>\n </PaginationSegment>\n </PaginationContainer>\n ) : (\n <Button\n variant=\"secondary\"\n label={loadMoreLabel}\n onClick={handleLoadMore}\n isDisabled={loadMoreIsDisabled}\n />\n );\n};\n\nconst MemoizedPagination = memo(Pagination);\nMemoizedPagination.displayName = \"Pagination\";\n\nexport { MemoizedPagination as Pagination };\n"],"mappings":";AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,OAAOA,MAAM,MAAM,iBAAiB;AAEpC,SAASC,IAAI,EAAEC,WAAW,EAAEC,SAAS,EAAEC,OAAO,EAAEC,MAAM,EAAEC,QAAQ,QAAQ,OAAO;AAC/E,SAASC,cAAc,QAAQ,eAAe;AAE9C,SAASC,GAAG,QAAQ,WAAW;AAC/B,SAASC,MAAM,QAAQ,qBAAqB;AAE5C,SAASC,aAAa,EAAEC,cAAc,QAAQ,6BAA6B;AAC3E,SAEEC,sBAAsB,QACjB,kCAAkC;AACzC,SAASC,aAAa,QAAQ,oBAAoB;AAClD,SAASC,SAAS,QAAQ,kBAAkB;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAE7C,MAAMC,mBAAmB,GAAGnB,MAAM,CAAC,KAAK,CAAC,CAAC;EACxCoB,OAAO,EAAE,MAAM;EACfC,cAAc,EAAE;AAClB,CAAC,CAAC;AAEF,MAAMC,iB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AAU,EAAET;QAAsB,CACnC,CAAC;MAAA,CACC,CACN,EACDnF,KAAA,CAACuB,yBAAyB;QAAA6D,QAAA,GACxBtF,IAAA,CAACP,MAAM;UACLsG,SAAS,EAAE/F,IAAA,CAACN,aAAa,IAAE,CAAE;UAC7B0D,OAAO,EAAC,UAAU;UAClB4C,IAAI,EAAC,OAAO;UACZC,SAAS,EAAElD,aAAc;UACzBmD,OAAO,EAAElB,oBAAqB;UAC9B9C,UAAU,EAAEiD;QAAuB,CACpC,CAAC,EACFnF,IAAA,CAACP,MAAM;UACL0G,OAAO,EAAEnG,IAAA,CAACL,cAAc,IAAE,CAAE;UAC5ByD,OAAO,EAAC,UAAU;UAClB4C,IAAI,EAAC,OAAO;UACZC,SAAS,EAAExD,SAAU;UACrByD,OAAO,EAAEnB,gBAAiB;UAC1B7C,UAAU,EAAEgD;QAAmB,CAChC,CAAC;MAAA,CACuB,CAAC;IAAA,CACX,CAAC;EAAA,CACD,CAAC,GAEtBlF,IAAA,CAACP,MAAM;IACL2D,OAAO,EAAC,WAAW;IACnBgD,KAAK,EAAE/D,aAAc;IACrB6D,OAAO,EAAErB,cAAe;IACxB3C,UAAU,EAAE+C;EAAmB,CAChC,CACF;AACH,CAAC;AAED,MAAMoB,kBAAkB,GAAGpH,IAAI,CAAC0C,UAAU,CAAC;AAC3C0E,kBAAkB,CAACC,WAAW,GAAG,YAAY;AAE7C,SAASD,kBAAkB,IAAI1E,UAAU","ignoreList":[]}
1
+ {"version":3,"file":"Pagination.js","names":["styled","memo","useCallback","useEffect","useMemo","useRef","useState","useTranslation","Box","Button","ArrowLeftIcon","ArrowRightIcon","useOdysseyDesignTokens","usePagination","Paragraph","jsx","_jsx","jsxs","_jsxs","PaginationContainer","display","justifyContent","PaginationSegment","shouldForwardProp","prop","odysseyDesignTokens","alignItems","gap","Spacing4","Spacing2","PaginationInput","_InputBase","borderColor","HueNeutral200","borderRadius","BorderRadiusTight","height","Spacing6","width","HueNeutral400","PalettePrimaryMain","PaginationButtonContainer","marginInlineStart","Pagination","currentPageLabel","currentPageLabelProp","currentRowsCount","hasPageInput","hasRowCountInput","hasRowCountLabel","isDisabled","isMoreDisabled","lastRow","loadMoreLabel","loadMoreLabelProp","maxPageIndex","maxPageSize","nextLabel","nextLabelProp","onPaginationChange","onPaginationChangeProp","pageIndex","pageSize","previousLabel","previousLabelProp","rowsPerPageLabel","rowsPerPageLabelProp","totalRows","variant","t","page","setPage","rowsPerPage","setRowsPerPage","initialRowsPerPage","totalRowsLabel","handlePaginationChange","updatedPage","updatedRowsPerPage","Math","ceil","handlePageSubmit","event","key","parseInt","currentTarget","value","handleRowsPerPageSubmit","setPageFromEvent","min","target","setRowsPerPageFromEvent","max","handleLoadMore","current","handleNextButton","handlePreviousButton","loadMoreIsDisabled","nextButtonDisabled","previousButtonDisabled","rowsPerPageInputProps","currentPageInputProps","children","component","color","type","onChange","onBlur","onKeyDown","disabled","inputProps","startIcon","size","ariaLabel","onClick","endIcon","label","MemoizedPagination","displayName"],"sources":["../../../src/Pagination/Pagination.tsx"],"sourcesContent":["/*!\n * Copyright (c) 2023-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *\n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport styled from \"@emotion/styled\";\nimport { InputBase } from \"@mui/material\";\nimport { memo, useCallback, useEffect, useMemo, useRef, useState } from \"react\";\nimport { useTranslation } from \"react-i18next\";\n\nimport { Box } from \"../Box.js\";\nimport { Button } from \"../Buttons/index.js\";\nimport { paginationTypeValues } from \"./constants.js\";\nimport { ArrowLeftIcon, ArrowRightIcon } from \"../icons.generated/index.js\";\nimport {\n DesignTokens,\n useOdysseyDesignTokens,\n} from \"../OdysseyDesignTokensContext.js\";\nimport { usePagination } from \"./usePagination.js\";\nimport { Paragraph } from \"../Typography.js\";\nimport \"../i18n.js\";\n\nconst PaginationContainer = styled(\"nav\")({\n display: \"flex\",\n justifyContent: \"space-between\",\n});\n\nconst PaginationSegment = styled(\"div\", {\n shouldForwardProp: (prop) => prop !== \"odysseyDesignTokens\",\n})<{ odysseyDesignTokens: DesignTokens }>(({ odysseyDesignTokens }) => ({\n display: \"flex\",\n alignItems: \"center\",\n gap: odysseyDesignTokens.Spacing4,\n \"& > div\": {\n display: \"flex\",\n alignItems: \"center\",\n gap: odysseyDesignTokens.Spacing2,\n },\n}));\n\nconst PaginationInput = styled(InputBase, {\n shouldForwardProp: (prop) => prop !== \"odysseyDesignTokens\",\n})<{ odysseyDesignTokens: DesignTokens }>(({ odysseyDesignTokens }) => ({\n borderColor: odysseyDesignTokens.HueNeutral200,\n borderRadius: odysseyDesignTokens.BorderRadiusTight,\n height: odysseyDesignTokens.Spacing6,\n width: \"4.5714285714rem\", // This is a hardcoded value, keep as string\n \"&:hover\": {\n borderColor: odysseyDesignTokens.HueNeutral400,\n },\n \"&.Mui-focused:hover\": {\n borderColor: odysseyDesignTokens.PalettePrimaryMain,\n },\n}));\n\nconst PaginationButtonContainer = styled(\"div\")({\n \"& > *\": {\n marginInlineStart: `0 !important`,\n },\n});\n\nexport type PaginationProps = {\n /**\n * The labeled rendered for the current page index\n */\n currentPageLabel?: string;\n /**\n * The number of items currently visible on the page\n */\n currentRowsCount?: number;\n /**\n * If true, the page input will be visible and the user can directly manipulate which page\n * is visible.\n */\n hasPageInput?: boolean;\n /**\n * If true, the row count input will be visible and the user can directly manipulate how many rows\n * are visible.\n */\n hasRowCountInput?: boolean;\n /**\n * If true, the \"X - X of total X\" label will be visible\n */\n hasRowCountLabel?: boolean;\n /**\n * If true, the pagination controls will be disabled\n */\n isDisabled?: boolean;\n /**\n * If true, the next or Show More button will be disabled\n */\n isMoreDisabled?: boolean;\n /**\n * The current page last row index\n */\n lastRow?: number;\n /**\n * If the pagination is of \"loadMore\" variant, then this is the the load more label\n */\n loadMoreLabel?: string;\n /**\n * The max page\n */\n maxPageIndex?: number;\n /**\n * The max rows per page\n */\n maxPageSize?: number;\n /**\n * The label for the next control\n */\n nextLabel?: string;\n /**\n * Page index and page size setter\n */\n onPaginationChange: ({\n pageIndex,\n pageSize,\n }: {\n pageIndex: number;\n pageSize: number;\n }) => void;\n /**\n * The current page index\n */\n pageIndex: number;\n /**\n * The current page size\n */\n pageSize: number;\n /**\n * The label for the previous control\n */\n previousLabel?: string;\n /**\n * The label that shows how many results are rendered per page\n */\n rowsPerPageLabel?: string;\n /**\n * Total rows count\n */\n totalRows?: number;\n /**\n * The type of pagination controls shown. Defaults to next/prev buttons, but can be\n * set to a simple \"Load more\" button by setting to \"loadMore\".\n */\n variant?: (typeof paginationTypeValues)[number];\n};\n\nconst Pagination = ({\n currentPageLabel: currentPageLabelProp,\n currentRowsCount,\n hasPageInput = true,\n hasRowCountInput = true,\n hasRowCountLabel = true,\n isDisabled,\n isMoreDisabled,\n lastRow,\n loadMoreLabel: loadMoreLabelProp,\n maxPageIndex,\n maxPageSize,\n nextLabel: nextLabelProp,\n onPaginationChange: onPaginationChangeProp,\n pageIndex,\n pageSize,\n previousLabel: previousLabelProp,\n rowsPerPageLabel: rowsPerPageLabelProp,\n totalRows,\n variant,\n}: PaginationProps) => {\n const odysseyDesignTokens = useOdysseyDesignTokens();\n const { t } = useTranslation();\n\n const [page, setPage] = useState<number>(pageIndex);\n const [rowsPerPage, setRowsPerPage] = useState<number>(pageSize);\n const initialRowsPerPage = useRef<number>(pageSize);\n\n const currentPageLabel = currentPageLabelProp ?? t(\"pagination.page\");\n const loadMoreLabel = loadMoreLabelProp ?? t(\"pagination.loadmore\");\n const nextLabel = nextLabelProp ?? t(\"pagination.next\");\n const previousLabel = previousLabelProp ?? t(\"pagination.previous\");\n const rowsPerPageLabel = rowsPerPageLabelProp ?? t(\"pagination.rowsperpage\");\n\n useEffect(() => {\n setPage(pageIndex);\n setRowsPerPage(pageSize);\n }, [pageIndex, pageSize]);\n\n const onPaginationChange = useCallback(\n ({ pageIndex, pageSize }: { pageIndex: number; pageSize: number }) => {\n onPaginationChangeProp({ pageIndex, pageSize });\n },\n [onPaginationChangeProp],\n );\n\n const { totalRowsLabel } = usePagination({\n pageIndex,\n pageSize,\n currentRowsCount: currentRowsCount || 0,\n totalRows,\n });\n\n const handlePaginationChange = useCallback(() => {\n let updatedPage = page;\n let updatedRowsPerPage = rowsPerPage;\n\n if (totalRows) {\n const maxPageIndex = Math.ceil(totalRows / updatedRowsPerPage);\n\n // Ensure rowsPerPage does not exceed totalRows\n if (updatedRowsPerPage > totalRows) {\n updatedRowsPerPage = totalRows;\n }\n\n // Ensure page is within valid range\n if (updatedPage > maxPageIndex) {\n updatedPage = maxPageIndex;\n } else if (updatedPage < 1) {\n updatedPage = 1;\n }\n }\n\n onPaginationChange({\n pageIndex: updatedPage,\n pageSize: updatedRowsPerPage,\n });\n }, [page, rowsPerPage, onPaginationChange, totalRows]);\n\n // The following handlers use React.KeyboardEvent (rather than just KeyboardEvent) becuase React.KeyboardEvent\n // is generic, while plain KeyboardEvent is not. We need this generic so we can specify the HTMLInputElement,\n // which allows us to use currentTarget.value\n const handlePageSubmit = useCallback(\n (event: React.KeyboardEvent<HTMLInputElement | HTMLTextAreaElement>) => {\n if (event.key === \"Enter\") {\n onPaginationChange({\n pageIndex: parseInt(event.currentTarget.value),\n pageSize: rowsPerPage,\n });\n }\n },\n [rowsPerPage, onPaginationChange],\n );\n\n const handleRowsPerPageSubmit = useCallback(\n (event: React.KeyboardEvent<HTMLInputElement | HTMLTextAreaElement>) => {\n if (event.key === \"Enter\") {\n onPaginationChange({\n pageIndex: page,\n pageSize: parseInt(event.currentTarget.value),\n });\n }\n },\n [page, onPaginationChange],\n );\n\n const setPageFromEvent = useCallback(\n (event: React.ChangeEvent<HTMLInputElement>) => {\n const value = maxPageIndex\n ? Math.min(parseInt(event.target.value), maxPageIndex)\n : parseInt(event.target.value);\n setPage(value);\n },\n [setPage, maxPageIndex],\n );\n\n const setRowsPerPageFromEvent = useCallback(\n (event: React.ChangeEvent<HTMLInputElement>) => {\n const value = maxPageSize\n ? Math.min(parseInt(event.target.value), maxPageSize)\n : parseInt(event.target.value);\n\n // Ensure the value can't be less than 1\n setRowsPerPage(Math.max(1, value));\n },\n [setRowsPerPage, maxPageSize],\n );\n\n const handleLoadMore = useCallback(() => {\n onPaginationChange({\n pageIndex: 1,\n pageSize: rowsPerPage + initialRowsPerPage.current,\n });\n }, [rowsPerPage, onPaginationChange]);\n\n const handleNextButton = useCallback(() => {\n onPaginationChange({ pageIndex: page + 1, pageSize: rowsPerPage });\n }, [onPaginationChange, page, rowsPerPage]);\n\n const handlePreviousButton = useCallback(() => {\n onPaginationChange({ pageIndex: page - 1, pageSize: rowsPerPage });\n }, [onPaginationChange, page, rowsPerPage]);\n\n const loadMoreIsDisabled = useMemo(() => {\n return isMoreDisabled || (totalRows ? rowsPerPage >= totalRows : false);\n }, [isMoreDisabled, rowsPerPage, totalRows]);\n\n const nextButtonDisabled = useMemo(\n () =>\n isMoreDisabled ||\n (lastRow && (totalRows ? lastRow >= totalRows : false)) ||\n isDisabled,\n [isMoreDisabled, totalRows, lastRow, isDisabled],\n );\n\n const previousButtonDisabled = useMemo(\n () => pageIndex <= 1 || isDisabled,\n [pageIndex, isDisabled],\n );\n\n const rowsPerPageInputProps = useMemo(\n () => ({\n \"aria-label\": rowsPerPageLabel,\n max: maxPageSize || totalRows,\n }),\n [maxPageSize, rowsPerPageLabel, totalRows],\n );\n\n const currentPageInputProps = useMemo(\n () => ({\n \"aria-label\": currentPageLabel,\n max: maxPageIndex,\n }),\n [currentPageLabel, maxPageIndex],\n );\n\n return variant === \"paged\" ? (\n <PaginationContainer aria-label={t(\"pagination.label\")}>\n <PaginationSegment odysseyDesignTokens={odysseyDesignTokens}>\n {hasRowCountInput && (\n <Box>\n <Paragraph component=\"span\" color=\"textSecondary\">\n {rowsPerPageLabel}\n </Paragraph>\n <PaginationInput\n odysseyDesignTokens={odysseyDesignTokens}\n type=\"number\"\n value={rowsPerPage}\n onChange={setRowsPerPageFromEvent}\n onBlur={handlePaginationChange}\n onKeyDown={handleRowsPerPageSubmit}\n disabled={isDisabled}\n inputProps={rowsPerPageInputProps}\n />\n </Box>\n )}\n {hasRowCountLabel && (\n <Paragraph component=\"span\" color=\"textSecondary\">\n {totalRowsLabel}\n </Paragraph>\n )}\n </PaginationSegment>\n\n <PaginationSegment odysseyDesignTokens={odysseyDesignTokens}>\n {totalRows && hasPageInput && (\n <Box>\n <Paragraph component=\"span\" color=\"textSecondary\">\n {currentPageLabel}\n </Paragraph>\n <PaginationInput\n odysseyDesignTokens={odysseyDesignTokens}\n type=\"number\"\n value={page}\n onChange={setPageFromEvent}\n onBlur={handlePaginationChange}\n onKeyDown={handlePageSubmit}\n disabled={isDisabled}\n inputProps={currentPageInputProps}\n />\n </Box>\n )}\n <PaginationButtonContainer>\n <Button\n startIcon={<ArrowLeftIcon />}\n variant=\"floating\"\n size=\"small\"\n ariaLabel={previousLabel}\n onClick={handlePreviousButton}\n isDisabled={previousButtonDisabled}\n />\n <Button\n endIcon={<ArrowRightIcon />}\n variant=\"floating\"\n size=\"small\"\n ariaLabel={nextLabel}\n onClick={handleNextButton}\n isDisabled={nextButtonDisabled}\n />\n </PaginationButtonContainer>\n </PaginationSegment>\n </PaginationContainer>\n ) : (\n <Button\n variant=\"secondary\"\n label={loadMoreLabel}\n onClick={handleLoadMore}\n isDisabled={loadMoreIsDisabled}\n />\n );\n};\n\nconst MemoizedPagination = memo(Pagination);\nMemoizedPagination.displayName = \"Pagination\";\n\nexport { MemoizedPagination as Pagination };\n"],"mappings":";AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,OAAOA,MAAM,MAAM,iBAAiB;AAEpC,SAASC,IAAI,EAAEC,WAAW,EAAEC,SA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,cAAe;IACxB3C,UAAU,EAAE+C;EAAmB,CAChC,CACF;AACH,CAAC;AAED,MAAMoB,kBAAkB,GAAGpH,IAAI,CAAC0C,UAAU,CAAC;AAC3C0E,kBAAkB,CAACC,WAAW,GAAG,YAAY;AAE7C,SAASD,kBAAkB,IAAI1E,UAAU","ignoreList":[]}
@@ -0,0 +1,15 @@
1
+ /*!
2
+ * Copyright (c) 2025-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
+ */export const addSpecificity = (specificityCount, selector) => {
12
+ const ampersands = "&".repeat(specificityCount);
13
+ return `${ampersands}${selector}`;
14
+ };
15
+ //# sourceMappingURL=addSpecificity.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"addSpecificity.js","names":["addSpecificity","specificityCount","selector","ampersands","repeat"],"sources":["../../src/addSpecificity.ts"],"sourcesContent":["/*!\n * Copyright (c) 2025-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *\n * See the License for the specific language governing permissions and limitations under the License.\n */\n\n/**\n * Adds CSS specificity to class selectors by prepending a specified number of ampersands.\n * This function helps override MUI component styles by increasing selector specificity.\n *\n * @param {number} specificityCount - Number of ampersands to prepend (e.g., 2 results in \"&&\")\n * @param {string} selector - The selector string to add specificity to.\n * Include spaces in the selector if needed for descendant selectors.\n * @returns {string} The selector with added specificity\n *\n * @example\n * // Direct selector: \"&&.MuiButton-root\"\n * addSpecificity(2, \".MuiButton-root\")\n *\n * // Descendant selector: \"&& .MuiButton-root\"\n * addSpecificity(2, \" .MuiButton-root\")\n *\n * // Direct selector with class reference:\n * addSpecificity(2, `.${buttonClasses.root}`)\n *\n * // Descendant selector with class reference:\n * addSpecificity(2, ` .${buttonClasses.root}`)\n *\n * // Combined selector: \"&&.MuiButton-root:hover\"\n * addSpecificity(2, \".MuiButton-root:hover\")\n */\nexport const addSpecificity = (\n specificityCount: number,\n selector: string,\n): string => {\n const ampersands = \"&\".repeat(specificityCount);\n return `${ampersands}${selector}`;\n};\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GA2BA,OAAO,MAAMA,cAAc,GAAGA,CAC5BC,gBAAwB,EACxBC,QAAgB,KACL;EACX,MAAMC,UAAU,GAAG,GAAG,CAACC,MAAM,CAACH,gBAAgB,CAAC;EAC/C,OAAO,GAAGE,UAAU,GAAGD,QAAQ,EAAE;AACnC,CAAC","ignoreList":[]}
@@ -24,18 +24,20 @@ import { dateTimePickerTheme } from "./dateTimePickerTheme.js";
24
24
  import { CalendarIcon, ClockIcon } from "../../icons.generated/index.js";
25
25
  import { useOdysseyDesignTokens } from "../../OdysseyDesignTokensContext.js";
26
26
  import { OdysseyThemeProvider } from "../../OdysseyThemeProvider.js";
27
+ import { pxToRem } from "../../theme/index.js";
27
28
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
29
+ export const DateTimePickerSize = {
30
+ maxWidth: `${pxToRem(486)}rem`
31
+ };
28
32
  const DatePickerContainer = styled.div({
29
33
  ".MuiFormControl-root": {
30
34
  marginBlockEnd: 0
31
35
  }
32
36
  });
33
- const DatePickerWidthContainer = styled.div(({
34
- odysseyDesignTokens
35
- }) => ({
37
+ const DatePickerWidthContainer = styled.div(() => ({
36
38
  ".MuiInput-root": {
37
39
  width: "100%",
38
- maxWidth: odysseyDesignTokens.TypographyLineLengthMax
40
+ maxWidth: DateTimePickerSize.maxWidth
39
41
  }
40
42
  }));
41
43
  const TimeZonePickerContainer = styled("div", {
@@ -1 +1 @@
1
- {"version":3,"file":"DateTimePicker.js","names":["memo","useCallback","useEffect","useMemo","useRef","useTranslation","DateTimePicker","MuiDateTimePicker","styled","Button","DateFieldActionBar","DateFieldLocalizationProvider","TimeZonePicker","useOdysseyDateFields","DateTimeField","dateTimePickerTheme","CalendarIcon","ClockIcon","useOdysseyDesignTokens","OdysseyThemeProvider","jsx","_jsx","jsxs","_jsxs","DatePickerContainer","div","marginBlockEnd","DatePickerWidthContainer","odysseyDesignTokens","width","maxWidth","TypographyLineLengthMax","TimeZonePickerContainer","shouldForwardProp","prop","marginBlockStart","Spacing3","defaultValue","defaultValueProp","errorMessage","hint","HintLinkComponent","isDateEnabled","isDisabled","isOptional","isReadOnly","isMonthEnabled","isYearEnabled","label","minDate","minDateProp","maxDate","maxDateProp","onBlur","onCalendarDateChange","onInputChange","onInputChangeProp","timeZone","timeZonePickerLabel","timeZoneOptions","value","valueProp","i18n","t","inputRef","closeCalendar","commonIcons","defaultedLanguageCode","formatDateTimeToUtcIsoDateString","formatDayOfWeek","inputValues","internalTimeZone","isOpen","localeText","onTimeZoneChange","popperElement","setPopperElement","shouldDisableDate","shouldDisableMonth","shouldDisableYear","toggleCalendarVisibility","language","containerRef","current","formatDateTimeToJsDateStringOnCalendarSelection","dateStringFromDateTime","renderDateTimeField","endAdornment","ariaLabel","onClick","size","startIcon","variant","onChange","timezone","slots","actionBar","field","muiProps","leftArrowIcon","ArrowLeftIcon","rightArrowIcon","ArrowRightIcon","switchViewIcon","ChevronDownIcon","slotProps","wrapperVariant","onAccept","onCancel","actions","popper","anchorEl","tabs","dateIcon","timeIcon","toolbar","toolbarPlaceholder","themeOverride","children","ref","dayOfWeekFormatter","disabled","fixedWeekNumber","onClose","open","readOnly","MemoizedDateTimePicker","displayName"],"sources":["../../../../src/labs/DatePickers/DateTimePicker.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 { memo, useCallback, useEffect, useMemo, useRef } from \"react\";\nimport { useTranslation } from \"react-i18next\";\nimport {\n type DateTimePickerSlots,\n DateTimePicker as MuiDateTimePicker,\n DateTimePickerProps as MuiDateTimePickerProps,\n DateTimePickerSlotProps,\n} from \"@mui/x-date-pickers\";\nimport { DateTime } from \"luxon\";\nimport styled from \"@emotion/styled\";\n\nimport { Button } from \"../../Buttons/index.js\";\nimport { DateFieldActionBar } from \"../../DatePickers/DateFieldActionBar.js\";\nimport { DateFieldLocalizationProvider } from \"../../DatePickers/DateFieldLocalizationProvider.js\";\nimport { TimeZonePicker } from \"../../DatePickers/TimeZonePicker.js\";\nimport {\n useOdysseyDateFields,\n OdysseyDateFieldProps,\n} from \"../../DatePickers/useOdysseyDateFields.js\";\nimport { DateTimeField, DateTimeFieldProps } from \"./DateTimeField.js\";\nimport { dateTimePickerTheme } from \"./dateTimePickerTheme.js\";\nimport { FieldComponentProps } from \"../../FieldComponentProps.js\";\nimport { CalendarIcon, ClockIcon } from \"../../icons.generated/index.js\";\nimport {\n useOdysseyDesignTokens,\n DesignTokens,\n} from \"../../OdysseyDesignTokensContext.js\";\nimport { OdysseyThemeProvider } from \"../../OdysseyThemeProvider.js\";\n\nconst DatePickerContainer = styled.div({\n \".MuiFormControl-root\": {\n marginBlockEnd: 0,\n },\n});\n\nconst DatePickerWidthContainer = styled.div<{\n odysseyDesignTokens: DesignTokens;\n}>(({ odysseyDesignTokens }) => ({\n \".MuiInput-root\": {\n width: \"100%\",\n maxWidth: odysseyDesignTokens.TypographyLineLengthMax,\n },\n}));\n\nconst TimeZonePickerContainer = styled(\"div\", {\n shouldForwardProp: (prop) => prop !== \"odysseyDesignTokens\",\n})<{ odysseyDesignTokens: DesignTokens }>(({ odysseyDesignTokens }) => ({\n marginBlockStart: odysseyDesignTokens.Spacing3,\n}));\n\ntype RenderDateTimeFieldProps = {\n defaultValue: DateTimeFieldProps[\"defaultValue\"];\n value: DateTimeFieldProps[\"value\"];\n} & MuiDateTimePickerProps<DateTime>;\n\nexport type DateTimePickerProps = OdysseyDateFieldProps &\n Pick<\n FieldComponentProps,\n | \"errorMessage\"\n | \"hint\"\n | \"HintLinkComponent\"\n | \"isDisabled\"\n | \"isReadOnly\"\n | \"isOptional\"\n >;\n\nconst DateTimePicker = ({\n defaultValue: defaultValueProp,\n errorMessage,\n hint,\n HintLinkComponent,\n isDateEnabled = () => true,\n isDisabled,\n isOptional,\n isReadOnly,\n isMonthEnabled = () => true,\n isYearEnabled = () => true,\n label,\n minDate: minDateProp,\n maxDate: maxDateProp,\n onBlur,\n onCalendarDateChange,\n onInputChange: onInputChangeProp,\n timeZone,\n timeZonePickerLabel,\n timeZoneOptions,\n value: valueProp,\n}: DateTimePickerProps) => {\n const { i18n, t } = useTranslation();\n const inputRef = useRef<HTMLInputElement>(null);\n const odysseyDesignTokens = useOdysseyDesignTokens();\n\n const {\n closeCalendar,\n commonIcons,\n defaultedLanguageCode,\n formatDateTimeToUtcIsoDateString,\n formatDayOfWeek,\n inputValues,\n internalTimeZone,\n isOpen,\n localeText,\n minDate,\n maxDate,\n onInputChange,\n onTimeZoneChange,\n popperElement,\n setPopperElement,\n shouldDisableDate,\n shouldDisableMonth,\n shouldDisableYear,\n toggleCalendarVisibility,\n } = useOdysseyDateFields({\n defaultValue: defaultValueProp,\n errorMessage,\n isDateEnabled,\n isMonthEnabled,\n isYearEnabled,\n minDate: minDateProp,\n maxDate: maxDateProp,\n onInputChange: onInputChangeProp,\n timeZone,\n value: valueProp,\n });\n\n const { language } = i18n;\n const containerRef = useRef<HTMLInputElement>(null);\n\n useEffect(() => {\n setPopperElement(containerRef.current);\n }, [setPopperElement]);\n\n const formatDateTimeToJsDateStringOnCalendarSelection = useCallback<\n NonNullable<MuiDateTimePickerProps<DateTime>[\"onChange\"]>\n >(\n (value) => {\n if (value) {\n const dateStringFromDateTime = formatDateTimeToUtcIsoDateString(value);\n\n if (dateStringFromDateTime) {\n onCalendarDateChange?.({\n value: dateStringFromDateTime,\n timeZone: internalTimeZone,\n });\n }\n }\n },\n [formatDateTimeToUtcIsoDateString, internalTimeZone, onCalendarDateChange],\n );\n\n const renderDateTimeField = useCallback(\n ({ defaultValue, inputRef, value }: RenderDateTimeFieldProps) => {\n return (\n <DateTimeField\n defaultValue={defaultValue}\n endAdornment={\n <Button\n ariaLabel={t(\"picker.labels.date.choose\")}\n label=\"\"\n onClick={toggleCalendarVisibility}\n size=\"small\"\n startIcon={<commonIcons.CalendarIcon />}\n variant=\"floating\"\n />\n }\n errorMessage={errorMessage}\n hint={hint}\n HintLinkComponent={HintLinkComponent}\n inputRef={inputRef}\n isDisabled={isDisabled}\n isOptional={isOptional}\n isReadOnly={isReadOnly}\n label={label}\n onBlur={onBlur}\n minDate={minDate}\n maxDate={maxDate}\n onChange={onInputChange}\n timezone={internalTimeZone}\n value={value}\n />\n );\n },\n [\n commonIcons,\n errorMessage,\n hint,\n HintLinkComponent,\n internalTimeZone,\n isDisabled,\n isOptional,\n isReadOnly,\n label,\n onBlur,\n onInputChange,\n minDate,\n maxDate,\n t,\n toggleCalendarVisibility,\n ],\n );\n\n const slots = useMemo<DateTimePickerSlots<DateTime>>(\n () => ({\n actionBar: DateFieldActionBar,\n field: (muiProps: RenderDateTimeFieldProps) =>\n renderDateTimeField(muiProps),\n leftArrowIcon: () => <commonIcons.ArrowLeftIcon />,\n rightArrowIcon: () => <commonIcons.ArrowRightIcon />,\n switchViewIcon: () => <commonIcons.ChevronDownIcon />,\n }),\n [commonIcons, renderDateTimeField],\n );\n\n const slotProps = useMemo<DateTimePickerSlotProps<DateTime, false>>(\n () => ({\n actionBar: ({ wrapperVariant, onAccept, onCancel }) => ({\n actions:\n // This is the default behavior but felt more clear to pass them in explicitly\n wrapperVariant === \"desktop\" ? [] : [\"accept\", \"cancel\"],\n onAccept,\n onCancel,\n }),\n popper: {\n anchorEl: popperElement,\n },\n tabs: {\n dateIcon: <CalendarIcon />,\n timeIcon: <ClockIcon />,\n },\n toolbar: {\n toolbarPlaceholder: \"\",\n },\n }),\n [popperElement],\n );\n\n return (\n <OdysseyThemeProvider themeOverride={dateTimePickerTheme}>\n <DateFieldLocalizationProvider\n defaultedLanguageCode={defaultedLanguageCode}\n localeText={localeText}\n >\n <DatePickerContainer>\n <DatePickerWidthContainer\n odysseyDesignTokens={odysseyDesignTokens}\n ref={containerRef}\n >\n <MuiDateTimePicker\n dayOfWeekFormatter={formatDayOfWeek}\n defaultValue={inputValues?.defaultValue}\n disabled={isDisabled}\n fixedWeekNumber={6}\n inputRef={inputRef}\n key={language}\n label={label}\n minDate={minDate}\n maxDate={maxDate}\n onChange={formatDateTimeToJsDateStringOnCalendarSelection}\n onClose={closeCalendar}\n open={isOpen}\n readOnly={isReadOnly}\n shouldDisableDate={shouldDisableDate}\n shouldDisableMonth={shouldDisableMonth}\n shouldDisableYear={shouldDisableYear}\n slots={slots}\n slotProps={slotProps}\n timezone={internalTimeZone}\n value={inputValues?.value}\n />\n </DatePickerWidthContainer>\n </DatePickerContainer>\n\n {timeZoneOptions && timeZonePickerLabel && (\n <TimeZonePickerContainer odysseyDesignTokens={odysseyDesignTokens}>\n <TimeZonePicker\n label={timeZonePickerLabel}\n onTimeZoneChange={onTimeZoneChange}\n isReadOnly={isReadOnly}\n timeZoneOptions={timeZoneOptions}\n value={internalTimeZone}\n />\n </TimeZonePickerContainer>\n )}\n </DateFieldLocalizationProvider>\n </OdysseyThemeProvider>\n );\n};\n\nconst MemoizedDateTimePicker = memo(DateTimePicker);\nMemoizedDateTimePicker.displayName = \"DateTimePicker\";\n\nexport { MemoizedDateTimePicker as DateTimePicker };\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,IAAI,EAAEC,WAAW,EAAEC,SAAS,EAAEC,OAAO,EAAEC,MAAM,QAAQ,OAAO;AACrE,SAASC,cAAc,QAAQ,eAAe;AAC9C,SAEEC,cAAc,IAAIC,iBAAiB,QAG9B,qBAAqB;AAE5B,OAAOC,MAAM,MAAM,iBAAiB;AAEpC,SAASC,MAAM,QAAQ,wBAAwB;AAC/C,SAASC,kBAAkB,QAAQ,yCAAyC;AAC5E,SAASC,6BAA6B,QAAQ,oDAAoD;AAClG,SAASC,cAAc,QAAQ,qCAAqC;AACpE,SACEC,oBAAoB,QAEf,2CAA2C;AAClD,SAASC,aAAa,QAA4B,oBAAoB;AACtE,SAASC,mBAAmB,QAAQ,0BAA0B;AAE9D,SAASC,YAAY,EAAEC,SAAS,QAAQ,gCAAgC;AACxE,SACEC,sBAAsB,QAEjB,qCAAqC;AAC5C,SAASC,oBAAoB,QAAQ,+BAA+B;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAErE,MAAMC,mBAAmB,GAAGhB,MAAM,CAACiB,GAAG,CAAC;EACrC,sBAAsB,EAAE;IACtBC,cAAc,EAAE;EAClB;AACF,CAAC,CAAC;AAEF,MAAMC,wBAAwB,GAAGnB,MAAM,CAACiB,GAAG,CAExC,CAAC;EAAEG;AAAoB,CAAC,MAAM;EAC/B,gBAAgB,EAAE;IAChBC,KAAK,EAAE,MAAM;IACbC,QAAQ,EAAEF,mBAAmB,CAACG;EAChC;AACF,CAAC,CAAC,CAAC;AAEH,MAAMC,uBAAuB,GAAGxB,MAAM,CAAC,KAAK,EAAE;EAC5CyB,iBAAiB,EAAGC,IAAI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AA,CAACW,uBAAuB;QAACJ,mBAAmB,EAAEA,mBAAoB;QAAA0F,QAAA,EAChEjG,IAAA,CAACT,cAAc;UACboC,KAAK,EAAEU,mBAAoB;UAC3BgB,gBAAgB,EAAEA,gBAAiB;UACnC7B,UAAU,EAAEA,UAAW;UACvBc,eAAe,EAAEA,eAAgB;UACjCC,KAAK,EAAEW;QAAiB,CACzB;MAAC,CACqB,CAC1B;IAAA,CAC4B;EAAC,CACZ,CAAC;AAE3B,CAAC;AAED,MAAMuD,sBAAsB,GAAG9H,IAAI,CAACM,cAAc,CAAC;AACnDwH,sBAAsB,CAACC,WAAW,GAAG,gBAAgB;AAErD,SAASD,sBAAsB,IAAIxH,cAAc","ignoreList":[]}
1
+ {"version":3,"file":"DateTimePicker.js","names":["memo","useCallback","useEffect","useMemo","useRef","useTranslation","DateTimePicker","MuiDateTimePicker","styled","Button","DateFieldActionBar","DateFieldLocalizationProvider","TimeZonePicker","useOdysseyDateFields","DateTimeField","dateTimePickerTheme","CalendarIcon","ClockIcon","useOdysseyDesignTokens","OdysseyThemeProvider","pxToRem","jsx","_jsx","jsxs","_jsxs","DateTimePickerSize","maxWidth","DatePickerContainer","div","marginBlockEnd","DatePickerWidthContainer","width","TimeZonePickerContainer","shouldForwardProp","prop","odysseyDesignTokens","marginBlockStart","Spacing3","defaultValue","defaultValueProp","errorMessage","hint","HintLinkComponent","isDateEnabled","isDisabled","isOptional","isReadOnly","isMonthEnabled","isYearEnabled","label","minDate","minDateProp","maxDate","maxDateProp","onBlur","onCalendarDateChange","onInputChange","onInputChangeProp","timeZone","timeZonePickerLabel","timeZoneOptions","value","valueProp","i18n","t","inputRef","closeCalendar","commonIcons","defaultedLanguageCode","formatDateTimeToUtcIsoDateString","formatDayOfWeek","inputValues","internalTimeZone","isOpen","localeText","onTimeZoneChange","popperElement","setPopperElement","shouldDisableDate","shouldDisableMonth","shouldDisableYear","toggleCalendarVisibility","language","containerRef","current","formatDateTimeToJsDateStringOnCalendarSelection","dateStringFromDateTime","renderDateTimeField","endAdornment","ariaLabel","onClick","size","startIcon","variant","onChange","timezone","slots","actionBar","field","muiProps","leftArrowIcon","ArrowLeftIcon","rightArrowIcon","ArrowRightIcon","switchViewIcon","ChevronDownIcon","slotProps","wrapperVariant","onAccept","onCancel","actions","popper","anchorEl","tabs","dateIcon","timeIcon","toolbar","toolbarPlaceholder","themeOverride","children","ref","dayOfWeekFormatter","disabled","fixedWeekNumber","onClose","open","readOnly","MemoizedDateTimePicker","displayName"],"sources":["../../../../src/labs/DatePickers/DateTimePicker.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 { memo, useCallback, useEffect, useMemo, useRef } from \"react\";\nimport { useTranslation } from \"react-i18next\";\nimport {\n type DateTimePickerSlots,\n DateTimePicker as MuiDateTimePicker,\n DateTimePickerProps as MuiDateTimePickerProps,\n DateTimePickerSlotProps,\n} from \"@mui/x-date-pickers\";\nimport { DateTime } from \"luxon\";\nimport styled from \"@emotion/styled\";\n\nimport { Button } from \"../../Buttons/index.js\";\nimport { DateFieldActionBar } from \"../../DatePickers/DateFieldActionBar.js\";\nimport { DateFieldLocalizationProvider } from \"../../DatePickers/DateFieldLocalizationProvider.js\";\nimport { TimeZonePicker } from \"../../DatePickers/TimeZonePicker.js\";\nimport {\n useOdysseyDateFields,\n OdysseyDateFieldProps,\n} from \"../../DatePickers/useOdysseyDateFields.js\";\nimport { DateTimeField, DateTimeFieldProps } from \"./DateTimeField.js\";\nimport { dateTimePickerTheme } from \"./dateTimePickerTheme.js\";\nimport { FieldComponentProps } from \"../../FieldComponentProps.js\";\nimport { CalendarIcon, ClockIcon } from \"../../icons.generated/index.js\";\nimport {\n useOdysseyDesignTokens,\n DesignTokens,\n} from \"../../OdysseyDesignTokensContext.js\";\nimport { OdysseyThemeProvider } from \"../../OdysseyThemeProvider.js\";\nimport { pxToRem } from \"../../theme/index.js\";\n\nexport const DateTimePickerSize = {\n maxWidth: `${pxToRem(486)}rem`,\n};\n\nconst DatePickerContainer = styled.div({\n \".MuiFormControl-root\": {\n marginBlockEnd: 0,\n },\n});\n\nconst DatePickerWidthContainer = styled.div<{\n odysseyDesignTokens: DesignTokens;\n}>(() => ({\n \".MuiInput-root\": {\n width: \"100%\",\n maxWidth: DateTimePickerSize.maxWidth,\n },\n}));\n\nconst TimeZonePickerContainer = styled(\"div\", {\n shouldForwardProp: (prop) => prop !== \"odysseyDesignTokens\",\n})<{ odysseyDesignTokens: DesignTokens }>(({ odysseyDesignTokens }) => ({\n marginBlockStart: odysseyDesignTokens.Spacing3,\n}));\n\ntype RenderDateTimeFieldProps = {\n defaultValue: DateTimeFieldProps[\"defaultValue\"];\n value: DateTimeFieldProps[\"value\"];\n} & MuiDateTimePickerProps<DateTime>;\n\nexport type DateTimePickerProps = OdysseyDateFieldProps &\n Pick<\n FieldComponentProps,\n | \"errorMessage\"\n | \"hint\"\n | \"HintLinkComponent\"\n | \"isDisabled\"\n | \"isReadOnly\"\n | \"isOptional\"\n >;\n\nconst DateTimePicker = ({\n defaultValue: defaultValueProp,\n errorMessage,\n hint,\n HintLinkComponent,\n isDateEnabled = () => true,\n isDisabled,\n isOptional,\n isReadOnly,\n isMonthEnabled = () => true,\n isYearEnabled = () => true,\n label,\n minDate: minDateProp,\n maxDate: maxDateProp,\n onBlur,\n onCalendarDateChange,\n onInputChange: onInputChangeProp,\n timeZone,\n timeZonePickerLabel,\n timeZoneOptions,\n value: valueProp,\n}: DateTimePickerProps) => {\n const { i18n, t } = useTranslation();\n const inputRef = useRef<HTMLInputElement>(null);\n const odysseyDesignTokens = useOdysseyDesignTokens();\n\n const {\n closeCalendar,\n commonIcons,\n defaultedLanguageCode,\n formatDateTimeToUtcIsoDateString,\n formatDayOfWeek,\n inputValues,\n internalTimeZone,\n isOpen,\n localeText,\n minDate,\n maxDate,\n onInputChange,\n onTimeZoneChange,\n popperElement,\n setPopperElement,\n shouldDisableDate,\n shouldDisableMonth,\n shouldDisableYear,\n toggleCalendarVisibility,\n } = useOdysseyDateFields({\n defaultValue: defaultValueProp,\n errorMessage,\n isDateEnabled,\n isMonthEnabled,\n isYearEnabled,\n minDate: minDateProp,\n maxDate: maxDateProp,\n onInputChange: onInputChangeProp,\n timeZone,\n value: valueProp,\n });\n\n const { language } = i18n;\n const containerRef = useRef<HTMLInputElement>(null);\n\n useEffect(() => {\n setPopperElement(containerRef.current);\n }, [setPopperElement]);\n\n const formatDateTimeToJsDateStringOnCalendarSelection = useCallback<\n NonNullable<MuiDateTimePickerProps<DateTime>[\"onChange\"]>\n >(\n (value) => {\n if (value) {\n const dateStringFromDateTime = formatDateTimeToUtcIsoDateString(value);\n\n if (dateStringFromDateTime) {\n onCalendarDateChange?.({\n value: dateStringFromDateTime,\n timeZone: internalTimeZone,\n });\n }\n }\n },\n [formatDateTimeToUtcIsoDateString, internalTimeZone, onCalendarDateChange],\n );\n\n const renderDateTimeField = useCallback(\n ({ defaultValue, inputRef, value }: RenderDateTimeFieldProps) => {\n return (\n <DateTimeField\n defaultValue={defaultValue}\n endAdornment={\n <Button\n ariaLabel={t(\"picker.labels.date.choose\")}\n label=\"\"\n onClick={toggleCalendarVisibility}\n size=\"small\"\n startIcon={<commonIcons.CalendarIcon />}\n variant=\"floating\"\n />\n }\n errorMessage={errorMessage}\n hint={hint}\n HintLinkComponent={HintLinkComponent}\n inputRef={inputRef}\n isDisabled={isDisabled}\n isOptional={isOptional}\n isReadOnly={isReadOnly}\n label={label}\n onBlur={onBlur}\n minDate={minDate}\n maxDate={maxDate}\n onChange={onInputChange}\n timezone={internalTimeZone}\n value={value}\n />\n );\n },\n [\n commonIcons,\n errorMessage,\n hint,\n HintLinkComponent,\n internalTimeZone,\n isDisabled,\n isOptional,\n isReadOnly,\n label,\n onBlur,\n onInputChange,\n minDate,\n maxDate,\n t,\n toggleCalendarVisibility,\n ],\n );\n\n const slots = useMemo<DateTimePickerSlots<DateTime>>(\n () => ({\n actionBar: DateFieldActionBar,\n field: (muiProps: RenderDateTimeFieldProps) =>\n renderDateTimeField(muiProps),\n leftArrowIcon: () => <commonIcons.ArrowLeftIcon />,\n rightArrowIcon: () => <commonIcons.ArrowRightIcon />,\n switchViewIcon: () => <commonIcons.ChevronDownIcon />,\n }),\n [commonIcons, renderDateTimeField],\n );\n\n const slotProps = useMemo<DateTimePickerSlotProps<DateTime, false>>(\n () => ({\n actionBar: ({ wrapperVariant, onAccept, onCancel }) => ({\n actions:\n // This is the default behavior but felt more clear to pass them in explicitly\n wrapperVariant === \"desktop\" ? [] : [\"accept\", \"cancel\"],\n onAccept,\n onCancel,\n }),\n popper: {\n anchorEl: popperElement,\n },\n tabs: {\n dateIcon: <CalendarIcon />,\n timeIcon: <ClockIcon />,\n },\n toolbar: {\n toolbarPlaceholder: \"\",\n },\n }),\n [popperElement],\n );\n\n return (\n <OdysseyThemeProvider themeOverride={dateTimePickerTheme}>\n <DateFieldLocalizationProvider\n defaultedLanguageCode={defaultedLanguageCode}\n localeText={localeText}\n >\n <DatePickerContainer>\n <DatePickerWidthContainer\n odysseyDesignTokens={odysseyDesignTokens}\n ref={containerRef}\n >\n <MuiDateTimePicker\n dayOfWeekFormatter={formatDayOfWeek}\n defaultValue={inputValues?.defaultValue}\n disabled={isDisabled}\n fixedWeekNumber={6}\n inputRef={inputRef}\n key={language}\n label={label}\n minDate={minDate}\n maxDate={maxDate}\n onChange={formatDateTimeToJsDateStringOnCalendarSelection}\n onClose={closeCalendar}\n open={isOpen}\n readOnly={isReadOnly}\n shouldDisableDate={shouldDisableDate}\n shouldDisableMonth={shouldDisableMonth}\n shouldDisableYear={shouldDisableYear}\n slots={slots}\n slotProps={slotProps}\n timezone={internalTimeZone}\n value={inputValues?.value}\n />\n </DatePickerWidthContainer>\n </DatePickerContainer>\n\n {timeZoneOptions && timeZonePickerLabel && (\n <TimeZonePickerContainer odysseyDesignTokens={odysseyDesignTokens}>\n <TimeZonePicker\n label={timeZonePickerLabel}\n onTimeZoneChange={onTimeZoneChange}\n isReadOnly={isReadOnly}\n timeZoneOptions={timeZoneOptions}\n value={internalTimeZone}\n />\n </TimeZonePickerContainer>\n )}\n </DateFieldLocalizationProvider>\n </OdysseyThemeProvider>\n );\n};\n\nconst MemoizedDateTimePicker = memo(DateTimePicker);\nMemoizedDateTimePicker.displayName = \"DateTimePicker\";\n\nexport { MemoizedDateTimePicker as DateTimePicker };\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,IAAI,EAAEC,WAAW,EAAEC,SAAS,EAAEC,OAAO,EAAEC,MAAM,QAAQ,OAAO;AACrE,SAASC,cAAc,QAAQ,eAAe;AAC9C,SAEEC,cAAc,IAAIC,iBAAiB,QAG9B,qBAAqB;AAE5B,OAAOC,MAAM,MAAM,iBAAiB;AAEpC,SAASC,MAAM,QAAQ,wBAAwB;AAC/C,SAASC,kBAAkB,QAAQ,yCAAyC;AAC5E,SAASC,6BAA6B,QAAQ,oDAAoD;AAClG,SAASC,cAAc,QAAQ,qCAAqC;AACpE,SACEC,oBAAoB,QAEf,2CAA2C;AAClD,SAASC,aAAa,QAA4B,oBAAoB;AACtE,SAASC,mBAAmB,QAAQ,0BAA0B;AAE9D,SAASC,YAAY,EAAEC,SAAS,QAAQ,gCAAgC;AACxE,SACEC,sBAAsB,QAEjB,qCAAqC;AAC5C,SAASC,oBAAoB,QAAQ,+BAA+B;AACpE,SAASC,OAAO,QAAQ,sBAAsB;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAE/C,OAAO,MAAMC,kB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AAO,EAAEA,OAAQ;YACjB0C,QAAQ,EAAET,+CAAgD;YAC1DuC,OAAO,EAAE1D,aAAc;YACvB2D,IAAI,EAAEpD,MAAO;YACbqD,QAAQ,EAAEhF,UAAW;YACrBgC,iBAAiB,EAAEA,iBAAkB;YACrCC,kBAAkB,EAAEA,kBAAmB;YACvCC,iBAAiB,EAAEA,iBAAkB;YACrCgB,KAAK,EAAEA,KAAM;YACbU,SAAS,EAAEA,SAAU;YACrBX,QAAQ,EAAEvB,gBAAiB;YAC3BX,KAAK,EAAEU,WAAW,EAAEV;UAAM,GAdrBqB,QAeN;QAAC,CACsB;MAAC,CACR,CAAC,EAErBtB,eAAe,IAAID,mBAAmB,IACrCrC,IAAA,CAACU,uBAAuB;QAACG,mBAAmB,EAAEA,mBAAoB;QAAAoF,QAAA,EAChEjG,IAAA,CAACV,cAAc;UACbqC,KAAK,EAAEU,mBAAoB;UAC3BgB,gBAAgB,EAAEA,gBAAiB;UACnC7B,UAAU,EAAEA,UAAW;UACvBc,eAAe,EAAEA,eAAgB;UACjCC,KAAK,EAAEW;QAAiB,CACzB;MAAC,CACqB,CAC1B;IAAA,CAC4B;EAAC,CACZ,CAAC;AAE3B,CAAC;AAED,MAAMuD,sBAAsB,GAAG/H,IAAI,CAACM,cAAc,CAAC;AACnDyH,sBAAsB,CAACC,WAAW,GAAG,gBAAgB;AAErD,SAASD,sBAAsB,IAAIzH,cAAc","ignoreList":[]}
@@ -9,7 +9,16 @@
9
9
  *
10
10
  * See the License for the specific language governing permissions and limitations under the License.
11
11
  */import { deepmerge } from "@mui/utils";
12
+ import { digitalClockClasses } from "@mui/x-date-pickers/DigitalClock";
13
+ import { multiSectionDigitalClockSectionClasses, multiSectionDigitalClockClasses } from "@mui/x-date-pickers/MultiSectionDigitalClock";
12
14
  import { datePickerTheme, dateStyles } from "../../DatePickers/datePickerTheme.js";
15
+ import { DateTimePickerSize } from "./DateTimePicker.js";
16
+ import { pxToRem } from "../../theme/index.js";
17
+ import { addSpecificity } from "../../addSpecificity.js";
18
+ const DateTimePickerComponentSize = {
19
+ dateCalendarMaxHeight: `${pxToRem(336)}rem`,
20
+ slideTransitionMinHeight: `${pxToRem(240)}rem`
21
+ };
13
22
  const theme = {
14
23
  components: {
15
24
  MuiClock: {
@@ -47,7 +56,9 @@ const theme = {
47
56
  styleOverrides: {
48
57
  root: {
49
58
  display: "block",
50
- width: "100%"
59
+ width: "100%",
60
+ maxHeight: DateTimePickerComponentSize.dateCalendarMaxHeight,
61
+ height: DateTimePickerComponentSize.dateCalendarMaxHeight
51
62
  }
52
63
  }
53
64
  },
@@ -76,6 +87,11 @@ const theme = {
76
87
  },
77
88
  MuiPickersLayout: {
78
89
  styleOverrides: {
90
+ root: () => ({
91
+ display: "block",
92
+ width: DateTimePickerSize.maxWidth,
93
+ maxWidth: DateTimePickerSize.maxWidth
94
+ }),
79
95
  contentWrapper: ({
80
96
  theme
81
97
  }) => ({
@@ -84,6 +100,17 @@ const theme = {
84
100
  })
85
101
  }
86
102
  },
103
+ MuiMultiSectionDigitalClock: {
104
+ styleOverrides: {
105
+ root: {
106
+ [`${addSpecificity(2, `.${multiSectionDigitalClockClasses.root}`)},
107
+ ${addSpecificity(2, ` .${multiSectionDigitalClockSectionClasses.root}`)},
108
+ ${addSpecificity(2, `.${digitalClockClasses.root}`)}`]: {
109
+ maxHeight: DateTimePickerComponentSize.dateCalendarMaxHeight
110
+ }
111
+ }
112
+ }
113
+ },
87
114
  MuiMultiSectionDigitalClockSection: {
88
115
  styleOverrides: {
89
116
  root: {
@@ -216,6 +243,13 @@ const theme = {
216
243
  })
217
244
  }
218
245
  },
246
+ MuiDayCalendar: {
247
+ styleOverrides: {
248
+ slideTransition: {
249
+ minHeight: DateTimePickerComponentSize.slideTransitionMinHeight
250
+ }
251
+ }
252
+ },
219
253
  MuiTimeClock: {
220
254
  styleOverrides: {
221
255
  arrowSwitcher: {
@@ -1 +1 @@
1
- {"version":3,"file":"dateTimePickerTheme.js","names":["deepmerge","datePickerTheme","dateStyles","theme","components","MuiClock","styleOverrides","clock","width","spacing","height","backgroundColor","palette","grey","pin","primary","light","MuiClockPointer","root","thumb","borderColor","main","MuiDateCalendar","display","MuiPickersArrowSwitcher","button","margin","padding","color","typography","body1","marginInlineStart","svg","spacer","MuiPickersLayout","contentWrapper","gridTemplateColumns","MuiMultiSectionDigitalClockSection","item","default","marginInline","marginBlockStart","hover","focus","selected","hoverSelected","disabled","MuiDateTimePickerToolbar","dateContainer","flexDirection","marginInlineEnd","timeDigitsContainer","alignItems","ampmSelection","common","white","separator","h5","marginBlock","MuiPickersToolbarButton","border","borderRadius","mixins","subtitle1","MuiPickersToolbarText","position","lineHeight","left","bottom","opacity","content","transition","transform","MuiTimeClock","arrowSwitcher","top","right","dateTimePickerTheme"],"sources":["../../../../src/labs/DatePickers/dateTimePickerTheme.ts"],"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\n// import { CSSInterpolation } from \"@mui/material/styles\";\nimport { deepmerge } from \"@mui/utils\";\nimport { ThemeOptions } from \"@mui/material\";\n\nimport {\n datePickerTheme,\n dateStyles,\n} from \"../../DatePickers/datePickerTheme.js\";\n\nconst theme: ThemeOptions = {\n components: {\n MuiClock: {\n styleOverrides: {\n clock: ({ theme }) => ({\n width: `calc(${theme.spacing(9)} * 4)`,\n height: `calc(${theme.spacing(9)} * 4)`,\n backgroundColor: theme.palette.grey[50],\n }),\n pin: ({ theme }) => ({\n backgroundColor: theme.palette.primary.light,\n }),\n },\n },\n MuiClockPointer: {\n styleOverrides: {\n root: ({ theme }) => ({\n backgroundColor: theme.palette.primary.light,\n }),\n thumb: ({ theme }) => ({\n borderColor: theme.palette.primary.light,\n backgroundColor: theme.palette.primary.main,\n }),\n },\n },\n MuiDateCalendar: {\n styleOverrides: {\n root: {\n display: \"block\",\n width: \"100%\",\n },\n },\n },\n MuiPickersArrowSwitcher: {\n styleOverrides: {\n button: ({ theme }) => ({\n display: \"flex\",\n margin: 0,\n padding: theme.spacing(2),\n color: theme.typography.body1.color,\n\n \"& + &\": {\n marginInlineStart: theme.spacing(2),\n },\n\n svg: {\n display: \"flex\",\n },\n }),\n spacer: ({ theme }) => ({\n width: theme.spacing(1),\n }),\n },\n },\n MuiPickersLayout: {\n styleOverrides: {\n contentWrapper: ({ theme }) => ({\n padding: theme.spacing(3),\n gridTemplateColumns: \"1fr 16px auto\",\n }),\n },\n },\n MuiMultiSectionDigitalClockSection: {\n styleOverrides: {\n root: {\n width: \"auto\",\n },\n item: ({ theme }) => [\n dateStyles.default({ theme }),\n {\n margin: 0,\n marginInline: theme.spacing(1),\n \"& + &\": {\n marginBlockStart: theme.spacing(1),\n },\n \"&:hover\": dateStyles.hover({ theme }),\n \"&:focus\": dateStyles.focus({ theme }),\n\n \"&.Mui-selected, &.Mui-selected:focus\": dateStyles.selected({\n theme,\n }),\n \"&.Mui-selected:hover\": dateStyles.hoverSelected({ theme }),\n\n \"&.Mui-disabled\": dateStyles.disabled({ theme }),\n },\n ],\n },\n },\n MuiDateTimePickerToolbar: {\n styleOverrides: {\n root: ({ theme }) => ({\n padding: theme.spacing(3),\n }),\n dateContainer: ({ theme }) => ({\n flexDirection: \"row-reverse\",\n\n button: {\n \"+ button\": {\n marginInlineEnd: theme.spacing(2),\n },\n },\n }),\n timeDigitsContainer: {\n alignItems: \"center\",\n },\n ampmSelection: ({ theme }) => ({\n margin: 0,\n marginInlineStart: theme.spacing(3),\n\n button: {\n padding: theme.spacing(2),\n\n \"&:has(.Mui-selected)\": {\n backgroundColor: theme.palette.primary.main,\n\n \".Mui-selected\": {\n color: theme.palette.common.white,\n \"&::after\": {\n display: \"none\",\n },\n },\n },\n },\n }),\n separator: ({ theme }) => ({\n ...theme.typography.h5,\n marginBlock: 0,\n marginInline: theme.spacing(1),\n }),\n },\n },\n MuiPickersToolbarButton: {\n styleOverrides: {\n root: ({ theme }) => ({\n height: \"auto\",\n padding: 0,\n margin: 0,\n border: 0,\n borderRadius: theme.mixins.borderRadius,\n backgroundColor: \"transparent\",\n color: theme.typography.subtitle1.color,\n\n \"&:hover\": {\n backgroundColor: \"transparent\",\n },\n\n \"& + &\": {\n marginInlineStart: 0,\n },\n }),\n },\n },\n MuiPickersToolbarText: {\n styleOverrides: {\n root: ({ theme }) => ({\n ...theme.typography.h5,\n position: \"relative\",\n margin: 0,\n lineHeight: 1,\n color: \"inherit\",\n\n \"&::after\": {\n position: \"absolute\",\n left: 0,\n bottom: 0,\n width: \"100%\",\n height: 2,\n backgroundColor: \"currentColor\",\n opacity: 0,\n content: \"''\",\n transition: \"opacity 100ms, transform 200ms\",\n },\n\n \"&.Mui-selected\": {\n color: theme.typography.body1.color,\n\n \"&::after\": {\n transform: \"translateY(2px)\",\n opacity: 1,\n },\n },\n }),\n },\n },\n MuiTimeClock: {\n styleOverrides: {\n arrowSwitcher: {\n top: 0,\n right: 0,\n },\n },\n },\n },\n};\nexport const dateTimePickerTheme = deepmerge(datePickerTheme, theme);\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAGA,SAASA,SAAS,QAAQ,YAAY;AAGtC,SACEC,eAAe,EACfC,UAAU,QACL,sCAAsC;AAE7C,MAAMC,KAAmB,GAAG;EAC1BC,UAAU,EAAE;IACVC,QAAQ,EAAE;MACRC,cAAc,EAAE;QACdC,KAAK,EAAEA,CAAC;UAAEJ;QAAM,CAAC,MAAM;UACrBK,KAAK,EAAE,QAAQL,KAAK,CAACM,OAAO,CAAC,CAAC,CAAC,OAAO;UACtCC,MAAM,EAAE,QAAQP,KAAK,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nB,CAAC;UAED,OAAO,EAAE;YACPoB,iBAAiB,EAAE;UACrB;QACF,CAAC;MACH;IACF,CAAC;IACDiC,qBAAqB,EAAE;MACrB1D,cAAc,EAAE;QACdY,IAAI,EAAEA,CAAC;UAAEf;QAAM,CAAC,MAAM;UACpB,GAAGA,KAAK,CAAC0B,UAAU,CAAC4B,EAAE;UACtBQ,QAAQ,EAAE,UAAU;UACpBvC,MAAM,EAAE,CAAC;UACTwC,UAAU,EAAE,CAAC;UACbtC,KAAK,EAAE,SAAS;UAEhB,UAAU,EAAE;YACVqC,QAAQ,EAAE,UAAU;YACpBE,IAAI,EAAE,CAAC;YACPC,MAAM,EAAE,CAAC;YACT5D,KAAK,EAAE,MAAM;YACbE,MAAM,EAAE,CAAC;YACTC,eAAe,EAAE,cAAc;YAC/B0D,OAAO,EAAE,CAAC;YACVC,OAAO,EAAE,IAAI;YACbC,UAAU,EAAE;UACd,CAAC;UAED,gBAAgB,EAAE;YAChB3C,KAAK,EAAEzB,KAAK,CAAC0B,UAAU,CAACC,KAAK,CAACF,KAAK;YAEnC,UAAU,EAAE;cACV4C,SAAS,EAAE,iBAAiB;cAC5BH,OAAO,EAAE;YACX;UACF;QACF,CAAC;MACH;IACF,CAAC;IACDI,YAAY,EAAE;MACZnE,cAAc,EAAE;QACdoE,aAAa,EAAE;UACbC,GAAG,EAAE,CAAC;UACNC,KAAK,EAAE;QACT;MACF;IACF;EACF;AACF,CAAC;AACD,OAAO,MAAMC,mBAAmB,GAAG7E,SAAS,CAACC,eAAe,EAAEE,KAAK,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"dateTimePickerTheme.js","names":["deepmerge","digitalClockClasses","multiSectionDigitalClockSectionClasses","multiSectionDigitalClockClasses","datePickerTheme","dateStyles","DateTimePickerSize","pxToRem","addSpecificity","DateTimePickerComponentSize","dateCalendarMaxHeight","slideTransitionMinHeight","theme","components","MuiClock","styleOverrides","clock","width","spacing","height","backgroundColor","palette","grey","pin","primary","light","MuiClockPointer","root","thumb","borderColor","main","MuiDateCalendar","display","maxHeight","MuiPickersArrowSwitcher","button","margin","padding","color","typography","body1","marginInlineStart","svg","spacer","MuiPickersLayout","maxWidth","contentWrapper","gridTemplateColumns","MuiMultiSectionDigitalClock","MuiMultiSectionDigitalClockSection","item","default","marginInline","marginBlockStart","hover","focus","selected","hoverSelected","disabled","MuiDateTimePickerToolbar","dateContainer","flexDirection","marginInlineEnd","timeDigitsContainer","alignItems","ampmSelection","common","white","separator","h5","marginBlock","MuiPickersToolbarButton","border","borderRadius","mixins","subtitle1","MuiPickersToolbarText","position","lineHeight","left","bottom","opacity","content","transition","transform","MuiDayCalendar","slideTransition","minHeight","MuiTimeClock","arrowSwitcher","top","right","dateTimePickerTheme"],"sources":["../../../../src/labs/DatePickers/dateTimePickerTheme.ts"],"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\n// import { CSSInterpolation } from \"@mui/material/styles\";\nimport { deepmerge } from \"@mui/utils\";\nimport { ThemeOptions } from \"@mui/material\";\nimport { digitalClockClasses } from \"@mui/x-date-pickers/DigitalClock\";\nimport {\n multiSectionDigitalClockSectionClasses,\n multiSectionDigitalClockClasses,\n} from \"@mui/x-date-pickers/MultiSectionDigitalClock\";\nimport {\n datePickerTheme,\n dateStyles,\n} from \"../../DatePickers/datePickerTheme.js\";\nimport { DateTimePickerSize } from \"./DateTimePicker.js\";\nimport { pxToRem } from \"../../theme/index.js\";\nimport { addSpecificity } from \"../../addSpecificity.js\";\n\nconst DateTimePickerComponentSize = {\n dateCalendarMaxHeight: `${pxToRem(336)}rem`,\n slideTransitionMinHeight: `${pxToRem(240)}rem`,\n};\n\nconst theme: ThemeOptions = {\n components: {\n MuiClock: {\n styleOverrides: {\n clock: ({ theme }) => ({\n width: `calc(${theme.spacing(9)} * 4)`,\n height: `calc(${theme.spacing(9)} * 4)`,\n backgroundColor: theme.palette.grey[50],\n }),\n pin: ({ theme }) => ({\n backgroundColor: theme.palette.primary.light,\n }),\n },\n },\n MuiClockPointer: {\n styleOverrides: {\n root: ({ theme }) => ({\n backgroundColor: theme.palette.primary.light,\n }),\n thumb: ({ theme }) => ({\n borderColor: theme.palette.primary.light,\n backgroundColor: theme.palette.primary.main,\n }),\n },\n },\n MuiDateCalendar: {\n styleOverrides: {\n root: {\n display: \"block\",\n width: \"100%\",\n maxHeight: DateTimePickerComponentSize.dateCalendarMaxHeight,\n height: DateTimePickerComponentSize.dateCalendarMaxHeight,\n },\n },\n },\n MuiPickersArrowSwitcher: {\n styleOverrides: {\n button: ({ theme }) => ({\n display: \"flex\",\n margin: 0,\n padding: theme.spacing(2),\n color: theme.typography.body1.color,\n\n \"& + &\": {\n marginInlineStart: theme.spacing(2),\n },\n\n svg: {\n display: \"flex\",\n },\n }),\n spacer: ({ theme }) => ({\n width: theme.spacing(1),\n }),\n },\n },\n MuiPickersLayout: {\n styleOverrides: {\n root: () => ({\n display: \"block\",\n width: DateTimePickerSize.maxWidth,\n maxWidth: DateTimePickerSize.maxWidth,\n }),\n contentWrapper: ({ theme }) => ({\n padding: theme.spacing(3),\n gridTemplateColumns: \"1fr 16px auto\",\n }),\n },\n },\n MuiMultiSectionDigitalClock: {\n styleOverrides: {\n root: {\n [`${addSpecificity(2, `.${multiSectionDigitalClockClasses.root}`)}, \n ${addSpecificity(2, ` .${multiSectionDigitalClockSectionClasses.root}`)}, \n ${addSpecificity(2, `.${digitalClockClasses.root}`)}`]: {\n maxHeight: DateTimePickerComponentSize.dateCalendarMaxHeight,\n },\n },\n },\n },\n MuiMultiSectionDigitalClockSection: {\n styleOverrides: {\n root: {\n width: \"auto\",\n },\n item: ({ theme }) => [\n dateStyles.default({ theme }),\n {\n margin: 0,\n marginInline: theme.spacing(1),\n \"& + &\": {\n marginBlockStart: theme.spacing(1),\n },\n \"&:hover\": dateStyles.hover({ theme }),\n \"&:focus\": dateStyles.focus({ theme }),\n\n \"&.Mui-selected, &.Mui-selected:focus\": dateStyles.selected({\n theme,\n }),\n \"&.Mui-selected:hover\": dateStyles.hoverSelected({ theme }),\n\n \"&.Mui-disabled\": dateStyles.disabled({ theme }),\n },\n ],\n },\n },\n MuiDateTimePickerToolbar: {\n styleOverrides: {\n root: ({ theme }) => ({\n padding: theme.spacing(3),\n }),\n dateContainer: ({ theme }) => ({\n flexDirection: \"row-reverse\",\n\n button: {\n \"+ button\": {\n marginInlineEnd: theme.spacing(2),\n },\n },\n }),\n timeDigitsContainer: {\n alignItems: \"center\",\n },\n ampmSelection: ({ theme }) => ({\n margin: 0,\n marginInlineStart: theme.spacing(3),\n\n button: {\n padding: theme.spacing(2),\n\n \"&:has(.Mui-selected)\": {\n backgroundColor: theme.palette.primary.main,\n\n \".Mui-selected\": {\n color: theme.palette.common.white,\n \"&::after\": {\n display: \"none\",\n },\n },\n },\n },\n }),\n separator: ({ theme }) => ({\n ...theme.typography.h5,\n marginBlock: 0,\n marginInline: theme.spacing(1),\n }),\n },\n },\n MuiPickersToolbarButton: {\n styleOverrides: {\n root: ({ theme }) => ({\n height: \"auto\",\n padding: 0,\n margin: 0,\n border: 0,\n borderRadius: theme.mixins.borderRadius,\n backgroundColor: \"transparent\",\n color: theme.typography.subtitle1.color,\n\n \"&:hover\": {\n backgroundColor: \"transparent\",\n },\n\n \"& + &\": {\n marginInlineStart: 0,\n },\n }),\n },\n },\n MuiPickersToolbarText: {\n styleOverrides: {\n root: ({ theme }) => ({\n ...theme.typography.h5,\n position: \"relative\",\n margin: 0,\n lineHeight: 1,\n color: \"inherit\",\n\n \"&::after\": {\n position: \"absolute\",\n left: 0,\n bottom: 0,\n width: \"100%\",\n height: 2,\n backgroundColor: \"currentColor\",\n opacity: 0,\n content: \"''\",\n transition: \"opacity 100ms, transform 200ms\",\n },\n\n \"&.Mui-selected\": {\n color: theme.typography.body1.color,\n\n \"&::after\": {\n transform: \"translateY(2px)\",\n opacity: 1,\n },\n },\n }),\n },\n },\n MuiDayCalendar: {\n styleOverrides: {\n slideTransition: {\n minHeight: DateTimePickerComponentSize.slideTransitionMinHeight,\n },\n },\n },\n MuiTimeClock: {\n styleOverrides: {\n arrowSwitcher: {\n top: 0,\n right: 0,\n },\n },\n },\n },\n};\nexport const dateTimePickerTheme = deepmerge(datePickerTheme, theme);\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAGA,SAASA,SAAS,QAAQ,YAAY;AAEtC,SAASC,mBAAmB,QAAQ,kCAAkC;AACtE,SACEC,sCAAsC,EACtCC,+BAA+B,QAC1B,8CAA8C;AACrD,SACEC,eAAe,EACfC,UAAU,QACL,sCAAsC;AAC7C,SAASC,kBAAkB,QAAQ,qBAAqB;AACxD,SAASC,OAAO,QAAQ,sBAAsB;AAC9C,SAASC,cAAc,QAAQ,yBAAyB;AAExD,MAAMC,2BAA2B,GAAG;EAClCC,qBAAqB,EAAE,GAAGH,OAAO,CAAC,GAAG,CAAC,KAAK;EAC3CI,wBAAwB,EAAE,GAAGJ,OAAO,CAAC,GAAG,CAAC;AAC3C,CAAC;AAED,MAAMK,KAAmB,GAAG;EAC1BC,UAAU,EAAE;IACVC,QAAQ,EAAE;MACRC,cAAc,EAAE;QACdC,KAAK,EAAEA,CAAC;UAAEJ;QAAM,CAAC,MAAM;UACrBK,KAAK,EAAE,QAAQL,KAAK,CAACM,OAAO,CAAC,CAAC,CAAC,OAAO;UACtCC,MAAM,EAAE,QAAQP,KAAK,CAACM,OAAO,CAAC,CAAC,CAAC,OAAO;UACvCE,eAAe,EAAER,KAAK,CAACS,OAAO,CAACC,IAAI,CAAC,EAAE;QACxC,CAAC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C5BH,OAAO,EAAE;YACX;UACF;QACF,CAAC;MACH;IACF,CAAC;IACDI,cAAc,EAAE;MACdtE,cAAc,EAAE;QACduE,eAAe,EAAE;UACfC,SAAS,EAAE9E,2BAA2B,CAACE;QACzC;MACF;IACF,CAAC;IACD6E,YAAY,EAAE;MACZzE,cAAc,EAAE;QACd0E,aAAa,EAAE;UACbC,GAAG,EAAE,CAAC;UACNC,KAAK,EAAE;QACT;MACF;IACF;EACF;AACF,CAAC;AACD,OAAO,MAAMC,mBAAmB,GAAG5F,SAAS,CAACI,eAAe,EAAEQ,KAAK,CAAC","ignoreList":[]}
@@ -20,6 +20,7 @@ export const adornmentSizeValues = ["small", "large"];
20
20
  const ComposablePicker = ({
21
21
  ariaDescribedBy,
22
22
  defaultValue,
23
+ emptyOptionsText,
23
24
  errorMessage,
24
25
  errorMessageList,
25
26
  getIsOptionEqualToValue,
@@ -95,6 +96,7 @@ const ComposablePicker = ({
95
96
  isOptionEqualToValue: getIsOptionEqualToValue,
96
97
  loading: isLoading,
97
98
  multiple: hasMultipleChoices,
99
+ noOptionsText: emptyOptionsText,
98
100
  onBlur: onBlur,
99
101
  onChange: onChange,
100
102
  onInputChange: onInputChange,
@@ -1 +1 @@
1
- {"version":3,"file":"ComposablePicker.js","names":["memo","useTranslation","PickerVirtualizationListBox","useAutocomplete","jsx","_jsx","adornmentSizeValues","ComposablePicker","ariaDescribedBy","defaultValue","errorMessage","errorMessageList","getIsOptionEqualToValue","getOptionLabel","groupOptionsBy","hasMultipleChoices","id","idOverride","inputValue","isCustomValueAllowed","isDisabled","isFullWidth","isLoading","isOptional","isReadOnly","isVirtualized","hint","HintLinkComponent","label","name","nameOverride","onBlur","onChange","onInputChange","onFocus","options","renderOption","renderTags","value","testId","translate","t","inputValueProp","isVirtualizedRef","renderInput","valueProps","_Autocomplete","current","ListboxComponent","clearText","closeText","disableCloseOnSelect","disabled","freeSolo","filterSelectedOptions","fullWidth","groupBy","isOptionEqualToValue","loading","multiple","readOnly","MemoizedComposablePicker","displayName"],"sources":["../../../../src/labs/OdysseyPickers/ComposablePicker.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 { memo, ReactNode } from \"react\";\nimport { useTranslation } from \"react-i18next\";\nimport {\n Autocomplete as MuiAutocomplete,\n AutocompleteProps as MuiAutocompleteProps,\n} from \"@mui/material\";\n\nimport { AutocompleteProps } from \"../../Autocomplete.js\";\nimport { PickerVirtualizationListBox } from \"./PickerVirtualizationListBox.js\";\nimport { useAutocomplete } from \"../../useAutocomplete.js\";\n\nexport const adornmentSizeValues = [\"small\", \"large\"] as const;\nexport type AdornmentSize = (typeof adornmentSizeValues)[number];\n\nexport type BasePickerProps<\n OptionType,\n HasMultipleChoices extends boolean | undefined,\n IsCustomValueAllowed extends boolean | undefined,\n> = AutocompleteProps<OptionType, HasMultipleChoices, IsCustomValueAllowed> & {\n adornmentSize?: AdornmentSize;\n groupOptionsBy?: MuiAutocompleteProps<\n OptionType,\n HasMultipleChoices,\n undefined,\n IsCustomValueAllowed\n >[\"groupBy\"];\n};\n\nexport type BasePickerType = {\n displayName: string;\n <\n OptionType,\n HasMultipleChoices extends boolean | undefined,\n IsCustomValueAllowed extends boolean | undefined,\n >(\n props: BasePickerProps<\n OptionType,\n HasMultipleChoices,\n IsCustomValueAllowed\n >,\n ): ReactNode;\n};\n\nexport type ComposablePickerProps<\n OptionType,\n HasMultipleChoices extends boolean | undefined,\n IsCustomValueAllowed extends boolean | undefined,\n> = BasePickerProps<OptionType, HasMultipleChoices, IsCustomValueAllowed> & {\n getOptionLabel?: MuiAutocompleteProps<\n OptionType,\n HasMultipleChoices,\n undefined,\n IsCustomValueAllowed\n >[\"getOptionLabel\"];\n\n renderOption: MuiAutocompleteProps<\n OptionType,\n HasMultipleChoices,\n undefined,\n IsCustomValueAllowed\n >[\"renderOption\"];\n\n renderTags?: MuiAutocompleteProps<\n OptionType,\n HasMultipleChoices,\n undefined,\n IsCustomValueAllowed\n >[\"renderTags\"];\n};\n\nconst ComposablePicker = <\n OptionType,\n HasMultipleChoices extends boolean | undefined,\n IsCustomValueAllowed extends boolean | undefined,\n>({\n ariaDescribedBy,\n defaultValue,\n errorMessage,\n errorMessageList,\n getIsOptionEqualToValue,\n getOptionLabel,\n groupOptionsBy,\n hasMultipleChoices,\n id: idOverride,\n inputValue,\n isCustomValueAllowed,\n isDisabled,\n isFullWidth = false,\n isLoading,\n isOptional = false,\n isReadOnly,\n isVirtualized = false,\n hint,\n HintLinkComponent,\n label,\n name: nameOverride,\n onBlur,\n onChange,\n onInputChange,\n onFocus,\n options,\n renderOption,\n renderTags,\n value,\n testId,\n translate,\n}: ComposablePickerProps<\n OptionType,\n HasMultipleChoices,\n IsCustomValueAllowed\n>) => {\n const { t } = useTranslation();\n const { inputValueProp, isVirtualizedRef, renderInput, valueProps } =\n useAutocomplete<OptionType, HasMultipleChoices, IsCustomValueAllowed>({\n ariaDescribedBy,\n defaultValue,\n errorMessage,\n errorMessageList,\n hasMultipleChoices,\n hint,\n HintLinkComponent,\n inputValue,\n isFullWidth,\n isOptional,\n isVirtualized,\n label,\n name: nameOverride,\n testId,\n value,\n });\n\n return (\n <MuiAutocomplete\n {...valueProps}\n {...inputValueProp}\n // conditionally provide the ListboxComponent if this needs to be virtualized\n {...(isVirtualizedRef.current && {\n ListboxComponent: PickerVirtualizationListBox,\n })}\n // AutoComplete is wrapped in a div within MUI which does not get the disabled attr. So this aria-disabled gets set in the div\n aria-disabled={isDisabled}\n clearText={t(\"clear.text\")}\n closeText={t(\"close.text\")}\n disableCloseOnSelect={hasMultipleChoices}\n disabled={isDisabled}\n freeSolo={isCustomValueAllowed}\n filterSelectedOptions={true}\n fullWidth={isFullWidth}\n getOptionLabel={getOptionLabel}\n groupBy={groupOptionsBy}\n id={idOverride}\n isOptionEqualToValue={getIsOptionEqualToValue}\n loading={isLoading}\n multiple={hasMultipleChoices}\n onBlur={onBlur}\n onChange={onChange}\n onInputChange={onInputChange}\n onFocus={onFocus}\n options={options}\n readOnly={isReadOnly}\n renderInput={renderInput}\n renderOption={renderOption}\n renderTags={renderTags}\n translate={translate}\n />\n );\n};\n\n// Need the `typeof ComposablePicker` because generics don't get passed through\nconst MemoizedComposablePicker = memo(\n ComposablePicker,\n) as typeof ComposablePicker;\n// @ts-expect-error displayName is expected to not be on `typeof ComposablePicker`\nMemoizedComposablePicker.displayName = \"ComposablePicker\";\n\nexport { MemoizedComposablePicker as ComposablePicker };\n"],"mappings":";AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,IAAI,QAAmB,OAAO;AACvC,SAASC,cAAc,QAAQ,eAAe;AAO9C,SAASC,2BAA2B,QAAQ,kCAAkC;AAC9E,SAASC,eAAe,QAAQ,0BAA0B;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAE3D,OAAO,MAAMC,mBAAmB,GAAG,CAAC,OAAO,EAAE,OAAO,CAAU;AA2D9D,MAAMC,gBAAgB,GAAGA,CAIvB;EACAC,eAAe;EACfC,YAAY;EACZC,YAAY;EACZC,gBAAgB;EAChBC,uBAAuB;EACvBC,cAAc;EACdC,cAAc;EACdC,kBAAkB;EAClBC,EAAE,EAAEC,UAAU;EACdC,UAAU;EACVC,oBAAoB;EACpBC,UAAU;EACVC,WAAW,GAAG,KAAK;EACnBC,SAAS;EACTC,UAAU,GAAG,KAAK;EAClBC,UAAU;EACVC,aAAa,GAAG,KAAK;EACrBC,IAAI;EACJC,iBAAiB;EACjBC,KAAK;EACLC,IAAI,EAAEC,YAAY;EAClBC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B,QAAQ,EAAEpC,UAAW;IACrBoB,WAAW,EAAEA,WAAY;IACzBR,YAAY,EAAEA,YAAa;IAC3BC,UAAU,EAAEA,UAAW;IACvBG,SAAS,EAAEA;EAAU,CACtB,CAAC;AAEN,CAAC;AAGD,MAAMqB,wBAAwB,GAAG7D,IAAI,CACnCO,gBACF,CAA4B;AAE5BsD,wBAAwB,CAACC,WAAW,GAAG,kBAAkB;AAEzD,SAASD,wBAAwB,IAAItD,gBAAgB","ignoreList":[]}
1
+ {"version":3,"file":"ComposablePicker.js","names":["memo","useTranslation","PickerVirtualizationListBox","useAutocomplete","jsx","_jsx","adornmentSizeValues","ComposablePicker","ariaDescribedBy","defaultValue","emptyOptionsText","errorMessage","errorMessageList","getIsOptionEqualToValue","getOptionLabel","groupOptionsBy","hasMultipleChoices","id","idOverride","inputValue","isCustomValueAllowed","isDisabled","isFullWidth","isLoading","isOptional","isReadOnly","isVirtualized","hint","HintLinkComponent","label","name","nameOverride","onBlur","onChange","onInputChange","onFocus","options","renderOption","renderTags","value","testId","translate","t","inputValueProp","isVirtualizedRef","renderInput","valueProps","_Autocomplete","current","ListboxComponent","clearText","closeText","disableCloseOnSelect","disabled","freeSolo","filterSelectedOptions","fullWidth","groupBy","isOptionEqualToValue","loading","multiple","noOptionsText","readOnly","MemoizedComposablePicker","displayName"],"sources":["../../../../src/labs/OdysseyPickers/ComposablePicker.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 { memo, ReactNode } from \"react\";\nimport { useTranslation } from \"react-i18next\";\nimport {\n Autocomplete as MuiAutocomplete,\n AutocompleteProps as MuiAutocompleteProps,\n} from \"@mui/material\";\n\nimport { AutocompleteProps } from \"../../Autocomplete.js\";\nimport { PickerVirtualizationListBox } from \"./PickerVirtualizationListBox.js\";\nimport { useAutocomplete } from \"../../useAutocomplete.js\";\n\nexport const adornmentSizeValues = [\"small\", \"large\"] as const;\nexport type AdornmentSize = (typeof adornmentSizeValues)[number];\n\nexport type BasePickerProps<\n OptionType,\n HasMultipleChoices extends boolean | undefined,\n IsCustomValueAllowed extends boolean | undefined,\n> = AutocompleteProps<OptionType, HasMultipleChoices, IsCustomValueAllowed> & {\n adornmentSize?: AdornmentSize;\n emptyOptionsText?: MuiAutocompleteProps<\n OptionType,\n HasMultipleChoices,\n undefined,\n IsCustomValueAllowed\n >[\"noOptionsText\"];\n groupOptionsBy?: MuiAutocompleteProps<\n OptionType,\n HasMultipleChoices,\n undefined,\n IsCustomValueAllowed\n >[\"groupBy\"];\n};\n\nexport type BasePickerType = {\n displayName: string;\n <\n OptionType,\n HasMultipleChoices extends boolean | undefined,\n IsCustomValueAllowed extends boolean | undefined,\n >(\n props: BasePickerProps<\n OptionType,\n HasMultipleChoices,\n IsCustomValueAllowed\n >,\n ): ReactNode;\n};\n\nexport type ComposablePickerProps<\n OptionType,\n HasMultipleChoices extends boolean | undefined,\n IsCustomValueAllowed extends boolean | undefined,\n> = BasePickerProps<OptionType, HasMultipleChoices, IsCustomValueAllowed> & {\n getOptionLabel?: MuiAutocompleteProps<\n OptionType,\n HasMultipleChoices,\n undefined,\n IsCustomValueAllowed\n >[\"getOptionLabel\"];\n\n renderOption: MuiAutocompleteProps<\n OptionType,\n HasMultipleChoices,\n undefined,\n IsCustomValueAllowed\n >[\"renderOption\"];\n\n renderTags?: MuiAutocompleteProps<\n OptionType,\n HasMultipleChoices,\n undefined,\n IsCustomValueAllowed\n >[\"renderTags\"];\n};\n\nconst ComposablePicker = <\n OptionType,\n HasMultipleChoices extends boolean | undefined,\n IsCustomValueAllowed extends boolean | undefined,\n>({\n ariaDescribedBy,\n defaultValue,\n emptyOptionsText,\n errorMessage,\n errorMessageList,\n getIsOptionEqualToValue,\n getOptionLabel,\n groupOptionsBy,\n hasMultipleChoices,\n id: idOverride,\n inputValue,\n isCustomValueAllowed,\n isDisabled,\n isFullWidth = false,\n isLoading,\n isOptional = false,\n isReadOnly,\n isVirtualized = false,\n hint,\n HintLinkComponent,\n label,\n name: nameOverride,\n onBlur,\n onChange,\n onInputChange,\n onFocus,\n options,\n renderOption,\n renderTags,\n value,\n testId,\n translate,\n}: ComposablePickerProps<\n OptionType,\n HasMultipleChoices,\n IsCustomValueAllowed\n>) => {\n const { t } = useTranslation();\n const { inputValueProp, isVirtualizedRef, renderInput, valueProps } =\n useAutocomplete<OptionType, HasMultipleChoices, IsCustomValueAllowed>({\n ariaDescribedBy,\n defaultValue,\n errorMessage,\n errorMessageList,\n hasMultipleChoices,\n hint,\n HintLinkComponent,\n inputValue,\n isFullWidth,\n isOptional,\n isVirtualized,\n label,\n name: nameOverride,\n testId,\n value,\n });\n\n return (\n <MuiAutocomplete\n {...valueProps}\n {...inputValueProp}\n // conditionally provide the ListboxComponent if this needs to be virtualized\n {...(isVirtualizedRef.current && {\n ListboxComponent: PickerVirtualizationListBox,\n })}\n // AutoComplete is wrapped in a div within MUI which does not get the disabled attr. So this aria-disabled gets set in the div\n aria-disabled={isDisabled}\n clearText={t(\"clear.text\")}\n closeText={t(\"close.text\")}\n disableCloseOnSelect={hasMultipleChoices}\n disabled={isDisabled}\n freeSolo={isCustomValueAllowed}\n filterSelectedOptions={true}\n fullWidth={isFullWidth}\n getOptionLabel={getOptionLabel}\n groupBy={groupOptionsBy}\n id={idOverride}\n isOptionEqualToValue={getIsOptionEqualToValue}\n loading={isLoading}\n multiple={hasMultipleChoices}\n noOptionsText={emptyOptionsText}\n onBlur={onBlur}\n onChange={onChange}\n onInputChange={onInputChange}\n onFocus={onFocus}\n options={options}\n readOnly={isReadOnly}\n renderInput={renderInput}\n renderOption={renderOption}\n renderTags={renderTags}\n translate={translate}\n />\n );\n};\n\n// Need the `typeof ComposablePicker` because generics don't get passed through\nconst MemoizedComposablePicker = memo(\n ComposablePicker,\n) as typeof ComposablePicker;\n// @ts-expect-error displayName is expected to not be on `typeof ComposablePicker`\nMemoizedComposablePicker.displayName = \"ComposablePicker\";\n\nexport { MemoizedComposablePicker as ComposablePicker };\n"],"mappings":";AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,IAAI,QAAmB,OAAO;AACvC,SAASC,cAAc,QAAQ,eAAe;AAO9C,SAASC,2BAA2B,QAAQ,kCAAkC;AAC9E,SAASC,eAAe,QAAQ,0BAA0B;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAE3D,OAAO,MAAMC,mBAAmB,GAAG,CAAC,OAAO,EAAE,OAAO,CAAU;AAiE9D,MAAMC,gBAAgB,GAAGA,CAIvB;EACAC,eAAe;EACfC,YAAY;EACZC,gBAAgB;EAChBC,YAAY;EACZC,gBAAgB;EAChBC,uBAAuB;EACvBC,cAAc;EACdC,cAAc;EACdC,kBAAkB;EAClBC,EAAE,EAAEC,UAAU;EACdC,UAAU;EACVC,oBAAoB;EACpBC,UAAU;EACVC,WAAW,GAAG,KAAK;EACnBC,SAAS;EACTC,UAAU,GAAG,KAAK;EAClBC,UAAU;EACVC,aAAa,GAAG,KAAK;EACrBC,IAAI;EACJC,iBAAiB;EACjBC,KAAK;EACLC,IAAI,EAAEC,YAAY;EAClBC,MAAM;EACNC,QAAQ;EACRC,aAAa;EACbC,OAAO;EACPC,OAAO;EACPC,YAAY;EACZC,UAAU;EACVC,KAAK;EACLC,MAAM;EACNC;AAKF,CAAC,KAAK;EACJ,MAAM;IAAEC;EAAE,CAAC,GAAGzC,cAAc,CAAC,CAAC;EAC9B,MAAM;IAAE0C,cAAc;IAAEC,gBAAgB;IAAEC,WAAW;IAAEC;EAAW,CAAC,GACjE3C,eAAe,CAAuD;IAC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