@pautena/react-design-system 0.14.0 → 0.14.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (424) hide show
  1. package/action/cjs/index.js +2 -0
  2. package/action/cjs/index.js.map +1 -0
  3. package/action/cjs/package.json +13 -0
  4. package/action/index.js +1 -1
  5. package/action/index.js.map +1 -1
  6. package/action/package.json +1 -1
  7. package/autocomplete/autocomplete.d.ts +2 -1
  8. package/autocomplete/cjs/index.js +2 -0
  9. package/autocomplete/cjs/index.js.map +1 -0
  10. package/autocomplete/cjs/package.json +11 -0
  11. package/autocomplete/index.js +1 -23
  12. package/autocomplete/index.js.map +1 -1
  13. package/autocomplete/package.json +1 -1
  14. package/board/board.d.ts +1 -1
  15. package/board/cjs/index.js +2 -0
  16. package/board/cjs/index.js.map +1 -0
  17. package/board/cjs/package.json +13 -0
  18. package/board/index.js +1 -1
  19. package/board/index.js.map +1 -1
  20. package/board/package.json +1 -1
  21. package/bootstrap-dialog/bootstrap-dialog.d.ts +1 -1
  22. package/bootstrap-dialog/cjs/index.js +2 -0
  23. package/bootstrap-dialog/cjs/index.js.map +1 -0
  24. package/bootstrap-dialog/cjs/package.json +13 -0
  25. package/bootstrap-dialog/index.js +1 -1
  26. package/bootstrap-dialog/index.js.map +1 -1
  27. package/bootstrap-dialog/package.json +1 -1
  28. package/bullet/bullet.d.ts +1 -1
  29. package/bullet/cjs/index.js +2 -0
  30. package/bullet/cjs/index.js.map +1 -0
  31. package/bullet/cjs/package.json +11 -0
  32. package/bullet/index.js +1 -1
  33. package/bullet/index.js.map +1 -1
  34. package/bullet/package.json +1 -1
  35. package/center-container/center-container.d.ts +1 -1
  36. package/center-container/cjs/index.js +2 -0
  37. package/center-container/cjs/index.js.map +1 -0
  38. package/center-container/cjs/package.json +11 -0
  39. package/center-container/index.js +1 -1
  40. package/center-container/index.js.map +1 -1
  41. package/center-container/package.json +1 -1
  42. package/cjs/index.js +4 -4
  43. package/cjs/index.js.map +1 -1
  44. package/confirm-dialog/cjs/index.js +2 -0
  45. package/confirm-dialog/cjs/index.js.map +1 -0
  46. package/confirm-dialog/cjs/package.json +13 -0
  47. package/confirm-dialog/confirm-dialog.d.ts +1 -1
  48. package/confirm-dialog/index.js +1 -1
  49. package/confirm-dialog/index.js.map +1 -1
  50. package/confirm-dialog/package.json +1 -1
  51. package/content/cjs/index.js +2 -0
  52. package/content/cjs/index.js.map +1 -0
  53. package/content/cjs/package.json +11 -0
  54. package/content/index.js +1 -1
  55. package/content/index.js.map +1 -1
  56. package/content/package.json +1 -1
  57. package/content-placeholder/cjs/index.js +2 -0
  58. package/content-placeholder/cjs/index.js.map +1 -0
  59. package/content-placeholder/cjs/package.json +11 -0
  60. package/content-placeholder/index.js +1 -1
  61. package/content-placeholder/index.js.map +1 -1
  62. package/content-placeholder/package.json +1 -1
  63. package/date-range-calendar/cjs/index.js +2 -0
  64. package/date-range-calendar/cjs/index.js.map +1 -0
  65. package/date-range-calendar/cjs/package.json +13 -0
  66. package/date-range-calendar/index.js +1 -1
  67. package/date-range-calendar/index.js.map +1 -1
  68. package/date-range-calendar/package.json +1 -1
  69. package/date-range-picker/cjs/index.js +2 -0
  70. package/date-range-picker/cjs/index.js.map +1 -0
  71. package/date-range-picker/cjs/package.json +14 -0
  72. package/date-range-picker/index.js +1 -1
  73. package/date-range-picker/index.js.map +1 -1
  74. package/date-range-picker/package.json +1 -1
  75. package/dialog/cjs/index.js +2 -0
  76. package/dialog/cjs/index.js.map +1 -0
  77. package/dialog/cjs/package.json +10 -0
  78. package/dialog/package.json +1 -1
  79. package/drawer/cjs/index.js +2 -0
  80. package/drawer/cjs/index.js.map +1 -0
  81. package/drawer/cjs/package.json +12 -0
  82. package/drawer/drawer.d.ts +3 -3
  83. package/drawer/drawer.types.d.ts +5 -4
  84. package/drawer/index.js +1 -1
  85. package/drawer/index.js.map +1 -1
  86. package/drawer/package.json +1 -1
  87. package/drawer-app-bar/cjs/index.js +2 -0
  88. package/drawer-app-bar/cjs/index.js.map +1 -0
  89. package/drawer-app-bar/cjs/package.json +12 -0
  90. package/drawer-app-bar/index.js +1 -1
  91. package/drawer-app-bar/index.js.map +1 -1
  92. package/drawer-app-bar/package.json +1 -1
  93. package/drawer-content/cjs/index.js +2 -0
  94. package/drawer-content/cjs/index.js.map +1 -0
  95. package/drawer-content/cjs/package.json +13 -0
  96. package/drawer-content/drawer-content.d.ts +1 -1
  97. package/drawer-content/index.js +1 -1
  98. package/drawer-content/index.js.map +1 -1
  99. package/drawer-content/package.json +1 -1
  100. package/drawer-item/cjs/index.js +2 -0
  101. package/drawer-item/cjs/index.js.map +1 -0
  102. package/drawer-item/cjs/package.json +13 -0
  103. package/drawer-item/drawer-item-link.d.ts +1 -1
  104. package/drawer-item/drawer-menu-item.d.ts +1 -1
  105. package/drawer-item/index.js +1 -1
  106. package/drawer-item/index.js.map +1 -1
  107. package/drawer-item/package.json +1 -1
  108. package/drawer-layout/cjs/index.js +2 -0
  109. package/drawer-layout/cjs/index.js.map +1 -0
  110. package/drawer-layout/cjs/package.json +12 -0
  111. package/drawer-layout/index.js +1 -1
  112. package/drawer-layout/index.js.map +1 -1
  113. package/drawer-layout/package.json +1 -1
  114. package/drawer-main/cjs/index.js +2 -0
  115. package/drawer-main/cjs/index.js.map +1 -0
  116. package/drawer-main/cjs/package.json +12 -0
  117. package/drawer-main/index.js +1 -1
  118. package/drawer-main/index.js.map +1 -1
  119. package/drawer-main/package.json +1 -1
  120. package/drawer-provider/cjs/index.js +2 -0
  121. package/drawer-provider/cjs/index.js.map +1 -0
  122. package/drawer-provider/cjs/package.json +12 -0
  123. package/drawer-provider/drawer-context.d.ts +1 -1
  124. package/drawer-provider/drawer.provider.d.ts +1 -1
  125. package/drawer-provider/index.js +1 -1
  126. package/drawer-provider/index.js.map +1 -1
  127. package/drawer-provider/package.json +1 -1
  128. package/drawer-section/cjs/index.js +2 -0
  129. package/drawer-section/cjs/index.js.map +1 -0
  130. package/drawer-section/cjs/package.json +13 -0
  131. package/drawer-section/drawer-section.d.ts +1 -1
  132. package/drawer-section/index.js +1 -1
  133. package/drawer-section/index.js.map +1 -1
  134. package/drawer-section/package.json +1 -1
  135. package/drawer-subheader/cjs/index.js +2 -0
  136. package/drawer-subheader/cjs/index.js.map +1 -0
  137. package/drawer-subheader/cjs/package.json +10 -0
  138. package/drawer-subheader/drawer-subheader.d.ts +5 -5
  139. package/drawer-subheader/index.js +1 -1
  140. package/drawer-subheader/index.js.map +1 -1
  141. package/drawer-subheader/package.json +1 -1
  142. package/enhanced-remote-table/cjs/index.js +24 -0
  143. package/enhanced-remote-table/cjs/index.js.map +1 -0
  144. package/enhanced-remote-table/cjs/package.json +12 -0
  145. package/enhanced-remote-table/enhanced-remote-table.d.ts +1 -1
  146. package/enhanced-remote-table/enhanced-remote-table.mock.d.ts +2 -2
  147. package/enhanced-remote-table/index.js +4 -4
  148. package/enhanced-remote-table/index.js.map +1 -1
  149. package/enhanced-remote-table/package.json +1 -1
  150. package/enhanced-table/cjs/index.js +24 -0
  151. package/enhanced-table/cjs/index.js.map +1 -0
  152. package/enhanced-table/cjs/package.json +12 -0
  153. package/enhanced-table/index.js +4 -4
  154. package/enhanced-table/index.js.map +1 -1
  155. package/enhanced-table/package.json +1 -1
  156. package/expandable-alert/cjs/index.js +2 -0
  157. package/expandable-alert/cjs/index.js.map +1 -0
  158. package/expandable-alert/cjs/package.json +13 -0
  159. package/expandable-alert/expandable-alert.d.ts +3 -3
  160. package/expandable-alert/index.js +1 -1
  161. package/expandable-alert/index.js.map +1 -1
  162. package/expandable-alert/package.json +1 -1
  163. package/form-dialog/cjs/index.js +2 -0
  164. package/form-dialog/cjs/index.js.map +1 -0
  165. package/form-dialog/cjs/package.json +13 -0
  166. package/form-dialog/form-dialog.d.ts +1 -1
  167. package/form-dialog/index.js +1 -1
  168. package/form-dialog/index.js.map +1 -1
  169. package/form-dialog/package.json +1 -1
  170. package/generators/cjs/index.js +2 -0
  171. package/generators/cjs/index.js.map +1 -0
  172. package/generators/cjs/package.json +7 -0
  173. package/generators/package.json +1 -1
  174. package/group-value-card/cjs/index.js +2 -0
  175. package/group-value-card/cjs/index.js.map +1 -0
  176. package/group-value-card/cjs/package.json +11 -0
  177. package/group-value-card/group-value-card.d.ts +1 -1
  178. package/group-value-card/index.js +1 -1
  179. package/group-value-card/index.js.map +1 -1
  180. package/group-value-card/package.json +1 -1
  181. package/header/cjs/index.js +2 -0
  182. package/header/cjs/index.js.map +1 -0
  183. package/header/cjs/package.json +12 -0
  184. package/header/index.js +1 -1
  185. package/header/index.js.map +1 -1
  186. package/header/package.json +1 -1
  187. package/header-layout/cjs/index.js +2 -0
  188. package/header-layout/cjs/index.js.map +1 -0
  189. package/header-layout/cjs/package.json +12 -0
  190. package/header-layout/index.js +1 -1
  191. package/header-layout/index.js.map +1 -1
  192. package/header-layout/package.json +1 -1
  193. package/hooks/cjs/index.js +2 -0
  194. package/hooks/cjs/index.js.map +1 -0
  195. package/hooks/cjs/package.json +11 -0
  196. package/hooks/package.json +1 -1
  197. package/index.js +4 -4
  198. package/index.js.map +1 -1
  199. package/label/cjs/index.js +2 -0
  200. package/label/cjs/index.js.map +1 -0
  201. package/label/cjs/package.json +11 -0
  202. package/label/index.js +1 -1
  203. package/label/index.js.map +1 -1
  204. package/label/label.d.ts +1 -1
  205. package/label/package.json +1 -1
  206. package/link/cjs/index.js +2 -0
  207. package/link/cjs/index.js.map +1 -0
  208. package/link/cjs/package.json +12 -0
  209. package/link/index.js +1 -1
  210. package/link/index.js.map +1 -1
  211. package/link/link.d.ts +5 -5
  212. package/link/package.json +1 -1
  213. package/link-card/cjs/index.js +2 -0
  214. package/link-card/cjs/index.js.map +1 -0
  215. package/link-card/cjs/package.json +12 -0
  216. package/link-card/index.js +1 -1
  217. package/link-card/index.js.map +1 -1
  218. package/link-card/link-card.d.ts +1 -1
  219. package/link-card/package.json +1 -1
  220. package/list-panel/cjs/index.js +2 -0
  221. package/list-panel/cjs/index.js.map +1 -0
  222. package/list-panel/cjs/package.json +11 -0
  223. package/list-panel/index.js +1 -1
  224. package/list-panel/index.js.map +1 -1
  225. package/list-panel/package.json +1 -1
  226. package/loading-area/cjs/index.js +2 -0
  227. package/loading-area/cjs/index.js.map +1 -0
  228. package/loading-area/cjs/package.json +11 -0
  229. package/loading-area/index.js +1 -1
  230. package/loading-area/index.js.map +1 -1
  231. package/loading-area/package.json +1 -1
  232. package/lorem-ipsum-placeholder/cjs/index.js +2 -0
  233. package/lorem-ipsum-placeholder/cjs/index.js.map +1 -0
  234. package/lorem-ipsum-placeholder/cjs/package.json +12 -0
  235. package/lorem-ipsum-placeholder/index.js +1 -1
  236. package/lorem-ipsum-placeholder/index.js.map +1 -1
  237. package/lorem-ipsum-placeholder/package.json +1 -1
  238. package/markdown/cjs/index.js +2 -0
  239. package/markdown/cjs/index.js.map +1 -0
  240. package/markdown/cjs/package.json +12 -0
  241. package/markdown/index.js +1 -1
  242. package/markdown/index.js.map +1 -1
  243. package/markdown/package.json +1 -1
  244. package/model-form/cjs/index.js +2 -0
  245. package/model-form/cjs/index.js.map +1 -0
  246. package/model-form/cjs/package.json +12 -0
  247. package/model-form/index.js +1 -1
  248. package/model-form/index.js.map +1 -1
  249. package/model-form/model-form.d.ts +1 -1
  250. package/model-form/package.json +1 -1
  251. package/model-router/cjs/index.js +24 -0
  252. package/model-router/cjs/index.js.map +1 -0
  253. package/model-router/cjs/package.json +16 -0
  254. package/model-router/index.js +4 -4
  255. package/model-router/index.js.map +1 -1
  256. package/model-router/model-router.d.ts +1 -1
  257. package/model-router/package.json +1 -1
  258. package/model-router/screens/screens.types.d.ts +1 -1
  259. package/model-router/screens/update-screen.d.ts +2 -2
  260. package/model-router/stories/templates.d.ts +7 -7
  261. package/notification-center/cjs/index.js +2 -0
  262. package/notification-center/cjs/index.js.map +1 -0
  263. package/notification-center/cjs/package.json +11 -0
  264. package/notification-center/index.js +1 -1
  265. package/notification-center/index.js.map +1 -1
  266. package/notification-center/notification-center.context.d.ts +3 -3
  267. package/notification-center/package.json +1 -1
  268. package/object-details/cjs/index.js +2 -0
  269. package/object-details/cjs/index.js.map +1 -0
  270. package/object-details/cjs/package.json +15 -0
  271. package/object-details/index.js +1 -1
  272. package/object-details/index.js.map +1 -1
  273. package/object-details/package.json +1 -1
  274. package/package.json +1 -1
  275. package/placeholder/cjs/index.js +2 -0
  276. package/placeholder/cjs/index.js.map +1 -0
  277. package/placeholder/cjs/package.json +11 -0
  278. package/placeholder/index.js +1 -1
  279. package/placeholder/index.js.map +1 -1
  280. package/placeholder/package.json +1 -1
  281. package/query-container/cjs/index.js +2 -0
  282. package/query-container/cjs/index.js.map +1 -0
  283. package/query-container/cjs/package.json +11 -0
  284. package/query-container/index.js +1 -1
  285. package/query-container/index.js.map +1 -1
  286. package/query-container/package.json +1 -1
  287. package/search-input/cjs/index.js +2 -0
  288. package/search-input/cjs/index.js.map +1 -0
  289. package/search-input/cjs/package.json +13 -0
  290. package/search-input/index.js +1 -1
  291. package/search-input/index.js.map +1 -1
  292. package/search-input/package.json +1 -1
  293. package/search-input/search-input.d.ts +1 -1
  294. package/select/cjs/index.js +2 -0
  295. package/select/cjs/index.js.map +1 -0
  296. package/select/cjs/package.json +11 -0
  297. package/select/index.js +1 -1
  298. package/select/index.js.map +1 -1
  299. package/select/package.json +1 -1
  300. package/select/select.d.ts +2 -2
  301. package/sign-in/cjs/index.js +2 -0
  302. package/sign-in/cjs/index.js.map +1 -0
  303. package/sign-in/cjs/package.json +12 -0
  304. package/sign-in/index.js +1 -1
  305. package/sign-in/index.js.map +1 -1
  306. package/sign-in/package.json +1 -1
  307. package/skeleton-card/cjs/index.js +2 -0
  308. package/skeleton-card/cjs/index.js.map +1 -0
  309. package/skeleton-card/cjs/package.json +11 -0
  310. package/skeleton-card/index.js +1 -1
  311. package/skeleton-card/index.js.map +1 -1
  312. package/skeleton-card/package.json +1 -1
  313. package/skeleton-grid/cjs/index.js +2 -0
  314. package/skeleton-grid/cjs/index.js.map +1 -0
  315. package/skeleton-grid/cjs/package.json +11 -0
  316. package/skeleton-grid/index.js +1 -1
  317. package/skeleton-grid/index.js.map +1 -1
  318. package/skeleton-grid/package.json +1 -1
  319. package/tab-card/cjs/index.js +2 -0
  320. package/tab-card/cjs/index.js.map +1 -0
  321. package/tab-card/cjs/package.json +11 -0
  322. package/tab-card/index.js +1 -1
  323. package/tab-card/index.js.map +1 -1
  324. package/tab-card/package.json +1 -1
  325. package/tab-panel/cjs/index.js +2 -0
  326. package/tab-panel/cjs/index.js.map +1 -0
  327. package/tab-panel/cjs/package.json +11 -0
  328. package/tab-panel/index.js +1 -1
  329. package/tab-panel/index.js.map +1 -1
  330. package/tab-panel/package.json +1 -1
  331. package/tab-panel/tab-panel.d.ts +1 -1
  332. package/tab-provider/cjs/index.js +2 -0
  333. package/tab-provider/cjs/index.js.map +1 -0
  334. package/tab-provider/cjs/package.json +10 -0
  335. package/tab-provider/index.js +1 -1
  336. package/tab-provider/index.js.map +1 -1
  337. package/tab-provider/package.json +1 -1
  338. package/table-list/cjs/index.js +24 -0
  339. package/table-list/cjs/index.js.map +1 -0
  340. package/table-list/cjs/package.json +12 -0
  341. package/table-list/index.js +4 -4
  342. package/table-list/index.js.map +1 -1
  343. package/table-list/package.json +1 -1
  344. package/table-list/table-list.d.ts +2 -2
  345. package/text-field/cjs/index.js +2 -0
  346. package/text-field/cjs/index.js.map +1 -0
  347. package/text-field/cjs/package.json +11 -0
  348. package/text-field/index.js +1 -23
  349. package/text-field/index.js.map +1 -1
  350. package/text-field/package.json +1 -1
  351. package/text-field/text-field.d.ts +1 -1
  352. package/utils/cjs/index.js +2 -0
  353. package/utils/cjs/index.js.map +1 -0
  354. package/utils/cjs/package.json +10 -0
  355. package/utils/package.json +1 -1
  356. package/value-base/cjs/index.js +2 -0
  357. package/value-base/cjs/index.js.map +1 -0
  358. package/value-base/cjs/package.json +12 -0
  359. package/value-base/index.js +1 -1
  360. package/value-base/index.js.map +1 -1
  361. package/value-base/package.json +1 -1
  362. package/value-base/value-edit.d.ts +3 -3
  363. package/value-boolean/cjs/index.js +2 -0
  364. package/value-boolean/cjs/index.js.map +1 -0
  365. package/value-boolean/cjs/package.json +12 -0
  366. package/value-boolean/index.js +1 -1
  367. package/value-boolean/index.js.map +1 -1
  368. package/value-boolean/package.json +1 -1
  369. package/value-boolean/value-boolean.d.ts +1 -1
  370. package/value-card/cjs/index.js +2 -0
  371. package/value-card/cjs/index.js.map +1 -0
  372. package/value-card/cjs/package.json +11 -0
  373. package/value-card/index.js +1 -1
  374. package/value-card/index.js.map +1 -1
  375. package/value-card/package.json +1 -1
  376. package/value-content/cjs/index.js +2 -0
  377. package/value-content/cjs/index.js.map +1 -0
  378. package/value-content/cjs/package.json +11 -0
  379. package/value-content/index.js +1 -1
  380. package/value-content/index.js.map +1 -1
  381. package/value-content/package.json +1 -1
  382. package/value-content/value-content.d.ts +2 -2
  383. package/value-datetime/cjs/index.js +2 -0
  384. package/value-datetime/cjs/index.js.map +1 -0
  385. package/value-datetime/cjs/package.json +14 -0
  386. package/value-datetime/index.js +1 -1
  387. package/value-datetime/index.js.map +1 -1
  388. package/value-datetime/package.json +1 -1
  389. package/value-datetime/value-datetime.d.ts +1 -1
  390. package/value-image/cjs/index.js +2 -0
  391. package/value-image/cjs/index.js.map +1 -0
  392. package/value-image/cjs/package.json +11 -0
  393. package/value-image/index.js +1 -1
  394. package/value-image/index.js.map +1 -1
  395. package/value-image/package.json +1 -1
  396. package/value-image/value-image.d.ts +1 -1
  397. package/value-item/cjs/index.js +2 -0
  398. package/value-item/cjs/index.js.map +1 -0
  399. package/value-item/cjs/package.json +11 -0
  400. package/value-item/index.js +1 -1
  401. package/value-item/index.js.map +1 -1
  402. package/value-item/package.json +1 -1
  403. package/value-item/value-item.d.ts +1 -1
  404. package/value-label/cjs/index.js +2 -0
  405. package/value-label/cjs/index.js.map +1 -0
  406. package/value-label/cjs/package.json +12 -0
  407. package/value-label/index.js +1 -1
  408. package/value-label/index.js.map +1 -1
  409. package/value-label/package.json +1 -1
  410. package/value-label/value-label.d.ts +1 -1
  411. package/value-rating/cjs/index.js +2 -0
  412. package/value-rating/cjs/index.js.map +1 -0
  413. package/value-rating/cjs/package.json +12 -0
  414. package/value-rating/index.js +1 -1
  415. package/value-rating/index.js.map +1 -1
  416. package/value-rating/package.json +1 -1
  417. package/value-rating/value-rating.d.ts +1 -1
  418. package/value-text/cjs/index.js +2 -0
  419. package/value-text/cjs/index.js.map +1 -0
  420. package/value-text/cjs/package.json +12 -0
  421. package/value-text/index.js +1 -1
  422. package/value-text/index.js.map +1 -1
  423. package/value-text/package.json +1 -1
  424. package/value-text/value-text.d.ts +1 -1
@@ -0,0 +1,2 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("@mui/material/Grid"),i=require("@mui/material/Button"),r=require("@mui/material/Typography"),l=require("@mui/material/DialogContentText"),a=require("@mui/material/styles"),n=require("react"),o=require("@mui/material/Dialog"),c=require("@mui/material/DialogTitle"),s=require("@mui/material/DialogActions"),d=require("@mui/material/IconButton"),u=require("@mui/material/DialogContent"),p=require("@mui/material/CircularProgress"),m=require("@mui/material/Box"),x=require("@mui/lab/LoadingButton"),h=require("@mui/icons-material/Close"),f=require("@mui/material/TextField");function j(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var C=j(t),b=j(i),g=j(r),y=j(l),q=j(o),T=j(c),v=j(s),A=j(d),k=j(u),D=j(p),B=j(m),V=j(x),O=j(h),I=j(f);const P=({title:t,titleVariant:i="h4",variant:r="primary"})=>{const{palette:l}=a.useTheme(),n={primary:void 0,error:"error",warning:l.warning.main,success:l.success.main};return e.jsx(g.default,{color:n[r],variant:i,pb:1,borderBottom:1,borderColor:"grey.300",children:t})},W=({open:t,title:i,component:r,componentProps:l={},disabled:a,disableAccept:n,disableCancel:o,actions:c=[],children:s,loading:d,cancelable:u,callCloseWhenCancel:p=!0,acceptable:m,acceptText:x="Accept",cancelText:h="Cancel",onAccept:f,onCancel:j=(()=>null),onClose:C,acceptType:g="button"})=>{const y=c.length>0||m||u;return e.jsxs(q.default,{open:t,onClose:C,children:[e.jsxs(T.default,{sx:{display:"flex",alignItems:"center"},children:[i,d&&!m&&e.jsx(D.default,{size:20,sx:{ml:2,color:e=>e.palette.grey[500]}}),e.jsx(A.default,{disabled:a,"aria-label":"close",onClick:C,sx:{position:"absolute",right:8,top:8,color:e=>e.palette.grey[500]},children:e.jsx(O.default,{})})]}),e.jsxs(B.default,{component:r,...l,children:[e.jsx(k.default,{dividers:!0,children:s}),y&&e.jsxs(v.default,{children:[c.map((({id:t,text:i,type:r="button",onClick:l,color:n="primary"})=>e.jsx(b.default,{type:r,disabled:a,onClick:l,color:n,children:i},t))),u&&e.jsx(b.default,{color:"error",disabled:a||o,onClick:()=>{j(),p&&C()},children:h}),m&&e.jsx(V.default,{type:g,loading:d,disabled:a||n,onClick:f,children:x})]})]})]})},w=({open:t,title:i,loading:r,disabled:l,confirmText:a="Confirm",cancelText:o="Cancel",passphrase:c,children:s,onConfirm:d,onCancel:u})=>{const[p,m]=n.useState(""),x=!c||p===c;return e.jsxs(W,{title:i,loading:r,disabled:r||l,disableAccept:!x,open:t,onClose:u,acceptable:!0,cancelable:!0,callCloseWhenCancel:!1,acceptText:a,cancelText:o,onCancel:u,onAccept:d,children:[s,c&&e.jsx(I.default,{size:"small",fullWidth:!0,value:p,onChange:e=>m(e.target.value),placeholder:c})]})};exports.Action=({variant:t="primary",title:i,titleVariant:r="h4",description:l,descriptionVariant:a="body2",buttonText:o,helperText:c,helperTextVariant:s="caption",confirmable:d,passphrase:u,confirmTitle:p="",confirmDescription:m="",onAction:x})=>{const{isOpen:h,open:f,close:j}=((e=!1)=>{const[t,i]=n.useState(e);return{isOpen:t,open:()=>i(!0),close:()=>i(!1),setIsOpen:i}})();return e.jsxs(e.Fragment,{children:[e.jsxs(C.default,{container:!0,spacing:1,children:[e.jsx(C.default,{item:!0,xs:12,mb:2,children:e.jsx(P,{title:i,titleVariant:r})}),l&&e.jsx(C.default,{item:!0,xs:12,children:e.jsx(g.default,{variant:a,children:l})}),e.jsx(C.default,{item:!0,xs:12,mt:1,children:e.jsx(b.default,{color:t,variant:"contained",onClick:()=>{d?f():x()},children:o})}),c&&e.jsx(C.default,{item:!0,xs:12,children:e.jsx(g.default,{variant:s,children:c})})]}),e.jsx(w,{open:h,title:p,passphrase:u,onCancel:j,onConfirm:()=>{x()},children:e.jsx(y.default,{children:m})})]})},exports.ActionHeader=P;
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":["../../../src/action/action-header.tsx","../../../src/bootstrap-dialog/bootstrap-dialog.tsx","../../../src/confirm-dialog/confirm-dialog.tsx","../../../src/action/action.tsx","../../../src/dialog/use-dialog.ts"],"sourcesContent":["import Typography from \"@mui/material/Typography\";\nimport { useTheme } from \"@mui/material/styles\";\nimport { Variant } from \"@mui/material/styles/createTypography\";\n\ntype ActionVariant = \"primary\" | \"error\" | \"warning\" | \"success\";\n\nexport interface ActionHeaderProps {\n variant?: ActionVariant;\n title: string;\n titleVariant?: Extract<Variant, \"h4\" | \"h5\" | \"h6\">;\n}\n\nexport const ActionHeader = ({\n title,\n titleVariant = \"h4\",\n variant = \"primary\",\n}: ActionHeaderProps) => {\n const { palette } = useTheme();\n\n const titleColor: Record<ActionVariant, string | undefined> = {\n primary: undefined,\n error: \"error\",\n warning: palette.warning.main,\n success: palette.success.main,\n };\n return (\n <Typography\n color={titleColor[variant]}\n variant={titleVariant}\n pb={1}\n borderBottom={1}\n borderColor=\"grey.300\"\n >\n {title}\n </Typography>\n );\n};\n","import Dialog from \"@mui/material/Dialog\";\nimport DialogTitle from \"@mui/material/DialogTitle\";\nimport DialogActions from \"@mui/material/DialogActions\";\nimport IconButton from \"@mui/material/IconButton\";\nimport DialogContent from \"@mui/material/DialogContent\";\nimport CircularProgress from \"@mui/material/CircularProgress\";\nimport Box from \"@mui/material/Box\";\nimport Button from \"@mui/material/Button\";\nimport LoadingButton from \"@mui/lab/LoadingButton\";\nimport CloseIcon from \"@mui/icons-material/Close\";\nimport { BootstrapDialogDialogProps } from \"~/dialog/dialog.types\";\n\nexport const BootstrapDialog = ({\n open,\n title,\n component,\n componentProps = {},\n disabled,\n disableAccept,\n disableCancel,\n actions = [],\n children,\n loading,\n cancelable,\n callCloseWhenCancel = true,\n acceptable,\n acceptText = \"Accept\",\n cancelText = \"Cancel\",\n onAccept,\n onCancel = () => null,\n onClose,\n acceptType = \"button\",\n}: BootstrapDialogDialogProps) => {\n const hasActions = actions.length > 0 || acceptable || cancelable;\n\n return (\n <Dialog open={open} onClose={onClose}>\n <DialogTitle sx={{ display: \"flex\", alignItems: \"center\" }}>\n {title}\n {loading && !acceptable && (\n <CircularProgress size={20} sx={{ ml: 2, color: (theme) => theme.palette.grey[500] }} />\n )}\n <IconButton\n disabled={disabled}\n aria-label=\"close\"\n onClick={onClose}\n sx={{\n position: \"absolute\",\n right: 8,\n top: 8,\n color: (theme) => theme.palette.grey[500],\n }}\n >\n <CloseIcon />\n </IconButton>\n </DialogTitle>\n <Box component={component} {...componentProps}>\n <DialogContent dividers>{children}</DialogContent>\n {hasActions && (\n <DialogActions>\n {actions.map(({ id, text, type = \"button\", onClick, color = \"primary\" }) => (\n <Button key={id} type={type} disabled={disabled} onClick={onClick} color={color}>\n {text}\n </Button>\n ))}\n {cancelable && (\n <Button\n color=\"error\"\n disabled={disabled || disableCancel}\n onClick={() => {\n onCancel();\n callCloseWhenCancel && onClose();\n }}\n >\n {cancelText}\n </Button>\n )}\n\n {acceptable && (\n <LoadingButton\n type={acceptType}\n loading={loading}\n disabled={disabled || disableAccept}\n onClick={onAccept}\n >\n {acceptText}\n </LoadingButton>\n )}\n </DialogActions>\n )}\n </Box>\n </Dialog>\n );\n};\n","import { useState } from \"react\";\nimport { BootstrapDialog } from \"~/bootstrap-dialog\";\nimport { BootstrapDialogDialogProps } from \"~/dialog/dialog.types\";\nimport TextField from \"@mui/material/TextField\";\n\ntype OmitBaseDialogProps =\n | \"cancelable\"\n | \"acceptable\"\n | \"onAccept\"\n | \"onCancel\"\n | \"onClose\"\n | \"actions\"\n | \"callCloseWhenCancel\"\n | \"component\"\n | \"acceptType\";\nexport interface ConfirmDialogProps extends Omit<BootstrapDialogDialogProps, OmitBaseDialogProps> {\n confirmText?: string;\n canceText?: string;\n passphrase?: string;\n onCancel: () => void;\n onConfirm: () => void;\n}\n\nexport const ConfirmDialog = ({\n open,\n title,\n loading,\n disabled,\n confirmText = \"Confirm\",\n cancelText = \"Cancel\",\n passphrase,\n children,\n onConfirm,\n onCancel,\n}: ConfirmDialogProps) => {\n const [inputPassphrase, setInputPassphrase] = useState(\"\");\n const validPassphrase = !passphrase || inputPassphrase === passphrase;\n\n return (\n <BootstrapDialog\n title={title}\n loading={loading}\n disabled={loading || disabled}\n disableAccept={!validPassphrase}\n open={open}\n onClose={onCancel}\n acceptable\n cancelable\n callCloseWhenCancel={false}\n acceptText={confirmText}\n cancelText={cancelText}\n onCancel={onCancel}\n onAccept={onConfirm}\n >\n {children}\n {passphrase && (\n <TextField\n size=\"small\"\n fullWidth\n value={inputPassphrase}\n onChange={(e) => setInputPassphrase(e.target.value)}\n placeholder={passphrase}\n />\n )}\n </BootstrapDialog>\n );\n};\n","import Grid from \"@mui/material/Grid\";\nimport Button from \"@mui/material/Button\";\nimport Typography from \"@mui/material/Typography\";\nimport DialogContentText from \"@mui/material/DialogContentText\";\nimport { Variant } from \"@mui/material/styles/createTypography\";\nimport { ReactElement } from \"react\";\nimport { ActionHeader } from \"./action-header\";\nimport { ConfirmDialog } from \"~/confirm-dialog\";\nimport { useDialog } from \"~/dialog\";\n\nexport type ActionVariant = \"primary\" | \"error\" | \"warning\" | \"success\";\n\nexport interface ActionProps {\n variant: ActionVariant;\n title: string;\n titleVariant?: Extract<Variant, \"h4\" | \"h5\" | \"h6\">;\n description?: string | ReactElement;\n descriptionVariant?: Variant;\n helperText?: string;\n helperTextVariant?: Variant;\n buttonText: string;\n confirmable?: boolean;\n confirmTitle?: string;\n confirmDescription?: string;\n passphrase?: string;\n onAction: () => void;\n}\n\nexport const Action = ({\n variant = \"primary\",\n title,\n titleVariant = \"h4\",\n description,\n descriptionVariant = \"body2\",\n buttonText,\n helperText,\n helperTextVariant = \"caption\",\n confirmable,\n passphrase,\n confirmTitle = \"\",\n confirmDescription = \"\",\n onAction,\n}: ActionProps) => {\n const { isOpen, open, close } = useDialog();\n\n const handleClickActionButton = () => {\n if (confirmable) {\n open();\n } else {\n onAction();\n }\n };\n\n const handleConfirmDialog = () => {\n onAction();\n close;\n };\n\n return (\n <>\n <Grid container spacing={1}>\n <Grid item xs={12} mb={2}>\n <ActionHeader title={title} titleVariant={titleVariant} />\n </Grid>\n {description && (\n <Grid item xs={12}>\n <Typography variant={descriptionVariant}>{description}</Typography>\n </Grid>\n )}\n <Grid item xs={12} mt={1}>\n <Button color={variant} variant=\"contained\" onClick={handleClickActionButton}>\n {buttonText}\n </Button>\n </Grid>\n {helperText && (\n <Grid item xs={12}>\n <Typography variant={helperTextVariant}>{helperText}</Typography>\n </Grid>\n )}\n </Grid>\n <ConfirmDialog\n open={isOpen}\n title={confirmTitle}\n passphrase={passphrase}\n onCancel={close}\n onConfirm={handleConfirmDialog}\n >\n <DialogContentText>{confirmDescription}</DialogContentText>\n </ConfirmDialog>\n </>\n );\n};\n","import { useState } from \"react\";\n\nexport const useDialog = (intialOpen = false) => {\n const [isOpen, setIsOpen] = useState(intialOpen);\n\n const open = () => setIsOpen(true);\n const close = () => setIsOpen(false);\n\n return { isOpen, open, close, setIsOpen };\n};\n"],"names":["ActionHeader","title","titleVariant","variant","palette","useTheme","titleColor","primary","undefined","error","warning","main","success","_jsx","Typography","color","pb","borderBottom","borderColor","children","BootstrapDialog","open","component","componentProps","disabled","disableAccept","disableCancel","actions","loading","cancelable","callCloseWhenCancel","acceptable","acceptText","cancelText","onAccept","onCancel","onClose","acceptType","hasActions","length","_jsxs","Dialog","jsxs","DialogTitle","sx","display","alignItems","CircularProgress","size","ml","theme","grey","IconButton","onClick","position","right","top","CloseIcon","Box","jsx","DialogContent","dividers","DialogActions","map","id","text","type","Button","LoadingButton","ConfirmDialog","confirmText","passphrase","onConfirm","inputPassphrase","setInputPassphrase","useState","validPassphrase","TextField","fullWidth","value","onChange","e","target","placeholder","description","descriptionVariant","buttonText","helperText","helperTextVariant","confirmable","confirmTitle","confirmDescription","onAction","isOpen","close","intialOpen","setIsOpen","useDialog","_Fragment","Fragment","Grid","container","spacing","item","xs","mb","mt","DialogContentText"],"mappings":"21BAYa,MAAAA,EAAe,EAC1BC,QACAC,eAAe,KACfC,UAAU,cAEV,MAAMC,QAAEA,GAAYC,EAAAA,WAEdC,EAAwD,CAC5DC,aAASC,EACTC,MAAO,QACPC,QAASN,EAAQM,QAAQC,KACzBC,QAASR,EAAQQ,QAAQD,MAE3B,OACEE,EAAAA,IAACC,EAAAA,QAAU,CACTC,MAAOT,EAAWH,GAClBA,QAASD,EACTc,GAAI,EACJC,aAAc,EACdC,YAAY,WAAUC,SAErBlB,GAEH,ECvBSmB,EAAkB,EAC7BC,OACApB,QACAqB,YACAC,iBAAiB,CAAA,EACjBC,WACAC,gBACAC,gBACAC,UAAU,GACVR,WACAS,UACAC,aACAC,uBAAsB,EACtBC,aACAC,aAAa,SACbC,aAAa,SACbC,WACAC,WAAW,KAAM,MACjBC,UACAC,aAAa,aAEb,MAAMC,EAAaX,EAAQY,OAAS,GAAKR,GAAcF,EAEvD,OACEW,OAACC,EAAAA,QAAO,CAAApB,KAAMA,EAAMe,QAASA,EAC3BjB,SAAA,CAAAqB,EAAAE,KAACC,EAAW,QAAC,CAAAC,GAAI,CAAEC,QAAS,OAAQC,WAAY,UAAU3B,SAAA,CACvDlB,EACA2B,IAAYG,GACXlB,MAACkC,EAAgB,QAAA,CAACC,KAAM,GAAIJ,GAAI,CAAEK,GAAI,EAAGlC,MAAQmC,GAAUA,EAAM9C,QAAQ+C,KAAK,QAEhFtC,EAAAA,IAACu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EACN5F,MAAOyF,EACPnB,WAAYA,EACZpC,SAAU2D,EACVtB,UAhCsB,KAC1BoB,GAAU,EA+BwBzE,SAE9BN,EAAAA,IAAC8F,EAAAA,kBAAmBhB,QAGxB"}
@@ -0,0 +1,13 @@
1
+ {
2
+ "name": "@pautena/react-design-system/action",
3
+ "private": true,
4
+ "main": "./cjs/index.js",
5
+ "module": "./index.js",
6
+ "types": "./index.d.ts",
7
+ "dependencies": {
8
+ "@mui/icons-material": "^5.11.16",
9
+ "@mui/lab": "^5.0.0-alpha.134",
10
+ "@mui/material": "^5.13.6",
11
+ "react": "^18.2.0"
12
+ }
13
+ }
package/action/index.js CHANGED
@@ -1,2 +1,2 @@
1
- import{useTheme as e,Typography as t,Dialog as n,DialogTitle as l,CircularProgress as a,IconButton as r,Box as c,DialogContent as o,DialogActions as i,Button as m,TextField as s,Grid as p,DialogContentText as d}from"@mui/material";import b,{useState as C}from"react";import{LoadingButton as E}from"@mui/lab";import u from"@mui/icons-material/Close";const x=({title:n,titleVariant:l="h4",variant:a="primary"})=>{const{palette:r}=e(),c={primary:void 0,error:"error",warning:r.warning.main,success:r.success.main};return b.createElement(t,{color:c[a],variant:l,pb:1,borderBottom:1,borderColor:"grey.300"},n)},g=({open:e,title:t,component:s,componentProps:p={},disabled:d,disableAccept:C,disableCancel:x,actions:g=[],children:h,loading:y,cancelable:f,callCloseWhenCancel:T=!0,acceptable:v,acceptText:k="Accept",cancelText:A="Cancel",onAccept:V,onCancel:O=(()=>null),onClose:W,acceptType:w="button"})=>{const z=g.length>0||v||f;return b.createElement(n,{open:e,onClose:W},b.createElement(l,{sx:{display:"flex",alignItems:"center"}},t,y&&!v&&b.createElement(a,{size:20,sx:{ml:2,color:e=>e.palette.grey[500]}}),b.createElement(r,{disabled:d,"aria-label":"close",onClick:W,sx:{position:"absolute",right:8,top:8,color:e=>e.palette.grey[500]}},b.createElement(u,null))),b.createElement(c,{component:s,...p},b.createElement(o,{dividers:!0},h),z&&b.createElement(i,null,g.map((({id:e,text:t,type:n="button",onClick:l,color:a="primary"})=>b.createElement(m,{key:e,type:n,disabled:d,onClick:l,color:a},t))),f&&b.createElement(m,{color:"error",disabled:d||x,onClick:()=>{O(),T&&W()}},A),v&&b.createElement(E,{type:w,loading:y,disabled:d||C,onClick:V},k))))},h=({open:e,title:t,loading:n,disabled:l,confirmText:a="Confirm",cancelText:r="Cancel",passphrase:c,children:o,onConfirm:i,onCancel:m})=>{const[p,d]=C(""),E=!c||p===c;return b.createElement(g,{title:t,loading:n,disabled:n||l,disableAccept:!E,open:e,onClose:m,acceptable:!0,cancelable:!0,callCloseWhenCancel:!1,acceptText:a,cancelText:r,onCancel:m,onAccept:i},o,c&&b.createElement(s,{size:"small",fullWidth:!0,value:p,onChange:e=>d(e.target.value),placeholder:c}))},y=({variant:e="primary",title:n,titleVariant:l="h4",description:a,descriptionVariant:r="body2",buttonText:c,helperText:o,helperTextVariant:i="caption",confirmable:s,passphrase:E,confirmTitle:u="",confirmDescription:g="",onAction:y})=>{const{isOpen:f,open:T,close:v}=((e=!1)=>{const[t,n]=C(e);return{isOpen:t,open:()=>n(!0),close:()=>n(!1),setIsOpen:n}})();return b.createElement(b.Fragment,null,b.createElement(p,{container:!0,spacing:1},b.createElement(p,{item:!0,xs:12,mb:2},b.createElement(x,{title:n,titleVariant:l})),a&&b.createElement(p,{item:!0,xs:12},b.createElement(t,{variant:r},a)),b.createElement(p,{item:!0,xs:12,mt:1},b.createElement(m,{color:e,variant:"contained",onClick:()=>{s?T():y()}},c)),o&&b.createElement(p,{item:!0,xs:12},b.createElement(t,{variant:i},o))),b.createElement(h,{open:f,title:u,passphrase:E,onCancel:v,onConfirm:()=>{y()}},b.createElement(d,null,g)))};export{y as Action,x as ActionHeader};
1
+ import{jsx as e,jsxs as i,Fragment as r}from"react/jsx-runtime";import t from"@mui/material/Grid";import o from"@mui/material/Button";import n from"@mui/material/Typography";import l from"@mui/material/DialogContentText";import{useTheme as a}from"@mui/material/styles";import{useState as c}from"react";import m from"@mui/material/Dialog";import p from"@mui/material/DialogTitle";import s from"@mui/material/DialogActions";import d from"@mui/material/IconButton";import h from"@mui/material/DialogContent";import u from"@mui/material/CircularProgress";import C from"@mui/material/Box";import b from"@mui/lab/LoadingButton";import f from"@mui/icons-material/Close";import g from"@mui/material/TextField";const x=({title:i,titleVariant:r="h4",variant:t="primary"})=>{const{palette:o}=a(),l={primary:void 0,error:"error",warning:o.warning.main,success:o.success.main};return e(n,{color:l[t],variant:r,pb:1,borderBottom:1,borderColor:"grey.300",children:i})},y=({open:r,title:t,component:n,componentProps:l={},disabled:a,disableAccept:c,disableCancel:g,actions:x=[],children:y,loading:T,cancelable:v,callCloseWhenCancel:A=!0,acceptable:k,acceptText:D="Accept",cancelText:B="Cancel",onAccept:V,onCancel:I=(()=>null),onClose:O,acceptType:W="button"})=>{const w=x.length>0||k||v;return i(m,{open:r,onClose:O,children:[i(p,{sx:{display:"flex",alignItems:"center"},children:[t,T&&!k&&e(u,{size:20,sx:{ml:2,color:e=>e.palette.grey[500]}}),e(d,{disabled:a,"aria-label":"close",onClick:O,sx:{position:"absolute",right:8,top:8,color:e=>e.palette.grey[500]},children:e(f,{})})]}),i(C,{component:n,...l,children:[e(h,{dividers:!0,children:y}),w&&i(s,{children:[x.map((({id:i,text:r,type:t="button",onClick:n,color:l="primary"})=>e(o,{type:t,disabled:a,onClick:n,color:l,children:r},i))),v&&e(o,{color:"error",disabled:a||g,onClick:()=>{I(),A&&O()},children:B}),k&&e(b,{type:W,loading:T,disabled:a||c,onClick:V,children:D})]})]})]})},T=({open:r,title:t,loading:o,disabled:n,confirmText:l="Confirm",cancelText:a="Cancel",passphrase:m,children:p,onConfirm:s,onCancel:d})=>{const[h,u]=c("");return i(y,{title:t,loading:o,disabled:o||n,disableAccept:!(!m||h===m),open:r,onClose:d,acceptable:!0,cancelable:!0,callCloseWhenCancel:!1,acceptText:l,cancelText:a,onCancel:d,onAccept:s,children:[p,m&&e(g,{size:"small",fullWidth:!0,value:h,onChange:e=>u(e.target.value),placeholder:m})]})},v=({variant:a="primary",title:m,titleVariant:p="h4",description:s,descriptionVariant:d="body2",buttonText:h,helperText:u,helperTextVariant:C="caption",confirmable:b,passphrase:f,confirmTitle:g="",confirmDescription:y="",onAction:v})=>{const{isOpen:A,open:k,close:D}=((e=!1)=>{const[i,r]=c(e);return{isOpen:i,open:()=>r(!0),close:()=>r(!1),setIsOpen:r}})();return i(r,{children:[i(t,{container:!0,spacing:1,children:[e(t,{item:!0,xs:12,mb:2,children:e(x,{title:m,titleVariant:p})}),s&&e(t,{item:!0,xs:12,children:e(n,{variant:d,children:s})}),e(t,{item:!0,xs:12,mt:1,children:e(o,{color:a,variant:"contained",onClick:()=>{b?k():v()},children:h})}),u&&e(t,{item:!0,xs:12,children:e(n,{variant:C,children:u})})]}),e(T,{open:A,title:g,passphrase:f,onCancel:D,onConfirm:()=>{v()},children:e(l,{children:y})})]})};export{v as Action,x as ActionHeader};
2
2
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../src/action/action-header.tsx","../../src/bootstrap-dialog/bootstrap-dialog.tsx","../../src/confirm-dialog/confirm-dialog.tsx","../../src/action/action.tsx","../../src/dialog/use-dialog.ts"],"sourcesContent":["import { Typography, useTheme } from \"@mui/material\";\nimport { Variant } from \"@mui/material/styles/createTypography\";\nimport React from \"react\";\n\ntype ActionVariant = \"primary\" | \"error\" | \"warning\" | \"success\";\n\nexport interface ActionHeaderProps {\n variant?: ActionVariant;\n title: string;\n titleVariant?: Extract<Variant, \"h4\" | \"h5\" | \"h6\">;\n}\n\nexport const ActionHeader = ({\n title,\n titleVariant = \"h4\",\n variant = \"primary\",\n}: ActionHeaderProps) => {\n const { palette } = useTheme();\n\n const titleColor: Record<ActionVariant, string | undefined> = {\n primary: undefined,\n error: \"error\",\n warning: palette.warning.main,\n success: palette.success.main,\n };\n return (\n <Typography\n color={titleColor[variant]}\n variant={titleVariant}\n pb={1}\n borderBottom={1}\n borderColor=\"grey.300\"\n >\n {title}\n </Typography>\n );\n};\n","import {\n Dialog,\n DialogTitle,\n DialogActions,\n Button,\n IconButton,\n DialogContent,\n Box,\n CircularProgress,\n} from \"@mui/material\";\nimport { LoadingButton } from \"@mui/lab\";\nimport CloseIcon from \"@mui/icons-material/Close\";\nimport React from \"react\";\nimport { BootstrapDialogDialogProps } from \"../dialog/dialog.types\";\n\nexport const BootstrapDialog = ({\n open,\n title,\n component,\n componentProps = {},\n disabled,\n disableAccept,\n disableCancel,\n actions = [],\n children,\n loading,\n cancelable,\n callCloseWhenCancel = true,\n acceptable,\n acceptText = \"Accept\",\n cancelText = \"Cancel\",\n onAccept,\n onCancel = () => null,\n onClose,\n acceptType = \"button\",\n}: BootstrapDialogDialogProps) => {\n const hasActions = actions.length > 0 || acceptable || cancelable;\n\n return (\n <Dialog open={open} onClose={onClose}>\n <DialogTitle sx={{ display: \"flex\", alignItems: \"center\" }}>\n {title}\n {loading && !acceptable && (\n <CircularProgress size={20} sx={{ ml: 2, color: (theme) => theme.palette.grey[500] }} />\n )}\n <IconButton\n disabled={disabled}\n aria-label=\"close\"\n onClick={onClose}\n sx={{\n position: \"absolute\",\n right: 8,\n top: 8,\n color: (theme) => theme.palette.grey[500],\n }}\n >\n <CloseIcon />\n </IconButton>\n </DialogTitle>\n <Box component={component} {...componentProps}>\n <DialogContent dividers>{children}</DialogContent>\n {hasActions && (\n <DialogActions>\n {actions.map(({ id, text, type = \"button\", onClick, color = \"primary\" }) => (\n <Button key={id} type={type} disabled={disabled} onClick={onClick} color={color}>\n {text}\n </Button>\n ))}\n {cancelable && (\n <Button\n color=\"error\"\n disabled={disabled || disableCancel}\n onClick={() => {\n onCancel();\n callCloseWhenCancel && onClose();\n }}\n >\n {cancelText}\n </Button>\n )}\n\n {acceptable && (\n <LoadingButton\n type={acceptType}\n loading={loading}\n disabled={disabled || disableAccept}\n onClick={onAccept}\n >\n {acceptText}\n </LoadingButton>\n )}\n </DialogActions>\n )}\n </Box>\n </Dialog>\n );\n};\n","import React, { useState } from \"react\";\nimport { BootstrapDialog } from \"../bootstrap-dialog\";\nimport { BootstrapDialogDialogProps } from \"../dialog/dialog.types\";\nimport { TextField } from \"@mui/material\";\n\ntype OmitBaseDialogProps =\n | \"cancelable\"\n | \"acceptable\"\n | \"onAccept\"\n | \"onCancel\"\n | \"onClose\"\n | \"actions\"\n | \"callCloseWhenCancel\"\n | \"component\"\n | \"acceptType\";\nexport interface ConfirmDialogProps extends Omit<BootstrapDialogDialogProps, OmitBaseDialogProps> {\n confirmText?: string;\n canceText?: string;\n passphrase?: string;\n onCancel: () => void;\n onConfirm: () => void;\n}\n\nexport const ConfirmDialog = ({\n open,\n title,\n loading,\n disabled,\n confirmText = \"Confirm\",\n cancelText = \"Cancel\",\n passphrase,\n children,\n onConfirm,\n onCancel,\n}: ConfirmDialogProps) => {\n const [inputPassphrase, setInputPassphrase] = useState(\"\");\n const validPassphrase = !passphrase || inputPassphrase === passphrase;\n\n return (\n <BootstrapDialog\n title={title}\n loading={loading}\n disabled={loading || disabled}\n disableAccept={!validPassphrase}\n open={open}\n onClose={onCancel}\n acceptable\n cancelable\n callCloseWhenCancel={false}\n acceptText={confirmText}\n cancelText={cancelText}\n onCancel={onCancel}\n onAccept={onConfirm}\n >\n {children}\n {passphrase && (\n <TextField\n size=\"small\"\n fullWidth\n value={inputPassphrase}\n onChange={(e) => setInputPassphrase(e.target.value)}\n placeholder={passphrase}\n />\n )}\n </BootstrapDialog>\n );\n};\n","import { Grid, Button, Typography, DialogContentText } from \"@mui/material\";\nimport { Variant } from \"@mui/material/styles/createTypography\";\nimport React, { ReactElement } from \"react\";\nimport { ActionHeader } from \"./action-header\";\nimport { ConfirmDialog } from \"~/confirm-dialog\";\nimport { useDialog } from \"~/dialog\";\n\nexport type ActionVariant = \"primary\" | \"error\" | \"warning\" | \"success\";\n\nexport interface ActionProps {\n variant: ActionVariant;\n title: string;\n titleVariant?: Extract<Variant, \"h4\" | \"h5\" | \"h6\">;\n description?: string | ReactElement;\n descriptionVariant?: Variant;\n helperText?: string;\n helperTextVariant?: Variant;\n buttonText: string;\n confirmable?: boolean;\n confirmTitle?: string;\n confirmDescription?: string;\n passphrase?: string;\n onAction: () => void;\n}\n\nexport const Action = ({\n variant = \"primary\",\n title,\n titleVariant = \"h4\",\n description,\n descriptionVariant = \"body2\",\n buttonText,\n helperText,\n helperTextVariant = \"caption\",\n confirmable,\n passphrase,\n confirmTitle = \"\",\n confirmDescription = \"\",\n onAction,\n}: ActionProps) => {\n const { isOpen, open, close } = useDialog();\n\n const handleClickActionButton = () => {\n if (confirmable) {\n open();\n } else {\n onAction();\n }\n };\n\n const handleConfirmDialog = () => {\n onAction();\n close;\n };\n\n return (\n <>\n <Grid container spacing={1}>\n <Grid item xs={12} mb={2}>\n <ActionHeader title={title} titleVariant={titleVariant} />\n </Grid>\n {description && (\n <Grid item xs={12}>\n <Typography variant={descriptionVariant}>{description}</Typography>\n </Grid>\n )}\n <Grid item xs={12} mt={1}>\n <Button color={variant} variant=\"contained\" onClick={handleClickActionButton}>\n {buttonText}\n </Button>\n </Grid>\n {helperText && (\n <Grid item xs={12}>\n <Typography variant={helperTextVariant}>{helperText}</Typography>\n </Grid>\n )}\n </Grid>\n <ConfirmDialog\n open={isOpen}\n title={confirmTitle}\n passphrase={passphrase}\n onCancel={close}\n onConfirm={handleConfirmDialog}\n >\n <DialogContentText>{confirmDescription}</DialogContentText>\n </ConfirmDialog>\n </>\n );\n};\n","import { useState } from \"react\";\n\nexport const useDialog = (intialOpen = false) => {\n const [isOpen, setIsOpen] = useState(intialOpen);\n\n const open = () => setIsOpen(true);\n const close = () => setIsOpen(false);\n\n return { isOpen, open, close, setIsOpen };\n};\n"],"names":["ActionHeader","title","titleVariant","variant","palette","useTheme","titleColor","primary","undefined","error","warning","main","success","React","createElement","Typography","color","pb","borderBottom","borderColor","BootstrapDialog","open","component","componentProps","disabled","disableAccept","disableCancel","actions","children","loading","cancelable","callCloseWhenCancel","acceptable","acceptText","cancelText","onAccept","onCancel","onClose","acceptType","hasActions","length","Dialog","DialogTitle","sx","display","alignItems","CircularProgress","size","ml","theme","grey","IconButton","onClick","position","right","top","CloseIcon","Box","DialogContent","dividers","DialogActions","map","id","text","type","Button","key","LoadingButton","ConfirmDialog","confirmText","passphrase","onConfirm","inputPassphrase","setInputPassphrase","useState","validPassphrase","TextField","fullWidth","value","onChange","e","target","placeholder","Action","description","descriptionVariant","buttonText","helperText","helperTextVariant","confirmable","confirmTitle","confirmDescription","onAction","isOpen","close","intialOpen","setIsOpen","useDialog","Fragment","Grid","container","spacing","item","xs","mb","mt","DialogContentText"],"mappings":"6VAYa,MAAAA,EAAe,EAC1BC,QACAC,eAAe,KACfC,UAAU,cAEV,MAAMC,QAAEA,GAAYC,IAEdC,EAAwD,CAC5DC,aAASC,EACTC,MAAO,QACPC,QAASN,EAAQM,QAAQC,KACzBC,QAASR,EAAQQ,QAAQD,MAE3B,OACEE,EAAAC,cAACC,EAAU,CACTC,MAAOV,EAAWH,GAClBA,QAASD,EACTe,GAAI,EACJC,aAAc,EACdC,YAAY,YAEXlB,EAEH,ECpBSmB,EAAkB,EAC7BC,OACApB,QACAqB,YACAC,iBAAiB,CAAA,EACjBC,WACAC,gBACAC,gBACAC,UAAU,GACVC,WACAC,UACAC,aACAC,uBAAsB,EACtBC,aACAC,aAAa,SACbC,aAAa,SACbC,WACAC,WAAW,KAAM,MACjBC,UACAC,aAAa,aAEb,MAAMC,EAAaZ,EAAQa,OAAS,GAAKR,GAAcF,EAEvD,OACEjB,EAACC,cAAA2B,EAAO,CAAApB,KAAMA,EAAMgB,QAASA,GAC3BxB,EAAAC,cAAC4B,EAAW,CAACC,GAAI,CAAEC,QAAS,OAAQC,WAAY,WAC7C5C,EACA4B,IAAYG,GACXnB,gBAACiC,EAAgB,CAACC,KAAM,GAAIJ,GAAI,CAAEK,GAAI,EAAGhC,MAAQiC,GAAUA,EAAM7C,QAAQ8C,KAAK,QAEhFrC,EAAAC,cAAC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EC,OAAOH,OAC7CI,YAAaZ,IAInB,ECxCSa,EAAS,EACpBhF,UAAU,UACVF,QACAC,eAAe,KACfkF,cACAC,qBAAqB,QACrBC,aACAC,aACAC,oBAAoB,UACpBC,cACAnB,aACAoB,eAAe,GACfC,qBAAqB,GACrBC,eAEA,MAAMC,OAAEA,EAAMxE,KAAEA,EAAIyE,MAAEA,GCtCC,EAACC,GAAa,KACrC,MAAOF,EAAQG,GAAatB,EAASqB,GAKrC,MAAO,CAAEF,SAAQxE,KAHJ,IAAM2E,GAAU,GAGNF,MAFT,IAAME,GAAU,GAEAA,YAAW,EDgCTC,GAehC,OACEpF,EAAAC,cAAAD,EAAAqF,SAAA,KACErF,EAAAC,cAACqF,EAAK,CAAAC,WAAU,EAAAC,QAAS,GACvBxF,EAACC,cAAAqF,EAAK,CAAAG,MAAK,EAAAC,GAAI,GAAIC,GAAI,GACrB3F,EAACC,cAAAd,EAAa,CAAAC,MAAOA,EAAOC,aAAcA,KAE3CkF,GACCvE,EAACC,cAAAqF,GAAKG,MAAI,EAACC,GAAI,IACb1F,EAACC,cAAAC,GAAWZ,QAASkF,GAAqBD,IAG9CvE,EAACC,cAAAqF,EAAK,CAAAG,MAAK,EAAAC,GAAI,GAAIE,GAAI,GACrB5F,EAAAC,cAACmD,EAAO,CAAAjD,MAAOb,EAASA,QAAQ,YAAYiD,QAzBpB,KAC1BqC,EACFpE,IAEAuE,GACD,GAqBQN,IAGJC,GACC1E,EAACC,cAAAqF,GAAKG,MAAI,EAACC,GAAI,IACb1F,EAACC,cAAAC,EAAW,CAAAZ,QAASqF,GAAoBD,KAI/C1E,EAACC,cAAAsD,GACC/C,KAAMwE,EACN5F,MAAOyF,EACPpB,WAAYA,EACZlC,SAAU0D,EACVvB,UAhCsB,KAC1BqB,GAAU,GAiCN/E,EAAAC,cAAC4F,EAAmB,KAAAf,IAGxB"}
1
+ {"version":3,"file":"index.js","sources":["../../src/action/action-header.tsx","../../src/bootstrap-dialog/bootstrap-dialog.tsx","../../src/confirm-dialog/confirm-dialog.tsx","../../src/action/action.tsx","../../src/dialog/use-dialog.ts"],"sourcesContent":["import Typography from \"@mui/material/Typography\";\nimport { useTheme } from \"@mui/material/styles\";\nimport { Variant } from \"@mui/material/styles/createTypography\";\n\ntype ActionVariant = \"primary\" | \"error\" | \"warning\" | \"success\";\n\nexport interface ActionHeaderProps {\n variant?: ActionVariant;\n title: string;\n titleVariant?: Extract<Variant, \"h4\" | \"h5\" | \"h6\">;\n}\n\nexport const ActionHeader = ({\n title,\n titleVariant = \"h4\",\n variant = \"primary\",\n}: ActionHeaderProps) => {\n const { palette } = useTheme();\n\n const titleColor: Record<ActionVariant, string | undefined> = {\n primary: undefined,\n error: \"error\",\n warning: palette.warning.main,\n success: palette.success.main,\n };\n return (\n <Typography\n color={titleColor[variant]}\n variant={titleVariant}\n pb={1}\n borderBottom={1}\n borderColor=\"grey.300\"\n >\n {title}\n </Typography>\n );\n};\n","import Dialog from \"@mui/material/Dialog\";\nimport DialogTitle from \"@mui/material/DialogTitle\";\nimport DialogActions from \"@mui/material/DialogActions\";\nimport IconButton from \"@mui/material/IconButton\";\nimport DialogContent from \"@mui/material/DialogContent\";\nimport CircularProgress from \"@mui/material/CircularProgress\";\nimport Box from \"@mui/material/Box\";\nimport Button from \"@mui/material/Button\";\nimport LoadingButton from \"@mui/lab/LoadingButton\";\nimport CloseIcon from \"@mui/icons-material/Close\";\nimport { BootstrapDialogDialogProps } from \"~/dialog/dialog.types\";\n\nexport const BootstrapDialog = ({\n open,\n title,\n component,\n componentProps = {},\n disabled,\n disableAccept,\n disableCancel,\n actions = [],\n children,\n loading,\n cancelable,\n callCloseWhenCancel = true,\n acceptable,\n acceptText = \"Accept\",\n cancelText = \"Cancel\",\n onAccept,\n onCancel = () => null,\n onClose,\n acceptType = \"button\",\n}: BootstrapDialogDialogProps) => {\n const hasActions = actions.length > 0 || acceptable || cancelable;\n\n return (\n <Dialog open={open} onClose={onClose}>\n <DialogTitle sx={{ display: \"flex\", alignItems: \"center\" }}>\n {title}\n {loading && !acceptable && (\n <CircularProgress size={20} sx={{ ml: 2, color: (theme) => theme.palette.grey[500] }} />\n )}\n <IconButton\n disabled={disabled}\n aria-label=\"close\"\n onClick={onClose}\n sx={{\n position: \"absolute\",\n right: 8,\n top: 8,\n color: (theme) => theme.palette.grey[500],\n }}\n >\n <CloseIcon />\n </IconButton>\n </DialogTitle>\n <Box component={component} {...componentProps}>\n <DialogContent dividers>{children}</DialogContent>\n {hasActions && (\n <DialogActions>\n {actions.map(({ id, text, type = \"button\", onClick, color = \"primary\" }) => (\n <Button key={id} type={type} disabled={disabled} onClick={onClick} color={color}>\n {text}\n </Button>\n ))}\n {cancelable && (\n <Button\n color=\"error\"\n disabled={disabled || disableCancel}\n onClick={() => {\n onCancel();\n callCloseWhenCancel && onClose();\n }}\n >\n {cancelText}\n </Button>\n )}\n\n {acceptable && (\n <LoadingButton\n type={acceptType}\n loading={loading}\n disabled={disabled || disableAccept}\n onClick={onAccept}\n >\n {acceptText}\n </LoadingButton>\n )}\n </DialogActions>\n )}\n </Box>\n </Dialog>\n );\n};\n","import { useState } from \"react\";\nimport { BootstrapDialog } from \"~/bootstrap-dialog\";\nimport { BootstrapDialogDialogProps } from \"~/dialog/dialog.types\";\nimport TextField from \"@mui/material/TextField\";\n\ntype OmitBaseDialogProps =\n | \"cancelable\"\n | \"acceptable\"\n | \"onAccept\"\n | \"onCancel\"\n | \"onClose\"\n | \"actions\"\n | \"callCloseWhenCancel\"\n | \"component\"\n | \"acceptType\";\nexport interface ConfirmDialogProps extends Omit<BootstrapDialogDialogProps, OmitBaseDialogProps> {\n confirmText?: string;\n canceText?: string;\n passphrase?: string;\n onCancel: () => void;\n onConfirm: () => void;\n}\n\nexport const ConfirmDialog = ({\n open,\n title,\n loading,\n disabled,\n confirmText = \"Confirm\",\n cancelText = \"Cancel\",\n passphrase,\n children,\n onConfirm,\n onCancel,\n}: ConfirmDialogProps) => {\n const [inputPassphrase, setInputPassphrase] = useState(\"\");\n const validPassphrase = !passphrase || inputPassphrase === passphrase;\n\n return (\n <BootstrapDialog\n title={title}\n loading={loading}\n disabled={loading || disabled}\n disableAccept={!validPassphrase}\n open={open}\n onClose={onCancel}\n acceptable\n cancelable\n callCloseWhenCancel={false}\n acceptText={confirmText}\n cancelText={cancelText}\n onCancel={onCancel}\n onAccept={onConfirm}\n >\n {children}\n {passphrase && (\n <TextField\n size=\"small\"\n fullWidth\n value={inputPassphrase}\n onChange={(e) => setInputPassphrase(e.target.value)}\n placeholder={passphrase}\n />\n )}\n </BootstrapDialog>\n );\n};\n","import Grid from \"@mui/material/Grid\";\nimport Button from \"@mui/material/Button\";\nimport Typography from \"@mui/material/Typography\";\nimport DialogContentText from \"@mui/material/DialogContentText\";\nimport { Variant } from \"@mui/material/styles/createTypography\";\nimport { ReactElement } from \"react\";\nimport { ActionHeader } from \"./action-header\";\nimport { ConfirmDialog } from \"~/confirm-dialog\";\nimport { useDialog } from \"~/dialog\";\n\nexport type ActionVariant = \"primary\" | \"error\" | \"warning\" | \"success\";\n\nexport interface ActionProps {\n variant: ActionVariant;\n title: string;\n titleVariant?: Extract<Variant, \"h4\" | \"h5\" | \"h6\">;\n description?: string | ReactElement;\n descriptionVariant?: Variant;\n helperText?: string;\n helperTextVariant?: Variant;\n buttonText: string;\n confirmable?: boolean;\n confirmTitle?: string;\n confirmDescription?: string;\n passphrase?: string;\n onAction: () => void;\n}\n\nexport const Action = ({\n variant = \"primary\",\n title,\n titleVariant = \"h4\",\n description,\n descriptionVariant = \"body2\",\n buttonText,\n helperText,\n helperTextVariant = \"caption\",\n confirmable,\n passphrase,\n confirmTitle = \"\",\n confirmDescription = \"\",\n onAction,\n}: ActionProps) => {\n const { isOpen, open, close } = useDialog();\n\n const handleClickActionButton = () => {\n if (confirmable) {\n open();\n } else {\n onAction();\n }\n };\n\n const handleConfirmDialog = () => {\n onAction();\n close;\n };\n\n return (\n <>\n <Grid container spacing={1}>\n <Grid item xs={12} mb={2}>\n <ActionHeader title={title} titleVariant={titleVariant} />\n </Grid>\n {description && (\n <Grid item xs={12}>\n <Typography variant={descriptionVariant}>{description}</Typography>\n </Grid>\n )}\n <Grid item xs={12} mt={1}>\n <Button color={variant} variant=\"contained\" onClick={handleClickActionButton}>\n {buttonText}\n </Button>\n </Grid>\n {helperText && (\n <Grid item xs={12}>\n <Typography variant={helperTextVariant}>{helperText}</Typography>\n </Grid>\n )}\n </Grid>\n <ConfirmDialog\n open={isOpen}\n title={confirmTitle}\n passphrase={passphrase}\n onCancel={close}\n onConfirm={handleConfirmDialog}\n >\n <DialogContentText>{confirmDescription}</DialogContentText>\n </ConfirmDialog>\n </>\n );\n};\n","import { useState } from \"react\";\n\nexport const useDialog = (intialOpen = false) => {\n const [isOpen, setIsOpen] = useState(intialOpen);\n\n const open = () => setIsOpen(true);\n const close = () => setIsOpen(false);\n\n return { isOpen, open, close, setIsOpen };\n};\n"],"names":["ActionHeader","title","titleVariant","variant","palette","useTheme","titleColor","primary","undefined","error","warning","main","success","_jsx","Typography","color","pb","borderBottom","borderColor","children","BootstrapDialog","open","component","componentProps","disabled","disableAccept","disableCancel","actions","loading","cancelable","callCloseWhenCancel","acceptable","acceptText","cancelText","onAccept","onCancel","onClose","acceptType","hasActions","length","_jsxs","Dialog","DialogTitle","sx","display","alignItems","CircularProgress","size","ml","theme","grey","IconButton","onClick","position","right","top","CloseIcon","Box","DialogContent","dividers","DialogActions","map","id","text","type","Button","LoadingButton","ConfirmDialog","confirmText","passphrase","onConfirm","inputPassphrase","setInputPassphrase","useState","TextField","fullWidth","value","onChange","e","target","placeholder","Action","description","descriptionVariant","buttonText","helperText","helperTextVariant","confirmable","confirmTitle","confirmDescription","onAction","isOpen","close","intialOpen","setIsOpen","useDialog","_Fragment","Grid","container","spacing","item","xs","mb","mt","DialogContentText"],"mappings":"8rBAYa,MAAAA,EAAe,EAC1BC,QACAC,eAAe,KACfC,UAAU,cAEV,MAAMC,QAAEA,GAAYC,IAEdC,EAAwD,CAC5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rBzF,EAACb,EAAa,CAAAC,MAAOA,EAAOC,aAAcA,MAE3CgF,GACCrE,EAACoF,GAAKG,MAAI,EAACC,GAAI,GACblF,SAAAN,EAACC,EAAU,CAACX,QAASgF,EAAqBhE,SAAA+D,MAG9CrE,EAACoF,EAAI,CAACG,MAAI,EAACC,GAAI,GAAIE,GAAI,EAACpF,SACtBN,EAACoD,EAAO,CAAAlD,MAAOZ,EAASA,QAAQ,YAAYiD,QAzBpB,KAC1BmC,EACFlE,IAEAqE,GACD,EAqBQvE,SAAAiE,MAGJC,GACCxE,EAACoF,EAAI,CAACG,MAAK,EAAAC,GAAI,YACbxF,EAACC,EAAW,CAAAX,QAASmF,EAAiBnE,SAAGkE,SAI/CxE,EAACsD,EAAa,CACZ9C,KAAMsE,EACN1F,MAAOuF,EACPnB,WAAYA,EACZlC,SAAUyD,EACVtB,UAhCsB,KAC1BoB,GAAU,EA+BwBvE,SAE9BN,EAAC2F,YAAmBf,QAGxB"}
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@pautena/react-design-system/action",
3
3
  "private": true,
4
- "main": "../cjs/index.js",
4
+ "main": "./cjs/index.js",
5
5
  "module": "./index.js",
6
6
  "types": "./index.d.ts",
7
7
  "dependencies": {
@@ -1,5 +1,6 @@
1
- import { AutocompleteProps as MuiAutocompleteProps, ChipTypeMap } from "@mui/material";
1
+ import { AutocompleteProps as MuiAutocompleteProps } from "@mui/material/Autocomplete";
2
2
  import React from "react";
3
+ import { ChipTypeMap } from "@mui/material/Chip";
3
4
  export interface AutocompleteProps<T, Multiple extends boolean | undefined, DisableClearable extends boolean | undefined, FreeSolo extends boolean | undefined, ChipComponent extends React.ElementType = ChipTypeMap["defaultComponent"]> extends Omit<MuiAutocompleteProps<T, Multiple, DisableClearable, FreeSolo, ChipComponent>, "renderInput" | "onChange" | "color"> {
4
5
  label: string;
5
6
  helperText?: string;
@@ -0,0 +1,2 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("@mui/material/Autocomplete"),r=require("@mui/material/CircularProgress"),l=require("@mui/material/FormControl"),o=require("@mui/material/FormHelperText"),n=require("@mui/material/IconButton"),i=require("@mui/material/LinearProgress"),u=require("@mui/material/OutlinedInput"),s=require("@mui/material/InputLabel"),a=require("@mui/material/InputAdornment"),d=require("react");function c(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}function m(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(r){if("default"!==r){var l=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,l.get?l:{enumerable:!0,get:function(){return e[r]}})}})),t.default=e,Object.freeze(t)}var f=c(t),p=c(r),x=c(l),h=c(o),b=c(i),g=c(u),j=c(s),C=c(a),q=m(d);let $=0;const I=q["useId".toString()];function O(e){if(void 0!==I){const t=I();return null!=e?e:t}return function(e){const[t,r]=q.useState(e),l=e||t;return q.useEffect((()=>{null==t&&($+=1,r(`mui-${$}`))}),[t]),l}(e)}const P=({id:l,label:o,InputLabelProps:a,InputProps:d,fetching:c,loading:m,helperText:f,hexColor:q,size:$,fullWidth:I,sx:P,...v})=>{const A=O(l),y=f&&A?`${A}-helper-text`:void 0,z=o&&A?`${A}-label`:void 0,L=q?{[`& .${u.outlinedInputClasses.notchedOutline}`]:{borderColor:`${q} !important`},[`& .${s.inputLabelClasses.root}`]:{color:q},[`& .${u.outlinedInputClasses.input}`]:{color:q},[`& .${r.circularProgressClasses.root}`]:{color:q},[`& .${i.linearProgressClasses.bar}`]:{backgroundColor:q},[`& .${t.autocompleteClasses.endAdornment} .${n.iconButtonClasses.root}`]:{color:q}}:{};return e.jsxs(x.default,{sx:L,fullWidth:I,children:[e.jsx(j.default,{size:"small"===$?"small":"normal",id:z,htmlFor:A,...a,children:o}),e.jsx(g.default,{...d,id:A,label:o,size:$,fullWidth:I,endAdornment:e.jsxs(C.default,{position:"end",children:[d?.endAdornment,m?e.jsx(p.default,{color:"inherit",size:20,sx:{ml:1}}):null]}),sx:P,...v}),c&&!m&&e.jsx(b.default,{color:"inherit",sx:{position:"absolute",left:0,right:0,bottom:0}}),f&&e.jsx(h.default,{id:y,children:f})]})};exports.Autocomplete=t=>{const{label:r,loading:l,fetching:o,options:n,helperText:i,color:u,onChangeValue:s=(()=>null),sx:a,...d}=t,c=l||o;return e.jsx(f.default,{loading:c,options:o?[]:n,onChange:(e,t)=>s(t),...d,renderInput:t=>e.jsx(P,{...t,label:r,fullWidth:!0,fetching:o,loading:l,hexColor:u,helperText:i}),sx:a})};
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":["../../../node_modules/@mui/utils/esm/useId/useId.js","../../../src/text-field/text-field.tsx","../../../src/autocomplete/autocomplete.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nlet globalId = 0;\nfunction useGlobalId(idOverride) {\n const [defaultId, setDefaultId] = React.useState(idOverride);\n const id = idOverride || defaultId;\n React.useEffect(() => {\n if (defaultId == null) {\n // Fallback to this default id when possible.\n // Use the incrementing value for client-side rendering only.\n // We can't use it server-side.\n // If you want to use random values please consider the Birthday Problem: https://en.wikipedia.org/wiki/Birthday_problem\n globalId += 1;\n setDefaultId(`mui-${globalId}`);\n }\n }, [defaultId]);\n return id;\n}\n\n// downstream bundlers may remove unnecessary concatenation, but won't remove toString call -- Workaround for https://github.com/webpack/webpack/issues/14814\nconst maybeReactUseId = React['useId'.toString()];\n/**\n *\n * @example <div id={useId()} />\n * @param idOverride\n * @returns {string}\n */\nexport default function useId(idOverride) {\n if (maybeReactUseId !== undefined) {\n const reactId = maybeReactUseId();\n return idOverride != null ? idOverride : reactId;\n }\n // eslint-disable-next-line react-hooks/rules-of-hooks -- `React.useId` is invariant at runtime.\n return useGlobalId(idOverride);\n}","import { TextFieldProps as MuiTextFieldProps } from \"@mui/material/TextField\";\nimport CircularProgress, { circularProgressClasses } from \"@mui/material/CircularProgress\";\nimport FormControl from \"@mui/material/FormControl\";\nimport FormHelperText from \"@mui/material/FormHelperText\";\nimport { iconButtonClasses } from \"@mui/material/IconButton\";\nimport LinearProgress, { linearProgressClasses } from \"@mui/material/LinearProgress\";\nimport OutlinedInput, { outlinedInputClasses } from \"@mui/material/OutlinedInput\";\nimport InputLabel, { inputLabelClasses } from \"@mui/material/InputLabel\";\nimport InputAdornment from \"@mui/material/InputAdornment\";\nimport { autocompleteClasses } from \"@mui/material/Autocomplete\";\nimport useId from \"@mui/utils/useId\";\n\nexport type TextFieldProps = MuiTextFieldProps & {\n fetching?: boolean;\n loading?: boolean;\n hexColor?: string;\n};\n\nexport const TextField = ({\n id: overrideId,\n label,\n InputLabelProps,\n InputProps,\n fetching,\n loading,\n helperText,\n hexColor,\n size,\n fullWidth,\n sx,\n ...rest\n}: TextFieldProps) => {\n const id = useId(overrideId);\n const helperTextId = helperText && id ? `${id}-helper-text` : undefined;\n const inputLabelId = label && id ? `${id}-label` : undefined;\n\n const hexColorSx = hexColor\n ? {\n [`& .${outlinedInputClasses.notchedOutline}`]: {\n borderColor: `${hexColor} !important`,\n },\n [`& .${inputLabelClasses.root}`]: {\n color: hexColor,\n },\n [`& .${outlinedInputClasses.input}`]: {\n color: hexColor,\n },\n [`& .${circularProgressClasses.root}`]: {\n color: hexColor,\n },\n [`& .${linearProgressClasses.bar}`]: {\n backgroundColor: hexColor,\n },\n [`& .${autocompleteClasses.endAdornment} .${iconButtonClasses.root}`]: {\n color: hexColor,\n },\n }\n : {};\n\n return (\n <FormControl sx={hexColorSx} fullWidth={fullWidth}>\n <InputLabel\n size={size === \"small\" ? \"small\" : \"normal\"}\n id={inputLabelId}\n htmlFor={id}\n {...InputLabelProps}\n >\n {label}\n </InputLabel>\n <OutlinedInput\n {...InputProps}\n id={id}\n label={label}\n size={size}\n fullWidth={fullWidth}\n endAdornment={\n <InputAdornment position=\"end\">\n {InputProps?.endAdornment}\n {loading ? <CircularProgress color=\"inherit\" size={20} sx={{ ml: 1 }} /> : null}\n </InputAdornment>\n }\n sx={sx}\n {...(rest as any)}\n />\n {fetching && !loading && (\n <LinearProgress\n color=\"inherit\"\n sx={{ position: \"absolute\", left: 0, right: 0, bottom: 0 }}\n />\n )}\n {helperText && <FormHelperText id={helperTextId}>{helperText}</FormHelperText>}\n </FormControl>\n );\n};\n","import MuiAutocomplete, {\n AutocompleteProps as MuiAutocompleteProps,\n} from \"@mui/material/Autocomplete\";\nimport React from \"react\";\nimport { TextField } from \"../text-field\";\nimport { ChipTypeMap } from \"@mui/material/Chip\";\n\nexport interface AutocompleteProps<\n T,\n Multiple extends boolean | undefined,\n DisableClearable extends boolean | undefined,\n FreeSolo extends boolean | undefined,\n ChipComponent extends React.ElementType = ChipTypeMap[\"defaultComponent\"],\n> extends Omit<\n MuiAutocompleteProps<T, Multiple, DisableClearable, FreeSolo, ChipComponent>,\n \"renderInput\" | \"onChange\" | \"color\"\n > {\n label: string;\n helperText?: string;\n color?: string;\n fetching?: boolean;\n onChangeValue?: (value: T) => void;\n}\n\nexport const Autocomplete = <\n T,\n Multiple extends boolean | undefined,\n DisableClearable extends boolean | undefined,\n FreeSolo extends boolean | undefined,\n ChipComponent extends React.ElementType = ChipTypeMap[\"defaultComponent\"],\n>(\n props: AutocompleteProps<T, Multiple, DisableClearable, FreeSolo, ChipComponent>,\n) => {\n const {\n label,\n loading,\n fetching,\n options,\n helperText,\n color,\n onChangeValue = () => null,\n sx,\n ...rest\n } = props;\n const loadingOrFetching = loading || fetching;\n\n return (\n <MuiAutocomplete\n loading={loadingOrFetching}\n options={fetching ? [] : options}\n onChange={(_, value) => onChangeValue(value as T)}\n {...(rest as any)}\n renderInput={(params) => (\n <TextField\n {...params}\n label={label}\n fullWidth\n fetching={fetching}\n loading={loading}\n hexColor={color}\n helperText={helperText}\n />\n )}\n sx={sx}\n />\n );\n};\n"],"names":["globalId","maybeReactUseId","React","toString","useId","idOverride","undefined","reactId","defaultId","setDefaultId","useState","id","useEffect","useGlobalId","TextField","overrideId","label","InputLabelProps","InputProps","fetching","loading","helperText","hexColor","size","fullWidth","sx","rest","helperTextId","inputLabelId","hexColorSx","outlinedInputClasses","notchedOutline","borderColor","inputLabelClasses","root","color","input","circularProgressClasses","linearProgressClasses","bar","backgroundColor","autocompleteClasses","endAdornment","iconButtonClasses","_jsxs","jsxs","FormControl","children","_jsx","InputLabel","htmlFor","jsx","OutlinedInput","InputAdornment","position","CircularProgress","ml","LinearProgress","left","right","bottom","FormHelperText","props","options","onChangeValue","loadingOrFetching","MuiAutocomplete","onChange","_","value","renderInput","params"],"mappings":"k5BAGA,IAAIA,EAAW,EAkBf,MAAMC,EAAkBC,EAAM,QAAQC,YAOvB,SAASC,EAAMC,GAC5B,QAAwBC,IAApBL,EAA+B,CACjC,MAAMM,EAAUN,IAChB,OAAqB,MAAdI,EAAqBA,EAAaE,CAC1C,CAED,OA9BF,SAAqBF,GACnB,MAAOG,EAAWC,GAAgBP,EAAMQ,SAASL,GAC3CM,EAAKN,GAAcG,EAWzB,OAVAN,EAAMU,WAAU,KACG,MAAbJ,IAKFR,GAAY,EACZS,EAAa,OAAOT,KACrB,GACA,CAACQ,IACGG,CACT,CAgBSE,CAAYR,EACrB,CCjBO,MAAMS,EAAY,EACvBH,GAAII,EACJC,QACAC,kBACAC,aACAC,WACAC,UACAC,aACAC,WACAC,OACAC,YACAC,QACGC,MAEH,MAAMf,EAAKP,EAAMW,GACXY,EAAeN,GAAcV,EAAK,GAAGA,qBAAmBL,EACxDsB,EAAeZ,GAASL,EAAK,GAAGA,eAAaL,EAE7CuB,EAAaP,EACf,CACE,CAAC,MAAMQ,uBAAqBC,kBAAmB,CAC7CC,YAAa,GAAGV,gBAElB,CAAC,MAAMW,oBAAkBC,QAAS,CAChCC,MAAOb,GAET,CAAC,MAAMQ,uBAAqBM,SAAU,CACpCD,MAAOb,GAET,CAAC,MAAMe,0BAAwBH,QAAS,CACtCC,MAAOb,GAET,CAAC,MAAMgB,wBAAsBC,OAAQ,CACnCC,gBAAiBlB,GAEnB,CAAC,MAAMm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system/autocomplete",
3
+ "private": true,
4
+ "main": "./cjs/index.js",
5
+ "module": "./index.js",
6
+ "types": "./index.d.ts",
7
+ "dependencies": {
8
+ "@mui/material": "^5.13.6",
9
+ "react": "^18.2.0"
10
+ }
11
+ }
@@ -1,24 +1,2 @@
1
- import{outlinedInputClasses as e,inputLabelClasses as t,circularProgressClasses as r,linearProgressClasses as n,autocompleteClasses as o,iconButtonClasses as i,FormControl as a,InputLabel as c,OutlinedInput as u,InputAdornment as f,CircularProgress as s,LinearProgress as l,FormHelperText as p,Autocomplete as y}from"@mui/material";import*as d from"react";import m from"react";function b(e,t){return"production"===process.env.NODE_ENV?()=>null:function(...r){return e(...r)||t(...r)}}var v,h={exports:{}},S={exports:{}},$={};var g,w,x,E,O,j,P,C,T,N,_,I,M,R,k={};
2
- /** @license React v16.13.1
3
- * react-is.development.js
4
- *
5
- * Copyright (c) Facebook, Inc. and its affiliates.
6
- *
7
- * This source code is licensed under the MIT license found in the
8
- * LICENSE file in the root directory of this source tree.
9
- */function A(){return w||(w=1,e=S,"production"===process.env.NODE_ENV?e.exports=function(){if(v)return $;v=1;var e="function"==typeof Symbol&&Symbol.for,t=e?Symbol.for("react.element"):60103,r=e?Symbol.for("react.portal"):60106,n=e?Symbol.for("react.fragment"):60107,o=e?Symbol.for("react.strict_mode"):60108,i=e?Symbol.for("react.profiler"):60114,a=e?Symbol.for("react.provider"):60109,c=e?Symbol.for("react.context"):60110,u=e?Symbol.for("react.async_mode"):60111,f=e?Symbol.for("react.concurrent_mode"):60111,s=e?Symbol.for("react.forward_ref"):60112,l=e?Symbol.for("react.suspense"):60113,p=e?Symbol.for("react.suspense_list"):60120,y=e?Symbol.for("react.memo"):60115,d=e?Symbol.for("react.lazy"):60116,m=e?Symbol.for("react.block"):60121,b=e?Symbol.for("react.fundamental"):60117,h=e?Symbol.for("react.responder"):60118,S=e?Symbol.for("react.scope"):60119;function g(e){if("object"==typeof e&&null!==e){var p=e.$$typeof;switch(p){case t:switch(e=e.type){case u:case f:case n:case i:case o:case l:return e;default:switch(e=e&&e.$$typeof){case c:case s:case d:case y:case a:return e;default:return p}}case r:return p}}}function w(e){return g(e)===f}return $.AsyncMode=u,$.ConcurrentMode=f,$.ContextConsumer=c,$.ContextProvider=a,$.Element=t,$.ForwardRef=s,$.Fragment=n,$.Lazy=d,$.Memo=y,$.Portal=r,$.Profiler=i,$.StrictMode=o,$.Suspense=l,$.isAsyncMode=function(e){return w(e)||g(e)===u},$.isConcurrentMode=w,$.isContextConsumer=function(e){return g(e)===c},$.isContextProvider=function(e){return g(e)===a},$.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===t},$.isForwardRef=function(e){return g(e)===s},$.isFragment=function(e){return g(e)===n},$.isLazy=function(e){return g(e)===d},$.isMemo=function(e){return g(e)===y},$.isPortal=function(e){return g(e)===r},$.isProfiler=function(e){return g(e)===i},$.isStrictMode=function(e){return g(e)===o},$.isSuspense=function(e){return g(e)===l},$.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===n||e===f||e===i||e===o||e===l||e===p||"object"==typeof e&&null!==e&&(e.$$typeof===d||e.$$typeof===y||e.$$typeof===a||e.$$typeof===c||e.$$typeof===s||e.$$typeof===b||e.$$typeof===h||e.$$typeof===S||e.$$typeof===m)},$.typeOf=g,$}():e.exports=(g||(g=1,"production"!==process.env.NODE_ENV&&function(){var e="function"==typeof Symbol&&Symbol.for,t=e?Symbol.for("react.element"):60103,r=e?Symbol.for("react.portal"):60106,n=e?Symbol.for("react.fragment"):60107,o=e?Symbol.for("react.strict_mode"):60108,i=e?Symbol.for("react.profiler"):60114,a=e?Symbol.for("react.provider"):60109,c=e?Symbol.for("react.context"):60110,u=e?Symbol.for("react.async_mode"):60111,f=e?Symbol.for("react.concurrent_mode"):60111,s=e?Symbol.for("react.forward_ref"):60112,l=e?Symbol.for("react.suspense"):60113,p=e?Symbol.for("react.suspense_list"):60120,y=e?Symbol.for("react.memo"):60115,d=e?Symbol.for("react.lazy"):60116,m=e?Symbol.for("react.block"):60121,b=e?Symbol.for("react.fundamental"):60117,v=e?Symbol.for("react.responder"):60118,h=e?Symbol.for("react.scope"):60119;function S(e){if("object"==typeof e&&null!==e){var p=e.$$typeof;switch(p){case t:var m=e.type;switch(m){case u:case f:case n:case i:case o:case l:return m;default:var b=m&&m.$$typeof;switch(b){case c:case s:case d:case y:case a:return b;default:return p}}case r:return p}}}var $=u,g=f,w=c,x=a,E=t,O=s,j=n,P=d,C=y,T=r,N=i,_=o,I=l,M=!1;function R(e){return S(e)===f}k.AsyncMode=$,k.ConcurrentMode=g,k.ContextConsumer=w,k.ContextProvider=x,k.Element=E,k.ForwardRef=O,k.Fragment=j,k.Lazy=P,k.Memo=C,k.Portal=T,k.Profiler=N,k.StrictMode=_,k.Suspense=I,k.isAsyncMode=function(e){return M||(M=!0,console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.")),R(e)||S(e)===u},k.isConcurrentMode=R,k.isContextConsumer=function(e){return S(e)===c},k.isContextProvider=function(e){return S(e)===a},k.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===t},k.isForwardRef=function(e){return S(e)===s},k.isFragment=function(e){return S(e)===n},k.isLazy=function(e){return S(e)===d},k.isMemo=function(e){return S(e)===y},k.isPortal=function(e){return S(e)===r},k.isProfiler=function(e){return S(e)===i},k.isStrictMode=function(e){return S(e)===o},k.isSuspense=function(e){return S(e)===l},k.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===n||e===f||e===i||e===o||e===l||e===p||"object"==typeof e&&null!==e&&(e.$$typeof===d||e.$$typeof===y||e.$$typeof===a||e.$$typeof===c||e.$$typeof===s||e.$$typeof===b||e.$$typeof===v||e.$$typeof===h||e.$$typeof===m)},k.typeOf=S}()),k)),S.exports;var e}
10
- /*
11
- object-assign
12
- (c) Sindre Sorhus
13
- @license MIT
14
- */function F(){if(E)return x;E=1;var e=Object.getOwnPropertySymbols,t=Object.prototype.hasOwnProperty,r=Object.prototype.propertyIsEnumerable;return x=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},r=0;r<10;r++)t["_"+String.fromCharCode(r)]=r;if("0123456789"!==Object.getOwnPropertyNames(t).map((function(e){return t[e]})).join(""))return!1;var n={};return"abcdefghijklmnopqrst".split("").forEach((function(e){n[e]=e})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},n)).join("")}catch(e){return!1}}()?Object.assign:function(n,o){for(var i,a,c=function(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}(n),u=1;u<arguments.length;u++){for(var f in i=Object(arguments[u]))t.call(i,f)&&(c[f]=i[f]);if(e){a=e(i);for(var s=0;s<a.length;s++)r.call(i,a[s])&&(c[a[s]]=i[a[s]])}}return c},x}function V(){if(j)return O;j=1;return O="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"}function D(){return C?P:(C=1,P=Function.call.bind(Object.prototype.hasOwnProperty))}if("production"!==process.env.NODE_ENV){var z=A();h.exports=function(){if(I)return _;I=1;var e=A(),t=F(),r=V(),n=D(),o=function(){if(N)return T;N=1;var e=function(){};if("production"!==process.env.NODE_ENV){var t=V(),r={},n=D();e=function(e){var t="Warning: "+e;"undefined"!=typeof console&&console.error(t);try{throw new Error(t)}catch(e){}}}function o(o,i,a,c,u){if("production"!==process.env.NODE_ENV)for(var f in o)if(n(o,f)){var s;try{if("function"!=typeof o[f]){var l=Error((c||"React class")+": "+a+" type `"+f+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof o[f]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw l.name="Invariant Violation",l}s=o[f](i,f,c,a,null,t)}catch(e){s=e}if(!s||s instanceof Error||e((c||"React class")+": type specification of "+a+" `"+f+"` is invalid; the type checker function must return `null` or an `Error` but returned a "+typeof s+". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."),s instanceof Error&&!(s.message in r)){r[s.message]=!0;var p=u?u():"";e("Failed "+a+" type: "+s.message+(null!=p?p:""))}}}return o.resetWarningCache=function(){"production"!==process.env.NODE_ENV&&(r={})},T=o}(),i=function(){};function a(){return null}return"production"!==process.env.NODE_ENV&&(i=function(e){var t="Warning: "+e;"undefined"!=typeof console&&console.error(t);try{throw new Error(t)}catch(e){}}),_=function(c,u){var f="function"==typeof Symbol&&Symbol.iterator,s="@@iterator",l="<<anonymous>>",p={array:b("array"),bigint:b("bigint"),bool:b("boolean"),func:b("function"),number:b("number"),object:b("object"),string:b("string"),symbol:b("symbol"),any:m(a),arrayOf:function(e){return m((function(t,n,o,i,a){if("function"!=typeof e)return new d("Property `"+a+"` of component `"+o+"` has invalid PropType notation inside arrayOf.");var c=t[n];if(!Array.isArray(c))return new d("Invalid "+i+" `"+a+"` of type `"+S(c)+"` supplied to `"+o+"`, expected an array.");for(var u=0;u<c.length;u++){var f=e(c,u,o,i,a+"["+u+"]",r);if(f instanceof Error)return f}return null}))},element:m((function(e,t,r,n,o){var i=e[t];return c(i)?null:new d("Invalid "+n+" `"+o+"` of type `"+S(i)+"` supplied to `"+r+"`, expected a single ReactElement.")})),elementType:m((function(t,r,n,o,i){var a=t[r];return e.isValidElementType(a)?null:new d("Invalid "+o+" `"+i+"` of type `"+S(a)+"` supplied to `"+n+"`, expected a single ReactElement type.")})),instanceOf:function(e){return m((function(t,r,n,o,i){if(!(t[r]instanceof e)){var a=e.name||l;return new d("Invalid "+o+" `"+i+"` of type `"+((c=t[r]).constructor&&c.constructor.name?c.constructor.name:l)+"` supplied to `"+n+"`, expected instance of `"+a+"`.")}var c;return null}))},node:m((function(e,t,r,n,o){return h(e[t])?null:new d("Invalid "+n+" `"+o+"` supplied to `"+r+"`, expected a ReactNode.")})),objectOf:function(e){return m((function(t,o,i,a,c){if("function"!=typeof e)return new d("Property `"+c+"` of component `"+i+"` has invalid PropType notation inside objectOf.");var u=t[o],f=S(u);if("object"!==f)return new d("Invalid "+a+" `"+c+"` of type `"+f+"` supplied to `"+i+"`, expected an object.");for(var s in u)if(n(u,s)){var l=e(u,s,i,a,c+"."+s,r);if(l instanceof Error)return l}return null}))},oneOf:function(e){return Array.isArray(e)?m((function(t,r,n,o,i){for(var a=t[r],c=0;c<e.length;c++)if(y(a,e[c]))return null;var u=JSON.stringify(e,(function(e,t){return"symbol"===$(t)?String(t):t}));return new d("Invalid "+o+" `"+i+"` of value `"+String(a)+"` supplied to `"+n+"`, expected one of "+u+".")})):("production"!==process.env.NODE_ENV&&i(arguments.length>1?"Invalid arguments supplied to oneOf, expected an array, got "+arguments.length+" arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z]).":"Invalid argument supplied to oneOf, expected an array."),a)},oneOfType:function(e){if(!Array.isArray(e))return"production"!==process.env.NODE_ENV&&i("Invalid argument supplied to oneOfType, expected an instance of array."),a;for(var t=0;t<e.length;t++){var o=e[t];if("function"!=typeof o)return i("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+g(o)+" at index "+t+"."),a}return m((function(t,o,i,a,c){for(var u=[],f=0;f<e.length;f++){var s=(0,e[f])(t,o,i,a,c,r);if(null==s)return null;s.data&&n(s.data,"expectedType")&&u.push(s.data.expectedType)}return new d("Invalid "+a+" `"+c+"` supplied to `"+i+"`"+(u.length>0?", expected one of type ["+u.join(", ")+"]":"")+".")}))},shape:function(e){return m((function(t,n,o,i,a){var c=t[n],u=S(c);if("object"!==u)return new d("Invalid "+i+" `"+a+"` of type `"+u+"` supplied to `"+o+"`, expected `object`.");for(var f in e){var s=e[f];if("function"!=typeof s)return v(o,i,a,f,$(s));var l=s(c,f,o,i,a+"."+f,r);if(l)return l}return null}))},exact:function(e){return m((function(o,i,a,c,u){var f=o[i],s=S(f);if("object"!==s)return new d("Invalid "+c+" `"+u+"` of type `"+s+"` supplied to `"+a+"`, expected `object`.");var l=t({},o[i],e);for(var p in l){var y=e[p];if(n(e,p)&&"function"!=typeof y)return v(a,c,u,p,$(y));if(!y)return new d("Invalid "+c+" `"+u+"` key `"+p+"` supplied to `"+a+"`.\nBad object: "+JSON.stringify(o[i],null," ")+"\nValid keys: "+JSON.stringify(Object.keys(e),null," "));var m=y(f,p,a,c,u+"."+p,r);if(m)return m}return null}))}};function y(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t}function d(e,t){this.message=e,this.data=t&&"object"==typeof t?t:{},this.stack=""}function m(e){if("production"!==process.env.NODE_ENV)var t={},n=0;function o(o,a,c,f,s,p,y){if(f=f||l,p=p||c,y!==r){if(u){var m=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types");throw m.name="Invariant Violation",m}if("production"!==process.env.NODE_ENV&&"undefined"!=typeof console){var b=f+":"+c;!t[b]&&n<3&&(i("You are manually calling a React.PropTypes validation function for the `"+p+"` prop on `"+f+"`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."),t[b]=!0,n++)}}return null==a[c]?o?null===a[c]?new d("The "+s+" `"+p+"` is marked as required in `"+f+"`, but its value is `null`."):new d("The "+s+" `"+p+"` is marked as required in `"+f+"`, but its value is `undefined`."):null:e(a,c,f,s,p)}var a=o.bind(null,!1);return a.isRequired=o.bind(null,!0),a}function b(e){return m((function(t,r,n,o,i,a){var c=t[r];return S(c)!==e?new d("Invalid "+o+" `"+i+"` of type `"+$(c)+"` supplied to `"+n+"`, expected `"+e+"`.",{expectedType:e}):null}))}function v(e,t,r,n,o){return new d((e||"React class")+": "+t+" type `"+r+"."+n+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+o+"`.")}function h(e){switch(typeof e){case"number":case"string":case"undefined":return!0;case"boolean":return!e;case"object":if(Array.isArray(e))return e.every(h);if(null===e||c(e))return!0;var t=function(e){var t=e&&(f&&e[f]||e[s]);if("function"==typeof t)return t}(e);if(!t)return!1;var r,n=t.call(e);if(t!==e.entries){for(;!(r=n.next()).done;)if(!h(r.value))return!1}else for(;!(r=n.next()).done;){var o=r.value;if(o&&!h(o[1]))return!1}return!0;default:return!1}}function S(e){var t=typeof e;return Array.isArray(e)?"array":e instanceof RegExp?"object":function(e,t){return"symbol"===e||!!t&&("Symbol"===t["@@toStringTag"]||"function"==typeof Symbol&&t instanceof Symbol)}(t,e)?"symbol":t}function $(e){if(null==e)return""+e;var t=S(e);if("object"===t){if(e instanceof Date)return"date";if(e instanceof RegExp)return"regexp"}return t}function g(e){var t=$(e);switch(t){case"array":case"object":return"an "+t;case"boolean":case"date":case"regexp":return"a "+t;default:return t}}return d.prototype=Error.prototype,p.checkPropTypes=o,p.resetWarningCache=o.resetWarningCache,p.PropTypes=p,p},_}()(z.isElement,!0)}else h.exports=function(){if(R)return M;R=1;var e=V();function t(){}function r(){}return r.resetWarningCache=t,M=function(){function n(t,r,n,o,i,a){if(a!==e){var c=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw c.name="Invariant Violation",c}}function o(){return n}n.isRequired=n;var i={array:n,bigint:n,bool:n,func:n,number:n,object:n,string:n,symbol:n,any:n,arrayOf:o,element:n,elementType:n,instanceOf:o,node:n,objectOf:o,oneOf:o,oneOfType:o,shape:o,exact:o,checkPropTypes:r,resetWarningCache:t};return i.PropTypes=i,i}}()();function L(e,t,r,n,o){const i=e[t],a=o||t;if(null==i||"undefined"==typeof window)return null;let c;const u=i.type;return"function"!=typeof u||function(e){const{prototype:t={}}=e;return Boolean(t.isReactComponent)}(u)||(c="Did you accidentally use a plain function component for an element instead?"),void 0!==c?new Error(`Invalid ${n} \`${a}\` supplied to \`${r}\`. Expected an element that can hold a ref. ${c} For more information see https://mui.com/r/caveat-with-refs-guide`):null}b(h.exports.element,L).isRequired=b(h.exports.element.isRequired,L),b(h.exports.elementType,(function(e,t,r,n,o){const i=e[t],a=o||t;if(null==i||"undefined"==typeof window)return null;let c;return"function"!=typeof i||function(e){const{prototype:t={}}=e;return Boolean(t.isReactComponent)}(i)||(c="Did you accidentally provide a plain function component instead?"),void 0!==c?new Error(`Invalid ${n} \`${a}\` supplied to \`${r}\`. Expected an element type that can hold a ref. ${c} For more information see https://mui.com/r/caveat-with-refs-guide`):null}));var W,q={};var B,U,Y={};
15
- /**
16
- * @license React
17
- * react-is.development.js
18
- *
19
- * Copyright (c) Facebook, Inc. and its affiliates.
20
- *
21
- * This source code is licensed under the MIT license found in the
22
- * LICENSE file in the root directory of this source tree.
23
- */U={exports:{}},"production"===process.env.NODE_ENV?U.exports=function(){if(W)return q;W=1;var e,t=Symbol.for("react.element"),r=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),o=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),a=Symbol.for("react.provider"),c=Symbol.for("react.context"),u=Symbol.for("react.server_context"),f=Symbol.for("react.forward_ref"),s=Symbol.for("react.suspense"),l=Symbol.for("react.suspense_list"),p=Symbol.for("react.memo"),y=Symbol.for("react.lazy"),d=Symbol.for("react.offscreen");function m(e){if("object"==typeof e&&null!==e){var d=e.$$typeof;switch(d){case t:switch(e=e.type){case n:case i:case o:case s:case l:return e;default:switch(e=e&&e.$$typeof){case u:case c:case f:case y:case p:case a:return e;default:return d}}case r:return d}}}return e=Symbol.for("react.module.reference"),q.ContextConsumer=c,q.ContextProvider=a,q.Element=t,q.ForwardRef=f,q.Fragment=n,q.Lazy=y,q.Memo=p,q.Portal=r,q.Profiler=i,q.StrictMode=o,q.Suspense=s,q.SuspenseList=l,q.isAsyncMode=function(){return!1},q.isConcurrentMode=function(){return!1},q.isContextConsumer=function(e){return m(e)===c},q.isContextProvider=function(e){return m(e)===a},q.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===t},q.isForwardRef=function(e){return m(e)===f},q.isFragment=function(e){return m(e)===n},q.isLazy=function(e){return m(e)===y},q.isMemo=function(e){return m(e)===p},q.isPortal=function(e){return m(e)===r},q.isProfiler=function(e){return m(e)===i},q.isStrictMode=function(e){return m(e)===o},q.isSuspense=function(e){return m(e)===s},q.isSuspenseList=function(e){return m(e)===l},q.isValidElementType=function(t){return"string"==typeof t||"function"==typeof t||t===n||t===i||t===o||t===s||t===l||t===d||"object"==typeof t&&null!==t&&(t.$$typeof===y||t.$$typeof===p||t.$$typeof===a||t.$$typeof===c||t.$$typeof===f||t.$$typeof===e||void 0!==t.getModuleId)},q.typeOf=m,q}():U.exports=(B||(B=1,"production"!==process.env.NODE_ENV&&function(){var e,t=Symbol.for("react.element"),r=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),o=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),a=Symbol.for("react.provider"),c=Symbol.for("react.context"),u=Symbol.for("react.server_context"),f=Symbol.for("react.forward_ref"),s=Symbol.for("react.suspense"),l=Symbol.for("react.suspense_list"),p=Symbol.for("react.memo"),y=Symbol.for("react.lazy"),d=Symbol.for("react.offscreen");function m(e){if("object"==typeof e&&null!==e){var d=e.$$typeof;switch(d){case t:var m=e.type;switch(m){case n:case i:case o:case s:case l:return m;default:var b=m&&m.$$typeof;switch(b){case u:case c:case f:case y:case p:case a:return b;default:return d}}case r:return d}}}e=Symbol.for("react.module.reference");var b=c,v=a,h=t,S=f,$=n,g=y,w=p,x=r,E=i,O=o,j=s,P=l,C=!1,T=!1;Y.ContextConsumer=b,Y.ContextProvider=v,Y.Element=h,Y.ForwardRef=S,Y.Fragment=$,Y.Lazy=g,Y.Memo=w,Y.Portal=x,Y.Profiler=E,Y.StrictMode=O,Y.Suspense=j,Y.SuspenseList=P,Y.isAsyncMode=function(e){return C||(C=!0,console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 18+.")),!1},Y.isConcurrentMode=function(e){return T||(T=!0,console.warn("The ReactIs.isConcurrentMode() alias has been deprecated, and will be removed in React 18+.")),!1},Y.isContextConsumer=function(e){return m(e)===c},Y.isContextProvider=function(e){return m(e)===a},Y.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===t},Y.isForwardRef=function(e){return m(e)===f},Y.isFragment=function(e){return m(e)===n},Y.isLazy=function(e){return m(e)===y},Y.isMemo=function(e){return m(e)===p},Y.isPortal=function(e){return m(e)===r},Y.isProfiler=function(e){return m(e)===i},Y.isStrictMode=function(e){return m(e)===o},Y.isSuspense=function(e){return m(e)===s},Y.isSuspenseList=function(e){return m(e)===l},Y.isValidElementType=function(t){return"string"==typeof t||"function"==typeof t||t===n||t===i||t===o||t===s||t===l||t===d||"object"==typeof t&&null!==t&&(t.$$typeof===y||t.$$typeof===p||t.$$typeof===a||t.$$typeof===c||t.$$typeof===f||t.$$typeof===e||void 0!==t.getModuleId)},Y.typeOf=m}()),Y),"undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")(),h.exports.oneOfType([h.exports.func,h.exports.object]);let J=0;const H=d["useId".toString()];function G(e){if(void 0!==H){const t=H();return null!=e?e:t}return function(e){const[t,r]=d.useState(e),n=e||t;return d.useEffect((()=>{null==t&&(J+=1,r(`mui-${J}`))}),[t]),n}(e)}const K=Number.isInteger||function(e){return"number"==typeof e&&isFinite(e)&&Math.floor(e)===e};function Q(e,t,r,n){const o=e[t];if(null==o||!K(o)){const e=function(e){const t=typeof e;switch(t){case"number":return Number.isNaN(e)?"NaN":Number.isFinite(e)?e!==Math.floor(e)?"float":"number":"Infinity";case"object":return null===e?"null":e.constructor.name;default:return t}}(o);return new RangeError(`Invalid ${n} \`${t}\` of type \`${e}\` supplied to \`${r}\`, expected \`integer\`.`)}return null}function X(e,t,...r){return void 0===e[t]?null:Q(e,t,...r)}function Z(){return null}X.isRequired=Q,Z.isRequired=Z,process.env.NODE_ENV;const ee=({id:y,label:d,InputLabelProps:b,InputProps:v,fetching:h,loading:S,helperText:$,hexColor:g,size:w,fullWidth:x,sx:E,...O})=>{const j=G(y),P=$&&j?`${j}-helper-text`:void 0,C=d&&j?`${j}-label`:void 0,T=g?{[`& .${e.notchedOutline}`]:{borderColor:`${g} !important`},[`& .${t.root}`]:{color:g},[`& .${e.input}`]:{color:g},[`& .${r.root}`]:{color:g},[`& .${n.bar}`]:{backgroundColor:g},[`& .${o.endAdornment} .${i.root}`]:{color:g}}:{};return m.createElement(a,{sx:T,fullWidth:x},m.createElement(c,{size:"small"===w?"small":"normal",id:C,htmlFor:j,...b},d),m.createElement(u,{...v,id:j,label:d,size:w,fullWidth:x,endAdornment:m.createElement(f,{position:"end"},v?.endAdornment,S?m.createElement(s,{color:"inherit",size:20,sx:{ml:1}}):null),sx:E,...O}),h&&!S&&m.createElement(l,{color:"inherit",sx:{position:"absolute",left:0,right:0,bottom:0}}),$&&m.createElement(p,{id:P},$))},te=e=>{const{label:t,loading:r,fetching:n,options:o,helperText:i,color:a,onChangeValue:c=(()=>null),sx:u,...f}=e,s=r||n;return m.createElement(y,{loading:s,options:n?[]:o,onChange:(e,t)=>c(t),...f,renderInput:e=>m.createElement(ee,{...e,label:t,fullWidth:!0,fetching:n,loading:r,hexColor:a,helperText:i}),sx:u})};export{te as Autocomplete};
1
+ import{jsxs as o,jsx as r}from"react/jsx-runtime";import t,{autocompleteClasses as e}from"@mui/material/Autocomplete";import i,{circularProgressClasses as l}from"@mui/material/CircularProgress";import n from"@mui/material/FormControl";import m from"@mui/material/FormHelperText";import{iconButtonClasses as a}from"@mui/material/IconButton";import u,{linearProgressClasses as s}from"@mui/material/LinearProgress";import d,{outlinedInputClasses as p}from"@mui/material/OutlinedInput";import c,{inputLabelClasses as f}from"@mui/material/InputLabel";import h from"@mui/material/InputAdornment";import*as x from"react";let g=0;const b=x["useId".toString()];function $(o){if(void 0!==b){const r=b();return null!=o?o:r}return function(o){const[r,t]=x.useState(o),e=o||r;return x.useEffect((()=>{null==r&&(g+=1,t(`mui-${g}`))}),[r]),e}(o)}const C=({id:t,label:x,InputLabelProps:g,InputProps:b,fetching:C,loading:I,helperText:A,hexColor:z,size:P,fullWidth:T,sx:W,...v})=>{const F=$(t),L=A&&F?`${F}-helper-text`:void 0,O=x&&F?`${F}-label`:void 0,S=z?{[`& .${p.notchedOutline}`]:{borderColor:`${z} !important`},[`& .${f.root}`]:{color:z},[`& .${p.input}`]:{color:z},[`& .${l.root}`]:{color:z},[`& .${s.bar}`]:{backgroundColor:z},[`& .${e.endAdornment} .${a.root}`]:{color:z}}:{};return o(n,{sx:S,fullWidth:T,children:[r(c,{size:"small"===P?"small":"normal",id:O,htmlFor:F,...g,children:x}),r(d,{...b,id:F,label:x,size:P,fullWidth:T,endAdornment:o(h,{position:"end",children:[b?.endAdornment,I?r(i,{color:"inherit",size:20,sx:{ml:1}}):null]}),sx:W,...v}),C&&!I&&r(u,{color:"inherit",sx:{position:"absolute",left:0,right:0,bottom:0}}),A&&r(m,{id:L,children:A})]})},I=o=>{const{label:e,loading:i,fetching:l,options:n,helperText:m,color:a,onChangeValue:u=(()=>null),sx:s,...d}=o;return r(t,{loading:i||l,options:l?[]:n,onChange:(o,r)=>u(r),...d,renderInput:o=>r(C,{...o,label:e,fullWidth:!0,fetching:l,loading:i,hexColor:a,helperText:m}),sx:s})};export{I as Autocomplete};
24
2
  //# sourceMappingURL=index.js.map