@yewdiel21/motion-kit 0.14.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.
Files changed (154) hide show
  1. package/README.md +174 -155
  2. package/bin/motion-kit.mjs +3 -3
  3. package/dist/auto/index.d.ts +6 -3
  4. package/dist/auto/index.js +8 -2
  5. package/dist/auto/index.js.map +1 -1
  6. package/dist/{chunk-EY4BJKC4.js → chunk-6IRJYXJU.js} +2 -2
  7. package/dist/{chunk-CU6SXW3E.js → chunk-A6QQCF6V.js} +1309 -310
  8. package/dist/chunk-A6QQCF6V.js.map +1 -0
  9. package/dist/chunk-JXRS3OEA.js +3638 -0
  10. package/dist/chunk-JXRS3OEA.js.map +1 -0
  11. package/dist/css/components/add-to-cart.css +72 -0
  12. package/dist/css/components/bidirectional-slider.css +168 -0
  13. package/dist/css/components/data-table.css +121 -26
  14. package/dist/css/components/filter-builder.css +10 -15
  15. package/dist/css/components/heatmap-chart.css +391 -0
  16. package/dist/css/components/hover-card.css +8 -2
  17. package/dist/css/components/image-preview.css +90 -2
  18. package/dist/css/components/json-viewer.css +33 -1
  19. package/dist/css/components/nav.css +102 -102
  20. package/dist/css/components/orbit-menu.css +130 -0
  21. package/dist/css/components/pagination.css +10 -5
  22. package/dist/css/components/pie-chart.css +390 -0
  23. package/dist/css/components/pill-button.css +135 -0
  24. package/dist/css/components/radar-chart.css +370 -0
  25. package/dist/css/components/radial-chart.css +398 -0
  26. package/dist/css/components/sankey-chart.css +358 -0
  27. package/dist/css/components/scroll-island.css +111 -0
  28. package/dist/css/components/select.css +136 -0
  29. package/dist/css/components/toolbar.css +122 -0
  30. package/dist/css/components/tree-view.css +79 -0
  31. package/dist/css/components/voice-dots.css +70 -0
  32. package/dist/elements/index.d.ts +180 -7
  33. package/dist/elements/index.js +287 -6
  34. package/dist/elements/index.js.map +1 -1
  35. package/dist/{engine-Cn6IhE3z.d.ts → engine-5zRIssTO.d.ts} +11 -1
  36. package/dist/index.css +1832 -168
  37. package/dist/index.d.ts +4 -4
  38. package/dist/index.js +33 -3
  39. package/dist/index.js.map +1 -1
  40. package/dist/react/index.d.ts +117 -11
  41. package/dist/react/index.js +314 -13
  42. package/dist/react/index.js.map +1 -1
  43. package/dist/{reduced-BBUusld6.d.ts → reduced-6X_bns60.d.ts} +1 -1
  44. package/dist/{reveal-DEvp6U6T.d.ts → reveal-BfyKKsw4.d.ts} +97 -4
  45. package/dist/store-CA2Qcun_.d.ts +453 -0
  46. package/package.json +9 -16
  47. package/registry.json +1096 -948
  48. package/src/auto/auto-init.ts +6 -0
  49. package/src/components/add-to-cart/README.md +34 -0
  50. package/src/components/add-to-cart/add-to-cart.css +71 -0
  51. package/src/components/add-to-cart/element.ts +20 -0
  52. package/src/components/add-to-cart/engine.ts +206 -0
  53. package/src/components/add-to-cart/react.tsx +29 -0
  54. package/src/components/bidirectional-slider/README.md +46 -0
  55. package/src/components/bidirectional-slider/bidirectional-slider.css +167 -0
  56. package/src/components/bidirectional-slider/element.ts +42 -0
  57. package/src/components/bidirectional-slider/engine.ts +289 -0
  58. package/src/components/bidirectional-slider/react.tsx +45 -0
  59. package/src/components/chart/README.md +10 -0
  60. package/src/components/chart/element.ts +2 -0
  61. package/src/components/chart/engine.ts +50 -23
  62. package/src/components/chart/parts.ts +237 -0
  63. package/src/components/chart/react.tsx +2 -2
  64. package/src/components/chart/use-chart.ts +55 -0
  65. package/src/components/data-table/README.md +3 -3
  66. package/src/components/data-table/data-table.css +121 -26
  67. package/src/components/data-table/engine.ts +81 -29
  68. package/src/components/editable-table/engine.ts +67 -11
  69. package/src/components/filter-builder/engine.ts +33 -2
  70. package/src/components/filter-builder/filter-builder.css +10 -15
  71. package/src/components/heatmap-chart/README.md +48 -0
  72. package/src/components/heatmap-chart/element.ts +21 -0
  73. package/src/components/heatmap-chart/engine.ts +281 -0
  74. package/src/components/heatmap-chart/heatmap-chart.css +93 -0
  75. package/src/components/heatmap-chart/react.tsx +14 -0
  76. package/src/components/hover-card/engine.ts +30 -1
  77. package/src/components/hover-card/hover-card.css +8 -2
  78. package/src/components/image-preview/element.ts +1 -1
  79. package/src/components/image-preview/engine.ts +95 -15
  80. package/src/components/image-preview/image-preview.css +90 -2
  81. package/src/components/image-preview/react.tsx +3 -3
  82. package/src/components/json-viewer/engine.ts +11 -2
  83. package/src/components/json-viewer/json-viewer.css +33 -1
  84. package/src/components/nav/README.md +12 -10
  85. package/src/components/nav/element.ts +5 -5
  86. package/src/components/nav/engine.ts +21 -14
  87. package/src/components/nav/nav.css +102 -102
  88. package/src/components/nav/react.tsx +4 -4
  89. package/src/components/orbit-menu/README.md +46 -0
  90. package/src/components/orbit-menu/element.ts +27 -0
  91. package/src/components/orbit-menu/engine.ts +179 -0
  92. package/src/components/orbit-menu/orbit-menu.css +129 -0
  93. package/src/components/orbit-menu/react.tsx +44 -0
  94. package/src/components/pagination/README.md +1 -1
  95. package/src/components/pagination/engine.ts +50 -4
  96. package/src/components/pagination/pagination.css +10 -5
  97. package/src/components/pie-chart/README.md +48 -0
  98. package/src/components/pie-chart/element.ts +30 -0
  99. package/src/components/pie-chart/engine.ts +283 -0
  100. package/src/components/pie-chart/pie-chart.css +92 -0
  101. package/src/components/pie-chart/react.tsx +14 -0
  102. package/src/components/pill-button/README.md +46 -0
  103. package/src/components/pill-button/element.ts +16 -0
  104. package/src/components/pill-button/engine.ts +77 -0
  105. package/src/components/pill-button/pill-button.css +134 -0
  106. package/src/components/pill-button/react.tsx +32 -0
  107. package/src/components/radar-chart/README.md +48 -0
  108. package/src/components/radar-chart/element.ts +30 -0
  109. package/src/components/radar-chart/engine.ts +327 -0
  110. package/src/components/radar-chart/radar-chart.css +72 -0
  111. package/src/components/radar-chart/react.tsx +14 -0
  112. package/src/components/radial-chart/README.md +48 -0
  113. package/src/components/radial-chart/element.ts +30 -0
  114. package/src/components/radial-chart/engine.ts +290 -0
  115. package/src/components/radial-chart/radial-chart.css +100 -0
  116. package/src/components/radial-chart/react.tsx +14 -0
  117. package/src/components/sankey-chart/README.md +48 -0
  118. package/src/components/sankey-chart/element.ts +31 -0
  119. package/src/components/sankey-chart/engine.ts +401 -0
  120. package/src/components/sankey-chart/react.tsx +14 -0
  121. package/src/components/sankey-chart/sankey-chart.css +60 -0
  122. package/src/components/scroll-island/README.md +34 -0
  123. package/src/components/scroll-island/element.ts +16 -0
  124. package/src/components/scroll-island/engine.ts +252 -0
  125. package/src/components/scroll-island/react.tsx +26 -0
  126. package/src/components/scroll-island/scroll-island.css +110 -0
  127. package/src/components/select/README.md +34 -0
  128. package/src/components/select/element.ts +26 -0
  129. package/src/components/select/engine.ts +267 -0
  130. package/src/components/select/react.tsx +33 -0
  131. package/src/components/select/select.css +135 -0
  132. package/src/components/toolbar/README.md +46 -0
  133. package/src/components/toolbar/element.ts +30 -0
  134. package/src/components/toolbar/engine.ts +230 -0
  135. package/src/components/toolbar/react.tsx +34 -0
  136. package/src/components/toolbar/toolbar.css +121 -0
  137. package/src/components/tree-view/element.ts +1 -1
  138. package/src/components/tree-view/engine.ts +174 -0
  139. package/src/components/tree-view/react.tsx +7 -3
  140. package/src/components/tree-view/tree-view.css +79 -0
  141. package/src/components/voice-dots/README.md +48 -0
  142. package/src/components/voice-dots/element.ts +45 -0
  143. package/src/components/voice-dots/engine.ts +243 -0
  144. package/src/components/voice-dots/react.tsx +52 -0
  145. package/src/components/voice-dots/voice-dots.css +69 -0
  146. package/src/elements/index.ts +39 -0
  147. package/src/index.ts +16 -0
  148. package/src/motion/liquid.ts +14 -4
  149. package/src/react/index.ts +14 -1
  150. package/dist/chunk-6P4P7NU6.js +0 -1401
  151. package/dist/chunk-6P4P7NU6.js.map +0 -1
  152. package/dist/chunk-CU6SXW3E.js.map +0 -1
  153. package/dist/store-DjkTBX7f.d.ts +0 -195
  154. /package/dist/{chunk-EY4BJKC4.js.map → chunk-6IRJYXJU.js.map} +0 -0
@@ -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
- void motion.animate(
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 springs settle well within the source's 1.1 s window.
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
  }
@@ -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';