@nice2dev/ui 1.0.6 → 1.0.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/NiceAPIFlow.doc-DnQLPUie.js +30 -0
- package/dist/NiceAPIFlow.doc-Dx4qw1lm.cjs +6 -0
- package/dist/NiceBranchManager.doc-BXjiENlD.cjs +6 -0
- package/dist/NiceBranchManager.doc-xLB82YwU.js +30 -0
- package/dist/NiceButton-CDiS45Ya.cjs +1 -0
- package/dist/NiceButton-D9l39Rs7.js +595 -0
- package/dist/NiceCodeTemplate.doc-BWxTE4C_.cjs +6 -0
- package/dist/NiceCodeTemplate.doc-CA2U5F-v.js +30 -0
- package/dist/NiceDataBranchGraph.doc-CkitupWc.js +29 -0
- package/dist/NiceDataBranchGraph.doc-DDUgipqH.cjs +5 -0
- package/dist/NiceDataBranchManager.doc-B0ODKOs4.js +30 -0
- package/dist/NiceDataBranchManager.doc-CC5o8ihs.cjs +6 -0
- package/dist/NiceDataConflictResolver.doc-CdzScNie.cjs +5 -0
- package/dist/NiceDataConflictResolver.doc-V8vxYAeo.js +29 -0
- package/dist/NiceDataDiffViewer.doc-CR14Bq3A.cjs +6 -0
- package/dist/NiceDataDiffViewer.doc-w2I2QjhX.js +30 -0
- package/dist/NiceDataMapper.doc-C7jSyHRM.js +30 -0
- package/dist/NiceDataMapper.doc-DXjQHz87.cjs +6 -0
- package/dist/NiceDataMergeBuilder.doc-CV32WC_w.cjs +6 -0
- package/dist/NiceDataMergeBuilder.doc-DtuYb3nx.js +30 -0
- package/dist/NiceDataSnapshot.doc-CFLkY3ry.js +30 -0
- package/dist/NiceDataSnapshot.doc-CpZyQ17u.cjs +6 -0
- package/dist/NiceErrorBoundary-B5nF-OVn.cjs +1 -0
- package/dist/NiceErrorBoundary-BAeqfoSc.cjs +1 -0
- package/dist/NiceErrorBoundary-D75yr_WE.js +762 -0
- package/dist/NiceErrorBoundary-niMx1aSJ.js +837 -0
- package/dist/NiceEventOrchestrator.doc-C4SJfIDV.js +30 -0
- package/dist/NiceEventOrchestrator.doc-CxjsLxBG.cjs +6 -0
- package/dist/NiceForm-CKoJA6NG.js +5131 -0
- package/dist/NiceForm-D7xnpnRJ.cjs +382 -0
- package/dist/NiceForm.css +1 -0
- package/dist/NiceGitBlame.doc-BG3_K9_0.cjs +6 -0
- package/dist/NiceGitBlame.doc-DrJABEat.js +30 -0
- package/dist/NiceGitConflictResolver.doc-BK7hAfz6.js +30 -0
- package/dist/NiceGitConflictResolver.doc-CgroGM9_.cjs +6 -0
- package/dist/NiceGitDiffViewer.doc-BAwgcY_3.cjs +6 -0
- package/dist/NiceGitDiffViewer.doc-BXKJeP-E.js +30 -0
- package/dist/NiceGitGraph.doc-B-WtGuzn.cjs +5 -0
- package/dist/NiceGitGraph.doc-DxnDPCgC.js +29 -0
- package/dist/NiceGitHooks.doc-BrEizvMp.js +29 -0
- package/dist/NiceGitHooks.doc-C4EdV5zj.cjs +5 -0
- package/dist/NiceMergeRequestBuilder.doc-C5p8mYuh.cjs +6 -0
- package/dist/NiceMergeRequestBuilder.doc-Ct9RCmU8.js +30 -0
- package/dist/NiceModal-1QX7NhyH.js +95 -0
- package/dist/NiceModal-CAwsKVQ2.cjs +1 -0
- package/dist/NiceModuleLifecyclePanel-Brg1RLwi.cjs +1 -0
- package/dist/NiceModuleLifecyclePanel-C9xMSjOF.cjs +1 -0
- package/dist/NiceModuleLifecyclePanel-CMrPbSw9.js +5249 -0
- package/dist/NiceModuleLifecyclePanel-I_TXRiiY.js +5053 -0
- package/dist/NiceModuleLifecyclePanel.css +1 -0
- package/dist/NicePagination-DbE-uOkl.js +171 -0
- package/dist/NicePagination-DlealakT.cjs +1 -0
- package/dist/NicePinCodeInput-B8cI8zu8.js +11830 -0
- package/dist/NicePinCodeInput-CrMfdxxc.js +15287 -0
- package/dist/NicePinCodeInput-D0aF9MK8.cjs +692 -0
- package/dist/NicePinCodeInput-SGQaHvpE.cjs +419 -0
- package/dist/NicePinCodeInput.css +1 -1
- package/dist/NicePipelineEditor.doc-0eGt8zbX.cjs +5 -0
- package/dist/NicePipelineEditor.doc-DTmaOebn.js +29 -0
- package/dist/NicePipelineMonitor.doc-67CmsRcf.cjs +5 -0
- package/dist/NicePipelineMonitor.doc-mSMdhuG8.js +29 -0
- package/dist/NiceSavedQueryPanel-BZNvqSQW.cjs +596 -0
- package/dist/NiceSavedQueryPanel-CUAsdOjJ.js +6190 -0
- package/dist/NiceSavedQueryPanel-CZ5bYOe_.js +6449 -0
- package/dist/NiceSavedQueryPanel-Ce2s060j.cjs +596 -0
- package/dist/NiceStateDesigner.doc-B36u0hNU.js +29 -0
- package/dist/NiceStateDesigner.doc-MPmvNHSx.cjs +5 -0
- package/dist/NiceTabs-DvOmxKyQ.cjs +1 -0
- package/dist/NiceTabs-DzLHzwuA.js +1636 -0
- package/dist/NiceTestBuilder.doc-BFInj8GJ.js +30 -0
- package/dist/NiceTestBuilder.doc-CB03U_uR.cjs +6 -0
- package/dist/NiceToggle-CaY1u82g.js +277 -0
- package/dist/NiceToggle-DFJFQv_Z.cjs +1 -0
- package/dist/NiceWindow-CVgkxcCz.cjs +1 -0
- package/dist/NiceWindow-DeC83yfE.js +1409 -0
- package/dist/NiceWindow-IdHAcP70.cjs +1 -0
- package/dist/NiceWindow-SiCaREbq.js +1408 -0
- package/dist/charts-BAS21jkC.js +4621 -0
- package/dist/charts-Bx_kNBsE.js +4280 -0
- package/dist/charts-DECVsCHX.cjs +754 -0
- package/dist/charts-DShUbWrP.cjs +759 -0
- package/dist/charts.cjs +1 -1
- package/dist/charts.css +1 -0
- package/dist/charts.d.ts +45 -48
- package/dist/charts.mjs +1 -1
- package/dist/core-BZBTsGWN.cjs +96 -0
- package/dist/core-BpghV7Ls.js +17555 -0
- package/dist/core-C2ZmWe_u.cjs +96 -0
- package/dist/core-Da43q-pO.js +22094 -0
- package/dist/data-branching-CJlrg8qf.cjs +1 -0
- package/dist/data-branching-DCUwI53s.js +6121 -0
- package/dist/data-branching-De4ExX-S.cjs +1 -0
- package/dist/data-branching-DiRfob1f.js +6071 -0
- package/dist/data-branching.cjs +1 -0
- package/dist/data-branching.d.ts +364 -0
- package/dist/data-branching.mjs +9 -0
- package/dist/data.cjs +1 -1
- package/dist/data.d.ts +206 -192
- package/dist/data.mjs +1 -1
- package/dist/devops-BnYinjkT.cjs +17 -0
- package/dist/devops-CXynFG3X.cjs +17 -0
- package/dist/devops-Ckh57eti.js +7198 -0
- package/dist/devops-D0TfzV5B.js +7660 -0
- package/dist/devops.cjs +1 -0
- package/dist/devops.d.ts +721 -0
- package/dist/devops.mjs +12 -0
- package/dist/editors.cjs +1 -1
- package/dist/editors.d.ts +311 -393
- package/dist/editors.mjs +61 -64
- package/dist/feedback.cjs +1 -1
- package/dist/feedback.d.ts +3 -44
- package/dist/feedback.mjs +11 -10
- package/dist/index-B8wxZ8Ps.cjs +5192 -0
- package/dist/index-CBIZ6mTQ.cjs +5734 -0
- package/dist/index-CIl98Vbm.js +72951 -0
- package/dist/index-pAuGTbuB.js +57319 -0
- package/dist/index.cjs +1 -1
- package/dist/index.css +1 -1
- package/dist/index.d.ts +4673 -10015
- package/dist/index.mjs +880 -969
- package/dist/lazy.cjs +1 -0
- package/dist/lazy.d.ts +1848 -0
- package/dist/lazy.mjs +98 -0
- package/dist/navigation.cjs +1 -1
- package/dist/navigation.d.ts +151 -216
- package/dist/navigation.mjs +111 -48
- package/dist/no-code-B5bzduNP.cjs +332 -0
- package/dist/no-code-BCuadkm4.cjs +332 -0
- package/dist/no-code-D8RJ7lx0.js +7064 -0
- package/dist/no-code-TL7PyulA.js +7005 -0
- package/dist/no-code.cjs +1 -0
- package/dist/no-code.d.ts +833 -0
- package/dist/no-code.mjs +13 -0
- package/dist/overlays.cjs +1 -1
- package/dist/overlays.d.ts +13 -45
- package/dist/overlays.mjs +490 -24
- package/package.json +24 -2
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
const n = "https://nice2dev.com/schemas/component-doc-v1.json", e = "NiceDataBranchManager", t = "Environment management panel for DEV, TEST, UAT, STAGING, PROD data environments.", a = "data-branching", o = "1.0.7", r = "stable", i = [{ name: "environments", type: "DataEnvironment[]", required: !0, description: "Available environments" }, { name: "currentEnvironment", type: "string", description: "Currently selected environment" }, { name: "onSelect", type: "(env: string) => void", description: "Environment selection callback" }, { name: "onCreateBranch", type: "(name: string, from: string) => Promise<void>", description: "Create data branch callback" }, { name: "onPromote", type: "(from: string, to: string) => Promise<void>", description: "Promote data callback" }], c = [{ title: "Data Branch Manager", description: "Manage data environments", code: `<NiceDataBranchManager
|
|
2
|
+
environments={envList}
|
|
3
|
+
currentEnvironment="DEV"
|
|
4
|
+
onSelect={handleSelect}
|
|
5
|
+
onPromote={handlePromote}
|
|
6
|
+
/>` }], s = { role: "region", ariaLabel: "Data environment manager" }, m = ["NiceDataSnapshot", "NiceDataMergeBuilder"], l = {
|
|
7
|
+
$schema: n,
|
|
8
|
+
name: e,
|
|
9
|
+
description: t,
|
|
10
|
+
category: a,
|
|
11
|
+
since: o,
|
|
12
|
+
status: r,
|
|
13
|
+
props: i,
|
|
14
|
+
examples: c,
|
|
15
|
+
accessibility: s,
|
|
16
|
+
seeAlso: m
|
|
17
|
+
};
|
|
18
|
+
export {
|
|
19
|
+
n as $schema,
|
|
20
|
+
s as accessibility,
|
|
21
|
+
a as category,
|
|
22
|
+
l as default,
|
|
23
|
+
t as description,
|
|
24
|
+
c as examples,
|
|
25
|
+
e as name,
|
|
26
|
+
i as props,
|
|
27
|
+
m as seeAlso,
|
|
28
|
+
o as since,
|
|
29
|
+
r as status
|
|
30
|
+
};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e="https://nice2dev.com/schemas/component-doc-v1.json",n="NiceDataBranchManager",t="Environment management panel for DEV, TEST, UAT, STAGING, PROD data environments.",a="data-branching",o="1.0.7",r="stable",i=[{name:"environments",type:"DataEnvironment[]",required:!0,description:"Available environments"},{name:"currentEnvironment",type:"string",description:"Currently selected environment"},{name:"onSelect",type:"(env: string) => void",description:"Environment selection callback"},{name:"onCreateBranch",type:"(name: string, from: string) => Promise<void>",description:"Create data branch callback"},{name:"onPromote",type:"(from: string, to: string) => Promise<void>",description:"Promote data callback"}],c=[{title:"Data Branch Manager",description:"Manage data environments",code:`<NiceDataBranchManager
|
|
2
|
+
environments={envList}
|
|
3
|
+
currentEnvironment="DEV"
|
|
4
|
+
onSelect={handleSelect}
|
|
5
|
+
onPromote={handlePromote}
|
|
6
|
+
/>`}],s={role:"region",ariaLabel:"Data environment manager"},m=["NiceDataSnapshot","NiceDataMergeBuilder"],l={$schema:e,name:n,description:t,category:a,since:o,status:r,props:i,examples:c,accessibility:s,seeAlso:m};exports.$schema=e;exports.accessibility=s;exports.category=a;exports.default=l;exports.description=t;exports.examples=c;exports.name=n;exports.props=i;exports.seeAlso=m;exports.since=o;exports.status=r;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e="https://nice2dev.com/schemas/component-doc-v1.json",o="NiceDataConflictResolver",t="Resolve data conflicts during merge with side-by-side comparison and resolution actions.",s="data-branching",c="1.0.7",i="stable",l=[{name:"conflicts",type:"DataConflict[]",required:!0,description:"List of conflicts"},{name:"onResolve",type:"(resolution: ConflictResolution) => void",description:"Resolve conflict callback"},{name:"onResolveAll",type:"(strategy: 'source' | 'target') => void",description:"Resolve all callback"},{name:"showFieldDiff",type:"boolean",default:!0,description:"Show field-level diff"}],n=[{title:"Data Conflict Resolver",description:"Resolve merge conflicts",code:`<NiceDataConflictResolver
|
|
2
|
+
conflicts={mergeConflicts}
|
|
3
|
+
onResolve={handleResolve}
|
|
4
|
+
onResolveAll={handleResolveAll}
|
|
5
|
+
/>`}],a={role:"region",ariaLabel:"Data conflict resolver"},r=["NiceDataMergeBuilder","NiceGitConflictResolver"],d={$schema:e,name:o,description:t,category:s,since:c,status:i,props:l,examples:n,accessibility:a,seeAlso:r};exports.$schema=e;exports.accessibility=a;exports.category=s;exports.default=d;exports.description=t;exports.examples=n;exports.name=o;exports.props=l;exports.seeAlso=r;exports.since=c;exports.status=i;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
const e = "https://nice2dev.com/schemas/component-doc-v1.json", o = "NiceDataConflictResolver", t = "Resolve data conflicts during merge with side-by-side comparison and resolution actions.", s = "data-branching", c = "1.0.7", l = "stable", n = [{ name: "conflicts", type: "DataConflict[]", required: !0, description: "List of conflicts" }, { name: "onResolve", type: "(resolution: ConflictResolution) => void", description: "Resolve conflict callback" }, { name: "onResolveAll", type: "(strategy: 'source' | 'target') => void", description: "Resolve all callback" }, { name: "showFieldDiff", type: "boolean", default: !0, description: "Show field-level diff" }], i = [{ title: "Data Conflict Resolver", description: "Resolve merge conflicts", code: `<NiceDataConflictResolver
|
|
2
|
+
conflicts={mergeConflicts}
|
|
3
|
+
onResolve={handleResolve}
|
|
4
|
+
onResolveAll={handleResolveAll}
|
|
5
|
+
/>` }], a = { role: "region", ariaLabel: "Data conflict resolver" }, r = ["NiceDataMergeBuilder", "NiceGitConflictResolver"], d = {
|
|
6
|
+
$schema: e,
|
|
7
|
+
name: o,
|
|
8
|
+
description: t,
|
|
9
|
+
category: s,
|
|
10
|
+
since: c,
|
|
11
|
+
status: l,
|
|
12
|
+
props: n,
|
|
13
|
+
examples: i,
|
|
14
|
+
accessibility: a,
|
|
15
|
+
seeAlso: r
|
|
16
|
+
};
|
|
17
|
+
export {
|
|
18
|
+
e as $schema,
|
|
19
|
+
a as accessibility,
|
|
20
|
+
s as category,
|
|
21
|
+
d as default,
|
|
22
|
+
t as description,
|
|
23
|
+
i as examples,
|
|
24
|
+
o as name,
|
|
25
|
+
n as props,
|
|
26
|
+
r as seeAlso,
|
|
27
|
+
c as since,
|
|
28
|
+
l as status
|
|
29
|
+
};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e="https://nice2dev.com/schemas/component-doc-v1.json",t="NiceDataDiffViewer",i="Compare data records between environments with field-level diff highlighting.",n="data-branching",a="1.0.7",o="stable",s=[{name:"sourceData",type:"Record<string, unknown>",required:!0,description:"Source environment data"},{name:"targetData",type:"Record<string, unknown>",required:!0,description:"Target environment data"},{name:"entity",type:"string",description:"Entity type name"},{name:"mode",type:"'split' | 'inline'",default:"split",description:"Display mode"},{name:"onFieldSelect",type:"(field: string) => void",description:"Field selection callback"}],c=[{title:"Data Diff Viewer",description:"Compare records between environments",code:`<NiceDataDiffViewer
|
|
2
|
+
sourceData={devRecord}
|
|
3
|
+
targetData={testRecord}
|
|
4
|
+
entity="Customer"
|
|
5
|
+
mode="split"
|
|
6
|
+
/>`}],r={role:"region",ariaLabel:"Data comparison viewer"},d=["NiceDataBranchGraph","NiceDataConflictResolver"],l={$schema:e,name:t,description:i,category:n,since:a,status:o,props:s,examples:c,accessibility:r,seeAlso:d};exports.$schema=e;exports.accessibility=r;exports.category=n;exports.default=l;exports.description=i;exports.examples=c;exports.name=t;exports.props=s;exports.seeAlso=d;exports.since=a;exports.status=o;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
const e = "https://nice2dev.com/schemas/component-doc-v1.json", t = "NiceDataDiffViewer", n = "Compare data records between environments with field-level diff highlighting.", i = "data-branching", a = "1.0.7", o = "stable", r = [{ name: "sourceData", type: "Record<string, unknown>", required: !0, description: "Source environment data" }, { name: "targetData", type: "Record<string, unknown>", required: !0, description: "Target environment data" }, { name: "entity", type: "string", description: "Entity type name" }, { name: "mode", type: "'split' | 'inline'", default: "split", description: "Display mode" }, { name: "onFieldSelect", type: "(field: string) => void", description: "Field selection callback" }], s = [{ title: "Data Diff Viewer", description: "Compare records between environments", code: `<NiceDataDiffViewer
|
|
2
|
+
sourceData={devRecord}
|
|
3
|
+
targetData={testRecord}
|
|
4
|
+
entity="Customer"
|
|
5
|
+
mode="split"
|
|
6
|
+
/>` }], c = { role: "region", ariaLabel: "Data comparison viewer" }, d = ["NiceDataBranchGraph", "NiceDataConflictResolver"], l = {
|
|
7
|
+
$schema: e,
|
|
8
|
+
name: t,
|
|
9
|
+
description: n,
|
|
10
|
+
category: i,
|
|
11
|
+
since: a,
|
|
12
|
+
status: o,
|
|
13
|
+
props: r,
|
|
14
|
+
examples: s,
|
|
15
|
+
accessibility: c,
|
|
16
|
+
seeAlso: d
|
|
17
|
+
};
|
|
18
|
+
export {
|
|
19
|
+
e as $schema,
|
|
20
|
+
c as accessibility,
|
|
21
|
+
i as category,
|
|
22
|
+
l as default,
|
|
23
|
+
n as description,
|
|
24
|
+
s as examples,
|
|
25
|
+
t as name,
|
|
26
|
+
r as props,
|
|
27
|
+
d as seeAlso,
|
|
28
|
+
a as since,
|
|
29
|
+
o as status
|
|
30
|
+
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
const e = "https://nice2dev.com/schemas/component-doc-v1.json", a = "NiceDataMapper", t = "Visual data mapping tool with source-to-target field connections and transformations.", n = "no-code", c = "1.0.7", s = "stable", i = [{ name: "sourceSchema", type: "DataSchema", required: !0, description: "Source data schema" }, { name: "targetSchema", type: "DataSchema", required: !0, description: "Target data schema" }, { name: "mappings", type: "FieldMapping[]", description: "Current field mappings" }, { name: "onChange", type: "(mappings: FieldMapping[]) => void", description: "Mapping change callback" }, { name: "transformers", type: "Transformer[]", description: "Available transformers" }], o = [{ title: "Data Mapper", description: "Map fields between schemas", code: `<NiceDataMapper
|
|
2
|
+
sourceSchema={inputSchema}
|
|
3
|
+
targetSchema={outputSchema}
|
|
4
|
+
mappings={fieldMappings}
|
|
5
|
+
onChange={handleMappingChange}
|
|
6
|
+
/>` }], p = { role: "application", ariaLabel: "Data field mapper" }, r = ["NiceAPIFlow", "NiceSchemaEditor"], m = {
|
|
7
|
+
$schema: e,
|
|
8
|
+
name: a,
|
|
9
|
+
description: t,
|
|
10
|
+
category: n,
|
|
11
|
+
since: c,
|
|
12
|
+
status: s,
|
|
13
|
+
props: i,
|
|
14
|
+
examples: o,
|
|
15
|
+
accessibility: p,
|
|
16
|
+
seeAlso: r
|
|
17
|
+
};
|
|
18
|
+
export {
|
|
19
|
+
e as $schema,
|
|
20
|
+
p as accessibility,
|
|
21
|
+
n as category,
|
|
22
|
+
m as default,
|
|
23
|
+
t as description,
|
|
24
|
+
o as examples,
|
|
25
|
+
a as name,
|
|
26
|
+
i as props,
|
|
27
|
+
r as seeAlso,
|
|
28
|
+
c as since,
|
|
29
|
+
s as status
|
|
30
|
+
};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e="https://nice2dev.com/schemas/component-doc-v1.json",a="NiceDataMapper",t="Visual data mapping tool with source-to-target field connections and transformations.",n="no-code",s="1.0.7",c="stable",i=[{name:"sourceSchema",type:"DataSchema",required:!0,description:"Source data schema"},{name:"targetSchema",type:"DataSchema",required:!0,description:"Target data schema"},{name:"mappings",type:"FieldMapping[]",description:"Current field mappings"},{name:"onChange",type:"(mappings: FieldMapping[]) => void",description:"Mapping change callback"},{name:"transformers",type:"Transformer[]",description:"Available transformers"}],o=[{title:"Data Mapper",description:"Map fields between schemas",code:`<NiceDataMapper
|
|
2
|
+
sourceSchema={inputSchema}
|
|
3
|
+
targetSchema={outputSchema}
|
|
4
|
+
mappings={fieldMappings}
|
|
5
|
+
onChange={handleMappingChange}
|
|
6
|
+
/>`}],p={role:"application",ariaLabel:"Data field mapper"},r=["NiceAPIFlow","NiceSchemaEditor"],m={$schema:e,name:a,description:t,category:n,since:s,status:c,props:i,examples:o,accessibility:p,seeAlso:r};exports.$schema=e;exports.accessibility=p;exports.category=n;exports.default=m;exports.description=t;exports.examples=o;exports.name=a;exports.props=i;exports.seeAlso=r;exports.since=s;exports.status=c;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e="https://nice2dev.com/schemas/component-doc-v1.json",t="NiceDataMergeBuilder",n="Build and execute data merges between environments with preview and rollback.",i="data-branching",r="1.0.7",s="stable",a=[{name:"sourceEnv",type:"string",required:!0,description:"Source environment"},{name:"targetEnv",type:"string",required:!0,description:"Target environment"},{name:"entities",type:"EntitySelection[]",description:"Selected entities to merge"},{name:"onPreview",type:"() => Promise<MergePreview>",description:"Preview merge callback"},{name:"onMerge",type:"(options: MergeOptions) => Promise<void>",description:"Execute merge callback"}],c=[{title:"Data Merge Builder",description:"Merge data between environments",code:`<NiceDataMergeBuilder
|
|
2
|
+
sourceEnv="TEST"
|
|
3
|
+
targetEnv="UAT"
|
|
4
|
+
entities={selectedEntities}
|
|
5
|
+
onMerge={handleMerge}
|
|
6
|
+
/>`}],o={role:"form",ariaLabel:"Data merge builder"},d=["NiceDataBranchManager","NiceDataConflictResolver"],l={$schema:e,name:t,description:n,category:i,since:r,status:s,props:a,examples:c,accessibility:o,seeAlso:d};exports.$schema=e;exports.accessibility=o;exports.category=i;exports.default=l;exports.description=n;exports.examples=c;exports.name=t;exports.props=a;exports.seeAlso=d;exports.since=r;exports.status=s;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
const e = "https://nice2dev.com/schemas/component-doc-v1.json", t = "NiceDataMergeBuilder", n = "Build and execute data merges between environments with preview and rollback.", i = "data-branching", r = "1.0.7", a = "stable", o = [{ name: "sourceEnv", type: "string", required: !0, description: "Source environment" }, { name: "targetEnv", type: "string", required: !0, description: "Target environment" }, { name: "entities", type: "EntitySelection[]", description: "Selected entities to merge" }, { name: "onPreview", type: "() => Promise<MergePreview>", description: "Preview merge callback" }, { name: "onMerge", type: "(options: MergeOptions) => Promise<void>", description: "Execute merge callback" }], c = [{ title: "Data Merge Builder", description: "Merge data between environments", code: `<NiceDataMergeBuilder
|
|
2
|
+
sourceEnv="TEST"
|
|
3
|
+
targetEnv="UAT"
|
|
4
|
+
entities={selectedEntities}
|
|
5
|
+
onMerge={handleMerge}
|
|
6
|
+
/>` }], s = { role: "form", ariaLabel: "Data merge builder" }, d = ["NiceDataBranchManager", "NiceDataConflictResolver"], l = {
|
|
7
|
+
$schema: e,
|
|
8
|
+
name: t,
|
|
9
|
+
description: n,
|
|
10
|
+
category: i,
|
|
11
|
+
since: r,
|
|
12
|
+
status: a,
|
|
13
|
+
props: o,
|
|
14
|
+
examples: c,
|
|
15
|
+
accessibility: s,
|
|
16
|
+
seeAlso: d
|
|
17
|
+
};
|
|
18
|
+
export {
|
|
19
|
+
e as $schema,
|
|
20
|
+
s as accessibility,
|
|
21
|
+
i as category,
|
|
22
|
+
l as default,
|
|
23
|
+
n as description,
|
|
24
|
+
c as examples,
|
|
25
|
+
t as name,
|
|
26
|
+
o as props,
|
|
27
|
+
d as seeAlso,
|
|
28
|
+
r as since,
|
|
29
|
+
a as status
|
|
30
|
+
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
const e = "https://nice2dev.com/schemas/component-doc-v1.json", t = "NiceDataSnapshot", n = "Create and restore data snapshots with retention policies and metadata.", a = "data-branching", s = "1.0.7", o = "stable", i = [{ name: "snapshots", type: "DataSnapshot[]", required: !0, description: "List of snapshots" }, { name: "environment", type: "string", description: "Current environment" }, { name: "onCreate", type: "(name: string, description?: string) => Promise<void>", description: "Create snapshot callback" }, { name: "onRestore", type: "(snapshotId: string) => Promise<void>", description: "Restore snapshot callback" }, { name: "onDelete", type: "(snapshotId: string) => Promise<void>", description: "Delete snapshot callback" }, { name: "retentionDays", type: "number", default: 30, description: "Default retention period" }], r = [{ title: "Data Snapshot", description: "Manage data snapshots", code: `<NiceDataSnapshot
|
|
2
|
+
snapshots={envSnapshots}
|
|
3
|
+
environment="PROD"
|
|
4
|
+
onCreate={handleCreate}
|
|
5
|
+
onRestore={handleRestore}
|
|
6
|
+
/>` }], c = { role: "region", ariaLabel: "Data snapshot manager" }, p = ["NiceDataBranchManager", "NiceBackupManager"], d = {
|
|
7
|
+
$schema: e,
|
|
8
|
+
name: t,
|
|
9
|
+
description: n,
|
|
10
|
+
category: a,
|
|
11
|
+
since: s,
|
|
12
|
+
status: o,
|
|
13
|
+
props: i,
|
|
14
|
+
examples: r,
|
|
15
|
+
accessibility: c,
|
|
16
|
+
seeAlso: p
|
|
17
|
+
};
|
|
18
|
+
export {
|
|
19
|
+
e as $schema,
|
|
20
|
+
c as accessibility,
|
|
21
|
+
a as category,
|
|
22
|
+
d as default,
|
|
23
|
+
n as description,
|
|
24
|
+
r as examples,
|
|
25
|
+
t as name,
|
|
26
|
+
i as props,
|
|
27
|
+
p as seeAlso,
|
|
28
|
+
s as since,
|
|
29
|
+
o as status
|
|
30
|
+
};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e="https://nice2dev.com/schemas/component-doc-v1.json",t="NiceDataSnapshot",n="Create and restore data snapshots with retention policies and metadata.",s="data-branching",a="1.0.7",o="stable",i=[{name:"snapshots",type:"DataSnapshot[]",required:!0,description:"List of snapshots"},{name:"environment",type:"string",description:"Current environment"},{name:"onCreate",type:"(name: string, description?: string) => Promise<void>",description:"Create snapshot callback"},{name:"onRestore",type:"(snapshotId: string) => Promise<void>",description:"Restore snapshot callback"},{name:"onDelete",type:"(snapshotId: string) => Promise<void>",description:"Delete snapshot callback"},{name:"retentionDays",type:"number",default:30,description:"Default retention period"}],r=[{title:"Data Snapshot",description:"Manage data snapshots",code:`<NiceDataSnapshot
|
|
2
|
+
snapshots={envSnapshots}
|
|
3
|
+
environment="PROD"
|
|
4
|
+
onCreate={handleCreate}
|
|
5
|
+
onRestore={handleRestore}
|
|
6
|
+
/>`}],c={role:"region",ariaLabel:"Data snapshot manager"},p=["NiceDataBranchManager","NiceBackupManager"],d={$schema:e,name:t,description:n,category:s,since:a,status:o,props:i,examples:r,accessibility:c,seeAlso:p};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=p;exports.since=a;exports.status=o;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const e=require("react/jsx-runtime"),C=require("./core-C2ZmWe_u.cjs"),i=require("react"),F={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"})})},W=({variant:s="info",title:t,children:c,closable:r,onClose:n,icon:a,size:l="md",className:m,style:d,displayStyle:p})=>{const h=C.useComponentDisplayClass("card",p);return e.jsxs("div",{className:`nice-alert nice-alert--${s} nice-alert--${l} nice-alert--ds-${h} ${m||""}`,style:d,role:"alert",children:[e.jsx("div",{className:`nice-alert__icon nice-alert__icon--${s}`,children:a||F[s]}),e.jsxs("div",{className:"nice-alert__content",children:[t&&e.jsx("div",{className:"nice-alert__title",children:t}),e.jsx("div",{children:c})]}),r&&e.jsx("button",{type:"button",className:"nice-alert__close",onClick:n,"aria-label":"Close",children:"✕"})]})},U=({open:s,onClose:t,title:c,position:r="right",size:n="md",children:a,footer:l,transitionDuration:m,className:d,style:p,displayStyle:h})=>{const g=C.useComponentDisplayStyle("modal",h),x=C.useComponentDisplayClass("modal",h),{t:f}=C.Wo(),v=i.useRef(null);return C.useFocusTrap(v,s),i.useEffect(()=>{if(!s)return;const _=o=>{o.key==="Escape"&&t()};return document.addEventListener("keydown",_),document.body.style.overflow="hidden",()=>{document.removeEventListener("keydown",_),document.body.style.overflow=""}},[s,t]),s?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"nice-drawer-overlay",onClick:t}),e.jsxs("div",{ref:v,className:`nice-drawer nice-drawer--${r} nice-drawer--${n} nice-drawer--ds-${x} ${d||""}`,style:{...g,...p,...m!=null?{transitionDuration:`${m}ms`}:{}},role:"dialog","aria-modal":"true","aria-label":c,children:[c&&e.jsxs("div",{className:"nice-drawer__header",children:[e.jsx("h3",{className:"nice-drawer__title",children:c}),e.jsx("button",{type:"button",className:"nice-drawer__close",onClick:t,"aria-label":f("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:a}),l&&e.jsx("div",{className:"nice-drawer__footer",children:l})]})]}):null},Y=({toasts:s,onDismiss:t,position:c="top-right"})=>e.jsx("div",{className:`nice-toast-container nice-toast-container--${c}`,children:s.map(r=>e.jsx(G,{toast:r,onDismiss:t},r.id))}),G=({toast:s,onDismiss:t})=>{const[c,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(c){const n=setTimeout(()=>t(s.id),200);return()=>clearTimeout(n)}},[c,s.id,t]),e.jsxs("div",{className:`nice-toast nice-toast--${s.variant} ${c?"nice-toast--exiting":""}`,role:"alert",style:{position:"relative"},children:[e.jsx("div",{className:"nice-toast__icon",children:F[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),children:"✕"})]})};let J=0;function K(){const[s,t]=i.useState([]),c=i.useCallback((n,a,l)=>{const m=`toast-${++J}`;return t(d=>[...d,{id:m,variant:n,message:a,title:l?.title,duration:l?.duration}]),m},[]),r=i.useCallback(n=>{t(a=>a.filter(l=>l.id!==n))},[]);return{toasts:s,dismiss:r,info:(n,a)=>c("info",n,a),success:(n,a)=>c("success",n,a),warning:(n,a)=>c("warning",n,a),error:(n,a)=>c("error",n,a)}}const Q={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"})})},X=({visible:s,message:t,header:c,icon:r,variant:n="warning",acceptLabel:a,rejectLabel:l,onAccept:m,onReject:d,closeOnOverlay:p=!1,closeOnEscape:h=!0,size:g="md",className:x,style:f})=>{const{t:v}=C.Wo();if(i.useEffect(()=>{if(!s||!h)return;const j=N=>{N.key==="Escape"&&d()};return document.addEventListener("keydown",j),()=>document.removeEventListener("keydown",j)},[s,h,d]),i.useEffect(()=>(s?document.body.style.overflow="hidden":document.body.style.overflow="",()=>{document.body.style.overflow=""}),[s]),!s)return null;const _=r??Q[n],o=a??v("confirm.accept","Yes"),w=l??v("confirm.reject","No");return e.jsx("div",{className:"nice-modal-overlay",onClick:p?d:void 0,children:e.jsxs("div",{className:`nice-confirm nice-confirm--${n} nice-confirm--${g} ${x||""}`,style:f,role:"alertdialog","aria-modal":"true","aria-label":c,"aria-describedby":"nice-confirm-message",onClick:j=>j.stopPropagation(),children:[c&&e.jsx("div",{className:"nice-confirm__header",children:e.jsx("h3",{className:"nice-confirm__title",children:c})}),e.jsxs("div",{className:"nice-confirm__body",children:[_&&e.jsx("div",{className:`nice-confirm__icon nice-confirm__icon--${n}`,children:_}),e.jsx("div",{id:"nice-confirm-message",className:"nice-confirm__message",children:t})]}),e.jsxs("div",{className:"nice-confirm__footer",children:[e.jsx("button",{type:"button",className:"nice-btn nice-btn--ghost nice-btn--md",onClick:d,children:w}),e.jsx("button",{type:"button",className:`nice-btn nice-btn--${n==="error"?"error":"primary"} nice-btn--md`,onClick:m,autoFocus:!0,children:o})]})]})})},Z=({error:s,onRetry:t,retryLabel:c="Retry",title:r="Operation failed",autoRetrySeconds:n,variant:a="error",icon:l,size:m="md",className:d,style:p,"data-testid":h})=>{const[g,x]=i.useState(n??0),f=i.useRef(),v=typeof s=="string"?s:s.message,_=i.useCallback(()=>{x(n??0),t()},[t,n]);return i.useEffect(()=>{if(!(!n||n<=0))return x(n),f.current=setInterval(()=>{x(o=>o<=1?(clearInterval(f.current),t(),0):o-1)},1e3),()=>clearInterval(f.current)},[n,t]),e.jsxs("div",{className:`nice-retry-panel nice-retry-panel--${a} nice-retry-panel--${m} ${d||""}`,style:p,role:"alert","data-testid":h,children:[e.jsx("div",{className:"nice-retry-panel__icon",children:l??"⚠️"}),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:v})]}),e.jsxs("div",{className:"nice-retry-panel__actions",children:[e.jsx("button",{type:"button",className:"nice-btn nice-btn--primary nice-btn--sm",onClick:_,children:c}),n&&g>0&&e.jsxs("span",{className:"nice-retry-panel__countdown",children:["Auto-retry in ",g,"s"]})]})]})};function ee(s){return window.addEventListener("online",s),window.addEventListener("offline",s),()=>{window.removeEventListener("online",s),window.removeEventListener("offline",s)}}function se(){return navigator.onLine}function ne(){return!0}const te=({message:s="You are offline. Some features may be unavailable.",variant:t="warning",icon:c,size:r="md",className:n,style:a,"data-testid":l})=>i.useSyncExternalStore(ee,se,ne)?null:e.jsxs("div",{className:`nice-offline-banner nice-offline-banner--${t} nice-offline-banner--${r} ${n||""}`,style:a,role:"alert","aria-live":"assertive","data-testid":l,children:[e.jsx("span",{className:"nice-offline-banner__icon",children:c??"📡"}),e.jsx("span",{className:"nice-offline-banner__message",children:s})]});function q({timeoutMs:s=1e4,slowThresholdMs:t=3e3,onTimeout:c,autoRetry:r=!1,autoRetryCount:n=3}={}){const[a,l]=i.useState(!1),[m,d]=i.useState(!1),[p,h]=i.useState(!1),[g,x]=i.useState(0),[f,v]=i.useState(0),_=i.useRef(null),o=i.useRef(null),w=i.useRef(null),j=i.useRef(0),N=i.useCallback(()=>{_.current&&clearTimeout(_.current),o.current&&clearTimeout(o.current),w.current&&clearInterval(w.current)},[]),k=i.useCallback(()=>{N(),l(!0),d(!1),h(!1),x(0),j.current=Date.now(),w.current=setInterval(()=>{x(Date.now()-j.current)},200),_.current=setTimeout(()=>{d(!0)},t),o.current=setTimeout(()=>{h(!0),l(!1),d(!1),N(),c?.()},s)},[N,t,s,c]),$=i.useCallback(()=>{N(),l(!1),d(!1)},[N]),u=i.useCallback(()=>{v(y=>y+1),h(!1),k()},[k]);return i.useEffect(()=>()=>N(),[N]),i.useEffect(()=>{if(r&&p&&f<n){const y=Math.pow(2,f)*1e3,L=setTimeout(()=>u(),y);return()=>clearTimeout(L)}},[r,n,p,f,u]),{isLoading:a,isSlow:m,isTimedOut:p,elapsed:g,retryCount:f,start:k,stop:$,retry:u}}const ie=({timeoutMs:s=1e4,slowThresholdMs:t=3e3,onTimeout:c,onRetry:r,autoRetry:n=!1,autoRetryCount:a=3,showProgress:l=!0,slowMessage:m="Operacja trwa dłużej niż zwykle…",timeoutMessage:d="Przekroczono limit czasu. Spróbuj ponownie.",loading:p,children:h,size:g="md",className:x,style:f,"data-testid":v})=>{const{isSlow:_,isTimedOut:o,elapsed:w,retry:j}=q({timeoutMs:s,slowThresholdMs:t,onTimeout:c,autoRetry:n,autoRetryCount:a}),N=()=>{j(),r?.()};if(!p)return e.jsx(e.Fragment,{children:h});if(o)return e.jsxs("div",{className:`nice-timeout-feedback nice-timeout-feedback--timeout nice-timeout-feedback--${g} ${x??""}`,style:f,role:"alert","data-testid":v,children:[e.jsx("p",{className:"nice-timeout-feedback__message",children:d}),e.jsx("button",{className:"nice-timeout-feedback__retry-btn",onClick:N,type:"button",children:"Spróbuj ponownie"})]});const k=Math.min(100,w/s*100);return e.jsxs("div",{className:`nice-timeout-feedback nice-timeout-feedback--${g} ${_?"nice-timeout-feedback--slow":""} ${x??""}`,style:f,"data-testid":v,children:[e.jsx("div",{className:"nice-timeout-feedback__spinner","aria-busy":"true"}),_&&e.jsx("p",{className:"nice-timeout-feedback__slow-msg",children:m}),l&&e.jsx("div",{className:"nice-timeout-feedback__progress",role:"progressbar","aria-valuenow":k,"aria-valuemin":0,"aria-valuemax":100,children:e.jsx("div",{className:"nice-timeout-feedback__progress-bar",style:{width:`${k}%`}})})]})},O=i.forwardRef(({visible:s,onAcceptAll:t,onRejectAll:c,onSave:r,categories:n=["necessary","analytics","marketing","preferences"],defaults:a,position:l="bottom",size:m="md",policyUrl:d,showDetails:p=!1,className:h,style:g,id:x,...f},v)=>{const _=C.useControlId(x),{t:o}=C.Wo(),[w,j]=i.useState(!0),N=s??w,[k,$]=i.useState(p),[u,y]=i.useState(()=>{const b={necessary:!0,analytics:!1,marketing:!1,preferences:!1};return a&&Object.assign(b,a),b.necessary=!0,b}),L={necessary:o("cookie.necessary","Necessary"),analytics:o("cookie.analytics","Analytics"),marketing:o("cookie.marketing","Marketing"),preferences:o("cookie.preferences","Preferences")},T={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.")},I=i.useCallback(()=>{const b={necessary:!0,analytics:!0,marketing:!0,preferences:!0};t?.(),r?.(b),j(!1)},[t,r]),E=i.useCallback(()=>{const b={necessary:!0,analytics:!1,marketing:!1,preferences:!1};c?.(),r?.(b),j(!1)},[c,r]),D=i.useCallback(()=>{r?.({...u,necessary:!0}),j(!1)},[u,r]);return N?e.jsx("div",{ref:v,id:_,className:`nice-cookie-consent nice-cookie-consent--${l} nice-cookie-consent--${m} ${h??""}`,style:g,role:"dialog","aria-label":o("cookie.label","Cookie Consent"),"aria-modal":"true",...f,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."),d&&e.jsxs(e.Fragment,{children:[" ",e.jsx("a",{href:d,className:"nice-cookie-consent__link",target:"_blank",rel:"noopener noreferrer",children:o("cookie.learnMore","Learn more")})]})]}),k&&e.jsx("div",{className:"nice-cookie-consent__details",children:n.map(b=>e.jsxs("label",{className:"nice-cookie-consent__category",children:[e.jsx("input",{type:"checkbox",checked:u[b],disabled:b==="necessary",onChange:R=>y(z=>({...z,[b]:R.target.checked})),className:"nice-cookie-consent__checkbox"}),e.jsxs("div",{className:"nice-cookie-consent__cat-info",children:[e.jsx("strong",{children:L[b]}),e.jsx("span",{className:"nice-cookie-consent__cat-desc",children:T[b]})]})]},b))}),e.jsxs("div",{className:"nice-cookie-consent__actions",children:[!k&&e.jsx("button",{type:"button",className:"nice-cookie-consent__btn nice-cookie-consent__btn--details",onClick:()=>$(!0),children:o("cookie.customize","Customize")}),k&&e.jsx("button",{type:"button",className:"nice-cookie-consent__btn nice-cookie-consent__btn--save",onClick:D,children:o("cookie.savePreferences","Save preferences")}),e.jsx("button",{type:"button",className:"nice-cookie-consent__btn nice-cookie-consent__btn--reject",onClick:E,children:o("cookie.rejectAll","Reject all")}),e.jsx("button",{type:"button",className:"nice-cookie-consent__btn nice-cookie-consent__btn--accept",onClick:I,children:o("cookie.acceptAll","Accept all")})]})]})}):null});O.displayName="NiceCookieConsent";const H=i.forwardRef(({onSubmit:s,onForgotPassword:t,onRegister:c,loading:r=!1,error:n,variant:a="primary",size:l="md",showRememberMe:m=!0,showForgotPassword:d=!0,showRegister:p=!1,title:h,logo:g,usernameLabel:x,passwordLabel:f,usernamePlaceholder:v,passwordPlaceholder:_,className:o,style:w,id:j,...N},k)=>{const $=C.useControlId(j),{t:u}=C.Wo(),[y,L]=i.useState(""),[T,I]=i.useState(""),[E,D]=i.useState(!1),[b,R]=i.useState(!1),z=`${$}-user`,A=`${$}-pass`,B=`${$}-remember`,V=i.useCallback(S=>{S.preventDefault(),!r&&s?.({username:y,password:T,rememberMe:E})},[r,y,T,E,s]);return e.jsxs("form",{ref:k,id:$,className:`nice-login nice-login--${a} nice-login--${l} ${o??""}`,style:w,onSubmit:V,noValidate:!0,...N,children:[g&&e.jsx("div",{className:"nice-login__logo",children:g}),h&&e.jsx("h2",{className:"nice-login__title",children:h??u("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:z,className:"nice-login__label",children:x??u("login.username","Username")}),e.jsx("input",{id:z,className:"nice-login__input",type:"text",value:y,onChange:S=>L(S.target.value),placeholder:v??u("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:A,className:"nice-login__label",children:f??u("login.password","Password")}),e.jsxs("div",{className:"nice-login__password-wrap",children:[e.jsx("input",{id:A,className:"nice-login__input",type:b?"text":"password",value:T,onChange:S=>I(S.target.value),placeholder:_??u("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:()=>R(!b),"aria-label":b?u("login.hidePassword","Hide password"):u("login.showPassword","Show password"),tabIndex:-1,children:b?"🙈":"👁"})]})]}),e.jsxs("div",{className:"nice-login__options",children:[m&&e.jsxs("label",{className:"nice-login__remember",htmlFor:B,children:[e.jsx("input",{id:B,type:"checkbox",checked:E,onChange:S=>D(S.target.checked),disabled:r}),e.jsx("span",{children:u("login.rememberMe","Remember me")})]}),d&&t&&e.jsx("button",{type:"button",className:"nice-login__forgot",onClick:t,disabled:r,children:u("login.forgotPassword","Forgot password?")})]}),e.jsx("button",{type:"submit",className:`nice-login__submit nice-login__submit--${a}`,disabled:r||!y||!T,children:r?u("login.loading","Signing in..."):u("login.submit","Sign In")}),p&&c&&e.jsxs("p",{className:"nice-login__register",children:[u("login.noAccount","Don't have an account?")," ",e.jsx("button",{type:"button",className:"nice-login__register-link",onClick:c,disabled:r,children:u("login.register","Register")})]})]})});H.displayName="NiceLoginForm";const P=class P 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,c){this.props.onError?.(t,c)}render(){if(this.state.hasError&&this.state.error){const{fallback:t,showRetry:c=!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("h2",{className:"nice-error-boundary__title",children:n}),e.jsx("p",{className:"nice-error-boundary__message",children:this.state.error.message}),c&&e.jsx("button",{type:"button",className:"nice-btn nice-btn--primary",onClick:this.handleReset,children:r})]})}return this.props.children}};P.displayName="NiceErrorBoundary";let M=P;exports.NiceAlert=W;exports.NiceConfirmDialog=X;exports.NiceCookieConsent=O;exports.NiceDrawer=U;exports.NiceErrorBoundary=M;exports.NiceLoginForm=H;exports.NiceOfflineBanner=te;exports.NiceRetryPanel=Z;exports.NiceTimeoutFeedback=ie;exports.NiceToastContainer=Y;exports.alertIcons=F;exports.useNiceTimeout=q;exports.useNiceToast=K;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const e=require("react/jsx-runtime"),k=require("./core-BZBTsGWN.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"})})},U=({variant:s="info",title:t,children:c,closable:r,onClose:n,icon:a,size:l="md",className:u,style:d,displayStyle:p})=>{const m=k.useComponentDisplayClass("card",p);return e.jsxs("div",{className:`nice-alert nice-alert--${s} nice-alert--${l} nice-alert--ds-${m} ${u||""}`,style:d,role:"alert",children:[e.jsx("div",{className:`nice-alert__icon nice-alert__icon--${s}`,children:a||M[s]}),e.jsxs("div",{className:"nice-alert__content",children:[t&&e.jsx("div",{className:"nice-alert__title",children:t}),e.jsx("div",{children:c})]}),r&&e.jsx("button",{type:"button",className:"nice-alert__close",onClick:n,"aria-label":"Close",children:"✕"})]})},Y=({open:s,onClose:t,title:c,size:r="md",children:n,footer:a,closeOnOverlay:l=!0,closeOnEscape:u=!0,fullscreenable:d,zIndex:p,className:m,style:N,displayStyle:x})=>{const{t:_}=k.useNiceTranslation(),v=i.useRef(null),[h,o]=i.useState(!1),w=k.useComponentDisplayStyle("modal",x),j=k.useComponentDisplayClass("modal",x);return k.useFocusTrap(v,s),i.useEffect(()=>{if(!s||!u)return;const f=y=>{y.key==="Escape"&&t()};return document.addEventListener("keydown",f),()=>document.removeEventListener("keydown",f)},[s,u,t]),i.useEffect(()=>(s?document.body.style.overflow="hidden":document.body.style.overflow="",()=>{document.body.style.overflow=""}),[s]),s?e.jsx("div",{className:"nice-modal-overlay",style:p?{zIndex:p}:void 0,onClick:l?t:void 0,children:e.jsxs("div",{ref:v,className:`nice-modal nice-modal--${h?"full":r} nice-modal--ds-${j} ${m||""}`,style:{...w,...N},role:"dialog","aria-modal":"true","aria-label":c,onClick:f=>f.stopPropagation(),children:[c&&e.jsxs("div",{className:"nice-modal__header",children:[e.jsx("h2",{className:"nice-modal__title",children:c}),e.jsxs("div",{className:"nice-modal__header-actions",children:[d&&e.jsx("button",{type:"button",className:"nice-modal__fullscreen",onClick:()=>o(f=>!f),"aria-label":h?"Exit fullscreen":"Fullscreen",children:h?"⇲":"⇱"}),e.jsx("button",{type:"button",className:"nice-modal__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-modal__body",children:n}),a&&e.jsx("div",{className:"nice-modal__footer",children:a})]})}):null},W=({open:s,onClose:t,title:c,position:r="right",size:n="md",children:a,footer:l,transitionDuration:u,className:d,style:p,displayStyle:m})=>{const N=k.useComponentDisplayStyle("modal",m),x=k.useComponentDisplayClass("modal",m),{t:_}=k.useNiceTranslation(),v=i.useRef(null);return k.useFocusTrap(v,s),i.useEffect(()=>{if(!s)return;const h=o=>{o.key==="Escape"&&t()};return document.addEventListener("keydown",h),document.body.style.overflow="hidden",()=>{document.removeEventListener("keydown",h),document.body.style.overflow=""}},[s,t]),s?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"nice-drawer-overlay",onClick:t}),e.jsxs("div",{ref:v,className:`nice-drawer nice-drawer--${r} nice-drawer--${n} nice-drawer--ds-${x} ${d||""}`,style:{...N,...p,...u!=null?{transitionDuration:`${u}ms`}:{}},role:"dialog","aria-modal":"true","aria-label":c,children:[c&&e.jsxs("div",{className:"nice-drawer__header",children:[e.jsx("h3",{className:"nice-drawer__title",children:c}),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:a}),l&&e.jsx("div",{className:"nice-drawer__footer",children:l})]})]}):null},G=({toasts:s,onDismiss:t,position:c="top-right"})=>e.jsx("div",{className:`nice-toast-container nice-toast-container--${c}`,children:s.map(r=>e.jsx(J,{toast:r,onDismiss:t},r.id))}),J=({toast:s,onDismiss:t})=>{const[c,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(c){const n=setTimeout(()=>t(s.id),200);return()=>clearTimeout(n)}},[c,s.id,t]),e.jsxs("div",{className:`nice-toast nice-toast--${s.variant} ${c?"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),children:"✕"})]})};let K=0;function Q(){const[s,t]=i.useState([]),c=i.useCallback((n,a,l)=>{const u=`toast-${++K}`;return t(d=>[...d,{id:u,variant:n,message:a,title:l?.title,duration:l?.duration}]),u},[]),r=i.useCallback(n=>{t(a=>a.filter(l=>l.id!==n))},[]);return{toasts:s,dismiss:r,info:(n,a)=>c("info",n,a),success:(n,a)=>c("success",n,a),warning:(n,a)=>c("warning",n,a),error:(n,a)=>c("error",n,a)}}const X={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"})})},Z=({visible:s,message:t,header:c,icon:r,variant:n="warning",acceptLabel:a,rejectLabel:l,onAccept:u,onReject:d,closeOnOverlay:p=!1,closeOnEscape:m=!0,size:N="md",className:x,style:_})=>{const{t:v}=k.useNiceTranslation();if(i.useEffect(()=>{if(!s||!m)return;const j=f=>{f.key==="Escape"&&d()};return document.addEventListener("keydown",j),()=>document.removeEventListener("keydown",j)},[s,m,d]),i.useEffect(()=>(s?document.body.style.overflow="hidden":document.body.style.overflow="",()=>{document.body.style.overflow=""}),[s]),!s)return null;const h=r??X[n],o=a??v("confirm.accept","Yes"),w=l??v("confirm.reject","No");return e.jsx("div",{className:"nice-modal-overlay",onClick:p?d:void 0,children:e.jsxs("div",{className:`nice-confirm nice-confirm--${n} nice-confirm--${N} ${x||""}`,style:_,role:"alertdialog","aria-modal":"true","aria-label":c,"aria-describedby":"nice-confirm-message",onClick:j=>j.stopPropagation(),children:[c&&e.jsx("div",{className:"nice-confirm__header",children:e.jsx("h3",{className:"nice-confirm__title",children:c})}),e.jsxs("div",{className:"nice-confirm__body",children:[h&&e.jsx("div",{className:`nice-confirm__icon nice-confirm__icon--${n}`,children:h}),e.jsx("div",{id:"nice-confirm-message",className:"nice-confirm__message",children:t})]}),e.jsxs("div",{className:"nice-confirm__footer",children:[e.jsx("button",{type:"button",className:"nice-btn nice-btn--ghost nice-btn--md",onClick:d,children:w}),e.jsx("button",{type:"button",className:`nice-btn nice-btn--${n==="error"?"error":"primary"} nice-btn--md`,onClick:u,autoFocus:!0,children:o})]})]})})},ee=({error:s,onRetry:t,retryLabel:c="Retry",title:r="Operation failed",autoRetrySeconds:n,variant:a="error",icon:l,size:u="md",className:d,style:p,"data-testid":m})=>{const[N,x]=i.useState(n??0),_=i.useRef(),v=typeof s=="string"?s:s.message,h=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--${a} nice-retry-panel--${u} ${d||""}`,style:p,role:"alert","data-testid":m,children:[e.jsx("div",{className:"nice-retry-panel__icon",children:l??"⚠️"}),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:v})]}),e.jsxs("div",{className:"nice-retry-panel__actions",children:[e.jsx("button",{type:"button",className:"nice-btn nice-btn--primary nice-btn--sm",onClick:h,children:c}),n&&N>0&&e.jsxs("span",{className:"nice-retry-panel__countdown",children:["Auto-retry in ",N,"s"]})]})]})};function se(s){return window.addEventListener("online",s),window.addEventListener("offline",s),()=>{window.removeEventListener("online",s),window.removeEventListener("offline",s)}}function ne(){return navigator.onLine}function te(){return!0}const ie=({message:s="You are offline. Some features may be unavailable.",variant:t="warning",icon:c,size:r="md",className:n,style:a,"data-testid":l})=>i.useSyncExternalStore(se,ne,te)?null:e.jsxs("div",{className:`nice-offline-banner nice-offline-banner--${t} nice-offline-banner--${r} ${n||""}`,style:a,role:"alert","aria-live":"assertive","data-testid":l,children:[e.jsx("span",{className:"nice-offline-banner__icon",children:c??"📡"}),e.jsx("span",{className:"nice-offline-banner__message",children:s})]});function q({timeoutMs:s=1e4,slowThresholdMs:t=3e3,onTimeout:c,autoRetry:r=!1,autoRetryCount:n=3}={}){const[a,l]=i.useState(!1),[u,d]=i.useState(!1),[p,m]=i.useState(!1),[N,x]=i.useState(0),[_,v]=i.useState(0),h=i.useRef(null),o=i.useRef(null),w=i.useRef(null),j=i.useRef(0),f=i.useCallback(()=>{h.current&&clearTimeout(h.current),o.current&&clearTimeout(o.current),w.current&&clearInterval(w.current)},[]),y=i.useCallback(()=>{f(),l(!0),d(!1),m(!1),x(0),j.current=Date.now(),w.current=setInterval(()=>{x(Date.now()-j.current)},200),h.current=setTimeout(()=>{d(!0)},t),o.current=setTimeout(()=>{m(!0),l(!1),d(!1),f(),c?.()},s)},[f,t,s,c]),$=i.useCallback(()=>{f(),l(!1),d(!1)},[f]),b=i.useCallback(()=>{v(C=>C+1),m(!1),y()},[y]);return i.useEffect(()=>()=>f(),[f]),i.useEffect(()=>{if(r&&p&&_<n){const C=Math.pow(2,_)*1e3,E=setTimeout(()=>b(),C);return()=>clearTimeout(E)}},[r,n,p,_,b]),{isLoading:a,isSlow:u,isTimedOut:p,elapsed:N,retryCount:_,start:y,stop:$,retry:b}}const re=({timeoutMs:s=1e4,slowThresholdMs:t=3e3,onTimeout:c,onRetry:r,autoRetry:n=!1,autoRetryCount:a=3,showProgress:l=!0,slowMessage:u="Operacja trwa dłużej niż zwykle…",timeoutMessage:d="Przekroczono limit czasu. Spróbuj ponownie.",loading:p,children:m,size:N="md",className:x,style:_,"data-testid":v})=>{const{isSlow:h,isTimedOut:o,elapsed:w,retry:j}=q({timeoutMs:s,slowThresholdMs:t,onTimeout:c,autoRetry:n,autoRetryCount:a}),f=()=>{j(),r?.()};if(!p)return e.jsx(e.Fragment,{children:m});if(o)return e.jsxs("div",{className:`nice-timeout-feedback nice-timeout-feedback--timeout nice-timeout-feedback--${N} ${x??""}`,style:_,role:"alert","data-testid":v,children:[e.jsx("p",{className:"nice-timeout-feedback__message",children:d}),e.jsx("button",{className:"nice-timeout-feedback__retry-btn",onClick:f,type:"button",children:"Spróbuj ponownie"})]});const y=Math.min(100,w/s*100);return e.jsxs("div",{className:`nice-timeout-feedback nice-timeout-feedback--${N} ${h?"nice-timeout-feedback--slow":""} ${x??""}`,style:_,"data-testid":v,children:[e.jsx("div",{className:"nice-timeout-feedback__spinner","aria-busy":"true"}),h&&e.jsx("p",{className:"nice-timeout-feedback__slow-msg",children:u}),l&&e.jsx("div",{className:"nice-timeout-feedback__progress",role:"progressbar","aria-valuenow":y,"aria-valuemin":0,"aria-valuemax":100,children:e.jsx("div",{className:"nice-timeout-feedback__progress-bar",style:{width:`${y}%`}})})]})},O=i.forwardRef(({visible:s,onAcceptAll:t,onRejectAll:c,onSave:r,categories:n=["necessary","analytics","marketing","preferences"],defaults:a,position:l="bottom",size:u="md",policyUrl:d,showDetails:p=!1,className:m,style:N,id:x,..._},v)=>{const h=k.useControlId(x),{t:o}=k.useNiceTranslation(),[w,j]=i.useState(!0),f=s??w,[y,$]=i.useState(p),[b,C]=i.useState(()=>{const g={necessary:!0,analytics:!1,marketing:!1,preferences:!1};return a&&Object.assign(g,a),g.necessary=!0,g}),E={necessary:o("cookie.necessary","Necessary"),analytics:o("cookie.analytics","Analytics"),marketing:o("cookie.marketing","Marketing"),preferences:o("cookie.preferences","Preferences")},L={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.")},D=i.useCallback(()=>{const g={necessary:!0,analytics:!0,marketing:!0,preferences:!0};t?.(),r?.(g),j(!1)},[t,r]),S=i.useCallback(()=>{const g={necessary:!0,analytics:!1,marketing:!1,preferences:!1};c?.(),r?.(g),j(!1)},[c,r]),I=i.useCallback(()=>{r?.({...b,necessary:!0}),j(!1)},[b,r]);return f?e.jsx("div",{ref:v,id:h,className:`nice-cookie-consent nice-cookie-consent--${l} nice-cookie-consent--${u} ${m??""}`,style:N,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."),d&&e.jsxs(e.Fragment,{children:[" ",e.jsx("a",{href:d,className:"nice-cookie-consent__link",target:"_blank",rel:"noopener noreferrer",children:o("cookie.learnMore","Learn more")})]})]}),y&&e.jsx("div",{className:"nice-cookie-consent__details",children:n.map(g=>e.jsxs("label",{className:"nice-cookie-consent__category",children:[e.jsx("input",{type:"checkbox",checked:b[g],disabled:g==="necessary",onChange:R=>C(z=>({...z,[g]:R.target.checked})),className:"nice-cookie-consent__checkbox"}),e.jsxs("div",{className:"nice-cookie-consent__cat-info",children:[e.jsx("strong",{children:E[g]}),e.jsx("span",{className:"nice-cookie-consent__cat-desc",children:L[g]})]})]},g))}),e.jsxs("div",{className:"nice-cookie-consent__actions",children:[!y&&e.jsx("button",{type:"button",className:"nice-cookie-consent__btn nice-cookie-consent__btn--details",onClick:()=>$(!0),children:o("cookie.customize","Customize")}),y&&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:S,children:o("cookie.rejectAll","Reject all")}),e.jsx("button",{type:"button",className:"nice-cookie-consent__btn nice-cookie-consent__btn--accept",onClick:D,children:o("cookie.acceptAll","Accept all")})]})]})}):null});O.displayName="NiceCookieConsent";const H=i.forwardRef(({onSubmit:s,onForgotPassword:t,onRegister:c,loading:r=!1,error:n,variant:a="primary",size:l="md",showRememberMe:u=!0,showForgotPassword:d=!0,showRegister:p=!1,title:m,logo:N,usernameLabel:x,passwordLabel:_,usernamePlaceholder:v,passwordPlaceholder:h,className:o,style:w,id:j,...f},y)=>{const $=k.useControlId(j),{t:b}=k.useNiceTranslation(),[C,E]=i.useState(""),[L,D]=i.useState(""),[S,I]=i.useState(!1),[g,R]=i.useState(!1),z=`${$}-user`,A=`${$}-pass`,B=`${$}-remember`,V=i.useCallback(T=>{T.preventDefault(),!r&&s?.({username:C,password:L,rememberMe:S})},[r,C,L,S,s]);return e.jsxs("form",{ref:y,id:$,className:`nice-login nice-login--${a} nice-login--${l} ${o??""}`,style:w,onSubmit:V,noValidate:!0,...f,children:[N&&e.jsx("div",{className:"nice-login__logo",children:N}),m&&e.jsx("h2",{className:"nice-login__title",children:m??b("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:z,className:"nice-login__label",children:x??b("login.username","Username")}),e.jsx("input",{id:z,className:"nice-login__input",type:"text",value:C,onChange:T=>E(T.target.value),placeholder:v??b("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:A,className:"nice-login__label",children:_??b("login.password","Password")}),e.jsxs("div",{className:"nice-login__password-wrap",children:[e.jsx("input",{id:A,className:"nice-login__input",type:g?"text":"password",value:L,onChange:T=>D(T.target.value),placeholder:h??b("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:()=>R(!g),"aria-label":g?b("login.hidePassword","Hide password"):b("login.showPassword","Show password"),tabIndex:-1,children:g?"🙈":"👁"})]})]}),e.jsxs("div",{className:"nice-login__options",children:[u&&e.jsxs("label",{className:"nice-login__remember",htmlFor:B,children:[e.jsx("input",{id:B,type:"checkbox",checked:S,onChange:T=>I(T.target.checked),disabled:r}),e.jsx("span",{children:b("login.rememberMe","Remember me")})]}),d&&t&&e.jsx("button",{type:"button",className:"nice-login__forgot",onClick:t,disabled:r,children:b("login.forgotPassword","Forgot password?")})]}),e.jsx("button",{type:"submit",className:`nice-login__submit nice-login__submit--${a}`,disabled:r||!C||!L,children:r?b("login.loading","Signing in..."):b("login.submit","Sign In")}),p&&c&&e.jsxs("p",{className:"nice-login__register",children:[b("login.noAccount","Don't have an account?")," ",e.jsx("button",{type:"button",className:"nice-login__register-link",onClick:c,disabled:r,children:b("login.register","Register")})]})]})});H.displayName="NiceLoginForm";const P=class P 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,c){this.props.onError?.(t,c)}render(){if(this.state.hasError&&this.state.error){const{fallback:t,showRetry:c=!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("h2",{className:"nice-error-boundary__title",children:n}),e.jsx("p",{className:"nice-error-boundary__message",children:this.state.error.message}),c&&e.jsx("button",{type:"button",className:"nice-btn nice-btn--primary",onClick:this.handleReset,children:r})]})}return this.props.children}};P.displayName="NiceErrorBoundary";let F=P;exports.NiceAlert=U;exports.NiceConfirmDialog=Z;exports.NiceCookieConsent=O;exports.NiceDrawer=W;exports.NiceErrorBoundary=F;exports.NiceLoginForm=H;exports.NiceModal=Y;exports.NiceOfflineBanner=ie;exports.NiceRetryPanel=ee;exports.NiceTimeoutFeedback=re;exports.NiceToastContainer=G;exports.alertIcons=M;exports.useNiceTimeout=q;exports.useNiceToast=Q;
|