@yewdiel21/motion-kit 0.10.0 → 0.15.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +81 -0
- package/bin/motion-kit.mjs +3 -3
- package/dist/auto/index.d.ts +56 -3
- package/dist/auto/index.js +107 -3
- package/dist/auto/index.js.map +1 -1
- package/dist/{chunk-XAKC2QY7.js → chunk-6IRJYXJU.js} +3 -28
- package/dist/chunk-6IRJYXJU.js.map +1 -0
- package/dist/chunk-A6QQCF6V.js +21333 -0
- package/dist/chunk-A6QQCF6V.js.map +1 -0
- package/dist/chunk-JXRS3OEA.js +3638 -0
- package/dist/chunk-JXRS3OEA.js.map +1 -0
- package/dist/chunk-QP4QJOEN.js +72 -0
- package/dist/chunk-QP4QJOEN.js.map +1 -0
- package/dist/css/components/activity-feed.css +240 -0
- package/dist/css/components/add-to-cart.css +72 -0
- package/dist/css/components/attachment.css +266 -0
- package/dist/css/components/bidirectional-slider.css +168 -0
- package/dist/css/components/breadcrumb.css +110 -0
- package/dist/css/components/chart-tooltip.css +168 -0
- package/dist/css/components/chart.css +296 -0
- package/dist/css/components/code-block.css +264 -0
- package/dist/css/components/color-area.css +82 -0
- package/dist/css/components/color-field.css +67 -0
- package/dist/css/components/color-picker.css +131 -0
- package/dist/css/components/color-slider.css +113 -0
- package/dist/css/components/command-search.css +252 -0
- package/dist/css/components/context-menu.css +23 -0
- package/dist/css/components/credit-card.css +288 -0
- package/dist/css/components/data-table.css +686 -0
- package/dist/css/components/date-range-picker.css +168 -0
- package/dist/css/components/date-time-picker.css +178 -0
- package/dist/css/components/drawer.css +58 -0
- package/dist/css/components/editable-table.css +201 -0
- package/dist/css/components/empty-state.css +61 -0
- package/dist/css/components/file-explorer.css +633 -0
- package/dist/css/components/filter-builder.css +227 -0
- package/dist/css/components/heatmap-chart.css +391 -0
- package/dist/css/components/hold-confirm.css +87 -0
- package/dist/css/components/hover-card.css +19 -7
- package/dist/css/components/image-preview.css +283 -0
- package/dist/css/components/json-viewer.css +304 -0
- package/dist/css/components/like-button.css +78 -0
- package/dist/css/components/link-preview.css +275 -0
- package/dist/css/components/loading-button.css +77 -0
- package/dist/css/components/multi-select.css +267 -0
- package/dist/css/components/nav.css +102 -102
- package/dist/css/components/notification-bell.css +127 -0
- package/dist/css/components/orbit-menu.css +130 -0
- package/dist/css/components/pagination.css +10 -5
- package/dist/css/components/password-strength.css +183 -0
- package/dist/css/components/pie-chart.css +390 -0
- package/dist/css/components/pill-button.css +135 -0
- package/dist/css/components/popover.css +25 -0
- package/dist/css/components/progress.css +140 -0
- package/dist/css/components/questionnaire.css +217 -0
- package/dist/css/components/radar-chart.css +370 -0
- package/dist/css/components/radial-chart.css +398 -0
- package/dist/css/components/range-calendar.css +186 -0
- package/dist/css/components/range-slider.css +192 -0
- package/dist/css/components/resizable-panel.css +243 -0
- package/dist/css/components/rich-text-editor.css +284 -0
- package/dist/css/components/sankey-chart.css +358 -0
- package/dist/css/components/scratch-card.css +75 -0
- package/dist/css/components/scroll-island.css +111 -0
- package/dist/css/components/select.css +136 -0
- package/dist/css/components/skeleton.css +108 -0
- package/dist/css/components/split-view.css +19 -0
- package/dist/css/components/star-rating.css +80 -0
- package/dist/css/components/stat-card.css +164 -0
- package/dist/css/components/swipe-actions.css +105 -0
- package/dist/css/components/tag-input.css +244 -0
- package/dist/css/components/time-field.css +88 -0
- package/dist/css/components/timeline.css +219 -0
- package/dist/css/components/toolbar.css +122 -0
- package/dist/css/components/tooltip.css +79 -0
- package/dist/css/components/tree-view.css +289 -0
- package/dist/css/components/virtual-list.css +195 -0
- package/dist/css/components/voice-dots.css +70 -0
- package/dist/css/tokens.css +185 -181
- package/dist/elements/index.d.ts +849 -7
- package/dist/elements/index.js +1642 -8
- package/dist/elements/index.js.map +1 -1
- package/dist/{engine-GDGwQnJE.d.ts → engine-5zRIssTO.d.ts} +11 -1
- package/dist/engine-QECQnGz1.d.ts +33 -0
- package/dist/index.css +10890 -311
- package/dist/index.d.ts +89 -5
- package/dist/index.js +273 -9
- package/dist/index.js.map +1 -1
- package/dist/react/index.d.ts +686 -24
- package/dist/react/index.js +2345 -9
- package/dist/react/index.js.map +1 -1
- package/dist/{reduced-BmBzKH94.d.ts → reduced-6X_bns60.d.ts} +9 -2
- package/dist/reveal-BfyKKsw4.d.ts +2474 -0
- package/dist/store-CA2Qcun_.d.ts +453 -0
- package/package.json +9 -16
- package/registry.json +1096 -543
- package/src/auto/auto-init.ts +104 -0
- package/src/components/activity-feed/README.md +56 -0
- package/src/components/activity-feed/activity-feed.css +239 -0
- package/src/components/activity-feed/element.ts +36 -0
- package/src/components/activity-feed/engine.ts +351 -0
- package/src/components/activity-feed/react.tsx +32 -0
- package/src/components/add-to-cart/README.md +34 -0
- package/src/components/add-to-cart/add-to-cart.css +71 -0
- package/src/components/add-to-cart/element.ts +20 -0
- package/src/components/add-to-cart/engine.ts +206 -0
- package/src/components/add-to-cart/react.tsx +29 -0
- package/src/components/attachment/README.md +27 -0
- package/src/components/attachment/attachment.css +265 -0
- package/src/components/attachment/element.ts +50 -0
- package/src/components/attachment/engine.ts +469 -0
- package/src/components/attachment/react.tsx +65 -0
- package/src/components/bidirectional-slider/README.md +46 -0
- package/src/components/bidirectional-slider/bidirectional-slider.css +167 -0
- package/src/components/bidirectional-slider/element.ts +42 -0
- package/src/components/bidirectional-slider/engine.ts +289 -0
- package/src/components/bidirectional-slider/react.tsx +45 -0
- package/src/components/breadcrumb/README.md +38 -0
- package/src/components/breadcrumb/breadcrumb.css +109 -0
- package/src/components/breadcrumb/element.ts +27 -0
- package/src/components/breadcrumb/engine.ts +249 -0
- package/src/components/breadcrumb/react.tsx +30 -0
- package/src/components/chart/README.md +34 -0
- package/src/components/chart/chart.css +295 -0
- package/src/components/chart/element.ts +43 -0
- package/src/components/chart/engine.ts +838 -0
- package/src/components/chart/parts.ts +237 -0
- package/src/components/chart/react.tsx +50 -0
- package/src/components/chart/use-chart.ts +55 -0
- package/src/components/chart-tooltip/README.md +53 -0
- package/src/components/chart-tooltip/chart-tooltip.css +167 -0
- package/src/components/chart-tooltip/element.ts +37 -0
- package/src/components/chart-tooltip/engine.ts +442 -0
- package/src/components/chart-tooltip/react.tsx +47 -0
- package/src/components/code-block/README.md +19 -0
- package/src/components/code-block/code-block.css +263 -0
- package/src/components/code-block/element.ts +34 -0
- package/src/components/code-block/engine.ts +254 -0
- package/src/components/code-block/highlight.ts +244 -0
- package/src/components/code-block/react.tsx +94 -0
- package/src/components/color-area/README.md +50 -0
- package/src/components/color-area/color-area.css +81 -0
- package/src/components/color-area/element.ts +26 -0
- package/src/components/color-area/engine.ts +246 -0
- package/src/components/color-area/react.tsx +42 -0
- package/src/components/color-field/README.md +43 -0
- package/src/components/color-field/color-field.css +66 -0
- package/src/components/color-field/element.ts +26 -0
- package/src/components/color-field/engine.ts +174 -0
- package/src/components/color-field/react.tsx +42 -0
- package/src/components/color-picker/README.md +45 -0
- package/src/components/color-picker/color-picker.css +130 -0
- package/src/components/color-picker/element.ts +45 -0
- package/src/components/color-picker/engine.ts +314 -0
- package/src/components/color-picker/react.tsx +47 -0
- package/src/components/color-slider/README.md +55 -0
- package/src/components/color-slider/color-slider.css +112 -0
- package/src/components/color-slider/element.ts +26 -0
- package/src/components/color-slider/engine.ts +234 -0
- package/src/components/color-slider/react.tsx +45 -0
- package/src/components/command-search/README.md +15 -0
- package/src/components/command-search/command-search.css +251 -0
- package/src/components/command-search/element.ts +36 -0
- package/src/components/command-search/engine.ts +356 -0
- package/src/components/command-search/match.ts +53 -0
- package/src/components/command-search/react.tsx +66 -0
- package/src/components/context-menu/README.md +31 -0
- package/src/components/context-menu/context-menu.css +22 -0
- package/src/components/context-menu/element.ts +40 -0
- package/src/components/context-menu/engine.ts +153 -0
- package/src/components/context-menu/react.tsx +57 -0
- package/src/components/credit-card/README.md +20 -0
- package/src/components/credit-card/card.ts +77 -0
- package/src/components/credit-card/credit-card.css +287 -0
- package/src/components/credit-card/element.ts +33 -0
- package/src/components/credit-card/engine.ts +410 -0
- package/src/components/credit-card/react.tsx +36 -0
- package/src/components/data-table/README.md +83 -0
- package/src/components/data-table/data-table.css +685 -0
- package/src/components/data-table/element.ts +54 -0
- package/src/components/data-table/engine.ts +1111 -0
- package/src/components/data-table/react.tsx +94 -0
- package/src/components/date-range-picker/README.md +51 -0
- package/src/components/date-range-picker/date-range-picker.css +167 -0
- package/src/components/date-range-picker/element.ts +52 -0
- package/src/components/date-range-picker/engine.ts +352 -0
- package/src/components/date-range-picker/react.tsx +57 -0
- package/src/components/date-time-picker/README.md +48 -0
- package/src/components/date-time-picker/date-time-picker.css +177 -0
- package/src/components/date-time-picker/element.ts +47 -0
- package/src/components/date-time-picker/engine.ts +350 -0
- package/src/components/date-time-picker/react.tsx +54 -0
- package/src/components/dialog/README.md +103 -102
- package/src/components/dialog/element.ts +123 -118
- package/src/components/dialog/engine.ts +449 -432
- package/src/components/drawer/README.md +28 -0
- package/src/components/drawer/drawer.css +57 -0
- package/src/components/drawer/element.ts +21 -0
- package/src/components/drawer/engine.ts +56 -0
- package/src/components/drawer/react.tsx +85 -0
- package/src/components/editable-table/README.md +67 -0
- package/src/components/editable-table/editable-table.css +200 -0
- package/src/components/editable-table/element.ts +45 -0
- package/src/components/editable-table/engine.ts +831 -0
- package/src/components/editable-table/react.tsx +79 -0
- package/src/components/empty-state/README.md +41 -0
- package/src/components/empty-state/element.ts +23 -0
- package/src/components/empty-state/empty-state.css +60 -0
- package/src/components/empty-state/engine.ts +232 -0
- package/src/components/empty-state/react.tsx +34 -0
- package/src/components/file-explorer/README.md +67 -0
- package/src/components/file-explorer/element.ts +39 -0
- package/src/components/file-explorer/engine.ts +1307 -0
- package/src/components/file-explorer/file-explorer.css +632 -0
- package/src/components/file-explorer/react.tsx +77 -0
- package/src/components/filter-builder/README.md +47 -0
- package/src/components/filter-builder/element.ts +34 -0
- package/src/components/filter-builder/engine.ts +396 -0
- package/src/components/filter-builder/filter-builder.css +226 -0
- package/src/components/filter-builder/react.tsx +36 -0
- package/src/components/heatmap-chart/README.md +48 -0
- package/src/components/heatmap-chart/element.ts +21 -0
- package/src/components/heatmap-chart/engine.ts +281 -0
- package/src/components/heatmap-chart/heatmap-chart.css +93 -0
- package/src/components/heatmap-chart/react.tsx +14 -0
- package/src/components/hold-confirm/README.md +13 -0
- package/src/components/hold-confirm/element.ts +24 -0
- package/src/components/hold-confirm/engine.ts +216 -0
- package/src/components/hold-confirm/hold-confirm.css +86 -0
- package/src/components/hold-confirm/react.tsx +28 -0
- package/src/components/hover-card/README.md +6 -2
- package/src/components/hover-card/engine.ts +98 -7
- package/src/components/hover-card/hover-card.css +19 -7
- package/src/components/image-preview/README.md +16 -0
- package/src/components/image-preview/element.ts +26 -0
- package/src/components/image-preview/engine.ts +405 -0
- package/src/components/image-preview/image-preview.css +282 -0
- package/src/components/image-preview/react.tsx +43 -0
- package/src/components/json-viewer/README.md +56 -0
- package/src/components/json-viewer/element.ts +37 -0
- package/src/components/json-viewer/engine.ts +449 -0
- package/src/components/json-viewer/json-viewer.css +303 -0
- package/src/components/json-viewer/react.tsx +56 -0
- package/src/components/like-button/README.md +13 -0
- package/src/components/like-button/element.ts +47 -0
- package/src/components/like-button/engine.ts +145 -0
- package/src/components/like-button/like-button.css +77 -0
- package/src/components/like-button/react.tsx +39 -0
- package/src/components/link-preview/README.md +19 -0
- package/src/components/link-preview/element.ts +29 -0
- package/src/components/link-preview/engine.ts +192 -0
- package/src/components/link-preview/link-preview.css +274 -0
- package/src/components/link-preview/react.tsx +101 -0
- package/src/components/loading-button/README.md +45 -0
- package/src/components/loading-button/element.ts +34 -0
- package/src/components/loading-button/engine.ts +201 -0
- package/src/components/loading-button/loading-button.css +76 -0
- package/src/components/loading-button/react.tsx +43 -0
- package/src/components/multi-select/README.md +48 -0
- package/src/components/multi-select/element.ts +28 -0
- package/src/components/multi-select/engine.ts +294 -0
- package/src/components/multi-select/multi-select.css +266 -0
- package/src/components/multi-select/react.tsx +39 -0
- package/src/components/nav/README.md +12 -10
- package/src/components/nav/element.ts +5 -5
- package/src/components/nav/engine.ts +21 -14
- package/src/components/nav/nav.css +102 -102
- package/src/components/nav/react.tsx +4 -4
- package/src/components/notification-bell/README.md +14 -0
- package/src/components/notification-bell/element.ts +48 -0
- package/src/components/notification-bell/engine.ts +202 -0
- package/src/components/notification-bell/notification-bell.css +126 -0
- package/src/components/notification-bell/react.tsx +57 -0
- package/src/components/orbit-menu/README.md +46 -0
- package/src/components/orbit-menu/element.ts +27 -0
- package/src/components/orbit-menu/engine.ts +179 -0
- package/src/components/orbit-menu/orbit-menu.css +129 -0
- package/src/components/orbit-menu/react.tsx +44 -0
- package/src/components/pagination/README.md +1 -1
- package/src/components/pagination/engine.ts +50 -4
- package/src/components/pagination/pagination.css +10 -5
- package/src/components/password-strength/README.md +17 -0
- package/src/components/password-strength/element.ts +22 -0
- package/src/components/password-strength/engine.ts +212 -0
- package/src/components/password-strength/password-strength.css +182 -0
- package/src/components/password-strength/react.tsx +36 -0
- package/src/components/password-strength/score.ts +62 -0
- package/src/components/pie-chart/README.md +48 -0
- package/src/components/pie-chart/element.ts +30 -0
- package/src/components/pie-chart/engine.ts +283 -0
- package/src/components/pie-chart/pie-chart.css +92 -0
- package/src/components/pie-chart/react.tsx +14 -0
- package/src/components/pill-button/README.md +46 -0
- package/src/components/pill-button/element.ts +16 -0
- package/src/components/pill-button/engine.ts +77 -0
- package/src/components/pill-button/pill-button.css +134 -0
- package/src/components/pill-button/react.tsx +32 -0
- package/src/components/popover/README.md +44 -0
- package/src/components/popover/element.ts +31 -0
- package/src/components/popover/engine.ts +114 -0
- package/src/components/popover/popover.css +24 -0
- package/src/components/popover/react.tsx +50 -0
- package/src/components/progress/README.md +17 -0
- package/src/components/progress/element.ts +30 -0
- package/src/components/progress/engine.ts +173 -0
- package/src/components/progress/progress.css +139 -0
- package/src/components/progress/react.tsx +35 -0
- package/src/components/questionnaire/README.md +32 -0
- package/src/components/questionnaire/element.ts +118 -0
- package/src/components/questionnaire/engine.ts +255 -0
- package/src/components/questionnaire/questionnaire.css +216 -0
- package/src/components/questionnaire/react.tsx +140 -0
- package/src/components/radar-chart/README.md +48 -0
- package/src/components/radar-chart/element.ts +30 -0
- package/src/components/radar-chart/engine.ts +327 -0
- package/src/components/radar-chart/radar-chart.css +72 -0
- package/src/components/radar-chart/react.tsx +14 -0
- package/src/components/radial-chart/README.md +48 -0
- package/src/components/radial-chart/element.ts +30 -0
- package/src/components/radial-chart/engine.ts +290 -0
- package/src/components/radial-chart/radial-chart.css +100 -0
- package/src/components/radial-chart/react.tsx +14 -0
- package/src/components/range-calendar/README.md +58 -0
- package/src/components/range-calendar/element.ts +42 -0
- package/src/components/range-calendar/engine.ts +390 -0
- package/src/components/range-calendar/range-calendar.css +185 -0
- package/src/components/range-calendar/react.tsx +56 -0
- package/src/components/range-slider/README.md +23 -0
- package/src/components/range-slider/element.ts +53 -0
- package/src/components/range-slider/engine.ts +316 -0
- package/src/components/range-slider/range-slider.css +191 -0
- package/src/components/range-slider/react.tsx +66 -0
- package/src/components/resizable-panel/README.md +61 -0
- package/src/components/resizable-panel/element.ts +36 -0
- package/src/components/resizable-panel/engine.ts +551 -0
- package/src/components/resizable-panel/react.tsx +74 -0
- package/src/components/resizable-panel/resizable-panel.css +242 -0
- package/src/components/rich-text-editor/README.md +57 -0
- package/src/components/rich-text-editor/element.ts +34 -0
- package/src/components/rich-text-editor/engine.ts +673 -0
- package/src/components/rich-text-editor/react.tsx +60 -0
- package/src/components/rich-text-editor/rich-text-editor.css +283 -0
- package/src/components/sankey-chart/README.md +48 -0
- package/src/components/sankey-chart/element.ts +31 -0
- package/src/components/sankey-chart/engine.ts +401 -0
- package/src/components/sankey-chart/react.tsx +14 -0
- package/src/components/sankey-chart/sankey-chart.css +60 -0
- package/src/components/scratch-card/README.md +15 -0
- package/src/components/scratch-card/element.ts +30 -0
- package/src/components/scratch-card/engine.ts +257 -0
- package/src/components/scratch-card/react.tsx +40 -0
- package/src/components/scratch-card/scratch-card.css +74 -0
- package/src/components/scroll-island/README.md +34 -0
- package/src/components/scroll-island/element.ts +16 -0
- package/src/components/scroll-island/engine.ts +252 -0
- package/src/components/scroll-island/react.tsx +26 -0
- package/src/components/scroll-island/scroll-island.css +110 -0
- package/src/components/select/README.md +34 -0
- package/src/components/select/element.ts +26 -0
- package/src/components/select/engine.ts +267 -0
- package/src/components/select/react.tsx +33 -0
- package/src/components/select/select.css +135 -0
- package/src/components/skeleton/README.md +15 -0
- package/src/components/skeleton/element.ts +32 -0
- package/src/components/skeleton/engine.ts +104 -0
- package/src/components/skeleton/react.tsx +41 -0
- package/src/components/skeleton/skeleton.css +107 -0
- package/src/components/split-view/README.md +50 -0
- package/src/components/split-view/element.ts +34 -0
- package/src/components/split-view/engine.ts +114 -0
- package/src/components/split-view/react.tsx +63 -0
- package/src/components/split-view/split-view.css +18 -0
- package/src/components/star-rating/README.md +14 -0
- package/src/components/star-rating/element.ts +26 -0
- package/src/components/star-rating/engine.ts +217 -0
- package/src/components/star-rating/react.tsx +33 -0
- package/src/components/star-rating/star-rating.css +79 -0
- package/src/components/stat-card/README.md +42 -0
- package/src/components/stat-card/element.ts +40 -0
- package/src/components/stat-card/engine.ts +283 -0
- package/src/components/stat-card/react.tsx +36 -0
- package/src/components/stat-card/stat-card.css +163 -0
- package/src/components/swipe-actions/README.md +19 -0
- package/src/components/swipe-actions/element.ts +26 -0
- package/src/components/swipe-actions/engine.ts +260 -0
- package/src/components/swipe-actions/react.tsx +80 -0
- package/src/components/swipe-actions/swipe-actions.css +104 -0
- package/src/components/tag-input/README.md +42 -0
- package/src/components/tag-input/element.ts +39 -0
- package/src/components/tag-input/engine.ts +313 -0
- package/src/components/tag-input/react.tsx +54 -0
- package/src/components/tag-input/tag-input.css +243 -0
- package/src/components/time-field/README.md +54 -0
- package/src/components/time-field/element.ts +38 -0
- package/src/components/time-field/engine.ts +110 -0
- package/src/components/time-field/react.tsx +45 -0
- package/src/components/time-field/time-field.css +87 -0
- package/src/components/timeline/README.md +57 -0
- package/src/components/timeline/element.ts +31 -0
- package/src/components/timeline/engine.ts +300 -0
- package/src/components/timeline/react.tsx +59 -0
- package/src/components/timeline/timeline.css +218 -0
- package/src/components/toolbar/README.md +46 -0
- package/src/components/toolbar/element.ts +30 -0
- package/src/components/toolbar/engine.ts +230 -0
- package/src/components/toolbar/react.tsx +34 -0
- package/src/components/toolbar/toolbar.css +121 -0
- package/src/components/tooltip/README.md +46 -0
- package/src/components/tooltip/element.ts +22 -0
- package/src/components/tooltip/engine.ts +288 -0
- package/src/components/tooltip/react.tsx +30 -0
- package/src/components/tooltip/tooltip.css +78 -0
- package/src/components/tree-view/README.md +61 -0
- package/src/components/tree-view/element.ts +32 -0
- package/src/components/tree-view/engine.ts +743 -0
- package/src/components/tree-view/react.tsx +82 -0
- package/src/components/tree-view/tree-view.css +288 -0
- package/src/components/virtual-list/README.md +81 -0
- package/src/components/virtual-list/element.ts +42 -0
- package/src/components/virtual-list/engine.ts +678 -0
- package/src/components/virtual-list/react.tsx +101 -0
- package/src/components/virtual-list/virtual-list.css +194 -0
- package/src/components/voice-dots/README.md +48 -0
- package/src/components/voice-dots/element.ts +45 -0
- package/src/components/voice-dots/engine.ts +243 -0
- package/src/components/voice-dots/react.tsx +52 -0
- package/src/components/voice-dots/voice-dots.css +69 -0
- package/src/core/chips.ts +196 -0
- package/src/core/color.ts +304 -0
- package/src/core/date-range.ts +67 -0
- package/src/core/dates.ts +11 -1
- package/src/core/files.ts +107 -0
- package/src/core/filter.ts +229 -0
- package/src/core/gsap.ts +80 -65
- package/src/core/listbox.ts +332 -0
- package/src/core/mark.ts +29 -0
- package/src/core/position.ts +89 -0
- package/src/core/relative-time.ts +77 -0
- package/src/core/segment-field.ts +373 -0
- package/src/core/segments.ts +153 -0
- package/src/core/tree.ts +116 -0
- package/src/core/virtual.ts +79 -0
- package/src/css/tokens.css +186 -182
- package/src/elements/index.ts +186 -0
- package/src/index.ts +88 -0
- package/src/motion/liquid.ts +14 -4
- package/src/motion/micro.ts +248 -0
- package/src/motion/sheet.ts +88 -65
- package/src/motion/surface.ts +9 -0
- package/src/react/index.ts +71 -1
- package/dist/chunk-IKQ5FODN.js +0 -1617
- package/dist/chunk-IKQ5FODN.js.map +0 -1
- package/dist/chunk-J6OCFNGU.js +0 -177
- package/dist/chunk-J6OCFNGU.js.map +0 -1
- package/dist/chunk-TFNRIZHU.js +0 -3977
- package/dist/chunk-TFNRIZHU.js.map +0 -1
- package/dist/chunk-XAKC2QY7.js.map +0 -1
- package/dist/reveal-jsX-uwUz.d.ts +0 -625
- package/dist/store-DYb3tTsZ.d.ts +0 -195
package/src/auto/auto-init.ts
CHANGED
|
@@ -17,6 +17,58 @@ import { createSticker } from '../recipes/sticker/create-sticker';
|
|
|
17
17
|
import { createScrollDock } from '../recipes/scroll-dock/create-scroll-dock';
|
|
18
18
|
import { createLocalClock } from '../recipes/local-clock/create-local-clock';
|
|
19
19
|
import { createTrailer } from '../components/trailer/engine';
|
|
20
|
+
import { createCreditCard } from '../components/credit-card/engine';
|
|
21
|
+
import { createCommandSearch } from '../components/command-search/engine';
|
|
22
|
+
import { createHoldConfirm } from '../components/hold-confirm/engine';
|
|
23
|
+
import { createImagePreview } from '../components/image-preview/engine';
|
|
24
|
+
import { createLikeButton } from '../components/like-button/engine';
|
|
25
|
+
import { createNotificationBell } from '../components/notification-bell/engine';
|
|
26
|
+
import { createPasswordStrength } from '../components/password-strength/engine';
|
|
27
|
+
import { createScratchCard } from '../components/scratch-card/engine';
|
|
28
|
+
import { createStarRating } from '../components/star-rating/engine';
|
|
29
|
+
import { createSwipeActions } from '../components/swipe-actions/engine';
|
|
30
|
+
import { createAttachment } from '../components/attachment/engine';
|
|
31
|
+
import { createSkeleton } from '../components/skeleton/engine';
|
|
32
|
+
import { createQuestionnaire } from '../components/questionnaire/engine';
|
|
33
|
+
import { createCodeBlock } from '../components/code-block/engine';
|
|
34
|
+
import { createContextMenu } from '../components/context-menu/engine';
|
|
35
|
+
import { createDrawer } from '../components/drawer/engine';
|
|
36
|
+
import { createLinkPreview } from '../components/link-preview/engine';
|
|
37
|
+
import { createProgress } from '../components/progress/engine';
|
|
38
|
+
import { createRangeSlider } from '../components/range-slider/engine';
|
|
39
|
+
import { createChart } from '../components/chart/engine';
|
|
40
|
+
import { createColorSlider } from '../components/color-slider/engine';
|
|
41
|
+
import { createColorArea } from '../components/color-area/engine';
|
|
42
|
+
import { createColorField } from '../components/color-field/engine';
|
|
43
|
+
import { createColorPicker } from '../components/color-picker/engine';
|
|
44
|
+
import { createTimeField } from '../components/time-field/engine';
|
|
45
|
+
import { createRangeCalendar } from '../components/range-calendar/engine';
|
|
46
|
+
import { createDateRangePicker } from '../components/date-range-picker/engine';
|
|
47
|
+
import { createTooltip } from '../components/tooltip/engine';
|
|
48
|
+
import { createPopover } from '../components/popover/engine';
|
|
49
|
+
import { createLoadingButton } from '../components/loading-button/engine';
|
|
50
|
+
import { createBreadcrumb } from '../components/breadcrumb/engine';
|
|
51
|
+
import { createEmptyState } from '../components/empty-state/engine';
|
|
52
|
+
import { createStatCard } from '../components/stat-card/engine';
|
|
53
|
+
import { createChartTooltip } from '../components/chart-tooltip/engine';
|
|
54
|
+
import { createMultiSelect } from '../components/multi-select/engine';
|
|
55
|
+
import { createTagInput } from '../components/tag-input/engine';
|
|
56
|
+
import { createDateTimePicker } from '../components/date-time-picker/engine';
|
|
57
|
+
import { createFilterBuilder } from '../components/filter-builder/engine';
|
|
58
|
+
import { createTimeline } from '../components/timeline/engine';
|
|
59
|
+
import { createActivityFeed } from '../components/activity-feed/engine';
|
|
60
|
+
import { createTreeView } from '../components/tree-view/engine';
|
|
61
|
+
import { createFileExplorer } from '../components/file-explorer/engine';
|
|
62
|
+
import { createJsonViewer } from '../components/json-viewer/engine';
|
|
63
|
+
import { createVirtualList } from '../components/virtual-list/engine';
|
|
64
|
+
import { createResizablePanel } from '../components/resizable-panel/engine';
|
|
65
|
+
import { createSplitView } from '../components/split-view/engine';
|
|
66
|
+
import { createDataTable } from '../components/data-table/engine';
|
|
67
|
+
import { createEditableTable } from '../components/editable-table/engine';
|
|
68
|
+
import { createRichTextEditor } from '../components/rich-text-editor/engine';
|
|
69
|
+
import { createSelect } from '../components/select/engine';
|
|
70
|
+
import { createAddToCart } from '../components/add-to-cart/engine';
|
|
71
|
+
import { createScrollIsland } from '../components/scroll-island/engine';
|
|
20
72
|
import { ScrollTrigger } from '../core/gsap';
|
|
21
73
|
import { warnOnce, type Instance } from '../core/types';
|
|
22
74
|
import { createSpringCards } from '../recipes/spring-cards/create-spring-cards';
|
|
@@ -73,6 +125,58 @@ const factories = {
|
|
|
73
125
|
'input-otp': createInputOtp,
|
|
74
126
|
'calendar': createCalendar,
|
|
75
127
|
'slot-picker': createSlotPicker,
|
|
128
|
+
'credit-card': createCreditCard,
|
|
129
|
+
'command-search': createCommandSearch,
|
|
130
|
+
'hold-confirm': createHoldConfirm,
|
|
131
|
+
'image-preview': createImagePreview,
|
|
132
|
+
'like-button': createLikeButton,
|
|
133
|
+
'notification-bell': createNotificationBell,
|
|
134
|
+
'password-strength': createPasswordStrength,
|
|
135
|
+
'scratch-card': createScratchCard,
|
|
136
|
+
'star-rating': createStarRating,
|
|
137
|
+
'swipe-actions': createSwipeActions,
|
|
138
|
+
'attachment': createAttachment,
|
|
139
|
+
'skeleton': createSkeleton,
|
|
140
|
+
'questionnaire': createQuestionnaire,
|
|
141
|
+
'code-block': createCodeBlock,
|
|
142
|
+
'context-menu': createContextMenu,
|
|
143
|
+
'drawer': createDrawer,
|
|
144
|
+
'link-preview': createLinkPreview,
|
|
145
|
+
'progress': createProgress,
|
|
146
|
+
'range-slider': createRangeSlider,
|
|
147
|
+
'chart': createChart,
|
|
148
|
+
'color-slider': createColorSlider,
|
|
149
|
+
'color-area': createColorArea,
|
|
150
|
+
'color-field': createColorField,
|
|
151
|
+
'color-picker': createColorPicker,
|
|
152
|
+
'time-field': createTimeField,
|
|
153
|
+
'range-calendar': createRangeCalendar,
|
|
154
|
+
'date-range-picker': createDateRangePicker,
|
|
155
|
+
'tooltip': createTooltip,
|
|
156
|
+
'popover': createPopover,
|
|
157
|
+
'loading-button': createLoadingButton,
|
|
158
|
+
'breadcrumb': createBreadcrumb,
|
|
159
|
+
'empty-state': createEmptyState,
|
|
160
|
+
'stat-card': createStatCard,
|
|
161
|
+
'chart-tooltip': createChartTooltip,
|
|
162
|
+
'multi-select': createMultiSelect,
|
|
163
|
+
'tag-input': createTagInput,
|
|
164
|
+
'date-time-picker': createDateTimePicker,
|
|
165
|
+
'filter-builder': createFilterBuilder,
|
|
166
|
+
'timeline': createTimeline,
|
|
167
|
+
'activity-feed': createActivityFeed,
|
|
168
|
+
'tree-view': createTreeView,
|
|
169
|
+
'file-explorer': createFileExplorer,
|
|
170
|
+
'json-viewer': createJsonViewer,
|
|
171
|
+
'virtual-list': createVirtualList,
|
|
172
|
+
'resizable-panel': createResizablePanel,
|
|
173
|
+
'split-view': createSplitView,
|
|
174
|
+
'data-table': createDataTable,
|
|
175
|
+
'editable-table': createEditableTable,
|
|
176
|
+
'rich-text-editor': createRichTextEditor,
|
|
177
|
+
'select': createSelect,
|
|
178
|
+
'add-to-cart': createAddToCart,
|
|
179
|
+
'scroll-island': createScrollIsland,
|
|
76
180
|
'weight-hover': createWeightHover,
|
|
77
181
|
'sticker': createSticker,
|
|
78
182
|
'scroll-dock': createScrollDock,
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
# activity-feed
|
|
2
|
+
|
|
3
|
+
Registro de acciones de usuarios en el sistema: lo más reciente arriba, agrupado por día («Hoy», «Ayer», «Lunes, 16 de noviembre»). Cada entrada tiene un avatar (foto, o iniciales sobre un color que sale del nombre, así cada persona conserva el suyo) con una insignia del tipo de acción, la frase «**Ana Gómez** comentó en <u>Tarea 12</u>», una hora relativa que se actualiza cada minuto y, si hace falta, una cita.
|
|
4
|
+
|
|
5
|
+
La actividad nueva (`prepend()`) entra arriba: las entradas de abajo se deslizan (el resorte de layout del kit, .62 s) mientras las nuevas caen saliendo de un blur y conservan un resaltado suave que se apaga. Si quien lee bajó por la lista, en lugar de moverle el contenido aparece una píldora «↑ 3 novedades» (el número rueda con cada llegada); al pulsarla sube y las mete. «Cargar más» al final pide entradas antiguas a `onLoadMore()` y las deja entrar en cascada; cuando ya no hay, lo dice.
|
|
6
|
+
|
|
7
|
+
## HTML / Astro
|
|
8
|
+
|
|
9
|
+
```html
|
|
10
|
+
<mk-activity-feed class="mk-activity-feed" style="--mk-af-height: 28rem"
|
|
11
|
+
items='[{"id":"1","actor":"Ana Gómez","action":"comentó en","target":"Tarea 12","href":"/tareas/12","time":"2026-11-23T09:12","kind":"comment","detail":"¿Lo vemos mañana?"},
|
|
12
|
+
{"id":"2","actor":{"name":"Luis Peña","avatar":"/luis.jpg"},"action":"cerró","target":"Tarea 9","time":"2026-11-22T18:40","kind":"complete"}]'></mk-activity-feed>
|
|
13
|
+
|
|
14
|
+
<script>
|
|
15
|
+
const feed = document.querySelector('mk-activity-feed');
|
|
16
|
+
// Llega algo en vivo (un socket, un intervalo…):
|
|
17
|
+
feed.prependItems([{ id: '3', actor: 'Sofía Ruiz', action: 'subió', target: 'propuesta.pdf', time: new Date(), kind: 'upload' }]);
|
|
18
|
+
// Entradas antiguas cuando quieras:
|
|
19
|
+
feed.appendItems(older);
|
|
20
|
+
</script>
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
## React
|
|
24
|
+
|
|
25
|
+
```tsx
|
|
26
|
+
const feed = useRef<ActivityFeedHandle>(null);
|
|
27
|
+
|
|
28
|
+
<ActivityFeed ref={feed} items={recent} onLoadMore={() => api.olderThan(cursor)} style={{ maxHeight: 448 }} />;
|
|
29
|
+
|
|
30
|
+
// después
|
|
31
|
+
feed.current?.prepend([nueva]);
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
## Opciones
|
|
35
|
+
|
|
36
|
+
| Opción | Atributo | Por defecto | Qué hace |
|
|
37
|
+
|---|---|---|---|
|
|
38
|
+
| `items` | `items` (JSON) | `[]` | `{ id, actor, action, target?, href?, time, detail?, kind? }[]`; `actor` es un nombre o `{ name, avatar? }`. |
|
|
39
|
+
| `onLoadMore()` | — | — | Muestra «Cargar más»; resuelve con las entradas anteriores o con `[]` cuando no hay más. |
|
|
40
|
+
| `locale` | `locale` | el `lang` más cercano | Idioma de las fechas. |
|
|
41
|
+
| `label` | `label` | `'Actividad'` | Nombre accesible. |
|
|
42
|
+
| `emptyLabel` | `empty-label` | `'Sin actividad todavía'` | Texto sin entradas. |
|
|
43
|
+
|
|
44
|
+
`kind` (la insignia): `comment`, `create`, `update`, `delete`, `upload`, `complete` o `mention`.
|
|
45
|
+
|
|
46
|
+
## API
|
|
47
|
+
|
|
48
|
+
`prepend(items)` (en el elemento, `prependItems`), `append(items)` (`appendItems`), `setItems(items)`, `items`, `destroy()`.
|
|
49
|
+
|
|
50
|
+
## Variables CSS
|
|
51
|
+
|
|
52
|
+
`--mk-af-height` (alto máximo antes de desplazarse dentro; también vale `max-height` en el elemento), `--mk-af-avatar-l` y `--mk-af-avatar-ink-l` (luminosidad del fondo y de las iniciales del avatar).
|
|
53
|
+
|
|
54
|
+
## Accesibilidad
|
|
55
|
+
|
|
56
|
+
Un `role="feed"` con cada entrada como `article`; las horas son `<time datetime>` con la fecha completa en su título. Un estado discreto anuncia lo nuevo («Sofía Ruiz subió propuesta.pdf», «3 novedades») y lo que se cargó. Al pulsar la píldora el foco pasa a la primera entrada nueva. Con movimiento reducido todo cambia sin animación.
|
|
@@ -0,0 +1,239 @@
|
|
|
1
|
+
/* activity-feed — day headings in small caps, entries on 12 px rows: a 2.25rem avatar (a picture, or initials on a hue
|
|
2
|
+
from the name) with a badge for the kind of action, the sentence, a quote on surface-3, a muted time. New entries
|
|
3
|
+
keep an accent-soft highlight that fades; the "novedades" pill sticks to the top. Give the root a max-height (or
|
|
4
|
+
--mk-af-height) to scroll inside it. */
|
|
5
|
+
.mk-activity-feed,
|
|
6
|
+
mk-activity-feed {
|
|
7
|
+
--mk-af-height: none;
|
|
8
|
+
--mk-af-avatar-l: 86%;
|
|
9
|
+
--mk-af-avatar-ink-l: 28%;
|
|
10
|
+
position: relative;
|
|
11
|
+
display: block;
|
|
12
|
+
max-height: var(--mk-af-height);
|
|
13
|
+
overflow-y: auto;
|
|
14
|
+
overscroll-behavior: contain;
|
|
15
|
+
color: var(--mk-text);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
@media (prefers-color-scheme: dark) {
|
|
19
|
+
:where(:root:not([data-mk-mode='light'])) :is(.mk-activity-feed, mk-activity-feed) {
|
|
20
|
+
--mk-af-avatar-l: 28%;
|
|
21
|
+
--mk-af-avatar-ink-l: 86%;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
:where(:root[data-mk-mode='dark']) :is(.mk-activity-feed, mk-activity-feed) {
|
|
26
|
+
--mk-af-avatar-l: 28%;
|
|
27
|
+
--mk-af-avatar-ink-l: 86%;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
[data-mk-af-new] {
|
|
31
|
+
position: sticky;
|
|
32
|
+
top: 0.5rem;
|
|
33
|
+
z-index: 2;
|
|
34
|
+
display: flex;
|
|
35
|
+
align-items: center;
|
|
36
|
+
gap: 0.15rem;
|
|
37
|
+
width: max-content;
|
|
38
|
+
height: 2rem;
|
|
39
|
+
margin: 0 auto 0.5rem;
|
|
40
|
+
padding: 0 0.9rem;
|
|
41
|
+
border: 0;
|
|
42
|
+
border-radius: 999px;
|
|
43
|
+
background: var(--mk-accent);
|
|
44
|
+
color: var(--mk-on-accent);
|
|
45
|
+
box-shadow: 0 8px 20px -8px color-mix(in srgb, var(--mk-shadow-color, #000) 45%, transparent);
|
|
46
|
+
font: inherit;
|
|
47
|
+
font-size: 0.8125rem;
|
|
48
|
+
font-weight: 600;
|
|
49
|
+
cursor: pointer;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
[data-mk-af-new][hidden] {
|
|
53
|
+
display: none;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
[data-mk-af-day] + [data-mk-af-day] {
|
|
57
|
+
margin-top: 1rem;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
/* Section > heading: strong enough for a page's own h3 rules (a card's `.card h3`, say). */
|
|
61
|
+
[data-mk-af-day] > [data-mk-af-heading] {
|
|
62
|
+
margin: 0 0 0.35rem;
|
|
63
|
+
padding: 0 0.5rem;
|
|
64
|
+
color: var(--mk-muted);
|
|
65
|
+
font-size: 0.75rem;
|
|
66
|
+
font-weight: 700;
|
|
67
|
+
letter-spacing: 0.04em;
|
|
68
|
+
text-transform: uppercase;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
[data-mk-af-day] ul {
|
|
72
|
+
display: grid;
|
|
73
|
+
gap: 0.15rem;
|
|
74
|
+
margin: 0;
|
|
75
|
+
padding: 0;
|
|
76
|
+
list-style: none;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
[data-mk-af-item] {
|
|
80
|
+
display: grid;
|
|
81
|
+
grid-template-columns: 2.25rem minmax(0, 1fr);
|
|
82
|
+
gap: 0.75rem;
|
|
83
|
+
padding: 0.6rem 0.5rem;
|
|
84
|
+
border-radius: 12px;
|
|
85
|
+
outline: none;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
[data-mk-af-item]:focus-visible {
|
|
89
|
+
box-shadow: inset 0 0 0 2px var(--mk-accent);
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
[data-mk-af-item][data-mk-fresh] {
|
|
93
|
+
animation: mk-af-fresh 2.4s ease-out both;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
@keyframes mk-af-fresh {
|
|
97
|
+
from {
|
|
98
|
+
background: color-mix(in srgb, var(--mk-accent-soft) 90%, transparent);
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
to {
|
|
102
|
+
background: transparent;
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
[data-mk-af-avatar] {
|
|
107
|
+
position: relative;
|
|
108
|
+
display: grid;
|
|
109
|
+
place-items: center;
|
|
110
|
+
width: 2.25rem;
|
|
111
|
+
height: 2.25rem;
|
|
112
|
+
border-radius: 50%;
|
|
113
|
+
background: hsl(var(--mk-af-hue, 210) 55% var(--mk-af-avatar-l));
|
|
114
|
+
color: hsl(var(--mk-af-hue, 210) 50% var(--mk-af-avatar-ink-l));
|
|
115
|
+
font-size: 0.8125rem;
|
|
116
|
+
font-weight: 700;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
[data-mk-af-avatar] img {
|
|
120
|
+
width: 100%;
|
|
121
|
+
height: 100%;
|
|
122
|
+
border-radius: 50%;
|
|
123
|
+
object-fit: cover;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
[data-mk-af-badge] {
|
|
127
|
+
position: absolute;
|
|
128
|
+
right: -3px;
|
|
129
|
+
bottom: -3px;
|
|
130
|
+
display: grid;
|
|
131
|
+
place-items: center;
|
|
132
|
+
width: 1.05rem;
|
|
133
|
+
height: 1.05rem;
|
|
134
|
+
border-radius: 50%;
|
|
135
|
+
background: var(--mk-text);
|
|
136
|
+
color: var(--mk-surface-1, var(--mk-bg));
|
|
137
|
+
box-shadow: 0 0 0 2px var(--mk-surface-1, var(--mk-bg));
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
[data-mk-af-badge='comment'],
|
|
141
|
+
[data-mk-af-badge='mention'] {
|
|
142
|
+
background: var(--mk-accent);
|
|
143
|
+
color: var(--mk-on-accent);
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
[data-mk-af-badge='complete'] {
|
|
147
|
+
background: #1f9d5b;
|
|
148
|
+
color: #fff;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
[data-mk-af-badge='delete'] {
|
|
152
|
+
background: var(--mk-error, #c62828);
|
|
153
|
+
color: var(--mk-on-error, #fff);
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
[data-mk-af-line] {
|
|
157
|
+
margin: 0;
|
|
158
|
+
font-size: 0.9375rem;
|
|
159
|
+
line-height: 1.45;
|
|
160
|
+
overflow-wrap: anywhere;
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
[data-mk-af-line] b {
|
|
164
|
+
font-weight: 600;
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
[data-mk-af-target] {
|
|
168
|
+
color: inherit;
|
|
169
|
+
font-weight: 600;
|
|
170
|
+
text-decoration: underline;
|
|
171
|
+
text-decoration-color: color-mix(in srgb, currentColor 30%, transparent);
|
|
172
|
+
text-underline-offset: 3px;
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
a[data-mk-af-target]:hover {
|
|
176
|
+
text-decoration-color: currentColor;
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
[data-mk-af-detail] {
|
|
180
|
+
margin: 0.4rem 0 0;
|
|
181
|
+
padding: 0.5rem 0.75rem;
|
|
182
|
+
border-radius: 10px;
|
|
183
|
+
background: var(--mk-surface-3);
|
|
184
|
+
font-size: 0.875rem;
|
|
185
|
+
line-height: 1.5;
|
|
186
|
+
overflow-wrap: anywhere;
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
[data-mk-af-time] {
|
|
190
|
+
display: block;
|
|
191
|
+
margin-top: 0.2rem;
|
|
192
|
+
color: var(--mk-muted);
|
|
193
|
+
font-size: 0.75rem;
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
[data-mk-af-more] {
|
|
197
|
+
display: block;
|
|
198
|
+
height: 2.25rem;
|
|
199
|
+
margin: 0.75rem auto 0;
|
|
200
|
+
padding: 0 1rem;
|
|
201
|
+
border: 0;
|
|
202
|
+
border-radius: 10px;
|
|
203
|
+
background: var(--mk-surface-3);
|
|
204
|
+
color: var(--mk-text);
|
|
205
|
+
font: inherit;
|
|
206
|
+
font-size: 0.875rem;
|
|
207
|
+
font-weight: 600;
|
|
208
|
+
cursor: pointer;
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
[data-mk-af-more][hidden],
|
|
212
|
+
[data-mk-af-empty][hidden] {
|
|
213
|
+
display: none;
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
[data-mk-af-more][aria-busy='true'] {
|
|
217
|
+
cursor: progress;
|
|
218
|
+
opacity: 0.7;
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
[data-mk-af-more]:focus-visible,
|
|
222
|
+
[data-mk-af-new]:focus-visible {
|
|
223
|
+
outline: 2px solid var(--mk-accent);
|
|
224
|
+
outline-offset: 2px;
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
[data-mk-af-end],
|
|
228
|
+
[data-mk-af-empty] {
|
|
229
|
+
margin: 0.75rem 0 0;
|
|
230
|
+
color: var(--mk-muted);
|
|
231
|
+
font-size: 0.875rem;
|
|
232
|
+
text-align: center;
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
@media (prefers-reduced-motion: reduce) {
|
|
236
|
+
[data-mk-af-item][data-mk-fresh] {
|
|
237
|
+
animation: none;
|
|
238
|
+
}
|
|
239
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { MkElement, defineElement, type OptionType } from '../../elements/base';
|
|
2
|
+
import { createActivityFeed, type ActivityFeedInstance, type ActivityItem } from './engine';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* <mk-activity-feed class="mk-activity-feed" items='[{"id":"1","actor":"Ana Gómez","action":"comentó en","target":"Tarea 12","time":"2026-11-23T09:12","kind":"comment"}]'>
|
|
6
|
+
* </mk-activity-feed>. element.prepend([...]) / element.append([...]) for live and older activity.
|
|
7
|
+
*/
|
|
8
|
+
export class MkActivityFeedElement extends MkElement<ActivityFeedInstance> {
|
|
9
|
+
static options: Record<string, OptionType> = { items: 'json', locale: 'string', label: 'string', emptyLabel: 'string' };
|
|
10
|
+
|
|
11
|
+
protected create(options: Record<string, unknown>) {
|
|
12
|
+
return createActivityFeed(this, options);
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
attributeChangedCallback(name: string, previous: string | null, next: string | null) {
|
|
16
|
+
if (previous === next || !this.instance) return;
|
|
17
|
+
if (name === 'items') {
|
|
18
|
+
try {
|
|
19
|
+
this.instance.setItems(JSON.parse(next ?? '[]') as ActivityItem[]);
|
|
20
|
+
} catch {
|
|
21
|
+
// Malformed JSON: keep the current entries.
|
|
22
|
+
}
|
|
23
|
+
} else super.attributeChangedCallback(name, previous, next);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
/** New activity on top (not Element.prepend). */
|
|
27
|
+
prependItems(items: ActivityItem[]) {
|
|
28
|
+
this.instance?.prepend(items);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
appendItems(items: ActivityItem[]) {
|
|
32
|
+
this.instance?.append(items);
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export const defineActivityFeed = () => defineElement('mk-activity-feed', MkActivityFeedElement);
|