@pfct/purple 1.12.0 → 1.14.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/dist/assets/dotLotties/sample.lottie +0 -0
- package/dist/assets/images/fallback.png +0 -0
- package/dist/assets/images/fallback@2x.png +0 -0
- package/dist/assets/images/fallback@3x.png +0 -0
- package/dist/assets/index.css +1 -1
- package/dist/chunks/DotLottie.CAB2tVvS.js +5 -0
- package/dist/chunks/DotLottie.rjIbaVEt.js +71443 -0
- package/dist/chunks/{Switch.2ZixJdlG.js → Switch.BL3XBsvs.js} +1 -1
- package/dist/chunks/{Switch.Cf71RNLF.js → Switch.BgeUHuBq.js} +3 -4
- package/dist/chunks/dist.Bj_fI5rQ.js +1 -0
- package/dist/chunks/dist.CYRtTgUR.js +96 -0
- package/dist/components/Control/Switch/index.cjs.js +1 -1
- package/dist/components/Control/Switch/index.d.ts.map +1 -1
- package/dist/components/Control/Switch/index.esm.js +1 -1
- package/dist/components/Control/index.cjs.js +1 -1
- package/dist/components/Control/index.esm.js +1 -1
- package/dist/components/ErrorUI/SectionError.cjs.js +1 -1
- package/dist/components/ErrorUI/SectionError.d.ts +2 -2
- package/dist/components/ErrorUI/SectionError.d.ts.map +1 -1
- package/dist/components/ErrorUI/SectionError.esm.js +14 -7
- package/dist/components/Input/PostfixInput/index.cjs.js +1 -1
- package/dist/components/Input/PostfixInput/index.d.ts.map +1 -1
- package/dist/components/Input/PostfixInput/index.esm.js +1 -1
- package/dist/components/Input/ResidentNumberInput/index.cjs.js +1 -1
- package/dist/components/Input/ResidentNumberInput/index.d.ts.map +1 -1
- package/dist/components/Input/ResidentNumberInput/index.esm.js +2 -2
- package/dist/components/List/index.cjs.js +1 -1
- package/dist/components/List/index.d.ts +48 -6
- package/dist/components/List/index.d.ts.map +1 -1
- package/dist/components/List/index.esm.js +77 -17
- package/dist/components/MiniButton/IconMiniButton/index.cjs.js +1 -1
- package/dist/components/MiniButton/IconMiniButton/index.d.ts.map +1 -1
- package/dist/components/MiniButton/IconMiniButton/index.esm.js +2 -1
- package/dist/components/MiniButton/UnderLineMiniButton/index.cjs.js +1 -1
- package/dist/components/MiniButton/UnderLineMiniButton/index.d.ts.map +1 -1
- package/dist/components/MiniButton/UnderLineMiniButton/index.esm.js +2 -3
- package/dist/components/index.cjs.js +1 -1
- package/dist/components/index.esm.js +26 -26
- package/dist/icons/src/aliases/prefixed.d.ts +3 -3
- package/dist/icons/src/aliases/prefixed.d.ts.map +1 -1
- package/dist/icons/src/aliases/suffixed.d.ts +5 -5
- package/dist/icons/src/aliases/suffixed.d.ts.map +1 -1
- package/dist/icons/src/icons/index.d.ts +1 -1
- package/dist/icons/src/icons/index.d.ts.map +1 -1
- package/dist/index.cjs.js +1 -1
- package/dist/index.esm.js +55 -54
- package/dist/library/DotLottie/index.cjs.js +1 -0
- package/dist/library/DotLottie/index.d.ts +21 -0
- package/dist/library/DotLottie/index.d.ts.map +1 -0
- package/dist/library/DotLottie/index.esm.js +2 -0
- package/dist/library/List/BottomSheetItemList/index.cjs.js +1 -1
- package/dist/library/List/BottomSheetItemList/index.esm.js +1 -1
- package/dist/library/Lottie/index.cjs.js +1 -1
- package/dist/library/Lottie/index.esm.js +67 -2
- package/dist/library/index.cjs.js +1 -1
- package/dist/library/index.d.ts +1 -0
- package/dist/library/index.d.ts.map +1 -1
- package/dist/library/index.esm.js +6 -5
- package/package.json +4 -2
- package/dist/chunks/Lottie.DxqtsFQi.js +0 -1
- package/dist/chunks/Lottie.RPp4wef7.js +0 -161
|
@@ -1,2 +1,67 @@
|
|
|
1
|
-
import { t as e } from "../../chunks/
|
|
2
|
-
|
|
1
|
+
import { t as e } from "../../chunks/utils.D6DjRYW1.js";
|
|
2
|
+
import t from "../../hooks/useLayoutIsMobile.esm.js";
|
|
3
|
+
import "../../hooks/index.esm.js";
|
|
4
|
+
import { t as n } from "../../chunks/dist.CYRtTgUR.js";
|
|
5
|
+
import { IconWithImage as r } from "../IconWithImage/index.esm.js";
|
|
6
|
+
import { uuid as i } from "../../utils/uuid.util.esm.js";
|
|
7
|
+
import { useEffect as a, useMemo as o, useRef as s, useState as c } from "react";
|
|
8
|
+
import { jsx as l } from "react/jsx-runtime";
|
|
9
|
+
import u from "lottie-web";
|
|
10
|
+
//#region src/library/Lottie/index.tsx
|
|
11
|
+
var d = ({ width: d, height: f, viewBox: p, className: m, playOnce: h, autoplay: g = !1, alterImgSrcOnLoad: _, lottieFileSrcPath: v }) => {
|
|
12
|
+
let [y, b] = c(null), x = s(null), S = s(i()), C = t(), { ref: w, inView: T } = n({
|
|
13
|
+
threshold: C ? .4 : .9,
|
|
14
|
+
rootMargin: C ? "20% 0% 0% 0%" : "40% 0% 10% 0%"
|
|
15
|
+
}), E = o(() => p ? `${p.x ?? 0} ${p.y ?? 0} ${p.width} ${p.height}` : void 0, [p]), [D, O] = c();
|
|
16
|
+
return a(() => {
|
|
17
|
+
fetch(v).then((e) => e.json()).then((e) => {
|
|
18
|
+
b(e);
|
|
19
|
+
}).catch(() => {
|
|
20
|
+
console.info("lottie load 에 실패했습니다.");
|
|
21
|
+
});
|
|
22
|
+
}, [v]), a(() => {
|
|
23
|
+
if (!(x.current && y)) return;
|
|
24
|
+
let e = u.loadAnimation({
|
|
25
|
+
container: x.current,
|
|
26
|
+
renderer: "svg",
|
|
27
|
+
loop: !h,
|
|
28
|
+
autoplay: g,
|
|
29
|
+
animationData: y,
|
|
30
|
+
rendererSettings: { viewBoxSize: E },
|
|
31
|
+
name: m
|
|
32
|
+
});
|
|
33
|
+
return O(e), () => e.destroy();
|
|
34
|
+
}, [
|
|
35
|
+
y,
|
|
36
|
+
m,
|
|
37
|
+
g,
|
|
38
|
+
h,
|
|
39
|
+
E
|
|
40
|
+
]), a(() => {
|
|
41
|
+
T ? D?.goToAndPlay(D?.currentFrame > .9 * D?.totalFrames ? 0 : D?.currentFrame, !0) : h ? D?.stop() : D?.pause();
|
|
42
|
+
}, [
|
|
43
|
+
T,
|
|
44
|
+
D,
|
|
45
|
+
h
|
|
46
|
+
]), y === null && _ ? /* @__PURE__ */ l("div", {
|
|
47
|
+
className: "flex items-center justify-center",
|
|
48
|
+
children: /* @__PURE__ */ l(r, {
|
|
49
|
+
srcPath: _,
|
|
50
|
+
width: d || 0
|
|
51
|
+
})
|
|
52
|
+
}) : /* @__PURE__ */ l("div", {
|
|
53
|
+
className: "w-full",
|
|
54
|
+
ref: w,
|
|
55
|
+
children: /* @__PURE__ */ l("div", {
|
|
56
|
+
className: e("flex", m),
|
|
57
|
+
id: S.current,
|
|
58
|
+
ref: x,
|
|
59
|
+
style: {
|
|
60
|
+
width: d || void 0,
|
|
61
|
+
height: f || void 0
|
|
62
|
+
}
|
|
63
|
+
})
|
|
64
|
+
});
|
|
65
|
+
};
|
|
66
|
+
//#endregion
|
|
67
|
+
export { d as Lottie };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./IconWithImage/index.cjs.js"),
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../chunks/DotLottie.CAB2tVvS.js"),t=require("./IconWithImage/index.cjs.js"),n=require("./List/BottomSheetItemList/index.cjs.js");require("./List/index.cjs.js");const r=require("./Lottie/index.cjs.js"),i=require("./Spacing/index.cjs.js");exports.BottomSheetItemList=n.BottomSheetItemList,exports.DotLottie=e.t,exports.IconWithImage=t.IconWithImage,exports.Lottie=r.Lottie,exports.Spacing=i.Spacing;
|
package/dist/library/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/library/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC;AAChC,cAAc,QAAQ,CAAC;AACvB,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/library/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,iBAAiB,CAAC;AAChC,cAAc,QAAQ,CAAC;AACvB,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { t as e } from "../chunks/DotLottie.rjIbaVEt.js";
|
|
2
|
+
import { IconWithImage as t } from "./IconWithImage/index.esm.js";
|
|
3
|
+
import { BottomSheetItemList as n } from "./List/BottomSheetItemList/index.esm.js";
|
|
3
4
|
import "./List/index.esm.js";
|
|
4
|
-
import {
|
|
5
|
-
import { Spacing as
|
|
6
|
-
export {
|
|
5
|
+
import { Lottie as r } from "./Lottie/index.esm.js";
|
|
6
|
+
import { Spacing as i } from "./Spacing/index.esm.js";
|
|
7
|
+
export { n as BottomSheetItemList, e as DotLottie, t as IconWithImage, r as Lottie, i as Spacing };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pfct/purple",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.14.0",
|
|
4
4
|
"description": "design system for PFCT web service",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": {
|
|
@@ -64,6 +64,7 @@
|
|
|
64
64
|
"dependencies": {
|
|
65
65
|
"@emotion/react": "^11.14.0",
|
|
66
66
|
"@emotion/styled": "^11.14.0",
|
|
67
|
+
"@lottiefiles/dotlottie-react": "^0.19.4",
|
|
67
68
|
"@radix-ui/react-accordion": "^1.2.10",
|
|
68
69
|
"@radix-ui/react-checkbox": "^1.3.2",
|
|
69
70
|
"@radix-ui/react-dialog": "^1.1.6",
|
|
@@ -100,6 +101,7 @@
|
|
|
100
101
|
"@types/node": "^25.9.2",
|
|
101
102
|
"@types/react": "^19.2.14",
|
|
102
103
|
"@types/react-dom": "^19.2.3",
|
|
104
|
+
"@typescript/typescript6": "^6.0.1",
|
|
103
105
|
"@vitejs/plugin-react": "^6.0.0",
|
|
104
106
|
"glob": "^13.0.0",
|
|
105
107
|
"jsdom": "^29.1.1",
|
|
@@ -109,7 +111,7 @@
|
|
|
109
111
|
"rollup-plugin-visualizer": "^7.0.0",
|
|
110
112
|
"storybook": "10.4.4",
|
|
111
113
|
"tailwindcss": "^4.0.15",
|
|
112
|
-
"typescript": "^
|
|
114
|
+
"typescript": "^7.0.1-rc",
|
|
113
115
|
"ultracite": "7.8.3",
|
|
114
116
|
"vite": "^8.0.0",
|
|
115
117
|
"vite-plugin-dts": "^5.0.0",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
const e=require("./chunk.CMqjfN_6.js"),t=require("./utils.C67s_c-g.js"),n=require("../hooks/useLayoutIsMobile.cjs.js");require("../hooks/index.cjs.js");const r=require("../library/IconWithImage/index.cjs.js"),i=require("../utils/uuid.util.cjs.js");let a=require("react");a=e.t(a,1);let o=require("react/jsx-runtime"),s=require("lottie-web");s=e.t(s);var c=new Map,l=new WeakMap,u=0,d;function f(e){return e?l.has(e)?l.get(e):(u+=1,l.set(e,u.toString()),l.get(e)):`0`}function p(e){return Object.keys(e).sort().filter(t=>e[t]!==void 0).map(t=>`${t}_${t===`root`?f(e.root):e[t]}`).toString()}function m(e){let t=p(e),n=c.get(t);if(!n){let r=new Map,i,a=new IntersectionObserver(t=>{t.forEach(t=>{let n=t.isIntersecting&&i.some(e=>t.intersectionRatio>=e);e.trackVisibility&&t.isVisible===void 0&&(t.isVisible=n),[...r.get(t.target)??[]].forEach(e=>{e(n,t)})})},e);i=a.thresholds||(Array.isArray(e.threshold)?e.threshold:[e.threshold||0]),n={id:t,observer:a,elements:r},c.set(t,n)}return n}function h(e,t,n={},r=d){if(window.IntersectionObserver===void 0&&r!==void 0){let i=e.getBoundingClientRect();return t(r,{isIntersecting:r,target:e,intersectionRatio:typeof n.threshold==`number`?n.threshold:0,time:0,boundingClientRect:i,intersectionRect:i,rootBounds:i}),()=>{}}let{id:i,observer:a,elements:o}=m(n),s=o.get(e)||[];return o.has(e)||o.set(e,s),s.push(t),a.observe(e),function(){s.splice(s.indexOf(t),1),s.length===0&&(o.delete(e),a.unobserve(e)),o.size===0&&(a.disconnect(),c.delete(i))}}a.Component;function g({threshold:e,delay:t,trackVisibility:n,rootMargin:r,root:i,triggerOnce:o,skip:s,initialInView:c,fallbackInView:l,onChange:u}={}){let[d,f]=a.useState(null),p=a.useRef(u),m=a.useRef(c),[g,_]=a.useState({inView:!!c,entry:void 0});p.current=u,a.useEffect(()=>{if(m.current===void 0&&(m.current=c),s||!d)return;let a;return a=h(d,(e,t)=>{let n=m.current;m.current=e,!(n===void 0&&!e)&&(_({inView:e,entry:t}),p.current&&p.current(e,t),t.isIntersecting&&o&&a&&(a(),a=void 0))},{root:i,rootMargin:r,threshold:e,trackVisibility:n,delay:t},l),()=>{a&&a()}},[Array.isArray(e)?e.toString():e,d,i,r,o,s,n,l,t]);let v=g.entry?.target,y=a.useRef(void 0);!d&&v&&!o&&!s&&y.current!==v&&(y.current=v,_({inView:!!c,entry:void 0}),m.current=c);let b=[f,g.inView,g.entry];return b.ref=b[0],b.inView=b[1],b.entry=b[2],b}(`useInsertionEffect`in a?a.useInsertionEffect:void 0)??a.useLayoutEffect??a.useEffect;var _=({width:e,height:c,viewBox:l,className:u,playOnce:d,autoplay:f=!1,alterImgSrcOnLoad:p,lottieFileSrcPath:m})=>{let[h,_]=(0,a.useState)(null),v=(0,a.useRef)(null),y=(0,a.useRef)(i.uuid()),b=n.default(),{ref:x,inView:S}=g({threshold:b?.4:.9,rootMargin:b?`20% 0% 0% 0%`:`40% 0% 10% 0%`}),C=(0,a.useMemo)(()=>l?`${l.x??0} ${l.y??0} ${l.width} ${l.height}`:void 0,[l]),[w,T]=(0,a.useState)();return(0,a.useEffect)(()=>{fetch(m).then(e=>e.json()).then(e=>{_(e)}).catch(()=>{console.info(`lottie load 에 실패했습니다.`)})},[m]),(0,a.useEffect)(()=>{if(!(v.current&&h))return;let e=s.default.loadAnimation({container:v.current,renderer:`svg`,loop:!d,autoplay:f,animationData:h,rendererSettings:{viewBoxSize:C},name:u});return T(e),()=>e.destroy()},[h,u,f,d,C]),(0,a.useEffect)(()=>{S?w?.goToAndPlay(w?.currentFrame>.9*w?.totalFrames?0:w?.currentFrame,!0):d?w?.stop():w?.pause()},[S,w,d]),h===null&&p?(0,o.jsx)(`div`,{className:`flex items-center justify-center`,children:(0,o.jsx)(r.IconWithImage,{srcPath:p,width:e||0})}):(0,o.jsx)(`div`,{className:`w-full`,ref:x,children:(0,o.jsx)(`div`,{className:t.t(`flex`,u),id:y.current,ref:v,style:{width:e||void 0,height:c||void 0}})})};Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return _}});
|
|
@@ -1,161 +0,0 @@
|
|
|
1
|
-
import { t as e } from "./utils.D6DjRYW1.js";
|
|
2
|
-
import t from "../hooks/useLayoutIsMobile.esm.js";
|
|
3
|
-
import "../hooks/index.esm.js";
|
|
4
|
-
import { IconWithImage as n } from "../library/IconWithImage/index.esm.js";
|
|
5
|
-
import { uuid as r } from "../utils/uuid.util.esm.js";
|
|
6
|
-
import * as i from "react";
|
|
7
|
-
import { useEffect as a, useMemo as o, useRef as s, useState as c } from "react";
|
|
8
|
-
import { jsx as l } from "react/jsx-runtime";
|
|
9
|
-
import u from "lottie-web";
|
|
10
|
-
//#region node_modules/react-intersection-observer/dist/index.mjs
|
|
11
|
-
var d = /* @__PURE__ */ new Map(), f = /* @__PURE__ */ new WeakMap(), p = 0, m;
|
|
12
|
-
function h(e) {
|
|
13
|
-
return e ? f.has(e) ? f.get(e) : (p += 1, f.set(e, p.toString()), f.get(e)) : "0";
|
|
14
|
-
}
|
|
15
|
-
function g(e) {
|
|
16
|
-
return Object.keys(e).sort().filter((t) => e[t] !== void 0).map((t) => `${t}_${t === "root" ? h(e.root) : e[t]}`).toString();
|
|
17
|
-
}
|
|
18
|
-
function _(e) {
|
|
19
|
-
let t = g(e), n = d.get(t);
|
|
20
|
-
if (!n) {
|
|
21
|
-
let r = /* @__PURE__ */ new Map(), i, a = new IntersectionObserver((t) => {
|
|
22
|
-
t.forEach((t) => {
|
|
23
|
-
let n = t.isIntersecting && i.some((e) => t.intersectionRatio >= e);
|
|
24
|
-
e.trackVisibility && t.isVisible === void 0 && (t.isVisible = n), [...r.get(t.target) ?? []].forEach((e) => {
|
|
25
|
-
e(n, t);
|
|
26
|
-
});
|
|
27
|
-
});
|
|
28
|
-
}, e);
|
|
29
|
-
i = a.thresholds || (Array.isArray(e.threshold) ? e.threshold : [e.threshold || 0]), n = {
|
|
30
|
-
id: t,
|
|
31
|
-
observer: a,
|
|
32
|
-
elements: r
|
|
33
|
-
}, d.set(t, n);
|
|
34
|
-
}
|
|
35
|
-
return n;
|
|
36
|
-
}
|
|
37
|
-
function v(e, t, n = {}, r = m) {
|
|
38
|
-
if (window.IntersectionObserver === void 0 && r !== void 0) {
|
|
39
|
-
let i = e.getBoundingClientRect();
|
|
40
|
-
return t(r, {
|
|
41
|
-
isIntersecting: r,
|
|
42
|
-
target: e,
|
|
43
|
-
intersectionRatio: typeof n.threshold == "number" ? n.threshold : 0,
|
|
44
|
-
time: 0,
|
|
45
|
-
boundingClientRect: i,
|
|
46
|
-
intersectionRect: i,
|
|
47
|
-
rootBounds: i
|
|
48
|
-
}), () => {};
|
|
49
|
-
}
|
|
50
|
-
let { id: i, observer: a, elements: o } = _(n), s = o.get(e) || [];
|
|
51
|
-
return o.has(e) || o.set(e, s), s.push(t), a.observe(e), function() {
|
|
52
|
-
s.splice(s.indexOf(t), 1), s.length === 0 && (o.delete(e), a.unobserve(e)), o.size === 0 && (a.disconnect(), d.delete(i));
|
|
53
|
-
};
|
|
54
|
-
}
|
|
55
|
-
i.Component;
|
|
56
|
-
function y({ threshold: e, delay: t, trackVisibility: n, rootMargin: r, root: a, triggerOnce: o, skip: s, initialInView: c, fallbackInView: l, onChange: u } = {}) {
|
|
57
|
-
let [d, f] = i.useState(null), p = i.useRef(u), m = i.useRef(c), [h, g] = i.useState({
|
|
58
|
-
inView: !!c,
|
|
59
|
-
entry: void 0
|
|
60
|
-
});
|
|
61
|
-
p.current = u, i.useEffect(() => {
|
|
62
|
-
if (m.current === void 0 && (m.current = c), s || !d) return;
|
|
63
|
-
let i;
|
|
64
|
-
return i = v(d, (e, t) => {
|
|
65
|
-
let n = m.current;
|
|
66
|
-
m.current = e, !(n === void 0 && !e) && (g({
|
|
67
|
-
inView: e,
|
|
68
|
-
entry: t
|
|
69
|
-
}), p.current && p.current(e, t), t.isIntersecting && o && i && (i(), i = void 0));
|
|
70
|
-
}, {
|
|
71
|
-
root: a,
|
|
72
|
-
rootMargin: r,
|
|
73
|
-
threshold: e,
|
|
74
|
-
trackVisibility: n,
|
|
75
|
-
delay: t
|
|
76
|
-
}, l), () => {
|
|
77
|
-
i && i();
|
|
78
|
-
};
|
|
79
|
-
}, [
|
|
80
|
-
Array.isArray(e) ? e.toString() : e,
|
|
81
|
-
d,
|
|
82
|
-
a,
|
|
83
|
-
r,
|
|
84
|
-
o,
|
|
85
|
-
s,
|
|
86
|
-
n,
|
|
87
|
-
l,
|
|
88
|
-
t
|
|
89
|
-
]);
|
|
90
|
-
let _ = h.entry?.target, y = i.useRef(void 0);
|
|
91
|
-
!d && _ && !o && !s && y.current !== _ && (y.current = _, g({
|
|
92
|
-
inView: !!c,
|
|
93
|
-
entry: void 0
|
|
94
|
-
}), m.current = c);
|
|
95
|
-
let b = [
|
|
96
|
-
f,
|
|
97
|
-
h.inView,
|
|
98
|
-
h.entry
|
|
99
|
-
];
|
|
100
|
-
return b.ref = b[0], b.inView = b[1], b.entry = b[2], b;
|
|
101
|
-
}
|
|
102
|
-
("useInsertionEffect" in i ? i.useInsertionEffect : void 0) ?? i.useLayoutEffect ?? i.useEffect;
|
|
103
|
-
//#endregion
|
|
104
|
-
//#region src/library/Lottie/index.tsx
|
|
105
|
-
var b = ({ width: i, height: d, viewBox: f, className: p, playOnce: m, autoplay: h = !1, alterImgSrcOnLoad: g, lottieFileSrcPath: _ }) => {
|
|
106
|
-
let [v, b] = c(null), x = s(null), S = s(r()), C = t(), { ref: w, inView: T } = y({
|
|
107
|
-
threshold: C ? .4 : .9,
|
|
108
|
-
rootMargin: C ? "20% 0% 0% 0%" : "40% 0% 10% 0%"
|
|
109
|
-
}), E = o(() => f ? `${f.x ?? 0} ${f.y ?? 0} ${f.width} ${f.height}` : void 0, [f]), [D, O] = c();
|
|
110
|
-
return a(() => {
|
|
111
|
-
fetch(_).then((e) => e.json()).then((e) => {
|
|
112
|
-
b(e);
|
|
113
|
-
}).catch(() => {
|
|
114
|
-
console.info("lottie load 에 실패했습니다.");
|
|
115
|
-
});
|
|
116
|
-
}, [_]), a(() => {
|
|
117
|
-
if (!(x.current && v)) return;
|
|
118
|
-
let e = u.loadAnimation({
|
|
119
|
-
container: x.current,
|
|
120
|
-
renderer: "svg",
|
|
121
|
-
loop: !m,
|
|
122
|
-
autoplay: h,
|
|
123
|
-
animationData: v,
|
|
124
|
-
rendererSettings: { viewBoxSize: E },
|
|
125
|
-
name: p
|
|
126
|
-
});
|
|
127
|
-
return O(e), () => e.destroy();
|
|
128
|
-
}, [
|
|
129
|
-
v,
|
|
130
|
-
p,
|
|
131
|
-
h,
|
|
132
|
-
m,
|
|
133
|
-
E
|
|
134
|
-
]), a(() => {
|
|
135
|
-
T ? D?.goToAndPlay(D?.currentFrame > .9 * D?.totalFrames ? 0 : D?.currentFrame, !0) : m ? D?.stop() : D?.pause();
|
|
136
|
-
}, [
|
|
137
|
-
T,
|
|
138
|
-
D,
|
|
139
|
-
m
|
|
140
|
-
]), v === null && g ? /* @__PURE__ */ l("div", {
|
|
141
|
-
className: "flex items-center justify-center",
|
|
142
|
-
children: /* @__PURE__ */ l(n, {
|
|
143
|
-
srcPath: g,
|
|
144
|
-
width: i || 0
|
|
145
|
-
})
|
|
146
|
-
}) : /* @__PURE__ */ l("div", {
|
|
147
|
-
className: "w-full",
|
|
148
|
-
ref: w,
|
|
149
|
-
children: /* @__PURE__ */ l("div", {
|
|
150
|
-
className: e("flex", p),
|
|
151
|
-
id: S.current,
|
|
152
|
-
ref: x,
|
|
153
|
-
style: {
|
|
154
|
-
width: i || void 0,
|
|
155
|
-
height: d || void 0
|
|
156
|
-
}
|
|
157
|
-
})
|
|
158
|
-
});
|
|
159
|
-
};
|
|
160
|
-
//#endregion
|
|
161
|
-
export { b as t };
|