@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
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"calendar-header-Dfr-CwkY.js","names":["s","t"],"sources":["../../../node_modules/.pnpm/@phosphor-icons+react@2.1.10_react-dom@19.2.3_react@19.2.3__react@19.2.3/node_modules/@phosphor-icons/react/dist/defs/PlusCircle.es.js","../../../node_modules/.pnpm/@phosphor-icons+react@2.1.10_react-dom@19.2.3_react@19.2.3__react@19.2.3/node_modules/@phosphor-icons/react/dist/csr/PlusCircle.es.js","../../../node_modules/.pnpm/date-fns@4.3.0/node_modules/date-fns/addWeeks.js","../../../node_modules/.pnpm/date-fns@4.3.0/node_modules/date-fns/subWeeks.js","../src/components/page-calendar/calendar-header.tsx"],"sourcesContent":["import * as e from \"react\";\nconst a = /* @__PURE__ */ new Map([\n [\n \"bold\",\n /* @__PURE__ */ e.createElement(e.Fragment, null, /* @__PURE__ */ e.createElement(\"path\", { d: \"M128,20A108,108,0,1,0,236,128,108.12,108.12,0,0,0,128,20Zm0,192a84,84,0,1,1,84-84A84.09,84.09,0,0,1,128,212Zm52-84a12,12,0,0,1-12,12H140v28a12,12,0,0,1-24,0V140H88a12,12,0,0,1,0-24h28V88a12,12,0,0,1,24,0v28h28A12,12,0,0,1,180,128Z\" }))\n ],\n [\n \"duotone\",\n /* @__PURE__ */ e.createElement(e.Fragment, null, /* @__PURE__ */ e.createElement(\"path\", { d: \"M224,128a96,96,0,1,1-96-96A96,96,0,0,1,224,128Z\", opacity: \"0.2\" }), /* @__PURE__ */ e.createElement(\"path\", { d: \"M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm0,192a88,88,0,1,1,88-88A88.1,88.1,0,0,1,128,216Zm48-88a8,8,0,0,1-8,8H136v32a8,8,0,0,1-16,0V136H88a8,8,0,0,1,0-16h32V88a8,8,0,0,1,16,0v32h32A8,8,0,0,1,176,128Z\" }))\n ],\n [\n \"fill\",\n /* @__PURE__ */ e.createElement(e.Fragment, null, /* @__PURE__ */ e.createElement(\"path\", { d: \"M128,24A104,104,0,1,0,232,128,104.13,104.13,0,0,0,128,24Zm40,112H136v32a8,8,0,0,1-16,0V136H88a8,8,0,0,1,0-16h32V88a8,8,0,0,1,16,0v32h32a8,8,0,0,1,0,16Z\" }))\n ],\n [\n \"light\",\n /* @__PURE__ */ e.createElement(e.Fragment, null, /* @__PURE__ */ e.createElement(\"path\", { d: \"M128,26A102,102,0,1,0,230,128,102.12,102.12,0,0,0,128,26Zm0,192a90,90,0,1,1,90-90A90.1,90.1,0,0,1,128,218Zm46-90a6,6,0,0,1-6,6H134v34a6,6,0,0,1-12,0V134H88a6,6,0,0,1,0-12h34V88a6,6,0,0,1,12,0v34h34A6,6,0,0,1,174,128Z\" }))\n ],\n [\n \"regular\",\n /* @__PURE__ */ e.createElement(e.Fragment, null, /* @__PURE__ */ e.createElement(\"path\", { d: \"M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm0,192a88,88,0,1,1,88-88A88.1,88.1,0,0,1,128,216Zm48-88a8,8,0,0,1-8,8H136v32a8,8,0,0,1-16,0V136H88a8,8,0,0,1,0-16h32V88a8,8,0,0,1,16,0v32h32A8,8,0,0,1,176,128Z\" }))\n ],\n [\n \"thin\",\n /* @__PURE__ */ e.createElement(e.Fragment, null, /* @__PURE__ */ e.createElement(\"path\", { d: \"M128,28A100,100,0,1,0,228,128,100.11,100.11,0,0,0,128,28Zm0,192a92,92,0,1,1,92-92A92.1,92.1,0,0,1,128,220Zm44-92a4,4,0,0,1-4,4H132v36a4,4,0,0,1-8,0V132H88a4,4,0,0,1,0-8h36V88a4,4,0,0,1,8,0v36h36A4,4,0,0,1,172,128Z\" }))\n ]\n]);\nexport {\n a as default\n};\n","import * as e from \"react\";\nimport s from \"../lib/IconBase.es.js\";\nimport t from \"../defs/PlusCircle.es.js\";\nconst o = e.forwardRef((r, c) => /* @__PURE__ */ e.createElement(s, { ref: c, ...r, weights: t }));\no.displayName = \"PlusCircleIcon\";\nconst l = o;\nexport {\n l as PlusCircle,\n o as PlusCircleIcon\n};\n","import { addDays } from \"./addDays.js\";\n\n/**\n * The {@link addWeeks} function options.\n */\n\n/**\n * @name addWeeks\n * @category Week Helpers\n * @summary Add the specified number of weeks to the given date.\n *\n * @description\n * Add the specified number of weeks to the given date.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.\n *\n * @param date - The date to be changed\n * @param amount - The amount of weeks to be added.\n * @param options - An object with options\n *\n * @returns The new date with the weeks added\n *\n * @example\n * // Add 4 weeks to 1 September 2014:\n * const result = addWeeks(new Date(2014, 8, 1), 4)\n * //=> Mon Sep 29 2014 00:00:00\n */\nexport function addWeeks(date, amount, options) {\n return addDays(date, amount * 7, options);\n}\n\n// Fallback for modularized imports:\nexport default addWeeks;\n","import { addWeeks } from \"./addWeeks.js\";\n\n/**\n * The {@link subWeeks} function options.\n */\n\n/**\n * @name subWeeks\n * @category Week Helpers\n * @summary Subtract the specified number of weeks from the given date.\n *\n * @description\n * Subtract the specified number of weeks from the given date.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.\n *\n * @param date - The date to be changed\n * @param amount - The amount of weeks to be subtracted.\n * @param options - An object with options\n *\n * @returns The new date with the weeks subtracted\n *\n * @example\n * // Subtract 4 weeks from 1 September 2014:\n * const result = subWeeks(new Date(2014, 8, 1), 4)\n * //=> Mon Aug 04 2014 00:00:00\n */\nexport function subWeeks(date, amount, options) {\n return addWeeks(date, -amount, options);\n}\n\n// Fallback for modularized imports:\nexport default subWeeks;\n","import { Button } from \"../core/button\";\nimport { Tag } from \"../core/tag\";\nimport { useLocale } from \"../../hooks/use-locale\";\nimport { useTranslations } from \"../../hooks/use-translations\";\nimport { CaretLeftIcon, CaretRightIcon, PlusCircleIcon, CalendarIcon } from \"@phosphor-icons/react\";\nimport { addDays, addMonths, addWeeks, isToday, subDays, subMonths, subWeeks } from \"date-fns\";\nimport type { CalendarFilter, ViewMode } from \"./page-calendar.types\";\nimport { formatDay, formatMonthShort, formatMonthYear, getWeekNumber } from \"./page-calendar.utils\";\nimport type { SetState } from \"../../types\";\nimport { useMemo, type ReactNode } from \"react\";\n\ntype CalendarHeaderProps = {\n currentDate: Date;\n currentView: ViewMode;\n onAddEvent?: () => void;\n filters: CalendarFilter[];\n filterArea?: ReactNode;\n setCurrentDate: SetState<Date>;\n setCurrentView: SetState<ViewMode>;\n onToggleFilter: (id: string) => void;\n};\n\nexport function CalendarHeader({\n currentDate,\n currentView,\n filters,\n filterArea,\n setCurrentDate,\n setCurrentView,\n onToggleFilter,\n onAddEvent,\n}: CalendarHeaderProps) {\n const locale = useLocale();\n const t = useTranslations();\n const isDateToday = isToday(currentDate);\n\n const VIEWS = useMemo(\n () => [\n { value: \"month\" as ViewMode, label: t.pageCalendarMonthView },\n { value: \"week\" as ViewMode, label: t.pageCalendarWeekView },\n { value: \"day\" as ViewMode, label: t.pageCalendarDayView },\n ],\n [t]\n );\n\n const handlePrev = () => {\n setCurrentDate((currentDate) => {\n if (currentView === \"month\") return subMonths(currentDate, 1);\n if (currentView === \"week\") return subWeeks(currentDate, 1);\n return subDays(currentDate, 1);\n });\n };\n\n const handleNext = () => {\n setCurrentDate((currentDate) => {\n if (currentView === \"month\") return addMonths(currentDate, 1);\n if (currentView === \"week\") return addWeeks(currentDate, 1);\n return addDays(currentDate, 1);\n });\n };\n\n const weekNum = getWeekNumber(currentDate);\n\n return (\n <header className=\"flex flex-col gap-page-calendar-header-gap\">\n <div className=\"flex items-center justify-between gap-page-calendar-header-gap\">\n <div className=\"flex items-center gap-page-calendar-date-gap\">\n <div\n aria-hidden=\"true\"\n className={`flex size-page-calendar-badge-size flex-col items-center justify-center overflow-hidden rounded-page-calendar-badge-radius text-page-calendar-week-label-text ${isDateToday ? \"bg-primary text-primary-foreground\" : \"bg-card text-foreground\"}`}\n >\n <span className=\"font-light uppercase leading-none\">{formatMonthShort(currentDate, locale)}</span>\n <span className=\"text-page-calendar-title-text font-medium leading-none\">{formatDay(currentDate, locale)}</span>\n </div>\n <div>\n <h1 aria-live=\"polite\" aria-atomic=\"true\" className=\"text-page-calendar-title-text font-bold leading-tight\">\n {formatMonthYear(currentDate, locale)}\n </h1>\n <span className=\"text-page-calendar-week-label-text text-muted-foreground\">{t.pageCalendarWeekLabel(weekNum)}</span>\n </div>\n </div>\n <nav aria-label={t.pageCalendarNavigation} className=\"flex items-center gap-page-calendar-nav-gap\">\n <div className=\"flex items-center gap-page-calendar-nav-btn-gap\">\n <Button\n size=\"small\"\n title={t.pageCalendarPrevious}\n aria-label={t.pageCalendarPrevious}\n theme=\"ghost-muted\"\n onClick={handlePrev}\n >\n <CaretLeftIcon size={16} />\n </Button>\n <button\n type=\"button\"\n aria-label={t.pageCalendarToday}\n onClick={() => setCurrentDate(new Date())}\n className=\"rounded-page-calendar-today-radius px-page-calendar-today-px py-page-calendar-today-py text-page-calendar-today-text transition-colors hover:bg-muted/50\"\n >\n {t.pageCalendarToday}\n </button>\n <Button size=\"small\" title={t.pageCalendarNext} aria-label={t.pageCalendarNext} theme=\"ghost-muted\" onClick={handleNext}>\n <CaretRightIcon size={16} />\n </Button>\n </div>\n <div className=\"flex rounded-page-calendar-view-switch-radius\">\n {VIEWS.map((v) => (\n <Button\n size=\"small\"\n key={v.value}\n rounded=\"squared\"\n onClick={() => setCurrentView(v.value)}\n theme={currentView === v.value ? \"primary\" : \"muted\"}\n aria-pressed={currentView === v.value}\n className=\"first:rounded-l-button-radius last:rounded-r-button-radius\"\n >\n {v.label}\n </Button>\n ))}\n </div>\n {onAddEvent && (\n <Button theme=\"primary\" size=\"small\" onClick={onAddEvent}>\n <PlusCircleIcon size={14} />\n {t.pageCalendarAddEvent}\n </Button>\n )}\n </nav>\n </div>\n {filterArea ??\n (filters.length > 0 && (\n <div role=\"group\" aria-label={t.pageCalendarFilter} className=\"flex flex-wrap items-center gap-page-calendar-filter-gap\">\n <span className=\"text-muted-foreground\">\n <CalendarIcon size={14} aria-hidden=\"true\" />\n </span>\n <span className=\"mr-page-calendar-nav-mr text-page-calendar-filter-text text-muted-foreground\">{t.pageCalendarFilter}</span>\n {filters.map((filter) => (\n <Tag\n as=\"button\"\n size=\"small\"\n type=\"button\"\n key={filter.id}\n theme={filter.theme}\n indicator={filter.enabled ? filter.theme : undefined}\n aria-pressed={filter.enabled}\n aria-label={`${filter.label}, ${filter.enabled ? t.pageCalendarFilterEnabled : t.pageCalendarFilterDisabled}`}\n onClick={() => onToggleFilter(filter.id)}\n >\n {filter.label}\n </Tag>\n ))}\n </div>\n ))}\n </header>\n );\n}\n"],"x_google_ignoreList":[0,1,2,3],"mappings":";;;;;;;;;;;;;;;AACA,IAAM,oBAAoB,IAAI,IAAI;CAChC,CACE,QACgB,kBAAE,cAAc,EAAE,UAAU,MAAsB,kBAAE,cAAc,QAAQ,EAAE,GAAG,yOAAyO,CAAC,CAAC,CAC5U;CACA,CACE,WACgB,kBAAE,cAAc,EAAE,UAAU,MAAsB,kBAAE,cAAc,QAAQ;EAAE,GAAG;EAAmD,SAAS;CAAM,CAAC,GAAmB,kBAAE,cAAc,QAAQ,EAAE,GAAG,2NAA2N,CAAC,CAAC,CACjb;CACA,CACE,QACgB,kBAAE,cAAc,EAAE,UAAU,MAAsB,kBAAE,cAAc,QAAQ,EAAE,GAAG,0JAA0J,CAAC,CAAC,CAC7P;CACA,CACE,SACgB,kBAAE,cAAc,EAAE,UAAU,MAAsB,kBAAE,cAAc,QAAQ,EAAE,GAAG,2NAA2N,CAAC,CAAC,CAC9T;CACA,CACE,WACgB,kBAAE,cAAc,EAAE,UAAU,MAAsB,kBAAE,cAAc,QAAQ,EAAE,GAAG,2NAA2N,CAAC,CAAC,CAC9T;CACA,CACE,QACgB,kBAAE,cAAc,EAAE,UAAU,MAAsB,kBAAE,cAAc,QAAQ,EAAE,GAAG,wNAAwN,CAAC,CAAC,CAC3T;AACF,CAAC,GCvBK,IAAI,EAAE,YAAY,GAAG,MAAsB,kBAAE,cAAcA,GAAG;CAAE,KAAK;CAAG,GAAG;CAAG,SAASC;AAAE,CAAC,CAAC;AACjG,EAAE,cAAc;;;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ACN,kBAAC,QAAD;KAAM,WAAU;eAAgF,EAAE;IAAyB,CAAA;IAC1H,EAAQ,KAAK,MACV,kBAAC,GAAD;KACI,IAAG;KACH,MAAK;KACL,MAAK;KAEL,OAAO,EAAO;KACd,WAAW,EAAO,UAAU,EAAO,QAAQ,KAAA;KAC3C,gBAAc,EAAO;KACrB,cAAY,GAAG,EAAO,MAAM,IAAI,EAAO,UAAU,EAAE,4BAA4B,EAAE;KACjF,eAAe,EAAe,EAAO,EAAE;eAEtC,EAAO;IACP,GARI,EAAO,EAQX,CACR;GACA;KAET;;AAEhB"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
//#region \0rolldown/runtime.js
|
|
2
|
+
var e = Object.create, t = Object.defineProperty, n = Object.getOwnPropertyDescriptor, r = Object.getOwnPropertyNames, i = Object.getPrototypeOf, a = Object.prototype.hasOwnProperty, o = (e, t) => () => (e && (t = e(e = 0)), t), s = (e, t) => () => (t || (e((t = { exports: {} }).exports, t), e = null), t.exports), c = (e, n) => {
|
|
3
|
+
let r = {};
|
|
4
|
+
for (var i in e) t(r, i, {
|
|
5
|
+
get: e[i],
|
|
6
|
+
enumerable: !0
|
|
7
|
+
});
|
|
8
|
+
return n || t(r, Symbol.toStringTag, { value: "Module" }), r;
|
|
9
|
+
}, l = (e, i, o, s) => {
|
|
10
|
+
if (i && typeof i == "object" || typeof i == "function") for (var c = r(i), l = 0, u = c.length, d; l < u; l++) d = c[l], !a.call(e, d) && d !== o && t(e, d, {
|
|
11
|
+
get: ((e) => i[e]).bind(null, d),
|
|
12
|
+
enumerable: !(s = n(i, d)) || s.enumerable
|
|
13
|
+
});
|
|
14
|
+
return e;
|
|
15
|
+
}, u = (n, r, a) => (a = n == null ? {} : e(i(n)), l(r || !n || !n.__esModule ? t(a, "default", {
|
|
16
|
+
value: n,
|
|
17
|
+
enumerable: !0
|
|
18
|
+
}) : a, n)), d = (e) => a.call(e, "module.exports") ? e["module.exports"] : l(t({}, "__esModule", { value: !0 }), e), f = /* @__PURE__ */ ((e) => typeof require < "u" ? require : typeof Proxy < "u" ? new Proxy(e, { get: (e, t) => (typeof require < "u" ? require : e)[t] }) : e)(function(e) {
|
|
19
|
+
if (typeof require < "u") return require.apply(this, arguments);
|
|
20
|
+
throw Error("Calling `require` for \"" + e + "\" in an environment that doesn't expose the `require` function. See https://rolldown.rs/in-depth/bundling-cjs#require-external-modules for more details.");
|
|
21
|
+
});
|
|
22
|
+
//#endregion
|
|
23
|
+
export { d as a, f as i, o as n, u as o, c as r, s as t };
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import React, { PropsWithChildren } from "react";
|
|
2
|
+
import { CvaVariants, type Label } from "../../types";
|
|
3
|
+
import { PolymorphicProps } from "./polymorph";
|
|
4
|
+
declare const variants: {
|
|
5
|
+
size: {
|
|
6
|
+
icon: string;
|
|
7
|
+
big: string;
|
|
8
|
+
default: string;
|
|
9
|
+
min: string;
|
|
10
|
+
tiny: string;
|
|
11
|
+
small: string;
|
|
12
|
+
};
|
|
13
|
+
rounded: {
|
|
14
|
+
rough: string;
|
|
15
|
+
squared: string;
|
|
16
|
+
default: string;
|
|
17
|
+
circle: string;
|
|
18
|
+
};
|
|
19
|
+
theme: {
|
|
20
|
+
raw: string;
|
|
21
|
+
disabled: string;
|
|
22
|
+
loading: string;
|
|
23
|
+
main: string;
|
|
24
|
+
info: string;
|
|
25
|
+
warn: string;
|
|
26
|
+
muted: string;
|
|
27
|
+
danger: string;
|
|
28
|
+
neutral: string;
|
|
29
|
+
primary: string;
|
|
30
|
+
success: string;
|
|
31
|
+
secondary: string;
|
|
32
|
+
"ghost-info": string;
|
|
33
|
+
"ghost-warn": string;
|
|
34
|
+
"ghost-danger": string;
|
|
35
|
+
"ghost-primary": string;
|
|
36
|
+
"ghost-success": string;
|
|
37
|
+
"ghost-secondary": string;
|
|
38
|
+
"ghost-muted": string;
|
|
39
|
+
"ghost-neutral": string;
|
|
40
|
+
};
|
|
41
|
+
};
|
|
42
|
+
type Variants = CvaVariants<typeof variants>;
|
|
43
|
+
export type ButtonProps<T extends React.ElementType = "button"> = PropsWithChildren<PolymorphicProps<Variants & Partial<{
|
|
44
|
+
/** Icon to display in the button */
|
|
45
|
+
icon: Label;
|
|
46
|
+
/** Whether the button is in a loading state */
|
|
47
|
+
loading: boolean;
|
|
48
|
+
}>, T>>;
|
|
49
|
+
/**
|
|
50
|
+
* A versatile button component with multiple variants, sizes, and states.
|
|
51
|
+
*
|
|
52
|
+
* @example
|
|
53
|
+
* ```tsx
|
|
54
|
+
* // Basic usage
|
|
55
|
+
* <Button>Click me</Button>
|
|
56
|
+
*
|
|
57
|
+
* // With variants
|
|
58
|
+
* <Button theme="primary" size="big">Primary Button</Button>
|
|
59
|
+
*
|
|
60
|
+
* // Loading state
|
|
61
|
+
* <Button loading>Saving...</Button>
|
|
62
|
+
*
|
|
63
|
+
* // With icon
|
|
64
|
+
* <Button icon={<Icon name="plus" />}>Add Item</Button>
|
|
65
|
+
*
|
|
66
|
+
* // As different element
|
|
67
|
+
* <Button as="a" href="/link">Link Button</Button>
|
|
68
|
+
* ```
|
|
69
|
+
*
|
|
70
|
+
* @template T - The HTML element type to render as
|
|
71
|
+
* @param props - Button props including theme, size, loading state, etc.
|
|
72
|
+
* @param ref - Forwarded ref to the button element
|
|
73
|
+
* @returns A styled button component
|
|
74
|
+
*/
|
|
75
|
+
export declare const Button: <T extends React.ElementType = "button">(_: ButtonProps<T>) => React.ReactNode;
|
|
76
|
+
export {};
|
|
77
|
+
//# sourceMappingURL=button.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"button.d.ts","sourceRoot":"","sources":["../../../src/components/core/button.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,EAAc,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAE7D,OAAO,EAAE,WAAW,EAAE,KAAK,KAAK,EAAE,MAAM,aAAa,CAAC;AACtD,OAAO,EAAa,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAE1D,QAAA,MAAM,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAsCb,CAAC;AAUF,KAAK,QAAQ,GAAG,WAAW,CAAC,OAAO,QAAQ,CAAC,CAAC;AAE7C,MAAM,MAAM,WAAW,CAAC,CAAC,SAAS,KAAK,CAAC,WAAW,GAAG,QAAQ,IAAI,iBAAiB,CAC/E,gBAAgB,CACZ,QAAQ,GACJ,OAAO,CAAC;IACJ,oCAAoC;IACpC,IAAI,EAAE,KAAK,CAAC;IACZ,+CAA+C;IAC/C,OAAO,EAAE,OAAO,CAAC;CACpB,CAAC,EACN,CAAC,CACJ,CACJ,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,eAAO,MAAM,MAAM,EAAE,CAAC,CAAC,SAAS,KAAK,CAAC,WAAW,GAAG,QAAQ,EAAE,CAAC,EAAE,WAAW,CAAC,CAAC,CAAC,KAAK,KAAK,CAAC,SAwBK,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { t as e } from "../../dom-Bn4wY_Zx.js";
|
|
2
2
|
import { t } from "../../dist-NmFtbuK4.js";
|
|
3
|
-
import {
|
|
3
|
+
import { Polymorph as n } from "./polymorph.js";
|
|
4
4
|
import { forwardRef as r } from "react";
|
|
5
5
|
import { jsxs as i } from "react/jsx-runtime";
|
|
6
6
|
//#region src/components/core/button.tsx
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { cva } from "class-variance-authority";
|
|
2
|
+
import React, { forwardRef } from "react";
|
|
3
|
+
import { css } from "../../lib/dom";
|
|
4
|
+
import { Polymorph } from "./polymorph";
|
|
5
|
+
const variants = {
|
|
6
|
+
size: {
|
|
7
|
+
icon: "p-button-padding-icon",
|
|
8
|
+
big: "h-button-height-big px-button-padding-x-big py-button-padding-y-big",
|
|
9
|
+
default: "h-button-height px-button-padding-x py-button-padding-y",
|
|
10
|
+
min: "h-button-height-min px-button-padding-x-min py-button-padding-y-min text-typography-sm",
|
|
11
|
+
tiny: "h-button-height-tiny px-button-padding-x-tiny py-button-padding-y-tiny text-typography-sm",
|
|
12
|
+
small: "h-button-height-small px-button-padding-x-small py-button-padding-y-small text-typography-sm",
|
|
13
|
+
},
|
|
14
|
+
rounded: {
|
|
15
|
+
rough: "rounded-button-radius-rough",
|
|
16
|
+
squared: "rounded-button-radius-squared",
|
|
17
|
+
default: "rounded-button-radius",
|
|
18
|
+
circle: "rounded-full aspect-square",
|
|
19
|
+
},
|
|
20
|
+
theme: {
|
|
21
|
+
raw: "",
|
|
22
|
+
disabled: "bg-disabled opacity-70",
|
|
23
|
+
loading: "animate-pulse bg-disabled",
|
|
24
|
+
main: "bg-button-primary-bg text-button-primary-text",
|
|
25
|
+
info: "bg-button-info-bg text-button-info-text",
|
|
26
|
+
warn: "bg-button-warn-bg text-button-warn-text",
|
|
27
|
+
muted: "bg-button-muted-bg text-button-muted-text",
|
|
28
|
+
danger: "bg-button-danger-bg text-button-danger-text",
|
|
29
|
+
neutral: "bg-transparent border-1 border-card-border",
|
|
30
|
+
primary: "bg-button-primary-bg text-button-primary-text",
|
|
31
|
+
success: "bg-button-success-bg text-button-success-text",
|
|
32
|
+
secondary: "bg-button-secondary-bg text-button-secondary-text",
|
|
33
|
+
"ghost-info": "bg-transparent hover:bg-info/20 border-0 border-transparent text-info",
|
|
34
|
+
"ghost-warn": "bg-transparent hover:bg-warn/20 border-0 border-transparent text-warn",
|
|
35
|
+
"ghost-danger": "bg-transparent hover:bg-danger/20 border-0 border-transparent text-danger",
|
|
36
|
+
"ghost-primary": "bg-transparent hover:bg-primary/20 border-0 border-transparent text-primary",
|
|
37
|
+
"ghost-success": "bg-transparent hover:bg-success/20 border-0 border-transparent text-success",
|
|
38
|
+
"ghost-secondary": "bg-transparent hover:bg-secondary/20 border-0 border-transparent text-secondary",
|
|
39
|
+
"ghost-muted": "bg-transparent hover:bg-muted/20 border-0 border-transparent text-muted-foreground",
|
|
40
|
+
"ghost-neutral": "bg-transparent border-0 border-card-border",
|
|
41
|
+
},
|
|
42
|
+
};
|
|
43
|
+
const buttonVariants = cva("relative inline-flex cursor-pointer items-center justify-center gap-button-gap overflow-hidden whitespace-nowrap align-middle font-medium transition-colors duration-300 ease-linear focus-visible:outline-none focus-visible:ring-4 focus-visible:ring-ring enabled:hover:bg-opacity-70 enabled:focus:bg-opacity-70 disabled:cursor-not-allowed disabled:bg-opacity-40 disabled:text-opacity-80 data-[loading=true]:animate-pulse data-[loading=true]:opacity-30", {
|
|
44
|
+
variants,
|
|
45
|
+
defaultVariants: { theme: "main", size: "default", rounded: "default" },
|
|
46
|
+
});
|
|
47
|
+
/**
|
|
48
|
+
* A versatile button component with multiple variants, sizes, and states.
|
|
49
|
+
*
|
|
50
|
+
* @example
|
|
51
|
+
* ```tsx
|
|
52
|
+
* // Basic usage
|
|
53
|
+
* <Button>Click me</Button>
|
|
54
|
+
*
|
|
55
|
+
* // With variants
|
|
56
|
+
* <Button theme="primary" size="big">Primary Button</Button>
|
|
57
|
+
*
|
|
58
|
+
* // Loading state
|
|
59
|
+
* <Button loading>Saving...</Button>
|
|
60
|
+
*
|
|
61
|
+
* // With icon
|
|
62
|
+
* <Button icon={<Icon name="plus" />}>Add Item</Button>
|
|
63
|
+
*
|
|
64
|
+
* // As different element
|
|
65
|
+
* <Button as="a" href="/link">Link Button</Button>
|
|
66
|
+
* ```
|
|
67
|
+
*
|
|
68
|
+
* @template T - The HTML element type to render as
|
|
69
|
+
* @param props - Button props including theme, size, loading state, etc.
|
|
70
|
+
* @param ref - Forwarded ref to the button element
|
|
71
|
+
* @returns A styled button component
|
|
72
|
+
*/
|
|
73
|
+
export const Button = forwardRef(function Button({ className, icon, loading, theme, type = "button", size, rounded, ...props }, ref) {
|
|
74
|
+
const disabled = loading || props.disabled;
|
|
75
|
+
return (<Polymorph {...props} ref={ref} type={type} data-theme={theme} disabled={disabled} data-loading={loading} data-component="button" aria-disabled={disabled} as={props.as ?? "button"} aria-busy={loading} onClick={disabled ? undefined : props.onClick} className={css(buttonVariants({ size, rounded, theme }), className)}>
|
|
76
|
+
{icon}
|
|
77
|
+
{props.children}
|
|
78
|
+
</Polymorph>);
|
|
79
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"heading.d.ts","sourceRoot":"","sources":["../../../src/components/core/heading.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAG1C,eAAO,MAAM,OAAO,GAAI,OAAO,iBAAiB,gCAE/C,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Polymorph as e } from "./polymorph.js";
|
|
2
|
+
import { jsx as t } from "react/jsx-runtime";
|
|
3
|
+
//#region src/components/core/heading.tsx
|
|
4
|
+
var n = (n) => /* @__PURE__ */ t(e, {
|
|
5
|
+
as: "h2",
|
|
6
|
+
children: n.children
|
|
7
|
+
});
|
|
8
|
+
//#endregion
|
|
9
|
+
export { n as Heading };
|
|
10
|
+
|
|
11
|
+
//# sourceMappingURL=heading.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"heading.js","names":[],"sources":["../../../src/components/core/heading.tsx"],"sourcesContent":["import { PropsWithChildren } from \"react\";\nimport { Polymorph } from \"./polymorph\";\n\nexport const Heading = (props: PropsWithChildren) => {\n return <Polymorph as=\"h2\">{props.children}</Polymorph>;\n};\n"],"mappings":";;;AAGA,IAAa,KAAW,MACb,kBAAC,GAAD;CAAW,IAAG;WAAM,EAAM;AAAoB,CAAA"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type React from "react";
|
|
2
|
+
type PropsOf<T extends React.ElementType> = React.ComponentPropsWithoutRef<T>;
|
|
3
|
+
export type PolymorphicProps<Props, T extends React.ElementType> = Props & {
|
|
4
|
+
as?: T;
|
|
5
|
+
} & Omit<PropsOf<T>, keyof Props | "as" | "ref"> & {
|
|
6
|
+
ref?: React.ComponentProps<T>["ref"];
|
|
7
|
+
};
|
|
8
|
+
export declare const Polymorph: React.ForwardRefExoticComponent<Omit<any, "ref"> & React.RefAttributes<React.ElementType<any, keyof React.JSX.IntrinsicElements>>>;
|
|
9
|
+
export {};
|
|
10
|
+
//# sourceMappingURL=polymorph.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"polymorph.d.ts","sourceRoot":"","sources":["../../../src/components/core/polymorph.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,KAAK,OAAO,CAAC,CAAC,SAAS,KAAK,CAAC,WAAW,IAAI,KAAK,CAAC,wBAAwB,CAAC,CAAC,CAAC,CAAC;AAE9E,MAAM,MAAM,gBAAgB,CAAC,KAAK,EAAE,CAAC,SAAS,KAAK,CAAC,WAAW,IAAI,KAAK,GAAG;IACvE,EAAE,CAAC,EAAE,CAAC,CAAC;CACV,GAAG,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,MAAM,KAAK,GAAG,IAAI,GAAG,KAAK,CAAC,GAAG;IAC3C,GAAG,CAAC,EAAE,KAAK,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC;CACxC,CAAC;AAEN,eAAO,MAAM,SAAS,oIAGpB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"polymorph.js","names":[],"sources":["../../../src/components/core/polymorph.tsx"],"sourcesContent":["import type React from \"react\";\nimport { forwardRef } from \"react\";\n\ntype PropsOf<T extends React.ElementType> = React.ComponentPropsWithoutRef<T>;\n\nexport type PolymorphicProps<Props, T extends React.ElementType> = Props & {\n as?: T;\n} & Omit<PropsOf<T>, keyof Props | \"as\" | \"ref\"> & {\n ref?: React.ComponentProps<T>[\"ref\"];\n };\n\nexport const Polymorph = forwardRef(function InnerPolymorph<P extends React.ElementType = \"div\">(props: PropsOf<P>, ref: React.ForwardedRef<P>) {\n const Element = props.as || \"span\";\n return <Element ref={ref} {...props} as={undefined} />;\n});\n"],"mappings":";;;AAWA,IAAa,IAAY,EAAW,SAA6D,GAAmB,GAA4B;CAE5I,OAAO,kBADS,EAAM,MAAM,QACrB;EAAc;EAAK,GAAI;EAAO,IAAI,KAAA;CAAY,CAAA;AACzD,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import React, { PropsWithChildren } from "react";
|
|
2
|
+
import { PolymorphicProps } from "./polymorph";
|
|
3
|
+
export type RenderOnViewProps<T extends React.ElementType = "div"> = PolymorphicProps<{
|
|
4
|
+
onIntersection?: () => void;
|
|
5
|
+
}, T>;
|
|
6
|
+
export declare const RenderOnView: ({ children, ...props }: PropsWithChildren<RenderOnViewProps>) => React.JSX.Element;
|
|
7
|
+
//# sourceMappingURL=render-on-view.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"render-on-view.d.ts","sourceRoot":"","sources":["../../../src/components/core/render-on-view.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,EAAE,iBAAiB,EAAqC,MAAM,OAAO,CAAC;AAEpF,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAE/C,MAAM,MAAM,iBAAiB,CAAC,CAAC,SAAS,KAAK,CAAC,WAAW,GAAG,KAAK,IAAI,gBAAgB,CACjF;IACI,cAAc,CAAC,EAAE,MAAM,IAAI,CAAC;CAC/B,EACD,CAAC,CACJ,CAAC;AAYF,eAAO,MAAM,YAAY,GAAI,wBAAwB,iBAAiB,CAAC,iBAAiB,CAAC,sBAsBxF,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { t as e } from "../../use-stable-ref-D5LFCx0u.js";
|
|
3
|
+
import { useLayoutEffect as t, useRef as n, useState as r } from "react";
|
|
4
|
+
import { jsx as i } from "react/jsx-runtime";
|
|
5
|
+
//#region src/components/core/render-on-view.tsx
|
|
6
|
+
function a(e) {
|
|
7
|
+
let t = e.getBoundingClientRect();
|
|
8
|
+
return t.top >= 0 && t.left >= 0 && t.bottom <= (window.innerHeight || document.documentElement.clientHeight) && t.right <= (window.innerWidth || document.documentElement.clientWidth);
|
|
9
|
+
}
|
|
10
|
+
var o = ({ children: o, ...s }) => {
|
|
11
|
+
let c = e(s.onIntersection), l = n(null), [u, d] = r(() => l.current === null ? !1 : a(l.current));
|
|
12
|
+
return t(() => {
|
|
13
|
+
let e = l.current;
|
|
14
|
+
if (e === null) return;
|
|
15
|
+
let t = new IntersectionObserver((e) => {
|
|
16
|
+
let t = e[0];
|
|
17
|
+
return t.isIntersecting && c.current?.(), d((e) => t.isIntersecting ? !0 : e);
|
|
18
|
+
});
|
|
19
|
+
return t.observe(e), () => t.disconnect();
|
|
20
|
+
}, [c]), /* @__PURE__ */ i("div", {
|
|
21
|
+
...s,
|
|
22
|
+
ref: l,
|
|
23
|
+
children: u ? o : null
|
|
24
|
+
});
|
|
25
|
+
};
|
|
26
|
+
//#endregion
|
|
27
|
+
export { o as RenderOnView };
|
|
28
|
+
|
|
29
|
+
//# sourceMappingURL=render-on-view.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"render-on-view.js","names":[],"sources":["../../../src/components/core/render-on-view.tsx"],"sourcesContent":["\"use client\";\nimport React, { PropsWithChildren, useLayoutEffect, useRef, useState } from \"react\";\nimport { useStableRef } from \"../../hooks/use-stable-ref\";\nimport { PolymorphicProps } from \"./polymorph\";\n\nexport type RenderOnViewProps<T extends React.ElementType = \"div\"> = PolymorphicProps<\n {\n onIntersection?: () => void;\n },\n T\n>;\n\nfunction isInViewport(el: HTMLElement): boolean {\n const rect = el.getBoundingClientRect();\n return (\n rect.top >= 0 &&\n rect.left >= 0 &&\n rect.bottom <= (window.innerHeight || document.documentElement.clientHeight) &&\n rect.right <= (window.innerWidth || document.documentElement.clientWidth) /* or $(window).width() */\n );\n}\n\nexport const RenderOnView = ({ children, ...props }: PropsWithChildren<RenderOnViewProps>) => {\n const onIntersect = useStableRef(props.onIntersection);\n const ref = useRef<HTMLDivElement>(null);\n const [shouldRender, setShouldRender] = useState(() => (ref.current === null ? false : isInViewport(ref.current)));\n\n useLayoutEffect(() => {\n const div = ref.current;\n if (div === null) return;\n const observer = new IntersectionObserver((args) => {\n const first = args[0];\n if (first.isIntersecting) onIntersect.current?.();\n return setShouldRender((prev) => (first.isIntersecting ? true : prev));\n });\n observer.observe(div);\n return () => observer.disconnect();\n }, [onIntersect]);\n\n return (\n <div {...props} ref={ref}>\n {shouldRender ? children : null}\n </div>\n );\n};\n"],"mappings":";;;;;AAYA,SAAS,EAAa,GAA0B;CAC5C,IAAM,IAAO,EAAG,sBAAsB;CACtC,OACI,EAAK,OAAO,KACZ,EAAK,QAAQ,KACb,EAAK,WAAW,OAAO,eAAe,SAAS,gBAAgB,iBAC/D,EAAK,UAAU,OAAO,cAAc,SAAS,gBAAgB;AAErE;AAEA,IAAa,KAAgB,EAAE,aAAU,GAAG,QAAkD;CAC1F,IAAM,IAAc,EAAa,EAAM,cAAc,GAC/C,IAAM,EAAuB,IAAI,GACjC,CAAC,GAAc,KAAmB,QAAgB,EAAI,YAAY,OAAO,KAAQ,EAAa,EAAI,OAAO,CAAE;CAcjH,OAZA,QAAsB;EAClB,IAAM,IAAM,EAAI;EAChB,IAAI,MAAQ,MAAM;EAClB,IAAM,IAAW,IAAI,sBAAsB,MAAS;GAChD,IAAM,IAAQ,EAAK;GAEnB,OADI,EAAM,kBAAgB,EAAY,UAAU,GACzC,GAAiB,MAAU,EAAM,iBAAiB,KAAO,CAAK;EACzE,CAAC;EAED,OADA,EAAS,QAAQ,CAAG,SACP,EAAS,WAAW;CACrC,GAAG,CAAC,CAAW,CAAC,GAGZ,kBAAC,OAAD;EAAK,GAAI;EAAY;YAChB,IAAe,IAAW;CAC1B,CAAA;AAEb"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import React, { useLayoutEffect, useRef, useState } from "react";
|
|
3
|
+
import { useStableRef } from "../../hooks/use-stable-ref";
|
|
4
|
+
function isInViewport(el) {
|
|
5
|
+
const rect = el.getBoundingClientRect();
|
|
6
|
+
return (rect.top >= 0 &&
|
|
7
|
+
rect.left >= 0 &&
|
|
8
|
+
rect.bottom <= (window.innerHeight || document.documentElement.clientHeight) &&
|
|
9
|
+
rect.right <= (window.innerWidth || document.documentElement.clientWidth) /* or $(window).width() */);
|
|
10
|
+
}
|
|
11
|
+
export const RenderOnView = ({ children, ...props }) => {
|
|
12
|
+
const onIntersect = useStableRef(props.onIntersection);
|
|
13
|
+
const ref = useRef(null);
|
|
14
|
+
const [shouldRender, setShouldRender] = useState(() => (ref.current === null ? false : isInViewport(ref.current)));
|
|
15
|
+
useLayoutEffect(() => {
|
|
16
|
+
const div = ref.current;
|
|
17
|
+
if (div === null)
|
|
18
|
+
return;
|
|
19
|
+
const observer = new IntersectionObserver((args) => {
|
|
20
|
+
const first = args[0];
|
|
21
|
+
if (first.isIntersecting)
|
|
22
|
+
onIntersect.current?.();
|
|
23
|
+
return setShouldRender((prev) => (first.isIntersecting ? true : prev));
|
|
24
|
+
});
|
|
25
|
+
observer.observe(div);
|
|
26
|
+
return () => observer.disconnect();
|
|
27
|
+
}, [onIntersect]);
|
|
28
|
+
return (<div {...props} ref={ref}>
|
|
29
|
+
{shouldRender ? children : null}
|
|
30
|
+
</div>);
|
|
31
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
type Props = React.PropsWithChildren<{
|
|
3
|
+
open?: boolean;
|
|
4
|
+
className?: string;
|
|
5
|
+
destroyOnUnmount?: boolean;
|
|
6
|
+
}>;
|
|
7
|
+
export declare const Resizable: ({ children, open, className, destroyOnUnmount }: Props) => React.JSX.Element | null;
|
|
8
|
+
export {};
|
|
9
|
+
//# sourceMappingURL=resizable.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resizable.d.ts","sourceRoot":"","sources":["../../../src/components/core/resizable.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAsC,MAAM,OAAO,CAAC;AAE3D,KAAK,KAAK,GAAG,KAAK,CAAC,iBAAiB,CAAC;IACjC,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,gBAAgB,CAAC,EAAE,OAAO,CAAC;CAC9B,CAAC,CAAC;AAUH,eAAO,MAAM,SAAS,GAAI,iDAAgE,KAAK,6BA+C9F,CAAC"}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { t as e } from "../../proxy-fP2NxmhM.js";
|
|
3
|
+
import { t } from "../../animate-BNYgkk_j.js";
|
|
4
|
+
import { t as n } from "../../use-motion-value-BqPF1j90.js";
|
|
5
|
+
import { useEffect as r, useRef as i, useState as a } from "react";
|
|
6
|
+
import { jsx as o } from "react/jsx-runtime";
|
|
7
|
+
//#region src/components/core/resizable.tsx
|
|
8
|
+
var s = 600, c = {
|
|
9
|
+
type: "spring",
|
|
10
|
+
stiffness: 500,
|
|
11
|
+
damping: 50,
|
|
12
|
+
mass: .5
|
|
13
|
+
}, l = ({ children: l, open: u = !0, className: d, destroyOnUnmount: f = !1 }) => {
|
|
14
|
+
let [p, m] = a(null), [h, g] = a(!1), [_, v] = a(f ? u : !0), y = i(0), b = n(0);
|
|
15
|
+
return r(() => {
|
|
16
|
+
if (!f) return;
|
|
17
|
+
if (u) {
|
|
18
|
+
v(!0);
|
|
19
|
+
return;
|
|
20
|
+
}
|
|
21
|
+
let e = setTimeout(() => v(!1), s);
|
|
22
|
+
return () => clearTimeout(e);
|
|
23
|
+
}, [u, f]), r(() => {
|
|
24
|
+
if (!p) return;
|
|
25
|
+
let e = new ResizeObserver((e) => {
|
|
26
|
+
let t = e[0];
|
|
27
|
+
if (!t) return;
|
|
28
|
+
let n = t.contentRect.height;
|
|
29
|
+
n <= 0 || (y.current = n, h || (b.jump(u ? n : 0), g(!0)));
|
|
30
|
+
});
|
|
31
|
+
return e.observe(p), () => e.disconnect();
|
|
32
|
+
}, [
|
|
33
|
+
p,
|
|
34
|
+
h,
|
|
35
|
+
u,
|
|
36
|
+
b
|
|
37
|
+
]), r(() => {
|
|
38
|
+
if (!h) return;
|
|
39
|
+
let e = t(b, u ? y.current : 0, c);
|
|
40
|
+
return () => e.stop();
|
|
41
|
+
}, [
|
|
42
|
+
u,
|
|
43
|
+
h,
|
|
44
|
+
b
|
|
45
|
+
]), _ ? /* @__PURE__ */ o(e.div, {
|
|
46
|
+
className: d,
|
|
47
|
+
style: {
|
|
48
|
+
height: h ? b : u ? "auto" : 0,
|
|
49
|
+
overflow: "hidden"
|
|
50
|
+
},
|
|
51
|
+
children: /* @__PURE__ */ o("div", {
|
|
52
|
+
ref: m,
|
|
53
|
+
children: l
|
|
54
|
+
})
|
|
55
|
+
}) : null;
|
|
56
|
+
};
|
|
57
|
+
//#endregion
|
|
58
|
+
export { l as Resizable };
|
|
59
|
+
|
|
60
|
+
//# sourceMappingURL=resizable.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resizable.js","names":[],"sources":["../../../src/components/core/resizable.tsx"],"sourcesContent":["\"use client\";\nimport { animate, motion, useMotionValue } from \"motion/react\";\nimport React, { useEffect, useRef, useState } from \"react\";\n\ntype Props = React.PropsWithChildren<{\n open?: boolean;\n className?: string;\n destroyOnUnmount?: boolean;\n}>;\n\nconst DESTROY_DELAY_MS = 600;\nconst SPRING = {\n type: \"spring\" as const,\n stiffness: 500,\n damping: 50,\n mass: 0.5,\n};\n\nexport const Resizable = ({ children, open = true, className, destroyOnUnmount = false }: Props) => {\n const [element, ref] = useState<HTMLDivElement | null>(null);\n const [ready, setReady] = useState(false);\n const [mounted, setMounted] = useState(destroyOnUnmount ? open : true);\n const measured = useRef(0);\n const height = useMotionValue<number>(0);\n\n useEffect(() => {\n if (!destroyOnUnmount) return;\n if (open) {\n setMounted(true);\n return;\n }\n const id = setTimeout(() => setMounted(false), DESTROY_DELAY_MS);\n return () => clearTimeout(id);\n }, [open, destroyOnUnmount]);\n\n useEffect(() => {\n if (!element) return;\n const observer = new ResizeObserver((entries) => {\n const entry = entries[0];\n if (!entry) return;\n const h = entry.contentRect.height;\n if (h <= 0) return;\n measured.current = h;\n if (!ready) {\n height.jump(open ? h : 0);\n setReady(true);\n }\n });\n observer.observe(element);\n return () => observer.disconnect();\n }, [element, ready, open, height]);\n\n useEffect(() => {\n if (!ready) return;\n const controls = animate(height, open ? measured.current : 0, SPRING);\n return () => controls.stop();\n }, [open, ready, height]);\n\n if (!mounted) return null;\n\n return (\n <motion.div className={className} style={{ height: ready ? height : open ? \"auto\" : 0, overflow: \"hidden\" }}>\n <div ref={ref}>{children}</div>\n </motion.div>\n );\n};\n"],"mappings":";;;;;;;AAUA,IAAM,IAAmB,KACnB,IAAS;CACX,MAAM;CACN,WAAW;CACX,SAAS;CACT,MAAM;AACV,GAEa,KAAa,EAAE,aAAU,UAAO,IAAM,cAAW,sBAAmB,SAAmB;CAChG,IAAM,CAAC,GAAS,KAAO,EAAgC,IAAI,GACrD,CAAC,GAAO,KAAY,EAAS,EAAK,GAClC,CAAC,GAAS,KAAc,EAAS,IAAmB,IAAO,EAAI,GAC/D,IAAW,EAAO,CAAC,GACnB,IAAS,EAAuB,CAAC;CAqCvC,OAnCA,QAAgB;EACZ,IAAI,CAAC,GAAkB;EACvB,IAAI,GAAM;GACN,EAAW,EAAI;GACf;EACJ;EACA,IAAM,IAAK,iBAAiB,EAAW,EAAK,GAAG,CAAgB;EAC/D,aAAa,aAAa,CAAE;CAChC,GAAG,CAAC,GAAM,CAAgB,CAAC,GAE3B,QAAgB;EACZ,IAAI,CAAC,GAAS;EACd,IAAM,IAAW,IAAI,gBAAgB,MAAY;GAC7C,IAAM,IAAQ,EAAQ;GACtB,IAAI,CAAC,GAAO;GACZ,IAAM,IAAI,EAAM,YAAY;GACxB,KAAK,MACT,EAAS,UAAU,GACd,MACD,EAAO,KAAK,IAAO,IAAI,CAAC,GACxB,EAAS,EAAI;EAErB,CAAC;EAED,OADA,EAAS,QAAQ,CAAO,SACX,EAAS,WAAW;CACrC,GAAG;EAAC;EAAS;EAAO;EAAM;CAAM,CAAC,GAEjC,QAAgB;EACZ,IAAI,CAAC,GAAO;EACZ,IAAM,IAAW,EAAQ,GAAQ,IAAO,EAAS,UAAU,GAAG,CAAM;EACpE,aAAa,EAAS,KAAK;CAC/B,GAAG;EAAC;EAAM;EAAO;CAAM,CAAC,GAEnB,IAGD,kBAAC,EAAO,KAAR;EAAuB;EAAW,OAAO;GAAE,QAAQ,IAAQ,IAAS,IAAO,SAAS;GAAG,UAAU;EAAS;YACtG,kBAAC,OAAD;GAAU;GAAM;EAAc,CAAA;CACtB,CAAA,IALK;AAOzB"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { animate, motion, useMotionValue } from "motion/react";
|
|
3
|
+
import React, { useEffect, useRef, useState } from "react";
|
|
4
|
+
const DESTROY_DELAY_MS = 600;
|
|
5
|
+
const SPRING = {
|
|
6
|
+
type: "spring",
|
|
7
|
+
stiffness: 500,
|
|
8
|
+
damping: 50,
|
|
9
|
+
mass: 0.5,
|
|
10
|
+
};
|
|
11
|
+
export const Resizable = ({ children, open = true, className, destroyOnUnmount = false }) => {
|
|
12
|
+
const [element, ref] = useState(null);
|
|
13
|
+
const [ready, setReady] = useState(false);
|
|
14
|
+
const [mounted, setMounted] = useState(destroyOnUnmount ? open : true);
|
|
15
|
+
const measured = useRef(0);
|
|
16
|
+
const height = useMotionValue(0);
|
|
17
|
+
useEffect(() => {
|
|
18
|
+
if (!destroyOnUnmount)
|
|
19
|
+
return;
|
|
20
|
+
if (open) {
|
|
21
|
+
setMounted(true);
|
|
22
|
+
return;
|
|
23
|
+
}
|
|
24
|
+
const id = setTimeout(() => setMounted(false), DESTROY_DELAY_MS);
|
|
25
|
+
return () => clearTimeout(id);
|
|
26
|
+
}, [open, destroyOnUnmount]);
|
|
27
|
+
useEffect(() => {
|
|
28
|
+
if (!element)
|
|
29
|
+
return;
|
|
30
|
+
const observer = new ResizeObserver((entries) => {
|
|
31
|
+
const entry = entries[0];
|
|
32
|
+
if (!entry)
|
|
33
|
+
return;
|
|
34
|
+
const h = entry.contentRect.height;
|
|
35
|
+
if (h <= 0)
|
|
36
|
+
return;
|
|
37
|
+
measured.current = h;
|
|
38
|
+
if (!ready) {
|
|
39
|
+
height.jump(open ? h : 0);
|
|
40
|
+
setReady(true);
|
|
41
|
+
}
|
|
42
|
+
});
|
|
43
|
+
observer.observe(element);
|
|
44
|
+
return () => observer.disconnect();
|
|
45
|
+
}, [element, ready, open, height]);
|
|
46
|
+
useEffect(() => {
|
|
47
|
+
if (!ready)
|
|
48
|
+
return;
|
|
49
|
+
const controls = animate(height, open ? measured.current : 0, SPRING);
|
|
50
|
+
return () => controls.stop();
|
|
51
|
+
}, [open, ready, height]);
|
|
52
|
+
if (!mounted)
|
|
53
|
+
return null;
|
|
54
|
+
return (<motion.div className={className} style={{ height: ready ? height : open ? "auto" : 0, overflow: "hidden" }}>
|
|
55
|
+
<div ref={ref}>{children}</div>
|
|
56
|
+
</motion.div>);
|
|
57
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
export type Usable<T> = PromiseLike<T> | React.Context<T>;
|
|
3
|
+
interface SlotProps extends React.HTMLAttributes<HTMLElement> {
|
|
4
|
+
children?: React.ReactNode;
|
|
5
|
+
}
|
|
6
|
+
export declare function createSlot(ownerName: string): React.ForwardRefExoticComponent<SlotProps & React.RefAttributes<HTMLElement>>;
|
|
7
|
+
export declare const Slot: React.ForwardRefExoticComponent<SlotProps & React.RefAttributes<HTMLElement>>;
|
|
8
|
+
interface SlottableProps {
|
|
9
|
+
children: React.ReactNode;
|
|
10
|
+
}
|
|
11
|
+
interface SlottableComponent extends React.FC<SlottableProps> {
|
|
12
|
+
__radixId: symbol;
|
|
13
|
+
}
|
|
14
|
+
export declare function createSlottable(ownerName: string): SlottableComponent;
|
|
15
|
+
export {};
|
|
16
|
+
//# sourceMappingURL=slot.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"slot.d.ts","sourceRoot":"","sources":["../../../src/components/core/slot.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AA4C/B,MAAM,MAAM,MAAM,CAAC,CAAC,IAAI,WAAW,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;AAI1D,UAAU,SAAU,SAAQ,KAAK,CAAC,cAAc,CAAC,WAAW,CAAC;IACzD,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC9B;AAiBD,wBAAgB,UAAU,CAAC,SAAS,EAAE,MAAM,iFAyC3C;AAED,eAAO,MAAM,IAAI,+EAAqB,CAAC;AAgCvC,UAAU,cAAc;IACpB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC7B;AAED,UAAU,kBAAmB,SAAQ,KAAK,CAAC,EAAE,CAAC,cAAc,CAAC;IACzD,SAAS,EAAE,MAAM,CAAC;CACrB;AAED,wBAAgB,eAAe,CAAC,SAAS,EAAE,MAAM,sBAOhD"}
|
|
@@ -91,6 +91,6 @@ function g(e) {
|
|
|
91
91
|
return n ? e.ref : (t = Object.getOwnPropertyDescriptor(e, "ref")?.get, n = t && "isReactWarning" in t && t.isReactWarning, n ? e.props.ref : e.props.ref || e.ref);
|
|
92
92
|
}
|
|
93
93
|
//#endregion
|
|
94
|
-
export { u as
|
|
94
|
+
export { u as Slot, l as createSlot, p as createSlottable };
|
|
95
95
|
|
|
96
|
-
//# sourceMappingURL=slot
|
|
96
|
+
//# sourceMappingURL=slot.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"slot.js","names":[],"sources":["../../../src/components/core/slot.tsx"],"sourcesContent":["import * as React from \"react\";\n\ntype PossibleRef<T> = React.Ref<T> | undefined;\n\nconst REACT_LAZY_TYPE = Symbol.for(\"react.lazy\");\n\nfunction setRef<T>(ref: PossibleRef<T>, value: T) {\n if (typeof ref === \"function\") {\n return ref(value);\n } else if (ref !== null && ref !== undefined) {\n ref.current = value;\n }\n}\n\nfunction composeRefs<T>(...refs: PossibleRef<T>[]): React.RefCallback<T> {\n return (node) => {\n let hasCleanup = false;\n const cleanups = refs.map((ref) => {\n const cleanup = setRef(ref, node);\n if (!hasCleanup && typeof cleanup == \"function\") {\n hasCleanup = true;\n }\n return cleanup;\n });\n if (hasCleanup) {\n return () => {\n for (let i = 0; i < cleanups.length; i++) {\n const cleanup = cleanups[i];\n if (typeof cleanup == \"function\") {\n cleanup();\n } else {\n setRef(refs[i], null);\n }\n }\n };\n }\n };\n}\n\ninterface LazyReactElement extends React.ReactElement {\n $$typeof: typeof REACT_LAZY_TYPE;\n _payload: PromiseLike<Exclude<React.ReactNode, PromiseLike<unknown>>>;\n}\n\nexport type Usable<T> = PromiseLike<T> | React.Context<T>;\n\nconst use: typeof React.use | undefined = (React as unknown as Record<string, unknown>)[\" use \".trim().toString()] as typeof React.use | undefined;\n\ninterface SlotProps extends React.HTMLAttributes<HTMLElement> {\n children?: React.ReactNode;\n}\n\nfunction isPromiseLike(value: unknown): value is PromiseLike<unknown> {\n return typeof value === \"object\" && value !== null && \"then\" in value;\n}\n\nfunction isLazyComponent(element: React.ReactNode): element is LazyReactElement {\n return (\n element != null &&\n typeof element === \"object\" &&\n \"$$typeof\" in element &&\n element.$$typeof === REACT_LAZY_TYPE &&\n \"_payload\" in element &&\n isPromiseLike(element._payload)\n );\n}\n\nexport function createSlot(ownerName: string) {\n const SlotClone = createSlotClone(ownerName);\n const Slot = React.forwardRef<HTMLElement, SlotProps>((props, forwardedRef) => {\n let { children, ...slotProps } = props;\n if (isLazyComponent(children) && typeof use === \"function\") {\n children = use(children._payload);\n }\n const childrenArray = React.Children.toArray(children);\n const slottable = childrenArray.find(isSlottable);\n\n if (slottable) {\n // the new element to render is the one passed as a child of `Slottable`\n const newElement = slottable.props.children;\n\n const newChildren = childrenArray.map((child) => {\n if (child === slottable) {\n // because the new element will be the one rendered, we are only interested\n // in grabbing its children (`newElement.props.children`)\n if (React.Children.count(newElement) > 1) return React.Children.only(null);\n return React.isValidElement(newElement) ? (newElement.props as { children: React.ReactNode }).children : null;\n } else {\n return child;\n }\n });\n\n return (\n <SlotClone {...slotProps} ref={forwardedRef}>\n {React.isValidElement(newElement) ? React.cloneElement(newElement, undefined, newChildren) : null}\n </SlotClone>\n );\n }\n\n return (\n <SlotClone {...slotProps} ref={forwardedRef}>\n {children}\n </SlotClone>\n );\n });\n\n Slot.displayName = `${ownerName}.Slot`;\n return Slot;\n}\n\nexport const Slot = createSlot(\"Slot\");\n\ninterface SlotCloneProps {\n children: React.ReactNode;\n}\n\nfunction createSlotClone(ownerName: string) {\n const SlotClone = React.forwardRef<HTMLElement, SlotCloneProps>((props, forwardedRef) => {\n let { children, ...slotProps } = props;\n if (isLazyComponent(children) && typeof use === \"function\") {\n children = use(children._payload);\n }\n\n if (React.isValidElement(children)) {\n const childrenRef = getElementRef(children);\n const props = mergeProps(slotProps, children.props as AnyProps);\n // do not pass ref to React.Fragment for React 19 compatibility\n if (children.type !== React.Fragment) {\n props.ref = forwardedRef ? composeRefs(forwardedRef, childrenRef) : childrenRef;\n }\n return React.cloneElement(children, props);\n }\n\n return React.Children.count(children) > 1 ? React.Children.only(null) : null;\n });\n\n SlotClone.displayName = `${ownerName}.SlotClone`;\n return SlotClone;\n}\n\nconst SLOTTABLE_IDENTIFIER = Symbol(\"radix.slottable\");\n\ninterface SlottableProps {\n children: React.ReactNode;\n}\n\ninterface SlottableComponent extends React.FC<SlottableProps> {\n __radixId: symbol;\n}\n\nexport function createSlottable(ownerName: string) {\n const Slottable: SlottableComponent = ({ children }) => {\n return <>{children}</>;\n };\n Slottable.displayName = `${ownerName}.Slottable`;\n Slottable.__radixId = SLOTTABLE_IDENTIFIER;\n return Slottable;\n}\n\nconst Slottable = createSlottable(\"Slottable\");\n\ntype AnyProps = Record<string, any>;\n\nfunction isSlottable(child: React.ReactNode): child is React.ReactElement<SlottableProps, typeof Slottable> {\n return (\n React.isValidElement(child) && typeof child.type === \"function\" && \"__radixId\" in child.type && child.type.__radixId === SLOTTABLE_IDENTIFIER\n );\n}\n\nfunction mergeProps(slotProps: AnyProps, childProps: AnyProps) {\n const overrideProps = { ...childProps };\n for (const propName in childProps) {\n const slotPropValue = slotProps[propName];\n const childPropValue = childProps[propName];\n\n const isHandler = /^on[A-Z]/.test(propName);\n if (isHandler) {\n if (slotPropValue && childPropValue) {\n overrideProps[propName] = (...args: unknown[]) => {\n const result = childPropValue(...args);\n slotPropValue(...args);\n return result;\n };\n } else if (slotPropValue) {\n overrideProps[propName] = slotPropValue;\n }\n } else if (propName === \"style\") {\n overrideProps[propName] = { ...slotPropValue, ...childPropValue };\n } else if (propName === \"className\") {\n overrideProps[propName] = [slotPropValue, childPropValue].filter(Boolean).join(\" \");\n }\n }\n\n return { ...slotProps, ...overrideProps };\n}\n\nfunction getElementRef(element: React.ReactElement) {\n let getter = Object.getOwnPropertyDescriptor(element.props, \"ref\")?.get;\n let mayWarn = getter && \"isReactWarning\" in getter && getter.isReactWarning;\n if (mayWarn) {\n return (element as unknown as { ref?: React.Ref<unknown> }).ref;\n }\n getter = Object.getOwnPropertyDescriptor(element, \"ref\")?.get;\n mayWarn = getter && \"isReactWarning\" in getter && getter.isReactWarning;\n if (mayWarn) {\n return (element.props as { ref?: React.Ref<unknown> }).ref;\n }\n return (element.props as { ref?: React.Ref<unknown> }).ref || (element as unknown as { ref?: React.Ref<unknown> }).ref;\n}\n"],"mappings":";;;AAIA,IAAM,IAAkB,OAAO,IAAI,YAAY;AAE/C,SAAS,EAAU,GAAqB,GAAU;CAC9C,IAAI,OAAO,KAAQ,YACf,OAAO,EAAI,CAAK;CACb,AAAI,KAAQ,SACf,EAAI,UAAU;AAEtB;AAEA,SAAS,EAAe,GAAG,GA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