@thebuoyant-tsdev/mui-ts-library 3.12.0 → 3.14.0

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/README.de.md CHANGED
@@ -12,7 +12,7 @@ Eine typsichere React-Komponentenbibliothek auf Basis von **TypeScript** und **M
12
12
 
13
13
  ## Komponenten
14
14
 
15
- 11 produktionsreife Komponenten in drei Kategorien. Jede verlinkt zu einer interaktiven Live-Demo und einem vollständigen Manual mit allen Props, Typen und Mustern.
15
+ 12 produktionsreife Komponenten in drei Kategorien. Jede verlinkt zu einer interaktiven Live-Demo und einem vollständigen Manual mit allen Props, Typen und Mustern.
16
16
 
17
17
  ### Interaktive UI
18
18
 
@@ -21,6 +21,7 @@ Eine typsichere React-Komponentenbibliothek auf Basis von **TypeScript** und **M
21
21
  | [`GanttChart`](#ganttchart) | Drag-and-Drop-Projekt-Timelines mit Meilensteinen, Abhängigkeiten und CSV-Export | [Live-Demo](https://thebuoyant.github.io/mui-ts-library/?path=/story/components-ganttchart--default) · [Docs](user-manuals/GanttChart.de.md) |
22
22
  | [`TagSelection`](#tagselection) | Multi-Tag-Autocomplete mit freier Tag-Erstellung und Suchergebnis-Highlighting | [Live-Demo](https://thebuoyant.github.io/mui-ts-library/?path=/story/components-tagselection--default) · [Docs](user-manuals/TagSelection.de.md) |
23
23
  | [`PasswordStrengthMeter`](#passwordstrengthmeter) | Echtzeit-Stärke-Feedback mit eingebautem sicheren Passwort-Generator | [Live-Demo](https://thebuoyant.github.io/mui-ts-library/?path=/story/components-passwordstrengthmeter--default) · [Docs](user-manuals/PasswordStrengthMeter.de.md) |
24
+ | [`ColorPicker`](#colorpicker) | Sättigung/Farbton/Alpha-Farbwähler-Panel mit Pipette-Werkzeug — MUI bringt keinen mit | [Live-Demo](https://thebuoyant.github.io/mui-ts-library/?path=/story/components-colorpicker--default) · [Docs](user-manuals/ColorPicker.de.md) |
24
25
 
25
26
  ### Code-Editoren
26
27
 
@@ -137,6 +138,31 @@ import { PasswordStrengthMeter } from '@thebuoyant-tsdev/mui-ts-library';
137
138
 
138
139
  ---
139
140
 
141
+ ### ColorPicker
142
+
143
+ Ein Sättigung/Farbton/Alpha-Farbwähler-Panel — schließt eine echte MUI-Lücke, denn MUI bringt überhaupt keinen Farbwähler mit. Nutze es für Theme-Customizer, Markenfarben-Auswahl oder Design-System-Playgrounds. Vollständig kontrolliert; du besitzt `value` und aktualisierst es über `onChange`.
144
+
145
+ ```tsx
146
+ import { useState } from 'react';
147
+ import { ColorPicker } from '@thebuoyant-tsdev/mui-ts-library';
148
+
149
+ function BrandColorPicker() {
150
+ const [color, setColor] = useState('#1976d2');
151
+
152
+ return (
153
+ <ColorPicker
154
+ value={color}
155
+ onChange={(hex) => setColor(hex)}
156
+ savedColors={['#f44336', '#2196f3', '#4caf50', '#ffeb3b']}
157
+ />
158
+ );
159
+ }
160
+ ```
161
+
162
+ → [Vollständige Dokumentation](user-manuals/ColorPicker.de.md)
163
+
164
+ ---
165
+
140
166
  ### RichTextEditor
141
167
 
142
168
  Vollständiger WYSIWYG-Editor für formatierte Langtexte. Ideal für CMS-Felder, E-Mail-Templates, Kommentarbereiche und alle Eingaben, die mehr als ein einfaches `<textarea>` benötigen — mit Toolbar, Tabellen, Bild-Embed, Emoji-Picker, Vollbild und Markdown-Einfügen.
@@ -408,6 +434,13 @@ Dieses Projekt folgt [Semantic Versioning](https://semver.org/). In der Praxis b
408
434
 
409
435
  ## Changelog
410
436
 
437
+ ### [3.13.0] — 2026-06-29
438
+
439
+ **Hinzugefügt**
440
+ - Neue Komponente: `ColorPicker` — ein Sättigung/Farbton/Alpha-Farbwähler-Panel mit Pipette-Werkzeug, schließt eine echte MUI-Lücke. Siehe [Quick Start](#colorpicker) und [Changelog](#3130--2026-06-29) für Details.
441
+
442
+ ---
443
+
411
444
  ### [3.12.0] — 2026-06-29
412
445
 
413
446
  **Hinzugefügt**
package/README.md CHANGED
@@ -12,7 +12,7 @@ A type-safe React component library built on **TypeScript** and **MUI (Material
12
12
 
13
13
  ## Components
14
14
 
15
- 11 production-ready components across three categories. Each links to a live, interactive demo and a full manual covering every prop, type, and pattern.
15
+ 12 production-ready components across three categories. Each links to a live, interactive demo and a full manual covering every prop, type, and pattern.
16
16
 
17
17
  ### Interactive UI
18
18
 
@@ -21,6 +21,7 @@ A type-safe React component library built on **TypeScript** and **MUI (Material
21
21
  | [`GanttChart`](#ganttchart) | Drag-and-drop project timelines with milestones, dependencies, and CSV export | [Live demo](https://thebuoyant.github.io/mui-ts-library/?path=/story/components-ganttchart--default) · [Docs](user-manuals/GanttChart.md) |
22
22
  | [`TagSelection`](#tagselection) | Multi-tag autocomplete with free-form tag creation and search highlighting | [Live demo](https://thebuoyant.github.io/mui-ts-library/?path=/story/components-tagselection--default) · [Docs](user-manuals/TagSelection.md) |
23
23
  | [`PasswordStrengthMeter`](#passwordstrengthmeter) | Real-time strength feedback with a built-in secure password generator | [Live demo](https://thebuoyant.github.io/mui-ts-library/?path=/story/components-passwordstrengthmeter--default) · [Docs](user-manuals/PasswordStrengthMeter.md) |
24
+ | [`ColorPicker`](#colorpicker) | Saturation/hue/alpha color picker panel with an eyedropper tool — MUI ships none | [Live demo](https://thebuoyant.github.io/mui-ts-library/?path=/story/components-colorpicker--default) · [Docs](user-manuals/ColorPicker.md) |
24
25
 
25
26
  ### Code Editors
26
27
 
@@ -137,6 +138,31 @@ import { PasswordStrengthMeter } from '@thebuoyant-tsdev/mui-ts-library';
137
138
 
138
139
  ---
139
140
 
141
+ ### ColorPicker
142
+
143
+ A saturation/hue/alpha color picker panel — fills a real MUI gap, since MUI ships no color picker at all. Use it for theme customizers, brand-color pickers, or design-system playgrounds. Fully controlled; you own `value` and update it from `onChange`.
144
+
145
+ ```tsx
146
+ import { useState } from 'react';
147
+ import { ColorPicker } from '@thebuoyant-tsdev/mui-ts-library';
148
+
149
+ function BrandColorPicker() {
150
+ const [color, setColor] = useState('#1976d2');
151
+
152
+ return (
153
+ <ColorPicker
154
+ value={color}
155
+ onChange={(hex) => setColor(hex)}
156
+ savedColors={['#f44336', '#2196f3', '#4caf50', '#ffeb3b']}
157
+ />
158
+ );
159
+ }
160
+ ```
161
+
162
+ → [Full documentation](user-manuals/ColorPicker.md)
163
+
164
+ ---
165
+
140
166
  ### RichTextEditor
141
167
 
142
168
  Full-featured WYSIWYG editor for long-form formatted content. Best for CMS fields, email templates, comment boxes, and any input that needs more than a plain `<textarea>` — with toolbar, tables, image embed, emoji picker, fullscreen, and Markdown paste support.
@@ -408,6 +434,13 @@ This project follows [Semantic Versioning](https://semver.org/). In practice:
408
434
 
409
435
  ## Changelog
410
436
 
437
+ ### [3.13.0] — 2026-06-29
438
+
439
+ **Added**
440
+ - New component: `ColorPicker` — a saturation/hue/alpha color picker panel with an eyedropper tool, fills a real MUI gap. See [Quick Start](#colorpicker) and the [Changelog](#3130--2026-06-29) for details.
441
+
442
+ ---
443
+
411
444
  ### [3.12.0] — 2026-06-29
412
445
 
413
446
  **Added**
@@ -0,0 +1,11 @@
1
+ import { type ColorPickerProps } from "./ColorPicker.types";
2
+ declare global {
3
+ interface Window {
4
+ EyeDropper?: new () => {
5
+ open: () => Promise<{
6
+ sRGBHex: string;
7
+ }>;
8
+ };
9
+ }
10
+ }
11
+ export declare function ColorPicker({ value, onChange, onChangeCommitted, defaultFormat, onFormatChange, showAlpha, showEyeDropper, showSliderSection, showInputSection, savedColors, disabled, colorGradientSize, inputSize, width, name, translation, }: ColorPickerProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,526 @@
1
+ import { clamp as e, hexToRgba as t, hslaToHsva as n, hsvaToHsla as r, hsvaToRgba as i, parseColorString as a, rgbaToHex as o, rgbaToHsva as s } from "./util/colorConversion.util.js";
2
+ import { DEFAULT_COLOR_PICKER_TRANSLATION as c } from "./ColorPicker.types.js";
3
+ import { useEffect as l, useRef as u, useState as d } from "react";
4
+ import { Box as f, IconButton as p, MenuItem as m, Select as ee, TextField as h, Tooltip as te, Typography as ne, useTheme as re } from "@mui/material";
5
+ import { jsx as g, jsxs as _ } from "react/jsx-runtime";
6
+ import ie from "@mui/icons-material/Colorize";
7
+ //#region src/components/color-picker/ColorPicker.tsx
8
+ function v(t, n) {
9
+ let r = e(t, 0, 100);
10
+ return `calc(${n / 2}px + (100% - ${n}px) * ${r / 100})`;
11
+ }
12
+ function y(e) {
13
+ let t = i(e), n = r(e), a = o(t);
14
+ return {
15
+ hex: a,
16
+ info: {
17
+ hex: a,
18
+ rgb: {
19
+ r: Math.round(t.r),
20
+ g: Math.round(t.g),
21
+ b: Math.round(t.b),
22
+ a: t.a
23
+ },
24
+ hsl: {
25
+ h: Math.round(n.h),
26
+ s: Math.round(n.s),
27
+ l: Math.round(n.l),
28
+ a: n.a
29
+ }
30
+ }
31
+ };
32
+ }
33
+ function b({ value: t, onCommit: n, min: r, max: i, label: a, disabled: o, size: s, onBlurExtra: c, fullWidth: u }) {
34
+ let [f, p] = d(String(Math.round(t)));
35
+ return l(() => {
36
+ p(String(Math.round(t)));
37
+ }, [t]), /* @__PURE__ */ g(h, {
38
+ size: s,
39
+ value: f,
40
+ disabled: o,
41
+ onChange: (t) => {
42
+ let a = t.target.value;
43
+ p(a);
44
+ let o = Number(a);
45
+ a.trim() !== "" && !Number.isNaN(o) && n(e(o, r, i));
46
+ },
47
+ onBlur: () => {
48
+ p(String(Math.round(t))), c?.();
49
+ },
50
+ slotProps: { htmlInput: {
51
+ "aria-label": a,
52
+ style: { textAlign: "center" }
53
+ } },
54
+ sx: u ? {
55
+ flex: 1,
56
+ minWidth: 0
57
+ } : {
58
+ width: 64,
59
+ flexShrink: 0
60
+ }
61
+ });
62
+ }
63
+ function x({ value: o, onChange: x, onChangeCommitted: S, defaultFormat: ae = "hex", onFormatChange: oe, showAlpha: C = !0, showEyeDropper: se = !0, showSliderSection: ce = !0, showInputSection: le = !0, savedColors: w, disabled: T = !1, colorGradientSize: E = "medium", inputSize: D = "medium", width: ue = 280, name: O, translation: de }) {
64
+ let k = re(), A = {
65
+ ...c,
66
+ ...de
67
+ }, [j, M] = d(() => {
68
+ let e = a(o);
69
+ return e ? s(e) : {
70
+ h: 0,
71
+ s: 0,
72
+ v: 0,
73
+ a: 1
74
+ };
75
+ }), [N, fe] = d(ae), [pe, P] = d(o);
76
+ if (pe !== o) {
77
+ P(o);
78
+ let e = a(o);
79
+ e && M(s(e));
80
+ }
81
+ let { hex: me, info: he } = y(j), F = me.slice(0, 7), [ge, I] = d(F);
82
+ l(() => {
83
+ I(F);
84
+ }, [F]);
85
+ let L = u(null), R = u(null), z = u(null), B = (e) => {
86
+ M(e);
87
+ let t = y(e);
88
+ P(t.hex), x(t.hex, t.info);
89
+ }, V = (e) => {
90
+ if (B(e), S) {
91
+ let t = y(e);
92
+ S(t.hex, t.info);
93
+ }
94
+ }, H = () => {
95
+ if (!S) return;
96
+ let e = y(j);
97
+ S(e.hex, e.info);
98
+ }, _e = E === "small" ? 130 : 160, U = E === "small" ? 20 : 24, W = E === "small" ? 10 : 12, G = E === "small" ? 13 : 16, K = (t) => {
99
+ if (T || !L.current) return;
100
+ let n = L.current.getBoundingClientRect(), r = e(t.clientX - n.left, 0, n.width), i = e(t.clientY - n.top, 0, n.height);
101
+ B({
102
+ ...j,
103
+ s: r / n.width * 100,
104
+ v: 100 - i / n.height * 100
105
+ });
106
+ }, q = (t) => {
107
+ if (T || !R.current) return;
108
+ let n = R.current.getBoundingClientRect(), r = e(t.clientX - n.left, 0, n.width);
109
+ B({
110
+ ...j,
111
+ h: r / n.width * 360
112
+ });
113
+ }, J = (t) => {
114
+ if (T || !z.current) return;
115
+ let n = z.current.getBoundingClientRect(), r = e(t.clientX - n.left, 0, n.width);
116
+ B({
117
+ ...j,
118
+ a: r / n.width
119
+ });
120
+ }, Y = typeof window < "u" && !!window.EyeDropper, ve = async () => {
121
+ if (!(T || !window.EyeDropper)) try {
122
+ let e = t((await new window.EyeDropper().open()).sRGBHex);
123
+ e && V(s({
124
+ ...e,
125
+ a: j.a
126
+ }));
127
+ } catch {}
128
+ }, ye = (e) => {
129
+ fe(e), oe?.(e);
130
+ }, X = i(j), Z = r(j), Q = F, $ = {
131
+ backgroundImage: "linear-gradient(45deg, #ccc 25%, transparent 25%), linear-gradient(-45deg, #ccc 25%, transparent 25%), linear-gradient(45deg, transparent 75%, #ccc 75%), linear-gradient(-45deg, transparent 75%, #ccc 75%)",
132
+ backgroundSize: "8px 8px",
133
+ backgroundPosition: "0 0, 0 4px, 4px -4px, -4px 0px"
134
+ };
135
+ return /* @__PURE__ */ _(f, {
136
+ sx: {
137
+ width: ue,
138
+ opacity: T ? .6 : 1,
139
+ display: "flex",
140
+ flexDirection: "column",
141
+ gap: 1
142
+ },
143
+ children: [
144
+ /* @__PURE__ */ g(f, {
145
+ ref: L,
146
+ role: "slider",
147
+ tabIndex: T ? -1 : 0,
148
+ "aria-label": A.gradientAreaLabel,
149
+ "aria-valuetext": `${Math.round(j.s)}, ${Math.round(j.v)}`,
150
+ onPointerDown: (e) => {
151
+ e.currentTarget.setPointerCapture?.(e.pointerId), K(e);
152
+ },
153
+ onPointerMove: (e) => {
154
+ e.buttons === 1 && K(e);
155
+ },
156
+ onPointerUp: H,
157
+ sx: {
158
+ position: "relative",
159
+ width: "100%",
160
+ height: _e,
161
+ borderRadius: `${k.shape.borderRadius}px`,
162
+ border: `1px solid ${k.palette.divider}`,
163
+ cursor: T ? "default" : "crosshair",
164
+ touchAction: "none",
165
+ background: `linear-gradient(to top, #000, rgba(0,0,0,0)), linear-gradient(to right, #fff, hsl(${j.h}, 100%, 50%))`
166
+ },
167
+ children: /* @__PURE__ */ g(f, { sx: {
168
+ position: "absolute",
169
+ left: v(j.s, G),
170
+ top: v(100 - j.v, G),
171
+ width: G,
172
+ height: G,
173
+ borderRadius: "50%",
174
+ border: "2px solid #fff",
175
+ boxShadow: "0 0 0 1px rgba(0,0,0,0.3)",
176
+ transform: "translate(-50%, -50%)",
177
+ pointerEvents: "none",
178
+ backgroundColor: Q
179
+ } })
180
+ }),
181
+ ce && /* @__PURE__ */ _(f, {
182
+ sx: {
183
+ display: "flex",
184
+ gap: 1,
185
+ alignItems: "center"
186
+ },
187
+ children: [se && Y && /* @__PURE__ */ g(te, {
188
+ title: A.eyeDropperLabel,
189
+ children: /* @__PURE__ */ g("span", { children: /* @__PURE__ */ g(p, {
190
+ size: "small",
191
+ onClick: ve,
192
+ disabled: T,
193
+ "aria-label": A.eyeDropperLabel,
194
+ children: /* @__PURE__ */ g(ie, { fontSize: "small" })
195
+ }) })
196
+ }), /* @__PURE__ */ _(f, {
197
+ sx: {
198
+ flex: 1,
199
+ display: "flex",
200
+ flexDirection: "column",
201
+ gap: .75
202
+ },
203
+ children: [/* @__PURE__ */ g(f, {
204
+ ref: R,
205
+ role: "slider",
206
+ tabIndex: T ? -1 : 0,
207
+ "aria-label": A.hueSliderLabel,
208
+ "aria-valuemin": 0,
209
+ "aria-valuemax": 360,
210
+ "aria-valuenow": Math.round(j.h),
211
+ onPointerDown: (e) => {
212
+ e.currentTarget.setPointerCapture?.(e.pointerId), q(e);
213
+ },
214
+ onPointerMove: (e) => {
215
+ e.buttons === 1 && q(e);
216
+ },
217
+ onPointerUp: H,
218
+ sx: {
219
+ position: "relative",
220
+ width: "100%",
221
+ height: W,
222
+ borderRadius: W,
223
+ cursor: T ? "default" : "pointer",
224
+ touchAction: "none",
225
+ background: "linear-gradient(to right, red, yellow, lime, cyan, blue, magenta, red)"
226
+ },
227
+ children: /* @__PURE__ */ g(f, { sx: {
228
+ position: "absolute",
229
+ left: v(j.h / 360 * 100, G),
230
+ top: "50%",
231
+ width: G,
232
+ height: G,
233
+ borderRadius: "50%",
234
+ border: "2px solid #fff",
235
+ boxShadow: "0 0 0 1px rgba(0,0,0,0.3)",
236
+ transform: "translate(-50%, -50%)",
237
+ pointerEvents: "none",
238
+ backgroundColor: `hsl(${j.h}, 100%, 50%)`
239
+ } })
240
+ }), C && /* @__PURE__ */ _(f, {
241
+ ref: z,
242
+ role: "slider",
243
+ tabIndex: T ? -1 : 0,
244
+ "aria-label": A.alphaFieldLabel,
245
+ "aria-valuemin": 0,
246
+ "aria-valuemax": 100,
247
+ "aria-valuenow": Math.round(j.a * 100),
248
+ onPointerDown: (e) => {
249
+ e.currentTarget.setPointerCapture?.(e.pointerId), J(e);
250
+ },
251
+ onPointerMove: (e) => {
252
+ e.buttons === 1 && J(e);
253
+ },
254
+ onPointerUp: H,
255
+ sx: {
256
+ position: "relative",
257
+ width: "100%",
258
+ height: W,
259
+ borderRadius: W,
260
+ cursor: T ? "default" : "pointer",
261
+ touchAction: "none",
262
+ ...$
263
+ },
264
+ children: [/* @__PURE__ */ g(f, { sx: {
265
+ position: "absolute",
266
+ inset: 0,
267
+ borderRadius: W,
268
+ background: `linear-gradient(to right, transparent, ${Q})`
269
+ } }), /* @__PURE__ */ g(f, { sx: {
270
+ position: "absolute",
271
+ left: v(j.a * 100, G),
272
+ top: "50%",
273
+ width: G,
274
+ height: G,
275
+ borderRadius: "50%",
276
+ border: "2px solid #fff",
277
+ boxShadow: "0 0 0 1px rgba(0,0,0,0.3)",
278
+ transform: "translate(-50%, -50%)",
279
+ pointerEvents: "none",
280
+ backgroundColor: Q
281
+ } })]
282
+ })]
283
+ })]
284
+ }),
285
+ le && /* @__PURE__ */ _(f, {
286
+ sx: {
287
+ display: "flex",
288
+ flexDirection: "column",
289
+ gap: .75
290
+ },
291
+ children: [
292
+ /* @__PURE__ */ _(f, {
293
+ sx: {
294
+ display: "flex",
295
+ gap: .75,
296
+ alignItems: "center"
297
+ },
298
+ children: [
299
+ /* @__PURE__ */ _(ee, {
300
+ size: D,
301
+ value: N,
302
+ "aria-label": A.formatLabel,
303
+ disabled: T,
304
+ onChange: (e) => ye(e.target.value),
305
+ sx: {
306
+ minWidth: 80,
307
+ flexShrink: 0
308
+ },
309
+ children: [
310
+ /* @__PURE__ */ g(m, {
311
+ value: "hex",
312
+ children: "HEX"
313
+ }),
314
+ /* @__PURE__ */ g(m, {
315
+ value: "rgb",
316
+ children: "RGB"
317
+ }),
318
+ /* @__PURE__ */ g(m, {
319
+ value: "hsl",
320
+ children: "HSL"
321
+ })
322
+ ]
323
+ }),
324
+ N === "hex" && /* @__PURE__ */ g(h, {
325
+ size: D,
326
+ value: ge,
327
+ disabled: T,
328
+ onChange: (e) => {
329
+ let n = e.target.value;
330
+ I(n);
331
+ let r = t(n);
332
+ r && B(s({
333
+ ...r,
334
+ a: j.a
335
+ }));
336
+ },
337
+ onBlur: () => {
338
+ I(F), H();
339
+ },
340
+ slotProps: { htmlInput: { "aria-label": A.hexFieldLabel } },
341
+ sx: {
342
+ flex: 1,
343
+ minWidth: 0
344
+ }
345
+ }),
346
+ N !== "hex" && /* @__PURE__ */ g(f, { sx: { flex: 1 } }),
347
+ C && /* @__PURE__ */ g(b, {
348
+ label: A.alphaFieldLabel,
349
+ value: Math.round(j.a * 100),
350
+ min: 0,
351
+ max: 100,
352
+ disabled: T,
353
+ size: D,
354
+ onBlurExtra: H,
355
+ onCommit: (e) => B({
356
+ ...j,
357
+ a: e / 100
358
+ })
359
+ })
360
+ ]
361
+ }),
362
+ N === "rgb" && /* @__PURE__ */ _(f, {
363
+ sx: {
364
+ display: "flex",
365
+ gap: .75
366
+ },
367
+ children: [
368
+ /* @__PURE__ */ g(b, {
369
+ label: A.redLabel,
370
+ value: X.r,
371
+ min: 0,
372
+ max: 255,
373
+ disabled: T,
374
+ size: D,
375
+ onBlurExtra: H,
376
+ fullWidth: !0,
377
+ onCommit: (e) => B(s({
378
+ r: e,
379
+ g: X.g,
380
+ b: X.b,
381
+ a: j.a
382
+ }))
383
+ }),
384
+ /* @__PURE__ */ g(b, {
385
+ label: A.greenLabel,
386
+ value: X.g,
387
+ min: 0,
388
+ max: 255,
389
+ disabled: T,
390
+ size: D,
391
+ onBlurExtra: H,
392
+ fullWidth: !0,
393
+ onCommit: (e) => B(s({
394
+ r: X.r,
395
+ g: e,
396
+ b: X.b,
397
+ a: j.a
398
+ }))
399
+ }),
400
+ /* @__PURE__ */ g(b, {
401
+ label: A.blueLabel,
402
+ value: X.b,
403
+ min: 0,
404
+ max: 255,
405
+ disabled: T,
406
+ size: D,
407
+ onBlurExtra: H,
408
+ fullWidth: !0,
409
+ onCommit: (e) => B(s({
410
+ r: X.r,
411
+ g: X.g,
412
+ b: e,
413
+ a: j.a
414
+ }))
415
+ })
416
+ ]
417
+ }),
418
+ N === "hsl" && /* @__PURE__ */ _(f, {
419
+ sx: {
420
+ display: "flex",
421
+ gap: .75
422
+ },
423
+ children: [
424
+ /* @__PURE__ */ g(b, {
425
+ label: A.hueFieldLabel,
426
+ value: Z.h,
427
+ min: 0,
428
+ max: 360,
429
+ disabled: T,
430
+ size: D,
431
+ onBlurExtra: H,
432
+ fullWidth: !0,
433
+ onCommit: (e) => B({
434
+ ...j,
435
+ h: e
436
+ })
437
+ }),
438
+ /* @__PURE__ */ g(b, {
439
+ label: A.saturationFieldLabel,
440
+ value: Z.s,
441
+ min: 0,
442
+ max: 100,
443
+ disabled: T,
444
+ size: D,
445
+ onBlurExtra: H,
446
+ fullWidth: !0,
447
+ onCommit: (e) => B(n({
448
+ h: Z.h,
449
+ s: e,
450
+ l: Z.l,
451
+ a: Z.a
452
+ }))
453
+ }),
454
+ /* @__PURE__ */ g(b, {
455
+ label: A.lightnessFieldLabel,
456
+ value: Z.l,
457
+ min: 0,
458
+ max: 100,
459
+ disabled: T,
460
+ size: D,
461
+ onBlurExtra: H,
462
+ fullWidth: !0,
463
+ onCommit: (e) => B(n({
464
+ h: Z.h,
465
+ s: Z.s,
466
+ l: e,
467
+ a: Z.a
468
+ }))
469
+ })
470
+ ]
471
+ })
472
+ ]
473
+ }),
474
+ w && w.length > 0 && /* @__PURE__ */ _(f, { children: [/* @__PURE__ */ g(ne, {
475
+ variant: "caption",
476
+ sx: {
477
+ color: "text.secondary",
478
+ display: "block",
479
+ mb: .5
480
+ },
481
+ children: A.savedColorsLabel
482
+ }), /* @__PURE__ */ g(f, {
483
+ sx: {
484
+ display: "flex",
485
+ flexWrap: "wrap",
486
+ gap: .75
487
+ },
488
+ children: w.map((e, t) => /* @__PURE__ */ g(f, {
489
+ component: "button",
490
+ type: "button",
491
+ disabled: T,
492
+ "aria-label": e,
493
+ onClick: () => {
494
+ let t = a(e);
495
+ t && V(s(t));
496
+ },
497
+ sx: {
498
+ width: U,
499
+ height: U,
500
+ p: 0,
501
+ borderRadius: .5,
502
+ border: `1px solid ${k.palette.divider}`,
503
+ cursor: T ? "default" : "pointer",
504
+ flexShrink: 0,
505
+ ...$,
506
+ backgroundSize: "6px 6px",
507
+ "&:hover": T ? void 0 : { borderColor: k.palette.primary.main }
508
+ },
509
+ children: /* @__PURE__ */ g(f, { sx: {
510
+ width: "100%",
511
+ height: "100%",
512
+ borderRadius: .5,
513
+ backgroundColor: e
514
+ } })
515
+ }, `${e}-${t}`))
516
+ })] }),
517
+ O && /* @__PURE__ */ g("input", {
518
+ type: "hidden",
519
+ name: O,
520
+ value: he.hex
521
+ })
522
+ ]
523
+ });
524
+ }
525
+ //#endregion
526
+ export { x as ColorPicker };