@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,273 @@
|
|
|
1
|
+
import type { ComponentProps, ReactNode } from 'react'
|
|
2
|
+
import { createContext, useContext, useState, useCallback } from 'react'
|
|
3
|
+
import { cva, cx, type ClassVariantProps } from '@xjur-ui/util'
|
|
4
|
+
import { Icon, type IconType } from './icon'
|
|
5
|
+
import { Button } from './controls/button'
|
|
6
|
+
|
|
7
|
+
const selectionBarVariants = cva(
|
|
8
|
+
[
|
|
9
|
+
'flex items-center gap-4 rounded-lg px-4 py-3 shadow-lg transition-colors duration-200 ease-in-out',
|
|
10
|
+
'fixed bottom-6 left-1/2 -translate-x-1/2 transform z-50',
|
|
11
|
+
'backdrop-blur-sm bg-white/95 border border-border-layer-2'
|
|
12
|
+
],
|
|
13
|
+
{
|
|
14
|
+
variants: {
|
|
15
|
+
size: {
|
|
16
|
+
sm: 'px-3 py-2 text-sm',
|
|
17
|
+
md: 'px-4 py-3 text-base',
|
|
18
|
+
lg: 'px-6 py-4 text-lg'
|
|
19
|
+
},
|
|
20
|
+
variant: {
|
|
21
|
+
primary:
|
|
22
|
+
'bg-primary-idle text-neutral-label hover:bg-primary-hover rounded-circle active:bg-primary-pressed',
|
|
23
|
+
secondary:
|
|
24
|
+
'bg-secondary-idle text-white border-secondary-idle hover:bg-secondary-hover rounded-circle',
|
|
25
|
+
success:
|
|
26
|
+
'bg-success-idle text-white border-success-idle hover:bg-success-hover rounded-circle',
|
|
27
|
+
warning:
|
|
28
|
+
'bg-warning-idle text-white border-warning-idle hover:bg-warning-hover rounded-circle',
|
|
29
|
+
destructive:
|
|
30
|
+
'bg-destructive-idle text-white border-destructive-idle hover:bg-destructive-hover rounded-circle',
|
|
31
|
+
neutral:
|
|
32
|
+
'bg-neutral-dark text-white border-neutral-dark hover:bg-neutral-hover rounded-circle',
|
|
33
|
+
outline:
|
|
34
|
+
'bg-white text-neutral-dark border-border-layer-2 hover:bg-layer-2-hover rounded-circle'
|
|
35
|
+
},
|
|
36
|
+
position: {
|
|
37
|
+
fixed: 'fixed bottom-6 left-1/2 -translate-x-1/2 transform',
|
|
38
|
+
absolute: 'absolute bottom-6 left-1/2 -translate-x-1/2 transform',
|
|
39
|
+
relative: 'relative',
|
|
40
|
+
sticky: 'sticky bottom-6'
|
|
41
|
+
}
|
|
42
|
+
},
|
|
43
|
+
defaultVariants: {
|
|
44
|
+
size: 'md',
|
|
45
|
+
variant: 'primary',
|
|
46
|
+
position: 'fixed'
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
)
|
|
50
|
+
|
|
51
|
+
export interface SelectionAction {
|
|
52
|
+
id: string
|
|
53
|
+
label?: string
|
|
54
|
+
icon: IconType
|
|
55
|
+
onClick: () => void
|
|
56
|
+
variant?: 'primary' | 'secondary' | 'destructive' | 'tertiary' | 'outlined'
|
|
57
|
+
disabled?: boolean
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
interface SelectionBarProps
|
|
61
|
+
extends Omit<ComponentProps<'div'>, 'onClose'>,
|
|
62
|
+
ClassVariantProps<typeof selectionBarVariants> {
|
|
63
|
+
selectedCount: number
|
|
64
|
+
onClose: () => void
|
|
65
|
+
actions?: SelectionAction[]
|
|
66
|
+
showCloseButton?: boolean
|
|
67
|
+
closeButtonText?: string
|
|
68
|
+
selectedText?: string
|
|
69
|
+
className?: string
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
function SelectionBar({
|
|
73
|
+
selectedCount,
|
|
74
|
+
onClose,
|
|
75
|
+
actions = [],
|
|
76
|
+
showCloseButton = true,
|
|
77
|
+
selectedText,
|
|
78
|
+
size = 'md',
|
|
79
|
+
variant = 'primary',
|
|
80
|
+
position = 'fixed',
|
|
81
|
+
className,
|
|
82
|
+
...props
|
|
83
|
+
}: SelectionBarProps) {
|
|
84
|
+
if (selectedCount === 0) return null
|
|
85
|
+
|
|
86
|
+
const getSelectedText = () => {
|
|
87
|
+
if (selectedText) return selectedText
|
|
88
|
+
return selectedCount === 1
|
|
89
|
+
? '1 item selecionado'
|
|
90
|
+
: `${selectedCount} itens selecionados`
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
const getIconSize = () => {
|
|
94
|
+
switch (size) {
|
|
95
|
+
case 'sm':
|
|
96
|
+
return 'text-sm'
|
|
97
|
+
case 'md':
|
|
98
|
+
return 'text-base'
|
|
99
|
+
case 'lg':
|
|
100
|
+
return 'text-lg'
|
|
101
|
+
default:
|
|
102
|
+
return 'text-base'
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
return (
|
|
107
|
+
<div
|
|
108
|
+
className={cx(
|
|
109
|
+
selectionBarVariants({ size, variant, position }),
|
|
110
|
+
className
|
|
111
|
+
)}
|
|
112
|
+
{...props}
|
|
113
|
+
>
|
|
114
|
+
{showCloseButton && (
|
|
115
|
+
<Button
|
|
116
|
+
appearance="ghost"
|
|
117
|
+
className="rounded-full text-current"
|
|
118
|
+
size={size === 'lg' ? 'md' : 'sm'}
|
|
119
|
+
variant="secondary"
|
|
120
|
+
onClick={() => onClose()}
|
|
121
|
+
>
|
|
122
|
+
<Icon className={getIconSize()} name="close" />
|
|
123
|
+
</Button>
|
|
124
|
+
)}
|
|
125
|
+
|
|
126
|
+
<span className="font-medium whitespace-nowrap">{getSelectedText()}</span>
|
|
127
|
+
|
|
128
|
+
{actions.map(action => (
|
|
129
|
+
<Button
|
|
130
|
+
appearance="ghost"
|
|
131
|
+
className="rounded-full text-current"
|
|
132
|
+
disabled={action.disabled}
|
|
133
|
+
key={action.id}
|
|
134
|
+
size={size === 'lg' ? 'md' : 'sm'}
|
|
135
|
+
variant={action.variant || 'secondary'}
|
|
136
|
+
onClick={() => action.onClick()}
|
|
137
|
+
>
|
|
138
|
+
<Icon className={getIconSize()} name={action.icon} />
|
|
139
|
+
{action.label && <span className="ml-2">{action.label}</span>}
|
|
140
|
+
</Button>
|
|
141
|
+
))}
|
|
142
|
+
</div>
|
|
143
|
+
)
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
interface SelectionBarContextType {
|
|
147
|
+
selectedItems: Set<string>
|
|
148
|
+
toggleSelection: (id: string) => void
|
|
149
|
+
clearSelection: () => void
|
|
150
|
+
selectAll: (ids: string[]) => void
|
|
151
|
+
isSelected: (id: string) => boolean
|
|
152
|
+
selectedCount: number
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
const SelectionBarContext = createContext<SelectionBarContextType | null>(null)
|
|
156
|
+
|
|
157
|
+
interface SelectionBarProviderProps {
|
|
158
|
+
children: ReactNode
|
|
159
|
+
onSelectionChange?: (selectedIds: string[]) => void
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
function SelectionBarProvider({
|
|
163
|
+
children,
|
|
164
|
+
onSelectionChange
|
|
165
|
+
}: SelectionBarProviderProps) {
|
|
166
|
+
const [selectedItems, setSelectedItems] = useState<Set<string>>(new Set())
|
|
167
|
+
|
|
168
|
+
const toggleSelection = useCallback(
|
|
169
|
+
(id: string) => {
|
|
170
|
+
setSelectedItems(prev => {
|
|
171
|
+
const newSet = new Set(prev)
|
|
172
|
+
if (newSet.has(id)) {
|
|
173
|
+
newSet.delete(id)
|
|
174
|
+
} else {
|
|
175
|
+
newSet.add(id)
|
|
176
|
+
}
|
|
177
|
+
onSelectionChange?.(Array.from(newSet))
|
|
178
|
+
return newSet
|
|
179
|
+
})
|
|
180
|
+
},
|
|
181
|
+
[onSelectionChange]
|
|
182
|
+
)
|
|
183
|
+
|
|
184
|
+
const clearSelection = useCallback(() => {
|
|
185
|
+
setSelectedItems(new Set())
|
|
186
|
+
onSelectionChange?.([])
|
|
187
|
+
}, [onSelectionChange])
|
|
188
|
+
|
|
189
|
+
const selectAll = useCallback(
|
|
190
|
+
(ids: string[]) => {
|
|
191
|
+
setSelectedItems(new Set(ids))
|
|
192
|
+
onSelectionChange?.(ids)
|
|
193
|
+
},
|
|
194
|
+
[onSelectionChange]
|
|
195
|
+
)
|
|
196
|
+
|
|
197
|
+
const isSelected = useCallback(
|
|
198
|
+
(id: string) => {
|
|
199
|
+
return selectedItems.has(id)
|
|
200
|
+
},
|
|
201
|
+
[selectedItems]
|
|
202
|
+
)
|
|
203
|
+
|
|
204
|
+
const value: SelectionBarContextType = {
|
|
205
|
+
selectedItems,
|
|
206
|
+
toggleSelection,
|
|
207
|
+
clearSelection,
|
|
208
|
+
selectAll,
|
|
209
|
+
isSelected,
|
|
210
|
+
selectedCount: selectedItems.size
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
return (
|
|
214
|
+
<SelectionBarContext.Provider value={value}>
|
|
215
|
+
{children}
|
|
216
|
+
</SelectionBarContext.Provider>
|
|
217
|
+
)
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
function useSelectionBar() {
|
|
221
|
+
const context = useContext(SelectionBarContext)
|
|
222
|
+
if (!context) {
|
|
223
|
+
throw new Error(
|
|
224
|
+
'useSelectionBar must be used within a SelectionBarProvider'
|
|
225
|
+
)
|
|
226
|
+
}
|
|
227
|
+
return context
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
interface SelectionBarContainerProps
|
|
231
|
+
extends Omit<SelectionBarProps, 'selectedCount' | 'onClose'> {
|
|
232
|
+
showCloseButton?: boolean
|
|
233
|
+
closeButtonText?: string
|
|
234
|
+
selectedText?: string
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
function SelectionBarContainer({
|
|
238
|
+
actions = [],
|
|
239
|
+
showCloseButton = true,
|
|
240
|
+
selectedText,
|
|
241
|
+
...props
|
|
242
|
+
}: SelectionBarContainerProps) {
|
|
243
|
+
const { selectedCount, clearSelection } = useSelectionBar()
|
|
244
|
+
|
|
245
|
+
return (
|
|
246
|
+
<SelectionBar
|
|
247
|
+
actions={actions}
|
|
248
|
+
selectedCount={selectedCount}
|
|
249
|
+
selectedText={selectedText}
|
|
250
|
+
showCloseButton={showCloseButton}
|
|
251
|
+
onClose={() => clearSelection()}
|
|
252
|
+
{...props}
|
|
253
|
+
/>
|
|
254
|
+
)
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
export const SelectionBarComponents = {
|
|
258
|
+
Root: SelectionBar,
|
|
259
|
+
Provider: SelectionBarProvider,
|
|
260
|
+
Container: SelectionBarContainer,
|
|
261
|
+
useSelectionBar
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
export { SelectionBar }
|
|
265
|
+
export { SelectionBarProvider }
|
|
266
|
+
export { SelectionBarContainer }
|
|
267
|
+
export { useSelectionBar }
|
|
268
|
+
export { selectionBarVariants }
|
|
269
|
+
export type {
|
|
270
|
+
SelectionBarProps,
|
|
271
|
+
SelectionBarProviderProps,
|
|
272
|
+
SelectionBarContainerProps
|
|
273
|
+
}
|
package/src/components/sheet.tsx
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from 'react'
|
|
2
2
|
import * as SheetPrimitive from '@radix-ui/react-dialog'
|
|
3
|
-
import { cx } from '@xjur-ui/util'
|
|
4
|
-
import { Button } from './button'
|
|
3
|
+
import { cx, tv } from '@xjur-ui/util'
|
|
4
|
+
import { Button } from './controls/button'
|
|
5
5
|
import { Icon } from './icon'
|
|
6
6
|
|
|
7
7
|
export function SheetRoot({
|
|
@@ -44,7 +44,7 @@ export function SheetOverlay({
|
|
|
44
44
|
return (
|
|
45
45
|
<SheetPrimitive.Overlay
|
|
46
46
|
className={cx(
|
|
47
|
-
'data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50
|
|
47
|
+
'data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50',
|
|
48
48
|
className
|
|
49
49
|
)}
|
|
50
50
|
data-slot="sheet-overlay"
|
|
@@ -63,22 +63,31 @@ export function SheetContent({
|
|
|
63
63
|
side?: 'top' | 'right' | 'bottom' | 'left'
|
|
64
64
|
overlay?: boolean
|
|
65
65
|
}) {
|
|
66
|
+
const content = tv({
|
|
67
|
+
base: [
|
|
68
|
+
'border-border-layer-2 bg-layer-2-idle shadow-elevation-2 fixed z-50 flex flex-col gap-medium',
|
|
69
|
+
'data-[state=open]:animate-in data-[state=closed]:animate-out transition ease-in-out data-[state=closed]:duration-300 data-[state=open]:duration-500'
|
|
70
|
+
],
|
|
71
|
+
variants: {
|
|
72
|
+
side: {
|
|
73
|
+
right:
|
|
74
|
+
'data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right inset-y-0 right-0 h-full border-l sm:max-w-sm',
|
|
75
|
+
left: 'data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left inset-y-0 left-0 h-full border-r sm:max-w-sm',
|
|
76
|
+
top: 'data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top inset-x-0 top-0 h-auto border-b',
|
|
77
|
+
bottom:
|
|
78
|
+
'data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom inset-x-0 bottom-0 h-auto border-t'
|
|
79
|
+
}
|
|
80
|
+
},
|
|
81
|
+
defaultVariants: {
|
|
82
|
+
side: 'right'
|
|
83
|
+
}
|
|
84
|
+
})
|
|
85
|
+
|
|
66
86
|
return (
|
|
67
87
|
<SheetPortal>
|
|
68
88
|
{overlay && <SheetOverlay />}
|
|
69
89
|
<SheetPrimitive.Content
|
|
70
|
-
className={
|
|
71
|
-
'border-border-layer-2 bg-layer-2-idle data-[state=open]:animate-in data-[state=closed]:animate-out shadow-elevation-2 fixed z-50 flex flex-col gap-4 transition ease-in-out data-[state=closed]:duration-300 data-[state=open]:duration-500',
|
|
72
|
-
side === 'right' &&
|
|
73
|
-
'data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right inset-y-0 right-0 h-full w-3/4 border-l sm:max-w-sm',
|
|
74
|
-
side === 'left' &&
|
|
75
|
-
'data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left inset-y-0 left-0 h-full w-3/4 border-r sm:max-w-sm',
|
|
76
|
-
side === 'top' &&
|
|
77
|
-
'data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top inset-x-0 top-0 h-auto border-b',
|
|
78
|
-
side === 'bottom' &&
|
|
79
|
-
'data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom inset-x-0 bottom-0 h-auto border-t',
|
|
80
|
-
className
|
|
81
|
-
)}
|
|
90
|
+
className={content({ side, className })}
|
|
82
91
|
data-slot="sheet-content"
|
|
83
92
|
{...props}
|
|
84
93
|
>
|
|
@@ -92,7 +101,7 @@ export function SheetBody({
|
|
|
92
101
|
className,
|
|
93
102
|
...props
|
|
94
103
|
}: React.ComponentProps<'div'>) {
|
|
95
|
-
return <div className={cx('px-large-2x', className)} {...props} />
|
|
104
|
+
return <div className={cx('px-large-2x h-full', className)} {...props} />
|
|
96
105
|
}
|
|
97
106
|
|
|
98
107
|
export function SheetHeader({
|
|
@@ -133,7 +142,7 @@ export function SheetTitle({
|
|
|
133
142
|
}: React.ComponentProps<typeof SheetPrimitive.Title>) {
|
|
134
143
|
return (
|
|
135
144
|
<SheetPrimitive.Title
|
|
136
|
-
className={cx('text-size-title-lg font-
|
|
145
|
+
className={cx('text-size-title-lg font-normal', className)}
|
|
137
146
|
data-slot="sheet-title"
|
|
138
147
|
{...props}
|
|
139
148
|
/>
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { ComponentProps } from 'react'
|
|
2
|
+
import { twMerge } from '@xjur-ui/util'
|
|
3
|
+
import { useSteps } from './steps-context'
|
|
4
|
+
|
|
5
|
+
export function Step({
|
|
6
|
+
stepIndex,
|
|
7
|
+
className,
|
|
8
|
+
...props
|
|
9
|
+
}: ComponentProps<'div'> & { stepIndex: number }) {
|
|
10
|
+
const { currentStepIndex } = useSteps()
|
|
11
|
+
|
|
12
|
+
if (currentStepIndex !== stepIndex) {
|
|
13
|
+
return null
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
return (
|
|
17
|
+
<div
|
|
18
|
+
className={twMerge('h-full w-full', className)}
|
|
19
|
+
data-slot="step-item"
|
|
20
|
+
{...props}
|
|
21
|
+
/>
|
|
22
|
+
)
|
|
23
|
+
}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { useCallback, type ComponentProps } from 'react'
|
|
2
|
+
import { Button } from '../controls/button'
|
|
3
|
+
import { useSteps } from './steps-context'
|
|
4
|
+
|
|
5
|
+
export function NextStep({
|
|
6
|
+
children = 'Próximo',
|
|
7
|
+
type,
|
|
8
|
+
onClick,
|
|
9
|
+
...props
|
|
10
|
+
}: Omit<ComponentProps<typeof Button>, 'children'> & {
|
|
11
|
+
children?: React.ReactNode | ((stepIndex: number) => React.ReactNode)
|
|
12
|
+
}) {
|
|
13
|
+
const { handleNextStep, currentStepIndex, isLastStep } = useSteps()
|
|
14
|
+
|
|
15
|
+
const handleClick = useCallback(
|
|
16
|
+
(event: React.MouseEvent<HTMLButtonElement>) => {
|
|
17
|
+
if (onClick) {
|
|
18
|
+
onClick(event)
|
|
19
|
+
} else {
|
|
20
|
+
event.preventDefault()
|
|
21
|
+
handleNextStep()
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
[onClick, handleNextStep]
|
|
25
|
+
)
|
|
26
|
+
|
|
27
|
+
const buttonType = type || (isLastStep ? 'submit' : 'button')
|
|
28
|
+
|
|
29
|
+
return (
|
|
30
|
+
<Button
|
|
31
|
+
type={buttonType}
|
|
32
|
+
{...(buttonType === 'button' ? { onClick: handleClick } : {})}
|
|
33
|
+
{...props}
|
|
34
|
+
>
|
|
35
|
+
{typeof children === 'function' ? children(currentStepIndex) : children}
|
|
36
|
+
</Button>
|
|
37
|
+
)
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export function PreviousStep({
|
|
41
|
+
appearance = 'ghost',
|
|
42
|
+
children = 'Anterior',
|
|
43
|
+
onClick,
|
|
44
|
+
...props
|
|
45
|
+
}: ComponentProps<typeof Button>) {
|
|
46
|
+
const { handlePreviousStep } = useSteps()
|
|
47
|
+
|
|
48
|
+
const handleClick = useCallback(
|
|
49
|
+
(event: React.MouseEvent<HTMLButtonElement>) => {
|
|
50
|
+
if (onClick) {
|
|
51
|
+
onClick(event)
|
|
52
|
+
} else {
|
|
53
|
+
event.preventDefault()
|
|
54
|
+
handlePreviousStep()
|
|
55
|
+
}
|
|
56
|
+
},
|
|
57
|
+
[onClick, handlePreviousStep]
|
|
58
|
+
)
|
|
59
|
+
|
|
60
|
+
return (
|
|
61
|
+
<Button appearance={appearance} onClick={handleClick} {...props}>
|
|
62
|
+
{children}
|
|
63
|
+
</Button>
|
|
64
|
+
)
|
|
65
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { twMerge } from '@xjur-ui/util'
|
|
2
|
+
import type { ComponentProps } from 'react'
|
|
3
|
+
|
|
4
|
+
export function Steps({ className, ...props }: ComponentProps<'div'>) {
|
|
5
|
+
return (
|
|
6
|
+
<div
|
|
7
|
+
className={twMerge('h-full w-full', className)}
|
|
8
|
+
data-slot="steps-content"
|
|
9
|
+
{...props}
|
|
10
|
+
/>
|
|
11
|
+
)
|
|
12
|
+
}
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
import { twMerge } from '@xjur-ui/util'
|
|
2
|
+
import {
|
|
3
|
+
createContext,
|
|
4
|
+
useCallback,
|
|
5
|
+
useContext,
|
|
6
|
+
useMemo,
|
|
7
|
+
useState,
|
|
8
|
+
type ComponentProps
|
|
9
|
+
} from 'react'
|
|
10
|
+
|
|
11
|
+
export interface StepsContextValue {
|
|
12
|
+
steps: string[]
|
|
13
|
+
currentStepIndex: number
|
|
14
|
+
isLastStep: boolean
|
|
15
|
+
|
|
16
|
+
handleStepChange: (index: number) => void
|
|
17
|
+
handleNextStep: () => void
|
|
18
|
+
handlePreviousStep: () => void
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export const StepsContext = createContext<StepsContextValue>({
|
|
22
|
+
steps: [],
|
|
23
|
+
currentStepIndex: 0,
|
|
24
|
+
isLastStep: false,
|
|
25
|
+
handleStepChange: () => {},
|
|
26
|
+
handleNextStep: () => {},
|
|
27
|
+
handlePreviousStep: () => {}
|
|
28
|
+
})
|
|
29
|
+
|
|
30
|
+
export function StepsProvider({
|
|
31
|
+
steps,
|
|
32
|
+
currentStepIndex: currentStepIndexProp = 0,
|
|
33
|
+
onStepChange,
|
|
34
|
+
children,
|
|
35
|
+
className,
|
|
36
|
+
...props
|
|
37
|
+
}: {
|
|
38
|
+
steps: string[]
|
|
39
|
+
currentStepIndex?: number
|
|
40
|
+
onStepChange?: (index: number) => void
|
|
41
|
+
children: React.ReactNode | ((context: StepsContextValue) => React.ReactNode)
|
|
42
|
+
} & Omit<ComponentProps<'div'>, 'children'>) {
|
|
43
|
+
const [currentStepIndex, setCurrentStepIndex] = useState(currentStepIndexProp)
|
|
44
|
+
|
|
45
|
+
const handleStepChange = useCallback(
|
|
46
|
+
(index: number) => {
|
|
47
|
+
setCurrentStepIndex(index)
|
|
48
|
+
onStepChange?.(index)
|
|
49
|
+
},
|
|
50
|
+
[onStepChange]
|
|
51
|
+
)
|
|
52
|
+
|
|
53
|
+
const handleNextStep = useCallback(() => {
|
|
54
|
+
const isLastStep = currentStepIndex === steps.length - 1
|
|
55
|
+
|
|
56
|
+
if (isLastStep) {
|
|
57
|
+
return
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
setCurrentStepIndex(prev => prev + 1)
|
|
61
|
+
onStepChange?.(currentStepIndex + 1)
|
|
62
|
+
}, [currentStepIndex, onStepChange, steps])
|
|
63
|
+
|
|
64
|
+
const handlePreviousStep = useCallback(() => {
|
|
65
|
+
if (currentStepIndex === 0) {
|
|
66
|
+
return
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
setCurrentStepIndex(prev => prev - 1)
|
|
70
|
+
onStepChange?.(currentStepIndex - 1)
|
|
71
|
+
}, [currentStepIndex, onStepChange])
|
|
72
|
+
|
|
73
|
+
const isLastStep = useMemo(
|
|
74
|
+
() => currentStepIndex === steps.length - 1,
|
|
75
|
+
[currentStepIndex, steps]
|
|
76
|
+
)
|
|
77
|
+
|
|
78
|
+
const providerValue = useMemo(
|
|
79
|
+
() => ({
|
|
80
|
+
steps,
|
|
81
|
+
currentStepIndex,
|
|
82
|
+
isLastStep,
|
|
83
|
+
setCurrentStepIndex,
|
|
84
|
+
|
|
85
|
+
handleStepChange,
|
|
86
|
+
handleNextStep,
|
|
87
|
+
handlePreviousStep
|
|
88
|
+
}),
|
|
89
|
+
[
|
|
90
|
+
steps,
|
|
91
|
+
currentStepIndex,
|
|
92
|
+
isLastStep,
|
|
93
|
+
setCurrentStepIndex,
|
|
94
|
+
handleStepChange,
|
|
95
|
+
handleNextStep,
|
|
96
|
+
handlePreviousStep
|
|
97
|
+
]
|
|
98
|
+
)
|
|
99
|
+
|
|
100
|
+
return (
|
|
101
|
+
<StepsContext.Provider value={providerValue}>
|
|
102
|
+
<div
|
|
103
|
+
className={twMerge('h-full w-full', className)}
|
|
104
|
+
data-slot="steps-root"
|
|
105
|
+
{...props}
|
|
106
|
+
>
|
|
107
|
+
{typeof children === 'function' ? children(providerValue) : children}
|
|
108
|
+
</div>
|
|
109
|
+
</StepsContext.Provider>
|
|
110
|
+
)
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
export function useSteps() {
|
|
114
|
+
const context = useContext(StepsContext)
|
|
115
|
+
|
|
116
|
+
if (!context) {
|
|
117
|
+
throw new Error('useSteps must be used within a StepsContext.Provider')
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
return context
|
|
121
|
+
}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { Fragment, useCallback, type ComponentProps } from 'react'
|
|
2
|
+
import { twMerge } from '@xjur-ui/util'
|
|
3
|
+
import { useSteps } from './steps-context'
|
|
4
|
+
|
|
5
|
+
export function StepsNavigation({
|
|
6
|
+
className,
|
|
7
|
+
...props
|
|
8
|
+
}: ComponentProps<'div'>) {
|
|
9
|
+
const { steps, currentStepIndex } = useSteps()
|
|
10
|
+
|
|
11
|
+
const isLastStep = useCallback(
|
|
12
|
+
(stepIndex: number) => stepIndex === steps.length - 1,
|
|
13
|
+
[steps]
|
|
14
|
+
)
|
|
15
|
+
|
|
16
|
+
const stepState = useCallback(
|
|
17
|
+
(stepIndex: number) => {
|
|
18
|
+
const isActive = stepIndex === currentStepIndex
|
|
19
|
+
const isPassed = stepIndex < currentStepIndex
|
|
20
|
+
|
|
21
|
+
if (isPassed) {
|
|
22
|
+
return 'disabled'
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
return isActive ? 'active' : 'normal'
|
|
26
|
+
},
|
|
27
|
+
[currentStepIndex]
|
|
28
|
+
)
|
|
29
|
+
|
|
30
|
+
return (
|
|
31
|
+
<div
|
|
32
|
+
className={twMerge('gap-small flex items-center', className)}
|
|
33
|
+
data-slot="steps-navigation"
|
|
34
|
+
{...props}
|
|
35
|
+
>
|
|
36
|
+
{steps.map((step, stepIndex) => {
|
|
37
|
+
const state = stepState(stepIndex)
|
|
38
|
+
|
|
39
|
+
return (
|
|
40
|
+
<Fragment key={`${step}-${stepIndex}`}>
|
|
41
|
+
<div
|
|
42
|
+
className="group gap-small flex items-center"
|
|
43
|
+
data-disabled={state === 'disabled'}
|
|
44
|
+
data-slot="step-trigger"
|
|
45
|
+
data-state={state}
|
|
46
|
+
{...props}
|
|
47
|
+
>
|
|
48
|
+
<div
|
|
49
|
+
className={twMerge(
|
|
50
|
+
'size-large-4x rounded-circle border-border-layer-2 text-size-label-sm bg-layer-2-idle flex items-center justify-center border',
|
|
51
|
+
'group-data-[state=active]:border-primary-active group-data-[state=active]:bg-primary-alt-active group-data-[state=active]:text-primary-label-active',
|
|
52
|
+
'group-data-[state=disabled]:bg-layer-1-idle group-data-[state=disabled]:border-border-layer-2 group-data-[state=disabled]:text-neutral-light'
|
|
53
|
+
)}
|
|
54
|
+
data-slot="step-number"
|
|
55
|
+
>
|
|
56
|
+
{stepIndex + 1}
|
|
57
|
+
</div>
|
|
58
|
+
|
|
59
|
+
<span
|
|
60
|
+
className="text-size-label-sm group-data-[state=active]:text-primary-label-active group-data-[state=disabled]:text-neutral-light font-medium"
|
|
61
|
+
data-slot="step-title"
|
|
62
|
+
>
|
|
63
|
+
{step}
|
|
64
|
+
</span>
|
|
65
|
+
</div>
|
|
66
|
+
|
|
67
|
+
{!isLastStep(stepIndex) && (
|
|
68
|
+
<div
|
|
69
|
+
className={twMerge(
|
|
70
|
+
'bg-border-layer-2 mx-2 h-px flex-1',
|
|
71
|
+
className
|
|
72
|
+
)}
|
|
73
|
+
/>
|
|
74
|
+
)}
|
|
75
|
+
</Fragment>
|
|
76
|
+
)
|
|
77
|
+
})}
|
|
78
|
+
</div>
|
|
79
|
+
)
|
|
80
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { cx } from '@xjur-ui/util'
|
|
2
|
+
|
|
3
|
+
export function TableBody({
|
|
4
|
+
className,
|
|
5
|
+
...props
|
|
6
|
+
}: React.ComponentProps<'tbody'>) {
|
|
7
|
+
return (
|
|
8
|
+
<tbody
|
|
9
|
+
className={cx(
|
|
10
|
+
'[&_tr]:border-border-layer-2 [&_tr]:border-b [&_tr:last-child]:border-0',
|
|
11
|
+
className
|
|
12
|
+
)}
|
|
13
|
+
data-slot="table-body"
|
|
14
|
+
{...props}
|
|
15
|
+
/>
|
|
16
|
+
)
|
|
17
|
+
}
|