@yewdiel21/motion-kit 0.14.0 → 0.16.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 +178 -155
- package/bin/motion-kit.mjs +3 -3
- package/dist/auto/index.d.ts +6 -3
- package/dist/auto/index.js +8 -2
- package/dist/auto/index.js.map +1 -1
- package/dist/{chunk-EY4BJKC4.js → chunk-NFZIX3IA.js} +2 -2
- package/dist/chunk-RBEKR5UZ.js +3660 -0
- package/dist/chunk-RBEKR5UZ.js.map +1 -0
- package/dist/{chunk-CU6SXW3E.js → chunk-SDQ776LG.js} +1596 -485
- package/dist/chunk-SDQ776LG.js.map +1 -0
- package/dist/css/components/add-to-cart.css +72 -0
- package/dist/css/components/bidirectional-slider.css +168 -0
- package/dist/css/components/chart.css +7 -0
- package/dist/css/components/data-table.css +121 -26
- package/dist/css/components/filter-builder.css +10 -15
- package/dist/css/components/heatmap-chart.css +398 -0
- package/dist/css/components/hover-card.css +8 -2
- package/dist/css/components/image-preview.css +90 -2
- package/dist/css/components/json-viewer.css +33 -1
- package/dist/css/components/nav.css +102 -102
- package/dist/css/components/orbit-menu.css +130 -0
- package/dist/css/components/pagination.css +10 -5
- package/dist/css/components/pie-chart.css +397 -0
- package/dist/css/components/pill-button.css +135 -0
- package/dist/css/components/radar-chart.css +377 -0
- package/dist/css/components/radial-chart.css +412 -0
- package/dist/css/components/sankey-chart.css +365 -0
- package/dist/css/components/scroll-island.css +114 -0
- package/dist/css/components/select.css +136 -0
- package/dist/css/components/toolbar.css +122 -0
- package/dist/css/components/tree-view.css +79 -0
- package/dist/css/components/voice-dots.css +70 -0
- package/dist/elements/index.d.ts +180 -7
- package/dist/elements/index.js +293 -7
- package/dist/elements/index.js.map +1 -1
- package/dist/{engine-Cn6IhE3z.d.ts → engine-5zRIssTO.d.ts} +11 -1
- package/dist/index.css +1849 -168
- package/dist/index.d.ts +4 -4
- package/dist/index.js +33 -3
- package/dist/index.js.map +1 -1
- package/dist/react/index.d.ts +117 -11
- package/dist/react/index.js +320 -13
- package/dist/react/index.js.map +1 -1
- package/dist/{reduced-BBUusld6.d.ts → reduced-DQwVXQYb.d.ts} +1 -1
- package/dist/{reveal-DEvp6U6T.d.ts → reveal-DRpNO4KP.d.ts} +109 -4
- package/dist/store-Da3zSh8Z.d.ts +457 -0
- package/package.json +9 -16
- package/registry.json +1096 -948
- package/src/auto/auto-init.ts +6 -0
- package/src/components/add-to-cart/README.md +49 -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 +33 -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/chart/README.md +49 -24
- package/src/components/chart/chart.css +7 -0
- package/src/components/chart/element.ts +4 -1
- package/src/components/chart/engine.ts +153 -34
- package/src/components/chart/parts.ts +237 -0
- package/src/components/chart/react.tsx +2 -2
- package/src/components/chart/use-chart.ts +55 -0
- package/src/components/data-table/README.md +3 -3
- package/src/components/data-table/data-table.css +121 -26
- package/src/components/data-table/engine.ts +81 -29
- package/src/components/editable-table/engine.ts +67 -11
- package/src/components/filter-builder/engine.ts +33 -2
- package/src/components/filter-builder/filter-builder.css +10 -15
- 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/hover-card/engine.ts +30 -1
- package/src/components/hover-card/hover-card.css +8 -2
- package/src/components/image-preview/element.ts +1 -1
- package/src/components/image-preview/engine.ts +95 -15
- package/src/components/image-preview/image-preview.css +90 -2
- package/src/components/image-preview/react.tsx +3 -3
- package/src/components/json-viewer/engine.ts +11 -2
- package/src/components/json-viewer/json-viewer.css +33 -1
- 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/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/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/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 +58 -0
- package/src/components/radial-chart/element.ts +30 -0
- package/src/components/radial-chart/engine.ts +317 -0
- package/src/components/radial-chart/radial-chart.css +107 -0
- package/src/components/radial-chart/react.tsx +14 -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/scroll-island/README.md +44 -0
- package/src/components/scroll-island/element.ts +16 -0
- package/src/components/scroll-island/engine.ts +274 -0
- package/src/components/scroll-island/react.tsx +26 -0
- package/src/components/scroll-island/scroll-island.css +113 -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/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/tree-view/element.ts +1 -1
- package/src/components/tree-view/engine.ts +174 -0
- package/src/components/tree-view/react.tsx +7 -3
- package/src/components/tree-view/tree-view.css +79 -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/elements/index.ts +39 -0
- package/src/index.ts +16 -0
- package/src/motion/liquid.ts +14 -4
- package/src/react/index.ts +14 -1
- package/dist/chunk-6P4P7NU6.js +0 -1401
- package/dist/chunk-6P4P7NU6.js.map +0 -1
- package/dist/chunk-CU6SXW3E.js.map +0 -1
- package/dist/store-DjkTBX7f.d.ts +0 -195
- /package/dist/{chunk-EY4BJKC4.js.map → chunk-NFZIX3IA.js.map} +0 -0
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
|
}
|
package/src/react/index.ts
CHANGED
|
@@ -69,7 +69,7 @@ export {
|
|
|
69
69
|
type ChatComposerProps,
|
|
70
70
|
} from '../components/chat/react';
|
|
71
71
|
export { Nav, type NavProps, type NavItem } from '../components/nav/react';
|
|
72
|
-
export { NAV_STYLES, type NavStyle } from '../components/nav/engine';
|
|
72
|
+
export { NAV_STYLES, NAV_STYLE_ALIASES, toNavStyle, type NavStyle, type NavStyleAlias } from '../components/nav/engine';
|
|
73
73
|
export { Steps, type StepsProps } from '../components/steps/react';
|
|
74
74
|
export { Cursor, type CursorProps } from '../components/cursor/react';
|
|
75
75
|
export { Frost, type FrostProps } from './frost';
|
|
@@ -156,3 +156,16 @@ export { EditableTable, type EditableTableProps, type EditableTableHandle } from
|
|
|
156
156
|
export type { EditableColumn, RowChange, EditorKind } from '../components/editable-table/engine';
|
|
157
157
|
export { RichTextEditor, type RichTextEditorProps, type RichTextEditorHandle } from '../components/rich-text-editor/react';
|
|
158
158
|
export type { RichCommand } from '../components/rich-text-editor/engine';
|
|
159
|
+
export { Select, type SelectProps } from '../components/select/react';
|
|
160
|
+
export { AddToCart, type AddToCartProps } from '../components/add-to-cart/react';
|
|
161
|
+
export { ScrollIsland, type ScrollIslandProps } from '../components/scroll-island/react';
|
|
162
|
+
export { PillButton, type PillButtonProps } from '../components/pill-button/react';
|
|
163
|
+
export { Toolbar, type ToolbarProps } from '../components/toolbar/react';
|
|
164
|
+
export { BidirectionalSlider, type BidirectionalSliderProps } from '../components/bidirectional-slider/react';
|
|
165
|
+
export { VoiceDots, type VoiceDotsProps } from '../components/voice-dots/react';
|
|
166
|
+
export { PieChart, type PieChartProps } from '../components/pie-chart/react';
|
|
167
|
+
export { RadarChart, type RadarChartProps } from '../components/radar-chart/react';
|
|
168
|
+
export { RadialChart, type RadialChartProps } from '../components/radial-chart/react';
|
|
169
|
+
export { SankeyChart, type SankeyChartProps } from '../components/sankey-chart/react';
|
|
170
|
+
export { HeatmapChart, type HeatmapChartProps } from '../components/heatmap-chart/react';
|
|
171
|
+
export { OrbitMenu, type OrbitMenuProps } from '../components/orbit-menu/react';
|