@nice2dev/ui 1.4.26 → 1.4.27

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.
@@ -1,9 +1,9 @@
1
- import { jsxs as x, jsx as i, Fragment as he } from "react/jsx-runtime";
2
- import { useNiceAccessMode as fe, useNiceTranslation as ge, useControlId as ve, useComponentDisplayClass as be, useOverlayFocus as _e, useRovingFocus as ke, NiceKeyboardHint as ye } from "@nice2dev/ui-core";
3
- import { forwardRef as Ne, useCallback as xe, useState as B, useRef as V, useLayoutEffect as Me, useEffect as we, useMemo as $e } from "react";
4
- import Pe from "react-dom";
5
- import { scopeThemeClass as Ce } from "../../utility/scopeThemeClass.mjs";
6
- const Re = [
1
+ import { jsxs as x, jsx as o, Fragment as fe } from "react/jsx-runtime";
2
+ import { useNiceAccessMode as ge, useNiceTranslation as ve, useControlId as be, useComponentDisplayClass as _e, NiceThemeContext as ke, useOverlayFocus as ye, useRovingFocus as Ne, NiceKeyboardHint as xe } from "@nice2dev/ui-core";
3
+ import { forwardRef as Me, useCallback as we, useState as B, useContext as Pe, useRef as V, useLayoutEffect as $e, useEffect as Ce, useMemo as Re } from "react";
4
+ import Ee from "react-dom";
5
+ import { scopeThemeClass as Se } from "../../utility/scopeThemeClass.mjs";
6
+ const He = [
7
7
  "#ef4444",
8
8
  "#f97316",
9
9
  "#f59e0b",
@@ -17,107 +17,107 @@ const Re = [
17
17
  "#64748b",
18
18
  "#1e293b"
19
19
  ];
20
- function Ee() {
20
+ function Le() {
21
21
  return "#" + Math.floor(Math.random() * 16777215).toString(16).padStart(6, "0");
22
22
  }
23
- function je(c) {
23
+ function qe(c) {
24
24
  const u = /^#?([0-9a-f]{6})$/i.exec(c.trim());
25
25
  if (!u)
26
26
  return { r: 0, g: 0, b: 0 };
27
27
  const h = parseInt(u[1], 16);
28
28
  return { r: h >> 16 & 255, g: h >> 8 & 255, b: h & 255 };
29
29
  }
30
- function ze(c, u, h) {
30
+ function Ge(c, u, h) {
31
31
  const p = (r) => Math.max(0, Math.min(255, Math.round(r))).toString(16).padStart(2, "0");
32
32
  return `#${p(c)}${p(u)}${p(h)}`;
33
33
  }
34
- function Se(c, u, h) {
35
- const p = c / 255, r = u / 255, t = h / 255, n = Math.max(p, r, t), b = Math.min(p, r, t), m = (n + b) / 2;
36
- let o = 0, s = 0;
37
- if (n !== b) {
38
- const k = n - b;
39
- switch (s = m > 0.5 ? k / (2 - n - b) : k / (n + b), n) {
34
+ function Te(c, u, h) {
35
+ const p = c / 255, r = u / 255, n = h / 255, t = Math.max(p, r, n), b = Math.min(p, r, n), m = (t + b) / 2;
36
+ let i = 0, s = 0;
37
+ if (t !== b) {
38
+ const k = t - b;
39
+ switch (s = m > 0.5 ? k / (2 - t - b) : k / (t + b), t) {
40
40
  case p:
41
- o = (r - t) / k + (r < t ? 6 : 0);
41
+ i = (r - n) / k + (r < n ? 6 : 0);
42
42
  break;
43
43
  case r:
44
- o = (t - p) / k + 2;
44
+ i = (n - p) / k + 2;
45
45
  break;
46
- case t:
47
- o = (p - r) / k + 4;
46
+ case n:
47
+ i = (p - r) / k + 4;
48
48
  break;
49
49
  }
50
- o *= 60;
50
+ i *= 60;
51
51
  }
52
- return { h: Math.round(o), s: Math.round(s * 100), l: Math.round(m * 100) };
52
+ return { h: Math.round(i), s: Math.round(s * 100), l: Math.round(m * 100) };
53
53
  }
54
- function He(c, u, h) {
55
- const p = u / 100, r = h / 100, t = (1 - Math.abs(2 * r - 1)) * p, n = t * (1 - Math.abs(c / 60 % 2 - 1)), b = r - t / 2;
56
- let m = 0, o = 0, s = 0;
57
- return c < 60 ? [m, o, s] = [t, n, 0] : c < 120 ? [m, o, s] = [n, t, 0] : c < 180 ? [m, o, s] = [0, t, n] : c < 240 ? [m, o, s] = [0, n, t] : c < 300 ? [m, o, s] = [n, 0, t] : [m, o, s] = [t, 0, n], {
54
+ function De(c, u, h) {
55
+ const p = u / 100, r = h / 100, n = (1 - Math.abs(2 * r - 1)) * p, t = n * (1 - Math.abs(c / 60 % 2 - 1)), b = r - n / 2;
56
+ let m = 0, i = 0, s = 0;
57
+ return c < 60 ? [m, i, s] = [n, t, 0] : c < 120 ? [m, i, s] = [t, n, 0] : c < 180 ? [m, i, s] = [0, n, t] : c < 240 ? [m, i, s] = [0, t, n] : c < 300 ? [m, i, s] = [t, 0, n] : [m, i, s] = [n, 0, t], {
58
58
  r: Math.round((m + b) * 255),
59
- g: Math.round((o + b) * 255),
59
+ g: Math.round((i + b) * 255),
60
60
  b: Math.round((s + b) * 255)
61
61
  };
62
62
  }
63
- function Le(c, u, h) {
64
- const p = c / 255, r = u / 255, t = h / 255, n = Math.max(p, r, t), b = Math.min(p, r, t), m = n - b;
65
- let o = 0;
66
- m !== 0 && (n === p ? o = (r - t) / m % 6 : n === r ? o = (t - p) / m + 2 : o = (p - r) / m + 4, o *= 60, o < 0 && (o += 360));
67
- const s = n === 0 ? 0 : m / n;
68
- return { h: Math.round(o), s: Math.round(s * 100), v: Math.round(n * 100) };
63
+ function Fe(c, u, h) {
64
+ const p = c / 255, r = u / 255, n = h / 255, t = Math.max(p, r, n), b = Math.min(p, r, n), m = t - b;
65
+ let i = 0;
66
+ m !== 0 && (t === p ? i = (r - n) / m % 6 : t === r ? i = (n - p) / m + 2 : i = (p - r) / m + 4, i *= 60, i < 0 && (i += 360));
67
+ const s = t === 0 ? 0 : m / t;
68
+ return { h: Math.round(i), s: Math.round(s * 100), v: Math.round(t * 100) };
69
69
  }
70
- function De(c, u, h) {
71
- const p = u / 100, r = h / 100, t = r * p, n = t * (1 - Math.abs(c / 60 % 2 - 1)), b = r - t;
72
- let m = 0, o = 0, s = 0;
73
- return c < 60 ? [m, o, s] = [t, n, 0] : c < 120 ? [m, o, s] = [n, t, 0] : c < 180 ? [m, o, s] = [0, t, n] : c < 240 ? [m, o, s] = [0, n, t] : c < 300 ? [m, o, s] = [n, 0, t] : [m, o, s] = [t, 0, n], {
70
+ function Ie(c, u, h) {
71
+ const p = u / 100, r = h / 100, n = r * p, t = n * (1 - Math.abs(c / 60 % 2 - 1)), b = r - n;
72
+ let m = 0, i = 0, s = 0;
73
+ return c < 60 ? [m, i, s] = [n, t, 0] : c < 120 ? [m, i, s] = [t, n, 0] : c < 180 ? [m, i, s] = [0, n, t] : c < 240 ? [m, i, s] = [0, t, n] : c < 300 ? [m, i, s] = [t, 0, n] : [m, i, s] = [n, 0, t], {
74
74
  r: Math.round((m + b) * 255),
75
- g: Math.round((o + b) * 255),
75
+ g: Math.round((i + b) * 255),
76
76
  b: Math.round((s + b) * 255)
77
77
  };
78
78
  }
79
- function Te(c) {
79
+ function Ae(c) {
80
80
  let u = c.trim();
81
81
  const h = /var\([^,]+,\s*(#[0-9a-fA-F]{3,8})\s*\)/.exec(u);
82
82
  h && (u = h[1]);
83
83
  const p = /^#?([0-9a-f]{3})$/i.exec(u);
84
- p && (u = `#${p[1].split("").map((n) => n + n).join("")}`);
85
- const r = /^#?([0-9a-f]{6})$/i.exec(u), t = /^#?([0-9a-f]{8})$/i.exec(u);
86
- if (t) {
87
- const n = t[1];
84
+ p && (u = `#${p[1].split("").map((t) => t + t).join("")}`);
85
+ const r = /^#?([0-9a-f]{6})$/i.exec(u), n = /^#?([0-9a-f]{8})$/i.exec(u);
86
+ if (n) {
87
+ const t = n[1];
88
88
  return {
89
- r: parseInt(n.slice(0, 2), 16),
90
- g: parseInt(n.slice(2, 4), 16),
91
- b: parseInt(n.slice(4, 6), 16),
92
- a: parseInt(n.slice(6, 8), 16) / 255
89
+ r: parseInt(t.slice(0, 2), 16),
90
+ g: parseInt(t.slice(2, 4), 16),
91
+ b: parseInt(t.slice(4, 6), 16),
92
+ a: parseInt(t.slice(6, 8), 16) / 255
93
93
  };
94
94
  }
95
95
  if (r) {
96
- const n = parseInt(r[1], 16);
97
- return { r: n >> 16 & 255, g: n >> 8 & 255, b: n & 255, a: 1 };
96
+ const t = parseInt(r[1], 16);
97
+ return { r: t >> 16 & 255, g: t >> 8 & 255, b: t & 255, a: 1 };
98
98
  }
99
99
  return { r: 0, g: 0, b: 0, a: 1 };
100
100
  }
101
- function Fe(c, u, h, p, r) {
102
- const t = (b) => Math.max(0, Math.min(255, Math.round(b))).toString(16).padStart(2, "0"), n = `#${t(c)}${t(u)}${t(h)}`;
103
- return r ? `${n}${t(p * 255)}` : n;
101
+ function Oe(c, u, h, p, r) {
102
+ const n = (b) => Math.max(0, Math.min(255, Math.round(b))).toString(16).padStart(2, "0"), t = `#${n(c)}${n(u)}${n(h)}`;
103
+ return r ? `${t}${n(p * 255)}` : t;
104
104
  }
105
- const Be = /* @__PURE__ */ Object.assign(
106
- /* @__PURE__ */ Ne(
105
+ const Xe = /* @__PURE__ */ Object.assign(
106
+ /* @__PURE__ */ Me(
107
107
  ({
108
108
  label: c,
109
109
  helperText: u,
110
110
  error: h,
111
111
  required: p,
112
112
  disabled: r,
113
- id: t,
114
- className: n,
113
+ id: n,
114
+ className: t,
115
115
  style: b,
116
116
  accessMode: m,
117
- displayStyle: o,
117
+ displayStyle: i,
118
118
  value: s = "#3b82f6",
119
119
  onChange: k,
120
- presets: q = Re,
120
+ presets: q = He,
121
121
  showInput: Y = !1,
122
122
  showRandom: J = !1,
123
123
  withAlpha: E = !1,
@@ -126,33 +126,33 @@ const Be = /* @__PURE__ */ Object.assign(
126
126
  size: Z = "md",
127
127
  labelPlacement: W,
128
128
  errorPlacement: L,
129
- labelWidth: D,
130
- controlWidth: T,
129
+ labelWidth: T,
130
+ controlWidth: D,
131
131
  loading: A
132
132
  }, F) => {
133
- const O = fe(m, t), ee = O === "hidden";
133
+ const O = ge(m, n), ee = O === "hidden";
134
134
  (O === "disabled" || O === "readOnly") && (r = !0);
135
- const { t: v } = ge(), P = ve(t);
136
- be("input", o);
137
- const re = xe(() => {
138
- r || k?.(Ee());
139
- }, [r, k]), [w, C] = B(!1), [K, ne] = B(null), [U, te] = B(""), j = V(null), S = V(null);
140
- Me(() => {
135
+ const { t: v } = ve(), $ = be(n);
136
+ _e("input", i);
137
+ const re = we(() => {
138
+ r || k?.(Le());
139
+ }, [r, k]), [w, C] = B(!1), [K, te] = B(null), [U, ne] = B(""), oe = Pe(ke)?.portalTarget ?? (typeof document < "u" ? document.body : null), j = V(null), S = V(null);
140
+ $e(() => {
141
141
  if (!w || !S.current)
142
142
  return;
143
- te(Ce(S.current));
143
+ ne(Se(S.current));
144
144
  const d = () => {
145
145
  const l = S.current?.getBoundingClientRect();
146
146
  if (!l)
147
147
  return;
148
- const N = 280, $ = 360;
148
+ const N = 280, P = 360;
149
149
  let _ = l.left, M = l.bottom + 6;
150
- _ + N > window.innerWidth - 8 && (_ = Math.max(8, window.innerWidth - N - 8)), M + $ > window.innerHeight - 8 && (M = Math.max(8, l.top - $ - 6)), ne({ left: _, top: M });
150
+ _ + N > window.innerWidth - 8 && (_ = Math.max(8, window.innerWidth - N - 8)), M + P > window.innerHeight - 8 && (M = Math.max(8, l.top - P - 6)), te({ left: _, top: M });
151
151
  };
152
152
  return d(), window.addEventListener("scroll", d, !0), window.addEventListener("resize", d), () => {
153
153
  window.removeEventListener("scroll", d, !0), window.removeEventListener("resize", d);
154
154
  };
155
- }, [w]), we(() => {
155
+ }, [w]), Ce(() => {
156
156
  if (!w)
157
157
  return;
158
158
  const d = (l) => {
@@ -162,18 +162,18 @@ const Be = /* @__PURE__ */ Object.assign(
162
162
  return document.addEventListener("mousedown", d), () => {
163
163
  document.removeEventListener("mousedown", d);
164
164
  };
165
- }, [w]), _e(j, {
165
+ }, [w]), ye(j, {
166
166
  open: w,
167
167
  modal: !1,
168
168
  onClose: () => C(!1)
169
169
  });
170
170
  const G = V(null);
171
- ke(G, {
171
+ Ne(G, {
172
172
  orientation: "grid",
173
173
  itemSelector: ".nice-color-picker__preset",
174
174
  wrap: !0
175
175
  });
176
- const ie = $e(
176
+ const ie = Re(
177
177
  () => [
178
178
  { key: "Enter", description: v("shortcuts.openPicker", "Open color picker") },
179
179
  { key: "Arrow keys", description: v("shortcuts.navigatePresets", "Navigate presets") }
@@ -183,14 +183,14 @@ const Be = /* @__PURE__ */ Object.assign(
183
183
  return ee ? null : /* @__PURE__ */ x(
184
184
  "div",
185
185
  {
186
- className: `nice-field nice-field--${Z} ${W === "left" ? "nice-field--label-left" : ""} ${I ? "nice-color-picker--compact" : ""} ${A ? "nice-field--loading" : ""} ${n || ""}`,
186
+ className: `nice-field nice-field--${Z} ${W === "left" ? "nice-field--label-left" : ""} ${I ? "nice-color-picker--compact" : ""} ${A ? "nice-field--loading" : ""} ${t || ""}`,
187
187
  style: {
188
188
  ...b,
189
- ...D != null && {
190
- "--nice-field-label-width": typeof D == "number" ? `${D}px` : D
191
- },
192
189
  ...T != null && {
193
- "--nice-field-control-width": typeof T == "number" ? `${T}px` : T
190
+ "--nice-field-label-width": typeof T == "number" ? `${T}px` : T
191
+ },
192
+ ...D != null && {
193
+ "--nice-field-control-width": typeof D == "number" ? `${D}px` : D
194
194
  }
195
195
  },
196
196
  "aria-busy": A || void 0,
@@ -198,22 +198,22 @@ const Be = /* @__PURE__ */ Object.assign(
198
198
  c && /* @__PURE__ */ x(
199
199
  "label",
200
200
  {
201
- htmlFor: P,
201
+ htmlFor: $,
202
202
  className: `nice-field__label ${p ? "nice-field__label--required" : ""}`,
203
203
  children: [
204
204
  c,
205
- Q && /* @__PURE__ */ i(ye, { shortcuts: ie, size: "sm" })
205
+ Q && /* @__PURE__ */ o(xe, { shortcuts: ie, size: "sm" })
206
206
  ]
207
207
  }
208
208
  ),
209
- /* @__PURE__ */ i("div", { className: "nice-field__control", children: /* @__PURE__ */ x("div", { className: "nice-color-picker", children: [
209
+ /* @__PURE__ */ o("div", { className: "nice-field__control", children: /* @__PURE__ */ x("div", { className: "nice-color-picker", children: [
210
210
  /* @__PURE__ */ x("div", { className: "nice-color-picker__preview-row", children: [
211
- /* @__PURE__ */ i(
211
+ /* @__PURE__ */ o(
212
212
  "div",
213
213
  {
214
214
  ref: S,
215
215
  className: "nice-color-picker__swatch",
216
- id: P,
216
+ id: $,
217
217
  style: { background: s },
218
218
  onClick: (d) => {
219
219
  d.stopPropagation(), r || C((l) => !l);
@@ -227,7 +227,7 @@ const Be = /* @__PURE__ */ Object.assign(
227
227
  "aria-label": v("colorPicker.openPalette", "Open color palette"),
228
228
  "aria-haspopup": "dialog",
229
229
  "aria-expanded": w,
230
- children: /* @__PURE__ */ i(
230
+ children: /* @__PURE__ */ o(
231
231
  "input",
232
232
  {
233
233
  ref: (d) => {
@@ -241,12 +241,12 @@ const Be = /* @__PURE__ */ Object.assign(
241
241
  )
242
242
  }
243
243
  ),
244
- Y && /* @__PURE__ */ i(
244
+ Y && /* @__PURE__ */ o(
245
245
  "div",
246
246
  {
247
247
  className: "nice-input nice-input--sm",
248
248
  style: I ? { flex: 1, minWidth: 0 } : { width: 100 },
249
- children: /* @__PURE__ */ i(
249
+ children: /* @__PURE__ */ o(
250
250
  "input",
251
251
  {
252
252
  className: "nice-input__native",
@@ -260,7 +260,7 @@ const Be = /* @__PURE__ */ Object.assign(
260
260
  )
261
261
  }
262
262
  ),
263
- J && !I && /* @__PURE__ */ i(
263
+ J && !I && /* @__PURE__ */ o(
264
264
  "button",
265
265
  {
266
266
  type: "button",
@@ -277,15 +277,15 @@ const Be = /* @__PURE__ */ Object.assign(
277
277
  children: v("colorPicker.random", "Random")
278
278
  }
279
279
  ),
280
- A && /* @__PURE__ */ i("span", { className: "nice-field__spinner", children: /* @__PURE__ */ i("span", { className: "nice-spinner nice-spinner--sm" }) }),
281
- L === "right" && h && /* @__PURE__ */ i("div", { id: `${P}-error`, className: "nice-field__error", role: "alert", children: h }),
282
- L === "right" && !h && u && /* @__PURE__ */ i("div", { id: `${P}-helper`, className: "nice-field__helper", children: u })
280
+ A && /* @__PURE__ */ o("span", { className: "nice-field__spinner", children: /* @__PURE__ */ o("span", { className: "nice-spinner nice-spinner--sm" }) }),
281
+ L === "right" && h && /* @__PURE__ */ o("div", { id: `${$}-error`, className: "nice-field__error", role: "alert", children: h }),
282
+ L === "right" && !h && u && /* @__PURE__ */ o("div", { id: `${$}-helper`, className: "nice-field__helper", children: u })
283
283
  ] }),
284
- w && K && typeof document < "u" && Pe.createPortal(
284
+ w && K && typeof document < "u" && Ee.createPortal(
285
285
  // stopPropagation keeps a click inside the palette from reaching the closer
286
286
  // listening outside it; it is no interaction of its own
287
287
  // eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-noninteractive-element-interactions -- no interaction of its own: it keeps a click inside the palette from the closer outside it
288
- /* @__PURE__ */ i(
288
+ /* @__PURE__ */ o(
289
289
  "div",
290
290
  {
291
291
  ref: j,
@@ -296,25 +296,25 @@ const Be = /* @__PURE__ */ Object.assign(
296
296
  style: { position: "fixed", left: K.left, top: K.top },
297
297
  onClick: (d) => d.stopPropagation(),
298
298
  children: (() => {
299
- const d = Te(s), l = { r: d.r, g: d.g, b: d.b }, N = E ? d.a : 1, $ = Se(l.r, l.g, l.b), _ = Le(l.r, l.g, l.b), M = (e, f, g, a = N) => k?.(Fe(e, f, g, a, E)), oe = (e, f, g) => M(e, f, g), ae = (e, f, g) => {
300
- const a = He(e, f, g);
299
+ const d = Ae(s), l = { r: d.r, g: d.g, b: d.b }, N = E ? d.a : 1, P = Te(l.r, l.g, l.b), _ = Fe(l.r, l.g, l.b), M = (e, f, g, a = N) => k?.(Oe(e, f, g, a, E)), ae = (e, f, g) => M(e, f, g), ce = (e, f, g) => {
300
+ const a = De(e, f, g);
301
301
  M(a.r, a.g, a.b);
302
302
  }, z = (e, f, g) => {
303
- const a = De(e, f, g);
303
+ const a = Ie(e, f, g);
304
304
  M(a.r, a.g, a.b);
305
- }, X = (e) => M(l.r, l.g, l.b, e), ce = (e) => {
305
+ }, X = (e) => M(l.r, l.g, l.b, e), se = (e) => {
306
306
  if (r)
307
307
  return;
308
308
  const f = e.currentTarget, g = (y) => {
309
- const R = f.getBoundingClientRect(), ue = Math.max(0, Math.min(R.width, y.clientX - R.left)), pe = Math.max(0, Math.min(R.height, y.clientY - R.top)), me = Math.round(ue / R.width * 100), de = 100 - Math.round(pe / R.height * 100);
310
- z(_.h, me, de);
309
+ const R = f.getBoundingClientRect(), pe = Math.max(0, Math.min(R.width, y.clientX - R.left)), me = Math.max(0, Math.min(R.height, y.clientY - R.top)), de = Math.round(pe / R.width * 100), he = 100 - Math.round(me / R.height * 100);
310
+ z(_.h, de, he);
311
311
  };
312
312
  g(e);
313
313
  const a = () => {
314
314
  document.removeEventListener("pointermove", g), document.removeEventListener("pointerup", a);
315
315
  };
316
316
  document.addEventListener("pointermove", g), document.addEventListener("pointerup", a);
317
- }, se = `hsl(${_.h}, 100%, 50%)`, le = (e) => {
317
+ }, le = `hsl(${_.h}, 100%, 50%)`, ue = (e) => {
318
318
  if (r)
319
319
  return;
320
320
  const f = e.shiftKey ? 10 : 1;
@@ -346,8 +346,8 @@ const Be = /* @__PURE__ */ Object.assign(
346
346
  g: v("colorPicker.green", "Green"),
347
347
  b: v("colorPicker.blue", "Blue")
348
348
  };
349
- return /* @__PURE__ */ x(he, { children: [
350
- /* @__PURE__ */ i("div", { className: "nice-color-picker__popup-header", children: /* @__PURE__ */ i(
349
+ return /* @__PURE__ */ x(fe, { children: [
350
+ /* @__PURE__ */ o("div", { className: "nice-color-picker__popup-header", children: /* @__PURE__ */ o(
351
351
  "input",
352
352
  {
353
353
  type: "text",
@@ -359,7 +359,7 @@ const Be = /* @__PURE__ */ Object.assign(
359
359
  "aria-label": v("colorPicker.hexValue", "Hex value")
360
360
  }
361
361
  ) }),
362
- /* @__PURE__ */ i(
362
+ /* @__PURE__ */ o(
363
363
  "input",
364
364
  {
365
365
  type: "range",
@@ -372,17 +372,17 @@ const Be = /* @__PURE__ */ Object.assign(
372
372
  "aria-label": v("colorPicker.hue", "Hue")
373
373
  }
374
374
  ),
375
- /* @__PURE__ */ i(
375
+ /* @__PURE__ */ o(
376
376
  "div",
377
377
  {
378
378
  className: "nice-color-picker__sv",
379
379
  style: {
380
380
  /* audit-allow: token-role — black letterbox / canvas fill. A video frame or a
381
381
  drawing surface is not a themed surface, so it stays black in both themes. */
382
- background: `linear-gradient(to top, var(--nice-text, #000), transparent), linear-gradient(to right, var(--nice-bg, #FFF), ${se})`
382
+ background: `linear-gradient(to top, var(--nice-text, #000), transparent), linear-gradient(to right, var(--nice-bg, #FFF), ${le})`
383
383
  },
384
- onPointerDown: ce,
385
- onKeyDown: le,
384
+ onPointerDown: se,
385
+ onKeyDown: ue,
386
386
  role: "slider",
387
387
  tabIndex: r ? -1 : 0,
388
388
  "aria-label": v("colorPicker.svPalette", "Saturation/value palette"),
@@ -390,7 +390,7 @@ const Be = /* @__PURE__ */ Object.assign(
390
390
  "aria-valuemax": 100,
391
391
  "aria-valuenow": _.s,
392
392
  "aria-valuetext": `${H.s} ${_.s}%, ${v("colorPicker.brightness", "Brightness")} ${_.v}%`,
393
- children: /* @__PURE__ */ i(
393
+ children: /* @__PURE__ */ o(
394
394
  "span",
395
395
  {
396
396
  className: "nice-color-picker__sv-marker",
@@ -400,15 +400,15 @@ const Be = /* @__PURE__ */ Object.assign(
400
400
  }
401
401
  ),
402
402
  /* @__PURE__ */ x("div", { className: "nice-color-picker__sliders", children: [
403
- /* @__PURE__ */ i("div", { className: "nice-color-picker__slider-col", children: ["h", "s", "l"].map((e) => {
404
- const f = e === "h" ? 360 : 100, g = $[e], a = (y) => ae(
405
- e === "h" ? y : $.h,
406
- e === "s" ? y : $.s,
407
- e === "l" ? y : $.l
403
+ /* @__PURE__ */ o("div", { className: "nice-color-picker__slider-col", children: ["h", "s", "l"].map((e) => {
404
+ const f = e === "h" ? 360 : 100, g = P[e], a = (y) => ce(
405
+ e === "h" ? y : P.h,
406
+ e === "s" ? y : P.s,
407
+ e === "l" ? y : P.l
408
408
  );
409
409
  return /* @__PURE__ */ x("div", { className: "nice-color-picker__slider-row", children: [
410
- /* @__PURE__ */ i("label", { className: "nice-color-picker__slider-label", children: e.toUpperCase() }),
411
- /* @__PURE__ */ i(
410
+ /* @__PURE__ */ o("label", { className: "nice-color-picker__slider-label", children: e.toUpperCase() }),
411
+ /* @__PURE__ */ o(
412
412
  "input",
413
413
  {
414
414
  type: "range",
@@ -420,7 +420,7 @@ const Be = /* @__PURE__ */ Object.assign(
420
420
  "aria-label": H[e]
421
421
  }
422
422
  ),
423
- /* @__PURE__ */ i(
423
+ /* @__PURE__ */ o(
424
424
  "input",
425
425
  {
426
426
  type: "number",
@@ -435,15 +435,15 @@ const Be = /* @__PURE__ */ Object.assign(
435
435
  )
436
436
  ] }, e);
437
437
  }) }),
438
- /* @__PURE__ */ i("div", { className: "nice-color-picker__slider-col", children: ["r", "g", "b"].map((e) => {
439
- const f = l[e], g = (a) => oe(
438
+ /* @__PURE__ */ o("div", { className: "nice-color-picker__slider-col", children: ["r", "g", "b"].map((e) => {
439
+ const f = l[e], g = (a) => ae(
440
440
  e === "r" ? a : l.r,
441
441
  e === "g" ? a : l.g,
442
442
  e === "b" ? a : l.b
443
443
  );
444
444
  return /* @__PURE__ */ x("div", { className: "nice-color-picker__slider-row", children: [
445
- /* @__PURE__ */ i("label", { className: "nice-color-picker__slider-label", children: e.toUpperCase() }),
446
- /* @__PURE__ */ i(
445
+ /* @__PURE__ */ o("label", { className: "nice-color-picker__slider-label", children: e.toUpperCase() }),
446
+ /* @__PURE__ */ o(
447
447
  "input",
448
448
  {
449
449
  type: "range",
@@ -455,7 +455,7 @@ const Be = /* @__PURE__ */ Object.assign(
455
455
  "aria-label": H[e]
456
456
  }
457
457
  ),
458
- /* @__PURE__ */ i(
458
+ /* @__PURE__ */ o(
459
459
  "input",
460
460
  {
461
461
  type: "number",
@@ -472,8 +472,8 @@ const Be = /* @__PURE__ */ Object.assign(
472
472
  }) })
473
473
  ] }),
474
474
  E && /* @__PURE__ */ x("div", { className: "nice-color-picker__alpha-row", children: [
475
- /* @__PURE__ */ i("label", { className: "nice-color-picker__slider-label", children: "A" }),
476
- /* @__PURE__ */ i(
475
+ /* @__PURE__ */ o("label", { className: "nice-color-picker__slider-label", children: "A" }),
476
+ /* @__PURE__ */ o(
477
477
  "input",
478
478
  {
479
479
  type: "range",
@@ -489,7 +489,7 @@ const Be = /* @__PURE__ */ Object.assign(
489
489
  "aria-label": v("colorPicker.alpha", "Alpha")
490
490
  }
491
491
  ),
492
- /* @__PURE__ */ i(
492
+ /* @__PURE__ */ o(
493
493
  "input",
494
494
  {
495
495
  type: "number",
@@ -503,14 +503,14 @@ const Be = /* @__PURE__ */ Object.assign(
503
503
  }
504
504
  )
505
505
  ] }),
506
- q.length > 0 && /* @__PURE__ */ i(
506
+ q.length > 0 && /* @__PURE__ */ o(
507
507
  "div",
508
508
  {
509
509
  ref: G,
510
510
  className: "nice-color-picker__popup-presets",
511
511
  role: "group",
512
512
  "aria-label": v("colorPicker.presets", "Preset colors"),
513
- children: q.map((e) => /* @__PURE__ */ i(
513
+ children: q.map((e) => /* @__PURE__ */ o(
514
514
  "div",
515
515
  {
516
516
  className: `nice-color-picker__preset ${s === e ? "nice-color-picker__preset--active" : ""}`,
@@ -533,11 +533,11 @@ const Be = /* @__PURE__ */ Object.assign(
533
533
  })()
534
534
  }
535
535
  ),
536
- document.body
536
+ oe ?? document.body
537
537
  )
538
538
  ] }) }),
539
- L !== "right" && h && /* @__PURE__ */ i("div", { id: `${P}-error`, className: "nice-field__error", role: "alert", children: h }),
540
- L !== "right" && !h && u && /* @__PURE__ */ i("div", { id: `${P}-helper`, className: "nice-field__helper", children: u })
539
+ L !== "right" && h && /* @__PURE__ */ o("div", { id: `${$}-error`, className: "nice-field__error", role: "alert", children: h }),
540
+ L !== "right" && !h && u && /* @__PURE__ */ o("div", { id: `${$}-helper`, className: "nice-field__helper", children: u })
541
541
  ]
542
542
  }
543
543
  );
@@ -546,7 +546,7 @@ const Be = /* @__PURE__ */ Object.assign(
546
546
  { displayName: "NiceColorPicker" }
547
547
  );
548
548
  export {
549
- Be as NiceColorPicker,
550
- je as hexToRgb,
551
- ze as rgbToHex
549
+ Xe as NiceColorPicker,
550
+ qe as hexToRgb,
551
+ Ge as rgbToHex
552
552
  };
package/dist/editors.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("./no-code-DPc82kyy.cjs"),i=require("./NiceForm-DM2tARZT.cjs"),e=require("./NiceMention-D330ovOt.cjs"),o=require("./pickerCommons-CQnae2FM.cjs"),N=require("./NiceColorPicker-79rkvaSk.cjs"),t=require("./NiceHtmlEditor-BEWNA_UI.cjs"),r=require("./NiceCodeEditor-CBgbzwjx.cjs");exports.NiceCheckbox=c.NiceCheckbox;exports.NiceNumberInput=c.NiceNumberInput;exports.NiceSelect=c.NiceSelect;exports.NiceTextInput=c.NiceTextInput;exports.MASK_PRESETS=i.MASK_PRESETS;exports.NiceAutocomplete=i.NiceAutocomplete;exports.NiceCalendar=i.NiceCalendar;exports.NiceCountryPicker=i.NiceCountryPicker;exports.NiceDateTimePicker=i.NiceDateTimePicker;exports.NiceForm=i.NiceForm;exports.NiceMaskedInput=i.NiceMaskedInput;exports.NicePasswordInput=i.NicePasswordInput;exports.NiceRadioGroup=i.NiceRadioGroup;exports.NiceRating=i.NiceRating;exports.NiceSlider=i.NiceSlider;exports.NiceTagBox=i.NiceTagBox;exports.NiceTextArea=i.NiceTextArea;exports.NiceUpload=i.NiceUpload;exports.NICE_COLOR_PRESET_KEYS=e.NICE_COLOR_PRESET_KEYS;exports.NiceAccountPicker=e.NiceAccountPicker;exports.NiceAddressInput=e.NiceAddressInput;exports.NiceCodeEditorAI=e.NiceCodeEditorAI;exports.NiceColorPalette=e.NiceColorPalette;exports.NiceContactPicker=e.NiceContactPicker;exports.NiceCropEditor=e.NiceCropEditor;exports.NiceDateRangeBox=e.NiceDateRangeBox;exports.NiceDocumentEditor=e.NiceDocumentEditor;exports.NiceDropDownBox=e.NiceDropDownBox;exports.NiceEmojiPicker=e.NiceEmojiPicker;exports.NiceGradientPicker=e.NiceGradientPicker;exports.NiceHtmlEditorAI=e.NiceHtmlEditorAI;exports.NiceImageAnnotator=e.NiceImageAnnotator;exports.NiceImageEditor=e.NiceImageEditor;exports.NiceInputOtp=e.NiceInputOtp;exports.NiceInvoiceLineEditor=e.NiceInvoiceLineEditor;exports.NiceKeyValueEditor=e.NiceKeyValueEditor;exports.NiceKnob=e.NiceKnob;exports.NiceLogConsole=e.NiceLogConsole;exports.NiceLookup=e.NiceLookup;exports.NiceMarkdownEditor=e.NiceMarkdownEditor;exports.NiceMention=e.NiceMention;exports.NicePDFAnnotationEditor=e.NicePDFAnnotationEditor;exports.NicePickList=e.NicePickList;exports.NiceRangeSlider=e.NiceRangeSlider;exports.NiceScannerControl=e.NiceScannerControl;exports.NiceScriptRunner=e.NiceScriptRunner;exports.NiceSignature=e.NiceSignature;exports.NiceTreeSelect=e.NiceTreeSelect;exports.NiceWiki=e.NiceWiki;exports.NiceToggle=o.NiceToggle;exports.NiceColorPicker=N.NiceColorPicker;exports.NiceHtmlEditor=t.NiceHtmlEditor;exports.NiceCodeEditor=r.NiceCodeEditor;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("./no-code-DPc82kyy.cjs"),i=require("./NiceForm-B8dX4aLD.cjs"),e=require("./NiceMention-CfSS8Ujd.cjs"),o=require("./pickerCommons-CQnae2FM.cjs"),N=require("./NiceColorPicker-BHaRJBM0.cjs"),t=require("./NiceHtmlEditor-f4_dA-V9.cjs"),r=require("./NiceCodeEditor-CBgbzwjx.cjs");exports.NiceCheckbox=c.NiceCheckbox;exports.NiceNumberInput=c.NiceNumberInput;exports.NiceSelect=c.NiceSelect;exports.NiceTextInput=c.NiceTextInput;exports.MASK_PRESETS=i.MASK_PRESETS;exports.NiceAutocomplete=i.NiceAutocomplete;exports.NiceCalendar=i.NiceCalendar;exports.NiceCountryPicker=i.NiceCountryPicker;exports.NiceDateTimePicker=i.NiceDateTimePicker;exports.NiceForm=i.NiceForm;exports.NiceMaskedInput=i.NiceMaskedInput;exports.NicePasswordInput=i.NicePasswordInput;exports.NiceRadioGroup=i.NiceRadioGroup;exports.NiceRating=i.NiceRating;exports.NiceSlider=i.NiceSlider;exports.NiceTagBox=i.NiceTagBox;exports.NiceTextArea=i.NiceTextArea;exports.NiceUpload=i.NiceUpload;exports.NICE_COLOR_PRESET_KEYS=e.NICE_COLOR_PRESET_KEYS;exports.NiceAccountPicker=e.NiceAccountPicker;exports.NiceAddressInput=e.NiceAddressInput;exports.NiceCodeEditorAI=e.NiceCodeEditorAI;exports.NiceColorPalette=e.NiceColorPalette;exports.NiceContactPicker=e.NiceContactPicker;exports.NiceCropEditor=e.NiceCropEditor;exports.NiceDateRangeBox=e.NiceDateRangeBox;exports.NiceDocumentEditor=e.NiceDocumentEditor;exports.NiceDropDownBox=e.NiceDropDownBox;exports.NiceEmojiPicker=e.NiceEmojiPicker;exports.NiceGradientPicker=e.NiceGradientPicker;exports.NiceHtmlEditorAI=e.NiceHtmlEditorAI;exports.NiceImageAnnotator=e.NiceImageAnnotator;exports.NiceImageEditor=e.NiceImageEditor;exports.NiceInputOtp=e.NiceInputOtp;exports.NiceInvoiceLineEditor=e.NiceInvoiceLineEditor;exports.NiceKeyValueEditor=e.NiceKeyValueEditor;exports.NiceKnob=e.NiceKnob;exports.NiceLogConsole=e.NiceLogConsole;exports.NiceLookup=e.NiceLookup;exports.NiceMarkdownEditor=e.NiceMarkdownEditor;exports.NiceMention=e.NiceMention;exports.NicePDFAnnotationEditor=e.NicePDFAnnotationEditor;exports.NicePickList=e.NicePickList;exports.NiceRangeSlider=e.NiceRangeSlider;exports.NiceScannerControl=e.NiceScannerControl;exports.NiceScriptRunner=e.NiceScriptRunner;exports.NiceSignature=e.NiceSignature;exports.NiceTreeSelect=e.NiceTreeSelect;exports.NiceWiki=e.NiceWiki;exports.NiceToggle=o.NiceToggle;exports.NiceColorPicker=N.NiceColorPicker;exports.NiceHtmlEditor=t.NiceHtmlEditor;exports.NiceCodeEditor=r.NiceCodeEditor;