@g4rcez/components 5.0.0 → 5.0.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/dist/{MotionConfig-BLwtdAWy.js → MotionConfig-DKKYqBH2.js} +2 -2
- package/dist/{MotionConfig-BLwtdAWy.js.map → MotionConfig-DKKYqBH2.js.map} +1 -1
- package/dist/{autocomplete-DVKTP0Il.js → autocomplete-D3VOTihi.js} +2 -2
- package/dist/{autocomplete-DVKTP0Il.js.map → autocomplete-D3VOTihi.js.map} +1 -1
- package/dist/{calendar-_DZjphH8.js → calendar-PCCZDUIL.js} +4 -4
- package/dist/{calendar-_DZjphH8.js.map → calendar-PCCZDUIL.js.map} +1 -1
- package/dist/components/display/alert.js +1 -1
- package/dist/components/display/calendar.js +1 -1
- package/dist/components/display/list.js +2 -2
- package/dist/components/display/notifications.js +1 -1
- package/dist/components/floating/expand.js +1 -1
- package/dist/components/floating/modal.js +1 -1
- package/dist/components/form/autocomplete.js +1 -1
- package/dist/components/form/date-picker.js +1 -1
- package/dist/components/form/file-upload.js +1 -1
- package/dist/components/table/table.js +1 -1
- package/dist/{date-picker-9q_Ki5Vu.js → date-picker-BhKEFZew.js} +2 -2
- package/dist/{date-picker-9q_Ki5Vu.js.map → date-picker-BhKEFZew.js.map} +1 -1
- package/dist/{dist-Buc00Zls.js → dist-BrGpYRaj.js} +56 -55
- package/dist/{dist-Buc00Zls.js.map → dist-BrGpYRaj.js.map} +1 -1
- package/dist/{file-upload-COk6_Bs5.js → file-upload-DWbZfeG5.js} +15 -15
- package/dist/{file-upload-COk6_Bs5.js.map → file-upload-DWbZfeG5.js.map} +1 -1
- package/dist/index.js +646 -647
- package/dist/index.js.map +1 -1
- package/dist/{modal-Cn-OaKRp.js → modal-Bz-61ays.js} +3 -3
- package/dist/{modal-Cn-OaKRp.js.map → modal-Bz-61ays.js.map} +1 -1
- package/dist/{notifications-l_B9J4Gx.js → notifications-MT4XkLov.js} +270 -269
- package/dist/{notifications-l_B9J4Gx.js.map → notifications-MT4XkLov.js.map} +1 -1
- package/dist/{proxy-Drpz0Avo.js → proxy-BcJ_5Dwq.js} +465 -468
- package/dist/{proxy-Drpz0Avo.js.map → proxy-BcJ_5Dwq.js.map} +1 -1
- package/dist/{table-Dql6Yzag.js → table-CUFbAI2k.js} +3 -3
- package/dist/{table-Dql6Yzag.js.map → table-CUFbAI2k.js.map} +1 -1
- package/package.json +1 -1
- package/dist/src/components/core/button.d.ts +0 -77
- package/dist/src/components/core/button.d.ts.map +0 -1
- package/dist/src/components/core/button.jsx +0 -79
- package/dist/src/components/core/heading.d.ts +0 -3
- package/dist/src/components/core/heading.d.ts.map +0 -1
- package/dist/src/components/core/heading.jsx +0 -4
- package/dist/src/components/core/polymorph.d.ts +0 -10
- package/dist/src/components/core/polymorph.d.ts.map +0 -1
- package/dist/src/components/core/polymorph.jsx +0 -5
- package/dist/src/components/core/render-on-view.d.ts +0 -7
- package/dist/src/components/core/render-on-view.d.ts.map +0 -1
- package/dist/src/components/core/render-on-view.jsx +0 -31
- package/dist/src/components/core/resizable.d.ts +0 -3
- package/dist/src/components/core/resizable.d.ts.map +0 -1
- package/dist/src/components/core/resizable.jsx +0 -51
- package/dist/src/components/core/slot.d.ts +0 -16
- package/dist/src/components/core/slot.d.ts.map +0 -1
- package/dist/src/components/core/slot.jsx +0 -156
- package/dist/src/components/core/tag.d.ts +0 -35
- package/dist/src/components/core/tag.d.ts.map +0 -1
- package/dist/src/components/core/tag.jsx +0 -53
- package/dist/src/components/core/typography.d.ts +0 -25
- package/dist/src/components/core/typography.d.ts.map +0 -1
- package/dist/src/components/core/typography.jsx +0 -20
- package/dist/src/components/display/alert.d.ts +0 -28
- package/dist/src/components/display/alert.d.ts.map +0 -1
- package/dist/src/components/display/alert.jsx +0 -61
- package/dist/src/components/display/calendar.d.ts +0 -42
- package/dist/src/components/display/calendar.d.ts.map +0 -1
- package/dist/src/components/display/calendar.jsx +0 -318
- package/dist/src/components/display/card.d.ts +0 -29
- package/dist/src/components/display/card.d.ts.map +0 -1
- package/dist/src/components/display/card.jsx +0 -43
- package/dist/src/components/display/empty.d.ts +0 -8
- package/dist/src/components/display/empty.d.ts.map +0 -1
- package/dist/src/components/display/empty.jsx +0 -11
- package/dist/src/components/display/list.d.ts +0 -16
- package/dist/src/components/display/list.d.ts.map +0 -1
- package/dist/src/components/display/list.jsx +0 -85
- package/dist/src/components/display/notifications.d.ts +0 -27
- package/dist/src/components/display/notifications.d.ts.map +0 -1
- package/dist/src/components/display/notifications.jsx +0 -130
- package/dist/src/components/display/progress.d.ts +0 -16
- package/dist/src/components/display/progress.d.ts.map +0 -1
- package/dist/src/components/display/progress.jsx +0 -21
- package/dist/src/components/display/shortcut.d.ts +0 -4
- package/dist/src/components/display/shortcut.d.ts.map +0 -1
- package/dist/src/components/display/shortcut.jsx +0 -23
- package/dist/src/components/display/skeleton.d.ts +0 -12
- package/dist/src/components/display/skeleton.d.ts.map +0 -1
- package/dist/src/components/display/skeleton.jsx +0 -19
- package/dist/src/components/display/spinner.d.ts +0 -5
- package/dist/src/components/display/spinner.d.ts.map +0 -1
- package/dist/src/components/display/spinner.jsx +0 -11
- package/dist/src/components/display/stats.d.ts +0 -12
- package/dist/src/components/display/stats.d.ts.map +0 -1
- package/dist/src/components/display/stats.jsx +0 -16
- package/dist/src/components/display/step.d.ts +0 -24
- package/dist/src/components/display/step.d.ts.map +0 -1
- package/dist/src/components/display/step.jsx +0 -145
- package/dist/src/components/display/tabs.d.ts +0 -24
- package/dist/src/components/display/tabs.d.ts.map +0 -1
- package/dist/src/components/display/tabs.jsx +0 -125
- package/dist/src/components/display/timeline.d.ts +0 -10
- package/dist/src/components/display/timeline.d.ts.map +0 -1
- package/dist/src/components/display/timeline.jsx +0 -25
- package/dist/src/components/floating/command-palette.d.ts +0 -49
- package/dist/src/components/floating/command-palette.d.ts.map +0 -1
- package/dist/src/components/floating/command-palette.jsx +0 -223
- package/dist/src/components/floating/dropdown.d.ts +0 -15
- package/dist/src/components/floating/dropdown.d.ts.map +0 -1
- package/dist/src/components/floating/dropdown.jsx +0 -56
- package/dist/src/components/floating/expand.d.ts +0 -11
- package/dist/src/components/floating/expand.d.ts.map +0 -1
- package/dist/src/components/floating/expand.jsx +0 -44
- package/dist/src/components/floating/menu.d.ts +0 -52
- package/dist/src/components/floating/menu.d.ts.map +0 -1
- package/dist/src/components/floating/menu.jsx +0 -165
- package/dist/src/components/floating/modal.d.ts +0 -60
- package/dist/src/components/floating/modal.d.ts.map +0 -1
- package/dist/src/components/floating/modal.jsx +0 -336
- package/dist/src/components/floating/toolbar.d.ts +0 -6
- package/dist/src/components/floating/toolbar.d.ts.map +0 -1
- package/dist/src/components/floating/toolbar.jsx +0 -5
- package/dist/src/components/floating/tooltip.d.ts +0 -17
- package/dist/src/components/floating/tooltip.d.ts.map +0 -1
- package/dist/src/components/floating/tooltip.jsx +0 -67
- package/dist/src/components/floating/wizard.d.ts +0 -26
- package/dist/src/components/floating/wizard.d.ts.map +0 -1
- package/dist/src/components/floating/wizard.jsx +0 -165
- package/dist/src/components/form/autocomplete.d.ts +0 -16
- package/dist/src/components/form/autocomplete.d.ts.map +0 -1
- package/dist/src/components/form/autocomplete.jsx +0 -290
- package/dist/src/components/form/checkbox.d.ts +0 -12
- package/dist/src/components/form/checkbox.d.ts.map +0 -1
- package/dist/src/components/form/checkbox.jsx +0 -12
- package/dist/src/components/form/date-picker.d.ts +0 -10
- package/dist/src/components/form/date-picker.d.ts.map +0 -1
- package/dist/src/components/form/date-picker.jsx +0 -115
- package/dist/src/components/form/file-upload.d.ts +0 -15
- package/dist/src/components/form/file-upload.d.ts.map +0 -1
- package/dist/src/components/form/file-upload.jsx +0 -138
- package/dist/src/components/form/form.d.ts +0 -3
- package/dist/src/components/form/form.d.ts.map +0 -1
- package/dist/src/components/form/form.jsx +0 -10
- package/dist/src/components/form/formReset.d.ts +0 -2
- package/dist/src/components/form/formReset.d.ts.map +0 -1
- package/dist/src/components/form/formReset.jsx +0 -17
- package/dist/src/components/form/free-text.d.ts +0 -11
- package/dist/src/components/form/free-text.d.ts.map +0 -1
- package/dist/src/components/form/free-text.jsx +0 -41
- package/dist/src/components/form/input-field.d.ts +0 -34
- package/dist/src/components/form/input-field.d.ts.map +0 -1
- package/dist/src/components/form/input-field.jsx +0 -58
- package/dist/src/components/form/input.d.ts +0 -52
- package/dist/src/components/form/input.d.ts.map +0 -1
- package/dist/src/components/form/input.jsx +0 -36
- package/dist/src/components/form/multi-select.d.ts +0 -19
- package/dist/src/components/form/multi-select.d.ts.map +0 -1
- package/dist/src/components/form/multi-select.jsx +0 -344
- package/dist/src/components/form/radiobox.d.ts +0 -7
- package/dist/src/components/form/radiobox.d.ts.map +0 -1
- package/dist/src/components/form/radiobox.jsx +0 -6
- package/dist/src/components/form/select.d.ts +0 -13
- package/dist/src/components/form/select.d.ts.map +0 -1
- package/dist/src/components/form/select.jsx +0 -44
- package/dist/src/components/form/slider.d.ts +0 -7
- package/dist/src/components/form/slider.d.ts.map +0 -1
- package/dist/src/components/form/slider.jsx +0 -45
- package/dist/src/components/form/switch.d.ts +0 -9
- package/dist/src/components/form/switch.d.ts.map +0 -1
- package/dist/src/components/form/switch.jsx +0 -46
- package/dist/src/components/form/task-list.d.ts +0 -3
- package/dist/src/components/form/task-list.d.ts.map +0 -1
- package/dist/src/components/form/task-list.jsx +0 -26
- package/dist/src/components/form/textarea.d.ts +0 -5
- package/dist/src/components/form/textarea.d.ts.map +0 -1
- package/dist/src/components/form/textarea.jsx +0 -26
- package/dist/src/components/index.d.ts +0 -45
- package/dist/src/components/index.d.ts.map +0 -1
- package/dist/src/components/index.js +0 -44
- package/dist/src/components/page-calendar/calendar-header.d.ts +0 -16
- package/dist/src/components/page-calendar/calendar-header.d.ts.map +0 -1
- package/dist/src/components/page-calendar/calendar-header.jsx +0 -83
- package/dist/src/components/page-calendar/day-view.d.ts +0 -12
- package/dist/src/components/page-calendar/day-view.d.ts.map +0 -1
- package/dist/src/components/page-calendar/day-view.jsx +0 -89
- package/dist/src/components/page-calendar/event-pill.d.ts +0 -9
- package/dist/src/components/page-calendar/event-pill.d.ts.map +0 -1
- package/dist/src/components/page-calendar/event-pill.jsx +0 -25
- package/dist/src/components/page-calendar/index.d.ts +0 -4
- package/dist/src/components/page-calendar/index.d.ts.map +0 -1
- package/dist/src/components/page-calendar/index.js +0 -2
- package/dist/src/components/page-calendar/month-view.d.ts +0 -11
- package/dist/src/components/page-calendar/month-view.d.ts.map +0 -1
- package/dist/src/components/page-calendar/month-view.jsx +0 -46
- package/dist/src/components/page-calendar/page-calendar.d.ts +0 -18
- package/dist/src/components/page-calendar/page-calendar.d.ts.map +0 -1
- package/dist/src/components/page-calendar/page-calendar.jsx +0 -41
- package/dist/src/components/page-calendar/page-calendar.types.d.ts +0 -18
- package/dist/src/components/page-calendar/page-calendar.types.d.ts.map +0 -1
- package/dist/src/components/page-calendar/page-calendar.types.js +0 -1
- package/dist/src/components/page-calendar/page-calendar.utils.d.ts +0 -24
- package/dist/src/components/page-calendar/page-calendar.utils.d.ts.map +0 -1
- package/dist/src/components/page-calendar/page-calendar.utils.js +0 -93
- package/dist/src/components/page-calendar/week-view.d.ts +0 -11
- package/dist/src/components/page-calendar/week-view.d.ts.map +0 -1
- package/dist/src/components/page-calendar/week-view.jsx +0 -66
- package/dist/src/components/table/filter.d.ts +0 -42
- package/dist/src/components/table/filter.d.ts.map +0 -1
- package/dist/src/components/table/filter.jsx +0 -169
- package/dist/src/components/table/group.d.ts +0 -17
- package/dist/src/components/table/group.d.ts.map +0 -1
- package/dist/src/components/table/group.jsx +0 -75
- package/dist/src/components/table/index.d.ts +0 -19
- package/dist/src/components/table/index.d.ts.map +0 -1
- package/dist/src/components/table/index.jsx +0 -63
- package/dist/src/components/table/inner-table.d.ts +0 -29
- package/dist/src/components/table/inner-table.d.ts.map +0 -1
- package/dist/src/components/table/inner-table.jsx +0 -102
- package/dist/src/components/table/metadata.d.ts +0 -4
- package/dist/src/components/table/metadata.d.ts.map +0 -1
- package/dist/src/components/table/metadata.jsx +0 -36
- package/dist/src/components/table/pagination.d.ts +0 -5
- package/dist/src/components/table/pagination.d.ts.map +0 -1
- package/dist/src/components/table/pagination.jsx +0 -74
- package/dist/src/components/table/row.d.ts +0 -11
- package/dist/src/components/table/row.d.ts.map +0 -1
- package/dist/src/components/table/row.jsx +0 -49
- package/dist/src/components/table/sort.d.ts +0 -28
- package/dist/src/components/table/sort.d.ts.map +0 -1
- package/dist/src/components/table/sort.jsx +0 -109
- package/dist/src/components/table/table-lib.d.ts +0 -135
- package/dist/src/components/table/table-lib.d.ts.map +0 -1
- package/dist/src/components/table/table-lib.js +0 -83
- package/dist/src/components/table/table.context.d.ts +0 -10
- package/dist/src/components/table/table.context.d.ts.map +0 -1
- package/dist/src/components/table/table.context.jsx +0 -5
- package/dist/src/components/table/thead.d.ts +0 -9
- package/dist/src/components/table/thead.d.ts.map +0 -1
- package/dist/src/components/table/thead.jsx +0 -103
- package/dist/src/config/context.d.ts +0 -21
- package/dist/src/config/context.d.ts.map +0 -1
- package/dist/src/config/context.js +0 -12
- package/dist/src/config/default-translations.d.ts +0 -94
- package/dist/src/config/default-translations.d.ts.map +0 -1
- package/dist/src/config/default-translations.jsx +0 -87
- package/dist/src/config/default-tweaks.d.ts +0 -13
- package/dist/src/config/default-tweaks.d.ts.map +0 -1
- package/dist/src/config/default-tweaks.js +0 -4
- package/dist/src/constants.d.ts +0 -3
- package/dist/src/constants.d.ts.map +0 -1
- package/dist/src/constants.js +0 -2
- package/dist/src/hooks/use-click-outside.d.ts +0 -3
- package/dist/src/hooks/use-click-outside.d.ts.map +0 -1
- package/dist/src/hooks/use-click-outside.js +0 -17
- package/dist/src/hooks/use-color-parser.d.ts +0 -2
- package/dist/src/hooks/use-color-parser.d.ts.map +0 -1
- package/dist/src/hooks/use-color-parser.js +0 -9
- package/dist/src/hooks/use-components-provider.d.ts +0 -15
- package/dist/src/hooks/use-components-provider.d.ts.map +0 -1
- package/dist/src/hooks/use-components-provider.jsx +0 -22
- package/dist/src/hooks/use-debounce.d.ts +0 -5
- package/dist/src/hooks/use-debounce.d.ts.map +0 -1
- package/dist/src/hooks/use-debounce.js +0 -12
- package/dist/src/hooks/use-floating-ref.d.ts +0 -2
- package/dist/src/hooks/use-floating-ref.d.ts.map +0 -1
- package/dist/src/hooks/use-floating-ref.js +0 -6
- package/dist/src/hooks/use-form.d.ts +0 -394
- package/dist/src/hooks/use-form.d.ts.map +0 -1
- package/dist/src/hooks/use-form.js +0 -563
- package/dist/src/hooks/use-hover.d.ts +0 -3
- package/dist/src/hooks/use-hover.d.ts.map +0 -1
- package/dist/src/hooks/use-hover.js +0 -18
- package/dist/src/hooks/use-input-id.d.ts +0 -4
- package/dist/src/hooks/use-input-id.d.ts.map +0 -1
- package/dist/src/hooks/use-input-id.js +0 -5
- package/dist/src/hooks/use-is-coarse-device.d.ts +0 -2
- package/dist/src/hooks/use-is-coarse-device.d.ts.map +0 -1
- package/dist/src/hooks/use-is-coarse-device.js +0 -12
- package/dist/src/hooks/use-locale.d.ts +0 -3
- package/dist/src/hooks/use-locale.d.ts.map +0 -1
- package/dist/src/hooks/use-locale.js +0 -10
- package/dist/src/hooks/use-media-query.d.ts +0 -2
- package/dist/src/hooks/use-media-query.d.ts.map +0 -1
- package/dist/src/hooks/use-media-query.js +0 -25
- package/dist/src/hooks/use-on-event.d.ts +0 -4
- package/dist/src/hooks/use-on-event.d.ts.map +0 -1
- package/dist/src/hooks/use-on-event.js +0 -10
- package/dist/src/hooks/use-parent.d.ts +0 -3
- package/dist/src/hooks/use-parent.d.ts.map +0 -1
- package/dist/src/hooks/use-parent.js +0 -21
- package/dist/src/hooks/use-preferences.d.ts +0 -2
- package/dist/src/hooks/use-preferences.d.ts.map +0 -1
- package/dist/src/hooks/use-preferences.js +0 -23
- package/dist/src/hooks/use-previous.d.ts +0 -2
- package/dist/src/hooks/use-previous.d.ts.map +0 -1
- package/dist/src/hooks/use-previous.js +0 -9
- package/dist/src/hooks/use-reactive.d.ts +0 -2
- package/dist/src/hooks/use-reactive.d.ts.map +0 -1
- package/dist/src/hooks/use-reactive.js +0 -9
- package/dist/src/hooks/use-remove-scroll.d.ts +0 -4
- package/dist/src/hooks/use-remove-scroll.d.ts.map +0 -1
- package/dist/src/hooks/use-remove-scroll.js +0 -48
- package/dist/src/hooks/use-resize-observer.d.ts +0 -2
- package/dist/src/hooks/use-resize-observer.d.ts.map +0 -1
- package/dist/src/hooks/use-resize-observer.js +0 -17
- package/dist/src/hooks/use-stable-ref.d.ts +0 -2
- package/dist/src/hooks/use-stable-ref.d.ts.map +0 -1
- package/dist/src/hooks/use-stable-ref.js +0 -9
- package/dist/src/hooks/use-swipe.d.ts +0 -8
- package/dist/src/hooks/use-swipe.d.ts.map +0 -1
- package/dist/src/hooks/use-swipe.js +0 -17
- package/dist/src/hooks/use-translations.d.ts +0 -92
- package/dist/src/hooks/use-translations.d.ts.map +0 -1
- package/dist/src/hooks/use-translations.js +0 -9
- package/dist/src/hooks/use-tweaks.d.ts +0 -3
- package/dist/src/hooks/use-tweaks.d.ts.map +0 -1
- package/dist/src/hooks/use-tweaks.js +0 -9
- package/dist/src/hooks/use-window-size.d.ts +0 -5
- package/dist/src/hooks/use-window-size.d.ts.map +0 -1
- package/dist/src/hooks/use-window-size.js +0 -14
- package/dist/src/index.d.ts +0 -22
- package/dist/src/index.d.ts.map +0 -1
- package/dist/src/index.js +0 -20
- package/dist/src/lib/combi-keys.d.ts +0 -15
- package/dist/src/lib/combi-keys.d.ts.map +0 -1
- package/dist/src/lib/combi-keys.js +0 -60
- package/dist/src/lib/dict.d.ts +0 -9
- package/dist/src/lib/dict.d.ts.map +0 -1
- package/dist/src/lib/dict.js +0 -28
- package/dist/src/lib/dom.d.ts +0 -20
- package/dist/src/lib/dom.d.ts.map +0 -1
- package/dist/src/lib/dom.js +0 -185
- package/dist/src/lib/fns.d.ts +0 -11
- package/dist/src/lib/fns.d.ts.map +0 -1
- package/dist/src/lib/fns.js +0 -46
- package/dist/src/lib/fzf.d.ts +0 -16
- package/dist/src/lib/fzf.d.ts.map +0 -1
- package/dist/src/lib/fzf.js +0 -115
- package/dist/src/lib/keyboard-area.d.ts +0 -16
- package/dist/src/lib/keyboard-area.d.ts.map +0 -1
- package/dist/src/lib/keyboard-area.js +0 -14
- package/dist/src/styles/common.d.ts +0 -8
- package/dist/src/styles/common.d.ts.map +0 -1
- package/dist/src/styles/common.js +0 -20
- package/dist/src/styles/components.d.ts +0 -3
- package/dist/src/styles/components.d.ts.map +0 -1
- package/dist/src/styles/components.js +0 -397
- package/dist/src/styles/dark.d.ts +0 -3
- package/dist/src/styles/dark.d.ts.map +0 -1
- package/dist/src/styles/dark.js +0 -217
- package/dist/src/styles/default-tokens.d.ts +0 -74
- package/dist/src/styles/default-tokens.d.ts.map +0 -1
- package/dist/src/styles/default-tokens.js +0 -41
- package/dist/src/styles/design-tokens.d.ts +0 -29
- package/dist/src/styles/design-tokens.d.ts.map +0 -1
- package/dist/src/styles/design-tokens.js +0 -73
- package/dist/src/styles/light.d.ts +0 -3
- package/dist/src/styles/light.d.ts.map +0 -1
- package/dist/src/styles/light.js +0 -217
- package/dist/src/styles/theme.d.ts +0 -3
- package/dist/src/styles/theme.d.ts.map +0 -1
- package/dist/src/styles/theme.js +0 -4
- package/dist/src/styles/theme.types.d.ts +0 -540
- package/dist/src/styles/theme.types.d.ts.map +0 -1
- package/dist/src/styles/theme.types.js +0 -1
- package/dist/src/types.d.ts +0 -26
- package/dist/src/types.d.ts.map +0 -1
- package/dist/src/types.js +0 -1
- package/dist/tsconfig.lib.tsbuildinfo +0 -1
- package/dist/with-selector-BAUQ-vKK.js +0 -187
- package/dist/with-selector-BAUQ-vKK.js.map +0 -1
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { HTMLMotionProps } from "motion/react";
|
|
2
|
-
import React, { PropsWithChildren } from "react";
|
|
3
|
-
import { CvaVariants } from "../../types";
|
|
4
|
-
import { PolymorphicProps } from "../core/polymorph";
|
|
5
|
-
type CollapseProps = HTMLMotionProps<"section"> & {
|
|
6
|
-
open: boolean;
|
|
7
|
-
};
|
|
8
|
-
export declare const Collapse: (props: PropsWithChildren<CollapseProps>) => React.JSX.Element;
|
|
9
|
-
declare const themeVariants: {
|
|
10
|
-
theme: {
|
|
11
|
-
primary: string;
|
|
12
|
-
danger: string;
|
|
13
|
-
info: string;
|
|
14
|
-
success: string;
|
|
15
|
-
secondary: string;
|
|
16
|
-
warn: string;
|
|
17
|
-
neutral: string;
|
|
18
|
-
};
|
|
19
|
-
};
|
|
20
|
-
export type AlertProps<T extends React.ElementType = "div"> = PolymorphicProps<CvaVariants<typeof themeVariants> & Partial<{
|
|
21
|
-
open?: boolean;
|
|
22
|
-
container: string;
|
|
23
|
-
Icon: React.ReactElement;
|
|
24
|
-
onClose: (nextState: boolean) => void;
|
|
25
|
-
}>, T>;
|
|
26
|
-
export declare const Alert: <T extends React.ElementType = "div">(props: AlertProps<T>) => React.ReactNode;
|
|
27
|
-
export {};
|
|
28
|
-
//# sourceMappingURL=alert.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"alert.d.ts","sourceRoot":"","sources":["../../../../src/components/display/alert.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAmB,eAAe,EAA0C,MAAM,cAAc,CAAC;AAExG,OAAO,KAAK,EAAE,EAAc,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAG7D,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,EAAa,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAahE,KAAK,aAAa,GAAG,eAAe,CAAC,SAAS,CAAC,GAAG;IAAE,IAAI,EAAE,OAAO,CAAA;CAAE,CAAC;AAEpE,eAAO,MAAM,QAAQ,GAAI,OAAO,iBAAiB,CAAC,aAAa,CAAC,sBAiB/D,CAAC;AAEF,QAAA,MAAM,aAAa;;;;;;;;;;CAUlB,CAAC;AAOF,MAAM,MAAM,UAAU,CAAC,CAAC,SAAS,KAAK,CAAC,WAAW,GAAG,KAAK,IAAI,gBAAgB,CAC1E,WAAW,CAAC,OAAO,aAAa,CAAC,GAC7B,OAAO,CAAC;IACJ,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,KAAK,CAAC,YAAY,CAAC;IACzB,OAAO,EAAE,CAAC,SAAS,EAAE,OAAO,KAAK,IAAI,CAAC;CACzC,CAAC,EACN,CAAC,CACJ,CAAC;AAEF,eAAO,MAAM,KAAK,EAAE,CAAC,CAAC,SAAS,KAAK,CAAC,WAAW,GAAG,KAAK,EAAE,KAAK,EAAE,UAAU,CAAC,CAAC,CAAC,KAAK,KAAK,CAAC,SAwD9E,CAAC"}
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { cva } from "class-variance-authority";
|
|
3
|
-
import { AnimatePresence, motion } from "motion/react";
|
|
4
|
-
import { CheckCircleIcon, InfoIcon, WarningIcon, XIcon } from "@phosphor-icons/react";
|
|
5
|
-
import React, { forwardRef } from "react";
|
|
6
|
-
import { useTranslations } from "../../hooks/use-translations";
|
|
7
|
-
import { css } from "../../lib/dom";
|
|
8
|
-
import { Polymorph } from "../core/polymorph";
|
|
9
|
-
const variants = {
|
|
10
|
-
true: { opacity: 1, height: "auto" },
|
|
11
|
-
false: { opacity: [0.7, 0.3, 0], height: 0 },
|
|
12
|
-
};
|
|
13
|
-
const transition = {
|
|
14
|
-
type: "tween",
|
|
15
|
-
duration: 0.7,
|
|
16
|
-
ease: [0.04, 0.62, 0.23, 0.98],
|
|
17
|
-
};
|
|
18
|
-
export const Collapse = (props) => (<motion.div {...props} layout layoutRoot layoutScroll initial={false} variants={variants} exit={variants.false} transition={transition} aria-hidden={!props.open} data-component="collapse" animate={props.open.toString()} className={css("aria-hidden:pointer-events-none", props.className)}>
|
|
19
|
-
{props.children}
|
|
20
|
-
</motion.div>);
|
|
21
|
-
const themeVariants = {
|
|
22
|
-
theme: {
|
|
23
|
-
primary: "bg-alert-primary-bg text-alert-primary-text border-alert-primary-border",
|
|
24
|
-
danger: "bg-alert-danger-bg text-alert-danger-text border-alert-danger-border",
|
|
25
|
-
info: "bg-alert-info-bg text-alert-info-text border-alert-info-border",
|
|
26
|
-
success: "bg-alert-success-bg text-alert-success-text border-alert-success-border",
|
|
27
|
-
secondary: "bg-alert-secondary-bg text-alert-secondary-text border-alert-secondary-border",
|
|
28
|
-
warn: "bg-alert-warn-bg text-alert-warn-text border-alert-warn-border",
|
|
29
|
-
neutral: "bg-transparent border border-card-border text-alert-primary-text",
|
|
30
|
-
},
|
|
31
|
-
};
|
|
32
|
-
const alertVariants = cva("text-typography-sm relative block w-full rounded-alert-radius border p-alert-p", {
|
|
33
|
-
variants: themeVariants,
|
|
34
|
-
defaultVariants: { theme: "neutral" },
|
|
35
|
-
});
|
|
36
|
-
export const Alert = forwardRef(function Alert({ className, theme, Icon, onClose, open = true, ...props }, ref) {
|
|
37
|
-
const t = useTranslations();
|
|
38
|
-
const close = () => onClose?.(false);
|
|
39
|
-
const liveRole = theme === "danger" || theme === "warn" ? "alert" : "status";
|
|
40
|
-
return (<AnimatePresence presenceAffectsLayout propagate mode="sync">
|
|
41
|
-
{open ? (<motion.div data-open={!!open} aria-hidden={!open} data-component="alert" className={css("isolate w-full", open ? "pointer-events-auto" : "pointer-events-none")}>
|
|
42
|
-
<Collapse data-open={!!open} open={!!open}>
|
|
43
|
-
<Polymorph {...props} ref={ref} role={liveRole} data-theme={theme} as={props.as || "div"} className={css(alertVariants({ theme }), className)}>
|
|
44
|
-
<div className="flex flex-col gap-alert-gap">
|
|
45
|
-
{onClose !== undefined && open ? (<button type="button" onClick={close} aria-label={t.closeButton} className="absolute right-alert-close-right top-alert-close-top text-foreground transition-colors duration-300 ease-in-out hover:text-danger">
|
|
46
|
-
<XIcon size={20} aria-hidden="true"/>
|
|
47
|
-
</button>) : null}
|
|
48
|
-
<div className="flex items-center gap-alert-gap">
|
|
49
|
-
{!Icon && theme === "success" ? <CheckCircleIcon aria-hidden="true" size={20}/> : null}
|
|
50
|
-
{!Icon && theme === "info" ? <InfoIcon aria-hidden="true" size={20}/> : null}
|
|
51
|
-
{!Icon && theme === "danger" ? <WarningIcon aria-hidden="true" size={20}/> : null}
|
|
52
|
-
{Icon}
|
|
53
|
-
{props.title ? (<h4 className="tracking-3 text-typography-lg text-balance font-semibold">{props.title}</h4>) : (<div className="w-full">{props.children}</div>)}
|
|
54
|
-
</div>
|
|
55
|
-
{props.title ? <div className="w-full">{props.children}</div> : null}
|
|
56
|
-
</div>
|
|
57
|
-
</Polymorph>
|
|
58
|
-
</Collapse>
|
|
59
|
-
</motion.div>) : null}
|
|
60
|
-
</AnimatePresence>);
|
|
61
|
-
});
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { type Locales } from "the-mask-input";
|
|
3
|
-
type Range = {
|
|
4
|
-
from?: Date;
|
|
5
|
-
to?: Date;
|
|
6
|
-
};
|
|
7
|
-
type OnChangeDate = (d: Date | undefined) => void;
|
|
8
|
-
type OnChangeRange = (d: Range | undefined) => void;
|
|
9
|
-
type DateStyle = (d: Date) => string;
|
|
10
|
-
type CalendarStyles = Partial<{
|
|
11
|
-
day: string | DateStyle;
|
|
12
|
-
weekDay: string | DateStyle;
|
|
13
|
-
dayFrame: string | DateStyle;
|
|
14
|
-
week: string | ((week: Date[]) => string);
|
|
15
|
-
calendar: string | ((daysOfMonth: Date[]) => string);
|
|
16
|
-
}>;
|
|
17
|
-
export type CalendarProps = Partial<{
|
|
18
|
-
date: Date;
|
|
19
|
-
range: Range;
|
|
20
|
-
markRange: boolean;
|
|
21
|
-
markToday: boolean;
|
|
22
|
-
rangeMode: boolean;
|
|
23
|
-
datetimeTitle: string;
|
|
24
|
-
styles: CalendarStyles;
|
|
25
|
-
type?: "date" | "datetime";
|
|
26
|
-
changeOnlyOnClick: boolean;
|
|
27
|
-
locale: Locales | undefined;
|
|
28
|
-
onChangeYear: (d: Date) => void;
|
|
29
|
-
onChangeMonth: (d: Date) => void;
|
|
30
|
-
disabledDate: (date: Date) => boolean;
|
|
31
|
-
RenderOnDay: React.FC<{
|
|
32
|
-
date: Date;
|
|
33
|
-
}>;
|
|
34
|
-
onChange: OnChangeRange | OnChangeDate;
|
|
35
|
-
labelRange: {
|
|
36
|
-
to: string;
|
|
37
|
-
from: string;
|
|
38
|
-
};
|
|
39
|
-
}>;
|
|
40
|
-
export declare const Calendar: ({ RenderOnDay, changeOnlyOnClick, labelRange, disabledDate, locale, markToday, onChangeMonth, onChangeYear, rangeMode, onChange, styles, markRange, type, datetimeTitle, ...props }: CalendarProps) => React.JSX.Element;
|
|
41
|
-
export {};
|
|
42
|
-
//# sourceMappingURL=calendar.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"calendar.d.ts","sourceRoot":"","sources":["../../../../src/components/display/calendar.tsx"],"names":[],"mappings":"AAmBA,OAAO,KAA4C,MAAM,OAAO,CAAC;AAEjE,OAAqB,EAAE,KAAK,OAAO,EAAE,MAAM,gBAAgB,CAAC;AA0B5D,KAAK,KAAK,GAAG;IAAE,IAAI,CAAC,EAAE,IAAI,CAAC;IAAC,EAAE,CAAC,EAAE,IAAI,CAAA;CAAE,CAAC;AAExC,KAAK,YAAY,GAAG,CAAC,CAAC,EAAE,IAAI,GAAG,SAAS,KAAK,IAAI,CAAC;AAElD,KAAK,aAAa,GAAG,CAAC,CAAC,EAAE,KAAK,GAAG,SAAS,KAAK,IAAI,CAAC;AAEpD,KAAK,SAAS,GAAG,CAAC,CAAC,EAAE,IAAI,KAAK,MAAM,CAAC;AAErC,KAAK,cAAc,GAAG,OAAO,CAAC;IAC1B,GAAG,EAAE,MAAM,GAAG,SAAS,CAAC;IACxB,OAAO,EAAE,MAAM,GAAG,SAAS,CAAC;IAC5B,QAAQ,EAAE,MAAM,GAAG,SAAS,CAAC;IAC7B,IAAI,EAAE,MAAM,GAAG,CAAC,CAAC,IAAI,EAAE,IAAI,EAAE,KAAK,MAAM,CAAC,CAAC;IAC1C,QAAQ,EAAE,MAAM,GAAG,CAAC,CAAC,WAAW,EAAE,IAAI,EAAE,KAAK,MAAM,CAAC,CAAC;CACxD,CAAC,CAAC;AAEH,MAAM,MAAM,aAAa,GAAG,OAAO,CAAC;IAChC,IAAI,EAAE,IAAI,CAAC;IACX,KAAK,EAAE,KAAK,CAAC;IACb,SAAS,EAAE,OAAO,CAAC;IACnB,SAAS,EAAE,OAAO,CAAC;IACnB,SAAS,EAAE,OAAO,CAAC;IACnB,aAAa,EAAE,MAAM,CAAC;IACtB,MAAM,EAAE,cAAc,CAAC;IACvB,IAAI,CAAC,EAAE,MAAM,GAAG,UAAU,CAAC;IAC3B,iBAAiB,EAAE,OAAO,CAAC;IAC3B,MAAM,EAAE,OAAO,GAAG,SAAS,CAAC;IAC5B,YAAY,EAAE,CAAC,CAAC,EAAE,IAAI,KAAK,IAAI,CAAC;IAChC,aAAa,EAAE,CAAC,CAAC,EAAE,IAAI,KAAK,IAAI,CAAC;IACjC,YAAY,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,OAAO,CAAC;IACtC,WAAW,EAAE,KAAK,CAAC,EAAE,CAAC;QAAE,IAAI,EAAE,IAAI,CAAA;KAAE,CAAC,CAAC;IACtC,QAAQ,EAAE,aAAa,GAAG,YAAY,CAAC;IACvC,UAAU,EAAE;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC;CAC5C,CAAC,CAAC;AA2IH,eAAO,MAAM,QAAQ,GAAI,qLAgBtB,aAAa,sBA2Sf,CAAC"}
|
|
@@ -1,318 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { add, eachDayOfInterval, endOfWeek, isAfter, isBefore, isSameMonth, isToday, setYear, startOfDay, startOfMonth, startOfWeek, sub, format, set, } from "date-fns";
|
|
3
|
-
import { CaretLeftIcon, CaretRightIcon } from "@phosphor-icons/react";
|
|
4
|
-
import { AnimatePresence, motion, MotionConfig } from "motion/react";
|
|
5
|
-
import React, { useEffect, useRef } from "react";
|
|
6
|
-
import { Is } from "sidekicker";
|
|
7
|
-
import TheMaskInput from "the-mask-input";
|
|
8
|
-
import { useReducer } from "use-typed-reducer";
|
|
9
|
-
import { useDebounce } from "../../hooks/use-debounce";
|
|
10
|
-
import { useLocale } from "../../hooks/use-locale";
|
|
11
|
-
import { useSwipe } from "../../hooks/use-swipe";
|
|
12
|
-
import { useTranslations } from "../../hooks/use-translations";
|
|
13
|
-
import { css } from "../../lib/dom";
|
|
14
|
-
import { splitInto, uuid } from "../../lib/fns";
|
|
15
|
-
import { Input } from "../form/input";
|
|
16
|
-
const timeRegex = /^(?<hour>\d\d):(?<min>\d\d)$/;
|
|
17
|
-
const transition = { type: "spring", bounce: 0.3, duration: 0.6 };
|
|
18
|
-
const dir = (mod) => (n = 1) => ({ x: `${100 * mod * n}%`, opacity: 0.25 });
|
|
19
|
-
const variants = {
|
|
20
|
-
enter: dir(1),
|
|
21
|
-
exit: dir(-1),
|
|
22
|
-
middle: { x: "0%", opacity: 1 },
|
|
23
|
-
};
|
|
24
|
-
const removeImmediately = { exit: { visibility: "hidden" } };
|
|
25
|
-
const createDays = (month) => {
|
|
26
|
-
const start = startOfWeek(startOfMonth(month));
|
|
27
|
-
return eachDayOfInterval({ start, end: add(start, { days: 41 }) });
|
|
28
|
-
};
|
|
29
|
-
const formatMonth = (d, locale) => d.toLocaleDateString(locale, { month: "long" });
|
|
30
|
-
const getOptionsMonth = (id, date, locale) => Array.from({ length: 12 }).map((_, i) => {
|
|
31
|
-
const month = startOfMonth(new Date(1970, i, 1).setMonth(i));
|
|
32
|
-
const label = formatMonth(month, locale);
|
|
33
|
-
return (<option value={label} key={`${id}-${label}`} data-index={i}>
|
|
34
|
-
{label}
|
|
35
|
-
</option>);
|
|
36
|
-
});
|
|
37
|
-
const onChangeUsingKeyboard = {
|
|
38
|
-
ArrowLeft: (date, duration) => (duration === "days" ? sub(date, { days: 1 }) : sub(date, { months: 1 })),
|
|
39
|
-
ArrowRight: (date, duration) => (duration === "days" ? add(date, { days: 1 }) : add(date, { months: 1 })),
|
|
40
|
-
ArrowUp: (date, duration) => (duration === "days" ? sub(date, { weeks: 1 }) : sub(date, { years: 1 })),
|
|
41
|
-
ArrowDown: (date, duration) => (duration === "days" ? add(date, { weeks: 1 }) : add(date, { years: 1 })),
|
|
42
|
-
};
|
|
43
|
-
const focusDate = (origin, root, next, delay = 0) => {
|
|
44
|
-
const d = next.toISOString();
|
|
45
|
-
const select = () => {
|
|
46
|
-
if (origin?.dataset.focustrap) {
|
|
47
|
-
const el = root.current?.querySelector(`button[data-focustrap="${origin?.dataset.focustrap}"]`);
|
|
48
|
-
return setTimeout(() => el?.focus({ preventScroll: true }), delay);
|
|
49
|
-
}
|
|
50
|
-
if (root.current) {
|
|
51
|
-
const element = root.current.querySelector(`button[data-date="${d}"]`);
|
|
52
|
-
if (element)
|
|
53
|
-
return element.focus({ preventScroll: true });
|
|
54
|
-
}
|
|
55
|
-
};
|
|
56
|
-
if (delay === 0)
|
|
57
|
-
select();
|
|
58
|
-
setTimeout(select, delay);
|
|
59
|
-
};
|
|
60
|
-
const formatYear = (now) => now.getFullYear().toString().padStart(4, "0");
|
|
61
|
-
const inRange = (start, middle, end) => {
|
|
62
|
-
if (start === undefined || end === undefined)
|
|
63
|
-
return false;
|
|
64
|
-
return isAfter(middle, start) && isBefore(middle, end);
|
|
65
|
-
};
|
|
66
|
-
const CalendarBody = (props) => {
|
|
67
|
-
const translate = useTranslations();
|
|
68
|
-
return (<motion.tbody layout variants={variants} custom={props.direction} onKeyDown={props.onKeyDown} className={css(props.styles?.week)}>
|
|
69
|
-
{props.zip.map((week, index) => {
|
|
70
|
-
const weekClassName = Is.function(props.styles?.week) ? props.styles?.week(week) : props.styles?.week;
|
|
71
|
-
return (<tr key={`week-${week.length}-${index}`} className={weekClassName}>
|
|
72
|
-
{week.map((day) => {
|
|
73
|
-
const key = day.toISOString();
|
|
74
|
-
const isSelected = props.rangeMode
|
|
75
|
-
? key === props.range?.to?.toISOString() || key === props.range?.from?.toISOString()
|
|
76
|
-
: key === (props.date ? startOfDay(props.date).toISOString() : undefined);
|
|
77
|
-
const today = isToday(day) && props.markToday;
|
|
78
|
-
const disabledByFn = props.disabledDate?.(day) || false;
|
|
79
|
-
const sameMonth = isSameMonth(day, props.stateDate);
|
|
80
|
-
const disableDate = !sameMonth || disabledByFn;
|
|
81
|
-
const isInRange = props.rangeMode ? inRange(props.range?.from, day, props.range?.to) : false;
|
|
82
|
-
return (<td key={key} align="center" className={css("relative p-calendar-cell-p", Is.function(props.styles?.dayFrame) ? props.styles?.dayFrame(day) : props.styles?.dayFrame)}>
|
|
83
|
-
<button type="button" data-date={key} disabled={disabledByFn} data-samemonth={sameMonth} data-range={props.rangeMode} onClick={props.dispatch.onSelectDate} data-view={props.stateDate.getMonth().toString()} className={css(`relative flex size-calendar-day-size items-center justify-center rounded-full proportional-nums disabled:cursor-not-allowed ${today ? "text-emphasis" : ""} ${disableDate ? "text-disabled" : ""} ${isSelected ? "bg-primary text-primary-foreground" : ""}`, isInRange && props.markRange ? "size-calendar-day-size border border-dashed border-card-border" : "", Is.function(props.styles?.day) ? props.styles?.day(day) : props.styles?.day)}>
|
|
84
|
-
<div></div>
|
|
85
|
-
{day.getDate()}
|
|
86
|
-
{isSelected && props.stateRange.from?.toISOString() === key ? (<span className="absolute -top-2 left-0 h-full w-full">
|
|
87
|
-
<span className="text-calendar-cell-text text-foreground">
|
|
88
|
-
{props.labelRange?.from ?? translate.calendarFromDate}
|
|
89
|
-
</span>
|
|
90
|
-
</span>) : null}
|
|
91
|
-
{isSelected && props.stateRange.to?.toISOString() === key ? (<span className="absolute -top-2 left-0 h-full w-full">
|
|
92
|
-
<span className="text-calendar-cell-text text-foreground">{props.labelRange?.to ?? translate.calendarToDate}</span>
|
|
93
|
-
</span>) : null}
|
|
94
|
-
</button>
|
|
95
|
-
{props.RenderOnDay ? <props.RenderOnDay date={day}/> : null}
|
|
96
|
-
</td>);
|
|
97
|
-
})}
|
|
98
|
-
</tr>);
|
|
99
|
-
})}
|
|
100
|
-
</motion.tbody>);
|
|
101
|
-
};
|
|
102
|
-
const getToday = () => startOfDay(new Date());
|
|
103
|
-
export const Calendar = ({ RenderOnDay, changeOnlyOnClick = false, labelRange, disabledDate, locale, markToday = true, onChangeMonth, onChangeYear, rangeMode = false, onChange, styles, markRange = true, type = "date", datetimeTitle, ...props }) => {
|
|
104
|
-
const id = useRef(uuid());
|
|
105
|
-
const translations = useTranslations();
|
|
106
|
-
const currentLocale = useLocale(locale);
|
|
107
|
-
const root = useRef(null);
|
|
108
|
-
const { date, range } = props;
|
|
109
|
-
const providedDate = date || new Date();
|
|
110
|
-
const monthClicked = useRef(null);
|
|
111
|
-
const [state, dispatch] = useReducer({
|
|
112
|
-
date: providedDate,
|
|
113
|
-
isAnimating: false,
|
|
114
|
-
year: formatYear(providedDate),
|
|
115
|
-
direction: undefined,
|
|
116
|
-
range: { from: range?.from, to: range?.to },
|
|
117
|
-
months: getOptionsMonth(id.current, providedDate, currentLocale),
|
|
118
|
-
selectMode: (rangeMode ? "from" : undefined),
|
|
119
|
-
week: eachDayOfInterval({
|
|
120
|
-
start: startOfWeek(providedDate),
|
|
121
|
-
end: endOfWeek(providedDate),
|
|
122
|
-
}),
|
|
123
|
-
}, (get) => ({
|
|
124
|
-
onChangeYear: (year) => ({ year }),
|
|
125
|
-
onExitComplete: () => {
|
|
126
|
-
focusDate(monthClicked.current || null, root, get.state().date, 200);
|
|
127
|
-
monthClicked.current = null;
|
|
128
|
-
return { isAnimating: false };
|
|
129
|
-
},
|
|
130
|
-
date: (callback) => {
|
|
131
|
-
const newDate = callback(get.state().date);
|
|
132
|
-
return { date: newDate, year: formatYear(newDate) };
|
|
133
|
-
},
|
|
134
|
-
nextMonth: (e) => {
|
|
135
|
-
if (e)
|
|
136
|
-
monthClicked.current = e.currentTarget;
|
|
137
|
-
const state = get.state();
|
|
138
|
-
if (state.isAnimating)
|
|
139
|
-
return state;
|
|
140
|
-
const date = add(state.date, { months: 1 });
|
|
141
|
-
return {
|
|
142
|
-
date,
|
|
143
|
-
isAnimating: true,
|
|
144
|
-
direction: 1,
|
|
145
|
-
year: formatYear(date),
|
|
146
|
-
};
|
|
147
|
-
},
|
|
148
|
-
previousMonth: (e) => {
|
|
149
|
-
if (e)
|
|
150
|
-
monthClicked.current = e.currentTarget;
|
|
151
|
-
const state = get.state();
|
|
152
|
-
if (state.isAnimating)
|
|
153
|
-
return state;
|
|
154
|
-
const date = sub(state.date, { months: 1 });
|
|
155
|
-
return {
|
|
156
|
-
date,
|
|
157
|
-
isAnimating: true,
|
|
158
|
-
direction: -1,
|
|
159
|
-
year: formatYear(date),
|
|
160
|
-
};
|
|
161
|
-
},
|
|
162
|
-
onSelectDate: (e) => {
|
|
163
|
-
const state = get.state();
|
|
164
|
-
const isRangeMode = e.currentTarget.dataset.range === "true";
|
|
165
|
-
const d = e.currentTarget.dataset.date || "";
|
|
166
|
-
const date = new Date(d);
|
|
167
|
-
return {
|
|
168
|
-
date,
|
|
169
|
-
year: formatYear(date),
|
|
170
|
-
selectMode: state.selectMode === undefined ? undefined : state.selectMode === "from" ? "to" : "from",
|
|
171
|
-
range: !isRangeMode
|
|
172
|
-
? state.range
|
|
173
|
-
: {
|
|
174
|
-
from: state.selectMode === "from" ? date : state.range.from,
|
|
175
|
-
to: state.selectMode === "to" ? date : state.range.to,
|
|
176
|
-
},
|
|
177
|
-
};
|
|
178
|
-
},
|
|
179
|
-
onChangeMonth: (e) => {
|
|
180
|
-
const value = e.target.value;
|
|
181
|
-
const array = Array.from(e.target.options);
|
|
182
|
-
const month = array.find((x) => x.value === value);
|
|
183
|
-
const state = get.state();
|
|
184
|
-
if (month) {
|
|
185
|
-
const i = month.dataset.index || "";
|
|
186
|
-
const d = new Date(get.state().date);
|
|
187
|
-
d.setMonth(+i);
|
|
188
|
-
return { ...state, date: d, year: formatYear(d) };
|
|
189
|
-
}
|
|
190
|
-
return state;
|
|
191
|
-
},
|
|
192
|
-
onKeyDown: (e) => {
|
|
193
|
-
const key = e.key;
|
|
194
|
-
const state = get.state();
|
|
195
|
-
if (key in onChangeUsingKeyboard) {
|
|
196
|
-
if (key === "ArrowUp" || key === "ArrowDown")
|
|
197
|
-
e.preventDefault();
|
|
198
|
-
const prev = get.state().date;
|
|
199
|
-
const date = Is.keyof(onChangeUsingKeyboard, key) ? onChangeUsingKeyboard[key](prev, e.shiftKey ? "month" : "days") : null;
|
|
200
|
-
if (date !== null) {
|
|
201
|
-
focusDate(e.target, root, date);
|
|
202
|
-
return { ...state, date, year: formatYear(date) };
|
|
203
|
-
}
|
|
204
|
-
}
|
|
205
|
-
return get.state();
|
|
206
|
-
},
|
|
207
|
-
}), {
|
|
208
|
-
props: { onChangeMonth, onChangeYear },
|
|
209
|
-
postMiddleware: [
|
|
210
|
-
(state, _, args) => {
|
|
211
|
-
const isValidMethod = args.method === "onChangeMonth" || args.method === "previousMonth" || args.method === "nextMonth";
|
|
212
|
-
if (isValidMethod)
|
|
213
|
-
args.props.onChangeMonth?.(state.date);
|
|
214
|
-
return state;
|
|
215
|
-
},
|
|
216
|
-
(state, _, args) => {
|
|
217
|
-
const isValidMethod = args.method === "onChangeYear";
|
|
218
|
-
if (isValidMethod)
|
|
219
|
-
args.props.onChangeYear?.(state.date);
|
|
220
|
-
return state;
|
|
221
|
-
},
|
|
222
|
-
(state, _, args) => {
|
|
223
|
-
const isValidMethod = args.method === "onSelectDate" || args.method === "setToday" || args.method === "onKeyDown";
|
|
224
|
-
if (rangeMode && isValidMethod && changeOnlyOnClick) {
|
|
225
|
-
onChange?.(state.range);
|
|
226
|
-
return state;
|
|
227
|
-
}
|
|
228
|
-
if (isValidMethod && changeOnlyOnClick)
|
|
229
|
-
onChange?.(state.date);
|
|
230
|
-
return state;
|
|
231
|
-
},
|
|
232
|
-
],
|
|
233
|
-
});
|
|
234
|
-
const allDaysOfMonth = createDays(state.date);
|
|
235
|
-
const zip = splitInto(allDaysOfMonth, 7);
|
|
236
|
-
const currentAsString = state.date.toISOString();
|
|
237
|
-
const monthString = formatMonth(state.date, currentLocale);
|
|
238
|
-
useEffect(() => {
|
|
239
|
-
if (!changeOnlyOnClick)
|
|
240
|
-
onChange?.(state.date);
|
|
241
|
-
}, [currentAsString, changeOnlyOnClick, state.date, onChange]);
|
|
242
|
-
const defer = useDebounce((y) => dispatch.date((prev) => setYear(new Date(prev), +y)), 1200);
|
|
243
|
-
const internalOnChangeYear = (e) => {
|
|
244
|
-
const value = e.currentTarget.value;
|
|
245
|
-
dispatch.onChangeYear(value);
|
|
246
|
-
onChangeYear?.(new Date(value));
|
|
247
|
-
defer(value);
|
|
248
|
-
};
|
|
249
|
-
const swipe = useSwipe((event, direction) => {
|
|
250
|
-
event.preventDefault();
|
|
251
|
-
return direction === "right" ? dispatch.previousMonth() : dispatch.nextMonth();
|
|
252
|
-
}, 10);
|
|
253
|
-
const onSetToday = () => {
|
|
254
|
-
const d = getToday();
|
|
255
|
-
dispatch.date(() => d);
|
|
256
|
-
onChange?.(d);
|
|
257
|
-
};
|
|
258
|
-
return (<MotionConfig transition={transition}>
|
|
259
|
-
<div ref={root} data-component="calendar" onTouchEnd={swipe.onTouchEnd} onTouchStart={swipe.onTouchStart} className={css("relative overflow-hidden", Is.function(styles?.calendar) ? styles?.calendar(allDaysOfMonth) : styles?.calendar)}>
|
|
260
|
-
<div className="rounded-calendar-header-radius flex flex-col justify-center text-center">
|
|
261
|
-
<AnimatePresence initial={false} mode="popLayout" custom={state.direction} onExitComplete={dispatch.onExitComplete}>
|
|
262
|
-
<motion.div key={monthString} initial="enter" animate="middle" exit="exit">
|
|
263
|
-
<header className="relative flex justify-between">
|
|
264
|
-
<motion.button layout type="button" data-focustrap="prev" variants={removeImmediately} onClick={dispatch.previousMonth} title={translations.calendarBackMonth} className="z-calendar rounded-full p-calendar-nav-p hover:bg-primary hover:text-primary-foreground">
|
|
265
|
-
<CaretLeftIcon className="size-calendar-icon-size"/>
|
|
266
|
-
</motion.button>
|
|
267
|
-
<motion.span layout variants={variants} custom={state.direction} className="absolute inset-0 isolate z-normal flex items-center justify-center font-semibold">
|
|
268
|
-
<span className="flex w-fit items-center justify-center gap-calendar-nav-gap py-calendar-nav-py">
|
|
269
|
-
<select value={monthString} onChange={dispatch.onChangeMonth} aria-label={translations.calendarMonthLabel} style={{ width: `${monthString.length + 1}ch` }} className="cursor-pointer appearance-none bg-transparent capitalize proportional-nums hover:text-primary">
|
|
270
|
-
{state.months}
|
|
271
|
-
</select>
|
|
272
|
-
<TheMaskInput mask="int" maxLength={4} placeholder="YYYY" value={state.year} onChange={internalOnChangeYear} style={{ width: `${state.year.length}ch` }} className="w-calendar-year-w cursor-pointer appearance-none bg-transparent hover:text-primary"/>
|
|
273
|
-
</span>
|
|
274
|
-
</motion.span>
|
|
275
|
-
<motion.button layout type="button" data-focustrap="next" variants={removeImmediately} onClick={dispatch.nextMonth} title={translations.calendarNextMonth} className="z-calendar rounded-full p-calendar-nav-p hover:bg-primary hover:text-primary-foreground">
|
|
276
|
-
<CaretRightIcon className="size-calendar-icon-size"/>
|
|
277
|
-
</motion.button>
|
|
278
|
-
</header>
|
|
279
|
-
<motion.table className="mt-calendar-table-mt table min-w-full table-auto border-0">
|
|
280
|
-
<thead>
|
|
281
|
-
<tr>
|
|
282
|
-
{state.week.map((dayOfWeek) => (<th role="columnheader" key={dayOfWeek.toString()} className={css("py-calendar-weekday-py text-typography-sm font-medium capitalize", Is.function(styles?.weekDay) ? styles.weekDay(dayOfWeek) : styles?.weekDay)}>
|
|
283
|
-
{dayOfWeek.toLocaleDateString(currentLocale, {
|
|
284
|
-
weekday: "short",
|
|
285
|
-
})}
|
|
286
|
-
</th>))}
|
|
287
|
-
</tr>
|
|
288
|
-
</thead>
|
|
289
|
-
<CalendarBody zip={zip} range={range} styles={styles} date={date || null} dispatch={dispatch} markRange={markRange} markToday={markToday} rangeMode={rangeMode} stateDate={state.date} labelRange={labelRange} stateRange={state.range} RenderOnDay={RenderOnDay} direction={state.direction} disabledDate={disabledDate} onKeyDown={dispatch.onKeyDown}/>
|
|
290
|
-
</motion.table>
|
|
291
|
-
</motion.div>
|
|
292
|
-
</AnimatePresence>
|
|
293
|
-
</div>
|
|
294
|
-
{type === "datetime" ? (<section className="my-calendar-datetime-my grid items-center">
|
|
295
|
-
<Input info={null} mask="time" optionalText=" " container="w-full" reportStatus={false} defaultValue={date ? format(date, "HH:mm") : undefined} title={datetimeTitle || translations.calendarDatetimeTitle} onChange={(e) => {
|
|
296
|
-
const value = e.target.value;
|
|
297
|
-
const match = timeRegex.exec(value);
|
|
298
|
-
if (!match)
|
|
299
|
-
return;
|
|
300
|
-
const hour = match.groups.hour;
|
|
301
|
-
const min = match.groups.min;
|
|
302
|
-
const d = set(state.date, {
|
|
303
|
-
hours: Number(hour),
|
|
304
|
-
minutes: Number(min),
|
|
305
|
-
seconds: 0,
|
|
306
|
-
});
|
|
307
|
-
dispatch.date(() => d);
|
|
308
|
-
onChange?.(d);
|
|
309
|
-
}}/>
|
|
310
|
-
</section>) : null}
|
|
311
|
-
<footer className="mt-calendar-footer-mt text-center text-primary">
|
|
312
|
-
<button type="button" onClick={onSetToday} className="transition-transform duration-300 hover:scale-105">
|
|
313
|
-
{translations.calendarToday}
|
|
314
|
-
</button>
|
|
315
|
-
</footer>
|
|
316
|
-
</div>
|
|
317
|
-
</MotionConfig>);
|
|
318
|
-
};
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { type Icon } from "@phosphor-icons/react";
|
|
2
|
-
import React, { type PropsWithChildren } from "react";
|
|
3
|
-
import { Label } from "../../types";
|
|
4
|
-
import { PolymorphicProps } from "../core/polymorph";
|
|
5
|
-
export type CardProps<T extends React.ElementType = "div"> = PolymorphicProps<{
|
|
6
|
-
title?: Label;
|
|
7
|
-
loading?: boolean;
|
|
8
|
-
container?: string;
|
|
9
|
-
titleClassName?: string;
|
|
10
|
-
header?: React.ReactElement | null;
|
|
11
|
-
}, T>;
|
|
12
|
-
export declare const Card: {
|
|
13
|
-
<T extends React.ElementType = "div">({ title, loading, children, as, header, container, titleClassName, ...props }: PropsWithChildren<CardProps<T>>): React.JSX.Element;
|
|
14
|
-
Title({ as, titleTag, navTag, children, ...props }: PropsWithChildren<CardHeaderTitleProps>): React.JSX.Element;
|
|
15
|
-
};
|
|
16
|
-
export type CardHeaderTitleProps<T extends React.ElementType = "div"> = PolymorphicProps<{
|
|
17
|
-
navTag?: React.ElementType;
|
|
18
|
-
titleTag?: React.ElementType;
|
|
19
|
-
title: React.ReactElement | string;
|
|
20
|
-
}, T>;
|
|
21
|
-
export type StatsCardProps = CardProps<React.ElementType> & {
|
|
22
|
-
Icon?: Icon;
|
|
23
|
-
title: string;
|
|
24
|
-
value: Label;
|
|
25
|
-
mark?: string;
|
|
26
|
-
interactive?: boolean;
|
|
27
|
-
};
|
|
28
|
-
export declare const StatsCard: (props: StatsCardProps) => React.JSX.Element;
|
|
29
|
-
//# sourceMappingURL=card.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"card.d.ts","sourceRoot":"","sources":["../../../../src/components/display/card.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAY,KAAK,IAAI,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,KAAK,EAAE,EAAE,KAAK,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAGtD,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACpC,OAAO,EAAa,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAGhE,MAAM,MAAM,SAAS,CAAC,CAAC,SAAS,KAAK,CAAC,WAAW,GAAG,KAAK,IAAI,gBAAgB,CACzE;IACI,KAAK,CAAC,EAAE,KAAK,CAAC;IACd,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,MAAM,CAAC,EAAE,KAAK,CAAC,YAAY,GAAG,IAAI,CAAC;CACtC,EACD,CAAC,CACJ,CAAC;AAEF,eAAO,MAAM,IAAI;KAAI,CAAC,SAAS,KAAK,CAAC,WAAW,yFAS7C,iBAAiB,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;wDA+C0B,iBAAiB,CAAC,oBAAoB,CAAC;CAXlG,CAAC;AAEF,MAAM,MAAM,oBAAoB,CAAC,CAAC,SAAS,KAAK,CAAC,WAAW,GAAG,KAAK,IAAI,gBAAgB,CACpF;IACI,MAAM,CAAC,EAAE,KAAK,CAAC,WAAW,CAAC;IAC3B,QAAQ,CAAC,EAAE,KAAK,CAAC,WAAW,CAAC;IAC7B,KAAK,EAAE,KAAK,CAAC,YAAY,GAAG,MAAM,CAAC;CACtC,EACD,CAAC,CACJ,CAAC;AAoBF,MAAM,MAAM,cAAc,GAAG,SAAS,CAAC,KAAK,CAAC,WAAW,CAAC,GAAG;IACxD,IAAI,CAAC,EAAE,IAAI,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,KAAK,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,OAAO,CAAC;CACzB,CAAC;AAEF,eAAO,MAAM,SAAS,GAAI,OAAO,cAAc,sBAuB9C,CAAC"}
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import { InfoIcon } from "@phosphor-icons/react";
|
|
2
|
-
import React from "react";
|
|
3
|
-
import { Is } from "sidekicker";
|
|
4
|
-
import { css } from "../../lib/dom";
|
|
5
|
-
import { Polymorph } from "../core/polymorph";
|
|
6
|
-
import { Skeleton } from "./skeleton";
|
|
7
|
-
export const Card = ({ title, loading, children, as, header = null, container = "", titleClassName = "", ...props }) => (<Polymorph {...props} as={as || "div"} data-component="card" className={css("flex w-full flex-col gap-card-gap rounded-card-radius border border-card-border bg-card-background py-card-padding-y shadow-shadow-card", container)}>
|
|
8
|
-
{title ? (<header data-component="card-title" className={css("mb-card-title-mb w-full border-b border-card-border px-card-padding-x pb-card-title-pb text-typography-xl font-medium", titleClassName)}>
|
|
9
|
-
{title}
|
|
10
|
-
</header>) : (header)}
|
|
11
|
-
<div data-component="card-body" className={css("min-w-full px-card-padding-x", props.className)}>
|
|
12
|
-
{loading ? (<div className="flex flex-col gap-card-gap">
|
|
13
|
-
<Skeleton className="w-full"/>
|
|
14
|
-
<Skeleton className="w-8/12"/>
|
|
15
|
-
<Skeleton className="w-10/12"/>
|
|
16
|
-
<Skeleton className="w-1/2"/>
|
|
17
|
-
</div>) : (children)}
|
|
18
|
-
</div>
|
|
19
|
-
</Polymorph>);
|
|
20
|
-
Card.Title = ({ as, titleTag, navTag, children, ...props }) => {
|
|
21
|
-
const Component = (as || "div");
|
|
22
|
-
const Title = (titleTag || "h2");
|
|
23
|
-
const Nav = (navTag || "nav");
|
|
24
|
-
return (<Component {...props} title={Is.string(props.title) ? props.title : undefined} className={css("flex w-full flex-col flex-wrap items-start justify-between gap-base sm:flex-row sm:items-center", props.className)}>
|
|
25
|
-
<Title className="font-semibold">{props.title}</Title>
|
|
26
|
-
{children ? (<Nav className="gap-kilo flex flex-col items-start justify-start sm:flex-row sm:items-center sm:justify-end">{children}</Nav>) : null}
|
|
27
|
-
</Component>);
|
|
28
|
-
};
|
|
29
|
-
export const StatsCard = (props) => {
|
|
30
|
-
const interactive = props.interactive ?? true;
|
|
31
|
-
const Icon = props.Icon ?? InfoIcon;
|
|
32
|
-
return (<Card {...props} title={null} loading={undefined} container="px-0 py-0" className="flex items-center gap-card-gap px-0">
|
|
33
|
-
<div className={`flex w-full items-center gap-card-gap rounded-card-radius px-0 lg:px-0 ${interactive ? "transition-colors duration-300 ease-linear hover:bg-primary-hover/10" : ""}`}>
|
|
34
|
-
<div className={css("flex self-stretch w-card-stats-icon-col-w items-center justify-center rounded-l-card-radius bg-primary p-card-stats-icon-col-p text-primary-foreground", props.mark)}>
|
|
35
|
-
{<Icon size={48}/>}
|
|
36
|
-
</div>
|
|
37
|
-
<div className="flex flex-col justify-center gap-card-stats-content-gap py-card-stats-content-py">
|
|
38
|
-
<p className="text-typography-lg">{props.title}</p>
|
|
39
|
-
{props.loading ? <Skeleton className="h-10"/> : <p className="text-card-title-text font-bold tracking-wide">{props.value}</p>}
|
|
40
|
-
</div>
|
|
41
|
-
</div>
|
|
42
|
-
</Card>);
|
|
43
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"empty.d.ts","sourceRoot":"","sources":["../../../../src/components/display/empty.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAY,KAAK,IAAI,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,MAAM,MAAM,UAAU,GAAG;IAAE,IAAI,CAAC,EAAE,IAAI,CAAC;IAAC,OAAO,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AAE3D,eAAO,MAAM,KAAK,GAAI,OAAO,UAAU,sBAStC,CAAC"}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { FileIcon } from "@phosphor-icons/react";
|
|
2
|
-
import React from "react";
|
|
3
|
-
import { useTranslations } from "../../hooks/use-translations";
|
|
4
|
-
export const Empty = (props) => {
|
|
5
|
-
const Icon = props.Icon ?? FileIcon;
|
|
6
|
-
const translate = useTranslations();
|
|
7
|
-
return (<div className="flex w-full flex-col items-center justify-center gap-empty-gap px-empty-px py-empty-py">
|
|
8
|
-
<Icon size={64} className="text-disabled"/>
|
|
9
|
-
<p className="text-disabled">{props.message ?? translate.emptyDataMessage}</p>
|
|
10
|
-
</div>);
|
|
11
|
-
};
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import React, { PropsWithChildren } from "react";
|
|
2
|
-
import { Label } from "../../types";
|
|
3
|
-
type AnimatedItemProps = {
|
|
4
|
-
title: Label;
|
|
5
|
-
description: Label;
|
|
6
|
-
children: Label;
|
|
7
|
-
avatar?: Label;
|
|
8
|
-
leading?: React.FC<{
|
|
9
|
-
open: () => void;
|
|
10
|
-
}>;
|
|
11
|
-
};
|
|
12
|
-
type AnimatedListProps = object;
|
|
13
|
-
export declare const AnimatedList: (props: PropsWithChildren<AnimatedListProps>) => React.JSX.Element;
|
|
14
|
-
export declare const AnimatedListItem: (props: PropsWithChildren<AnimatedItemProps>) => React.JSX.Element;
|
|
15
|
-
export {};
|
|
16
|
-
//# sourceMappingURL=list.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"list.d.ts","sourceRoot":"","sources":["../../../../src/components/display/list.tsx"],"names":[],"mappings":"AAcA,OAAO,KAAK,EAAE,EAAY,iBAAiB,EAAgC,MAAM,OAAO,CAAC;AACzF,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAEpC,KAAK,iBAAiB,GAAG;IACrB,KAAK,EAAE,KAAK,CAAC;IACb,WAAW,EAAE,KAAK,CAAC;IACnB,QAAQ,EAAE,KAAK,CAAC;IAChB,MAAM,CAAC,EAAE,KAAK,CAAC;IACf,OAAO,CAAC,EAAE,KAAK,CAAC,EAAE,CAAC;QAAE,IAAI,EAAE,MAAM,IAAI,CAAA;KAAE,CAAC,CAAC;CAC5C,CAAC;AAIF,KAAK,iBAAiB,GAAG,MAAM,CAAC;AA4DhC,eAAO,MAAM,YAAY,GAAI,OAAO,iBAAiB,CAAC,iBAAiB,CAAC,sBAwEvE,CAAC;AAEF,eAAO,MAAM,gBAAgB,GAAI,OAAO,iBAAiB,CAAC,iBAAiB,CAAC,sBAA0C,CAAC"}
|