@udixio/ui-react 2.1.0 → 2.3.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.
@@ -4,4 +4,5 @@ export type AnimateOnScrollOptions = {
4
4
  };
5
5
  export declare function initAnimateOnScroll(options?: AnimateOnScrollOptions): () => void;
6
6
  export declare const AnimateOnScrollInit: typeof initAnimateOnScroll;
7
+ export declare const animateOnScroll: typeof initAnimateOnScroll;
7
8
  //# sourceMappingURL=AnimateOnScroll.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"AnimateOnScroll.d.ts","sourceRoot":"","sources":["../../../src/lib/effects/AnimateOnScroll.ts"],"names":[],"mappings":"AAyHA,MAAM,MAAM,sBAAsB,GAAG;IACnC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,OAAO,CAAC;CAChB,CAAC;AAEF,wBAAgB,mBAAmB,CAAC,OAAO,GAAE,sBAA2B,GAAG,MAAM,IAAI,CAyIpF;AAGD,eAAO,MAAM,mBAAmB,4BAAsB,CAAC"}
1
+ {"version":3,"file":"AnimateOnScroll.d.ts","sourceRoot":"","sources":["../../../src/lib/effects/AnimateOnScroll.ts"],"names":[],"mappings":"AAwHA,MAAM,MAAM,sBAAsB,GAAG;IACnC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,OAAO,CAAC;CAChB,CAAC;AAEF,wBAAgB,mBAAmB,CACjC,OAAO,GAAE,sBAA2B,GACnC,MAAM,IAAI,CAyIZ;AAGD,eAAO,MAAM,mBAAmB,4BAAsB,CAAC;AACvD,eAAO,MAAM,eAAe,4BAAsB,CAAC"}
@@ -2,6 +2,7 @@ import { CustomScrollInterface } from './custom-scroll';
2
2
  import { ReactProps } from '../utils';
3
3
  export declare const SmoothScroll: ({ transition, orientation, throttleDuration, }: {
4
4
  transition?: {
5
+ ease: "linear" | "easeIn" | "easeOut" | "easeInOut" | "circIn" | "circOut" | "circInOut" | "backIn" | "backOut" | "backInOut" | "anticipate" | ((t: number) => number);
5
6
  duration?: number;
6
7
  };
7
8
  } & ReactProps<CustomScrollInterface>) => import("react/jsx-runtime").JSX.Element | null;
@@ -1 +1 @@
1
- {"version":3,"file":"smooth-scroll.effect.d.ts","sourceRoot":"","sources":["../../../src/lib/effects/smooth-scroll.effect.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AACxD,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAItC,eAAO,MAAM,YAAY,GAAI,gDAI1B;IACD,UAAU,CAAC,EAAE;QACX,QAAQ,CAAC,EAAE,MAAM,CAAC;KACnB,CAAC;CACH,GAAG,UAAU,CAAC,qBAAqB,CAAC,mDA6GpC,CAAC"}
1
+ {"version":3,"file":"smooth-scroll.effect.d.ts","sourceRoot":"","sources":["../../../src/lib/effects/smooth-scroll.effect.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AACxD,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAItC,eAAO,MAAM,YAAY,GAAI,gDAI1B;IACD,UAAU,CAAC,EAAE;QACX,IAAI,EACA,QAAQ,GACR,QAAQ,GACR,SAAS,GACT,WAAW,GACX,QAAQ,GACR,SAAS,GACT,WAAW,GACX,QAAQ,GACR,SAAS,GACT,WAAW,GACX,YAAY,GACZ,CAAC,CAAC,CAAC,EAAE,MAAM,KAAK,MAAM,CAAC,CAAC;QAC5B,QAAQ,CAAC,EAAE,MAAM,CAAC;KACnB,CAAC;CACH,GAAG,UAAU,CAAC,qBAAqB,CAAC,mDA6GpC,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@udixio/ui-react",
3
- "version": "2.1.0",
3
+ "version": "2.3.0",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.js",
@@ -37,7 +37,7 @@
37
37
  "react": "^19.1.1",
38
38
  "react-dom": "^19.1.1",
39
39
  "@udixio/theme": "2.0.0",
40
- "@udixio/tailwind": "2.1.0"
40
+ "@udixio/tailwind": "2.3.0"
41
41
  },
42
42
  "repository": {
43
43
  "type": "git",
@@ -8,7 +8,6 @@
8
8
  * - Other entry/exit animations: handled via IntersectionObserver in JS.
9
9
  */
10
10
 
11
-
12
11
  function supportsScrollTimeline(): boolean {
13
12
  if (typeof window === `undefined`) return false;
14
13
  try {
@@ -124,7 +123,9 @@ export type AnimateOnScrollOptions = {
124
123
  once?: boolean;
125
124
  };
126
125
 
127
- export function initAnimateOnScroll(options: AnimateOnScrollOptions = {}): () => void {
126
+ export function initAnimateOnScroll(
127
+ options: AnimateOnScrollOptions = {},
128
+ ): () => void {
128
129
  const { prefix = 'anim', once = true } = options;
129
130
 
130
131
  if (prefersReducedMotion()) {
@@ -265,3 +266,4 @@ export function initAnimateOnScroll(options: AnimateOnScrollOptions = {}): () =>
265
266
 
266
267
  // Backward-compatible alias name (non-React):
267
268
  export const AnimateOnScrollInit = initAnimateOnScroll;
269
+ export const animateOnScroll = initAnimateOnScroll;
@@ -10,6 +10,19 @@ export const SmoothScroll = ({
10
10
  throttleDuration = 25,
11
11
  }: {
12
12
  transition?: {
13
+ ease:
14
+ | 'linear'
15
+ | 'easeIn'
16
+ | 'easeOut'
17
+ | 'easeInOut'
18
+ | 'circIn'
19
+ | 'circOut'
20
+ | 'circInOut'
21
+ | 'backIn'
22
+ | 'backOut'
23
+ | 'backInOut'
24
+ | 'anticipate'
25
+ | ((t: number) => number);
13
26
  duration?: number;
14
27
  };
15
28
  } & ReactProps<CustomScrollInterface>) => {
@@ -59,8 +72,8 @@ export const SmoothScroll = ({
59
72
  return;
60
73
  }
61
74
  animationRef.current = animate(currentY.current ?? y, y, {
62
- duration: transition?.duration ?? 0.5,
63
- ease: 'circOut',
75
+ duration: (transition?.duration ?? 500) / 1000,
76
+ ease: transition?.ease ?? 'easeOut',
64
77
 
65
78
  onUpdate: (value) => {
66
79
  if (scrollTimeoutRef.current) {