@ssgoi/core 0.0.3 → 2.0.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 (41) hide show
  1. package/README.md +252 -23
  2. package/dist/animator.d.ts +28 -17
  3. package/dist/animator.d.ts.map +1 -1
  4. package/dist/create-transition-callback.d.ts +3 -32
  5. package/dist/create-transition-callback.d.ts.map +1 -1
  6. package/dist/index.cjs +1 -1
  7. package/dist/index.d.ts +1 -0
  8. package/dist/index.d.ts.map +1 -1
  9. package/dist/index.js +310 -195
  10. package/dist/presets/index.cjs +1 -0
  11. package/dist/presets/index.d.ts +16 -0
  12. package/dist/presets/index.d.ts.map +1 -0
  13. package/dist/presets/index.js +35 -0
  14. package/dist/transition-strategy.d.ts +60 -0
  15. package/dist/transition-strategy.d.ts.map +1 -0
  16. package/dist/transition.d.ts +7 -3
  17. package/dist/transition.d.ts.map +1 -1
  18. package/dist/transitions/blur.d.ts +2 -1
  19. package/dist/transitions/blur.d.ts.map +1 -1
  20. package/dist/transitions/bounce.d.ts +2 -0
  21. package/dist/transitions/bounce.d.ts.map +1 -1
  22. package/dist/transitions/fly.d.ts +27 -0
  23. package/dist/transitions/fly.d.ts.map +1 -0
  24. package/dist/transitions/index.cjs +1 -1
  25. package/dist/transitions/index.d.ts +1 -0
  26. package/dist/transitions/index.d.ts.map +1 -1
  27. package/dist/transitions/index.js +175 -111
  28. package/dist/transitions/rotate.d.ts +3 -0
  29. package/dist/transitions/rotate.d.ts.map +1 -1
  30. package/dist/transitions/scale.d.ts +3 -3
  31. package/dist/transitions/scale.d.ts.map +1 -1
  32. package/dist/transitions/slide.d.ts +3 -1
  33. package/dist/transitions/slide.d.ts.map +1 -1
  34. package/dist/types.d.ts +8 -6
  35. package/dist/types.d.ts.map +1 -1
  36. package/dist/view-transitions/index.cjs +1 -1
  37. package/dist/view-transitions/index.d.ts +1 -1
  38. package/dist/view-transitions/index.js +117 -126
  39. package/dist/view-transitions/scroll.d.ts +8 -0
  40. package/dist/view-transitions/scroll.d.ts.map +1 -0
  41. package/package.json +21 -4
@@ -0,0 +1,60 @@
1
+ import { TransitionConfig } from './types';
2
+ import { Animator } from './animator';
3
+ export declare const TRANSITION_STRATEGY: unique symbol;
4
+ export interface StrategyContext<TAnimationValue = number> {
5
+ currentAnimation: {
6
+ animator: Animator<TAnimationValue>;
7
+ direction: "in" | "out";
8
+ } | null;
9
+ }
10
+ export interface AnimationSetup<TAnimationValue = number> {
11
+ config?: TransitionConfig<TAnimationValue>;
12
+ state: {
13
+ position: TAnimationValue;
14
+ velocity: TAnimationValue extends number ? number : Record<string, number>;
15
+ };
16
+ from: TAnimationValue;
17
+ to: TAnimationValue;
18
+ direction: "forward" | "backward";
19
+ }
20
+ export interface TransitionConfigs<TAnimationValue = number> {
21
+ in?: Promise<TransitionConfig<TAnimationValue>>;
22
+ out?: Promise<TransitionConfig<TAnimationValue>>;
23
+ }
24
+ export interface TransitionStrategy<TAnimationValue = number> {
25
+ runIn: (configs: TransitionConfigs<TAnimationValue>) => Promise<AnimationSetup<TAnimationValue>>;
26
+ runOut: (configs: TransitionConfigs<TAnimationValue>) => Promise<AnimationSetup<TAnimationValue>>;
27
+ }
28
+ /**
29
+ * Creates a transition callback that can be used with framework-specific implementations
30
+ * This is the core logic that frameworks can wrap with their own APIs
31
+ *
32
+ * UX Animation Behavior - 4 Main Scenarios:
33
+ *
34
+ * 1. No animation running + IN trigger:
35
+ * - Start entrance animation (0 → 1)
36
+ * - Return cleanup function for exit
37
+ *
38
+ * 2. No animation running + OUT trigger:
39
+ * - Clone element, start exit animation (1 → 0)
40
+ * - Remove clone when complete
41
+ *
42
+ * 3. IN animation running + OUT trigger:
43
+ * - Stop current IN animation (DOM is disappearing)
44
+ * - Clone element for exit animation
45
+ * - Create REVERSED IN animation (not OUT animation) with current state
46
+ * - This gives natural backward motion instead of jumping to OUT definition
47
+ *
48
+ * 4. OUT animation running + IN trigger:
49
+ * - Stop current OUT animation (cleanup any cloned elements)
50
+ * - Create REVERSED OUT animation (not IN animation) with current state
51
+ * - This gives natural backward motion instead of jumping to IN definition
52
+ * - Switch to entrance mode
53
+ *
54
+ * Closure Structure:
55
+ * - Outer function: Returns entrance callback
56
+ * - Inner function (entrance callback): Returns cleanup callback (exit)
57
+ * - Cleanup callback: Handles exit transitions
58
+ */
59
+ export declare const createDefaultStrategy: <TAnimationValue = number>(context: StrategyContext<TAnimationValue>) => TransitionStrategy<TAnimationValue>;
60
+ //# sourceMappingURL=transition-strategy.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"transition-strategy.d.ts","sourceRoot":"","sources":["../src/lib/transition-strategy.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAChD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAE3C,eAAO,MAAM,mBAAmB,eAAoC,CAAC;AAErE,MAAM,WAAW,eAAe,CAAC,eAAe,GAAG,MAAM;IAEvD,gBAAgB,EAAE;QAAE,QAAQ,EAAE,QAAQ,CAAC,eAAe,CAAC,CAAC;QAAC,SAAS,EAAE,IAAI,GAAG,KAAK,CAAA;KAAE,GAAG,IAAI,CAAC;CAC3F;AAED,MAAM,WAAW,cAAc,CAAC,eAAe,GAAG,MAAM;IACtD,MAAM,CAAC,EAAE,gBAAgB,CAAC,eAAe,CAAC,CAAC;IAC3C,KAAK,EAAE;QAAE,QAAQ,EAAE,eAAe,CAAC;QAAC,QAAQ,EAAE,eAAe,SAAS,MAAM,GAAG,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;KAAE,CAAC;IACjH,IAAI,EAAE,eAAe,CAAC;IACtB,EAAE,EAAE,eAAe,CAAC;IACpB,SAAS,EAAE,SAAS,GAAG,UAAU,CAAC;CACnC;AAED,MAAM,WAAW,iBAAiB,CAAC,eAAe,GAAG,MAAM;IACzD,EAAE,CAAC,EAAE,OAAO,CAAC,gBAAgB,CAAC,eAAe,CAAC,CAAC,CAAC;IAChD,GAAG,CAAC,EAAE,OAAO,CAAC,gBAAgB,CAAC,eAAe,CAAC,CAAC,CAAC;CAClD;AAED,MAAM,WAAW,kBAAkB,CAAC,eAAe,GAAG,MAAM;IAC1D,KAAK,EAAE,CAAC,OAAO,EAAE,iBAAiB,CAAC,eAAe,CAAC,KAAK,OAAO,CAAC,cAAc,CAAC,eAAe,CAAC,CAAC,CAAC;IACjG,MAAM,EAAE,CAAC,OAAO,EAAE,iBAAiB,CAAC,eAAe,CAAC,KAAK,OAAO,CAAC,cAAc,CAAC,eAAe,CAAC,CAAC,CAAC;CACnG;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AAEH,eAAO,MAAM,qBAAqB,GAAI,eAAe,GAAG,MAAM,EAC5D,SAAS,eAAe,CAAC,eAAe,CAAC,KACxC,kBAAkB,CAAC,eAAe,CAmGpC,CAAC"}
@@ -1,3 +1,4 @@
1
+ import { StrategyContext, TRANSITION_STRATEGY, TransitionStrategy } from './transition-strategy';
1
2
  import { Transition, TransitionCallback } from './types';
2
3
  /**
3
4
  * Key type for transitions - can be string or symbol
@@ -6,11 +7,14 @@ type TransitionKey = string | symbol;
6
7
  /**
7
8
  * Framework-agnostic transition function that can be used as a ref
8
9
  * Usage: <div ref={transition({ key: 'fade', in, out })} />
10
+ *
11
+ * @template TAnimationValue - The type of value being animated (number | object)
9
12
  */
10
- export declare function transition(options: {
13
+ export declare function transition<TAnimationValue = number>(options: {
11
14
  key: TransitionKey;
12
- in?: Transition["in"];
13
- out?: Transition["out"];
15
+ in?: Transition<undefined, TAnimationValue>["in"];
16
+ out?: Transition<undefined, TAnimationValue>["out"];
17
+ [TRANSITION_STRATEGY]?: (context: StrategyContext<TAnimationValue>) => TransitionStrategy<TAnimationValue>;
14
18
  }): TransitionCallback;
15
19
  export {};
16
20
  //# sourceMappingURL=transition.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"transition.d.ts","sourceRoot":"","sources":["../src/lib/transition.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAE9D;;GAEG;AACH,KAAK,aAAa,GAAG,MAAM,GAAG,MAAM,CAAC;AAuDrC;;;GAGG;AACH,wBAAgB,UAAU,CAAC,OAAO,EAAE;IAClC,GAAG,EAAE,aAAa,CAAC;IACnB,EAAE,CAAC,EAAE,UAAU,CAAC,IAAI,CAAC,CAAC;IACtB,GAAG,CAAC,EAAE,UAAU,CAAC,KAAK,CAAC,CAAC;CACzB,GAAG,kBAAkB,CAMrB"}
1
+ {"version":3,"file":"transition.d.ts","sourceRoot":"","sources":["../src/lib/transition.ts"],"names":[],"mappings":"AACA,OAAO,EACL,eAAe,EACf,mBAAmB,EACnB,kBAAkB,EACnB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,KAAK,EAAE,UAAU,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAE9D;;GAEG;AACH,KAAK,aAAa,GAAG,MAAM,GAAG,MAAM,CAAC;AAyDrC;;;;;GAKG;AACH,wBAAgB,UAAU,CAAC,eAAe,GAAG,MAAM,EAAE,OAAO,EAAE;IAC5D,GAAG,EAAE,aAAa,CAAC;IACnB,EAAE,CAAC,EAAE,UAAU,CAAC,SAAS,EAAE,eAAe,CAAC,CAAC,IAAI,CAAC,CAAC;IAClD,GAAG,CAAC,EAAE,UAAU,CAAC,SAAS,EAAE,eAAe,CAAC,CAAC,KAAK,CAAC,CAAC;IACpD,CAAC,mBAAmB,CAAC,CAAC,EAAE,CAAC,OAAO,EAAE,eAAe,CAAC,eAAe,CAAC,KAAK,kBAAkB,CAAC,eAAe,CAAC,CAAC;CAC5G,GAAG,kBAAkB,CAMrB"}
@@ -1,5 +1,6 @@
1
1
  interface BlurOptions {
2
- amount?: number;
2
+ amount?: number | string;
3
+ opacity?: number;
3
4
  scale?: boolean;
4
5
  fade?: boolean;
5
6
  spring?: {
@@ -1 +1 @@
1
- {"version":3,"file":"blur.d.ts","sourceRoot":"","sources":["../../src/lib/transitions/blur.ts"],"names":[],"mappings":"AAAA,UAAU,WAAW;IACnB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,MAAM,CAAC,EAAE;QACP,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,OAAO,CAAC,EAAE,MAAM,CAAC;KAClB,CAAC;CACH;AAED,eAAO,MAAM,IAAI,GAAI,UAAS,WAAgB;kBAS5B,WAAW;;wBAdb,MAAM;sBACR,MAAM;;yBAeG,MAAM;;mBAeV,WAAW;;wBA/Bd,MAAM;sBACR,MAAM;;yBAgCG,MAAM;;CAgB5B,CAAC"}
1
+ {"version":3,"file":"blur.d.ts","sourceRoot":"","sources":["../../src/lib/transitions/blur.ts"],"names":[],"mappings":"AAAA,UAAU,WAAW;IACnB,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACzB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,MAAM,CAAC,EAAE;QACP,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,OAAO,CAAC,EAAE,MAAM,CAAC;KAClB,CAAC;CACH;AAED,eAAO,MAAM,IAAI,GAAI,UAAS,WAAgB;kBAc5B,WAAW;;wBAnBb,MAAM;sBACR,MAAM;;yBAoBG,MAAM;;mBAmBV,WAAW;;wBAxCd,MAAM;sBACR,MAAM;;yBAyCG,MAAM;;CAoB5B,CAAC"}
@@ -1,7 +1,9 @@
1
1
  interface BounceOptions {
2
2
  height?: number;
3
+ intensity?: number;
3
4
  scale?: boolean;
4
5
  fade?: boolean;
6
+ direction?: 'up' | 'down';
5
7
  spring?: {
6
8
  stiffness?: number;
7
9
  damping?: number;
@@ -1 +1 @@
1
- {"version":3,"file":"bounce.d.ts","sourceRoot":"","sources":["../../src/lib/transitions/bounce.ts"],"names":[],"mappings":"AAAA,UAAU,aAAa;IACrB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,MAAM,CAAC,EAAE;QACP,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,OAAO,CAAC,EAAE,MAAM,CAAC;KAClB,CAAC;CACH;AAED,eAAO,MAAM,MAAM,GAAI,UAAS,aAAkB;kBAShC,WAAW;;wBAdb,MAAM;sBACR,MAAM;;yBAeG,MAAM;;mBAkBV,WAAW;;wBAlCd,MAAM;sBACR,MAAM;;yBAmCG,MAAM;;CAmB5B,CAAC"}
1
+ {"version":3,"file":"bounce.d.ts","sourceRoot":"","sources":["../../src/lib/transitions/bounce.ts"],"names":[],"mappings":"AAAA,UAAU,aAAa;IACrB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,SAAS,CAAC,EAAE,IAAI,GAAG,MAAM,CAAC;IAC1B,MAAM,CAAC,EAAE;QACP,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,OAAO,CAAC,EAAE,MAAM,CAAC;KAClB,CAAC;CACH;AAED,eAAO,MAAM,MAAM,GAAI,UAAS,aAAkB;kBAWhC,WAAW;;wBAhBb,MAAM;sBACR,MAAM;;yBAiBG,MAAM;;mBA0BV,WAAW;;wBA5Cd,MAAM;sBACR,MAAM;;yBA6CG,MAAM;;CA2B5B,CAAC"}
@@ -0,0 +1,27 @@
1
+ interface FlyOptions {
2
+ x?: number | string;
3
+ y?: number | string;
4
+ opacity?: number;
5
+ spring?: {
6
+ stiffness?: number;
7
+ damping?: number;
8
+ };
9
+ }
10
+ export declare const fly: (options?: FlyOptions) => {
11
+ in: (element: HTMLElement) => {
12
+ spring: {
13
+ stiffness?: number;
14
+ damping?: number;
15
+ };
16
+ tick: (progress: number) => void;
17
+ };
18
+ out: (element: HTMLElement) => {
19
+ spring: {
20
+ stiffness?: number;
21
+ damping?: number;
22
+ };
23
+ tick: (progress: number) => void;
24
+ };
25
+ };
26
+ export {};
27
+ //# sourceMappingURL=fly.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fly.d.ts","sourceRoot":"","sources":["../../src/lib/transitions/fly.ts"],"names":[],"mappings":"AAAA,UAAU,UAAU;IAClB,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACpB,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACpB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,EAAE;QACP,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,OAAO,CAAC,EAAE,MAAM,CAAC;KAClB,CAAC;CACH;AAED,eAAO,MAAM,GAAG,GAAI,UAAS,UAAe;kBAiB1B,WAAW;;wBAtBb,MAAM;sBACR,MAAM;;yBAuBG,MAAM;;mBAQV,WAAW;;wBAhCd,MAAM;sBACR,MAAM;;yBAiCG,MAAM;;CAS5B,CAAC"}
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=(r={})=>{const{from:i=0,to:c=1,spring:a={stiffness:300,damping:30}}=r;return{in:o=>({spring:a,tick:s=>{const t=i+(c-i)*s;o.style.opacity=t.toString()}}),out:o=>({spring:a,tick:s=>{const t=i+(c-i)*s;o.style.opacity=t.toString()}})}},u=(r={})=>{const{from:i=0,to:c=1,spring:a={stiffness:300,damping:30}}=r;return{in:o=>({spring:a,tick:s=>{const t=i+(c-i)*s;o.style.transform=`scale(${t})`}}),out:o=>({spring:a,tick:s=>{const t=i+(c-i)*s;o.style.transform=`scale(${t})`}})}},y=(r={})=>{const{direction:i="left",distance:c=100,fade:a=!0,spring:o={stiffness:400,damping:35}}=r,s=t=>{const n=(1-t)*c;switch(i){case"left":return`translateX(${-n}px)`;case"right":return`translateX(${n}px)`;case"up":return`translateY(${-n}px)`;case"down":return`translateY(${n}px)`}};return{in:t=>({spring:o,tick:n=>{t.style.transform=s(n),a&&(t.style.opacity=n.toString())}}),out:t=>({spring:o,tick:n=>{t.style.transform=s(n),a&&(t.style.opacity=n.toString())}})}},p=(r={})=>{const{degrees:i=360,clockwise:c=!0,scale:a=!1,fade:o=!1,spring:s={stiffness:500,damping:25}}=r,t=c?i:-i;return{in:n=>({spring:s,tick:e=>{const f=[`rotate(${e*t}deg)`];a&&f.push(`scale(${e})`),n.style.transform=f.join(" "),o&&(n.style.opacity=e.toString())}}),out:n=>({spring:s,tick:e=>{const f=[`rotate(${e*t}deg)`];a&&f.push(`scale(${e})`),n.style.transform=f.join(" "),o&&(n.style.opacity=e.toString())}})}},d=(r={})=>{const{height:i=20,scale:c=!0,fade:a=!1,spring:o={stiffness:800,damping:15}}=r;return{in:s=>({spring:o,tick:t=>{const n=[],e=Math.sin(t*Math.PI)*i*(1-t);n.push(`translateY(${-e}px)`),c&&n.push(`scale(${.8+t*.2})`),s.style.transform=n.join(" "),a&&(s.style.opacity=t.toString())}}),out:s=>({spring:o,tick:t=>{const n=[],e=Math.sin(t*Math.PI)*i*(1-t);n.push(`translateY(${-e}px)`),c&&n.push(`scale(${.8+t*.2})`),s.style.transform=n.join(" "),a&&(s.style.opacity=t.toString())}})}},g=(r={})=>{const{amount:i=10,scale:c=!1,fade:a=!0,spring:o={stiffness:300,damping:30}}=r;return{in:s=>({spring:o,tick:t=>{const e=[`blur(${(1-t)*i}px)`];s.style.filter=e.join(" "),c&&(s.style.transform=`scale(${.8+t*.2})`),a&&(s.style.opacity=t.toString())}}),out:s=>({spring:o,tick:t=>{const e=[`blur(${(1-t)*i}px)`];s.style.filter=e.join(" "),c&&(s.style.transform=`scale(${.8+t*.2})`),a&&(s.style.opacity=t.toString())}})}},m=(r={})=>{const{spring:i={stiffness:1e3,damping:100}}=r;return{in:c=>({spring:i,tick:a=>{}}),out:c=>({spring:i,tick:a=>{}})}};exports.blur=g;exports.bounce=d;exports.fade=l;exports.none=m;exports.rotate=p;exports.scale=u;exports.slide=y;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const $=(p={})=>{const{from:n=0,to:s=1,spring:r={stiffness:300,damping:30}}=p;return{in:u=>({spring:r,tick:l=>{const c=n+(s-n)*l;u.style.opacity=c.toString()}}),out:u=>({spring:r,tick:l=>{const c=n+(s-n)*l;u.style.opacity=c.toString()}})}},b=(p={})=>{const{start:n=0,opacity:s=0,axis:r="both",spring:u={stiffness:300,damping:30}}=p,l=c=>{switch(r){case"x":return`scaleX(${c})`;case"y":return`scaleY(${c})`;case"both":default:return`scale(${c})`}};return{in:c=>({spring:u,tick:t=>{const e=n+(1-n)*t;c.style.transform=l(e),c.style.opacity=(s+(1-s)*t).toString()}}),out:c=>({spring:u,tick:t=>{const e=n+(1-n)*t;c.style.transform=l(e),c.style.opacity=(s+(1-s)*t).toString()}})}},m=(p={})=>{const{direction:n,distance:s=100,opacity:r=0,fade:u=!0,axis:l,spring:c={stiffness:400,damping:35}}=p,e=n||(l==="x"?"left":l==="y"?"up":"left"),o=a=>typeof a=="number"?`${a}px`:a,f=a=>{const i=1-a,y=typeof s=="number"?i*s:`calc(${o(s)} * ${i})`;switch(e){case"left":return typeof s=="number"?`translateX(${-y}px)`:`translateX(calc(-1 * ${y}))`;case"right":return typeof s=="number"?`translateX(${y}px)`:`translateX(${y})`;case"up":return typeof s=="number"?`translateY(${-y}px)`:`translateY(calc(-1 * ${y}))`;case"down":return typeof s=="number"?`translateY(${y}px)`:`translateY(${y})`}};return{in:a=>({spring:c,tick:i=>{a.style.transform=f(i),u&&(a.style.opacity=(r+(1-r)*i).toString())}}),out:a=>({spring:c,tick:i=>{a.style.transform=f(i),u&&(a.style.opacity=(r+(1-r)*i).toString())}})}},d=(p={})=>{const{degrees:n=360,clockwise:s=!0,scale:r=!1,fade:u=!0,origin:l="center",axis:c="2d",perspective:t=800,spring:e={stiffness:500,damping:25}}=p,o=s?n:-n,f=a=>{const i=(1-a)*o;switch(c){case"x":return`perspective(${t}px) rotateX(${i}deg)`;case"y":return`perspective(${t}px) rotateY(${i}deg)`;case"z":return`rotateZ(${i}deg)`;case"2d":default:return`rotate(${i}deg)`}};return{in:a=>({spring:e,tick:i=>{const y=[f(i)];r&&y.push(`scale(${i})`),a.style.transform=y.join(" "),a.style.transformOrigin=l,u&&(a.style.opacity=i.toString())}}),out:a=>({spring:e,tick:i=>{const y=[f(i)];r&&y.push(`scale(${i})`),a.style.transform=y.join(" "),a.style.transformOrigin=l,u&&(a.style.opacity=i.toString())}})}},g=(p={})=>{const{height:n=20,intensity:s=1,scale:r=!0,fade:u=!0,direction:l="up",spring:c={stiffness:800,damping:15}}=p;return{in:t=>({spring:c,tick:e=>{const o=[],f=Math.sin(e*Math.PI*(1+s)),a=1-e,i=f*n*a;if(l==="up"?o.push(`translateY(${-Math.abs(i)}px)`):o.push(`translateY(${Math.abs(i)}px)`),r){const y=.8+e*.2+f*.05*a;o.push(`scale(${y})`)}t.style.transform=o.join(" "),u&&(t.style.opacity=e.toString())}}),out:t=>({spring:c,tick:e=>{const o=[],f=Math.sin(e*Math.PI*(1+s)),a=1-e,i=f*n*a;if(l==="up"?o.push(`translateY(${-Math.abs(i)}px)`):o.push(`translateY(${Math.abs(i)}px)`),r){const y=.8+e*.2+f*.05*a;o.push(`scale(${y})`)}t.style.transform=o.join(" "),u&&(t.style.opacity=e.toString())}})}},x=(p={})=>{const{amount:n=10,opacity:s=0,scale:r=!1,fade:u=!0,spring:l={stiffness:300,damping:30}}=p,c=t=>typeof t=="number"?`${t}px`:t;return{in:t=>({spring:l,tick:e=>{const o=1-e,f=typeof n=="number"?o*n:`calc(${c(n)} * ${o})`;t.style.filter=typeof n=="number"?`blur(${f}px)`:`blur(${f})`,r&&(t.style.transform=`scale(${.8+e*.2})`),u&&(t.style.opacity=(s+(1-s)*e).toString())}}),out:t=>({spring:l,tick:e=>{const o=1-e,f=typeof n=="number"?o*n:`calc(${c(n)} * ${o})`;t.style.filter=typeof n=="number"?`blur(${f}px)`:`blur(${f})`,r&&(t.style.transform=`scale(${.8+e*.2})`),u&&(t.style.opacity=(s+(1-s)*e).toString())}})}},h=(p={})=>{const{x:n=0,y:s=-100,opacity:r=0,spring:u={stiffness:400,damping:35}}=p,l=t=>typeof t=="number"?`${t}px`:t,c=t=>typeof t=="number"?`${t}px`:t;return{in:t=>({spring:u,tick:e=>{const o=typeof n=="number"?(1-e)*n:`calc(${l(n)} * ${1-e})`,f=typeof s=="number"?(1-e)*s:`calc(${c(s)} * ${1-e})`;t.style.transform=`translate(${typeof n=="number"?o+"px":o}, ${typeof s=="number"?f+"px":f})`,t.style.opacity=(r+(1-r)*e).toString()}}),out:t=>({spring:u,tick:e=>{const o=typeof n=="number"?(1-e)*n:`calc(${l(n)} * ${1-e})`,f=typeof s=="number"?(1-e)*s:`calc(${c(s)} * ${1-e})`;t.style.transform=`translate(${typeof n=="number"?o+"px":o}, ${typeof s=="number"?f+"px":f})`,t.style.opacity=(r+(1-r)*e).toString()}})}},k=(p={})=>{const{spring:n={stiffness:1e3,damping:100}}=p;return{in:s=>({spring:n,tick:r=>{}}),out:s=>({spring:n,tick:r=>{}})}};exports.blur=x;exports.bounce=g;exports.fade=$;exports.fly=h;exports.none=k;exports.rotate=d;exports.scale=b;exports.slide=m;
@@ -4,5 +4,6 @@ export * from './slide';
4
4
  export * from './rotate';
5
5
  export * from './bounce';
6
6
  export * from './blur';
7
+ export * from './fly';
7
8
  export * from './none';
8
9
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/lib/transitions/index.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAC;AACvB,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC;AACvB,cAAc,QAAQ,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/lib/transitions/index.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAC;AACvB,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC;AACvB,cAAc,OAAO,CAAC;AACtB,cAAc,QAAQ,CAAC"}
@@ -1,173 +1,237 @@
1
- const l = (r = {}) => {
1
+ const $ = (p = {}) => {
2
2
  const {
3
- from: i = 0,
4
- to: c = 1,
5
- spring: a = { stiffness: 300, damping: 30 }
6
- } = r;
3
+ from: n = 0,
4
+ to: e = 1,
5
+ spring: r = { stiffness: 300, damping: 30 }
6
+ } = p;
7
7
  return {
8
- in: (o) => ({
9
- spring: a,
10
- tick: (s) => {
11
- const t = i + (c - i) * s;
12
- o.style.opacity = t.toString();
8
+ in: (u) => ({
9
+ spring: r,
10
+ tick: (l) => {
11
+ const c = n + (e - n) * l;
12
+ u.style.opacity = c.toString();
13
13
  }
14
14
  }),
15
- out: (o) => ({
16
- spring: a,
17
- tick: (s) => {
18
- const t = i + (c - i) * s;
19
- o.style.opacity = t.toString();
15
+ out: (u) => ({
16
+ spring: r,
17
+ tick: (l) => {
18
+ const c = n + (e - n) * l;
19
+ u.style.opacity = c.toString();
20
20
  }
21
21
  })
22
22
  };
23
- }, u = (r = {}) => {
23
+ }, m = (p = {}) => {
24
24
  const {
25
- from: i = 0,
26
- to: c = 1,
27
- spring: a = { stiffness: 300, damping: 30 }
28
- } = r;
25
+ start: n = 0,
26
+ opacity: e = 0,
27
+ axis: r = "both",
28
+ spring: u = { stiffness: 300, damping: 30 }
29
+ } = p, l = (c) => {
30
+ switch (r) {
31
+ case "x":
32
+ return `scaleX(${c})`;
33
+ case "y":
34
+ return `scaleY(${c})`;
35
+ case "both":
36
+ default:
37
+ return `scale(${c})`;
38
+ }
39
+ };
29
40
  return {
30
- in: (o) => ({
31
- spring: a,
32
- tick: (s) => {
33
- const t = i + (c - i) * s;
34
- o.style.transform = `scale(${t})`;
41
+ in: (c) => ({
42
+ spring: u,
43
+ tick: (t) => {
44
+ const s = n + (1 - n) * t;
45
+ c.style.transform = l(s), c.style.opacity = (e + (1 - e) * t).toString();
35
46
  }
36
47
  }),
37
- out: (o) => ({
38
- spring: a,
39
- tick: (s) => {
40
- const t = i + (c - i) * s;
41
- o.style.transform = `scale(${t})`;
48
+ out: (c) => ({
49
+ spring: u,
50
+ tick: (t) => {
51
+ const s = n + (1 - n) * t;
52
+ c.style.transform = l(s), c.style.opacity = (e + (1 - e) * t).toString();
42
53
  }
43
54
  })
44
55
  };
45
- }, y = (r = {}) => {
56
+ }, b = (p = {}) => {
46
57
  const {
47
- direction: i = "left",
48
- distance: c = 100,
49
- fade: a = !0,
50
- spring: o = { stiffness: 400, damping: 35 }
51
- } = r, s = (t) => {
52
- const n = (1 - t) * c;
53
- switch (i) {
58
+ direction: n,
59
+ distance: e = 100,
60
+ opacity: r = 0,
61
+ fade: u = !0,
62
+ axis: l,
63
+ spring: c = { stiffness: 400, damping: 35 }
64
+ } = p, s = n || (l === "x" ? "left" : l === "y" ? "up" : "left"), o = (a) => typeof a == "number" ? `${a}px` : a, f = (a) => {
65
+ const i = 1 - a, y = typeof e == "number" ? i * e : `calc(${o(e)} * ${i})`;
66
+ switch (s) {
54
67
  case "left":
55
- return `translateX(${-n}px)`;
68
+ return typeof e == "number" ? `translateX(${-y}px)` : `translateX(calc(-1 * ${y}))`;
56
69
  case "right":
57
- return `translateX(${n}px)`;
70
+ return typeof e == "number" ? `translateX(${y}px)` : `translateX(${y})`;
58
71
  case "up":
59
- return `translateY(${-n}px)`;
72
+ return typeof e == "number" ? `translateY(${-y}px)` : `translateY(calc(-1 * ${y}))`;
60
73
  case "down":
61
- return `translateY(${n}px)`;
74
+ return typeof e == "number" ? `translateY(${y}px)` : `translateY(${y})`;
62
75
  }
63
76
  };
64
77
  return {
65
- in: (t) => ({
66
- spring: o,
67
- tick: (n) => {
68
- t.style.transform = s(n), a && (t.style.opacity = n.toString());
78
+ in: (a) => ({
79
+ spring: c,
80
+ tick: (i) => {
81
+ a.style.transform = f(i), u && (a.style.opacity = (r + (1 - r) * i).toString());
69
82
  }
70
83
  }),
71
- out: (t) => ({
72
- spring: o,
73
- tick: (n) => {
74
- t.style.transform = s(n), a && (t.style.opacity = n.toString());
84
+ out: (a) => ({
85
+ spring: c,
86
+ tick: (i) => {
87
+ a.style.transform = f(i), u && (a.style.opacity = (r + (1 - r) * i).toString());
75
88
  }
76
89
  })
77
90
  };
78
- }, p = (r = {}) => {
91
+ }, x = (p = {}) => {
79
92
  const {
80
- degrees: i = 360,
81
- clockwise: c = !0,
82
- scale: a = !1,
83
- fade: o = !1,
93
+ degrees: n = 360,
94
+ clockwise: e = !0,
95
+ scale: r = !1,
96
+ fade: u = !0,
97
+ origin: l = "center",
98
+ axis: c = "2d",
99
+ perspective: t = 800,
84
100
  spring: s = { stiffness: 500, damping: 25 }
85
- } = r, t = c ? i : -i;
101
+ } = p, o = e ? n : -n, f = (a) => {
102
+ const i = (1 - a) * o;
103
+ switch (c) {
104
+ case "x":
105
+ return `perspective(${t}px) rotateX(${i}deg)`;
106
+ case "y":
107
+ return `perspective(${t}px) rotateY(${i}deg)`;
108
+ case "z":
109
+ return `rotateZ(${i}deg)`;
110
+ case "2d":
111
+ default:
112
+ return `rotate(${i}deg)`;
113
+ }
114
+ };
86
115
  return {
87
- in: (n) => ({
116
+ in: (a) => ({
88
117
  spring: s,
89
- tick: (e) => {
90
- const f = [`rotate(${e * t}deg)`];
91
- a && f.push(`scale(${e})`), n.style.transform = f.join(" "), o && (n.style.opacity = e.toString());
118
+ tick: (i) => {
119
+ const y = [f(i)];
120
+ r && y.push(`scale(${i})`), a.style.transform = y.join(" "), a.style.transformOrigin = l, u && (a.style.opacity = i.toString());
92
121
  }
93
122
  }),
94
- out: (n) => ({
123
+ out: (a) => ({
95
124
  spring: s,
96
- tick: (e) => {
97
- const f = [`rotate(${e * t}deg)`];
98
- a && f.push(`scale(${e})`), n.style.transform = f.join(" "), o && (n.style.opacity = e.toString());
125
+ tick: (i) => {
126
+ const y = [f(i)];
127
+ r && y.push(`scale(${i})`), a.style.transform = y.join(" "), a.style.transformOrigin = l, u && (a.style.opacity = i.toString());
99
128
  }
100
129
  })
101
130
  };
102
- }, d = (r = {}) => {
131
+ }, d = (p = {}) => {
103
132
  const {
104
- height: i = 20,
105
- scale: c = !0,
106
- fade: a = !1,
107
- spring: o = { stiffness: 800, damping: 15 }
108
- } = r;
133
+ height: n = 20,
134
+ intensity: e = 1,
135
+ scale: r = !0,
136
+ fade: u = !0,
137
+ direction: l = "up",
138
+ spring: c = { stiffness: 800, damping: 15 }
139
+ } = p;
109
140
  return {
110
- in: (s) => ({
111
- spring: o,
112
- tick: (t) => {
113
- const n = [], e = Math.sin(t * Math.PI) * i * (1 - t);
114
- n.push(`translateY(${-e}px)`), c && n.push(`scale(${0.8 + t * 0.2})`), s.style.transform = n.join(" "), a && (s.style.opacity = t.toString());
141
+ in: (t) => ({
142
+ spring: c,
143
+ tick: (s) => {
144
+ const o = [], f = Math.sin(s * Math.PI * (1 + e)), a = 1 - s, i = f * n * a;
145
+ if (l === "up" ? o.push(`translateY(${-Math.abs(i)}px)`) : o.push(`translateY(${Math.abs(i)}px)`), r) {
146
+ const y = 0.8 + s * 0.2 + f * 0.05 * a;
147
+ o.push(`scale(${y})`);
148
+ }
149
+ t.style.transform = o.join(" "), u && (t.style.opacity = s.toString());
115
150
  }
116
151
  }),
117
- out: (s) => ({
118
- spring: o,
119
- tick: (t) => {
120
- const n = [], e = Math.sin(t * Math.PI) * i * (1 - t);
121
- n.push(`translateY(${-e}px)`), c && n.push(`scale(${0.8 + t * 0.2})`), s.style.transform = n.join(" "), a && (s.style.opacity = t.toString());
152
+ out: (t) => ({
153
+ spring: c,
154
+ tick: (s) => {
155
+ const o = [], f = Math.sin(s * Math.PI * (1 + e)), a = 1 - s, i = f * n * a;
156
+ if (l === "up" ? o.push(`translateY(${-Math.abs(i)}px)`) : o.push(`translateY(${Math.abs(i)}px)`), r) {
157
+ const y = 0.8 + s * 0.2 + f * 0.05 * a;
158
+ o.push(`scale(${y})`);
159
+ }
160
+ t.style.transform = o.join(" "), u && (t.style.opacity = s.toString());
122
161
  }
123
162
  })
124
163
  };
125
- }, $ = (r = {}) => {
164
+ }, g = (p = {}) => {
126
165
  const {
127
- amount: i = 10,
128
- scale: c = !1,
129
- fade: a = !0,
130
- spring: o = { stiffness: 300, damping: 30 }
131
- } = r;
166
+ amount: n = 10,
167
+ opacity: e = 0,
168
+ scale: r = !1,
169
+ fade: u = !0,
170
+ spring: l = { stiffness: 300, damping: 30 }
171
+ } = p, c = (t) => typeof t == "number" ? `${t}px` : t;
132
172
  return {
133
- in: (s) => ({
134
- spring: o,
135
- tick: (t) => {
136
- const e = [`blur(${(1 - t) * i}px)`];
137
- s.style.filter = e.join(" "), c && (s.style.transform = `scale(${0.8 + t * 0.2})`), a && (s.style.opacity = t.toString());
173
+ in: (t) => ({
174
+ spring: l,
175
+ tick: (s) => {
176
+ const o = 1 - s, f = typeof n == "number" ? o * n : `calc(${c(n)} * ${o})`;
177
+ t.style.filter = typeof n == "number" ? `blur(${f}px)` : `blur(${f})`, r && (t.style.transform = `scale(${0.8 + s * 0.2})`), u && (t.style.opacity = (e + (1 - e) * s).toString());
138
178
  }
139
179
  }),
140
- out: (s) => ({
141
- spring: o,
142
- tick: (t) => {
143
- const e = [`blur(${(1 - t) * i}px)`];
144
- s.style.filter = e.join(" "), c && (s.style.transform = `scale(${0.8 + t * 0.2})`), a && (s.style.opacity = t.toString());
180
+ out: (t) => ({
181
+ spring: l,
182
+ tick: (s) => {
183
+ const o = 1 - s, f = typeof n == "number" ? o * n : `calc(${c(n)} * ${o})`;
184
+ t.style.filter = typeof n == "number" ? `blur(${f}px)` : `blur(${f})`, r && (t.style.transform = `scale(${0.8 + s * 0.2})`), u && (t.style.opacity = (e + (1 - e) * s).toString());
145
185
  }
146
186
  })
147
187
  };
148
- }, m = (r = {}) => {
188
+ }, h = (p = {}) => {
149
189
  const {
150
- spring: i = { stiffness: 1e3, damping: 100 }
151
- } = r;
190
+ x: n = 0,
191
+ y: e = -100,
192
+ opacity: r = 0,
193
+ spring: u = { stiffness: 400, damping: 35 }
194
+ } = p, l = (t) => typeof t == "number" ? `${t}px` : t, c = (t) => typeof t == "number" ? `${t}px` : t;
152
195
  return {
153
- in: (c) => ({
154
- spring: i,
155
- tick: (a) => {
196
+ in: (t) => ({
197
+ spring: u,
198
+ tick: (s) => {
199
+ const o = typeof n == "number" ? (1 - s) * n : `calc(${l(n)} * ${1 - s})`, f = typeof e == "number" ? (1 - s) * e : `calc(${c(e)} * ${1 - s})`;
200
+ t.style.transform = `translate(${typeof n == "number" ? o + "px" : o}, ${typeof e == "number" ? f + "px" : f})`, t.style.opacity = (r + (1 - r) * s).toString();
156
201
  }
157
202
  }),
158
- out: (c) => ({
159
- spring: i,
160
- tick: (a) => {
203
+ out: (t) => ({
204
+ spring: u,
205
+ tick: (s) => {
206
+ const o = typeof n == "number" ? (1 - s) * n : `calc(${l(n)} * ${1 - s})`, f = typeof e == "number" ? (1 - s) * e : `calc(${c(e)} * ${1 - s})`;
207
+ t.style.transform = `translate(${typeof n == "number" ? o + "px" : o}, ${typeof e == "number" ? f + "px" : f})`, t.style.opacity = (r + (1 - r) * s).toString();
208
+ }
209
+ })
210
+ };
211
+ }, k = (p = {}) => {
212
+ const {
213
+ spring: n = { stiffness: 1e3, damping: 100 }
214
+ } = p;
215
+ return {
216
+ in: (e) => ({
217
+ spring: n,
218
+ tick: (r) => {
219
+ }
220
+ }),
221
+ out: (e) => ({
222
+ spring: n,
223
+ tick: (r) => {
161
224
  }
162
225
  })
163
226
  };
164
227
  };
165
228
  export {
166
- $ as blur,
229
+ g as blur,
167
230
  d as bounce,
168
- l as fade,
169
- m as none,
170
- p as rotate,
171
- u as scale,
172
- y as slide
231
+ $ as fade,
232
+ h as fly,
233
+ k as none,
234
+ x as rotate,
235
+ m as scale,
236
+ b as slide
173
237
  };
@@ -3,6 +3,9 @@ interface RotateOptions {
3
3
  clockwise?: boolean;
4
4
  scale?: boolean;
5
5
  fade?: boolean;
6
+ origin?: string;
7
+ axis?: '2d' | 'x' | 'y' | 'z';
8
+ perspective?: number;
6
9
  spring?: {
7
10
  stiffness?: number;
8
11
  damping?: number;
@@ -1 +1 @@
1
- {"version":3,"file":"rotate.d.ts","sourceRoot":"","sources":["../../src/lib/transitions/rotate.ts"],"names":[],"mappings":"AAAA,UAAU,aAAa;IACrB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,MAAM,CAAC,EAAE;QACP,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,OAAO,CAAC,EAAE,MAAM,CAAC;KAClB,CAAC;CACH;AAED,eAAO,MAAM,MAAM,GAAI,UAAS,aAAkB;kBAYhC,WAAW;;wBAjBb,MAAM;sBACR,MAAM;;yBAkBG,MAAM;;mBAcV,WAAW;;wBAjCd,MAAM;sBACR,MAAM;;yBAkCG,MAAM;;CAe5B,CAAC"}
1
+ {"version":3,"file":"rotate.d.ts","sourceRoot":"","sources":["../../src/lib/transitions/rotate.ts"],"names":[],"mappings":"AAAA,UAAU,aAAa;IACrB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,IAAI,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,CAAC;IAC9B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,MAAM,CAAC,EAAE;QACP,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,OAAO,CAAC,EAAE,MAAM,CAAC;KAClB,CAAC;CACH;AAED,eAAO,MAAM,MAAM,GAAI,UAAS,aAAkB;kBA8BhC,WAAW;;wBAnCb,MAAM;sBACR,MAAM;;yBAoCG,MAAM;;mBAeV,WAAW;;wBApDd,MAAM;sBACR,MAAM;;yBAqDG,MAAM;;CAgB5B,CAAC"}
@@ -1,7 +1,7 @@
1
1
  interface ScaleOptions {
2
- duration?: number;
3
- from?: number;
4
- to?: number;
2
+ start?: number;
3
+ opacity?: number;
4
+ axis?: 'x' | 'y' | 'both';
5
5
  spring?: {
6
6
  stiffness?: number;
7
7
  damping?: number;
@@ -1 +1 @@
1
- {"version":3,"file":"scale.d.ts","sourceRoot":"","sources":["../../src/lib/transitions/scale.ts"],"names":[],"mappings":"AAAA,UAAU,YAAY;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,MAAM,CAAC,EAAE;QACP,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,OAAO,CAAC,EAAE,MAAM,CAAC;KAClB,CAAC;CACH;AAED,eAAO,MAAM,KAAK,GAAI,UAAS,YAAiB;kBAQ9B,WAAW;;wBAbb,MAAM;sBACR,MAAM;;yBAcG,MAAM;;mBAKV,WAAW;;wBApBd,MAAM;sBACR,MAAM;;yBAqBG,MAAM;;CAM5B,CAAC"}
1
+ {"version":3,"file":"scale.d.ts","sourceRoot":"","sources":["../../src/lib/transitions/scale.ts"],"names":[],"mappings":"AAAA,UAAU,YAAY;IACpB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,IAAI,CAAC,EAAE,GAAG,GAAG,GAAG,GAAG,MAAM,CAAC;IAC1B,MAAM,CAAC,EAAE;QACP,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,OAAO,CAAC,EAAE,MAAM,CAAC;KAClB,CAAC;CACH;AAED,eAAO,MAAM,KAAK,GAAI,UAAS,YAAiB;kBAqB9B,WAAW;;wBA1Bb,MAAM;sBACR,MAAM;;yBA2BG,MAAM;;mBAMV,WAAW;;wBAlCd,MAAM;sBACR,MAAM;;yBAmCG,MAAM;;CAO5B,CAAC"}
@@ -1,7 +1,9 @@
1
1
  interface SlideOptions {
2
2
  direction?: 'left' | 'right' | 'up' | 'down';
3
- distance?: number;
3
+ distance?: number | string;
4
+ opacity?: number;
4
5
  fade?: boolean;
6
+ axis?: 'x' | 'y';
5
7
  spring?: {
6
8
  stiffness?: number;
7
9
  damping?: number;
@@ -1 +1 @@
1
- {"version":3,"file":"slide.d.ts","sourceRoot":"","sources":["../../src/lib/transitions/slide.ts"],"names":[],"mappings":"AAAA,UAAU,YAAY;IACpB,SAAS,CAAC,EAAE,MAAM,GAAG,OAAO,GAAG,IAAI,GAAG,MAAM,CAAC;IAC7C,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,MAAM,CAAC,EAAE;QACP,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,OAAO,CAAC,EAAE,MAAM,CAAC;KAClB,CAAC;CACH;AAED,eAAO,MAAM,KAAK,GAAI,UAAS,YAAiB;kBAuB9B,WAAW;;wBA5Bb,MAAM;sBACR,MAAM;;yBA6BG,MAAM;;mBAOV,WAAW;;wBArCd,MAAM;sBACR,MAAM;;yBAsCG,MAAM;;CAQ5B,CAAC"}
1
+ {"version":3,"file":"slide.d.ts","sourceRoot":"","sources":["../../src/lib/transitions/slide.ts"],"names":[],"mappings":"AAAA,UAAU,YAAY;IACpB,SAAS,CAAC,EAAE,MAAM,GAAG,OAAO,GAAG,IAAI,GAAG,MAAM,CAAC;IAC7C,QAAQ,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAC3B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,IAAI,CAAC,EAAE,GAAG,GAAG,GAAG,CAAC;IACjB,MAAM,CAAC,EAAE;QACP,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,OAAO,CAAC,EAAE,MAAM,CAAC;KAClB,CAAC;CACH;AAED,eAAO,MAAM,KAAK,GAAI,UAAS,YAAiB;kBAmD9B,WAAW;;wBAxDb,MAAM;sBACR,MAAM;;yBAyDG,MAAM;;mBAOV,WAAW;;wBAjEd,MAAM;sBACR,MAAM;;yBAkEG,MAAM;;CAQ5B,CAAC"}