@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.
- package/.turbo/turbo-build.log +409 -119
- package/CHANGELOG.md +76 -0
- package/dist/chunk-2JQVYVAT.js +2 -0
- package/dist/chunk-2JQVYVAT.js.map +1 -0
- package/dist/chunk-2JU3PFV2.js +2 -0
- package/dist/chunk-2JU3PFV2.js.map +1 -0
- package/dist/chunk-3H75F4Y2.js +2 -0
- package/dist/chunk-3H75F4Y2.js.map +1 -0
- package/dist/{components/switch.js → chunk-3L772WC6.js} +2 -2
- package/dist/chunk-3L772WC6.js.map +1 -0
- package/dist/chunk-43DUEHUA.js +2 -0
- package/dist/chunk-43DUEHUA.js.map +1 -0
- package/dist/chunk-4BGAERSD.js +2 -0
- package/dist/chunk-4BGAERSD.js.map +1 -0
- package/dist/chunk-4BGTC333.js +2 -0
- package/dist/chunk-4BGTC333.js.map +1 -0
- package/dist/chunk-4PTFZTVU.js +2 -0
- package/dist/chunk-4PTFZTVU.js.map +1 -0
- package/dist/chunk-6PHXO2YA.js +2 -0
- package/dist/{chunk-RWMV7APX.js.map → chunk-6PHXO2YA.js.map} +1 -1
- package/dist/chunk-7HG6Y3VV.js +2 -0
- package/dist/chunk-7HG6Y3VV.js.map +1 -0
- package/dist/chunk-7HMMMRDA.js +2 -0
- package/dist/chunk-7HMMMRDA.js.map +1 -0
- package/dist/chunk-7QGN6XFA.js +2 -0
- package/dist/chunk-7QGN6XFA.js.map +1 -0
- package/dist/chunk-AKR2BJRB.js +2 -0
- package/dist/chunk-AKR2BJRB.js.map +1 -0
- package/dist/chunk-ASZAHSU5.js +2 -0
- package/dist/chunk-ASZAHSU5.js.map +1 -0
- package/dist/chunk-BZDGWC5O.js +2 -0
- package/dist/chunk-BZDGWC5O.js.map +1 -0
- package/dist/chunk-DFXHNK5D.js +2 -0
- package/dist/chunk-DFXHNK5D.js.map +1 -0
- package/dist/chunk-DOC3XTYC.js +2 -0
- package/dist/chunk-DOC3XTYC.js.map +1 -0
- package/dist/chunk-DT44JTXB.js +2 -0
- package/dist/chunk-DT44JTXB.js.map +1 -0
- package/dist/chunk-DVDHTP4C.js +2 -0
- package/dist/chunk-DVDHTP4C.js.map +1 -0
- package/dist/chunk-EITO7GZX.js +2 -0
- package/dist/chunk-EITO7GZX.js.map +1 -0
- package/dist/chunk-EXC2XOL6.js +2 -0
- package/dist/chunk-EXC2XOL6.js.map +1 -0
- package/dist/chunk-F4DYKYWJ.js +2 -0
- package/dist/chunk-F4DYKYWJ.js.map +1 -0
- package/dist/chunk-F5ZLEQGN.js +2 -0
- package/dist/chunk-F5ZLEQGN.js.map +1 -0
- package/dist/chunk-F7ANJ4HD.js +2 -0
- package/dist/chunk-F7ANJ4HD.js.map +1 -0
- package/dist/chunk-FQTUN47L.js +2 -0
- package/dist/chunk-FQTUN47L.js.map +1 -0
- package/dist/chunk-FUHASFGU.js +2 -0
- package/dist/chunk-FUHASFGU.js.map +1 -0
- package/dist/chunk-G6NSC3FL.js +2 -0
- package/dist/chunk-G6NSC3FL.js.map +1 -0
- package/dist/chunk-GKILN5HI.js +2 -0
- package/dist/chunk-GKILN5HI.js.map +1 -0
- package/dist/chunk-GVKH2BG2.js +2 -0
- package/dist/chunk-GVKH2BG2.js.map +1 -0
- package/dist/chunk-J4X5RQTR.js +2 -0
- package/dist/chunk-J4X5RQTR.js.map +1 -0
- package/dist/chunk-JF7JKJES.js +2 -0
- package/dist/chunk-JF7JKJES.js.map +1 -0
- package/dist/chunk-JGPHBUVM.js +2 -0
- package/dist/chunk-JGPHBUVM.js.map +1 -0
- package/dist/{chunk-FASEHVMD.js → chunk-M6ZI7M3R.js} +2 -2
- package/dist/chunk-M6ZI7M3R.js.map +1 -0
- package/dist/chunk-MQ7YTZBI.js +2 -0
- package/dist/chunk-MQ7YTZBI.js.map +1 -0
- package/dist/chunk-MZSV4LNY.js +2 -0
- package/dist/chunk-MZSV4LNY.js.map +1 -0
- package/dist/chunk-O3JK6QF6.js +2 -0
- package/dist/chunk-O3JK6QF6.js.map +1 -0
- package/dist/chunk-OKSGVAQQ.js +2 -0
- package/dist/chunk-OKSGVAQQ.js.map +1 -0
- package/dist/chunk-OLWYBKQR.js +2 -0
- package/dist/chunk-OLWYBKQR.js.map +1 -0
- package/dist/chunk-PBR7SFWY.js +2 -0
- package/dist/chunk-PBR7SFWY.js.map +1 -0
- package/dist/chunk-Q2BZSHS2.js +2 -0
- package/dist/chunk-Q2BZSHS2.js.map +1 -0
- package/dist/chunk-RGKXZJJS.js +3 -0
- package/dist/chunk-RGKXZJJS.js.map +1 -0
- package/dist/chunk-SLAAEXWI.js +2 -0
- package/dist/chunk-SLAAEXWI.js.map +1 -0
- package/dist/chunk-SSTXFHNX.js +2 -0
- package/dist/chunk-SSTXFHNX.js.map +1 -0
- package/dist/chunk-SXGSWVMZ.js +2 -0
- package/dist/chunk-SXGSWVMZ.js.map +1 -0
- package/dist/chunk-TORICLEW.js +2 -0
- package/dist/chunk-TORICLEW.js.map +1 -0
- package/dist/chunk-TYWCS7GS.js +2 -0
- package/dist/chunk-TYWCS7GS.js.map +1 -0
- package/dist/chunk-URDL5OKH.js +2 -0
- package/dist/chunk-URDL5OKH.js.map +1 -0
- package/dist/chunk-V2FCP4FA.js +2 -0
- package/dist/chunk-V2FCP4FA.js.map +1 -0
- package/dist/chunk-VCNKCHFF.js +2 -0
- package/dist/chunk-VCNKCHFF.js.map +1 -0
- package/dist/chunk-WEBAXQID.js +2 -0
- package/dist/chunk-WEBAXQID.js.map +1 -0
- package/dist/chunk-WEGFAS5P.js +2 -0
- package/dist/chunk-WEGFAS5P.js.map +1 -0
- package/dist/chunk-X6SOSTUN.js +2 -0
- package/dist/chunk-X6SOSTUN.js.map +1 -0
- package/dist/chunk-XGPKBYDY.js +2 -0
- package/dist/chunk-XGPKBYDY.js.map +1 -0
- package/dist/chunk-YOLTIAFT.js +2 -0
- package/dist/{chunk-KIFR5VIE.js.map → chunk-YOLTIAFT.js.map} +1 -1
- package/dist/chunk-ZPQPJJQJ.js +2 -0
- package/dist/chunk-ZPQPJJQJ.js.map +1 -0
- package/dist/chunk-ZVVPUP7V.js +2 -0
- package/dist/chunk-ZVVPUP7V.js.map +1 -0
- package/dist/components/breadcrumb.d.ts +20 -0
- package/dist/components/breadcrumb.js +2 -0
- package/dist/components/breadcrumb.js.map +1 -0
- package/dist/components/chip.d.ts +2 -1
- package/dist/components/chip.js +1 -1
- package/dist/components/controls/button.js +2 -0
- package/dist/components/controls/calendar.js +2 -0
- package/dist/components/controls/calendar.js.map +1 -0
- package/dist/components/controls/checkbox.js +2 -0
- package/dist/components/controls/checkbox.js.map +1 -0
- package/dist/components/controls/context/field.context.d.ts +14 -0
- package/dist/components/controls/context/field.context.js +2 -0
- package/dist/components/controls/context/field.context.js.map +1 -0
- package/dist/components/controls/date-picker.d.ts +85 -0
- package/dist/components/controls/date-picker.js +2 -0
- package/dist/components/controls/date-picker.js.map +1 -0
- package/dist/components/controls/floating-label.d.ts +6 -0
- package/dist/components/controls/floating-label.js +2 -0
- package/dist/components/controls/floating-label.js.map +1 -0
- package/dist/components/controls/input.d.ts +96 -0
- package/dist/components/controls/input.js +2 -0
- package/dist/components/controls/input.js.map +1 -0
- package/dist/components/controls/otp-input.js.map +1 -0
- package/dist/components/controls/radio.js +2 -0
- package/dist/components/controls/radio.js.map +1 -0
- package/dist/components/controls/rich-editor.js +2 -0
- package/dist/components/controls/rich-editor.js.map +1 -0
- package/dist/components/{search-input.d.ts → controls/search-input.d.ts} +9 -1
- package/dist/components/controls/search-input.js +2 -0
- package/dist/components/controls/search-selector.d.ts +19 -0
- package/dist/components/controls/search-selector.js +2 -0
- package/dist/components/controls/search-selector.js.map +1 -0
- package/dist/components/controls/select.d.ts +95 -0
- package/dist/components/controls/select.js +2 -0
- package/dist/components/controls/select.js.map +1 -0
- package/dist/components/controls/switch.js +2 -0
- package/dist/components/controls/switch.js.map +1 -0
- package/dist/components/custom/pessoa/index.d.ts +16 -0
- package/dist/components/custom/pessoa/index.js +2 -0
- package/dist/components/custom/pessoa/index.js.map +1 -0
- package/dist/components/custom/pessoa/pessoa-add-button.d.ts +9 -0
- package/dist/components/custom/pessoa/pessoa-add-button.js +2 -0
- package/dist/components/custom/pessoa/pessoa-add-button.js.map +1 -0
- package/dist/components/custom/pessoa/pessoa-body.d.ts +8 -0
- package/dist/components/custom/pessoa/pessoa-body.js +2 -0
- package/dist/components/custom/pessoa/pessoa-body.js.map +1 -0
- package/dist/components/custom/pessoa/pessoa-close-button.d.ts +8 -0
- package/dist/components/custom/pessoa/pessoa-close-button.js +2 -0
- package/dist/components/custom/pessoa/pessoa-close-button.js.map +1 -0
- package/dist/components/custom/pessoa/pessoa-content.d.ts +8 -0
- package/dist/components/custom/pessoa/pessoa-content.js +2 -0
- package/dist/components/custom/pessoa/pessoa-content.js.map +1 -0
- package/dist/components/custom/pessoa/pessoa-footer.d.ts +8 -0
- package/dist/components/custom/pessoa/pessoa-footer.js +2 -0
- package/dist/components/custom/pessoa/pessoa-footer.js.map +1 -0
- package/dist/components/custom/pessoa/pessoa-header.d.ts +10 -0
- package/dist/components/custom/pessoa/pessoa-header.js +2 -0
- package/dist/components/custom/pessoa/pessoa-header.js.map +1 -0
- package/dist/components/custom/pessoa/pessoa-trigger.d.ts +8 -0
- package/dist/components/custom/pessoa/pessoa-trigger.js +2 -0
- package/dist/components/custom/pessoa/pessoa-trigger.js.map +1 -0
- package/dist/components/custom/pessoa/pessoa.context.d.ts +25 -0
- package/dist/components/custom/pessoa/pessoa.context.js +2 -0
- package/dist/components/custom/pessoa/pessoa.context.js.map +1 -0
- package/dist/components/custom/pessoa/pessoa.d.ts +11 -0
- package/dist/components/custom/pessoa/pessoa.js +2 -0
- package/dist/components/custom/pessoa/pessoa.js.map +1 -0
- package/dist/components/dialog.d.ts +51 -0
- package/dist/components/dialog.js +2 -0
- package/dist/components/dialog.js.map +1 -0
- package/dist/components/drag-and-drop/drag-handle.d.ts +15 -0
- package/dist/components/drag-and-drop/drag-handle.js +2 -0
- package/dist/components/drag-and-drop/drag-handle.js.map +1 -0
- package/dist/components/drag-and-drop/drag-list-item.d.ts +14 -0
- package/dist/components/drag-and-drop/drag-list-item.js +2 -0
- package/dist/components/drag-and-drop/drag-list-item.js.map +1 -0
- package/dist/components/drag-and-drop/drag-list.d.ts +14 -0
- package/dist/components/drag-and-drop/drag-list.js +2 -0
- package/dist/components/drag-and-drop/drag-list.js.map +1 -0
- package/dist/components/drag-and-drop/drag-root.d.ts +6 -0
- package/dist/components/drag-and-drop/drag-root.js +2 -0
- package/dist/components/drag-and-drop/drag-root.js.map +1 -0
- package/dist/components/drag-and-drop/index.d.ts +10 -0
- package/dist/components/drag-and-drop/index.js +2 -0
- package/dist/components/drag-and-drop/index.js.map +1 -0
- package/dist/components/drag-and-drop/types/drag-item.d.ts +9 -0
- package/dist/components/drag-and-drop/types/drag-item.js +2 -0
- package/dist/components/drag-and-drop/types/drag-item.js.map +1 -0
- package/dist/components/dropdown-menu.js +1 -1
- package/dist/components/full-calendar/calendar-add-event.d.ts +9 -0
- package/dist/components/full-calendar/calendar-add-event.js +2 -0
- package/dist/components/full-calendar/calendar-add-event.js.map +1 -0
- package/dist/components/full-calendar/calendar-body.d.ts +6 -0
- package/dist/components/full-calendar/calendar-body.js +2 -0
- package/dist/components/full-calendar/calendar-body.js.map +1 -0
- package/dist/components/full-calendar/calendar-cell.d.ts +11 -0
- package/dist/components/full-calendar/calendar-cell.js +2 -0
- package/dist/components/full-calendar/calendar-cell.js.map +1 -0
- package/dist/components/full-calendar/calendar-day-view.d.ts +5 -0
- package/dist/components/full-calendar/calendar-day-view.js +2 -0
- package/dist/components/full-calendar/calendar-day-view.js.map +1 -0
- package/dist/components/full-calendar/calendar-event.d.ts +18 -0
- package/dist/components/full-calendar/calendar-event.js +2 -0
- package/dist/components/full-calendar/calendar-event.js.map +1 -0
- package/dist/components/full-calendar/calendar-header.d.ts +6 -0
- package/dist/components/full-calendar/calendar-header.js +2 -0
- package/dist/components/full-calendar/calendar-header.js.map +1 -0
- package/dist/components/full-calendar/calendar-month-view.d.ts +5 -0
- package/dist/components/full-calendar/calendar-month-view.js +2 -0
- package/dist/components/full-calendar/calendar-month-view.js.map +1 -0
- package/dist/components/full-calendar/calendar-more-events-dropdown.d.ts +9 -0
- package/dist/components/full-calendar/calendar-more-events-dropdown.js +2 -0
- package/dist/components/full-calendar/calendar-more-events-dropdown.js.map +1 -0
- package/dist/components/full-calendar/calendar-navigator.d.ts +5 -0
- package/dist/components/full-calendar/calendar-navigator.js +2 -0
- package/dist/components/full-calendar/calendar-navigator.js.map +1 -0
- package/dist/components/full-calendar/calendar-root.d.ts +30 -0
- package/dist/components/full-calendar/calendar-root.js +2 -0
- package/dist/components/full-calendar/calendar-root.js.map +1 -0
- package/dist/components/full-calendar/calendar-today-button.d.ts +9 -0
- package/dist/components/full-calendar/calendar-today-button.js +2 -0
- package/dist/components/full-calendar/calendar-today-button.js.map +1 -0
- package/dist/components/full-calendar/calendar-toggle-view.d.ts +5 -0
- package/dist/components/full-calendar/calendar-toggle-view.js +2 -0
- package/dist/components/full-calendar/calendar-toggle-view.js.map +1 -0
- package/dist/components/full-calendar/calendar-view-renderer.d.ts +5 -0
- package/dist/components/full-calendar/calendar-view-renderer.js +2 -0
- package/dist/components/full-calendar/calendar-view-renderer.js.map +1 -0
- package/dist/components/full-calendar/calendar-week-day.d.ts +10 -0
- package/dist/components/full-calendar/calendar-week-day.js +2 -0
- package/dist/components/full-calendar/calendar-week-day.js.map +1 -0
- package/dist/components/full-calendar/calendar-week-view.d.ts +5 -0
- package/dist/components/full-calendar/calendar-week-view.js +2 -0
- package/dist/components/full-calendar/calendar-week-view.js.map +1 -0
- package/dist/components/full-calendar/helpers/calendar.d.ts +25 -0
- package/dist/components/full-calendar/helpers/calendar.js +2 -0
- package/dist/components/full-calendar/helpers/calendar.js.map +1 -0
- package/dist/components/full-calendar/index.d.ts +18 -0
- package/dist/components/full-calendar/index.js +2 -0
- package/dist/components/full-calendar/index.js.map +1 -0
- package/dist/components/full-calendar/types/calendar-cell.d.ts +6 -0
- package/dist/components/full-calendar/types/calendar-cell.js +2 -0
- package/dist/components/full-calendar/types/calendar-cell.js.map +1 -0
- package/dist/components/full-calendar/types/calendar-event.d.ts +8 -0
- package/dist/components/full-calendar/types/calendar-event.js +2 -0
- package/dist/components/full-calendar/types/calendar-event.js.map +1 -0
- package/dist/components/full-calendar/types/calendar-view.d.ts +3 -0
- package/dist/components/full-calendar/types/calendar-view.js +2 -0
- package/dist/components/full-calendar/types/calendar-view.js.map +1 -0
- package/dist/components/full-calendar/types/calendar-week-hour.d.ts +6 -0
- package/dist/components/full-calendar/types/calendar-week-hour.js +2 -0
- package/dist/components/full-calendar/types/calendar-week-hour.js.map +1 -0
- package/dist/components/horizontal-scroll.d.ts +11 -0
- package/dist/components/horizontal-scroll.js +2 -0
- package/dist/components/horizontal-scroll.js.map +1 -0
- package/dist/components/icon.d.ts +3 -4
- package/dist/components/icon.js +1 -1
- package/dist/components/list.js +1 -1
- package/dist/components/selection-bar.d.ts +57 -0
- package/dist/components/selection-bar.js +2 -0
- package/dist/components/selection-bar.js.map +1 -0
- package/dist/components/sheet.d.ts +8 -8
- package/dist/components/sheet.js +1 -1
- package/dist/components/sheet.js.map +1 -1
- package/dist/components/steps/index.d.ts +11 -0
- package/dist/components/steps/index.js +2 -0
- package/dist/components/steps/index.js.map +1 -0
- package/dist/components/steps/step.d.ts +8 -0
- package/dist/components/steps/step.js +2 -0
- package/dist/components/steps/step.js.map +1 -0
- package/dist/components/steps/steps-action.d.ts +12 -0
- package/dist/components/steps/steps-action.js +2 -0
- package/dist/components/steps/steps-action.js.map +1 -0
- package/dist/components/steps/steps-content.d.ts +6 -0
- package/dist/components/steps/steps-content.js +2 -0
- package/dist/components/steps/steps-content.js.map +1 -0
- package/dist/components/steps/steps-context.d.ts +22 -0
- package/dist/components/steps/steps-context.js +2 -0
- package/dist/components/steps/steps-context.js.map +1 -0
- package/dist/components/steps/steps-navigation.d.ts +6 -0
- package/dist/components/steps/steps-navigation.js +2 -0
- package/dist/components/steps/steps-navigation.js.map +1 -0
- package/dist/components/steps/steps-root.d.ts +7 -0
- package/dist/components/steps/steps-root.js +2 -0
- package/dist/components/steps/steps-root.js.map +1 -0
- package/dist/components/table/index.d.ts +9 -0
- package/dist/components/table/index.js +2 -0
- package/dist/components/table/index.js.map +1 -0
- package/dist/components/table/table-body.d.ts +5 -0
- package/dist/components/table/table-body.js +2 -0
- package/dist/components/table/table-body.js.map +1 -0
- package/dist/components/table/table-cell.d.ts +5 -0
- package/dist/components/table/table-cell.js +2 -0
- package/dist/components/table/table-cell.js.map +1 -0
- package/dist/components/table/table-footer.d.ts +5 -0
- package/dist/components/table/table-footer.js +2 -0
- package/dist/components/table/table-footer.js.map +1 -0
- package/dist/components/table/table-head.d.ts +6 -0
- package/dist/components/table/table-head.js +2 -0
- package/dist/components/table/table-head.js.map +1 -0
- package/dist/components/table/table-header.d.ts +5 -0
- package/dist/components/table/table-header.js +2 -0
- package/dist/components/table/table-header.js.map +1 -0
- package/dist/components/table/table-row.d.ts +7 -0
- package/dist/components/table/table-row.js +2 -0
- package/dist/components/table/table-row.js.map +1 -0
- package/dist/components/table/table-sort.d.ts +7 -0
- package/dist/components/table/table-sort.js +2 -0
- package/dist/components/table/table-sort.js.map +1 -0
- package/dist/components/table/table.d.ts +5 -0
- package/dist/components/table/table.js +2 -0
- package/dist/components/table/table.js.map +1 -0
- package/dist/components/tag.d.ts +2 -1
- package/dist/components/tag.js +1 -1
- package/dist/components/upload.d.ts +74 -0
- package/dist/components/upload.js +2 -0
- package/dist/components/upload.js.map +1 -0
- package/dist/icons-C-hGI45d.d.ts +4 -0
- package/dist/index.css +1 -1
- package/dist/index.css.map +1 -1
- package/dist/input-mask-DhbtCxF7.d.ts +3 -0
- package/package.json +26 -14
- package/src/components/breadcrumb.tsx +119 -0
- package/src/components/{calendar.tsx → controls/calendar.tsx} +1 -1
- package/src/components/{checkbox.tsx → controls/checkbox.tsx} +2 -2
- package/src/components/controls/context/field.context.ts +27 -0
- package/src/components/controls/date-picker.tsx +199 -0
- package/src/components/controls/floating-label.tsx +60 -0
- package/src/components/controls/input.tsx +237 -0
- package/src/components/{radio.tsx → controls/radio.tsx} +1 -1
- package/src/components/{rich-editor.tsx → controls/rich-editor.tsx} +5 -5
- package/src/components/{search-input.tsx → controls/search-input.tsx} +46 -3
- package/src/components/controls/search-selector.tsx +98 -0
- package/src/components/controls/select.tsx +274 -0
- package/src/components/custom/pessoa/index.ts +9 -0
- package/src/components/custom/pessoa/pessoa-add-button.tsx +35 -0
- package/src/components/custom/pessoa/pessoa-body.tsx +22 -0
- package/src/components/custom/pessoa/pessoa-close-button.tsx +13 -0
- package/src/components/custom/pessoa/pessoa-content.tsx +25 -0
- package/src/components/custom/pessoa/pessoa-footer.tsx +15 -0
- package/src/components/custom/pessoa/pessoa-header.tsx +35 -0
- package/src/components/custom/pessoa/pessoa-trigger.tsx +25 -0
- package/src/components/custom/pessoa/pessoa.context.tsx +73 -0
- package/src/components/custom/pessoa/pessoa.tsx +35 -0
- package/src/components/dialog.tsx +242 -0
- package/src/components/drag-and-drop/drag-handle.tsx +46 -0
- package/src/components/drag-and-drop/drag-list-item.tsx +91 -0
- package/src/components/drag-and-drop/drag-list.tsx +47 -0
- package/src/components/drag-and-drop/drag-root.tsx +30 -0
- package/src/components/drag-and-drop/index.ts +39 -0
- package/src/components/drag-and-drop/types/drag-item.ts +7 -0
- package/src/components/dropdown-menu.tsx +1 -1
- package/src/components/full-calendar/calendar-add-event.tsx +15 -0
- package/src/components/full-calendar/calendar-body.tsx +12 -0
- package/src/components/full-calendar/calendar-cell.tsx +120 -0
- package/src/components/full-calendar/calendar-day-view.tsx +76 -0
- package/src/components/full-calendar/calendar-event.tsx +178 -0
- package/src/components/full-calendar/calendar-header.tsx +14 -0
- package/src/components/full-calendar/calendar-month-view.tsx +69 -0
- package/src/components/full-calendar/calendar-more-events-dropdown.tsx +39 -0
- package/src/components/full-calendar/calendar-navigator.tsx +86 -0
- package/src/components/full-calendar/calendar-root.tsx +165 -0
- package/src/components/full-calendar/calendar-today-button.tsx +21 -0
- package/src/components/full-calendar/calendar-toggle-view.tsx +61 -0
- package/src/components/full-calendar/calendar-view-renderer.tsx +19 -0
- package/src/components/full-calendar/calendar-week-day.tsx +49 -0
- package/src/components/full-calendar/calendar-week-view.tsx +88 -0
- package/src/components/full-calendar/helpers/calendar.ts +158 -0
- package/src/components/full-calendar/index.ts +16 -0
- package/src/components/full-calendar/types/calendar-cell.ts +4 -0
- package/src/components/full-calendar/types/calendar-event.ts +7 -0
- package/src/components/full-calendar/types/calendar-view.ts +1 -0
- package/src/components/full-calendar/types/calendar-week-hour.ts +4 -0
- package/src/components/horizontal-scroll.tsx +159 -0
- package/src/components/list.tsx +1 -1
- package/src/components/selection-bar.tsx +273 -0
- package/src/components/sheet.tsx +26 -17
- package/src/components/steps/index.ts +6 -0
- package/src/components/steps/step.tsx +23 -0
- package/src/components/steps/steps-action.tsx +65 -0
- package/src/components/steps/steps-content.tsx +12 -0
- package/src/components/steps/steps-context.tsx +121 -0
- package/src/components/steps/steps-navigation.tsx +80 -0
- package/src/components/steps/steps-root.tsx +9 -0
- package/src/components/table/index.ts +8 -0
- package/src/components/table/table-body.tsx +17 -0
- package/src/components/table/table-cell.tsx +14 -0
- package/src/components/table/table-footer.tsx +17 -0
- package/src/components/table/table-head.tsx +31 -0
- package/src/components/table/table-header.tsx +17 -0
- package/src/components/table/table-row.tsx +21 -0
- package/src/components/table/table-sort.tsx +34 -0
- package/src/components/table/table.tsx +16 -0
- package/src/components/upload.tsx +647 -0
- package/src/resources/icons.ts +5 -1
- package/dist/chunk-FASEHVMD.js.map +0 -1
- package/dist/chunk-KIFR5VIE.js +0 -2
- package/dist/chunk-NPTLORW5.js +0 -2
- package/dist/chunk-NPTLORW5.js.map +0 -1
- package/dist/chunk-RWMV7APX.js +0 -2
- package/dist/chunk-SHHXKVVR.js +0 -2
- package/dist/chunk-SHHXKVVR.js.map +0 -1
- package/dist/components/button.js +0 -2
- package/dist/components/calendar.js +0 -2
- package/dist/components/calendar.js.map +0 -1
- package/dist/components/checkbox.js +0 -2
- package/dist/components/checkbox.js.map +0 -1
- package/dist/components/date-picker.d.ts +0 -25
- package/dist/components/date-picker.js +0 -2
- package/dist/components/date-picker.js.map +0 -1
- package/dist/components/input.d.ts +0 -37
- package/dist/components/input.js +0 -2
- package/dist/components/input.js.map +0 -1
- package/dist/components/otp-input.js.map +0 -1
- package/dist/components/radio.js +0 -2
- package/dist/components/radio.js.map +0 -1
- package/dist/components/rich-editor.js +0 -2
- package/dist/components/rich-editor.js.map +0 -1
- package/dist/components/search-input.js +0 -2
- package/dist/components/select.d.ts +0 -36
- package/dist/components/select.js +0 -2
- package/dist/components/select.js.map +0 -1
- package/dist/components/switch.js.map +0 -1
- package/dist/components/table.d.ts +0 -17
- package/dist/components/table.js +0 -2
- package/dist/components/table.js.map +0 -1
- package/src/components/date-picker.tsx +0 -263
- package/src/components/input.tsx +0 -320
- package/src/components/select.tsx +0 -318
- package/src/components/table.tsx +0 -160
- /package/dist/components/{button.d.ts → controls/button.d.ts} +0 -0
- /package/dist/components/{button.js.map → controls/button.js.map} +0 -0
- /package/dist/components/{calendar.d.ts → controls/calendar.d.ts} +0 -0
- /package/dist/components/{checkbox.d.ts → controls/checkbox.d.ts} +0 -0
- /package/dist/components/{otp-input.d.ts → controls/otp-input.d.ts} +0 -0
- /package/dist/components/{otp-input.js → controls/otp-input.js} +0 -0
- /package/dist/components/{radio.d.ts → controls/radio.d.ts} +0 -0
- /package/dist/components/{rich-editor.d.ts → controls/rich-editor.d.ts} +0 -0
- /package/dist/components/{search-input.js.map → controls/search-input.js.map} +0 -0
- /package/dist/components/{switch.d.ts → controls/switch.d.ts} +0 -0
- /package/src/components/{button.tsx → controls/button.tsx} +0 -0
- /package/src/components/{otp-input.tsx → controls/otp-input.tsx} +0 -0
- /package/src/components/{switch.tsx → controls/switch.tsx} +0 -0
|
@@ -0,0 +1,242 @@
|
|
|
1
|
+
import * as DialogPrimitive from '@radix-ui/react-dialog'
|
|
2
|
+
import { cva, cx, type ClassVariantProps } from '@xjur-ui/util'
|
|
3
|
+
import { forwardRef, type ComponentProps } from 'react'
|
|
4
|
+
import { Button } from './controls/button'
|
|
5
|
+
import { Typography } from './typography'
|
|
6
|
+
import { Icon } from './icon'
|
|
7
|
+
|
|
8
|
+
const dialogOverlayVariants = cva([
|
|
9
|
+
'fixed inset-0 z-50 bg-black/50 backdrop-blur-sm',
|
|
10
|
+
'data-[state=open]:animate-in data-[state=closed]:animate-out',
|
|
11
|
+
'data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0'
|
|
12
|
+
])
|
|
13
|
+
|
|
14
|
+
const dialogContentVariants = cva(
|
|
15
|
+
[
|
|
16
|
+
'fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-layer-1-idle p-6 shadow-lg duration-200',
|
|
17
|
+
'data-[state=open]:animate-in data-[state=closed]:animate-out',
|
|
18
|
+
'data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0',
|
|
19
|
+
'data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95',
|
|
20
|
+
'data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%]',
|
|
21
|
+
'data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%]',
|
|
22
|
+
'sm:rounded-lg'
|
|
23
|
+
],
|
|
24
|
+
{
|
|
25
|
+
variants: {
|
|
26
|
+
size: {
|
|
27
|
+
sm: 'max-w-sm',
|
|
28
|
+
md: 'max-w-lg',
|
|
29
|
+
lg: 'max-w-2xl',
|
|
30
|
+
xl: 'max-w-4xl'
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
defaultVariants: {
|
|
34
|
+
size: 'md'
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
)
|
|
38
|
+
|
|
39
|
+
const dialogHeaderVariants = cva([
|
|
40
|
+
'flex flex-col space-y-1.5 text-center sm:text-left'
|
|
41
|
+
])
|
|
42
|
+
|
|
43
|
+
const dialogFooterVariants = cva([
|
|
44
|
+
'flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2'
|
|
45
|
+
])
|
|
46
|
+
|
|
47
|
+
const dialogTitleVariants = cva([
|
|
48
|
+
'text-lg font-semibold leading-none tracking-tight'
|
|
49
|
+
])
|
|
50
|
+
|
|
51
|
+
const dialogDescriptionVariants = cva(['text-sm text-neutral-dark'])
|
|
52
|
+
|
|
53
|
+
export const Dialog = DialogPrimitive.Root
|
|
54
|
+
|
|
55
|
+
export const DialogTrigger = DialogPrimitive.Trigger
|
|
56
|
+
|
|
57
|
+
export const DialogPortal = DialogPrimitive.Portal
|
|
58
|
+
|
|
59
|
+
export const DialogClose = DialogPrimitive.Close
|
|
60
|
+
|
|
61
|
+
export interface DialogOverlayProps
|
|
62
|
+
extends ComponentProps<typeof DialogPrimitive.Overlay>,
|
|
63
|
+
ClassVariantProps<typeof dialogOverlayVariants> {}
|
|
64
|
+
|
|
65
|
+
export const DialogOverlay = forwardRef<
|
|
66
|
+
React.ElementRef<typeof DialogPrimitive.Overlay>,
|
|
67
|
+
DialogOverlayProps
|
|
68
|
+
>(({ className, ...props }, ref) => (
|
|
69
|
+
<DialogPrimitive.Overlay
|
|
70
|
+
className={cx(dialogOverlayVariants(), className)}
|
|
71
|
+
ref={ref}
|
|
72
|
+
{...props}
|
|
73
|
+
/>
|
|
74
|
+
))
|
|
75
|
+
|
|
76
|
+
DialogOverlay.displayName = DialogPrimitive.Overlay.displayName
|
|
77
|
+
|
|
78
|
+
export interface DialogContentProps
|
|
79
|
+
extends ComponentProps<typeof DialogPrimitive.Content>,
|
|
80
|
+
ClassVariantProps<typeof dialogContentVariants> {}
|
|
81
|
+
|
|
82
|
+
export const DialogContent = forwardRef<
|
|
83
|
+
React.ElementRef<typeof DialogPrimitive.Content>,
|
|
84
|
+
DialogContentProps
|
|
85
|
+
>(({ className, children, size, ...props }, ref) => (
|
|
86
|
+
<DialogPortal>
|
|
87
|
+
<DialogOverlay />
|
|
88
|
+
<DialogPrimitive.Content
|
|
89
|
+
className={cx(dialogContentVariants({ size }), className)}
|
|
90
|
+
ref={ref}
|
|
91
|
+
{...props}
|
|
92
|
+
>
|
|
93
|
+
{children}
|
|
94
|
+
<DialogPrimitive.Close className="ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute top-4 right-4 rounded-sm opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-none disabled:pointer-events-none">
|
|
95
|
+
<Icon className="h-4 w-4" name="close" />
|
|
96
|
+
<span className="sr-only">Fechar</span>
|
|
97
|
+
</DialogPrimitive.Close>
|
|
98
|
+
</DialogPrimitive.Content>
|
|
99
|
+
</DialogPortal>
|
|
100
|
+
))
|
|
101
|
+
|
|
102
|
+
DialogContent.displayName = DialogPrimitive.Content.displayName
|
|
103
|
+
|
|
104
|
+
export interface DialogHeaderProps
|
|
105
|
+
extends ComponentProps<'div'>,
|
|
106
|
+
ClassVariantProps<typeof dialogHeaderVariants> {}
|
|
107
|
+
|
|
108
|
+
export const DialogHeader = forwardRef<HTMLDivElement, DialogHeaderProps>(
|
|
109
|
+
({ className, ...props }, ref) => (
|
|
110
|
+
<div
|
|
111
|
+
className={cx(dialogHeaderVariants(), className)}
|
|
112
|
+
ref={ref}
|
|
113
|
+
{...props}
|
|
114
|
+
/>
|
|
115
|
+
)
|
|
116
|
+
)
|
|
117
|
+
|
|
118
|
+
DialogHeader.displayName = 'DialogHeader'
|
|
119
|
+
|
|
120
|
+
export interface DialogFooterProps
|
|
121
|
+
extends ComponentProps<'div'>,
|
|
122
|
+
ClassVariantProps<typeof dialogFooterVariants> {}
|
|
123
|
+
|
|
124
|
+
export const DialogFooter = forwardRef<HTMLDivElement, DialogFooterProps>(
|
|
125
|
+
({ className, ...props }, ref) => (
|
|
126
|
+
<div
|
|
127
|
+
className={cx(dialogFooterVariants(), className)}
|
|
128
|
+
ref={ref}
|
|
129
|
+
{...props}
|
|
130
|
+
/>
|
|
131
|
+
)
|
|
132
|
+
)
|
|
133
|
+
|
|
134
|
+
DialogFooter.displayName = 'DialogFooter'
|
|
135
|
+
|
|
136
|
+
export interface DialogTitleProps
|
|
137
|
+
extends ComponentProps<typeof DialogPrimitive.Title>,
|
|
138
|
+
ClassVariantProps<typeof dialogTitleVariants> {}
|
|
139
|
+
|
|
140
|
+
export const DialogTitle = forwardRef<
|
|
141
|
+
React.ElementRef<typeof DialogPrimitive.Title>,
|
|
142
|
+
DialogTitleProps
|
|
143
|
+
>(({ className, ...props }, ref) => (
|
|
144
|
+
<DialogPrimitive.Title
|
|
145
|
+
className={cx(dialogTitleVariants(), className)}
|
|
146
|
+
ref={ref}
|
|
147
|
+
{...props}
|
|
148
|
+
/>
|
|
149
|
+
))
|
|
150
|
+
|
|
151
|
+
DialogTitle.displayName = DialogPrimitive.Title.displayName
|
|
152
|
+
|
|
153
|
+
export interface DialogDescriptionProps
|
|
154
|
+
extends ComponentProps<typeof DialogPrimitive.Description>,
|
|
155
|
+
ClassVariantProps<typeof dialogDescriptionVariants> {}
|
|
156
|
+
|
|
157
|
+
export const DialogDescription = forwardRef<
|
|
158
|
+
React.ElementRef<typeof DialogPrimitive.Description>,
|
|
159
|
+
DialogDescriptionProps
|
|
160
|
+
>(({ className, ...props }, ref) => (
|
|
161
|
+
<DialogPrimitive.Description
|
|
162
|
+
className={cx(dialogDescriptionVariants(), className)}
|
|
163
|
+
ref={ref}
|
|
164
|
+
{...props}
|
|
165
|
+
/>
|
|
166
|
+
))
|
|
167
|
+
|
|
168
|
+
DialogDescription.displayName = DialogPrimitive.Description.displayName
|
|
169
|
+
|
|
170
|
+
export interface DeleteDialogProps {
|
|
171
|
+
open?: boolean
|
|
172
|
+
onOpenChange?: (open: boolean) => void
|
|
173
|
+
title?: string
|
|
174
|
+
description?: string
|
|
175
|
+
onConfirm?: () => void
|
|
176
|
+
onCancel?: () => void
|
|
177
|
+
confirmText?: string
|
|
178
|
+
cancelText?: string
|
|
179
|
+
isLoading?: boolean
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
export function DeleteDialog({
|
|
183
|
+
open,
|
|
184
|
+
onOpenChange,
|
|
185
|
+
title = 'Excluir documento',
|
|
186
|
+
description = 'Você tem certeza que deseja excluir este documento permanentemente?',
|
|
187
|
+
onConfirm,
|
|
188
|
+
onCancel,
|
|
189
|
+
confirmText = 'Excluir permanentemente',
|
|
190
|
+
cancelText = 'Cancelar',
|
|
191
|
+
isLoading = false
|
|
192
|
+
}: DeleteDialogProps) {
|
|
193
|
+
const handleCancel = () => {
|
|
194
|
+
onCancel?.()
|
|
195
|
+
onOpenChange?.(false)
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
const handleConfirm = () => {
|
|
199
|
+
onConfirm?.()
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
const handleOpenChange = (newOpen: boolean) => {
|
|
203
|
+
onOpenChange?.(newOpen)
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
return (
|
|
207
|
+
<Dialog open={open} onOpenChange={handleOpenChange}>
|
|
208
|
+
<DialogContent size="sm">
|
|
209
|
+
<DialogHeader>
|
|
210
|
+
<DialogTitle>
|
|
211
|
+
<Typography size="md" variant="title" weight="semibold">
|
|
212
|
+
{title}
|
|
213
|
+
</Typography>
|
|
214
|
+
</DialogTitle>
|
|
215
|
+
<DialogDescription>
|
|
216
|
+
<Typography size="md" variant="body">
|
|
217
|
+
{description}
|
|
218
|
+
</Typography>
|
|
219
|
+
</DialogDescription>
|
|
220
|
+
</DialogHeader>
|
|
221
|
+
<DialogFooter>
|
|
222
|
+
<Button
|
|
223
|
+
appearance="ghost"
|
|
224
|
+
disabled={isLoading}
|
|
225
|
+
variant="tertiary"
|
|
226
|
+
onClick={handleCancel}
|
|
227
|
+
>
|
|
228
|
+
{cancelText}
|
|
229
|
+
</Button>
|
|
230
|
+
<Button
|
|
231
|
+
appearance="solid"
|
|
232
|
+
disabled={isLoading}
|
|
233
|
+
variant="destructive"
|
|
234
|
+
onClick={handleConfirm}
|
|
235
|
+
>
|
|
236
|
+
{isLoading ? 'Excluindo...' : confirmText}
|
|
237
|
+
</Button>
|
|
238
|
+
</DialogFooter>
|
|
239
|
+
</DialogContent>
|
|
240
|
+
</Dialog>
|
|
241
|
+
)
|
|
242
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { createContext, use, type ComponentProps } from 'react'
|
|
2
|
+
import type { SyntheticListenerMap } from '@dnd-kit/core/dist/hooks/utilities'
|
|
3
|
+
import { Slot } from '@radix-ui/react-slot'
|
|
4
|
+
import { cx } from '@xjur-ui/util'
|
|
5
|
+
import { useDndContext } from '@dnd-kit/core'
|
|
6
|
+
|
|
7
|
+
interface DragHandleContextType {
|
|
8
|
+
listeners?: SyntheticListenerMap
|
|
9
|
+
setActivatorNodeRef: (el: HTMLElement | null) => void
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export const DragHandlerContext = createContext<DragHandleContextType>(
|
|
13
|
+
{} as DragHandleContextType
|
|
14
|
+
)
|
|
15
|
+
|
|
16
|
+
export function DragHandle({
|
|
17
|
+
className,
|
|
18
|
+
asChild,
|
|
19
|
+
...props
|
|
20
|
+
}: ComponentProps<'button'> & {
|
|
21
|
+
asChild?: boolean
|
|
22
|
+
}) {
|
|
23
|
+
const { active } = useDndContext()
|
|
24
|
+
const context = use(DragHandlerContext)
|
|
25
|
+
|
|
26
|
+
if (!context) {
|
|
27
|
+
throw new Error('DragHandle must be used within a DragHandlerContext')
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
const { listeners, setActivatorNodeRef } = context
|
|
31
|
+
|
|
32
|
+
const Comp = asChild ? Slot : 'button'
|
|
33
|
+
|
|
34
|
+
return (
|
|
35
|
+
<Comp
|
|
36
|
+
className={cx(
|
|
37
|
+
className,
|
|
38
|
+
'cursor-grab',
|
|
39
|
+
active !== null && 'cursor-grabbing'
|
|
40
|
+
)}
|
|
41
|
+
{...props}
|
|
42
|
+
{...listeners}
|
|
43
|
+
ref={setActivatorNodeRef}
|
|
44
|
+
/>
|
|
45
|
+
)
|
|
46
|
+
}
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import type { UniqueIdentifier } from '@dnd-kit/core'
|
|
2
|
+
import { useSortable } from '@dnd-kit/sortable'
|
|
3
|
+
import { cx } from '@xjur-ui/util'
|
|
4
|
+
import { type ComponentProps, type CSSProperties } from 'react'
|
|
5
|
+
import { CSS } from '@dnd-kit/utilities'
|
|
6
|
+
import type { DragItem } from './types/drag-item'
|
|
7
|
+
import { DragHandlerContext } from './drag-handle'
|
|
8
|
+
|
|
9
|
+
export function DragListItem({
|
|
10
|
+
id,
|
|
11
|
+
className,
|
|
12
|
+
draggableClassName = '',
|
|
13
|
+
data,
|
|
14
|
+
useCustomDragHandle = false,
|
|
15
|
+
hasOverlay = true,
|
|
16
|
+
...props
|
|
17
|
+
}: Omit<ComponentProps<'li'>, 'id'> & {
|
|
18
|
+
id: UniqueIdentifier
|
|
19
|
+
draggableClassName?: string
|
|
20
|
+
data: DragItem
|
|
21
|
+
useCustomDragHandle?: boolean
|
|
22
|
+
hasOverlay?: boolean
|
|
23
|
+
}) {
|
|
24
|
+
const {
|
|
25
|
+
setNodeRef,
|
|
26
|
+
setActivatorNodeRef,
|
|
27
|
+
attributes,
|
|
28
|
+
listeners,
|
|
29
|
+
transition,
|
|
30
|
+
transform,
|
|
31
|
+
isDragging
|
|
32
|
+
} = useSortable({
|
|
33
|
+
id,
|
|
34
|
+
data
|
|
35
|
+
})
|
|
36
|
+
|
|
37
|
+
const style: CSSProperties = {
|
|
38
|
+
transition,
|
|
39
|
+
transform: CSS.Transform.toString(transform),
|
|
40
|
+
...(isDragging && {
|
|
41
|
+
boxShadow: 'none'
|
|
42
|
+
})
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
const listClassNames = cx(
|
|
46
|
+
'list-none',
|
|
47
|
+
useCustomDragHandle ? 'cursor-default' : 'cursor-grab',
|
|
48
|
+
className
|
|
49
|
+
)
|
|
50
|
+
|
|
51
|
+
if (isDragging) {
|
|
52
|
+
return (
|
|
53
|
+
<li
|
|
54
|
+
className={cx(
|
|
55
|
+
'data-[overlay=true]:border-border-layer-2 data-[overlay=true]:border-2 data-[overlay=true]:border-dashed data-[overlay=true]:bg-transparent data-[overlay=true]:opacity-60',
|
|
56
|
+
draggableClassName,
|
|
57
|
+
className
|
|
58
|
+
)}
|
|
59
|
+
data-overlay={hasOverlay}
|
|
60
|
+
ref={setNodeRef}
|
|
61
|
+
style={style}
|
|
62
|
+
{...props}
|
|
63
|
+
/>
|
|
64
|
+
)
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
if (useCustomDragHandle) {
|
|
68
|
+
return (
|
|
69
|
+
<DragHandlerContext.Provider value={{ listeners, setActivatorNodeRef }}>
|
|
70
|
+
<li
|
|
71
|
+
className={listClassNames}
|
|
72
|
+
ref={setNodeRef}
|
|
73
|
+
style={style}
|
|
74
|
+
{...attributes}
|
|
75
|
+
{...props}
|
|
76
|
+
/>
|
|
77
|
+
</DragHandlerContext.Provider>
|
|
78
|
+
)
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
return (
|
|
82
|
+
<li
|
|
83
|
+
className={listClassNames}
|
|
84
|
+
ref={setNodeRef}
|
|
85
|
+
style={style}
|
|
86
|
+
{...attributes}
|
|
87
|
+
{...listeners}
|
|
88
|
+
{...props}
|
|
89
|
+
/>
|
|
90
|
+
)
|
|
91
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { useDroppable, type UniqueIdentifier } from '@dnd-kit/core'
|
|
2
|
+
import {
|
|
3
|
+
type SortableContextProps,
|
|
4
|
+
verticalListSortingStrategy,
|
|
5
|
+
horizontalListSortingStrategy,
|
|
6
|
+
SortableContext
|
|
7
|
+
} from '@dnd-kit/sortable'
|
|
8
|
+
import { cx } from '@xjur-ui/util'
|
|
9
|
+
import type { DragItem } from './types/drag-item'
|
|
10
|
+
|
|
11
|
+
export function DragList({
|
|
12
|
+
items,
|
|
13
|
+
orientation = 'vertical',
|
|
14
|
+
children,
|
|
15
|
+
className,
|
|
16
|
+
id,
|
|
17
|
+
data,
|
|
18
|
+
...props
|
|
19
|
+
}: Omit<SortableContextProps, 'items' | 'id'> & {
|
|
20
|
+
items: DragItem[]
|
|
21
|
+
orientation?: 'vertical' | 'horizontal'
|
|
22
|
+
className?: string
|
|
23
|
+
id: UniqueIdentifier
|
|
24
|
+
data?: DragItem
|
|
25
|
+
}) {
|
|
26
|
+
const strategy =
|
|
27
|
+
orientation === 'vertical'
|
|
28
|
+
? verticalListSortingStrategy
|
|
29
|
+
: horizontalListSortingStrategy
|
|
30
|
+
|
|
31
|
+
const { setNodeRef } = useDroppable({
|
|
32
|
+
id,
|
|
33
|
+
data
|
|
34
|
+
})
|
|
35
|
+
|
|
36
|
+
return (
|
|
37
|
+
<SortableContext
|
|
38
|
+
items={items.map(item => item)}
|
|
39
|
+
strategy={strategy}
|
|
40
|
+
{...props}
|
|
41
|
+
>
|
|
42
|
+
<ul className={cx(className)} ref={setNodeRef}>
|
|
43
|
+
{children}
|
|
44
|
+
</ul>
|
|
45
|
+
</SortableContext>
|
|
46
|
+
)
|
|
47
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import {
|
|
2
|
+
closestCenter,
|
|
3
|
+
useSensors,
|
|
4
|
+
useSensor,
|
|
5
|
+
PointerSensor,
|
|
6
|
+
KeyboardSensor,
|
|
7
|
+
DndContext,
|
|
8
|
+
type DndContextProps
|
|
9
|
+
} from '@dnd-kit/core'
|
|
10
|
+
import { sortableKeyboardCoordinates } from '@dnd-kit/sortable'
|
|
11
|
+
|
|
12
|
+
export function DragRoot({
|
|
13
|
+
collisionDetection = closestCenter,
|
|
14
|
+
...props
|
|
15
|
+
}: DndContextProps) {
|
|
16
|
+
const sensors = useSensors(
|
|
17
|
+
useSensor(PointerSensor),
|
|
18
|
+
useSensor(KeyboardSensor, {
|
|
19
|
+
coordinateGetter: sortableKeyboardCoordinates
|
|
20
|
+
})
|
|
21
|
+
)
|
|
22
|
+
|
|
23
|
+
return (
|
|
24
|
+
<DndContext
|
|
25
|
+
collisionDetection={collisionDetection}
|
|
26
|
+
sensors={props.sensors ?? sensors}
|
|
27
|
+
{...props}
|
|
28
|
+
/>
|
|
29
|
+
)
|
|
30
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/* Dnd Kit Sortable helpers */
|
|
2
|
+
export { arrayMove, useSortable } from '@dnd-kit/sortable'
|
|
3
|
+
|
|
4
|
+
/* Dnd Kit Core helpers */
|
|
5
|
+
export {
|
|
6
|
+
closestCenter,
|
|
7
|
+
closestCorners,
|
|
8
|
+
pointerWithin,
|
|
9
|
+
getFirstCollision,
|
|
10
|
+
getClientRect,
|
|
11
|
+
useDroppable,
|
|
12
|
+
useDndContext,
|
|
13
|
+
useDraggable,
|
|
14
|
+
useSensor,
|
|
15
|
+
useDndMonitor,
|
|
16
|
+
useSensors
|
|
17
|
+
} from '@dnd-kit/core'
|
|
18
|
+
|
|
19
|
+
/* Dnd Kit Core Components */
|
|
20
|
+
export { DragOverlay } from '@dnd-kit/core'
|
|
21
|
+
|
|
22
|
+
/* Dnd Kit Core Types */
|
|
23
|
+
export {
|
|
24
|
+
type DragEndEvent,
|
|
25
|
+
type DragStartEvent,
|
|
26
|
+
type DragOverEvent,
|
|
27
|
+
type DragAbortEvent,
|
|
28
|
+
type DragCancelEvent,
|
|
29
|
+
type DragMoveEvent,
|
|
30
|
+
type DragPendingEvent,
|
|
31
|
+
type UniqueIdentifier
|
|
32
|
+
} from '@dnd-kit/core'
|
|
33
|
+
|
|
34
|
+
/* Drag And Drop Components */
|
|
35
|
+
export { DragRoot } from './drag-root'
|
|
36
|
+
export { DragList } from './drag-list'
|
|
37
|
+
export { DragListItem } from './drag-list-item'
|
|
38
|
+
export { DragHandle } from './drag-handle'
|
|
39
|
+
export type { DragItem } from './types/drag-item'
|
|
@@ -49,7 +49,7 @@ export function DropdownMenuContent({
|
|
|
49
49
|
<DropdownMenuPrimitive.Content
|
|
50
50
|
align={align}
|
|
51
51
|
className={cx(
|
|
52
|
-
'group z-
|
|
52
|
+
'group z-1000 max-h-[var(--radix-popover-content-available-height)] max-w-[var(--radix-popover-trigger-width)] min-w-[var(--radix-popover-trigger-width)]',
|
|
53
53
|
className
|
|
54
54
|
)}
|
|
55
55
|
data-slot="dropdown-menu-content"
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Button } from '../controls/button'
|
|
2
|
+
import { Icon } from '../icon'
|
|
3
|
+
|
|
4
|
+
interface CalendarAddEventProps {
|
|
5
|
+
date: Date
|
|
6
|
+
onAddEvent: (date: Date) => void
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export function CalendarAddEvent({ date, onAddEvent }: CalendarAddEventProps) {
|
|
10
|
+
return (
|
|
11
|
+
<Button size="icon_sm" variant="outlined" onClick={() => onAddEvent(date)}>
|
|
12
|
+
<Icon className="text-icon-neutral-3" name="add" />
|
|
13
|
+
</Button>
|
|
14
|
+
)
|
|
15
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { cx } from '@xjur-ui/util'
|
|
2
|
+
import type { ComponentProps } from 'react'
|
|
3
|
+
|
|
4
|
+
export function CalendarBody({ className, ...props }: ComponentProps<'div'>) {
|
|
5
|
+
return (
|
|
6
|
+
<div
|
|
7
|
+
className={cx(className, 'gap-large-2x p-large flex flex-col')}
|
|
8
|
+
data-slot="calendar-body"
|
|
9
|
+
{...props}
|
|
10
|
+
/>
|
|
11
|
+
)
|
|
12
|
+
}
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
import { Fragment, useMemo } from 'react'
|
|
2
|
+
import { useDroppable } from '@dnd-kit/core'
|
|
3
|
+
import { cx, tv } from '@xjur-ui/util'
|
|
4
|
+
import { isPast } from 'date-fns'
|
|
5
|
+
import { Typography } from '../typography'
|
|
6
|
+
import { Button } from '../controls/button'
|
|
7
|
+
import { Icon } from '../icon'
|
|
8
|
+
import { isToday } from './helpers/calendar'
|
|
9
|
+
import { useFullCalendar } from './calendar-root'
|
|
10
|
+
import type { ICalendarCell } from './types/calendar-cell'
|
|
11
|
+
import type { ICalendarEvent } from './types/calendar-event'
|
|
12
|
+
import { CalendarMoreEventsDropdown } from './calendar-more-events-dropdown'
|
|
13
|
+
|
|
14
|
+
interface CalendarCellProps {
|
|
15
|
+
events: ICalendarEvent[]
|
|
16
|
+
cell: ICalendarCell
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
const calendarCellVariants = tv({
|
|
20
|
+
base: 'group/calendar-cell p-small flex flex-col gap-small-1x w-full bg-layer-2-idle ',
|
|
21
|
+
variants: {
|
|
22
|
+
type: {
|
|
23
|
+
month: 'h-[212px]',
|
|
24
|
+
week: 'min-h-[64px] max-h-[212px]',
|
|
25
|
+
day: 'min-h-[64px] max-h-[212px]'
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
})
|
|
29
|
+
|
|
30
|
+
export function CalendarCell({ cell, events }: CalendarCellProps) {
|
|
31
|
+
const { date, type } = cell
|
|
32
|
+
|
|
33
|
+
const { renderEvent, activeEventId, onAddEvent, disableEventCreationInPast } =
|
|
34
|
+
useFullCalendar()
|
|
35
|
+
const eventsToShow = useMemo(() => events.slice(0, 2), [events])
|
|
36
|
+
const hasMore = events.length >= 3
|
|
37
|
+
|
|
38
|
+
const { isOver, setNodeRef } = useDroppable({
|
|
39
|
+
id: `calendar-cell-${type}-${date.toISOString()}`,
|
|
40
|
+
data: {
|
|
41
|
+
date,
|
|
42
|
+
type
|
|
43
|
+
}
|
|
44
|
+
})
|
|
45
|
+
|
|
46
|
+
const isDraggingInCell = useMemo(() => {
|
|
47
|
+
const cellEvent = events.find(event => event.id === activeEventId)
|
|
48
|
+
|
|
49
|
+
if (!cellEvent) return false
|
|
50
|
+
|
|
51
|
+
const formatDate = (date: Date) => {
|
|
52
|
+
return date.toLocaleDateString('pt-BR', {
|
|
53
|
+
year: 'numeric',
|
|
54
|
+
month: '2-digit',
|
|
55
|
+
day: '2-digit'
|
|
56
|
+
})
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
const cellDate = formatDate(date)
|
|
60
|
+
const cellEventDate = formatDate(cellEvent.eventDate)
|
|
61
|
+
|
|
62
|
+
return cellDate === cellEventDate
|
|
63
|
+
}, [activeEventId, date, events])
|
|
64
|
+
|
|
65
|
+
const calendarCellClassNames = calendarCellVariants({ type })
|
|
66
|
+
|
|
67
|
+
const disableEventCreation = useMemo(
|
|
68
|
+
() => disableEventCreationInPast && isPast(date) && !isToday(date),
|
|
69
|
+
[disableEventCreationInPast, date]
|
|
70
|
+
)
|
|
71
|
+
|
|
72
|
+
return (
|
|
73
|
+
<div
|
|
74
|
+
className={calendarCellClassNames}
|
|
75
|
+
data-slot="calendar-cell"
|
|
76
|
+
ref={setNodeRef}
|
|
77
|
+
>
|
|
78
|
+
{type === 'month' && (
|
|
79
|
+
<div className="flex items-center justify-center">
|
|
80
|
+
<div
|
|
81
|
+
className={cx(
|
|
82
|
+
'size-large-2x rounded-circle bg-layer-2-idle flex items-center justify-center',
|
|
83
|
+
isToday(date) && 'bg-primary-idle text-neutral-label'
|
|
84
|
+
)}
|
|
85
|
+
>
|
|
86
|
+
<Typography size="sm" variant="label" weight="medium">
|
|
87
|
+
{cell.date.getDate()}
|
|
88
|
+
</Typography>
|
|
89
|
+
</div>
|
|
90
|
+
</div>
|
|
91
|
+
)}
|
|
92
|
+
|
|
93
|
+
<div className="gap-small-1x flex flex-col">
|
|
94
|
+
{eventsToShow.map(event => (
|
|
95
|
+
<Fragment key={event.id}>{renderEvent(event)}</Fragment>
|
|
96
|
+
))}
|
|
97
|
+
|
|
98
|
+
{isOver && eventsToShow.length < 2 && !isDraggingInCell && (
|
|
99
|
+
<div className="border-border-layer-4 rounded-small-2x h-[68px] w-full border border-dashed" />
|
|
100
|
+
)}
|
|
101
|
+
</div>
|
|
102
|
+
|
|
103
|
+
<div className="mt-auto flex items-center justify-between">
|
|
104
|
+
{hasMore && <CalendarMoreEventsDropdown events={events.slice(2)} />}
|
|
105
|
+
|
|
106
|
+
{onAddEvent && !disableEventCreation && (
|
|
107
|
+
<div className="invisible ml-auto transition-opacity duration-100 ease-in-out group-hover/calendar-cell:visible">
|
|
108
|
+
<Button
|
|
109
|
+
size="icon_sm"
|
|
110
|
+
variant="outlined"
|
|
111
|
+
onClick={() => onAddEvent(date)}
|
|
112
|
+
>
|
|
113
|
+
<Icon className="text-icon-neutral-3" name="add" />
|
|
114
|
+
</Button>
|
|
115
|
+
</div>
|
|
116
|
+
)}
|
|
117
|
+
</div>
|
|
118
|
+
</div>
|
|
119
|
+
)
|
|
120
|
+
}
|