@mp-front/components 0.0.1-next-8 → 0.0.1-next-10
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/{classNames-EUcv3dqx.js → classNames-BiTpavcN.js} +2 -2
- package/dist/components/animation/count-up/count-up.component.d.ts +3 -0
- package/dist/components/animation/count-up/count-up.component.d.ts.map +1 -0
- package/dist/components/animation/count-up/count-up.stories.d.ts +15 -0
- package/dist/components/animation/count-up/count-up.stories.d.ts.map +1 -0
- package/dist/components/animation/count-up/count-up.test.d.ts +2 -0
- package/dist/components/animation/count-up/count-up.test.d.ts.map +1 -0
- package/dist/components/animation/count-up/count-up.types.d.ts +11 -0
- package/dist/components/animation/count-up/count-up.types.d.ts.map +1 -0
- package/dist/components/animation/index.d.ts +2 -0
- package/dist/components/animation/index.d.ts.map +1 -0
- package/dist/components/dropdown/dropdown.types.d.ts +1 -0
- package/dist/components/dropdown/dropdown.types.d.ts.map +1 -1
- package/dist/components/input/number/useInputNumber.d.ts +3 -2
- package/dist/components/input/number/useInputNumber.d.ts.map +1 -1
- package/dist/components/modal/{modal.overlay.d.ts → dialog.overlay.d.ts} +5 -6
- package/dist/components/modal/dialog.overlay.d.ts.map +1 -0
- package/dist/components/modal/dialog.types.d.ts +5 -0
- package/dist/components/modal/dialog.types.d.ts.map +1 -0
- package/dist/components/modal/modal.component.d.ts +4 -3
- package/dist/components/modal/modal.component.d.ts.map +1 -1
- package/dist/components/progress/progress.component.d.ts.map +1 -1
- package/dist/indeterminate-C7JUOCP0.cjs +1 -0
- package/dist/indeterminate-CSEeEKiJ.js +25 -0
- package/dist/index-DGDeDoym.cjs +17 -0
- package/dist/index-q_fyr_Rn.js +156 -0
- package/dist/interfaces/modal/index.d.ts +2 -0
- package/dist/interfaces/modal/index.d.ts.map +1 -1
- package/dist/layout/header/right-side.component.d.ts.map +1 -1
- package/dist/layout/header/store.component.d.ts.map +1 -1
- package/dist/layout/header/user.component.d.ts.map +1 -1
- package/dist/proxy-2cglvzJh.cjs +31 -0
- package/dist/proxy-uRb7Bek8.js +5497 -0
- package/dist/skeleton-avatar-8uHbPAra.cjs +1 -0
- package/dist/skeleton-avatar-Cp8o0kUa.js +20 -0
- package/dist/styles.css +2 -2
- package/dist/toggle-group.component-D2gEDqha.js +11259 -0
- package/dist/toggle-group.component-DoOPPzV2.cjs +80 -0
- package/dist/ui-components-animation.cjs +1 -0
- package/dist/ui-components-animation.js +416 -0
- package/dist/ui-components-hooks.cjs +1 -1
- package/dist/ui-components-hooks.js +16 -15
- package/dist/ui-components-icons.cjs +1 -1
- package/dist/ui-components-icons.js +24 -23
- package/dist/ui-components-index.cjs +3 -102
- package/dist/ui-components-index.js +3217 -19256
- package/dist/ui-components-layout.cjs +1 -131
- package/dist/ui-components-layout.js +1144 -21131
- package/dist/ui-components-utils.js +2 -2
- package/dist/use-controlled-state-CNjWcDSI.js +19 -0
- package/dist/use-controlled-state-Ci1ztv5B.cjs +1 -0
- package/dist/useTranslation-2Dz5dMlm.cjs +1 -0
- package/dist/useTranslation-B0fSob9I.js +189 -0
- package/package.json +3 -3
- package/dist/components/modal/modal.overlay.d.ts.map +0 -1
- package/dist/index-BP9HuXkV.cjs +0 -31
- package/dist/index-C0ENqrRs.js +0 -570
- package/dist/interfaces/animation/check-icon.d.ts +0 -5
- package/dist/interfaces/animation/check-icon.d.ts.map +0 -1
- package/dist/interfaces/animation/count-up.d.ts +0 -12
- package/dist/interfaces/animation/count-up.d.ts.map +0 -1
- package/dist/interfaces/animation/index.d.ts +0 -6
- package/dist/interfaces/animation/index.d.ts.map +0 -1
- package/dist/interfaces/animation/text-effect.d.ts +0 -25
- package/dist/interfaces/animation/text-effect.d.ts.map +0 -1
- package/dist/interfaces/animation/text-morph.d.ts +0 -10
- package/dist/interfaces/animation/text-morph.d.ts.map +0 -1
- package/dist/interfaces/animation/text-scramble.d.ts +0 -14
- package/dist/interfaces/animation/text-scramble.d.ts.map +0 -1
- package/dist/skeleton-avatar-BzklbqjK.js +0 -41
- package/dist/skeleton-avatar-Ce_osCsT.cjs +0 -1
- package/dist/use-controlled-state-FlR7N58L.js +0 -51
- package/dist/use-controlled-state-H7oMYjxi.cjs +0 -1
- package/dist/useTranslation-QicPQnlv.cjs +0 -1
- package/dist/useTranslation-tTfk6apO.js +0 -157
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("./proxy-2cglvzJh.cjs"),rt=require("./classNames-CN12fVA7.cjs"),B=require("react"),st=(t,e,n)=>{const r=e-t;return((n-t)%r+r)%r+t};function Y(t,e){return s.isEasingArray(t)?t[st(0,t.length,e)]:t}class it{constructor(e){this.stop=()=>this.runAll("stop"),this.animations=e.filter(Boolean)}get finished(){return Promise.all(this.animations.map(e=>e.finished))}getAll(e){return this.animations[0][e]}setAll(e,n){for(let r=0;r<this.animations.length;r++)this.animations[r][e]=n}attachTimeline(e){const n=this.animations.map(r=>r.attachTimeline(e));return()=>{n.forEach((r,i)=>{r&&r(),this.animations[i].stop()})}}get time(){return this.getAll("time")}set time(e){this.setAll("time",e)}get speed(){return this.getAll("speed")}set speed(e){this.setAll("speed",e)}get state(){return this.getAll("state")}get startTime(){return this.getAll("startTime")}get duration(){return z(this.animations,"duration")}get iterationDuration(){return z(this.animations,"iterationDuration")}runAll(e){this.animations.forEach(n=>n[e]())}play(){this.runAll("play")}pause(){this.runAll("pause")}cancel(){this.runAll("cancel")}complete(){this.runAll("complete")}}function z(t,e){let n=0;for(let r=0;r<t.length;r++){const i=t[r][e];i!==null&&i>n&&(n=i)}return n}class ot extends it{then(e,n){return this.finished.finally(e).then(()=>{})}}function at(...t){const e=!Array.isArray(t[0]),n=e?0:-1,r=t[0+n],i=t[1+n],l=t[2+n],o=t[3+n],a=s.interpolate(i,l,o);return e?a(r):a}function ut(t,e){return t in e}class lt extends s.VisualElement{constructor(){super(...arguments),this.type="object"}readValueFromInstance(e,n){if(ut(n,e)){const r=e[n];if(typeof r=="string"||typeof r=="number")return r}}getBaseTargetFromProps(){}removeValueFromRenderState(e,n){delete n.output[e]}measureInstanceViewportBox(){return s.createBox()}build(e,n){Object.assign(e.output,n)}renderInstance(e,{output:n}){Object.assign(e,n)}sortInstanceNodePosition(){return 0}}function Z(t){const e=s.useConstant(()=>s.motionValue(t)),{isStatic:n}=B.useContext(s.MotionConfigContext);if(n){const[,r]=B.useState(t);B.useEffect(()=>e.on("change",r),[])}return e}function $(t,e){const n=Z(e()),r=()=>n.set(e());return r(),s.useIsomorphicLayoutEffect(()=>{const i=()=>s.frame.preRender(r,!1,!0),l=t.map(o=>o.on("change",i));return()=>{l.forEach(o=>o()),s.cancelFrame(r)}}),n}function ct(t){s.collectMotionValues.current=[],t();const e=$(s.collectMotionValues.current,t);return s.collectMotionValues.current=void 0,e}function ft(t,e,n,r){if(typeof t=="function")return ct(t);const l=typeof e=="function"?e:at(e,n,r),o=Array.isArray(t)?k(t,l):k([t],([u])=>l(u)),a=Array.isArray(t)?void 0:t.accelerate;return a&&!a.isTransformed&&typeof e!="function"&&Array.isArray(n)&&(r==null?void 0:r.clamp)!==!1&&(o.accelerate={...a,times:e,keyframes:n,isTransformed:!0}),o}function k(t,e){const n=s.useConstant(()=>[]);return $(t,()=>{n.length=0;const r=t.length;for(let i=0;i<r;i++)n[i]=t[i].get();return e(n)})}function R(t){return typeof t=="object"&&!Array.isArray(t)}function tt(t,e,n,r){return t==null?[]:typeof t=="string"&&R(e)?s.resolveElements(t,n,r):t instanceof NodeList?Array.from(t):Array.isArray(t)?t.filter(i=>i!=null):[t]}function mt(t,e,n){return t*(e+1)}function H(t,e,n,r){return typeof e=="number"?e:e.startsWith("-")||e.startsWith("+")?Math.max(0,t+parseFloat(e)):e==="<"?n:e.startsWith("<")?Math.max(0,n+parseFloat(e.slice(1))):r.get(e)??t}function ht(t,e,n){for(let r=0;r<t.length;r++){const i=t[r];i.at>e&&i.at<n&&(s.removeItem(t,i),r--)}}function pt(t,e,n,r,i,l){ht(t,i,l);for(let o=0;o<e.length;o++)t.push({value:e[o],at:s.mixNumber(i,l,r[o]),easing:Y(n,o)})}function dt(t,e){for(let n=0;n<t.length;n++)t[n]=t[n]/(e+1)}function yt(t,e){return t.at===e.at?t.value===null?1:e.value===null?-1:0:t.at-e.at}const gt="easeInOut",At=20;function St(t,{defaultTransition:e={},...n}={},r,i){const l=e.duration||.3,o=new Map,a=new Map,u={},m=new Map;let h=0,f=0,L=0;for(let x=0;x<t.length;x++){const y=t[x];if(typeof y=="string"){m.set(y,f);continue}else if(!Array.isArray(y)){m.set(y.name,H(f,y.at,h,m));continue}let[M,g,p={}]=y;p.at!==void 0&&(f=H(f,p.at,h,m));let d=0;const T=(A,D,V,b=0,C=0)=>{const c=Et(A),{delay:I=0,times:S=s.defaultOffset(c),type:K=e.type||"keyframes",repeat:N,repeatType:Ft,repeatDelay:Gt=0,...nt}=D;let{ease:v=e.ease||"easeOut",duration:E}=D;const P=typeof I=="function"?I(b,C):I,W=c.length,_=s.isGenerator(K)?K:i==null?void 0:i[K||"keyframes"];if(W<=2&&_){let w=100;if(W===2&&Mt(c)){const F=c[1]-c[0];w=Math.abs(F)}const j={...e,...nt};E!==void 0&&(j.duration=s.secondsToMilliseconds(E));const O=s.createGeneratorEasing(j,w,_);v=O.ease,E=O.duration}E??(E=l);const q=f+P;S.length===1&&S[0]===0&&(S[1]=1);const U=S.length-c.length;if(U>0&&s.fillOffset(S,U),c.length===1&&c.unshift(null),N){s.invariant(N<At,"Repeat count too high, must be less than 20","repeat-count-high"),E=mt(E,N);const w=[...c],j=[...S];v=Array.isArray(v)?[...v]:[v];const O=[...v];for(let F=0;F<N;F++){c.push(...w);for(let G=0;G<w.length;G++)S.push(j[G]+(F+1)),v.push(G===0?"linear":Y(O,G-1))}dt(S,N)}const X=q+E;pt(V,c,v,S,q,X),d=Math.max(P+E,d),L=Math.max(X,L)};if(s.isMotionValue(M)){const A=J(M,a);T(g,p,Q("default",A))}else{const A=tt(M,g,r,u),D=A.length;for(let V=0;V<D;V++){g=g,p=p;const b=A[V],C=J(b,a);for(const c in g)T(g[c],Vt(p,c),Q(c,C),V,D)}}h=f,f+=d}return a.forEach((x,y)=>{for(const M in x){const g=x[M];g.sort(yt);const p=[],d=[],T=[];for(let b=0;b<g.length;b++){const{at:C,value:c,easing:I}=g[b];p.push(c),d.push(s.progress(0,L,C)),T.push(I||"easeOut")}d[0]!==0&&(d.unshift(0),p.unshift(p[0]),T.unshift(gt)),d[d.length-1]!==1&&(d.push(1),p.push(null)),o.has(y)||o.set(y,{keyframes:{},transition:{}});const A=o.get(y);A.keyframes[M]=p;const{type:D,...V}=e;A.transition[M]={...V,duration:L,ease:T,times:d,...n}}}),o}function J(t,e){return!e.has(t)&&e.set(t,{}),e.get(t)}function Q(t,e){return e[t]||(e[t]=[]),e[t]}function Et(t){return Array.isArray(t)?t:[t]}function Vt(t,e){return t&&t[e]?{...t,...t[e]}:{...t}}const vt=t=>typeof t=="number",Mt=t=>t.every(vt);function bt(t){const e={presenceContext:null,props:{},visualState:{renderState:{transform:{},transformOrigin:{},style:{},vars:{},attrs:{}},latestValues:{}}},n=s.isSVGElement(t)&&!s.isSVGSVGElement(t)?new s.SVGVisualElement(e):new s.HTMLVisualElement(e);n.mount(t),s.visualElementStore.set(t,n)}function xt(t){const e={presenceContext:null,props:{},visualState:{renderState:{output:{}},latestValues:{}}},n=new lt(e);n.mount(t),s.visualElementStore.set(t,n)}function Tt(t,e){return s.isMotionValue(t)||typeof t=="number"||typeof t=="string"&&!R(e)}function et(t,e,n,r){const i=[];if(Tt(t,e))i.push(s.animateSingleValue(t,R(e)&&e.default||e,n&&(n.default||n)));else{if(t==null)return i;const l=tt(t,e,r),o=l.length;s.invariant(!!o,"No valid elements provided.","no-valid-elements");for(let a=0;a<o;a++){const u=l[a],m=u instanceof Element?bt:xt;s.visualElementStore.has(u)||m(u);const h=s.visualElementStore.get(u),f={...n};"delay"in f&&typeof f.delay=="function"&&(f.delay=f.delay(a,o)),i.push(...s.animateTarget(h,{...e,transition:f},{}))}}return i}function Dt(t,e,n){const r=[],i=t.map(o=>{if(Array.isArray(o)&&typeof o[0]=="function"){const a=o[0],u=s.motionValue(0);return u.on("change",a),o.length===1?[u,[0,1]]:o.length===2?[u,[0,1],o[1]]:[u,o[1],o[2]]}return o});return St(i,e,n,{spring:s.spring}).forEach(({keyframes:o,transition:a},u)=>{r.push(...et(u,o,a))}),r}function Ct(t){return Array.isArray(t)&&t.some(Array.isArray)}function It(t={}){const{scope:e,reduceMotion:n}=t;function r(i,l,o){let a=[],u;if(Ct(i))a=Dt(i,n!==void 0?{reduceMotion:n,...l}:l,e);else{const{onComplete:h,...f}=o||{};typeof h=="function"&&(u=h),a=et(i,l,n!==void 0?{reduceMotion:n,...f}:f,e)}const m=new ot(a);return u&&m.finished.then(u),e&&(e.animations.push(m),m.finished.then(()=>{s.removeItem(e.animations,m)})),m}return r}const Nt=It(),wt=({to:t,className:e,from:n=0,duration:r=1,rounded:i=!1,style:l="decimal",onPlay:o,onComplete:a})=>{const u=Z(n),m=ft(u,h=>new Intl.NumberFormat("es-MX",{style:l,currency:"MXN"}).format(i?Math.round(h):h));return B.useEffect(()=>{const h=Nt(u,t,{duration:r,onPlay:o,onComplete:a});return()=>h.stop()},[m,u,t]),s.jsxRuntimeExports.jsx(s.motion.span,{className:rt.classNames("text-base",e),children:m})};exports.CountUp=wt;
|
|
@@ -0,0 +1,416 @@
|
|
|
1
|
+
import { i as lt, a as ct, V as ft, c as mt, u as Y, b as Z, M as ht, d as pt, e as dt, f as yt, g as O, r as gt, h as At, k as $, l as tt, n as St, o as Et, p as Vt, q as vt, s as Mt, t as et, v as bt, w as xt, x as Dt, S as Tt, H as Ct, y as B, z as It, A as wt, B as Nt, j as Ft, m as Gt } from "./proxy-uRb7Bek8.js";
|
|
2
|
+
import { c as Lt } from "./classNames-BiTpavcN.js";
|
|
3
|
+
import { useContext as jt, useState as Bt, useEffect as nt } from "react";
|
|
4
|
+
const Kt = (t, e, n) => {
|
|
5
|
+
const s = e - t;
|
|
6
|
+
return ((n - t) % s + s) % s + t;
|
|
7
|
+
};
|
|
8
|
+
function st(t, e) {
|
|
9
|
+
return lt(t) ? t[Kt(0, t.length, e)] : t;
|
|
10
|
+
}
|
|
11
|
+
class Ot {
|
|
12
|
+
constructor(e) {
|
|
13
|
+
this.stop = () => this.runAll("stop"), this.animations = e.filter(Boolean);
|
|
14
|
+
}
|
|
15
|
+
get finished() {
|
|
16
|
+
return Promise.all(this.animations.map((e) => e.finished));
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* TODO: Filter out cancelled or stopped animations before returning
|
|
20
|
+
*/
|
|
21
|
+
getAll(e) {
|
|
22
|
+
return this.animations[0][e];
|
|
23
|
+
}
|
|
24
|
+
setAll(e, n) {
|
|
25
|
+
for (let s = 0; s < this.animations.length; s++)
|
|
26
|
+
this.animations[s][e] = n;
|
|
27
|
+
}
|
|
28
|
+
attachTimeline(e) {
|
|
29
|
+
const n = this.animations.map((s) => s.attachTimeline(e));
|
|
30
|
+
return () => {
|
|
31
|
+
n.forEach((s, a) => {
|
|
32
|
+
s && s(), this.animations[a].stop();
|
|
33
|
+
});
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
get time() {
|
|
37
|
+
return this.getAll("time");
|
|
38
|
+
}
|
|
39
|
+
set time(e) {
|
|
40
|
+
this.setAll("time", e);
|
|
41
|
+
}
|
|
42
|
+
get speed() {
|
|
43
|
+
return this.getAll("speed");
|
|
44
|
+
}
|
|
45
|
+
set speed(e) {
|
|
46
|
+
this.setAll("speed", e);
|
|
47
|
+
}
|
|
48
|
+
get state() {
|
|
49
|
+
return this.getAll("state");
|
|
50
|
+
}
|
|
51
|
+
get startTime() {
|
|
52
|
+
return this.getAll("startTime");
|
|
53
|
+
}
|
|
54
|
+
get duration() {
|
|
55
|
+
return H(this.animations, "duration");
|
|
56
|
+
}
|
|
57
|
+
get iterationDuration() {
|
|
58
|
+
return H(this.animations, "iterationDuration");
|
|
59
|
+
}
|
|
60
|
+
runAll(e) {
|
|
61
|
+
this.animations.forEach((n) => n[e]());
|
|
62
|
+
}
|
|
63
|
+
play() {
|
|
64
|
+
this.runAll("play");
|
|
65
|
+
}
|
|
66
|
+
pause() {
|
|
67
|
+
this.runAll("pause");
|
|
68
|
+
}
|
|
69
|
+
cancel() {
|
|
70
|
+
this.runAll("cancel");
|
|
71
|
+
}
|
|
72
|
+
complete() {
|
|
73
|
+
this.runAll("complete");
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
function H(t, e) {
|
|
77
|
+
let n = 0;
|
|
78
|
+
for (let s = 0; s < t.length; s++) {
|
|
79
|
+
const a = t[s][e];
|
|
80
|
+
a !== null && a > n && (n = a);
|
|
81
|
+
}
|
|
82
|
+
return n;
|
|
83
|
+
}
|
|
84
|
+
class Rt extends Ot {
|
|
85
|
+
then(e, n) {
|
|
86
|
+
return this.finished.finally(e).then(() => {
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
function Pt(...t) {
|
|
91
|
+
const e = !Array.isArray(t[0]), n = e ? 0 : -1, s = t[0 + n], a = t[1 + n], u = t[2 + n], r = t[3 + n], i = ct(a, u, r);
|
|
92
|
+
return e ? i(s) : i;
|
|
93
|
+
}
|
|
94
|
+
function Wt(t, e) {
|
|
95
|
+
return t in e;
|
|
96
|
+
}
|
|
97
|
+
class _t extends ft {
|
|
98
|
+
constructor() {
|
|
99
|
+
super(...arguments), this.type = "object";
|
|
100
|
+
}
|
|
101
|
+
readValueFromInstance(e, n) {
|
|
102
|
+
if (Wt(n, e)) {
|
|
103
|
+
const s = e[n];
|
|
104
|
+
if (typeof s == "string" || typeof s == "number")
|
|
105
|
+
return s;
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
getBaseTargetFromProps() {
|
|
109
|
+
}
|
|
110
|
+
removeValueFromRenderState(e, n) {
|
|
111
|
+
delete n.output[e];
|
|
112
|
+
}
|
|
113
|
+
measureInstanceViewportBox() {
|
|
114
|
+
return mt();
|
|
115
|
+
}
|
|
116
|
+
build(e, n) {
|
|
117
|
+
Object.assign(e.output, n);
|
|
118
|
+
}
|
|
119
|
+
renderInstance(e, { output: n }) {
|
|
120
|
+
Object.assign(e, n);
|
|
121
|
+
}
|
|
122
|
+
sortInstanceNodePosition() {
|
|
123
|
+
return 0;
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
function at(t) {
|
|
127
|
+
const e = Y(() => Z(t)), { isStatic: n } = jt(ht);
|
|
128
|
+
if (n) {
|
|
129
|
+
const [, s] = Bt(t);
|
|
130
|
+
nt(() => e.on("change", s), []);
|
|
131
|
+
}
|
|
132
|
+
return e;
|
|
133
|
+
}
|
|
134
|
+
function rt(t, e) {
|
|
135
|
+
const n = at(e()), s = () => n.set(e());
|
|
136
|
+
return s(), pt(() => {
|
|
137
|
+
const a = () => yt.preRender(s, !1, !0), u = t.map((r) => r.on("change", a));
|
|
138
|
+
return () => {
|
|
139
|
+
u.forEach((r) => r()), dt(s);
|
|
140
|
+
};
|
|
141
|
+
}), n;
|
|
142
|
+
}
|
|
143
|
+
function zt(t) {
|
|
144
|
+
O.current = [], t();
|
|
145
|
+
const e = rt(O.current, t);
|
|
146
|
+
return O.current = void 0, e;
|
|
147
|
+
}
|
|
148
|
+
function Xt(t, e, n, s) {
|
|
149
|
+
if (typeof t == "function")
|
|
150
|
+
return zt(t);
|
|
151
|
+
const u = typeof e == "function" ? e : Pt(e, n, s), r = Array.isArray(t) ? U(t, u) : U([t], ([o]) => u(o)), i = Array.isArray(t) ? void 0 : t.accelerate;
|
|
152
|
+
return i && !i.isTransformed && typeof e != "function" && Array.isArray(n) && (s == null ? void 0 : s.clamp) !== !1 && (r.accelerate = {
|
|
153
|
+
...i,
|
|
154
|
+
times: e,
|
|
155
|
+
keyframes: n,
|
|
156
|
+
isTransformed: !0
|
|
157
|
+
}), r;
|
|
158
|
+
}
|
|
159
|
+
function U(t, e) {
|
|
160
|
+
const n = Y(() => []);
|
|
161
|
+
return rt(t, () => {
|
|
162
|
+
n.length = 0;
|
|
163
|
+
const s = t.length;
|
|
164
|
+
for (let a = 0; a < s; a++)
|
|
165
|
+
n[a] = t[a].get();
|
|
166
|
+
return e(n);
|
|
167
|
+
});
|
|
168
|
+
}
|
|
169
|
+
function R(t) {
|
|
170
|
+
return typeof t == "object" && !Array.isArray(t);
|
|
171
|
+
}
|
|
172
|
+
function it(t, e, n, s) {
|
|
173
|
+
return t == null ? [] : typeof t == "string" && R(e) ? gt(t, n, s) : t instanceof NodeList ? Array.from(t) : Array.isArray(t) ? t.filter((a) => a != null) : [t];
|
|
174
|
+
}
|
|
175
|
+
function kt(t, e, n) {
|
|
176
|
+
return t * (e + 1);
|
|
177
|
+
}
|
|
178
|
+
function q(t, e, n, s) {
|
|
179
|
+
return typeof e == "number" ? e : e.startsWith("-") || e.startsWith("+") ? Math.max(0, t + parseFloat(e)) : e === "<" ? n : e.startsWith("<") ? Math.max(0, n + parseFloat(e.slice(1))) : s.get(e) ?? t;
|
|
180
|
+
}
|
|
181
|
+
function Ht(t, e, n) {
|
|
182
|
+
for (let s = 0; s < t.length; s++) {
|
|
183
|
+
const a = t[s];
|
|
184
|
+
a.at > e && a.at < n && ($(t, a), s--);
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
function Ut(t, e, n, s, a, u) {
|
|
188
|
+
Ht(t, a, u);
|
|
189
|
+
for (let r = 0; r < e.length; r++)
|
|
190
|
+
t.push({
|
|
191
|
+
value: e[r],
|
|
192
|
+
at: At(a, u, s[r]),
|
|
193
|
+
easing: st(n, r)
|
|
194
|
+
});
|
|
195
|
+
}
|
|
196
|
+
function qt(t, e) {
|
|
197
|
+
for (let n = 0; n < t.length; n++)
|
|
198
|
+
t[n] = t[n] / (e + 1);
|
|
199
|
+
}
|
|
200
|
+
function Jt(t, e) {
|
|
201
|
+
return t.at === e.at ? t.value === null ? 1 : e.value === null ? -1 : 0 : t.at - e.at;
|
|
202
|
+
}
|
|
203
|
+
const Qt = "easeInOut", Yt = 20;
|
|
204
|
+
function Zt(t, { defaultTransition: e = {}, ...n } = {}, s, a) {
|
|
205
|
+
const u = e.duration || 0.3, r = /* @__PURE__ */ new Map(), i = /* @__PURE__ */ new Map(), o = {}, f = /* @__PURE__ */ new Map();
|
|
206
|
+
let m = 0, c = 0, G = 0;
|
|
207
|
+
for (let b = 0; b < t.length; b++) {
|
|
208
|
+
const d = t[b];
|
|
209
|
+
if (typeof d == "string") {
|
|
210
|
+
f.set(d, c);
|
|
211
|
+
continue;
|
|
212
|
+
} else if (!Array.isArray(d)) {
|
|
213
|
+
f.set(d.name, q(c, d.at, m, f));
|
|
214
|
+
continue;
|
|
215
|
+
}
|
|
216
|
+
let [v, y, h = {}] = d;
|
|
217
|
+
h.at !== void 0 && (c = q(c, h.at, m, f));
|
|
218
|
+
let p = 0;
|
|
219
|
+
const x = (g, D, E, M = 0, T = 0) => {
|
|
220
|
+
const l = $t(g), { delay: C = 0, times: A = St(l), type: K = e.type || "keyframes", repeat: I, repeatType: ce, repeatDelay: fe = 0, ...ut } = D;
|
|
221
|
+
let { ease: V = e.ease || "easeOut", duration: S } = D;
|
|
222
|
+
const P = typeof C == "function" ? C(M, T) : C, W = l.length, _ = vt(K) ? K : a == null ? void 0 : a[K || "keyframes"];
|
|
223
|
+
if (W <= 2 && _) {
|
|
224
|
+
let w = 100;
|
|
225
|
+
if (W === 2 && ne(l)) {
|
|
226
|
+
const N = l[1] - l[0];
|
|
227
|
+
w = Math.abs(N);
|
|
228
|
+
}
|
|
229
|
+
const L = {
|
|
230
|
+
...e,
|
|
231
|
+
...ut
|
|
232
|
+
};
|
|
233
|
+
S !== void 0 && (L.duration = Mt(S));
|
|
234
|
+
const j = Et(L, w, _);
|
|
235
|
+
V = j.ease, S = j.duration;
|
|
236
|
+
}
|
|
237
|
+
S ?? (S = u);
|
|
238
|
+
const z = c + P;
|
|
239
|
+
A.length === 1 && A[0] === 0 && (A[1] = 1);
|
|
240
|
+
const X = A.length - l.length;
|
|
241
|
+
if (X > 0 && Vt(A, X), l.length === 1 && l.unshift(null), I) {
|
|
242
|
+
et(I < Yt, "Repeat count too high, must be less than 20", "repeat-count-high"), S = kt(S, I);
|
|
243
|
+
const w = [...l], L = [...A];
|
|
244
|
+
V = Array.isArray(V) ? [...V] : [V];
|
|
245
|
+
const j = [...V];
|
|
246
|
+
for (let N = 0; N < I; N++) {
|
|
247
|
+
l.push(...w);
|
|
248
|
+
for (let F = 0; F < w.length; F++)
|
|
249
|
+
A.push(L[F] + (N + 1)), V.push(F === 0 ? "linear" : st(j, F - 1));
|
|
250
|
+
}
|
|
251
|
+
qt(A, I);
|
|
252
|
+
}
|
|
253
|
+
const k = z + S;
|
|
254
|
+
Ut(E, l, V, A, z, k), p = Math.max(P + S, p), G = Math.max(k, G);
|
|
255
|
+
};
|
|
256
|
+
if (tt(v)) {
|
|
257
|
+
const g = J(v, i);
|
|
258
|
+
x(y, h, Q("default", g));
|
|
259
|
+
} else {
|
|
260
|
+
const g = it(v, y, s, o), D = g.length;
|
|
261
|
+
for (let E = 0; E < D; E++) {
|
|
262
|
+
y = y, h = h;
|
|
263
|
+
const M = g[E], T = J(M, i);
|
|
264
|
+
for (const l in y)
|
|
265
|
+
x(y[l], te(h, l), Q(l, T), E, D);
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
m = c, c += p;
|
|
269
|
+
}
|
|
270
|
+
return i.forEach((b, d) => {
|
|
271
|
+
for (const v in b) {
|
|
272
|
+
const y = b[v];
|
|
273
|
+
y.sort(Jt);
|
|
274
|
+
const h = [], p = [], x = [];
|
|
275
|
+
for (let M = 0; M < y.length; M++) {
|
|
276
|
+
const { at: T, value: l, easing: C } = y[M];
|
|
277
|
+
h.push(l), p.push(bt(0, G, T)), x.push(C || "easeOut");
|
|
278
|
+
}
|
|
279
|
+
p[0] !== 0 && (p.unshift(0), h.unshift(h[0]), x.unshift(Qt)), p[p.length - 1] !== 1 && (p.push(1), h.push(null)), r.has(d) || r.set(d, {
|
|
280
|
+
keyframes: {},
|
|
281
|
+
transition: {}
|
|
282
|
+
});
|
|
283
|
+
const g = r.get(d);
|
|
284
|
+
g.keyframes[v] = h;
|
|
285
|
+
const { type: D, ...E } = e;
|
|
286
|
+
g.transition[v] = {
|
|
287
|
+
...E,
|
|
288
|
+
duration: G,
|
|
289
|
+
ease: x,
|
|
290
|
+
times: p,
|
|
291
|
+
...n
|
|
292
|
+
};
|
|
293
|
+
}
|
|
294
|
+
}), r;
|
|
295
|
+
}
|
|
296
|
+
function J(t, e) {
|
|
297
|
+
return !e.has(t) && e.set(t, {}), e.get(t);
|
|
298
|
+
}
|
|
299
|
+
function Q(t, e) {
|
|
300
|
+
return e[t] || (e[t] = []), e[t];
|
|
301
|
+
}
|
|
302
|
+
function $t(t) {
|
|
303
|
+
return Array.isArray(t) ? t : [t];
|
|
304
|
+
}
|
|
305
|
+
function te(t, e) {
|
|
306
|
+
return t && t[e] ? {
|
|
307
|
+
...t,
|
|
308
|
+
...t[e]
|
|
309
|
+
} : { ...t };
|
|
310
|
+
}
|
|
311
|
+
const ee = (t) => typeof t == "number", ne = (t) => t.every(ee);
|
|
312
|
+
function se(t) {
|
|
313
|
+
const e = {
|
|
314
|
+
presenceContext: null,
|
|
315
|
+
props: {},
|
|
316
|
+
visualState: {
|
|
317
|
+
renderState: {
|
|
318
|
+
transform: {},
|
|
319
|
+
transformOrigin: {},
|
|
320
|
+
style: {},
|
|
321
|
+
vars: {},
|
|
322
|
+
attrs: {}
|
|
323
|
+
},
|
|
324
|
+
latestValues: {}
|
|
325
|
+
}
|
|
326
|
+
}, n = xt(t) && !Dt(t) ? new Tt(e) : new Ct(e);
|
|
327
|
+
n.mount(t), B.set(t, n);
|
|
328
|
+
}
|
|
329
|
+
function ae(t) {
|
|
330
|
+
const e = {
|
|
331
|
+
presenceContext: null,
|
|
332
|
+
props: {},
|
|
333
|
+
visualState: {
|
|
334
|
+
renderState: {
|
|
335
|
+
output: {}
|
|
336
|
+
},
|
|
337
|
+
latestValues: {}
|
|
338
|
+
}
|
|
339
|
+
}, n = new _t(e);
|
|
340
|
+
n.mount(t), B.set(t, n);
|
|
341
|
+
}
|
|
342
|
+
function re(t, e) {
|
|
343
|
+
return tt(t) || typeof t == "number" || typeof t == "string" && !R(e);
|
|
344
|
+
}
|
|
345
|
+
function ot(t, e, n, s) {
|
|
346
|
+
const a = [];
|
|
347
|
+
if (re(t, e))
|
|
348
|
+
a.push(It(t, R(e) && e.default || e, n && (n.default || n)));
|
|
349
|
+
else {
|
|
350
|
+
if (t == null)
|
|
351
|
+
return a;
|
|
352
|
+
const u = it(t, e, s), r = u.length;
|
|
353
|
+
et(!!r, "No valid elements provided.", "no-valid-elements");
|
|
354
|
+
for (let i = 0; i < r; i++) {
|
|
355
|
+
const o = u[i], f = o instanceof Element ? se : ae;
|
|
356
|
+
B.has(o) || f(o);
|
|
357
|
+
const m = B.get(o), c = { ...n };
|
|
358
|
+
"delay" in c && typeof c.delay == "function" && (c.delay = c.delay(i, r)), a.push(...wt(m, { ...e, transition: c }, {}));
|
|
359
|
+
}
|
|
360
|
+
}
|
|
361
|
+
return a;
|
|
362
|
+
}
|
|
363
|
+
function ie(t, e, n) {
|
|
364
|
+
const s = [], a = t.map((r) => {
|
|
365
|
+
if (Array.isArray(r) && typeof r[0] == "function") {
|
|
366
|
+
const i = r[0], o = Z(0);
|
|
367
|
+
return o.on("change", i), r.length === 1 ? [o, [0, 1]] : r.length === 2 ? [o, [0, 1], r[1]] : [o, r[1], r[2]];
|
|
368
|
+
}
|
|
369
|
+
return r;
|
|
370
|
+
});
|
|
371
|
+
return Zt(a, e, n, { spring: Nt }).forEach(({ keyframes: r, transition: i }, o) => {
|
|
372
|
+
s.push(...ot(o, r, i));
|
|
373
|
+
}), s;
|
|
374
|
+
}
|
|
375
|
+
function oe(t) {
|
|
376
|
+
return Array.isArray(t) && t.some(Array.isArray);
|
|
377
|
+
}
|
|
378
|
+
function ue(t = {}) {
|
|
379
|
+
const { scope: e, reduceMotion: n } = t;
|
|
380
|
+
function s(a, u, r) {
|
|
381
|
+
let i = [], o;
|
|
382
|
+
if (oe(a))
|
|
383
|
+
i = ie(a, n !== void 0 ? { reduceMotion: n, ...u } : u, e);
|
|
384
|
+
else {
|
|
385
|
+
const { onComplete: m, ...c } = r || {};
|
|
386
|
+
typeof m == "function" && (o = m), i = ot(a, u, n !== void 0 ? { reduceMotion: n, ...c } : c, e);
|
|
387
|
+
}
|
|
388
|
+
const f = new Rt(i);
|
|
389
|
+
return o && f.finished.then(o), e && (e.animations.push(f), f.finished.then(() => {
|
|
390
|
+
$(e.animations, f);
|
|
391
|
+
})), f;
|
|
392
|
+
}
|
|
393
|
+
return s;
|
|
394
|
+
}
|
|
395
|
+
const le = ue(), de = ({
|
|
396
|
+
to: t,
|
|
397
|
+
className: e,
|
|
398
|
+
from: n = 0,
|
|
399
|
+
duration: s = 1,
|
|
400
|
+
rounded: a = !1,
|
|
401
|
+
style: u = "decimal",
|
|
402
|
+
onPlay: r,
|
|
403
|
+
onComplete: i
|
|
404
|
+
}) => {
|
|
405
|
+
const o = at(n), f = Xt(o, (m) => new Intl.NumberFormat("es-MX", {
|
|
406
|
+
style: u,
|
|
407
|
+
currency: "MXN"
|
|
408
|
+
}).format(a ? Math.round(m) : m));
|
|
409
|
+
return nt(() => {
|
|
410
|
+
const m = le(o, t, { duration: s, onPlay: r, onComplete: i });
|
|
411
|
+
return () => m.stop();
|
|
412
|
+
}, [f, o, t]), /* @__PURE__ */ Ft.jsx(Gt.span, { className: Lt("text-base", e), children: f });
|
|
413
|
+
};
|
|
414
|
+
export {
|
|
415
|
+
de as CountUp
|
|
416
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./index-DGDeDoym.cjs"),a=require("react"),d=require("./useTranslation-2Dz5dMlm.cjs"),l=require("./use-controlled-state-Ci1ztv5B.cjs"),u=()=>{const n=typeof window<"u"?localStorage.getItem("theme")==="dark":"light",[e,o]=a.useState(n);return a.useEffect(()=>{e?(document.documentElement.classList.add("dark"),localStorage.setItem("theme","dark")):(document.documentElement.classList.remove("dark"),localStorage.setItem("theme","light"))},[e]),{darkMode:e,setDarkMode:o}},i=()=>{const{i18n:{changeLanguage:n,language:e}}=d.useTranslation(),o=t=>{n(t),localStorage.setItem("lang",t)};return a.useEffect(()=>{const t=localStorage.getItem("lang");n(t||e)},[]),{language:e,setLang:o}},c=n=>{const[e,o]=a.useState(!1);return a.useEffect(()=>{if(n){const t=()=>o(!1),s=()=>o(!0);return window.addEventListener("load",t),window.addEventListener("beforeunload",s),()=>{window.removeEventListener("load",t),window.removeEventListener("beforeunload",s)}}},[]),e};exports.useBreakpoint=r.useBreakpoint;exports.useControlledState=l.useControlledState;exports.useDarkMode=u;exports.useLang=i;exports.useWindowLoading=c;
|
|
@@ -1,26 +1,27 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { useState as s, useEffect as
|
|
3
|
-
import { u as d } from "./useTranslation-
|
|
1
|
+
import { u as L } from "./index-q_fyr_Rn.js";
|
|
2
|
+
import { useState as s, useEffect as a } from "react";
|
|
3
|
+
import { u as d } from "./useTranslation-B0fSob9I.js";
|
|
4
|
+
import { u as k } from "./use-controlled-state-CNjWcDSI.js";
|
|
4
5
|
const c = () => {
|
|
5
|
-
const o = typeof window < "u" ? localStorage.getItem("theme") === "dark" : "light", [e,
|
|
6
|
-
return
|
|
6
|
+
const o = typeof window < "u" ? localStorage.getItem("theme") === "dark" : "light", [e, n] = s(o);
|
|
7
|
+
return a(() => {
|
|
7
8
|
e ? (document.documentElement.classList.add("dark"), localStorage.setItem("theme", "dark")) : (document.documentElement.classList.remove("dark"), localStorage.setItem("theme", "light"));
|
|
8
|
-
}, [e]), { darkMode: e, setDarkMode:
|
|
9
|
+
}, [e]), { darkMode: e, setDarkMode: n };
|
|
9
10
|
}, u = () => {
|
|
10
11
|
const {
|
|
11
12
|
i18n: { changeLanguage: o, language: e }
|
|
12
|
-
} = d(),
|
|
13
|
+
} = d(), n = (t) => {
|
|
13
14
|
o(t), localStorage.setItem("lang", t);
|
|
14
15
|
};
|
|
15
|
-
return
|
|
16
|
+
return a(() => {
|
|
16
17
|
const t = localStorage.getItem("lang");
|
|
17
18
|
o(t || e);
|
|
18
|
-
}, []), { language: e, setLang:
|
|
19
|
-
},
|
|
20
|
-
const [e,
|
|
21
|
-
return
|
|
19
|
+
}, []), { language: e, setLang: n };
|
|
20
|
+
}, m = (o) => {
|
|
21
|
+
const [e, n] = s(!1);
|
|
22
|
+
return a(() => {
|
|
22
23
|
if (o) {
|
|
23
|
-
const t = () =>
|
|
24
|
+
const t = () => n(!1), r = () => n(!0);
|
|
24
25
|
return window.addEventListener("load", t), window.addEventListener("beforeunload", r), () => {
|
|
25
26
|
window.removeEventListener("load", t), window.removeEventListener("beforeunload", r);
|
|
26
27
|
};
|
|
@@ -29,8 +30,8 @@ const c = () => {
|
|
|
29
30
|
};
|
|
30
31
|
export {
|
|
31
32
|
L as useBreakpoint,
|
|
32
|
-
|
|
33
|
+
k as useControlledState,
|
|
33
34
|
c as useDarkMode,
|
|
34
35
|
u as useLang,
|
|
35
|
-
|
|
36
|
+
m as useWindowLoading
|
|
36
37
|
};
|