@g4rcez/components 5.0.1 → 5.0.3
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/AnimatePresence-j36AYeOQ.js +181 -0
- package/dist/AnimatePresence-j36AYeOQ.js.map +1 -0
- package/dist/Calendar.es-xICmgvjq.js +23 -0
- package/dist/Calendar.es-xICmgvjq.js.map +1 -0
- package/dist/Funnel.es-DjKVl8Nj.js +23 -0
- package/dist/Funnel.es-DjKVl8Nj.js.map +1 -0
- package/dist/{MotionConfig-DKKYqBH2.js → MotionConfig-CXHoPGbK.js} +2 -2
- package/dist/{MotionConfig-DKKYqBH2.js.map → MotionConfig-CXHoPGbK.js.map} +1 -1
- package/dist/Plus.es-DbyRkEE2.js +23 -0
- package/dist/Plus.es-DbyRkEE2.js.map +1 -0
- package/dist/Trash.es-BFAc8PMf.js +23 -0
- package/dist/Trash.es-BFAc8PMf.js.map +1 -0
- package/dist/{calendar-PCCZDUIL.js → calendar-DEPkz8sw.js} +364 -502
- package/dist/calendar-DEPkz8sw.js.map +1 -0
- package/dist/calendar-header-Dfr-CwkY.js +174 -0
- package/dist/calendar-header-Dfr-CwkY.js.map +1 -0
- package/dist/chunk-jwUa06l-.js +23 -0
- package/dist/components/core/button.d.ts +77 -0
- package/dist/components/core/button.d.ts.map +1 -0
- package/dist/components/core/button.js +1 -1
- package/dist/components/core/button.jsx +79 -0
- package/dist/components/core/heading.d.ts +3 -0
- package/dist/components/core/heading.d.ts.map +1 -0
- package/dist/components/core/heading.js +11 -0
- package/dist/components/core/heading.js.map +1 -0
- package/dist/components/core/heading.jsx +4 -0
- package/dist/components/core/polymorph.d.ts +10 -0
- package/dist/components/core/polymorph.d.ts.map +1 -0
- package/dist/{polymorph-BLXhrn9n.js → components/core/polymorph.js} +2 -2
- package/dist/components/core/polymorph.js.map +1 -0
- package/dist/components/core/polymorph.jsx +5 -0
- package/dist/components/core/render-on-view.d.ts +7 -0
- package/dist/components/core/render-on-view.d.ts.map +1 -0
- package/dist/components/core/render-on-view.js +29 -0
- package/dist/components/core/render-on-view.js.map +1 -0
- package/dist/components/core/render-on-view.jsx +31 -0
- package/dist/components/core/resizable.d.ts +9 -0
- package/dist/components/core/resizable.d.ts.map +1 -0
- package/dist/components/core/resizable.js +60 -0
- package/dist/components/core/resizable.js.map +1 -0
- package/dist/components/core/resizable.jsx +57 -0
- package/dist/components/core/slot.d.ts +16 -0
- package/dist/components/core/slot.d.ts.map +1 -0
- package/dist/{slot-pC8kH9De.js → components/core/slot.js} +2 -2
- package/dist/components/core/slot.js.map +1 -0
- package/dist/components/core/slot.jsx +156 -0
- package/dist/components/core/tag.d.ts +35 -0
- package/dist/components/core/tag.d.ts.map +1 -0
- package/dist/components/core/tag.js +1 -1
- package/dist/components/core/tag.jsx +53 -0
- package/dist/components/core/typography.d.ts +25 -0
- package/dist/components/core/typography.d.ts.map +1 -0
- package/dist/components/core/typography.js +40 -0
- package/dist/components/core/typography.js.map +1 -0
- package/dist/components/core/typography.jsx +20 -0
- package/dist/components/display/alert.d.ts +28 -0
- package/dist/components/display/alert.d.ts.map +1 -0
- package/dist/components/display/alert.js +83 -102
- package/dist/components/display/alert.js.map +1 -1
- package/dist/components/display/alert.jsx +58 -0
- package/dist/components/display/calendar.d.ts +42 -0
- package/dist/components/display/calendar.d.ts.map +1 -0
- package/dist/components/display/calendar.js +1 -1
- package/dist/components/display/calendar.jsx +323 -0
- package/dist/components/display/card.d.ts +29 -0
- package/dist/components/display/card.d.ts.map +1 -0
- package/dist/components/display/card.js +2 -2
- package/dist/components/display/card.jsx +43 -0
- package/dist/components/display/empty.d.ts +8 -0
- package/dist/components/display/empty.d.ts.map +1 -0
- package/dist/components/display/empty.js +25 -0
- package/dist/components/display/empty.js.map +1 -0
- package/dist/components/display/empty.jsx +13 -0
- package/dist/components/display/list.d.ts +16 -0
- package/dist/components/display/list.d.ts.map +1 -0
- package/dist/components/display/list.js +132 -122
- package/dist/components/display/list.js.map +1 -1
- package/dist/components/display/list.jsx +90 -0
- package/dist/components/display/notifications.d.ts +27 -0
- package/dist/components/display/notifications.d.ts.map +1 -0
- package/dist/components/display/notifications.js +1 -1
- package/dist/components/display/notifications.jsx +132 -0
- package/dist/components/display/progress.d.ts +16 -0
- package/dist/components/display/progress.d.ts.map +1 -0
- package/dist/components/display/progress.js +3 -0
- package/dist/components/display/progress.jsx +19 -0
- package/dist/components/display/shortcut.d.ts +4 -0
- package/dist/components/display/shortcut.d.ts.map +1 -0
- package/dist/components/display/shortcut.js +2 -0
- package/dist/components/display/shortcut.jsx +23 -0
- package/dist/components/display/skeleton.d.ts +12 -0
- package/dist/components/display/skeleton.d.ts.map +1 -0
- package/dist/components/display/skeleton.js +41 -0
- package/dist/components/display/skeleton.js.map +1 -0
- package/dist/components/display/skeleton.jsx +19 -0
- package/dist/components/display/spinner.d.ts +5 -0
- package/dist/components/display/spinner.d.ts.map +1 -0
- package/dist/components/display/spinner.js +17 -0
- package/dist/components/display/spinner.js.map +1 -0
- package/dist/components/display/spinner.jsx +11 -0
- package/dist/components/display/stats.d.ts +12 -0
- package/dist/components/display/stats.d.ts.map +1 -0
- package/dist/components/display/stats.jsx +16 -0
- package/dist/components/display/step.d.ts +24 -0
- package/dist/components/display/step.d.ts.map +1 -0
- package/dist/components/display/step.js +3 -0
- package/dist/components/display/step.jsx +145 -0
- package/dist/components/display/tabs.d.ts +24 -0
- package/dist/components/display/tabs.d.ts.map +1 -0
- package/dist/components/display/tabs.js +1 -1
- package/dist/components/display/tabs.jsx +125 -0
- package/dist/components/display/timeline.d.ts +10 -0
- package/dist/components/display/timeline.d.ts.map +1 -0
- package/dist/components/display/timeline.js +1 -1
- package/dist/components/display/timeline.jsx +25 -0
- package/dist/components/floating/command-palette.d.ts +49 -0
- package/dist/components/floating/command-palette.d.ts.map +1 -0
- package/dist/components/floating/command-palette.js +255 -0
- package/dist/components/floating/command-palette.js.map +1 -0
- package/dist/components/floating/command-palette.jsx +232 -0
- package/dist/components/floating/dropdown.d.ts +15 -0
- package/dist/components/floating/dropdown.d.ts.map +1 -0
- package/dist/components/floating/dropdown.js +1 -1
- package/dist/components/floating/dropdown.js.map +1 -1
- package/dist/components/floating/dropdown.jsx +56 -0
- package/dist/components/floating/expand.d.ts +11 -0
- package/dist/components/floating/expand.d.ts.map +1 -0
- package/dist/components/floating/expand.js +15 -14
- package/dist/components/floating/expand.js.map +1 -1
- package/dist/components/floating/expand.jsx +44 -0
- package/dist/components/floating/menu.d.ts +52 -0
- package/dist/components/floating/menu.d.ts.map +1 -0
- package/dist/components/floating/menu.js +1 -1
- package/dist/components/floating/menu.jsx +165 -0
- package/dist/components/floating/modal.d.ts +63 -0
- package/dist/components/floating/modal.d.ts.map +1 -0
- package/dist/components/floating/modal.js +1 -1
- package/dist/components/floating/modal.jsx +375 -0
- package/dist/components/floating/toolbar.d.ts +6 -0
- package/dist/components/floating/toolbar.d.ts.map +1 -0
- package/dist/components/floating/toolbar.js +20 -0
- package/dist/components/floating/toolbar.js.map +1 -0
- package/dist/components/floating/toolbar.jsx +9 -0
- package/dist/components/floating/tooltip.d.ts +17 -0
- package/dist/components/floating/tooltip.d.ts.map +1 -0
- package/dist/components/floating/tooltip.js +2 -2
- package/dist/components/floating/tooltip.js.map +1 -1
- package/dist/components/floating/tooltip.jsx +67 -0
- package/dist/components/floating/wizard.d.ts +26 -0
- package/dist/components/floating/wizard.d.ts.map +1 -0
- package/dist/components/floating/wizard.js +3 -0
- package/dist/components/floating/wizard.jsx +165 -0
- package/dist/components/form/autocomplete.d.ts +16 -0
- package/dist/components/form/autocomplete.d.ts.map +1 -0
- package/dist/components/form/autocomplete.js +344 -2
- package/dist/components/form/autocomplete.js.map +1 -0
- package/dist/components/form/autocomplete.jsx +299 -0
- package/dist/components/form/checkbox.d.ts +12 -0
- package/dist/components/form/checkbox.d.ts.map +1 -0
- package/dist/components/form/checkbox.js +29 -27
- package/dist/components/form/checkbox.js.map +1 -1
- package/dist/components/form/checkbox.jsx +27 -0
- package/dist/components/form/date-picker.d.ts +10 -0
- package/dist/components/form/date-picker.d.ts.map +1 -0
- package/dist/components/form/date-picker.js +1 -1
- package/dist/components/form/date-picker.jsx +115 -0
- package/dist/components/form/file-upload.d.ts +20 -0
- package/dist/components/form/file-upload.d.ts.map +1 -0
- package/dist/components/form/file-upload.js +1 -1
- package/dist/components/form/file-upload.jsx +160 -0
- package/dist/components/form/form.d.ts +3 -0
- package/dist/components/form/form.d.ts.map +1 -0
- package/dist/components/form/form.jsx +10 -0
- package/dist/components/form/formReset.d.ts +2 -0
- package/dist/components/form/formReset.d.ts.map +1 -0
- package/dist/components/form/formReset.js +10 -0
- package/dist/components/form/formReset.js.map +1 -0
- package/dist/components/form/formReset.jsx +17 -0
- package/dist/components/form/free-text.d.ts +11 -0
- package/dist/components/form/free-text.d.ts.map +1 -0
- package/dist/components/form/free-text.js +70 -0
- package/dist/components/form/free-text.js.map +1 -0
- package/dist/components/form/free-text.jsx +41 -0
- package/dist/components/form/input-field.d.ts +34 -0
- package/dist/components/form/input-field.d.ts.map +1 -0
- package/dist/components/form/input-field.js +3 -0
- package/dist/components/form/input-field.jsx +64 -0
- package/dist/components/form/input.d.ts +52 -0
- package/dist/components/form/input.d.ts.map +1 -0
- package/dist/components/form/input.js +1 -1
- package/dist/components/form/input.jsx +36 -0
- package/dist/components/form/multi-select.d.ts +19 -0
- package/dist/components/form/multi-select.d.ts.map +1 -0
- package/dist/components/form/multi-select.js +420 -0
- package/dist/components/form/multi-select.js.map +1 -0
- package/dist/components/form/multi-select.jsx +352 -0
- package/dist/components/form/radiobox.d.ts +7 -0
- package/dist/components/form/radiobox.d.ts.map +1 -0
- package/dist/components/form/radiobox.jsx +6 -0
- package/dist/components/form/select.d.ts +13 -0
- package/dist/components/form/select.d.ts.map +1 -0
- package/dist/components/form/select.js +55 -51
- package/dist/components/form/select.js.map +1 -1
- package/dist/components/form/select.jsx +47 -0
- package/dist/components/form/slider.d.ts +7 -0
- package/dist/components/form/slider.d.ts.map +1 -0
- package/dist/components/form/slider.js +3 -0
- package/dist/components/form/slider.jsx +45 -0
- package/dist/components/form/switch.d.ts +10 -0
- package/dist/components/form/switch.d.ts.map +1 -0
- package/dist/components/form/switch.js +32 -26
- package/dist/components/form/switch.js.map +1 -1
- package/dist/components/form/switch.jsx +59 -0
- package/dist/components/form/task-list.d.ts +3 -0
- package/dist/components/form/task-list.d.ts.map +1 -0
- package/dist/components/form/task-list.jsx +26 -0
- package/dist/components/form/textarea.d.ts +5 -0
- package/dist/components/form/textarea.d.ts.map +1 -0
- package/dist/components/form/textarea.js +19 -0
- package/dist/components/form/textarea.js.map +1 -0
- package/dist/components/form/textarea.jsx +26 -0
- package/dist/components/index.d.ts +45 -0
- package/dist/components/index.d.ts.map +1 -0
- package/dist/components/index.js +44 -0
- package/dist/components/page-calendar/calendar-header.d.ts +16 -0
- package/dist/components/page-calendar/calendar-header.d.ts.map +1 -0
- package/dist/components/page-calendar/calendar-header.js +2 -0
- package/dist/components/page-calendar/calendar-header.jsx +85 -0
- package/dist/components/page-calendar/day-view.d.ts +12 -0
- package/dist/components/page-calendar/day-view.d.ts.map +1 -0
- package/dist/components/page-calendar/day-view.js +124 -0
- package/dist/components/page-calendar/day-view.js.map +1 -0
- package/dist/components/page-calendar/day-view.jsx +89 -0
- package/dist/components/page-calendar/event-pill.d.ts +9 -0
- package/dist/components/page-calendar/event-pill.d.ts.map +1 -0
- package/dist/components/page-calendar/event-pill.js +44 -0
- package/dist/components/page-calendar/event-pill.js.map +1 -0
- package/dist/components/page-calendar/event-pill.jsx +25 -0
- package/dist/components/page-calendar/index.d.ts +4 -0
- package/dist/components/page-calendar/index.d.ts.map +1 -0
- package/dist/components/page-calendar/index.js +2 -0
- package/dist/components/page-calendar/month-view.d.ts +11 -0
- package/dist/components/page-calendar/month-view.d.ts.map +1 -0
- package/dist/components/page-calendar/month-view.js +109 -0
- package/dist/components/page-calendar/month-view.js.map +1 -0
- package/dist/components/page-calendar/month-view.jsx +93 -0
- package/dist/components/page-calendar/page-calendar.d.ts +18 -0
- package/dist/components/page-calendar/page-calendar.d.ts.map +1 -0
- package/dist/components/page-calendar/page-calendar.js +75 -0
- package/dist/components/page-calendar/page-calendar.js.map +1 -0
- package/dist/components/page-calendar/page-calendar.jsx +41 -0
- package/dist/components/page-calendar/page-calendar.types.d.ts +18 -0
- package/dist/components/page-calendar/page-calendar.types.d.ts.map +1 -0
- package/dist/components/page-calendar/page-calendar.types.js +1 -0
- package/dist/components/page-calendar/page-calendar.utils.d.ts +24 -0
- package/dist/components/page-calendar/page-calendar.utils.d.ts.map +1 -0
- package/dist/components/page-calendar/page-calendar.utils.js +93 -0
- package/dist/components/page-calendar/week-view.d.ts +11 -0
- package/dist/components/page-calendar/week-view.d.ts.map +1 -0
- package/dist/components/page-calendar/week-view.js +88 -0
- package/dist/components/page-calendar/week-view.js.map +1 -0
- package/dist/components/page-calendar/week-view.jsx +66 -0
- package/dist/components/table/filter.d.ts +42 -0
- package/dist/components/table/filter.d.ts.map +1 -0
- package/dist/components/table/filter.js +239 -0
- package/dist/components/table/filter.js.map +1 -0
- package/dist/components/table/filter.jsx +174 -0
- package/dist/components/table/group.d.ts +17 -0
- package/dist/components/table/group.d.ts.map +1 -0
- package/dist/components/table/group.js +3 -0
- package/dist/components/table/group.jsx +77 -0
- package/dist/components/table/index.d.ts +19 -0
- package/dist/components/table/index.d.ts.map +1 -0
- package/dist/components/table/index.js +102 -0
- package/dist/components/table/index.js.map +1 -0
- package/dist/components/table/index.jsx +63 -0
- package/dist/components/table/inner-table.d.ts +29 -0
- package/dist/components/table/inner-table.d.ts.map +1 -0
- package/dist/components/table/inner-table.js +2 -0
- package/dist/components/table/inner-table.jsx +102 -0
- package/dist/components/table/metadata.d.ts +4 -0
- package/dist/components/table/metadata.d.ts.map +1 -0
- package/dist/components/table/metadata.js +73 -0
- package/dist/components/table/metadata.js.map +1 -0
- package/dist/components/table/metadata.jsx +36 -0
- package/dist/components/table/pagination.d.ts +5 -0
- package/dist/components/table/pagination.d.ts.map +1 -0
- package/dist/components/table/pagination.js +70 -0
- package/dist/components/table/pagination.js.map +1 -0
- package/dist/components/table/pagination.jsx +74 -0
- package/dist/components/table/row.d.ts +11 -0
- package/dist/components/table/row.d.ts.map +1 -0
- package/dist/components/table/row.js +58 -0
- package/dist/components/table/row.js.map +1 -0
- package/dist/components/table/row.jsx +49 -0
- package/dist/components/table/sort.d.ts +28 -0
- package/dist/components/table/sort.d.ts.map +1 -0
- package/dist/components/table/sort.js +3 -0
- package/dist/components/table/sort.jsx +111 -0
- package/dist/components/table/table-lib.d.ts +135 -0
- package/dist/components/table/table-lib.d.ts.map +1 -0
- package/dist/components/table/table-lib.js +83 -0
- package/dist/components/table/table.context.d.ts +10 -0
- package/dist/components/table/table.context.d.ts.map +1 -0
- package/dist/components/table/table.context.jsx +5 -0
- package/dist/components/table/thead.d.ts +9 -0
- package/dist/components/table/thead.d.ts.map +1 -0
- package/dist/components/table/thead.js +3 -0
- package/dist/components/table/thead.jsx +103 -0
- package/dist/config/context.d.ts +21 -0
- package/dist/config/context.d.ts.map +1 -0
- package/dist/config/context.js +12 -0
- package/dist/config/default-translations.d.ts +112 -0
- package/dist/config/default-translations.d.ts.map +1 -0
- package/dist/config/default-translations.jsx +105 -0
- package/dist/config/default-tweaks.d.ts +13 -0
- package/dist/config/default-tweaks.d.ts.map +1 -0
- package/dist/config/default-tweaks.js +4 -0
- package/dist/constants.d.ts +3 -0
- package/dist/constants.d.ts.map +1 -0
- package/dist/constants.js +2 -0
- package/dist/{use-translations-DTLfPE3_.js → context-CsnUsfeP.js} +55 -40
- package/dist/context-CsnUsfeP.js.map +1 -0
- package/dist/{date-picker-BhKEFZew.js → date-picker-DNzupG8R.js} +301 -317
- package/dist/date-picker-DNzupG8R.js.map +1 -0
- package/dist/dict-CisoYSMO.js +28 -0
- package/dist/dict-CisoYSMO.js.map +1 -0
- package/dist/dist-ChfJ5LO9.js +498 -0
- package/dist/dist-ChfJ5LO9.js.map +1 -0
- package/dist/{dist-BrGpYRaj.js → dist-DIjUECx9.js} +56 -56
- package/dist/{dist-BrGpYRaj.js.map → dist-DIjUECx9.js.map} +1 -1
- package/dist/dom-Bn4wY_Zx.js.map +1 -1
- package/dist/{file-upload-DWbZfeG5.js → file-upload-C2zNnv9n.js} +501 -481
- package/dist/{file-upload-DWbZfeG5.js.map → file-upload-C2zNnv9n.js.map} +1 -1
- package/dist/fzf-CPGDDCoU.js +64 -0
- package/dist/fzf-CPGDDCoU.js.map +1 -0
- package/dist/getISOWeek-EcB4Ebqp.js +72 -0
- package/dist/getISOWeek-EcB4Ebqp.js.map +1 -0
- package/dist/group-Dl14TJXO.js +222 -0
- package/dist/group-Dl14TJXO.js.map +1 -0
- package/dist/hooks/use-click-outside.d.ts +3 -0
- package/dist/hooks/use-click-outside.d.ts.map +1 -0
- package/dist/hooks/use-click-outside.js +17 -0
- package/dist/hooks/use-color-parser.d.ts +2 -0
- package/dist/hooks/use-color-parser.d.ts.map +1 -0
- package/dist/hooks/use-color-parser.js +9 -0
- package/dist/hooks/use-components-provider.d.ts +15 -0
- package/dist/hooks/use-components-provider.d.ts.map +1 -0
- package/dist/hooks/use-components-provider.jsx +22 -0
- package/dist/hooks/use-debounce.d.ts +5 -0
- package/dist/hooks/use-debounce.d.ts.map +1 -0
- package/dist/hooks/use-debounce.js +12 -0
- package/dist/hooks/use-floating-ref.d.ts +2 -0
- package/dist/hooks/use-floating-ref.d.ts.map +1 -0
- package/dist/hooks/use-floating-ref.js +6 -0
- package/dist/hooks/use-form.d.ts +394 -0
- package/dist/hooks/use-form.d.ts.map +1 -0
- package/dist/hooks/use-form.js +563 -0
- package/dist/hooks/use-hover.d.ts +3 -0
- package/dist/hooks/use-hover.d.ts.map +1 -0
- package/dist/hooks/use-hover.js +18 -0
- package/dist/hooks/use-input-id.d.ts +4 -0
- package/dist/hooks/use-input-id.d.ts.map +1 -0
- package/dist/hooks/use-input-id.js +5 -0
- package/dist/hooks/use-is-coarse-device.d.ts +2 -0
- package/dist/hooks/use-is-coarse-device.d.ts.map +1 -0
- package/dist/hooks/use-is-coarse-device.js +12 -0
- package/dist/hooks/use-locale.d.ts +3 -0
- package/dist/hooks/use-locale.d.ts.map +1 -0
- package/dist/hooks/use-locale.js +10 -0
- package/dist/hooks/use-media-query.d.ts +2 -0
- package/dist/hooks/use-media-query.d.ts.map +1 -0
- package/dist/hooks/use-media-query.js +25 -0
- package/dist/hooks/use-on-event.d.ts +4 -0
- package/dist/hooks/use-on-event.d.ts.map +1 -0
- package/dist/hooks/use-on-event.js +10 -0
- package/dist/hooks/use-parent.d.ts +3 -0
- package/dist/hooks/use-parent.d.ts.map +1 -0
- package/dist/hooks/use-parent.js +21 -0
- package/dist/hooks/use-preferences.d.ts +2 -0
- package/dist/hooks/use-preferences.d.ts.map +1 -0
- package/dist/hooks/use-preferences.js +23 -0
- package/dist/hooks/use-previous.d.ts +2 -0
- package/dist/hooks/use-previous.d.ts.map +1 -0
- package/dist/hooks/use-previous.js +9 -0
- package/dist/hooks/use-reactive.d.ts +2 -0
- package/dist/hooks/use-reactive.d.ts.map +1 -0
- package/dist/hooks/use-reactive.js +9 -0
- package/dist/hooks/use-remove-scroll.d.ts +4 -0
- package/dist/hooks/use-remove-scroll.d.ts.map +1 -0
- package/dist/hooks/use-remove-scroll.js +48 -0
- package/dist/hooks/use-resize-observer.d.ts +2 -0
- package/dist/hooks/use-resize-observer.d.ts.map +1 -0
- package/dist/hooks/use-resize-observer.js +17 -0
- package/dist/hooks/use-stable-ref.d.ts +2 -0
- package/dist/hooks/use-stable-ref.d.ts.map +1 -0
- package/dist/hooks/use-stable-ref.js +9 -0
- package/dist/hooks/use-swipe.d.ts +8 -0
- package/dist/hooks/use-swipe.d.ts.map +1 -0
- package/dist/hooks/use-swipe.js +17 -0
- package/dist/hooks/use-translations.d.ts +110 -0
- package/dist/hooks/use-translations.d.ts.map +1 -0
- package/dist/hooks/use-translations.js +9 -0
- package/dist/hooks/use-tweaks.d.ts +3 -0
- package/dist/hooks/use-tweaks.d.ts.map +1 -0
- package/dist/hooks/use-tweaks.js +9 -0
- package/dist/hooks/use-window-size.d.ts +5 -0
- package/dist/hooks/use-window-size.d.ts.map +1 -0
- package/dist/hooks/use-window-size.js +14 -0
- package/dist/index.css +1 -1
- package/dist/index.d.ts +22 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +20 -7932
- package/dist/index.js.map +1 -1
- package/dist/inner-table-CeDX60cL.js +151 -0
- package/dist/inner-table-CeDX60cL.js.map +1 -0
- package/dist/input-Cmyuea4Y.js +412 -0
- package/dist/input-Cmyuea4Y.js.map +1 -0
- package/dist/{input-field-B_whI66Q.js → input-field-ffx1MbHo.js} +29 -16
- package/dist/input-field-ffx1MbHo.js.map +1 -0
- package/dist/isSameMonth-C3lsSwcg.js +10 -0
- package/dist/isSameMonth-C3lsSwcg.js.map +1 -0
- package/dist/isToday-COXfxFui.js +32 -0
- package/dist/isToday-COXfxFui.js.map +1 -0
- package/dist/lib/combi-keys.d.ts +15 -0
- package/dist/lib/combi-keys.d.ts.map +1 -0
- package/dist/lib/combi-keys.js +60 -0
- package/dist/lib/dict.d.ts +9 -0
- package/dist/lib/dict.d.ts.map +1 -0
- package/dist/lib/dict.js +28 -0
- package/dist/lib/dom.d.ts +20 -0
- package/dist/lib/dom.d.ts.map +1 -0
- package/dist/lib/dom.js +185 -0
- package/dist/lib/fns.d.ts +11 -0
- package/dist/lib/fns.d.ts.map +1 -0
- package/dist/lib/fns.js +46 -0
- package/dist/lib/fzf.d.ts +16 -0
- package/dist/lib/fzf.d.ts.map +1 -0
- package/dist/lib/fzf.js +115 -0
- package/dist/lib/keyboard-area.d.ts +16 -0
- package/dist/lib/keyboard-area.d.ts.map +1 -0
- package/dist/lib/keyboard-area.js +14 -0
- package/dist/modal-Df8-6i-o.js +408 -0
- package/dist/modal-Df8-6i-o.js.map +1 -0
- package/dist/notifications-NhCESJUV.js +1697 -0
- package/dist/notifications-NhCESJUV.js.map +1 -0
- package/dist/page-calendar.utils-Bd0PHktL.js +102 -0
- package/dist/page-calendar.utils-Bd0PHktL.js.map +1 -0
- package/dist/preset/preset.tailwind.d.ts.map +1 -1
- package/dist/preset/preset.tailwind.js +6 -7
- package/dist/preset/src/styles/dark.js +1 -1
- package/dist/progress-8LO5gWLp.js +104 -0
- package/dist/progress-8LO5gWLp.js.map +1 -0
- package/dist/{proxy-BcJ_5Dwq.js → proxy-fP2NxmhM.js} +658 -844
- package/dist/proxy-fP2NxmhM.js.map +1 -0
- package/dist/shim-Czv-YhKR.js +93 -0
- package/dist/shim-Czv-YhKR.js.map +1 -0
- package/dist/shortcut-CQCmgmlU.js +100 -0
- package/dist/shortcut-CQCmgmlU.js.map +1 -0
- package/dist/slider-TX9hiHO-.js +1196 -0
- package/dist/slider-TX9hiHO-.js.map +1 -0
- package/dist/sort-DGmiselV.js +195 -0
- package/dist/sort-DGmiselV.js.map +1 -0
- package/dist/step-DFpJ7zCG.js +185 -0
- package/dist/step-DFpJ7zCG.js.map +1 -0
- package/dist/styles/dark.js +1 -1
- package/dist/subMonths-QcCnE3Yh.js +43 -0
- package/dist/subMonths-QcCnE3Yh.js.map +1 -0
- package/dist/table-lib-1bkYSklk.js +174 -0
- package/dist/table-lib-1bkYSklk.js.map +1 -0
- package/dist/{tabs-Ciy0l9OF.js → tabs-Brc963EW.js} +2 -2
- package/dist/{tabs-Ciy0l9OF.js.map → tabs-Brc963EW.js.map} +1 -1
- package/dist/thead-B6WELJZ-.js +211 -0
- package/dist/thead-B6WELJZ-.js.map +1 -0
- package/dist/types.d.ts +26 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +1 -0
- package/dist/use-locale-DPM_sg4s.js +12 -0
- package/dist/use-locale-DPM_sg4s.js.map +1 -0
- package/dist/use-remove-scroll-pAgC09Sq.js +38 -0
- package/dist/use-remove-scroll-pAgC09Sq.js.map +1 -0
- package/dist/use-translations-BE4PuhLm.js +11 -0
- package/dist/use-translations-BE4PuhLm.js.map +1 -0
- package/dist/useAnimationFrame-DnKbaXfi.js +223 -0
- package/dist/useAnimationFrame-DnKbaXfi.js.map +1 -0
- package/dist/valueToPercent-DZc_m1tm.js +43 -0
- package/dist/valueToPercent-DZc_m1tm.js.map +1 -0
- package/dist/visuallyHidden-B7wI86yi.js +303 -0
- package/dist/visuallyHidden-B7wI86yi.js.map +1 -0
- package/dist/with-selector-BFW5n-pb.js +102 -0
- package/dist/with-selector-BFW5n-pb.js.map +1 -0
- package/dist/wizard-7u_qZ-78.js +218 -0
- package/dist/wizard-7u_qZ-78.js.map +1 -0
- package/package.json +19 -11
- package/dist/autocomplete-D3VOTihi.js +0 -415
- package/dist/autocomplete-D3VOTihi.js.map +0 -1
- package/dist/calendar-PCCZDUIL.js.map +0 -1
- package/dist/components/table/table.js +0 -3
- package/dist/date-picker-BhKEFZew.js.map +0 -1
- package/dist/input-B7jqwPG4.js +0 -473
- package/dist/input-B7jqwPG4.js.map +0 -1
- package/dist/input-field-B_whI66Q.js.map +0 -1
- package/dist/modal-Bz-61ays.js +0 -373
- package/dist/modal-Bz-61ays.js.map +0 -1
- package/dist/notifications-MT4XkLov.js +0 -2203
- package/dist/notifications-MT4XkLov.js.map +0 -1
- package/dist/polymorph-BLXhrn9n.js.map +0 -1
- package/dist/proxy-BcJ_5Dwq.js.map +0 -1
- package/dist/skeleton-CBYEq3lM.js +0 -26
- package/dist/skeleton-CBYEq3lM.js.map +0 -1
- package/dist/slot-pC8kH9De.js.map +0 -1
- package/dist/table-CUFbAI2k.js +0 -1914
- package/dist/table-CUFbAI2k.js.map +0 -1
- package/dist/use-translations-DTLfPE3_.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"alert.js","names":[],"sources":["../../../src/components/display/alert.tsx"],"sourcesContent":["\"use client\";\nimport { cva } from \"class-variance-authority\";\nimport {
|
|
1
|
+
{"version":3,"file":"alert.js","names":[],"sources":["../../../src/components/display/alert.tsx"],"sourcesContent":["\"use client\";\nimport { cva } from \"class-variance-authority\";\nimport { HTMLMotionProps, motion, type Transition } from \"motion/react\";\nimport { CheckCircleIcon, InfoIcon, WarningIcon, XIcon } from \"@phosphor-icons/react\";\nimport React, { forwardRef, PropsWithChildren } from \"react\";\nimport { useTranslations } from \"../../hooks/use-translations\";\nimport { css } from \"../../lib/dom\";\nimport { CvaVariants } from \"../../types\";\nimport { Polymorph, PolymorphicProps } from \"../core/polymorph\";\nimport { Resizable } from \"../core/resizable\";\n\nconst transition: Transition = {\n type: \"tween\",\n duration: 0.35,\n ease: [0.04, 0.62, 0.23, 0.98],\n};\n\ntype CollapseProps = HTMLMotionProps<\"section\"> & { open: boolean };\n\nexport const Collapse = (props: PropsWithChildren<CollapseProps>) => (\n <motion.div\n {...(props as unknown as HTMLMotionProps<\"div\">)}\n initial={false}\n animate={{ opacity: props.open ? 1 : 0 }}\n transition={transition}\n aria-hidden={!props.open}\n data-component=\"collapse\"\n className={css(\"aria-hidden:pointer-events-none\", props.className)}\n >\n <Resizable open={props.open} destroyOnUnmount>\n {props.children}\n </Resizable>\n </motion.div>\n);\n\nconst themeVariants = {\n theme: {\n primary: \"bg-alert-primary-bg text-alert-primary-text border-alert-primary-border\",\n danger: \"bg-alert-danger-bg text-alert-danger-text border-alert-danger-border\",\n info: \"bg-alert-info-bg text-alert-info-text border-alert-info-border\",\n success: \"bg-alert-success-bg text-alert-success-text border-alert-success-border\",\n secondary: \"bg-alert-secondary-bg text-alert-secondary-text border-alert-secondary-border\",\n warn: \"bg-alert-warn-bg text-alert-warn-text border-alert-warn-border\",\n neutral: \"bg-transparent border border-card-border text-alert-primary-text\",\n },\n};\n\nconst alertVariants = cva(\"text-typography-sm relative block w-full rounded-alert-radius border p-alert-p\", {\n variants: themeVariants,\n defaultVariants: { theme: \"neutral\" },\n});\n\nexport type AlertProps<T extends React.ElementType = \"div\"> = PolymorphicProps<\n CvaVariants<typeof themeVariants> &\n Partial<{\n open?: boolean;\n container: string;\n Icon: React.ReactElement;\n onClose: (nextState: boolean) => void;\n }>,\n T\n>;\n\nexport const Alert: <T extends React.ElementType = \"div\">(props: AlertProps<T>) => React.ReactNode = forwardRef(function Alert(\n { className, theme, Icon, onClose, open = true, ...props }: AlertProps,\n ref: React.Ref<\"div\">\n) {\n const t = useTranslations();\n const close = () => onClose?.(false);\n const liveRole = theme === \"danger\" || theme === \"warn\" ? \"alert\" : \"status\";\n\n return (\n <div\n data-open={!!open}\n aria-hidden={!open}\n data-component=\"alert\"\n className={css(\"isolate w-full\", open ? \"pointer-events-auto\" : \"pointer-events-none\")}\n >\n <Collapse open={!!open}>\n <Polymorph\n {...props}\n ref={ref}\n role={liveRole}\n data-theme={theme}\n as={props.as || \"div\"}\n className={css(alertVariants({ theme }), className)}\n >\n <div className=\"flex flex-col gap-alert-gap\">\n {onClose !== undefined ? (\n <button\n type=\"button\"\n onClick={close}\n aria-label={t.closeButton}\n className=\"absolute right-alert-close-right top-alert-close-top text-foreground transition-colors duration-300 ease-in-out hover:text-danger\"\n >\n <XIcon size={20} aria-hidden=\"true\" />\n </button>\n ) : null}\n <div className=\"flex items-center gap-alert-gap\">\n {!Icon && theme === \"success\" ? <CheckCircleIcon aria-hidden=\"true\" size={20} /> : null}\n {!Icon && theme === \"info\" ? <InfoIcon aria-hidden=\"true\" size={20} /> : null}\n {!Icon && theme === \"danger\" ? <WarningIcon aria-hidden=\"true\" size={20} /> : null}\n {Icon}\n {props.title ? (\n <h4 className=\"tracking-3 text-typography-lg text-balance font-semibold\">{props.title}</h4>\n ) : (\n <div className=\"w-full\">{props.children}</div>\n )}\n </div>\n {props.title ? <div className=\"w-full\">{props.children}</div> : null}\n </div>\n </Polymorph>\n </Collapse>\n </div>\n );\n}) as never;\n"],"mappings":";;;;;;;;;;;;;;AAWA,IAAM,IAAyB;CAC3B,MAAM;CACN,UAAU;CACV,MAAM;EAAC;EAAM;EAAM;EAAM;CAAI;AACjC,GAIa,KAAY,MACrB,kBAAC,EAAO,KAAR;CACI,GAAK;CACL,SAAS;CACT,SAAS,EAAE,SAAS,KAAM,KAAa;CAC3B;CACZ,eAAa,CAAC,EAAM;CACpB,kBAAe;CACf,WAAW,EAAI,mCAAmC,EAAM,SAAS;WAEjE,kBAAC,GAAD;EAAW,MAAM,EAAM;EAAM,kBAAA;YACxB,EAAM;CACA,CAAA;AACH,CAAA,GAeV,IAAgB,EAAI,kFAAkF;CACxG,UAAU,EAZV,OAAO;EACH,SAAS;EACT,QAAQ;EACR,MAAM;EACN,SAAS;EACT,WAAW;EACX,MAAM;EACN,SAAS;CACb,EAIU;CACV,iBAAiB,EAAE,OAAO,UAAU;AACxC,CAAC,GAaY,IAAwF,EAAW,SAC5G,EAAE,cAAW,UAAO,SAAM,YAAS,UAAO,IAAM,GAAG,KACnD,GACF;CACE,IAAM,IAAI,EAAgB,GACpB,UAAc,IAAU,EAAK,GAC7B,IAAW,MAAU,YAAY,MAAU,SAAS,UAAU;CAEpE,OACI,kBAAC,OAAD;EACI,aAAW,CAAC,CAAC;EACb,eAAa,CAAC;EACd,kBAAe;EACf,WAAW,EAAI,kBAAkB,IAAO,wBAAwB,qBAAqB;YAErF,kBAAC,GAAD;GAAU,MAAM,CAAC,CAAC;aACd,kBAAC,GAAD;IACI,GAAI;IACC;IACL,MAAM;IACN,cAAY;IACZ,IAAI,EAAM,MAAM;IAChB,WAAW,EAAI,EAAc,EAAE,SAAM,CAAC,GAAG,CAAS;cAElD,kBAAC,OAAD;KAAK,WAAU;eAAf;MACK,MAAY,KAAA,IAST,OARA,kBAAC,UAAD;OACI,MAAK;OACL,SAAS;OACT,cAAY,EAAE;OACd,WAAU;iBAEV,kBAAC,GAAD;QAAO,MAAM;QAAI,eAAY;OAAQ,CAAA;MACjC,CAAA;MAEZ,kBAAC,OAAD;OAAK,WAAU;iBAAf;QACK,CAAC,KAAQ,MAAU,YAAY,kBAAC,GAAD;SAAiB,eAAY;SAAO,MAAM;QAAK,CAAA,IAAI;QAClF,CAAC,KAAQ,MAAU,SAAS,kBAAC,GAAD;SAAU,eAAY;SAAO,MAAM;QAAK,CAAA,IAAI;QACxE,CAAC,KAAQ,MAAU,WAAW,kBAAC,GAAD;SAAa,eAAY;SAAO,MAAM;QAAK,CAAA,IAAI;QAC7E;QACA,EAAM,QACH,kBAAC,MAAD;SAAI,WAAU;mBAA4D,EAAM;QAAU,CAAA,IAE1F,kBAAC,OAAD;SAAK,WAAU;mBAAU,EAAM;QAAc,CAAA;OAEhD;;MACJ,EAAM,QAAQ,kBAAC,OAAD;OAAK,WAAU;iBAAU,EAAM;MAAc,CAAA,IAAI;KAC/D;;GACE,CAAA;EACL,CAAA;CACT,CAAA;AAEb,CAAC"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { cva } from "class-variance-authority";
|
|
3
|
+
import { 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
|
+
import { Resizable } from "../core/resizable";
|
|
10
|
+
const transition = {
|
|
11
|
+
type: "tween",
|
|
12
|
+
duration: 0.35,
|
|
13
|
+
ease: [0.04, 0.62, 0.23, 0.98],
|
|
14
|
+
};
|
|
15
|
+
export const Collapse = (props) => (<motion.div {...props} initial={false} animate={{ opacity: props.open ? 1 : 0 }} transition={transition} aria-hidden={!props.open} data-component="collapse" className={css("aria-hidden:pointer-events-none", props.className)}>
|
|
16
|
+
<Resizable open={props.open} destroyOnUnmount>
|
|
17
|
+
{props.children}
|
|
18
|
+
</Resizable>
|
|
19
|
+
</motion.div>);
|
|
20
|
+
const themeVariants = {
|
|
21
|
+
theme: {
|
|
22
|
+
primary: "bg-alert-primary-bg text-alert-primary-text border-alert-primary-border",
|
|
23
|
+
danger: "bg-alert-danger-bg text-alert-danger-text border-alert-danger-border",
|
|
24
|
+
info: "bg-alert-info-bg text-alert-info-text border-alert-info-border",
|
|
25
|
+
success: "bg-alert-success-bg text-alert-success-text border-alert-success-border",
|
|
26
|
+
secondary: "bg-alert-secondary-bg text-alert-secondary-text border-alert-secondary-border",
|
|
27
|
+
warn: "bg-alert-warn-bg text-alert-warn-text border-alert-warn-border",
|
|
28
|
+
neutral: "bg-transparent border border-card-border text-alert-primary-text",
|
|
29
|
+
},
|
|
30
|
+
};
|
|
31
|
+
const alertVariants = cva("text-typography-sm relative block w-full rounded-alert-radius border p-alert-p", {
|
|
32
|
+
variants: themeVariants,
|
|
33
|
+
defaultVariants: { theme: "neutral" },
|
|
34
|
+
});
|
|
35
|
+
export const Alert = forwardRef(function Alert({ className, theme, Icon, onClose, open = true, ...props }, ref) {
|
|
36
|
+
const t = useTranslations();
|
|
37
|
+
const close = () => onClose?.(false);
|
|
38
|
+
const liveRole = theme === "danger" || theme === "warn" ? "alert" : "status";
|
|
39
|
+
return (<div data-open={!!open} aria-hidden={!open} data-component="alert" className={css("isolate w-full", open ? "pointer-events-auto" : "pointer-events-none")}>
|
|
40
|
+
<Collapse open={!!open}>
|
|
41
|
+
<Polymorph {...props} ref={ref} role={liveRole} data-theme={theme} as={props.as || "div"} className={css(alertVariants({ theme }), className)}>
|
|
42
|
+
<div className="flex flex-col gap-alert-gap">
|
|
43
|
+
{onClose !== undefined ? (<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">
|
|
44
|
+
<XIcon size={20} aria-hidden="true"/>
|
|
45
|
+
</button>) : null}
|
|
46
|
+
<div className="flex items-center gap-alert-gap">
|
|
47
|
+
{!Icon && theme === "success" ? <CheckCircleIcon aria-hidden="true" size={20}/> : null}
|
|
48
|
+
{!Icon && theme === "info" ? <InfoIcon aria-hidden="true" size={20}/> : null}
|
|
49
|
+
{!Icon && theme === "danger" ? <WarningIcon aria-hidden="true" size={20}/> : null}
|
|
50
|
+
{Icon}
|
|
51
|
+
{props.title ? (<h4 className="tracking-3 text-typography-lg text-balance font-semibold">{props.title}</h4>) : (<div className="w-full">{props.children}</div>)}
|
|
52
|
+
</div>
|
|
53
|
+
{props.title ? <div className="w-full">{props.children}</div> : null}
|
|
54
|
+
</div>
|
|
55
|
+
</Polymorph>
|
|
56
|
+
</Collapse>
|
|
57
|
+
</div>);
|
|
58
|
+
});
|
|
@@ -0,0 +1,42 @@
|
|
|
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
|
|
@@ -0,0 +1 @@
|
|
|
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;AAwB5D,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;AA6IH,eAAO,MAAM,QAAQ,GAAI,qLAgBtB,aAAa,sBA2Sf,CAAC"}
|
|
@@ -0,0 +1,323 @@
|
|
|
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 createDays = (month) => {
|
|
25
|
+
const start = startOfWeek(startOfMonth(month));
|
|
26
|
+
return eachDayOfInterval({ start, end: add(start, { days: 41 }) });
|
|
27
|
+
};
|
|
28
|
+
const formatMonth = (d, locale) => d.toLocaleDateString(locale, { month: "long" });
|
|
29
|
+
const getOptionsMonth = (id, date, locale) => Array.from({ length: 12 }).map((_, i) => {
|
|
30
|
+
const month = startOfMonth(new Date(1970, i, 1).setMonth(i));
|
|
31
|
+
const label = formatMonth(month, locale);
|
|
32
|
+
return (<option value={label} key={`${id}-${label}`} data-index={i}>
|
|
33
|
+
{label}
|
|
34
|
+
</option>);
|
|
35
|
+
});
|
|
36
|
+
const onChangeUsingKeyboard = {
|
|
37
|
+
ArrowLeft: (date, duration) => (duration === "days" ? sub(date, { days: 1 }) : sub(date, { months: 1 })),
|
|
38
|
+
ArrowRight: (date, duration) => (duration === "days" ? add(date, { days: 1 }) : add(date, { months: 1 })),
|
|
39
|
+
ArrowUp: (date, duration) => (duration === "days" ? sub(date, { weeks: 1 }) : sub(date, { years: 1 })),
|
|
40
|
+
ArrowDown: (date, duration) => (duration === "days" ? add(date, { weeks: 1 }) : add(date, { years: 1 })),
|
|
41
|
+
};
|
|
42
|
+
const focusDate = (origin, root, next, delay = 0) => {
|
|
43
|
+
const d = next.toISOString();
|
|
44
|
+
const select = () => {
|
|
45
|
+
if (origin?.dataset.focustrap) {
|
|
46
|
+
const el = root.current?.querySelector(`button[data-focustrap="${origin?.dataset.focustrap}"]`);
|
|
47
|
+
return setTimeout(() => el?.focus({ preventScroll: true }), delay);
|
|
48
|
+
}
|
|
49
|
+
if (root.current) {
|
|
50
|
+
const element = root.current.querySelector(`button[data-date="${d}"]`);
|
|
51
|
+
if (element)
|
|
52
|
+
return element.focus({ preventScroll: true });
|
|
53
|
+
}
|
|
54
|
+
};
|
|
55
|
+
if (delay === 0)
|
|
56
|
+
select();
|
|
57
|
+
setTimeout(select, delay);
|
|
58
|
+
};
|
|
59
|
+
const formatYear = (now) => now.getFullYear().toString().padStart(4, "0");
|
|
60
|
+
const inRange = (start, middle, end) => {
|
|
61
|
+
if (start === undefined || end === undefined)
|
|
62
|
+
return false;
|
|
63
|
+
return isAfter(middle, start) && isBefore(middle, end);
|
|
64
|
+
};
|
|
65
|
+
const CalendarBody = (props) => {
|
|
66
|
+
const translate = useTranslations();
|
|
67
|
+
return (<motion.tbody layout variants={variants} custom={props.direction} onKeyDown={props.onKeyDown} className={css(props.styles?.week)}>
|
|
68
|
+
{props.zip.map((week, index) => {
|
|
69
|
+
const weekClassName = Is.function(props.styles?.week) ? props.styles?.week(week) : props.styles?.week;
|
|
70
|
+
return (<tr key={`week-${week.length}-${index}`} className={weekClassName}>
|
|
71
|
+
{week.map((day) => {
|
|
72
|
+
const key = day.toISOString();
|
|
73
|
+
const isSelected = props.rangeMode
|
|
74
|
+
? key === props.range?.to?.toISOString() || key === props.range?.from?.toISOString()
|
|
75
|
+
: key === (props.date ? startOfDay(props.date).toISOString() : undefined);
|
|
76
|
+
const today = isToday(day) && props.markToday;
|
|
77
|
+
const disabledByFn = props.disabledDate?.(day) || false;
|
|
78
|
+
const sameMonth = isSameMonth(day, props.stateDate);
|
|
79
|
+
const disableDate = !sameMonth || disabledByFn;
|
|
80
|
+
const isInRange = props.rangeMode ? inRange(props.range?.from, day, props.range?.to) : false;
|
|
81
|
+
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)}>
|
|
82
|
+
<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)}>
|
|
83
|
+
<div></div>
|
|
84
|
+
{day.getDate()}
|
|
85
|
+
{isSelected && props.stateRange.from?.toISOString() === key ? (<span className="absolute -top-2 left-0 h-full w-full">
|
|
86
|
+
<span className="text-calendar-cell-text text-foreground">
|
|
87
|
+
{props.labelRange?.from ?? translate.calendarFromDate}
|
|
88
|
+
</span>
|
|
89
|
+
</span>) : null}
|
|
90
|
+
{isSelected && props.stateRange.to?.toISOString() === key ? (<span className="absolute -top-2 left-0 h-full w-full">
|
|
91
|
+
<span className="text-calendar-cell-text text-foreground">
|
|
92
|
+
{props.labelRange?.to ?? translate.calendarToDate}
|
|
93
|
+
</span>
|
|
94
|
+
</span>) : null}
|
|
95
|
+
</button>
|
|
96
|
+
{props.RenderOnDay ? <props.RenderOnDay date={day}/> : null}
|
|
97
|
+
</td>);
|
|
98
|
+
})}
|
|
99
|
+
</tr>);
|
|
100
|
+
})}
|
|
101
|
+
</motion.tbody>);
|
|
102
|
+
};
|
|
103
|
+
const getToday = () => startOfDay(new Date());
|
|
104
|
+
export const Calendar = ({ RenderOnDay, changeOnlyOnClick = false, labelRange, disabledDate, locale, markToday = true, onChangeMonth, onChangeYear, rangeMode = false, onChange, styles, markRange = true, type = "date", datetimeTitle, ...props }) => {
|
|
105
|
+
const id = useRef(uuid());
|
|
106
|
+
const translations = useTranslations();
|
|
107
|
+
const currentLocale = useLocale(locale);
|
|
108
|
+
const root = useRef(null);
|
|
109
|
+
const { date, range } = props;
|
|
110
|
+
const providedDate = date || new Date();
|
|
111
|
+
const monthClicked = useRef(null);
|
|
112
|
+
const [state, dispatch] = useReducer({
|
|
113
|
+
date: providedDate,
|
|
114
|
+
isAnimating: false,
|
|
115
|
+
year: formatYear(providedDate),
|
|
116
|
+
direction: undefined,
|
|
117
|
+
range: { from: range?.from, to: range?.to },
|
|
118
|
+
months: getOptionsMonth(id.current, providedDate, currentLocale),
|
|
119
|
+
selectMode: (rangeMode ? "from" : undefined),
|
|
120
|
+
week: eachDayOfInterval({
|
|
121
|
+
start: startOfWeek(providedDate),
|
|
122
|
+
end: endOfWeek(providedDate),
|
|
123
|
+
}),
|
|
124
|
+
}, (get) => ({
|
|
125
|
+
onChangeYear: (year) => ({ year }),
|
|
126
|
+
onExitComplete: () => {
|
|
127
|
+
focusDate(monthClicked.current || null, root, get.state().date, 200);
|
|
128
|
+
monthClicked.current = null;
|
|
129
|
+
return { isAnimating: false };
|
|
130
|
+
},
|
|
131
|
+
date: (callback) => {
|
|
132
|
+
const newDate = callback(get.state().date);
|
|
133
|
+
return { date: newDate, year: formatYear(newDate) };
|
|
134
|
+
},
|
|
135
|
+
nextMonth: (e) => {
|
|
136
|
+
if (e)
|
|
137
|
+
monthClicked.current = e.currentTarget;
|
|
138
|
+
const state = get.state();
|
|
139
|
+
if (state.isAnimating)
|
|
140
|
+
return state;
|
|
141
|
+
const date = add(state.date, { months: 1 });
|
|
142
|
+
return {
|
|
143
|
+
date,
|
|
144
|
+
isAnimating: true,
|
|
145
|
+
direction: 1,
|
|
146
|
+
year: formatYear(date),
|
|
147
|
+
};
|
|
148
|
+
},
|
|
149
|
+
previousMonth: (e) => {
|
|
150
|
+
if (e)
|
|
151
|
+
monthClicked.current = e.currentTarget;
|
|
152
|
+
const state = get.state();
|
|
153
|
+
if (state.isAnimating)
|
|
154
|
+
return state;
|
|
155
|
+
const date = sub(state.date, { months: 1 });
|
|
156
|
+
return {
|
|
157
|
+
date,
|
|
158
|
+
isAnimating: true,
|
|
159
|
+
direction: -1,
|
|
160
|
+
year: formatYear(date),
|
|
161
|
+
};
|
|
162
|
+
},
|
|
163
|
+
onSelectDate: (e) => {
|
|
164
|
+
const state = get.state();
|
|
165
|
+
const isRangeMode = e.currentTarget.dataset.range === "true";
|
|
166
|
+
const d = e.currentTarget.dataset.date || "";
|
|
167
|
+
const date = new Date(d);
|
|
168
|
+
return {
|
|
169
|
+
date,
|
|
170
|
+
year: formatYear(date),
|
|
171
|
+
selectMode: state.selectMode === undefined ? undefined : state.selectMode === "from" ? "to" : "from",
|
|
172
|
+
range: !isRangeMode
|
|
173
|
+
? state.range
|
|
174
|
+
: {
|
|
175
|
+
from: state.selectMode === "from" ? date : state.range.from,
|
|
176
|
+
to: state.selectMode === "to" ? date : state.range.to,
|
|
177
|
+
},
|
|
178
|
+
};
|
|
179
|
+
},
|
|
180
|
+
onChangeMonth: (e) => {
|
|
181
|
+
const value = e.target.value;
|
|
182
|
+
const array = Array.from(e.target.options);
|
|
183
|
+
const month = array.find((x) => x.value === value);
|
|
184
|
+
const state = get.state();
|
|
185
|
+
if (month) {
|
|
186
|
+
const i = month.dataset.index || "";
|
|
187
|
+
const d = new Date(get.state().date);
|
|
188
|
+
d.setMonth(+i);
|
|
189
|
+
return { ...state, date: d, year: formatYear(d) };
|
|
190
|
+
}
|
|
191
|
+
return state;
|
|
192
|
+
},
|
|
193
|
+
onKeyDown: (e) => {
|
|
194
|
+
const key = e.key;
|
|
195
|
+
const state = get.state();
|
|
196
|
+
if (key in onChangeUsingKeyboard) {
|
|
197
|
+
if (key === "ArrowUp" || key === "ArrowDown")
|
|
198
|
+
e.preventDefault();
|
|
199
|
+
const prev = get.state().date;
|
|
200
|
+
const date = Is.keyof(onChangeUsingKeyboard, key) ? onChangeUsingKeyboard[key](prev, e.shiftKey ? "month" : "days") : null;
|
|
201
|
+
if (date !== null) {
|
|
202
|
+
focusDate(e.target, root, date);
|
|
203
|
+
return { ...state, date, year: formatYear(date) };
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
return get.state();
|
|
207
|
+
},
|
|
208
|
+
}), {
|
|
209
|
+
props: { onChangeMonth, onChangeYear },
|
|
210
|
+
postMiddleware: [
|
|
211
|
+
(state, _, args) => {
|
|
212
|
+
const isValidMethod = args.method === "onChangeMonth" || args.method === "previousMonth" || args.method === "nextMonth";
|
|
213
|
+
if (isValidMethod)
|
|
214
|
+
args.props.onChangeMonth?.(state.date);
|
|
215
|
+
return state;
|
|
216
|
+
},
|
|
217
|
+
(state, _, args) => {
|
|
218
|
+
const isValidMethod = args.method === "onChangeYear";
|
|
219
|
+
if (isValidMethod)
|
|
220
|
+
args.props.onChangeYear?.(state.date);
|
|
221
|
+
return state;
|
|
222
|
+
},
|
|
223
|
+
(state, _, args) => {
|
|
224
|
+
const isValidMethod = args.method === "onSelectDate" || args.method === "setToday" || args.method === "onKeyDown";
|
|
225
|
+
if (rangeMode && isValidMethod && changeOnlyOnClick) {
|
|
226
|
+
onChange?.(state.range);
|
|
227
|
+
return state;
|
|
228
|
+
}
|
|
229
|
+
if (isValidMethod && changeOnlyOnClick)
|
|
230
|
+
onChange?.(state.date);
|
|
231
|
+
return state;
|
|
232
|
+
},
|
|
233
|
+
],
|
|
234
|
+
});
|
|
235
|
+
const allDaysOfMonth = createDays(state.date);
|
|
236
|
+
const zip = splitInto(allDaysOfMonth, 7);
|
|
237
|
+
const currentAsString = state.date.toISOString();
|
|
238
|
+
const monthString = formatMonth(state.date, currentLocale);
|
|
239
|
+
useEffect(() => {
|
|
240
|
+
if (!changeOnlyOnClick)
|
|
241
|
+
onChange?.(state.date);
|
|
242
|
+
}, [currentAsString, changeOnlyOnClick, state.date, onChange]);
|
|
243
|
+
const defer = useDebounce((y) => dispatch.date((prev) => setYear(new Date(prev), +y)), 1200);
|
|
244
|
+
const internalOnChangeYear = (e) => {
|
|
245
|
+
const value = e.currentTarget.value;
|
|
246
|
+
dispatch.onChangeYear(value);
|
|
247
|
+
onChangeYear?.(new Date(value));
|
|
248
|
+
defer(value);
|
|
249
|
+
};
|
|
250
|
+
const swipe = useSwipe((event, direction) => {
|
|
251
|
+
event.preventDefault();
|
|
252
|
+
return direction === "right" ? dispatch.previousMonth() : dispatch.nextMonth();
|
|
253
|
+
}, 10);
|
|
254
|
+
const onSetToday = () => {
|
|
255
|
+
const d = getToday();
|
|
256
|
+
dispatch.date(() => d);
|
|
257
|
+
onChange?.(d);
|
|
258
|
+
};
|
|
259
|
+
return (<MotionConfig transition={transition}>
|
|
260
|
+
<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)}>
|
|
261
|
+
<div className="flex flex-col justify-center rounded-calendar-header-radius text-center">
|
|
262
|
+
<AnimatePresence initial={false} mode="popLayout" custom={state.direction} onExitComplete={dispatch.onExitComplete}>
|
|
263
|
+
<motion.div key={monthString} initial="enter" animate="middle" exit="exit">
|
|
264
|
+
<header className="relative grid grid-cols-7 items-center">
|
|
265
|
+
<button type="button" data-focustrap="prev" onClick={dispatch.previousMonth} title={translations.calendarBackMonth} className="z-calendar col-start-1 justify-self-center rounded-full p-calendar-nav-p hover:text-primary">
|
|
266
|
+
<span className="inline-flex size-calendar-icon-size items-center justify-center">
|
|
267
|
+
<CaretLeftIcon aria-hidden="true"/>
|
|
268
|
+
</span>
|
|
269
|
+
</button>
|
|
270
|
+
<motion.span layout variants={variants} custom={state.direction} className="absolute inset-0 isolate z-normal flex items-center justify-center font-semibold">
|
|
271
|
+
<span className="flex w-fit items-center justify-center gap-calendar-nav-gap py-calendar-nav-py">
|
|
272
|
+
<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">
|
|
273
|
+
{state.months}
|
|
274
|
+
</select>
|
|
275
|
+
<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"/>
|
|
276
|
+
</span>
|
|
277
|
+
</motion.span>
|
|
278
|
+
<button type="button" data-focustrap="next" onClick={dispatch.nextMonth} title={translations.calendarNextMonth} className="z-calendar col-start-7 justify-self-center rounded-full p-calendar-nav-p hover:text-primary">
|
|
279
|
+
<span className="inline-flex size-calendar-icon-size items-center justify-center">
|
|
280
|
+
<CaretRightIcon aria-hidden="true"/>
|
|
281
|
+
</span>
|
|
282
|
+
</button>
|
|
283
|
+
</header>
|
|
284
|
+
<motion.table className="mt-calendar-table-mt table min-w-full table-auto border-0">
|
|
285
|
+
<thead>
|
|
286
|
+
<tr>
|
|
287
|
+
{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)}>
|
|
288
|
+
{dayOfWeek.toLocaleDateString(currentLocale, {
|
|
289
|
+
weekday: "short",
|
|
290
|
+
})}
|
|
291
|
+
</th>))}
|
|
292
|
+
</tr>
|
|
293
|
+
</thead>
|
|
294
|
+
<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}/>
|
|
295
|
+
</motion.table>
|
|
296
|
+
</motion.div>
|
|
297
|
+
</AnimatePresence>
|
|
298
|
+
</div>
|
|
299
|
+
{type === "datetime" ? (<section className="my-calendar-datetime-my grid items-center">
|
|
300
|
+
<Input info={null} mask="time" optionalText=" " container="w-full" reportStatus={false} defaultValue={date ? format(date, "HH:mm") : undefined} title={datetimeTitle || translations.calendarDatetimeTitle} onChange={(e) => {
|
|
301
|
+
const value = e.target.value;
|
|
302
|
+
const match = timeRegex.exec(value);
|
|
303
|
+
if (!match)
|
|
304
|
+
return;
|
|
305
|
+
const hour = match.groups.hour;
|
|
306
|
+
const min = match.groups.min;
|
|
307
|
+
const d = set(state.date, {
|
|
308
|
+
hours: Number(hour),
|
|
309
|
+
minutes: Number(min),
|
|
310
|
+
seconds: 0,
|
|
311
|
+
});
|
|
312
|
+
dispatch.date(() => d);
|
|
313
|
+
onChange?.(d);
|
|
314
|
+
}}/>
|
|
315
|
+
</section>) : null}
|
|
316
|
+
<footer className="mt-calendar-footer-mt text-center text-primary">
|
|
317
|
+
<button type="button" onClick={onSetToday} className="transition-transform duration-300 hover:scale-105">
|
|
318
|
+
{translations.calendarToday}
|
|
319
|
+
</button>
|
|
320
|
+
</footer>
|
|
321
|
+
</div>
|
|
322
|
+
</MotionConfig>);
|
|
323
|
+
};
|
|
@@ -0,0 +1,29 @@
|
|
|
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
|
|
@@ -0,0 +1 @@
|
|
|
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,7 +1,7 @@
|
|
|
1
1
|
import { p as e, t } from "../../dom-Bn4wY_Zx.js";
|
|
2
|
-
import {
|
|
2
|
+
import { Polymorph as n } from "../core/polymorph.js";
|
|
3
3
|
import { t as r } from "../../Info.es-Dvln8pws.js";
|
|
4
|
-
import {
|
|
4
|
+
import { Skeleton as i } from "./skeleton.js";
|
|
5
5
|
import "react";
|
|
6
6
|
import { jsx as a, jsxs as o } from "react/jsx-runtime";
|
|
7
7
|
//#region src/components/display/card.tsx
|
|
@@ -0,0 +1,43 @@
|
|
|
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
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
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,sBAWtC,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { t as e } from "../../File.es-CjNVQ00B.js";
|
|
2
|
+
import { t } from "../../use-translations-BE4PuhLm.js";
|
|
3
|
+
import "react";
|
|
4
|
+
import { jsx as n, jsxs as r } from "react/jsx-runtime";
|
|
5
|
+
//#region src/components/display/empty.tsx
|
|
6
|
+
var i = (i) => {
|
|
7
|
+
let a = i.Icon ?? e, o = t();
|
|
8
|
+
return /* @__PURE__ */ r("div", {
|
|
9
|
+
className: "flex w-full flex-col items-center justify-center gap-empty-gap px-empty-px py-empty-py",
|
|
10
|
+
children: [/* @__PURE__ */ n("span", {
|
|
11
|
+
className: "text-disabled",
|
|
12
|
+
children: /* @__PURE__ */ n(a, {
|
|
13
|
+
size: 64,
|
|
14
|
+
"aria-hidden": "true"
|
|
15
|
+
})
|
|
16
|
+
}), /* @__PURE__ */ n("p", {
|
|
17
|
+
className: "text-disabled",
|
|
18
|
+
children: i.message ?? o.emptyDataMessage
|
|
19
|
+
})]
|
|
20
|
+
});
|
|
21
|
+
};
|
|
22
|
+
//#endregion
|
|
23
|
+
export { i as Empty };
|
|
24
|
+
|
|
25
|
+
//# sourceMappingURL=empty.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"empty.js","names":[],"sources":["../../../src/components/display/empty.tsx"],"sourcesContent":["import { FileIcon, type Icon } from \"@phosphor-icons/react\";\nimport React from \"react\";\nimport { useTranslations } from \"../../hooks/use-translations\";\n\nexport type EmptyProps = { Icon?: Icon; message?: string };\n\nexport const Empty = (props: EmptyProps) => {\n const Icon = props.Icon ?? FileIcon;\n const translate = useTranslations();\n return (\n <div className=\"flex w-full flex-col items-center justify-center gap-empty-gap px-empty-px py-empty-py\">\n <span className=\"text-disabled\">\n <Icon size={64} aria-hidden=\"true\" />\n </span>\n <p className=\"text-disabled\">{props.message ?? translate.emptyDataMessage}</p>\n </div>\n );\n};\n"],"mappings":";;;;;AAMA,IAAa,KAAS,MAAsB;CACxC,IAAM,IAAO,EAAM,QAAQ,GACrB,IAAY,EAAgB;CAClC,OACI,kBAAC,OAAD;EAAK,WAAU;YAAf,CACI,kBAAC,QAAD;GAAM,WAAU;aACZ,kBAAC,GAAD;IAAM,MAAM;IAAI,eAAY;GAAQ,CAAA;EAClC,CAAA,GACN,kBAAC,KAAD;GAAG,WAAU;aAAiB,EAAM,WAAW,EAAU;EAAoB,CAAA,CAC5E;;AAEb"}
|
|
@@ -0,0 +1,13 @@
|
|
|
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
|
+
<span className="text-disabled">
|
|
9
|
+
<Icon size={64} aria-hidden="true"/>
|
|
10
|
+
</span>
|
|
11
|
+
<p className="text-disabled">{props.message ?? translate.emptyDataMessage}</p>
|
|
12
|
+
</div>);
|
|
13
|
+
};
|