@nice2dev/ui 1.0.11 → 1.0.14
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/CHANGELOG.md +28 -0
- package/README.md +61 -0
- package/css/legacy-bg-text-aliases.css +83 -0
- package/dist/NiceErrorBoundary-BLTq8mPU.cjs +1 -0
- package/dist/NiceErrorBoundary-Bjw5U31n.js +762 -0
- package/dist/NiceErrorBoundary-DT5XPTeu.cjs +1 -0
- package/dist/NiceErrorBoundary-SqPtbIxK.js +762 -0
- package/dist/NiceForm-CI_vgkD4.cjs +382 -0
- package/dist/NiceForm-CUlhtlHw.js +5357 -0
- package/dist/NiceForm-DTgIGX88.cjs +382 -0
- package/dist/NiceForm-t9zdH8kU.js +5343 -0
- package/dist/NiceForm.css +1 -1
- package/dist/NiceModal-C_t2qqZd.js +95 -0
- package/dist/NiceModal-DQ7u-xVm.cjs +1 -0
- package/dist/NiceModal-FQqBxCij.cjs +1 -0
- package/dist/NiceModal-IkSunDgK.js +95 -0
- package/dist/NiceModuleLifecyclePanel-CCFHxKIu.js +6343 -0
- package/dist/NiceModuleLifecyclePanel-Cj4x54sw.cjs +1 -0
- package/dist/NiceModuleLifecyclePanel-D-xBAp1_.js +5228 -0
- package/dist/NiceModuleLifecyclePanel-D8cIOI8I.cjs +1 -0
- package/dist/NiceModuleLifecyclePanel.css +1 -1
- package/dist/NicePagination-BVkkePJU.js +171 -0
- package/dist/NicePagination-DDFkSRr9.js +171 -0
- package/dist/NicePagination-DGHtXqy1.cjs +1 -0
- package/dist/NicePagination-DGd3Hrh9.cjs +1 -0
- package/dist/NicePinCodeInput-BhIABBTV.cjs +419 -0
- package/dist/NicePinCodeInput-CDtodnIM.js +11875 -0
- package/dist/NicePinCodeInput-DytLfqZL.cjs +419 -0
- package/dist/NicePinCodeInput-jMNfPqOx.js +11866 -0
- package/dist/NicePinCodeInput.css +1 -1
- package/dist/NiceSavedQueryPanel-BkYRk5cX.js +6441 -0
- package/dist/NiceSavedQueryPanel-CbR3EDQU.cjs +596 -0
- package/dist/NiceSavedQueryPanel-CmFSi21-.cjs +596 -0
- package/dist/NiceSavedQueryPanel-DJqCNWYZ.js +6446 -0
- package/dist/NiceSavedQueryPanel.css +1 -1
- package/dist/NiceTabs-B-9_mzpc.js +1624 -0
- package/dist/NiceTabs-C4H5un8J.cjs +1 -0
- package/dist/NiceTabs-CHg36waF.cjs +1 -0
- package/dist/NiceTabs-DlsCMth_.js +1622 -0
- package/dist/NiceWindow-BNrA5Dxq.js +1409 -0
- package/dist/NiceWindow-BxGVzUs2.js +1409 -0
- package/dist/NiceWindow-CbzJmurQ.cjs +1 -0
- package/dist/NiceWindow-HhPIzPzs.cjs +1 -0
- package/dist/charts-F_b5-OR8.js +4621 -0
- package/dist/charts-Us8Ep8MJ.cjs +761 -0
- package/dist/charts-e10jGjuF.cjs +759 -0
- package/dist/charts-fO6InNZd.js +4645 -0
- package/dist/charts.cjs +1 -1
- package/dist/charts.css +1 -1
- package/dist/charts.mjs +1 -1
- package/dist/core-B-tu8l9M.cjs +96 -0
- package/dist/core-BJ_UNMlX.js +22276 -0
- package/dist/core-CSfXTICE.cjs +96 -0
- package/dist/core-ClmvtMVZ.js +22253 -0
- package/dist/data-branching-B_9C6-hE.cjs +1 -0
- package/dist/data-branching-BmCKIXgr.js +6121 -0
- package/dist/data-branching.cjs +1 -1
- package/dist/data-branching.mjs +1 -1
- package/dist/data.cjs +1 -1
- package/dist/data.d.ts +9 -2
- package/dist/data.mjs +1 -1
- package/dist/devops-BL39OCVh.js +7660 -0
- package/dist/devops-CkuTC7RJ.cjs +17 -0
- package/dist/devops.cjs +1 -1
- package/dist/devops.mjs +1 -1
- package/dist/editors.cjs +1 -1
- package/dist/editors.d.ts +92 -6
- package/dist/editors.mjs +3 -3
- package/dist/feedback.cjs +1 -1
- package/dist/feedback.mjs +2 -2
- package/dist/index-BU6KCDpP.js +57872 -0
- package/dist/index-D7i7sZGV.cjs +5194 -0
- package/dist/index-DHc_KZkF.js +61311 -0
- package/dist/index-drIVMHeC.cjs +5194 -0
- package/dist/index.cjs +1 -1
- package/dist/index.css +1 -1
- package/dist/index.d.ts +1607 -102
- package/dist/index.mjs +894 -867
- package/dist/lazy.cjs +1 -1
- package/dist/lazy.mjs +24 -24
- package/dist/navigation.cjs +1 -1
- package/dist/navigation.d.ts +309 -70
- package/dist/navigation.mjs +94 -93
- package/dist/no-code-Bb3QFKdm.cjs +332 -0
- package/dist/no-code-snLY0d6I.js +7065 -0
- package/dist/no-code.cjs +1 -1
- package/dist/no-code.mjs +1 -1
- package/dist/overlays.cjs +1 -1
- package/dist/overlays.mjs +33 -33
- package/dist/style.css +7 -0
- package/dist/vendor-DF586kuF.js +271 -0
- package/dist/vendor-DHEorsoy.cjs +1 -0
- package/package.json +10 -5
package/dist/NiceForm.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.nice-country-picker{position:relative;display:inline-block;width:100%;max-width:320px;font-family:inherit}.nice-country-picker--sm{font-size:12px}.nice-country-picker--md{font-size:14px}.nice-country-picker--lg{font-size:16px}.nice-country-picker__trigger{display:flex;align-items:center;justify-content:space-between;width:100%;padding:8px 12px;border:1px solid var(--border-color, var(--nice-border-color, #d1d5db));border-radius:6px;background:var(--bg-primary, var(--nice-bg, #fff));cursor:pointer;text-align:left;font-size:inherit;color:var(--text-primary, var(--nice-text, #1f2937));transition:border-color .2s,box-shadow .2s}.nice-country-picker--sm .nice-country-picker__trigger{padding:6px 10px}.nice-country-picker--lg .nice-country-picker__trigger{padding:10px 14px}.nice-country-picker__trigger:hover:not(:disabled){border-color:var(--nice-primary, #3b82f6)}.nice-country-picker__trigger:focus{outline:none;border-color:var(--nice-primary, #3b82f6);box-shadow:0 0 0 3px
|
|
1
|
+
.nice-country-picker{position:relative;display:inline-block;width:100%;max-width:320px;font-family:inherit}.nice-country-picker--sm{font-size:12px}.nice-country-picker--md{font-size:14px}.nice-country-picker--lg{font-size:16px}.nice-country-picker__trigger{display:flex;align-items:center;justify-content:space-between;width:100%;padding:var(--nice-space-2, 8px) var(--nice-space-3, 12px);border:1px solid var(--border-color, var(--nice-border-color, #d1d5db));border-radius:var(--nice-radius-md, 6px);background:var(--bg-primary, var(--nice-bg, #fff));cursor:pointer;text-align:left;font-size:inherit;color:var(--text-primary, var(--nice-text, #1f2937));transition:border-color .2s,box-shadow .2s}.nice-country-picker--sm .nice-country-picker__trigger{padding:var(--nice-space-1-5, 6px) var(--nice-space-2-5, 10px)}.nice-country-picker--lg .nice-country-picker__trigger{padding:var(--nice-space-2-5, 10px) var(--nice-space-3-5, 14px)}.nice-country-picker__trigger:hover:not(:disabled){border-color:var(--nice-primary, #3b82f6)}.nice-country-picker__trigger:focus{outline:none;border-color:var(--nice-primary, #3b82f6);box-shadow:0 0 0 3px var(--nice-primary-tint-20, rgba(59, 130, 246, .2))}.nice-country-picker--open .nice-country-picker__trigger{border-color:var(--nice-primary, #3b82f6);box-shadow:0 0 0 3px var(--nice-primary-tint-20, rgba(59, 130, 246, .2))}.nice-country-picker--disabled .nice-country-picker__trigger{background:var(--nice-disabled-bg, #f3f4f6);color:var(--nice-disabled-text, #9ca3af);cursor:not-allowed}.nice-country-picker__value{display:flex;align-items:center;gap:var(--nice-space-2, 8px);flex:1;overflow:hidden}.nice-country-picker__flag{font-size:1.2em;line-height:1;flex-shrink:0}.nice-country-picker__name{flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.nice-country-picker__dial-code{color:var(--nice-text-secondary, #6b7280);font-size:.9em;flex-shrink:0}.nice-country-picker__code{color:var(--nice-text-secondary, #6b7280);font-size:.85em;font-variant:tabular-nums;text-transform:uppercase;letter-spacing:.04em;flex-shrink:0}.nice-country-picker__placeholder{color:var(--nice-placeholder, #9ca3af)}.nice-country-picker__icons{display:flex;align-items:center;gap:var(--nice-space-1, 4px);margin-left:var(--nice-space-2, 8px);flex-shrink:0}.nice-country-picker__clear{display:flex;align-items:center;justify-content:center;width:18px;height:18px;font-size:10px;color:var(--nice-text-secondary, #6b7280);background:var(--nice-hover-bg, #f3f4f6);border-radius:var(--nice-radius-full, 50%);cursor:pointer;transition:background .2s,color .2s}.nice-country-picker__clear:hover{background:var(--nice-danger, #ef4444);color:#fff}.nice-country-picker__arrow{font-size:10px;color:var(--nice-text-secondary, #6b7280);transition:transform .2s}.nice-country-picker__dropdown{position:absolute;top:100%;left:0;right:0;margin-top:var(--nice-space-1, 4px);background:var(--bg-primary, var(--nice-bg, #fff));color:var(--text-primary, var(--nice-text, #1f2937));border:1px solid var(--border-color, var(--nice-border-color, #d1d5db));border-radius:var(--nice-radius-md, 6px);box-shadow:0 10px 25px var(--nice-overlay-15, rgba(0, 0, 0, .15));z-index:1000;max-height:320px;display:flex;flex-direction:column;overflow:hidden}.nice-country-picker__search{padding:var(--nice-space-2, 8px);border-bottom:1px solid var(--border-color, var(--nice-border-color, #e5e7eb));flex-shrink:0;background:transparent}.nice-country-picker__search-input{width:100%;padding:var(--nice-space-2, 8px) var(--nice-space-3, 12px);border:1px solid var(--border-color, var(--nice-border-color, #d1d5db));border-radius:var(--nice-radius-sm, 4px);font-size:inherit;background:var(--bg-primary, var(--nice-bg, #fff));color:var(--text-primary, var(--nice-text, #1f2937))}.nice-country-picker__search-input:focus{outline:none;border-color:var(--color-primary, var(--nice-primary, #3b82f6));box-shadow:0 0 0 2px color-mix(in srgb,var(--color-primary, var(--nice-primary, #3b82f6)) 18%,transparent)}.nice-country-picker__search-input::placeholder{color:var(--text-muted, var(--nice-placeholder, #9ca3af))}.nice-country-picker__list{flex:1;overflow-y:auto;padding:var(--nice-space-1, 4px)}.nice-country-picker__option{display:flex;align-items:center;gap:var(--nice-space-2, 8px);padding:var(--nice-space-2, 8px) var(--nice-space-3, 12px);cursor:pointer;border-radius:var(--nice-radius-sm, 4px);transition:background .15s}.nice-country-picker__option:hover,.nice-country-picker__option--highlighted{background:color-mix(in srgb,var(--color-primary, #3b82f6) 14%,transparent);color:var(--text-primary, var(--nice-text, #1f2937))}.nice-country-picker__option--selected{background:color-mix(in srgb,var(--color-primary, #3b82f6) 22%,transparent);color:var(--text-primary, var(--nice-text, #1f2937));font-weight:600}.nice-country-picker__option--selected:hover,.nice-country-picker__option--selected.nice-country-picker__option--highlighted{background:color-mix(in srgb,var(--color-primary, #3b82f6) 30%,transparent)}.nice-country-picker__option .nice-country-picker__dial-code{margin-left:auto}.nice-country-picker__empty{padding:var(--nice-space-4, 16px);text-align:center;color:var(--nice-text-secondary, #6b7280)}@media(prefers-color-scheme:dark){.nice-country-picker__trigger{background:var(--nice-bg, #1f2937);border-color:var(--nice-border-color, #374151);color:var(--nice-text, #f3f4f6)}.nice-country-picker--disabled .nice-country-picker__trigger{background:var(--nice-disabled-bg, #374151);color:var(--nice-disabled-text, #6b7280)}.nice-country-picker__dropdown{background:var(--nice-bg, #1f2937);border-color:var(--nice-border-color, #374151);box-shadow:0 10px 25px var(--nice-overlay-40, rgba(0, 0, 0, .4))}.nice-country-picker__search{border-color:var(--nice-border-color, #374151)}.nice-country-picker__search-input{background:var(--nice-bg, #111827);border-color:var(--nice-border-color, #374151);color:var(--nice-text, #f3f4f6)}.nice-country-picker__option:hover,.nice-country-picker__option--highlighted{background:var(--nice-hover-bg, #374151)}.nice-country-picker__option--selected,.nice-country-picker__option--selected:hover,.nice-country-picker__option--selected.nice-country-picker__option--highlighted{background:var(--nice-primary-dark, #1e3a8a)}.nice-country-picker__clear{background:var(--nice-hover-bg, #374151);color:var(--nice-text-secondary, #9ca3af)}}.nice-country-picker__list::-webkit-scrollbar{width:8px}.nice-country-picker__list::-webkit-scrollbar-track{background:transparent}.nice-country-picker__list::-webkit-scrollbar-thumb{background:var(--nice-border-color, #d1d5db);border-radius:var(--nice-radius-sm, 4px)}.nice-country-picker__list::-webkit-scrollbar-thumb:hover{background:var(--nice-text-secondary, #9ca3af)}.nice-country-picker--compact{display:inline-block;width:auto;max-width:none}.nice-country-picker--compact .nice-country-picker__trigger{width:auto;min-width:0;padding:var(--nice-space-1, 4px) var(--nice-space-2, 8px);gap:var(--nice-space-1, 4px)}.nice-country-picker--compact .nice-country-picker__value{gap:var(--nice-space-1, 4px);flex:0 0 auto}.nice-country-picker--compact .nice-country-picker__icons{margin-left:var(--nice-space-1, 4px)}.nice-country-picker__dropdown--align-left{left:0;right:auto;min-width:100%}.nice-country-picker__dropdown--align-right{right:0;left:auto;min-width:240px}.nice-theme-picker__option{position:relative}.nice-theme-picker__edit-btn{margin-left:auto;background:transparent;border:1px solid transparent;color:var(--nice-text-secondary, #6b7280);cursor:pointer;width:22px;height:22px;border-radius:var(--nice-radius-sm, 4px);display:inline-flex;align-items:center;justify-content:center;font-size:12px;opacity:0;transition:opacity .15s,background .15s,color .15s}.nice-theme-picker__option:hover .nice-theme-picker__edit-btn,.nice-theme-picker__option--highlighted .nice-theme-picker__edit-btn,.nice-theme-picker__edit-btn:focus{opacity:1}.nice-theme-picker__edit-btn:hover{background:var(--nice-hover-bg, #f3f4f6);color:var(--nice-primary, #3b82f6);border-color:var(--nice-border-color, #d1d5db)}.nice-theme-picker__add-btn{display:flex;align-items:center;justify-content:center;gap:var(--nice-space-1, 4px);width:100%;padding:var(--nice-space-2, 8px) var(--nice-space-3, 12px);border:none;border-top:1px solid var(--border-color, var(--nice-border-color, #e5e7eb));background:transparent;color:var(--color-primary, var(--nice-primary, #3b82f6));font-size:inherit;font-weight:600;cursor:pointer;flex-shrink:0;transition:background .15s}.nice-theme-picker__add-btn:hover{background:color-mix(in srgb,var(--color-primary, var(--nice-primary, #3b82f6)) 14%,transparent)}.nice-theme-picker__add-btn--top{border-top:none;border-bottom:1px solid var(--border-color, var(--nice-border-color, #e5e7eb))}@media(prefers-color-scheme:dark){.nice-theme-picker__add-btn{background:transparent;border-top-color:var(--nice-border-color, #374151)}.nice-theme-picker__add-btn--top{border-bottom-color:var(--nice-border-color, #374151)}.nice-theme-picker__edit-btn:hover{background:var(--nice-hover-bg, #374151)}}
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import { jsx as e, jsxs as s } from "react/jsx-runtime";
|
|
2
|
+
import { $ as g, t as $, o as E, a as F, k as j } from "./core-BJ_UNMlX.js";
|
|
3
|
+
import { useContext as M, useRef as P, useState as R, useEffect as u } from "react";
|
|
4
|
+
import { createPortal as B } from "react-dom";
|
|
5
|
+
const A = ({
|
|
6
|
+
open: l,
|
|
7
|
+
onClose: o,
|
|
8
|
+
title: t,
|
|
9
|
+
size: f = "md",
|
|
10
|
+
children: h,
|
|
11
|
+
footer: n,
|
|
12
|
+
closeOnOverlay: v = !0,
|
|
13
|
+
closeOnEscape: d = !0,
|
|
14
|
+
fullscreenable: y,
|
|
15
|
+
zIndex: c,
|
|
16
|
+
className: _,
|
|
17
|
+
style: b,
|
|
18
|
+
displayStyle: i
|
|
19
|
+
}) => {
|
|
20
|
+
const { t: N } = g(), k = M($), m = P(null), [r, p] = R(!1), w = E("modal", i), x = F("modal", i);
|
|
21
|
+
if (j(m, l), u(() => {
|
|
22
|
+
if (!l || !d)
|
|
23
|
+
return;
|
|
24
|
+
const a = (L) => {
|
|
25
|
+
L.key === "Escape" && o();
|
|
26
|
+
};
|
|
27
|
+
return document.addEventListener("keydown", a), () => document.removeEventListener("keydown", a);
|
|
28
|
+
}, [l, d, o]), u(() => (l ? document.body.style.overflow = "hidden" : document.body.style.overflow = "", () => {
|
|
29
|
+
document.body.style.overflow = "";
|
|
30
|
+
}), [l]), !l || typeof document > "u")
|
|
31
|
+
return null;
|
|
32
|
+
const C = /* @__PURE__ */ e(
|
|
33
|
+
"div",
|
|
34
|
+
{
|
|
35
|
+
className: "nice-modal-overlay",
|
|
36
|
+
style: c ? { zIndex: c } : void 0,
|
|
37
|
+
onClick: v ? o : void 0,
|
|
38
|
+
children: /* @__PURE__ */ s(
|
|
39
|
+
"div",
|
|
40
|
+
{
|
|
41
|
+
ref: m,
|
|
42
|
+
className: `nice-modal nice-modal--${r ? "full" : f} nice-modal--ds-${x} ${_ || ""}`,
|
|
43
|
+
style: { ...w, ...b },
|
|
44
|
+
role: "dialog",
|
|
45
|
+
"aria-modal": "true",
|
|
46
|
+
"aria-label": t,
|
|
47
|
+
onClick: (a) => a.stopPropagation(),
|
|
48
|
+
children: [
|
|
49
|
+
t && /* @__PURE__ */ s("div", { className: "nice-modal__header", children: [
|
|
50
|
+
/* @__PURE__ */ e("h2", { className: "nice-modal__title", children: t }),
|
|
51
|
+
/* @__PURE__ */ s("div", { className: "nice-modal__header-actions", children: [
|
|
52
|
+
y && /* @__PURE__ */ e(
|
|
53
|
+
"button",
|
|
54
|
+
{
|
|
55
|
+
type: "button",
|
|
56
|
+
className: "nice-modal__fullscreen",
|
|
57
|
+
onClick: () => p((a) => !a),
|
|
58
|
+
"aria-label": r ? "Exit fullscreen" : "Fullscreen",
|
|
59
|
+
children: r ? "⇲" : "⇱"
|
|
60
|
+
}
|
|
61
|
+
),
|
|
62
|
+
/* @__PURE__ */ e(
|
|
63
|
+
"button",
|
|
64
|
+
{
|
|
65
|
+
type: "button",
|
|
66
|
+
className: "nice-modal__close",
|
|
67
|
+
onClick: o,
|
|
68
|
+
"aria-label": N("controls.close", "Close"),
|
|
69
|
+
children: /* @__PURE__ */ e(
|
|
70
|
+
"svg",
|
|
71
|
+
{
|
|
72
|
+
width: "24",
|
|
73
|
+
height: "24",
|
|
74
|
+
viewBox: "0 0 20 20",
|
|
75
|
+
fill: "currentColor",
|
|
76
|
+
"aria-hidden": "true",
|
|
77
|
+
children: /* @__PURE__ */ e("path", { d: "M6.28 5.22a.75.75 0 00-1.06 1.06L8.94 10l-3.72 3.72a.75.75 0 101.06 1.06L10 11.06l3.72 3.72a.75.75 0 101.06-1.06L11.06 10l3.72-3.72a.75.75 0 00-1.06-1.06L10 8.94 6.28 5.22z" })
|
|
78
|
+
}
|
|
79
|
+
)
|
|
80
|
+
}
|
|
81
|
+
)
|
|
82
|
+
] })
|
|
83
|
+
] }),
|
|
84
|
+
/* @__PURE__ */ e("div", { className: "nice-modal__body", children: h }),
|
|
85
|
+
n && /* @__PURE__ */ e("div", { className: "nice-modal__footer", children: n })
|
|
86
|
+
]
|
|
87
|
+
}
|
|
88
|
+
)
|
|
89
|
+
}
|
|
90
|
+
);
|
|
91
|
+
return B(C, k?.portalTarget ?? document.body);
|
|
92
|
+
};
|
|
93
|
+
export {
|
|
94
|
+
A as N
|
|
95
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const e=require("react/jsx-runtime"),t=require("./core-CSfXTICE.cjs"),a=require("react"),g=require("react-dom"),E=({open:l,onClose:c,title:o,size:f="md",children:h,footer:r,closeOnOverlay:v=!0,closeOnEscape:d=!0,fullscreenable:y,zIndex:i,className:x,style:_,displayStyle:u})=>{const{t:b}=t.$o(),j=a.useContext(t.tr),m=a.useRef(null),[n,N]=a.useState(!1),k=t.os("modal",u),w=t.is("modal",u);if(t.ks(m,l),a.useEffect(()=>{if(!l||!d)return;const s=L=>{L.key==="Escape"&&c()};return document.addEventListener("keydown",s),()=>document.removeEventListener("keydown",s)},[l,d,c]),a.useEffect(()=>(l?document.body.style.overflow="hidden":document.body.style.overflow="",()=>{document.body.style.overflow=""}),[l]),!l||typeof document>"u")return null;const C=e.jsx("div",{className:"nice-modal-overlay",style:i?{zIndex:i}:void 0,onClick:v?c:void 0,children:e.jsxs("div",{ref:m,className:`nice-modal nice-modal--${n?"full":f} nice-modal--ds-${w} ${x||""}`,style:{...k,..._},role:"dialog","aria-modal":"true","aria-label":o,onClick:s=>s.stopPropagation(),children:[o&&e.jsxs("div",{className:"nice-modal__header",children:[e.jsx("h2",{className:"nice-modal__title",children:o}),e.jsxs("div",{className:"nice-modal__header-actions",children:[y&&e.jsx("button",{type:"button",className:"nice-modal__fullscreen",onClick:()=>N(s=>!s),"aria-label":n?"Exit fullscreen":"Fullscreen",children:n?"⇲":"⇱"}),e.jsx("button",{type:"button",className:"nice-modal__close",onClick:c,"aria-label":b("controls.close","Close"),children:e.jsx("svg",{width:"24",height:"24",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",children:e.jsx("path",{d:"M6.28 5.22a.75.75 0 00-1.06 1.06L8.94 10l-3.72 3.72a.75.75 0 101.06 1.06L10 11.06l3.72 3.72a.75.75 0 101.06-1.06L11.06 10l3.72-3.72a.75.75 0 00-1.06-1.06L10 8.94 6.28 5.22z"})})})]})]}),e.jsx("div",{className:"nice-modal__body",children:h}),r&&e.jsx("div",{className:"nice-modal__footer",children:r})]})});return g.createPortal(C,j?.portalTarget??document.body)};exports.NiceModal=E;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const e=require("react/jsx-runtime"),t=require("./core-B-tu8l9M.cjs"),a=require("react"),g=require("react-dom"),E=({open:l,onClose:c,title:o,size:f="md",children:h,footer:r,closeOnOverlay:v=!0,closeOnEscape:d=!0,fullscreenable:y,zIndex:i,className:x,style:_,displayStyle:u})=>{const{t:b}=t.$o(),j=a.useContext(t.tr),m=a.useRef(null),[n,N]=a.useState(!1),k=t.os("modal",u),w=t.is("modal",u);if(t.ks(m,l),a.useEffect(()=>{if(!l||!d)return;const s=L=>{L.key==="Escape"&&c()};return document.addEventListener("keydown",s),()=>document.removeEventListener("keydown",s)},[l,d,c]),a.useEffect(()=>(l?document.body.style.overflow="hidden":document.body.style.overflow="",()=>{document.body.style.overflow=""}),[l]),!l||typeof document>"u")return null;const C=e.jsx("div",{className:"nice-modal-overlay",style:i?{zIndex:i}:void 0,onClick:v?c:void 0,children:e.jsxs("div",{ref:m,className:`nice-modal nice-modal--${n?"full":f} nice-modal--ds-${w} ${x||""}`,style:{...k,..._},role:"dialog","aria-modal":"true","aria-label":o,onClick:s=>s.stopPropagation(),children:[o&&e.jsxs("div",{className:"nice-modal__header",children:[e.jsx("h2",{className:"nice-modal__title",children:o}),e.jsxs("div",{className:"nice-modal__header-actions",children:[y&&e.jsx("button",{type:"button",className:"nice-modal__fullscreen",onClick:()=>N(s=>!s),"aria-label":n?"Exit fullscreen":"Fullscreen",children:n?"⇲":"⇱"}),e.jsx("button",{type:"button",className:"nice-modal__close",onClick:c,"aria-label":b("controls.close","Close"),children:e.jsx("svg",{width:"24",height:"24",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",children:e.jsx("path",{d:"M6.28 5.22a.75.75 0 00-1.06 1.06L8.94 10l-3.72 3.72a.75.75 0 101.06 1.06L10 11.06l3.72 3.72a.75.75 0 101.06-1.06L11.06 10l3.72-3.72a.75.75 0 00-1.06-1.06L10 8.94 6.28 5.22z"})})})]})]}),e.jsx("div",{className:"nice-modal__body",children:h}),r&&e.jsx("div",{className:"nice-modal__footer",children:r})]})});return g.createPortal(C,j?.portalTarget??document.body)};exports.NiceModal=E;
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import { jsx as e, jsxs as s } from "react/jsx-runtime";
|
|
2
|
+
import { $ as g, t as $, o as E, a as F, k as j } from "./core-ClmvtMVZ.js";
|
|
3
|
+
import { useContext as M, useRef as P, useState as R, useEffect as u } from "react";
|
|
4
|
+
import { createPortal as B } from "react-dom";
|
|
5
|
+
const A = ({
|
|
6
|
+
open: l,
|
|
7
|
+
onClose: o,
|
|
8
|
+
title: t,
|
|
9
|
+
size: f = "md",
|
|
10
|
+
children: h,
|
|
11
|
+
footer: n,
|
|
12
|
+
closeOnOverlay: v = !0,
|
|
13
|
+
closeOnEscape: d = !0,
|
|
14
|
+
fullscreenable: y,
|
|
15
|
+
zIndex: c,
|
|
16
|
+
className: _,
|
|
17
|
+
style: b,
|
|
18
|
+
displayStyle: i
|
|
19
|
+
}) => {
|
|
20
|
+
const { t: N } = g(), k = M($), m = P(null), [r, p] = R(!1), w = E("modal", i), x = F("modal", i);
|
|
21
|
+
if (j(m, l), u(() => {
|
|
22
|
+
if (!l || !d)
|
|
23
|
+
return;
|
|
24
|
+
const a = (L) => {
|
|
25
|
+
L.key === "Escape" && o();
|
|
26
|
+
};
|
|
27
|
+
return document.addEventListener("keydown", a), () => document.removeEventListener("keydown", a);
|
|
28
|
+
}, [l, d, o]), u(() => (l ? document.body.style.overflow = "hidden" : document.body.style.overflow = "", () => {
|
|
29
|
+
document.body.style.overflow = "";
|
|
30
|
+
}), [l]), !l || typeof document > "u")
|
|
31
|
+
return null;
|
|
32
|
+
const C = /* @__PURE__ */ e(
|
|
33
|
+
"div",
|
|
34
|
+
{
|
|
35
|
+
className: "nice-modal-overlay",
|
|
36
|
+
style: c ? { zIndex: c } : void 0,
|
|
37
|
+
onClick: v ? o : void 0,
|
|
38
|
+
children: /* @__PURE__ */ s(
|
|
39
|
+
"div",
|
|
40
|
+
{
|
|
41
|
+
ref: m,
|
|
42
|
+
className: `nice-modal nice-modal--${r ? "full" : f} nice-modal--ds-${x} ${_ || ""}`,
|
|
43
|
+
style: { ...w, ...b },
|
|
44
|
+
role: "dialog",
|
|
45
|
+
"aria-modal": "true",
|
|
46
|
+
"aria-label": t,
|
|
47
|
+
onClick: (a) => a.stopPropagation(),
|
|
48
|
+
children: [
|
|
49
|
+
t && /* @__PURE__ */ s("div", { className: "nice-modal__header", children: [
|
|
50
|
+
/* @__PURE__ */ e("h2", { className: "nice-modal__title", children: t }),
|
|
51
|
+
/* @__PURE__ */ s("div", { className: "nice-modal__header-actions", children: [
|
|
52
|
+
y && /* @__PURE__ */ e(
|
|
53
|
+
"button",
|
|
54
|
+
{
|
|
55
|
+
type: "button",
|
|
56
|
+
className: "nice-modal__fullscreen",
|
|
57
|
+
onClick: () => p((a) => !a),
|
|
58
|
+
"aria-label": r ? "Exit fullscreen" : "Fullscreen",
|
|
59
|
+
children: r ? "⇲" : "⇱"
|
|
60
|
+
}
|
|
61
|
+
),
|
|
62
|
+
/* @__PURE__ */ e(
|
|
63
|
+
"button",
|
|
64
|
+
{
|
|
65
|
+
type: "button",
|
|
66
|
+
className: "nice-modal__close",
|
|
67
|
+
onClick: o,
|
|
68
|
+
"aria-label": N("controls.close", "Close"),
|
|
69
|
+
children: /* @__PURE__ */ e(
|
|
70
|
+
"svg",
|
|
71
|
+
{
|
|
72
|
+
width: "24",
|
|
73
|
+
height: "24",
|
|
74
|
+
viewBox: "0 0 20 20",
|
|
75
|
+
fill: "currentColor",
|
|
76
|
+
"aria-hidden": "true",
|
|
77
|
+
children: /* @__PURE__ */ e("path", { d: "M6.28 5.22a.75.75 0 00-1.06 1.06L8.94 10l-3.72 3.72a.75.75 0 101.06 1.06L10 11.06l3.72 3.72a.75.75 0 101.06-1.06L11.06 10l3.72-3.72a.75.75 0 00-1.06-1.06L10 8.94 6.28 5.22z" })
|
|
78
|
+
}
|
|
79
|
+
)
|
|
80
|
+
}
|
|
81
|
+
)
|
|
82
|
+
] })
|
|
83
|
+
] }),
|
|
84
|
+
/* @__PURE__ */ e("div", { className: "nice-modal__body", children: h }),
|
|
85
|
+
n && /* @__PURE__ */ e("div", { className: "nice-modal__footer", children: n })
|
|
86
|
+
]
|
|
87
|
+
}
|
|
88
|
+
)
|
|
89
|
+
}
|
|
90
|
+
);
|
|
91
|
+
return B(C, k?.portalTarget ?? document.body);
|
|
92
|
+
};
|
|
93
|
+
export {
|
|
94
|
+
A as N
|
|
95
|
+
};
|