@xjur-ui/react 2.0.0 → 2.1.1

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 (457) hide show
  1. package/.turbo/turbo-build.log +409 -119
  2. package/CHANGELOG.md +76 -0
  3. package/dist/chunk-2JQVYVAT.js +2 -0
  4. package/dist/chunk-2JQVYVAT.js.map +1 -0
  5. package/dist/chunk-2JU3PFV2.js +2 -0
  6. package/dist/chunk-2JU3PFV2.js.map +1 -0
  7. package/dist/chunk-3H75F4Y2.js +2 -0
  8. package/dist/chunk-3H75F4Y2.js.map +1 -0
  9. package/dist/{components/switch.js → chunk-3L772WC6.js} +2 -2
  10. package/dist/chunk-3L772WC6.js.map +1 -0
  11. package/dist/chunk-43DUEHUA.js +2 -0
  12. package/dist/chunk-43DUEHUA.js.map +1 -0
  13. package/dist/chunk-4BGAERSD.js +2 -0
  14. package/dist/chunk-4BGAERSD.js.map +1 -0
  15. package/dist/chunk-4BGTC333.js +2 -0
  16. package/dist/chunk-4BGTC333.js.map +1 -0
  17. package/dist/chunk-4PTFZTVU.js +2 -0
  18. package/dist/chunk-4PTFZTVU.js.map +1 -0
  19. package/dist/chunk-6PHXO2YA.js +2 -0
  20. package/dist/{chunk-RWMV7APX.js.map → chunk-6PHXO2YA.js.map} +1 -1
  21. package/dist/chunk-7HG6Y3VV.js +2 -0
  22. package/dist/chunk-7HG6Y3VV.js.map +1 -0
  23. package/dist/chunk-7HMMMRDA.js +2 -0
  24. package/dist/chunk-7HMMMRDA.js.map +1 -0
  25. package/dist/chunk-7QGN6XFA.js +2 -0
  26. package/dist/chunk-7QGN6XFA.js.map +1 -0
  27. package/dist/chunk-AKR2BJRB.js +2 -0
  28. package/dist/chunk-AKR2BJRB.js.map +1 -0
  29. package/dist/chunk-ASZAHSU5.js +2 -0
  30. package/dist/chunk-ASZAHSU5.js.map +1 -0
  31. package/dist/chunk-BZDGWC5O.js +2 -0
  32. package/dist/chunk-BZDGWC5O.js.map +1 -0
  33. package/dist/chunk-DFXHNK5D.js +2 -0
  34. package/dist/chunk-DFXHNK5D.js.map +1 -0
  35. package/dist/chunk-DOC3XTYC.js +2 -0
  36. package/dist/chunk-DOC3XTYC.js.map +1 -0
  37. package/dist/chunk-DT44JTXB.js +2 -0
  38. package/dist/chunk-DT44JTXB.js.map +1 -0
  39. package/dist/chunk-DVDHTP4C.js +2 -0
  40. package/dist/chunk-DVDHTP4C.js.map +1 -0
  41. package/dist/chunk-EITO7GZX.js +2 -0
  42. package/dist/chunk-EITO7GZX.js.map +1 -0
  43. package/dist/chunk-EXC2XOL6.js +2 -0
  44. package/dist/chunk-EXC2XOL6.js.map +1 -0
  45. package/dist/chunk-F4DYKYWJ.js +2 -0
  46. package/dist/chunk-F4DYKYWJ.js.map +1 -0
  47. package/dist/chunk-F5ZLEQGN.js +2 -0
  48. package/dist/chunk-F5ZLEQGN.js.map +1 -0
  49. package/dist/chunk-F7ANJ4HD.js +2 -0
  50. package/dist/chunk-F7ANJ4HD.js.map +1 -0
  51. package/dist/chunk-FQTUN47L.js +2 -0
  52. package/dist/chunk-FQTUN47L.js.map +1 -0
  53. package/dist/chunk-FUHASFGU.js +2 -0
  54. package/dist/chunk-FUHASFGU.js.map +1 -0
  55. package/dist/chunk-G6NSC3FL.js +2 -0
  56. package/dist/chunk-G6NSC3FL.js.map +1 -0
  57. package/dist/chunk-GKILN5HI.js +2 -0
  58. package/dist/chunk-GKILN5HI.js.map +1 -0
  59. package/dist/chunk-GVKH2BG2.js +2 -0
  60. package/dist/chunk-GVKH2BG2.js.map +1 -0
  61. package/dist/chunk-J4X5RQTR.js +2 -0
  62. package/dist/chunk-J4X5RQTR.js.map +1 -0
  63. package/dist/chunk-JF7JKJES.js +2 -0
  64. package/dist/chunk-JF7JKJES.js.map +1 -0
  65. package/dist/chunk-JGPHBUVM.js +2 -0
  66. package/dist/chunk-JGPHBUVM.js.map +1 -0
  67. package/dist/{chunk-FASEHVMD.js → chunk-M6ZI7M3R.js} +2 -2
  68. package/dist/chunk-M6ZI7M3R.js.map +1 -0
  69. package/dist/chunk-MQ7YTZBI.js +2 -0
  70. package/dist/chunk-MQ7YTZBI.js.map +1 -0
  71. package/dist/chunk-MZSV4LNY.js +2 -0
  72. package/dist/chunk-MZSV4LNY.js.map +1 -0
  73. package/dist/chunk-O3JK6QF6.js +2 -0
  74. package/dist/chunk-O3JK6QF6.js.map +1 -0
  75. package/dist/chunk-OKSGVAQQ.js +2 -0
  76. package/dist/chunk-OKSGVAQQ.js.map +1 -0
  77. package/dist/chunk-OLWYBKQR.js +2 -0
  78. package/dist/chunk-OLWYBKQR.js.map +1 -0
  79. package/dist/chunk-PBR7SFWY.js +2 -0
  80. package/dist/chunk-PBR7SFWY.js.map +1 -0
  81. package/dist/chunk-Q2BZSHS2.js +2 -0
  82. package/dist/chunk-Q2BZSHS2.js.map +1 -0
  83. package/dist/chunk-RGKXZJJS.js +3 -0
  84. package/dist/chunk-RGKXZJJS.js.map +1 -0
  85. package/dist/chunk-SLAAEXWI.js +2 -0
  86. package/dist/chunk-SLAAEXWI.js.map +1 -0
  87. package/dist/chunk-SSTXFHNX.js +2 -0
  88. package/dist/chunk-SSTXFHNX.js.map +1 -0
  89. package/dist/chunk-SXGSWVMZ.js +2 -0
  90. package/dist/chunk-SXGSWVMZ.js.map +1 -0
  91. package/dist/chunk-TORICLEW.js +2 -0
  92. package/dist/chunk-TORICLEW.js.map +1 -0
  93. package/dist/chunk-TYWCS7GS.js +2 -0
  94. package/dist/chunk-TYWCS7GS.js.map +1 -0
  95. package/dist/chunk-URDL5OKH.js +2 -0
  96. package/dist/chunk-URDL5OKH.js.map +1 -0
  97. package/dist/chunk-V2FCP4FA.js +2 -0
  98. package/dist/chunk-V2FCP4FA.js.map +1 -0
  99. package/dist/chunk-VCNKCHFF.js +2 -0
  100. package/dist/chunk-VCNKCHFF.js.map +1 -0
  101. package/dist/chunk-WEBAXQID.js +2 -0
  102. package/dist/chunk-WEBAXQID.js.map +1 -0
  103. package/dist/chunk-WEGFAS5P.js +2 -0
  104. package/dist/chunk-WEGFAS5P.js.map +1 -0
  105. package/dist/chunk-X6SOSTUN.js +2 -0
  106. package/dist/chunk-X6SOSTUN.js.map +1 -0
  107. package/dist/chunk-XGPKBYDY.js +2 -0
  108. package/dist/chunk-XGPKBYDY.js.map +1 -0
  109. package/dist/chunk-YOLTIAFT.js +2 -0
  110. package/dist/{chunk-KIFR5VIE.js.map → chunk-YOLTIAFT.js.map} +1 -1
  111. package/dist/chunk-ZPQPJJQJ.js +2 -0
  112. package/dist/chunk-ZPQPJJQJ.js.map +1 -0
  113. package/dist/chunk-ZVVPUP7V.js +2 -0
  114. package/dist/chunk-ZVVPUP7V.js.map +1 -0
  115. package/dist/components/breadcrumb.d.ts +20 -0
  116. package/dist/components/breadcrumb.js +2 -0
  117. package/dist/components/breadcrumb.js.map +1 -0
  118. package/dist/components/chip.d.ts +2 -1
  119. package/dist/components/chip.js +1 -1
  120. package/dist/components/controls/button.js +2 -0
  121. package/dist/components/controls/calendar.js +2 -0
  122. package/dist/components/controls/calendar.js.map +1 -0
  123. package/dist/components/controls/checkbox.js +2 -0
  124. package/dist/components/controls/checkbox.js.map +1 -0
  125. package/dist/components/controls/context/field.context.d.ts +14 -0
  126. package/dist/components/controls/context/field.context.js +2 -0
  127. package/dist/components/controls/context/field.context.js.map +1 -0
  128. package/dist/components/controls/date-picker.d.ts +85 -0
  129. package/dist/components/controls/date-picker.js +2 -0
  130. package/dist/components/controls/date-picker.js.map +1 -0
  131. package/dist/components/controls/floating-label.d.ts +6 -0
  132. package/dist/components/controls/floating-label.js +2 -0
  133. package/dist/components/controls/floating-label.js.map +1 -0
  134. package/dist/components/controls/input.d.ts +96 -0
  135. package/dist/components/controls/input.js +2 -0
  136. package/dist/components/controls/input.js.map +1 -0
  137. package/dist/components/controls/otp-input.js.map +1 -0
  138. package/dist/components/controls/radio.js +2 -0
  139. package/dist/components/controls/radio.js.map +1 -0
  140. package/dist/components/controls/rich-editor.js +2 -0
  141. package/dist/components/controls/rich-editor.js.map +1 -0
  142. package/dist/components/{search-input.d.ts → controls/search-input.d.ts} +9 -1
  143. package/dist/components/controls/search-input.js +2 -0
  144. package/dist/components/controls/search-selector.d.ts +19 -0
  145. package/dist/components/controls/search-selector.js +2 -0
  146. package/dist/components/controls/search-selector.js.map +1 -0
  147. package/dist/components/controls/select.d.ts +95 -0
  148. package/dist/components/controls/select.js +2 -0
  149. package/dist/components/controls/select.js.map +1 -0
  150. package/dist/components/controls/switch.js +2 -0
  151. package/dist/components/controls/switch.js.map +1 -0
  152. package/dist/components/custom/pessoa/index.d.ts +16 -0
  153. package/dist/components/custom/pessoa/index.js +2 -0
  154. package/dist/components/custom/pessoa/index.js.map +1 -0
  155. package/dist/components/custom/pessoa/pessoa-add-button.d.ts +9 -0
  156. package/dist/components/custom/pessoa/pessoa-add-button.js +2 -0
  157. package/dist/components/custom/pessoa/pessoa-add-button.js.map +1 -0
  158. package/dist/components/custom/pessoa/pessoa-body.d.ts +8 -0
  159. package/dist/components/custom/pessoa/pessoa-body.js +2 -0
  160. package/dist/components/custom/pessoa/pessoa-body.js.map +1 -0
  161. package/dist/components/custom/pessoa/pessoa-close-button.d.ts +8 -0
  162. package/dist/components/custom/pessoa/pessoa-close-button.js +2 -0
  163. package/dist/components/custom/pessoa/pessoa-close-button.js.map +1 -0
  164. package/dist/components/custom/pessoa/pessoa-content.d.ts +8 -0
  165. package/dist/components/custom/pessoa/pessoa-content.js +2 -0
  166. package/dist/components/custom/pessoa/pessoa-content.js.map +1 -0
  167. package/dist/components/custom/pessoa/pessoa-footer.d.ts +8 -0
  168. package/dist/components/custom/pessoa/pessoa-footer.js +2 -0
  169. package/dist/components/custom/pessoa/pessoa-footer.js.map +1 -0
  170. package/dist/components/custom/pessoa/pessoa-header.d.ts +10 -0
  171. package/dist/components/custom/pessoa/pessoa-header.js +2 -0
  172. package/dist/components/custom/pessoa/pessoa-header.js.map +1 -0
  173. package/dist/components/custom/pessoa/pessoa-trigger.d.ts +8 -0
  174. package/dist/components/custom/pessoa/pessoa-trigger.js +2 -0
  175. package/dist/components/custom/pessoa/pessoa-trigger.js.map +1 -0
  176. package/dist/components/custom/pessoa/pessoa.context.d.ts +25 -0
  177. package/dist/components/custom/pessoa/pessoa.context.js +2 -0
  178. package/dist/components/custom/pessoa/pessoa.context.js.map +1 -0
  179. package/dist/components/custom/pessoa/pessoa.d.ts +11 -0
  180. package/dist/components/custom/pessoa/pessoa.js +2 -0
  181. package/dist/components/custom/pessoa/pessoa.js.map +1 -0
  182. package/dist/components/dialog.d.ts +51 -0
  183. package/dist/components/dialog.js +2 -0
  184. package/dist/components/dialog.js.map +1 -0
  185. package/dist/components/drag-and-drop/drag-handle.d.ts +15 -0
  186. package/dist/components/drag-and-drop/drag-handle.js +2 -0
  187. package/dist/components/drag-and-drop/drag-handle.js.map +1 -0
  188. package/dist/components/drag-and-drop/drag-list-item.d.ts +14 -0
  189. package/dist/components/drag-and-drop/drag-list-item.js +2 -0
  190. package/dist/components/drag-and-drop/drag-list-item.js.map +1 -0
  191. package/dist/components/drag-and-drop/drag-list.d.ts +14 -0
  192. package/dist/components/drag-and-drop/drag-list.js +2 -0
  193. package/dist/components/drag-and-drop/drag-list.js.map +1 -0
  194. package/dist/components/drag-and-drop/drag-root.d.ts +6 -0
  195. package/dist/components/drag-and-drop/drag-root.js +2 -0
  196. package/dist/components/drag-and-drop/drag-root.js.map +1 -0
  197. package/dist/components/drag-and-drop/index.d.ts +10 -0
  198. package/dist/components/drag-and-drop/index.js +2 -0
  199. package/dist/components/drag-and-drop/index.js.map +1 -0
  200. package/dist/components/drag-and-drop/types/drag-item.d.ts +9 -0
  201. package/dist/components/drag-and-drop/types/drag-item.js +2 -0
  202. package/dist/components/drag-and-drop/types/drag-item.js.map +1 -0
  203. package/dist/components/dropdown-menu.js +1 -1
  204. package/dist/components/full-calendar/calendar-add-event.d.ts +9 -0
  205. package/dist/components/full-calendar/calendar-add-event.js +2 -0
  206. package/dist/components/full-calendar/calendar-add-event.js.map +1 -0
  207. package/dist/components/full-calendar/calendar-body.d.ts +6 -0
  208. package/dist/components/full-calendar/calendar-body.js +2 -0
  209. package/dist/components/full-calendar/calendar-body.js.map +1 -0
  210. package/dist/components/full-calendar/calendar-cell.d.ts +11 -0
  211. package/dist/components/full-calendar/calendar-cell.js +2 -0
  212. package/dist/components/full-calendar/calendar-cell.js.map +1 -0
  213. package/dist/components/full-calendar/calendar-day-view.d.ts +5 -0
  214. package/dist/components/full-calendar/calendar-day-view.js +2 -0
  215. package/dist/components/full-calendar/calendar-day-view.js.map +1 -0
  216. package/dist/components/full-calendar/calendar-event.d.ts +18 -0
  217. package/dist/components/full-calendar/calendar-event.js +2 -0
  218. package/dist/components/full-calendar/calendar-event.js.map +1 -0
  219. package/dist/components/full-calendar/calendar-header.d.ts +6 -0
  220. package/dist/components/full-calendar/calendar-header.js +2 -0
  221. package/dist/components/full-calendar/calendar-header.js.map +1 -0
  222. package/dist/components/full-calendar/calendar-month-view.d.ts +5 -0
  223. package/dist/components/full-calendar/calendar-month-view.js +2 -0
  224. package/dist/components/full-calendar/calendar-month-view.js.map +1 -0
  225. package/dist/components/full-calendar/calendar-more-events-dropdown.d.ts +9 -0
  226. package/dist/components/full-calendar/calendar-more-events-dropdown.js +2 -0
  227. package/dist/components/full-calendar/calendar-more-events-dropdown.js.map +1 -0
  228. package/dist/components/full-calendar/calendar-navigator.d.ts +5 -0
  229. package/dist/components/full-calendar/calendar-navigator.js +2 -0
  230. package/dist/components/full-calendar/calendar-navigator.js.map +1 -0
  231. package/dist/components/full-calendar/calendar-root.d.ts +30 -0
  232. package/dist/components/full-calendar/calendar-root.js +2 -0
  233. package/dist/components/full-calendar/calendar-root.js.map +1 -0
  234. package/dist/components/full-calendar/calendar-today-button.d.ts +9 -0
  235. package/dist/components/full-calendar/calendar-today-button.js +2 -0
  236. package/dist/components/full-calendar/calendar-today-button.js.map +1 -0
  237. package/dist/components/full-calendar/calendar-toggle-view.d.ts +5 -0
  238. package/dist/components/full-calendar/calendar-toggle-view.js +2 -0
  239. package/dist/components/full-calendar/calendar-toggle-view.js.map +1 -0
  240. package/dist/components/full-calendar/calendar-view-renderer.d.ts +5 -0
  241. package/dist/components/full-calendar/calendar-view-renderer.js +2 -0
  242. package/dist/components/full-calendar/calendar-view-renderer.js.map +1 -0
  243. package/dist/components/full-calendar/calendar-week-day.d.ts +10 -0
  244. package/dist/components/full-calendar/calendar-week-day.js +2 -0
  245. package/dist/components/full-calendar/calendar-week-day.js.map +1 -0
  246. package/dist/components/full-calendar/calendar-week-view.d.ts +5 -0
  247. package/dist/components/full-calendar/calendar-week-view.js +2 -0
  248. package/dist/components/full-calendar/calendar-week-view.js.map +1 -0
  249. package/dist/components/full-calendar/helpers/calendar.d.ts +25 -0
  250. package/dist/components/full-calendar/helpers/calendar.js +2 -0
  251. package/dist/components/full-calendar/helpers/calendar.js.map +1 -0
  252. package/dist/components/full-calendar/index.d.ts +18 -0
  253. package/dist/components/full-calendar/index.js +2 -0
  254. package/dist/components/full-calendar/index.js.map +1 -0
  255. package/dist/components/full-calendar/types/calendar-cell.d.ts +6 -0
  256. package/dist/components/full-calendar/types/calendar-cell.js +2 -0
  257. package/dist/components/full-calendar/types/calendar-cell.js.map +1 -0
  258. package/dist/components/full-calendar/types/calendar-event.d.ts +8 -0
  259. package/dist/components/full-calendar/types/calendar-event.js +2 -0
  260. package/dist/components/full-calendar/types/calendar-event.js.map +1 -0
  261. package/dist/components/full-calendar/types/calendar-view.d.ts +3 -0
  262. package/dist/components/full-calendar/types/calendar-view.js +2 -0
  263. package/dist/components/full-calendar/types/calendar-view.js.map +1 -0
  264. package/dist/components/full-calendar/types/calendar-week-hour.d.ts +6 -0
  265. package/dist/components/full-calendar/types/calendar-week-hour.js +2 -0
  266. package/dist/components/full-calendar/types/calendar-week-hour.js.map +1 -0
  267. package/dist/components/horizontal-scroll.d.ts +11 -0
  268. package/dist/components/horizontal-scroll.js +2 -0
  269. package/dist/components/horizontal-scroll.js.map +1 -0
  270. package/dist/components/icon.d.ts +3 -4
  271. package/dist/components/icon.js +1 -1
  272. package/dist/components/list.js +1 -1
  273. package/dist/components/selection-bar.d.ts +57 -0
  274. package/dist/components/selection-bar.js +2 -0
  275. package/dist/components/selection-bar.js.map +1 -0
  276. package/dist/components/sheet.d.ts +8 -8
  277. package/dist/components/sheet.js +1 -1
  278. package/dist/components/sheet.js.map +1 -1
  279. package/dist/components/steps/index.d.ts +11 -0
  280. package/dist/components/steps/index.js +2 -0
  281. package/dist/components/steps/index.js.map +1 -0
  282. package/dist/components/steps/step.d.ts +8 -0
  283. package/dist/components/steps/step.js +2 -0
  284. package/dist/components/steps/step.js.map +1 -0
  285. package/dist/components/steps/steps-action.d.ts +12 -0
  286. package/dist/components/steps/steps-action.js +2 -0
  287. package/dist/components/steps/steps-action.js.map +1 -0
  288. package/dist/components/steps/steps-content.d.ts +6 -0
  289. package/dist/components/steps/steps-content.js +2 -0
  290. package/dist/components/steps/steps-content.js.map +1 -0
  291. package/dist/components/steps/steps-context.d.ts +22 -0
  292. package/dist/components/steps/steps-context.js +2 -0
  293. package/dist/components/steps/steps-context.js.map +1 -0
  294. package/dist/components/steps/steps-navigation.d.ts +6 -0
  295. package/dist/components/steps/steps-navigation.js +2 -0
  296. package/dist/components/steps/steps-navigation.js.map +1 -0
  297. package/dist/components/steps/steps-root.d.ts +7 -0
  298. package/dist/components/steps/steps-root.js +2 -0
  299. package/dist/components/steps/steps-root.js.map +1 -0
  300. package/dist/components/table/index.d.ts +9 -0
  301. package/dist/components/table/index.js +2 -0
  302. package/dist/components/table/index.js.map +1 -0
  303. package/dist/components/table/table-body.d.ts +5 -0
  304. package/dist/components/table/table-body.js +2 -0
  305. package/dist/components/table/table-body.js.map +1 -0
  306. package/dist/components/table/table-cell.d.ts +5 -0
  307. package/dist/components/table/table-cell.js +2 -0
  308. package/dist/components/table/table-cell.js.map +1 -0
  309. package/dist/components/table/table-footer.d.ts +5 -0
  310. package/dist/components/table/table-footer.js +2 -0
  311. package/dist/components/table/table-footer.js.map +1 -0
  312. package/dist/components/table/table-head.d.ts +6 -0
  313. package/dist/components/table/table-head.js +2 -0
  314. package/dist/components/table/table-head.js.map +1 -0
  315. package/dist/components/table/table-header.d.ts +5 -0
  316. package/dist/components/table/table-header.js +2 -0
  317. package/dist/components/table/table-header.js.map +1 -0
  318. package/dist/components/table/table-row.d.ts +7 -0
  319. package/dist/components/table/table-row.js +2 -0
  320. package/dist/components/table/table-row.js.map +1 -0
  321. package/dist/components/table/table-sort.d.ts +7 -0
  322. package/dist/components/table/table-sort.js +2 -0
  323. package/dist/components/table/table-sort.js.map +1 -0
  324. package/dist/components/table/table.d.ts +5 -0
  325. package/dist/components/table/table.js +2 -0
  326. package/dist/components/table/table.js.map +1 -0
  327. package/dist/components/tag.d.ts +2 -1
  328. package/dist/components/tag.js +1 -1
  329. package/dist/components/upload.d.ts +74 -0
  330. package/dist/components/upload.js +2 -0
  331. package/dist/components/upload.js.map +1 -0
  332. package/dist/icons-C-hGI45d.d.ts +4 -0
  333. package/dist/index.css +1 -1
  334. package/dist/index.css.map +1 -1
  335. package/dist/input-mask-DhbtCxF7.d.ts +3 -0
  336. package/package.json +26 -14
  337. package/src/components/breadcrumb.tsx +119 -0
  338. package/src/components/{calendar.tsx → controls/calendar.tsx} +1 -1
  339. package/src/components/{checkbox.tsx → controls/checkbox.tsx} +2 -2
  340. package/src/components/controls/context/field.context.ts +27 -0
  341. package/src/components/controls/date-picker.tsx +199 -0
  342. package/src/components/controls/floating-label.tsx +60 -0
  343. package/src/components/controls/input.tsx +237 -0
  344. package/src/components/{radio.tsx → controls/radio.tsx} +1 -1
  345. package/src/components/{rich-editor.tsx → controls/rich-editor.tsx} +5 -5
  346. package/src/components/{search-input.tsx → controls/search-input.tsx} +46 -3
  347. package/src/components/controls/search-selector.tsx +98 -0
  348. package/src/components/controls/select.tsx +274 -0
  349. package/src/components/custom/pessoa/index.ts +9 -0
  350. package/src/components/custom/pessoa/pessoa-add-button.tsx +35 -0
  351. package/src/components/custom/pessoa/pessoa-body.tsx +22 -0
  352. package/src/components/custom/pessoa/pessoa-close-button.tsx +13 -0
  353. package/src/components/custom/pessoa/pessoa-content.tsx +25 -0
  354. package/src/components/custom/pessoa/pessoa-footer.tsx +15 -0
  355. package/src/components/custom/pessoa/pessoa-header.tsx +35 -0
  356. package/src/components/custom/pessoa/pessoa-trigger.tsx +25 -0
  357. package/src/components/custom/pessoa/pessoa.context.tsx +73 -0
  358. package/src/components/custom/pessoa/pessoa.tsx +35 -0
  359. package/src/components/dialog.tsx +242 -0
  360. package/src/components/drag-and-drop/drag-handle.tsx +46 -0
  361. package/src/components/drag-and-drop/drag-list-item.tsx +91 -0
  362. package/src/components/drag-and-drop/drag-list.tsx +47 -0
  363. package/src/components/drag-and-drop/drag-root.tsx +30 -0
  364. package/src/components/drag-and-drop/index.ts +39 -0
  365. package/src/components/drag-and-drop/types/drag-item.ts +7 -0
  366. package/src/components/dropdown-menu.tsx +1 -1
  367. package/src/components/full-calendar/calendar-add-event.tsx +15 -0
  368. package/src/components/full-calendar/calendar-body.tsx +12 -0
  369. package/src/components/full-calendar/calendar-cell.tsx +120 -0
  370. package/src/components/full-calendar/calendar-day-view.tsx +76 -0
  371. package/src/components/full-calendar/calendar-event.tsx +178 -0
  372. package/src/components/full-calendar/calendar-header.tsx +14 -0
  373. package/src/components/full-calendar/calendar-month-view.tsx +69 -0
  374. package/src/components/full-calendar/calendar-more-events-dropdown.tsx +39 -0
  375. package/src/components/full-calendar/calendar-navigator.tsx +86 -0
  376. package/src/components/full-calendar/calendar-root.tsx +165 -0
  377. package/src/components/full-calendar/calendar-today-button.tsx +21 -0
  378. package/src/components/full-calendar/calendar-toggle-view.tsx +61 -0
  379. package/src/components/full-calendar/calendar-view-renderer.tsx +19 -0
  380. package/src/components/full-calendar/calendar-week-day.tsx +49 -0
  381. package/src/components/full-calendar/calendar-week-view.tsx +88 -0
  382. package/src/components/full-calendar/helpers/calendar.ts +158 -0
  383. package/src/components/full-calendar/index.ts +16 -0
  384. package/src/components/full-calendar/types/calendar-cell.ts +4 -0
  385. package/src/components/full-calendar/types/calendar-event.ts +7 -0
  386. package/src/components/full-calendar/types/calendar-view.ts +1 -0
  387. package/src/components/full-calendar/types/calendar-week-hour.ts +4 -0
  388. package/src/components/horizontal-scroll.tsx +159 -0
  389. package/src/components/list.tsx +1 -1
  390. package/src/components/selection-bar.tsx +273 -0
  391. package/src/components/sheet.tsx +26 -17
  392. package/src/components/steps/index.ts +6 -0
  393. package/src/components/steps/step.tsx +23 -0
  394. package/src/components/steps/steps-action.tsx +65 -0
  395. package/src/components/steps/steps-content.tsx +12 -0
  396. package/src/components/steps/steps-context.tsx +121 -0
  397. package/src/components/steps/steps-navigation.tsx +80 -0
  398. package/src/components/steps/steps-root.tsx +9 -0
  399. package/src/components/table/index.ts +8 -0
  400. package/src/components/table/table-body.tsx +17 -0
  401. package/src/components/table/table-cell.tsx +14 -0
  402. package/src/components/table/table-footer.tsx +17 -0
  403. package/src/components/table/table-head.tsx +31 -0
  404. package/src/components/table/table-header.tsx +17 -0
  405. package/src/components/table/table-row.tsx +21 -0
  406. package/src/components/table/table-sort.tsx +34 -0
  407. package/src/components/table/table.tsx +16 -0
  408. package/src/components/upload.tsx +647 -0
  409. package/src/resources/icons.ts +5 -1
  410. package/dist/chunk-FASEHVMD.js.map +0 -1
  411. package/dist/chunk-KIFR5VIE.js +0 -2
  412. package/dist/chunk-NPTLORW5.js +0 -2
  413. package/dist/chunk-NPTLORW5.js.map +0 -1
  414. package/dist/chunk-RWMV7APX.js +0 -2
  415. package/dist/chunk-SHHXKVVR.js +0 -2
  416. package/dist/chunk-SHHXKVVR.js.map +0 -1
  417. package/dist/components/button.js +0 -2
  418. package/dist/components/calendar.js +0 -2
  419. package/dist/components/calendar.js.map +0 -1
  420. package/dist/components/checkbox.js +0 -2
  421. package/dist/components/checkbox.js.map +0 -1
  422. package/dist/components/date-picker.d.ts +0 -25
  423. package/dist/components/date-picker.js +0 -2
  424. package/dist/components/date-picker.js.map +0 -1
  425. package/dist/components/input.d.ts +0 -37
  426. package/dist/components/input.js +0 -2
  427. package/dist/components/input.js.map +0 -1
  428. package/dist/components/otp-input.js.map +0 -1
  429. package/dist/components/radio.js +0 -2
  430. package/dist/components/radio.js.map +0 -1
  431. package/dist/components/rich-editor.js +0 -2
  432. package/dist/components/rich-editor.js.map +0 -1
  433. package/dist/components/search-input.js +0 -2
  434. package/dist/components/select.d.ts +0 -36
  435. package/dist/components/select.js +0 -2
  436. package/dist/components/select.js.map +0 -1
  437. package/dist/components/switch.js.map +0 -1
  438. package/dist/components/table.d.ts +0 -17
  439. package/dist/components/table.js +0 -2
  440. package/dist/components/table.js.map +0 -1
  441. package/src/components/date-picker.tsx +0 -263
  442. package/src/components/input.tsx +0 -320
  443. package/src/components/select.tsx +0 -318
  444. package/src/components/table.tsx +0 -160
  445. /package/dist/components/{button.d.ts → controls/button.d.ts} +0 -0
  446. /package/dist/components/{button.js.map → controls/button.js.map} +0 -0
  447. /package/dist/components/{calendar.d.ts → controls/calendar.d.ts} +0 -0
  448. /package/dist/components/{checkbox.d.ts → controls/checkbox.d.ts} +0 -0
  449. /package/dist/components/{otp-input.d.ts → controls/otp-input.d.ts} +0 -0
  450. /package/dist/components/{otp-input.js → controls/otp-input.js} +0 -0
  451. /package/dist/components/{radio.d.ts → controls/radio.d.ts} +0 -0
  452. /package/dist/components/{rich-editor.d.ts → controls/rich-editor.d.ts} +0 -0
  453. /package/dist/components/{search-input.js.map → controls/search-input.js.map} +0 -0
  454. /package/dist/components/{switch.d.ts → controls/switch.d.ts} +0 -0
  455. /package/src/components/{button.tsx → controls/button.tsx} +0 -0
  456. /package/src/components/{otp-input.tsx → controls/otp-input.tsx} +0 -0
  457. /package/src/components/{switch.tsx → controls/switch.tsx} +0 -0
@@ -0,0 +1,273 @@
1
+ import type { ComponentProps, ReactNode } from 'react'
2
+ import { createContext, useContext, useState, useCallback } from 'react'
3
+ import { cva, cx, type ClassVariantProps } from '@xjur-ui/util'
4
+ import { Icon, type IconType } from './icon'
5
+ import { Button } from './controls/button'
6
+
7
+ const selectionBarVariants = cva(
8
+ [
9
+ 'flex items-center gap-4 rounded-lg px-4 py-3 shadow-lg transition-colors duration-200 ease-in-out',
10
+ 'fixed bottom-6 left-1/2 -translate-x-1/2 transform z-50',
11
+ 'backdrop-blur-sm bg-white/95 border border-border-layer-2'
12
+ ],
13
+ {
14
+ variants: {
15
+ size: {
16
+ sm: 'px-3 py-2 text-sm',
17
+ md: 'px-4 py-3 text-base',
18
+ lg: 'px-6 py-4 text-lg'
19
+ },
20
+ variant: {
21
+ primary:
22
+ 'bg-primary-idle text-neutral-label hover:bg-primary-hover rounded-circle active:bg-primary-pressed',
23
+ secondary:
24
+ 'bg-secondary-idle text-white border-secondary-idle hover:bg-secondary-hover rounded-circle',
25
+ success:
26
+ 'bg-success-idle text-white border-success-idle hover:bg-success-hover rounded-circle',
27
+ warning:
28
+ 'bg-warning-idle text-white border-warning-idle hover:bg-warning-hover rounded-circle',
29
+ destructive:
30
+ 'bg-destructive-idle text-white border-destructive-idle hover:bg-destructive-hover rounded-circle',
31
+ neutral:
32
+ 'bg-neutral-dark text-white border-neutral-dark hover:bg-neutral-hover rounded-circle',
33
+ outline:
34
+ 'bg-white text-neutral-dark border-border-layer-2 hover:bg-layer-2-hover rounded-circle'
35
+ },
36
+ position: {
37
+ fixed: 'fixed bottom-6 left-1/2 -translate-x-1/2 transform',
38
+ absolute: 'absolute bottom-6 left-1/2 -translate-x-1/2 transform',
39
+ relative: 'relative',
40
+ sticky: 'sticky bottom-6'
41
+ }
42
+ },
43
+ defaultVariants: {
44
+ size: 'md',
45
+ variant: 'primary',
46
+ position: 'fixed'
47
+ }
48
+ }
49
+ )
50
+
51
+ export interface SelectionAction {
52
+ id: string
53
+ label?: string
54
+ icon: IconType
55
+ onClick: () => void
56
+ variant?: 'primary' | 'secondary' | 'destructive' | 'tertiary' | 'outlined'
57
+ disabled?: boolean
58
+ }
59
+
60
+ interface SelectionBarProps
61
+ extends Omit<ComponentProps<'div'>, 'onClose'>,
62
+ ClassVariantProps<typeof selectionBarVariants> {
63
+ selectedCount: number
64
+ onClose: () => void
65
+ actions?: SelectionAction[]
66
+ showCloseButton?: boolean
67
+ closeButtonText?: string
68
+ selectedText?: string
69
+ className?: string
70
+ }
71
+
72
+ function SelectionBar({
73
+ selectedCount,
74
+ onClose,
75
+ actions = [],
76
+ showCloseButton = true,
77
+ selectedText,
78
+ size = 'md',
79
+ variant = 'primary',
80
+ position = 'fixed',
81
+ className,
82
+ ...props
83
+ }: SelectionBarProps) {
84
+ if (selectedCount === 0) return null
85
+
86
+ const getSelectedText = () => {
87
+ if (selectedText) return selectedText
88
+ return selectedCount === 1
89
+ ? '1 item selecionado'
90
+ : `${selectedCount} itens selecionados`
91
+ }
92
+
93
+ const getIconSize = () => {
94
+ switch (size) {
95
+ case 'sm':
96
+ return 'text-sm'
97
+ case 'md':
98
+ return 'text-base'
99
+ case 'lg':
100
+ return 'text-lg'
101
+ default:
102
+ return 'text-base'
103
+ }
104
+ }
105
+
106
+ return (
107
+ <div
108
+ className={cx(
109
+ selectionBarVariants({ size, variant, position }),
110
+ className
111
+ )}
112
+ {...props}
113
+ >
114
+ {showCloseButton && (
115
+ <Button
116
+ appearance="ghost"
117
+ className="rounded-full text-current"
118
+ size={size === 'lg' ? 'md' : 'sm'}
119
+ variant="secondary"
120
+ onClick={() => onClose()}
121
+ >
122
+ <Icon className={getIconSize()} name="close" />
123
+ </Button>
124
+ )}
125
+
126
+ <span className="font-medium whitespace-nowrap">{getSelectedText()}</span>
127
+
128
+ {actions.map(action => (
129
+ <Button
130
+ appearance="ghost"
131
+ className="rounded-full text-current"
132
+ disabled={action.disabled}
133
+ key={action.id}
134
+ size={size === 'lg' ? 'md' : 'sm'}
135
+ variant={action.variant || 'secondary'}
136
+ onClick={() => action.onClick()}
137
+ >
138
+ <Icon className={getIconSize()} name={action.icon} />
139
+ {action.label && <span className="ml-2">{action.label}</span>}
140
+ </Button>
141
+ ))}
142
+ </div>
143
+ )
144
+ }
145
+
146
+ interface SelectionBarContextType {
147
+ selectedItems: Set<string>
148
+ toggleSelection: (id: string) => void
149
+ clearSelection: () => void
150
+ selectAll: (ids: string[]) => void
151
+ isSelected: (id: string) => boolean
152
+ selectedCount: number
153
+ }
154
+
155
+ const SelectionBarContext = createContext<SelectionBarContextType | null>(null)
156
+
157
+ interface SelectionBarProviderProps {
158
+ children: ReactNode
159
+ onSelectionChange?: (selectedIds: string[]) => void
160
+ }
161
+
162
+ function SelectionBarProvider({
163
+ children,
164
+ onSelectionChange
165
+ }: SelectionBarProviderProps) {
166
+ const [selectedItems, setSelectedItems] = useState<Set<string>>(new Set())
167
+
168
+ const toggleSelection = useCallback(
169
+ (id: string) => {
170
+ setSelectedItems(prev => {
171
+ const newSet = new Set(prev)
172
+ if (newSet.has(id)) {
173
+ newSet.delete(id)
174
+ } else {
175
+ newSet.add(id)
176
+ }
177
+ onSelectionChange?.(Array.from(newSet))
178
+ return newSet
179
+ })
180
+ },
181
+ [onSelectionChange]
182
+ )
183
+
184
+ const clearSelection = useCallback(() => {
185
+ setSelectedItems(new Set())
186
+ onSelectionChange?.([])
187
+ }, [onSelectionChange])
188
+
189
+ const selectAll = useCallback(
190
+ (ids: string[]) => {
191
+ setSelectedItems(new Set(ids))
192
+ onSelectionChange?.(ids)
193
+ },
194
+ [onSelectionChange]
195
+ )
196
+
197
+ const isSelected = useCallback(
198
+ (id: string) => {
199
+ return selectedItems.has(id)
200
+ },
201
+ [selectedItems]
202
+ )
203
+
204
+ const value: SelectionBarContextType = {
205
+ selectedItems,
206
+ toggleSelection,
207
+ clearSelection,
208
+ selectAll,
209
+ isSelected,
210
+ selectedCount: selectedItems.size
211
+ }
212
+
213
+ return (
214
+ <SelectionBarContext.Provider value={value}>
215
+ {children}
216
+ </SelectionBarContext.Provider>
217
+ )
218
+ }
219
+
220
+ function useSelectionBar() {
221
+ const context = useContext(SelectionBarContext)
222
+ if (!context) {
223
+ throw new Error(
224
+ 'useSelectionBar must be used within a SelectionBarProvider'
225
+ )
226
+ }
227
+ return context
228
+ }
229
+
230
+ interface SelectionBarContainerProps
231
+ extends Omit<SelectionBarProps, 'selectedCount' | 'onClose'> {
232
+ showCloseButton?: boolean
233
+ closeButtonText?: string
234
+ selectedText?: string
235
+ }
236
+
237
+ function SelectionBarContainer({
238
+ actions = [],
239
+ showCloseButton = true,
240
+ selectedText,
241
+ ...props
242
+ }: SelectionBarContainerProps) {
243
+ const { selectedCount, clearSelection } = useSelectionBar()
244
+
245
+ return (
246
+ <SelectionBar
247
+ actions={actions}
248
+ selectedCount={selectedCount}
249
+ selectedText={selectedText}
250
+ showCloseButton={showCloseButton}
251
+ onClose={() => clearSelection()}
252
+ {...props}
253
+ />
254
+ )
255
+ }
256
+
257
+ export const SelectionBarComponents = {
258
+ Root: SelectionBar,
259
+ Provider: SelectionBarProvider,
260
+ Container: SelectionBarContainer,
261
+ useSelectionBar
262
+ }
263
+
264
+ export { SelectionBar }
265
+ export { SelectionBarProvider }
266
+ export { SelectionBarContainer }
267
+ export { useSelectionBar }
268
+ export { selectionBarVariants }
269
+ export type {
270
+ SelectionBarProps,
271
+ SelectionBarProviderProps,
272
+ SelectionBarContainerProps
273
+ }
@@ -1,7 +1,7 @@
1
1
  import * as React from 'react'
2
2
  import * as SheetPrimitive from '@radix-ui/react-dialog'
3
- import { cx } from '@xjur-ui/util'
4
- import { Button } from './button'
3
+ import { cx, tv } from '@xjur-ui/util'
4
+ import { Button } from './controls/button'
5
5
  import { Icon } from './icon'
6
6
 
7
7
  export function SheetRoot({
@@ -44,7 +44,7 @@ export function SheetOverlay({
44
44
  return (
45
45
  <SheetPrimitive.Overlay
46
46
  className={cx(
47
- 'data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50',
47
+ 'data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50',
48
48
  className
49
49
  )}
50
50
  data-slot="sheet-overlay"
@@ -63,22 +63,31 @@ export function SheetContent({
63
63
  side?: 'top' | 'right' | 'bottom' | 'left'
64
64
  overlay?: boolean
65
65
  }) {
66
+ const content = tv({
67
+ base: [
68
+ 'border-border-layer-2 bg-layer-2-idle shadow-elevation-2 fixed z-50 flex flex-col gap-medium',
69
+ 'data-[state=open]:animate-in data-[state=closed]:animate-out transition ease-in-out data-[state=closed]:duration-300 data-[state=open]:duration-500'
70
+ ],
71
+ variants: {
72
+ side: {
73
+ right:
74
+ 'data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right inset-y-0 right-0 h-full border-l sm:max-w-sm',
75
+ left: 'data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left inset-y-0 left-0 h-full border-r sm:max-w-sm',
76
+ top: 'data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top inset-x-0 top-0 h-auto border-b',
77
+ bottom:
78
+ 'data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom inset-x-0 bottom-0 h-auto border-t'
79
+ }
80
+ },
81
+ defaultVariants: {
82
+ side: 'right'
83
+ }
84
+ })
85
+
66
86
  return (
67
87
  <SheetPortal>
68
88
  {overlay && <SheetOverlay />}
69
89
  <SheetPrimitive.Content
70
- className={cx(
71
- 'border-border-layer-2 bg-layer-2-idle data-[state=open]:animate-in data-[state=closed]:animate-out shadow-elevation-2 fixed z-50 flex flex-col gap-4 transition ease-in-out data-[state=closed]:duration-300 data-[state=open]:duration-500',
72
- side === 'right' &&
73
- 'data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right inset-y-0 right-0 h-full w-3/4 border-l sm:max-w-sm',
74
- side === 'left' &&
75
- 'data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left inset-y-0 left-0 h-full w-3/4 border-r sm:max-w-sm',
76
- side === 'top' &&
77
- 'data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top inset-x-0 top-0 h-auto border-b',
78
- side === 'bottom' &&
79
- 'data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom inset-x-0 bottom-0 h-auto border-t',
80
- className
81
- )}
90
+ className={content({ side, className })}
82
91
  data-slot="sheet-content"
83
92
  {...props}
84
93
  >
@@ -92,7 +101,7 @@ export function SheetBody({
92
101
  className,
93
102
  ...props
94
103
  }: React.ComponentProps<'div'>) {
95
- return <div className={cx('px-large-2x', className)} {...props} />
104
+ return <div className={cx('px-large-2x h-full', className)} {...props} />
96
105
  }
97
106
 
98
107
  export function SheetHeader({
@@ -133,7 +142,7 @@ export function SheetTitle({
133
142
  }: React.ComponentProps<typeof SheetPrimitive.Title>) {
134
143
  return (
135
144
  <SheetPrimitive.Title
136
- className={cx('text-size-title-lg font-medium', className)}
145
+ className={cx('text-size-title-lg font-normal', className)}
137
146
  data-slot="sheet-title"
138
147
  {...props}
139
148
  />
@@ -0,0 +1,6 @@
1
+ export * from './steps-context'
2
+ export * from './steps-root'
3
+ export * from './steps-navigation'
4
+ export * from './steps-content'
5
+ export * from './step'
6
+ export * from './steps-action'
@@ -0,0 +1,23 @@
1
+ import type { ComponentProps } from 'react'
2
+ import { twMerge } from '@xjur-ui/util'
3
+ import { useSteps } from './steps-context'
4
+
5
+ export function Step({
6
+ stepIndex,
7
+ className,
8
+ ...props
9
+ }: ComponentProps<'div'> & { stepIndex: number }) {
10
+ const { currentStepIndex } = useSteps()
11
+
12
+ if (currentStepIndex !== stepIndex) {
13
+ return null
14
+ }
15
+
16
+ return (
17
+ <div
18
+ className={twMerge('h-full w-full', className)}
19
+ data-slot="step-item"
20
+ {...props}
21
+ />
22
+ )
23
+ }
@@ -0,0 +1,65 @@
1
+ import { useCallback, type ComponentProps } from 'react'
2
+ import { Button } from '../controls/button'
3
+ import { useSteps } from './steps-context'
4
+
5
+ export function NextStep({
6
+ children = 'Próximo',
7
+ type,
8
+ onClick,
9
+ ...props
10
+ }: Omit<ComponentProps<typeof Button>, 'children'> & {
11
+ children?: React.ReactNode | ((stepIndex: number) => React.ReactNode)
12
+ }) {
13
+ const { handleNextStep, currentStepIndex, isLastStep } = useSteps()
14
+
15
+ const handleClick = useCallback(
16
+ (event: React.MouseEvent<HTMLButtonElement>) => {
17
+ if (onClick) {
18
+ onClick(event)
19
+ } else {
20
+ event.preventDefault()
21
+ handleNextStep()
22
+ }
23
+ },
24
+ [onClick, handleNextStep]
25
+ )
26
+
27
+ const buttonType = type || (isLastStep ? 'submit' : 'button')
28
+
29
+ return (
30
+ <Button
31
+ type={buttonType}
32
+ {...(buttonType === 'button' ? { onClick: handleClick } : {})}
33
+ {...props}
34
+ >
35
+ {typeof children === 'function' ? children(currentStepIndex) : children}
36
+ </Button>
37
+ )
38
+ }
39
+
40
+ export function PreviousStep({
41
+ appearance = 'ghost',
42
+ children = 'Anterior',
43
+ onClick,
44
+ ...props
45
+ }: ComponentProps<typeof Button>) {
46
+ const { handlePreviousStep } = useSteps()
47
+
48
+ const handleClick = useCallback(
49
+ (event: React.MouseEvent<HTMLButtonElement>) => {
50
+ if (onClick) {
51
+ onClick(event)
52
+ } else {
53
+ event.preventDefault()
54
+ handlePreviousStep()
55
+ }
56
+ },
57
+ [onClick, handlePreviousStep]
58
+ )
59
+
60
+ return (
61
+ <Button appearance={appearance} onClick={handleClick} {...props}>
62
+ {children}
63
+ </Button>
64
+ )
65
+ }
@@ -0,0 +1,12 @@
1
+ import { twMerge } from '@xjur-ui/util'
2
+ import type { ComponentProps } from 'react'
3
+
4
+ export function Steps({ className, ...props }: ComponentProps<'div'>) {
5
+ return (
6
+ <div
7
+ className={twMerge('h-full w-full', className)}
8
+ data-slot="steps-content"
9
+ {...props}
10
+ />
11
+ )
12
+ }
@@ -0,0 +1,121 @@
1
+ import { twMerge } from '@xjur-ui/util'
2
+ import {
3
+ createContext,
4
+ useCallback,
5
+ useContext,
6
+ useMemo,
7
+ useState,
8
+ type ComponentProps
9
+ } from 'react'
10
+
11
+ export interface StepsContextValue {
12
+ steps: string[]
13
+ currentStepIndex: number
14
+ isLastStep: boolean
15
+
16
+ handleStepChange: (index: number) => void
17
+ handleNextStep: () => void
18
+ handlePreviousStep: () => void
19
+ }
20
+
21
+ export const StepsContext = createContext<StepsContextValue>({
22
+ steps: [],
23
+ currentStepIndex: 0,
24
+ isLastStep: false,
25
+ handleStepChange: () => {},
26
+ handleNextStep: () => {},
27
+ handlePreviousStep: () => {}
28
+ })
29
+
30
+ export function StepsProvider({
31
+ steps,
32
+ currentStepIndex: currentStepIndexProp = 0,
33
+ onStepChange,
34
+ children,
35
+ className,
36
+ ...props
37
+ }: {
38
+ steps: string[]
39
+ currentStepIndex?: number
40
+ onStepChange?: (index: number) => void
41
+ children: React.ReactNode | ((context: StepsContextValue) => React.ReactNode)
42
+ } & Omit<ComponentProps<'div'>, 'children'>) {
43
+ const [currentStepIndex, setCurrentStepIndex] = useState(currentStepIndexProp)
44
+
45
+ const handleStepChange = useCallback(
46
+ (index: number) => {
47
+ setCurrentStepIndex(index)
48
+ onStepChange?.(index)
49
+ },
50
+ [onStepChange]
51
+ )
52
+
53
+ const handleNextStep = useCallback(() => {
54
+ const isLastStep = currentStepIndex === steps.length - 1
55
+
56
+ if (isLastStep) {
57
+ return
58
+ }
59
+
60
+ setCurrentStepIndex(prev => prev + 1)
61
+ onStepChange?.(currentStepIndex + 1)
62
+ }, [currentStepIndex, onStepChange, steps])
63
+
64
+ const handlePreviousStep = useCallback(() => {
65
+ if (currentStepIndex === 0) {
66
+ return
67
+ }
68
+
69
+ setCurrentStepIndex(prev => prev - 1)
70
+ onStepChange?.(currentStepIndex - 1)
71
+ }, [currentStepIndex, onStepChange])
72
+
73
+ const isLastStep = useMemo(
74
+ () => currentStepIndex === steps.length - 1,
75
+ [currentStepIndex, steps]
76
+ )
77
+
78
+ const providerValue = useMemo(
79
+ () => ({
80
+ steps,
81
+ currentStepIndex,
82
+ isLastStep,
83
+ setCurrentStepIndex,
84
+
85
+ handleStepChange,
86
+ handleNextStep,
87
+ handlePreviousStep
88
+ }),
89
+ [
90
+ steps,
91
+ currentStepIndex,
92
+ isLastStep,
93
+ setCurrentStepIndex,
94
+ handleStepChange,
95
+ handleNextStep,
96
+ handlePreviousStep
97
+ ]
98
+ )
99
+
100
+ return (
101
+ <StepsContext.Provider value={providerValue}>
102
+ <div
103
+ className={twMerge('h-full w-full', className)}
104
+ data-slot="steps-root"
105
+ {...props}
106
+ >
107
+ {typeof children === 'function' ? children(providerValue) : children}
108
+ </div>
109
+ </StepsContext.Provider>
110
+ )
111
+ }
112
+
113
+ export function useSteps() {
114
+ const context = useContext(StepsContext)
115
+
116
+ if (!context) {
117
+ throw new Error('useSteps must be used within a StepsContext.Provider')
118
+ }
119
+
120
+ return context
121
+ }
@@ -0,0 +1,80 @@
1
+ import { Fragment, useCallback, type ComponentProps } from 'react'
2
+ import { twMerge } from '@xjur-ui/util'
3
+ import { useSteps } from './steps-context'
4
+
5
+ export function StepsNavigation({
6
+ className,
7
+ ...props
8
+ }: ComponentProps<'div'>) {
9
+ const { steps, currentStepIndex } = useSteps()
10
+
11
+ const isLastStep = useCallback(
12
+ (stepIndex: number) => stepIndex === steps.length - 1,
13
+ [steps]
14
+ )
15
+
16
+ const stepState = useCallback(
17
+ (stepIndex: number) => {
18
+ const isActive = stepIndex === currentStepIndex
19
+ const isPassed = stepIndex < currentStepIndex
20
+
21
+ if (isPassed) {
22
+ return 'disabled'
23
+ }
24
+
25
+ return isActive ? 'active' : 'normal'
26
+ },
27
+ [currentStepIndex]
28
+ )
29
+
30
+ return (
31
+ <div
32
+ className={twMerge('gap-small flex items-center', className)}
33
+ data-slot="steps-navigation"
34
+ {...props}
35
+ >
36
+ {steps.map((step, stepIndex) => {
37
+ const state = stepState(stepIndex)
38
+
39
+ return (
40
+ <Fragment key={`${step}-${stepIndex}`}>
41
+ <div
42
+ className="group gap-small flex items-center"
43
+ data-disabled={state === 'disabled'}
44
+ data-slot="step-trigger"
45
+ data-state={state}
46
+ {...props}
47
+ >
48
+ <div
49
+ className={twMerge(
50
+ 'size-large-4x rounded-circle border-border-layer-2 text-size-label-sm bg-layer-2-idle flex items-center justify-center border',
51
+ 'group-data-[state=active]:border-primary-active group-data-[state=active]:bg-primary-alt-active group-data-[state=active]:text-primary-label-active',
52
+ 'group-data-[state=disabled]:bg-layer-1-idle group-data-[state=disabled]:border-border-layer-2 group-data-[state=disabled]:text-neutral-light'
53
+ )}
54
+ data-slot="step-number"
55
+ >
56
+ {stepIndex + 1}
57
+ </div>
58
+
59
+ <span
60
+ className="text-size-label-sm group-data-[state=active]:text-primary-label-active group-data-[state=disabled]:text-neutral-light font-medium"
61
+ data-slot="step-title"
62
+ >
63
+ {step}
64
+ </span>
65
+ </div>
66
+
67
+ {!isLastStep(stepIndex) && (
68
+ <div
69
+ className={twMerge(
70
+ 'bg-border-layer-2 mx-2 h-px flex-1',
71
+ className
72
+ )}
73
+ />
74
+ )}
75
+ </Fragment>
76
+ )
77
+ })}
78
+ </div>
79
+ )
80
+ }
@@ -0,0 +1,9 @@
1
+ import type { ComponentProps } from 'react'
2
+ import { StepsProvider } from './steps-context'
3
+
4
+ export function StepsRoot({
5
+ className,
6
+ ...props
7
+ }: ComponentProps<typeof StepsProvider>) {
8
+ return <StepsProvider className={className} {...props} />
9
+ }
@@ -0,0 +1,8 @@
1
+ export * from './table'
2
+ export * from './table-body'
3
+ export * from './table-cell'
4
+ export * from './table-footer'
5
+ export * from './table-header'
6
+ export * from './table-head'
7
+ export * from './table-row'
8
+ export * from './table-sort'
@@ -0,0 +1,17 @@
1
+ import { cx } from '@xjur-ui/util'
2
+
3
+ export function TableBody({
4
+ className,
5
+ ...props
6
+ }: React.ComponentProps<'tbody'>) {
7
+ return (
8
+ <tbody
9
+ className={cx(
10
+ '[&_tr]:border-border-layer-2 [&_tr]:border-b [&_tr:last-child]:border-0',
11
+ className
12
+ )}
13
+ data-slot="table-body"
14
+ {...props}
15
+ />
16
+ )
17
+ }