uplord-ui 0.1.32 → 0.2.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/.next/dev/types/validator.d.ts +1 -0
- package/dist/.next/types/validator.d.ts +1 -0
- package/dist/index.cjs.js +13 -1
- package/dist/index.css +1 -0
- package/dist/index.d.ts +2 -1
- package/dist/index.es.js +3341 -26
- package/dist/next.config.d.ts +3 -0
- package/dist/src/app/fonts.d.ts +2 -0
- package/dist/src/app/layout.d.ts +3 -0
- package/dist/src/app/page.d.ts +1 -0
- package/dist/src/components/Button/Button.d.ts +33 -0
- package/dist/src/components/Button/Button.stories.d.ts +11 -0
- package/dist/src/components/Button/index.d.ts +2 -0
- package/dist/src/components/Icon/Icon.d.ts +11 -0
- package/dist/src/components/Icon/Icon.stories.d.ts +6 -0
- package/dist/src/components/Icon/index.d.ts +2 -0
- package/dist/src/components/Test/Test.d.ts +1 -0
- package/dist/src/components/Test/index.d.ts +1 -0
- package/dist/src/context/NiceModalProvider.d.ts +4 -0
- package/dist/src/context/ThemeProvider.d.ts +7 -0
- package/dist/src/index.d.ts +2 -0
- package/dist/src/lib/color.d.ts +7 -0
- package/dist/src/lib/icons.d.ts +4 -0
- package/dist/src/types/block.d.ts +62 -0
- package/dist/src/types/system.d.ts +14 -0
- package/dist/tsconfig.build.tsbuildinfo +1 -0
- package/dist/vite.config.d.ts +2 -0
- package/package.json +35 -102
- package/dist/Rating-B0YCJQG5.js +0 -40571
- package/dist/Rating-tHGOSSCk.cjs +0 -7854
- package/dist/apple.png +0 -0
- package/dist/components/index.d.ts +0 -25
- package/dist/components.cjs.js +0 -1
- package/dist/components.es.js +0 -28
- package/dist/favicon.svg +0 -4
- package/dist/lib/index.d.ts +0 -2
- package/dist/lib.cjs.js +0 -1
- package/dist/lib.es.js +0 -332
- package/dist/styles/forward.scss +0 -3
- package/dist/styles/mixins.scss +0 -331
- package/dist/styles/typography.scss +0 -71
- package/dist/styles/variables.scss +0 -76
- package/dist/title.svg +0 -1
- package/dist/uplord-ui.css +0 -1
- package/dist/useMounted-DXrSfiau.cjs +0 -1
- package/dist/useMounted-L5oHFr3N.js +0 -11
package/dist/apple.png
DELETED
|
Binary file
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
export { Banner } from './blocks/Banner';
|
|
2
|
-
export { Projects } from './blocks/Projects';
|
|
3
|
-
export { Section } from './blocks/Section';
|
|
4
|
-
export { Stack } from './blocks/Stack';
|
|
5
|
-
export { Timeline } from './blocks/Timeline';
|
|
6
|
-
export { Card } from './main/Card';
|
|
7
|
-
export { Footer } from './main/Footer';
|
|
8
|
-
export { Header } from './main/Header';
|
|
9
|
-
export { Social } from './main/Social';
|
|
10
|
-
export { Pagination } from './navigation/Pagination';
|
|
11
|
-
export { Navbar } from './navigation/Navbar';
|
|
12
|
-
export { Button } from './ui/Button';
|
|
13
|
-
export { Checkbox } from './ui/Checkbox';
|
|
14
|
-
export { FormikInput } from './ui/FormikInput';
|
|
15
|
-
export { Input } from './ui/Input';
|
|
16
|
-
export { InputOtp } from './ui/InputOtp';
|
|
17
|
-
export { Radio } from './ui/Radio';
|
|
18
|
-
export { Select } from './ui/Select';
|
|
19
|
-
export { Textarea } from './ui/Textarea';
|
|
20
|
-
export { Accordion } from './utils/Accordian';
|
|
21
|
-
export { Alert } from './utils/Alert';
|
|
22
|
-
export { Icon } from './utils/Icon';
|
|
23
|
-
export { Logo } from './utils/Logo';
|
|
24
|
-
export { Modal } from './utils/Modal';
|
|
25
|
-
export { Rating } from './utils/Rating';
|
package/dist/components.cjs.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./Rating-tHGOSSCk.cjs");exports.Accordion=t.Accordion;exports.Alert=t.Alert;exports.Banner=t.Banner;exports.Button=t.Button;exports.Card=t.Card;exports.Checkbox=t.Checkbox;exports.Footer=t.Footer;exports.FormikInput=t.FormikInput;exports.Header=t.Header;exports.Icon=t.Icon;exports.Input=t.Input;exports.InputOtp=t.InputOtp;exports.Logo=t.Logo;exports.Modal=t.Modal;exports.Navbar=t.Navbar;exports.Pagination=t.Pagination;exports.Projects=t.Projects;exports.Radio=t.Radio;exports.Rating=t.Rating;exports.Section=t.Section;exports.Select=t.Select;exports.Social=t.Social;exports.Stack=t.Stack;exports.Textarea=t.Textarea;exports.Timeline=t.Timeline;
|
package/dist/components.es.js
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { A as o, j as e, B as t, d as n, C as r, e as i, F as c, f as d, H as l, k as p, I, g as S, L as g, M as k, N as u, c as b, P as m, R as x, l as A, S as B, h as C, b as F, a as P, i as R, T } from "./Rating-B0YCJQG5.js";
|
|
2
|
-
export {
|
|
3
|
-
o as Accordion,
|
|
4
|
-
e as Alert,
|
|
5
|
-
t as Banner,
|
|
6
|
-
n as Button,
|
|
7
|
-
r as Card,
|
|
8
|
-
i as Checkbox,
|
|
9
|
-
c as Footer,
|
|
10
|
-
d as FormikInput,
|
|
11
|
-
l as Header,
|
|
12
|
-
p as Icon,
|
|
13
|
-
I as Input,
|
|
14
|
-
S as InputOtp,
|
|
15
|
-
g as Logo,
|
|
16
|
-
k as Modal,
|
|
17
|
-
u as Navbar,
|
|
18
|
-
b as Pagination,
|
|
19
|
-
m as Projects,
|
|
20
|
-
x as Radio,
|
|
21
|
-
A as Rating,
|
|
22
|
-
B as Section,
|
|
23
|
-
C as Select,
|
|
24
|
-
F as Social,
|
|
25
|
-
P as Stack,
|
|
26
|
-
R as Textarea,
|
|
27
|
-
T as Timeline
|
|
28
|
-
};
|
package/dist/favicon.svg
DELETED
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
<svg width="40" height="40" viewBox="0 0 40 40" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
-
<rect width="40" height="40" rx="4" fill="#fff"/>
|
|
3
|
-
<path d="M9.794 29V10.8H13.98L19.544 22.162L25.056 10.8H29.242V29H25.732V16.78L20.922 26.452H18.14L13.304 16.78V29H9.794Z" fill="#dd2121"/>
|
|
4
|
-
</svg>
|
package/dist/lib/index.d.ts
DELETED
package/dist/lib.cjs.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("react"),T=require("./useMounted-DXrSfiau.cjs");var u=function(){return u=Object.assign||function(e){for(var r,o=1,n=arguments.length;o<n;o++){r=arguments[o];for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&(e[a]=r[a])}return e},u.apply(this,arguments)},j=function(e,r){var o={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&r.indexOf(n)<0&&(o[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var a=0,n=Object.getOwnPropertySymbols(e);a<n.length;a++)r.indexOf(n[a])<0&&Object.prototype.propertyIsEnumerable.call(e,n[a])&&(o[n[a]]=e[n[a]]);return o},I=Symbol("NiceModalId"),O={},h=i.createContext(O),H=i.createContext(null),v={},C={},F=0,g=function(){throw new Error("No dispatch method detected, did you embed your app with NiceModal.Provider?")},_=function(){return"_nice_modal_"+F++},S=function(e,r){var o,n,a;switch(e===void 0&&(e=O),r.type){case"nice-modal/show":{var d=r.payload,t=d.modalId,l=d.args;return u(u({},e),(o={},o[t]=u(u({},e[t]),{id:t,args:l,visible:!!C[t],delayVisible:!C[t]}),o))}case"nice-modal/hide":{var t=r.payload.modalId;return e[t]?u(u({},e),(n={},n[t]=u(u({},e[t]),{visible:!1}),n)):e}case"nice-modal/remove":{var t=r.payload.modalId,c=u({},e);return delete c[t],c}case"nice-modal/set-flags":{var f=r.payload,t=f.modalId,m=f.flags;return u(u({},e),(a={},a[t]=u(u({},e[t]),m),a))}default:return e}};function U(e){var r;return(r=v[e])===null||r===void 0?void 0:r.comp}function q(e,r){return{type:"nice-modal/show",payload:{modalId:e,args:r}}}function R(e,r){return{type:"nice-modal/set-flags",payload:{modalId:e,flags:r}}}function Y(e){return{type:"nice-modal/hide",payload:{modalId:e}}}function G(e){return{type:"nice-modal/remove",payload:{modalId:e}}}var p={},b={},k=function(e){return typeof e=="string"?e:(e[I]||(e[I]=_()),e[I])};function P(e,r){var o=k(e);if(typeof e!="string"&&!v[o]&&E(o,e),g(q(o,r)),!p[o]){var n,a,d=new Promise(function(t,l){n=t,a=l});p[o]={resolve:n,reject:a,promise:d}}return p[o].promise}function x(e){var r=k(e);if(g(Y(r)),delete p[r],!b[r]){var o,n,a=new Promise(function(d,t){o=d,n=t});b[r]={resolve:o,reject:n,promise:a}}return b[r].promise}var L=function(e){var r=k(e);g(G(r)),delete p[r],delete b[r]},J=function(e,r){g(R(e,r))};function V(e,r){var o=i.useContext(h),n=i.useContext(H),a=null,d=e&&typeof e!="string";if(e?a=k(e):a=n,!a)throw new Error("No modal id found in NiceModal.useModal.");var t=a;i.useEffect(function(){d&&!v[t]&&E(t,e,r)},[d,t,e,r]);var l=o[t],c=i.useCallback(function(M){return P(t,M)},[t]),f=i.useCallback(function(){return x(t)},[t]),m=i.useCallback(function(){return L(t)},[t]),w=i.useCallback(function(M){var s;(s=p[t])===null||s===void 0||s.resolve(M),delete p[t]},[t]),y=i.useCallback(function(M){var s;(s=p[t])===null||s===void 0||s.reject(M),delete p[t]},[t]),N=i.useCallback(function(M){var s;(s=b[t])===null||s===void 0||s.resolve(M),delete b[t]},[t]);return i.useMemo(function(){return{id:t,args:l==null?void 0:l.args,visible:!!(l!=null&&l.visible),keepMounted:!!(l!=null&&l.keepMounted),show:c,hide:f,remove:m,resolve:w,reject:y,resolveHide:N}},[t,l==null?void 0:l.args,l==null?void 0:l.visible,l==null?void 0:l.keepMounted,c,f,m,w,y,N])}var X=function(e){return function(r){var o,n=r.defaultVisible,a=r.keepMounted,d=r.id,t=j(r,["defaultVisible","keepMounted","id"]),l=V(d),c=l.args,f=l.show,m=i.useContext(h),w=!!m[d];i.useEffect(function(){return n&&f(),C[d]=!0,function(){delete C[d]}},[d,f,n]),i.useEffect(function(){a&&J(d,{keepMounted:!0})},[d,a]);var y=(o=m[d])===null||o===void 0?void 0:o.delayVisible;return i.useEffect(function(){y&&f(c)},[y,c,f]),w?i.createElement(H.Provider,{value:d},i.createElement(e,u({},t,c))):null}},E=function(e,r,o){v[e]?v[e].props=o:v[e]={comp:r,props:o}},z=function(e){delete v[e]},A=function(){var e=i.useContext(h),r=Object.keys(e).filter(function(n){return!!e[n]});r.forEach(function(n){if(!v[n]&&!C[n]){console.warn("No modal found for id: "+n+". Please check the id or if it is registered or declared via JSX.");return}});var o=r.filter(function(n){return v[n]}).map(function(n){return u({id:n},v[n])});return i.createElement(i.Fragment,null,o.map(function(n){return i.createElement(n.comp,u({key:n.id,id:n.id},n.props))}))},B=function(e){var r=e.children,o=i.useReducer(S,O),n=o[0];return g=o[1],i.createElement(h.Provider,{value:n},r,i.createElement(A,null))},K=function(e){var r=e.children,o=e.dispatch,n=e.modals;return!o||!n?i.createElement(B,null,r):(g=o,i.createElement(h.Provider,{value:n},r,i.createElement(A,null)))},Q=function(e){var r=e.id,o=e.component;return i.useEffect(function(){return E(r,o),function(){z(r)}},[r,o]),null},W=function(e){var r,o=e.modal,n=e.handler,a=n===void 0?{}:n,d=j(e,["modal","handler"]),t=i.useMemo(function(){return _()},[]),l=typeof o=="string"?(r=v[o])===null||r===void 0?void 0:r.comp:o;if(!a)throw new Error("No handler found in NiceModal.ModalHolder.");if(!l)throw new Error("No modal found for id: "+o+" in NiceModal.ModalHolder.");return a.show=i.useCallback(function(c){return P(t,c)},[t]),a.hide=i.useCallback(function(){return x(t)},[t]),i.createElement(l,u({id:t},d))},Z=function(e){return{visible:e.visible,onOk:function(){return e.hide()},onCancel:function(){return e.hide()},afterClose:function(){e.resolveHide(),e.keepMounted||e.remove()}}},$=function(e){return{visible:e.visible,onClose:function(){return e.hide()},afterVisibleChange:function(r){r||e.resolveHide(),!r&&!e.keepMounted&&e.remove()}}},ee=function(e){return{open:e.visible,onClose:function(){return e.hide()},onExited:function(){e.resolveHide(),!e.keepMounted&&e.remove()}}},re=function(e){return{show:e.visible,onHide:function(){return e.hide()},onExited:function(){e.resolveHide(),!e.keepMounted&&e.remove()}}},D={Provider:K,ModalDef:Q,ModalHolder:W,NiceModalContext:h,create:X,register:E,getModal:U,show:P,hide:x,remove:L,useModal:V,reducer:S,antdModal:Z,antdDrawer:$,muiDialog:ee,bootstrapDialog:re};const ne=()=>{const e=i.useContext(D.NiceModalContext),r=Object.keys(e).length>0;return i.useEffect(()=>{const o=()=>{Object.values(e).forEach(n=>D.remove(n.id))};return window.addEventListener("popstate",o),()=>{window.removeEventListener("popstate",o)}},[e]),i.useEffect(()=>(r?document.body.classList.add("stop-scroll"):document.body.classList.remove("stop-scroll"),()=>{document.body.classList.remove("stop-scroll")}),[r]),r};exports.useMounted=T.useMounted;exports.useModalData=ne;
|
package/dist/lib.es.js
DELETED
|
@@ -1,332 +0,0 @@
|
|
|
1
|
-
import u, { useContext as k, useEffect as b, useCallback as m, useMemo as L, useReducer as Y } from "react";
|
|
2
|
-
import { u as ce } from "./useMounted-L5oHFr3N.js";
|
|
3
|
-
var d = function() {
|
|
4
|
-
return d = Object.assign || function(e) {
|
|
5
|
-
for (var r, o = 1, n = arguments.length; o < n; o++) {
|
|
6
|
-
r = arguments[o];
|
|
7
|
-
for (var i in r) Object.prototype.hasOwnProperty.call(r, i) && (e[i] = r[i]);
|
|
8
|
-
}
|
|
9
|
-
return e;
|
|
10
|
-
}, d.apply(this, arguments);
|
|
11
|
-
}, S = function(e, r) {
|
|
12
|
-
var o = {};
|
|
13
|
-
for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && r.indexOf(n) < 0 && (o[n] = e[n]);
|
|
14
|
-
if (e != null && typeof Object.getOwnPropertySymbols == "function")
|
|
15
|
-
for (var i = 0, n = Object.getOwnPropertySymbols(e); i < n.length; i++)
|
|
16
|
-
r.indexOf(n[i]) < 0 && Object.prototype.propertyIsEnumerable.call(e, n[i]) && (o[n[i]] = e[n[i]]);
|
|
17
|
-
return o;
|
|
18
|
-
}, P = Symbol("NiceModalId"), x = {}, y = u.createContext(x), V = u.createContext(null), s = {}, C = {}, G = 0, w = function() {
|
|
19
|
-
throw new Error("No dispatch method detected, did you embed your app with NiceModal.Provider?");
|
|
20
|
-
}, A = function() {
|
|
21
|
-
return "_nice_modal_" + G++;
|
|
22
|
-
}, F = function(e, r) {
|
|
23
|
-
var o, n, i;
|
|
24
|
-
switch (e === void 0 && (e = x), r.type) {
|
|
25
|
-
case "nice-modal/show": {
|
|
26
|
-
var l = r.payload, t = l.modalId, a = l.args;
|
|
27
|
-
return d(d({}, e), (o = {}, o[t] = d(d({}, e[t]), {
|
|
28
|
-
id: t,
|
|
29
|
-
args: a,
|
|
30
|
-
// If modal is not mounted, mount it first then make it visible.
|
|
31
|
-
// There is logic inside HOC wrapper to make it visible after its first mount.
|
|
32
|
-
// This mechanism ensures the entering transition.
|
|
33
|
-
visible: !!C[t],
|
|
34
|
-
delayVisible: !C[t]
|
|
35
|
-
}), o));
|
|
36
|
-
}
|
|
37
|
-
case "nice-modal/hide": {
|
|
38
|
-
var t = r.payload.modalId;
|
|
39
|
-
return e[t] ? d(d({}, e), (n = {}, n[t] = d(d({}, e[t]), { visible: !1 }), n)) : e;
|
|
40
|
-
}
|
|
41
|
-
case "nice-modal/remove": {
|
|
42
|
-
var t = r.payload.modalId, c = d({}, e);
|
|
43
|
-
return delete c[t], c;
|
|
44
|
-
}
|
|
45
|
-
case "nice-modal/set-flags": {
|
|
46
|
-
var f = r.payload, t = f.modalId, h = f.flags;
|
|
47
|
-
return d(d({}, e), (i = {}, i[t] = d(d({}, e[t]), h), i));
|
|
48
|
-
}
|
|
49
|
-
default:
|
|
50
|
-
return e;
|
|
51
|
-
}
|
|
52
|
-
};
|
|
53
|
-
function J(e) {
|
|
54
|
-
var r;
|
|
55
|
-
return (r = s[e]) === null || r === void 0 ? void 0 : r.comp;
|
|
56
|
-
}
|
|
57
|
-
function X(e, r) {
|
|
58
|
-
return {
|
|
59
|
-
type: "nice-modal/show",
|
|
60
|
-
payload: {
|
|
61
|
-
modalId: e,
|
|
62
|
-
args: r
|
|
63
|
-
}
|
|
64
|
-
};
|
|
65
|
-
}
|
|
66
|
-
function q(e, r) {
|
|
67
|
-
return {
|
|
68
|
-
type: "nice-modal/set-flags",
|
|
69
|
-
payload: {
|
|
70
|
-
modalId: e,
|
|
71
|
-
flags: r
|
|
72
|
-
}
|
|
73
|
-
};
|
|
74
|
-
}
|
|
75
|
-
function z(e) {
|
|
76
|
-
return {
|
|
77
|
-
type: "nice-modal/hide",
|
|
78
|
-
payload: {
|
|
79
|
-
modalId: e
|
|
80
|
-
}
|
|
81
|
-
};
|
|
82
|
-
}
|
|
83
|
-
function B(e) {
|
|
84
|
-
return {
|
|
85
|
-
type: "nice-modal/remove",
|
|
86
|
-
payload: {
|
|
87
|
-
modalId: e
|
|
88
|
-
}
|
|
89
|
-
};
|
|
90
|
-
}
|
|
91
|
-
var p = {}, g = {}, O = function(e) {
|
|
92
|
-
return typeof e == "string" ? e : (e[P] || (e[P] = A()), e[P]);
|
|
93
|
-
};
|
|
94
|
-
function D(e, r) {
|
|
95
|
-
var o = O(e);
|
|
96
|
-
if (typeof e != "string" && !s[o] && N(o, e), w(X(o, r)), !p[o]) {
|
|
97
|
-
var n, i, l = new Promise(function(t, a) {
|
|
98
|
-
n = t, i = a;
|
|
99
|
-
});
|
|
100
|
-
p[o] = {
|
|
101
|
-
resolve: n,
|
|
102
|
-
reject: i,
|
|
103
|
-
promise: l
|
|
104
|
-
};
|
|
105
|
-
}
|
|
106
|
-
return p[o].promise;
|
|
107
|
-
}
|
|
108
|
-
function j(e) {
|
|
109
|
-
var r = O(e);
|
|
110
|
-
if (w(z(r)), delete p[r], !g[r]) {
|
|
111
|
-
var o, n, i = new Promise(function(l, t) {
|
|
112
|
-
o = l, n = t;
|
|
113
|
-
});
|
|
114
|
-
g[r] = {
|
|
115
|
-
resolve: o,
|
|
116
|
-
reject: n,
|
|
117
|
-
promise: i
|
|
118
|
-
};
|
|
119
|
-
}
|
|
120
|
-
return g[r].promise;
|
|
121
|
-
}
|
|
122
|
-
var T = function(e) {
|
|
123
|
-
var r = O(e);
|
|
124
|
-
w(B(r)), delete p[r], delete g[r];
|
|
125
|
-
}, K = function(e, r) {
|
|
126
|
-
w(q(e, r));
|
|
127
|
-
};
|
|
128
|
-
function U(e, r) {
|
|
129
|
-
var o = k(y), n = k(V), i = null, l = e && typeof e != "string";
|
|
130
|
-
if (e ? i = O(e) : i = n, !i)
|
|
131
|
-
throw new Error("No modal id found in NiceModal.useModal.");
|
|
132
|
-
var t = i;
|
|
133
|
-
b(function() {
|
|
134
|
-
l && !s[t] && N(t, e, r);
|
|
135
|
-
}, [l, t, e, r]);
|
|
136
|
-
var a = o[t], c = m(function(M) {
|
|
137
|
-
return D(t, M);
|
|
138
|
-
}, [t]), f = m(function() {
|
|
139
|
-
return j(t);
|
|
140
|
-
}, [t]), h = m(function() {
|
|
141
|
-
return T(t);
|
|
142
|
-
}, [t]), I = m(function(M) {
|
|
143
|
-
var v;
|
|
144
|
-
(v = p[t]) === null || v === void 0 || v.resolve(M), delete p[t];
|
|
145
|
-
}, [t]), E = m(function(M) {
|
|
146
|
-
var v;
|
|
147
|
-
(v = p[t]) === null || v === void 0 || v.reject(M), delete p[t];
|
|
148
|
-
}, [t]), _ = m(function(M) {
|
|
149
|
-
var v;
|
|
150
|
-
(v = g[t]) === null || v === void 0 || v.resolve(M), delete g[t];
|
|
151
|
-
}, [t]);
|
|
152
|
-
return L(function() {
|
|
153
|
-
return {
|
|
154
|
-
id: t,
|
|
155
|
-
args: a == null ? void 0 : a.args,
|
|
156
|
-
visible: !!(a != null && a.visible),
|
|
157
|
-
keepMounted: !!(a != null && a.keepMounted),
|
|
158
|
-
show: c,
|
|
159
|
-
hide: f,
|
|
160
|
-
remove: h,
|
|
161
|
-
resolve: I,
|
|
162
|
-
reject: E,
|
|
163
|
-
resolveHide: _
|
|
164
|
-
};
|
|
165
|
-
}, [
|
|
166
|
-
t,
|
|
167
|
-
a == null ? void 0 : a.args,
|
|
168
|
-
a == null ? void 0 : a.visible,
|
|
169
|
-
a == null ? void 0 : a.keepMounted,
|
|
170
|
-
c,
|
|
171
|
-
f,
|
|
172
|
-
h,
|
|
173
|
-
I,
|
|
174
|
-
E,
|
|
175
|
-
_
|
|
176
|
-
]);
|
|
177
|
-
}
|
|
178
|
-
var Q = function(e) {
|
|
179
|
-
return function(r) {
|
|
180
|
-
var o, n = r.defaultVisible, i = r.keepMounted, l = r.id, t = S(r, ["defaultVisible", "keepMounted", "id"]), a = U(l), c = a.args, f = a.show, h = k(y), I = !!h[l];
|
|
181
|
-
b(function() {
|
|
182
|
-
return n && f(), C[l] = !0, function() {
|
|
183
|
-
delete C[l];
|
|
184
|
-
};
|
|
185
|
-
}, [l, f, n]), b(function() {
|
|
186
|
-
i && K(l, { keepMounted: !0 });
|
|
187
|
-
}, [l, i]);
|
|
188
|
-
var E = (o = h[l]) === null || o === void 0 ? void 0 : o.delayVisible;
|
|
189
|
-
return b(function() {
|
|
190
|
-
E && f(c);
|
|
191
|
-
}, [E, c, f]), I ? u.createElement(
|
|
192
|
-
V.Provider,
|
|
193
|
-
{ value: l },
|
|
194
|
-
u.createElement(e, d({}, t, c))
|
|
195
|
-
) : null;
|
|
196
|
-
};
|
|
197
|
-
}, N = function(e, r, o) {
|
|
198
|
-
s[e] ? s[e].props = o : s[e] = { comp: r, props: o };
|
|
199
|
-
}, W = function(e) {
|
|
200
|
-
delete s[e];
|
|
201
|
-
}, R = function() {
|
|
202
|
-
var e = k(y), r = Object.keys(e).filter(function(n) {
|
|
203
|
-
return !!e[n];
|
|
204
|
-
});
|
|
205
|
-
r.forEach(function(n) {
|
|
206
|
-
if (!s[n] && !C[n]) {
|
|
207
|
-
console.warn("No modal found for id: " + n + ". Please check the id or if it is registered or declared via JSX.");
|
|
208
|
-
return;
|
|
209
|
-
}
|
|
210
|
-
});
|
|
211
|
-
var o = r.filter(function(n) {
|
|
212
|
-
return s[n];
|
|
213
|
-
}).map(function(n) {
|
|
214
|
-
return d({ id: n }, s[n]);
|
|
215
|
-
});
|
|
216
|
-
return u.createElement(u.Fragment, null, o.map(function(n) {
|
|
217
|
-
return u.createElement(n.comp, d({ key: n.id, id: n.id }, n.props));
|
|
218
|
-
}));
|
|
219
|
-
}, Z = function(e) {
|
|
220
|
-
var r = e.children, o = Y(F, x), n = o[0];
|
|
221
|
-
return w = o[1], u.createElement(
|
|
222
|
-
y.Provider,
|
|
223
|
-
{ value: n },
|
|
224
|
-
r,
|
|
225
|
-
u.createElement(R, null)
|
|
226
|
-
);
|
|
227
|
-
}, $ = function(e) {
|
|
228
|
-
var r = e.children, o = e.dispatch, n = e.modals;
|
|
229
|
-
return !o || !n ? u.createElement(Z, null, r) : (w = o, u.createElement(
|
|
230
|
-
y.Provider,
|
|
231
|
-
{ value: n },
|
|
232
|
-
r,
|
|
233
|
-
u.createElement(R, null)
|
|
234
|
-
));
|
|
235
|
-
}, ee = function(e) {
|
|
236
|
-
var r = e.id, o = e.component;
|
|
237
|
-
return b(function() {
|
|
238
|
-
return N(r, o), function() {
|
|
239
|
-
W(r);
|
|
240
|
-
};
|
|
241
|
-
}, [r, o]), null;
|
|
242
|
-
}, re = function(e) {
|
|
243
|
-
var r, o = e.modal, n = e.handler, i = n === void 0 ? {} : n, l = S(e, ["modal", "handler"]), t = L(function() {
|
|
244
|
-
return A();
|
|
245
|
-
}, []), a = typeof o == "string" ? (r = s[o]) === null || r === void 0 ? void 0 : r.comp : o;
|
|
246
|
-
if (!i)
|
|
247
|
-
throw new Error("No handler found in NiceModal.ModalHolder.");
|
|
248
|
-
if (!a)
|
|
249
|
-
throw new Error("No modal found for id: " + o + " in NiceModal.ModalHolder.");
|
|
250
|
-
return i.show = m(function(c) {
|
|
251
|
-
return D(t, c);
|
|
252
|
-
}, [t]), i.hide = m(function() {
|
|
253
|
-
return j(t);
|
|
254
|
-
}, [t]), u.createElement(a, d({ id: t }, l));
|
|
255
|
-
}, ne = function(e) {
|
|
256
|
-
return {
|
|
257
|
-
visible: e.visible,
|
|
258
|
-
onOk: function() {
|
|
259
|
-
return e.hide();
|
|
260
|
-
},
|
|
261
|
-
onCancel: function() {
|
|
262
|
-
return e.hide();
|
|
263
|
-
},
|
|
264
|
-
afterClose: function() {
|
|
265
|
-
e.resolveHide(), e.keepMounted || e.remove();
|
|
266
|
-
}
|
|
267
|
-
};
|
|
268
|
-
}, oe = function(e) {
|
|
269
|
-
return {
|
|
270
|
-
visible: e.visible,
|
|
271
|
-
onClose: function() {
|
|
272
|
-
return e.hide();
|
|
273
|
-
},
|
|
274
|
-
afterVisibleChange: function(r) {
|
|
275
|
-
r || e.resolveHide(), !r && !e.keepMounted && e.remove();
|
|
276
|
-
}
|
|
277
|
-
};
|
|
278
|
-
}, te = function(e) {
|
|
279
|
-
return {
|
|
280
|
-
open: e.visible,
|
|
281
|
-
onClose: function() {
|
|
282
|
-
return e.hide();
|
|
283
|
-
},
|
|
284
|
-
onExited: function() {
|
|
285
|
-
e.resolveHide(), !e.keepMounted && e.remove();
|
|
286
|
-
}
|
|
287
|
-
};
|
|
288
|
-
}, ie = function(e) {
|
|
289
|
-
return {
|
|
290
|
-
show: e.visible,
|
|
291
|
-
onHide: function() {
|
|
292
|
-
return e.hide();
|
|
293
|
-
},
|
|
294
|
-
onExited: function() {
|
|
295
|
-
e.resolveHide(), !e.keepMounted && e.remove();
|
|
296
|
-
}
|
|
297
|
-
};
|
|
298
|
-
}, H = {
|
|
299
|
-
Provider: $,
|
|
300
|
-
ModalDef: ee,
|
|
301
|
-
ModalHolder: re,
|
|
302
|
-
NiceModalContext: y,
|
|
303
|
-
create: Q,
|
|
304
|
-
register: N,
|
|
305
|
-
getModal: J,
|
|
306
|
-
show: D,
|
|
307
|
-
hide: j,
|
|
308
|
-
remove: T,
|
|
309
|
-
useModal: U,
|
|
310
|
-
reducer: F,
|
|
311
|
-
antdModal: ne,
|
|
312
|
-
antdDrawer: oe,
|
|
313
|
-
muiDialog: te,
|
|
314
|
-
bootstrapDialog: ie
|
|
315
|
-
};
|
|
316
|
-
const le = () => {
|
|
317
|
-
const e = k(H.NiceModalContext), r = Object.keys(e).length > 0;
|
|
318
|
-
return b(() => {
|
|
319
|
-
const o = () => {
|
|
320
|
-
Object.values(e).forEach((n) => H.remove(n.id));
|
|
321
|
-
};
|
|
322
|
-
return window.addEventListener("popstate", o), () => {
|
|
323
|
-
window.removeEventListener("popstate", o);
|
|
324
|
-
};
|
|
325
|
-
}, [e]), b(() => (r ? document.body.classList.add("stop-scroll") : document.body.classList.remove("stop-scroll"), () => {
|
|
326
|
-
document.body.classList.remove("stop-scroll");
|
|
327
|
-
}), [r]), r;
|
|
328
|
-
};
|
|
329
|
-
export {
|
|
330
|
-
le as useModalData,
|
|
331
|
-
ce as useMounted
|
|
332
|
-
};
|
package/dist/styles/forward.scss
DELETED