@nice2dev/ui 1.0.29 → 1.0.31
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 +512 -0
- package/README.md +30 -31
- package/dist/NiceBackupStatusBadge.doc-Bx2bFmBQ.cjs +1 -0
- package/dist/NiceBackupStatusBadge.doc-CdDxIQ-M.js +25 -0
- package/dist/NiceCalendarScheduler.doc-BEtQkZjV.cjs +9 -0
- package/dist/NiceCalendarScheduler.doc-D__LRgOx.js +33 -0
- package/dist/NiceConfirmDialog-B57cl_F7.cjs +1 -0
- package/dist/NiceConfirmDialog-BiTJVR4-.js +81 -0
- package/dist/NiceConfirmDialog-Bjw_rN4o.cjs +1 -0
- package/dist/NiceConfirmDialog-N9fBTLYm.js +81 -0
- package/dist/NiceDrawingCanvas.doc-Dv5vB4gY.js +32 -0
- package/dist/NiceDrawingCanvas.doc-Ww9zz17x.cjs +8 -0
- package/dist/NiceErrorBoundary-1H751jK7.cjs +1 -0
- package/dist/NiceErrorBoundary-B-txoU3Y.js +709 -0
- package/dist/NiceErrorBoundary-BD-uqk_q.js +709 -0
- package/dist/NiceErrorBoundary-CIPXaYik.cjs +1 -0
- package/dist/NiceFileManagerViews.doc-CKlnm6cX.cjs +1 -0
- package/dist/NiceFileManagerViews.doc-Cg21DArG.js +25 -0
- package/dist/NiceForm-BNZB31Pg.js +4499 -0
- package/dist/NiceForm-CPyAXxBO.cjs +1 -0
- package/dist/NiceForm-DGUTmaZT.js +5014 -0
- package/dist/NiceForm-DmU-gmyv.cjs +382 -0
- package/dist/NiceMegaMenu.doc-7UyOCd3l.cjs +7 -0
- package/dist/NiceMegaMenu.doc-zeIyVa65.js +31 -0
- package/dist/NiceModal-BClAtR5T.js +95 -0
- package/dist/NiceModal-Bj53SKLI.js +95 -0
- package/dist/NiceModal-DC0UlQhc.cjs +1 -0
- package/dist/NiceModal-iKwtagFB.cjs +1 -0
- package/dist/NiceModuleLifecyclePanel-BBOg9g0b.cjs +1 -0
- package/dist/NiceModuleLifecyclePanel-BO8Hw_W9.js +7619 -0
- package/dist/NiceModuleLifecyclePanel-Ch7HRRoy.cjs +1 -0
- package/dist/NiceModuleLifecyclePanel-DtuXRiLR.js +6991 -0
- package/dist/NiceModuleLifecyclePanel.css +1 -1
- package/dist/NicePagination-BVo-4KAD.js +172 -0
- package/dist/NicePagination-Bjxy9aEc.js +172 -0
- package/dist/NicePagination-CaohvQsY.cjs +1 -0
- package/dist/NicePagination-CfFfNwrg.cjs +1 -0
- package/dist/NicePinCodeInput-DsyLuc0b.cjs +696 -0
- package/dist/NicePinCodeInput-nuRCN-9R.js +13223 -0
- package/dist/NiceSavedQueryPanel-BBFV4qiF.js +6969 -0
- package/dist/NiceSavedQueryPanel-CH5c3rUG.js +6988 -0
- package/dist/NiceSavedQueryPanel-CsiVNkCT.cjs +596 -0
- package/dist/NiceSavedQueryPanel-aQrEmmcC.cjs +596 -0
- package/dist/NiceScannerControl-Cd5KXJA9.js +12769 -0
- package/dist/NiceScannerControl-DZsERSw_.cjs +698 -0
- package/dist/NiceScannerControl.css +1 -0
- package/dist/NiceWindow-BoDzlGk-.js +1621 -0
- package/dist/NiceWindow-Cm9E6EAi.cjs +1 -0
- package/dist/NiceWindow-DgONWxBm.cjs +1 -0
- package/dist/NiceWindow-FMrVS7zo.js +1603 -0
- package/dist/charts-B90sSFeJ.cjs +761 -0
- package/dist/charts-Bs0aDM0X.js +4671 -0
- package/dist/charts-DaLf19vS.js +4671 -0
- package/dist/charts-DjjKkw0q.cjs +761 -0
- package/dist/charts.cjs +1 -1
- package/dist/charts.mjs +1 -1
- package/dist/core-BUTtIHg0.js +27766 -0
- package/dist/core-BUsZ7_vI.js +27914 -0
- package/dist/core-CESNSRyS.cjs +122 -0
- package/dist/core-CLfcCDKc.cjs +122 -0
- package/dist/data-branching-ByQdcjKO.cjs +1 -0
- package/dist/data-branching-D7l_kILW.cjs +1 -0
- package/dist/data-branching-lJ07lDN-.js +6255 -0
- package/dist/data-branching-psTzlcrT.js +6255 -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 +41 -37
- package/dist/data.mjs +18 -19
- package/dist/devops-Bi8MXtko.js +8165 -0
- package/dist/devops-D7bQ3rE4.cjs +17 -0
- package/dist/devops-On_1wRf9.cjs +17 -0
- package/dist/devops-jCmpD6O-.js +8165 -0
- package/dist/devops.cjs +1 -1
- package/dist/devops.mjs +3 -3
- package/dist/editors.cjs +1 -1
- package/dist/editors.d.ts +219 -431
- package/dist/editors.mjs +48 -56
- package/dist/feedback.cjs +1 -1
- package/dist/feedback.mjs +3 -3
- package/dist/index-BDH1yDSg.js +69235 -0
- package/dist/index-BpixglWg.js +69337 -0
- package/dist/index-C9njkNOD.cjs +5470 -0
- package/dist/index-DLR-aWZR.cjs +5506 -0
- package/dist/index.cjs +1 -1
- package/dist/index.css +1 -1
- package/dist/index.d.ts +798 -1059
- package/dist/index.mjs +741 -756
- package/dist/lazy.cjs +1 -1
- package/dist/lazy.mjs +24 -24
- package/dist/navigation.cjs +1 -1
- package/dist/navigation.d.ts +25 -213
- package/dist/navigation.mjs +143 -151
- package/dist/no-code-8lO7o6xi.js +7425 -0
- package/dist/no-code-BHo5WrXr.js +7425 -0
- package/dist/no-code-DyA_1_Th.cjs +332 -0
- package/dist/no-code-K8tOLNew.cjs +332 -0
- package/dist/no-code.cjs +1 -1
- package/dist/no-code.mjs +1 -1
- package/dist/overlays.cjs +1 -1
- package/dist/overlays.d.ts +12 -0
- package/dist/overlays.mjs +82 -82
- package/dist/pickerCommons-BEc3pZ_s.js +2044 -0
- package/dist/pickerCommons-CORo9j2a.js +2119 -0
- package/dist/pickerCommons-CrITwM88.cjs +1 -0
- package/dist/pickerCommons-D3WShRrR.cjs +1 -0
- package/dist/style.css +5 -5
- package/package.json +3 -3
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
const t = "https://nice2dev.com/schemas/component-doc-v1.json", s = "NiceBackupStatusBadge", e = "Backup status indicator badge.", a = "display", c = "1.0.0", n = "stable", o = [{ name: "status", type: "'synced' | 'pending' | 'error' | 'syncing'", required: !0, description: "Backup status" }, { name: "lastBackup", type: "Date", description: "Last backup timestamp" }], i = [{ title: "Status Badge", code: '<NiceBackupStatusBadge status="synced" lastBackup={new Date()} />' }], p = { keyboard: [], aria: ["Status announcement"] }, u = ["NiceBadge"], d = {
|
|
2
|
+
$schema: t,
|
|
3
|
+
name: s,
|
|
4
|
+
description: e,
|
|
5
|
+
category: a,
|
|
6
|
+
since: c,
|
|
7
|
+
status: n,
|
|
8
|
+
props: o,
|
|
9
|
+
examples: i,
|
|
10
|
+
accessibility: p,
|
|
11
|
+
seeAlso: u
|
|
12
|
+
};
|
|
13
|
+
export {
|
|
14
|
+
t as $schema,
|
|
15
|
+
p as accessibility,
|
|
16
|
+
a as category,
|
|
17
|
+
d as default,
|
|
18
|
+
e as description,
|
|
19
|
+
i as examples,
|
|
20
|
+
s as name,
|
|
21
|
+
o as props,
|
|
22
|
+
u as seeAlso,
|
|
23
|
+
c as since,
|
|
24
|
+
n as status
|
|
25
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e="https://nice2dev.com/schemas/component-doc-v1.json",t="NiceCalendarScheduler",n="Calendar scheduler for appointments and event management.",a="planning",c="1.0.0",o="planned",r=[{name:"events",type:"SchedulerEvent[]",required:!0,description:"Event data"},{name:"view",type:"'day' | 'week' | 'month' | 'agenda'",default:"'week'",description:"View mode"},{name:"date",type:"Date",required:!0,description:"Current date"},{name:"onDateChange",type:"(date: Date) => void",description:"Date change callback"},{name:"onEventClick",type:"(event: SchedulerEvent) => void",description:"Event click callback"},{name:"onEventCreate",type:"(start: Date, end: Date) => void",description:"Create event callback"},{name:"onEventUpdate",type:"(event: SchedulerEvent) => void",description:"Update event callback"},{name:"resources",type:"Resource[]",description:"Resources for multi-resource view"},{name:"workingHours",type:"WorkingHours",description:"Working hours config"}],s=[{title:"Calendar Scheduler",description:"Schedule events",code:`<NiceCalendarScheduler
|
|
2
|
+
events={appointments}
|
|
3
|
+
view="week"
|
|
4
|
+
date={currentDate}
|
|
5
|
+
onDateChange={setCurrentDate}
|
|
6
|
+
onEventClick={openEvent}
|
|
7
|
+
onEventCreate={createEvent}
|
|
8
|
+
onEventUpdate={updateEvent}
|
|
9
|
+
/>`}],i={keyboard:["Arrow keys to navigate","Enter to select"],aria:["Calendar scheduler","Event descriptions"]},d=["NiceDateTimePicker","NiceGanttChart"],l={$schema:e,name:t,description:n,category:a,since:c,status:o,props:r,examples:s,accessibility:i,seeAlso:d};exports.$schema=e;exports.accessibility=i;exports.category=a;exports.default=l;exports.description=n;exports.examples=s;exports.name=t;exports.props=r;exports.seeAlso=d;exports.since=c;exports.status=o;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
const e = "https://nice2dev.com/schemas/component-doc-v1.json", t = "NiceCalendarScheduler", n = "Calendar scheduler for appointments and event management.", a = "planning", c = "1.0.0", o = "planned", r = [{ name: "events", type: "SchedulerEvent[]", required: !0, description: "Event data" }, { name: "view", type: "'day' | 'week' | 'month' | 'agenda'", default: "'week'", description: "View mode" }, { name: "date", type: "Date", required: !0, description: "Current date" }, { name: "onDateChange", type: "(date: Date) => void", description: "Date change callback" }, { name: "onEventClick", type: "(event: SchedulerEvent) => void", description: "Event click callback" }, { name: "onEventCreate", type: "(start: Date, end: Date) => void", description: "Create event callback" }, { name: "onEventUpdate", type: "(event: SchedulerEvent) => void", description: "Update event callback" }, { name: "resources", type: "Resource[]", description: "Resources for multi-resource view" }, { name: "workingHours", type: "WorkingHours", description: "Working hours config" }], i = [{ title: "Calendar Scheduler", description: "Schedule events", code: `<NiceCalendarScheduler
|
|
2
|
+
events={appointments}
|
|
3
|
+
view="week"
|
|
4
|
+
date={currentDate}
|
|
5
|
+
onDateChange={setCurrentDate}
|
|
6
|
+
onEventClick={openEvent}
|
|
7
|
+
onEventCreate={createEvent}
|
|
8
|
+
onEventUpdate={updateEvent}
|
|
9
|
+
/>` }], s = { keyboard: ["Arrow keys to navigate", "Enter to select"], aria: ["Calendar scheduler", "Event descriptions"] }, d = ["NiceDateTimePicker", "NiceGanttChart"], p = {
|
|
10
|
+
$schema: e,
|
|
11
|
+
name: t,
|
|
12
|
+
description: n,
|
|
13
|
+
category: a,
|
|
14
|
+
since: c,
|
|
15
|
+
status: o,
|
|
16
|
+
props: r,
|
|
17
|
+
examples: i,
|
|
18
|
+
accessibility: s,
|
|
19
|
+
seeAlso: d
|
|
20
|
+
};
|
|
21
|
+
export {
|
|
22
|
+
e as $schema,
|
|
23
|
+
s as accessibility,
|
|
24
|
+
a as category,
|
|
25
|
+
p as default,
|
|
26
|
+
n as description,
|
|
27
|
+
i as examples,
|
|
28
|
+
t as name,
|
|
29
|
+
r as props,
|
|
30
|
+
d as seeAlso,
|
|
31
|
+
c as since,
|
|
32
|
+
o as status
|
|
33
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const e=require("react/jsx-runtime"),C=require("./core-CLfcCDKc.cjs"),d=require("react"),N={info:e.jsx("svg",{width:"28",height:"28",viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-6h2v6zm0-8h-2V7h2v2z"})}),warning:e.jsx("svg",{width:"28",height:"28",viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("path",{d:"M1 21h22L12 2 1 21zm12-3h-2v-2h2v2zm0-4h-2v-4h2v4z"})}),error:e.jsx("svg",{width:"28",height:"28",viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-2h2v2zm0-4h-2V7h2v6z"})}),success:e.jsx("svg",{width:"28",height:"28",viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-2 15l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"})})},b=({visible:c,message:m,header:o,icon:h,variant:i="warning",acceptLabel:a,rejectLabel:f,onAccept:u,onReject:n,closeOnOverlay:v=!1,closeOnEscape:s=!0,size:x="md",className:g,style:j})=>{const{t}=C.Gt();if(d.useEffect(()=>{if(!c||!s)return;const r=_=>{_.key==="Escape"&&n()};return document.addEventListener("keydown",r),()=>document.removeEventListener("keydown",r)},[c,s,n]),d.useEffect(()=>(c?document.body.style.overflow="hidden":document.body.style.overflow="",()=>{document.body.style.overflow=""}),[c]),!c)return null;const l=h??N[i],w=a??t("confirm.accept","Yes"),y=f??t("confirm.reject","No");return e.jsx("div",{className:"nice-modal-overlay",onClick:v?n:void 0,children:e.jsxs("div",{className:`nice-confirm nice-confirm--${i} nice-confirm--${x} ${g||""}`,style:j,role:"alertdialog","aria-modal":"true","aria-label":o,"aria-describedby":"nice-confirm-message",onClick:r=>r.stopPropagation(),children:[o&&e.jsx("div",{className:"nice-confirm__header",children:e.jsx("h3",{className:"nice-confirm__title",children:o})}),e.jsxs("div",{className:"nice-confirm__body",children:[l&&e.jsx("div",{className:`nice-confirm__icon nice-confirm__icon--${i}`,children:l}),e.jsx("div",{id:"nice-confirm-message",className:"nice-confirm__message",children:m})]}),e.jsxs("div",{className:"nice-confirm__footer",children:[e.jsx("button",{type:"button",className:"nice-btn nice-btn--ghost nice-btn--md",onClick:n,children:y}),e.jsx("button",{type:"button",className:`nice-btn nice-btn--${i==="error"?"error":"primary"} nice-btn--md`,onClick:u,autoFocus:!0,children:w})]})]})})};exports.NiceConfirmDialog=b;
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { jsx as e, jsxs as t } from "react/jsx-runtime";
|
|
2
|
+
import { G as C } from "./core-BUTtIHg0.js";
|
|
3
|
+
import m from "react";
|
|
4
|
+
const z = {
|
|
5
|
+
info: /* @__PURE__ */ e("svg", { width: "28", height: "28", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ e("path", { d: "M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-6h2v6zm0-8h-2V7h2v2z" }) }),
|
|
6
|
+
warning: /* @__PURE__ */ e("svg", { width: "28", height: "28", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ e("path", { d: "M1 21h22L12 2 1 21zm12-3h-2v-2h2v2zm0-4h-2v-4h2v4z" }) }),
|
|
7
|
+
error: /* @__PURE__ */ e("svg", { width: "28", height: "28", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ e("path", { d: "M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-2h2v2zm0-4h-2V7h2v6z" }) }),
|
|
8
|
+
success: /* @__PURE__ */ e("svg", { width: "28", height: "28", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ e("path", { d: "M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-2 15l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z" }) })
|
|
9
|
+
}, E = ({
|
|
10
|
+
visible: i,
|
|
11
|
+
message: a,
|
|
12
|
+
header: o,
|
|
13
|
+
icon: h,
|
|
14
|
+
variant: n = "warning",
|
|
15
|
+
acceptLabel: f,
|
|
16
|
+
rejectLabel: v,
|
|
17
|
+
onAccept: u,
|
|
18
|
+
onReject: c,
|
|
19
|
+
closeOnOverlay: g = !1,
|
|
20
|
+
closeOnEscape: l = !0,
|
|
21
|
+
size: p = "md",
|
|
22
|
+
className: w,
|
|
23
|
+
style: y
|
|
24
|
+
}) => {
|
|
25
|
+
const { t: s } = C();
|
|
26
|
+
if (m.useEffect(() => {
|
|
27
|
+
if (!i || !l)
|
|
28
|
+
return;
|
|
29
|
+
const r = (b) => {
|
|
30
|
+
b.key === "Escape" && c();
|
|
31
|
+
};
|
|
32
|
+
return document.addEventListener("keydown", r), () => document.removeEventListener("keydown", r);
|
|
33
|
+
}, [i, l, c]), m.useEffect(() => (i ? document.body.style.overflow = "hidden" : document.body.style.overflow = "", () => {
|
|
34
|
+
document.body.style.overflow = "";
|
|
35
|
+
}), [i]), !i)
|
|
36
|
+
return null;
|
|
37
|
+
const d = h ?? z[n], _ = f ?? s("confirm.accept", "Yes"), N = v ?? s("confirm.reject", "No");
|
|
38
|
+
return /* @__PURE__ */ e("div", { className: "nice-modal-overlay", onClick: g ? c : void 0, children: /* @__PURE__ */ t(
|
|
39
|
+
"div",
|
|
40
|
+
{
|
|
41
|
+
className: `nice-confirm nice-confirm--${n} nice-confirm--${p} ${w || ""}`,
|
|
42
|
+
style: y,
|
|
43
|
+
role: "alertdialog",
|
|
44
|
+
"aria-modal": "true",
|
|
45
|
+
"aria-label": o,
|
|
46
|
+
"aria-describedby": "nice-confirm-message",
|
|
47
|
+
onClick: (r) => r.stopPropagation(),
|
|
48
|
+
children: [
|
|
49
|
+
o && /* @__PURE__ */ e("div", { className: "nice-confirm__header", children: /* @__PURE__ */ e("h3", { className: "nice-confirm__title", children: o }) }),
|
|
50
|
+
/* @__PURE__ */ t("div", { className: "nice-confirm__body", children: [
|
|
51
|
+
d && /* @__PURE__ */ e("div", { className: `nice-confirm__icon nice-confirm__icon--${n}`, children: d }),
|
|
52
|
+
/* @__PURE__ */ e("div", { id: "nice-confirm-message", className: "nice-confirm__message", children: a })
|
|
53
|
+
] }),
|
|
54
|
+
/* @__PURE__ */ t("div", { className: "nice-confirm__footer", children: [
|
|
55
|
+
/* @__PURE__ */ e(
|
|
56
|
+
"button",
|
|
57
|
+
{
|
|
58
|
+
type: "button",
|
|
59
|
+
className: "nice-btn nice-btn--ghost nice-btn--md",
|
|
60
|
+
onClick: c,
|
|
61
|
+
children: N
|
|
62
|
+
}
|
|
63
|
+
),
|
|
64
|
+
/* @__PURE__ */ e(
|
|
65
|
+
"button",
|
|
66
|
+
{
|
|
67
|
+
type: "button",
|
|
68
|
+
className: `nice-btn nice-btn--${n === "error" ? "error" : "primary"} nice-btn--md`,
|
|
69
|
+
onClick: u,
|
|
70
|
+
autoFocus: !0,
|
|
71
|
+
children: _
|
|
72
|
+
}
|
|
73
|
+
)
|
|
74
|
+
] })
|
|
75
|
+
]
|
|
76
|
+
}
|
|
77
|
+
) });
|
|
78
|
+
};
|
|
79
|
+
export {
|
|
80
|
+
E as N
|
|
81
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const e=require("react/jsx-runtime"),C=require("./core-CESNSRyS.cjs"),d=require("react"),N={info:e.jsx("svg",{width:"28",height:"28",viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-6h2v6zm0-8h-2V7h2v2z"})}),warning:e.jsx("svg",{width:"28",height:"28",viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("path",{d:"M1 21h22L12 2 1 21zm12-3h-2v-2h2v2zm0-4h-2v-4h2v4z"})}),error:e.jsx("svg",{width:"28",height:"28",viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-2h2v2zm0-4h-2V7h2v6z"})}),success:e.jsx("svg",{width:"28",height:"28",viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-2 15l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"})})},b=({visible:c,message:m,header:o,icon:h,variant:i="warning",acceptLabel:a,rejectLabel:f,onAccept:u,onReject:n,closeOnOverlay:v=!1,closeOnEscape:s=!0,size:x="md",className:g,style:j})=>{const{t}=C.Gt();if(d.useEffect(()=>{if(!c||!s)return;const r=_=>{_.key==="Escape"&&n()};return document.addEventListener("keydown",r),()=>document.removeEventListener("keydown",r)},[c,s,n]),d.useEffect(()=>(c?document.body.style.overflow="hidden":document.body.style.overflow="",()=>{document.body.style.overflow=""}),[c]),!c)return null;const l=h??N[i],w=a??t("confirm.accept","Yes"),y=f??t("confirm.reject","No");return e.jsx("div",{className:"nice-modal-overlay",onClick:v?n:void 0,children:e.jsxs("div",{className:`nice-confirm nice-confirm--${i} nice-confirm--${x} ${g||""}`,style:j,role:"alertdialog","aria-modal":"true","aria-label":o,"aria-describedby":"nice-confirm-message",onClick:r=>r.stopPropagation(),children:[o&&e.jsx("div",{className:"nice-confirm__header",children:e.jsx("h3",{className:"nice-confirm__title",children:o})}),e.jsxs("div",{className:"nice-confirm__body",children:[l&&e.jsx("div",{className:`nice-confirm__icon nice-confirm__icon--${i}`,children:l}),e.jsx("div",{id:"nice-confirm-message",className:"nice-confirm__message",children:m})]}),e.jsxs("div",{className:"nice-confirm__footer",children:[e.jsx("button",{type:"button",className:"nice-btn nice-btn--ghost nice-btn--md",onClick:n,children:y}),e.jsx("button",{type:"button",className:`nice-btn nice-btn--${i==="error"?"error":"primary"} nice-btn--md`,onClick:u,autoFocus:!0,children:w})]})]})})};exports.NiceConfirmDialog=b;
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { jsx as e, jsxs as t } from "react/jsx-runtime";
|
|
2
|
+
import { G as C } from "./core-BUsZ7_vI.js";
|
|
3
|
+
import m from "react";
|
|
4
|
+
const z = {
|
|
5
|
+
info: /* @__PURE__ */ e("svg", { width: "28", height: "28", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ e("path", { d: "M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-6h2v6zm0-8h-2V7h2v2z" }) }),
|
|
6
|
+
warning: /* @__PURE__ */ e("svg", { width: "28", height: "28", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ e("path", { d: "M1 21h22L12 2 1 21zm12-3h-2v-2h2v2zm0-4h-2v-4h2v4z" }) }),
|
|
7
|
+
error: /* @__PURE__ */ e("svg", { width: "28", height: "28", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ e("path", { d: "M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-2h2v2zm0-4h-2V7h2v6z" }) }),
|
|
8
|
+
success: /* @__PURE__ */ e("svg", { width: "28", height: "28", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ e("path", { d: "M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-2 15l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z" }) })
|
|
9
|
+
}, E = ({
|
|
10
|
+
visible: i,
|
|
11
|
+
message: a,
|
|
12
|
+
header: o,
|
|
13
|
+
icon: h,
|
|
14
|
+
variant: n = "warning",
|
|
15
|
+
acceptLabel: f,
|
|
16
|
+
rejectLabel: v,
|
|
17
|
+
onAccept: u,
|
|
18
|
+
onReject: c,
|
|
19
|
+
closeOnOverlay: g = !1,
|
|
20
|
+
closeOnEscape: l = !0,
|
|
21
|
+
size: p = "md",
|
|
22
|
+
className: w,
|
|
23
|
+
style: y
|
|
24
|
+
}) => {
|
|
25
|
+
const { t: s } = C();
|
|
26
|
+
if (m.useEffect(() => {
|
|
27
|
+
if (!i || !l)
|
|
28
|
+
return;
|
|
29
|
+
const r = (b) => {
|
|
30
|
+
b.key === "Escape" && c();
|
|
31
|
+
};
|
|
32
|
+
return document.addEventListener("keydown", r), () => document.removeEventListener("keydown", r);
|
|
33
|
+
}, [i, l, c]), m.useEffect(() => (i ? document.body.style.overflow = "hidden" : document.body.style.overflow = "", () => {
|
|
34
|
+
document.body.style.overflow = "";
|
|
35
|
+
}), [i]), !i)
|
|
36
|
+
return null;
|
|
37
|
+
const d = h ?? z[n], _ = f ?? s("confirm.accept", "Yes"), N = v ?? s("confirm.reject", "No");
|
|
38
|
+
return /* @__PURE__ */ e("div", { className: "nice-modal-overlay", onClick: g ? c : void 0, children: /* @__PURE__ */ t(
|
|
39
|
+
"div",
|
|
40
|
+
{
|
|
41
|
+
className: `nice-confirm nice-confirm--${n} nice-confirm--${p} ${w || ""}`,
|
|
42
|
+
style: y,
|
|
43
|
+
role: "alertdialog",
|
|
44
|
+
"aria-modal": "true",
|
|
45
|
+
"aria-label": o,
|
|
46
|
+
"aria-describedby": "nice-confirm-message",
|
|
47
|
+
onClick: (r) => r.stopPropagation(),
|
|
48
|
+
children: [
|
|
49
|
+
o && /* @__PURE__ */ e("div", { className: "nice-confirm__header", children: /* @__PURE__ */ e("h3", { className: "nice-confirm__title", children: o }) }),
|
|
50
|
+
/* @__PURE__ */ t("div", { className: "nice-confirm__body", children: [
|
|
51
|
+
d && /* @__PURE__ */ e("div", { className: `nice-confirm__icon nice-confirm__icon--${n}`, children: d }),
|
|
52
|
+
/* @__PURE__ */ e("div", { id: "nice-confirm-message", className: "nice-confirm__message", children: a })
|
|
53
|
+
] }),
|
|
54
|
+
/* @__PURE__ */ t("div", { className: "nice-confirm__footer", children: [
|
|
55
|
+
/* @__PURE__ */ e(
|
|
56
|
+
"button",
|
|
57
|
+
{
|
|
58
|
+
type: "button",
|
|
59
|
+
className: "nice-btn nice-btn--ghost nice-btn--md",
|
|
60
|
+
onClick: c,
|
|
61
|
+
children: N
|
|
62
|
+
}
|
|
63
|
+
),
|
|
64
|
+
/* @__PURE__ */ e(
|
|
65
|
+
"button",
|
|
66
|
+
{
|
|
67
|
+
type: "button",
|
|
68
|
+
className: `nice-btn nice-btn--${n === "error" ? "error" : "primary"} nice-btn--md`,
|
|
69
|
+
onClick: u,
|
|
70
|
+
autoFocus: !0,
|
|
71
|
+
children: _
|
|
72
|
+
}
|
|
73
|
+
)
|
|
74
|
+
] })
|
|
75
|
+
]
|
|
76
|
+
}
|
|
77
|
+
) });
|
|
78
|
+
};
|
|
79
|
+
export {
|
|
80
|
+
E as N
|
|
81
|
+
};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
const e = "https://nice2dev.com/schemas/component-doc-v1.json", n = "NiceDrawingCanvas", t = "Freeform drawing canvas with brush tools.", a = "editors", o = "1.0.0", s = "planned", i = [{ name: "value", type: "string", description: "Canvas data URL" }, { name: "onChange", type: "(dataUrl: string) => void", required: !0, description: "Change callback" }, { name: "width", type: "number | string", default: "'100%'", description: "Canvas width" }, { name: "height", type: "number | string", default: "400", description: "Canvas height" }, { name: "tools", type: "DrawingTool[]", description: "Available tools" }, { name: "colors", type: "string[]", description: "Color palette" }, { name: "brushSizes", type: "number[]", description: "Brush sizes" }, { name: "showToolbar", type: "boolean", default: "true", description: "Show toolbar" }, { name: "undoSteps", type: "number", default: "50", description: "Max undo steps" }, { name: "disabled", type: "boolean", default: "false", description: "Disabled state" }], r = [{ title: "Drawing Canvas", description: "Draw freeform", code: `<NiceDrawingCanvas
|
|
2
|
+
value={drawing}
|
|
3
|
+
onChange={setDrawing}
|
|
4
|
+
width={800}
|
|
5
|
+
height={600}
|
|
6
|
+
tools={['brush', 'eraser', 'line', 'rectangle']}
|
|
7
|
+
showToolbar
|
|
8
|
+
/>` }], c = { keyboard: ["Tab through tools", "Shortcuts for tools"], aria: ["Drawing canvas", "Tool descriptions"] }, d = ["NiceSignature", "NiceImageEditor"], l = {
|
|
9
|
+
$schema: e,
|
|
10
|
+
name: n,
|
|
11
|
+
description: t,
|
|
12
|
+
category: a,
|
|
13
|
+
since: o,
|
|
14
|
+
status: s,
|
|
15
|
+
props: i,
|
|
16
|
+
examples: r,
|
|
17
|
+
accessibility: c,
|
|
18
|
+
seeAlso: d
|
|
19
|
+
};
|
|
20
|
+
export {
|
|
21
|
+
e as $schema,
|
|
22
|
+
c as accessibility,
|
|
23
|
+
a as category,
|
|
24
|
+
l as default,
|
|
25
|
+
t as description,
|
|
26
|
+
r as examples,
|
|
27
|
+
n as name,
|
|
28
|
+
i as props,
|
|
29
|
+
d as seeAlso,
|
|
30
|
+
o as since,
|
|
31
|
+
s as status
|
|
32
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e="https://nice2dev.com/schemas/component-doc-v1.json",t="NiceDrawingCanvas",n="Freeform drawing canvas with brush tools.",s="editors",a="1.0.0",o="planned",i=[{name:"value",type:"string",description:"Canvas data URL"},{name:"onChange",type:"(dataUrl: string) => void",required:!0,description:"Change callback"},{name:"width",type:"number | string",default:"'100%'",description:"Canvas width"},{name:"height",type:"number | string",default:"400",description:"Canvas height"},{name:"tools",type:"DrawingTool[]",description:"Available tools"},{name:"colors",type:"string[]",description:"Color palette"},{name:"brushSizes",type:"number[]",description:"Brush sizes"},{name:"showToolbar",type:"boolean",default:"true",description:"Show toolbar"},{name:"undoSteps",type:"number",default:"50",description:"Max undo steps"},{name:"disabled",type:"boolean",default:"false",description:"Disabled state"}],r=[{title:"Drawing Canvas",description:"Draw freeform",code:`<NiceDrawingCanvas
|
|
2
|
+
value={drawing}
|
|
3
|
+
onChange={setDrawing}
|
|
4
|
+
width={800}
|
|
5
|
+
height={600}
|
|
6
|
+
tools={['brush', 'eraser', 'line', 'rectangle']}
|
|
7
|
+
showToolbar
|
|
8
|
+
/>`}],c={keyboard:["Tab through tools","Shortcuts for tools"],aria:["Drawing canvas","Tool descriptions"]},l=["NiceSignature","NiceImageEditor"],d={$schema:e,name:t,description:n,category:s,since:a,status:o,props:i,examples:r,accessibility:c,seeAlso:l};exports.$schema=e;exports.accessibility=c;exports.category=s;exports.default=d;exports.description=n;exports.examples=r;exports.name=t;exports.props=i;exports.seeAlso=l;exports.since=a;exports.status=o;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const e=require("react/jsx-runtime"),g=require("./core-CESNSRyS.cjs"),i=require("react"),M={info:e.jsx("svg",{viewBox:"0 0 20 20",fill:"currentColor",children:e.jsx("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})}),success:e.jsx("svg",{viewBox:"0 0 20 20",fill:"currentColor",children:e.jsx("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})}),warning:e.jsx("svg",{viewBox:"0 0 20 20",fill:"currentColor",children:e.jsx("path",{fillRule:"evenodd",d:"M8.485 2.495c.673-1.167 2.357-1.167 3.03 0l6.28 10.875c.673 1.167-.17 2.625-1.516 2.625H3.72c-1.347 0-2.189-1.458-1.515-2.625L8.485 2.495zM10 5a.75.75 0 01.75.75v3.5a.75.75 0 01-1.5 0v-3.5A.75.75 0 0110 5zm0 9a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})}),error:e.jsx("svg",{viewBox:"0 0 20 20",fill:"currentColor",children:e.jsx("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zM8.28 7.22a.75.75 0 00-1.06 1.06L8.94 10l-1.72 1.72a.75.75 0 101.06 1.06L10 11.06l1.72 1.72a.75.75 0 101.06-1.06L11.06 10l1.72-1.72a.75.75 0 00-1.06-1.06L10 8.94 8.28 7.22z",clipRule:"evenodd"})})},V=({variant:s="info",title:t,children:a,closable:r,onClose:n,icon:c,size:l="md",className:h,style:u,displayStyle:p})=>{const b=g.ac("card",p);return e.jsxs("div",{className:`nice-alert nice-alert--${s} nice-alert--${l} nice-alert--ds-${b} ${h||""}`,style:u,role:"alert",children:[e.jsx("div",{className:`nice-alert__icon nice-alert__icon--${s}`,children:c||M[s]}),e.jsxs("div",{className:"nice-alert__content",children:[t&&e.jsx("div",{className:"nice-alert__title",children:t}),e.jsx("div",{children:a})]}),r&&e.jsx("button",{type:"button",className:"nice-alert__close",onClick:n,"aria-label":"Close",children:e.jsx(g.oa,{name:"close",size:16})})]})},U=({open:s,onClose:t,title:a,position:r="right",size:n="md",children:c,footer:l,transitionDuration:h,className:u,style:p,displayStyle:b})=>{const j=g.rc("modal",b),x=g.ac("modal",b),{t:_}=g.Gt(),k=i.useRef(null);return g.Sc(k,s),i.useEffect(()=>{if(!s)return;const f=o=>{o.key==="Escape"&&t()};return document.addEventListener("keydown",f),document.body.style.overflow="hidden",()=>{document.removeEventListener("keydown",f),document.body.style.overflow=""}},[s,t]),s?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"nice-drawer-overlay",onMouseDown:f=>{f.target===f.currentTarget&&t()}}),e.jsxs("div",{ref:k,className:`nice-drawer nice-drawer--${r} nice-drawer--${n} nice-drawer--ds-${x} ${u||""}`,style:{...j,...p,...h!=null?{transitionDuration:`${h}ms`}:{}},role:"dialog","aria-modal":"true","aria-label":a,children:[a&&e.jsxs("div",{className:"nice-drawer__header",children:[e.jsx("h3",{className:"nice-drawer__title",children:a}),e.jsx("button",{type:"button",className:"nice-drawer__close",onClick:t,"aria-label":_("controls.close","Close"),children:e.jsx("svg",{width:"18",height:"18",viewBox:"0 0 20 20",fill:"currentColor",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-drawer__body",children:c}),l&&e.jsx("div",{className:"nice-drawer__footer",children:l})]})]}):null},W=({toasts:s,onDismiss:t,position:a="top-right"})=>e.jsx("div",{className:`nice-toast-container nice-toast-container--${a}`,children:s.map(r=>e.jsx(Y,{toast:r,onDismiss:t},r.id))}),Y=({toast:s,onDismiss:t})=>{const[a,r]=i.useState(!1);return i.useEffect(()=>{if(!s.duration&&s.duration!==0){const n=setTimeout(()=>r(!0),4e3);return()=>clearTimeout(n)}if(s.duration>0){const n=setTimeout(()=>r(!0),s.duration);return()=>clearTimeout(n)}},[s.duration]),i.useEffect(()=>{if(a){const n=setTimeout(()=>t(s.id),200);return()=>clearTimeout(n)}},[a,s.id,t]),e.jsxs("div",{className:`nice-toast nice-toast--${s.variant} ${a?"nice-toast--exiting":""}`,role:"alert",style:{position:"relative"},children:[e.jsx("div",{className:"nice-toast__icon",children:M[s.variant]}),e.jsxs("div",{className:"nice-toast__content",children:[s.title&&e.jsx("div",{className:"nice-toast__title",children:s.title}),e.jsx("div",{className:"nice-toast__message",children:s.message})]}),e.jsx("button",{type:"button",className:"nice-toast__close",onClick:()=>r(!0),"aria-label":"Close",children:e.jsx(g.oa,{name:"close",size:16})})]})};let J=0;function K(){const[s,t]=i.useState([]),a=i.useCallback((n,c,l)=>{const h=`toast-${++J}`;return t(u=>[...u,{id:h,variant:n,message:c,title:l?.title,duration:l?.duration}]),h},[]),r=i.useCallback(n=>{t(c=>c.filter(l=>l.id!==n))},[]);return{toasts:s,dismiss:r,info:(n,c)=>a("info",n,c),success:(n,c)=>a("success",n,c),warning:(n,c)=>a("warning",n,c),error:(n,c)=>a("error",n,c)}}const Q=({error:s,onRetry:t,retryLabel:a="Retry",title:r="Operation failed",autoRetrySeconds:n,variant:c="error",icon:l,size:h="md",className:u,style:p,"data-testid":b})=>{const[j,x]=i.useState(n??0),_=i.useRef(),k=typeof s=="string"?s:s.message,f=i.useCallback(()=>{x(n??0),t()},[t,n]);return i.useEffect(()=>{if(!(!n||n<=0))return x(n),_.current=setInterval(()=>{x(o=>o<=1?(clearInterval(_.current),t(),0):o-1)},1e3),()=>clearInterval(_.current)},[n,t]),e.jsxs("div",{className:`nice-retry-panel nice-retry-panel--${c} nice-retry-panel--${h} ${u||""}`,style:p,role:"alert","data-testid":b,children:[e.jsx("div",{className:"nice-retry-panel__icon",children:l??e.jsx(g.oa,{name:"warning",size:24})}),e.jsxs("div",{className:"nice-retry-panel__content",children:[e.jsx("div",{className:"nice-retry-panel__title",children:r}),e.jsx("p",{className:"nice-retry-panel__message",children:k})]}),e.jsxs("div",{className:"nice-retry-panel__actions",children:[e.jsx("button",{type:"button",className:"nice-btn nice-btn--primary nice-btn--sm",onClick:f,children:a}),n&&j>0&&e.jsxs("span",{className:"nice-retry-panel__countdown",children:["Auto-retry in ",j,"s"]})]})]})};function X(s){return window.addEventListener("online",s),window.addEventListener("offline",s),()=>{window.removeEventListener("online",s),window.removeEventListener("offline",s)}}function Z(){return navigator.onLine}function ee(){return!0}const se=({message:s="You are offline. Some features may be unavailable.",variant:t="warning",icon:a,size:r="md",className:n,style:c,"data-testid":l})=>i.useSyncExternalStore(X,Z,ee)?null:e.jsxs("div",{className:`nice-offline-banner nice-offline-banner--${t} nice-offline-banner--${r} ${n||""}`,style:c,role:"alert","aria-live":"assertive","data-testid":l,children:[e.jsx("span",{className:"nice-offline-banner__icon",children:a??e.jsx(g.oa,{name:"wifi",size:18})}),e.jsx("span",{className:"nice-offline-banner__message",children:s})]});function B({timeoutMs:s=1e4,slowThresholdMs:t=3e3,onTimeout:a,autoRetry:r=!1,autoRetryCount:n=3}={}){const[c,l]=i.useState(!1),[h,u]=i.useState(!1),[p,b]=i.useState(!1),[j,x]=i.useState(0),[_,k]=i.useState(0),f=i.useRef(null),o=i.useRef(null),C=i.useRef(null),w=i.useRef(0),N=i.useCallback(()=>{f.current&&clearTimeout(f.current),o.current&&clearTimeout(o.current),C.current&&clearInterval(C.current)},[]),v=i.useCallback(()=>{N(),l(!0),u(!1),b(!1),x(0),w.current=Date.now(),C.current=setInterval(()=>{x(Date.now()-w.current)},200),f.current=setTimeout(()=>{u(!0)},t),o.current=setTimeout(()=>{b(!0),l(!1),u(!1),N(),a?.()},s)},[N,t,s,a]),$=i.useCallback(()=>{N(),l(!1),u(!1)},[N]),d=i.useCallback(()=>{k(y=>y+1),b(!1),v()},[v]);return i.useEffect(()=>()=>N(),[N]),i.useEffect(()=>{if(r&&p&&_<n){const y=Math.pow(2,_)*1e3,E=setTimeout(()=>d(),y);return()=>clearTimeout(E)}},[r,n,p,_,d]),{isLoading:c,isSlow:h,isTimedOut:p,elapsed:j,retryCount:_,start:v,stop:$,retry:d}}const ne=({timeoutMs:s=1e4,slowThresholdMs:t=3e3,onTimeout:a,onRetry:r,autoRetry:n=!1,autoRetryCount:c=3,showProgress:l=!0,slowMessage:h="Operacja trwa dłużej niż zwykle…",timeoutMessage:u="Przekroczono limit czasu. Spróbuj ponownie.",loading:p,children:b,size:j="md",className:x,style:_,"data-testid":k})=>{const{isSlow:f,isTimedOut:o,elapsed:C,retry:w}=B({timeoutMs:s,slowThresholdMs:t,onTimeout:a,autoRetry:n,autoRetryCount:c}),N=()=>{w(),r?.()};if(!p)return e.jsx(e.Fragment,{children:b});if(o)return e.jsxs("div",{className:`nice-timeout-feedback nice-timeout-feedback--timeout nice-timeout-feedback--${j} ${x??""}`,style:_,role:"alert","data-testid":k,children:[e.jsx("p",{className:"nice-timeout-feedback__message",children:u}),e.jsx("button",{className:"nice-timeout-feedback__retry-btn",onClick:N,type:"button",children:"Spróbuj ponownie"})]});const v=Math.min(100,C/s*100);return e.jsxs("div",{className:`nice-timeout-feedback nice-timeout-feedback--${j} ${f?"nice-timeout-feedback--slow":""} ${x??""}`,style:_,"data-testid":k,children:[e.jsx("div",{className:"nice-timeout-feedback__spinner","aria-busy":"true"}),f&&e.jsx("p",{className:"nice-timeout-feedback__slow-msg",children:h}),l&&e.jsx("div",{className:"nice-timeout-feedback__progress",role:"progressbar","aria-valuenow":v,"aria-valuemin":0,"aria-valuemax":100,children:e.jsx("div",{className:"nice-timeout-feedback__progress-bar",style:{width:`${v}%`}})})]})},O=i.forwardRef(({visible:s,onAcceptAll:t,onRejectAll:a,onSave:r,categories:n=["necessary","analytics","marketing","preferences"],defaults:c,position:l="bottom",size:h="md",policyUrl:u,showDetails:p=!1,className:b,style:j,id:x,..._},k)=>{const f=g.hc(x),{t:o}=g.Gt(),[C,w]=i.useState(!0),N=s??C,[v,$]=i.useState(p),[d,y]=i.useState(()=>{const m={necessary:!0,analytics:!1,marketing:!1,preferences:!1};return c&&Object.assign(m,c),m.necessary=!0,m}),E={necessary:o("cookie.necessary","Necessary"),analytics:o("cookie.analytics","Analytics"),marketing:o("cookie.marketing","Marketing"),preferences:o("cookie.preferences","Preferences")},S={necessary:o("cookie.necessaryDesc","Required for the website to function. Cannot be disabled."),analytics:o("cookie.analyticsDesc","Help us understand how visitors interact with the website."),marketing:o("cookie.marketingDesc","Used to deliver relevant advertisements."),preferences:o("cookie.preferencesDesc","Allow the website to remember your choices.")},z=i.useCallback(()=>{const m={necessary:!0,analytics:!0,marketing:!0,preferences:!0};t?.(),r?.(m),w(!1)},[t,r]),L=i.useCallback(()=>{const m={necessary:!0,analytics:!1,marketing:!1,preferences:!1};a?.(),r?.(m),w(!1)},[a,r]),I=i.useCallback(()=>{r?.({...d,necessary:!0}),w(!1)},[d,r]);return N?e.jsx("div",{ref:k,id:f,className:`nice-cookie-consent nice-cookie-consent--${l} nice-cookie-consent--${h} ${b??""}`,style:j,role:"dialog","aria-label":o("cookie.label","Cookie Consent"),"aria-modal":"true",..._,children:e.jsxs("div",{className:"nice-cookie-consent__content",children:[e.jsxs("p",{className:"nice-cookie-consent__message",children:[o("cookie.message","We use cookies to enhance your experience. By continuing to visit this site you agree to our use of cookies."),u&&e.jsxs(e.Fragment,{children:[" ",e.jsx("a",{href:u,className:"nice-cookie-consent__link",target:"_blank",rel:"noopener noreferrer",children:o("cookie.learnMore","Learn more")})]})]}),v&&e.jsx("div",{className:"nice-cookie-consent__details",children:n.map(m=>e.jsxs("label",{className:"nice-cookie-consent__category",children:[e.jsx("input",{type:"checkbox",checked:d[m],disabled:m==="necessary",onChange:D=>y(R=>({...R,[m]:D.target.checked})),className:"nice-cookie-consent__checkbox"}),e.jsxs("div",{className:"nice-cookie-consent__cat-info",children:[e.jsx("strong",{children:E[m]}),e.jsx("span",{className:"nice-cookie-consent__cat-desc",children:S[m]})]})]},m))}),e.jsxs("div",{className:"nice-cookie-consent__actions",children:[!v&&e.jsx("button",{type:"button",className:"nice-cookie-consent__btn nice-cookie-consent__btn--details",onClick:()=>$(!0),children:o("cookie.customize","Customize")}),v&&e.jsx("button",{type:"button",className:"nice-cookie-consent__btn nice-cookie-consent__btn--save",onClick:I,children:o("cookie.savePreferences","Save preferences")}),e.jsx("button",{type:"button",className:"nice-cookie-consent__btn nice-cookie-consent__btn--reject",onClick:L,children:o("cookie.rejectAll","Reject all")}),e.jsx("button",{type:"button",className:"nice-cookie-consent__btn nice-cookie-consent__btn--accept",onClick:z,children:o("cookie.acceptAll","Accept all")})]})]})}):null});O.displayName="NiceCookieConsent";const H=i.forwardRef(({onSubmit:s,onForgotPassword:t,onRegister:a,loading:r=!1,error:n,variant:c="primary",size:l="md",showRememberMe:h=!0,showForgotPassword:u=!0,showRegister:p=!1,title:b,logo:j,usernameLabel:x,passwordLabel:_,usernamePlaceholder:k,passwordPlaceholder:f,className:o,style:C,id:w,...N},v)=>{const $=g.hc(w),{t:d}=g.Gt(),[y,E]=i.useState(""),[S,z]=i.useState(""),[L,I]=i.useState(!1),[m,D]=i.useState(!1),R=`${$}-user`,F=`${$}-pass`,q=`${$}-remember`,G=i.useCallback(T=>{T.preventDefault(),!r&&s?.({username:y,password:S,rememberMe:L})},[r,y,S,L,s]);return e.jsxs("form",{ref:v,id:$,className:`nice-login nice-login--${c} nice-login--${l} ${o??""}`,style:C,onSubmit:G,noValidate:!0,...N,children:[j&&e.jsx("div",{className:"nice-login__logo",children:j}),b&&e.jsx("h2",{className:"nice-login__title",children:b??d("login.title","Sign In")}),n&&e.jsx("div",{className:"nice-login__error",role:"alert",children:n}),e.jsxs("div",{className:"nice-login__field",children:[e.jsx("label",{htmlFor:R,className:"nice-login__label",children:x??d("login.username","Username")}),e.jsx("input",{id:R,className:"nice-login__input",type:"text",value:y,onChange:T=>E(T.target.value),placeholder:k??d("login.usernamePlaceholder","Enter your username"),autoComplete:"username",required:!0,disabled:r,"aria-required":"true"})]}),e.jsxs("div",{className:"nice-login__field",children:[e.jsx("label",{htmlFor:F,className:"nice-login__label",children:_??d("login.password","Password")}),e.jsxs("div",{className:"nice-login__password-wrap",children:[e.jsx("input",{id:F,className:"nice-login__input",type:m?"text":"password",value:S,onChange:T=>z(T.target.value),placeholder:f??d("login.passwordPlaceholder","Enter your password"),autoComplete:"current-password",required:!0,disabled:r,"aria-required":"true"}),e.jsx("button",{type:"button",className:"nice-login__toggle-password",onClick:()=>D(!m),"aria-label":m?d("login.hidePassword","Hide password"):d("login.showPassword","Show password"),tabIndex:-1,children:e.jsx(g.oa,{name:m?"eye-off":"eye",size:16})})]})]}),e.jsxs("div",{className:"nice-login__options",children:[h&&e.jsxs("label",{className:"nice-login__remember",htmlFor:q,children:[e.jsx("input",{id:q,type:"checkbox",checked:L,onChange:T=>I(T.target.checked),disabled:r}),e.jsx("span",{children:d("login.rememberMe","Remember me")})]}),u&&t&&e.jsx("button",{type:"button",className:"nice-login__forgot",onClick:t,disabled:r,children:d("login.forgotPassword","Forgot password?")})]}),e.jsx("button",{type:"submit",className:`nice-login__submit nice-login__submit--${c}`,disabled:r||!y||!S,children:r?d("login.loading","Signing in..."):d("login.submit","Sign In")}),p&&a&&e.jsxs("p",{className:"nice-login__register",children:[d("login.noAccount","Don't have an account?")," ",e.jsx("button",{type:"button",className:"nice-login__register-link",onClick:a,disabled:r,children:d("login.register","Register")})]})]})});H.displayName="NiceLoginForm";const A=class A extends i.Component{constructor(){super(...arguments),this.state={hasError:!1,error:null},this.handleReset=()=>{this.setState({hasError:!1,error:null})}}static getDerivedStateFromError(t){return{hasError:!0,error:t}}componentDidCatch(t,a){this.props.onError?.(t,a)}render(){if(this.state.hasError&&this.state.error){const{fallback:t,showRetry:a=!0,retryLabel:r="Retry",title:n="Something went wrong"}=this.props;return typeof t=="function"?t(this.state.error,this.handleReset):t||e.jsxs("div",{className:"nice-error-boundary",role:"alert",children:[e.jsx("div",{className:"nice-error-boundary__icon",children:e.jsx(g.oa,{name:"warning",size:32})}),e.jsx("h2",{className:"nice-error-boundary__title",children:n}),e.jsx("p",{className:"nice-error-boundary__message",children:this.state.error.message}),a&&e.jsx("button",{type:"button",className:"nice-btn nice-btn--primary",onClick:this.handleReset,children:r})]})}return this.props.children}};A.displayName="NiceErrorBoundary";let P=A;exports.NiceAlert=V;exports.NiceCookieConsent=O;exports.NiceDrawer=U;exports.NiceErrorBoundary=P;exports.NiceLoginForm=H;exports.NiceOfflineBanner=se;exports.NiceRetryPanel=Q;exports.NiceTimeoutFeedback=ne;exports.NiceToastContainer=W;exports.alertIcons=M;exports.useNiceTimeout=B;exports.useNiceToast=K;
|