@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,50 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { useRef, type HTMLAttributes } from 'react';
|
|
3
|
+
import { useIsomorphicLayoutEffect, useLatest } from '../../react/use-recipe';
|
|
4
|
+
import { createChart, type ChartInstance, type ChartOptions } from './engine';
|
|
5
|
+
|
|
6
|
+
export interface ChartProps extends Omit<HTMLAttributes<HTMLDivElement>, 'onSelect' | 'children'>, ChartOptions {
|
|
7
|
+
instanceRef?: { current: ChartInstance | null };
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* <Chart type="bar" stacked labels={weeks} series={[{ name: 'Ana', values }]} formatValue={money} label="Sesiones por semana" />.
|
|
12
|
+
* Data changes redraw in place; the selection survives when its point still exists.
|
|
13
|
+
*/
|
|
14
|
+
export function Chart({ type, labels, series, points, stacked, formatValue, label, height, emptyLabel, legend, tooltip, onSelect, instanceRef, className, ...props }: ChartProps) {
|
|
15
|
+
const ref = useRef<HTMLDivElement>(null);
|
|
16
|
+
const instance = useRef<ChartInstance | null>(null);
|
|
17
|
+
const format = useLatest(formatValue);
|
|
18
|
+
const select = useLatest(onSelect);
|
|
19
|
+
const formatted = formatValue !== undefined;
|
|
20
|
+
const data = { type, labels, series, points, stacked, label, height, emptyLabel, legend, tooltip };
|
|
21
|
+
const key = JSON.stringify(data);
|
|
22
|
+
const latest = useLatest(data);
|
|
23
|
+
const options = (): ChartOptions => ({
|
|
24
|
+
...latest.current,
|
|
25
|
+
formatValue: formatted ? (value) => format.current?.(value) ?? String(value) : undefined,
|
|
26
|
+
onSelect: (index) => select.current?.(index),
|
|
27
|
+
});
|
|
28
|
+
useIsomorphicLayoutEffect(() => {
|
|
29
|
+
const created = createChart(ref.current, options());
|
|
30
|
+
instance.current = created;
|
|
31
|
+
if (instanceRef) instanceRef.current = created;
|
|
32
|
+
return () => {
|
|
33
|
+
created.destroy();
|
|
34
|
+
instance.current = null;
|
|
35
|
+
if (instanceRef) instanceRef.current = null;
|
|
36
|
+
};
|
|
37
|
+
// Created once; data is pushed below.
|
|
38
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
39
|
+
}, []);
|
|
40
|
+
const first = useRef(true);
|
|
41
|
+
useIsomorphicLayoutEffect(() => {
|
|
42
|
+
if (first.current) {
|
|
43
|
+
first.current = false;
|
|
44
|
+
return;
|
|
45
|
+
}
|
|
46
|
+
instance.current?.update(options());
|
|
47
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
48
|
+
}, [key, formatted]);
|
|
49
|
+
return <div {...props} ref={ref} className={['mk-chart', className].filter(Boolean).join(' ')} />;
|
|
50
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
# chart-tooltip
|
|
2
|
+
|
|
3
|
+
Tooltip avanzado para gráficas. Sobre la `chart` de motion-kit (creada con `tooltip: false`) sigue la selección de la propia gráfica, que le pasa el punto, cada serie y su valor anterior por `mk:select`, y deja la guía y los marcadores a la gráfica. Sobre cualquier otra gráfica sigue al puntero por `labels` (de borde a borde en líneas, en el centro de cada hueco en barras, dentro de `inset`) y dibuja una guía punteada y, con `min`/`max`, un marcador por serie. El teclado también la mueve (flechas, Inicio, Fin, Escape).
|
|
4
|
+
|
|
5
|
+
La tarjeta es el cristal invertido de Melon Mind: la etiqueta y una fila por serie con su valor, la variación respecto al punto anterior (▲ ▼ %) y, si lo pides, su parte del total, más una fila de total. Aparece con un pop (.25 s), se desliza entre puntos hacia el lado con espacio y los valores que cambian ruedan en su dirección. Un clic la fija: se queda aunque el puntero salga (el pin aparece con un giro); otro clic o Escape la suelta.
|
|
6
|
+
|
|
7
|
+
## HTML / Astro
|
|
8
|
+
|
|
9
|
+
```html
|
|
10
|
+
<mk-chart-tooltip class="mk-chart-tooltip" share>
|
|
11
|
+
<mk-chart class="mk-chart" type="line" tooltip="false" labels="Ene,Feb,Mar"
|
|
12
|
+
series='[{"name":"Ingresos","values":[120,150,140]},{"name":"Gastos","values":[80,95,70]}]'></mk-chart>
|
|
13
|
+
</mk-chart-tooltip>
|
|
14
|
+
|
|
15
|
+
<!-- Sobre otra gráfica (SVG o canvas propios): -->
|
|
16
|
+
<mk-chart-tooltip labels="L,M,X,J,V" series='[{"name":"Visitas","values":[4,6,5,8,7]}]'
|
|
17
|
+
inset='{"left":40,"right":16,"top":12,"bottom":28}' min="0" max="10">
|
|
18
|
+
<canvas id="grafica"></canvas>
|
|
19
|
+
</mk-chart-tooltip>
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
## React
|
|
23
|
+
|
|
24
|
+
```tsx
|
|
25
|
+
<ChartTooltip share total>
|
|
26
|
+
<Chart type="bar" labels={weeks} series={teams} tooltip={false} />
|
|
27
|
+
</ChartTooltip>
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
## Opciones
|
|
31
|
+
|
|
32
|
+
| Opción | Atributo | Por defecto | Qué hace |
|
|
33
|
+
|---|---|---|---|
|
|
34
|
+
| `labels`, `series` | `labels`, `series` (JSON) | — | Datos, en modo independiente (`{ name, values, color? }`). |
|
|
35
|
+
| `align` | `align` | `'edge'` | `edge` (líneas) o `center` (barras). |
|
|
36
|
+
| `inset` | `inset` (JSON) | 0 | Margen del área de la gráfica dentro del contenedor, en px. |
|
|
37
|
+
| `min`, `max` | `min`, `max` | — | Escala vertical: con ella se dibujan marcadores. |
|
|
38
|
+
| `formatValue(n)` | — | 2 decimales | Formato de los valores. |
|
|
39
|
+
| `delta` | `delta` | `true` | Variación respecto al punto anterior. |
|
|
40
|
+
| `share` | `share` | `false` | Parte del total de cada fila. |
|
|
41
|
+
| `total` | `total` | con 2+ series | Fila de total. |
|
|
42
|
+
| `sort` | `sort` | `false` | Filas de mayor a menor. |
|
|
43
|
+
| `pin` | `pin` | `true` | Un clic fija la tarjeta. |
|
|
44
|
+
| `label` | `label` | `'Gráfica'` | Nombre accesible en modo independiente. |
|
|
45
|
+
| `onIndexChange(index)` | — | — | Al cambiar de punto. |
|
|
46
|
+
|
|
47
|
+
## API y eventos
|
|
48
|
+
|
|
49
|
+
`show(i)`, `hide()`, `update(options)`, `index`, `pinned`, `destroy()`. Evento `mk:index-change` con `{ index, pinned }`.
|
|
50
|
+
|
|
51
|
+
## Accesibilidad
|
|
52
|
+
|
|
53
|
+
Sobre `chart`, la tabla y los anuncios son los de la gráfica. En modo independiente el contenedor es enfocable y un estado discreto anuncia cada punto al moverse con el teclado. Con movimiento reducido no hay pop ni deslizamientos.
|
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
/* chart-tooltip — an overlay on the chart it wraps: a dotted guide, 10 px markers ringed in the surface colour and
|
|
2
|
+
a 12 px card in Melon Mind's inverse glass (label, rows with a swatch, value, change and share, a total). */
|
|
3
|
+
.mk-chart-tooltip,
|
|
4
|
+
mk-chart-tooltip {
|
|
5
|
+
/* The chart palette (same as chart.css), so series over any chart get their colours without it. */
|
|
6
|
+
--mk-chart-mono: var(--mk-text);
|
|
7
|
+
--mk-chart-1: #2a78d6;
|
|
8
|
+
--mk-chart-2: #eb6834;
|
|
9
|
+
--mk-chart-3: #1baf7a;
|
|
10
|
+
--mk-chart-4: #eda100;
|
|
11
|
+
--mk-chart-5: #e87ba4;
|
|
12
|
+
--mk-chart-6: #008300;
|
|
13
|
+
--mk-chart-7: #6250d6;
|
|
14
|
+
--mk-chart-8: #e34948;
|
|
15
|
+
position: relative;
|
|
16
|
+
display: block;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
@media (prefers-color-scheme: dark) {
|
|
20
|
+
:where(:root:not([data-mk-mode='light'])) :is(.mk-chart-tooltip, mk-chart-tooltip) {
|
|
21
|
+
--mk-chart-1: #3987e5;
|
|
22
|
+
--mk-chart-2: #d95926;
|
|
23
|
+
--mk-chart-3: #199e70;
|
|
24
|
+
--mk-chart-4: #c98500;
|
|
25
|
+
--mk-chart-5: #d55181;
|
|
26
|
+
--mk-chart-6: #008300;
|
|
27
|
+
--mk-chart-7: #9085e9;
|
|
28
|
+
--mk-chart-8: #e66767;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
:where(:root[data-mk-mode='dark']) :is(.mk-chart-tooltip, mk-chart-tooltip) {
|
|
33
|
+
--mk-chart-1: #3987e5;
|
|
34
|
+
--mk-chart-2: #d95926;
|
|
35
|
+
--mk-chart-3: #199e70;
|
|
36
|
+
--mk-chart-4: #c98500;
|
|
37
|
+
--mk-chart-5: #d55181;
|
|
38
|
+
--mk-chart-6: #008300;
|
|
39
|
+
--mk-chart-7: #9085e9;
|
|
40
|
+
--mk-chart-8: #e66767;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
:is(.mk-chart-tooltip, mk-chart-tooltip):focus-visible {
|
|
44
|
+
border-radius: 12px;
|
|
45
|
+
outline: 2px solid var(--mk-accent);
|
|
46
|
+
outline-offset: 4px;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
[data-mk-ct-layer] {
|
|
50
|
+
position: absolute;
|
|
51
|
+
inset: 0;
|
|
52
|
+
z-index: 3;
|
|
53
|
+
pointer-events: none;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
[data-mk-ct-guide] {
|
|
57
|
+
position: absolute;
|
|
58
|
+
left: 0;
|
|
59
|
+
width: 0;
|
|
60
|
+
border-left: 1.5px dotted var(--mk-muted);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
[data-mk-ct-marker] {
|
|
64
|
+
position: absolute;
|
|
65
|
+
top: -5px;
|
|
66
|
+
left: -5px;
|
|
67
|
+
width: 10px;
|
|
68
|
+
height: 10px;
|
|
69
|
+
border-radius: 50%;
|
|
70
|
+
box-shadow: 0 0 0 2.5px var(--mk-surface-1);
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
[data-mk-ct-card] {
|
|
74
|
+
position: absolute;
|
|
75
|
+
top: 0;
|
|
76
|
+
left: 0;
|
|
77
|
+
display: grid;
|
|
78
|
+
gap: 0.35rem;
|
|
79
|
+
box-sizing: border-box;
|
|
80
|
+
min-width: 11rem;
|
|
81
|
+
max-width: min(18rem, calc(100% - 8px));
|
|
82
|
+
padding: 0.65rem 0.8rem;
|
|
83
|
+
border-radius: 12px;
|
|
84
|
+
background: var(--mk-glass-inverse, rgb(24 24 24 / 0.9));
|
|
85
|
+
color: var(--mk-on-glass-inverse, #fff);
|
|
86
|
+
box-shadow: var(--mk-glass-bevel, 0 12px 32px -12px rgb(0 0 0 / 0.4));
|
|
87
|
+
font-size: 0.8125rem;
|
|
88
|
+
line-height: 1.3;
|
|
89
|
+
-webkit-backdrop-filter: blur(16px);
|
|
90
|
+
backdrop-filter: blur(16px);
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
[data-mk-ct-card][hidden],
|
|
94
|
+
[data-mk-ct-guide][hidden],
|
|
95
|
+
[data-mk-ct-marker][hidden],
|
|
96
|
+
[data-mk-ct-pin][hidden],
|
|
97
|
+
[data-mk-ct-delta][hidden] {
|
|
98
|
+
display: none;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
[data-mk-ct-head] {
|
|
102
|
+
display: flex;
|
|
103
|
+
align-items: center;
|
|
104
|
+
justify-content: space-between;
|
|
105
|
+
gap: 0.5rem;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
[data-mk-ct-title] {
|
|
109
|
+
overflow: hidden;
|
|
110
|
+
font-weight: 600;
|
|
111
|
+
text-overflow: ellipsis;
|
|
112
|
+
white-space: nowrap;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
[data-mk-ct-pin] {
|
|
116
|
+
display: inline-grid;
|
|
117
|
+
place-items: center;
|
|
118
|
+
opacity: 0.8;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
[data-mk-ct-rows] {
|
|
122
|
+
display: grid;
|
|
123
|
+
gap: 0.3rem;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
[data-mk-ct-row] {
|
|
127
|
+
display: grid;
|
|
128
|
+
grid-template-columns: auto minmax(0, 1fr) auto;
|
|
129
|
+
align-items: center;
|
|
130
|
+
column-gap: 0.5rem;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
[data-mk-ct-swatch] {
|
|
134
|
+
width: 0.6rem;
|
|
135
|
+
height: 0.6rem;
|
|
136
|
+
border-radius: 3px;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
[data-mk-ct-swatch][data-mk-mono] {
|
|
140
|
+
height: 2px;
|
|
141
|
+
border-radius: 1px;
|
|
142
|
+
background: currentColor;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
[data-mk-ct-name] {
|
|
146
|
+
overflow: hidden;
|
|
147
|
+
text-overflow: ellipsis;
|
|
148
|
+
white-space: nowrap;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
[data-mk-ct-value] {
|
|
152
|
+
font-variant-numeric: tabular-nums;
|
|
153
|
+
font-weight: 600;
|
|
154
|
+
text-align: end;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
[data-mk-ct-delta] {
|
|
158
|
+
grid-column: 2 / -1;
|
|
159
|
+
font-size: 0.75rem;
|
|
160
|
+
font-variant-numeric: tabular-nums;
|
|
161
|
+
opacity: 0.78;
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
[data-mk-ct-row='total'] {
|
|
165
|
+
padding-top: 0.3rem;
|
|
166
|
+
border-top: 1px solid color-mix(in srgb, currentColor 22%, transparent);
|
|
167
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { MkElement, defineElement, type OptionType } from '../../elements/base';
|
|
2
|
+
import { createChartTooltip, type ChartTooltipInstance } from './engine';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* <mk-chart-tooltip class="mk-chart-tooltip" share total>
|
|
6
|
+
* <mk-chart class="mk-chart" tooltip="false" …></mk-chart>
|
|
7
|
+
* </mk-chart-tooltip>
|
|
8
|
+
* Over another chart give it labels, series (JSON), align, inset (JSON), min and max.
|
|
9
|
+
* Emits mk:index-change ({index, pinned}).
|
|
10
|
+
*/
|
|
11
|
+
export class MkChartTooltipElement extends MkElement<ChartTooltipInstance> {
|
|
12
|
+
static options: Record<string, OptionType> = {
|
|
13
|
+
labels: 'list',
|
|
14
|
+
series: 'json',
|
|
15
|
+
align: 'string',
|
|
16
|
+
inset: 'json',
|
|
17
|
+
min: 'number',
|
|
18
|
+
max: 'number',
|
|
19
|
+
delta: 'boolean',
|
|
20
|
+
share: 'boolean',
|
|
21
|
+
total: 'boolean',
|
|
22
|
+
sort: 'boolean',
|
|
23
|
+
pin: 'boolean',
|
|
24
|
+
label: 'string',
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
protected create(options: Record<string, unknown>) {
|
|
28
|
+
return createChartTooltip(this, options);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
attributeChangedCallback(_name: string, previous: string | null, next: string | null) {
|
|
32
|
+
if (previous === next || !this.instance) return;
|
|
33
|
+
this.instance.update(this.options);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export const defineChartTooltip = () => defineElement('mk-chart-tooltip', MkChartTooltipElement);
|