chesai-ui 0.16.3 → 0.16.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chesai-ui.css +1 -1
- package/dist/components/charts/bar-chart.d.ts +3 -1
- package/dist/components/charts/bar-chart.mjs +87 -74
- package/dist/components/charts/chart-utils.d.ts +7 -0
- package/dist/components/charts/chart-utils.mjs +24 -7
- package/dist/components/charts/heatmap-chart.d.ts +25 -0
- package/dist/components/playlist-studio/elements.d.ts +10 -2
- package/dist/components/playlist-studio/elements.mjs +289 -120
- package/dist/components/playlist-studio/index.d.ts +1 -0
- package/dist/components/playlist-studio/item-renderer.d.ts +2 -1
- package/dist/components/playlist-studio/item-renderer.mjs +66 -55
- package/dist/components/playlist-studio/player.d.ts +3 -1
- package/dist/components/playlist-studio/player.mjs +438 -71
- package/dist/components/playlist-studio/preload-context.d.ts +8 -0
- package/dist/components/playlist-studio/preload-context.mjs +6 -0
- package/dist/components/playlist-studio/types.d.ts +3 -0
- package/dist/components/textarea/textarea-styles.mjs +4 -4
- package/dist/components/textarea/use-textarea.d.ts +2 -2
- package/dist/components/textarea/use-textarea.mjs +72 -69
- package/dist/context/ChesaiProvider.d.ts +5 -1
- package/dist/context/ChesaiProvider.mjs +28 -24
- package/dist/context/ThemeProvider.d.ts +5 -1
- package/dist/context/ThemeProvider.mjs +130 -112
- package/dist/context/heatmap-chart.d.ts +25 -0
- package/dist/index.mjs +67 -63
- package/dist/utils/theme-generator.d.ts +1 -1
- package/dist/utils/theme-generator.mjs +39 -39
- package/package.json +1 -1
|
@@ -10,5 +10,7 @@ export interface BarChartProps extends ChartProps {
|
|
|
10
10
|
highlightShape?: ShapeType;
|
|
11
11
|
/** Custom overlay icon centered in the badge. Defaults to a checkmark. */
|
|
12
12
|
highlightIcon?: React.ReactNode;
|
|
13
|
+
/** Show a distinctive baseline reference line at y = 0 */
|
|
14
|
+
showBaseline?: boolean;
|
|
13
15
|
}
|
|
14
|
-
export declare const BarChart: ({ data, categories, index, variant, shape, colors, height, className, valueFormatter, scrollable, minWidth, highlightKey, highlightColor, highlightShape, highlightIcon, }: BarChartProps) => import("react/jsx-runtime").JSX.Element;
|
|
16
|
+
export declare const BarChart: ({ data, categories, index, variant, shape, colors, height, className, valueFormatter, scrollable, minWidth, highlightKey, highlightColor, highlightShape, highlightIcon, showBaseline, }: BarChartProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,33 +1,37 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { ResponsiveContainer as
|
|
3
|
-
import { ChartTooltip as
|
|
4
|
-
import { chartGridConfig as
|
|
5
|
-
import { clsx as
|
|
6
|
-
import { motion as
|
|
7
|
-
import { SHAPE_PATHS as
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
1
|
+
import { jsx as t, jsxs as b } from "react/jsx-runtime";
|
|
2
|
+
import { ResponsiveContainer as R, BarChart as z, CartesianGrid as M, XAxis as W, YAxis as O, Tooltip as X, ReferenceLine as U, Bar as V, Cell as Y } from "recharts";
|
|
3
|
+
import { ChartTooltip as Z } from "./chart-tooltip.mjs";
|
|
4
|
+
import { chartGridConfig as q, chartAxisConfig as C, getColorForIndex as J, EASE_EXPRESSIVE_DEFAULT_SPATIAL as Q, EASE_EMPHASIZED as K } from "./chart-utils.mjs";
|
|
5
|
+
import { clsx as tt } from "clsx";
|
|
6
|
+
import { motion as rt } from "framer-motion";
|
|
7
|
+
import { SHAPE_PATHS as E } from "../shape/paths.mjs";
|
|
8
|
+
import { useTheme as et } from "../../context/ThemeProvider.mjs";
|
|
9
|
+
const ft = ({
|
|
10
|
+
data: d,
|
|
11
|
+
categories: A,
|
|
12
|
+
index: S,
|
|
13
|
+
variant: m = "primary",
|
|
14
|
+
shape: h = "minimal",
|
|
15
|
+
colors: w,
|
|
16
|
+
height: k = 300,
|
|
16
17
|
className: H,
|
|
17
|
-
valueFormatter:
|
|
18
|
-
scrollable:
|
|
19
|
-
minWidth:
|
|
20
|
-
highlightKey:
|
|
21
|
-
highlightColor:
|
|
22
|
-
highlightShape:
|
|
23
|
-
highlightIcon: p
|
|
18
|
+
valueFormatter: L = (r) => `${r}`,
|
|
19
|
+
scrollable: f = !1,
|
|
20
|
+
minWidth: N = 500,
|
|
21
|
+
highlightKey: i,
|
|
22
|
+
highlightColor: B = "var(--md-sys-color-tertiary, #4ADE80)",
|
|
23
|
+
highlightShape: u = "flower",
|
|
24
|
+
highlightIcon: p,
|
|
25
|
+
showBaseline: P = !1
|
|
24
26
|
}) => {
|
|
25
|
-
const
|
|
26
|
-
const { x:
|
|
27
|
-
if (!(
|
|
28
|
-
const
|
|
29
|
-
|
|
30
|
-
|
|
27
|
+
const r = m === "ghost", g = m === "secondary", { animationStyle: T } = et(), x = T === "expressive", _ = x ? Q : K, $ = x ? 1e3 : 550, j = () => h === "sharp" ? [0, 0, 0, 0] : h === "full" ? [999, 999, 999, 999] : [4, 4, 4, 4], D = (a) => {
|
|
28
|
+
const { x: o, y: l, width: n, height: s, value: v, index: c } = a, F = d[c];
|
|
29
|
+
if (!(i ? !!F[i] : !1) || r || s === 0) return null;
|
|
30
|
+
const e = Math.min(n * 0.75, 32), G = o + n / 2 - e / 2, y = v < 0 ? l + s - e - 6 : l + 6;
|
|
31
|
+
if (s < e + 12) return null;
|
|
32
|
+
const I = u ? E[u] : E.flower;
|
|
33
|
+
return /* @__PURE__ */ t(
|
|
34
|
+
rt.g,
|
|
31
35
|
{
|
|
32
36
|
className: "pointer-events-none",
|
|
33
37
|
initial: { opacity: 0, scale: 0.3 },
|
|
@@ -38,19 +42,19 @@ const rr = ({
|
|
|
38
42
|
// Elegant spring-like elastic ease-out
|
|
39
43
|
},
|
|
40
44
|
style: {
|
|
41
|
-
transformOrigin: `${
|
|
45
|
+
transformOrigin: `${o + n / 2}px ${y + e / 2}px`
|
|
42
46
|
},
|
|
43
47
|
children: /* @__PURE__ */ b(
|
|
44
48
|
"svg",
|
|
45
49
|
{
|
|
46
|
-
x:
|
|
47
|
-
y
|
|
48
|
-
width:
|
|
49
|
-
height:
|
|
50
|
+
x: G,
|
|
51
|
+
y,
|
|
52
|
+
width: e,
|
|
53
|
+
height: e,
|
|
50
54
|
viewBox: "0 0 380 380",
|
|
51
55
|
children: [
|
|
52
|
-
/* @__PURE__ */
|
|
53
|
-
p ? /* @__PURE__ */
|
|
56
|
+
/* @__PURE__ */ t("path", { d: I, fill: "rgba(255, 255, 255, 0.6)" }),
|
|
57
|
+
p ? /* @__PURE__ */ t("g", { transform: "translate(95, 95) scale(0.5)", children: /* @__PURE__ */ t("foreignObject", { width: "380", height: "380", children: p }) }) : /* @__PURE__ */ t(
|
|
54
58
|
"path",
|
|
55
59
|
{
|
|
56
60
|
d: "M130 195L170 235L250 155",
|
|
@@ -66,77 +70,86 @@ const rr = ({
|
|
|
66
70
|
}
|
|
67
71
|
)
|
|
68
72
|
},
|
|
69
|
-
`badge-${
|
|
73
|
+
`badge-${c}`
|
|
70
74
|
);
|
|
71
75
|
};
|
|
72
|
-
return /* @__PURE__ */
|
|
76
|
+
return /* @__PURE__ */ t(
|
|
73
77
|
"div",
|
|
74
78
|
{
|
|
75
|
-
className:
|
|
79
|
+
className: tt(
|
|
76
80
|
"outline-none [&_.recharts-surface]:outline-none",
|
|
77
|
-
|
|
81
|
+
f && "overflow-x-auto scrollbar-thin",
|
|
78
82
|
H
|
|
79
83
|
),
|
|
80
|
-
style: { height:
|
|
81
|
-
children: /* @__PURE__ */
|
|
84
|
+
style: { height: k },
|
|
85
|
+
children: /* @__PURE__ */ t(
|
|
82
86
|
"div",
|
|
83
87
|
{
|
|
84
88
|
style: {
|
|
85
|
-
minWidth:
|
|
89
|
+
minWidth: f ? N : void 0,
|
|
86
90
|
height: "100%"
|
|
87
91
|
},
|
|
88
|
-
children: /* @__PURE__ */
|
|
89
|
-
|
|
92
|
+
children: /* @__PURE__ */ t(R, { width: "100%", height: "100%", children: /* @__PURE__ */ b(
|
|
93
|
+
z,
|
|
90
94
|
{
|
|
91
|
-
data:
|
|
92
|
-
margin:
|
|
95
|
+
data: d,
|
|
96
|
+
margin: r ? { top: 0, right: 0, bottom: 0, left: 0 } : { top: 20, right: 10, bottom: 5, left: 0 },
|
|
93
97
|
barGap: 2,
|
|
94
98
|
children: [
|
|
95
|
-
!
|
|
96
|
-
!
|
|
97
|
-
!
|
|
98
|
-
|
|
99
|
+
!r && /* @__PURE__ */ t(M, { ...q, horizontal: !g }),
|
|
100
|
+
!r && /* @__PURE__ */ t(W, { dataKey: S, ...C }),
|
|
101
|
+
!r && /* @__PURE__ */ t(
|
|
102
|
+
O,
|
|
99
103
|
{
|
|
100
|
-
...
|
|
101
|
-
tickFormatter:
|
|
102
|
-
hide:
|
|
104
|
+
...C,
|
|
105
|
+
tickFormatter: L,
|
|
106
|
+
hide: g,
|
|
103
107
|
width: 45
|
|
104
108
|
}
|
|
105
109
|
),
|
|
106
|
-
!
|
|
107
|
-
|
|
110
|
+
!r && /* @__PURE__ */ t(
|
|
111
|
+
X,
|
|
108
112
|
{
|
|
109
|
-
content: /* @__PURE__ */
|
|
113
|
+
content: /* @__PURE__ */ t(Z, {}),
|
|
110
114
|
cursor: {
|
|
111
115
|
fill: "var(--md-sys-color-surface-container-highest)",
|
|
112
116
|
opacity: 0.25
|
|
113
117
|
}
|
|
114
118
|
}
|
|
115
119
|
),
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
+
P && !r && /* @__PURE__ */ t(
|
|
121
|
+
U,
|
|
122
|
+
{
|
|
123
|
+
y: 0,
|
|
124
|
+
stroke: "var(--md-sys-color-outline-variant)",
|
|
125
|
+
strokeWidth: 1.5,
|
|
126
|
+
className: "opacity-80"
|
|
127
|
+
}
|
|
128
|
+
),
|
|
129
|
+
A.map((a, o) => {
|
|
130
|
+
const l = w?.[o] || J(o);
|
|
131
|
+
return /* @__PURE__ */ t(
|
|
132
|
+
V,
|
|
120
133
|
{
|
|
121
|
-
dataKey:
|
|
122
|
-
radius:
|
|
123
|
-
animationDuration:
|
|
124
|
-
animationEasing:
|
|
125
|
-
maxBarSize:
|
|
126
|
-
label:
|
|
127
|
-
children:
|
|
128
|
-
const
|
|
129
|
-
return /* @__PURE__ */
|
|
130
|
-
|
|
134
|
+
dataKey: a,
|
|
135
|
+
radius: j(),
|
|
136
|
+
animationDuration: $,
|
|
137
|
+
animationEasing: _,
|
|
138
|
+
maxBarSize: r ? void 0 : 60,
|
|
139
|
+
label: i ? D : void 0,
|
|
140
|
+
children: d.map((n, s) => {
|
|
141
|
+
const c = (i ? !!n[i] : !1) ? B : l;
|
|
142
|
+
return /* @__PURE__ */ t(
|
|
143
|
+
Y,
|
|
131
144
|
{
|
|
132
|
-
fill:
|
|
145
|
+
fill: c,
|
|
133
146
|
className: "transition-colors duration-300"
|
|
134
147
|
},
|
|
135
|
-
`cell-${
|
|
148
|
+
`cell-${s}`
|
|
136
149
|
);
|
|
137
150
|
})
|
|
138
151
|
},
|
|
139
|
-
|
|
152
|
+
a
|
|
140
153
|
);
|
|
141
154
|
})
|
|
142
155
|
]
|
|
@@ -148,5 +161,5 @@ const rr = ({
|
|
|
148
161
|
);
|
|
149
162
|
};
|
|
150
163
|
export {
|
|
151
|
-
|
|
164
|
+
ft as BarChart
|
|
152
165
|
};
|
|
@@ -16,3 +16,10 @@ export declare const chartAxisConfig: {
|
|
|
16
16
|
tickLine: boolean;
|
|
17
17
|
tickMargin: number;
|
|
18
18
|
};
|
|
19
|
+
/**
|
|
20
|
+
* Generates a cubic-bezier solver function mapping normalized time progress
|
|
21
|
+
* t [0, 1] to physical visual progress. Highly robust and performs Newton-Raphson approximation.
|
|
22
|
+
*/
|
|
23
|
+
export declare function cubicBezier(x1: number, y1: number, x2: number, y2: number): (t: number) => number;
|
|
24
|
+
export declare const EASE_EMPHASIZED: (t: number) => number;
|
|
25
|
+
export declare const EASE_EXPRESSIVE_DEFAULT_SPATIAL: (t: number) => number;
|
|
@@ -1,25 +1,42 @@
|
|
|
1
|
-
const
|
|
1
|
+
const i = [
|
|
2
2
|
"var(--md-sys-color-primary)",
|
|
3
3
|
"var(--md-sys-color-secondary)",
|
|
4
4
|
"var(--md-sys-color-tertiary)",
|
|
5
5
|
"var(--md-sys-color-error)",
|
|
6
6
|
"var(--md-sys-color-outline)",
|
|
7
7
|
"var(--md-sys-color-inverse-primary)"
|
|
8
|
-
],
|
|
8
|
+
], v = (o) => i[o % i.length], d = {
|
|
9
9
|
stroke: "var(--md-sys-color-outline-variant)",
|
|
10
10
|
strokeDasharray: "4 4",
|
|
11
11
|
vertical: !1,
|
|
12
12
|
opacity: 0.4
|
|
13
|
-
},
|
|
13
|
+
}, f = {
|
|
14
14
|
stroke: "var(--md-sys-color-outline-variant)",
|
|
15
15
|
tick: { fill: "var(--md-sys-color-on-surface-variant)", fontSize: 12 },
|
|
16
16
|
axisLine: !1,
|
|
17
17
|
tickLine: !1,
|
|
18
18
|
tickMargin: 10
|
|
19
19
|
};
|
|
20
|
+
function n(o, c, t, l) {
|
|
21
|
+
return (s) => {
|
|
22
|
+
if (s <= 0) return 0;
|
|
23
|
+
if (s >= 1) return 1;
|
|
24
|
+
let r = s;
|
|
25
|
+
for (let a = 0; a < 8; a++) {
|
|
26
|
+
const y = 3 * r * (1 - r) * (1 - r) * o + 3 * r * r * (1 - r) * t + r * r * r, e = 3 * (1 - r) * (1 - r) * o + 6 * r * (1 - r) * (t - o) + 3 * r * r * (1 - t);
|
|
27
|
+
if (Math.abs(e) < 1e-6) break;
|
|
28
|
+
r -= (y - s) / e;
|
|
29
|
+
}
|
|
30
|
+
return 3 * r * (1 - r) * (1 - r) * c + 3 * r * r * (1 - r) * l + r * r * r;
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
const u = n(0.2, 0, 0, 1), m = n(0.38, 1.5, 0.22, 1);
|
|
20
34
|
export {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
35
|
+
i as CHART_COLORS,
|
|
36
|
+
u as EASE_EMPHASIZED,
|
|
37
|
+
m as EASE_EXPRESSIVE_DEFAULT_SPATIAL,
|
|
38
|
+
f as chartAxisConfig,
|
|
39
|
+
d as chartGridConfig,
|
|
40
|
+
n as cubicBezier,
|
|
41
|
+
v as getColorForIndex
|
|
25
42
|
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
export interface HeatmapDataPoint {
|
|
2
|
+
x: string;
|
|
3
|
+
y: string;
|
|
4
|
+
value: number;
|
|
5
|
+
label?: string;
|
|
6
|
+
}
|
|
7
|
+
export interface HeatmapChartProps {
|
|
8
|
+
data: HeatmapDataPoint[];
|
|
9
|
+
/** Explicit sequence of columns along the X-axis */
|
|
10
|
+
xLabels: string[];
|
|
11
|
+
/** Explicit sequence of rows along the Y-axis */
|
|
12
|
+
yLabels: string[];
|
|
13
|
+
/** Theme palette coloring (maps to container colors) */
|
|
14
|
+
variant?: "primary" | "secondary" | "tertiary" | "error";
|
|
15
|
+
/** Cell corner rounding */
|
|
16
|
+
shape?: "full" | "minimal" | "sharp";
|
|
17
|
+
height?: number | string;
|
|
18
|
+
className?: string;
|
|
19
|
+
/** Custom formatter function for values displayed inside tooltips */
|
|
20
|
+
valueFormatter?: (value: number) => string;
|
|
21
|
+
/** Color overrides. If empty, dynamically binds to MD3 color theme variables. */
|
|
22
|
+
colorScale?: string[];
|
|
23
|
+
showLabels?: boolean;
|
|
24
|
+
}
|
|
25
|
+
export declare const HeatmapChart: ({ data, xLabels, yLabels, variant, shape, height, className, valueFormatter, showLabels, }: HeatmapChartProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -6,13 +6,21 @@ import { PlaylistComponentProps } from './types';
|
|
|
6
6
|
*/
|
|
7
7
|
export declare const PlaylistVideo: React.FC<PlaylistComponentProps>;
|
|
8
8
|
/**
|
|
9
|
-
* Invisible Audio Engine.
|
|
10
|
-
*
|
|
9
|
+
* Invisible Programmatic Audio Engine.
|
|
10
|
+
* Handled via a direct in-memory HTMLAudioElement instance.
|
|
11
|
+
* Completely eliminates layout-rendering thread blocks, keeping media pipelines open.
|
|
11
12
|
*/
|
|
12
13
|
export declare const PlaylistAudio: React.FC<PlaylistComponentProps>;
|
|
13
14
|
export declare const PlaylistImage: React.FC<PlaylistComponentProps>;
|
|
15
|
+
/**
|
|
16
|
+
* Flexible HTML Element Renderer.
|
|
17
|
+
* Supports rendering custom tags (whitelisted for safety), custom React children,
|
|
18
|
+
* or raw HTML safely integrated with transitions and coordinates.
|
|
19
|
+
*/
|
|
20
|
+
export declare const PlaylistHtml: React.FC<PlaylistComponentProps>;
|
|
14
21
|
export declare const defaultPlaylistRegistry: {
|
|
15
22
|
Video: React.FC<PlaylistComponentProps>;
|
|
16
23
|
Audio: React.FC<PlaylistComponentProps>;
|
|
17
24
|
Image: React.FC<PlaylistComponentProps>;
|
|
25
|
+
Html: React.FC<PlaylistComponentProps>;
|
|
18
26
|
};
|