@xjur-ui/react 2.1.0 → 2.2.0
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/CHANGELOG.md +18 -0
- package/dist/{chunk-IRHU7PDO.js → chunk-2JQVYVAT.js} +2 -2
- 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/{chunk-Z47R2CIM.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-5WLIDYZH.js → chunk-4PTFZTVU.js} +2 -2
- package/dist/{chunk-5WLIDYZH.js.map → chunk-4PTFZTVU.js.map} +1 -1
- package/dist/chunk-6PHXO2YA.js +2 -0
- package/dist/{chunk-RWMV7APX.js.map → chunk-6PHXO2YA.js.map} +1 -1
- package/dist/{chunk-2CTBH6VI.js → chunk-7HG6Y3VV.js} +2 -2
- package/dist/{chunk-2CTBH6VI.js.map → chunk-7HG6Y3VV.js.map} +1 -1
- 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-BK6FP63A.js → chunk-ASZAHSU5.js} +2 -2
- package/dist/{chunk-BK6FP63A.js.map → chunk-ASZAHSU5.js.map} +1 -1
- package/dist/chunk-DOC3XTYC.js +2 -0
- package/dist/chunk-DOC3XTYC.js.map +1 -0
- package/dist/{chunk-IKL6PSXU.js → chunk-DT44JTXB.js} +2 -2
- package/dist/{chunk-IKL6PSXU.js.map → chunk-DT44JTXB.js.map} +1 -1
- 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-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-CI3ZXWEX.js → chunk-G6NSC3FL.js} +2 -2
- package/dist/{chunk-CI3ZXWEX.js.map → chunk-G6NSC3FL.js.map} +1 -1
- package/dist/{chunk-6AD6O6II.js → chunk-GKILN5HI.js} +2 -2
- 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-JF7JKJES.js +2 -0
- package/dist/chunk-JF7JKJES.js.map +1 -0
- package/dist/{chunk-TSVURBUY.js → chunk-JGPHBUVM.js} +2 -2
- package/dist/chunk-JGPHBUVM.js.map +1 -0
- package/dist/{chunk-PKCW37CJ.js → chunk-M6ZI7M3R.js} +2 -2
- package/dist/chunk-M6ZI7M3R.js.map +1 -0
- package/dist/{chunk-UXIVZWLB.js → chunk-MQ7YTZBI.js} +2 -2
- package/dist/{chunk-UXIVZWLB.js.map → chunk-MQ7YTZBI.js.map} +1 -1
- package/dist/chunk-O3JK6QF6.js +2 -0
- package/dist/chunk-O3JK6QF6.js.map +1 -0
- package/dist/{chunk-L4ET6GIZ.js → chunk-OKSGVAQQ.js} +2 -2
- 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-OS53BV63.js → chunk-RGKXZJJS.js} +3 -3
- package/dist/{chunk-OS53BV63.js.map → chunk-RGKXZJJS.js.map} +1 -1
- package/dist/chunk-SSTXFHNX.js +2 -0
- package/dist/chunk-SSTXFHNX.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-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/components/breadcrumb.js +1 -1
- package/dist/components/chip.d.ts +1 -1
- package/dist/components/chip.js +1 -1
- package/dist/components/controls/button.js +2 -0
- package/dist/components/{form → controls}/calendar.js +1 -1
- package/dist/components/controls/calendar.js.map +1 -0
- package/dist/components/{form → controls}/checkbox.js +1 -1
- package/dist/components/controls/checkbox.js.map +1 -0
- package/dist/components/{form → controls}/context/field.context.d.ts +1 -2
- package/dist/components/controls/context/field.context.js +2 -0
- package/dist/components/{form → controls}/date-picker.d.ts +2 -1
- package/dist/components/{form → controls}/date-picker.js +1 -1
- package/dist/components/controls/date-picker.js.map +1 -0
- package/dist/components/controls/floating-label.js +2 -0
- package/dist/components/{form → controls}/input.d.ts +3 -2
- package/dist/components/controls/input.js +2 -0
- package/dist/components/controls/otp-input.js.map +1 -0
- package/dist/components/controls/radio.js.map +1 -0
- package/dist/components/{form → controls}/rich-editor.js +1 -1
- package/dist/components/controls/rich-editor.js.map +1 -0
- package/dist/components/{form → controls}/search-input.d.ts +9 -1
- package/dist/components/controls/search-input.js +2 -0
- package/dist/components/controls/search-input.js.map +1 -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/{form → controls}/select.d.ts +2 -1
- package/dist/components/{form → controls}/select.js +1 -1
- package/dist/components/controls/switch.js +2 -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.js +1 -1
- package/dist/components/dialog.js.map +1 -1
- package/dist/components/drag-and-drop/index.js +1 -1
- package/dist/components/dropdown-menu.js +1 -1
- package/dist/components/full-calendar/calendar-add-event.js +1 -1
- package/dist/components/full-calendar/calendar-add-event.js.map +1 -1
- package/dist/components/full-calendar/calendar-cell.js +1 -1
- package/dist/components/full-calendar/calendar-day-view.js +1 -1
- package/dist/components/full-calendar/calendar-month-view.js +1 -1
- package/dist/components/full-calendar/calendar-more-events-dropdown.js +1 -1
- package/dist/components/full-calendar/calendar-navigator.js +1 -1
- package/dist/components/full-calendar/calendar-today-button.d.ts +1 -1
- package/dist/components/full-calendar/calendar-today-button.js +1 -1
- package/dist/components/full-calendar/calendar-toggle-view.js +1 -1
- package/dist/components/full-calendar/calendar-view-renderer.js +1 -1
- package/dist/components/full-calendar/calendar-week-view.js +1 -1
- package/dist/components/full-calendar/index.d.ts +1 -1
- package/dist/components/full-calendar/index.js +1 -1
- package/dist/components/horizontal-scroll.js +1 -1
- package/dist/components/horizontal-scroll.js.map +1 -1
- package/dist/components/icon.d.ts +2 -2
- package/dist/components/icon.js +1 -1
- package/dist/components/list.js +1 -1
- package/dist/components/selection-bar.d.ts +1 -1
- package/dist/components/selection-bar.js +1 -1
- package/dist/components/selection-bar.js.map +1 -1
- 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 +1 -1
- package/dist/components/tag.js +1 -1
- package/dist/components/upload.js +1 -1
- package/dist/components/upload.js.map +1 -1
- 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 +22 -16
- package/.turbo/turbo-build.log +0 -288
- package/dist/chunk-2CM3SFOY.js +0 -2
- package/dist/chunk-2CM3SFOY.js.map +0 -1
- package/dist/chunk-6AD6O6II.js.map +0 -1
- package/dist/chunk-AA6V5YEC.js +0 -2
- package/dist/chunk-AA6V5YEC.js.map +0 -1
- package/dist/chunk-IRHU7PDO.js.map +0 -1
- package/dist/chunk-KIFR5VIE.js +0 -2
- package/dist/chunk-L4ET6GIZ.js.map +0 -1
- package/dist/chunk-PKCW37CJ.js.map +0 -1
- package/dist/chunk-RWMV7APX.js +0 -2
- package/dist/chunk-TSVURBUY.js.map +0 -1
- package/dist/chunk-WV7QV2PU.js +0 -2
- package/dist/chunk-WV7QV2PU.js.map +0 -1
- package/dist/chunk-Z47R2CIM.js.map +0 -1
- package/dist/components/form/button.js +0 -2
- package/dist/components/form/calendar.js.map +0 -1
- package/dist/components/form/checkbox.js.map +0 -1
- package/dist/components/form/context/field.context.js +0 -2
- package/dist/components/form/date-picker.js.map +0 -1
- package/dist/components/form/floating-label.js +0 -2
- package/dist/components/form/input.js +0 -2
- package/dist/components/form/otp-input.js.map +0 -1
- package/dist/components/form/radio.js.map +0 -1
- package/dist/components/form/rich-editor.js.map +0 -1
- package/dist/components/form/search-input.js +0 -2
- package/dist/components/form/search-input.js.map +0 -1
- package/dist/components/form/switch.js +0 -2
- package/dist/components/table.d.ts +0 -17
- package/dist/components/table.js +0 -2
- package/dist/components/table.js.map +0 -1
- package/dist/icons-CmDuL0gZ.d.ts +0 -4
- package/eslint.config.js +0 -10
- package/postcss.config.js +0 -5
- package/prettier.config.js +0 -7
- package/src/components/avatar-group.tsx +0 -76
- package/src/components/avatar.tsx +0 -54
- package/src/components/badge.tsx +0 -40
- package/src/components/breadcrumb.tsx +0 -119
- package/src/components/chip.tsx +0 -117
- package/src/components/collapsible.tsx +0 -35
- package/src/components/dialog.tsx +0 -242
- package/src/components/divider.tsx +0 -24
- package/src/components/drag-and-drop/drag-handle.tsx +0 -46
- package/src/components/drag-and-drop/drag-list-item.tsx +0 -91
- package/src/components/drag-and-drop/drag-list.tsx +0 -47
- package/src/components/drag-and-drop/drag-root.tsx +0 -30
- package/src/components/drag-and-drop/index.ts +0 -39
- package/src/components/drag-and-drop/types/drag-item.ts +0 -7
- package/src/components/dropdown-menu.tsx +0 -101
- package/src/components/form/button.tsx +0 -107
- package/src/components/form/calendar.tsx +0 -124
- package/src/components/form/checkbox.tsx +0 -57
- package/src/components/form/context/field.context.ts +0 -27
- package/src/components/form/date-picker.tsx +0 -199
- package/src/components/form/floating-label.tsx +0 -60
- package/src/components/form/input.tsx +0 -235
- package/src/components/form/otp-input.tsx +0 -45
- package/src/components/form/radio.tsx +0 -74
- package/src/components/form/rich-editor.tsx +0 -372
- package/src/components/form/search-input.tsx +0 -111
- package/src/components/form/select.tsx +0 -274
- package/src/components/form/switch.tsx +0 -31
- package/src/components/full-calendar/calendar-add-event.tsx +0 -15
- package/src/components/full-calendar/calendar-body.tsx +0 -12
- package/src/components/full-calendar/calendar-cell.tsx +0 -120
- package/src/components/full-calendar/calendar-day-view.tsx +0 -76
- package/src/components/full-calendar/calendar-event.tsx +0 -178
- package/src/components/full-calendar/calendar-header.tsx +0 -14
- package/src/components/full-calendar/calendar-month-view.tsx +0 -69
- package/src/components/full-calendar/calendar-more-events-dropdown.tsx +0 -39
- package/src/components/full-calendar/calendar-navigator.tsx +0 -86
- package/src/components/full-calendar/calendar-root.tsx +0 -165
- package/src/components/full-calendar/calendar-today-button.tsx +0 -21
- package/src/components/full-calendar/calendar-toggle-view.tsx +0 -61
- package/src/components/full-calendar/calendar-view-renderer.tsx +0 -19
- package/src/components/full-calendar/calendar-week-day.tsx +0 -49
- package/src/components/full-calendar/calendar-week-view.tsx +0 -88
- package/src/components/full-calendar/helpers/calendar.ts +0 -158
- package/src/components/full-calendar/index.ts +0 -16
- package/src/components/full-calendar/types/calendar-cell.ts +0 -4
- package/src/components/full-calendar/types/calendar-event.ts +0 -7
- package/src/components/full-calendar/types/calendar-view.ts +0 -1
- package/src/components/full-calendar/types/calendar-week-hour.ts +0 -4
- package/src/components/horizontal-scroll.tsx +0 -159
- package/src/components/icon.tsx +0 -29
- package/src/components/list.tsx +0 -111
- package/src/components/logo.tsx +0 -44
- package/src/components/selection-bar.tsx +0 -273
- package/src/components/sheet.tsx +0 -141
- package/src/components/skeleton.tsx +0 -12
- package/src/components/status.tsx +0 -43
- package/src/components/table.tsx +0 -160
- package/src/components/tabs.tsx +0 -72
- package/src/components/tag.tsx +0 -99
- package/src/components/tooltip.tsx +0 -63
- package/src/components/typography.tsx +0 -85
- package/src/components/upload.tsx +0 -647
- package/src/hooks/index.ts +0 -1
- package/src/hooks/use-os.ts +0 -32
- package/src/index.css +0 -5
- package/src/resources/icons.ts +0 -153
- package/src/resources/input-mask.ts +0 -91
- package/src/resources/logo/horizontal.tsx +0 -70
- package/src/resources/logo/icon.tsx +0 -54
- package/src/resources/logo/index.tsx +0 -33
- package/src/resources/logo/vertical.tsx +0 -70
- package/src/types.d.ts +0 -4
- package/tsconfig.json +0 -4
- package/tsup.config.ts +0 -30
- /package/dist/components/{form → controls}/button.d.ts +0 -0
- /package/dist/components/{form → controls}/button.js.map +0 -0
- /package/dist/components/{form → controls}/calendar.d.ts +0 -0
- /package/dist/components/{form → controls}/checkbox.d.ts +0 -0
- /package/dist/components/{form → controls}/context/field.context.js.map +0 -0
- /package/dist/components/{form → controls}/floating-label.d.ts +0 -0
- /package/dist/components/{form → controls}/floating-label.js.map +0 -0
- /package/dist/components/{form → controls}/input.js.map +0 -0
- /package/dist/components/{form → controls}/otp-input.d.ts +0 -0
- /package/dist/components/{form → controls}/otp-input.js +0 -0
- /package/dist/components/{form → controls}/radio.d.ts +0 -0
- /package/dist/components/{form → controls}/radio.js +0 -0
- /package/dist/components/{form → controls}/rich-editor.d.ts +0 -0
- /package/dist/components/{form → controls}/select.js.map +0 -0
- /package/dist/components/{form → controls}/switch.d.ts +0 -0
- /package/dist/components/{form → controls}/switch.js.map +0 -0
|
@@ -1,158 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
endOfMonth,
|
|
3
|
-
startOfMonth,
|
|
4
|
-
subMonths,
|
|
5
|
-
isToday as isTodayDateFns,
|
|
6
|
-
isSameDay,
|
|
7
|
-
endOfWeek,
|
|
8
|
-
startOfWeek,
|
|
9
|
-
eachDayOfInterval
|
|
10
|
-
} from 'date-fns'
|
|
11
|
-
import type { ICalendarEvent } from '../types/calendar-event'
|
|
12
|
-
import type { ICalendarCell } from '../types/calendar-cell'
|
|
13
|
-
import type { ICalendarWeekHour } from '../types/calendar-week-hour'
|
|
14
|
-
|
|
15
|
-
function arrayFromLength(length: number) {
|
|
16
|
-
return Array.from({ length }, (_, i) => i)
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
export const WEEKDAYS = [
|
|
20
|
-
'Domingo',
|
|
21
|
-
'Segunda',
|
|
22
|
-
'Terça',
|
|
23
|
-
'Quarta',
|
|
24
|
-
'Quinta',
|
|
25
|
-
'Sexta',
|
|
26
|
-
'Sábado'
|
|
27
|
-
]
|
|
28
|
-
|
|
29
|
-
export const WEEK_HOURS: ICalendarWeekHour[] = Array.from(
|
|
30
|
-
{ length: 16 },
|
|
31
|
-
(_, i) => {
|
|
32
|
-
const hour = i + 8
|
|
33
|
-
return {
|
|
34
|
-
hour,
|
|
35
|
-
label: `${hour.toString().padStart(2, '0')}:00`
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
)
|
|
39
|
-
|
|
40
|
-
export function getDaysInMonth(date: Date): ICalendarCell[] {
|
|
41
|
-
const year = date.getFullYear()
|
|
42
|
-
const month = date.getMonth()
|
|
43
|
-
|
|
44
|
-
const firstWeekdayOfMonth = startOfMonth(date).getDay()
|
|
45
|
-
const daysInPrevMonth = endOfMonth(subMonths(date, 1)).getDate()
|
|
46
|
-
const daysInMonth = endOfMonth(date).getDate()
|
|
47
|
-
|
|
48
|
-
const prevMonthDays = arrayFromLength(firstWeekdayOfMonth).map<ICalendarCell>(
|
|
49
|
-
dayIndex => {
|
|
50
|
-
dayIndex += 1
|
|
51
|
-
const prevMonth = month - 1
|
|
52
|
-
const dayOfPrevMonth = daysInPrevMonth - firstWeekdayOfMonth
|
|
53
|
-
const day = dayOfPrevMonth + dayIndex
|
|
54
|
-
const date = new Date(year, prevMonth, day)
|
|
55
|
-
|
|
56
|
-
return {
|
|
57
|
-
dayOfWeekNumber: date.getDay(),
|
|
58
|
-
date,
|
|
59
|
-
type: 'month'
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
)
|
|
63
|
-
|
|
64
|
-
const currentMonthDays = arrayFromLength(daysInMonth).map<ICalendarCell>(
|
|
65
|
-
dayIndex => {
|
|
66
|
-
const day = dayIndex + 1
|
|
67
|
-
const date = new Date(year, month, day)
|
|
68
|
-
return {
|
|
69
|
-
dayOfWeekNumber: date.getDay(),
|
|
70
|
-
date,
|
|
71
|
-
type: 'month'
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
)
|
|
75
|
-
|
|
76
|
-
const totalWeekdays = 7
|
|
77
|
-
const totalDays = firstWeekdayOfMonth + daysInMonth
|
|
78
|
-
const remainingDays =
|
|
79
|
-
totalWeekdays - ((totalDays % totalWeekdays) % totalWeekdays)
|
|
80
|
-
|
|
81
|
-
const nextMonthDays = arrayFromLength(remainingDays).map<ICalendarCell>(
|
|
82
|
-
dayIndex => {
|
|
83
|
-
const day = dayIndex + 1
|
|
84
|
-
const date = new Date(year, month + 1, day)
|
|
85
|
-
return {
|
|
86
|
-
dayOfWeekNumber: date.getDay(),
|
|
87
|
-
date,
|
|
88
|
-
type: 'month'
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
)
|
|
92
|
-
|
|
93
|
-
return [...prevMonthDays, ...currentMonthDays, ...nextMonthDays]
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
export function getEventsForDay(events: ICalendarEvent[], date: Date) {
|
|
97
|
-
return events.filter(event => isSameDay(event.eventDate, date))
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
export function isToday(date: Date) {
|
|
101
|
-
return isTodayDateFns(date)
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
/**
|
|
105
|
-
* Week view helpers
|
|
106
|
-
*/
|
|
107
|
-
|
|
108
|
-
export function getWeekDaysInMonth(date: Date): ICalendarCell[] {
|
|
109
|
-
const weekStart = startOfWeek(date, { weekStartsOn: 0 }) // Domingo = 0
|
|
110
|
-
const weekEnd = endOfWeek(date, { weekStartsOn: 0 })
|
|
111
|
-
const weekDays = eachDayOfInterval({ start: weekStart, end: weekEnd })
|
|
112
|
-
|
|
113
|
-
const dayOfWeekNumber = weekStart.getDay()
|
|
114
|
-
const dayOfWeekName = WEEKDAYS[dayOfWeekNumber]
|
|
115
|
-
|
|
116
|
-
return weekDays.map(day => ({
|
|
117
|
-
date: day,
|
|
118
|
-
dayOfWeekNumber,
|
|
119
|
-
dayOfWeekName,
|
|
120
|
-
fullDate: day,
|
|
121
|
-
type: 'week'
|
|
122
|
-
}))
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
export function getEventsForDayAndHour(
|
|
126
|
-
events: ICalendarEvent[],
|
|
127
|
-
date: Date,
|
|
128
|
-
hour: number
|
|
129
|
-
): ICalendarEvent[] {
|
|
130
|
-
return events.filter(event => {
|
|
131
|
-
return (
|
|
132
|
-
isSameDay(event.eventDate, date) && event.eventDate.getHours() === hour
|
|
133
|
-
)
|
|
134
|
-
})
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
export function isCurrentHour(date: Date, hour: number): boolean {
|
|
138
|
-
const now = new Date()
|
|
139
|
-
return isSameDay(now, date) && now.getHours() === hour
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
export function getStartAndEndDateOfWeek(date: Date): {
|
|
143
|
-
start: Date
|
|
144
|
-
end: Date
|
|
145
|
-
} {
|
|
146
|
-
const start = startOfWeek(date, { weekStartsOn: 0 })
|
|
147
|
-
const end = endOfWeek(date, { weekStartsOn: 0 })
|
|
148
|
-
return { start, end }
|
|
149
|
-
}
|
|
150
|
-
|
|
151
|
-
/**
|
|
152
|
-
* Day view helpers
|
|
153
|
-
*/
|
|
154
|
-
|
|
155
|
-
export function getDaysInDay(date: Date): ICalendarCell[] {
|
|
156
|
-
const days = eachDayOfInterval({ start: date, end: date })
|
|
157
|
-
return days.map(day => ({ date: day, type: 'day' }))
|
|
158
|
-
}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
export * from './calendar-month-view'
|
|
2
|
-
export * from './calendar-week-view'
|
|
3
|
-
export * from './calendar-view-renderer'
|
|
4
|
-
export * from './calendar-navigator'
|
|
5
|
-
export * from './calendar-root'
|
|
6
|
-
export * from './calendar-toggle-view'
|
|
7
|
-
export * from './calendar-header'
|
|
8
|
-
export * from './calendar-body'
|
|
9
|
-
export * from './calendar-event'
|
|
10
|
-
export * from './calendar-today-button'
|
|
11
|
-
|
|
12
|
-
export type {
|
|
13
|
-
ICalendarEvent,
|
|
14
|
-
ICalendarEventStatus
|
|
15
|
-
} from './types/calendar-event'
|
|
16
|
-
export type { CalendarView } from './types/calendar-view'
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export type CalendarView = 'month' | 'week' | 'day'
|
|
@@ -1,159 +0,0 @@
|
|
|
1
|
-
import type { ComponentProps, ReactNode } from 'react'
|
|
2
|
-
import { useCallback, useEffect, useRef, useState } from 'react'
|
|
3
|
-
import { cx } from '@xjur-ui/util'
|
|
4
|
-
import { Button } from './form/button'
|
|
5
|
-
import { Icon } from './icon'
|
|
6
|
-
|
|
7
|
-
export interface HorizontalScrollProps extends ComponentProps<'div'> {
|
|
8
|
-
children: ReactNode
|
|
9
|
-
gap?: 'small' | 'medium' | 'large'
|
|
10
|
-
scrollAmount?: number
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
export function HorizontalScroll({
|
|
14
|
-
children,
|
|
15
|
-
className,
|
|
16
|
-
gap = 'small',
|
|
17
|
-
scrollAmount = 200,
|
|
18
|
-
...props
|
|
19
|
-
}: HorizontalScrollProps) {
|
|
20
|
-
const scrollContainerRef = useRef<HTMLDivElement>(null)
|
|
21
|
-
const [canScrollLeft, setCanScrollLeft] = useState(false)
|
|
22
|
-
const [canScrollRight, setCanScrollRight] = useState(false)
|
|
23
|
-
const [isScrolling, setIsScrolling] = useState(false)
|
|
24
|
-
|
|
25
|
-
const checkScrollable = useCallback(() => {
|
|
26
|
-
const container = scrollContainerRef.current
|
|
27
|
-
if (!container) return
|
|
28
|
-
|
|
29
|
-
const { scrollLeft, scrollWidth, clientWidth } = container
|
|
30
|
-
setCanScrollLeft(scrollLeft > 0)
|
|
31
|
-
setCanScrollRight(scrollLeft < scrollWidth - clientWidth - 1)
|
|
32
|
-
}, [])
|
|
33
|
-
|
|
34
|
-
const handleScrollLeft = useCallback(() => {
|
|
35
|
-
const container = scrollContainerRef.current
|
|
36
|
-
if (!container) return
|
|
37
|
-
|
|
38
|
-
setIsScrolling(true)
|
|
39
|
-
container.scrollTo({
|
|
40
|
-
left: container.scrollLeft - scrollAmount,
|
|
41
|
-
behavior: 'smooth'
|
|
42
|
-
})
|
|
43
|
-
|
|
44
|
-
setTimeout(() => setIsScrolling(false), 300)
|
|
45
|
-
}, [scrollAmount])
|
|
46
|
-
|
|
47
|
-
const handleScrollRight = useCallback(() => {
|
|
48
|
-
const container = scrollContainerRef.current
|
|
49
|
-
if (!container) return
|
|
50
|
-
|
|
51
|
-
setIsScrolling(true)
|
|
52
|
-
container.scrollTo({
|
|
53
|
-
left: container.scrollLeft + scrollAmount,
|
|
54
|
-
behavior: 'smooth'
|
|
55
|
-
})
|
|
56
|
-
|
|
57
|
-
setTimeout(() => setIsScrolling(false), 300)
|
|
58
|
-
}, [scrollAmount])
|
|
59
|
-
|
|
60
|
-
useEffect(() => {
|
|
61
|
-
const container = scrollContainerRef.current
|
|
62
|
-
if (!container) return
|
|
63
|
-
|
|
64
|
-
const handleScroll = () => {
|
|
65
|
-
checkScrollable()
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
const handleResize = () => {
|
|
69
|
-
checkScrollable()
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
checkScrollable()
|
|
73
|
-
container.addEventListener('scroll', handleScroll, { passive: true })
|
|
74
|
-
window.addEventListener('resize', handleResize)
|
|
75
|
-
|
|
76
|
-
let resizeObserver: ResizeObserver | null = null
|
|
77
|
-
if (typeof ResizeObserver !== 'undefined') {
|
|
78
|
-
resizeObserver = new ResizeObserver(() => {
|
|
79
|
-
checkScrollable()
|
|
80
|
-
})
|
|
81
|
-
resizeObserver.observe(container)
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
return () => {
|
|
85
|
-
container.removeEventListener('scroll', handleScroll)
|
|
86
|
-
window.removeEventListener('resize', handleResize)
|
|
87
|
-
if (resizeObserver) {
|
|
88
|
-
resizeObserver.disconnect()
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
}, [checkScrollable])
|
|
92
|
-
|
|
93
|
-
const gapClass = {
|
|
94
|
-
small: 'gap-small',
|
|
95
|
-
medium: 'gap-medium',
|
|
96
|
-
large: 'gap-large'
|
|
97
|
-
}[gap]
|
|
98
|
-
|
|
99
|
-
return (
|
|
100
|
-
<div className={cx('relative isolate', className)} {...props}>
|
|
101
|
-
{/* Left Arrow */}
|
|
102
|
-
{canScrollLeft && (
|
|
103
|
-
<div
|
|
104
|
-
className="absolute top-1/2 left-0 z-[3] flex h-full w-[80px] -translate-y-1/2 items-center"
|
|
105
|
-
style={{
|
|
106
|
-
background: `linear-gradient(to right, white 40%, transparent)`
|
|
107
|
-
}}
|
|
108
|
-
>
|
|
109
|
-
<Button
|
|
110
|
-
appearance="ghost"
|
|
111
|
-
aria-label="Scroll left"
|
|
112
|
-
className="ml-0"
|
|
113
|
-
disabled={isScrolling}
|
|
114
|
-
size="icon_md"
|
|
115
|
-
variant="secondary"
|
|
116
|
-
onClick={handleScrollLeft}
|
|
117
|
-
>
|
|
118
|
-
<Icon name="chevron_left" />
|
|
119
|
-
</Button>
|
|
120
|
-
</div>
|
|
121
|
-
)}
|
|
122
|
-
|
|
123
|
-
{/* Right Arrow */}
|
|
124
|
-
{canScrollRight && (
|
|
125
|
-
<div
|
|
126
|
-
className="absolute top-1/2 right-0 z-[2] flex h-full w-[80px] -translate-y-1/2 items-center justify-end"
|
|
127
|
-
style={{
|
|
128
|
-
background: `linear-gradient(to left, white 40%, transparent)`
|
|
129
|
-
}}
|
|
130
|
-
>
|
|
131
|
-
<Button
|
|
132
|
-
appearance="ghost"
|
|
133
|
-
aria-label="Scroll right"
|
|
134
|
-
className="mr-0"
|
|
135
|
-
disabled={isScrolling}
|
|
136
|
-
size="icon_md"
|
|
137
|
-
variant="secondary"
|
|
138
|
-
onClick={handleScrollRight}
|
|
139
|
-
>
|
|
140
|
-
<Icon name="chevron_right" />
|
|
141
|
-
</Button>
|
|
142
|
-
</div>
|
|
143
|
-
)}
|
|
144
|
-
|
|
145
|
-
{/* Scrollable Content */}
|
|
146
|
-
<div
|
|
147
|
-
className={cx(
|
|
148
|
-
'scrollbar-hide relative z-1 flex overflow-x-auto overflow-y-visible',
|
|
149
|
-
'min-w-0 [&>*]:flex-none [&>*]:whitespace-nowrap',
|
|
150
|
-
gapClass,
|
|
151
|
-
className
|
|
152
|
-
)}
|
|
153
|
-
ref={scrollContainerRef}
|
|
154
|
-
>
|
|
155
|
-
{children}
|
|
156
|
-
</div>
|
|
157
|
-
</div>
|
|
158
|
-
)
|
|
159
|
-
}
|
package/src/components/icon.tsx
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import type { ComponentProps } from 'react'
|
|
2
|
-
import { cx } from '@xjur-ui/util'
|
|
3
|
-
import type { IconType } from '../resources/icons'
|
|
4
|
-
|
|
5
|
-
export type IconProps = {
|
|
6
|
-
name: IconType
|
|
7
|
-
filled?: boolean
|
|
8
|
-
} & ComponentProps<'span'>
|
|
9
|
-
|
|
10
|
-
export function Icon({ className, filled = false, name, ...props }: IconProps) {
|
|
11
|
-
return (
|
|
12
|
-
<span
|
|
13
|
-
{...props}
|
|
14
|
-
className={cx(
|
|
15
|
-
'material-symbols-outlined',
|
|
16
|
-
'text-size-body-lg select-none',
|
|
17
|
-
className
|
|
18
|
-
)}
|
|
19
|
-
style={{
|
|
20
|
-
fontVariationSettings: `'FILL' ${filled ? 1 : 0}, 'wght' 600, 'GRAD' 0, 'opsz' 20`,
|
|
21
|
-
...props.style
|
|
22
|
-
}}
|
|
23
|
-
>
|
|
24
|
-
{name}
|
|
25
|
-
</span>
|
|
26
|
-
)
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
export { icons, type IconType } from '../resources/icons'
|
package/src/components/list.tsx
DELETED
|
@@ -1,111 +0,0 @@
|
|
|
1
|
-
import { Slot } from '@radix-ui/react-slot'
|
|
2
|
-
import { cx, cva, type ClassVariantProps } from '@xjur-ui/util'
|
|
3
|
-
import type { ComponentProps } from 'react'
|
|
4
|
-
import { type TypographyProps, Typography } from './typography'
|
|
5
|
-
|
|
6
|
-
export function ListRoot({
|
|
7
|
-
className,
|
|
8
|
-
asChild,
|
|
9
|
-
...props
|
|
10
|
-
}: ComponentProps<'div'> & {
|
|
11
|
-
asChild?: boolean
|
|
12
|
-
}) {
|
|
13
|
-
const Comp = asChild ? Slot : 'div'
|
|
14
|
-
|
|
15
|
-
return (
|
|
16
|
-
<Comp
|
|
17
|
-
{...props}
|
|
18
|
-
className={cx(
|
|
19
|
-
className,
|
|
20
|
-
'rounded-small scrollbar-hide bg-layer-2-idle border-border-layer-2 shadow-elevation-3 z-10 max-h-[400px] list-none overflow-y-auto border'
|
|
21
|
-
)}
|
|
22
|
-
/>
|
|
23
|
-
)
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
export function ListHeader({
|
|
27
|
-
className,
|
|
28
|
-
asChild,
|
|
29
|
-
...props
|
|
30
|
-
}: ComponentProps<'div'> & {
|
|
31
|
-
asChild?: boolean
|
|
32
|
-
}) {
|
|
33
|
-
const Comp = asChild ? Slot : 'div'
|
|
34
|
-
return <Comp {...props} className={cx(className, 'px-small pt-small-1x')} />
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
export function ListHeaderTitle({
|
|
38
|
-
variant = 'label',
|
|
39
|
-
size = 'sm',
|
|
40
|
-
weight = 'medium',
|
|
41
|
-
className,
|
|
42
|
-
...props
|
|
43
|
-
}: TypographyProps) {
|
|
44
|
-
return (
|
|
45
|
-
<Typography
|
|
46
|
-
className={cx(className, 'text-neutral-placeholder')}
|
|
47
|
-
size={size}
|
|
48
|
-
variant={variant}
|
|
49
|
-
weight={weight}
|
|
50
|
-
{...props}
|
|
51
|
-
/>
|
|
52
|
-
)
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
export function ListContent({
|
|
56
|
-
className,
|
|
57
|
-
asChild,
|
|
58
|
-
...props
|
|
59
|
-
}: ComponentProps<'ul'> & {
|
|
60
|
-
asChild?: boolean
|
|
61
|
-
}) {
|
|
62
|
-
const Comp = asChild ? Slot : 'ul'
|
|
63
|
-
|
|
64
|
-
return (
|
|
65
|
-
<Comp
|
|
66
|
-
{...props}
|
|
67
|
-
className={cx('gap-small-1x p-small flex flex-col', className)}
|
|
68
|
-
/>
|
|
69
|
-
)
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
const variants = cva(
|
|
73
|
-
[
|
|
74
|
-
'py-medium px-small flex items-center gap-small rounded-small-1x',
|
|
75
|
-
'bg-layer-2-idle text-neutral-dark',
|
|
76
|
-
'hover:bg-layer-2-hover transition-colors duration-100 ease-out',
|
|
77
|
-
'active:bg-layer-2-pressed'
|
|
78
|
-
],
|
|
79
|
-
{
|
|
80
|
-
variants: {
|
|
81
|
-
size: {
|
|
82
|
-
md: 'h-large-4x',
|
|
83
|
-
lg: 'h-large-7x'
|
|
84
|
-
},
|
|
85
|
-
isActive: {
|
|
86
|
-
true: 'bg-primary-alt-active text-primary-label-active hover:bg-primary-alt-hover active:bg-primary-alt-pressed'
|
|
87
|
-
}
|
|
88
|
-
},
|
|
89
|
-
defaultVariants: {
|
|
90
|
-
size: 'md',
|
|
91
|
-
isActive: false
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
)
|
|
95
|
-
|
|
96
|
-
export function ListItem({
|
|
97
|
-
className,
|
|
98
|
-
size,
|
|
99
|
-
isActive,
|
|
100
|
-
asChild,
|
|
101
|
-
...props
|
|
102
|
-
}: ComponentProps<'li'> &
|
|
103
|
-
ClassVariantProps<typeof variants> & {
|
|
104
|
-
asChild?: boolean
|
|
105
|
-
}) {
|
|
106
|
-
const Comp = asChild ? Slot : 'li'
|
|
107
|
-
|
|
108
|
-
return (
|
|
109
|
-
<Comp {...props} className={cx(variants({ size, isActive }), className)} />
|
|
110
|
-
)
|
|
111
|
-
}
|
package/src/components/logo.tsx
DELETED
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import { memo, lazy, Suspense } from 'react'
|
|
2
|
-
|
|
3
|
-
export interface LogoProps {
|
|
4
|
-
mode?: 'horizontal' | 'vertical' | 'icon'
|
|
5
|
-
variant?: 'colorful' | 'orange' | 'purple' | 'white' | 'gray'
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
// Lazy load logo components to reduce initial bundle size
|
|
9
|
-
const LazyLogos = lazy(() => import('../resources/logo'))
|
|
10
|
-
|
|
11
|
-
function LogoFallback({ mode }: { mode?: string }) {
|
|
12
|
-
const dimensions =
|
|
13
|
-
mode === 'icon' ? { width: 24, height: 24 } : { width: 95, height: 26 }
|
|
14
|
-
return (
|
|
15
|
-
<div
|
|
16
|
-
aria-label="Loading logo"
|
|
17
|
-
className="animate-pulse rounded bg-gray-200"
|
|
18
|
-
style={dimensions}
|
|
19
|
-
/>
|
|
20
|
-
)
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
export const Logo = memo(
|
|
24
|
-
({ mode = 'horizontal', variant = 'colorful' }: LogoProps) => {
|
|
25
|
-
const colorToHex = {
|
|
26
|
-
orange: '#D68600',
|
|
27
|
-
purple: '#66127D',
|
|
28
|
-
white: '#FFFFFF',
|
|
29
|
-
gray: '#6B7280'
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
return (
|
|
33
|
-
<Suspense fallback={<LogoFallback mode={mode} />}>
|
|
34
|
-
<LazyLogos
|
|
35
|
-
color={variant !== 'colorful' ? colorToHex[variant] : undefined}
|
|
36
|
-
mode={mode}
|
|
37
|
-
variant={variant}
|
|
38
|
-
/>
|
|
39
|
-
</Suspense>
|
|
40
|
-
)
|
|
41
|
-
}
|
|
42
|
-
)
|
|
43
|
-
|
|
44
|
-
Logo.displayName = 'Logo'
|