@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/elements/index.ts
CHANGED
|
@@ -17,6 +17,68 @@ import { MkHoverCardElement } from '../components/hover-card/element';
|
|
|
17
17
|
import { MkInputOtpElement } from '../components/input-otp/element';
|
|
18
18
|
import { MkCalendarElement } from '../components/calendar/element';
|
|
19
19
|
import { MkSlotPickerElement } from '../components/slot-picker/element';
|
|
20
|
+
import { MkAttachmentElement } from '../components/attachment/element';
|
|
21
|
+
import { MkSkeletonElement } from '../components/skeleton/element';
|
|
22
|
+
import { MkQuestionnaireElement } from '../components/questionnaire/element';
|
|
23
|
+
import { MkCodeBlockElement } from '../components/code-block/element';
|
|
24
|
+
import { MkContextMenuElement } from '../components/context-menu/element';
|
|
25
|
+
import { MkDrawerElement } from '../components/drawer/element';
|
|
26
|
+
import { MkLinkPreviewElement } from '../components/link-preview/element';
|
|
27
|
+
import { MkProgressElement } from '../components/progress/element';
|
|
28
|
+
import { MkRangeSliderElement } from '../components/range-slider/element';
|
|
29
|
+
import { MkChartElement } from '../components/chart/element';
|
|
30
|
+
import { MkCreditCardElement } from '../components/credit-card/element';
|
|
31
|
+
import { MkCommandSearchElement } from '../components/command-search/element';
|
|
32
|
+
import { MkHoldConfirmElement } from '../components/hold-confirm/element';
|
|
33
|
+
import { MkImagePreviewElement } from '../components/image-preview/element';
|
|
34
|
+
import { MkLikeButtonElement } from '../components/like-button/element';
|
|
35
|
+
import { MkNotificationBellElement } from '../components/notification-bell/element';
|
|
36
|
+
import { MkPasswordStrengthElement } from '../components/password-strength/element';
|
|
37
|
+
import { MkScratchCardElement } from '../components/scratch-card/element';
|
|
38
|
+
import { MkStarRatingElement } from '../components/star-rating/element';
|
|
39
|
+
import { MkSwipeActionsElement } from '../components/swipe-actions/element';
|
|
40
|
+
import { MkColorSliderElement } from '../components/color-slider/element';
|
|
41
|
+
import { MkColorAreaElement } from '../components/color-area/element';
|
|
42
|
+
import { MkColorFieldElement } from '../components/color-field/element';
|
|
43
|
+
import { MkColorPickerElement } from '../components/color-picker/element';
|
|
44
|
+
import { MkTimeFieldElement } from '../components/time-field/element';
|
|
45
|
+
import { MkRangeCalendarElement } from '../components/range-calendar/element';
|
|
46
|
+
import { MkDateRangePickerElement } from '../components/date-range-picker/element';
|
|
47
|
+
import { MkTooltipElement } from '../components/tooltip/element';
|
|
48
|
+
import { MkPopoverElement } from '../components/popover/element';
|
|
49
|
+
import { MkLoadingButtonElement } from '../components/loading-button/element';
|
|
50
|
+
import { MkBreadcrumbElement } from '../components/breadcrumb/element';
|
|
51
|
+
import { MkEmptyStateElement } from '../components/empty-state/element';
|
|
52
|
+
import { MkStatCardElement } from '../components/stat-card/element';
|
|
53
|
+
import { MkChartTooltipElement } from '../components/chart-tooltip/element';
|
|
54
|
+
import { MkMultiSelectElement } from '../components/multi-select/element';
|
|
55
|
+
import { MkTagInputElement } from '../components/tag-input/element';
|
|
56
|
+
import { MkDateTimePickerElement } from '../components/date-time-picker/element';
|
|
57
|
+
import { MkFilterBuilderElement } from '../components/filter-builder/element';
|
|
58
|
+
import { MkTimelineElement } from '../components/timeline/element';
|
|
59
|
+
import { MkActivityFeedElement } from '../components/activity-feed/element';
|
|
60
|
+
import { MkTreeViewElement } from '../components/tree-view/element';
|
|
61
|
+
import { MkFileExplorerElement } from '../components/file-explorer/element';
|
|
62
|
+
import { MkJsonViewerElement } from '../components/json-viewer/element';
|
|
63
|
+
import { MkVirtualListElement } from '../components/virtual-list/element';
|
|
64
|
+
import { MkResizablePanelElement } from '../components/resizable-panel/element';
|
|
65
|
+
import { MkSplitViewElement } from '../components/split-view/element';
|
|
66
|
+
import { MkDataTableElement } from '../components/data-table/element';
|
|
67
|
+
import { MkEditableTableElement } from '../components/editable-table/element';
|
|
68
|
+
import { MkRichTextEditorElement } from '../components/rich-text-editor/element';
|
|
69
|
+
import { MkSelectElement } from '../components/select/element';
|
|
70
|
+
import { MkAddToCartElement } from '../components/add-to-cart/element';
|
|
71
|
+
import { MkScrollIslandElement } from '../components/scroll-island/element';
|
|
72
|
+
import { MkPillButtonElement } from '../components/pill-button/element';
|
|
73
|
+
import { MkToolbarElement } from '../components/toolbar/element';
|
|
74
|
+
import { MkBidirectionalSliderElement } from '../components/bidirectional-slider/element';
|
|
75
|
+
import { MkVoiceDotsElement } from '../components/voice-dots/element';
|
|
76
|
+
import { MkPieChartElement } from '../components/pie-chart/element';
|
|
77
|
+
import { MkRadarChartElement } from '../components/radar-chart/element';
|
|
78
|
+
import { MkRadialChartElement } from '../components/radial-chart/element';
|
|
79
|
+
import { MkSankeyChartElement } from '../components/sankey-chart/element';
|
|
80
|
+
import { MkHeatmapChartElement } from '../components/heatmap-chart/element';
|
|
81
|
+
import { MkOrbitMenuElement } from '../components/orbit-menu/element';
|
|
20
82
|
// new-component:imports (scripts/new-component.mjs inserts above this line)
|
|
21
83
|
|
|
22
84
|
export { MkElement, SafeHTMLElement, defineElement, type OptionType } from './base';
|
|
@@ -39,6 +101,68 @@ export { MkStudioDockElement, defineStudioDock } from '../components/studio-dock
|
|
|
39
101
|
export { MkTrailerElement, defineTrailer } from '../components/trailer/element';
|
|
40
102
|
export { MkCalendarElement } from '../components/calendar/element';
|
|
41
103
|
export { MkSlotPickerElement } from '../components/slot-picker/element';
|
|
104
|
+
export { MkAttachmentElement } from '../components/attachment/element';
|
|
105
|
+
export { MkSkeletonElement } from '../components/skeleton/element';
|
|
106
|
+
export { MkQuestionnaireElement } from '../components/questionnaire/element';
|
|
107
|
+
export { MkCodeBlockElement } from '../components/code-block/element';
|
|
108
|
+
export { MkContextMenuElement } from '../components/context-menu/element';
|
|
109
|
+
export { MkDrawerElement } from '../components/drawer/element';
|
|
110
|
+
export { MkLinkPreviewElement } from '../components/link-preview/element';
|
|
111
|
+
export { MkProgressElement } from '../components/progress/element';
|
|
112
|
+
export { MkRangeSliderElement } from '../components/range-slider/element';
|
|
113
|
+
export { MkChartElement } from '../components/chart/element';
|
|
114
|
+
export { MkCreditCardElement } from '../components/credit-card/element';
|
|
115
|
+
export { MkCommandSearchElement } from '../components/command-search/element';
|
|
116
|
+
export { MkHoldConfirmElement } from '../components/hold-confirm/element';
|
|
117
|
+
export { MkImagePreviewElement } from '../components/image-preview/element';
|
|
118
|
+
export { MkLikeButtonElement } from '../components/like-button/element';
|
|
119
|
+
export { MkNotificationBellElement } from '../components/notification-bell/element';
|
|
120
|
+
export { MkPasswordStrengthElement } from '../components/password-strength/element';
|
|
121
|
+
export { MkScratchCardElement } from '../components/scratch-card/element';
|
|
122
|
+
export { MkStarRatingElement } from '../components/star-rating/element';
|
|
123
|
+
export { MkSwipeActionsElement } from '../components/swipe-actions/element';
|
|
124
|
+
export { MkColorSliderElement } from '../components/color-slider/element';
|
|
125
|
+
export { MkColorAreaElement } from '../components/color-area/element';
|
|
126
|
+
export { MkColorFieldElement } from '../components/color-field/element';
|
|
127
|
+
export { MkColorPickerElement } from '../components/color-picker/element';
|
|
128
|
+
export { MkTimeFieldElement } from '../components/time-field/element';
|
|
129
|
+
export { MkRangeCalendarElement } from '../components/range-calendar/element';
|
|
130
|
+
export { MkDateRangePickerElement } from '../components/date-range-picker/element';
|
|
131
|
+
export { MkTooltipElement } from '../components/tooltip/element';
|
|
132
|
+
export { MkPopoverElement } from '../components/popover/element';
|
|
133
|
+
export { MkLoadingButtonElement } from '../components/loading-button/element';
|
|
134
|
+
export { MkBreadcrumbElement } from '../components/breadcrumb/element';
|
|
135
|
+
export { MkEmptyStateElement } from '../components/empty-state/element';
|
|
136
|
+
export { MkStatCardElement } from '../components/stat-card/element';
|
|
137
|
+
export { MkChartTooltipElement } from '../components/chart-tooltip/element';
|
|
138
|
+
export { MkMultiSelectElement } from '../components/multi-select/element';
|
|
139
|
+
export { MkTagInputElement } from '../components/tag-input/element';
|
|
140
|
+
export { MkDateTimePickerElement } from '../components/date-time-picker/element';
|
|
141
|
+
export { MkFilterBuilderElement } from '../components/filter-builder/element';
|
|
142
|
+
export { MkTimelineElement } from '../components/timeline/element';
|
|
143
|
+
export { MkActivityFeedElement } from '../components/activity-feed/element';
|
|
144
|
+
export { MkTreeViewElement } from '../components/tree-view/element';
|
|
145
|
+
export { MkFileExplorerElement } from '../components/file-explorer/element';
|
|
146
|
+
export { MkJsonViewerElement } from '../components/json-viewer/element';
|
|
147
|
+
export { MkVirtualListElement } from '../components/virtual-list/element';
|
|
148
|
+
export { MkResizablePanelElement } from '../components/resizable-panel/element';
|
|
149
|
+
export { MkSplitViewElement } from '../components/split-view/element';
|
|
150
|
+
export { MkDataTableElement } from '../components/data-table/element';
|
|
151
|
+
export { MkEditableTableElement } from '../components/editable-table/element';
|
|
152
|
+
export { MkRichTextEditorElement } from '../components/rich-text-editor/element';
|
|
153
|
+
export { MkSelectElement } from '../components/select/element';
|
|
154
|
+
export { MkAddToCartElement } from '../components/add-to-cart/element';
|
|
155
|
+
export { MkScrollIslandElement } from '../components/scroll-island/element';
|
|
156
|
+
export { MkPillButtonElement } from '../components/pill-button/element';
|
|
157
|
+
export { MkToolbarElement } from '../components/toolbar/element';
|
|
158
|
+
export { MkBidirectionalSliderElement } from '../components/bidirectional-slider/element';
|
|
159
|
+
export { MkVoiceDotsElement } from '../components/voice-dots/element';
|
|
160
|
+
export { MkPieChartElement } from '../components/pie-chart/element';
|
|
161
|
+
export { MkRadarChartElement } from '../components/radar-chart/element';
|
|
162
|
+
export { MkRadialChartElement } from '../components/radial-chart/element';
|
|
163
|
+
export { MkSankeyChartElement } from '../components/sankey-chart/element';
|
|
164
|
+
export { MkHeatmapChartElement } from '../components/heatmap-chart/element';
|
|
165
|
+
export { MkOrbitMenuElement } from '../components/orbit-menu/element';
|
|
42
166
|
// new-component:exports
|
|
43
167
|
|
|
44
168
|
/** Tag name → element class, for every component. */
|
|
@@ -61,6 +185,68 @@ export const ELEMENTS = {
|
|
|
61
185
|
'mk-trailer': MkTrailerElement,
|
|
62
186
|
'mk-calendar': MkCalendarElement,
|
|
63
187
|
'mk-slot-picker': MkSlotPickerElement,
|
|
188
|
+
'mk-attachment': MkAttachmentElement,
|
|
189
|
+
'mk-skeleton': MkSkeletonElement,
|
|
190
|
+
'mk-questionnaire': MkQuestionnaireElement,
|
|
191
|
+
'mk-code-block': MkCodeBlockElement,
|
|
192
|
+
'mk-context-menu': MkContextMenuElement,
|
|
193
|
+
'mk-drawer': MkDrawerElement,
|
|
194
|
+
'mk-link-preview': MkLinkPreviewElement,
|
|
195
|
+
'mk-progress': MkProgressElement,
|
|
196
|
+
'mk-range-slider': MkRangeSliderElement,
|
|
197
|
+
'mk-chart': MkChartElement,
|
|
198
|
+
'mk-credit-card': MkCreditCardElement,
|
|
199
|
+
'mk-command-search': MkCommandSearchElement,
|
|
200
|
+
'mk-hold-confirm': MkHoldConfirmElement,
|
|
201
|
+
'mk-image-preview': MkImagePreviewElement,
|
|
202
|
+
'mk-like-button': MkLikeButtonElement,
|
|
203
|
+
'mk-notification-bell': MkNotificationBellElement,
|
|
204
|
+
'mk-password-strength': MkPasswordStrengthElement,
|
|
205
|
+
'mk-scratch-card': MkScratchCardElement,
|
|
206
|
+
'mk-star-rating': MkStarRatingElement,
|
|
207
|
+
'mk-swipe-actions': MkSwipeActionsElement,
|
|
208
|
+
'mk-color-slider': MkColorSliderElement,
|
|
209
|
+
'mk-color-area': MkColorAreaElement,
|
|
210
|
+
'mk-color-field': MkColorFieldElement,
|
|
211
|
+
'mk-color-picker': MkColorPickerElement,
|
|
212
|
+
'mk-time-field': MkTimeFieldElement,
|
|
213
|
+
'mk-range-calendar': MkRangeCalendarElement,
|
|
214
|
+
'mk-date-range-picker': MkDateRangePickerElement,
|
|
215
|
+
'mk-tooltip': MkTooltipElement,
|
|
216
|
+
'mk-popover': MkPopoverElement,
|
|
217
|
+
'mk-loading-button': MkLoadingButtonElement,
|
|
218
|
+
'mk-breadcrumb': MkBreadcrumbElement,
|
|
219
|
+
'mk-empty-state': MkEmptyStateElement,
|
|
220
|
+
'mk-stat-card': MkStatCardElement,
|
|
221
|
+
'mk-chart-tooltip': MkChartTooltipElement,
|
|
222
|
+
'mk-multi-select': MkMultiSelectElement,
|
|
223
|
+
'mk-tag-input': MkTagInputElement,
|
|
224
|
+
'mk-date-time-picker': MkDateTimePickerElement,
|
|
225
|
+
'mk-filter-builder': MkFilterBuilderElement,
|
|
226
|
+
'mk-timeline': MkTimelineElement,
|
|
227
|
+
'mk-activity-feed': MkActivityFeedElement,
|
|
228
|
+
'mk-tree-view': MkTreeViewElement,
|
|
229
|
+
'mk-file-explorer': MkFileExplorerElement,
|
|
230
|
+
'mk-json-viewer': MkJsonViewerElement,
|
|
231
|
+
'mk-virtual-list': MkVirtualListElement,
|
|
232
|
+
'mk-resizable-panel': MkResizablePanelElement,
|
|
233
|
+
'mk-split-view': MkSplitViewElement,
|
|
234
|
+
'mk-data-table': MkDataTableElement,
|
|
235
|
+
'mk-editable-table': MkEditableTableElement,
|
|
236
|
+
'mk-rich-text-editor': MkRichTextEditorElement,
|
|
237
|
+
'mk-select': MkSelectElement,
|
|
238
|
+
'mk-add-to-cart': MkAddToCartElement,
|
|
239
|
+
'mk-scroll-island': MkScrollIslandElement,
|
|
240
|
+
'mk-pill-button': MkPillButtonElement,
|
|
241
|
+
'mk-toolbar': MkToolbarElement,
|
|
242
|
+
'mk-bidirectional-slider': MkBidirectionalSliderElement,
|
|
243
|
+
'mk-voice-dots': MkVoiceDotsElement,
|
|
244
|
+
'mk-pie-chart': MkPieChartElement,
|
|
245
|
+
'mk-radar-chart': MkRadarChartElement,
|
|
246
|
+
'mk-radial-chart': MkRadialChartElement,
|
|
247
|
+
'mk-sankey-chart': MkSankeyChartElement,
|
|
248
|
+
'mk-heatmap-chart': MkHeatmapChartElement,
|
|
249
|
+
'mk-orbit-menu': MkOrbitMenuElement,
|
|
64
250
|
// new-component:entries
|
|
65
251
|
} as const;
|
|
66
252
|
|
package/src/index.ts
CHANGED
|
@@ -153,9 +153,12 @@ export {
|
|
|
153
153
|
createNav,
|
|
154
154
|
revealShell,
|
|
155
155
|
NAV_STYLES,
|
|
156
|
+
NAV_STYLE_ALIASES,
|
|
157
|
+
toNavStyle,
|
|
156
158
|
type NavOptions,
|
|
157
159
|
type NavInstance,
|
|
158
160
|
type NavStyle,
|
|
161
|
+
type NavStyleAlias,
|
|
159
162
|
type NavigateDetail,
|
|
160
163
|
} from './components/nav/engine';
|
|
161
164
|
export { createSteps, type StepsOptions, type StepsInstance, type StepDetail } from './components/steps/engine';
|
|
@@ -200,3 +203,88 @@ export { createWeightHover, type WeightHoverOptions, type WeightHoverInstance }
|
|
|
200
203
|
export { createSticker, type StickerOptions, type StickerInstance, type StickerState } from './recipes/sticker/create-sticker';
|
|
201
204
|
export { createScrollDock, type ScrollDockOptions, type ScrollDockInstance } from './recipes/scroll-dock/create-scroll-dock';
|
|
202
205
|
export { createLocalClock, type LocalClockOptions, type LocalClockInstance } from './recipes/local-clock/create-local-clock';
|
|
206
|
+
export { createAttachment, acceptsFile, describeAccept, formatBytes, type AttachmentOptions, type AttachmentInstance, type AttachmentFile, type AttachmentStatus, type AttachmentRejection, type AttachmentRejectCode, type AttachmentLabels } from './components/attachment/engine';
|
|
207
|
+
export { createSkeleton, skeletonBones, type SkeletonOptions, type SkeletonInstance, type SkeletonShape, type SkeletonAnimation } from './components/skeleton/engine';
|
|
208
|
+
export { createQuestionnaire, readAnswers, type QuestionnaireOptions, type QuestionnaireInstance, type QuestionnaireAnswers, type QuestionnaireLabels } from './components/questionnaire/engine';
|
|
209
|
+
export { createCodeBlock, codeLines, type CodeBlockOptions, type CodeBlockInstance } from './components/code-block/engine';
|
|
210
|
+
export { createContextMenu, type ContextMenuOptions, type ContextMenuInstance } from './components/context-menu/engine';
|
|
211
|
+
export { createDrawer, type DrawerOptions, type DrawerInstance, type DrawerSide } from './components/drawer/engine';
|
|
212
|
+
export { createLinkPreview, safeHref, safeImage, linkDomain, type LinkPreviewOptions, type LinkPreviewInstance, type LinkPreviewVariant } from './components/link-preview/engine';
|
|
213
|
+
export { createProgress, type ProgressOptions, type ProgressInstance, type ProgressVariant } from './components/progress/engine';
|
|
214
|
+
export { createRangeSlider, type RangeSliderOptions, type RangeSliderInstance, type RangeValue } from './components/range-slider/engine';
|
|
215
|
+
export { createChart, type ChartOptions, type ChartInstance, type ChartSeries, type ChartPoint, type ChartType } from './components/chart/engine';
|
|
216
|
+
export { press, blurIn, blurOut, collapse, shake, ringPulse, burst, rollDigits, type BlurInOptions, type BurstOptions } from './motion/micro';
|
|
217
|
+
export { createCreditCard, type CreditCardOptions, type CreditCardInstance, type CreditCardField, type CreditCardValues, type CreditCardLabels } from './components/credit-card/engine';
|
|
218
|
+
export { detectBrand, formatNumber, luhn, parseExpiry, cardLength, cvcLength, BRAND_LABELS, type CardBrand, type Expiry } from './components/credit-card/card';
|
|
219
|
+
export { createCommandSearch, type CommandSearchOptions, type CommandSearchInstance, type CommandItem } from './components/command-search/engine';
|
|
220
|
+
export { matchScore, type Match } from './components/command-search/match';
|
|
221
|
+
export { createHoldConfirm, type HoldConfirmOptions, type HoldConfirmInstance } from './components/hold-confirm/engine';
|
|
222
|
+
export { createImagePreview, type ImagePreviewOptions, type ImagePreviewInstance } from './components/image-preview/engine';
|
|
223
|
+
export { createLikeButton, type LikeButtonOptions, type LikeButtonInstance } from './components/like-button/engine';
|
|
224
|
+
export { createNotificationBell, type NotificationBellOptions, type NotificationBellInstance } from './components/notification-bell/engine';
|
|
225
|
+
export { createPasswordStrength, type PasswordStrengthOptions, type PasswordStrengthInstance } from './components/password-strength/engine';
|
|
226
|
+
export { scorePassword, STRENGTH_LABELS, type PasswordScore, type PasswordChecks } from './components/password-strength/score';
|
|
227
|
+
export { createScratchCard, type ScratchCardOptions, type ScratchCardInstance } from './components/scratch-card/engine';
|
|
228
|
+
export { createStarRating, type StarRatingOptions, type StarRatingInstance } from './components/star-rating/engine';
|
|
229
|
+
export { createSwipeActions, type SwipeActionsOptions, type SwipeActionsInstance, type SwipeSide } from './components/swipe-actions/engine';
|
|
230
|
+
export { tokenize, renderCode, languageFamily, type Token, type TokenType } from './components/code-block/highlight';
|
|
231
|
+
export { createColorSlider, type ColorSliderOptions, type ColorSliderInstance } from './components/color-slider/engine';
|
|
232
|
+
export { createColorArea, type ColorAreaOptions, type ColorAreaInstance } from './components/color-area/engine';
|
|
233
|
+
export { createColorField, type ColorFieldOptions, type ColorFieldInstance } from './components/color-field/engine';
|
|
234
|
+
export { createColorPicker, type ColorPickerOptions, type ColorPickerInstance } from './components/color-picker/engine';
|
|
235
|
+
export { createTimeField, type TimeFieldOptions, type TimeFieldInstance } from './components/time-field/engine';
|
|
236
|
+
export { createRangeCalendar, bandDuration, type RangeCalendarOptions, type RangeCalendarInstance } from './components/range-calendar/engine';
|
|
237
|
+
export { createDateRangePicker, type DateRangePickerOptions, type DateRangePickerInstance } from './components/date-range-picker/engine';
|
|
238
|
+
export {
|
|
239
|
+
parseColor, formatColor, toHex, toHsva, hsvToRgb, rgbToHsv, getChannel, setChannel, channelText, luminance, CHANNEL_LABELS,
|
|
240
|
+
type Hsva, type Rgba, type Hsla, type ColorFormat, type ColorChannel,
|
|
241
|
+
} from './core/color';
|
|
242
|
+
export { parseTime, formatTime, type TimeValue } from './core/segments';
|
|
243
|
+
export { toRange, rangeKeys, rangeLength, type DateRange } from './core/date-range';
|
|
244
|
+
export { createTooltip, type TooltipOptions, type TooltipInstance } from './components/tooltip/engine';
|
|
245
|
+
export { place, type Placement, type Side, type Placed } from './core/position';
|
|
246
|
+
export { createPopover, type PopoverOptions, type PopoverInstance } from './components/popover/engine';
|
|
247
|
+
export { createLoadingButton, type LoadingButtonOptions, type LoadingButtonInstance, type LoadingState } from './components/loading-button/engine';
|
|
248
|
+
export { createBreadcrumb, type BreadcrumbOptions, type BreadcrumbInstance, type BreadcrumbItem } from './components/breadcrumb/engine';
|
|
249
|
+
export { createEmptyState, type EmptyStateOptions, type EmptyStateInstance, type EmptyIllustration, type EmptyAction } from './components/empty-state/engine';
|
|
250
|
+
export { createStatCard, type StatCardOptions, type StatCardInstance } from './components/stat-card/engine';
|
|
251
|
+
export { createChartTooltip, type ChartTooltipOptions, type ChartTooltipInstance, type ChartTooltipSeries } from './components/chart-tooltip/engine';
|
|
252
|
+
export { createMultiSelect, type MultiSelectOptions, type MultiSelectInstance, type MultiSelectOption } from './components/multi-select/engine';
|
|
253
|
+
export { createTagInput, type TagInputOptions, type TagInputInstance } from './components/tag-input/engine';
|
|
254
|
+
export { createDateTimePicker, toDateTimeValue, dateTimeKey, type DateTimePickerOptions, type DateTimePickerInstance } from './components/date-time-picker/engine';
|
|
255
|
+
export { createFilterBuilder, type FilterBuilderOptions, type FilterBuilderInstance } from './components/filter-builder/engine';
|
|
256
|
+
export {
|
|
257
|
+
matchesFilter, describeFilter, emptyFilter, hasConditions, OPERATORS,
|
|
258
|
+
type FilterField, type FilterFieldType, type FilterGroup, type FilterRule, type FilterNode, type FilterValue,
|
|
259
|
+
} from './core/filter';
|
|
260
|
+
export { createTimeline, type TimelineOptions, type TimelineInstance, type TimelineEvent, type TimelineStatus } from './components/timeline/engine';
|
|
261
|
+
export { relativeTime, dayLabel, type TimeInput } from './core/relative-time';
|
|
262
|
+
export { createActivityFeed, type ActivityFeedOptions, type ActivityFeedInstance, type ActivityItem, type ActivityActor, type ActivityKind } from './components/activity-feed/engine';
|
|
263
|
+
export { createTreeView, type TreeViewOptions, type TreeViewInstance } from './components/tree-view/engine';
|
|
264
|
+
export { findNode, checkStates, toggleCheck, searchTree, type TreeNode, type CheckState } from './core/tree';
|
|
265
|
+
export { createFileExplorer, type FileExplorerOptions, type FileExplorerInstance, type FileView, type FileChange } from './components/file-explorer/engine';
|
|
266
|
+
export { formatSize, fileFamily, sortEntries, type FileEntry, type FileFamily, type FileSort } from './core/files';
|
|
267
|
+
export { createJsonViewer, jsonPath, type JsonViewerOptions, type JsonViewerInstance, type JsonType } from './components/json-viewer/engine';
|
|
268
|
+
export { createVirtualList, type VirtualListOptions, type VirtualListInstance, type VirtualKey, type VirtualScrollOptions } from './components/virtual-list/engine';
|
|
269
|
+
export { createSizes, type VirtualSizes, type VirtualRange } from './core/virtual';
|
|
270
|
+
export { createResizablePanel, normaliseSizes, type ResizablePanelOptions, type ResizablePanelInstance, type PanelOrientation } from './components/resizable-panel/engine';
|
|
271
|
+
export { createSplitView, type SplitViewOptions, type SplitViewInstance, type SplitSide } from './components/split-view/engine';
|
|
272
|
+
export {
|
|
273
|
+
createDataTable,
|
|
274
|
+
type DataTableOptions, type DataTableInstance, type DataColumn, type DataColumnType, type DataAction, type DataRow, type DataSort, type RowId, type SortDirection,
|
|
275
|
+
} from './components/data-table/engine';
|
|
276
|
+
export { createEditableTable, type EditableTableOptions, type EditableTableInstance, type EditableColumn, type RowChange, type EditorKind } from './components/editable-table/engine';
|
|
277
|
+
export { createRichTextEditor, sanitizeHtml, type RichTextEditorOptions, type RichTextEditorInstance, type RichCommand } from './components/rich-text-editor/engine';
|
|
278
|
+
export { createSelect, type SelectOptions, type SelectInstance, type SelectOption } from './components/select/engine';
|
|
279
|
+
export { createAddToCart, type AddToCartOptions, type AddToCartInstance } from './components/add-to-cart/engine';
|
|
280
|
+
export { createScrollIsland, type ScrollIslandOptions, type ScrollIslandInstance } from './components/scroll-island/engine';
|
|
281
|
+
export { createPillButton, type PillButtonOptions, type PillButtonInstance } from './components/pill-button/engine';
|
|
282
|
+
export { createToolbar, type ToolbarOptions, type ToolbarInstance } from './components/toolbar/engine';
|
|
283
|
+
export { createBidirectionalSlider, type BidirectionalSliderOptions, type BidirectionalSliderInstance } from './components/bidirectional-slider/engine';
|
|
284
|
+
export { createVoiceDots, type VoiceDotsOptions, type VoiceDotsInstance, type VoiceState } from './components/voice-dots/engine';
|
|
285
|
+
export { createPieChart, type PieChartOptions, type PieChartInstance, type PieSlice } from './components/pie-chart/engine';
|
|
286
|
+
export { createRadarChart, type RadarChartOptions, type RadarChartInstance, type RadarSeries } from './components/radar-chart/engine';
|
|
287
|
+
export { createRadialChart, type RadialChartOptions, type RadialChartInstance, type RadialDatum } from './components/radial-chart/engine';
|
|
288
|
+
export { createSankeyChart, type SankeyChartOptions, type SankeyChartInstance, type SankeyNode, type SankeyLink } from './components/sankey-chart/engine';
|
|
289
|
+
export { createHeatmapChart, type HeatmapChartOptions, type HeatmapChartInstance, type HeatmapDatum } from './components/heatmap-chart/engine';
|
|
290
|
+
export { createOrbitMenu, type OrbitMenuOptions, type OrbitMenuInstance } from './components/orbit-menu/engine';
|
package/src/motion/liquid.ts
CHANGED
|
@@ -9,7 +9,9 @@ import { transparentColor } from './surface';
|
|
|
9
9
|
* a "goo" filter (blur 20, alpha threshold 19·a − 9), so while the surface's
|
|
10
10
|
* blob swings out of the opener on a spring (144/14, kick 2400 px/s) they
|
|
11
11
|
* stretch and merge like a liquid; the content zooms in from twice its size.
|
|
12
|
-
* Each property runs on its own channel, as in the source.
|
|
12
|
+
* Each property runs on its own channel, as in the source. The goo only works
|
|
13
|
+
* while the shape leaves the opener: then the filter goes, so the rest of the
|
|
14
|
+
* travel is drawn sharp, and it settles as soon as the springs rest.
|
|
13
15
|
*/
|
|
14
16
|
|
|
15
17
|
const GOO = 'mk-liquid-goo';
|
|
@@ -22,7 +24,7 @@ function ensureGoo() {
|
|
|
22
24
|
svg.setAttribute('width', '0');
|
|
23
25
|
svg.setAttribute('height', '0');
|
|
24
26
|
svg.style.position = 'absolute';
|
|
25
|
-
svg.innerHTML = `<defs><filter id="${GOO}" x="-50%" y="-50%" width="200%" height="200%"><feGaussianBlur in="SourceGraphic" stdDeviation="20"/><feColorMatrix type="matrix" values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 19 -9"/></filter></defs>`;
|
|
27
|
+
svg.innerHTML = `<defs><filter id="${GOO}" x="-50%" y="-50%" width="200%" height="200%" color-interpolation-filters="sRGB"><feGaussianBlur in="SourceGraphic" stdDeviation="20"/><feColorMatrix type="matrix" values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 19 -9"/></filter></defs>`;
|
|
26
28
|
document.body.append(svg);
|
|
27
29
|
}
|
|
28
30
|
|
|
@@ -139,7 +141,7 @@ export function liquidOpen(surface: HTMLElement, origin: HTMLElement, parts: HTM
|
|
|
139
141
|
}
|
|
140
142
|
});
|
|
141
143
|
const L = TIMING.liquid;
|
|
142
|
-
|
|
144
|
+
const settled = motion.animate(
|
|
143
145
|
{ top: box.top, left: box.left, width: box.width, height: box.height, radius: endRadius, scale: 1, blur: 0 },
|
|
144
146
|
{
|
|
145
147
|
top: spring(144, 14, { velocity: 2400, direction: towardY }),
|
|
@@ -154,17 +156,25 @@ export function liquidOpen(surface: HTMLElement, origin: HTMLElement, parts: HTM
|
|
|
154
156
|
gsap.to(shape, { background: surfaceColor, duration: L.color, delay: L.colorDelay, ease: 'power2.out' });
|
|
155
157
|
if (parts.length) gsap.to(parts, { opacity: 1, duration: L.color, delay: L.colorDelay, ease: 'power2.out' });
|
|
156
158
|
gsap.to(originBlob, { opacity: 0, duration: L.ghost, delay: L.ghostDelay, ease: 'power2.out' });
|
|
159
|
+
// Once the opener's blob has gone there is nothing left to melt into: the thresholded blur would only blur the
|
|
160
|
+
// shape's edge, so the shape is drawn as it is for the rest of the way.
|
|
161
|
+
const sharpen = setTimeout(() => {
|
|
162
|
+
layer.style.filter = 'none';
|
|
163
|
+
originBlob.remove();
|
|
164
|
+
}, (L.ghostDelay + L.ghost) * 1000 + 30);
|
|
157
165
|
let done = false;
|
|
158
166
|
const finish = () => {
|
|
159
167
|
if (done) return;
|
|
160
168
|
done = true;
|
|
161
169
|
motion.stop();
|
|
162
170
|
clearTimeout(timer);
|
|
171
|
+
clearTimeout(sharpen);
|
|
163
172
|
layer.remove();
|
|
164
173
|
restore();
|
|
165
174
|
if (parts.length) gsap.set(parts, { clearProps: 'opacity,transform,transformOrigin,filter' });
|
|
166
175
|
};
|
|
167
|
-
// The
|
|
176
|
+
// The surface takes over as soon as every channel rests; the source's 1.1 s window stays as a safety net.
|
|
177
|
+
void settled.then(finish);
|
|
168
178
|
const timer = setTimeout(finish, L.safetyMs);
|
|
169
179
|
return finish;
|
|
170
180
|
}
|
|
@@ -0,0 +1,248 @@
|
|
|
1
|
+
import { gsap, EASE, registerMotion } from '../core/gsap';
|
|
2
|
+
import { reduced } from '../core/reduced';
|
|
3
|
+
|
|
4
|
+
/*
|
|
5
|
+
* Melonmind microinteractions (sources/app/css/ui-elements/animations.css,
|
|
6
|
+
* button.css, popover.css) on GSAP, shared by the components:
|
|
7
|
+
* - press: buttonClickAnimation, scale .95 × .9 and back in 500 ms (click curve).
|
|
8
|
+
* - blurIn: search-result-item-in (blur 16, y −20, 500 ms, 50 ms apart),
|
|
9
|
+
* animation-general-in-2 (pop: blur 32, scale .7, 300 ms) or general-in (soft).
|
|
10
|
+
* - blurOut: item-out / -left / -bottom (blur 16, 500 ms).
|
|
11
|
+
* - collapse: a removed row folds (height 0, blur 16, 250 ms).
|
|
12
|
+
* - shake: the error shake (±4 px, 500 ms).
|
|
13
|
+
* - ringPulse: animation-highlight-2 (inset ring 0 → 4 px → 0 in 1 s).
|
|
14
|
+
* - burst: particles flying out of a control (like, rating, confirm).
|
|
15
|
+
* - rollDigits: Melonmind's RollingNumber, changed characters roll in their direction.
|
|
16
|
+
* Every helper returns its animation, or null under reduced motion (final state at once).
|
|
17
|
+
*/
|
|
18
|
+
|
|
19
|
+
type Targets = Element | Element[] | NodeListOf<Element> | null | undefined;
|
|
20
|
+
|
|
21
|
+
const list = (targets: Targets) => (!targets ? [] : targets instanceof Element ? [targets] : [...targets]);
|
|
22
|
+
const live = () => {
|
|
23
|
+
registerMotion();
|
|
24
|
+
return !reduced();
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
/** Press bounce (Melonmind buttonClickAnimation). */
|
|
28
|
+
export function press(el: Element | null | undefined) {
|
|
29
|
+
if (!el || !live()) return null;
|
|
30
|
+
gsap.killTweensOf(el, 'scaleX,scaleY');
|
|
31
|
+
return gsap
|
|
32
|
+
.timeline({
|
|
33
|
+
onComplete: () => {
|
|
34
|
+
gsap.set(el, { clearProps: 'scale,transform' });
|
|
35
|
+
},
|
|
36
|
+
})
|
|
37
|
+
.to(el, { scaleX: 0.95, scaleY: 0.9, duration: 0.1, ease: 'power2.out' })
|
|
38
|
+
.to(el, { scaleX: 1, scaleY: 1, duration: 0.5, ease: EASE.click });
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export interface BlurInOptions {
|
|
42
|
+
/** rise: list item (y −20, blur 16); pop: surface (scale .7, blur 32); soft: scale .96, blur 16. */
|
|
43
|
+
from?: 'rise' | 'pop' | 'soft';
|
|
44
|
+
stagger?: number;
|
|
45
|
+
delay?: number;
|
|
46
|
+
duration?: number;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export function blurIn(targets: Targets, { from = 'rise', stagger = 0.05, delay = 0, duration }: BlurInOptions = {}) {
|
|
50
|
+
const items = list(targets);
|
|
51
|
+
if (!items.length || !live()) return null;
|
|
52
|
+
const start =
|
|
53
|
+
from === 'pop' ? { opacity: 0, scale: 0.7, filter: 'blur(32px)' } : from === 'soft' ? { opacity: 0, scale: 0.96, filter: 'blur(16px)' } : { opacity: 0, y: -20, filter: 'blur(16px)' };
|
|
54
|
+
return gsap.fromTo(items, start, {
|
|
55
|
+
opacity: 1,
|
|
56
|
+
y: 0,
|
|
57
|
+
scale: 1,
|
|
58
|
+
filter: 'blur(0px)',
|
|
59
|
+
duration: duration ?? (from === 'pop' ? 0.3 : 0.5),
|
|
60
|
+
ease: from === 'pop' ? EASE.pop : 'power2.out',
|
|
61
|
+
stagger,
|
|
62
|
+
delay,
|
|
63
|
+
clearProps: 'opacity,transform,filter',
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
export function blurOut(targets: Targets, { to = 'up', onComplete }: { to?: 'up' | 'left' | 'down'; onComplete?: () => void } = {}) {
|
|
68
|
+
const items = list(targets);
|
|
69
|
+
if (!items.length) return null;
|
|
70
|
+
if (!live()) {
|
|
71
|
+
onComplete?.();
|
|
72
|
+
return null;
|
|
73
|
+
}
|
|
74
|
+
const end = to === 'left' ? { x: -64 } : to === 'down' ? { y: 24 } : { y: -20 };
|
|
75
|
+
return gsap.to(items, { ...end, opacity: 0, filter: 'blur(16px)', duration: 0.5, ease: 'power2.out', onComplete });
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
/** Fold an element away (Melonmind today-appt-item-out). */
|
|
79
|
+
export function collapse(el: HTMLElement | null | undefined, { onComplete }: { onComplete?: () => void } = {}) {
|
|
80
|
+
if (!el) return null;
|
|
81
|
+
if (!live()) {
|
|
82
|
+
onComplete?.();
|
|
83
|
+
return null;
|
|
84
|
+
}
|
|
85
|
+
return gsap.to(el, {
|
|
86
|
+
height: 0,
|
|
87
|
+
paddingTop: 0,
|
|
88
|
+
paddingBottom: 0,
|
|
89
|
+
marginTop: 0,
|
|
90
|
+
marginBottom: 0,
|
|
91
|
+
opacity: 0,
|
|
92
|
+
filter: 'blur(16px)',
|
|
93
|
+
overflow: 'hidden',
|
|
94
|
+
duration: 0.25,
|
|
95
|
+
ease: 'power2.in',
|
|
96
|
+
onComplete,
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
/** The error shake. */
|
|
101
|
+
export function shake(el: Element | null | undefined, distance = 4) {
|
|
102
|
+
if (!el || !live()) return null;
|
|
103
|
+
gsap.killTweensOf(el, 'x');
|
|
104
|
+
return gsap.to(el, {
|
|
105
|
+
keyframes: { x: [0, -distance, distance, -distance, 0] },
|
|
106
|
+
duration: 0.5,
|
|
107
|
+
ease: EASE.shake,
|
|
108
|
+
clearProps: 'x,transform',
|
|
109
|
+
});
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
/** An inset ring that swells and fades (Melonmind animation-highlight-2). */
|
|
113
|
+
export function ringPulse(el: HTMLElement | null | undefined, color = 'var(--mk-accent-soft)') {
|
|
114
|
+
if (!el || !live()) return null;
|
|
115
|
+
const before = { color: el.style.outlineColor, style: el.style.outlineStyle, offset: el.style.outlineOffset };
|
|
116
|
+
el.style.outlineColor = color;
|
|
117
|
+
el.style.outlineStyle = 'solid';
|
|
118
|
+
el.style.outlineOffset = '-4px';
|
|
119
|
+
const restore = () => {
|
|
120
|
+
el.style.outlineColor = before.color;
|
|
121
|
+
el.style.outlineStyle = before.style;
|
|
122
|
+
el.style.outlineOffset = before.offset;
|
|
123
|
+
el.style.removeProperty('outline-width');
|
|
124
|
+
if (el.getAttribute('style') === '') el.removeAttribute('style');
|
|
125
|
+
};
|
|
126
|
+
return gsap.fromTo(el, { outlineWidth: 0 }, { keyframes: { outlineWidth: [0, 4, 0] }, duration: 1, ease: 'power1.inOut', onComplete: restore, onInterrupt: restore });
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
export interface BurstOptions {
|
|
130
|
+
count?: number;
|
|
131
|
+
distance?: number;
|
|
132
|
+
/** CSS colours, used in turn. */
|
|
133
|
+
colors?: string[];
|
|
134
|
+
/** An expanding ring behind the particles. */
|
|
135
|
+
ring?: boolean;
|
|
136
|
+
size?: number;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
/** Particles flying out of the centre of `origin` (like, rating, confirm). Removed when done. */
|
|
140
|
+
export function burst(origin: HTMLElement | null | undefined, { count = 7, distance = 28, colors = ['var(--mk-accent)'], ring = true, size = 6 }: BurstOptions = {}) {
|
|
141
|
+
if (!origin || !live()) return null;
|
|
142
|
+
const layer = document.createElement('span');
|
|
143
|
+
layer.setAttribute('aria-hidden', 'true');
|
|
144
|
+
layer.dataset.mkBurst = '';
|
|
145
|
+
Object.assign(layer.style, { position: 'absolute', inset: '0', pointerEvents: 'none', overflow: 'visible', display: 'grid', placeItems: 'center' });
|
|
146
|
+
const positioned = getComputedStyle(origin).position !== 'static';
|
|
147
|
+
const previousPosition = origin.style.position;
|
|
148
|
+
if (!positioned) origin.style.position = 'relative';
|
|
149
|
+
origin.append(layer);
|
|
150
|
+
const cleanup = () => {
|
|
151
|
+
layer.remove();
|
|
152
|
+
if (!positioned) origin.style.position = previousPosition;
|
|
153
|
+
if (origin.getAttribute('style') === '') origin.removeAttribute('style');
|
|
154
|
+
};
|
|
155
|
+
const timeline = gsap.timeline({ onComplete: cleanup, onInterrupt: cleanup });
|
|
156
|
+
if (ring) {
|
|
157
|
+
const circle = document.createElement('span');
|
|
158
|
+
Object.assign(circle.style, { position: 'absolute', width: '100%', aspectRatio: '1', borderRadius: '50%', border: `2px solid ${colors[0]}` });
|
|
159
|
+
layer.append(circle);
|
|
160
|
+
timeline.fromTo(circle, { scale: 0.3, opacity: 0.9 }, { scale: 1.6, opacity: 0, duration: 0.5, ease: 'power2.out' }, 0);
|
|
161
|
+
}
|
|
162
|
+
for (let i = 0; i < count; i++) {
|
|
163
|
+
const angle = (i / count) * Math.PI * 2 - Math.PI / 2;
|
|
164
|
+
for (const [k, scale] of [[0, 1], [1, 0.6]] as const) {
|
|
165
|
+
const dot = document.createElement('span');
|
|
166
|
+
Object.assign(dot.style, {
|
|
167
|
+
position: 'absolute',
|
|
168
|
+
width: `${size * scale}px`,
|
|
169
|
+
height: `${size * scale}px`,
|
|
170
|
+
borderRadius: '50%',
|
|
171
|
+
background: colors[(i + k) % colors.length],
|
|
172
|
+
});
|
|
173
|
+
layer.append(dot);
|
|
174
|
+
const reach = distance * (k ? 0.72 : 1);
|
|
175
|
+
const turn = k ? 0.32 : 0;
|
|
176
|
+
timeline.fromTo(
|
|
177
|
+
dot,
|
|
178
|
+
{ x: 0, y: 0, scale: 0, opacity: 1 },
|
|
179
|
+
{ x: Math.cos(angle + turn) * reach, y: Math.sin(angle + turn) * reach, scale: 1, duration: 0.45, ease: 'power3.out' },
|
|
180
|
+
0.05,
|
|
181
|
+
);
|
|
182
|
+
timeline.to(dot, { scale: 0, opacity: 0, duration: 0.3, ease: 'power2.in' }, 0.38);
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
return timeline;
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
const rolling = new WeakMap<HTMLElement, gsap.core.Timeline>();
|
|
189
|
+
|
|
190
|
+
/**
|
|
191
|
+
* Write `text` into `el`, rolling the characters that changed (up when the value
|
|
192
|
+
* grew, down when it shrank). Unchanged characters stay; the final DOM is plain text.
|
|
193
|
+
*/
|
|
194
|
+
export function rollDigits(el: HTMLElement | null | undefined, text: string, direction: 1 | -1 = 1, duration = 0.5) {
|
|
195
|
+
if (!el) return null;
|
|
196
|
+
rolling.get(el)?.progress(1).kill();
|
|
197
|
+
rolling.delete(el);
|
|
198
|
+
const previous = el.textContent ?? '';
|
|
199
|
+
if (previous === text || !live()) {
|
|
200
|
+
el.textContent = text;
|
|
201
|
+
return null;
|
|
202
|
+
}
|
|
203
|
+
// Right-aligned comparison: digits keep their place value.
|
|
204
|
+
const width = Math.max(previous.length, text.length);
|
|
205
|
+
const oldChars = previous.padStart(width, ' ');
|
|
206
|
+
const newChars = text.padStart(width, ' ');
|
|
207
|
+
el.textContent = '';
|
|
208
|
+
const label = document.createElement('span');
|
|
209
|
+
label.className = 'mk-sr-only';
|
|
210
|
+
label.textContent = text;
|
|
211
|
+
const visual = document.createElement('span');
|
|
212
|
+
visual.setAttribute('aria-hidden', 'true');
|
|
213
|
+
visual.style.display = 'inline-flex';
|
|
214
|
+
const moving: Array<[HTMLElement, HTMLElement]> = [];
|
|
215
|
+
// Only the padding added for the alignment is skipped; spaces inside the text stay.
|
|
216
|
+
const padding = Math.min(width - previous.length, width - text.length);
|
|
217
|
+
for (let i = padding; i < width; i++) {
|
|
218
|
+
const before = oldChars[i]!;
|
|
219
|
+
const after = newChars[i]!;
|
|
220
|
+
const cell = document.createElement('span');
|
|
221
|
+
Object.assign(cell.style, { position: 'relative', display: 'inline-block', overflow: 'hidden', whiteSpace: 'pre' });
|
|
222
|
+
const next = document.createElement('span');
|
|
223
|
+
next.style.display = 'inline-block';
|
|
224
|
+
next.textContent = after;
|
|
225
|
+
cell.append(next);
|
|
226
|
+
if (before !== after) {
|
|
227
|
+
const old = document.createElement('span');
|
|
228
|
+
Object.assign(old.style, { position: 'absolute', left: '0', top: '0', display: 'inline-block' });
|
|
229
|
+
old.textContent = before;
|
|
230
|
+
cell.append(old);
|
|
231
|
+
moving.push([old, next]);
|
|
232
|
+
}
|
|
233
|
+
visual.append(cell);
|
|
234
|
+
}
|
|
235
|
+
el.append(label, visual);
|
|
236
|
+
const timeline = gsap.timeline({
|
|
237
|
+
onComplete: () => {
|
|
238
|
+
el.textContent = text;
|
|
239
|
+
rolling.delete(el);
|
|
240
|
+
},
|
|
241
|
+
});
|
|
242
|
+
moving.forEach(([old, next], i) => {
|
|
243
|
+
timeline.to(old, { yPercent: -100 * direction, opacity: 0, filter: 'blur(4px)', duration, ease: EASE.signature }, i * 0.03);
|
|
244
|
+
timeline.fromTo(next, { yPercent: 100 * direction, opacity: 0, filter: 'blur(4px)' }, { yPercent: 0, opacity: 1, filter: 'blur(0px)', duration, ease: EASE.signature }, i * 0.03);
|
|
245
|
+
});
|
|
246
|
+
rolling.set(el, timeline);
|
|
247
|
+
return timeline;
|
|
248
|
+
}
|