@nice2dev/ui 1.0.6 → 1.0.8
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-BAeqfoSc.cjs +1 -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/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/NiceModuleLifecyclePanel-Brg1RLwi.cjs +1 -0
- package/dist/NiceModuleLifecyclePanel-I_TXRiiY.js +5053 -0
- package/dist/NicePinCodeInput-CrMfdxxc.js +15287 -0
- package/dist/NicePinCodeInput-D0aF9MK8.cjs +692 -0
- 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/NiceStateDesigner.doc-B36u0hNU.js +29 -0
- package/dist/NiceStateDesigner.doc-MPmvNHSx.cjs +5 -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-IdHAcP70.cjs +1 -0
- package/dist/NiceWindow-SiCaREbq.js +1408 -0
- package/dist/charts-Bx_kNBsE.js +4280 -0
- package/dist/charts-DECVsCHX.cjs +754 -0
- package/dist/charts.cjs +1 -1
- package/dist/charts.css +1 -0
- package/dist/charts.d.ts +3 -3
- package/dist/charts.mjs +1 -1
- package/dist/core-BZBTsGWN.cjs +96 -0
- package/dist/core-BpghV7Ls.js +17555 -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 +401 -0
- package/dist/data-branching.mjs +9 -0
- package/dist/data.cjs +1 -1
- package/dist/data.mjs +1 -1
- package/dist/devops-BnYinjkT.cjs +17 -0
- package/dist/devops-Ckh57eti.js +7198 -0
- package/dist/devops.cjs +1 -0
- package/dist/devops.d.ts +758 -0
- package/dist/devops.mjs +12 -0
- package/dist/editors.cjs +1 -1
- package/dist/editors.mjs +3 -3
- package/dist/feedback.cjs +1 -1
- package/dist/feedback.mjs +1 -1
- package/dist/index-CBIZ6mTQ.cjs +5734 -0
- package/dist/index-CIl98Vbm.js +72951 -0
- package/dist/index.cjs +1 -1
- package/dist/index.css +1 -1
- package/dist/index.d.ts +3643 -93
- package/dist/index.mjs +1001 -952
- package/dist/lazy.cjs +1 -0
- package/dist/lazy.d.ts +1880 -0
- package/dist/lazy.mjs +98 -0
- package/dist/navigation.cjs +1 -1
- package/dist/navigation.mjs +69 -12
- package/dist/no-code-BCuadkm4.cjs +332 -0
- package/dist/no-code-TL7PyulA.js +7005 -0
- package/dist/no-code.cjs +1 -0
- package/dist/no-code.d.ts +870 -0
- package/dist/no-code.mjs +13 -0
- package/dist/overlays.cjs +1 -1
- package/dist/overlays.mjs +480 -24
- package/package.json +21 -1
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
const e = "https://nice2dev.com/schemas/component-doc-v1.json", t = "NiceStateDesigner", n = "Visual state machine designer with states, transitions, and guards.", i = "no-code", a = "1.0.7", s = "stable", c = [{ name: "machine", type: "StateMachine", required: !0, description: "State machine definition" }, { name: "onChange", type: "(machine: StateMachine) => void", description: "Machine change callback" }, { name: "currentState", type: "string", description: "Current active state" }, { name: "onTransition", type: "(from: string, to: string, event: string) => void", description: "Transition callback" }], o = [{ title: "State Designer", description: "Design state machines visually", code: `<NiceStateDesigner
|
|
2
|
+
machine={orderStateMachine}
|
|
3
|
+
onChange={handleMachineChange}
|
|
4
|
+
currentState="pending"
|
|
5
|
+
/>` }], r = { role: "application", ariaLabel: "State machine designer" }, d = ["NiceWorkflowDesigner", "NiceEventOrchestrator"], h = {
|
|
6
|
+
$schema: e,
|
|
7
|
+
name: t,
|
|
8
|
+
description: n,
|
|
9
|
+
category: i,
|
|
10
|
+
since: a,
|
|
11
|
+
status: s,
|
|
12
|
+
props: c,
|
|
13
|
+
examples: o,
|
|
14
|
+
accessibility: r,
|
|
15
|
+
seeAlso: d
|
|
16
|
+
};
|
|
17
|
+
export {
|
|
18
|
+
e as $schema,
|
|
19
|
+
r as accessibility,
|
|
20
|
+
i as category,
|
|
21
|
+
h as default,
|
|
22
|
+
n as description,
|
|
23
|
+
o as examples,
|
|
24
|
+
t as name,
|
|
25
|
+
c as props,
|
|
26
|
+
d as seeAlso,
|
|
27
|
+
a as since,
|
|
28
|
+
s as status
|
|
29
|
+
};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e="https://nice2dev.com/schemas/component-doc-v1.json",t="NiceStateDesigner",n="Visual state machine designer with states, transitions, and guards.",i="no-code",a="1.0.7",s="stable",c=[{name:"machine",type:"StateMachine",required:!0,description:"State machine definition"},{name:"onChange",type:"(machine: StateMachine) => void",description:"Machine change callback"},{name:"currentState",type:"string",description:"Current active state"},{name:"onTransition",type:"(from: string, to: string, event: string) => void",description:"Transition callback"}],o=[{title:"State Designer",description:"Design state machines visually",code:`<NiceStateDesigner
|
|
2
|
+
machine={orderStateMachine}
|
|
3
|
+
onChange={handleMachineChange}
|
|
4
|
+
currentState="pending"
|
|
5
|
+
/>`}],r={role:"application",ariaLabel:"State machine designer"},d=["NiceWorkflowDesigner","NiceEventOrchestrator"],l={$schema:e,name:t,description:n,category:i,since:a,status:s,props:c,examples:o,accessibility:r,seeAlso:d};exports.$schema=e;exports.accessibility=r;exports.category=i;exports.default=l;exports.description=n;exports.examples=o;exports.name=t;exports.props=c;exports.seeAlso=d;exports.since=a;exports.status=s;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
const e = "https://nice2dev.com/schemas/component-doc-v1.json", t = "NiceTestBuilder", s = "Visual test case builder with assertions, mocks, and test scenario management.", i = "no-code", n = "1.0.7", o = "stable", c = [{ name: "testSuite", type: "TestSuite", required: !0, description: "Test suite configuration" }, { name: "onChange", type: "(suite: TestSuite) => void", description: "Suite change callback" }, { name: "onRun", type: "(tests: TestCase[]) => Promise<TestResult[]>", description: "Run tests callback" }, { name: "mockProviders", type: "MockProvider[]", description: "Available mock providers" }], a = [{ title: "Test Builder", description: "Build test cases visually", code: `<NiceTestBuilder
|
|
2
|
+
testSuite={currentSuite}
|
|
3
|
+
onChange={handleSuiteChange}
|
|
4
|
+
onRun={handleRunTests}
|
|
5
|
+
mockProviders={mocks}
|
|
6
|
+
/>` }], r = { role: "application", ariaLabel: "Visual test builder" }, u = ["NiceTestRunner", "NiceAPIFlow"], l = {
|
|
7
|
+
$schema: e,
|
|
8
|
+
name: t,
|
|
9
|
+
description: s,
|
|
10
|
+
category: i,
|
|
11
|
+
since: n,
|
|
12
|
+
status: o,
|
|
13
|
+
props: c,
|
|
14
|
+
examples: a,
|
|
15
|
+
accessibility: r,
|
|
16
|
+
seeAlso: u
|
|
17
|
+
};
|
|
18
|
+
export {
|
|
19
|
+
e as $schema,
|
|
20
|
+
r as accessibility,
|
|
21
|
+
i as category,
|
|
22
|
+
l as default,
|
|
23
|
+
s as description,
|
|
24
|
+
a as examples,
|
|
25
|
+
t as name,
|
|
26
|
+
c as props,
|
|
27
|
+
u as seeAlso,
|
|
28
|
+
n 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",s="NiceTestBuilder",t="Visual test case builder with assertions, mocks, and test scenario management.",i="no-code",n="1.0.7",c="stable",o=[{name:"testSuite",type:"TestSuite",required:!0,description:"Test suite configuration"},{name:"onChange",type:"(suite: TestSuite) => void",description:"Suite change callback"},{name:"onRun",type:"(tests: TestCase[]) => Promise<TestResult[]>",description:"Run tests callback"},{name:"mockProviders",type:"MockProvider[]",description:"Available mock providers"}],a=[{title:"Test Builder",description:"Build test cases visually",code:`<NiceTestBuilder
|
|
2
|
+
testSuite={currentSuite}
|
|
3
|
+
onChange={handleSuiteChange}
|
|
4
|
+
onRun={handleRunTests}
|
|
5
|
+
mockProviders={mocks}
|
|
6
|
+
/>`}],r={role:"application",ariaLabel:"Visual test builder"},l=["NiceTestRunner","NiceAPIFlow"],u={$schema:e,name:s,description:t,category:i,since:n,status:c,props:o,examples:a,accessibility:r,seeAlso:l};exports.$schema=e;exports.accessibility=r;exports.category=i;exports.default=u;exports.description=t;exports.examples=a;exports.name=s;exports.props=o;exports.seeAlso=l;exports.since=n;exports.status=c;
|
|
@@ -0,0 +1,277 @@
|
|
|
1
|
+
import { jsxs as v, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import ne, { forwardRef as j, useCallback as D, useMemo as R } from "react";
|
|
3
|
+
import { f as S, g as A, b as H, h as E, i as K, j as ce, C as te, N as L } from "./core-BpghV7Ls.js";
|
|
4
|
+
const ie = j(
|
|
5
|
+
({
|
|
6
|
+
label: r,
|
|
7
|
+
helperText: p,
|
|
8
|
+
error: i,
|
|
9
|
+
required: N,
|
|
10
|
+
disabled: c,
|
|
11
|
+
readOnly: o,
|
|
12
|
+
size: _ = "md",
|
|
13
|
+
name: f,
|
|
14
|
+
id: b,
|
|
15
|
+
className: C,
|
|
16
|
+
style: d,
|
|
17
|
+
accessMode: x,
|
|
18
|
+
displayStyle: k,
|
|
19
|
+
value: s,
|
|
20
|
+
onChange: n,
|
|
21
|
+
onBlur: u,
|
|
22
|
+
onKeyDown: g,
|
|
23
|
+
placeholder: y,
|
|
24
|
+
min: m,
|
|
25
|
+
max: h,
|
|
26
|
+
step: t = 1,
|
|
27
|
+
precision: M,
|
|
28
|
+
prefix: O,
|
|
29
|
+
suffix: U,
|
|
30
|
+
showStepper: F = !0,
|
|
31
|
+
submitOnEnter: T,
|
|
32
|
+
onSubmit: G,
|
|
33
|
+
showKeyboardHints: J
|
|
34
|
+
}, P) => {
|
|
35
|
+
const w = S(x, b);
|
|
36
|
+
if (w === "hidden")
|
|
37
|
+
return null;
|
|
38
|
+
w === "disabled" && (c = !0), w === "readOnly" && (o = !0);
|
|
39
|
+
const { t: I } = A(), q = H(b), Q = E("input", k), V = K("input", k), $ = D(
|
|
40
|
+
(l) => {
|
|
41
|
+
let a = l;
|
|
42
|
+
return m !== void 0 && (a = Math.max(m, a)), h !== void 0 && (a = Math.min(h, a)), M !== void 0 && (a = parseFloat(a.toFixed(M))), a;
|
|
43
|
+
},
|
|
44
|
+
[m, h, M]
|
|
45
|
+
), X = D(
|
|
46
|
+
(l) => {
|
|
47
|
+
const a = l.target.value;
|
|
48
|
+
if (a === "") {
|
|
49
|
+
n?.(null);
|
|
50
|
+
return;
|
|
51
|
+
}
|
|
52
|
+
const W = parseFloat(a);
|
|
53
|
+
isNaN(W) || n?.($(W));
|
|
54
|
+
},
|
|
55
|
+
[n, $]
|
|
56
|
+
), Y = D(() => {
|
|
57
|
+
n?.($((s ?? 0) + t));
|
|
58
|
+
}, [s, t, n, $]), Z = D(() => {
|
|
59
|
+
n?.($((s ?? 0) - t));
|
|
60
|
+
}, [s, t, n, $]), z = ce({
|
|
61
|
+
enabled: T,
|
|
62
|
+
onSubmit: G
|
|
63
|
+
}), ee = D(
|
|
64
|
+
(l) => {
|
|
65
|
+
z(l), g?.(l);
|
|
66
|
+
},
|
|
67
|
+
[z, g]
|
|
68
|
+
), B = R(() => {
|
|
69
|
+
const l = [];
|
|
70
|
+
return T && l.push(te.submit), F && (l.push({ key: "ArrowUp", description: I("shortcuts.increment", "Increase value") }), l.push({ key: "ArrowDown", description: I("shortcuts.decrement", "Decrease value") })), l;
|
|
71
|
+
}, [T, F, I]);
|
|
72
|
+
return /* @__PURE__ */ v("div", { className: `nice-field ${C || ""}`, style: d, children: [
|
|
73
|
+
r && /* @__PURE__ */ v(
|
|
74
|
+
"label",
|
|
75
|
+
{
|
|
76
|
+
htmlFor: q,
|
|
77
|
+
className: `nice-field__label ${N ? "nice-field__label--required" : ""}`,
|
|
78
|
+
children: [
|
|
79
|
+
r,
|
|
80
|
+
J && B.length > 0 && /* @__PURE__ */ e(L, { shortcuts: B, size: "sm" })
|
|
81
|
+
]
|
|
82
|
+
}
|
|
83
|
+
),
|
|
84
|
+
/* @__PURE__ */ v(
|
|
85
|
+
"div",
|
|
86
|
+
{
|
|
87
|
+
className: `nice-input nice-input--${_} nice-input--ds-${V} ${i ? "nice-input--error" : ""} ${c ? "nice-input--disabled" : ""} ${o ? "nice-input--readonly" : ""}`,
|
|
88
|
+
style: Q,
|
|
89
|
+
children: [
|
|
90
|
+
O && /* @__PURE__ */ e("span", { className: "nice-input__icon", children: O }),
|
|
91
|
+
F && !o && /* @__PURE__ */ e(
|
|
92
|
+
"button",
|
|
93
|
+
{
|
|
94
|
+
type: "button",
|
|
95
|
+
className: "nice-input__clear",
|
|
96
|
+
onClick: Z,
|
|
97
|
+
disabled: c,
|
|
98
|
+
"aria-label": I("controls.decrement", "Decrement"),
|
|
99
|
+
children: "−"
|
|
100
|
+
}
|
|
101
|
+
),
|
|
102
|
+
/* @__PURE__ */ e(
|
|
103
|
+
"input",
|
|
104
|
+
{
|
|
105
|
+
ref: P,
|
|
106
|
+
id: q,
|
|
107
|
+
className: "nice-input__native",
|
|
108
|
+
type: "number",
|
|
109
|
+
name: f,
|
|
110
|
+
value: s ?? "",
|
|
111
|
+
placeholder: y,
|
|
112
|
+
min: m,
|
|
113
|
+
max: h,
|
|
114
|
+
step: t,
|
|
115
|
+
disabled: c,
|
|
116
|
+
readOnly: o,
|
|
117
|
+
"aria-invalid": !!i,
|
|
118
|
+
onChange: X,
|
|
119
|
+
onBlur: u,
|
|
120
|
+
onKeyDown: ee
|
|
121
|
+
}
|
|
122
|
+
),
|
|
123
|
+
F && !o && /* @__PURE__ */ e(
|
|
124
|
+
"button",
|
|
125
|
+
{
|
|
126
|
+
type: "button",
|
|
127
|
+
className: "nice-input__clear",
|
|
128
|
+
onClick: Y,
|
|
129
|
+
disabled: c,
|
|
130
|
+
"aria-label": I("controls.increment", "Increment"),
|
|
131
|
+
children: "+"
|
|
132
|
+
}
|
|
133
|
+
),
|
|
134
|
+
U && /* @__PURE__ */ e("span", { className: "nice-input__icon", children: U })
|
|
135
|
+
]
|
|
136
|
+
}
|
|
137
|
+
),
|
|
138
|
+
i && /* @__PURE__ */ e("div", { className: "nice-field__error", role: "alert", children: i }),
|
|
139
|
+
!i && p && /* @__PURE__ */ e("div", { className: "nice-field__helper", children: p })
|
|
140
|
+
] });
|
|
141
|
+
}
|
|
142
|
+
);
|
|
143
|
+
ie.displayName = "NiceNumberInput";
|
|
144
|
+
const se = j(
|
|
145
|
+
({
|
|
146
|
+
label: r,
|
|
147
|
+
checked: p = !1,
|
|
148
|
+
indeterminate: i = !1,
|
|
149
|
+
onChange: N,
|
|
150
|
+
disabled: c,
|
|
151
|
+
size: o = "md",
|
|
152
|
+
name: _,
|
|
153
|
+
id: f,
|
|
154
|
+
className: b,
|
|
155
|
+
style: C,
|
|
156
|
+
error: d,
|
|
157
|
+
accessMode: x,
|
|
158
|
+
displayStyle: k,
|
|
159
|
+
showKeyboardHints: s
|
|
160
|
+
}, n) => {
|
|
161
|
+
const u = S(x, f);
|
|
162
|
+
if (u === "hidden")
|
|
163
|
+
return null;
|
|
164
|
+
(u === "disabled" || u === "readOnly") && (c = !0);
|
|
165
|
+
const { t: g } = A(), y = H(f);
|
|
166
|
+
K("toggle", k);
|
|
167
|
+
const m = R(
|
|
168
|
+
() => [{ key: "Space", description: g("shortcuts.toggle", "Toggle") }],
|
|
169
|
+
[g]
|
|
170
|
+
), h = ne.useCallback(
|
|
171
|
+
(t) => {
|
|
172
|
+
t && (t.indeterminate = i), typeof n == "function" ? n(t) : n && (n.current = t);
|
|
173
|
+
},
|
|
174
|
+
[i, n]
|
|
175
|
+
);
|
|
176
|
+
return /* @__PURE__ */ v("div", { className: b, style: C, children: [
|
|
177
|
+
/* @__PURE__ */ v(
|
|
178
|
+
"label",
|
|
179
|
+
{
|
|
180
|
+
className: `nice-checkbox ${o !== "md" ? `nice-checkbox--${o}` : ""} ${c ? "nice-checkbox--disabled" : ""}`,
|
|
181
|
+
htmlFor: y,
|
|
182
|
+
children: [
|
|
183
|
+
/* @__PURE__ */ e(
|
|
184
|
+
"input",
|
|
185
|
+
{
|
|
186
|
+
ref: h,
|
|
187
|
+
id: y,
|
|
188
|
+
type: "checkbox",
|
|
189
|
+
className: "nice-checkbox__input",
|
|
190
|
+
name: _,
|
|
191
|
+
checked: p,
|
|
192
|
+
disabled: c,
|
|
193
|
+
"aria-invalid": !!d,
|
|
194
|
+
onChange: (t) => N?.(t.target.checked)
|
|
195
|
+
}
|
|
196
|
+
),
|
|
197
|
+
/* @__PURE__ */ e("span", { className: "nice-checkbox__box", children: /* @__PURE__ */ e(
|
|
198
|
+
"svg",
|
|
199
|
+
{
|
|
200
|
+
viewBox: "0 0 12 12",
|
|
201
|
+
fill: "none",
|
|
202
|
+
stroke: "currentColor",
|
|
203
|
+
strokeWidth: "2",
|
|
204
|
+
strokeLinecap: "round",
|
|
205
|
+
strokeLinejoin: "round",
|
|
206
|
+
children: i ? /* @__PURE__ */ e("line", { x1: "2", y1: "6", x2: "10", y2: "6" }) : /* @__PURE__ */ e("polyline", { points: "2 6 5 9 10 3" })
|
|
207
|
+
}
|
|
208
|
+
) }),
|
|
209
|
+
r && /* @__PURE__ */ e("span", { children: r }),
|
|
210
|
+
s && /* @__PURE__ */ e(L, { shortcuts: m, size: "sm" })
|
|
211
|
+
]
|
|
212
|
+
}
|
|
213
|
+
),
|
|
214
|
+
d && /* @__PURE__ */ e("div", { className: "nice-field__error", role: "alert", children: d })
|
|
215
|
+
] });
|
|
216
|
+
}
|
|
217
|
+
);
|
|
218
|
+
se.displayName = "NiceCheckbox";
|
|
219
|
+
const le = j(
|
|
220
|
+
({
|
|
221
|
+
label: r,
|
|
222
|
+
checked: p = !1,
|
|
223
|
+
onChange: i,
|
|
224
|
+
disabled: N,
|
|
225
|
+
size: c = "md",
|
|
226
|
+
name: o,
|
|
227
|
+
id: _,
|
|
228
|
+
className: f,
|
|
229
|
+
style: b,
|
|
230
|
+
accessMode: C,
|
|
231
|
+
displayStyle: d,
|
|
232
|
+
showKeyboardHints: x
|
|
233
|
+
}, k) => {
|
|
234
|
+
const s = S(C, _);
|
|
235
|
+
if (s === "hidden")
|
|
236
|
+
return null;
|
|
237
|
+
(s === "disabled" || s === "readOnly") && (N = !0);
|
|
238
|
+
const { t: n } = A(), u = H(_), g = E("toggle", d), y = K("toggle", d), m = R(
|
|
239
|
+
() => [{ key: "Space", description: n("shortcuts.toggle", "Toggle on/off") }],
|
|
240
|
+
[n]
|
|
241
|
+
);
|
|
242
|
+
return /* @__PURE__ */ v(
|
|
243
|
+
"label",
|
|
244
|
+
{
|
|
245
|
+
className: `nice-toggle nice-toggle--ds-${y} ${c !== "md" ? `nice-toggle--${c}` : ""} ${N ? "nice-toggle--disabled" : ""} ${f || ""}`,
|
|
246
|
+
htmlFor: u,
|
|
247
|
+
style: { ...g, ...b },
|
|
248
|
+
children: [
|
|
249
|
+
/* @__PURE__ */ e(
|
|
250
|
+
"input",
|
|
251
|
+
{
|
|
252
|
+
ref: k,
|
|
253
|
+
id: u,
|
|
254
|
+
type: "checkbox",
|
|
255
|
+
className: "nice-toggle__input",
|
|
256
|
+
name: o,
|
|
257
|
+
checked: p,
|
|
258
|
+
disabled: N,
|
|
259
|
+
role: "switch",
|
|
260
|
+
"aria-checked": p,
|
|
261
|
+
onChange: (h) => i?.(h.target.checked)
|
|
262
|
+
}
|
|
263
|
+
),
|
|
264
|
+
/* @__PURE__ */ e("span", { className: "nice-toggle__track", children: /* @__PURE__ */ e("span", { className: "nice-toggle__thumb" }) }),
|
|
265
|
+
r && /* @__PURE__ */ e("span", { children: r }),
|
|
266
|
+
x && /* @__PURE__ */ e(L, { shortcuts: m, size: "sm" })
|
|
267
|
+
]
|
|
268
|
+
}
|
|
269
|
+
);
|
|
270
|
+
}
|
|
271
|
+
);
|
|
272
|
+
le.displayName = "NiceToggle";
|
|
273
|
+
export {
|
|
274
|
+
se as N,
|
|
275
|
+
ie as a,
|
|
276
|
+
le as b
|
|
277
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const e=require("react/jsx-runtime"),i=require("react"),s=require("./core-BZBTsGWN.cjs"),K=i.forwardRef(({label:d,helperText:x,error:l,required:g,disabled:n,readOnly:r,size:b="md",name:f,id:j,className:$,style:m,accessMode:v,displayStyle:k,value:o,onChange:c,onBlur:h,onKeyDown:_,placeholder:y,min:p,max:N,step:t=1,precision:D,prefix:R,suffix:F,showStepper:M=!0,submitOnEnter:T,onSubmit:U,showKeyboardHints:z},B)=>{const w=s.useNiceAccessMode(v,j);if(w==="hidden")return null;w==="disabled"&&(n=!0),w==="readOnly"&&(r=!0);const{t:I}=s.useNiceTranslation(),A=s.useControlId(j),W=s.useComponentDisplayStyle("input",k),E=s.useComponentDisplayClass("input",k),C=i.useCallback(a=>{let u=a;return p!==void 0&&(u=Math.max(p,u)),N!==void 0&&(u=Math.min(N,u)),D!==void 0&&(u=parseFloat(u.toFixed(D))),u},[p,N,D]),G=i.useCallback(a=>{const u=a.target.value;if(u===""){c?.(null);return}const H=parseFloat(u);isNaN(H)||c?.(C(H))},[c,C]),J=i.useCallback(()=>{c?.(C((o??0)+t))},[o,t,c,C]),P=i.useCallback(()=>{c?.(C((o??0)-t))},[o,t,c,C]),S=s.useSubmitOnEnter({enabled:T,onSubmit:U}),Q=i.useCallback(a=>{S(a),_?.(a)},[S,_]),q=i.useMemo(()=>{const a=[];return T&&a.push(s.COMMON_SHORTCUTS.submit),M&&(a.push({key:"ArrowUp",description:I("shortcuts.increment","Increase value")}),a.push({key:"ArrowDown",description:I("shortcuts.decrement","Decrease value")})),a},[T,M,I]);return e.jsxs("div",{className:`nice-field ${$||""}`,style:m,children:[d&&e.jsxs("label",{htmlFor:A,className:`nice-field__label ${g?"nice-field__label--required":""}`,children:[d,z&&q.length>0&&e.jsx(s.NiceKeyboardHint,{shortcuts:q,size:"sm"})]}),e.jsxs("div",{className:`nice-input nice-input--${b} nice-input--ds-${E} ${l?"nice-input--error":""} ${n?"nice-input--disabled":""} ${r?"nice-input--readonly":""}`,style:W,children:[R&&e.jsx("span",{className:"nice-input__icon",children:R}),M&&!r&&e.jsx("button",{type:"button",className:"nice-input__clear",onClick:P,disabled:n,"aria-label":I("controls.decrement","Decrement"),children:"−"}),e.jsx("input",{ref:B,id:A,className:"nice-input__native",type:"number",name:f,value:o??"",placeholder:y,min:p,max:N,step:t,disabled:n,readOnly:r,"aria-invalid":!!l,onChange:G,onBlur:h,onKeyDown:Q}),M&&!r&&e.jsx("button",{type:"button",className:"nice-input__clear",onClick:J,disabled:n,"aria-label":I("controls.increment","Increment"),children:"+"}),F&&e.jsx("span",{className:"nice-input__icon",children:F})]}),l&&e.jsx("div",{className:"nice-field__error",role:"alert",children:l}),!l&&x&&e.jsx("div",{className:"nice-field__helper",children:x})]})});K.displayName="NiceNumberInput";const L=i.forwardRef(({label:d,checked:x=!1,indeterminate:l=!1,onChange:g,disabled:n,size:r="md",name:b,id:f,className:j,style:$,error:m,accessMode:v,displayStyle:k,showKeyboardHints:o},c)=>{const h=s.useNiceAccessMode(v,f);if(h==="hidden")return null;(h==="disabled"||h==="readOnly")&&(n=!0);const{t:_}=s.useNiceTranslation(),y=s.useControlId(f);s.useComponentDisplayClass("toggle",k);const p=i.useMemo(()=>[{key:"Space",description:_("shortcuts.toggle","Toggle")}],[_]),N=i.useCallback(t=>{t&&(t.indeterminate=l),typeof c=="function"?c(t):c&&(c.current=t)},[l,c]);return e.jsxs("div",{className:j,style:$,children:[e.jsxs("label",{className:`nice-checkbox ${r!=="md"?`nice-checkbox--${r}`:""} ${n?"nice-checkbox--disabled":""}`,htmlFor:y,children:[e.jsx("input",{ref:N,id:y,type:"checkbox",className:"nice-checkbox__input",name:b,checked:x,disabled:n,"aria-invalid":!!m,onChange:t=>g?.(t.target.checked)}),e.jsx("span",{className:"nice-checkbox__box",children:e.jsx("svg",{viewBox:"0 0 12 12",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:l?e.jsx("line",{x1:"2",y1:"6",x2:"10",y2:"6"}):e.jsx("polyline",{points:"2 6 5 9 10 3"})})}),d&&e.jsx("span",{children:d}),o&&e.jsx(s.NiceKeyboardHint,{shortcuts:p,size:"sm"})]}),m&&e.jsx("div",{className:"nice-field__error",role:"alert",children:m})]})});L.displayName="NiceCheckbox";const O=i.forwardRef(({label:d,checked:x=!1,onChange:l,disabled:g,size:n="md",name:r,id:b,className:f,style:j,accessMode:$,displayStyle:m,showKeyboardHints:v},k)=>{const o=s.useNiceAccessMode($,b);if(o==="hidden")return null;(o==="disabled"||o==="readOnly")&&(g=!0);const{t:c}=s.useNiceTranslation(),h=s.useControlId(b),_=s.useComponentDisplayStyle("toggle",m),y=s.useComponentDisplayClass("toggle",m),p=i.useMemo(()=>[{key:"Space",description:c("shortcuts.toggle","Toggle on/off")}],[c]);return e.jsxs("label",{className:`nice-toggle nice-toggle--ds-${y} ${n!=="md"?`nice-toggle--${n}`:""} ${g?"nice-toggle--disabled":""} ${f||""}`,htmlFor:h,style:{..._,...j},children:[e.jsx("input",{ref:k,id:h,type:"checkbox",className:"nice-toggle__input",name:r,checked:x,disabled:g,role:"switch","aria-checked":x,onChange:N=>l?.(N.target.checked)}),e.jsx("span",{className:"nice-toggle__track",children:e.jsx("span",{className:"nice-toggle__thumb"})}),d&&e.jsx("span",{children:d}),v&&e.jsx(s.NiceKeyboardHint,{shortcuts:p,size:"sm"})]})});O.displayName="NiceToggle";exports.NiceCheckbox=L;exports.NiceNumberInput=K;exports.NiceToggle=O;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const t=require("react/jsx-runtime"),W=require("./core-BZBTsGWN.cjs"),i=require("react"),ot=({visible:e,onClose:s,title:c,items:r,showCancelButton:h=!0,cancelText:d,className:f,style:w})=>{const{t:p}=W.useNiceTranslation();return e?t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"nice-actionsheet__overlay",onClick:s}),t.jsxs("div",{className:`nice-actionsheet ${f||""}`,style:w,children:[c&&t.jsx("div",{className:"nice-actionsheet__title",children:c}),t.jsx("div",{className:"nice-actionsheet__items",children:r.map((N,a)=>t.jsxs("button",{className:`nice-actionsheet__item ${N.type==="danger"?"nice-actionsheet__item--danger":""}`,disabled:N.disabled,onClick:()=>{N.onClick?.(),s()},children:[N.icon&&t.jsx("span",{className:"nice-actionsheet__icon",children:N.icon}),N.text]},a))}),h&&t.jsx("button",{className:"nice-actionsheet__cancel",onClick:s,children:d||p("cancel","Cancel")})]})]}):null},rt=({visible:e,onClose:s,targetRef:c,position:r="bottom",title:h,showArrow:d=!0,width:f,children:w,className:p,style:N,displayStyle:a})=>{W.useComponentDisplayClass("tooltip",a);const y=i.useRef(null),[R,u]=i.useState({top:0,left:0}),Y=i.useCallback(()=>{const _=c.current,T=y.current;if(!_||!T)return;const o=_.getBoundingClientRect(),b=T.getBoundingClientRect();let m=0,E=0;const M=8;switch(r){case"top":m=o.top-b.height-M,E=o.left+(o.width-b.width)/2;break;case"bottom":m=o.bottom+M,E=o.left+(o.width-b.width)/2;break;case"left":m=o.top+(o.height-b.height)/2,E=o.left-b.width-M;break;case"right":m=o.top+(o.height-b.height)/2,E=o.right+M;break}u({top:m+window.scrollY,left:E+window.scrollX})},[c,r]);return i.useEffect(()=>{if(e){requestAnimationFrame(Y);const _=T=>{y.current&&!y.current.contains(T.target)&&c.current&&!c.current.contains(T.target)&&s()};return document.addEventListener("mousedown",_),()=>document.removeEventListener("mousedown",_)}},[e,Y,s,c]),e?t.jsxs("div",{ref:y,className:`nice-popover nice-popover--${r} ${p||""}`,style:{...N,position:"absolute",top:R.top,left:R.left,width:f},children:[d&&t.jsx("div",{className:`nice-popover__arrow nice-popover__arrow--${r}`}),h&&t.jsx("div",{className:"nice-popover__title",children:h}),t.jsx("div",{className:"nice-popover__content",children:w})]}):null},at=({visible:e,message:s,container:c,showIndicator:r=!0,shading:h=!0,className:d,style:f})=>{const{t:w}=W.useNiceTranslation();if(!e)return null;const p=!!c?.current,N=t.jsxs("div",{className:`nice-loadpanel ${d||""}`,style:f,children:[h&&t.jsx("div",{className:"nice-loadpanel__shade"}),t.jsxs("div",{className:"nice-loadpanel__box",children:[r&&t.jsx("div",{className:"nice-spinner nice-spinner--md"}),t.jsx("span",{className:"nice-loadpanel__text",children:s||w("loading","Loading...")})]})]});if(p&&c.current){const a=c.current;return a.style.position=a.style.position||"relative",N}return N},lt=({direction:e="row",align:s,justify:c,wrap:r,gap:h,flex:d,children:f,className:w,style:p})=>t.jsx("div",{className:`nice-box ${w||""}`,style:{display:"flex",flexDirection:e,alignItems:s,justifyContent:c,flexWrap:r?"wrap":void 0,gap:h,flex:d,...p},children:f}),dt=({direction:e="row",items:s,gap:c,className:r,style:h})=>t.jsx("div",{className:`nice-responsivebox ${r||""}`,style:{display:"flex",flexDirection:e,gap:c,...h},children:s.map((d,f)=>t.jsx("div",{style:{flex:d.ratio??1,flexBasis:d.baseSize,flexShrink:d.shrink??1},children:d.children},f))}),ut=({width:e=200,height:s=200,minWidth:c=50,minHeight:r=50,maxWidth:h=1/0,maxHeight:d=1/0,handles:f=["right","bottom","bottomRight"],onResize:w,children:p,className:N,style:a})=>{const[y,R]=i.useState({width:e,height:s}),u=i.useRef(null),Y=(o,b)=>{b.preventDefault();const m=b.clientX,E=b.clientY,M=y.width,$=y.height,n=C=>{const z=C.clientX-m,q=C.clientY-E;let P=M,l=$;(o.includes("right")||o==="right")&&(P=M+z),(o.includes("bottom")||o==="bottom")&&(l=$+q),(o.includes("left")||o==="left")&&(P=M-z),(o.includes("top")||o==="top")&&(l=$-q),P=Math.max(c,Math.min(h,P)),l=Math.max(r,Math.min(d,l)),R({width:P,height:l}),w?.({width:P,height:l})},g=()=>{document.removeEventListener("pointermove",n),document.removeEventListener("pointerup",g)};document.addEventListener("pointermove",n),document.addEventListener("pointerup",g)},_=o=>{switch(o){case"top":case"bottom":return"ns-resize";case"left":case"right":return"ew-resize";case"topLeft":case"bottomRight":return"nwse-resize";case"topRight":case"bottomLeft":return"nesw-resize";default:return"default"}},T=o=>{const b={position:"absolute",zIndex:1},m=8;return o==="right"?{...b,top:0,right:-m/2,width:m,height:"100%",cursor:_(o)}:o==="bottom"?{...b,left:0,bottom:-m/2,width:"100%",height:m,cursor:_(o)}:o==="left"?{...b,top:0,left:-m/2,width:m,height:"100%",cursor:_(o)}:o==="top"?{...b,top:-m/2,left:0,width:"100%",height:m,cursor:_(o)}:o==="bottomRight"?{...b,bottom:-m/2,right:-m/2,width:m*2,height:m*2,cursor:_(o)}:o==="bottomLeft"?{...b,bottom:-m/2,left:-m/2,width:m*2,height:m*2,cursor:_(o)}:o==="topRight"?{...b,top:-m/2,right:-m/2,width:m*2,height:m*2,cursor:_(o)}:o==="topLeft"?{...b,top:-m/2,left:-m/2,width:m*2,height:m*2,cursor:_(o)}:b};return t.jsxs("div",{ref:u,className:`nice-resizable ${N||""}`,style:{...a,width:y.width,height:y.height,position:"relative",overflow:"hidden"},children:[p,f.map(o=>t.jsx("div",{style:T(o),onPointerDown:b=>Y(o,b)},o))]})},mt=({direction:e="vertical",showScrollbar:s="onInteraction",width:c,height:r,onScroll:h,children:d,className:f,style:w})=>{const p=e==="horizontal"||e==="both"?"auto":"hidden",N=e==="vertical"||e==="both"?"auto":"hidden",a=s==="never"?"nice-scrollview--hide-sb":s==="always"?"nice-scrollview--show-sb":"";return t.jsx("div",{className:`nice-scrollview ${a} ${f||""}`,style:{...w,width:c,height:r,overflowX:p,overflowY:N},onScroll:h,children:d})};function he(e,s){if(!e)return{score:1,indices:[]};const c=e.toLowerCase(),r=s.toLowerCase();let h=0;const d=[];let f=0,w=-1;for(let p=0;p<r.length&&h<c.length;p++)r[p]===c[h]&&(d.push(p),w===p-1&&(f+=3),(p===0||/[\s\-_/.]/.test(s[p-1]))&&(f+=5),s[p]===e[h]&&(f+=1),f+=1,w=p,h++);return h<c.length?null:(f-=d[0]*.1,{score:f,indices:d})}function Ce(e,s){if(s.length===0)return[e];const c=[];let r=0;const h=new Set(s);for(let d=0;d<e.length;d++)h.has(d)&&(r<d&&c.push(e.slice(r,d)),c.push(i.createElement("mark",{key:`m-${d}`,className:"nice-command-palette__match"},e[d])),r=d+1);return r<e.length&&c.push(e.slice(r)),c}function ht(e,s){switch(s.type){case"REGISTER":{const c=new Map(e.commands);return c.set(s.command.id,s.command),{...e,commands:c}}case"REGISTER_BATCH":{const c=new Map(e.commands);for(const r of s.commands)c.set(r.id,r);return{...e,commands:c}}case"UNREGISTER":{const c=new Map(e.commands);return c.delete(s.id),{...e,commands:c}}case"OPEN":return{...e,isOpen:!0,query:"",selectedIndex:0};case"CLOSE":return{...e,isOpen:!1,query:"",selectedIndex:0};case"SET_QUERY":return{...e,query:s.query,selectedIndex:0};case"SET_SELECTED":return{...e,selectedIndex:s.index};case"ADD_RECENT":{const c=e.recentIds.filter(r=>r!==s.id);return{...e,recentIds:[s.id,...c].slice(0,s.maxRecent)}}default:return e}}const je=i.createContext(null);function Ee(){const e=i.useContext(je);if(!e)throw new Error("useCommandPalette must be used within NiceCommandPaletteProvider");return e}const ze=({children:e,commands:s,placeholder:c="Type a command...",maxVisible:r=10,maxRecent:h=5,className:d,emptyText:f="No commands found",closeOnAction:w=!0,onOpen:p,onClose:N})=>{const[a,y]=i.useReducer(ht,{commands:new Map(s?.map(l=>[l.id,l])??[]),isOpen:!1,query:"",selectedIndex:0,recentIds:[]}),R=i.useRef(null),u=i.useRef(null),[Y,_]=i.useState(!1),T=i.useCallback(l=>{y({type:"REGISTER",command:l})},[]),o=i.useCallback(l=>{y({type:"UNREGISTER",id:l})},[]),b=i.useCallback(l=>{y({type:"REGISTER_BATCH",commands:l})},[]),m=i.useCallback(()=>{y({type:"OPEN"}),p?.()},[p]),E=i.useCallback(()=>{y({type:"CLOSE"}),N?.()},[N]),M=i.useCallback(()=>{a.isOpen?E():m()},[a.isOpen,E,m]),n=i.useMemo(()=>{const l=Array.from(a.commands.values()).filter(x=>!x.hidden);if(!a.query.trim()){const x=a.recentIds.map(S=>a.commands.get(S)).filter(S=>!!S&&!S.hidden),D=l.filter(S=>!a.recentIds.includes(S.id));return D.sort((S,K)=>S.label.localeCompare(K.label)),[...x,...D].map(S=>({command:S,match:null,isRecent:a.recentIds.includes(S.id)}))}return l.map(x=>{const D=he(a.query,x.label),S=x.description?he(a.query,x.description):null,K=x.keywords?.map(j=>he(a.query,j)).filter(Boolean)[0]??null,se=[D,S,K].filter(Boolean).sort((j,L)=>(L?.score??0)-(j?.score??0))[0];return{command:x,match:se,isRecent:!1}}).filter(x=>x.match!==null).sort((x,D)=>(D.match?.score??0)-(x.match?.score??0))},[a.commands,a.query,a.recentIds]).slice(0,r),g=i.useCallback(async l=>{const k=a.commands.get(l);if(!(!k||k.disabled)){_(!0);try{await k.action(),y({type:"ADD_RECENT",id:l,maxRecent:h})}finally{_(!1),w&&E()}}},[a.commands,h,w,E]);i.useEffect(()=>{const l=k=>{(k.metaKey||k.ctrlKey)&&k.key==="k"&&(k.preventDefault(),M()),k.key==="Escape"&&a.isOpen&&(k.preventDefault(),E())};return document.addEventListener("keydown",l),()=>document.removeEventListener("keydown",l)},[M,a.isOpen,E]),i.useEffect(()=>{a.isOpen&&requestAnimationFrame(()=>R.current?.focus())},[a.isOpen]);const C=i.useCallback(l=>{const k=n.length;if(k){if(l.key==="ArrowDown")l.preventDefault(),y({type:"SET_SELECTED",index:(a.selectedIndex+1)%k});else if(l.key==="ArrowUp")l.preventDefault(),y({type:"SET_SELECTED",index:(a.selectedIndex-1+k)%k});else if(l.key==="Enter"){l.preventDefault();const x=n[a.selectedIndex];x&&g(x.command.id)}}},[n,a.selectedIndex,g]);i.useEffect(()=>{if(!u.current)return;u.current.children[a.selectedIndex]?.scrollIntoView({block:"nearest"})},[a.selectedIndex]);const z=i.useMemo(()=>({registerCommand:T,unregisterCommand:o,registerCommands:b,open:m,close:E,toggle:M,isOpen:a.isOpen,executeCommand:g}),[T,o,b,m,E,M,a.isOpen,g]),q=i.useMemo(()=>{const l=new Map;for(const k of n){const x=k.command.category??"General";l.has(x)||l.set(x,[]),l.get(x).push(k)}return l},[n]);let P=0;return t.jsxs(je.Provider,{value:z,children:[e,a.isOpen&&t.jsx("div",{className:`nice-command-palette__overlay ${d??""}`,onClick:E,children:t.jsxs("div",{className:"nice-command-palette",role:"dialog","aria-label":"Command Palette","aria-modal":"true",onClick:l=>l.stopPropagation(),children:[t.jsx("div",{className:"nice-command-palette__input-wrapper",children:t.jsx("input",{ref:R,className:"nice-command-palette__input",type:"text",placeholder:c,value:a.query,onChange:l=>y({type:"SET_QUERY",query:l.target.value}),onKeyDown:C,"aria-label":"Search commands","aria-autocomplete":"list","aria-controls":"nice-command-palette-list","aria-activedescendant":n[a.selectedIndex]?`nice-cmd-${n[a.selectedIndex].command.id}`:void 0})}),t.jsxs("div",{ref:u,id:"nice-command-palette-list",className:"nice-command-palette__list",role:"listbox",children:[n.length===0&&t.jsx("div",{className:"nice-command-palette__empty",children:f}),Array.from(q.entries()).map(([l,k])=>t.jsxs("div",{className:"nice-command-palette__group",children:[t.jsx("div",{className:"nice-command-palette__category",children:l}),k.map(x=>{const D=P++,S=D===a.selectedIndex;return t.jsxs("div",{id:`nice-cmd-${x.command.id}`,className:`nice-command-palette__item ${S?"nice-command-palette__item--selected":""} ${x.command.disabled?"nice-command-palette__item--disabled":""}`,role:"option","aria-selected":S,"aria-disabled":x.command.disabled,onClick:()=>!x.command.disabled&&g(x.command.id),onMouseEnter:()=>y({type:"SET_SELECTED",index:D}),children:[x.command.icon&&t.jsx("span",{className:"nice-command-palette__icon",children:x.command.icon}),t.jsxs("div",{className:"nice-command-palette__label-group",children:[t.jsx("span",{className:"nice-command-palette__label",children:x.match&&a.query?Ce(x.command.label,x.match.indices):x.command.label}),x.command.description&&t.jsx("span",{className:"nice-command-palette__description",children:x.command.description})]}),x.command.shortcut&&t.jsx("kbd",{className:"nice-command-palette__shortcut",children:x.command.shortcut}),x.isRecent&&t.jsx("span",{className:"nice-command-palette__recent-badge",children:"Recent"})]},x.command.id)})]},l))]}),Y&&t.jsx("div",{className:"nice-command-palette__executing",children:"Executing..."})]})})]})};ze.displayName="NiceCommandPaletteProvider";function ft(e){const{registerCommands:s,unregisterCommand:c}=Ee();i.useEffect(()=>(s(e),()=>{for(const r of e)c(r.id)}),[])}const Se=i.forwardRef(({blocked:e,message:s,children:c,className:r,style:h,id:d},f)=>{const w=W.useControlId(d);return t.jsxs("div",{ref:f,id:w,className:`nice-block-ui ${r||""}`,style:{position:"relative",...h},children:[c,e&&t.jsx("div",{className:"nice-block-ui__overlay","aria-busy":"true",role:"alert",children:s&&t.jsx("div",{className:"nice-block-ui__message",children:s})})]})});Se.displayName="NiceBlockUI";const Me=i.forwardRef(({windows:e,onChange:s,onClose:c,onFocus:r,showTaskbar:h=!0,size:d="md",className:f,style:w,id:p,...N},a)=>{const y=W.useControlId(p),{t:R}=W.useNiceTranslation(),[u,Y]=i.useState(null),_=i.useRef(null),T=Math.max(1,...e.map(n=>n.zIndex??1)),o=i.useCallback((n,g)=>{const C=e.map(z=>z.key===n?{...z,...g}:z);s?.(C)},[e,s]),b=i.useCallback(n=>{o(n,{zIndex:T+1}),r?.(n)},[o,T,r]),m=i.useCallback(n=>{c?.(n),s?.(e.filter(g=>g.key!==n))},[e,s,c]),E=i.useCallback(n=>{const g=e.find(C=>C.key===n);g&&o(n,{minimized:!g.minimized,maximized:!1})},[e,o]),M=i.useCallback(n=>{const g=e.find(C=>C.key===n);g&&o(n,{maximized:!g.maximized,minimized:!1})},[e,o]);i.useEffect(()=>{if(!u)return;const n=C=>{const z=e.find(q=>q.key===u.key);if(z)if(u.mode==="move")o(u.key,{x:C.clientX-u.offsetX,y:C.clientY-u.offsetY});else{const P=_.current?.getBoundingClientRect(),l=P?.left??0,k=P?.top??0;o(u.key,{width:Math.max(200,C.clientX-l-z.x),height:Math.max(100,C.clientY-k-z.y)})}},g=()=>Y(null);return document.addEventListener("mousemove",n),document.addEventListener("mouseup",g),()=>{document.removeEventListener("mousemove",n),document.removeEventListener("mouseup",g)}},[u,e,o]);const $=i.useCallback((n,g,C)=>{g.preventDefault();const z=e.find(q=>q.key===n);z&&(b(n),Y({key:n,offsetX:C==="move"?g.clientX-z.x:0,offsetY:C==="move"?g.clientY-z.y:0,mode:C}))},[e,b]);return t.jsxs("div",{ref:n=>{_.current=n,typeof a=="function"?a(n):a&&(a.current=n)},id:y,className:`nice-wm nice-wm--${d} ${f??""}`,style:{...w,position:"relative",overflow:"hidden"},...N,children:[e.map(n=>{if(n.minimized)return null;const g=n.maximized,C=g?{position:"absolute",top:0,left:0,width:"100%",height:"100%",zIndex:n.zIndex??1}:{position:"absolute",top:n.y,left:n.x,width:n.width,height:n.height,zIndex:n.zIndex??1};return t.jsxs("div",{className:`nice-wm__window ${g?"nice-wm__window--maximized":""}`,style:C,onMouseDown:()=>b(n.key),role:"dialog","aria-label":n.title,children:[t.jsxs("div",{className:"nice-wm__titlebar",onMouseDown:z=>!g&&$(n.key,z,"move"),children:[n.icon&&t.jsx("span",{className:"nice-wm__icon",children:n.icon}),t.jsx("span",{className:"nice-wm__title",children:n.title}),t.jsxs("div",{className:"nice-wm__controls",children:[(n.minimizable??!0)&&t.jsx("button",{type:"button",className:"nice-wm__ctrl-btn nice-wm__ctrl-btn--min",onClick:()=>E(n.key),title:R("wm.minimize","Minimize"),children:"─"}),(n.maximizable??!0)&&t.jsx("button",{type:"button",className:"nice-wm__ctrl-btn nice-wm__ctrl-btn--max",onClick:()=>M(n.key),title:R("wm.maximize","Maximize"),children:g?"❐":"☐"}),(n.closable??!0)&&t.jsx("button",{type:"button",className:"nice-wm__ctrl-btn nice-wm__ctrl-btn--close",onClick:()=>m(n.key),title:R("wm.close","Close"),children:"✕"})]})]}),t.jsx("div",{className:"nice-wm__body",children:n.content}),(n.resizable??!0)&&!g&&t.jsx("div",{className:"nice-wm__resize-handle",onMouseDown:z=>$(n.key,z,"resize")})]},n.key)}),h&&t.jsx("div",{className:"nice-wm__taskbar",role:"toolbar","aria-label":R("wm.taskbar","Taskbar"),children:e.map(n=>t.jsxs("button",{type:"button",className:`nice-wm__taskbar-btn ${n.minimized?"nice-wm__taskbar-btn--minimized":""}`,onClick:()=>{n.minimized&&E(n.key),b(n.key)},children:[n.icon&&t.jsx("span",{className:"nice-wm__taskbar-icon",children:n.icon}),t.jsx("span",{className:"nice-wm__taskbar-label",children:n.title})]},n.key))})]})});Me.displayName="NiceWindowManager";function pt(e,s){const c=document.querySelector(e);if(!c)return null;const r=c.getBoundingClientRect();return{top:r.top-s+window.scrollY,left:r.left-s+window.scrollX,width:r.width+s*2,height:r.height+s*2}}function xt(e,s,c,r){const d={w:window.innerWidth,h:window.innerHeight+window.scrollY},f={top:{top:e.top-c-12,left:e.left+e.width/2-s/2},bottom:{top:e.top+e.height+12,left:e.left+e.width/2-s/2},left:{top:e.top+e.height/2-c/2,left:e.left-s-12},right:{top:e.top+e.height/2-c/2,left:e.left+e.width+12}};if(r&&r!=="auto")return{...f[r],actualPlacement:r};for(const w of["bottom","top","right","left"]){const p=f[w];if(p.top>=0&&p.left>=0&&p.top+c<=d.h&&p.left+s<=d.w)return{...p,actualPlacement:w}}return{...f.bottom,actualPlacement:"bottom"}}const be=({steps:e,active:s,onFinish:c,onSkip:r,onStepChange:h,closeOnEscape:d=!0,closeOnOverlayClick:f=!1,showProgress:w=!0,showSkipButton:p=!0,labels:N,animationDuration:a=300,overlayOpacity:y=.6,zIndex:R=1e4})=>{const[u,Y]=i.useState(0),[_,T]=i.useState(null),[o,b]=i.useState({w:340,h:200}),[m,E]=i.useState(!0),M=i.useRef(null),$=i.useRef(-1),n=e[u],g=u===e.length-1,C=u===0,z=N?.next??"Next",q=N?.back??"Back",P=N?.finish??"Finish",l=N?.skip??"Skip",k=N?.stepOf??"of";i.useEffect(()=>{if(M.current){const j=M.current.getBoundingClientRect();b({w:j.width,h:j.height})}},[u,s]),i.useEffect(()=>{if(!s||!n)return;const j=()=>{const L=pt(n.target,n.highlightPadding??8);T(L)};if(j(),n.scrollIntoView!==!1){document.querySelector(n.target)?.scrollIntoView({behavior:"smooth",block:"center"});const fe=setTimeout(j,350);return()=>clearTimeout(fe)}},[s,n,u]),i.useEffect(()=>{!s||!n||$.current!==u&&($.current>=0&&$.current<e.length&&e[$.current]?.onLeave?.(),n.onEnter?.(),$.current=u)},[s,n,u,e]),i.useEffect(()=>{if(!s||!n?.advanceOn)return;const j=document.querySelector(n.target);if(!j)return;const L=()=>x();return j.addEventListener(n.advanceOn.event,L),()=>j.removeEventListener(n.advanceOn.event,L)},[s,n,u]),i.useEffect(()=>{if(!s)return;const j=L=>{L.key==="Escape"&&d?r?.():L.key==="ArrowRight"?x():L.key==="ArrowLeft"&&D()};return document.addEventListener("keydown",j),()=>document.removeEventListener("keydown",j)},[s,u,d]),i.useEffect(()=>{E(!0);const j=setTimeout(()=>E(!1),a);return()=>clearTimeout(j)},[u,a]);const x=i.useCallback(()=>{if(g)n?.onLeave?.(),c?.();else{const j=u+1;Y(j),h?.(j)}},[u,g,c,h,n]),D=i.useCallback(()=>{if(!C){const j=u-1;Y(j),h?.(j)}},[u,C,h]),S=i.useMemo(()=>_?xt(_,o.w,o.h,n?.placement):{top:window.innerHeight/2,left:window.innerWidth/2,actualPlacement:"bottom"},[_,o,n?.placement]);if(!s||!n)return null;const K=Math.max(document.documentElement.scrollWidth,window.innerWidth),se=Math.max(document.documentElement.scrollHeight,window.innerHeight);return t.jsxs("div",{className:"nice-tutorial",style:{zIndex:R},"aria-modal":"true",role:"dialog","aria-label":"Tutorial",children:[t.jsxs("svg",{className:"nice-tutorial__overlay",style:{position:"absolute",top:0,left:0,width:K,height:se,pointerEvents:"auto"},onClick:f?r:void 0,children:[t.jsx("defs",{children:t.jsxs("mask",{id:"nice-tutorial-mask",children:[t.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:"white"}),_&&t.jsx("rect",{x:_.left,y:_.top,width:_.width,height:_.height,rx:"8",fill:"black",className:m?"nice-tutorial__spotlight--entering":""})]})}),t.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`rgba(0,0,0,${y})`,mask:"url(#nice-tutorial-mask)"})]}),_&&t.jsx("div",{className:`nice-tutorial__highlight ${m?"nice-tutorial__highlight--entering":""}`,style:{position:"absolute",top:_.top,left:_.left,width:_.width,height:_.height,transition:`all ${a}ms ease`}}),n.disableInteraction&&_&&t.jsx("div",{className:"nice-tutorial__blocker",style:{position:"absolute",top:_.top,left:_.left,width:_.width,height:_.height}}),t.jsxs("div",{ref:M,className:`nice-tutorial__tooltip nice-tutorial__tooltip--${S.actualPlacement} ${m?"nice-tutorial__tooltip--entering":""}`,style:{position:"absolute",top:S.top,left:S.left,transition:`all ${a}ms ease`,maxWidth:380,zIndex:R+1},children:[n.showArrow!==!1&&t.jsx("div",{className:`nice-tutorial__arrow nice-tutorial__arrow--${S.actualPlacement}`}),t.jsxs("div",{className:"nice-tutorial__header",children:[t.jsx("h4",{className:"nice-tutorial__title",children:n.title}),p&&t.jsx("button",{type:"button",className:"nice-tutorial__close",onClick:r,"aria-label":l,children:"✕"})]}),t.jsx("div",{className:"nice-tutorial__content",dangerouslySetInnerHTML:{__html:W.sanitizeHtml(n.content)}}),t.jsxs("div",{className:"nice-tutorial__footer",children:[w&&t.jsxs("div",{className:"nice-tutorial__progress",children:[e.map((j,L)=>t.jsx("span",{className:`nice-tutorial__dot ${L===u?"nice-tutorial__dot--active":""} ${L<u?"nice-tutorial__dot--done":""}`},L)),t.jsxs("span",{className:"nice-tutorial__step-label",children:[u+1," ",k," ",e.length]})]}),t.jsxs("div",{className:"nice-tutorial__actions",children:[p&&!g&&t.jsx("button",{type:"button",className:"nice-tutorial__btn nice-tutorial__btn--skip",onClick:r,children:l}),!C&&t.jsx("button",{type:"button",className:"nice-tutorial__btn nice-tutorial__btn--back",onClick:D,children:q}),!n.waitForAction&&t.jsx("button",{type:"button",className:"nice-tutorial__btn nice-tutorial__btn--next",onClick:x,children:g?P:z})]})]})]})]})};be.displayName="NiceTutorial";const Re=i.createContext({startTutorial:()=>{},stopTutorial:()=>{},isActive:!1,currentStep:0,nextStep:()=>{},prevStep:()=>{},goToStep:()=>{}});function _t(){return i.useContext(Re)}const Ie=({children:e})=>{const[s,c]=i.useState([]),[r,h]=i.useState(!1),[d,f]=i.useState(0),w=i.useCallback(u=>{c(u),f(0),h(!0)},[]),p=i.useCallback(()=>{h(!1),f(0),c([])},[]),N=i.useCallback(()=>{f(u=>Math.min(u+1,s.length-1))},[s.length]),a=i.useCallback(()=>{f(u=>Math.max(u-1,0))},[]),y=i.useCallback(u=>{f(Math.max(0,Math.min(u,s.length-1)))},[s.length]),R={startTutorial:w,stopTutorial:p,isActive:r,currentStep:d,nextStep:N,prevStep:a,goToStep:y};return t.jsxs(Re.Provider,{value:R,children:[e,r&&s.length>0&&t.jsx(be,{steps:s,active:r,onFinish:p,onSkip:p,onStepChange:f})]})};Ie.displayName="NiceTutorialProvider";function gt(e,s,c,r,h){const d=e<=h,f=e+h>=c,w=s<=h,p=s+h>=r;return w&&d?"top-left":w&&f?"top-right":p&&d?"bottom-left":p&&f?"bottom-right":d?"left":f?"right":w?"top":p?"bottom":"none"}function wt(e){switch(e){case"left":return{left:0,top:0,width:"50%",height:"100%"};case"right":return{left:"50%",top:0,width:"50%",height:"100%"};case"top":return{left:0,top:0,width:"100%",height:"50%"};case"bottom":return{left:0,top:"50%",width:"100%",height:"50%"};case"top-left":return{left:0,top:0,width:"50%",height:"50%"};case"top-right":return{left:"50%",top:0,width:"50%",height:"50%"};case"bottom-left":return{left:0,top:"50%",width:"50%",height:"50%"};case"bottom-right":return{left:"50%",top:"50%",width:"50%",height:"50%"};default:return null}}const Te=i.forwardRef(({windowKey:e,title:s,icon:c,children:r,footer:h,x:d=100,y:f=100,width:w=480,height:p=360,minWidth:N=200,minHeight:a=120,maxWidth:y,maxHeight:R,zIndex:u=1,closable:Y=!0,minimizable:_=!0,maximizable:T=!0,fullscreenable:o=!1,pinnable:b=!1,resizable:m=!0,draggable:E=!0,snappable:M=!0,snapThreshold:$=20,minimized:n,maximized:g,fullscreen:C,pinned:z,focused:q,onClose:P,onMinimize:l,onMaximize:k,onFullscreen:x,onPin:D,onFocus:S,onMove:K,onResize:se,onSnap:j,onTitleBarDoubleClick:L,size:fe="md",statusBar:ve,titleBarActions:Le,className:Pe,style:$e,id:Ne,accessMode:De,...Ye},Xe)=>{const qe=W.useControlId(Ne),Oe=W.useNiceAccessMode(De,Ne),{t:ce}=W.useNiceTranslation();if(Oe==="hidden")return null;const[de,ne]=i.useState({x:d,y:f}),[ue,me]=i.useState({width:w,height:p}),[Ae,Be]=i.useState(!1),[We,Fe]=i.useState(!1),[He,Ue]=i.useState(!1),[Ge,Ve]=i.useState(!1),[F,pe]=i.useState("none"),Qe=n??Ae,B=g??We,A=C??He,oe=z??Ge,xe=q??!0,ee=de.x,te=de.y,G=ue.width,V=ue.height,H=i.useRef(null),O=i.useRef(null),I=i.useRef(null),Ze=i.useCallback(()=>{P?.(e)},[e,P]),Je=i.useCallback(()=>{Be(!0),l?.(e)},[e,l]),_e=i.useCallback(()=>{const v=!B;Fe(v),!v&&I.current?(ne({x:I.current.x,y:I.current.y}),me({width:I.current.w,height:I.current.h}),I.current=null):v&&(I.current={x:ee,y:te,w:G,h:V}),pe("none"),k?.(e,v)},[e,B,ee,te,G,V,k]),ge=i.useCallback(()=>{const v=!A;Ue(v),v?I.current={x:ee,y:te,w:G,h:V}:I.current&&(ne({x:I.current.x,y:I.current.y}),me({width:I.current.w,height:I.current.h}),I.current=null),x?.(e,v)},[e,A,ee,te,G,V,x]),Ke=i.useCallback(()=>{const v=!oe;Ve(v),D?.(e,v)},[e,oe,D]),re=i.useCallback(()=>{S?.(e)},[e,S]),et=i.useCallback(()=>{L?L(e):T&&_e()},[e,T,_e,L]);i.useEffect(()=>{if(!H.current)return;const v=Q=>{if(!H.current)return;const U=Q.clientX-H.current.startX+H.current.origX,ae=Q.clientY-H.current.startY+H.current.origY;ne({x:U,y:ae}),K?.(e,{x:U,y:ae})},X=Q=>{if(H.current){if(M){const U=gt(Q.clientX,Q.clientY,window.innerWidth,window.innerHeight,$);U!=="none"&&(I.current={x:de.x,y:de.y,w:G,h:V},pe(U),j?.(e,U))}H.current=null}};return document.addEventListener("mousemove",v),document.addEventListener("mouseup",X),()=>{document.removeEventListener("mousemove",v),document.removeEventListener("mouseup",X)}});const tt=i.useCallback(v=>{!E||B||A||(v.preventDefault(),F!=="none"&&(I.current&&(ne({x:I.current.x,y:I.current.y}),me({width:I.current.w,height:I.current.h})),pe("none")),re(),H.current={startX:v.clientX,startY:v.clientY,origX:ee,origY:te})},[E,B,A,F,ee,te,re]);i.useEffect(()=>{if(!O.current)return;const v=Q=>{if(!O.current)return;const U=Q.clientX-O.current.startX,ae=Q.clientY-O.current.startY,ie=O.current.handle;let Z=O.current.origW,J=O.current.origH;if(ie.includes("e")&&(Z=O.current.origW+U),ie.includes("w")&&(Z=O.current.origW-U),ie.includes("s")&&(J=O.current.origH+ae),ie.includes("n")&&(J=O.current.origH-ae),Z=Math.max(N,y?Math.min(y,Z):Z),J=Math.max(a,R?Math.min(R,J):J),ie.includes("w")){const we=ue.width-Z;ne(le=>({...le,x:le.x+we}))}if(ie.includes("n")){const we=ue.height-J;ne(le=>({...le,y:le.y+we}))}me({width:Z,height:J}),se?.(e,{width:Z,height:J})},X=()=>{O.current=null};return document.addEventListener("mousemove",v),document.addEventListener("mouseup",X),()=>{document.removeEventListener("mousemove",v),document.removeEventListener("mouseup",X)}});const nt=i.useCallback((v,X)=>{!m||B||A||F!=="none"||(X.preventDefault(),X.stopPropagation(),re(),O.current={startX:X.clientX,startY:X.clientY,origW:G,origH:V,handle:v})},[m,B,A,F,G,V,re]);if(i.useEffect(()=>{if(!xe)return;const v=X=>{X.key==="Escape"&&A&&ge()};return document.addEventListener("keydown",v),()=>document.removeEventListener("keydown",v)},[xe,A,ge]),Qe)return null;const ye=F!=="none"?wt(F):null,ke=B||A,it=A?{position:"fixed",top:0,left:0,width:"100vw",height:"100vh",zIndex:999999}:B?{position:"absolute",top:0,left:0,width:"100%",height:"100%",zIndex:u}:ye?{position:"absolute",...ye,zIndex:u}:{position:"absolute",top:te,left:ee,width:G,height:V,zIndex:u},st=["n","e","s","w","ne","se","sw","nw"],ct={n:"ns-resize",s:"ns-resize",e:"ew-resize",w:"ew-resize",ne:"nesw-resize",sw:"nesw-resize",nw:"nwse-resize",se:"nwse-resize"};return t.jsxs("div",{ref:Xe,id:qe,className:`nice-window nice-window--${fe} ${xe?"nice-window--focused":""} ${oe?"nice-window--pinned":""} ${ke?"nice-window--maximized":""} ${F!=="none"?`nice-window--snapped-${F}`:""} ${Pe??""}`,style:{...it,...$e},onMouseDown:re,role:"dialog","aria-label":s,...Ye,children:[t.jsxs("div",{className:"nice-window__titlebar",onMouseDown:tt,onDoubleClick:et,children:[c&&t.jsx("span",{className:"nice-window__icon",children:c}),t.jsx("span",{className:"nice-window__title",children:s}),t.jsxs("div",{className:"nice-window__actions",children:[Le,b&&t.jsx("button",{type:"button",className:`nice-window__action nice-window__action--pin ${oe?"nice-window__action--active":""}`,onClick:Ke,title:ce("window.pin",oe?"Unpin":"Pin"),children:"📌"}),_&&t.jsx("button",{type:"button",className:"nice-window__action nice-window__action--minimize",onClick:Je,title:ce("window.minimize","Minimize"),children:"─"}),T&&t.jsx("button",{type:"button",className:"nice-window__action nice-window__action--maximize",onClick:_e,title:ce("window.maximize",B?"Restore":"Maximize"),children:B?"❐":"☐"}),o&&t.jsx("button",{type:"button",className:"nice-window__action nice-window__action--fullscreen",onClick:ge,title:ce("window.fullscreen",A?"Exit Full Screen":"Full Screen"),children:A?"⇲":"⇱"}),Y&&t.jsx("button",{type:"button",className:"nice-window__action nice-window__action--close",onClick:Ze,title:ce("window.close","Close"),children:"✕"})]})]}),t.jsx("div",{className:"nice-window__body",children:r}),h&&t.jsx("div",{className:"nice-window__footer",children:h}),ve&&t.jsx("div",{className:"nice-window__statusbar",children:ve}),m&&!ke&&F==="none"&&t.jsx(t.Fragment,{children:st.map(v=>t.jsx("div",{className:`nice-window__resize nice-window__resize--${v}`,style:{cursor:ct[v]},onMouseDown:X=>nt(v,X)},v))})]})});Te.displayName="NiceWindow";exports.NiceActionSheet=ot;exports.NiceBlockUI=Se;exports.NiceBox=lt;exports.NiceCommandPaletteProvider=ze;exports.NiceLoadPanel=at;exports.NicePopover=rt;exports.NiceResizable=ut;exports.NiceResponsiveBox=dt;exports.NiceScrollView=mt;exports.NiceTutorial=be;exports.NiceTutorialProvider=Ie;exports.NiceWindow=Te;exports.NiceWindowManager=Me;exports.fuzzyMatch=he;exports.highlightMatches=Ce;exports.useCommandPalette=Ee;exports.useNiceTutorial=_t;exports.useRegisterCommands=ft;
|