@yewdiel21/motion-kit 0.9.1 → 0.14.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 +72 -0
- package/dist/auto/index.d.ts +72 -3
- package/dist/auto/index.js +139 -3
- package/dist/auto/index.js.map +1 -1
- package/dist/{chunk-BFC27F2G.js → chunk-6P4P7NU6.js} +2 -218
- package/dist/chunk-6P4P7NU6.js.map +1 -0
- package/dist/chunk-CU6SXW3E.js +20334 -0
- package/dist/chunk-CU6SXW3E.js.map +1 -0
- package/dist/{chunk-XDWBVFHQ.js → chunk-EY4BJKC4.js} +1203 -29
- package/dist/chunk-EY4BJKC4.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/attachment.css +266 -0
- package/dist/css/components/breadcrumb.css +110 -0
- package/dist/css/components/calendar.css +159 -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 +591 -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 +232 -0
- package/dist/css/components/hold-confirm.css +87 -0
- package/dist/css/components/hover-card.css +20 -0
- package/dist/css/components/image-preview.css +195 -0
- package/dist/css/components/input-otp.css +10 -0
- package/dist/css/components/json-viewer.css +272 -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/notification-bell.css +127 -0
- package/dist/css/components/pagination.css +11 -0
- package/dist/css/components/password-strength.css +183 -0
- package/dist/css/components/popover.css +25 -0
- package/dist/css/components/progress.css +140 -0
- package/dist/css/components/quantity.css +16 -0
- package/dist/css/components/questionnaire.css +217 -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/scratch-card.css +75 -0
- package/dist/css/components/skeleton.css +108 -0
- package/dist/css/components/slot-picker.css +126 -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/studio-dock.css +35 -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/tooltip.css +79 -0
- package/dist/css/components/trailer.css +37 -0
- package/dist/css/components/tree-view.css +210 -0
- package/dist/css/components/virtual-list.css +195 -0
- package/dist/css/controls.css +65 -0
- package/dist/css/tokens.css +185 -181
- package/dist/elements/index.d.ts +742 -5
- package/dist/elements/index.js +1527 -8
- package/dist/elements/index.js.map +1 -1
- package/dist/{engine-GDGwQnJE.d.ts → engine-Cn6IhE3z.d.ts} +1 -1
- package/dist/engine-QECQnGz1.d.ts +33 -0
- package/dist/index.css +10113 -181
- package/dist/index.d.ts +89 -5
- package/dist/index.js +285 -9
- package/dist/index.js.map +1 -1
- package/dist/react/index.d.ts +678 -23
- package/dist/react/index.js +2389 -7
- package/dist/react/index.js.map +1 -1
- package/dist/{reduced-B98f8LPs.d.ts → reduced-BBUusld6.d.ts} +206 -2
- package/dist/reveal-DEvp6U6T.d.ts +2381 -0
- package/dist/{store-pHiUvxP8.d.ts → store-DjkTBX7f.d.ts} +2 -2
- package/package.json +1 -1
- package/registry.json +583 -104
- package/skills/motion-kit/SKILL.md +209 -189
- package/src/auto/auto-init.ts +136 -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/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/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/calendar/README.md +82 -0
- package/src/components/calendar/calendar.css +158 -0
- package/src/components/calendar/element.ts +27 -0
- package/src/components/calendar/engine.ts +412 -0
- package/src/components/calendar/react.tsx +69 -0
- package/src/components/chart/README.md +24 -0
- package/src/components/chart/chart.css +295 -0
- package/src/components/chart/element.ts +41 -0
- package/src/components/chart/engine.ts +811 -0
- package/src/components/chart/react.tsx +50 -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 +590 -0
- package/src/components/data-table/element.ts +54 -0
- package/src/components/data-table/engine.ts +1059 -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 +775 -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 +365 -0
- package/src/components/filter-builder/filter-builder.css +231 -0
- package/src/components/filter-builder/react.tsx +36 -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 +20 -0
- package/src/components/hover-card/element.ts +8 -0
- package/src/components/hover-card/engine.ts +131 -0
- package/src/components/hover-card/hover-card.css +19 -0
- package/src/components/hover-card/react.tsx +19 -0
- 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 +325 -0
- package/src/components/image-preview/image-preview.css +194 -0
- package/src/components/image-preview/react.tsx +43 -0
- package/src/components/input-otp/README.md +18 -0
- package/src/components/input-otp/element.ts +14 -0
- package/src/components/input-otp/engine.ts +106 -0
- package/src/components/input-otp/input-otp.css +9 -0
- package/src/components/input-otp/react.tsx +21 -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 +440 -0
- package/src/components/json-viewer/json-viewer.css +271 -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/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/pagination/README.md +17 -0
- package/src/components/pagination/element.ts +14 -0
- package/src/components/pagination/engine.ts +102 -0
- package/src/components/pagination/pagination.css +10 -0
- package/src/components/pagination/react.tsx +22 -0
- 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/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/quantity/README.md +20 -0
- package/src/components/quantity/element.ts +14 -0
- package/src/components/quantity/engine.ts +85 -0
- package/src/components/quantity/quantity.css +15 -0
- package/src/components/quantity/react.tsx +21 -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/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/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/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/slot-picker/README.md +68 -0
- package/src/components/slot-picker/element.ts +27 -0
- package/src/components/slot-picker/engine.ts +412 -0
- package/src/components/slot-picker/react.tsx +76 -0
- package/src/components/slot-picker/slot-picker.css +125 -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/studio-dock/README.md +44 -0
- package/src/components/studio-dock/element.ts +11 -0
- package/src/components/studio-dock/engine.ts +212 -0
- package/src/components/studio-dock/react.tsx +23 -0
- package/src/components/studio-dock/studio-dock.css +34 -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/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/trailer/README.md +28 -0
- package/src/components/trailer/element.ts +13 -0
- package/src/components/trailer/engine.ts +189 -0
- package/src/components/trailer/react.tsx +16 -0
- package/src/components/trailer/trailer.css +36 -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 +569 -0
- package/src/components/tree-view/react.tsx +78 -0
- package/src/components/tree-view/tree-view.css +209 -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/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 +108 -0
- 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/controls/README.md +14 -0
- package/src/css/controls/status.css +63 -0
- package/src/css/tokens.css +186 -182
- package/src/elements/index.ts +171 -0
- package/src/index.ts +97 -0
- 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 +78 -0
- package/src/react/use-action-button.ts +6 -0
- package/src/react/use-editorial-reveal.ts +7 -0
- package/src/react/use-film-hero.ts +6 -0
- package/src/react/use-font-cycle.ts +7 -0
- package/src/react/use-image-zoom.ts +5 -0
- package/src/react/use-joined-cta.ts +5 -0
- package/src/react/use-local-clock.ts +5 -0
- package/src/react/use-scroll-dock.ts +5 -0
- package/src/react/use-sticker.ts +5 -0
- package/src/react/use-studio-dock.ts +8 -0
- package/src/react/use-thumbnail-nav.ts +7 -0
- package/src/react/use-trailer.ts +6 -0
- package/src/react/use-weight-hover.ts +5 -0
- package/src/recipes/action-button/README.md +31 -0
- package/src/recipes/action-button/action-button.css +113 -0
- package/src/recipes/action-button/create-action-button.ts +56 -0
- package/src/recipes/editorial-reveal/README.md +35 -0
- package/src/recipes/editorial-reveal/create-editorial-reveal.ts +91 -0
- package/src/recipes/editorial-reveal/editorial-reveal.css +17 -0
- package/src/recipes/film-hero/README.md +23 -0
- package/src/recipes/film-hero/create-film-hero.ts +65 -0
- package/src/recipes/film-hero/film-hero.css +29 -0
- package/src/recipes/font-cycle/README.md +11 -0
- package/src/recipes/font-cycle/create-font-cycle.ts +126 -0
- package/src/recipes/font-cycle/font-cycle.css +36 -0
- package/src/recipes/image-zoom/README.md +16 -0
- package/src/recipes/image-zoom/create-image-zoom.ts +27 -0
- package/src/recipes/image-zoom/image-zoom.css +7 -0
- package/src/recipes/joined-cta/README.md +13 -0
- package/src/recipes/joined-cta/create-joined-cta.ts +22 -0
- package/src/recipes/joined-cta/joined-cta.css +17 -0
- package/src/recipes/local-clock/README.md +31 -0
- package/src/recipes/local-clock/create-local-clock.ts +61 -0
- package/src/recipes/scroll-dock/README.md +46 -0
- package/src/recipes/scroll-dock/create-scroll-dock.ts +72 -0
- package/src/recipes/scroll-dock/scroll-dock.css +70 -0
- package/src/recipes/sticker/README.md +59 -0
- package/src/recipes/sticker/create-sticker.ts +490 -0
- package/src/recipes/sticker/sticker.css +112 -0
- package/src/recipes/thumbnail-nav/README.md +16 -0
- package/src/recipes/thumbnail-nav/create-thumbnail-nav.ts +165 -0
- package/src/recipes/thumbnail-nav/thumbnail-nav.css +108 -0
- package/src/recipes/weight-hover/README.md +37 -0
- package/src/recipes/weight-hover/create-weight-hover.ts +136 -0
- package/src/recipes/weight-hover/weight-hover.css +7 -0
- package/dist/chunk-BFC27F2G.js.map +0 -1
- package/dist/chunk-J6OCFNGU.js +0 -177
- package/dist/chunk-J6OCFNGU.js.map +0 -1
- package/dist/chunk-JQMJQSXD.js +0 -2374
- package/dist/chunk-JQMJQSXD.js.map +0 -1
- package/dist/chunk-XDWBVFHQ.js.map +0 -1
- package/dist/reveal-C0hCDcB_.d.ts +0 -415
|
@@ -0,0 +1,209 @@
|
|
|
1
|
+
/* tree-view — 2.25rem rows indented 1.25rem a level; a chevron that turns, an 18 px check box (accent when checked, a
|
|
2
|
+
dash when mixed), an icon and the label; the selected row sits on a 10 px accent-soft pill that glides; the search
|
|
3
|
+
above on surface-3; matches underlined in the accent. */
|
|
4
|
+
.mk-tree-view,
|
|
5
|
+
mk-tree-view {
|
|
6
|
+
display: grid;
|
|
7
|
+
gap: 0.6rem;
|
|
8
|
+
min-width: 0;
|
|
9
|
+
color: var(--mk-text);
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
[data-mk-tree-search] {
|
|
13
|
+
box-sizing: border-box;
|
|
14
|
+
width: 100%;
|
|
15
|
+
height: 2.5rem;
|
|
16
|
+
padding: 0 0.85rem;
|
|
17
|
+
border: 0;
|
|
18
|
+
border-radius: 12px;
|
|
19
|
+
background: var(--mk-surface-3);
|
|
20
|
+
color: inherit;
|
|
21
|
+
font: inherit;
|
|
22
|
+
outline: none;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
[data-mk-tree-search]:focus-visible {
|
|
26
|
+
box-shadow: 0 0 0 3px color-mix(in srgb, var(--mk-accent) 35%, transparent);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
[data-mk-tree-box] {
|
|
30
|
+
position: relative;
|
|
31
|
+
min-width: 0;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
[data-mk-tree-pill] {
|
|
35
|
+
position: absolute;
|
|
36
|
+
top: 0;
|
|
37
|
+
right: 0;
|
|
38
|
+
left: 0;
|
|
39
|
+
border-radius: 10px;
|
|
40
|
+
background: var(--mk-accent-soft);
|
|
41
|
+
opacity: 0;
|
|
42
|
+
pointer-events: none;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
[data-mk-tree],
|
|
46
|
+
[data-mk-tree] [role='group'] {
|
|
47
|
+
margin: 0;
|
|
48
|
+
padding: 0;
|
|
49
|
+
list-style: none;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
[data-mk-tree] [role='group'][hidden],
|
|
53
|
+
[data-mk-tree] [role='treeitem'][hidden] {
|
|
54
|
+
display: none;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
[data-mk-tree] [role='treeitem'] {
|
|
58
|
+
outline: none;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
[data-mk-tree-row] {
|
|
62
|
+
position: relative;
|
|
63
|
+
z-index: 1;
|
|
64
|
+
display: flex;
|
|
65
|
+
align-items: center;
|
|
66
|
+
gap: 0.35rem;
|
|
67
|
+
min-height: 2.25rem;
|
|
68
|
+
padding: 0 0.5rem 0 calc(0.25rem + var(--mk-tree-depth, 0) * 1.25rem);
|
|
69
|
+
border-radius: 10px;
|
|
70
|
+
cursor: pointer;
|
|
71
|
+
user-select: none;
|
|
72
|
+
transition: background-color 0.15s ease;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
[data-mk-tree-row]:hover {
|
|
76
|
+
background: color-mix(in srgb, var(--mk-text) 5%, transparent);
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
[data-mk-tree] [role='treeitem']:focus-visible > [data-mk-tree-row] {
|
|
80
|
+
box-shadow: inset 0 0 0 2px var(--mk-accent);
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
[data-mk-tree] [role='treeitem'][aria-selected='true'] > [data-mk-tree-row] {
|
|
84
|
+
color: var(--mk-on-accent-soft, var(--mk-text));
|
|
85
|
+
font-weight: 600;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
[data-mk-tree] [role='treeitem'][aria-disabled='true'] > [data-mk-tree-row] {
|
|
89
|
+
color: var(--mk-muted);
|
|
90
|
+
cursor: not-allowed;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
[data-mk-tree-chevron] {
|
|
94
|
+
display: grid;
|
|
95
|
+
flex: none;
|
|
96
|
+
place-items: center;
|
|
97
|
+
width: 1.25rem;
|
|
98
|
+
height: 1.25rem;
|
|
99
|
+
border-radius: 6px;
|
|
100
|
+
color: var(--mk-muted);
|
|
101
|
+
transition: rotate 0.3s cubic-bezier(0.38, 0.49, 0, 1.5);
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
[data-mk-tree] [role='treeitem'][aria-expanded='true'] > [data-mk-tree-row] [data-mk-tree-chevron] {
|
|
105
|
+
rotate: 90deg;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
[data-mk-tree-check] {
|
|
109
|
+
display: grid;
|
|
110
|
+
flex: none;
|
|
111
|
+
place-items: center;
|
|
112
|
+
width: 1.125rem;
|
|
113
|
+
height: 1.125rem;
|
|
114
|
+
border: 1.5px solid var(--mk-outline);
|
|
115
|
+
border-radius: 5px;
|
|
116
|
+
color: transparent;
|
|
117
|
+
transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
[data-mk-tree-check] [data-mk-tree-dash] {
|
|
121
|
+
display: none;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
[data-mk-tree] [role='treeitem'][aria-checked='true'] > [data-mk-tree-row] [data-mk-tree-check],
|
|
125
|
+
[data-mk-tree] [role='treeitem'][aria-checked='mixed'] > [data-mk-tree-row] [data-mk-tree-check] {
|
|
126
|
+
border-color: var(--mk-accent);
|
|
127
|
+
background: var(--mk-accent);
|
|
128
|
+
color: var(--mk-on-accent);
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
[data-mk-tree] [role='treeitem'][aria-checked='mixed'] > [data-mk-tree-row] [data-mk-tree-tick] {
|
|
132
|
+
display: none;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
[data-mk-tree] [role='treeitem'][aria-checked='mixed'] > [data-mk-tree-row] [data-mk-tree-dash] {
|
|
136
|
+
display: block;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
[data-mk-tree-icon] {
|
|
140
|
+
flex: none;
|
|
141
|
+
width: 1.25rem;
|
|
142
|
+
text-align: center;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
[data-mk-tree-label] {
|
|
146
|
+
flex: 1;
|
|
147
|
+
min-width: 0;
|
|
148
|
+
overflow: hidden;
|
|
149
|
+
text-overflow: ellipsis;
|
|
150
|
+
white-space: nowrap;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
[data-mk-tree-label] mark {
|
|
154
|
+
background: transparent;
|
|
155
|
+
color: inherit;
|
|
156
|
+
font-weight: 700;
|
|
157
|
+
text-decoration: underline;
|
|
158
|
+
text-decoration-color: var(--mk-accent);
|
|
159
|
+
text-decoration-thickness: 2px;
|
|
160
|
+
text-underline-offset: 3px;
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
[data-mk-tree-loading] {
|
|
164
|
+
display: flex;
|
|
165
|
+
align-items: center;
|
|
166
|
+
gap: 0.5rem;
|
|
167
|
+
min-height: 2.25rem;
|
|
168
|
+
padding-left: calc(1.75rem + var(--mk-tree-depth, 0) * 1.25rem);
|
|
169
|
+
color: var(--mk-muted);
|
|
170
|
+
font-size: 0.875rem;
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
[data-mk-tree-loading]::before {
|
|
174
|
+
content: '';
|
|
175
|
+
width: 0.85rem;
|
|
176
|
+
height: 0.85rem;
|
|
177
|
+
border: 2px solid currentColor;
|
|
178
|
+
border-right-color: transparent;
|
|
179
|
+
border-radius: 50%;
|
|
180
|
+
animation: mk-tree-spin 0.8s linear infinite;
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
@keyframes mk-tree-spin {
|
|
184
|
+
to {
|
|
185
|
+
transform: rotate(360deg);
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
[data-mk-tree-empty] {
|
|
190
|
+
margin: 0;
|
|
191
|
+
color: var(--mk-muted);
|
|
192
|
+
font-size: 0.875rem;
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
[data-mk-tree-empty][hidden] {
|
|
196
|
+
display: none;
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
@media (prefers-reduced-motion: reduce) {
|
|
200
|
+
[data-mk-tree-chevron],
|
|
201
|
+
[data-mk-tree-check],
|
|
202
|
+
[data-mk-tree-row] {
|
|
203
|
+
transition: none;
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
[data-mk-tree-loading]::before {
|
|
207
|
+
animation: none;
|
|
208
|
+
}
|
|
209
|
+
}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
# virtual-list
|
|
2
|
+
|
|
3
|
+
Lista optimizada para miles de elementos: en la página solo están las filas visibles y unas cuantas alrededor, y se reciclan al desplazarse. Las alturas pueden ser fijas (`itemHeight`, lo más rápido) o medirse al aparecer, con una estimación para las demás; si una fila de arriba cambia de alto, lo que estás viendo no se mueve.
|
|
4
|
+
|
|
5
|
+
Mientras te desplazas, una píldora acompaña el borde derecho con la posición («1 240 de 10 000») y se va con un blur cuando paras. `scrollToIndex()` se desliza hasta la fila (.6 s, curva signature; en un salto largo, recorre de golpe casi todo el camino y desliza el final) y la hace destellar. Con `selectable`, la lista es un `listbox`: un anillo se desliza entre filas al usar el teclado y la palomita de la fila elegida hace pop. `onEndReached()` trae más filas al llegar al final (una fila «Cargando…» mientras tanto y «No hay más elementos» cuando ya no hay). Las primeras filas entran en cascada desde un blur.
|
|
6
|
+
|
|
7
|
+
## HTML / Astro
|
|
8
|
+
|
|
9
|
+
```html
|
|
10
|
+
<mk-virtual-list class="mk-virtual-list" item-height="44" selectable="multiple" label="Contactos"
|
|
11
|
+
items='["Ana Gómez","Luis Peña","Sofía Ruiz"]'></mk-virtual-list>
|
|
12
|
+
|
|
13
|
+
<script>
|
|
14
|
+
const list = document.querySelector('mk-virtual-list');
|
|
15
|
+
// Filas más ricas: dibuja cada una (se reciclan, así que dibújala completa cada vez).
|
|
16
|
+
list.instance.setRenderer((person, index, row) => {
|
|
17
|
+
row.innerHTML = '';
|
|
18
|
+
const name = document.createElement('strong');
|
|
19
|
+
name.textContent = person;
|
|
20
|
+
row.append(name);
|
|
21
|
+
});
|
|
22
|
+
list.instance.scrollToIndex(1500, { align: 'center' });
|
|
23
|
+
</script>
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
También lee una `<ul>` escrita dentro, con una fila de texto por `<li>`.
|
|
27
|
+
|
|
28
|
+
## React
|
|
29
|
+
|
|
30
|
+
```tsx
|
|
31
|
+
const list = useRef<VirtualListHandle>(null);
|
|
32
|
+
|
|
33
|
+
<VirtualList
|
|
34
|
+
ref={list}
|
|
35
|
+
items={contactos}
|
|
36
|
+
itemHeight={56}
|
|
37
|
+
selectable="multiple"
|
|
38
|
+
onSelect={(keys) => setElegidos(keys)}
|
|
39
|
+
renderItem={(contacto) => <Contacto {...contacto} />}
|
|
40
|
+
onEndReached={() => api.siguientePagina()}
|
|
41
|
+
/>;
|
|
42
|
+
|
|
43
|
+
list.current?.scrollToIndex(5000);
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
React dibuja solo las filas visibles; el motor las coloca, las mide y decide cuáles van.
|
|
47
|
+
|
|
48
|
+
## Opciones
|
|
49
|
+
|
|
50
|
+
| Opción | Atributo | Por defecto | Qué hace |
|
|
51
|
+
|---|---|---|---|
|
|
52
|
+
| `items` | `items` (JSON) | la `<ul>` escrita | Las filas (cualquier valor). |
|
|
53
|
+
| `itemHeight` | `item-height` | — | Alto fijo de cada fila; sin él, las filas se miden. |
|
|
54
|
+
| `estimatedHeight` | `estimated-height` | `itemHeight` o `48` | Alto supuesto de una fila sin medir. |
|
|
55
|
+
| `overscan` | `overscan` | `6` | Filas extra dibujadas a cada lado. |
|
|
56
|
+
| `renderItem(item, index, row)` | — | su texto | Dibuja una fila (en React, `renderItem(item, index)` devuelve el contenido). |
|
|
57
|
+
| `itemText(item)` | — | `label`, `title`, `name` o el valor | El texto de una fila: dibujo por defecto, salto al escribir y anuncios. |
|
|
58
|
+
| `getKey(item, index)` | — | su `id`, o el índice | Clave estable de una fila. |
|
|
59
|
+
| `selectable` | `selectable` | `false` | `true` o `'single'`: una; `'multiple'`: varias (clic alterna, Mayús toma un rango). |
|
|
60
|
+
| `selected` | `selected` (lista con comas) | `[]` | Claves elegidas. |
|
|
61
|
+
| `label` | `label` | `'Lista'` | Nombre accesible. |
|
|
62
|
+
| `emptyLabel` | `empty-label` | `'Sin elementos'` | Texto sin filas. |
|
|
63
|
+
| `onSelect(keys, items)` | — | — | Cambió lo elegido. |
|
|
64
|
+
| `onActivate(item, index)` | — | — | Intro o doble clic en una fila. |
|
|
65
|
+
| `onEndReached()` | — | — | Más filas al final: resuelve con ellas, con `[]` cuando no hay más, o sin nada si tú las agregas a `items` (lo natural en React). Con la lista vacía, pide la primera página. |
|
|
66
|
+
|
|
67
|
+
## API y eventos
|
|
68
|
+
|
|
69
|
+
`setItems(items)`, `append(items)`, `scrollToIndex(index, { align: 'auto' \| 'start' \| 'center' \| 'end', animate = true })`, `refresh()`, `select(keys)`, `setRenderer(fn)`, `items`, `range`, `selected`, `container`, `destroy()`. Evento `mk:select` con `{ keys, items }`. El núcleo de ventanas (`createSizes`) también se exporta.
|
|
70
|
+
|
|
71
|
+
## Variables CSS
|
|
72
|
+
|
|
73
|
+
`--mk-vl-height` (alto visible, `24rem`).
|
|
74
|
+
|
|
75
|
+
## Teclado
|
|
76
|
+
|
|
77
|
+
En una lista elegible: ↑ ↓, Re Pág, Av Pág, Inicio y Fin mueven el anillo; Espacio elige; Intro elige y activa; Mayús + flechas amplía en modo múltiple, y escribir salta a la fila que empieza así. Una lista que no es elegible se desplaza con las teclas de siempre.
|
|
78
|
+
|
|
79
|
+
## Accesibilidad
|
|
80
|
+
|
|
81
|
+
Cada fila dice su posición en el total (`aria-posinset` y `aria-setsize`), aunque no estén todas en la página. En modo elegible, el foco se queda en la lista y `aria-activedescendant` apunta a la fila activa, que siempre está dibujada. Un estado discreto anuncia lo elegido y las filas que llegan. Con movimiento reducido no hay deslizamientos, destellos ni cascadas.
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { MkElement, defineElement, type OptionType } from '../../elements/base';
|
|
2
|
+
import { createVirtualList, type VirtualListInstance } from './engine';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* <mk-virtual-list class="mk-virtual-list" item-height="44" selectable="multiple" items='["Uno","Dos", …]'></mk-virtual-list>
|
|
6
|
+
* Or an authored <ul><li>…</li></ul>. element.instance.setRenderer((item, i, row) => …) draws richer rows.
|
|
7
|
+
* Emits mk:select ({keys, items}).
|
|
8
|
+
*/
|
|
9
|
+
export class MkVirtualListElement extends MkElement<VirtualListInstance> {
|
|
10
|
+
static options: Record<string, OptionType> = {
|
|
11
|
+
items: 'json',
|
|
12
|
+
itemHeight: 'number',
|
|
13
|
+
estimatedHeight: 'number',
|
|
14
|
+
overscan: 'number',
|
|
15
|
+
selectable: 'string',
|
|
16
|
+
selected: 'list',
|
|
17
|
+
label: 'string',
|
|
18
|
+
emptyLabel: 'string',
|
|
19
|
+
locale: 'string',
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
protected create(options: Record<string, unknown>) {
|
|
23
|
+
// selectable="" or "true" → one at a time; "multiple" → several.
|
|
24
|
+
const raw = this.getAttribute('selectable');
|
|
25
|
+
const selectable = raw === null || raw === 'false' ? false : raw === 'multiple' ? 'multiple' : 'single';
|
|
26
|
+
return createVirtualList(this, { ...options, selectable });
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
attributeChangedCallback(name: string, previous: string | null, next: string | null) {
|
|
30
|
+
if (previous === next || !this.instance) return;
|
|
31
|
+
if (name === 'items') {
|
|
32
|
+
try {
|
|
33
|
+
this.instance.setItems(JSON.parse(next ?? '[]') as unknown[]);
|
|
34
|
+
} catch {
|
|
35
|
+
// Malformed JSON: keep the current rows.
|
|
36
|
+
}
|
|
37
|
+
} else if (name === 'selected') this.instance.select((next ?? '').split(',').map((key) => key.trim()).filter(Boolean));
|
|
38
|
+
else super.attributeChangedCallback(name, previous, next);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export const defineVirtualList = () => defineElement('mk-virtual-list', MkVirtualListElement);
|