@andreagiugni/tailwind-dashboard-ui 0.4.0 → 0.5.1
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.md +12 -0
- package/dist/{chunk-OSIOO5AE.cjs → chunk-2C5QY3Z2.cjs} +22 -6
- package/dist/chunk-2C5QY3Z2.cjs.map +1 -0
- package/dist/{chunk-BGA7AECV.cjs → chunk-3EE6CPHW.cjs} +11 -3
- package/dist/chunk-3EE6CPHW.cjs.map +1 -0
- package/dist/chunk-MYN5LDMO.cjs +184 -0
- package/dist/chunk-MYN5LDMO.cjs.map +1 -0
- package/dist/{chunk-MEU4PMP5.js → chunk-NWIOJGF7.js} +11 -3
- package/dist/chunk-NWIOJGF7.js.map +1 -0
- package/dist/chunk-P7LI2FSR.js +182 -0
- package/dist/chunk-P7LI2FSR.js.map +1 -0
- package/dist/{chunk-HZQZC5CK.js → chunk-YAKIMPXZ.js} +22 -6
- package/dist/chunk-YAKIMPXZ.js.map +1 -0
- package/dist/components/Charts/BarChart.cjs +2 -2
- package/dist/components/Charts/BarChart.js +1 -1
- package/dist/components/Charts/LineChart.cjs +2 -2
- package/dist/components/Charts/LineChart.js +1 -1
- package/dist/components/ColorPicker/ColorPicker.cjs +14 -0
- package/dist/components/ColorPicker/ColorPicker.cjs.map +1 -0
- package/dist/components/ColorPicker/ColorPicker.d.cts +23 -0
- package/dist/components/ColorPicker/ColorPicker.d.ts +23 -0
- package/dist/components/ColorPicker/ColorPicker.js +5 -0
- package/dist/components/ColorPicker/ColorPicker.js.map +1 -0
- package/dist/index.cjs +12 -6
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +6 -4
- package/dist/index.js.map +1 -1
- package/package.json +2 -1
- package/dist/chunk-BGA7AECV.cjs.map +0 -1
- package/dist/chunk-HZQZC5CK.js.map +0 -1
- package/dist/chunk-MEU4PMP5.js.map +0 -1
- package/dist/chunk-OSIOO5AE.cjs.map +0 -1
package/README.md
CHANGED
|
@@ -47,6 +47,17 @@ npm i @tiptap/react @tiptap/pm @tiptap/starter-kit @tiptap/extension-link @tipta
|
|
|
47
47
|
> They are code-split into their own chunks and never executed unless you actually import them, so
|
|
48
48
|
> the rest of the library stays SSR-safe and light.
|
|
49
49
|
|
|
50
|
+
### `ColorPicker`
|
|
51
|
+
|
|
52
|
+
The `ColorPicker` is built on [`react-beautiful-color`](https://www.npmjs.com/package/react-beautiful-color),
|
|
53
|
+
which is a **bundled dependency** (installed automatically — you don't add it yourself). It is
|
|
54
|
+
client-only and code-split like the data-viz widgets, so render it client-only under SSR. It ships
|
|
55
|
+
its own stylesheet — import it once in your app:
|
|
56
|
+
|
|
57
|
+
```ts
|
|
58
|
+
import 'react-beautiful-color/dist/react-beautiful-color.css';
|
|
59
|
+
```
|
|
60
|
+
|
|
50
61
|
## Tailwind setup
|
|
51
62
|
|
|
52
63
|
The library ships its design tokens as an importable stylesheet. Add this line to your app's
|
|
@@ -194,6 +205,7 @@ Legend: **(+native)** = also extends the element's native HTML attributes.
|
|
|
194
205
|
| `DatePicker` | `id`, `mode` (single/multiple/range/time), `defaultDate`, `onChange`, `label`, `placeholder` |
|
|
195
206
|
| `DateTimePicker` | `id`, `label?`, `placeholder?`, `defaultDate?`, `defaultTime?` (`"HH:MM"`), `onChange?({ date, time })` — flatpickr date calendar + a compact `HH:MM` time input |
|
|
196
207
|
| `Slider` | `value` / `defaultValue`, `onChange(value)`, `min`, `max`, `step`, `color`, `label?`, `showValue?`, `disabled` |
|
|
208
|
+
| `ColorPicker` | `defaultValue?` (hex), `defaultFormat?` / `formats?` (`hex`/`rgb`/`rgba`/`hsl`/`hsla`), `showInput?`, `withEyeDropper?`, `label?`, `onChange?(value, color)` — saturation/hue/alpha picker + value input with a format switcher; built on `react-beautiful-color` (bundled), client-only, **import its CSS** (see ColorPicker note above) |
|
|
197
209
|
| `Editor` (WYSIWYG) | `content`, `onChange(html)`, `placeholder?`, `editable?`, `toolbar?` (ordered tool ids or custom buttons), `editorClassName?` — optional Tiptap peers; render client-only (see Data viz) |
|
|
198
210
|
|
|
199
211
|
### Data viz
|
|
@@ -29,10 +29,12 @@ var defaultOptions = {
|
|
|
29
29
|
dataLabels: {
|
|
30
30
|
enabled: false
|
|
31
31
|
},
|
|
32
|
+
// No transparent stroke around the columns: it shrinks and shifts the
|
|
33
|
+
// painted bar inside its allocated slot, so the hover highlight band
|
|
34
|
+
// (crosshairs width "barWidth" = the allocated width) would render wider
|
|
35
|
+
// than — and offset from — the visible bar.
|
|
32
36
|
stroke: {
|
|
33
|
-
show:
|
|
34
|
-
width: 4,
|
|
35
|
-
colors: ["transparent"]
|
|
37
|
+
show: false
|
|
36
38
|
},
|
|
37
39
|
xaxis: {
|
|
38
40
|
categories: [
|
|
@@ -54,13 +56,27 @@ var defaultOptions = {
|
|
|
54
56
|
},
|
|
55
57
|
axisTicks: {
|
|
56
58
|
show: false
|
|
59
|
+
},
|
|
60
|
+
// Match the hover highlight band to the bar width (the default band spans
|
|
61
|
+
// the whole category slot, looking ~3x wider than the 39% columns).
|
|
62
|
+
crosshairs: {
|
|
63
|
+
width: "barWidth"
|
|
57
64
|
}
|
|
58
65
|
},
|
|
59
66
|
legend: {
|
|
60
67
|
show: true,
|
|
61
68
|
position: "top",
|
|
62
69
|
horizontalAlign: "left",
|
|
63
|
-
fontFamily: "Outfit"
|
|
70
|
+
fontFamily: "Outfit",
|
|
71
|
+
// Rounded, border-less swatches that echo the column styling. ApexCharts
|
|
72
|
+
// sets the marker span's `color` to the series color, so `currentColor`
|
|
73
|
+
// picks it up; `customHTML` lets us round the corners (the built-in shapes
|
|
74
|
+
// are sharp SVG paths that CSS border-radius can't touch).
|
|
75
|
+
markers: {
|
|
76
|
+
size: 7,
|
|
77
|
+
strokeWidth: 0,
|
|
78
|
+
customHTML: () => '<span style="display:block;height:100%;width:100%;border-radius:3px;background:currentColor"></span>'
|
|
79
|
+
}
|
|
64
80
|
},
|
|
65
81
|
yaxis: {
|
|
66
82
|
title: {
|
|
@@ -126,5 +142,5 @@ var BarChart = ({
|
|
|
126
142
|
};
|
|
127
143
|
|
|
128
144
|
exports.BarChart = BarChart;
|
|
129
|
-
//# sourceMappingURL=chunk-
|
|
130
|
-
//# sourceMappingURL=chunk-
|
|
145
|
+
//# sourceMappingURL=chunk-2C5QY3Z2.cjs.map
|
|
146
|
+
//# sourceMappingURL=chunk-2C5QY3Z2.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/components/Charts/BarChart.tsx"],"names":["jsx","Chart"],"mappings":";;;;;;;;;AAaA,IAAM,cAAA,GAA8B;AAAA,EAClC,MAAA,EAAQ,CAAC,SAAS,CAAA;AAAA,EAClB,KAAA,EAAO;AAAA,IACL,UAAA,EAAY,oBAAA;AAAA,IACZ,IAAA,EAAM,KAAA;AAAA,IACN,MAAA,EAAQ,GAAA;AAAA,IACR,OAAA,EAAS;AAAA,MACP,IAAA,EAAM;AAAA;AACR,GACF;AAAA,EACA,WAAA,EAAa;AAAA,IACX,GAAA,EAAK;AAAA,MACH,UAAA,EAAY,KAAA;AAAA,MACZ,WAAA,EAAa,KAAA;AAAA,MACb,YAAA,EAAc,CAAA;AAAA,MACd,uBAAA,EAAyB;AAAA;AAC3B,GACF;AAAA,EACA,UAAA,EAAY;AAAA,IACV,OAAA,EAAS;AAAA,GACX;AAAA;AAAA;AAAA;AAAA;AAAA,EAKA,MAAA,EAAQ;AAAA,IACN,IAAA,EAAM;AAAA,GACR;AAAA,EACA,KAAA,EAAO;AAAA,IACL,UAAA,EAAY;AAAA,MACV,KAAA;AAAA,MACA,KAAA;AAAA,MACA,KAAA;AAAA,MACA,KAAA;AAAA,MACA,KAAA;AAAA,MACA,KAAA;AAAA,MACA,KAAA;AAAA,MACA,KAAA;AAAA,MACA,KAAA;AAAA,MACA,KAAA;AAAA,MACA,KAAA;AAAA,MACA;AAAA,KACF;AAAA,IACA,UAAA,EAAY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ACA,MAAA;AAAA,EACA;AACF,CAAA,KAAM;AACJ,EAAA,MAAM,aAAA,GAA6B;AAAA,IACjC,GAAG,cAAA;AAAA,IACH,GAAG,OAAA;AAAA,IACH,MAAA,EAAQ,MAAA,IAAU,OAAA,EAAS,MAAA,IAAU,cAAA,CAAe,MAAA;AAAA,IACpD,KAAA,EAAO;AAAA,MACL,GAAG,cAAA,CAAe,KAAA;AAAA,MAClB,GAAG,OAAA,EAAS,KAAA;AAAA,MACZ,QAAQ,MAAA,IAAU,OAAA,EAAS,KAAA,EAAO,MAAA,IAAU,eAAe,KAAA,EAAO;AAAA,KACpE;AAAA,IACA,KAAA,EAAO;AAAA,MACL,GAAG,cAAA,CAAe,KAAA;AAAA,MAClB,GAAG,OAAA,EAAS,KAAA;AAAA,MACZ,YACE,UAAA,IACA,OAAA,EAAS,KAAA,EAAO,UAAA,IAChB,eAAe,KAAA,EAAO;AAAA;AAC1B,GACF;AAEA,EAAA,uBACEA,cAAA;AAAA,IAACC,sBAAA;AAAA,IAAA;AAAA,MACC,OAAA,EAAS,aAAA;AAAA,MACT,QAAQ,MAAA,IAAU,aAAA;AAAA,MAClB,IAAA,EAAK,KAAA;AAAA,MACL,QAAQ,MAAA,IAAU;AAAA;AAAA,GACpB;AAEJ","file":"chunk-2C5QY3Z2.cjs","sourcesContent":["\"use client\";\nimport React from \"react\";\nimport Chart from \"react-apexcharts\";\nimport type { ApexOptions } from \"apexcharts\";\n\nexport interface BarChartProps {\n series?: ApexAxisChartSeries;\n categories?: string[];\n colors?: string[];\n height?: number;\n options?: ApexOptions;\n}\n\nconst defaultOptions: ApexOptions = {\n colors: [\"#465fff\"],\n chart: {\n fontFamily: \"Outfit, sans-serif\",\n type: \"bar\",\n height: 180,\n toolbar: {\n show: false,\n },\n },\n plotOptions: {\n bar: {\n horizontal: false,\n columnWidth: \"39%\",\n borderRadius: 5,\n borderRadiusApplication: \"end\",\n },\n },\n dataLabels: {\n enabled: false,\n },\n // No transparent stroke around the columns: it shrinks and shifts the\n // painted bar inside its allocated slot, so the hover highlight band\n // (crosshairs width \"barWidth\" = the allocated width) would render wider\n // than — and offset from — the visible bar.\n stroke: {\n show: false,\n },\n xaxis: {\n categories: [\n \"Jan\",\n \"Feb\",\n \"Mar\",\n \"Apr\",\n \"May\",\n \"Jun\",\n \"Jul\",\n \"Aug\",\n \"Sep\",\n \"Oct\",\n \"Nov\",\n \"Dec\",\n ],\n axisBorder: {\n show: false,\n },\n axisTicks: {\n show: false,\n },\n // Match the hover highlight band to the bar width (the default band spans\n // the whole category slot, looking ~3x wider than the 39% columns).\n crosshairs: {\n width: \"barWidth\",\n },\n },\n legend: {\n show: true,\n position: \"top\",\n horizontalAlign: \"left\",\n fontFamily: \"Outfit\",\n // Rounded, border-less swatches that echo the column styling. ApexCharts\n // sets the marker span's `color` to the series color, so `currentColor`\n // picks it up; `customHTML` lets us round the corners (the built-in shapes\n // are sharp SVG paths that CSS border-radius can't touch).\n markers: {\n size: 7,\n strokeWidth: 0,\n customHTML: () =>\n '<span style=\"display:block;height:100%;width:100%;border-radius:3px;background:currentColor\"></span>',\n },\n },\n yaxis: {\n title: {\n text: undefined,\n },\n },\n grid: {\n yaxis: {\n lines: {\n show: true,\n },\n },\n },\n fill: {\n opacity: 1,\n },\n tooltip: {\n x: {\n show: false,\n },\n y: {\n formatter: (val: number) => `${val}`,\n },\n },\n};\n\nconst defaultSeries: ApexAxisChartSeries = [\n {\n name: \"Sales\",\n data: [168, 385, 201, 298, 187, 195, 291, 110, 215, 390, 280, 112],\n },\n];\n\nexport const BarChart: React.FC<BarChartProps> = ({\n series,\n categories,\n colors,\n height,\n options,\n}) => {\n const mergedOptions: ApexOptions = {\n ...defaultOptions,\n ...options,\n colors: colors ?? options?.colors ?? defaultOptions.colors,\n chart: {\n ...defaultOptions.chart,\n ...options?.chart,\n height: height ?? options?.chart?.height ?? defaultOptions.chart?.height,\n },\n xaxis: {\n ...defaultOptions.xaxis,\n ...options?.xaxis,\n categories:\n categories ??\n options?.xaxis?.categories ??\n defaultOptions.xaxis?.categories,\n },\n };\n\n return (\n <Chart\n options={mergedOptions}\n series={series ?? defaultSeries}\n type=\"bar\"\n height={height ?? 180}\n />\n );\n};\n"]}
|
|
@@ -12,7 +12,15 @@ var defaultOptions = {
|
|
|
12
12
|
legend: {
|
|
13
13
|
show: false,
|
|
14
14
|
position: "top",
|
|
15
|
-
horizontalAlign: "left"
|
|
15
|
+
horizontalAlign: "left",
|
|
16
|
+
// Rounded, border-less swatches (visible when the legend is enabled).
|
|
17
|
+
// ApexCharts sets the marker span's `color` to the series color, so
|
|
18
|
+
// `currentColor` picks it up; `customHTML` rounds the corners.
|
|
19
|
+
markers: {
|
|
20
|
+
size: 7,
|
|
21
|
+
strokeWidth: 0,
|
|
22
|
+
customHTML: () => '<span style="display:block;height:100%;width:100%;border-radius:3px;background:currentColor"></span>'
|
|
23
|
+
}
|
|
16
24
|
},
|
|
17
25
|
colors: ["#465FFF", "#9CB9FF"],
|
|
18
26
|
chart: {
|
|
@@ -148,5 +156,5 @@ var LineChart = ({
|
|
|
148
156
|
};
|
|
149
157
|
|
|
150
158
|
exports.LineChart = LineChart;
|
|
151
|
-
//# sourceMappingURL=chunk-
|
|
152
|
-
//# sourceMappingURL=chunk-
|
|
159
|
+
//# sourceMappingURL=chunk-3EE6CPHW.cjs.map
|
|
160
|
+
//# sourceMappingURL=chunk-3EE6CPHW.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/components/Charts/LineChart.tsx"],"names":["jsx","Chart"],"mappings":";;;;;;;;;AAaA,IAAM,cAAA,GAA8B;AAAA,EAClC,MAAA,EAAQ;AAAA,IACN,IAAA,EAAM,KAAA;AAAA,IACN,QAAA,EAAU,KAAA;AAAA,IACV,eAAA,EAAiB,MAAA;AAAA;AAAA;AAAA;AAAA,IAIjB,OAAA,EAAS;AAAA,MACP,IAAA,EAAM,CAAA;AAAA,MACN,WAAA,EAAa,CAAA;AAAA,MACb,YAA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,MAAA,IAAU,OAAA,EAAS,MAAA,IAAU,cAAA,CAAe,MAAA;AAAA,IACpD,KAAA,EAAO;AAAA,MACL,GAAG,cAAA,CAAe,KAAA;AAAA,MAClB,GAAG,OAAA,EAAS,KAAA;AAAA,MACZ,QAAQ,MAAA,IAAU,OAAA,EAAS,KAAA,EAAO,MAAA,IAAU,eAAe,KAAA,EAAO;AAAA,KACpE;AAAA,IACA,KAAA,EAAO;AAAA,MACL,GAAG,cAAA,CAAe,KAAA;AAAA,MAClB,GAAG,OAAA,EAAS,KAAA;AAAA,MACZ,YACE,UAAA,IACA,OAAA,EAAS,KAAA,EAAO,UAAA,IAChB,eAAe,KAAA,EAAO;AAAA;AAC1B,GACF;AAEA,EAAA,uBACEA,cAAA;AAAA,IAACC,sBAAA;AAAA,IAAA;AAAA,MACC,OAAA,EAAS,aAAA;AAAA,MACT,QAAQ,MAAA,IAAU,aAAA;AAAA,MAClB,IAAA,EAAK,MAAA;AAAA,MACL,QAAQ,MAAA,IAAU;AAAA;AAAA,GACpB;AAEJ","file":"chunk-3EE6CPHW.cjs","sourcesContent":["\"use client\";\nimport React from \"react\";\nimport Chart from \"react-apexcharts\";\nimport type { ApexOptions } from \"apexcharts\";\n\nexport interface LineChartProps {\n series?: ApexAxisChartSeries;\n categories?: string[];\n colors?: string[];\n height?: number;\n options?: ApexOptions;\n}\n\nconst defaultOptions: ApexOptions = {\n legend: {\n show: false,\n position: \"top\",\n horizontalAlign: \"left\",\n // Rounded, border-less swatches (visible when the legend is enabled).\n // ApexCharts sets the marker span's `color` to the series color, so\n // `currentColor` picks it up; `customHTML` rounds the corners.\n markers: {\n size: 7,\n strokeWidth: 0,\n customHTML: () =>\n '<span style=\"display:block;height:100%;width:100%;border-radius:3px;background:currentColor\"></span>',\n },\n },\n colors: [\"#465FFF\", \"#9CB9FF\"],\n chart: {\n fontFamily: \"Outfit, sans-serif\",\n height: 310,\n type: \"line\",\n toolbar: {\n show: false,\n },\n },\n stroke: {\n curve: \"straight\",\n width: [2, 2],\n },\n fill: {\n type: \"gradient\",\n gradient: {\n opacityFrom: 0.55,\n opacityTo: 0,\n },\n },\n markers: {\n size: 0,\n strokeColors: \"#fff\",\n strokeWidth: 2,\n hover: {\n size: 6,\n },\n },\n grid: {\n xaxis: {\n lines: {\n show: false,\n },\n },\n yaxis: {\n lines: {\n show: true,\n },\n },\n },\n dataLabels: {\n enabled: false,\n },\n tooltip: {\n enabled: true,\n x: {\n format: \"dd MMM yyyy\",\n },\n },\n xaxis: {\n type: \"category\",\n categories: [\n \"Jan\",\n \"Feb\",\n \"Mar\",\n \"Apr\",\n \"May\",\n \"Jun\",\n \"Jul\",\n \"Aug\",\n \"Sep\",\n \"Oct\",\n \"Nov\",\n \"Dec\",\n ],\n axisBorder: {\n show: false,\n },\n axisTicks: {\n show: false,\n },\n tooltip: {\n enabled: false,\n },\n },\n yaxis: {\n labels: {\n style: {\n fontSize: \"12px\",\n colors: [\"#6B7280\"],\n },\n },\n title: {\n text: \"\",\n style: {\n fontSize: \"0px\",\n },\n },\n },\n};\n\nconst defaultSeries: ApexAxisChartSeries = [\n {\n name: \"Sales\",\n data: [180, 190, 170, 160, 175, 165, 170, 205, 230, 210, 240, 235],\n },\n {\n name: \"Revenue\",\n data: [40, 30, 50, 40, 55, 40, 70, 100, 110, 120, 150, 140],\n },\n];\n\nexport const LineChart: React.FC<LineChartProps> = ({\n series,\n categories,\n colors,\n height,\n options,\n}) => {\n const mergedOptions: ApexOptions = {\n ...defaultOptions,\n ...options,\n colors: colors ?? options?.colors ?? defaultOptions.colors,\n chart: {\n ...defaultOptions.chart,\n ...options?.chart,\n height: height ?? options?.chart?.height ?? defaultOptions.chart?.height,\n },\n xaxis: {\n ...defaultOptions.xaxis,\n ...options?.xaxis,\n categories:\n categories ??\n options?.xaxis?.categories ??\n defaultOptions.xaxis?.categories,\n },\n };\n\n return (\n <Chart\n options={mergedOptions}\n series={series ?? defaultSeries}\n type=\"area\"\n height={height ?? 310}\n />\n );\n};\n"]}
|
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
var chunkYERNSNT4_cjs = require('./chunk-YERNSNT4.cjs');
|
|
5
|
+
var react = require('react');
|
|
6
|
+
var reactBeautifulColor = require('react-beautiful-color');
|
|
7
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
8
|
+
|
|
9
|
+
var ALL_FORMATS = ["hex", "rgb", "rgba", "hsl", "hsla"];
|
|
10
|
+
function parseValue(text, format) {
|
|
11
|
+
const t = text.trim();
|
|
12
|
+
if (format === "hex") {
|
|
13
|
+
return /^#([0-9a-f]{3}|[0-9a-f]{6}|[0-9a-f]{8})$/i.test(t) ? { type: "hex", value: t } : null;
|
|
14
|
+
}
|
|
15
|
+
const n = t.match(/-?\d*\.?\d+/g)?.map(Number) ?? [];
|
|
16
|
+
if (format === "rgb" && n.length >= 3) return { type: "rgb", r: n[0], g: n[1], b: n[2] };
|
|
17
|
+
if (format === "rgba" && n.length >= 4)
|
|
18
|
+
return { type: "rgba", r: n[0], g: n[1], b: n[2], a: n[3] };
|
|
19
|
+
if (format === "hsl" && n.length >= 3) return { type: "hsl", h: n[0], s: n[1], l: n[2] };
|
|
20
|
+
if (format === "hsla" && n.length >= 4)
|
|
21
|
+
return { type: "hsla", h: n[0], s: n[1], l: n[2], a: n[3] };
|
|
22
|
+
return null;
|
|
23
|
+
}
|
|
24
|
+
function colorToString(color, format) {
|
|
25
|
+
switch (format) {
|
|
26
|
+
case "hex": {
|
|
27
|
+
const { r, g, b } = color.getRgb();
|
|
28
|
+
const a = color.getRgba().a;
|
|
29
|
+
const hex = `#${[r, g, b].map((v) => Math.round(v).toString(16).padStart(2, "0")).join("")}`;
|
|
30
|
+
return a < 1 ? `${hex}${Math.round(a * 255).toString(16).padStart(2, "0")}` : hex;
|
|
31
|
+
}
|
|
32
|
+
case "rgb": {
|
|
33
|
+
const { r, g, b } = color.getRgb();
|
|
34
|
+
return `rgb(${r}, ${g}, ${b})`;
|
|
35
|
+
}
|
|
36
|
+
case "rgba": {
|
|
37
|
+
const { r, g, b, a } = color.getRgba();
|
|
38
|
+
return `rgba(${r}, ${g}, ${b}, ${a})`;
|
|
39
|
+
}
|
|
40
|
+
case "hsl": {
|
|
41
|
+
const { h, s, l } = color.getHsl();
|
|
42
|
+
return `hsl(${h}, ${s}%, ${l}%)`;
|
|
43
|
+
}
|
|
44
|
+
case "hsla": {
|
|
45
|
+
const { h, s, l, a } = color.getHsla();
|
|
46
|
+
return `hsla(${h}, ${s}%, ${l}%, ${a})`;
|
|
47
|
+
}
|
|
48
|
+
default:
|
|
49
|
+
return color.getHex();
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
var pipetteIcon = /* @__PURE__ */ jsxRuntime.jsx("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", "aria-hidden": "true", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
53
|
+
"path",
|
|
54
|
+
{
|
|
55
|
+
d: "M19.5 3.5a2.12 2.12 0 0 0-3 0l-2.3 2.3-1-1-1.4 1.4 1 1L4 14.9V19h4.1l7.7-7.7 1 1 1.4-1.4-1-1 2.3-2.3a2.12 2.12 0 0 0 0-3ZM7.3 17.6H6v-1.3l6.6-6.6 1.3 1.3-6.6 6.6Z",
|
|
56
|
+
fill: "currentColor"
|
|
57
|
+
}
|
|
58
|
+
) });
|
|
59
|
+
var ColorPicker = ({
|
|
60
|
+
defaultValue = "#3641f5",
|
|
61
|
+
defaultFormat = "hex",
|
|
62
|
+
formats = ALL_FORMATS,
|
|
63
|
+
showInput = true,
|
|
64
|
+
withEyeDropper = false,
|
|
65
|
+
label,
|
|
66
|
+
onChange,
|
|
67
|
+
className,
|
|
68
|
+
...rest
|
|
69
|
+
}) => {
|
|
70
|
+
const [hsva, setHsva] = react.useState(
|
|
71
|
+
() => new reactBeautifulColor.Color({ type: "hex", value: defaultValue }).getHsva()
|
|
72
|
+
);
|
|
73
|
+
const [format, setFormat] = react.useState(defaultFormat);
|
|
74
|
+
const [draft, setDraft] = react.useState(null);
|
|
75
|
+
const [exact, setExact] = react.useState(
|
|
76
|
+
() => ({ format: "hex", value: defaultValue })
|
|
77
|
+
);
|
|
78
|
+
const colorInput = react.useMemo(() => ({ type: "hsva", ...hsva }), [hsva]);
|
|
79
|
+
const currentColor = react.useMemo(() => new reactBeautifulColor.Color(colorInput), [colorInput]);
|
|
80
|
+
const display = exact && exact.format === format ? exact.value : colorToString(currentColor, format);
|
|
81
|
+
const inputValue = draft ?? display;
|
|
82
|
+
const hsvaRef = react.useRef(hsva);
|
|
83
|
+
hsvaRef.current = hsva;
|
|
84
|
+
const formatRef = react.useRef(format);
|
|
85
|
+
formatRef.current = format;
|
|
86
|
+
const onChangeRef = react.useRef(onChange);
|
|
87
|
+
onChangeRef.current = onChange;
|
|
88
|
+
const handlePickerChange = react.useCallback((next) => {
|
|
89
|
+
const nv = next.getHsva();
|
|
90
|
+
const cur = hsvaRef.current;
|
|
91
|
+
if (nv.h === cur.h && nv.s === cur.s && nv.v === cur.v && nv.a === cur.a) return;
|
|
92
|
+
setHsva(nv);
|
|
93
|
+
setExact(null);
|
|
94
|
+
setDraft(null);
|
|
95
|
+
onChangeRef.current?.(colorToString(next, formatRef.current), next);
|
|
96
|
+
}, []);
|
|
97
|
+
const handleFormatChange = (f) => {
|
|
98
|
+
setFormat(f);
|
|
99
|
+
setDraft(null);
|
|
100
|
+
onChange?.(
|
|
101
|
+
exact && exact.format === f ? exact.value : colorToString(currentColor, f),
|
|
102
|
+
currentColor
|
|
103
|
+
);
|
|
104
|
+
};
|
|
105
|
+
const handleInputChange = (text) => {
|
|
106
|
+
setDraft(text);
|
|
107
|
+
const parsed = parseValue(text, format);
|
|
108
|
+
if (parsed) {
|
|
109
|
+
const c = new reactBeautifulColor.Color(parsed);
|
|
110
|
+
setHsva(c.getHsva());
|
|
111
|
+
setExact({ format, value: text.trim() });
|
|
112
|
+
onChange?.(text.trim(), c);
|
|
113
|
+
}
|
|
114
|
+
};
|
|
115
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: chunkYERNSNT4_cjs.cn("w-full max-w-xs", className), ...rest, children: [
|
|
116
|
+
label && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "mb-1.5 block text-sm font-medium text-gray-700 dark:text-gray-400", children: label }),
|
|
117
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
118
|
+
reactBeautifulColor.ColorPicker,
|
|
119
|
+
{
|
|
120
|
+
color: colorInput,
|
|
121
|
+
onChange: handlePickerChange,
|
|
122
|
+
className: "h-auto w-full rounded-2xl border border-gray-200 bg-white p-3 shadow-none dark:border-gray-800 dark:bg-white/[0.03]",
|
|
123
|
+
children: [
|
|
124
|
+
/* @__PURE__ */ jsxRuntime.jsx(reactBeautifulColor.ColorPicker.Saturation, { className: "mb-4 h-40 rounded-lg" }),
|
|
125
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-3", children: [
|
|
126
|
+
withEyeDropper && /* @__PURE__ */ jsxRuntime.jsx(reactBeautifulColor.ColorPicker.EyeDropper, { className: "flex h-9 w-9 shrink-0 items-center justify-center rounded-lg border border-gray-200 text-gray-600 hover:bg-gray-50 dark:border-gray-700 dark:text-gray-300 dark:hover:bg-white/[0.03]", children: pipetteIcon }),
|
|
127
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-1 flex-col gap-3", children: [
|
|
128
|
+
/* @__PURE__ */ jsxRuntime.jsx(reactBeautifulColor.ColorPicker.Hue, { className: "h-4" }),
|
|
129
|
+
/* @__PURE__ */ jsxRuntime.jsx(reactBeautifulColor.ColorPicker.Alpha, { className: "h-4" })
|
|
130
|
+
] })
|
|
131
|
+
] })
|
|
132
|
+
]
|
|
133
|
+
}
|
|
134
|
+
),
|
|
135
|
+
showInput && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "mt-3 flex items-stretch gap-2", children: [
|
|
136
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
137
|
+
"span",
|
|
138
|
+
{
|
|
139
|
+
"aria-hidden": "true",
|
|
140
|
+
className: "h-11 w-11 shrink-0 rounded-lg border border-gray-200 dark:border-gray-700",
|
|
141
|
+
style: { backgroundColor: currentColor.format("rgba") }
|
|
142
|
+
}
|
|
143
|
+
),
|
|
144
|
+
formats.length > 1 && /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "relative shrink-0", children: [
|
|
145
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
146
|
+
"select",
|
|
147
|
+
{
|
|
148
|
+
"aria-label": "Color format",
|
|
149
|
+
value: format,
|
|
150
|
+
onChange: (e) => handleFormatChange(e.target.value),
|
|
151
|
+
className: "h-11 appearance-none rounded-lg border border-gray-300 bg-transparent pl-3 pr-8 text-sm text-gray-700 focus:outline-hidden dark:border-gray-700 dark:text-gray-300",
|
|
152
|
+
children: formats.map((f) => /* @__PURE__ */ jsxRuntime.jsx("option", { value: f, children: f.toUpperCase() }, f))
|
|
153
|
+
}
|
|
154
|
+
),
|
|
155
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
156
|
+
"svg",
|
|
157
|
+
{
|
|
158
|
+
"aria-hidden": "true",
|
|
159
|
+
className: "pointer-events-none absolute right-2.5 top-1/2 -translate-y-1/2 text-gray-500 dark:text-gray-400",
|
|
160
|
+
width: "14",
|
|
161
|
+
height: "14",
|
|
162
|
+
viewBox: "0 0 24 24",
|
|
163
|
+
fill: "none",
|
|
164
|
+
children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "m6 9 6 6 6-6", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" })
|
|
165
|
+
}
|
|
166
|
+
)
|
|
167
|
+
] }),
|
|
168
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
169
|
+
"input",
|
|
170
|
+
{
|
|
171
|
+
"aria-label": "Color value",
|
|
172
|
+
value: inputValue,
|
|
173
|
+
onChange: (e) => handleInputChange(e.target.value),
|
|
174
|
+
onBlur: () => setDraft(null),
|
|
175
|
+
className: "h-11 w-full rounded-lg border border-gray-300 bg-transparent px-3 text-sm text-gray-800 focus:outline-hidden dark:border-gray-700 dark:text-white/90"
|
|
176
|
+
}
|
|
177
|
+
)
|
|
178
|
+
] })
|
|
179
|
+
] });
|
|
180
|
+
};
|
|
181
|
+
|
|
182
|
+
exports.ColorPicker = ColorPicker;
|
|
183
|
+
//# sourceMappingURL=chunk-MYN5LDMO.cjs.map
|
|
184
|
+
//# sourceMappingURL=chunk-MYN5LDMO.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/components/ColorPicker/ColorPicker.tsx"],"names":["jsx","useState","Color","useMemo","useRef","useCallback","jsxs","cn","RBColorPicker"],"mappings":";;;;;;;AA8BA,IAAM,cAAmC,CAAC,KAAA,EAAO,KAAA,EAAO,MAAA,EAAQ,OAAO,MAAM,CAAA;AAG7E,SAAS,UAAA,CAAW,MAAc,MAAA,EAA8C;AAC9E,EAAA,MAAM,CAAA,GAAI,KAAK,IAAA,EAAK;AACpB,EAAA,IAAI,WAAW,KAAA,EAAO;AACpB,IAAA,OAAO,2CAAA,CAA4C,KAAK,CAAC,CAAA,GACrD,EAAE,IAAA,EAAM,KAAA,EAAO,KAAA,EAAO,CAAA,EAAE,GACxB,IAAA;AAAA,EACN;AACA,EAAA,MAAM,CAAA,GAAI,EAAE,KAAA,CAAM,cAAc,GAAG,GAAA,CAAI,MAAM,KAAK,EAAC;AACnD,EAAA,IAAI,MAAA,KAAW,SAAS,CAAA,CAAE,MAAA,IAAU,GAAG,OAAO,EAAE,MAAM,KAAA,EAAO,CAAA,EAAG,EAAE,CAAC,CAAA,EAAG,GAAG,CAAA,CAAE,CAAC,GAAG,CAAA,EAAG,CAAA,CAAE,CAAC,CAAA,EAAE;AACvF,EAAA,IAAI,MAAA,KAAW,MAAA,IAAU,CAAA,CAAE,MAAA,IAAU,CAAA;AACnC,IAA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AA;AAAA,YACV,KAAA,EAAM,IAAA;AAAA,YACN,MAAA,EAAO,IAAA;AAAA,YACP,OAAA,EAAQ,WAAA;AAAA,YACR,IAAA,EAAK,MAAA;AAAA,YAEL,QAAA,kBAAAA,cAAA,CAAC,MAAA,EAAA,EAAK,CAAA,EAAE,cAAA,EAAe,MAAA,EAAO,cAAA,EAAe,WAAA,EAAY,GAAA,EAAI,aAAA,EAAc,OAAA,EAAQ,cAAA,EAAe,OAAA,EAAQ;AAAA;AAAA;AAC5G,OAAA,EACF,CAAA;AAAA,sBAEFA,cAAA;AAAA,QAAC,OAAA;AAAA,QAAA;AAAA,UACC,YAAA,EAAW,aAAA;AAAA,UACX,KAAA,EAAO,UAAA;AAAA,UACP,UAAU,CAAC,CAAA,KAAM,iBAAA,CAAkB,CAAA,CAAE,OAAO,KAAK,CAAA;AAAA,UACjD,MAAA,EAAQ,MAAM,QAAA,CAAS,IAAI,CAAA;AAAA,UAC3B,SAAA,EAAU;AAAA;AAAA;AACZ,KAAA,EACF;AAAA,GAAA,EAEJ,CAAA;AAEJ","file":"chunk-MYN5LDMO.cjs","sourcesContent":["\"use client\";\nimport React, { useCallback, useMemo, useRef, useState } from \"react\";\nimport { ColorPicker as RBColorPicker, Color } from \"react-beautiful-color\";\nimport { cn } from \"../../lib/cn\";\n\n// `react-beautiful-color` doesn't re-export these types from its entry, so\n// derive them from the values its API does expose.\ntype Hsva = ReturnType<Color[\"getHsva\"]>;\ntype ColorInput = ConstructorParameters<typeof Color>[0] & { type: string };\n\nexport type ColorPickerFormat = \"hex\" | \"rgb\" | \"rgba\" | \"hsl\" | \"hsla\";\n\nexport interface ColorPickerProps\n extends Omit<React.HTMLAttributes<HTMLDivElement>, \"onChange\"> {\n /** Initial color (uncontrolled). Any hex string, e.g. `\"#3641f5\"`. */\n defaultValue?: string;\n /** Format selected on first render. Default: `\"hex\"`. */\n defaultFormat?: ColorPickerFormat;\n /** Formats offered in the switcher. Default: all five. */\n formats?: ColorPickerFormat[];\n /** Render the value input + format switcher. Default: `true`. */\n showInput?: boolean;\n /** Show the native eye-dropper button (browser support varies). */\n withEyeDropper?: boolean;\n /** Optional label rendered above the picker. */\n label?: string;\n /** Fires on every change with the formatted string and the `Color` instance. */\n onChange?: (value: string, color: Color) => void;\n}\n\nconst ALL_FORMATS: ColorPickerFormat[] = [\"hex\", \"rgb\", \"rgba\", \"hsl\", \"hsla\"];\n\n/** Parse the text in the input back into a `ColorInput`, or `null` if invalid. */\nfunction parseValue(text: string, format: ColorPickerFormat): ColorInput | null {\n const t = text.trim();\n if (format === \"hex\") {\n return /^#([0-9a-f]{3}|[0-9a-f]{6}|[0-9a-f]{8})$/i.test(t)\n ? { type: \"hex\", value: t }\n : null;\n }\n const n = t.match(/-?\\d*\\.?\\d+/g)?.map(Number) ?? [];\n if (format === \"rgb\" && n.length >= 3) return { type: \"rgb\", r: n[0], g: n[1], b: n[2] };\n if (format === \"rgba\" && n.length >= 4)\n return { type: \"rgba\", r: n[0], g: n[1], b: n[2], a: n[3] };\n if (format === \"hsl\" && n.length >= 3) return { type: \"hsl\", h: n[0], s: n[1], l: n[2] };\n if (format === \"hsla\" && n.length >= 4)\n return { type: \"hsla\", h: n[0], s: n[1], l: n[2], a: n[3] };\n return null;\n}\n\n/** Format a `Color` into the requested CSS string. */\nfunction colorToString(color: Color, format: ColorPickerFormat): string {\n switch (format) {\n case \"hex\": {\n const { r, g, b } = color.getRgb();\n const a = color.getRgba().a;\n const hex = `#${[r, g, b].map((v) => Math.round(v).toString(16).padStart(2, \"0\")).join(\"\")}`;\n return a < 1\n ? `${hex}${Math.round(a * 255).toString(16).padStart(2, \"0\")}`\n : hex;\n }\n case \"rgb\": {\n const { r, g, b } = color.getRgb();\n return `rgb(${r}, ${g}, ${b})`;\n }\n case \"rgba\": {\n const { r, g, b, a } = color.getRgba();\n return `rgba(${r}, ${g}, ${b}, ${a})`;\n }\n case \"hsl\": {\n const { h, s, l } = color.getHsl();\n return `hsl(${h}, ${s}%, ${l}%)`;\n }\n case \"hsla\": {\n const { h, s, l, a } = color.getHsla();\n return `hsla(${h}, ${s}%, ${l}%, ${a})`;\n }\n default:\n return color.getHex();\n }\n}\n\nconst pipetteIcon = (\n <svg width=\"16\" height=\"16\" viewBox=\"0 0 24 24\" fill=\"none\" aria-hidden=\"true\">\n <path\n d=\"M19.5 3.5a2.12 2.12 0 0 0-3 0l-2.3 2.3-1-1-1.4 1.4 1 1L4 14.9V19h4.1l7.7-7.7 1 1 1.4-1.4-1-1 2.3-2.3a2.12 2.12 0 0 0 0-3ZM7.3 17.6H6v-1.3l6.6-6.6 1.3 1.3-6.6 6.6Z\"\n fill=\"currentColor\"\n />\n </svg>\n);\n\nexport const ColorPicker: React.FC<ColorPickerProps> = ({\n defaultValue = \"#3641f5\",\n defaultFormat = \"hex\",\n formats = ALL_FORMATS,\n showInput = true,\n withEyeDropper = false,\n label,\n onChange,\n className,\n ...rest\n}) => {\n // Internal state lives in full-fidelity HSVA — the picker's native space.\n // Feeding anything lossier (e.g. hex) back into the controlled picker makes\n // the knobs fight the cursor (hue/alpha collapse on round-trip), which is\n // why drag would freeze or snap.\n const [hsva, setHsva] = useState<Hsva>(() =>\n new Color({ type: \"hex\", value: defaultValue }).getHsva()\n );\n const [format, setFormat] = useState<ColorPickerFormat>(defaultFormat);\n // While the input is focused we keep a raw draft so partial/invalid typing\n // isn't clobbered by the normalized value.\n const [draft, setDraft] = useState<string | null>(null);\n // HSVA is integer-quantized, so we keep the user's exact text (defaultValue\n // or typed) and show it verbatim until the picker actually changes color.\n const [exact, setExact] = useState<{ format: ColorPickerFormat; value: string } | null>(\n () => ({ format: \"hex\", value: defaultValue })\n );\n\n const colorInput = useMemo(() => ({ type: \"hsva\" as const, ...hsva }), [hsva]);\n const currentColor = useMemo(() => new Color(colorInput), [colorInput]);\n const display =\n exact && exact.format === format ? exact.value : colorToString(currentColor, format);\n const inputValue = draft ?? display;\n\n // The picker's internal drag layer unbinds its document listeners whenever\n // the `onChange` identity changes (its cleanup effect depends on it), which\n // would kill an in-flight drag after the first tick. Keep the handler\n // identity-stable and read mutable values through refs.\n const hsvaRef = useRef(hsva);\n hsvaRef.current = hsva;\n const formatRef = useRef(format);\n formatRef.current = format;\n const onChangeRef = useRef(onChange);\n onChangeRef.current = onChange;\n\n const handlePickerChange = useCallback((next: Color) => {\n const nv = next.getHsva();\n const cur = hsvaRef.current;\n // The picker re-emits the current color on mount; ignore no-op changes so\n // the exact defaultValue isn't clobbered.\n if (nv.h === cur.h && nv.s === cur.s && nv.v === cur.v && nv.a === cur.a) return;\n setHsva(nv);\n setExact(null);\n setDraft(null);\n onChangeRef.current?.(colorToString(next, formatRef.current), next);\n }, []);\n\n const handleFormatChange = (f: ColorPickerFormat) => {\n setFormat(f);\n setDraft(null);\n onChange?.(\n exact && exact.format === f ? exact.value : colorToString(currentColor, f),\n currentColor\n );\n };\n\n const handleInputChange = (text: string) => {\n setDraft(text);\n const parsed = parseValue(text, format);\n if (parsed) {\n const c = new Color(parsed);\n setHsva(c.getHsva());\n setExact({ format, value: text.trim() });\n onChange?.(text.trim(), c);\n }\n };\n\n return (\n <div className={cn(\"w-full max-w-xs\", className)} {...rest}>\n {label && (\n <span className=\"mb-1.5 block text-sm font-medium text-gray-700 dark:text-gray-400\">\n {label}\n </span>\n )}\n <RBColorPicker\n color={colorInput}\n onChange={handlePickerChange}\n className=\"h-auto w-full rounded-2xl border border-gray-200 bg-white p-3 shadow-none dark:border-gray-800 dark:bg-white/[0.03]\"\n >\n {/* no overflow-hidden here: it would clip the drag knobs (24px) beyond\n the track bounds, shrinking their visible/grabbable area */}\n <RBColorPicker.Saturation className=\"mb-4 h-40 rounded-lg\" />\n <div className=\"flex items-center gap-3\">\n {withEyeDropper && (\n <RBColorPicker.EyeDropper className=\"flex h-9 w-9 shrink-0 items-center justify-center rounded-lg border border-gray-200 text-gray-600 hover:bg-gray-50 dark:border-gray-700 dark:text-gray-300 dark:hover:bg-white/[0.03]\">\n {pipetteIcon}\n </RBColorPicker.EyeDropper>\n )}\n <div className=\"flex flex-1 flex-col gap-3\">\n <RBColorPicker.Hue className=\"h-4\" />\n <RBColorPicker.Alpha className=\"h-4\" />\n </div>\n </div>\n </RBColorPicker>\n\n {showInput && (\n <div className=\"mt-3 flex items-stretch gap-2\">\n <span\n aria-hidden=\"true\"\n className=\"h-11 w-11 shrink-0 rounded-lg border border-gray-200 dark:border-gray-700\"\n style={{ backgroundColor: currentColor.format(\"rgba\") }}\n />\n {formats.length > 1 && (\n <span className=\"relative shrink-0\">\n <select\n aria-label=\"Color format\"\n value={format}\n onChange={(e) => handleFormatChange(e.target.value as ColorPickerFormat)}\n className=\"h-11 appearance-none rounded-lg border border-gray-300 bg-transparent pl-3 pr-8 text-sm text-gray-700 focus:outline-hidden dark:border-gray-700 dark:text-gray-300\"\n >\n {formats.map((f) => (\n <option key={f} value={f}>\n {f.toUpperCase()}\n </option>\n ))}\n </select>\n <svg\n aria-hidden=\"true\"\n className=\"pointer-events-none absolute right-2.5 top-1/2 -translate-y-1/2 text-gray-500 dark:text-gray-400\"\n width=\"14\"\n height=\"14\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n >\n <path d=\"m6 9 6 6 6-6\" stroke=\"currentColor\" strokeWidth=\"2\" strokeLinecap=\"round\" strokeLinejoin=\"round\" />\n </svg>\n </span>\n )}\n <input\n aria-label=\"Color value\"\n value={inputValue}\n onChange={(e) => handleInputChange(e.target.value)}\n onBlur={() => setDraft(null)}\n className=\"h-11 w-full rounded-lg border border-gray-300 bg-transparent px-3 text-sm text-gray-800 focus:outline-hidden dark:border-gray-700 dark:text-white/90\"\n />\n </div>\n )}\n </div>\n );\n};\n"]}
|
|
@@ -6,7 +6,15 @@ var defaultOptions = {
|
|
|
6
6
|
legend: {
|
|
7
7
|
show: false,
|
|
8
8
|
position: "top",
|
|
9
|
-
horizontalAlign: "left"
|
|
9
|
+
horizontalAlign: "left",
|
|
10
|
+
// Rounded, border-less swatches (visible when the legend is enabled).
|
|
11
|
+
// ApexCharts sets the marker span's `color` to the series color, so
|
|
12
|
+
// `currentColor` picks it up; `customHTML` rounds the corners.
|
|
13
|
+
markers: {
|
|
14
|
+
size: 7,
|
|
15
|
+
strokeWidth: 0,
|
|
16
|
+
customHTML: () => '<span style="display:block;height:100%;width:100%;border-radius:3px;background:currentColor"></span>'
|
|
17
|
+
}
|
|
10
18
|
},
|
|
11
19
|
colors: ["#465FFF", "#9CB9FF"],
|
|
12
20
|
chart: {
|
|
@@ -142,5 +150,5 @@ var LineChart = ({
|
|
|
142
150
|
};
|
|
143
151
|
|
|
144
152
|
export { LineChart };
|
|
145
|
-
//# sourceMappingURL=chunk-
|
|
146
|
-
//# sourceMappingURL=chunk-
|
|
153
|
+
//# sourceMappingURL=chunk-NWIOJGF7.js.map
|
|
154
|
+
//# sourceMappingURL=chunk-NWIOJGF7.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/components/Charts/LineChart.tsx"],"names":[],"mappings":";;;AAaA,IAAM,cAAA,GAA8B;AAAA,EAClC,MAAA,EAAQ;AAAA,IACN,IAAA,EAAM,KAAA;AAAA,IACN,QAAA,EAAU,KAAA;AAAA,IACV,eAAA,EAAiB,MAAA;AAAA;AAAA;AAAA;AAAA,IAIjB,OAAA,EAAS;AAAA,MACP,IAAA,EAAM,CAAA;AAAA,MACN,WAAA,EAAa,CAAA;AAAA,MACb,YAAY,MACV;AAAA;AACJ,GACF;AAAA,EACA,MAAA,EAAQ,CAAC,SAAA,EAAW,SAAS,CAAA;AAAA,EAC7B,KAAA,EAAO;AAAA,IACL,UAAA,EAAY,oBAAA;AAAA,IACZ,MAAA,EAAQ,GAAA;AAAA,IACR,IAAA,EAAM,MAAA;AAAA,IACN,OAAA,EAAS;AAAA,MACP,IAAA,EAAM;AAAA;AACR,GACF;AAAA,EACA,MAAA,EAAQ;AAAA,IACN,KAAA,EAAO,UAAA;AAAA,IACP,KAAA,EAAO,CAAC,CAAA,EAAG,CAAC;AAAA,GAC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A,IACA,OAAA,EAAS,KAAA,EAAO,UAAA,IAChB,eAAe,KAAA,EAAO;AAAA;AAC1B,GACF;AAEA,EAAA,uBACE,GAAA;AAAA,IAAC,KAAA;AAAA,IAAA;AAAA,MACC,OAAA,EAAS,aAAA;AAAA,MACT,QAAQ,MAAA,IAAU,aAAA;AAAA,MAClB,IAAA,EAAK,MAAA;AAAA,MACL,QAAQ,MAAA,IAAU;AAAA;AAAA,GACpB;AAEJ","file":"chunk-NWIOJGF7.js","sourcesContent":["\"use client\";\nimport React from \"react\";\nimport Chart from \"react-apexcharts\";\nimport type { ApexOptions } from \"apexcharts\";\n\nexport interface LineChartProps {\n series?: ApexAxisChartSeries;\n categories?: string[];\n colors?: string[];\n height?: number;\n options?: ApexOptions;\n}\n\nconst defaultOptions: ApexOptions = {\n legend: {\n show: false,\n position: \"top\",\n horizontalAlign: \"left\",\n // Rounded, border-less swatches (visible when the legend is enabled).\n // ApexCharts sets the marker span's `color` to the series color, so\n // `currentColor` picks it up; `customHTML` rounds the corners.\n markers: {\n size: 7,\n strokeWidth: 0,\n customHTML: () =>\n '<span style=\"display:block;height:100%;width:100%;border-radius:3px;background:currentColor\"></span>',\n },\n },\n colors: [\"#465FFF\", \"#9CB9FF\"],\n chart: {\n fontFamily: \"Outfit, sans-serif\",\n height: 310,\n type: \"line\",\n toolbar: {\n show: false,\n },\n },\n stroke: {\n curve: \"straight\",\n width: [2, 2],\n },\n fill: {\n type: \"gradient\",\n gradient: {\n opacityFrom: 0.55,\n opacityTo: 0,\n },\n },\n markers: {\n size: 0,\n strokeColors: \"#fff\",\n strokeWidth: 2,\n hover: {\n size: 6,\n },\n },\n grid: {\n xaxis: {\n lines: {\n show: false,\n },\n },\n yaxis: {\n lines: {\n show: true,\n },\n },\n },\n dataLabels: {\n enabled: false,\n },\n tooltip: {\n enabled: true,\n x: {\n format: \"dd MMM yyyy\",\n },\n },\n xaxis: {\n type: \"category\",\n categories: [\n \"Jan\",\n \"Feb\",\n \"Mar\",\n \"Apr\",\n \"May\",\n \"Jun\",\n \"Jul\",\n \"Aug\",\n \"Sep\",\n \"Oct\",\n \"Nov\",\n \"Dec\",\n ],\n axisBorder: {\n show: false,\n },\n axisTicks: {\n show: false,\n },\n tooltip: {\n enabled: false,\n },\n },\n yaxis: {\n labels: {\n style: {\n fontSize: \"12px\",\n colors: [\"#6B7280\"],\n },\n },\n title: {\n text: \"\",\n style: {\n fontSize: \"0px\",\n },\n },\n },\n};\n\nconst defaultSeries: ApexAxisChartSeries = [\n {\n name: \"Sales\",\n data: [180, 190, 170, 160, 175, 165, 170, 205, 230, 210, 240, 235],\n },\n {\n name: \"Revenue\",\n data: [40, 30, 50, 40, 55, 40, 70, 100, 110, 120, 150, 140],\n },\n];\n\nexport const LineChart: React.FC<LineChartProps> = ({\n series,\n categories,\n colors,\n height,\n options,\n}) => {\n const mergedOptions: ApexOptions = {\n ...defaultOptions,\n ...options,\n colors: colors ?? options?.colors ?? defaultOptions.colors,\n chart: {\n ...defaultOptions.chart,\n ...options?.chart,\n height: height ?? options?.chart?.height ?? defaultOptions.chart?.height,\n },\n xaxis: {\n ...defaultOptions.xaxis,\n ...options?.xaxis,\n categories:\n categories ??\n options?.xaxis?.categories ??\n defaultOptions.xaxis?.categories,\n },\n };\n\n return (\n <Chart\n options={mergedOptions}\n series={series ?? defaultSeries}\n type=\"area\"\n height={height ?? 310}\n />\n );\n};\n"]}
|
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { cn } from './chunk-ZLIYUUA4.js';
|
|
3
|
+
import { useState, useMemo, useRef, useCallback } from 'react';
|
|
4
|
+
import { Color, ColorPicker as ColorPicker$1 } from 'react-beautiful-color';
|
|
5
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
6
|
+
|
|
7
|
+
var ALL_FORMATS = ["hex", "rgb", "rgba", "hsl", "hsla"];
|
|
8
|
+
function parseValue(text, format) {
|
|
9
|
+
const t = text.trim();
|
|
10
|
+
if (format === "hex") {
|
|
11
|
+
return /^#([0-9a-f]{3}|[0-9a-f]{6}|[0-9a-f]{8})$/i.test(t) ? { type: "hex", value: t } : null;
|
|
12
|
+
}
|
|
13
|
+
const n = t.match(/-?\d*\.?\d+/g)?.map(Number) ?? [];
|
|
14
|
+
if (format === "rgb" && n.length >= 3) return { type: "rgb", r: n[0], g: n[1], b: n[2] };
|
|
15
|
+
if (format === "rgba" && n.length >= 4)
|
|
16
|
+
return { type: "rgba", r: n[0], g: n[1], b: n[2], a: n[3] };
|
|
17
|
+
if (format === "hsl" && n.length >= 3) return { type: "hsl", h: n[0], s: n[1], l: n[2] };
|
|
18
|
+
if (format === "hsla" && n.length >= 4)
|
|
19
|
+
return { type: "hsla", h: n[0], s: n[1], l: n[2], a: n[3] };
|
|
20
|
+
return null;
|
|
21
|
+
}
|
|
22
|
+
function colorToString(color, format) {
|
|
23
|
+
switch (format) {
|
|
24
|
+
case "hex": {
|
|
25
|
+
const { r, g, b } = color.getRgb();
|
|
26
|
+
const a = color.getRgba().a;
|
|
27
|
+
const hex = `#${[r, g, b].map((v) => Math.round(v).toString(16).padStart(2, "0")).join("")}`;
|
|
28
|
+
return a < 1 ? `${hex}${Math.round(a * 255).toString(16).padStart(2, "0")}` : hex;
|
|
29
|
+
}
|
|
30
|
+
case "rgb": {
|
|
31
|
+
const { r, g, b } = color.getRgb();
|
|
32
|
+
return `rgb(${r}, ${g}, ${b})`;
|
|
33
|
+
}
|
|
34
|
+
case "rgba": {
|
|
35
|
+
const { r, g, b, a } = color.getRgba();
|
|
36
|
+
return `rgba(${r}, ${g}, ${b}, ${a})`;
|
|
37
|
+
}
|
|
38
|
+
case "hsl": {
|
|
39
|
+
const { h, s, l } = color.getHsl();
|
|
40
|
+
return `hsl(${h}, ${s}%, ${l}%)`;
|
|
41
|
+
}
|
|
42
|
+
case "hsla": {
|
|
43
|
+
const { h, s, l, a } = color.getHsla();
|
|
44
|
+
return `hsla(${h}, ${s}%, ${l}%, ${a})`;
|
|
45
|
+
}
|
|
46
|
+
default:
|
|
47
|
+
return color.getHex();
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
var pipetteIcon = /* @__PURE__ */ jsx("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", "aria-hidden": "true", children: /* @__PURE__ */ jsx(
|
|
51
|
+
"path",
|
|
52
|
+
{
|
|
53
|
+
d: "M19.5 3.5a2.12 2.12 0 0 0-3 0l-2.3 2.3-1-1-1.4 1.4 1 1L4 14.9V19h4.1l7.7-7.7 1 1 1.4-1.4-1-1 2.3-2.3a2.12 2.12 0 0 0 0-3ZM7.3 17.6H6v-1.3l6.6-6.6 1.3 1.3-6.6 6.6Z",
|
|
54
|
+
fill: "currentColor"
|
|
55
|
+
}
|
|
56
|
+
) });
|
|
57
|
+
var ColorPicker = ({
|
|
58
|
+
defaultValue = "#3641f5",
|
|
59
|
+
defaultFormat = "hex",
|
|
60
|
+
formats = ALL_FORMATS,
|
|
61
|
+
showInput = true,
|
|
62
|
+
withEyeDropper = false,
|
|
63
|
+
label,
|
|
64
|
+
onChange,
|
|
65
|
+
className,
|
|
66
|
+
...rest
|
|
67
|
+
}) => {
|
|
68
|
+
const [hsva, setHsva] = useState(
|
|
69
|
+
() => new Color({ type: "hex", value: defaultValue }).getHsva()
|
|
70
|
+
);
|
|
71
|
+
const [format, setFormat] = useState(defaultFormat);
|
|
72
|
+
const [draft, setDraft] = useState(null);
|
|
73
|
+
const [exact, setExact] = useState(
|
|
74
|
+
() => ({ format: "hex", value: defaultValue })
|
|
75
|
+
);
|
|
76
|
+
const colorInput = useMemo(() => ({ type: "hsva", ...hsva }), [hsva]);
|
|
77
|
+
const currentColor = useMemo(() => new Color(colorInput), [colorInput]);
|
|
78
|
+
const display = exact && exact.format === format ? exact.value : colorToString(currentColor, format);
|
|
79
|
+
const inputValue = draft ?? display;
|
|
80
|
+
const hsvaRef = useRef(hsva);
|
|
81
|
+
hsvaRef.current = hsva;
|
|
82
|
+
const formatRef = useRef(format);
|
|
83
|
+
formatRef.current = format;
|
|
84
|
+
const onChangeRef = useRef(onChange);
|
|
85
|
+
onChangeRef.current = onChange;
|
|
86
|
+
const handlePickerChange = useCallback((next) => {
|
|
87
|
+
const nv = next.getHsva();
|
|
88
|
+
const cur = hsvaRef.current;
|
|
89
|
+
if (nv.h === cur.h && nv.s === cur.s && nv.v === cur.v && nv.a === cur.a) return;
|
|
90
|
+
setHsva(nv);
|
|
91
|
+
setExact(null);
|
|
92
|
+
setDraft(null);
|
|
93
|
+
onChangeRef.current?.(colorToString(next, formatRef.current), next);
|
|
94
|
+
}, []);
|
|
95
|
+
const handleFormatChange = (f) => {
|
|
96
|
+
setFormat(f);
|
|
97
|
+
setDraft(null);
|
|
98
|
+
onChange?.(
|
|
99
|
+
exact && exact.format === f ? exact.value : colorToString(currentColor, f),
|
|
100
|
+
currentColor
|
|
101
|
+
);
|
|
102
|
+
};
|
|
103
|
+
const handleInputChange = (text) => {
|
|
104
|
+
setDraft(text);
|
|
105
|
+
const parsed = parseValue(text, format);
|
|
106
|
+
if (parsed) {
|
|
107
|
+
const c = new Color(parsed);
|
|
108
|
+
setHsva(c.getHsva());
|
|
109
|
+
setExact({ format, value: text.trim() });
|
|
110
|
+
onChange?.(text.trim(), c);
|
|
111
|
+
}
|
|
112
|
+
};
|
|
113
|
+
return /* @__PURE__ */ jsxs("div", { className: cn("w-full max-w-xs", className), ...rest, children: [
|
|
114
|
+
label && /* @__PURE__ */ jsx("span", { className: "mb-1.5 block text-sm font-medium text-gray-700 dark:text-gray-400", children: label }),
|
|
115
|
+
/* @__PURE__ */ jsxs(
|
|
116
|
+
ColorPicker$1,
|
|
117
|
+
{
|
|
118
|
+
color: colorInput,
|
|
119
|
+
onChange: handlePickerChange,
|
|
120
|
+
className: "h-auto w-full rounded-2xl border border-gray-200 bg-white p-3 shadow-none dark:border-gray-800 dark:bg-white/[0.03]",
|
|
121
|
+
children: [
|
|
122
|
+
/* @__PURE__ */ jsx(ColorPicker$1.Saturation, { className: "mb-4 h-40 rounded-lg" }),
|
|
123
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-3", children: [
|
|
124
|
+
withEyeDropper && /* @__PURE__ */ jsx(ColorPicker$1.EyeDropper, { className: "flex h-9 w-9 shrink-0 items-center justify-center rounded-lg border border-gray-200 text-gray-600 hover:bg-gray-50 dark:border-gray-700 dark:text-gray-300 dark:hover:bg-white/[0.03]", children: pipetteIcon }),
|
|
125
|
+
/* @__PURE__ */ jsxs("div", { className: "flex flex-1 flex-col gap-3", children: [
|
|
126
|
+
/* @__PURE__ */ jsx(ColorPicker$1.Hue, { className: "h-4" }),
|
|
127
|
+
/* @__PURE__ */ jsx(ColorPicker$1.Alpha, { className: "h-4" })
|
|
128
|
+
] })
|
|
129
|
+
] })
|
|
130
|
+
]
|
|
131
|
+
}
|
|
132
|
+
),
|
|
133
|
+
showInput && /* @__PURE__ */ jsxs("div", { className: "mt-3 flex items-stretch gap-2", children: [
|
|
134
|
+
/* @__PURE__ */ jsx(
|
|
135
|
+
"span",
|
|
136
|
+
{
|
|
137
|
+
"aria-hidden": "true",
|
|
138
|
+
className: "h-11 w-11 shrink-0 rounded-lg border border-gray-200 dark:border-gray-700",
|
|
139
|
+
style: { backgroundColor: currentColor.format("rgba") }
|
|
140
|
+
}
|
|
141
|
+
),
|
|
142
|
+
formats.length > 1 && /* @__PURE__ */ jsxs("span", { className: "relative shrink-0", children: [
|
|
143
|
+
/* @__PURE__ */ jsx(
|
|
144
|
+
"select",
|
|
145
|
+
{
|
|
146
|
+
"aria-label": "Color format",
|
|
147
|
+
value: format,
|
|
148
|
+
onChange: (e) => handleFormatChange(e.target.value),
|
|
149
|
+
className: "h-11 appearance-none rounded-lg border border-gray-300 bg-transparent pl-3 pr-8 text-sm text-gray-700 focus:outline-hidden dark:border-gray-700 dark:text-gray-300",
|
|
150
|
+
children: formats.map((f) => /* @__PURE__ */ jsx("option", { value: f, children: f.toUpperCase() }, f))
|
|
151
|
+
}
|
|
152
|
+
),
|
|
153
|
+
/* @__PURE__ */ jsx(
|
|
154
|
+
"svg",
|
|
155
|
+
{
|
|
156
|
+
"aria-hidden": "true",
|
|
157
|
+
className: "pointer-events-none absolute right-2.5 top-1/2 -translate-y-1/2 text-gray-500 dark:text-gray-400",
|
|
158
|
+
width: "14",
|
|
159
|
+
height: "14",
|
|
160
|
+
viewBox: "0 0 24 24",
|
|
161
|
+
fill: "none",
|
|
162
|
+
children: /* @__PURE__ */ jsx("path", { d: "m6 9 6 6 6-6", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" })
|
|
163
|
+
}
|
|
164
|
+
)
|
|
165
|
+
] }),
|
|
166
|
+
/* @__PURE__ */ jsx(
|
|
167
|
+
"input",
|
|
168
|
+
{
|
|
169
|
+
"aria-label": "Color value",
|
|
170
|
+
value: inputValue,
|
|
171
|
+
onChange: (e) => handleInputChange(e.target.value),
|
|
172
|
+
onBlur: () => setDraft(null),
|
|
173
|
+
className: "h-11 w-full rounded-lg border border-gray-300 bg-transparent px-3 text-sm text-gray-800 focus:outline-hidden dark:border-gray-700 dark:text-white/90"
|
|
174
|
+
}
|
|
175
|
+
)
|
|
176
|
+
] })
|
|
177
|
+
] });
|
|
178
|
+
};
|
|
179
|
+
|
|
180
|
+
export { ColorPicker };
|
|
181
|
+
//# sourceMappingURL=chunk-P7LI2FSR.js.map
|
|
182
|
+
//# sourceMappingURL=chunk-P7LI2FSR.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/components/ColorPicker/ColorPicker.tsx"],"names":["RBColorPicker"],"mappings":";;;;;AA8BA,IAAM,cAAmC,CAAC,KAAA,EAAO,KAAA,EAAO,MAAA,EAAQ,OAAO,MAAM,CAAA;AAG7E,SAAS,UAAA,CAAW,MAAc,MAAA,EAA8C;AAC9E,EAAA,MAAM,CAAA,GAAI,KAAK,IAAA,EAAK;AACpB,EAAA,IAAI,WAAW,KAAA,EAAO;AACpB,IAAA,OAAO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A;AAAA,YACX,KAAA,EAAO,MAAA;AAAA,YACP,UAAU,CAAC,CAAA,KAAM,kBAAA,CAAmB,CAAA,CAAE,OAAO,KAA0B,CAAA;AAAA,YACvE,SAAA,EAAU,oKAAA;AAAA,YAET,QAAA,EAAA,OAAA,CAAQ,GAAA,CAAI,CAAC,CAAA,qBACZ,GAAA,CAAC,QAAA,EAAA,EAAe,KAAA,EAAO,CAAA,EACpB,QAAA,EAAA,CAAA,CAAE,WAAA,EAAY,EAAA,EADJ,CAEb,CACD;AAAA;AAAA,SACH;AAAA,wBACA,GAAA;AAAA,UAAC,KAAA;AAAA,UAAA;AAAA,YACC,aAAA,EAAY,MAAA;AAAA,YACZ,SAAA,EAAU,kGAAA;AAAA,YACV,KAAA,EAAM,IAAA;AAAA,YACN,MAAA,EAAO,IAAA;AAAA,YACP,OAAA,EAAQ,WAAA;AAAA,YACR,IAAA,EAAK,MAAA;AAAA,YAEL,QAAA,kBAAA,GAAA,CAAC,MAAA,EAAA,EAAK,CAAA,EAAE,cAAA,EAAe,MAAA,EAAO,cAAA,EAAe,WAAA,EAAY,GAAA,EAAI,aAAA,EAAc,OAAA,EAAQ,cAAA,EAAe,OAAA,EAAQ;AAAA;AAAA;AAC5G,OAAA,EACF,CAAA;AAAA,sBAEF,GAAA;AAAA,QAAC,OAAA;AAAA,QAAA;AAAA,UACC,YAAA,EAAW,aAAA;AAAA,UACX,KAAA,EAAO,UAAA;AAAA,UACP,UAAU,CAAC,CAAA,KAAM,iBAAA,CAAkB,CAAA,CAAE,OAAO,KAAK,CAAA;AAAA,UACjD,MAAA,EAAQ,MAAM,QAAA,CAAS,IAAI,CAAA;AAAA,UAC3B,SAAA,EAAU;AAAA;AAAA;AACZ,KAAA,EACF;AAAA,GAAA,EAEJ,CAAA;AAEJ","file":"chunk-P7LI2FSR.js","sourcesContent":["\"use client\";\nimport React, { useCallback, useMemo, useRef, useState } from \"react\";\nimport { ColorPicker as RBColorPicker, Color } from \"react-beautiful-color\";\nimport { cn } from \"../../lib/cn\";\n\n// `react-beautiful-color` doesn't re-export these types from its entry, so\n// derive them from the values its API does expose.\ntype Hsva = ReturnType<Color[\"getHsva\"]>;\ntype ColorInput = ConstructorParameters<typeof Color>[0] & { type: string };\n\nexport type ColorPickerFormat = \"hex\" | \"rgb\" | \"rgba\" | \"hsl\" | \"hsla\";\n\nexport interface ColorPickerProps\n extends Omit<React.HTMLAttributes<HTMLDivElement>, \"onChange\"> {\n /** Initial color (uncontrolled). Any hex string, e.g. `\"#3641f5\"`. */\n defaultValue?: string;\n /** Format selected on first render. Default: `\"hex\"`. */\n defaultFormat?: ColorPickerFormat;\n /** Formats offered in the switcher. Default: all five. */\n formats?: ColorPickerFormat[];\n /** Render the value input + format switcher. Default: `true`. */\n showInput?: boolean;\n /** Show the native eye-dropper button (browser support varies). */\n withEyeDropper?: boolean;\n /** Optional label rendered above the picker. */\n label?: string;\n /** Fires on every change with the formatted string and the `Color` instance. */\n onChange?: (value: string, color: Color) => void;\n}\n\nconst ALL_FORMATS: ColorPickerFormat[] = [\"hex\", \"rgb\", \"rgba\", \"hsl\", \"hsla\"];\n\n/** Parse the text in the input back into a `ColorInput`, or `null` if invalid. */\nfunction parseValue(text: string, format: ColorPickerFormat): ColorInput | null {\n const t = text.trim();\n if (format === \"hex\") {\n return /^#([0-9a-f]{3}|[0-9a-f]{6}|[0-9a-f]{8})$/i.test(t)\n ? { type: \"hex\", value: t }\n : null;\n }\n const n = t.match(/-?\\d*\\.?\\d+/g)?.map(Number) ?? [];\n if (format === \"rgb\" && n.length >= 3) return { type: \"rgb\", r: n[0], g: n[1], b: n[2] };\n if (format === \"rgba\" && n.length >= 4)\n return { type: \"rgba\", r: n[0], g: n[1], b: n[2], a: n[3] };\n if (format === \"hsl\" && n.length >= 3) return { type: \"hsl\", h: n[0], s: n[1], l: n[2] };\n if (format === \"hsla\" && n.length >= 4)\n return { type: \"hsla\", h: n[0], s: n[1], l: n[2], a: n[3] };\n return null;\n}\n\n/** Format a `Color` into the requested CSS string. */\nfunction colorToString(color: Color, format: ColorPickerFormat): string {\n switch (format) {\n case \"hex\": {\n const { r, g, b } = color.getRgb();\n const a = color.getRgba().a;\n const hex = `#${[r, g, b].map((v) => Math.round(v).toString(16).padStart(2, \"0\")).join(\"\")}`;\n return a < 1\n ? `${hex}${Math.round(a * 255).toString(16).padStart(2, \"0\")}`\n : hex;\n }\n case \"rgb\": {\n const { r, g, b } = color.getRgb();\n return `rgb(${r}, ${g}, ${b})`;\n }\n case \"rgba\": {\n const { r, g, b, a } = color.getRgba();\n return `rgba(${r}, ${g}, ${b}, ${a})`;\n }\n case \"hsl\": {\n const { h, s, l } = color.getHsl();\n return `hsl(${h}, ${s}%, ${l}%)`;\n }\n case \"hsla\": {\n const { h, s, l, a } = color.getHsla();\n return `hsla(${h}, ${s}%, ${l}%, ${a})`;\n }\n default:\n return color.getHex();\n }\n}\n\nconst pipetteIcon = (\n <svg width=\"16\" height=\"16\" viewBox=\"0 0 24 24\" fill=\"none\" aria-hidden=\"true\">\n <path\n d=\"M19.5 3.5a2.12 2.12 0 0 0-3 0l-2.3 2.3-1-1-1.4 1.4 1 1L4 14.9V19h4.1l7.7-7.7 1 1 1.4-1.4-1-1 2.3-2.3a2.12 2.12 0 0 0 0-3ZM7.3 17.6H6v-1.3l6.6-6.6 1.3 1.3-6.6 6.6Z\"\n fill=\"currentColor\"\n />\n </svg>\n);\n\nexport const ColorPicker: React.FC<ColorPickerProps> = ({\n defaultValue = \"#3641f5\",\n defaultFormat = \"hex\",\n formats = ALL_FORMATS,\n showInput = true,\n withEyeDropper = false,\n label,\n onChange,\n className,\n ...rest\n}) => {\n // Internal state lives in full-fidelity HSVA — the picker's native space.\n // Feeding anything lossier (e.g. hex) back into the controlled picker makes\n // the knobs fight the cursor (hue/alpha collapse on round-trip), which is\n // why drag would freeze or snap.\n const [hsva, setHsva] = useState<Hsva>(() =>\n new Color({ type: \"hex\", value: defaultValue }).getHsva()\n );\n const [format, setFormat] = useState<ColorPickerFormat>(defaultFormat);\n // While the input is focused we keep a raw draft so partial/invalid typing\n // isn't clobbered by the normalized value.\n const [draft, setDraft] = useState<string | null>(null);\n // HSVA is integer-quantized, so we keep the user's exact text (defaultValue\n // or typed) and show it verbatim until the picker actually changes color.\n const [exact, setExact] = useState<{ format: ColorPickerFormat; value: string } | null>(\n () => ({ format: \"hex\", value: defaultValue })\n );\n\n const colorInput = useMemo(() => ({ type: \"hsva\" as const, ...hsva }), [hsva]);\n const currentColor = useMemo(() => new Color(colorInput), [colorInput]);\n const display =\n exact && exact.format === format ? exact.value : colorToString(currentColor, format);\n const inputValue = draft ?? display;\n\n // The picker's internal drag layer unbinds its document listeners whenever\n // the `onChange` identity changes (its cleanup effect depends on it), which\n // would kill an in-flight drag after the first tick. Keep the handler\n // identity-stable and read mutable values through refs.\n const hsvaRef = useRef(hsva);\n hsvaRef.current = hsva;\n const formatRef = useRef(format);\n formatRef.current = format;\n const onChangeRef = useRef(onChange);\n onChangeRef.current = onChange;\n\n const handlePickerChange = useCallback((next: Color) => {\n const nv = next.getHsva();\n const cur = hsvaRef.current;\n // The picker re-emits the current color on mount; ignore no-op changes so\n // the exact defaultValue isn't clobbered.\n if (nv.h === cur.h && nv.s === cur.s && nv.v === cur.v && nv.a === cur.a) return;\n setHsva(nv);\n setExact(null);\n setDraft(null);\n onChangeRef.current?.(colorToString(next, formatRef.current), next);\n }, []);\n\n const handleFormatChange = (f: ColorPickerFormat) => {\n setFormat(f);\n setDraft(null);\n onChange?.(\n exact && exact.format === f ? exact.value : colorToString(currentColor, f),\n currentColor\n );\n };\n\n const handleInputChange = (text: string) => {\n setDraft(text);\n const parsed = parseValue(text, format);\n if (parsed) {\n const c = new Color(parsed);\n setHsva(c.getHsva());\n setExact({ format, value: text.trim() });\n onChange?.(text.trim(), c);\n }\n };\n\n return (\n <div className={cn(\"w-full max-w-xs\", className)} {...rest}>\n {label && (\n <span className=\"mb-1.5 block text-sm font-medium text-gray-700 dark:text-gray-400\">\n {label}\n </span>\n )}\n <RBColorPicker\n color={colorInput}\n onChange={handlePickerChange}\n className=\"h-auto w-full rounded-2xl border border-gray-200 bg-white p-3 shadow-none dark:border-gray-800 dark:bg-white/[0.03]\"\n >\n {/* no overflow-hidden here: it would clip the drag knobs (24px) beyond\n the track bounds, shrinking their visible/grabbable area */}\n <RBColorPicker.Saturation className=\"mb-4 h-40 rounded-lg\" />\n <div className=\"flex items-center gap-3\">\n {withEyeDropper && (\n <RBColorPicker.EyeDropper className=\"flex h-9 w-9 shrink-0 items-center justify-center rounded-lg border border-gray-200 text-gray-600 hover:bg-gray-50 dark:border-gray-700 dark:text-gray-300 dark:hover:bg-white/[0.03]\">\n {pipetteIcon}\n </RBColorPicker.EyeDropper>\n )}\n <div className=\"flex flex-1 flex-col gap-3\">\n <RBColorPicker.Hue className=\"h-4\" />\n <RBColorPicker.Alpha className=\"h-4\" />\n </div>\n </div>\n </RBColorPicker>\n\n {showInput && (\n <div className=\"mt-3 flex items-stretch gap-2\">\n <span\n aria-hidden=\"true\"\n className=\"h-11 w-11 shrink-0 rounded-lg border border-gray-200 dark:border-gray-700\"\n style={{ backgroundColor: currentColor.format(\"rgba\") }}\n />\n {formats.length > 1 && (\n <span className=\"relative shrink-0\">\n <select\n aria-label=\"Color format\"\n value={format}\n onChange={(e) => handleFormatChange(e.target.value as ColorPickerFormat)}\n className=\"h-11 appearance-none rounded-lg border border-gray-300 bg-transparent pl-3 pr-8 text-sm text-gray-700 focus:outline-hidden dark:border-gray-700 dark:text-gray-300\"\n >\n {formats.map((f) => (\n <option key={f} value={f}>\n {f.toUpperCase()}\n </option>\n ))}\n </select>\n <svg\n aria-hidden=\"true\"\n className=\"pointer-events-none absolute right-2.5 top-1/2 -translate-y-1/2 text-gray-500 dark:text-gray-400\"\n width=\"14\"\n height=\"14\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n >\n <path d=\"m6 9 6 6 6-6\" stroke=\"currentColor\" strokeWidth=\"2\" strokeLinecap=\"round\" strokeLinejoin=\"round\" />\n </svg>\n </span>\n )}\n <input\n aria-label=\"Color value\"\n value={inputValue}\n onChange={(e) => handleInputChange(e.target.value)}\n onBlur={() => setDraft(null)}\n className=\"h-11 w-full rounded-lg border border-gray-300 bg-transparent px-3 text-sm text-gray-800 focus:outline-hidden dark:border-gray-700 dark:text-white/90\"\n />\n </div>\n )}\n </div>\n );\n};\n"]}
|