matsuri-ui 17.0.1 → 17.0.2-alpha-1744547219352-794c92f.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/Alert/Alert.js +48 -24
- package/Alert/Alert.js.map +1 -1
- package/ImageViewer/ImageViewer.js +34 -33
- package/ImageViewer/ImageViewer.js.map +1 -1
- package/cjs/Alert/Alert.js +64 -40
- package/cjs/Alert/Alert.js.map +1 -1
- package/cjs/ImageViewer/ImageViewer.js +51 -50
- package/cjs/ImageViewer/ImageViewer.js.map +1 -1
- package/esm/Alert/Alert.js +48 -24
- package/esm/Alert/Alert.js.map +1 -1
- package/esm/ImageViewer/ImageViewer.js +34 -33
- package/esm/ImageViewer/ImageViewer.js.map +1 -1
- package/package.json +4 -5
- package/Alert/useAlertMotion.d.ts +0 -10
- package/Alert/useAlertMotion.js +0 -50
- package/Alert/useAlertMotion.js.map +0 -1
- package/cjs/Alert/useAlertMotion.js +0 -54
- package/cjs/Alert/useAlertMotion.js.map +0 -1
- package/cjs/react-spring.d.js +0 -4
- package/cjs/react-spring.d.js.map +0 -1
- package/esm/Alert/useAlertMotion.js +0 -50
- package/esm/Alert/useAlertMotion.js.map +0 -1
- package/esm/react-spring.d.js +0 -2
- package/esm/react-spring.d.js.map +0 -1
- package/react-spring.d.js +0 -2
- package/react-spring.d.js.map +0 -1
- package/types/Alert/useAlertMotion.d.ts +0 -10
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useAlertMotion.js","names":["useAlert","useCallback","useEffect","useMemo","useState","useTransition","useAlertMotion","_ref","duration","id","show","setShow","removeAlert","transitions","from","opacity","enter","leave","durationNumber","Infinity","timeout","setTimeout","clearTimeout","undefined","handleClick"],"sources":["../../../src/Alert/useAlertMotion.tsx"],"sourcesContent":["import { AlertDuration } from \"./Alert\";\nimport { useAlert } from \"./AlertContext\";\nimport { useCallback, useEffect, useMemo, useState } from \"react\";\nimport { useTransition } from \"react-spring\";\n\nexport const useAlertMotion = ({\n duration,\n id,\n}: {\n duration: AlertDuration;\n id?: string;\n}) => {\n const [show, setShow] = useState(true);\n const { removeAlert } = useAlert();\n const transitions = useTransition(show, {\n from: { opacity: 0 },\n enter: { opacity: 1 },\n leave: { opacity: 0 },\n });\n\n const durationNumber = useMemo(() => {\n return duration === \"standard\"\n ? 3500\n : duration === \"short\"\n ? 1500\n : duration;\n }, [duration]);\n\n useEffect(() => {\n if (show && durationNumber !== Infinity) {\n const timeout = setTimeout(() => {\n setShow(false);\n if (id) {\n removeAlert(id);\n }\n }, durationNumber);\n\n return () => clearTimeout(timeout);\n }\n return undefined;\n }, [durationNumber, id, removeAlert, show]);\n\n const handleClick = useCallback(() => {\n setShow(false);\n if (id) {\n removeAlert(id);\n }\n }, [id, removeAlert]);\n return {\n transitions,\n handleClick,\n };\n};\n"],"mappings":"AACA,SAASA,QAAQ,QAAQ,gBAAgB;AACzC,SAASC,WAAW,EAAEC,SAAS,EAAEC,OAAO,EAAEC,QAAQ,QAAQ,OAAO;AACjE,SAASC,aAAa,QAAQ,cAAc;AAE5C,OAAO,IAAMC,cAAc,GAAGC,IAAA,IAMxB;EAAA,IANyB;IAC7BC,QAAQ;IACRC;EAIF,CAAC,GAAAF,IAAA;EACC,IAAM,CAACG,IAAI,EAAEC,OAAO,CAAC,GAAGP,QAAQ,CAAC,IAAI,CAAC;EACtC,IAAM;IAAEQ;EAAY,CAAC,GAAGZ,QAAQ,CAAC,CAAC;EAClC,IAAMa,WAAW,GAAGR,aAAa,CAACK,IAAI,EAAE;IACtCI,IAAI,EAAE;MAAEC,OAAO,EAAE;IAAE,CAAC;IACpBC,KAAK,EAAE;MAAED,OAAO,EAAE;IAAE,CAAC;IACrBE,KAAK,EAAE;MAAEF,OAAO,EAAE;IAAE;EACtB,CAAC,CAAC;EAEF,IAAMG,cAAc,GAAGf,OAAO,CAAC,MAAM;IACnC,OAAOK,QAAQ,KAAK,UAAU,GAC1B,IAAI,GACJA,QAAQ,KAAK,OAAO,GAClB,IAAI,GACJA,QAAQ;EAChB,CAAC,EAAE,CAACA,QAAQ,CAAC,CAAC;EAEdN,SAAS,CAAC,MAAM;IACd,IAAIQ,IAAI,IAAIQ,cAAc,KAAKC,QAAQ,EAAE;MACvC,IAAMC,OAAO,GAAGC,UAAU,CAAC,MAAM;QAC/BV,OAAO,CAAC,KAAK,CAAC;QACd,IAAIF,EAAE,EAAE;UACNG,WAAW,CAACH,EAAE,CAAC;QACjB;MACF,CAAC,EAAES,cAAc,CAAC;MAElB,OAAO,MAAMI,YAAY,CAACF,OAAO,CAAC;IACpC;IACA,OAAOG,SAAS;EAClB,CAAC,EAAE,CAACL,cAAc,EAAET,EAAE,EAAEG,WAAW,EAAEF,IAAI,CAAC,CAAC;EAE3C,IAAMc,WAAW,GAAGvB,WAAW,CAAC,MAAM;IACpCU,OAAO,CAAC,KAAK,CAAC;IACd,IAAIF,EAAE,EAAE;MACNG,WAAW,CAACH,EAAE,CAAC;IACjB;EACF,CAAC,EAAE,CAACA,EAAE,EAAEG,WAAW,CAAC,CAAC;EACrB,OAAO;IACLC,WAAW;IACXW;EACF,CAAC;AACH,CAAC","ignoreList":[]}
|
package/esm/react-spring.d.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"react-spring.d.js","names":[],"sources":["../../src/react-spring.d.ts"],"sourcesContent":["import { WithAnimated } from \"react-spring\";\n\ntype Animated = {\n [Tag in keyof React.JSX.IntrinsicElements]: AnimatedComponent;\n};\n\ndeclare module \"react-spring\" {\n export const animated: Animated & WithAnimated;\n}\n"],"mappings":"","ignoreList":[]}
|
package/react-spring.d.js
DELETED
package/react-spring.d.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"react-spring.d.js","names":[],"sources":["../../src/react-spring.d.ts"],"sourcesContent":["import { WithAnimated } from \"react-spring\";\n\ntype Animated = {\n [Tag in keyof React.JSX.IntrinsicElements]: AnimatedComponent;\n};\n\ndeclare module \"react-spring\" {\n export const animated: Animated & WithAnimated;\n}\n"],"mappings":"","ignoreList":[]}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { AlertDuration } from "./Alert";
|
|
2
|
-
export declare const useAlertMotion: ({ duration, id, }: {
|
|
3
|
-
duration: AlertDuration;
|
|
4
|
-
id?: string;
|
|
5
|
-
}) => {
|
|
6
|
-
transitions: import("react-spring").TransitionFn<boolean, {
|
|
7
|
-
opacity: number;
|
|
8
|
-
}>;
|
|
9
|
-
handleClick: () => void;
|
|
10
|
-
};
|