@xanui/core 1.2.64 → 1.2.65
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/Transition/index.cjs +75 -14
- package/Transition/index.cjs.map +1 -1
- package/Transition/index.d.ts +27 -4
- package/Transition/index.js +76 -15
- package/Transition/index.js.map +1 -1
- package/{hooks/useTransition → Transition}/variants.cjs +60 -20
- package/Transition/variants.cjs.map +1 -0
- package/{hooks/useTransition → Transition}/variants.d.ts +38 -10
- package/{hooks/useTransition → Transition}/variants.js +59 -21
- package/Transition/variants.js.map +1 -0
- package/index.cjs +8 -10
- package/index.cjs.map +1 -1
- package/index.d.ts +1 -2
- package/index.js +0 -1
- package/index.js.map +1 -1
- package/package.json +2 -2
- package/hooks/useTransition/index.cjs +0 -108
- package/hooks/useTransition/index.cjs.map +0 -1
- package/hooks/useTransition/index.d.ts +0 -36
- package/hooks/useTransition/index.js +0 -106
- package/hooks/useTransition/index.js.map +0 -1
- package/hooks/useTransition/variants.cjs.map +0 -1
- package/hooks/useTransition/variants.js.map +0 -1
package/Transition/index.cjs
CHANGED
|
@@ -2,27 +2,88 @@
|
|
|
2
2
|
'use strict';
|
|
3
3
|
|
|
4
4
|
var tslib = require('tslib');
|
|
5
|
-
var jsxRuntime = require('react/jsx-runtime');
|
|
6
5
|
var React = require('react');
|
|
7
|
-
var
|
|
6
|
+
var variants = require('./variants.cjs');
|
|
7
|
+
var index$1 = require('../css/index.cjs');
|
|
8
|
+
var index = require('../Document/index.cjs');
|
|
9
|
+
var CSSCacheProvider = require('../css/CSSCacheProvider.cjs');
|
|
10
|
+
var useAnimation = require('../hooks/useAnimation.cjs');
|
|
11
|
+
var oncss = require('oncss');
|
|
8
12
|
|
|
9
|
-
const
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
const clone = React.Children.only(children);
|
|
15
|
-
return React.cloneElement(clone, props);
|
|
13
|
+
const getVariant = (rect, variant) => {
|
|
14
|
+
let fn = typeof variant === 'string' ? variants[variant] : variant;
|
|
15
|
+
if (!fn)
|
|
16
|
+
throw new Error(`Transition variant "${variant}" not found.`);
|
|
17
|
+
return fn(rect);
|
|
16
18
|
};
|
|
17
19
|
function Transition(_a) {
|
|
18
20
|
var { children } = _a, options = tslib.__rest(_a, ["children"]);
|
|
19
|
-
|
|
21
|
+
let { disableInitialTransition = false, variant = "fade", duration = 400, delay, ease, easing, open, onOpen, onOpened, onClose, onClosed, onState } = options;
|
|
22
|
+
const [rect, setRect] = React.useState();
|
|
23
|
+
const [isDisableInitial, setIsDisableInitial] = React.useState(disableInitialTransition);
|
|
24
|
+
const ref = React.useRef(null);
|
|
25
|
+
const doc = index.useDocument();
|
|
26
|
+
const cacheId = CSSCacheProvider.useCSSCacheId();
|
|
27
|
+
let _ease = ease || useAnimation.animationEases[easing] || useAnimation.animationEases.bounce;
|
|
28
|
+
const style = (obj = {}) => {
|
|
29
|
+
return index$1.css(obj, { container: doc === null || doc === void 0 ? void 0 : doc.document, cacheId }).classname;
|
|
30
|
+
};
|
|
31
|
+
let [cls, setCls] = React.useState(() => {
|
|
32
|
+
let props = {};
|
|
33
|
+
if (!isDisableInitial) {
|
|
34
|
+
props.visibility = 'hidden';
|
|
35
|
+
}
|
|
36
|
+
else if (isDisableInitial && !open) {
|
|
37
|
+
props.visibility = 'hidden';
|
|
38
|
+
}
|
|
39
|
+
return style(props);
|
|
40
|
+
});
|
|
20
41
|
React.useEffect(() => {
|
|
21
|
-
|
|
42
|
+
var _a;
|
|
43
|
+
const rect = (_a = ref.current) === null || _a === void 0 ? void 0 : _a.getBoundingClientRect();
|
|
44
|
+
const v = getVariant(rect, variant);
|
|
45
|
+
setCls(style(open ? v.from : v.to));
|
|
46
|
+
setRect(rect);
|
|
22
47
|
}, []);
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
48
|
+
React.useLayoutEffect(() => {
|
|
49
|
+
if (rect) {
|
|
50
|
+
const v = getVariant(rect, variant);
|
|
51
|
+
let _css = open ? v.to : v.from;
|
|
52
|
+
let trans = ` ${duration}ms ${_ease} ${delay || 0}ms`;
|
|
53
|
+
if (isDisableInitial) {
|
|
54
|
+
trans = '';
|
|
55
|
+
setIsDisableInitial(false);
|
|
56
|
+
}
|
|
57
|
+
let _ = Object.assign(Object.assign({}, _css), { transition: Object.keys(_css || {}).map(k => oncss.formatCSSProp(k)).join(trans + ", ") + trans });
|
|
58
|
+
setCls(style(_));
|
|
59
|
+
const ele = ref.current;
|
|
60
|
+
let stimer = null;
|
|
61
|
+
let etimer = null;
|
|
62
|
+
ele.ontransitionstart = () => {
|
|
63
|
+
clearTimeout(stimer);
|
|
64
|
+
stimer = setTimeout(() => {
|
|
65
|
+
(onOpen && open) && onOpen();
|
|
66
|
+
(onClose && !open) && onClose();
|
|
67
|
+
onState && onState(open ? "open" : "close");
|
|
68
|
+
}, 1);
|
|
69
|
+
};
|
|
70
|
+
ele.ontransitionend = () => {
|
|
71
|
+
clearTimeout(etimer);
|
|
72
|
+
etimer = setTimeout(() => {
|
|
73
|
+
if (onOpened && open)
|
|
74
|
+
onOpened();
|
|
75
|
+
if (onClosed && !open)
|
|
76
|
+
onClosed();
|
|
77
|
+
onState && onState(open ? "opened" : "closed");
|
|
78
|
+
}, 1);
|
|
79
|
+
};
|
|
80
|
+
}
|
|
81
|
+
}, [rect, open, variant]);
|
|
82
|
+
const clone = React.Children.only(children);
|
|
83
|
+
return React.cloneElement(clone, {
|
|
84
|
+
className: cls,
|
|
85
|
+
ref
|
|
86
|
+
});
|
|
26
87
|
}
|
|
27
88
|
|
|
28
89
|
module.exports = Transition;
|
package/Transition/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","sources":["../../src/Transition/index.tsx"],"sourcesContent":["\"use client\";\nimport React, { cloneElement, Children, useEffect,
|
|
1
|
+
{"version":3,"file":"index.cjs","sources":["../../src/Transition/index.tsx"],"sourcesContent":["\"use client\";\nimport React, { cloneElement, Children, useState, useLayoutEffect, useEffect, useRef } from 'react';\nimport * as variants from './variants'\nimport { css } from '../css';\nimport { useDocument } from '../Document';\nimport { useCSSCacheId } from '../css/CSSCacheProvider';\nimport { animationEases } from '../hooks/useAnimation';\nimport { formatCSSProp } from 'oncss';\nimport { CSSProps } from '../css/types';\n\nexport type TransitionVariantTypes = keyof typeof variants\nexport type TransitionVariant = TransitionVariantTypes | ((rect: DOMRect) => ({ from: CSSProps, to: CSSProps }))\nexport type TransitionState = \"open\" | \"opened\" | \"close\" | \"closed\"\n\nexport type TransitionProps = {\n children: React.ReactElement;\n open: boolean;\n variant: TransitionVariant\n ease?: string;\n easing?: keyof typeof animationEases;\n duration?: number;\n delay?: number;\n disableInitialTransition?: boolean;\n onOpen?: () => void;\n onOpened?: () => void;\n onClose?: () => void;\n onClosed?: () => void;\n onState?: (state: TransitionState) => void;\n}\n\nconst getVariant = (rect: DOMRect, variant: TransitionVariant) => {\n let fn = typeof variant === 'string' ? variants[variant] : variant\n if (!fn) throw new Error(`Transition variant \"${variant}\" not found.`)\n return fn(rect as DOMRect);\n}\n\nfunction Transition({ children, ...options }: TransitionProps) {\n let {\n disableInitialTransition = false,\n variant = \"fade\",\n duration = 400,\n delay,\n ease,\n easing,\n open,\n onOpen,\n onOpened,\n onClose,\n onClosed,\n onState\n } = options\n\n const [rect, setRect] = useState<DOMRect>()\n const [isDisableInitial, setIsDisableInitial] = useState(disableInitialTransition)\n const ref = useRef<HTMLElement>(null)\n const doc = useDocument();\n const cacheId = useCSSCacheId()\n let _ease = ease || (animationEases as any)[easing as any] || animationEases.bounce\n\n const style = (obj = {}) => {\n return css(obj, { container: doc?.document, cacheId }).classname;\n }\n\n let [cls, setCls] = useState(() => {\n let props: any = {}\n if (!isDisableInitial) {\n props.visibility = 'hidden'\n } else if (isDisableInitial && !open) {\n props.visibility = 'hidden'\n }\n return style(props)\n })\n\n\n useEffect(() => {\n const rect = ref.current?.getBoundingClientRect() as DOMRect\n const v = getVariant(rect, variant)\n setCls(style(open ? v.from : v.to))\n setRect(rect)\n }, [])\n\n useLayoutEffect(() => {\n if (rect) {\n const v = getVariant(rect, variant)\n let _css: any = open ? v.to : v.from\n let trans = ` ${duration}ms ${_ease} ${delay || 0}ms`\n if (isDisableInitial) {\n trans = ''\n setIsDisableInitial(false)\n }\n let _ = {\n ..._css,\n transition: Object.keys(_css || {}).map(k => formatCSSProp(k)).join(trans + \", \") + trans,\n }\n\n setCls(style(_))\n\n const ele = ref.current as HTMLElement\n let stimer: any = null\n let etimer: any = null\n ele.ontransitionstart = () => {\n clearTimeout(stimer)\n stimer = setTimeout(() => {\n (onOpen && open) && onOpen();\n (onClose && !open) && onClose()\n onState && onState(open ? \"open\" : \"close\")\n }, 1)\n }\n ele.ontransitionend = () => {\n clearTimeout(etimer)\n etimer = setTimeout(() => {\n if (onOpened && open) onOpened();\n if (onClosed && !open) onClosed();\n onState && onState(open ? \"opened\" : \"closed\")\n }, 1)\n }\n }\n }, [rect, open, variant])\n\n const clone: any = Children.only(children);\n return cloneElement(clone, {\n className: cls,\n ref\n });\n}\n\nexport default Transition"],"names":[],"mappings":";;;;;;;;;;;;AA8BA;AACI;AACA;AAAS;AACT;AACJ;AAEA;AAAoB;AAChB;;;AAiBA;AACA;AACA;AACA;AAEA;;AAEA;;;;AAKQ;;AACG;AACH;;AAEJ;AACJ;;;;;AAMI;;;;;;AAOI;;;;;;AAMA;AAKA;AAEA;;;AAGA;;AAEI;AACI;;AAEA;;AAER;AACA;;AAEI;;AAC0B;;AACC;AACvB;;AAER;;;;;AAMJ;;AAEH;AACL;;"}
|
package/Transition/index.d.ts
CHANGED
|
@@ -1,10 +1,33 @@
|
|
|
1
1
|
import React__default from 'react';
|
|
2
|
-
import
|
|
2
|
+
import * as variants from './variants.js';
|
|
3
|
+
import { animationEases } from '../hooks/useAnimation.js';
|
|
4
|
+
import { CSSProps } from '../css/types.js';
|
|
3
5
|
|
|
4
|
-
type
|
|
6
|
+
type TransitionVariantTypes = keyof typeof variants;
|
|
7
|
+
type TransitionVariant = TransitionVariantTypes | ((rect: DOMRect) => ({
|
|
8
|
+
from: CSSProps;
|
|
9
|
+
to: CSSProps;
|
|
10
|
+
}));
|
|
11
|
+
type TransitionState = "open" | "opened" | "close" | "closed";
|
|
12
|
+
type TransitionProps = {
|
|
5
13
|
children: React__default.ReactElement;
|
|
14
|
+
open: boolean;
|
|
15
|
+
variant: TransitionVariant;
|
|
16
|
+
ease?: string;
|
|
17
|
+
easing?: keyof typeof animationEases;
|
|
18
|
+
duration?: number;
|
|
19
|
+
delay?: number;
|
|
20
|
+
disableInitialTransition?: boolean;
|
|
21
|
+
onOpen?: () => void;
|
|
22
|
+
onOpened?: () => void;
|
|
23
|
+
onClose?: () => void;
|
|
24
|
+
onClosed?: () => void;
|
|
25
|
+
onState?: (state: TransitionState) => void;
|
|
6
26
|
};
|
|
7
|
-
declare function Transition({ children, ...options }: TransitionProps): React__default.
|
|
27
|
+
declare function Transition({ children, ...options }: TransitionProps): React__default.DetailedReactHTMLElement<{
|
|
28
|
+
className: string;
|
|
29
|
+
ref: React__default.RefObject<HTMLElement | null>;
|
|
30
|
+
}, HTMLElement>;
|
|
8
31
|
|
|
9
32
|
export { Transition as default };
|
|
10
|
-
export type { TransitionProps };
|
|
33
|
+
export type { TransitionProps, TransitionState, TransitionVariant, TransitionVariantTypes };
|
package/Transition/index.js
CHANGED
|
@@ -1,26 +1,87 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { __rest } from 'tslib';
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
5
|
-
import
|
|
3
|
+
import { useState, useRef, useEffect, useLayoutEffect, Children, cloneElement } from 'react';
|
|
4
|
+
import * as variants from './variants.js';
|
|
5
|
+
import { css } from '../css/index.js';
|
|
6
|
+
import { useDocument } from '../Document/index.js';
|
|
7
|
+
import { useCSSCacheId } from '../css/CSSCacheProvider.js';
|
|
8
|
+
import { animationEases } from '../hooks/useAnimation.js';
|
|
9
|
+
import { formatCSSProp } from 'oncss';
|
|
6
10
|
|
|
7
|
-
const
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
const clone = Children.only(children);
|
|
13
|
-
return cloneElement(clone, props);
|
|
11
|
+
const getVariant = (rect, variant) => {
|
|
12
|
+
let fn = typeof variant === 'string' ? variants[variant] : variant;
|
|
13
|
+
if (!fn)
|
|
14
|
+
throw new Error(`Transition variant "${variant}" not found.`);
|
|
15
|
+
return fn(rect);
|
|
14
16
|
};
|
|
15
17
|
function Transition(_a) {
|
|
16
18
|
var { children } = _a, options = __rest(_a, ["children"]);
|
|
17
|
-
|
|
19
|
+
let { disableInitialTransition = false, variant = "fade", duration = 400, delay, ease, easing, open, onOpen, onOpened, onClose, onClosed, onState } = options;
|
|
20
|
+
const [rect, setRect] = useState();
|
|
21
|
+
const [isDisableInitial, setIsDisableInitial] = useState(disableInitialTransition);
|
|
22
|
+
const ref = useRef(null);
|
|
23
|
+
const doc = useDocument();
|
|
24
|
+
const cacheId = useCSSCacheId();
|
|
25
|
+
let _ease = ease || animationEases[easing] || animationEases.bounce;
|
|
26
|
+
const style = (obj = {}) => {
|
|
27
|
+
return css(obj, { container: doc === null || doc === void 0 ? void 0 : doc.document, cacheId }).classname;
|
|
28
|
+
};
|
|
29
|
+
let [cls, setCls] = useState(() => {
|
|
30
|
+
let props = {};
|
|
31
|
+
if (!isDisableInitial) {
|
|
32
|
+
props.visibility = 'hidden';
|
|
33
|
+
}
|
|
34
|
+
else if (isDisableInitial && !open) {
|
|
35
|
+
props.visibility = 'hidden';
|
|
36
|
+
}
|
|
37
|
+
return style(props);
|
|
38
|
+
});
|
|
18
39
|
useEffect(() => {
|
|
19
|
-
|
|
40
|
+
var _a;
|
|
41
|
+
const rect = (_a = ref.current) === null || _a === void 0 ? void 0 : _a.getBoundingClientRect();
|
|
42
|
+
const v = getVariant(rect, variant);
|
|
43
|
+
setCls(style(open ? v.from : v.to));
|
|
44
|
+
setRect(rect);
|
|
20
45
|
}, []);
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
46
|
+
useLayoutEffect(() => {
|
|
47
|
+
if (rect) {
|
|
48
|
+
const v = getVariant(rect, variant);
|
|
49
|
+
let _css = open ? v.to : v.from;
|
|
50
|
+
let trans = ` ${duration}ms ${_ease} ${delay || 0}ms`;
|
|
51
|
+
if (isDisableInitial) {
|
|
52
|
+
trans = '';
|
|
53
|
+
setIsDisableInitial(false);
|
|
54
|
+
}
|
|
55
|
+
let _ = Object.assign(Object.assign({}, _css), { transition: Object.keys(_css || {}).map(k => formatCSSProp(k)).join(trans + ", ") + trans });
|
|
56
|
+
setCls(style(_));
|
|
57
|
+
const ele = ref.current;
|
|
58
|
+
let stimer = null;
|
|
59
|
+
let etimer = null;
|
|
60
|
+
ele.ontransitionstart = () => {
|
|
61
|
+
clearTimeout(stimer);
|
|
62
|
+
stimer = setTimeout(() => {
|
|
63
|
+
(onOpen && open) && onOpen();
|
|
64
|
+
(onClose && !open) && onClose();
|
|
65
|
+
onState && onState(open ? "open" : "close");
|
|
66
|
+
}, 1);
|
|
67
|
+
};
|
|
68
|
+
ele.ontransitionend = () => {
|
|
69
|
+
clearTimeout(etimer);
|
|
70
|
+
etimer = setTimeout(() => {
|
|
71
|
+
if (onOpened && open)
|
|
72
|
+
onOpened();
|
|
73
|
+
if (onClosed && !open)
|
|
74
|
+
onClosed();
|
|
75
|
+
onState && onState(open ? "opened" : "closed");
|
|
76
|
+
}, 1);
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
}, [rect, open, variant]);
|
|
80
|
+
const clone = Children.only(children);
|
|
81
|
+
return cloneElement(clone, {
|
|
82
|
+
className: cls,
|
|
83
|
+
ref
|
|
84
|
+
});
|
|
24
85
|
}
|
|
25
86
|
|
|
26
87
|
export { Transition as default };
|
package/Transition/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../src/Transition/index.tsx"],"sourcesContent":["\"use client\";\nimport React, { cloneElement, Children, useEffect,
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../src/Transition/index.tsx"],"sourcesContent":["\"use client\";\nimport React, { cloneElement, Children, useState, useLayoutEffect, useEffect, useRef } from 'react';\nimport * as variants from './variants'\nimport { css } from '../css';\nimport { useDocument } from '../Document';\nimport { useCSSCacheId } from '../css/CSSCacheProvider';\nimport { animationEases } from '../hooks/useAnimation';\nimport { formatCSSProp } from 'oncss';\nimport { CSSProps } from '../css/types';\n\nexport type TransitionVariantTypes = keyof typeof variants\nexport type TransitionVariant = TransitionVariantTypes | ((rect: DOMRect) => ({ from: CSSProps, to: CSSProps }))\nexport type TransitionState = \"open\" | \"opened\" | \"close\" | \"closed\"\n\nexport type TransitionProps = {\n children: React.ReactElement;\n open: boolean;\n variant: TransitionVariant\n ease?: string;\n easing?: keyof typeof animationEases;\n duration?: number;\n delay?: number;\n disableInitialTransition?: boolean;\n onOpen?: () => void;\n onOpened?: () => void;\n onClose?: () => void;\n onClosed?: () => void;\n onState?: (state: TransitionState) => void;\n}\n\nconst getVariant = (rect: DOMRect, variant: TransitionVariant) => {\n let fn = typeof variant === 'string' ? variants[variant] : variant\n if (!fn) throw new Error(`Transition variant \"${variant}\" not found.`)\n return fn(rect as DOMRect);\n}\n\nfunction Transition({ children, ...options }: TransitionProps) {\n let {\n disableInitialTransition = false,\n variant = \"fade\",\n duration = 400,\n delay,\n ease,\n easing,\n open,\n onOpen,\n onOpened,\n onClose,\n onClosed,\n onState\n } = options\n\n const [rect, setRect] = useState<DOMRect>()\n const [isDisableInitial, setIsDisableInitial] = useState(disableInitialTransition)\n const ref = useRef<HTMLElement>(null)\n const doc = useDocument();\n const cacheId = useCSSCacheId()\n let _ease = ease || (animationEases as any)[easing as any] || animationEases.bounce\n\n const style = (obj = {}) => {\n return css(obj, { container: doc?.document, cacheId }).classname;\n }\n\n let [cls, setCls] = useState(() => {\n let props: any = {}\n if (!isDisableInitial) {\n props.visibility = 'hidden'\n } else if (isDisableInitial && !open) {\n props.visibility = 'hidden'\n }\n return style(props)\n })\n\n\n useEffect(() => {\n const rect = ref.current?.getBoundingClientRect() as DOMRect\n const v = getVariant(rect, variant)\n setCls(style(open ? v.from : v.to))\n setRect(rect)\n }, [])\n\n useLayoutEffect(() => {\n if (rect) {\n const v = getVariant(rect, variant)\n let _css: any = open ? v.to : v.from\n let trans = ` ${duration}ms ${_ease} ${delay || 0}ms`\n if (isDisableInitial) {\n trans = ''\n setIsDisableInitial(false)\n }\n let _ = {\n ..._css,\n transition: Object.keys(_css || {}).map(k => formatCSSProp(k)).join(trans + \", \") + trans,\n }\n\n setCls(style(_))\n\n const ele = ref.current as HTMLElement\n let stimer: any = null\n let etimer: any = null\n ele.ontransitionstart = () => {\n clearTimeout(stimer)\n stimer = setTimeout(() => {\n (onOpen && open) && onOpen();\n (onClose && !open) && onClose()\n onState && onState(open ? \"open\" : \"close\")\n }, 1)\n }\n ele.ontransitionend = () => {\n clearTimeout(etimer)\n etimer = setTimeout(() => {\n if (onOpened && open) onOpened();\n if (onClosed && !open) onClosed();\n onState && onState(open ? \"opened\" : \"closed\")\n }, 1)\n }\n }\n }, [rect, open, variant])\n\n const clone: any = Children.only(children);\n return cloneElement(clone, {\n className: cls,\n ref\n });\n}\n\nexport default Transition"],"names":[],"mappings":";;;;;;;;;;AA8BA;AACI;AACA;AAAS;AACT;AACJ;AAEA;AAAoB;AAChB;;;AAiBA;AACA;AACA;AACA;AAEA;;AAEA;;;;AAKQ;;AACG;AACH;;AAEJ;AACJ;;;;;AAMI;;;;;;AAOI;;;;;;AAMA;AAKA;AAEA;;;AAGA;;AAEI;AACI;;AAEA;;AAER;AACA;;AAEI;;AAC0B;;AACC;AACvB;;AAER;;;;;AAMJ;;AAEH;AACL;;"}
|
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
+
const getY = (rect) => rect ? Math.min(rect.height / 2, 40) : 20;
|
|
4
|
+
const getX = (rect) => rect ? Math.min(rect.width / 2, 40) : 20;
|
|
3
5
|
const slideDown = (rect) => {
|
|
6
|
+
const y = getY(rect);
|
|
4
7
|
return {
|
|
5
8
|
from: {
|
|
6
|
-
transform: `translateY(-${
|
|
9
|
+
transform: `translateY(-${y}px)`,
|
|
7
10
|
},
|
|
8
11
|
to: {
|
|
9
12
|
transform: `translateY(0)`,
|
|
@@ -11,9 +14,10 @@ const slideDown = (rect) => {
|
|
|
11
14
|
};
|
|
12
15
|
};
|
|
13
16
|
const slideUp = (rect) => {
|
|
17
|
+
const y = getY(rect);
|
|
14
18
|
return {
|
|
15
19
|
from: {
|
|
16
|
-
transform: `translateY(${
|
|
20
|
+
transform: `translateY(${y}px)`,
|
|
17
21
|
},
|
|
18
22
|
to: {
|
|
19
23
|
transform: `translateY(0)`,
|
|
@@ -21,9 +25,10 @@ const slideUp = (rect) => {
|
|
|
21
25
|
};
|
|
22
26
|
};
|
|
23
27
|
const slideRight = (rect) => {
|
|
28
|
+
const x = getX(rect);
|
|
24
29
|
return {
|
|
25
30
|
from: {
|
|
26
|
-
transform: `translateX(-${
|
|
31
|
+
transform: `translateX(-${x}px)`,
|
|
27
32
|
},
|
|
28
33
|
to: {
|
|
29
34
|
transform: `translateX(0)`,
|
|
@@ -31,15 +36,40 @@ const slideRight = (rect) => {
|
|
|
31
36
|
};
|
|
32
37
|
};
|
|
33
38
|
const slideLeft = (rect) => {
|
|
39
|
+
const x = getX(rect);
|
|
34
40
|
return {
|
|
35
41
|
from: {
|
|
36
|
-
transform: `translateX(${
|
|
42
|
+
transform: `translateX(${x}px)`,
|
|
37
43
|
},
|
|
38
44
|
to: {
|
|
39
45
|
transform: `translateX(0)`,
|
|
40
46
|
}
|
|
41
47
|
};
|
|
42
48
|
};
|
|
49
|
+
const scaleYDown = () => ({
|
|
50
|
+
from: {
|
|
51
|
+
transform: "scaleY(0.8)",
|
|
52
|
+
opacity: 0,
|
|
53
|
+
transformOrigin: "top"
|
|
54
|
+
},
|
|
55
|
+
to: {
|
|
56
|
+
transform: "scaleY(1)",
|
|
57
|
+
opacity: 1,
|
|
58
|
+
transformOrigin: "top"
|
|
59
|
+
}
|
|
60
|
+
});
|
|
61
|
+
const scaleYUp = () => ({
|
|
62
|
+
from: {
|
|
63
|
+
transform: "scaleY(0.8)",
|
|
64
|
+
transformOrigin: "bottom",
|
|
65
|
+
opacity: 0
|
|
66
|
+
},
|
|
67
|
+
to: {
|
|
68
|
+
transform: "scaleY(1)",
|
|
69
|
+
transformOrigin: "bottom",
|
|
70
|
+
opacity: 1
|
|
71
|
+
}
|
|
72
|
+
});
|
|
43
73
|
const fade = () => {
|
|
44
74
|
return {
|
|
45
75
|
from: {
|
|
@@ -50,50 +80,54 @@ const fade = () => {
|
|
|
50
80
|
}
|
|
51
81
|
};
|
|
52
82
|
};
|
|
53
|
-
const fadeDown = () => {
|
|
83
|
+
const fadeDown = (rect) => {
|
|
84
|
+
const y = getY(rect);
|
|
54
85
|
return {
|
|
55
86
|
from: {
|
|
56
|
-
transform: `translateY(
|
|
87
|
+
transform: `translateY(-${y}px) scale(0.98)`,
|
|
57
88
|
opacity: 0
|
|
58
89
|
},
|
|
59
90
|
to: {
|
|
60
|
-
transform: `translateY(0)`,
|
|
91
|
+
transform: `translateY(0) scale(1)`,
|
|
61
92
|
opacity: 1
|
|
62
93
|
}
|
|
63
94
|
};
|
|
64
95
|
};
|
|
65
|
-
const fadeUp = () => {
|
|
96
|
+
const fadeUp = (rect) => {
|
|
97
|
+
const y = getY(rect);
|
|
66
98
|
return {
|
|
67
99
|
from: {
|
|
68
|
-
transform: `translateY(
|
|
100
|
+
transform: `translateY(${y}px) scale(0.98)`,
|
|
69
101
|
opacity: 0
|
|
70
102
|
},
|
|
71
103
|
to: {
|
|
72
|
-
transform: `translateY(0)`,
|
|
104
|
+
transform: `translateY(0) scale(1)`,
|
|
73
105
|
opacity: 1
|
|
74
106
|
}
|
|
75
107
|
};
|
|
76
108
|
};
|
|
77
|
-
const fadeRight = () => {
|
|
109
|
+
const fadeRight = (rect) => {
|
|
110
|
+
const x = getX(rect);
|
|
78
111
|
return {
|
|
79
112
|
from: {
|
|
80
|
-
transform: `translateX(
|
|
113
|
+
transform: `translateX(-${x}px) scale(0.98)`,
|
|
81
114
|
opacity: 0
|
|
82
115
|
},
|
|
83
116
|
to: {
|
|
84
|
-
transform: `translateX(0)`,
|
|
117
|
+
transform: `translateX(0) scale(1)`,
|
|
85
118
|
opacity: 1
|
|
86
119
|
}
|
|
87
120
|
};
|
|
88
121
|
};
|
|
89
|
-
const fadeLeft = () => {
|
|
122
|
+
const fadeLeft = (rect) => {
|
|
123
|
+
const x = getX(rect);
|
|
90
124
|
return {
|
|
91
125
|
from: {
|
|
92
|
-
transform: `translateX(
|
|
126
|
+
transform: `translateX(${x}px) scale(0.98)`,
|
|
93
127
|
opacity: 0
|
|
94
128
|
},
|
|
95
129
|
to: {
|
|
96
|
-
transform: `translateX(0)`,
|
|
130
|
+
transform: `translateX(0) scale(1)`,
|
|
97
131
|
opacity: 1
|
|
98
132
|
}
|
|
99
133
|
};
|
|
@@ -114,10 +148,12 @@ const zoom = () => {
|
|
|
114
148
|
return {
|
|
115
149
|
from: {
|
|
116
150
|
transform: "scale(.8)",
|
|
151
|
+
transformOrigin: "center",
|
|
117
152
|
opacity: 0
|
|
118
153
|
},
|
|
119
154
|
to: {
|
|
120
155
|
transform: "scale(1)",
|
|
156
|
+
transformOrigin: "center",
|
|
121
157
|
opacity: 1
|
|
122
158
|
}
|
|
123
159
|
};
|
|
@@ -126,10 +162,12 @@ const zoomOver = () => {
|
|
|
126
162
|
return {
|
|
127
163
|
from: {
|
|
128
164
|
transform: "scale(1.2)",
|
|
165
|
+
transformOrigin: "center",
|
|
129
166
|
opacity: 0
|
|
130
167
|
},
|
|
131
168
|
to: {
|
|
132
169
|
transform: "scale(1)",
|
|
170
|
+
transformOrigin: "center",
|
|
133
171
|
opacity: 1
|
|
134
172
|
}
|
|
135
173
|
};
|
|
@@ -137,11 +175,11 @@ const zoomOver = () => {
|
|
|
137
175
|
const collapseVertical = (rect) => {
|
|
138
176
|
return {
|
|
139
177
|
from: {
|
|
140
|
-
maxHeight:
|
|
178
|
+
maxHeight: "0px",
|
|
141
179
|
overflow: "hidden"
|
|
142
180
|
},
|
|
143
181
|
to: {
|
|
144
|
-
maxHeight: rect.height,
|
|
182
|
+
maxHeight: rect.height + "px",
|
|
145
183
|
overflow: "hidden"
|
|
146
184
|
}
|
|
147
185
|
};
|
|
@@ -149,11 +187,11 @@ const collapseVertical = (rect) => {
|
|
|
149
187
|
const collapseHorizontal = (rect) => {
|
|
150
188
|
return {
|
|
151
189
|
from: {
|
|
152
|
-
width:
|
|
190
|
+
width: "0px",
|
|
153
191
|
overflow: "hidden"
|
|
154
192
|
},
|
|
155
193
|
to: {
|
|
156
|
-
width:
|
|
194
|
+
width: rect.width + "px",
|
|
157
195
|
overflow: "hidden"
|
|
158
196
|
}
|
|
159
197
|
};
|
|
@@ -167,6 +205,8 @@ exports.fadeLeft = fadeLeft;
|
|
|
167
205
|
exports.fadeRight = fadeRight;
|
|
168
206
|
exports.fadeUp = fadeUp;
|
|
169
207
|
exports.grow = grow;
|
|
208
|
+
exports.scaleYDown = scaleYDown;
|
|
209
|
+
exports.scaleYUp = scaleYUp;
|
|
170
210
|
exports.slideDown = slideDown;
|
|
171
211
|
exports.slideLeft = slideLeft;
|
|
172
212
|
exports.slideRight = slideRight;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"variants.cjs","sources":["../../src/Transition/variants.ts"],"sourcesContent":["\nconst getY = (rect?: DOMRect) =>\n rect ? Math.min(rect.height / 2, 40) : 20\n\nconst getX = (rect?: DOMRect) =>\n rect ? Math.min(rect.width / 2, 40) : 20\n\n\n\nexport const slideDown = (rect?: DOMRect) => {\n const y = getY(rect)\n\n return {\n from: {\n transform: `translateY(-${y}px)`,\n },\n to: {\n transform: `translateY(0)`,\n }\n }\n}\n\nexport const slideUp = (rect?: DOMRect) => {\n const y = getY(rect)\n\n return {\n from: {\n transform: `translateY(${y}px)`,\n },\n to: {\n transform: `translateY(0)`,\n }\n }\n}\n\nexport const slideRight = (rect?: DOMRect) => {\n const x = getX(rect)\n\n return {\n from: {\n transform: `translateX(-${x}px)`,\n },\n to: {\n transform: `translateX(0)`,\n }\n }\n}\n\nexport const slideLeft = (rect?: DOMRect) => {\n const x = getX(rect)\n\n return {\n from: {\n transform: `translateX(${x}px)`,\n },\n to: {\n transform: `translateX(0)`,\n }\n }\n}\n\nexport const scaleYDown = () => ({\n from: {\n transform: \"scaleY(0.8)\",\n opacity: 0,\n transformOrigin: \"top\"\n },\n to: {\n transform: \"scaleY(1)\",\n opacity: 1,\n transformOrigin: \"top\"\n }\n})\n\nexport const scaleYUp = () => ({\n from: {\n transform: \"scaleY(0.8)\",\n transformOrigin: \"bottom\",\n opacity: 0\n },\n to: {\n transform: \"scaleY(1)\",\n transformOrigin: \"bottom\",\n opacity: 1\n }\n})\n\nexport const fade = () => {\n return {\n from: {\n opacity: 0\n },\n to: {\n opacity: 1\n }\n }\n}\n\n\nexport const fadeDown = (rect?: DOMRect) => {\n const y = getY(rect)\n\n return {\n from: {\n transform: `translateY(-${y}px) scale(0.98)`,\n opacity: 0\n },\n to: {\n transform: `translateY(0) scale(1)`,\n opacity: 1\n }\n }\n}\n\nexport const fadeUp = (rect?: DOMRect) => {\n const y = getY(rect)\n\n return {\n from: {\n transform: `translateY(${y}px) scale(0.98)`,\n opacity: 0\n },\n to: {\n transform: `translateY(0) scale(1)`,\n opacity: 1\n }\n }\n}\n\nexport const fadeRight = (rect?: DOMRect) => {\n const x = getX(rect)\n\n return {\n from: {\n transform: `translateX(-${x}px) scale(0.98)`,\n opacity: 0\n },\n to: {\n transform: `translateX(0) scale(1)`,\n opacity: 1\n }\n }\n}\n\nexport const fadeLeft = (rect?: DOMRect) => {\n const x = getX(rect)\n\n return {\n from: {\n transform: `translateX(${x}px) scale(0.98)`,\n opacity: 0\n },\n to: {\n transform: `translateX(0) scale(1)`,\n opacity: 1\n }\n }\n}\n\nexport const grow = () => {\n return {\n from: {\n transform: \"scale(.8, .6)\",\n opacity: 0\n },\n to: {\n transform: \"scale(1)\",\n opacity: 1\n }\n }\n}\n\nexport const zoom = () => {\n return {\n from: {\n transform: \"scale(.8)\",\n transformOrigin: \"center\",\n opacity: 0\n },\n to: {\n transform: \"scale(1)\",\n transformOrigin: \"center\",\n opacity: 1\n }\n }\n}\n\nexport const zoomOver = () => {\n return {\n from: {\n transform: \"scale(1.2)\",\n transformOrigin: \"center\",\n opacity: 0\n },\n to: {\n transform: \"scale(1)\",\n transformOrigin: \"center\",\n opacity: 1\n }\n }\n}\n\nexport const collapseVertical = (rect: DOMRect) => {\n return {\n from: {\n maxHeight: \"0px\",\n overflow: \"hidden\"\n },\n to: {\n maxHeight: rect.height + \"px\",\n overflow: \"hidden\"\n }\n }\n}\n\n\nexport const collapseHorizontal = (rect: DOMRect) => {\n return {\n from: {\n width: \"0px\",\n overflow: \"hidden\"\n },\n to: {\n width: rect.width + \"px\",\n overflow: \"hidden\"\n }\n }\n}\n\n\n\n\n"],"names":[],"mappings":";;AACA,MAAM,IAAI,GAAG,CAAC,IAAc,KACxB,IAAI,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,EAAE,EAAE,CAAC,GAAG,EAAE;AAE7C,MAAM,IAAI,GAAG,CAAC,IAAc,KACxB,IAAI,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,KAAK,GAAG,CAAC,EAAE,EAAE,CAAC,GAAG,EAAE;AAIrC,MAAM,SAAS,GAAG,CAAC,IAAc,KAAI;AACxC,IAAA,MAAM,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC;IAEpB,OAAO;AACH,QAAA,IAAI,EAAE;YACF,SAAS,EAAE,CAAA,YAAA,EAAe,CAAC,CAAA,GAAA,CAAK;AACnC,SAAA;AACD,QAAA,EAAE,EAAE;AACA,YAAA,SAAS,EAAE,CA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E,QAAQ;AACzB,YAAA,OAAO,EAAE;AACZ;KACJ;AACL;AAEO,MAAM,gBAAgB,GAAG,CAAC,IAAa,KAAI;IAC9C,OAAO;AACH,QAAA,IAAI,EAAE;AACF,YAAA,SAAS,EAAE,KAAK;AAChB,YAAA,QAAQ,EAAE;AACb,SAAA;AACD,QAAA,EAAE,EAAE;AACA,YAAA,SAAS,EAAE,IAAI,CAAC,MAAM,GAAG,IAAI;AAC7B,YAAA,QAAQ,EAAE;AACb;KACJ;AACL;AAGO,MAAM,kBAAkB,GAAG,CAAC,IAAa,KAAI;IAChD,OAAO;AACH,QAAA,IAAI,EAAE;AACF,YAAA,KAAK,EAAE,KAAK;AACZ,YAAA,QAAQ,EAAE;AACb,SAAA;AACD,QAAA,EAAE,EAAE;AACA,YAAA,KAAK,EAAE,IAAI,CAAC,KAAK,GAAG,IAAI;AACxB,YAAA,QAAQ,EAAE;AACb;KACJ;AACL;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
declare const slideDown: (rect
|
|
1
|
+
declare const slideDown: (rect?: DOMRect) => {
|
|
2
2
|
from: {
|
|
3
3
|
transform: string;
|
|
4
4
|
};
|
|
@@ -6,7 +6,7 @@ declare const slideDown: (rect: DOMRect) => {
|
|
|
6
6
|
transform: string;
|
|
7
7
|
};
|
|
8
8
|
};
|
|
9
|
-
declare const slideUp: (rect
|
|
9
|
+
declare const slideUp: (rect?: DOMRect) => {
|
|
10
10
|
from: {
|
|
11
11
|
transform: string;
|
|
12
12
|
};
|
|
@@ -14,7 +14,7 @@ declare const slideUp: (rect: DOMRect) => {
|
|
|
14
14
|
transform: string;
|
|
15
15
|
};
|
|
16
16
|
};
|
|
17
|
-
declare const slideRight: (rect
|
|
17
|
+
declare const slideRight: (rect?: DOMRect) => {
|
|
18
18
|
from: {
|
|
19
19
|
transform: string;
|
|
20
20
|
};
|
|
@@ -22,7 +22,7 @@ declare const slideRight: (rect: DOMRect) => {
|
|
|
22
22
|
transform: string;
|
|
23
23
|
};
|
|
24
24
|
};
|
|
25
|
-
declare const slideLeft: (rect
|
|
25
|
+
declare const slideLeft: (rect?: DOMRect) => {
|
|
26
26
|
from: {
|
|
27
27
|
transform: string;
|
|
28
28
|
};
|
|
@@ -30,6 +30,30 @@ declare const slideLeft: (rect: DOMRect) => {
|
|
|
30
30
|
transform: string;
|
|
31
31
|
};
|
|
32
32
|
};
|
|
33
|
+
declare const scaleYDown: () => {
|
|
34
|
+
from: {
|
|
35
|
+
transform: string;
|
|
36
|
+
opacity: number;
|
|
37
|
+
transformOrigin: string;
|
|
38
|
+
};
|
|
39
|
+
to: {
|
|
40
|
+
transform: string;
|
|
41
|
+
opacity: number;
|
|
42
|
+
transformOrigin: string;
|
|
43
|
+
};
|
|
44
|
+
};
|
|
45
|
+
declare const scaleYUp: () => {
|
|
46
|
+
from: {
|
|
47
|
+
transform: string;
|
|
48
|
+
transformOrigin: string;
|
|
49
|
+
opacity: number;
|
|
50
|
+
};
|
|
51
|
+
to: {
|
|
52
|
+
transform: string;
|
|
53
|
+
transformOrigin: string;
|
|
54
|
+
opacity: number;
|
|
55
|
+
};
|
|
56
|
+
};
|
|
33
57
|
declare const fade: () => {
|
|
34
58
|
from: {
|
|
35
59
|
opacity: number;
|
|
@@ -38,7 +62,7 @@ declare const fade: () => {
|
|
|
38
62
|
opacity: number;
|
|
39
63
|
};
|
|
40
64
|
};
|
|
41
|
-
declare const fadeDown: () => {
|
|
65
|
+
declare const fadeDown: (rect?: DOMRect) => {
|
|
42
66
|
from: {
|
|
43
67
|
transform: string;
|
|
44
68
|
opacity: number;
|
|
@@ -48,7 +72,7 @@ declare const fadeDown: () => {
|
|
|
48
72
|
opacity: number;
|
|
49
73
|
};
|
|
50
74
|
};
|
|
51
|
-
declare const fadeUp: () => {
|
|
75
|
+
declare const fadeUp: (rect?: DOMRect) => {
|
|
52
76
|
from: {
|
|
53
77
|
transform: string;
|
|
54
78
|
opacity: number;
|
|
@@ -58,7 +82,7 @@ declare const fadeUp: () => {
|
|
|
58
82
|
opacity: number;
|
|
59
83
|
};
|
|
60
84
|
};
|
|
61
|
-
declare const fadeRight: () => {
|
|
85
|
+
declare const fadeRight: (rect?: DOMRect) => {
|
|
62
86
|
from: {
|
|
63
87
|
transform: string;
|
|
64
88
|
opacity: number;
|
|
@@ -68,7 +92,7 @@ declare const fadeRight: () => {
|
|
|
68
92
|
opacity: number;
|
|
69
93
|
};
|
|
70
94
|
};
|
|
71
|
-
declare const fadeLeft: () => {
|
|
95
|
+
declare const fadeLeft: (rect?: DOMRect) => {
|
|
72
96
|
from: {
|
|
73
97
|
transform: string;
|
|
74
98
|
opacity: number;
|
|
@@ -91,20 +115,24 @@ declare const grow: () => {
|
|
|
91
115
|
declare const zoom: () => {
|
|
92
116
|
from: {
|
|
93
117
|
transform: string;
|
|
118
|
+
transformOrigin: string;
|
|
94
119
|
opacity: number;
|
|
95
120
|
};
|
|
96
121
|
to: {
|
|
97
122
|
transform: string;
|
|
123
|
+
transformOrigin: string;
|
|
98
124
|
opacity: number;
|
|
99
125
|
};
|
|
100
126
|
};
|
|
101
127
|
declare const zoomOver: () => {
|
|
102
128
|
from: {
|
|
103
129
|
transform: string;
|
|
130
|
+
transformOrigin: string;
|
|
104
131
|
opacity: number;
|
|
105
132
|
};
|
|
106
133
|
to: {
|
|
107
134
|
transform: string;
|
|
135
|
+
transformOrigin: string;
|
|
108
136
|
opacity: number;
|
|
109
137
|
};
|
|
110
138
|
};
|
|
@@ -114,7 +142,7 @@ declare const collapseVertical: (rect: DOMRect) => {
|
|
|
114
142
|
overflow: string;
|
|
115
143
|
};
|
|
116
144
|
to: {
|
|
117
|
-
maxHeight:
|
|
145
|
+
maxHeight: string;
|
|
118
146
|
overflow: string;
|
|
119
147
|
};
|
|
120
148
|
};
|
|
@@ -129,4 +157,4 @@ declare const collapseHorizontal: (rect: DOMRect) => {
|
|
|
129
157
|
};
|
|
130
158
|
};
|
|
131
159
|
|
|
132
|
-
export { collapseHorizontal, collapseVertical, fade, fadeDown, fadeLeft, fadeRight, fadeUp, grow, slideDown, slideLeft, slideRight, slideUp, zoom, zoomOver };
|
|
160
|
+
export { collapseHorizontal, collapseVertical, fade, fadeDown, fadeLeft, fadeRight, fadeUp, grow, scaleYDown, scaleYUp, slideDown, slideLeft, slideRight, slideUp, zoom, zoomOver };
|