@nice2dev/ui 1.4.19 → 1.4.21

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.
Files changed (35) hide show
  1. package/CHANGELOG.md +57 -0
  2. package/dist/NiceGantt-Drl4gvw9.cjs +1 -0
  3. package/dist/{NiceGantt.doc-B6YZcJvG.cjs → NiceGantt.doc-DTv0r7bP.cjs} +2 -2
  4. package/dist/NiceModuleLifecyclePanel-jckyVqqt.cjs +1 -0
  5. package/dist/NiceWindow-DQyf5wat.cjs +1 -0
  6. package/dist/{core-lazy-BhQxFuLf.cjs → core-lazy-DirbU7jp.cjs} +1 -1
  7. package/dist/display/NiceDocumentApprovalFlow.mjs +67 -89
  8. package/dist/display/NiceLeaderboard.mjs +47 -40
  9. package/dist/display/NiceQuestCard.mjs +93 -76
  10. package/dist/docs/NiceGantt.doc.json.mjs +9 -9
  11. package/dist/documentation/utils.mjs +1 -1
  12. package/dist/index.cjs +94 -94
  13. package/dist/index.d.ts +58 -2
  14. package/dist/index.mjs +778 -776
  15. package/dist/navigation/NiceMenu.mjs +249 -248
  16. package/dist/navigation.cjs +1 -1
  17. package/dist/navigation.d.ts +6 -0
  18. package/dist/overlays/NiceResponsiveBox.mjs +51 -24
  19. package/dist/overlays/NiceTutorial.mjs +136 -127
  20. package/dist/overlays.cjs +1 -1
  21. package/dist/overlays.d.ts +25 -2
  22. package/dist/planning/NiceGantt.mjs +130 -121
  23. package/dist/planning/NiceStepper.mjs +36 -35
  24. package/dist/style.css +2 -2
  25. package/dist/tools/NiceDraggable.mjs +44 -29
  26. package/dist/tools/NiceSortable.mjs +66 -48
  27. package/dist/tools/NiceSpeechToText.mjs +67 -52
  28. package/dist/tools/NiceValidationBuilder.mjs +210 -119
  29. package/dist/tools/NiceViewRegistry.mjs +67 -34
  30. package/package.json +4 -4
  31. package/dist/NiceBottomSheet.doc-keq-Fzlz.cjs +0 -8
  32. package/dist/NiceGantt-BygumlaY.cjs +0 -1
  33. package/dist/NiceModuleLifecyclePanel-DAIbzfZd.cjs +0 -1
  34. package/dist/NiceWindow-BklnkBpu.cjs +0 -1
  35. package/dist/docs/NiceBottomSheet.doc.json.mjs +0 -32
@@ -1,8 +1,8 @@
1
- import { jsxs as r, jsx as a } from "react/jsx-runtime";
2
- import { useNiceTranslation as g, useControllableState as B, NiceTutorialButton as k, resolveTutorial as w, NiceIcon as V } from "@nice2dev/ui-core";
3
- import { useCallback as b } from "react";
4
- import { NiceFilterBuilder as R } from "./NiceFilterBuilder.mjs";
5
- const T = [], x = [
1
+ import { jsxs as s, jsx as n } from "react/jsx-runtime";
2
+ import { useNiceTranslation as w, useControllableState as x, NiceTutorialButton as E, resolveTutorial as G, NiceIcon as f } from "@nice2dev/ui-core";
3
+ import { useCallback as p, useMemo as I } from "react";
4
+ import { NiceFilterBuilder as M } from "./NiceFilterBuilder.mjs";
5
+ const F = [], L = [
6
6
  {
7
7
  target: ".nice-validationbuilder",
8
8
  titleKey: "tutorial.validationBuilder.intro.title",
@@ -11,7 +11,7 @@ const T = [], x = [
11
11
  content: "Add validation rules per field — required, length/number bounds, pattern, cross-field comparisons — and optionally limit each rule to apply only when a condition holds. These rules are enforced by the generated forms.",
12
12
  placement: "auto"
13
13
  }
14
- ], _ = [
14
+ ], R = [
15
15
  { value: "required", label: "Required", kind: "none" },
16
16
  { value: "minLength", label: "Min length", kind: "value" },
17
17
  { value: "maxLength", label: "Max length", kind: "value" },
@@ -28,185 +28,276 @@ const T = [], x = [
28
28
  { value: "greaterThanField", label: "Greater than field", kind: "field" },
29
29
  { value: "lessThanField", label: "Less than field", kind: "field" },
30
30
  { value: "custom", label: "Custom (code)", kind: "custom" }
31
- ], I = (l) => _.find((t) => t.value === l)?.kind ?? "value", C = () => `vr-${Date.now().toString(36)}-${Math.random().toString(36).slice(2, 7)}`, E = ({ rule: l, fields: t, onChange: n, onRemove: p }) => {
32
- const { t: i } = g(), c = I(l.op), m = t.find((e) => e.field === l.field);
33
- return /* @__PURE__ */ r("div", { className: "nice-validationbuilder__rule", children: [
34
- /* @__PURE__ */ r("div", { className: "nice-validationbuilder__rule-main", children: [
35
- /* @__PURE__ */ a(
31
+ ], q = (e) => R.find((v) => v.value === e)?.kind ?? "value", O = () => `vr-${Date.now().toString(36)}-${Math.random().toString(36).slice(2, 7)}`, k = ({ rule: e, fields: v, onChange: r, onRemove: N }) => {
32
+ const { t } = w(), b = q(e.op), g = v.find((l) => l.field === e.field);
33
+ return /* @__PURE__ */ s("div", { className: "nice-validationbuilder__rule", children: [
34
+ /* @__PURE__ */ s("div", { className: "nice-validationbuilder__rule-main", children: [
35
+ /* @__PURE__ */ n(
36
36
  "select",
37
37
  {
38
38
  className: "nice-filterbuilder__select",
39
- value: l.field,
40
- onChange: (e) => n({ ...l, field: e.target.value }),
41
- "aria-label": i("validationBuilder.field", "Field"),
42
- children: t.map((e) => /* @__PURE__ */ a("option", { value: e.field, children: e.label }, e.field))
39
+ value: e.field,
40
+ onChange: (l) => r({ ...e, field: l.target.value }),
41
+ "aria-label": t("validationBuilder.field", "Field"),
42
+ children: v.map((l) => /* @__PURE__ */ n("option", { value: l.field, children: l.label }, l.field))
43
43
  }
44
44
  ),
45
- /* @__PURE__ */ a(
45
+ /* @__PURE__ */ n(
46
46
  "select",
47
47
  {
48
48
  className: "nice-filterbuilder__select",
49
- value: l.op,
50
- onChange: (e) => n({ ...l, op: e.target.value }),
51
- "aria-label": i("validationBuilder.validation", "Validation"),
52
- children: _.map((e) => /* @__PURE__ */ a("option", { value: e.value, children: e.label }, e.value))
49
+ value: e.op,
50
+ onChange: (l) => r({ ...e, op: l.target.value }),
51
+ "aria-label": t("validationBuilder.validation", "Validation"),
52
+ children: R.map((l) => /* @__PURE__ */ n("option", { value: l.value, children: l.label }, l.value))
53
53
  }
54
54
  ),
55
- c === "value" && /* @__PURE__ */ a(
55
+ b === "value" && /* @__PURE__ */ n(
56
56
  "input",
57
57
  {
58
58
  className: "nice-filterbuilder__input",
59
- type: m?.type === "number" ? "number" : "text",
60
- value: String(l.value ?? ""),
61
- onChange: (e) => n({
62
- ...l,
63
- value: m?.type === "number" ? Number(e.target.value) : e.target.value
59
+ type: g?.type === "number" ? "number" : "text",
60
+ value: String(e.value ?? ""),
61
+ onChange: (l) => r({
62
+ ...e,
63
+ value: g?.type === "number" ? Number(l.target.value) : l.target.value
64
64
  }),
65
- placeholder: i("validationBuilder.value", "Value"),
66
- "aria-label": i("validationBuilder.value", "Value")
65
+ placeholder: t("validationBuilder.value", "Value"),
66
+ "aria-label": t("validationBuilder.value", "Value")
67
67
  }
68
68
  ),
69
- c === "field" && /* @__PURE__ */ r(
69
+ b === "field" && /* @__PURE__ */ s(
70
70
  "select",
71
71
  {
72
72
  className: "nice-filterbuilder__select",
73
- value: l.compareField ?? "",
74
- onChange: (e) => n({ ...l, compareField: e.target.value }),
75
- "aria-label": i("validationBuilder.compareField", "Compare field"),
73
+ value: e.compareField ?? "",
74
+ onChange: (l) => r({ ...e, compareField: l.target.value }),
75
+ "aria-label": t("validationBuilder.compareField", "Compare field"),
76
76
  children: [
77
- /* @__PURE__ */ a("option", { value: "", children: i("validationBuilder.field2", "-- field --") }),
78
- t.map((e) => /* @__PURE__ */ a("option", { value: e.field, children: e.label }, e.field))
77
+ /* @__PURE__ */ n("option", { value: "", children: t("validationBuilder.field2", "-- field --") }),
78
+ v.map((l) => /* @__PURE__ */ n("option", { value: l.field, children: l.label }, l.field))
79
79
  ]
80
80
  }
81
81
  ),
82
- c === "custom" && /* @__PURE__ */ a("span", { className: "nice-validationbuilder__custom-hint", children: i("validationBuilder.predicateWiredInCode", "predicate wired in code") }),
83
- /* @__PURE__ */ a(
82
+ b === "custom" && /* @__PURE__ */ n("span", { className: "nice-validationbuilder__custom-hint", children: t("validationBuilder.predicateWiredInCode", "predicate wired in code") }),
83
+ /* @__PURE__ */ n(
84
84
  "input",
85
85
  {
86
86
  className: "nice-filterbuilder__input",
87
- value: l.message ?? "",
88
- onChange: (e) => n({ ...l, message: e.target.value || void 0 }),
89
- placeholder: i("validationBuilder.messageOptional", "Message (optional)"),
90
- "aria-label": i("validationBuilder.message", "Message")
87
+ value: e.message ?? "",
88
+ onChange: (l) => r({ ...e, message: l.target.value || void 0 }),
89
+ placeholder: t("validationBuilder.messageOptional", "Message (optional)"),
90
+ "aria-label": t("validationBuilder.message", "Message")
91
91
  }
92
92
  ),
93
- /* @__PURE__ */ r(
93
+ /* @__PURE__ */ s(
94
94
  "select",
95
95
  {
96
96
  className: "nice-filterbuilder__select",
97
- value: l.severity ?? "error",
98
- onChange: (e) => n({ ...l, severity: e.target.value }),
99
- "aria-label": i("validationBuilder.severity", "Severity"),
97
+ value: e.severity ?? "error",
98
+ onChange: (l) => r({ ...e, severity: l.target.value }),
99
+ "aria-label": t("validationBuilder.severity", "Severity"),
100
100
  children: [
101
- /* @__PURE__ */ a("option", { value: "error", children: i("validationBuilder.error", "Error") }),
102
- /* @__PURE__ */ a("option", { value: "warning", children: i("validationBuilder.warning", "Warning") })
101
+ /* @__PURE__ */ n("option", { value: "error", children: t("validationBuilder.error", "Error") }),
102
+ /* @__PURE__ */ n("option", { value: "warning", children: t("validationBuilder.warning", "Warning") })
103
103
  ]
104
104
  }
105
105
  ),
106
- /* @__PURE__ */ a(
106
+ /* @__PURE__ */ n(
107
107
  "button",
108
108
  {
109
109
  type: "button",
110
110
  className: "nice-validationbuilder__when-toggle",
111
- onClick: () => n({
112
- ...l,
113
- when: l.when ? void 0 : { type: "group", logic: "and", items: [] }
111
+ onClick: () => r({
112
+ ...e,
113
+ when: e.when ? void 0 : { type: "group", logic: "and", items: [] }
114
114
  }),
115
- "aria-pressed": l.when != null,
116
- title: i("validationBuilder.applyOnlyWhen", "Apply only when…"),
117
- children: i("validationBuilder.when", "when…")
115
+ "aria-pressed": e.when != null,
116
+ title: t("validationBuilder.applyOnlyWhen", "Apply only when…"),
117
+ children: t("validationBuilder.when", "when…")
118
118
  }
119
119
  ),
120
- /* @__PURE__ */ a(
120
+ /* @__PURE__ */ n(
121
121
  "button",
122
122
  {
123
123
  type: "button",
124
124
  className: "nice-filterbuilder__remove",
125
- onClick: p,
126
- "aria-label": i("validationBuilder.removeRule", "Remove rule"),
127
- children: /* @__PURE__ */ a(V, { name: "close", size: 14 })
125
+ onClick: N,
126
+ "aria-label": t("validationBuilder.removeRule", "Remove rule"),
127
+ children: /* @__PURE__ */ n(f, { name: "close", size: 14 })
128
128
  }
129
129
  )
130
130
  ] }),
131
- l.when && /* @__PURE__ */ r("div", { className: "nice-validationbuilder__when", children: [
132
- /* @__PURE__ */ a("span", { className: "nice-validationbuilder__when-label", children: i("validationBuilder.validateOnlyWhen", "Validate only when:") }),
133
- /* @__PURE__ */ a(
134
- R,
131
+ e.when && /* @__PURE__ */ s("div", { className: "nice-validationbuilder__when", children: [
132
+ /* @__PURE__ */ n("span", { className: "nice-validationbuilder__when-label", children: t("validationBuilder.validateOnlyWhen", "Validate only when:") }),
133
+ /* @__PURE__ */ n(
134
+ M,
135
135
  {
136
- fields: t,
137
- value: l.when,
138
- onChange: (e) => n({ ...l, when: e })
136
+ fields: v,
137
+ value: e.when,
138
+ onChange: (l) => r({ ...e, when: l })
139
139
  }
140
140
  )
141
141
  ] })
142
142
  ] });
143
- }, F = ({
144
- fields: l = T,
145
- value: t,
146
- defaultValue: n,
147
- onChange: p,
148
- tutorial: i,
149
- className: c,
150
- style: m,
151
- "data-testid": e
143
+ }, A = ({
144
+ fields: e = F,
145
+ value: v,
146
+ defaultValue: r,
147
+ onChange: N,
148
+ tutorial: t,
149
+ className: b,
150
+ style: g,
151
+ "data-testid": l
152
152
  }) => {
153
- const { t: h } = g(), [d, o] = B({
154
- value: t,
155
- defaultValue: n,
153
+ const { t: c } = w(), [d, u] = x({
154
+ value: v,
155
+ defaultValue: r,
156
156
  fallbackValue: [],
157
- onChange: p,
157
+ onChange: N,
158
158
  componentName: "NiceValidationBuilder"
159
- }), N = b(() => {
160
- o([
161
- ...d,
162
- { id: C(), field: l[0]?.field ?? "", op: "required", severity: "error" }
163
- ]);
164
- }, [d, o, l]), f = b(
165
- (u, v) => {
166
- const s = [...d];
167
- s[u] = v, o(s);
159
+ }), _ = p(
160
+ (i) => {
161
+ const a = {
162
+ id: O(),
163
+ field: e[0]?.field ?? "",
164
+ op: "required",
165
+ severity: "error"
166
+ };
167
+ i && (a.group = i), u([...d, a]);
168
168
  },
169
- [d, o]
170
- ), y = b(
171
- (u) => o(d.filter((v, s) => s !== u)),
172
- [d, o]
169
+ [d, u, e]
170
+ ), m = I(() => {
171
+ const i = [];
172
+ for (const a of d)
173
+ a.group && !i.includes(a.group) && i.push(a.group);
174
+ return i;
175
+ }, [d]), V = p(() => {
176
+ const i = c("validationBuilder.groupName", "Group");
177
+ let a = m.length + 1;
178
+ for (; m.includes(`${i} ${a}`); )
179
+ a++;
180
+ _(`${i} ${a}`);
181
+ }, [m, _, c]), C = p(
182
+ (i, a) => {
183
+ const o = a.trim();
184
+ !o || o === i || m.includes(o) || u(d.map((h) => h.group === i ? { ...h, group: o } : h));
185
+ },
186
+ [d, u, m]
187
+ ), T = p(
188
+ (i) => u(d.filter((a) => a.group !== i)),
189
+ [d, u]
190
+ ), y = p(
191
+ (i, a) => {
192
+ const o = [...d];
193
+ o[i] = a, u(o);
194
+ },
195
+ [d, u]
196
+ ), B = p(
197
+ (i) => u(d.filter((a, o) => o !== i)),
198
+ [d, u]
173
199
  );
174
- return /* @__PURE__ */ r(
200
+ return /* @__PURE__ */ s(
175
201
  "div",
176
202
  {
177
- className: `nice-validationbuilder ${c || ""}`,
178
- style: { position: "relative", ...m },
179
- "data-testid": e,
203
+ className: `nice-validationbuilder ${b || ""}`,
204
+ style: { position: "relative", ...g },
205
+ "data-testid": l,
180
206
  children: [
181
- /* @__PURE__ */ a("span", { style: { position: "absolute", top: 6, right: 6, zIndex: 20 }, children: /* @__PURE__ */ a(k, { steps: w(i, x) }) }),
182
- /* @__PURE__ */ r("div", { className: "nice-validationbuilder__rules", children: [
183
- d.map((u, v) => /* @__PURE__ */ a(
184
- E,
185
- {
186
- rule: u,
187
- fields: l,
188
- onChange: (s) => f(v, s),
189
- onRemove: () => y(v)
190
- },
191
- u.id
192
- )),
193
- d.length === 0 && /* @__PURE__ */ a("div", { className: "nice-validationbuilder__empty", children: h("validationBuilder.noValidationRulesYet", "No validation rules yet.") })
207
+ /* @__PURE__ */ n("span", { style: { position: "absolute", top: 6, right: 6, zIndex: 20 }, children: /* @__PURE__ */ n(E, { steps: G(t, L) }) }),
208
+ /* @__PURE__ */ s("div", { className: "nice-validationbuilder__rules", children: [
209
+ d.map(
210
+ (i, a) => i.group ? null : /* @__PURE__ */ n(
211
+ k,
212
+ {
213
+ rule: i,
214
+ fields: e,
215
+ onChange: (o) => y(a, o),
216
+ onRemove: () => B(a)
217
+ },
218
+ i.id
219
+ )
220
+ ),
221
+ d.length === 0 && /* @__PURE__ */ n("div", { className: "nice-validationbuilder__empty", children: c("validationBuilder.noValidationRulesYet", "No validation rules yet.") })
194
222
  ] }),
195
- /* @__PURE__ */ a(
196
- "button",
197
- {
198
- type: "button",
199
- className: "nice-btn nice-btn--sm",
200
- onClick: N,
201
- disabled: l.length === 0,
202
- children: h("validationBuilder.rule", "+ Rule")
203
- }
204
- )
223
+ m.map((i) => /* @__PURE__ */ s("section", { className: "nice-validationbuilder__group", children: [
224
+ /* @__PURE__ */ s("header", { className: "nice-validationbuilder__group-head", children: [
225
+ /* @__PURE__ */ n(f, { name: "folder", size: 14 }),
226
+ /* @__PURE__ */ n(
227
+ "input",
228
+ {
229
+ className: "nice-filterbuilder__input nice-validationbuilder__group-name",
230
+ defaultValue: i,
231
+ onBlur: (a) => C(i, a.target.value),
232
+ onKeyDown: (a) => {
233
+ a.key === "Enter" && a.target.blur();
234
+ },
235
+ "aria-label": c("validationBuilder.groupNameAria", "Group name")
236
+ },
237
+ i
238
+ ),
239
+ /* @__PURE__ */ n(
240
+ "button",
241
+ {
242
+ type: "button",
243
+ className: "nice-btn nice-btn--sm",
244
+ onClick: () => _(i),
245
+ disabled: e.length === 0,
246
+ children: c("validationBuilder.rule", "+ Rule")
247
+ }
248
+ ),
249
+ /* @__PURE__ */ n(
250
+ "button",
251
+ {
252
+ type: "button",
253
+ className: "nice-filterbuilder__remove",
254
+ onClick: () => T(i),
255
+ "aria-label": c("validationBuilder.removeGroup", "Remove group and its rules"),
256
+ title: c("validationBuilder.removeGroup", "Remove group and its rules"),
257
+ children: /* @__PURE__ */ n(f, { name: "trash", size: 14 })
258
+ }
259
+ )
260
+ ] }),
261
+ /* @__PURE__ */ n("div", { className: "nice-validationbuilder__rules", children: d.map(
262
+ (a, o) => a.group === i ? /* @__PURE__ */ n(
263
+ k,
264
+ {
265
+ rule: a,
266
+ fields: e,
267
+ onChange: (h) => y(o, h),
268
+ onRemove: () => B(o)
269
+ },
270
+ a.id
271
+ ) : null
272
+ ) })
273
+ ] }, i)),
274
+ /* @__PURE__ */ s("div", { className: "nice-validationbuilder__footer", children: [
275
+ /* @__PURE__ */ n(
276
+ "button",
277
+ {
278
+ type: "button",
279
+ className: "nice-btn nice-btn--sm",
280
+ onClick: () => _(),
281
+ disabled: e.length === 0,
282
+ children: c("validationBuilder.rule", "+ Rule")
283
+ }
284
+ ),
285
+ /* @__PURE__ */ n(
286
+ "button",
287
+ {
288
+ type: "button",
289
+ className: "nice-btn nice-btn--sm",
290
+ onClick: V,
291
+ disabled: e.length === 0,
292
+ children: c("validationBuilder.group", "+ Group")
293
+ }
294
+ )
295
+ ] })
205
296
  ]
206
297
  }
207
298
  );
208
299
  };
209
- process.env.NODE_ENV !== "production" && (F.displayName = "NiceValidationBuilder");
300
+ process.env.NODE_ENV !== "production" && (A.displayName = "NiceValidationBuilder");
210
301
  export {
211
- F as NiceValidationBuilder
302
+ A as NiceValidationBuilder
212
303
  };
@@ -10,8 +10,8 @@ class s {
10
10
  }
11
11
  /** Register multiple components at once. */
12
12
  registerAll(e) {
13
- for (const r of e)
14
- this.register(r);
13
+ for (const t of e)
14
+ this.register(t);
15
15
  return this;
16
16
  }
17
17
  /** Unregister a component type. */
@@ -32,7 +32,7 @@ class s {
32
32
  }
33
33
  /** Get components by category. */
34
34
  getByCategory(e) {
35
- return this.getAll().filter((r) => r.category === e);
35
+ return this.getAll().filter((t) => t.category === e);
36
36
  }
37
37
  /** Get all category names. */
38
38
  getCategories() {
@@ -40,8 +40,8 @@ class s {
40
40
  }
41
41
  // ── Action Handlers ───────────────────────────────────
42
42
  /** Register a custom action handler. */
43
- registerAction(e, r) {
44
- return this.actionHandlers.set(e, r), this;
43
+ registerAction(e, t) {
44
+ return this.actionHandlers.set(e, t), this;
45
45
  }
46
46
  /** Get a registered action handler. */
47
47
  getAction(e) {
@@ -58,23 +58,23 @@ class s {
58
58
  // ── Validation ────────────────────────────────────────
59
59
  /** Validate that all controlTypes in a view definition are registered. */
60
60
  validateTypes(e) {
61
- const r = [];
62
- for (const a of e)
63
- this.has(a) || r.push(a);
64
- return r;
61
+ const t = [];
62
+ for (const r of e)
63
+ this.has(r) || t.push(r);
64
+ return t;
65
65
  }
66
66
  /** Clear all registrations (useful for testing). */
67
67
  clear() {
68
68
  this.components.clear(), this.actionHandlers.clear();
69
69
  }
70
70
  }
71
- const y = /* @__PURE__ */ p();
72
- function p() {
73
- const t = new s();
74
- return u(t), m(t), t;
71
+ const p = /* @__PURE__ */ u();
72
+ function u() {
73
+ const a = new s();
74
+ return m(a), y(a), a;
75
75
  }
76
- function u(t) {
77
- t.registerAll([
76
+ function m(a) {
77
+ a.registerAll([
78
78
  {
79
79
  type: "text",
80
80
  label: "Text",
@@ -90,9 +90,9 @@ function u(t) {
90
90
  label: "Heading",
91
91
  category: "content",
92
92
  component: ((e) => {
93
- const a = `h${Math.min(6, Math.max(1, Number(e.level ?? 2)))}`;
93
+ const r = `h${Math.min(6, Math.max(1, Number(e.level ?? 2)))}`;
94
94
  return i.createElement(
95
- a,
95
+ r,
96
96
  { className: "nice-view-v2__heading" },
97
97
  String(e.text ?? "")
98
98
  );
@@ -126,74 +126,107 @@ function u(t) {
126
126
  }
127
127
  ]);
128
128
  }
129
- function n(t, e, r, a) {
130
- const c = i.lazy(() => e().then((o) => ({ default: r(o) }))), l = (o) => i.createElement(i.Suspense, { fallback: null }, i.createElement(c, o));
131
- t.register({ ...a, component: l });
129
+ function n(a, e, t, r) {
130
+ const l = i.lazy(() => e().then((c) => ({ default: t(c) }))), o = (c) => i.createElement(i.Suspense, { fallback: null }, i.createElement(l, c));
131
+ a.register({ ...r, component: o });
132
132
  }
133
- function m(t) {
133
+ function y(a) {
134
134
  n(
135
- t,
135
+ a,
136
136
  () => import("../editors/inputs/NiceTextInput.mjs"),
137
137
  (e) => e.NiceTextInput,
138
138
  { type: "textInput", label: "Text Input", category: "input" }
139
139
  ), n(
140
- t,
140
+ a,
141
141
  () => import("../editors/inputs/NiceTextArea.mjs"),
142
142
  (e) => e.NiceTextArea,
143
143
  { type: "textArea", label: "Text Area", category: "input" }
144
144
  ), n(
145
- t,
145
+ a,
146
146
  () => import("../editors/inputs/NiceNumberInput.mjs"),
147
147
  (e) => e.NiceNumberInput,
148
148
  { type: "numberInput", label: "Number Input", category: "input" }
149
149
  ), n(
150
- t,
150
+ a,
151
151
  () => import("../editors/inputs/NiceCheckbox.mjs"),
152
152
  (e) => e.NiceCheckbox,
153
153
  { type: "checkbox", label: "Checkbox", category: "input" }
154
154
  ), n(
155
- t,
155
+ a,
156
156
  () => import("../editors/inputs/NiceSelect.mjs"),
157
157
  (e) => e.NiceSelect,
158
158
  { type: "select", label: "Select", category: "input" }
159
159
  ), n(
160
- t,
160
+ a,
161
161
  () => import("../editors/inputs/NiceSlider.mjs"),
162
162
  (e) => e.NiceSlider,
163
163
  { type: "slider", label: "Slider", category: "input" }
164
164
  ), n(
165
- t,
165
+ a,
166
166
  () => import("../editors/inputs/NiceRating.mjs"),
167
167
  (e) => e.NiceRating,
168
168
  { type: "rating", label: "Rating", category: "input" }
169
169
  ), n(
170
- t,
170
+ a,
171
171
  () => import("../editors/inputs/NiceRadioGroup.mjs"),
172
172
  (e) => e.NiceRadioGroup,
173
173
  { type: "radioGroup", label: "Radio Group", category: "input" }
174
174
  ), n(
175
- t,
175
+ a,
176
176
  () => import("../editors/pickers/NiceDateTimePicker.mjs"),
177
177
  (e) => e.NiceDateTimePicker,
178
178
  { type: "datePicker", label: "Date Picker", category: "input" }
179
179
  ), n(
180
- t,
180
+ a,
181
181
  () => import("../editors/pickers/NiceDateTimePicker.mjs"),
182
182
  (e) => e.NiceDateTimePicker,
183
183
  { type: "timePicker", label: "Time Picker", category: "input" }
184
184
  ), n(
185
- t,
185
+ a,
186
186
  () => import("../editors/pickers/NiceColorPicker.mjs"),
187
187
  (e) => e.NiceColorPicker,
188
188
  { type: "colorPicker", label: "Color Picker", category: "input" }
189
189
  ), n(
190
- t,
190
+ a,
191
191
  () => import("../navigation/NiceCard.mjs"),
192
192
  (e) => e.NiceCard,
193
193
  { type: "card", label: "Card", category: "layout" }
194
+ ), n(
195
+ a,
196
+ () => import("../data/NiceDataGrid.mjs"),
197
+ (e) => ((t) => i.createElement(e.NiceDataGrid, {
198
+ ...t,
199
+ data: Array.isArray(t.data) ? t.data : []
200
+ })),
201
+ { type: "dataGrid", label: "Data Grid", category: "data" }
202
+ ), n(
203
+ a,
204
+ () => import("../charts/NiceChart.mjs"),
205
+ (e) => ((t) => i.createElement(e.NiceChart, {
206
+ ...t,
207
+ series: Array.isArray(t.series) ? t.series : []
208
+ })),
209
+ { type: "chart", label: "Chart", category: "data" }
210
+ ), n(
211
+ a,
212
+ () => import("../display/NiceStatistic.mjs"),
213
+ (e) => ((t) => i.createElement(e.NiceStatistic, {
214
+ ...t,
215
+ title: String(t.title ?? t.label ?? "KPI"),
216
+ value: typeof t.value == "number" || typeof t.value == "string" ? t.value : "—"
217
+ })),
218
+ { type: "kpi", label: "KPI", category: "data" }
219
+ ), n(
220
+ a,
221
+ () => import("../display/NiceBadge.mjs"),
222
+ (e) => ((t) => i.createElement(e.NiceBadge, {
223
+ ...t,
224
+ children: t.children ?? String(t.text ?? t.label ?? "Badge")
225
+ })),
226
+ { type: "badge", label: "Badge", category: "display" }
194
227
  );
195
228
  }
196
229
  export {
197
230
  s as NiceViewRegistry,
198
- y as defaultViewRegistry
231
+ p as defaultViewRegistry
199
232
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nice2dev/ui",
3
- "version": "1.4.19",
3
+ "version": "1.4.21",
4
4
  "description": "Nice2Dev UI — Universal, themeable, i18n-ready React component library",
5
5
  "type": "module",
6
6
  "main": "dist/index.cjs",
@@ -97,12 +97,12 @@
97
97
  "react-dom": ">=17.0.0"
98
98
  },
99
99
  "dependencies": {
100
- "@nice2dev/i18n": "^1.4.19",
101
- "@nice2dev/ui-core": "^1.4.19",
100
+ "@nice2dev/i18n": "^1.4.21",
101
+ "@nice2dev/ui-core": "^1.4.21",
102
102
  "country-flag-icons": "^1.6.20"
103
103
  },
104
104
  "devDependencies": {
105
- "@nice2dev/testing": "^1.4.19",
105
+ "@nice2dev/testing": "^1.4.21",
106
106
  "@playwright/test": "^1.62.1",
107
107
  "@testing-library/dom": "^10.4.1",
108
108
  "@testing-library/jest-dom": "^7.0.1",
@@ -1,8 +0,0 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e="https://nice2dev.com/schemas/component-doc-v1.json",t="NiceBottomSheet",n="Bottom sheet with snap points and drag-to-dismiss.",o="mobile",s="1.0.0",a="stable",i=[{name:"open",type:"boolean",required:!0,description:"Open state"},{name:"onOpenChange",type:"(open: boolean) => void",required:!0,description:"Open change callback"},{name:"children",type:"React.ReactNode",required:!0,description:"Sheet content"},{name:"snapPoints",type:"number[]",default:"[0.5, 1]",description:"Snap points (0-1)"},{name:"initialSnap",type:"number",default:"0",description:"Default snap point index"},{name:"onSnap",type:"(index: number) => void",description:"Snap callback"},{name:"showHandle",type:"boolean",default:"true",description:"Show drag handle"}],c=[{title:"Bottom Sheet",description:"Draggable sheet",code:`<NiceBottomSheet
2
- open={sheetOpen}
3
- onOpenChange={setSheetOpen}
4
- snapPoints={[0.3, 0.7, 1]}
5
- showHandle
6
- >
7
- <DetailPanel />
8
- </NiceBottomSheet>`}],p={keyboard:["Tab within sheet","Escape to close"],aria:["Dialog role","Drag handle description"]},r=["NiceActionSheet","NiceDrawer"],d={$schema:e,name:t,description:n,category:o,since:s,status:a,props:i,examples:c,accessibility:p,seeAlso:r};exports.$schema=e;exports.accessibility=p;exports.category=o;exports.default=d;exports.description=n;exports.examples=c;exports.name=t;exports.props=i;exports.seeAlso=r;exports.since=s;exports.status=a;