@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,274 @@
|
|
|
1
|
+
import { tv, twJoin, twMerge } from '@xjur-ui/util'
|
|
2
|
+
import { useMemo, type ComponentProps } from 'react'
|
|
3
|
+
import * as RadixPopover from '@radix-ui/react-popover'
|
|
4
|
+
import { Icon, type IconType } from '../icon'
|
|
5
|
+
import { Typography } from '../typography'
|
|
6
|
+
import {
|
|
7
|
+
ListHeaderTitle,
|
|
8
|
+
ListHeader,
|
|
9
|
+
ListContent,
|
|
10
|
+
ListItem,
|
|
11
|
+
ListRoot
|
|
12
|
+
} from '../list'
|
|
13
|
+
import {
|
|
14
|
+
FieldContext,
|
|
15
|
+
useFieldContext,
|
|
16
|
+
type FieldContextValue
|
|
17
|
+
} from './context/field.context'
|
|
18
|
+
import { FloatingLabel } from './floating-label'
|
|
19
|
+
|
|
20
|
+
export const select = tv({
|
|
21
|
+
slots: {
|
|
22
|
+
wrapper: 'group flex w-full flex-col gap-small-2x',
|
|
23
|
+
trigger: [
|
|
24
|
+
'h-large-4x w-full cursor-pointer relative',
|
|
25
|
+
'flex items-center gap-small rounded-small-1x justify-between',
|
|
26
|
+
'py-small_1x-alt px-small',
|
|
27
|
+
'bg-layer-2-idle border border-border-layer-2',
|
|
28
|
+
'group-has-[div[data-slot=input-action-slot]]:rounded-r-none',
|
|
29
|
+
'transition-all duration-200'
|
|
30
|
+
],
|
|
31
|
+
content: [
|
|
32
|
+
'group z-1000 max-h-[var(--radix-popover-content-available-height)] max-w-[var(--radix-popover-content-available-width)] min-w-[var(--radix-popover-trigger-width)]'
|
|
33
|
+
],
|
|
34
|
+
icon: 'size-large text-icon-neutral-3 flex items-center justify-center',
|
|
35
|
+
slotText:
|
|
36
|
+
'size-large flex items-center justify-center !text-size-label-md text-neutral-placeholder',
|
|
37
|
+
caption: '!text-size-body-sm font-normal'
|
|
38
|
+
},
|
|
39
|
+
variants: {
|
|
40
|
+
state: {
|
|
41
|
+
normal: {
|
|
42
|
+
trigger:
|
|
43
|
+
'hover:border-border-layer-3 data-[state=open]:border-primary-idle data-[state=open]:hover:border-primary-idle'
|
|
44
|
+
},
|
|
45
|
+
error: {
|
|
46
|
+
trigger:
|
|
47
|
+
'border-danger-idle hover:border-danger-idle data-[state=open]:border-danger-idle data-[state=open]:hover:border-danger-idle',
|
|
48
|
+
caption: 'text-danger-label-idle'
|
|
49
|
+
},
|
|
50
|
+
disabled: {
|
|
51
|
+
trigger: 'pointer-events-none border-transparent bg-layer-2-idle'
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
})
|
|
56
|
+
|
|
57
|
+
const { wrapper, trigger, icon, caption, slotText, content } = select()
|
|
58
|
+
|
|
59
|
+
export function SelectRoot({
|
|
60
|
+
className,
|
|
61
|
+
state = 'normal',
|
|
62
|
+
defaultOpen,
|
|
63
|
+
variant = 'normal',
|
|
64
|
+
modal,
|
|
65
|
+
open,
|
|
66
|
+
onOpenChange: handleOpenChange,
|
|
67
|
+
...props
|
|
68
|
+
}: ComponentProps<'div'> &
|
|
69
|
+
FieldContextValue &
|
|
70
|
+
ComponentProps<typeof RadixPopover.Root>) {
|
|
71
|
+
return (
|
|
72
|
+
<RadixPopover.Root
|
|
73
|
+
defaultOpen={defaultOpen}
|
|
74
|
+
modal={modal}
|
|
75
|
+
open={open}
|
|
76
|
+
onOpenChange={handleOpenChange}
|
|
77
|
+
>
|
|
78
|
+
<FieldContext.Provider value={{ state, variant }}>
|
|
79
|
+
<div className={wrapper({ className, state })} {...props} />
|
|
80
|
+
</FieldContext.Provider>
|
|
81
|
+
</RadixPopover.Root>
|
|
82
|
+
)
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
export function SelectTrigger({
|
|
86
|
+
className,
|
|
87
|
+
...props
|
|
88
|
+
}: ComponentProps<typeof RadixPopover.Trigger>) {
|
|
89
|
+
const { state, variant } = useFieldContext()
|
|
90
|
+
|
|
91
|
+
const filterTrigger = tv({
|
|
92
|
+
base: ['group bg-layer-2-idle'],
|
|
93
|
+
variants: {
|
|
94
|
+
state: {
|
|
95
|
+
normal: [
|
|
96
|
+
'border-border-layer-2 hover:border-border-layer-3 has-[input:not(:placeholder-shown)]:border-primary-idle'
|
|
97
|
+
],
|
|
98
|
+
error: ['border-danger-idle hover:border-danger-idle'],
|
|
99
|
+
disabled: ['border border-border-layer-2 opacity-60']
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
})
|
|
103
|
+
|
|
104
|
+
const mergedClassName = twMerge(
|
|
105
|
+
trigger({ state, className }),
|
|
106
|
+
variant === 'filter' && filterTrigger({ state, className })
|
|
107
|
+
)
|
|
108
|
+
|
|
109
|
+
return (
|
|
110
|
+
<RadixPopover.Trigger
|
|
111
|
+
className={mergedClassName}
|
|
112
|
+
disabled={state === 'disabled'}
|
|
113
|
+
{...props}
|
|
114
|
+
/>
|
|
115
|
+
)
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
export function SelectIcon({
|
|
119
|
+
className,
|
|
120
|
+
name,
|
|
121
|
+
...props
|
|
122
|
+
}: ComponentProps<'div'> & {
|
|
123
|
+
name: IconType
|
|
124
|
+
}) {
|
|
125
|
+
const { state } = useFieldContext()
|
|
126
|
+
|
|
127
|
+
return (
|
|
128
|
+
<div className={icon({ className, state })} {...props}>
|
|
129
|
+
<Icon name={name} />
|
|
130
|
+
</div>
|
|
131
|
+
)
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
export function SelectLabel(props: ComponentProps<typeof FloatingLabel>) {
|
|
135
|
+
return <FloatingLabel {...props} />
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
export function SelectValue({
|
|
139
|
+
className,
|
|
140
|
+
displayValue = '',
|
|
141
|
+
value,
|
|
142
|
+
placeholder,
|
|
143
|
+
...props
|
|
144
|
+
}: ComponentProps<'input'> & { displayValue?: string }) {
|
|
145
|
+
const { variant } = useFieldContext()
|
|
146
|
+
|
|
147
|
+
const valueOrPlaceholder = useMemo(() => {
|
|
148
|
+
if (variant === 'filter') return displayValue
|
|
149
|
+
return displayValue || placeholder
|
|
150
|
+
}, [displayValue, placeholder, variant])
|
|
151
|
+
|
|
152
|
+
return (
|
|
153
|
+
<div className="flex w-full">
|
|
154
|
+
<Typography className="text-neutral-dark group-has-[div[data-slot=date-picker-left-slot]]:pl-large-1x">
|
|
155
|
+
{valueOrPlaceholder}
|
|
156
|
+
</Typography>
|
|
157
|
+
|
|
158
|
+
<input
|
|
159
|
+
{...props}
|
|
160
|
+
aria-readonly={true}
|
|
161
|
+
className={twJoin('pointer-events-none', className)}
|
|
162
|
+
hidden={true}
|
|
163
|
+
placeholder={' '}
|
|
164
|
+
readOnly={true}
|
|
165
|
+
value={value ?? ''}
|
|
166
|
+
/>
|
|
167
|
+
</div>
|
|
168
|
+
)
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
export function SelectMultiValue({
|
|
172
|
+
className,
|
|
173
|
+
value,
|
|
174
|
+
placeholder,
|
|
175
|
+
children,
|
|
176
|
+
...props
|
|
177
|
+
}: ComponentProps<'input'>) {
|
|
178
|
+
const { variant } = useFieldContext()
|
|
179
|
+
|
|
180
|
+
const shouldShowPlaceholder = useMemo(() => {
|
|
181
|
+
if (variant === 'filter') return false
|
|
182
|
+
return Array.isArray(value) && value.length === 0 && placeholder
|
|
183
|
+
}, [value, placeholder, variant])
|
|
184
|
+
|
|
185
|
+
return (
|
|
186
|
+
<div
|
|
187
|
+
className={twMerge(
|
|
188
|
+
className,
|
|
189
|
+
'gap-small-1x scrollbar-hide flex w-full overflow-x-hidden',
|
|
190
|
+
'group-disabled:!pl-0'
|
|
191
|
+
)}
|
|
192
|
+
>
|
|
193
|
+
{shouldShowPlaceholder && (
|
|
194
|
+
<Typography className="text-neutral-dark group-has-[div[data-slot=date-picker-left-slot]]:pl-large-1x">
|
|
195
|
+
{placeholder}
|
|
196
|
+
</Typography>
|
|
197
|
+
)}
|
|
198
|
+
|
|
199
|
+
{children}
|
|
200
|
+
|
|
201
|
+
<input
|
|
202
|
+
{...props}
|
|
203
|
+
aria-readonly={true}
|
|
204
|
+
className={twMerge(className, 'pointer-events-none')}
|
|
205
|
+
hidden={true}
|
|
206
|
+
placeholder={' '}
|
|
207
|
+
readOnly={true}
|
|
208
|
+
value={value}
|
|
209
|
+
/>
|
|
210
|
+
</div>
|
|
211
|
+
)
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
export function SelectContent({
|
|
215
|
+
className,
|
|
216
|
+
sideOffset = 5,
|
|
217
|
+
side = 'bottom',
|
|
218
|
+
align = 'start',
|
|
219
|
+
children,
|
|
220
|
+
...props
|
|
221
|
+
}: ComponentProps<typeof RadixPopover.Content>) {
|
|
222
|
+
const { state } = useFieldContext()
|
|
223
|
+
|
|
224
|
+
return (
|
|
225
|
+
<RadixPopover.Portal>
|
|
226
|
+
<RadixPopover.Content
|
|
227
|
+
align={align}
|
|
228
|
+
className={content({ className, state })}
|
|
229
|
+
side={side}
|
|
230
|
+
sideOffset={sideOffset}
|
|
231
|
+
{...props}
|
|
232
|
+
>
|
|
233
|
+
<ListRoot>{children}</ListRoot>
|
|
234
|
+
</RadixPopover.Content>
|
|
235
|
+
</RadixPopover.Portal>
|
|
236
|
+
)
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
export function SelectCaption({ className, ...props }: ComponentProps<'p'>) {
|
|
240
|
+
const { state } = useFieldContext()
|
|
241
|
+
return <p className={caption({ className, state })} {...props} />
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
export function SelectSlot({ className, ...props }: ComponentProps<'span'>) {
|
|
245
|
+
const { state } = useFieldContext()
|
|
246
|
+
return <span className={slotText({ className, state })} {...props} />
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
export function SelectOptions(props: ComponentProps<typeof ListContent>) {
|
|
250
|
+
return <ListContent {...props} />
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
export function SelectOption({
|
|
254
|
+
className,
|
|
255
|
+
...props
|
|
256
|
+
}: ComponentProps<typeof ListItem>) {
|
|
257
|
+
return (
|
|
258
|
+
<ListItem className={twMerge(className, 'cursor-pointer')} {...props} />
|
|
259
|
+
)
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
export function SelectOptionText(props: ComponentProps<typeof Typography>) {
|
|
263
|
+
return <Typography {...props} />
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
export function SelectHeader(props: ComponentProps<typeof ListHeader>) {
|
|
267
|
+
return <ListHeader {...props} />
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
export function SelectHeaderTitle(
|
|
271
|
+
props: ComponentProps<typeof ListHeaderTitle>
|
|
272
|
+
) {
|
|
273
|
+
return <ListHeaderTitle {...props} />
|
|
274
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export * from './pessoa'
|
|
2
|
+
export * from './pessoa.context'
|
|
3
|
+
export * from './pessoa-add-button'
|
|
4
|
+
export * from './pessoa-body'
|
|
5
|
+
export * from './pessoa-content'
|
|
6
|
+
export * from './pessoa-footer'
|
|
7
|
+
export * from './pessoa-header'
|
|
8
|
+
export * from './pessoa-trigger'
|
|
9
|
+
export * from './pessoa-close-button'
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { twMerge } from '@xjur-ui/util'
|
|
2
|
+
import { type ComponentProps, type MouseEvent, useCallback } from 'react'
|
|
3
|
+
import { Button } from '../../controls/button'
|
|
4
|
+
import { Icon } from '../../icon'
|
|
5
|
+
import { usePessoaContext } from './pessoa.context'
|
|
6
|
+
|
|
7
|
+
export function PessoaAddButton({
|
|
8
|
+
appearance = 'ghost',
|
|
9
|
+
onClick,
|
|
10
|
+
className,
|
|
11
|
+
children = 'Adicionar',
|
|
12
|
+
...props
|
|
13
|
+
}: ComponentProps<typeof Button>) {
|
|
14
|
+
const { changeCurrentView } = usePessoaContext()
|
|
15
|
+
|
|
16
|
+
const handleAddPessoaClick = useCallback(
|
|
17
|
+
(event: MouseEvent<HTMLButtonElement>) => {
|
|
18
|
+
changeCurrentView('form')
|
|
19
|
+
onClick?.(event)
|
|
20
|
+
},
|
|
21
|
+
[changeCurrentView, onClick]
|
|
22
|
+
)
|
|
23
|
+
|
|
24
|
+
return (
|
|
25
|
+
<Button
|
|
26
|
+
appearance={appearance}
|
|
27
|
+
className={twMerge('w-fit', className)}
|
|
28
|
+
onClick={handleAddPessoaClick}
|
|
29
|
+
{...props}
|
|
30
|
+
>
|
|
31
|
+
{children}
|
|
32
|
+
<Icon name="add" />
|
|
33
|
+
</Button>
|
|
34
|
+
)
|
|
35
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { twMerge } from '@xjur-ui/util'
|
|
2
|
+
import type { ComponentProps } from 'react'
|
|
3
|
+
import { SheetBody } from '../../sheet'
|
|
4
|
+
import { usePessoaContext } from './pessoa.context'
|
|
5
|
+
|
|
6
|
+
export function PessoaBody({
|
|
7
|
+
className,
|
|
8
|
+
...props
|
|
9
|
+
}: ComponentProps<typeof SheetBody>) {
|
|
10
|
+
const { currentView } = usePessoaContext()
|
|
11
|
+
|
|
12
|
+
return (
|
|
13
|
+
<SheetBody
|
|
14
|
+
className={twMerge(
|
|
15
|
+
'gap-large-2x data-[view=form]:!px-none flex flex-col',
|
|
16
|
+
className
|
|
17
|
+
)}
|
|
18
|
+
data-view={currentView}
|
|
19
|
+
{...props}
|
|
20
|
+
/>
|
|
21
|
+
)
|
|
22
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { ComponentProps } from 'react'
|
|
2
|
+
import { SheetClose } from '../../sheet'
|
|
3
|
+
import { Button } from '../../controls/button'
|
|
4
|
+
|
|
5
|
+
export function PessoaCloseButton({
|
|
6
|
+
...props
|
|
7
|
+
}: ComponentProps<typeof SheetClose>) {
|
|
8
|
+
return (
|
|
9
|
+
<SheetClose {...props} asChild={true}>
|
|
10
|
+
<Button appearance="ghost">Cancelar</Button>
|
|
11
|
+
</SheetClose>
|
|
12
|
+
)
|
|
13
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { twMerge } from '@xjur-ui/util'
|
|
2
|
+
import type { ComponentProps } from 'react'
|
|
3
|
+
import { SheetContent } from '../../sheet'
|
|
4
|
+
import { usePessoaContext } from './pessoa.context'
|
|
5
|
+
|
|
6
|
+
export function PessoaContent({
|
|
7
|
+
className,
|
|
8
|
+
side = 'right',
|
|
9
|
+
...props
|
|
10
|
+
}: ComponentProps<typeof SheetContent>) {
|
|
11
|
+
const { currentView, isFullscreen } = usePessoaContext()
|
|
12
|
+
|
|
13
|
+
return (
|
|
14
|
+
<SheetContent
|
|
15
|
+
className={twMerge(
|
|
16
|
+
'min-w-[900px] data-[fullscreen=true]:min-w-full',
|
|
17
|
+
className
|
|
18
|
+
)}
|
|
19
|
+
data-fullscreen={isFullscreen}
|
|
20
|
+
data-view={currentView}
|
|
21
|
+
side={side}
|
|
22
|
+
{...props}
|
|
23
|
+
/>
|
|
24
|
+
)
|
|
25
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { twMerge } from '@xjur-ui/util'
|
|
2
|
+
import type { ComponentProps } from 'react'
|
|
3
|
+
import { SheetFooter } from '../../sheet'
|
|
4
|
+
|
|
5
|
+
export function PessoaFooter({
|
|
6
|
+
className,
|
|
7
|
+
...props
|
|
8
|
+
}: ComponentProps<typeof SheetFooter>) {
|
|
9
|
+
return (
|
|
10
|
+
<SheetFooter
|
|
11
|
+
className={twMerge('flex items-center justify-between', className)}
|
|
12
|
+
{...props}
|
|
13
|
+
/>
|
|
14
|
+
)
|
|
15
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { ComponentProps } from 'react'
|
|
2
|
+
import { twMerge } from '@xjur-ui/util'
|
|
3
|
+
import { SheetHeader, SheetTitle, SheetClose } from '../../sheet'
|
|
4
|
+
import { Button } from '../../controls/button'
|
|
5
|
+
import { Icon } from '../../icon'
|
|
6
|
+
import { usePessoaContext } from './pessoa.context'
|
|
7
|
+
|
|
8
|
+
export function PessoaHeader({
|
|
9
|
+
title,
|
|
10
|
+
className,
|
|
11
|
+
...props
|
|
12
|
+
}: ComponentProps<typeof SheetHeader> & { title: string }) {
|
|
13
|
+
const { changeIsFullscreen } = usePessoaContext()
|
|
14
|
+
|
|
15
|
+
return (
|
|
16
|
+
<SheetHeader
|
|
17
|
+
className={twMerge('flex items-center justify-between', className)}
|
|
18
|
+
{...props}
|
|
19
|
+
>
|
|
20
|
+
<SheetTitle>{title}</SheetTitle>
|
|
21
|
+
|
|
22
|
+
<div className="gap-small flex items-center">
|
|
23
|
+
<Button
|
|
24
|
+
appearance="ghost"
|
|
25
|
+
size="icon_md"
|
|
26
|
+
variant="tertiary"
|
|
27
|
+
onClick={() => changeIsFullscreen()}
|
|
28
|
+
>
|
|
29
|
+
<Icon className="text-icon-neutral-3" name="expand_content" />
|
|
30
|
+
</Button>
|
|
31
|
+
<SheetClose />
|
|
32
|
+
</div>
|
|
33
|
+
</SheetHeader>
|
|
34
|
+
)
|
|
35
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { ComponentProps } from 'react'
|
|
2
|
+
import { Button } from '../../controls/button'
|
|
3
|
+
import { SheetTrigger } from '../../sheet'
|
|
4
|
+
import { Icon } from '../../icon'
|
|
5
|
+
|
|
6
|
+
export function PessoaTrigger({
|
|
7
|
+
children = (
|
|
8
|
+
<Button
|
|
9
|
+
appearance="ghost"
|
|
10
|
+
className="border-border-layer-2 border"
|
|
11
|
+
variant="secondary"
|
|
12
|
+
>
|
|
13
|
+
<Icon className="text-icon-neutral-3" name="add" />
|
|
14
|
+
Adicionar
|
|
15
|
+
</Button>
|
|
16
|
+
),
|
|
17
|
+
asChild = true,
|
|
18
|
+
...props
|
|
19
|
+
}: ComponentProps<typeof SheetTrigger>) {
|
|
20
|
+
return (
|
|
21
|
+
<SheetTrigger asChild={asChild} {...props}>
|
|
22
|
+
{children}
|
|
23
|
+
</SheetTrigger>
|
|
24
|
+
)
|
|
25
|
+
}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import {
|
|
2
|
+
createContext,
|
|
3
|
+
useCallback,
|
|
4
|
+
useContext,
|
|
5
|
+
useState,
|
|
6
|
+
useMemo
|
|
7
|
+
} from 'react'
|
|
8
|
+
|
|
9
|
+
export interface PessoaContextValue {
|
|
10
|
+
currentView: 'list' | 'form'
|
|
11
|
+
isFullscreen: boolean
|
|
12
|
+
pessoas: unknown[]
|
|
13
|
+
changeCurrentView: (view: PessoaContextValue['currentView']) => void
|
|
14
|
+
changeIsFullscreen: () => void
|
|
15
|
+
setPessoas: React.Dispatch<React.SetStateAction<unknown[]>>
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export const PessoaContext = createContext<PessoaContextValue>(
|
|
19
|
+
{} as PessoaContextValue
|
|
20
|
+
)
|
|
21
|
+
|
|
22
|
+
export function PessoaProvider({ children }: { children: React.ReactNode }) {
|
|
23
|
+
const [currentView, setCurrentView] = useState<'list' | 'form'>('list')
|
|
24
|
+
const [isFullscreen, setIsFullscreen] = useState(false)
|
|
25
|
+
const [pessoas, setPessoas] = useState<unknown[]>([])
|
|
26
|
+
|
|
27
|
+
const changeCurrentView = useCallback((view: 'list' | 'form') => {
|
|
28
|
+
setCurrentView(view)
|
|
29
|
+
}, [])
|
|
30
|
+
|
|
31
|
+
const changeIsFullscreen = useCallback(() => {
|
|
32
|
+
setIsFullscreen(state => !state)
|
|
33
|
+
}, [])
|
|
34
|
+
|
|
35
|
+
const providerValue = useMemo(
|
|
36
|
+
() => ({
|
|
37
|
+
currentView,
|
|
38
|
+
changeCurrentView,
|
|
39
|
+
isFullscreen,
|
|
40
|
+
changeIsFullscreen,
|
|
41
|
+
pessoas,
|
|
42
|
+
setPessoas
|
|
43
|
+
}),
|
|
44
|
+
[
|
|
45
|
+
currentView,
|
|
46
|
+
changeCurrentView,
|
|
47
|
+
isFullscreen,
|
|
48
|
+
changeIsFullscreen,
|
|
49
|
+
pessoas,
|
|
50
|
+
setPessoas
|
|
51
|
+
]
|
|
52
|
+
)
|
|
53
|
+
|
|
54
|
+
return (
|
|
55
|
+
<PessoaContext.Provider value={providerValue}>
|
|
56
|
+
{children}
|
|
57
|
+
</PessoaContext.Provider>
|
|
58
|
+
)
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
export function usePessoaContext<T = unknown>() {
|
|
62
|
+
const context = useContext(PessoaContext)
|
|
63
|
+
|
|
64
|
+
if (!context) {
|
|
65
|
+
throw new Error('usePessoaContext must be used within a PessoaProvider')
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
return {
|
|
69
|
+
...context,
|
|
70
|
+
pessoas: context.pessoas as T[],
|
|
71
|
+
setPessoas: context.setPessoas as React.Dispatch<React.SetStateAction<T[]>>
|
|
72
|
+
}
|
|
73
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { type ComponentProps } from 'react'
|
|
2
|
+
import { SheetRoot } from '../../sheet'
|
|
3
|
+
import {
|
|
4
|
+
PessoaProvider,
|
|
5
|
+
PessoaContext,
|
|
6
|
+
type PessoaContextValue
|
|
7
|
+
} from './pessoa.context'
|
|
8
|
+
|
|
9
|
+
export function PessoaRoot({
|
|
10
|
+
onOpenChange,
|
|
11
|
+
children,
|
|
12
|
+
...props
|
|
13
|
+
}: Omit<ComponentProps<typeof SheetRoot>, 'children'> & {
|
|
14
|
+
children: React.ReactNode | ((context: PessoaContextValue) => React.ReactNode)
|
|
15
|
+
}) {
|
|
16
|
+
return (
|
|
17
|
+
<PessoaProvider>
|
|
18
|
+
<PessoaContext.Consumer>
|
|
19
|
+
{pessoaContext => (
|
|
20
|
+
<SheetRoot
|
|
21
|
+
onOpenChange={open => {
|
|
22
|
+
pessoaContext.changeCurrentView('list')
|
|
23
|
+
onOpenChange?.(open)
|
|
24
|
+
}}
|
|
25
|
+
{...props}
|
|
26
|
+
>
|
|
27
|
+
{typeof children === 'function'
|
|
28
|
+
? children(pessoaContext)
|
|
29
|
+
: children}
|
|
30
|
+
</SheetRoot>
|
|
31
|
+
)}
|
|
32
|
+
</PessoaContext.Consumer>
|
|
33
|
+
</PessoaProvider>
|
|
34
|
+
)
|
|
35
|
+
}
|