@cjlapao/ui-kit 0.2.35 → 0.2.37
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/{CodeBlock-QDW3hqU0.d.cts → CodeBlock-Sj3AzAca.d.cts} +27 -1
- package/dist/{CodeBlock-QDW3hqU0.d.ts → CodeBlock-Sj3AzAca.d.ts} +27 -1
- package/dist/index.cjs +856 -504
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +24 -0
- package/dist/index.d.cts +173 -9
- package/dist/index.d.ts +173 -9
- package/dist/index.js +1236 -881
- package/dist/index.js.map +1 -1
- package/dist/markdown.cjs +43 -18
- package/dist/markdown.cjs.map +1 -1
- package/dist/markdown.d.cts +2 -2
- package/dist/markdown.d.ts +2 -2
- package/dist/markdown.js +43 -18
- package/dist/markdown.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -247,6 +247,7 @@ __export(src_exports, {
|
|
|
247
247
|
PAGE_HEADER_VARIANTS: () => SURFACE_VARIANTS,
|
|
248
248
|
PANEL_HERO_TITLE_ELEMENTS: () => PANEL_HERO_TITLE_ELEMENTS,
|
|
249
249
|
PANEL_HERO_VARIANTS: () => PANEL_HERO_VARIANTS,
|
|
250
|
+
PANEL_MOTIONS: () => PANEL_MOTIONS,
|
|
250
251
|
PANEL_SLIDE_DURATION_MS: () => PANEL_SLIDE_DURATION_MS,
|
|
251
252
|
PANEL_SLIDE_EASING: () => PANEL_SLIDE_EASING,
|
|
252
253
|
PANEL_TONE_FOR_FIELD: () => PANEL_TONE_FOR_FIELD,
|
|
@@ -300,6 +301,7 @@ __export(src_exports, {
|
|
|
300
301
|
SPLIT_VIEW_VARIANTS: () => SURFACE_VARIANTS,
|
|
301
302
|
STATUS_ICON: () => STATUS_ICON2,
|
|
302
303
|
STATUS_TONE: () => STATUS_TONE,
|
|
304
|
+
STAT_CARD_ICON_PLACEMENTS: () => STAT_CARD_ICON_PLACEMENTS,
|
|
303
305
|
STAT_CARD_LOADERS: () => STAT_CARD_LOADERS,
|
|
304
306
|
STAT_CARD_PROGRESS_TYPES: () => STAT_CARD_PROGRESS_TYPES,
|
|
305
307
|
STAT_GRAPH_CHART_TYPES: () => STAT_GRAPH_CHART_TYPES,
|
|
@@ -571,6 +573,7 @@ __export(src_exports, {
|
|
|
571
573
|
getSurfaceGutterClass: () => getSurfaceGutterClass,
|
|
572
574
|
getSurfacePaddingClass: () => getSurfacePaddingClass,
|
|
573
575
|
getSurfacePaddingClasses: () => getSurfacePaddingClasses,
|
|
576
|
+
getSurfacePaddingPx: () => getSurfacePaddingPx,
|
|
574
577
|
getSurfaceTextTokens: () => getSurfaceTextTokens,
|
|
575
578
|
getSurfaceTokens: () => getSurfaceTokens,
|
|
576
579
|
getSurfaceTransparencyClasses: () => getSurfaceTransparencyClasses,
|
|
@@ -737,9 +740,9 @@ var import_react = require("react");
|
|
|
737
740
|
|
|
738
741
|
// ../common/aiOrb/model.ts
|
|
739
742
|
var AI_ORB_PRESETS = {
|
|
740
|
-
solar: { coreColor: "#ffe9a8", accentColor: "#ff9b32", glowColor: "#ed5b16", glow: 0.7, motionIntensity: 0.75 },
|
|
741
|
-
ion: { coreColor: "#e0fffa", accentColor: "#63e8dd", glowColor: "#158ca5", glow: 0.55, motionIntensity: 0.6 },
|
|
742
|
-
ember: { coreColor: "#641b18", accentColor: "#ff7754", glowColor: "#ad2517", glow: 0.45, motionIntensity: 0.4 }
|
|
743
|
+
solar: { coreColor: "#ffe9a8", accentColor: "#ff9b32", glowColor: "#ed5b16", glow: 0.7, motionIntensity: 0.75, definition: 1 },
|
|
744
|
+
ion: { coreColor: "#e0fffa", accentColor: "#63e8dd", glowColor: "#158ca5", glow: 0.55, motionIntensity: 0.6, definition: 1 },
|
|
745
|
+
ember: { coreColor: "#641b18", accentColor: "#ff7754", glowColor: "#ad2517", glow: 0.45, motionIntensity: 0.4, definition: 1 }
|
|
743
746
|
};
|
|
744
747
|
var AI_ORB_QUALITY = {
|
|
745
748
|
low: { fps: 24, dpr: 1, particles: 8, flares: 6, rings: 2 },
|
|
@@ -760,7 +763,8 @@ function resolveAppearance(preset, appearance) {
|
|
|
760
763
|
accentColor: color2(appearance?.accentColor, base.accentColor),
|
|
761
764
|
glowColor: color2(appearance?.glowColor, base.glowColor),
|
|
762
765
|
glow: unit(appearance?.glow, base.glow),
|
|
763
|
-
motionIntensity: unit(appearance?.motionIntensity, base.motionIntensity)
|
|
766
|
+
motionIntensity: unit(appearance?.motionIntensity, base.motionIntensity),
|
|
767
|
+
definition: unit(appearance?.definition, base.definition)
|
|
764
768
|
};
|
|
765
769
|
}
|
|
766
770
|
function backingSize(cssSize, dpr, quality) {
|
|
@@ -778,6 +782,13 @@ function createOrbRenderer(canvas, options) {
|
|
|
778
782
|
let listen = options.state === "listening" ? 1 : 0;
|
|
779
783
|
let speak = options.state === "speaking" ? 1 : 0;
|
|
780
784
|
let time = 0;
|
|
785
|
+
let cssSize = 240;
|
|
786
|
+
let compact2 = 0;
|
|
787
|
+
let pixel = 2;
|
|
788
|
+
const updateDefinition = () => {
|
|
789
|
+
compact2 = Math.max(0, Math.min(1, (240 - cssSize) / 176)) * colors3.definition;
|
|
790
|
+
pixel = 480 / cssSize;
|
|
791
|
+
};
|
|
781
792
|
const core = document.createElement("canvas");
|
|
782
793
|
const halo = document.createElement("canvas");
|
|
783
794
|
core.width = core.height = 256;
|
|
@@ -816,9 +827,12 @@ function createOrbRenderer(canvas, options) {
|
|
|
816
827
|
settings = next;
|
|
817
828
|
colors3 = nextColors;
|
|
818
829
|
budget = AI_ORB_QUALITY[next.quality];
|
|
830
|
+
updateDefinition();
|
|
819
831
|
if (changed) textures();
|
|
820
832
|
},
|
|
821
833
|
resize(size, dpr) {
|
|
834
|
+
cssSize = Number.isFinite(size) && size > 0 ? size : 240;
|
|
835
|
+
updateDefinition();
|
|
822
836
|
const pixels = backingSize(size, dpr, settings.quality);
|
|
823
837
|
if (canvas.width !== pixels || canvas.height !== pixels) canvas.width = canvas.height = pixels;
|
|
824
838
|
},
|
|
@@ -832,54 +846,57 @@ function createOrbRenderer(canvas, options) {
|
|
|
832
846
|
const target = animated && settings.state !== "idle" ? audio?.sample() ?? 0 : 0;
|
|
833
847
|
level += (target - level) * (animated ? Math.min(1, dt * 14) : 1);
|
|
834
848
|
const energy = level * colors3.motionIntensity;
|
|
835
|
-
const radius = 75 + Math.sin(time * 1.8) * 2 + energy * 12;
|
|
849
|
+
const radius = 75 + compact2 * 25 + Math.sin(time * 1.8) * (2 + compact2 * 3) + energy * (12 + compact2 * 10);
|
|
836
850
|
ctx.setTransform(canvas.width / 480, 0, 0, canvas.height / 480, 0, 0);
|
|
837
851
|
ctx.clearRect(0, 0, 480, 480);
|
|
838
|
-
ctx.globalAlpha = colors3.glow * (0.65 + energy * 0.35);
|
|
852
|
+
ctx.globalAlpha = colors3.glow * (0.65 + energy * 0.35) * (1 - compact2 * 0.45);
|
|
839
853
|
ctx.drawImage(halo, 0, 0);
|
|
840
854
|
ctx.globalAlpha = 1;
|
|
841
855
|
if (listen > 1e-3) {
|
|
842
|
-
|
|
856
|
+
const rings = compact2 > 0.5 ? Math.min(2, budget.rings) : budget.rings;
|
|
857
|
+
for (let ring = 0; ring < rings; ring++) {
|
|
843
858
|
ctx.beginPath();
|
|
844
859
|
for (let i = 0; i <= 128; i++) {
|
|
845
860
|
const angle = i / 128 * Math.PI * 2;
|
|
846
861
|
const sample = animated ? audio?.waveform[i % 128] ?? 0 : 0;
|
|
847
|
-
const wave = sample * Math.sin(angle / 2) * 40 * colors3.motionIntensity;
|
|
848
|
-
const r = 112 + ring * 15 + wave + Math.sin(angle * 7 + time * 2 + ring) * 3 * colors3.motionIntensity;
|
|
862
|
+
const wave = sample * Math.sin(angle / 2) * (40 + compact2 * 28) * colors3.motionIntensity;
|
|
863
|
+
const r = 112 + compact2 * 25 + ring * (15 + compact2 * 8) + wave + Math.sin(angle * 7 + time * 2 + ring) * (3 + compact2 * 10) * colors3.motionIntensity;
|
|
849
864
|
const x = 240 + Math.cos(angle) * r, y = 240 + Math.sin(angle) * r;
|
|
850
865
|
if (i === 0) ctx.moveTo(x, y);
|
|
851
866
|
else ctx.lineTo(x, y);
|
|
852
867
|
}
|
|
853
868
|
ctx.closePath();
|
|
854
869
|
ctx.strokeStyle = colors3.accentColor;
|
|
855
|
-
ctx.globalAlpha = listen * (0.65 - ring * 0.15);
|
|
856
|
-
ctx.lineWidth = 1.4;
|
|
870
|
+
ctx.globalAlpha = listen * (0.65 + compact2 * 0.25 - ring * 0.15);
|
|
871
|
+
ctx.lineWidth = Math.max(1.4, pixel * compact2 * 1.25);
|
|
857
872
|
ctx.stroke();
|
|
858
873
|
}
|
|
859
874
|
}
|
|
860
875
|
if (speak > 1e-3) {
|
|
861
876
|
ctx.strokeStyle = colors3.accentColor;
|
|
862
|
-
|
|
877
|
+
const flares = Math.max(6, Math.round(budget.flares * (1 - compact2 * 0.45)));
|
|
878
|
+
for (let i = 0; i < flares; i++) {
|
|
863
879
|
const angle = seeds[i] + time * 0.07;
|
|
864
|
-
const length = 10 + (Math.sin(time * 1.7 + seeds[i]) + 1) * 7 * colors3.motionIntensity + energy * 18;
|
|
880
|
+
const length = 10 + compact2 * 7 + (Math.sin(time * 1.7 + seeds[i]) + 1) * (7 + compact2 * 8) * colors3.motionIntensity + energy * 18;
|
|
865
881
|
ctx.save();
|
|
866
882
|
ctx.translate(240, 240);
|
|
867
883
|
ctx.rotate(angle);
|
|
868
|
-
ctx.globalAlpha = speak * (0.25 + colors3.glow * 0.4);
|
|
884
|
+
ctx.globalAlpha = speak * (0.25 + colors3.glow * 0.4 + compact2 * 0.3);
|
|
869
885
|
ctx.beginPath();
|
|
870
|
-
ctx.ellipse(radius + length * 0.45, 0, length, 4 + energy * 3, 0, 0, Math.PI * 2);
|
|
871
|
-
ctx.lineWidth = 1.3;
|
|
886
|
+
ctx.ellipse(radius + length * 0.45, 0, length, 4 + compact2 * 5 + energy * 3, 0, 0, Math.PI * 2);
|
|
887
|
+
ctx.lineWidth = Math.max(1.3, pixel * compact2 * 1.15);
|
|
872
888
|
ctx.stroke();
|
|
873
889
|
ctx.restore();
|
|
874
890
|
}
|
|
875
891
|
ctx.fillStyle = colors3.coreColor;
|
|
876
|
-
|
|
892
|
+
const particles = Math.max(4, Math.round(budget.particles * (1 - compact2 * 0.5)));
|
|
893
|
+
for (let i = 0; i < particles; i++) {
|
|
877
894
|
const phase = (time * 0.12 + i * 0.173) % 1;
|
|
878
895
|
const angle = seeds[i] + time * 0.035;
|
|
879
896
|
const r = radius + 22 + phase * 85;
|
|
880
|
-
ctx.globalAlpha = speak * (1 - phase) * (0.3 + energy * 0.5);
|
|
897
|
+
ctx.globalAlpha = speak * (1 - phase) * (0.3 + energy * 0.5 + compact2 * 0.2);
|
|
881
898
|
ctx.beginPath();
|
|
882
|
-
ctx.arc(240 + Math.cos(angle) * r, 240 + Math.sin(angle) * r, 1 + i % 3 * 0.65, 0, Math.PI * 2);
|
|
899
|
+
ctx.arc(240 + Math.cos(angle) * r, 240 + Math.sin(angle) * r, Math.max(1 + i % 3 * 0.65, pixel * compact2 * (0.8 + i % 3 * 0.15)), 0, Math.PI * 2);
|
|
883
900
|
ctx.fill();
|
|
884
901
|
}
|
|
885
902
|
}
|
|
@@ -890,11 +907,12 @@ function createOrbRenderer(canvas, options) {
|
|
|
890
907
|
ctx.arc(240, 240, radius * 0.95, 0, Math.PI * 2);
|
|
891
908
|
ctx.clip();
|
|
892
909
|
ctx.strokeStyle = colors3.accentColor;
|
|
893
|
-
|
|
894
|
-
|
|
910
|
+
const surfaceLoops = compact2 > 0.5 ? 4 : 10;
|
|
911
|
+
for (let i = 0; i < surfaceLoops; i++) {
|
|
912
|
+
ctx.globalAlpha = 0.12 + speak * 0.07 + compact2 * 0.12;
|
|
895
913
|
ctx.beginPath();
|
|
896
914
|
ctx.ellipse(240 + Math.sin(seeds[i] + time * 0.16) * 54, 240 + Math.cos(seeds[i] * 2 + time * 0.1) * 54, 22 + i * 2, 8 + i % 4, seeds[i] + time * 0.1, 0, Math.PI * 2);
|
|
897
|
-
ctx.lineWidth = 1;
|
|
915
|
+
ctx.lineWidth = Math.max(1, pixel * compact2 * 0.65);
|
|
898
916
|
ctx.stroke();
|
|
899
917
|
}
|
|
900
918
|
ctx.restore();
|
|
@@ -6502,6 +6520,17 @@ var COLLAPSED_RAIL_WIDTH = 56;
|
|
|
6502
6520
|
var PANEL_SLIDE_DURATION_MS = 450;
|
|
6503
6521
|
var PANEL_SLIDE_EASING = "cubic-bezier(0.32, 0.72, 0, 1)";
|
|
6504
6522
|
var panelSlideTransition = (...properties) => properties.map((property) => `${property} ${PANEL_SLIDE_DURATION_MS}ms ${PANEL_SLIDE_EASING}`).join(", ");
|
|
6523
|
+
var PANEL_MOTIONS = ["layout", "slide"];
|
|
6524
|
+
function prefersReducedMotion() {
|
|
6525
|
+
if (typeof window === "undefined" || typeof window.matchMedia !== "function") {
|
|
6526
|
+
return false;
|
|
6527
|
+
}
|
|
6528
|
+
try {
|
|
6529
|
+
return window.matchMedia("(prefers-reduced-motion: reduce)").matches;
|
|
6530
|
+
} catch {
|
|
6531
|
+
return false;
|
|
6532
|
+
}
|
|
6533
|
+
}
|
|
6505
6534
|
var DEFAULT_CONTROL_CORNER = "rounded-lg";
|
|
6506
6535
|
var SURFACE_VARIANT_FOR_FIELD = {
|
|
6507
6536
|
flat: "outlined",
|
|
@@ -6561,6 +6590,15 @@ var surfacePaddingClasses = {
|
|
|
6561
6590
|
};
|
|
6562
6591
|
var DEFAULT_SURFACE_PADDING = "sm";
|
|
6563
6592
|
var getSurfacePaddingClass = (padding) => surfacePaddingClasses[padding] ?? surfacePaddingClasses[DEFAULT_SURFACE_PADDING];
|
|
6593
|
+
var SURFACE_PADDING_PX = {
|
|
6594
|
+
none: 0,
|
|
6595
|
+
xs: 8,
|
|
6596
|
+
sm: 16,
|
|
6597
|
+
md: 24,
|
|
6598
|
+
lg: 32,
|
|
6599
|
+
xl: 40
|
|
6600
|
+
};
|
|
6601
|
+
var getSurfacePaddingPx = (padding) => SURFACE_PADDING_PX[padding] ?? SURFACE_PADDING_PX[DEFAULT_SURFACE_PADDING];
|
|
6564
6602
|
var getSurfacePaddingClasses = () => ({
|
|
6565
6603
|
...surfacePaddingClasses
|
|
6566
6604
|
});
|
|
@@ -18676,53 +18714,72 @@ var ScrollArea = ({
|
|
|
18676
18714
|
const [hovered, setHovered] = (0, import_react182.useState)(false);
|
|
18677
18715
|
const [scrolling, setScrolling] = (0, import_react182.useState)(false);
|
|
18678
18716
|
const dragging = (0, import_react182.useRef)(null);
|
|
18717
|
+
const virtual = virtualScroll != null;
|
|
18718
|
+
const virtualViewport = virtualScroll?.viewportSize ?? 0;
|
|
18719
|
+
const virtualContent = virtualScroll?.contentSize ?? 0;
|
|
18720
|
+
const virtualOffset = virtualScroll?.offset ?? 0;
|
|
18679
18721
|
const thumb = (0, import_react182.useCallback)(
|
|
18680
18722
|
(viewport, track, axis) => {
|
|
18681
|
-
const viewportSize = axis === "y" &&
|
|
18682
|
-
const contentSize = axis === "y" &&
|
|
18723
|
+
const viewportSize = axis === "y" && virtual ? virtualViewport : axis === "y" ? viewport.clientHeight : viewport.clientWidth;
|
|
18724
|
+
const contentSize = axis === "y" && virtual ? virtualContent : axis === "y" ? viewport.scrollHeight : viewport.scrollWidth;
|
|
18683
18725
|
const trackSize = (track ? axis === "y" ? track.clientHeight : track.clientWidth : viewportSize) || 1;
|
|
18684
18726
|
const scrollable = contentSize - viewportSize;
|
|
18685
|
-
if (scrollable <= (
|
|
18727
|
+
if (scrollable <= (virtual ? 0 : 1)) return FITTING_THUMB;
|
|
18686
18728
|
const size = Math.max(
|
|
18687
18729
|
MIN_THUMB,
|
|
18688
18730
|
viewportSize / contentSize * trackSize
|
|
18689
18731
|
);
|
|
18690
|
-
const position = axis === "y" &&
|
|
18732
|
+
const position = axis === "y" && virtual ? virtualOffset : axis === "y" ? viewport.scrollTop : viewport.scrollLeft;
|
|
18691
18733
|
return {
|
|
18692
18734
|
size,
|
|
18693
18735
|
offset: position / scrollable * (trackSize - size),
|
|
18694
18736
|
ratio: position / scrollable
|
|
18695
18737
|
};
|
|
18696
18738
|
},
|
|
18697
|
-
[
|
|
18739
|
+
[virtual, virtualViewport, virtualContent, virtualOffset]
|
|
18698
18740
|
);
|
|
18741
|
+
const sameMetrics = (a, b) => a.size === b.size && a.offset === b.offset && a.ratio === b.ratio;
|
|
18699
18742
|
const update = (0, import_react182.useCallback)(() => {
|
|
18700
18743
|
const viewport = viewportRef.current;
|
|
18701
18744
|
if (!viewport) return;
|
|
18702
|
-
|
|
18703
|
-
|
|
18704
|
-
|
|
18705
|
-
|
|
18706
|
-
setThumbY(thumb(viewport, yTrackRef.current, "y"));
|
|
18707
|
-
setThumbX(
|
|
18708
|
-
horizontal ? thumb(viewport, xTrackRef.current, "x") : FITTING_THUMB
|
|
18745
|
+
const nextX = horizontal && viewport.scrollWidth - viewport.clientWidth > 1;
|
|
18746
|
+
const nextY = virtual ? virtualContent > virtualViewport : viewport.scrollHeight - viewport.clientHeight > 1;
|
|
18747
|
+
setOverflow(
|
|
18748
|
+
(prev) => prev.x === nextX && prev.y === nextY ? prev : { x: nextX, y: nextY }
|
|
18709
18749
|
);
|
|
18710
|
-
|
|
18750
|
+
const nextYThumb = thumb(viewport, yTrackRef.current, "y");
|
|
18751
|
+
setThumbY((prev) => sameMetrics(prev, nextYThumb) ? prev : nextYThumb);
|
|
18752
|
+
const nextXThumb = horizontal ? thumb(viewport, xTrackRef.current, "x") : FITTING_THUMB;
|
|
18753
|
+
setThumbX((prev) => sameMetrics(prev, nextXThumb) ? prev : nextXThumb);
|
|
18754
|
+
}, [thumb, horizontal, virtual, virtualContent, virtualViewport]);
|
|
18755
|
+
const updateRef = (0, import_react182.useRef)(update);
|
|
18711
18756
|
(0, import_react182.useEffect)(() => {
|
|
18712
|
-
update
|
|
18757
|
+
updateRef.current = update;
|
|
18758
|
+
});
|
|
18759
|
+
(0, import_react182.useEffect)(() => {
|
|
18760
|
+
updateRef.current();
|
|
18713
18761
|
let observer;
|
|
18762
|
+
let frame = 0;
|
|
18763
|
+
const schedule = () => {
|
|
18764
|
+
if (frame) return;
|
|
18765
|
+
frame = requestAnimationFrame(() => {
|
|
18766
|
+
frame = 0;
|
|
18767
|
+
updateRef.current();
|
|
18768
|
+
});
|
|
18769
|
+
};
|
|
18714
18770
|
if (typeof ResizeObserver !== "undefined") {
|
|
18715
|
-
observer = new ResizeObserver(
|
|
18771
|
+
observer = new ResizeObserver(schedule);
|
|
18716
18772
|
if (viewportRef.current) observer.observe(viewportRef.current);
|
|
18717
18773
|
if (contentRef.current) observer.observe(contentRef.current);
|
|
18718
18774
|
} else {
|
|
18719
|
-
window.addEventListener("resize",
|
|
18775
|
+
window.addEventListener("resize", schedule);
|
|
18720
18776
|
}
|
|
18721
18777
|
return () => {
|
|
18778
|
+
if (frame) cancelAnimationFrame(frame);
|
|
18722
18779
|
observer?.disconnect();
|
|
18723
|
-
window.removeEventListener("resize",
|
|
18780
|
+
window.removeEventListener("resize", schedule);
|
|
18724
18781
|
};
|
|
18725
|
-
}, [
|
|
18782
|
+
}, []);
|
|
18726
18783
|
(0, import_react182.useEffect)(() => () => window.clearTimeout(lingerTimer.current), []);
|
|
18727
18784
|
const handleScroll = () => {
|
|
18728
18785
|
update();
|
|
@@ -18860,6 +18917,12 @@ var ScrollArea = ({
|
|
|
18860
18917
|
"data-slot": "scrollarea-content",
|
|
18861
18918
|
className: (0, import_classnames35.default)(
|
|
18862
18919
|
virtualScroll ? "h-full min-w-full" : "table min-w-full",
|
|
18920
|
+
// The overlay bar's lane is reserved in the content *always*:
|
|
18921
|
+
// the auto/hover bar appears on gesture, and a gutter tied to
|
|
18922
|
+
// its visibility would jog the text sideways on every scroll.
|
|
18923
|
+
// A constant 10px inset is the calmer contract — the thumb then
|
|
18924
|
+
// never sits on the caller's content, or its hover state.
|
|
18925
|
+
"pr-2.5",
|
|
18863
18926
|
contentClassName
|
|
18864
18927
|
),
|
|
18865
18928
|
children
|
|
@@ -27853,8 +27916,86 @@ Chat2.displayName = "Chat";
|
|
|
27853
27916
|
var Chat_default = Chat2;
|
|
27854
27917
|
|
|
27855
27918
|
// src/components/ActivityFeed.tsx
|
|
27856
|
-
var
|
|
27919
|
+
var import_react204 = require("react");
|
|
27857
27920
|
var import_classnames58 = __toESM(require("classnames"), 1);
|
|
27921
|
+
|
|
27922
|
+
// src/hooks/useInfiniteScroll.ts
|
|
27923
|
+
var import_react203 = require("react");
|
|
27924
|
+
function useInfiniteScroll(options) {
|
|
27925
|
+
const {
|
|
27926
|
+
rootRef,
|
|
27927
|
+
sentinelRef,
|
|
27928
|
+
hasMore,
|
|
27929
|
+
isLoading = false,
|
|
27930
|
+
itemCount,
|
|
27931
|
+
minItems = 0,
|
|
27932
|
+
rootMargin = 320,
|
|
27933
|
+
resetKey,
|
|
27934
|
+
observeKey
|
|
27935
|
+
} = options;
|
|
27936
|
+
const latest = (0, import_react203.useRef)(options);
|
|
27937
|
+
const generation = (0, import_react203.useRef)(0);
|
|
27938
|
+
const locked = (0, import_react203.useRef)(false);
|
|
27939
|
+
const failed = (0, import_react203.useRef)(false);
|
|
27940
|
+
const mounted = (0, import_react203.useRef)(false);
|
|
27941
|
+
const attemptedCount = (0, import_react203.useRef)(null);
|
|
27942
|
+
const [isLoadingMore, setIsLoadingMore] = (0, import_react203.useState)(false);
|
|
27943
|
+
const [error, setError] = (0, import_react203.useState)(null);
|
|
27944
|
+
(0, import_react203.useLayoutEffect)(() => {
|
|
27945
|
+
latest.current = options;
|
|
27946
|
+
});
|
|
27947
|
+
(0, import_react203.useLayoutEffect)(() => {
|
|
27948
|
+
mounted.current = true;
|
|
27949
|
+
generation.current += 1;
|
|
27950
|
+
attemptedCount.current = null;
|
|
27951
|
+
failed.current = false;
|
|
27952
|
+
setError(null);
|
|
27953
|
+
if (rootRef.current) rootRef.current.scrollTop = 0;
|
|
27954
|
+
return () => {
|
|
27955
|
+
mounted.current = false;
|
|
27956
|
+
generation.current += 1;
|
|
27957
|
+
};
|
|
27958
|
+
}, [resetKey, rootRef]);
|
|
27959
|
+
const loadMore = (0, import_react203.useCallback)(async () => {
|
|
27960
|
+
const current = latest.current;
|
|
27961
|
+
if (!mounted.current || locked.current || current.isLoading || !current.hasMore) return;
|
|
27962
|
+
const started = generation.current;
|
|
27963
|
+
locked.current = true;
|
|
27964
|
+
attemptedCount.current = current.itemCount;
|
|
27965
|
+
failed.current = false;
|
|
27966
|
+
setIsLoadingMore(true);
|
|
27967
|
+
setError(null);
|
|
27968
|
+
try {
|
|
27969
|
+
await current.onLoadMore();
|
|
27970
|
+
} catch (caught) {
|
|
27971
|
+
if (started === generation.current) {
|
|
27972
|
+
failed.current = true;
|
|
27973
|
+
setError(caught || new Error("Failed to load more items"));
|
|
27974
|
+
current.onError?.(caught);
|
|
27975
|
+
}
|
|
27976
|
+
} finally {
|
|
27977
|
+
locked.current = false;
|
|
27978
|
+
if (mounted.current) setIsLoadingMore(false);
|
|
27979
|
+
}
|
|
27980
|
+
}, []);
|
|
27981
|
+
const busy = isLoading || isLoadingMore;
|
|
27982
|
+
(0, import_react203.useEffect)(() => {
|
|
27983
|
+
const root = rootRef.current;
|
|
27984
|
+
const sentinel = sentinelRef.current;
|
|
27985
|
+
if (!root || !sentinel || !hasMore || busy || error || typeof IntersectionObserver === "undefined") return;
|
|
27986
|
+
const observer = new IntersectionObserver((entries) => {
|
|
27987
|
+
if (!failed.current && attemptedCount.current !== latest.current.itemCount && entries.some((entry) => entry.isIntersecting)) void loadMore();
|
|
27988
|
+
}, { root, rootMargin: `0px 0px ${rootMargin}px 0px`, threshold: 0 });
|
|
27989
|
+
observer.observe(sentinel);
|
|
27990
|
+
return () => observer.disconnect();
|
|
27991
|
+
}, [rootRef, sentinelRef, hasMore, busy, error, rootMargin, itemCount, resetKey, observeKey, loadMore]);
|
|
27992
|
+
(0, import_react203.useEffect)(() => {
|
|
27993
|
+
if (hasMore && !busy && !error && attemptedCount.current !== itemCount && itemCount < minItems) void loadMore();
|
|
27994
|
+
}, [hasMore, busy, error, itemCount, minItems, resetKey, loadMore]);
|
|
27995
|
+
return { isLoadingMore, error, busy, loadMore };
|
|
27996
|
+
}
|
|
27997
|
+
|
|
27998
|
+
// src/components/ActivityFeed.tsx
|
|
27858
27999
|
var import_jsx_runtime214 = require("react/jsx-runtime");
|
|
27859
28000
|
var ActivityFeed = ({
|
|
27860
28001
|
title = "Recent activity",
|
|
@@ -27868,11 +28009,19 @@ var ActivityFeed = ({
|
|
|
27868
28009
|
ctaVariant,
|
|
27869
28010
|
loadMoreVariant,
|
|
27870
28011
|
filterVariant,
|
|
28012
|
+
filterTone,
|
|
27871
28013
|
onLoadMore,
|
|
27872
28014
|
hasMore = false,
|
|
28015
|
+
loadMode = "scroll",
|
|
28016
|
+
rootMargin,
|
|
28017
|
+
minItems,
|
|
28018
|
+
scrollResetKey,
|
|
28019
|
+
onError,
|
|
28020
|
+
controlsTone,
|
|
27873
28021
|
loading = false,
|
|
27874
28022
|
loadMoreLabel = "Load more",
|
|
27875
28023
|
totalCount,
|
|
28024
|
+
maxHeight,
|
|
27876
28025
|
variant = "outlined",
|
|
27877
28026
|
tone: surfaceTone = "none",
|
|
27878
28027
|
padding = "md",
|
|
@@ -27881,12 +28030,15 @@ var ActivityFeed = ({
|
|
|
27881
28030
|
...rest
|
|
27882
28031
|
}) => {
|
|
27883
28032
|
const tone = getSurfaceAccentColor(surfaceTone);
|
|
27884
|
-
const
|
|
27885
|
-
const
|
|
28033
|
+
const controlColor = controlsTone ?? (tone === "neutral" ? void 0 : tone);
|
|
28034
|
+
const pillTone = controlsTone ?? (tone === "neutral" ? "blue" : tone);
|
|
28035
|
+
const filterColor = filterTone ?? controlColor;
|
|
28036
|
+
const [active, setActive] = (0, import_react204.useState)(defaultFilter);
|
|
28037
|
+
const options = (0, import_react204.useMemo)(
|
|
27886
28038
|
() => [{ label: "All", value: "all" }, ...filters],
|
|
27887
28039
|
[filters]
|
|
27888
28040
|
);
|
|
27889
|
-
const visible = (0,
|
|
28041
|
+
const visible = (0, import_react204.useMemo)(
|
|
27890
28042
|
() => active === "all" ? items : items.filter((item) => (item.category ?? item.tone) === active),
|
|
27891
28043
|
[items, active]
|
|
27892
28044
|
);
|
|
@@ -27894,6 +28046,130 @@ var ActivityFeed = ({
|
|
|
27894
28046
|
setActive(value);
|
|
27895
28047
|
onFilterChange?.(value);
|
|
27896
28048
|
};
|
|
28049
|
+
const viewportRef = (0, import_react204.useRef)(null);
|
|
28050
|
+
const sentinelRef = (0, import_react204.useRef)(null);
|
|
28051
|
+
const infinite = loadMode === "scroll" && maxHeight !== void 0 && !!onLoadMore;
|
|
28052
|
+
const scroll = useInfiniteScroll({
|
|
28053
|
+
rootRef: viewportRef,
|
|
28054
|
+
sentinelRef,
|
|
28055
|
+
hasMore: infinite && hasMore,
|
|
28056
|
+
isLoading: loading,
|
|
28057
|
+
onLoadMore: async () => {
|
|
28058
|
+
await onLoadMore?.();
|
|
28059
|
+
},
|
|
28060
|
+
itemCount: visible.length,
|
|
28061
|
+
minItems,
|
|
28062
|
+
rootMargin,
|
|
28063
|
+
// Switching filters swaps the dataset, and the watch resets with it.
|
|
28064
|
+
resetKey: `${active}:${scrollResetKey ?? ""}`,
|
|
28065
|
+
onError
|
|
28066
|
+
});
|
|
28067
|
+
const scrollTail = infinite ? /* @__PURE__ */ (0, import_jsx_runtime214.jsxs)(import_jsx_runtime214.Fragment, { children: [
|
|
28068
|
+
/* @__PURE__ */ (0, import_jsx_runtime214.jsx)("div", { ref: sentinelRef, "aria-hidden": "true" }),
|
|
28069
|
+
scroll.error ? /* @__PURE__ */ (0, import_jsx_runtime214.jsxs)(
|
|
28070
|
+
"div",
|
|
28071
|
+
{
|
|
28072
|
+
"data-slot": "activity-feed-scroll-error",
|
|
28073
|
+
className: "flex items-center justify-center gap-2 py-2 text-xs text-rose-600 dark:text-rose-400",
|
|
28074
|
+
children: [
|
|
28075
|
+
"Couldn't load more",
|
|
28076
|
+
/* @__PURE__ */ (0, import_jsx_runtime214.jsx)(Button_default, { size: "xs", variant: "link", onClick: () => void scroll.loadMore(), children: "Try again" })
|
|
28077
|
+
]
|
|
28078
|
+
}
|
|
28079
|
+
) : scroll.isLoadingMore ? /* @__PURE__ */ (0, import_jsx_runtime214.jsx)(
|
|
28080
|
+
"div",
|
|
28081
|
+
{
|
|
28082
|
+
"data-slot": "activity-feed-scroll-loading",
|
|
28083
|
+
className: "flex justify-center py-2",
|
|
28084
|
+
role: "status",
|
|
28085
|
+
"aria-label": "Loading more",
|
|
28086
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime214.jsx)(Spinner_default, { size: "xs", color: controlColor })
|
|
28087
|
+
}
|
|
28088
|
+
) : null
|
|
28089
|
+
] }) : null;
|
|
28090
|
+
const rowBody = (item) => /* @__PURE__ */ (0, import_jsx_runtime214.jsxs)(import_jsx_runtime214.Fragment, { children: [
|
|
28091
|
+
/* @__PURE__ */ (0, import_jsx_runtime214.jsx)(
|
|
28092
|
+
"span",
|
|
28093
|
+
{
|
|
28094
|
+
className: (0, import_classnames58.default)(
|
|
28095
|
+
getTrueColorDotClass(item.tone ?? (tone === "neutral" ? "neutral" : tone)),
|
|
28096
|
+
"mt-1.5 size-2 shrink-0 rounded-full"
|
|
28097
|
+
),
|
|
28098
|
+
"aria-hidden": "true"
|
|
28099
|
+
}
|
|
28100
|
+
),
|
|
28101
|
+
/* @__PURE__ */ (0, import_jsx_runtime214.jsxs)("div", { className: "min-w-0 flex-1", children: [
|
|
28102
|
+
/* @__PURE__ */ (0, import_jsx_runtime214.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
28103
|
+
/* @__PURE__ */ (0, import_jsx_runtime214.jsxs)("span", { className: "min-w-0 truncate text-sm font-medium", children: [
|
|
28104
|
+
item.actor && /* @__PURE__ */ (0, import_jsx_runtime214.jsxs)("span", { className: "font-semibold", children: [
|
|
28105
|
+
item.actor,
|
|
28106
|
+
" "
|
|
28107
|
+
] }),
|
|
28108
|
+
item.title
|
|
28109
|
+
] }),
|
|
28110
|
+
item.count !== void 0 && item.count > 1 && /* @__PURE__ */ (0, import_jsx_runtime214.jsxs)(Pill_default, { size: "sm", tone: "neutral", children: [
|
|
28111
|
+
"\xD7",
|
|
28112
|
+
item.count
|
|
28113
|
+
] })
|
|
28114
|
+
] }),
|
|
28115
|
+
item.description && /* @__PURE__ */ (0, import_jsx_runtime214.jsx)("p", { className: "mt-0.5 text-xs text-neutral-500 dark:text-neutral-400", children: item.description }),
|
|
28116
|
+
item.code && /* @__PURE__ */ (0, import_jsx_runtime214.jsx)("code", { className: "mt-1 inline-block rounded bg-neutral-100 px-1.5 py-0.5 font-mono text-[11px] tracking-tighter text-neutral-600 dark:bg-neutral-800 dark:text-neutral-300", children: item.code })
|
|
28117
|
+
] }),
|
|
28118
|
+
/* @__PURE__ */ (0, import_jsx_runtime214.jsx)("time", { className: "shrink-0 pt-0.5 text-xs tabular-nums text-neutral-400 dark:text-neutral-500", children: item.timestamp })
|
|
28119
|
+
] });
|
|
28120
|
+
const body = loading ? /* @__PURE__ */ (0, import_jsx_runtime214.jsx)(
|
|
28121
|
+
"div",
|
|
28122
|
+
{
|
|
28123
|
+
className: "flex flex-col divide-y divide-neutral-100 animate-pulse motion-reduce:animate-none dark:divide-neutral-800",
|
|
28124
|
+
"aria-hidden": "true",
|
|
28125
|
+
children: Array.from({ length: Math.min(Math.max(items.length, 3), 6) }).map(
|
|
28126
|
+
(_, index) => /* @__PURE__ */ (0, import_jsx_runtime214.jsxs)("div", { className: "flex items-center gap-3 py-3 first:pt-1 last:pb-0", children: [
|
|
28127
|
+
/* @__PURE__ */ (0, import_jsx_runtime214.jsx)(SkeletonBar, { className: "size-2 shrink-0 rounded-full", height: "h-2" }),
|
|
28128
|
+
/* @__PURE__ */ (0, import_jsx_runtime214.jsx)(SkeletonBar, { className: "h-3 flex-1", width: `${74 - index * 8}%` }),
|
|
28129
|
+
/* @__PURE__ */ (0, import_jsx_runtime214.jsx)(SkeletonBar, { className: "h-3 w-10 shrink-0" })
|
|
28130
|
+
] }, index)
|
|
28131
|
+
)
|
|
28132
|
+
}
|
|
28133
|
+
) : visible.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime214.jsx)(
|
|
28134
|
+
EmptyState_default,
|
|
28135
|
+
{
|
|
28136
|
+
icon: "Log",
|
|
28137
|
+
title: "Nothing here",
|
|
28138
|
+
subtitle: "No events match this filter yet."
|
|
28139
|
+
}
|
|
28140
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime214.jsx)("ol", { className: "divide-y divide-neutral-100 dark:divide-neutral-800", children: visible.map(
|
|
28141
|
+
(item) => item.onClick ? (
|
|
28142
|
+
// A clickable row is a control: like `StatCard`'s clickable body it
|
|
28143
|
+
// carries the button semantics and the Enter/Space keys. The role
|
|
28144
|
+
// is spelled literally on this branch — a computed attribute reads
|
|
28145
|
+
// as an unknown `li` to the a11y resolver, and to tooling generally.
|
|
28146
|
+
// The rule bans listitem→button outright; here the row *is* the
|
|
28147
|
+
// affordance, the same stance `StatCard` takes for its whole-card
|
|
28148
|
+
// click, and the `ol` still announces the count of events.
|
|
28149
|
+
/* @__PURE__ */ (0, import_jsx_runtime214.jsx)(
|
|
28150
|
+
"li",
|
|
28151
|
+
{
|
|
28152
|
+
role: "button",
|
|
28153
|
+
tabIndex: 0,
|
|
28154
|
+
onClick: item.onClick,
|
|
28155
|
+
onKeyDown: (event) => {
|
|
28156
|
+
if (event.key === "Enter" || event.key === " ") {
|
|
28157
|
+
event.preventDefault();
|
|
28158
|
+
item.onClick?.();
|
|
28159
|
+
}
|
|
28160
|
+
},
|
|
28161
|
+
className: (0, import_classnames58.default)(
|
|
28162
|
+
"flex items-start gap-3 px-2 py-3 first:pt-1 last:pb-0",
|
|
28163
|
+
// The Table's clickable-row grammar: cursor plus a soft wash,
|
|
28164
|
+
// with the scroller's own focus ring for the keyboard path.
|
|
28165
|
+
"cursor-pointer transition-colors duration-150 ease-out hover:bg-neutral-50 dark:hover:bg-neutral-800/40 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-blue-400"
|
|
28166
|
+
),
|
|
28167
|
+
children: rowBody(item)
|
|
28168
|
+
},
|
|
28169
|
+
item.id
|
|
28170
|
+
)
|
|
28171
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime214.jsx)("li", { className: "flex items-start gap-3 px-2 py-3 first:pt-1 last:pb-0", children: rowBody(item) }, item.id)
|
|
28172
|
+
) });
|
|
27897
28173
|
return /* @__PURE__ */ (0, import_jsx_runtime214.jsx)(
|
|
27898
28174
|
Panel_default,
|
|
27899
28175
|
{
|
|
@@ -27906,7 +28182,7 @@ var ActivityFeed = ({
|
|
|
27906
28182
|
children: /* @__PURE__ */ (0, import_jsx_runtime214.jsxs)("div", { className: "flex flex-col gap-4", children: [
|
|
27907
28183
|
/* @__PURE__ */ (0, import_jsx_runtime214.jsxs)("div", { className: "flex flex-wrap items-center gap-x-3 gap-y-2", children: [
|
|
27908
28184
|
/* @__PURE__ */ (0, import_jsx_runtime214.jsx)("h3", { className: "text-sm font-semibold", children: title }),
|
|
27909
|
-
tag && !loading && /* @__PURE__ */ (0, import_jsx_runtime214.jsx)(Pill_default, { tone:
|
|
28185
|
+
tag && !loading && /* @__PURE__ */ (0, import_jsx_runtime214.jsx)(Pill_default, { tone: pillTone, size: "sm", children: tag }),
|
|
27910
28186
|
/* @__PURE__ */ (0, import_jsx_runtime214.jsxs)(
|
|
27911
28187
|
"span",
|
|
27912
28188
|
{
|
|
@@ -27927,7 +28203,7 @@ var ActivityFeed = ({
|
|
|
27927
28203
|
Button_default,
|
|
27928
28204
|
{
|
|
27929
28205
|
variant: ctaVariant ?? SURFACE_TO_BUTTON_VARIANT[variant],
|
|
27930
|
-
color:
|
|
28206
|
+
color: controlColor,
|
|
27931
28207
|
size: "sm",
|
|
27932
28208
|
className: "ms-auto",
|
|
27933
28209
|
trailingIcon: "ChevronRight",
|
|
@@ -27944,64 +28220,28 @@ var ActivityFeed = ({
|
|
|
27944
28220
|
onChange: pick,
|
|
27945
28221
|
variant: filterVariant ?? variant,
|
|
27946
28222
|
size: "sm",
|
|
27947
|
-
tone:
|
|
28223
|
+
tone: filterColor
|
|
27948
28224
|
}
|
|
27949
28225
|
),
|
|
27950
|
-
|
|
27951
|
-
|
|
27952
|
-
{
|
|
27953
|
-
className: "flex flex-col divide-y divide-neutral-100 animate-pulse motion-reduce:animate-none dark:divide-neutral-800",
|
|
27954
|
-
"aria-hidden": "true",
|
|
27955
|
-
children: Array.from({ length: Math.min(Math.max(items.length, 3), 6) }).map(
|
|
27956
|
-
(_, index) => /* @__PURE__ */ (0, import_jsx_runtime214.jsxs)("div", { className: "flex items-center gap-3 py-3 first:pt-1 last:pb-0", children: [
|
|
27957
|
-
/* @__PURE__ */ (0, import_jsx_runtime214.jsx)(SkeletonBar, { className: "size-2 shrink-0 rounded-full", height: "h-2" }),
|
|
27958
|
-
/* @__PURE__ */ (0, import_jsx_runtime214.jsx)(SkeletonBar, { className: "h-3 flex-1", width: `${74 - index * 8}%` }),
|
|
27959
|
-
/* @__PURE__ */ (0, import_jsx_runtime214.jsx)(SkeletonBar, { className: "h-3 w-10 shrink-0" })
|
|
27960
|
-
] }, index)
|
|
27961
|
-
)
|
|
27962
|
-
}
|
|
27963
|
-
) : visible.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime214.jsx)(
|
|
27964
|
-
EmptyState_default,
|
|
28226
|
+
maxHeight === void 0 ? body : /* @__PURE__ */ (0, import_jsx_runtime214.jsxs)(
|
|
28227
|
+
ScrollArea_default,
|
|
27965
28228
|
{
|
|
27966
|
-
|
|
27967
|
-
|
|
27968
|
-
|
|
28229
|
+
horizontal: false,
|
|
28230
|
+
viewportRef,
|
|
28231
|
+
style: {
|
|
28232
|
+
maxHeight: typeof maxHeight === "number" ? `${maxHeight}px` : maxHeight
|
|
28233
|
+
},
|
|
28234
|
+
children: [
|
|
28235
|
+
body,
|
|
28236
|
+
scrollTail
|
|
28237
|
+
]
|
|
27969
28238
|
}
|
|
27970
|
-
)
|
|
27971
|
-
|
|
27972
|
-
"span",
|
|
27973
|
-
{
|
|
27974
|
-
className: (0, import_classnames58.default)(
|
|
27975
|
-
getTrueColorDotClass(item.tone ?? (tone === "neutral" ? "neutral" : tone)),
|
|
27976
|
-
"mt-1.5 size-2 shrink-0 rounded-full"
|
|
27977
|
-
),
|
|
27978
|
-
"aria-hidden": "true"
|
|
27979
|
-
}
|
|
27980
|
-
),
|
|
27981
|
-
/* @__PURE__ */ (0, import_jsx_runtime214.jsxs)("div", { className: "min-w-0 flex-1", children: [
|
|
27982
|
-
/* @__PURE__ */ (0, import_jsx_runtime214.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
27983
|
-
/* @__PURE__ */ (0, import_jsx_runtime214.jsxs)("span", { className: "min-w-0 truncate text-sm font-medium", children: [
|
|
27984
|
-
item.actor && /* @__PURE__ */ (0, import_jsx_runtime214.jsxs)("span", { className: "font-semibold", children: [
|
|
27985
|
-
item.actor,
|
|
27986
|
-
" "
|
|
27987
|
-
] }),
|
|
27988
|
-
item.title
|
|
27989
|
-
] }),
|
|
27990
|
-
item.count !== void 0 && item.count > 1 && /* @__PURE__ */ (0, import_jsx_runtime214.jsxs)(Pill_default, { size: "sm", tone: "neutral", children: [
|
|
27991
|
-
"\xD7",
|
|
27992
|
-
item.count
|
|
27993
|
-
] })
|
|
27994
|
-
] }),
|
|
27995
|
-
item.description && /* @__PURE__ */ (0, import_jsx_runtime214.jsx)("p", { className: "mt-0.5 text-xs text-neutral-500 dark:text-neutral-400", children: item.description }),
|
|
27996
|
-
item.code && /* @__PURE__ */ (0, import_jsx_runtime214.jsx)("code", { className: "mt-1 inline-block rounded bg-neutral-100 px-1.5 py-0.5 font-mono text-[11px] tracking-tighter text-neutral-600 dark:bg-neutral-800 dark:text-neutral-300", children: item.code })
|
|
27997
|
-
] }),
|
|
27998
|
-
/* @__PURE__ */ (0, import_jsx_runtime214.jsx)("time", { className: "shrink-0 pt-0.5 text-xs tabular-nums text-neutral-400 dark:text-neutral-500", children: item.timestamp })
|
|
27999
|
-
] }, item.id)) }),
|
|
28000
|
-
hasMore && onLoadMore && !loading && /* @__PURE__ */ (0, import_jsx_runtime214.jsx)(
|
|
28239
|
+
),
|
|
28240
|
+
hasMore && onLoadMore && !loading && !infinite && /* @__PURE__ */ (0, import_jsx_runtime214.jsx)(
|
|
28001
28241
|
Button_default,
|
|
28002
28242
|
{
|
|
28003
28243
|
variant: loadMoreVariant ?? SURFACE_TO_BUTTON_VARIANT[variant],
|
|
28004
|
-
color:
|
|
28244
|
+
color: controlColor,
|
|
28005
28245
|
size: "sm",
|
|
28006
28246
|
className: "self-center",
|
|
28007
28247
|
onClick: onLoadMore,
|
|
@@ -28019,7 +28259,7 @@ var ActivityFeed_default = ActivityFeed;
|
|
|
28019
28259
|
var import_classnames59 = __toESM(require("classnames"), 1);
|
|
28020
28260
|
|
|
28021
28261
|
// src/components/chart/react/ChartRoot.tsx
|
|
28022
|
-
var
|
|
28262
|
+
var import_react209 = require("react");
|
|
28023
28263
|
|
|
28024
28264
|
// src/components/chart/engine/types.ts
|
|
28025
28265
|
function readAccessor(accessor, item, index) {
|
|
@@ -28414,16 +28654,6 @@ function getEasing(name) {
|
|
|
28414
28654
|
if (!name) return EASING_FUNCTIONS[DEFAULT_EASING];
|
|
28415
28655
|
return EASING_FUNCTIONS[name] ?? EASING_FUNCTIONS[DEFAULT_EASING];
|
|
28416
28656
|
}
|
|
28417
|
-
function prefersReducedMotion() {
|
|
28418
|
-
if (typeof window === "undefined" || typeof window.matchMedia !== "function") {
|
|
28419
|
-
return false;
|
|
28420
|
-
}
|
|
28421
|
-
try {
|
|
28422
|
-
return window.matchMedia("(prefers-reduced-motion: reduce)").matches;
|
|
28423
|
-
} catch {
|
|
28424
|
-
return false;
|
|
28425
|
-
}
|
|
28426
|
-
}
|
|
28427
28657
|
function isAnimationInstant(config, reducedMotion) {
|
|
28428
28658
|
if (reducedMotion) return true;
|
|
28429
28659
|
if (config === void 0) return false;
|
|
@@ -29957,7 +30187,7 @@ function layoutAnnotationCards(inputs, bounds) {
|
|
|
29957
30187
|
}
|
|
29958
30188
|
|
|
29959
30189
|
// src/hooks/useTheme.ts
|
|
29960
|
-
var
|
|
30190
|
+
var import_react205 = require("react");
|
|
29961
30191
|
var STORAGE_KEY = "ui-kit-demo-theme";
|
|
29962
30192
|
function getStoredTheme() {
|
|
29963
30193
|
if (typeof window === "undefined") return "light";
|
|
@@ -29984,18 +30214,18 @@ function applyTheme(mode) {
|
|
|
29984
30214
|
}
|
|
29985
30215
|
}
|
|
29986
30216
|
function useTheme() {
|
|
29987
|
-
const [theme, setTheme] = (0,
|
|
29988
|
-
const [effectiveTheme, setEffectiveTheme] = (0,
|
|
30217
|
+
const [theme, setTheme] = (0, import_react205.useState)(getStoredTheme);
|
|
30218
|
+
const [effectiveTheme, setEffectiveTheme] = (0, import_react205.useState)(() => {
|
|
29989
30219
|
const t = getStoredTheme();
|
|
29990
30220
|
return t === "system" ? isSystemDark() ? "dark" : "light" : t;
|
|
29991
30221
|
});
|
|
29992
|
-
(0,
|
|
30222
|
+
(0, import_react205.useLayoutEffect)(() => {
|
|
29993
30223
|
applyTheme(theme);
|
|
29994
30224
|
}, [theme]);
|
|
29995
|
-
(0,
|
|
30225
|
+
(0, import_react205.useEffect)(() => {
|
|
29996
30226
|
setEffectiveTheme(theme === "system" ? isSystemDark() ? "dark" : "light" : theme);
|
|
29997
30227
|
}, [theme]);
|
|
29998
|
-
(0,
|
|
30228
|
+
(0, import_react205.useEffect)(() => {
|
|
29999
30229
|
if (typeof window === "undefined") return;
|
|
30000
30230
|
if (theme !== "system") return;
|
|
30001
30231
|
const mql = window.matchMedia("(prefers-color-scheme: dark)");
|
|
@@ -30011,24 +30241,24 @@ function useTheme() {
|
|
|
30011
30241
|
}
|
|
30012
30242
|
|
|
30013
30243
|
// src/components/chart/react/ChartGroup.tsx
|
|
30014
|
-
var
|
|
30244
|
+
var import_react206 = require("react");
|
|
30015
30245
|
var import_jsx_runtime215 = require("react/jsx-runtime");
|
|
30016
|
-
var ChartGroupContext = (0,
|
|
30246
|
+
var ChartGroupContext = (0, import_react206.createContext)(null);
|
|
30017
30247
|
function useChartGroup() {
|
|
30018
|
-
return (0,
|
|
30248
|
+
return (0, import_react206.useContext)(ChartGroupContext);
|
|
30019
30249
|
}
|
|
30020
30250
|
function ChartGroup({ children }) {
|
|
30021
|
-
const membersRef = (0,
|
|
30022
|
-
const register = (0,
|
|
30251
|
+
const membersRef = (0, import_react206.useRef)(/* @__PURE__ */ new Map());
|
|
30252
|
+
const register = (0, import_react206.useCallback)(
|
|
30023
30253
|
(id, apply) => {
|
|
30024
30254
|
membersRef.current.set(id, apply);
|
|
30025
30255
|
},
|
|
30026
30256
|
[]
|
|
30027
30257
|
);
|
|
30028
|
-
const unregister = (0,
|
|
30258
|
+
const unregister = (0, import_react206.useCallback)((id) => {
|
|
30029
30259
|
membersRef.current.delete(id);
|
|
30030
30260
|
}, []);
|
|
30031
|
-
const broadcast = (0,
|
|
30261
|
+
const broadcast = (0, import_react206.useCallback)(
|
|
30032
30262
|
(rawX, sourceId) => {
|
|
30033
30263
|
for (const [id, apply] of membersRef.current) {
|
|
30034
30264
|
if (id !== sourceId) apply(rawX);
|
|
@@ -30129,11 +30359,11 @@ var ChartSkeleton = ({
|
|
|
30129
30359
|
ChartSkeleton.displayName = "ChartSkeleton";
|
|
30130
30360
|
|
|
30131
30361
|
// src/components/chart/react/ChartContext.tsx
|
|
30132
|
-
var
|
|
30133
|
-
var ChartContext = (0,
|
|
30362
|
+
var import_react207 = require("react");
|
|
30363
|
+
var ChartContext = (0, import_react207.createContext)(null);
|
|
30134
30364
|
var ChartContextProvider = ChartContext.Provider;
|
|
30135
30365
|
function useChart() {
|
|
30136
|
-
const ctx = (0,
|
|
30366
|
+
const ctx = (0, import_react207.useContext)(ChartContext);
|
|
30137
30367
|
if (!ctx) {
|
|
30138
30368
|
throw new Error(
|
|
30139
30369
|
"useChart() must be called inside <Chart.Svg> or <Chart.Canvas>."
|
|
@@ -30143,7 +30373,7 @@ function useChart() {
|
|
|
30143
30373
|
}
|
|
30144
30374
|
|
|
30145
30375
|
// src/components/chart/react/series-utils.ts
|
|
30146
|
-
var
|
|
30376
|
+
var import_react208 = require("react");
|
|
30147
30377
|
|
|
30148
30378
|
// src/components/chart/react/dash.ts
|
|
30149
30379
|
var DASH_PATTERNS = {
|
|
@@ -30168,7 +30398,7 @@ function flattenChartChildren(children) {
|
|
|
30168
30398
|
}
|
|
30169
30399
|
if (node !== null && typeof node === "object") {
|
|
30170
30400
|
const el = node;
|
|
30171
|
-
if (el.type ===
|
|
30401
|
+
if (el.type === import_react208.Fragment && el.props?.children != null) {
|
|
30172
30402
|
visit(el.props.children);
|
|
30173
30403
|
return;
|
|
30174
30404
|
}
|
|
@@ -31041,11 +31271,11 @@ function ChartRootImpl({
|
|
|
31041
31271
|
renderer
|
|
31042
31272
|
}) {
|
|
31043
31273
|
const hoverDimValue = Math.max(0, Math.min(1, hoverDim ?? 1));
|
|
31044
|
-
const containerRef = (0,
|
|
31045
|
-
const [width, setWidth] = (0,
|
|
31274
|
+
const containerRef = (0, import_react209.useRef)(null);
|
|
31275
|
+
const [width, setWidth] = (0, import_react209.useState)(800);
|
|
31046
31276
|
const height = heightProp ?? 400;
|
|
31047
31277
|
const { effectiveTheme } = useTheme();
|
|
31048
|
-
(0,
|
|
31278
|
+
(0, import_react209.useEffect)(() => {
|
|
31049
31279
|
const el = containerRef.current;
|
|
31050
31280
|
if (!el) return;
|
|
31051
31281
|
const measure = () => {
|
|
@@ -31060,7 +31290,7 @@ function ChartRootImpl({
|
|
|
31060
31290
|
}
|
|
31061
31291
|
}, []);
|
|
31062
31292
|
const reg = getRegistry();
|
|
31063
|
-
const summary = (0,
|
|
31293
|
+
const summary = (0, import_react209.useMemo)(
|
|
31064
31294
|
() => reg ? summarizeChildren(children, reg) : EMPTY_SUMMARY,
|
|
31065
31295
|
// children identity changes when the parent re-renders — that is the
|
|
31066
31296
|
// trigger we want (prop changes flow through).
|
|
@@ -31081,10 +31311,10 @@ function ChartRootImpl({
|
|
|
31081
31311
|
const showXAxis = axesEnabled && (hasCartesian || summary.hasXAxis);
|
|
31082
31312
|
const showYAxis = axesEnabled && hasCartesian;
|
|
31083
31313
|
const needsRightYAxis = summary.yAxisRight || cartesianSeries.some((d) => d.yFieldAxis === "right");
|
|
31084
|
-
const [hiddenIds, setHiddenIds] = (0,
|
|
31314
|
+
const [hiddenIds, setHiddenIds] = (0, import_react209.useState)(
|
|
31085
31315
|
() => /* @__PURE__ */ new Set()
|
|
31086
31316
|
);
|
|
31087
|
-
const toggleSeries = (0,
|
|
31317
|
+
const toggleSeries = (0, import_react209.useCallback)((id) => {
|
|
31088
31318
|
setHiddenIds((prev) => {
|
|
31089
31319
|
const next = new Set(prev);
|
|
31090
31320
|
if (next.has(id)) next.delete(id);
|
|
@@ -31093,8 +31323,8 @@ function ChartRootImpl({
|
|
|
31093
31323
|
});
|
|
31094
31324
|
}, []);
|
|
31095
31325
|
const themeName = themeMode === "light" || themeMode === "dark" ? themeMode : effectiveTheme;
|
|
31096
|
-
const tokens = (0,
|
|
31097
|
-
const layout = (0,
|
|
31326
|
+
const tokens = (0, import_react209.useMemo)(() => getChartTheme(themeName), [themeName]);
|
|
31327
|
+
const layout = (0, import_react209.useMemo)(
|
|
31098
31328
|
() => computeLayout({
|
|
31099
31329
|
width,
|
|
31100
31330
|
height,
|
|
@@ -31123,11 +31353,11 @@ function ChartRootImpl({
|
|
|
31123
31353
|
]
|
|
31124
31354
|
);
|
|
31125
31355
|
const area2 = layout.chartArea;
|
|
31126
|
-
const heatmapSeries = (0,
|
|
31356
|
+
const heatmapSeries = (0, import_react209.useMemo)(
|
|
31127
31357
|
() => summary.series.filter((d) => d.type === "heatmap"),
|
|
31128
31358
|
[summary.series]
|
|
31129
31359
|
);
|
|
31130
|
-
const heatmapLayout = (0,
|
|
31360
|
+
const heatmapLayout = (0, import_react209.useMemo)(() => {
|
|
31131
31361
|
const me = heatmapSeries[0];
|
|
31132
31362
|
if (!me) return null;
|
|
31133
31363
|
const rows = me.heatmapRows ?? [];
|
|
@@ -31145,11 +31375,11 @@ function ChartRootImpl({
|
|
|
31145
31375
|
});
|
|
31146
31376
|
return { descriptor: me, rows, cols, layout: layout2, gutter };
|
|
31147
31377
|
}, [heatmapSeries, area2]);
|
|
31148
|
-
const treemapSeries = (0,
|
|
31378
|
+
const treemapSeries = (0, import_react209.useMemo)(
|
|
31149
31379
|
() => summary.series.filter((d) => d.type === "treemap"),
|
|
31150
31380
|
[summary.series]
|
|
31151
31381
|
);
|
|
31152
|
-
const treemapLayout = (0,
|
|
31382
|
+
const treemapLayout = (0, import_react209.useMemo)(() => {
|
|
31153
31383
|
const me = treemapSeries[0];
|
|
31154
31384
|
if (!me || !me.treemapItems?.length) return null;
|
|
31155
31385
|
const items = me.treemapItems;
|
|
@@ -31174,11 +31404,11 @@ function ChartRootImpl({
|
|
|
31174
31404
|
});
|
|
31175
31405
|
return { descriptor: me, items, grouped, layout: layout2, groupDataIdx };
|
|
31176
31406
|
}, [treemapSeries, area2]);
|
|
31177
|
-
const funnelSeries = (0,
|
|
31407
|
+
const funnelSeries = (0, import_react209.useMemo)(
|
|
31178
31408
|
() => summary.series.filter((d) => d.type === "funnel"),
|
|
31179
31409
|
[summary.series]
|
|
31180
31410
|
);
|
|
31181
|
-
const funnelLayout = (0,
|
|
31411
|
+
const funnelLayout = (0, import_react209.useMemo)(() => {
|
|
31182
31412
|
const me = funnelSeries[0];
|
|
31183
31413
|
if (!me || !me.funnelItems?.length) return null;
|
|
31184
31414
|
const base = me.funnelColor ?? (typeof me.color === "string" ? me.color : void 0) ?? DEFAULT_SERIES_PALETTE[me.paletteIndex % DEFAULT_SERIES_PALETTE.length];
|
|
@@ -31196,7 +31426,7 @@ function ChartRootImpl({
|
|
|
31196
31426
|
}
|
|
31197
31427
|
);
|
|
31198
31428
|
}, [funnelSeries, area2]);
|
|
31199
|
-
const radarLayout = (0,
|
|
31429
|
+
const radarLayout = (0, import_react209.useMemo)(() => {
|
|
31200
31430
|
if (!hasRadar || area2.width <= 0 || area2.height <= 0) return null;
|
|
31201
31431
|
const first = radarSeries[0];
|
|
31202
31432
|
const axes2 = [];
|
|
@@ -31235,7 +31465,7 @@ function ChartRootImpl({
|
|
|
31235
31465
|
axes: axes2
|
|
31236
31466
|
};
|
|
31237
31467
|
}, [hasRadar, area2, radarSeries, summary.radarAxis]);
|
|
31238
|
-
const radarGrid = (0,
|
|
31468
|
+
const radarGrid = (0, import_react209.useMemo)(() => {
|
|
31239
31469
|
if (!radarLayout) return null;
|
|
31240
31470
|
return computeRadarGrid({
|
|
31241
31471
|
axes: radarLayout.axes,
|
|
@@ -31247,7 +31477,7 @@ function ChartRootImpl({
|
|
|
31247
31477
|
format: summary.radarAxis?.tickFormat
|
|
31248
31478
|
});
|
|
31249
31479
|
}, [radarLayout, summary.radarAxis]);
|
|
31250
|
-
const polarLayout = (0,
|
|
31480
|
+
const polarLayout = (0, import_react209.useMemo)(() => {
|
|
31251
31481
|
if (!hasPolar || area2.width <= 0 || area2.height <= 0) return null;
|
|
31252
31482
|
const first = polarSeries[0];
|
|
31253
31483
|
const cats = [];
|
|
@@ -31334,7 +31564,7 @@ function ChartRootImpl({
|
|
|
31334
31564
|
categoryTotals
|
|
31335
31565
|
};
|
|
31336
31566
|
}, [hasPolar, area2, polarSeries, summary.polarAxis]);
|
|
31337
|
-
const polarGrid = (0,
|
|
31567
|
+
const polarGrid = (0, import_react209.useMemo)(() => {
|
|
31338
31568
|
if (!polarLayout) return null;
|
|
31339
31569
|
return computePolarGrid({
|
|
31340
31570
|
categories: polarLayout.categories,
|
|
@@ -31348,7 +31578,7 @@ function ChartRootImpl({
|
|
|
31348
31578
|
innerR: polarLayout.innerR
|
|
31349
31579
|
});
|
|
31350
31580
|
}, [polarLayout, summary.polarAxis]);
|
|
31351
|
-
const radarGridSpec = (0,
|
|
31581
|
+
const radarGridSpec = (0, import_react209.useMemo)(
|
|
31352
31582
|
() => resolveGrid(
|
|
31353
31583
|
{
|
|
31354
31584
|
gridStyle: summary.radarAxis?.gridStyle,
|
|
@@ -31360,7 +31590,7 @@ function ChartRootImpl({
|
|
|
31360
31590
|
),
|
|
31361
31591
|
[summary.radarAxis, tokens.gridColor]
|
|
31362
31592
|
);
|
|
31363
|
-
const polarGridSpec = (0,
|
|
31593
|
+
const polarGridSpec = (0, import_react209.useMemo)(
|
|
31364
31594
|
() => resolveGrid(
|
|
31365
31595
|
{
|
|
31366
31596
|
gridStyle: summary.polarAxis?.gridStyle,
|
|
@@ -31372,7 +31602,7 @@ function ChartRootImpl({
|
|
|
31372
31602
|
),
|
|
31373
31603
|
[summary.polarAxis, tokens.gridColor]
|
|
31374
31604
|
);
|
|
31375
|
-
const xDomainValues = (0,
|
|
31605
|
+
const xDomainValues = (0, import_react209.useMemo)(
|
|
31376
31606
|
() => {
|
|
31377
31607
|
if (transposed) {
|
|
31378
31608
|
const vals = [];
|
|
@@ -31388,7 +31618,7 @@ function ChartRootImpl({
|
|
|
31388
31618
|
[cartesianSeries, transposed]
|
|
31389
31619
|
);
|
|
31390
31620
|
const xIsTime = isTimeDomain(xDomainValues);
|
|
31391
|
-
const xScale = (0,
|
|
31621
|
+
const xScale = (0, import_react209.useMemo)(() => {
|
|
31392
31622
|
if (!hasCartesian || xDomainValues.length === 0) return null;
|
|
31393
31623
|
const range = [area2.x, area2.x + area2.width];
|
|
31394
31624
|
if (xIsTime) {
|
|
@@ -31436,7 +31666,7 @@ function ChartRootImpl({
|
|
|
31436
31666
|
transposed
|
|
31437
31667
|
]);
|
|
31438
31668
|
const xIsCategorical = xScale !== null && "bandWidth" in xScale;
|
|
31439
|
-
const leftYDomain = (0,
|
|
31669
|
+
const leftYDomain = (0, import_react209.useMemo)(
|
|
31440
31670
|
() => computeYDomain(
|
|
31441
31671
|
cartesianSeries.filter((d) => d.yFieldAxis !== "right"),
|
|
31442
31672
|
hiddenIds,
|
|
@@ -31444,7 +31674,7 @@ function ChartRootImpl({
|
|
|
31444
31674
|
),
|
|
31445
31675
|
[cartesianSeries, hiddenIds, summary.yAxisLeft.domain]
|
|
31446
31676
|
);
|
|
31447
|
-
const yScale = (0,
|
|
31677
|
+
const yScale = (0, import_react209.useMemo)(() => {
|
|
31448
31678
|
if (!hasCartesian) return null;
|
|
31449
31679
|
if (transposed) {
|
|
31450
31680
|
const cats = [];
|
|
@@ -31488,11 +31718,11 @@ function ChartRootImpl({
|
|
|
31488
31718
|
cartesianSeries
|
|
31489
31719
|
]);
|
|
31490
31720
|
const yCont = yScale !== null && !("bandWidth" in yScale) ? yScale : null;
|
|
31491
|
-
const rightSeries = (0,
|
|
31721
|
+
const rightSeries = (0, import_react209.useMemo)(
|
|
31492
31722
|
() => cartesianSeries.filter((d) => d.yFieldAxis === "right"),
|
|
31493
31723
|
[cartesianSeries]
|
|
31494
31724
|
);
|
|
31495
|
-
const rightYScale = (0,
|
|
31725
|
+
const rightYScale = (0, import_react209.useMemo)(() => {
|
|
31496
31726
|
if (!needsRightYAxis || rightSeries.length === 0) return null;
|
|
31497
31727
|
const range = [area2.y + area2.height, area2.y];
|
|
31498
31728
|
if (summary.yAxisRightLog) {
|
|
@@ -31507,12 +31737,12 @@ function ChartRootImpl({
|
|
|
31507
31737
|
range
|
|
31508
31738
|
});
|
|
31509
31739
|
}, [needsRightYAxis, rightSeries, hiddenIds, area2, summary.yAxisRightLog]);
|
|
31510
|
-
const scatterSeries = (0,
|
|
31740
|
+
const scatterSeries = (0, import_react209.useMemo)(
|
|
31511
31741
|
() => summary.series.filter((d) => d.type === "scatter"),
|
|
31512
31742
|
[summary.series]
|
|
31513
31743
|
);
|
|
31514
31744
|
const hasScatter = scatterSeries.length > 0;
|
|
31515
|
-
const scatterLayout = (0,
|
|
31745
|
+
const scatterLayout = (0, import_react209.useMemo)(() => {
|
|
31516
31746
|
if (!hasScatter || !xScale || !yScale) return null;
|
|
31517
31747
|
return scatterSeries.map((d) => {
|
|
31518
31748
|
const vs = d.yFieldAxis === "right" && rightYScale ? rightYScale : yScale;
|
|
@@ -31539,7 +31769,7 @@ function ChartRootImpl({
|
|
|
31539
31769
|
yScale,
|
|
31540
31770
|
rightYScale
|
|
31541
31771
|
]);
|
|
31542
|
-
const series = (0,
|
|
31772
|
+
const series = (0, import_react209.useMemo)(
|
|
31543
31773
|
() => summary.series.map((d) => {
|
|
31544
31774
|
const [colors3] = resolveSeriesColors([d], DEFAULT_SERIES_PALETTE);
|
|
31545
31775
|
return { descriptor: d, ...colors3, hidden: hiddenIds.has(d.id) };
|
|
@@ -31551,7 +31781,7 @@ function ChartRootImpl({
|
|
|
31551
31781
|
const easingName = animation ? animation.easing ?? "easeOutQuart" : "linear";
|
|
31552
31782
|
const animType = typeof animation === "object" && animation !== null ? animation.type ?? "grow" : "grow";
|
|
31553
31783
|
const elements = flattenChartChildren(children);
|
|
31554
|
-
const seriesTokens = (0,
|
|
31784
|
+
const seriesTokens = (0, import_react209.useMemo)(() => {
|
|
31555
31785
|
const map = /* @__PURE__ */ new Map();
|
|
31556
31786
|
let k = 0;
|
|
31557
31787
|
for (const c of elements) {
|
|
@@ -31565,7 +31795,7 @@ function ChartRootImpl({
|
|
|
31565
31795
|
}
|
|
31566
31796
|
return map;
|
|
31567
31797
|
}, [elements, series, reg]);
|
|
31568
|
-
const annotationLayout = (0,
|
|
31798
|
+
const annotationLayout = (0, import_react209.useMemo)(() => {
|
|
31569
31799
|
const map = /* @__PURE__ */ new Map();
|
|
31570
31800
|
if (!reg || !reg.Annotation) return map;
|
|
31571
31801
|
const inputs = [];
|
|
@@ -31617,16 +31847,16 @@ function ChartRootImpl({
|
|
|
31617
31847
|
});
|
|
31618
31848
|
return map;
|
|
31619
31849
|
}, [elements, reg, xScale, yScale, area2, width, height, transposed]);
|
|
31620
|
-
const [progress, setProgress] = (0,
|
|
31621
|
-
const progressRef = (0,
|
|
31850
|
+
const [progress, setProgress] = (0, import_react209.useState)(animationsDisabled ? 1 : 0);
|
|
31851
|
+
const progressRef = (0, import_react209.useRef)(progress);
|
|
31622
31852
|
const settled = progress >= 1;
|
|
31623
|
-
const canvasRef = (0,
|
|
31624
|
-
const drawFnsRef = (0,
|
|
31625
|
-
const piePresentationsRef = (0,
|
|
31626
|
-
const drawOnceRef = (0,
|
|
31853
|
+
const canvasRef = (0, import_react209.useRef)(null);
|
|
31854
|
+
const drawFnsRef = (0, import_react209.useRef)(/* @__PURE__ */ new Map());
|
|
31855
|
+
const piePresentationsRef = (0, import_react209.useRef)(/* @__PURE__ */ new Map());
|
|
31856
|
+
const drawOnceRef = (0, import_react209.useRef)(() => {
|
|
31627
31857
|
});
|
|
31628
|
-
const rafRef = (0,
|
|
31629
|
-
const [redrawNonce, setRedrawNonce] = (0,
|
|
31858
|
+
const rafRef = (0, import_react209.useRef)(null);
|
|
31859
|
+
const [redrawNonce, setRedrawNonce] = (0, import_react209.useState)(0);
|
|
31630
31860
|
drawOnceRef.current = () => {
|
|
31631
31861
|
const canvas = canvasRef.current;
|
|
31632
31862
|
if (!canvas) return;
|
|
@@ -31650,7 +31880,7 @@ function ChartRootImpl({
|
|
|
31650
31880
|
for (const e of entries.filter(([, d]) => d.layer === "front"))
|
|
31651
31881
|
e[1].fn(ctx, state);
|
|
31652
31882
|
};
|
|
31653
|
-
const scheduleCanvasDraw = (0,
|
|
31883
|
+
const scheduleCanvasDraw = (0, import_react209.useCallback)(() => {
|
|
31654
31884
|
if (renderer !== "canvas") return;
|
|
31655
31885
|
if (rafRef.current != null) return;
|
|
31656
31886
|
rafRef.current = requestAnimationFrame(() => {
|
|
@@ -31658,21 +31888,21 @@ function ChartRootImpl({
|
|
|
31658
31888
|
drawOnceRef.current();
|
|
31659
31889
|
});
|
|
31660
31890
|
}, [renderer]);
|
|
31661
|
-
const registerDraw = (0,
|
|
31891
|
+
const registerDraw = (0, import_react209.useCallback)(
|
|
31662
31892
|
(id, fn, layer = "front") => {
|
|
31663
31893
|
drawFnsRef.current.set(id, { fn, layer });
|
|
31664
31894
|
scheduleCanvasDraw();
|
|
31665
31895
|
},
|
|
31666
31896
|
[scheduleCanvasDraw]
|
|
31667
31897
|
);
|
|
31668
|
-
const unregisterDraw = (0,
|
|
31898
|
+
const unregisterDraw = (0, import_react209.useCallback)(
|
|
31669
31899
|
(id) => {
|
|
31670
31900
|
drawFnsRef.current.delete(id);
|
|
31671
31901
|
scheduleCanvasDraw();
|
|
31672
31902
|
},
|
|
31673
31903
|
[scheduleCanvasDraw]
|
|
31674
31904
|
);
|
|
31675
|
-
(0,
|
|
31905
|
+
(0, import_react209.useEffect)(() => {
|
|
31676
31906
|
if (!radarGrid || renderer !== "canvas") return;
|
|
31677
31907
|
const g = radarGrid;
|
|
31678
31908
|
const showLabels = summary.radarAxis?.showAxisLabels !== false;
|
|
@@ -31722,7 +31952,7 @@ function ChartRootImpl({
|
|
|
31722
31952
|
);
|
|
31723
31953
|
return () => unregisterDraw("radar-grid");
|
|
31724
31954
|
}, [radarGrid, renderer, registerDraw, unregisterDraw, tokens, summary.radarAxis, radarGridSpec]);
|
|
31725
|
-
(0,
|
|
31955
|
+
(0, import_react209.useEffect)(() => {
|
|
31726
31956
|
if (!polarGrid || !polarLayout || renderer !== "canvas") return;
|
|
31727
31957
|
const g = polarGrid;
|
|
31728
31958
|
const showTickLabels = summary.polarAxis?.showTickLabels === true;
|
|
@@ -31775,14 +32005,14 @@ function ChartRootImpl({
|
|
|
31775
32005
|
);
|
|
31776
32006
|
return () => unregisterDraw("polar-grid");
|
|
31777
32007
|
}, [polarGrid, polarLayout, renderer, registerDraw, unregisterDraw, tokens, summary.polarAxis, polarGridSpec, polarSeries]);
|
|
31778
|
-
const requestRedraw = (0,
|
|
31779
|
-
(0,
|
|
32008
|
+
const requestRedraw = (0, import_react209.useCallback)(() => setRedrawNonce((n) => n + 1), []);
|
|
32009
|
+
(0, import_react209.useImperativeHandle)(
|
|
31780
32010
|
hostRef,
|
|
31781
32011
|
() => ({ redraw: requestRedraw }),
|
|
31782
32012
|
[requestRedraw]
|
|
31783
32013
|
);
|
|
31784
|
-
const animatorRef = (0,
|
|
31785
|
-
const runAnimation = (0,
|
|
32014
|
+
const animatorRef = (0, import_react209.useRef)(null);
|
|
32015
|
+
const runAnimation = (0, import_react209.useCallback)(
|
|
31786
32016
|
(immediate) => {
|
|
31787
32017
|
animatorRef.current?.cancel();
|
|
31788
32018
|
if (immediate) {
|
|
@@ -31810,7 +32040,7 @@ function ChartRootImpl({
|
|
|
31810
32040
|
},
|
|
31811
32041
|
[duration, easingName, renderer, scheduleCanvasDraw]
|
|
31812
32042
|
);
|
|
31813
|
-
const dataSig = (0,
|
|
32043
|
+
const dataSig = (0, import_react209.useMemo)(() => {
|
|
31814
32044
|
const parts = summary.series.map((d) => {
|
|
31815
32045
|
const a = d.data;
|
|
31816
32046
|
return `${d.id}:${a.length}:${JSON.stringify(a[0] ?? null)}:${JSON.stringify(
|
|
@@ -31819,21 +32049,21 @@ function ChartRootImpl({
|
|
|
31819
32049
|
});
|
|
31820
32050
|
return parts.join("|") + "##" + Array.from(hiddenIds).sort().join(",");
|
|
31821
32051
|
}, [summary.series, hiddenIds]);
|
|
31822
|
-
(0,
|
|
32052
|
+
(0, import_react209.useEffect)(() => {
|
|
31823
32053
|
runAnimation(animationsDisabled);
|
|
31824
32054
|
}, [dataSig, animationsDisabled, runAnimation]);
|
|
31825
|
-
(0,
|
|
31826
|
-
const [hover, setHover] = (0,
|
|
32055
|
+
(0, import_react209.useEffect)(() => () => animatorRef.current?.cancel(), []);
|
|
32056
|
+
const [hover, setHover] = (0, import_react209.useState)(null);
|
|
31827
32057
|
const group = useChartGroup();
|
|
31828
|
-
const syncId = (0,
|
|
32058
|
+
const syncId = (0, import_react209.useId)();
|
|
31829
32059
|
const syncing = Boolean(sync && group);
|
|
31830
|
-
const lastSyncedRef = (0,
|
|
31831
|
-
const computeHoverRef = (0,
|
|
31832
|
-
const xScaleRef = (0,
|
|
32060
|
+
const lastSyncedRef = (0, import_react209.useRef)(void 0);
|
|
32061
|
+
const computeHoverRef = (0, import_react209.useRef)(null);
|
|
32062
|
+
const xScaleRef = (0, import_react209.useRef)(xScale);
|
|
31833
32063
|
xScaleRef.current = xScale;
|
|
31834
|
-
const areaRef = (0,
|
|
32064
|
+
const areaRef = (0, import_react209.useRef)(area2);
|
|
31835
32065
|
areaRef.current = area2;
|
|
31836
|
-
const broadcastSync = (0,
|
|
32066
|
+
const broadcastSync = (0, import_react209.useCallback)(
|
|
31837
32067
|
(rawX) => {
|
|
31838
32068
|
if (!group || !syncing) return;
|
|
31839
32069
|
if (rawX === lastSyncedRef.current) return;
|
|
@@ -31842,7 +32072,7 @@ function ChartRootImpl({
|
|
|
31842
32072
|
},
|
|
31843
32073
|
[group, syncing, syncId]
|
|
31844
32074
|
);
|
|
31845
|
-
const applySync = (0,
|
|
32075
|
+
const applySync = (0, import_react209.useCallback)(
|
|
31846
32076
|
(rawX) => {
|
|
31847
32077
|
if (rawX == null) {
|
|
31848
32078
|
setHover(null);
|
|
@@ -31866,12 +32096,12 @@ function ChartRootImpl({
|
|
|
31866
32096
|
},
|
|
31867
32097
|
[]
|
|
31868
32098
|
);
|
|
31869
|
-
(0,
|
|
32099
|
+
(0, import_react209.useEffect)(() => {
|
|
31870
32100
|
if (!group || !syncing) return;
|
|
31871
32101
|
group.register(syncId, applySync);
|
|
31872
32102
|
return () => group.unregister(syncId);
|
|
31873
32103
|
}, [group, syncing, syncId, applySync]);
|
|
31874
|
-
(0,
|
|
32104
|
+
(0, import_react209.useEffect)(() => {
|
|
31875
32105
|
if (renderer === "canvas") scheduleCanvasDraw();
|
|
31876
32106
|
}, [
|
|
31877
32107
|
renderer,
|
|
@@ -31884,7 +32114,7 @@ function ChartRootImpl({
|
|
|
31884
32114
|
hover,
|
|
31885
32115
|
scheduleCanvasDraw
|
|
31886
32116
|
]);
|
|
31887
|
-
const computeHover = (0,
|
|
32117
|
+
const computeHover = (0, import_react209.useCallback)(
|
|
31888
32118
|
(px, py) => {
|
|
31889
32119
|
const visible = series.filter((s) => !s.hidden);
|
|
31890
32120
|
if (visible.length === 0) return null;
|
|
@@ -32476,7 +32706,7 @@ function ChartRootImpl({
|
|
|
32476
32706
|
);
|
|
32477
32707
|
computeHoverRef.current = computeHover;
|
|
32478
32708
|
const hoverEnabled = summary.hoverEnabled;
|
|
32479
|
-
const handlePointerMove = (0,
|
|
32709
|
+
const handlePointerMove = (0, import_react209.useCallback)(
|
|
32480
32710
|
(e) => {
|
|
32481
32711
|
if (!hoverEnabled) return;
|
|
32482
32712
|
const target = e.currentTarget;
|
|
@@ -32497,11 +32727,11 @@ function ChartRootImpl({
|
|
|
32497
32727
|
},
|
|
32498
32728
|
[hoverEnabled, computeHover, area2, broadcastSync]
|
|
32499
32729
|
);
|
|
32500
|
-
const handlePointerLeave = (0,
|
|
32730
|
+
const handlePointerLeave = (0, import_react209.useCallback)(() => {
|
|
32501
32731
|
setHover(null);
|
|
32502
32732
|
broadcastSync(null);
|
|
32503
32733
|
}, [broadcastSync]);
|
|
32504
|
-
const seriesEndpoints = (0,
|
|
32734
|
+
const seriesEndpoints = (0, import_react209.useMemo)(() => {
|
|
32505
32735
|
const out = [];
|
|
32506
32736
|
if (!xScale || !yScale) return out;
|
|
32507
32737
|
for (const s of series) {
|
|
@@ -32533,7 +32763,7 @@ function ChartRootImpl({
|
|
|
32533
32763
|
const isEmpty2 = summary.series.length === 0 || summary.series.every(
|
|
32534
32764
|
(d) => d.type === "gauge" ? false : d.data.length === 0
|
|
32535
32765
|
);
|
|
32536
|
-
const ctxValue = (0,
|
|
32766
|
+
const ctxValue = (0, import_react209.useMemo)(
|
|
32537
32767
|
() => ({
|
|
32538
32768
|
renderer,
|
|
32539
32769
|
width,
|
|
@@ -32637,7 +32867,7 @@ function ChartRootImpl({
|
|
|
32637
32867
|
else if (el.type === reg?.Hover) {
|
|
32638
32868
|
} else if (el.type === reg?.Line || el.type === reg?.Bar || el.type === reg?.Pie || el.type === reg?.Candlestick || el.type === reg?.RangeArea || el.type === reg?.Radar || el.type === reg?.Polar || el.type === reg?.Gauge || el.type === reg?.Waterfall || el.type === reg?.Heatmap || el.type === reg?.Treemap) {
|
|
32639
32869
|
plotChildren.push(
|
|
32640
|
-
(0,
|
|
32870
|
+
(0, import_react209.cloneElement)(c, {
|
|
32641
32871
|
__chartSeriesToken: c
|
|
32642
32872
|
})
|
|
32643
32873
|
);
|
|
@@ -32647,7 +32877,7 @@ function ChartRootImpl({
|
|
|
32647
32877
|
} else if (el.type === reg?.Annotation) {
|
|
32648
32878
|
annotationIndex += 1;
|
|
32649
32879
|
plotChildren.push(
|
|
32650
|
-
(0,
|
|
32880
|
+
(0, import_react209.cloneElement)(c, {
|
|
32651
32881
|
__chartAnnotationToken: c,
|
|
32652
32882
|
__chartAnnotationIndex: annotationIndex
|
|
32653
32883
|
})
|
|
@@ -32957,17 +33187,17 @@ function ensureChartKeyframes() {
|
|
|
32957
33187
|
keyframesInjected = true;
|
|
32958
33188
|
}
|
|
32959
33189
|
var defaultErrorNode = /* @__PURE__ */ (0, import_jsx_runtime217.jsx)("span", { style: { color: "#f87171", fontSize: 13 }, children: "Chart failed to render" });
|
|
32960
|
-
var ChartSvg = (0,
|
|
33190
|
+
var ChartSvg = (0, import_react209.forwardRef)(
|
|
32961
33191
|
(props, ref) => /* @__PURE__ */ (0, import_jsx_runtime217.jsx)(ChartRootImpl, { ...props, renderer: "svg", hostRef: ref })
|
|
32962
33192
|
);
|
|
32963
|
-
var ChartCanvas = (0,
|
|
33193
|
+
var ChartCanvas = (0, import_react209.forwardRef)(
|
|
32964
33194
|
(props, ref) => /* @__PURE__ */ (0, import_jsx_runtime217.jsx)(ChartRootImpl, { ...props, renderer: "canvas", hostRef: ref })
|
|
32965
33195
|
);
|
|
32966
33196
|
ChartSvg.displayName = "Chart.Svg";
|
|
32967
33197
|
ChartCanvas.displayName = "Chart.Canvas";
|
|
32968
33198
|
|
|
32969
33199
|
// src/components/chart/react/series/LineSeries.tsx
|
|
32970
|
-
var
|
|
33200
|
+
var import_react210 = require("react");
|
|
32971
33201
|
|
|
32972
33202
|
// src/components/chart/react/series-common.ts
|
|
32973
33203
|
function findSeries(ctx, type, myId, data, token) {
|
|
@@ -33141,13 +33371,13 @@ function LineSeries(props) {
|
|
|
33141
33371
|
animType
|
|
33142
33372
|
} = ctx;
|
|
33143
33373
|
const me = findSeries(ctx, "line", props.id, props.data, props.__chartSeriesToken);
|
|
33144
|
-
const clipId = (0,
|
|
33145
|
-
const gradId = (0,
|
|
33146
|
-
const lastSigRef = (0,
|
|
33147
|
-
const lastRef = (0,
|
|
33148
|
-
const prevRef = (0,
|
|
33149
|
-
const lastBaseRef = (0,
|
|
33150
|
-
const prevBaseRef = (0,
|
|
33374
|
+
const clipId = (0, import_react210.useId)().replace(/:/g, "");
|
|
33375
|
+
const gradId = (0, import_react210.useId)().replace(/:/g, "");
|
|
33376
|
+
const lastSigRef = (0, import_react210.useRef)(null);
|
|
33377
|
+
const lastRef = (0, import_react210.useRef)(null);
|
|
33378
|
+
const prevRef = (0, import_react210.useRef)(null);
|
|
33379
|
+
const lastBaseRef = (0, import_react210.useRef)(null);
|
|
33380
|
+
const prevBaseRef = (0, import_react210.useRef)(null);
|
|
33151
33381
|
let final = null;
|
|
33152
33382
|
let finalBaseline = null;
|
|
33153
33383
|
let curve = "linear";
|
|
@@ -33243,7 +33473,7 @@ function LineSeries(props) {
|
|
|
33243
33473
|
const prevBase = progress < 1 ? prevBaseRef.current : null;
|
|
33244
33474
|
const entrance = prev === null;
|
|
33245
33475
|
const baselineY = area2.y + area2.height;
|
|
33246
|
-
(0,
|
|
33476
|
+
(0, import_react210.useEffect)(() => {
|
|
33247
33477
|
if (renderer !== "canvas" || !final || hidden) return;
|
|
33248
33478
|
const id = `series:${seriesId}`;
|
|
33249
33479
|
const fn = (c, st) => {
|
|
@@ -33483,7 +33713,7 @@ function canvasGradient(c, area2, color2) {
|
|
|
33483
33713
|
}
|
|
33484
33714
|
|
|
33485
33715
|
// src/components/chart/react/series/BarSeries.tsx
|
|
33486
|
-
var
|
|
33716
|
+
var import_react211 = require("react");
|
|
33487
33717
|
var import_jsx_runtime220 = require("react/jsx-runtime");
|
|
33488
33718
|
function frameBars(cur, prev, p, orientation, full = false) {
|
|
33489
33719
|
const baseline = cur.baseline;
|
|
@@ -33520,10 +33750,10 @@ function BarSeries(props) {
|
|
|
33520
33750
|
animationsDisabled
|
|
33521
33751
|
} = ctx;
|
|
33522
33752
|
const me = findSeries(ctx, "bar", props.id, props.data, props.__chartSeriesToken);
|
|
33523
|
-
const lastRef = (0,
|
|
33524
|
-
const prevRef = (0,
|
|
33525
|
-
const lastSigRef = (0,
|
|
33526
|
-
const clipId = (0,
|
|
33753
|
+
const lastRef = (0, import_react211.useRef)(null);
|
|
33754
|
+
const prevRef = (0, import_react211.useRef)(null);
|
|
33755
|
+
const lastSigRef = (0, import_react211.useRef)(null);
|
|
33756
|
+
const clipId = (0, import_react211.useId)().replace(/:/g, "");
|
|
33527
33757
|
let final = null;
|
|
33528
33758
|
let hidden = false;
|
|
33529
33759
|
let seriesId = "bar";
|
|
@@ -33617,7 +33847,7 @@ function BarSeries(props) {
|
|
|
33617
33847
|
lastSigRef.current = dataSig;
|
|
33618
33848
|
}
|
|
33619
33849
|
const prev = progress < 1 ? prevRef.current : null;
|
|
33620
|
-
(0,
|
|
33850
|
+
(0, import_react211.useEffect)(() => {
|
|
33621
33851
|
if (renderer !== "canvas" || !final || hidden) return;
|
|
33622
33852
|
const id = `series:${seriesId}`;
|
|
33623
33853
|
const fn = (c, st) => {
|
|
@@ -33727,7 +33957,7 @@ function BarSeries(props) {
|
|
|
33727
33957
|
|
|
33728
33958
|
// src/components/chart/react/series/PieSeries.tsx
|
|
33729
33959
|
var import_d3_shape3 = require("d3-shape");
|
|
33730
|
-
var
|
|
33960
|
+
var import_react212 = require("react");
|
|
33731
33961
|
var import_jsx_runtime221 = require("react/jsx-runtime");
|
|
33732
33962
|
var TWO_PI = Math.PI * 2;
|
|
33733
33963
|
function sweepPaths(geometry, progress) {
|
|
@@ -33833,10 +34063,10 @@ function PieSeries(props) {
|
|
|
33833
34063
|
theme
|
|
33834
34064
|
} = ctx;
|
|
33835
34065
|
const me = findSeries(ctx, "pie", props.id, props.data, props.__chartSeriesToken);
|
|
33836
|
-
const lastRef = (0,
|
|
33837
|
-
const prevRef = (0,
|
|
33838
|
-
const lastSigRef = (0,
|
|
33839
|
-
const sliceColors = (0,
|
|
34066
|
+
const lastRef = (0, import_react212.useRef)(null);
|
|
34067
|
+
const prevRef = (0, import_react212.useRef)(null);
|
|
34068
|
+
const lastSigRef = (0, import_react212.useRef)(null);
|
|
34069
|
+
const sliceColors = (0, import_react212.useMemo)(() => {
|
|
33840
34070
|
if (!me) return [];
|
|
33841
34071
|
return props.data.map((_item, i) => {
|
|
33842
34072
|
if (props.colors && props.colors.length > 0) {
|
|
@@ -33855,7 +34085,7 @@ function PieSeries(props) {
|
|
|
33855
34085
|
const hidden = me?.hidden ?? false;
|
|
33856
34086
|
const seriesId = me?.descriptor.id ?? "pie";
|
|
33857
34087
|
const baseColor = me?.color ?? "#8b5cf6";
|
|
33858
|
-
const final = (0,
|
|
34088
|
+
const final = (0, import_react212.useMemo)(() => {
|
|
33859
34089
|
if (!me) return null;
|
|
33860
34090
|
const d2 = me.descriptor;
|
|
33861
34091
|
const cx = area2.x + area2.width / 2;
|
|
@@ -33877,7 +34107,7 @@ function PieSeries(props) {
|
|
|
33877
34107
|
outerRadius: Math.max(10, outerRadius)
|
|
33878
34108
|
});
|
|
33879
34109
|
}, [me, area2]);
|
|
33880
|
-
const nightingaleLabels = (0,
|
|
34110
|
+
const nightingaleLabels = (0, import_react212.useMemo)(() => {
|
|
33881
34111
|
if (!final || !me) return [];
|
|
33882
34112
|
const d2 = me.descriptor;
|
|
33883
34113
|
if (!d2.pieShowLabels) return [];
|
|
@@ -33918,7 +34148,7 @@ function PieSeries(props) {
|
|
|
33918
34148
|
}
|
|
33919
34149
|
const prev = progress < 1 ? prevRef.current : null;
|
|
33920
34150
|
const pctLabel = (v) => (v >= 10 ? String(Math.round(v)) : String(Math.round(v * 10) / 10)) + "%";
|
|
33921
|
-
const percentLabels = (0,
|
|
34151
|
+
const percentLabels = (0, import_react212.useMemo)(() => {
|
|
33922
34152
|
if (!final || final.total <= 0 || !me) return [];
|
|
33923
34153
|
const d2 = me.descriptor;
|
|
33924
34154
|
if (!d2.piePercentLabels) return [];
|
|
@@ -33938,7 +34168,7 @@ function PieSeries(props) {
|
|
|
33938
34168
|
});
|
|
33939
34169
|
return out;
|
|
33940
34170
|
}, [final, me, sliceColors, baseColor]);
|
|
33941
|
-
const piePresentation = (0,
|
|
34171
|
+
const piePresentation = (0, import_react212.useMemo)(() => {
|
|
33942
34172
|
if (!me || !final) return null;
|
|
33943
34173
|
const d2 = me.descriptor;
|
|
33944
34174
|
return {
|
|
@@ -33957,7 +34187,7 @@ function PieSeries(props) {
|
|
|
33957
34187
|
}))
|
|
33958
34188
|
};
|
|
33959
34189
|
}, [me, final, sliceColors, baseColor]);
|
|
33960
|
-
(0,
|
|
34190
|
+
(0, import_react212.useEffect)(() => {
|
|
33961
34191
|
if (!piePresentation) return;
|
|
33962
34192
|
ctx.piePresentations.set(seriesId, piePresentation);
|
|
33963
34193
|
ctx.requestRedraw();
|
|
@@ -33965,7 +34195,7 @@ function PieSeries(props) {
|
|
|
33965
34195
|
ctx.piePresentations.delete(seriesId);
|
|
33966
34196
|
};
|
|
33967
34197
|
}, [piePresentation, seriesId]);
|
|
33968
|
-
(0,
|
|
34198
|
+
(0, import_react212.useEffect)(() => {
|
|
33969
34199
|
if (renderer !== "canvas" || !final || hidden) return;
|
|
33970
34200
|
const id = `series:${seriesId}`;
|
|
33971
34201
|
const d2 = me?.descriptor;
|
|
@@ -34301,7 +34531,7 @@ function PieSeries(props) {
|
|
|
34301
34531
|
}
|
|
34302
34532
|
|
|
34303
34533
|
// src/components/chart/react/series/CandlestickSeries.tsx
|
|
34304
|
-
var
|
|
34534
|
+
var import_react213 = require("react");
|
|
34305
34535
|
var import_jsx_runtime222 = require("react/jsx-runtime");
|
|
34306
34536
|
var UP_DEFAULT = "emerald";
|
|
34307
34537
|
var DOWN_DEFAULT = "red";
|
|
@@ -34353,10 +34583,10 @@ function CandlestickSeries(props) {
|
|
|
34353
34583
|
animationsDisabled
|
|
34354
34584
|
} = ctx;
|
|
34355
34585
|
const me = findSeries(ctx, "candlestick", props.id, props.data, props.__chartSeriesToken);
|
|
34356
|
-
const lastRef = (0,
|
|
34357
|
-
const prevRef = (0,
|
|
34358
|
-
const clipId = (0,
|
|
34359
|
-
const lastSigRef = (0,
|
|
34586
|
+
const lastRef = (0, import_react213.useRef)(null);
|
|
34587
|
+
const prevRef = (0, import_react213.useRef)(null);
|
|
34588
|
+
const clipId = (0, import_react213.useId)().replace(/:/g, "");
|
|
34589
|
+
const lastSigRef = (0, import_react213.useRef)(null);
|
|
34360
34590
|
let final = null;
|
|
34361
34591
|
let hidden = false;
|
|
34362
34592
|
let seriesId = "candlestick";
|
|
@@ -34405,7 +34635,7 @@ function CandlestickSeries(props) {
|
|
|
34405
34635
|
const baselineY = area2.y + area2.height;
|
|
34406
34636
|
const hoverItem = hover?.items.find((it) => it.seriesId === seriesId) ?? null;
|
|
34407
34637
|
const hoveredIndex = highlightOn && hoverItem && final ? final.findIndex((k) => k.item === hoverItem.item) : -1;
|
|
34408
|
-
(0,
|
|
34638
|
+
(0, import_react213.useEffect)(() => {
|
|
34409
34639
|
if (renderer !== "canvas" || !final || hidden) return;
|
|
34410
34640
|
const id = `series:${seriesId}`;
|
|
34411
34641
|
const fn = (c, st) => {
|
|
@@ -34660,7 +34890,7 @@ function CandlestickSeries(props) {
|
|
|
34660
34890
|
}
|
|
34661
34891
|
|
|
34662
34892
|
// src/components/chart/react/series/RangeAreaSeries.tsx
|
|
34663
|
-
var
|
|
34893
|
+
var import_react214 = require("react");
|
|
34664
34894
|
var import_jsx_runtime223 = require("react/jsx-runtime");
|
|
34665
34895
|
function entranceFrame(g, p, baselineY, curve) {
|
|
34666
34896
|
if (p >= 1) return g;
|
|
@@ -34699,11 +34929,11 @@ function RangeAreaSeries(props) {
|
|
|
34699
34929
|
props.data,
|
|
34700
34930
|
props.__chartSeriesToken
|
|
34701
34931
|
);
|
|
34702
|
-
const clipId = (0,
|
|
34703
|
-
const fillGradId = (0,
|
|
34704
|
-
const lastRef = (0,
|
|
34705
|
-
const prevRef = (0,
|
|
34706
|
-
const lastSigRef = (0,
|
|
34932
|
+
const clipId = (0, import_react214.useId)().replace(/:/g, "");
|
|
34933
|
+
const fillGradId = (0, import_react214.useId)().replace(/:/g, "");
|
|
34934
|
+
const lastRef = (0, import_react214.useRef)(null);
|
|
34935
|
+
const prevRef = (0, import_react214.useRef)(null);
|
|
34936
|
+
const lastSigRef = (0, import_react214.useRef)(null);
|
|
34707
34937
|
let final = null;
|
|
34708
34938
|
let curve = "linear";
|
|
34709
34939
|
let seriesId = "range-area";
|
|
@@ -34773,7 +35003,7 @@ function RangeAreaSeries(props) {
|
|
|
34773
35003
|
const prev = progress < 1 ? prevRef.current : null;
|
|
34774
35004
|
const entrance = prev === null;
|
|
34775
35005
|
const baselineY = area2.y + area2.height;
|
|
34776
|
-
(0,
|
|
35006
|
+
(0, import_react214.useEffect)(() => {
|
|
34777
35007
|
if (renderer !== "canvas" || !final || hidden) return;
|
|
34778
35008
|
const id = `series:${seriesId}`;
|
|
34779
35009
|
const fn = (c, st) => {
|
|
@@ -34995,7 +35225,7 @@ function RangeAreaSeries(props) {
|
|
|
34995
35225
|
}
|
|
34996
35226
|
|
|
34997
35227
|
// src/components/chart/react/series/RadarSeries.tsx
|
|
34998
|
-
var
|
|
35228
|
+
var import_react215 = require("react");
|
|
34999
35229
|
var import_jsx_runtime224 = require("react/jsx-runtime");
|
|
35000
35230
|
function entranceFrame2(g, p, cx, cy, axisCount) {
|
|
35001
35231
|
if (p >= 1) return g;
|
|
@@ -35029,10 +35259,10 @@ function RadarSeries(props) {
|
|
|
35029
35259
|
props.data,
|
|
35030
35260
|
props.__chartSeriesToken
|
|
35031
35261
|
);
|
|
35032
|
-
const gradId = (0,
|
|
35033
|
-
const lastRef = (0,
|
|
35034
|
-
const prevRef = (0,
|
|
35035
|
-
const lastSigRef = (0,
|
|
35262
|
+
const gradId = (0, import_react215.useId)().replace(/:/g, "");
|
|
35263
|
+
const lastRef = (0, import_react215.useRef)(null);
|
|
35264
|
+
const prevRef = (0, import_react215.useRef)(null);
|
|
35265
|
+
const lastSigRef = (0, import_react215.useRef)(null);
|
|
35036
35266
|
let final = null;
|
|
35037
35267
|
let seriesId = "radar-series";
|
|
35038
35268
|
let hidden = false;
|
|
@@ -35081,7 +35311,7 @@ function RadarSeries(props) {
|
|
|
35081
35311
|
const prev = progress < 1 ? prevRef.current : null;
|
|
35082
35312
|
const entrance = prev === null;
|
|
35083
35313
|
const fillActive = fillOpacity > 0 && final !== null;
|
|
35084
|
-
(0,
|
|
35314
|
+
(0, import_react215.useEffect)(() => {
|
|
35085
35315
|
if (renderer !== "canvas" || !final || hidden || !radar) return;
|
|
35086
35316
|
const id = `series:${seriesId}`;
|
|
35087
35317
|
const { cx, cy, R, domainMax, axisCount: n } = radar;
|
|
@@ -35289,7 +35519,7 @@ function RadarAxis(_props = {}) {
|
|
|
35289
35519
|
}
|
|
35290
35520
|
|
|
35291
35521
|
// src/components/chart/react/series/PolarSeries.tsx
|
|
35292
|
-
var
|
|
35522
|
+
var import_react216 = require("react");
|
|
35293
35523
|
var import_jsx_runtime225 = require("react/jsx-runtime");
|
|
35294
35524
|
function entranceFrame3(g, p, layout, radius = 0) {
|
|
35295
35525
|
if (p >= 1) return g;
|
|
@@ -35335,9 +35565,9 @@ function PolarSeries(props) {
|
|
|
35335
35565
|
props.data,
|
|
35336
35566
|
props.__chartSeriesToken
|
|
35337
35567
|
);
|
|
35338
|
-
const lastSigRef = (0,
|
|
35339
|
-
const lastRef = (0,
|
|
35340
|
-
const prevRef = (0,
|
|
35568
|
+
const lastSigRef = (0, import_react216.useRef)(null);
|
|
35569
|
+
const lastRef = (0, import_react216.useRef)(null);
|
|
35570
|
+
const prevRef = (0, import_react216.useRef)(null);
|
|
35341
35571
|
let final = null;
|
|
35342
35572
|
let seriesId = "polar-series";
|
|
35343
35573
|
let hidden = false;
|
|
@@ -35422,7 +35652,7 @@ function PolarSeries(props) {
|
|
|
35422
35652
|
);
|
|
35423
35653
|
return seg ?? null;
|
|
35424
35654
|
}
|
|
35425
|
-
(0,
|
|
35655
|
+
(0, import_react216.useEffect)(() => {
|
|
35426
35656
|
if (renderer !== "canvas" || !final || hidden || !polar) return;
|
|
35427
35657
|
const id = `series:${seriesId}`;
|
|
35428
35658
|
const fn = (c, st) => {
|
|
@@ -35618,7 +35848,7 @@ function PolarCenter(props = {}) {
|
|
|
35618
35848
|
}
|
|
35619
35849
|
|
|
35620
35850
|
// src/components/chart/react/series/ScatterSeries.tsx
|
|
35621
|
-
var
|
|
35851
|
+
var import_react217 = require("react");
|
|
35622
35852
|
var import_jsx_runtime227 = require("react/jsx-runtime");
|
|
35623
35853
|
function markerPath2(shape2, x, y, r) {
|
|
35624
35854
|
switch (shape2) {
|
|
@@ -35672,9 +35902,9 @@ function ScatterSeries(props) {
|
|
|
35672
35902
|
props.data,
|
|
35673
35903
|
props.__chartSeriesToken
|
|
35674
35904
|
);
|
|
35675
|
-
const lastSigRef = (0,
|
|
35676
|
-
const lastRef = (0,
|
|
35677
|
-
const prevRef = (0,
|
|
35905
|
+
const lastSigRef = (0, import_react217.useRef)(null);
|
|
35906
|
+
const lastRef = (0, import_react217.useRef)(null);
|
|
35907
|
+
const prevRef = (0, import_react217.useRef)(null);
|
|
35678
35908
|
let final = null;
|
|
35679
35909
|
let seriesId = "scatter-series";
|
|
35680
35910
|
let hidden = false;
|
|
@@ -35731,7 +35961,7 @@ function ScatterSeries(props) {
|
|
|
35731
35961
|
const hoverFill = hoverBackground === "auto" ? seriesColor : hoverBackground;
|
|
35732
35962
|
const hoverBorder = hoverBorderWidth > 0 ? hoverBorderColor ?? tintColor(hoverFill, 0.5) : void 0;
|
|
35733
35963
|
const hoverR = (r) => hoverSize != null ? hoverSize : r * hoverRadiusMultiplier;
|
|
35734
|
-
(0,
|
|
35964
|
+
(0, import_react217.useEffect)(() => {
|
|
35735
35965
|
if (renderer !== "canvas" || !final || hidden) return;
|
|
35736
35966
|
const id = `series:${seriesId}`;
|
|
35737
35967
|
const fn = (c, st) => {
|
|
@@ -35825,7 +36055,7 @@ function ScatterSeries(props) {
|
|
|
35825
36055
|
}
|
|
35826
36056
|
|
|
35827
36057
|
// src/components/chart/react/features/XAxis.tsx
|
|
35828
|
-
var
|
|
36058
|
+
var import_react218 = require("react");
|
|
35829
36059
|
var import_jsx_runtime228 = require("react/jsx-runtime");
|
|
35830
36060
|
function ticksFor(xScale, props) {
|
|
35831
36061
|
if ("bandWidth" in xScale) {
|
|
@@ -35849,7 +36079,7 @@ function XAxis(props = {}) {
|
|
|
35849
36079
|
const ctx = useChart();
|
|
35850
36080
|
const { renderer, xScale, area: area2, theme } = ctx;
|
|
35851
36081
|
const axesEnabled = ctx.axesEnabled;
|
|
35852
|
-
(0,
|
|
36082
|
+
(0, import_react218.useEffect)(() => {
|
|
35853
36083
|
if (renderer !== "canvas" || !xScale || !axesEnabled) return;
|
|
35854
36084
|
const id = "feature:xaxis";
|
|
35855
36085
|
const fn = (c) => {
|
|
@@ -35962,7 +36192,7 @@ function XAxis(props = {}) {
|
|
|
35962
36192
|
}
|
|
35963
36193
|
|
|
35964
36194
|
// src/components/chart/react/features/YAxis.tsx
|
|
35965
|
-
var
|
|
36195
|
+
var import_react219 = require("react");
|
|
35966
36196
|
var import_jsx_runtime229 = require("react/jsx-runtime");
|
|
35967
36197
|
function YAxis(props = {}) {
|
|
35968
36198
|
const ctx = useChart();
|
|
@@ -35970,7 +36200,7 @@ function YAxis(props = {}) {
|
|
|
35970
36200
|
const onRight = props.axis === "right";
|
|
35971
36201
|
const scale = onRight ? rightYScale : yScale;
|
|
35972
36202
|
const axesEnabled = ctx.axesEnabled;
|
|
35973
|
-
(0,
|
|
36203
|
+
(0, import_react219.useEffect)(() => {
|
|
35974
36204
|
if (renderer !== "canvas" || !scale || !axesEnabled) return;
|
|
35975
36205
|
const id = `feature:yaxis:${onRight ? "right" : "left"}`;
|
|
35976
36206
|
const fn = (c) => {
|
|
@@ -36260,7 +36490,7 @@ function Legend(props = {}) {
|
|
|
36260
36490
|
}
|
|
36261
36491
|
|
|
36262
36492
|
// src/components/chart/react/features/Tooltip.tsx
|
|
36263
|
-
var
|
|
36493
|
+
var import_react220 = require("react");
|
|
36264
36494
|
var import_jsx_runtime231 = require("react/jsx-runtime");
|
|
36265
36495
|
function Tooltip2(props = {}) {
|
|
36266
36496
|
const ctx = useChart();
|
|
@@ -36277,11 +36507,11 @@ function Tooltip2(props = {}) {
|
|
|
36277
36507
|
const header = rawX !== void 0 ? props.headerFormat ? props.headerFormat(rawX) : xIsTime ? formatFullDate(
|
|
36278
36508
|
typeof rawX === "string" ? new Date(rawX).getTime() : rawX
|
|
36279
36509
|
) : typeof rawX === "number" ? Number.isInteger(rawX) ? String(rawX) : String(Math.round(rawX * 100) / 100) : String(rawX) : ctx.title;
|
|
36280
|
-
const cardRef = (0,
|
|
36281
|
-
const [pos, setPos] = (0,
|
|
36510
|
+
const cardRef = (0, import_react220.useRef)(null);
|
|
36511
|
+
const [pos, setPos] = (0, import_react220.useState)(null);
|
|
36282
36512
|
const anchorX = hv && active ? hv.pointerX ?? hv.x : 0;
|
|
36283
36513
|
const anchorY = hv && active ? hv.pointerY ?? hv.y ?? 40 : 0;
|
|
36284
|
-
(0,
|
|
36514
|
+
(0, import_react220.useLayoutEffect)(() => {
|
|
36285
36515
|
if (!active) {
|
|
36286
36516
|
setPos(null);
|
|
36287
36517
|
return;
|
|
@@ -36496,17 +36726,17 @@ function Caption(props) {
|
|
|
36496
36726
|
}
|
|
36497
36727
|
|
|
36498
36728
|
// src/components/chart/react/features/Hover.tsx
|
|
36499
|
-
var
|
|
36729
|
+
var import_react221 = require("react");
|
|
36500
36730
|
function Hover(props) {
|
|
36501
36731
|
const ctx = useChart();
|
|
36502
|
-
(0,
|
|
36732
|
+
(0, import_react221.useEffect)(() => {
|
|
36503
36733
|
props.onHover?.(ctx.hover);
|
|
36504
36734
|
}, [ctx.hover, props.onHover]);
|
|
36505
36735
|
return null;
|
|
36506
36736
|
}
|
|
36507
36737
|
|
|
36508
36738
|
// src/components/chart/react/features/ReferenceMarks.tsx
|
|
36509
|
-
var
|
|
36739
|
+
var import_react222 = require("react");
|
|
36510
36740
|
var import_jsx_runtime233 = require("react/jsx-runtime");
|
|
36511
36741
|
function xPixel2(ctx, x) {
|
|
36512
36742
|
if (x === void 0 || !ctx.xScale) return null;
|
|
@@ -36542,7 +36772,7 @@ function ReferenceLine(props) {
|
|
|
36542
36772
|
const color2 = props.color ?? theme.crosshairColor;
|
|
36543
36773
|
const dash = props.dash ?? [4, 4];
|
|
36544
36774
|
const sloped = props.x !== void 0 && props.y !== void 0 && props.x2 !== void 0 && props.y2 !== void 0;
|
|
36545
|
-
(0,
|
|
36775
|
+
(0, import_react222.useEffect)(() => {
|
|
36546
36776
|
if (renderer !== "canvas") return;
|
|
36547
36777
|
const id = `feature:refline-${props.x ?? ""}-${props.y ?? ""}-${props.x2 ?? ""}-${props.y2 ?? ""}`;
|
|
36548
36778
|
const fn = (c) => {
|
|
@@ -36711,7 +36941,7 @@ function ReferenceBand(props) {
|
|
|
36711
36941
|
h: Math.abs(py2 - py1)
|
|
36712
36942
|
};
|
|
36713
36943
|
}
|
|
36714
|
-
(0,
|
|
36944
|
+
(0, import_react222.useEffect)(() => {
|
|
36715
36945
|
if (renderer !== "canvas" || !rect) return;
|
|
36716
36946
|
const id = `feature:refband-${props.x1 ?? ""}-${props.y1 ?? ""}`;
|
|
36717
36947
|
const fn = (c) => {
|
|
@@ -36767,7 +36997,7 @@ function ReferenceBand(props) {
|
|
|
36767
36997
|
}
|
|
36768
36998
|
|
|
36769
36999
|
// src/components/chart/react/features/Annotation.tsx
|
|
36770
|
-
var
|
|
37000
|
+
var import_react223 = require("react");
|
|
36771
37001
|
var import_jsx_runtime234 = require("react/jsx-runtime");
|
|
36772
37002
|
function xPixelOf(x, xScale) {
|
|
36773
37003
|
if (x === void 0 || !xScale) return null;
|
|
@@ -36846,7 +37076,7 @@ function Annotation(props) {
|
|
|
36846
37076
|
} : { cardX: 0, cardY: 0, cardW, cardH: CARD_H, side: "auto" });
|
|
36847
37077
|
const { cardX, cardY } = cardRect;
|
|
36848
37078
|
const annotationIndex = props.__chartAnnotationIndex ?? 0;
|
|
36849
|
-
(0,
|
|
37079
|
+
(0, import_react223.useEffect)(() => {
|
|
36850
37080
|
if (renderer !== "canvas" || px === null || py === null) return;
|
|
36851
37081
|
const id = `feature:annotation:${annotationIndex}`;
|
|
36852
37082
|
const fn = (c) => {
|
|
@@ -37231,7 +37461,7 @@ function AxisBadges(props = {}) {
|
|
|
37231
37461
|
|
|
37232
37462
|
// src/components/chart/react/series/GaugeSeries.tsx
|
|
37233
37463
|
var import_d3_shape4 = require("d3-shape");
|
|
37234
|
-
var
|
|
37464
|
+
var import_react224 = require("react");
|
|
37235
37465
|
var import_jsx_runtime238 = require("react/jsx-runtime");
|
|
37236
37466
|
function arcPath(innerRadius, outerRadius, seg) {
|
|
37237
37467
|
const gen = (0, import_d3_shape4.arc)().innerRadius(innerRadius).outerRadius(outerRadius);
|
|
@@ -37268,7 +37498,7 @@ function GaugeSeries(props) {
|
|
|
37268
37498
|
10,
|
|
37269
37499
|
Math.min(area2.width, area2.height) / 2 - 8 - ((d?.gaugeTicks?.length ?? 8) + 10)
|
|
37270
37500
|
);
|
|
37271
|
-
const final = (0,
|
|
37501
|
+
const final = (0, import_react224.useMemo)(() => {
|
|
37272
37502
|
if (!d) return null;
|
|
37273
37503
|
return computeGaugeGeometry({
|
|
37274
37504
|
value: d.gaugeValue ?? 0,
|
|
@@ -37295,7 +37525,7 @@ function GaugeSeries(props) {
|
|
|
37295
37525
|
const value = d?.gaugeValue ?? 0;
|
|
37296
37526
|
const max = d?.gaugeMax ?? 100;
|
|
37297
37527
|
const min = d?.gaugeMin ?? 0;
|
|
37298
|
-
const presentation = (0,
|
|
37528
|
+
const presentation = (0, import_react224.useMemo)(() => {
|
|
37299
37529
|
if (!d) return null;
|
|
37300
37530
|
return {
|
|
37301
37531
|
cx,
|
|
@@ -37313,7 +37543,7 @@ function GaugeSeries(props) {
|
|
|
37313
37543
|
]
|
|
37314
37544
|
};
|
|
37315
37545
|
}, [d, final, value, max, min, baseColor]);
|
|
37316
|
-
(0,
|
|
37546
|
+
(0, import_react224.useEffect)(() => {
|
|
37317
37547
|
if (!presentation) return;
|
|
37318
37548
|
ctx.piePresentations.set(seriesId, presentation);
|
|
37319
37549
|
ctx.requestRedraw();
|
|
@@ -37322,7 +37552,7 @@ function GaugeSeries(props) {
|
|
|
37322
37552
|
};
|
|
37323
37553
|
}, [presentation, seriesId]);
|
|
37324
37554
|
const trackColor = theme.gridColor;
|
|
37325
|
-
(0,
|
|
37555
|
+
(0, import_react224.useEffect)(() => {
|
|
37326
37556
|
if (renderer !== "canvas" || !final || hidden) return;
|
|
37327
37557
|
const id = `series:${seriesId}`;
|
|
37328
37558
|
const fn = (c) => {
|
|
@@ -37460,7 +37690,7 @@ function GaugeSeries(props) {
|
|
|
37460
37690
|
}
|
|
37461
37691
|
|
|
37462
37692
|
// src/components/chart/react/series/WaterfallSeries.tsx
|
|
37463
|
-
var
|
|
37693
|
+
var import_react225 = require("react");
|
|
37464
37694
|
var import_jsx_runtime239 = require("react/jsx-runtime");
|
|
37465
37695
|
var DEFAULT_UP = "#10b981";
|
|
37466
37696
|
var DEFAULT_DOWN = "#f43f5e";
|
|
@@ -37486,9 +37716,9 @@ function WaterfallSeries(props) {
|
|
|
37486
37716
|
const me = ctx.series.find(
|
|
37487
37717
|
(s) => s.descriptor.type === "waterfall" && (props.id === void 0 || s.descriptor.id === props.id)
|
|
37488
37718
|
);
|
|
37489
|
-
const lastRef = (0,
|
|
37490
|
-
const prevRef = (0,
|
|
37491
|
-
const lastSigRef = (0,
|
|
37719
|
+
const lastRef = (0, import_react225.useRef)(null);
|
|
37720
|
+
const prevRef = (0, import_react225.useRef)(null);
|
|
37721
|
+
const lastSigRef = (0, import_react225.useRef)(null);
|
|
37492
37722
|
const d = me?.descriptor;
|
|
37493
37723
|
const hidden = me?.hidden ?? false;
|
|
37494
37724
|
const seriesId = d?.id ?? "waterfall";
|
|
@@ -37669,7 +37899,7 @@ function WaterfallSeries(props) {
|
|
|
37669
37899
|
}
|
|
37670
37900
|
c.restore();
|
|
37671
37901
|
};
|
|
37672
|
-
(0,
|
|
37902
|
+
(0, import_react225.useEffect)(() => {
|
|
37673
37903
|
if (renderer !== "canvas" || !final || hidden) return;
|
|
37674
37904
|
const id = `series:${seriesId}`;
|
|
37675
37905
|
const fn = (c, st) => {
|
|
@@ -37819,7 +38049,7 @@ function WaterfallSeries(props) {
|
|
|
37819
38049
|
}
|
|
37820
38050
|
|
|
37821
38051
|
// src/components/chart/react/series/HeatmapSeries.tsx
|
|
37822
|
-
var
|
|
38052
|
+
var import_react226 = require("react");
|
|
37823
38053
|
var import_jsx_runtime240 = require("react/jsx-runtime");
|
|
37824
38054
|
var DEFAULT_STOPS = ["#dbeafe", "#3b82f6", "#7c3aed"];
|
|
37825
38055
|
function buildModel(me, area2) {
|
|
@@ -37889,19 +38119,19 @@ function HeatmapSeries(props) {
|
|
|
37889
38119
|
theme,
|
|
37890
38120
|
isDark
|
|
37891
38121
|
} = ctx;
|
|
37892
|
-
const gradId = (0,
|
|
38122
|
+
const gradId = (0, import_react226.useId)().replace(/:/g, "");
|
|
37893
38123
|
const me = ctx.series.find(
|
|
37894
38124
|
(s) => s.descriptor.type === "heatmap" && (props.id === void 0 || s.descriptor.id === props.id)
|
|
37895
38125
|
) ?? null;
|
|
37896
38126
|
const seriesId = me?.descriptor.id ?? "heatmap";
|
|
37897
|
-
const model = (0,
|
|
38127
|
+
const model = (0, import_react226.useMemo)(
|
|
37898
38128
|
() => me ? buildModel(me.descriptor, area2) : null,
|
|
37899
38129
|
[me, area2]
|
|
37900
38130
|
);
|
|
37901
38131
|
const hidden = me?.hidden ?? false;
|
|
37902
38132
|
const dim = seriesDimStyle(hover, seriesId, hoverDim);
|
|
37903
38133
|
const groupOpacity = hidden ? 0 : dim;
|
|
37904
|
-
const hoverCellIdx = (0,
|
|
38134
|
+
const hoverCellIdx = (0, import_react226.useMemo)(() => {
|
|
37905
38135
|
if (!model || !hover) return -1;
|
|
37906
38136
|
const it = hover.items.find((i) => i.seriesId === seriesId);
|
|
37907
38137
|
if (!it) return -1;
|
|
@@ -37911,7 +38141,7 @@ function HeatmapSeries(props) {
|
|
|
37911
38141
|
const tierFmt = me?.descriptor.heatmapTierLabel;
|
|
37912
38142
|
const annotations = me?.descriptor.heatmapAnnotations ?? [];
|
|
37913
38143
|
const settled = progress >= 1 || animationsDisabled;
|
|
37914
|
-
(0,
|
|
38144
|
+
(0, import_react226.useEffect)(() => {
|
|
37915
38145
|
if (renderer !== "canvas" || !model) return;
|
|
37916
38146
|
const {
|
|
37917
38147
|
rows: rows2,
|
|
@@ -38273,7 +38503,7 @@ function HeatmapSeries(props) {
|
|
|
38273
38503
|
}
|
|
38274
38504
|
|
|
38275
38505
|
// src/components/chart/react/series/TreemapSeries.tsx
|
|
38276
|
-
var
|
|
38506
|
+
var import_react227 = require("react");
|
|
38277
38507
|
var import_jsx_runtime241 = require("react/jsx-runtime");
|
|
38278
38508
|
var DEFAULT_GAP = 2;
|
|
38279
38509
|
function buildModel2(d, area2, palette) {
|
|
@@ -38370,7 +38600,7 @@ function TreemapSeries(props) {
|
|
|
38370
38600
|
(s) => s.descriptor.type === "treemap" && (props.id === void 0 || s.descriptor.id === props.id)
|
|
38371
38601
|
) ?? null;
|
|
38372
38602
|
const seriesId = me?.descriptor.id ?? "treemap";
|
|
38373
|
-
const model = (0,
|
|
38603
|
+
const model = (0, import_react227.useMemo)(
|
|
38374
38604
|
() => me ? buildModel2(me.descriptor, area2, DEFAULT_SERIES_PALETTE) : null,
|
|
38375
38605
|
[me, area2]
|
|
38376
38606
|
);
|
|
@@ -38382,19 +38612,19 @@ function TreemapSeries(props) {
|
|
|
38382
38612
|
const deltaFmt = me?.descriptor.treemapDeltaFormat;
|
|
38383
38613
|
const settled = progress >= 1 || animationsDisabled;
|
|
38384
38614
|
const p = settled ? 1 : progress;
|
|
38385
|
-
const hoverTileIdx = (0,
|
|
38615
|
+
const hoverTileIdx = (0, import_react227.useMemo)(() => {
|
|
38386
38616
|
if (!model || !hover) return -1;
|
|
38387
38617
|
const it = hover.items.find((i) => i.seriesId === seriesId);
|
|
38388
38618
|
if (!it || it.index === void 0 || it.index < 0) return -1;
|
|
38389
38619
|
return model.tiles.findIndex((t) => t.index === it.index);
|
|
38390
38620
|
}, [hover, model, seriesId]);
|
|
38391
|
-
const hoverGroup = (0,
|
|
38621
|
+
const hoverGroup = (0, import_react227.useMemo)(() => {
|
|
38392
38622
|
if (!model || !hover || model.grouped !== true) return -1;
|
|
38393
38623
|
const it = hover.items.find((i) => i.seriesId === seriesId);
|
|
38394
38624
|
if (!it || it.index !== -1) return -1;
|
|
38395
38625
|
return model.groupHeaders.findIndex((h) => h.name === it.name);
|
|
38396
38626
|
}, [hover, model, seriesId]);
|
|
38397
|
-
(0,
|
|
38627
|
+
(0, import_react227.useEffect)(() => {
|
|
38398
38628
|
if (renderer !== "canvas" || !model) return;
|
|
38399
38629
|
const { tiles: tiles2, radius: radius2, showLabels: showLabels2, valueLabels: valueLabels2, groupHeaders: groupHeaders2 } = model;
|
|
38400
38630
|
const fn = (c, st) => {
|
|
@@ -38657,7 +38887,7 @@ function drawPill(c, x, y, pill) {
|
|
|
38657
38887
|
}
|
|
38658
38888
|
|
|
38659
38889
|
// src/components/chart/react/series/FunnelSeries.tsx
|
|
38660
|
-
var
|
|
38890
|
+
var import_react228 = require("react");
|
|
38661
38891
|
var import_jsx_runtime242 = require("react/jsx-runtime");
|
|
38662
38892
|
function FunnelSeries(props) {
|
|
38663
38893
|
const ctx = useChart();
|
|
@@ -38678,7 +38908,7 @@ function FunnelSeries(props) {
|
|
|
38678
38908
|
) ?? null;
|
|
38679
38909
|
const seriesId = me?.descriptor.id ?? "funnel";
|
|
38680
38910
|
const d = me?.descriptor;
|
|
38681
|
-
const model = (0,
|
|
38911
|
+
const model = (0, import_react228.useMemo)(() => {
|
|
38682
38912
|
if (!me || !d?.funnelItems?.length) return null;
|
|
38683
38913
|
const base = d.funnelColor ?? DEFAULT_SERIES_PALETTE[d.paletteIndex % DEFAULT_SERIES_PALETTE.length];
|
|
38684
38914
|
const colors3 = d.funnelColors?.length ? d.funnelColors : Array(FUNNEL_MAX_STAGES).fill(base);
|
|
@@ -38701,12 +38931,12 @@ function FunnelSeries(props) {
|
|
|
38701
38931
|
const valueFmt = d?.funnelValueFormat ?? formatSI;
|
|
38702
38932
|
const settled = progress >= 1 || animationsDisabled;
|
|
38703
38933
|
const p = settled ? 1 : progress;
|
|
38704
|
-
const hoverIdx = (0,
|
|
38934
|
+
const hoverIdx = (0, import_react228.useMemo)(() => {
|
|
38705
38935
|
if (!hover) return -1;
|
|
38706
38936
|
const it = hover.items.find((i) => i.seriesId === seriesId);
|
|
38707
38937
|
return it && it.index !== void 0 ? it.index : -1;
|
|
38708
38938
|
}, [hover, seriesId]);
|
|
38709
|
-
(0,
|
|
38939
|
+
(0, import_react228.useEffect)(() => {
|
|
38710
38940
|
if (renderer !== "canvas" || !model) return;
|
|
38711
38941
|
const id = `feature:funnel:${seriesId}`;
|
|
38712
38942
|
const fn = (c, st) => {
|
|
@@ -39214,7 +39444,7 @@ var GlassBackground = ({
|
|
|
39214
39444
|
var GlassBackground_default = GlassBackground;
|
|
39215
39445
|
|
|
39216
39446
|
// src/components/TruncatedText.tsx
|
|
39217
|
-
var
|
|
39447
|
+
var import_react229 = require("react");
|
|
39218
39448
|
var import_jsx_runtime245 = require("react/jsx-runtime");
|
|
39219
39449
|
var TruncatedText = ({
|
|
39220
39450
|
text: text2,
|
|
@@ -39224,9 +39454,9 @@ var TruncatedText = ({
|
|
|
39224
39454
|
tooltipPosition = "top",
|
|
39225
39455
|
noWrapper = false
|
|
39226
39456
|
}) => {
|
|
39227
|
-
const ref = (0,
|
|
39228
|
-
const [truncated, setTruncated] = (0,
|
|
39229
|
-
(0,
|
|
39457
|
+
const ref = (0, import_react229.useRef)(null);
|
|
39458
|
+
const [truncated, setTruncated] = (0, import_react229.useState)(false);
|
|
39459
|
+
(0, import_react229.useEffect)(() => {
|
|
39230
39460
|
const el = ref.current;
|
|
39231
39461
|
if (!el) return;
|
|
39232
39462
|
const check = () => {
|
|
@@ -39266,7 +39496,7 @@ var TruncatedText = ({
|
|
|
39266
39496
|
var TruncatedText_default = TruncatedText;
|
|
39267
39497
|
|
|
39268
39498
|
// src/components/InfoRow.tsx
|
|
39269
|
-
var
|
|
39499
|
+
var import_react230 = require("react");
|
|
39270
39500
|
var import_classnames61 = __toESM(require("classnames"), 1);
|
|
39271
39501
|
var import_jsx_runtime246 = (
|
|
39272
39502
|
// The truncated value is the tooltip's anchor: focusable (with a
|
|
@@ -39382,12 +39612,12 @@ var InfoRowBody = ({
|
|
|
39382
39612
|
}) => {
|
|
39383
39613
|
const t = useKitT();
|
|
39384
39614
|
const text2 = useSurfaceText();
|
|
39385
|
-
const [copyState, setCopyState] = (0,
|
|
39386
|
-
const [dismissed, setDismissed] = (0,
|
|
39387
|
-
const [truncated, setTruncated] = (0,
|
|
39388
|
-
const valueRef = (0,
|
|
39389
|
-
const timerRef = (0,
|
|
39390
|
-
(0,
|
|
39615
|
+
const [copyState, setCopyState] = (0, import_react230.useState)("idle");
|
|
39616
|
+
const [dismissed, setDismissed] = (0, import_react230.useState)(false);
|
|
39617
|
+
const [truncated, setTruncated] = (0, import_react230.useState)(false);
|
|
39618
|
+
const valueRef = (0, import_react230.useRef)(null);
|
|
39619
|
+
const timerRef = (0, import_react230.useRef)(null);
|
|
39620
|
+
(0, import_react230.useEffect)(
|
|
39391
39621
|
() => () => {
|
|
39392
39622
|
if (timerRef.current) clearTimeout(timerRef.current);
|
|
39393
39623
|
},
|
|
@@ -39403,7 +39633,7 @@ var InfoRowBody = ({
|
|
|
39403
39633
|
const canTooltip = tooltipOnTruncate && !wrap2 && copyText !== null && !loading && !hasError;
|
|
39404
39634
|
const useSmartLayout = labelWidth === void 0;
|
|
39405
39635
|
const trigger = getSurfaceTriggerTokens(rowTone);
|
|
39406
|
-
const handleCopy = (0,
|
|
39636
|
+
const handleCopy = (0, import_react230.useCallback)(async () => {
|
|
39407
39637
|
if (!copyText) return;
|
|
39408
39638
|
if (timerRef.current) clearTimeout(timerRef.current);
|
|
39409
39639
|
const ok = await writeClipboard(copyText);
|
|
@@ -39412,7 +39642,7 @@ var InfoRowBody = ({
|
|
|
39412
39642
|
if (ok) onCopy?.(copyText);
|
|
39413
39643
|
timerRef.current = setTimeout(() => setCopyState("idle"), 1600);
|
|
39414
39644
|
}, [copyText, onCopy]);
|
|
39415
|
-
const measure = (0,
|
|
39645
|
+
const measure = (0, import_react230.useCallback)(() => {
|
|
39416
39646
|
const el = valueRef.current;
|
|
39417
39647
|
if (!canTooltip || !el) return;
|
|
39418
39648
|
setTruncated(el.scrollWidth > el.offsetWidth);
|
|
@@ -39699,19 +39929,19 @@ var SectionCard_default = SectionCard;
|
|
|
39699
39929
|
var import_classnames63 = __toESM(require("classnames"), 1);
|
|
39700
39930
|
|
|
39701
39931
|
// src/hooks/usePager.ts
|
|
39702
|
-
var
|
|
39932
|
+
var import_react231 = require("react");
|
|
39703
39933
|
function usePager({
|
|
39704
39934
|
count,
|
|
39705
39935
|
page,
|
|
39706
39936
|
onPageChange,
|
|
39707
39937
|
loop = false
|
|
39708
39938
|
}) {
|
|
39709
|
-
const [internal, setInternal] = (0,
|
|
39939
|
+
const [internal, setInternal] = (0, import_react231.useState)(0);
|
|
39710
39940
|
const total = Math.max(0, count);
|
|
39711
39941
|
const isControlled = page !== void 0;
|
|
39712
39942
|
const raw = isControlled ? page : internal;
|
|
39713
39943
|
const current = total > 0 ? Math.min(Math.max(0, raw), total - 1) : 0;
|
|
39714
|
-
(0,
|
|
39944
|
+
(0, import_react231.useEffect)(() => {
|
|
39715
39945
|
if (!isControlled && internal !== current) setInternal(current);
|
|
39716
39946
|
}, [isControlled, internal, current]);
|
|
39717
39947
|
const goTo = (next) => {
|
|
@@ -39986,7 +40216,7 @@ var PagedPanel = ({
|
|
|
39986
40216
|
var PagedPanel_default = PagedPanel;
|
|
39987
40217
|
|
|
39988
40218
|
// src/components/CollapsiblePanel.tsx
|
|
39989
|
-
var
|
|
40219
|
+
var import_react232 = require("react");
|
|
39990
40220
|
var import_classnames64 = __toESM(require("classnames"), 1);
|
|
39991
40221
|
var import_jsx_runtime249 = require("react/jsx-runtime");
|
|
39992
40222
|
var SCROLLBAR = `overflow-y-auto ${THIN_SCROLLBAR}`;
|
|
@@ -40158,10 +40388,10 @@ var CollapsiblePanel = ({
|
|
|
40158
40388
|
}) => {
|
|
40159
40389
|
const resolvedTone = resolvePanelTone(tone, color2);
|
|
40160
40390
|
const resolvedPadding = padding ?? DEFAULT_SURFACE_PADDING;
|
|
40161
|
-
const [internalExpanded, setInternalExpanded] = (0,
|
|
40391
|
+
const [internalExpanded, setInternalExpanded] = (0, import_react232.useState)(defaultExpanded);
|
|
40162
40392
|
const isControlled = typeof expanded === "boolean";
|
|
40163
40393
|
const isExpanded = isControlled ? expanded : internalExpanded;
|
|
40164
|
-
const baseId = (0,
|
|
40394
|
+
const baseId = (0, import_react232.useId)();
|
|
40165
40395
|
const headerId = `${baseId}-header`;
|
|
40166
40396
|
const contentId = `${baseId}-content`;
|
|
40167
40397
|
const handleToggle = () => {
|
|
@@ -40214,7 +40444,7 @@ CollapsiblePanel.displayName = "CollapsiblePanel";
|
|
|
40214
40444
|
var CollapsiblePanel_default = CollapsiblePanel;
|
|
40215
40445
|
|
|
40216
40446
|
// src/components/HeaderGroup.tsx
|
|
40217
|
-
var
|
|
40447
|
+
var import_react233 = __toESM(require("react"), 1);
|
|
40218
40448
|
var import_classnames65 = __toESM(require("classnames"), 1);
|
|
40219
40449
|
var import_jsx_runtime250 = require("react/jsx-runtime");
|
|
40220
40450
|
var GAP_PX3 = {
|
|
@@ -40261,9 +40491,9 @@ var HeaderGroup = ({
|
|
|
40261
40491
|
...rest
|
|
40262
40492
|
}) => {
|
|
40263
40493
|
const surface = useSurfaceText();
|
|
40264
|
-
const ref =
|
|
40265
|
-
const [snapPx, setSnapPx] = (0,
|
|
40266
|
-
(0,
|
|
40494
|
+
const ref = import_react233.default.useRef(null);
|
|
40495
|
+
const [snapPx, setSnapPx] = (0, import_react233.useState)(0);
|
|
40496
|
+
(0, import_react233.useLayoutEffect)(() => {
|
|
40267
40497
|
if (typeof window === "undefined" || typeof ResizeObserver === "undefined")
|
|
40268
40498
|
return;
|
|
40269
40499
|
const el = ref.current;
|
|
@@ -40325,7 +40555,7 @@ HeaderGroup.displayName = "HeaderGroup";
|
|
|
40325
40555
|
var HeaderGroup_default = HeaderGroup;
|
|
40326
40556
|
|
|
40327
40557
|
// src/components/DetailItemCard.tsx
|
|
40328
|
-
var
|
|
40558
|
+
var import_react234 = require("react");
|
|
40329
40559
|
var import_classnames66 = __toESM(require("classnames"), 1);
|
|
40330
40560
|
var import_jsx_runtime251 = require("react/jsx-runtime");
|
|
40331
40561
|
var DetailBody = ({
|
|
@@ -40346,7 +40576,7 @@ var DetailBody = ({
|
|
|
40346
40576
|
const renderIcon2 = useIconRenderer();
|
|
40347
40577
|
const surface = useSurfaceText();
|
|
40348
40578
|
const trigger = getSurfaceTriggerTokens(tone);
|
|
40349
|
-
const baseId = (0,
|
|
40579
|
+
const baseId = (0, import_react234.useId)();
|
|
40350
40580
|
const titleId = `${baseId}-title`;
|
|
40351
40581
|
const detailId = `${baseId}-detail`;
|
|
40352
40582
|
const hasDetails = Boolean(children);
|
|
@@ -40489,7 +40719,7 @@ var DetailItemCard = ({
|
|
|
40489
40719
|
...rest
|
|
40490
40720
|
}) => {
|
|
40491
40721
|
const tone = getSurfaceAccentColor(surfaceTone);
|
|
40492
|
-
const [internalExpanded, setInternalExpanded] = (0,
|
|
40722
|
+
const [internalExpanded, setInternalExpanded] = (0, import_react234.useState)(defaultExpanded);
|
|
40493
40723
|
const isControlled = typeof expanded === "boolean";
|
|
40494
40724
|
const isExpanded = isControlled ? expanded : internalExpanded;
|
|
40495
40725
|
const handleToggleExpanded = () => {
|
|
@@ -40532,84 +40762,6 @@ var DetailItemCard_default = DetailItemCard;
|
|
|
40532
40762
|
// src/components/InfiniteScrollPanel.tsx
|
|
40533
40763
|
var import_react235 = require("react");
|
|
40534
40764
|
var import_classnames67 = __toESM(require("classnames"), 1);
|
|
40535
|
-
|
|
40536
|
-
// src/hooks/useInfiniteScroll.ts
|
|
40537
|
-
var import_react234 = require("react");
|
|
40538
|
-
function useInfiniteScroll(options) {
|
|
40539
|
-
const {
|
|
40540
|
-
rootRef,
|
|
40541
|
-
sentinelRef,
|
|
40542
|
-
hasMore,
|
|
40543
|
-
isLoading = false,
|
|
40544
|
-
itemCount,
|
|
40545
|
-
minItems = 0,
|
|
40546
|
-
rootMargin = 320,
|
|
40547
|
-
resetKey,
|
|
40548
|
-
observeKey
|
|
40549
|
-
} = options;
|
|
40550
|
-
const latest = (0, import_react234.useRef)(options);
|
|
40551
|
-
const generation = (0, import_react234.useRef)(0);
|
|
40552
|
-
const locked = (0, import_react234.useRef)(false);
|
|
40553
|
-
const failed = (0, import_react234.useRef)(false);
|
|
40554
|
-
const mounted = (0, import_react234.useRef)(false);
|
|
40555
|
-
const attemptedCount = (0, import_react234.useRef)(null);
|
|
40556
|
-
const [isLoadingMore, setIsLoadingMore] = (0, import_react234.useState)(false);
|
|
40557
|
-
const [error, setError] = (0, import_react234.useState)(null);
|
|
40558
|
-
(0, import_react234.useLayoutEffect)(() => {
|
|
40559
|
-
latest.current = options;
|
|
40560
|
-
});
|
|
40561
|
-
(0, import_react234.useLayoutEffect)(() => {
|
|
40562
|
-
mounted.current = true;
|
|
40563
|
-
generation.current += 1;
|
|
40564
|
-
attemptedCount.current = null;
|
|
40565
|
-
failed.current = false;
|
|
40566
|
-
setError(null);
|
|
40567
|
-
if (rootRef.current) rootRef.current.scrollTop = 0;
|
|
40568
|
-
return () => {
|
|
40569
|
-
mounted.current = false;
|
|
40570
|
-
generation.current += 1;
|
|
40571
|
-
};
|
|
40572
|
-
}, [resetKey, rootRef]);
|
|
40573
|
-
const loadMore = (0, import_react234.useCallback)(async () => {
|
|
40574
|
-
const current = latest.current;
|
|
40575
|
-
if (!mounted.current || locked.current || current.isLoading || !current.hasMore) return;
|
|
40576
|
-
const started = generation.current;
|
|
40577
|
-
locked.current = true;
|
|
40578
|
-
attemptedCount.current = current.itemCount;
|
|
40579
|
-
failed.current = false;
|
|
40580
|
-
setIsLoadingMore(true);
|
|
40581
|
-
setError(null);
|
|
40582
|
-
try {
|
|
40583
|
-
await current.onLoadMore();
|
|
40584
|
-
} catch (caught) {
|
|
40585
|
-
if (started === generation.current) {
|
|
40586
|
-
failed.current = true;
|
|
40587
|
-
setError(caught || new Error("Failed to load more items"));
|
|
40588
|
-
current.onError?.(caught);
|
|
40589
|
-
}
|
|
40590
|
-
} finally {
|
|
40591
|
-
locked.current = false;
|
|
40592
|
-
if (mounted.current) setIsLoadingMore(false);
|
|
40593
|
-
}
|
|
40594
|
-
}, []);
|
|
40595
|
-
const busy = isLoading || isLoadingMore;
|
|
40596
|
-
(0, import_react234.useEffect)(() => {
|
|
40597
|
-
const root = rootRef.current;
|
|
40598
|
-
const sentinel = sentinelRef.current;
|
|
40599
|
-
if (!root || !sentinel || !hasMore || busy || error || typeof IntersectionObserver === "undefined") return;
|
|
40600
|
-
const observer = new IntersectionObserver((entries) => {
|
|
40601
|
-
if (!failed.current && attemptedCount.current !== latest.current.itemCount && entries.some((entry) => entry.isIntersecting)) void loadMore();
|
|
40602
|
-
}, { root, rootMargin: `0px 0px ${rootMargin}px 0px`, threshold: 0 });
|
|
40603
|
-
observer.observe(sentinel);
|
|
40604
|
-
return () => observer.disconnect();
|
|
40605
|
-
}, [rootRef, sentinelRef, hasMore, busy, error, rootMargin, itemCount, resetKey, observeKey, loadMore]);
|
|
40606
|
-
(0, import_react234.useEffect)(() => {
|
|
40607
|
-
if (hasMore && !busy && !error && attemptedCount.current !== itemCount && itemCount < minItems) void loadMore();
|
|
40608
|
-
}, [hasMore, busy, error, itemCount, minItems, resetKey, loadMore]);
|
|
40609
|
-
return { isLoadingMore, error, busy, loadMore };
|
|
40610
|
-
}
|
|
40611
|
-
|
|
40612
|
-
// src/components/InfiniteScrollPanel.tsx
|
|
40613
40765
|
var import_jsx_runtime252 = require("react/jsx-runtime");
|
|
40614
40766
|
var GAP_CLASSES2 = {
|
|
40615
40767
|
xs: "gap-1.5",
|
|
@@ -47954,6 +48106,10 @@ var INNER_CORNER = {
|
|
|
47954
48106
|
var SIDE_PANEL_SIDES = ["left", "right", "top", "bottom"];
|
|
47955
48107
|
var OPEN_DURATION_MS = PANEL_SLIDE_DURATION_MS;
|
|
47956
48108
|
var OPEN_EASING = PANEL_SLIDE_EASING;
|
|
48109
|
+
var SHELL_CONTAINMENT = {
|
|
48110
|
+
contain: "layout style",
|
|
48111
|
+
containIntrinsicSize: "auto"
|
|
48112
|
+
};
|
|
47957
48113
|
var SIZE_TOKENS5 = {
|
|
47958
48114
|
xs: {
|
|
47959
48115
|
pad: "px-2 py-1.5",
|
|
@@ -48026,9 +48182,12 @@ var SidePanel = ({
|
|
|
48026
48182
|
defaultCollapsed = false,
|
|
48027
48183
|
onCollapsedChange,
|
|
48028
48184
|
collapsedLabel,
|
|
48185
|
+
motion = "layout",
|
|
48029
48186
|
onKeyDown
|
|
48030
48187
|
}) => {
|
|
48031
48188
|
const t = useKitT();
|
|
48189
|
+
const reduced = prefersReducedMotion();
|
|
48190
|
+
const slide = motion === "slide";
|
|
48032
48191
|
warnIfMissingTitle("SidePanel", title);
|
|
48033
48192
|
const vertical = side === "top" || side === "bottom";
|
|
48034
48193
|
const effectiveTone = tone ?? color2 ?? "neutral";
|
|
@@ -48058,20 +48217,32 @@ var SidePanel = ({
|
|
|
48058
48217
|
const wasOpen = prevOpenRef.current;
|
|
48059
48218
|
prevOpenRef.current = isOpen;
|
|
48060
48219
|
if (isOpen && !wasOpen) setMounted(true);
|
|
48061
|
-
if (!isOpen && wasOpen)
|
|
48062
|
-
|
|
48220
|
+
if (!isOpen && wasOpen) {
|
|
48221
|
+
setEntered(false);
|
|
48222
|
+
if (reduced) setMounted(false);
|
|
48223
|
+
}
|
|
48224
|
+
}, [isOpen, reduced]);
|
|
48063
48225
|
const shellRef = (0, import_react259.useRef)(null);
|
|
48064
48226
|
(0, import_react259.useLayoutEffect)(() => {
|
|
48065
48227
|
if (mounted && isOpen && !entered) {
|
|
48066
|
-
|
|
48067
|
-
|
|
48068
|
-
|
|
48228
|
+
if (reduced || slide) {
|
|
48229
|
+
setEntered(true);
|
|
48230
|
+
return void 0;
|
|
48231
|
+
}
|
|
48232
|
+
let second = 0;
|
|
48233
|
+
const first = requestAnimationFrame(() => {
|
|
48234
|
+
second = requestAnimationFrame(() => setEntered(true));
|
|
48235
|
+
});
|
|
48236
|
+
return () => {
|
|
48237
|
+
cancelAnimationFrame(first);
|
|
48238
|
+
cancelAnimationFrame(second);
|
|
48239
|
+
};
|
|
48069
48240
|
}
|
|
48070
48241
|
return void 0;
|
|
48071
|
-
}, [mounted, isOpen, entered]);
|
|
48242
|
+
}, [mounted, isOpen, entered, reduced, slide]);
|
|
48072
48243
|
const handleTransitionEnd = (event) => {
|
|
48073
48244
|
if (event.target !== event.currentTarget) return;
|
|
48074
|
-
if (event.propertyName !== (vertical ? "height" : "width")) return;
|
|
48245
|
+
if (event.propertyName !== (slide ? "opacity" : vertical ? "height" : "width")) return;
|
|
48075
48246
|
if (!isOpen) setMounted(false);
|
|
48076
48247
|
};
|
|
48077
48248
|
const [currentWidth, setCurrentWidth] = (0, import_react259.useState)(width);
|
|
@@ -48135,6 +48306,47 @@ var SidePanel = ({
|
|
|
48135
48306
|
};
|
|
48136
48307
|
const shellWidth = isCollapsed ? COLLAPSED_RAIL_WIDTH : resolvedWidth;
|
|
48137
48308
|
const shellHeight = isCollapsed ? COLLAPSED_RAIL_WIDTH : resolvedHeight;
|
|
48309
|
+
const sweepAxisSize = vertical ? resolvedHeight : resolvedWidth;
|
|
48310
|
+
const [sweep, setSweep] = (0, import_react259.useState)(null);
|
|
48311
|
+
const sweepKeyRef = (0, import_react259.useRef)(`${isOpen}:${isCollapsed}`);
|
|
48312
|
+
(0, import_react259.useEffect)(() => {
|
|
48313
|
+
const key = `${isOpen}:${isCollapsed}`;
|
|
48314
|
+
const prev = sweepKeyRef.current;
|
|
48315
|
+
sweepKeyRef.current = key;
|
|
48316
|
+
if (!slide || reduced || key === prev) return;
|
|
48317
|
+
const [wasOpen, wasCollapsed] = prev.split(":").map((v) => v === "true");
|
|
48318
|
+
if (!isOpen) {
|
|
48319
|
+
setSweep(null);
|
|
48320
|
+
return;
|
|
48321
|
+
}
|
|
48322
|
+
if (!wasOpen) {
|
|
48323
|
+
setSweep({ dir: "in", distance: sweepAxisSize });
|
|
48324
|
+
} else if (isCollapsed !== wasCollapsed) {
|
|
48325
|
+
setSweep({
|
|
48326
|
+
dir: isCollapsed ? "out" : "in",
|
|
48327
|
+
distance: Math.max(1, sweepAxisSize - COLLAPSED_RAIL_WIDTH)
|
|
48328
|
+
});
|
|
48329
|
+
}
|
|
48330
|
+
}, [slide, reduced, isOpen, isCollapsed, sweepAxisSize]);
|
|
48331
|
+
const sweepStyle = slide && sweep && !reduced ? {
|
|
48332
|
+
// `both` fill: an "out" sweep holds its end state (offset + hidden),
|
|
48333
|
+
// which is exactly the resting state of the inert collapsed content.
|
|
48334
|
+
...vertical ? { "--sp-sweep-y": `${(side === "top" ? -1 : 1) * sweep.distance}px` } : { "--sp-sweep-x": `${(side === "left" ? -1 : 1) * sweep.distance}px` },
|
|
48335
|
+
animation: `kit-sp-sweep-${vertical ? "y" : "x"}-${sweep.dir} ${OPEN_DURATION_MS}ms ${OPEN_EASING} both`
|
|
48336
|
+
} : void 0;
|
|
48337
|
+
const closingSlide = slide && !isOpen && !reduced;
|
|
48338
|
+
const dockRef = (0, import_react259.useRef)(null);
|
|
48339
|
+
(0, import_react259.useEffect)(() => {
|
|
48340
|
+
if (!docked) return;
|
|
48341
|
+
const prop = side === "left" ? "--page-zone-min-left" : side === "right" ? "--page-zone-min-right" : void 0;
|
|
48342
|
+
if (!prop) return;
|
|
48343
|
+
const row = dockRef.current?.closest("[data-page-row]");
|
|
48344
|
+
if (!row) return;
|
|
48345
|
+
row.style.setProperty(prop, `${shellWidth}px`);
|
|
48346
|
+
return () => {
|
|
48347
|
+
row.style.removeProperty(prop);
|
|
48348
|
+
};
|
|
48349
|
+
}, [docked, side, shellWidth, isOpen]);
|
|
48138
48350
|
const collapseButton = (label) => /* @__PURE__ */ (0, import_jsx_runtime271.jsx)(
|
|
48139
48351
|
CollapseToggleButton,
|
|
48140
48352
|
{
|
|
@@ -48171,13 +48383,21 @@ var SidePanel = ({
|
|
|
48171
48383
|
[resizable, vertical, side, currentWidth, currentHeight, minWidth, maxWidth, minHeight, maxHeight]
|
|
48172
48384
|
);
|
|
48173
48385
|
if (!mounted || docked && !isOpen) return null;
|
|
48174
|
-
const edgeOffset = entered ? vertical ? shellHeight : shellWidth : 0;
|
|
48386
|
+
const edgeOffset = slide || reduced || entered ? vertical ? shellHeight : shellWidth : 0;
|
|
48175
48387
|
const barTone = isDragging ? `opacity-100 bg-${effectiveTone}-500` : `bg-${effectiveTone}-400 opacity-0 group-hover:opacity-70 group-active:opacity-100`;
|
|
48176
48388
|
const gripTone = isDragging ? `opacity-100 bg-${effectiveTone}-500` : `bg-${effectiveTone}-400 opacity-0 group-hover:opacity-100 group-focus-visible:opacity-100`;
|
|
48177
48389
|
const edgeProperty = side;
|
|
48178
48390
|
const handleStyle = {
|
|
48179
48391
|
[edgeProperty]: edgeOffset,
|
|
48180
|
-
|
|
48392
|
+
...isDragging ? null : reduced ? null : slide ? closingSlide ? {
|
|
48393
|
+
// Out with the panel: a composited fade, and the sweep is over
|
|
48394
|
+
// once the shell unmounts. Click-through while it fades.
|
|
48395
|
+
opacity: 0,
|
|
48396
|
+
pointerEvents: "none",
|
|
48397
|
+
transition: `opacity ${OPEN_DURATION_MS}ms ${OPEN_EASING}`
|
|
48398
|
+
} : null : {
|
|
48399
|
+
transition: `${edgeProperty} ${OPEN_DURATION_MS}ms ${OPEN_EASING}, opacity ${OPEN_DURATION_MS}ms ${OPEN_EASING}`
|
|
48400
|
+
}
|
|
48181
48401
|
};
|
|
48182
48402
|
const handleParked = isCollapsed;
|
|
48183
48403
|
const panel = /* @__PURE__ */ (0, import_jsx_runtime271.jsxs)(import_jsx_runtime271.Fragment, { children: [
|
|
@@ -48195,15 +48415,29 @@ var SidePanel = ({
|
|
|
48195
48415
|
legacyVariant && borderClass,
|
|
48196
48416
|
legacyVariant ? shadowClass : panelOuterChrome
|
|
48197
48417
|
),
|
|
48198
|
-
style: {
|
|
48199
|
-
|
|
48418
|
+
style: slide ? {
|
|
48419
|
+
// Slide mode: the final flow size, once, no size transition.
|
|
48420
|
+
// A closing panel holds this size while it fades (composited)
|
|
48421
|
+
// and releases it at the end in a single layout.
|
|
48422
|
+
...vertical ? { height: shellHeight } : { width: shellWidth },
|
|
48423
|
+
...SHELL_CONTAINMENT,
|
|
48424
|
+
...closingSlide ? {
|
|
48425
|
+
opacity: 0,
|
|
48426
|
+
transition: `opacity ${OPEN_DURATION_MS}ms ${OPEN_EASING}`
|
|
48427
|
+
} : null
|
|
48428
|
+
} : {
|
|
48429
|
+
...vertical ? { height: reduced || entered ? shellHeight : 0 } : { width: reduced || entered ? shellWidth : 0 },
|
|
48430
|
+
...SHELL_CONTAINMENT,
|
|
48200
48431
|
// Inline rather than `transition-[width] duration-… ease-…`: an
|
|
48201
|
-
// arbitrary easing utility would have to survive the safelist,
|
|
48202
|
-
// this curve is not themeable anyway. It decelerates hard
|
|
48203
|
-
// which is what stops the panel feeling like it
|
|
48204
|
-
// Suppressed while resizing so the panel
|
|
48205
|
-
// rather than lagging a third of a
|
|
48206
|
-
|
|
48432
|
+
// arbitrary easing utility would have to survive the safelist,
|
|
48433
|
+
// and this curve is not themeable anyway. It decelerates hard
|
|
48434
|
+
// at the end, which is what stops the panel feeling like it
|
|
48435
|
+
// snaps into place. Suppressed while resizing so the panel
|
|
48436
|
+
// tracks the pointer exactly rather than lagging a third of a
|
|
48437
|
+
// second behind it — and under `prefers-reduced-motion`, where
|
|
48438
|
+
// an instant collapse is the whole point (no duration means no
|
|
48439
|
+
// `transitionend` either; the close effect unmounts directly).
|
|
48440
|
+
transition: isDragging || reduced ? void 0 : `${vertical ? "height" : "width"} ${OPEN_DURATION_MS}ms ${OPEN_EASING}`
|
|
48207
48441
|
},
|
|
48208
48442
|
onTransitionEnd: handleTransitionEnd,
|
|
48209
48443
|
children: [
|
|
@@ -48260,7 +48494,7 @@ var SidePanel = ({
|
|
|
48260
48494
|
isCollapsed && "opacity-0",
|
|
48261
48495
|
className
|
|
48262
48496
|
),
|
|
48263
|
-
style: vertical ? { height: resolvedHeight } : { width: resolvedWidth },
|
|
48497
|
+
style: vertical ? { height: resolvedHeight, ...sweepStyle } : { width: resolvedWidth, ...sweepStyle },
|
|
48264
48498
|
onKeyDown,
|
|
48265
48499
|
children: [
|
|
48266
48500
|
/* @__PURE__ */ (0, import_jsx_runtime271.jsxs)(
|
|
@@ -48358,12 +48592,14 @@ var SidePanel = ({
|
|
|
48358
48592
|
className: "absolute inset-0 z-30 bg-black/20 backdrop-blur-sm",
|
|
48359
48593
|
style: {
|
|
48360
48594
|
// A collapsed panel is a rail beside the content, not a sheet
|
|
48361
|
-
// over it — the scrim steps back with it.
|
|
48362
|
-
|
|
48595
|
+
// over it — the scrim steps back with it. Slide mode has no
|
|
48596
|
+
// entered-sweep to fade in behind, and reduced motion takes the
|
|
48597
|
+
// scrim off at once (there is no 450 ms fade to wait out).
|
|
48598
|
+
opacity: (slide || reduced ? isOpen : entered) && !isCollapsed ? 1 : 0,
|
|
48363
48599
|
// Not clickable until it has faded in: a double-click-open
|
|
48364
48600
|
// gesture must not have its second click eaten by the scrim.
|
|
48365
|
-
pointerEvents: isOpen && entered && !isCollapsed ? "auto" : "none",
|
|
48366
|
-
transition: `opacity ${OPEN_DURATION_MS}ms ${OPEN_EASING}`
|
|
48601
|
+
pointerEvents: isOpen && (slide || reduced || entered) && !isCollapsed ? "auto" : "none",
|
|
48602
|
+
transition: reduced ? void 0 : `opacity ${OPEN_DURATION_MS}ms ${OPEN_EASING}`
|
|
48367
48603
|
}
|
|
48368
48604
|
}
|
|
48369
48605
|
),
|
|
@@ -48450,6 +48686,7 @@ var SidePanel = ({
|
|
|
48450
48686
|
return docked ? /* @__PURE__ */ (0, import_jsx_runtime271.jsx)(
|
|
48451
48687
|
"div",
|
|
48452
48688
|
{
|
|
48689
|
+
ref: dockRef,
|
|
48453
48690
|
"data-sp-dock": true,
|
|
48454
48691
|
className: (0, import_classnames81.default)(
|
|
48455
48692
|
"relative flex shrink-0",
|
|
@@ -54636,6 +54873,7 @@ var StatPager_default = StatPager;
|
|
|
54636
54873
|
var import_jsx_runtime281 = require("react/jsx-runtime");
|
|
54637
54874
|
var STAT_CARD_PROGRESS_TYPES = ["spinner", "bar"];
|
|
54638
54875
|
var STAT_CARD_LOADERS = ["skeleton", "spinner", "progress"];
|
|
54876
|
+
var STAT_CARD_ICON_PLACEMENTS = ["left", "right"];
|
|
54639
54877
|
var SIZE_TOKENS8 = {
|
|
54640
54878
|
xs: {
|
|
54641
54879
|
value: "text-lg",
|
|
@@ -54678,6 +54916,13 @@ var SIZE_TOKENS8 = {
|
|
|
54678
54916
|
ecg: 80
|
|
54679
54917
|
}
|
|
54680
54918
|
};
|
|
54919
|
+
var LABEL_SIZE_TOKENS = {
|
|
54920
|
+
xs: "text-xs",
|
|
54921
|
+
sm: "text-sm",
|
|
54922
|
+
md: "text-base",
|
|
54923
|
+
lg: "text-base",
|
|
54924
|
+
xl: "text-lg"
|
|
54925
|
+
};
|
|
54681
54926
|
var TREND_TONES = {
|
|
54682
54927
|
up: "emerald",
|
|
54683
54928
|
down: "rose",
|
|
@@ -54689,12 +54934,21 @@ var TREND_ICONS = {
|
|
|
54689
54934
|
neutral: "Equal"
|
|
54690
54935
|
};
|
|
54691
54936
|
var SKELETON5 = "animate-pulse bg-black/10 motion-reduce:animate-none dark:bg-white/10";
|
|
54937
|
+
var TONED_SURFACE_VARIANTS = [
|
|
54938
|
+
"subtle",
|
|
54939
|
+
"tonal",
|
|
54940
|
+
"glass",
|
|
54941
|
+
"simple",
|
|
54942
|
+
"liquid-glass"
|
|
54943
|
+
];
|
|
54692
54944
|
var isEmpty = (node) => node == null || node === "" || node === false;
|
|
54693
54945
|
var StatCard = ({
|
|
54694
54946
|
label: labelProp,
|
|
54695
54947
|
value: valueProp,
|
|
54696
54948
|
icon: iconProp,
|
|
54697
54949
|
iconTone,
|
|
54950
|
+
iconBackground = false,
|
|
54951
|
+
iconPlacement = "left",
|
|
54698
54952
|
trend: trendProp,
|
|
54699
54953
|
size = "md",
|
|
54700
54954
|
tone: surfaceTone = "none",
|
|
@@ -54760,6 +55014,7 @@ var StatCard = ({
|
|
|
54760
55014
|
const tokens = SIZE_TOKENS8[size] ?? SIZE_TOKENS8.md;
|
|
54761
55015
|
const valueTokens = SIZE_TOKENS8[valueSize ?? size] ?? tokens;
|
|
54762
55016
|
const labelTokens = SIZE_TOKENS8[labelSize ?? size] ?? tokens;
|
|
55017
|
+
const titleScale = LABEL_SIZE_TOKENS[labelSize ?? size] ?? LABEL_SIZE_TOKENS.md;
|
|
54763
55018
|
const hasLabel = !isEmpty(label);
|
|
54764
55019
|
const hasValue = !isEmpty(value);
|
|
54765
55020
|
const hasIcon = !!icon;
|
|
@@ -54781,6 +55036,7 @@ var StatCard = ({
|
|
|
54781
55036
|
const resolvedDecoration = withDecoration === true ? "shapes" : withDecoration === false ? "none" : decoration;
|
|
54782
55037
|
const statTokens = getStatTileColorClasses(tone ?? "neutral");
|
|
54783
55038
|
const chipTokens = getPillColorClasses(iconTone ?? tone ?? "neutral", "soft");
|
|
55039
|
+
const iconColor = iconTone ?? tone ?? "neutral";
|
|
54784
55040
|
const trendTone = trend ? TREND_TONES[trend.direction] ?? "slate" : "slate";
|
|
54785
55041
|
const gradientTone = tone ?? "blue";
|
|
54786
55042
|
const translucentSurface = getSurfaceTextTokens(
|
|
@@ -54789,11 +55045,56 @@ var StatCard = ({
|
|
|
54789
55045
|
const gradientStop = (shade) => translucentSurface ? `color-mix(in srgb, var(--color-${gradientTone}-${shade}) 60%, transparent)` : `var(--color-${gradientTone}-${shade})`;
|
|
54790
55046
|
const gradientBackground = gradient ? `linear-gradient(135deg, ${gradientStop("950")}, ${gradientStop("800")} 50%, ${gradientStop("700")})` : void 0;
|
|
54791
55047
|
const onGradient = Boolean(gradientBackground);
|
|
55048
|
+
const titleClass = (0, import_classnames89.default)(
|
|
55049
|
+
"min-w-0 font-medium",
|
|
55050
|
+
onGradient ? "text-white/80" : labelTone ? `text-${labelTone}-600 dark:text-${labelTone}-400` : "text-neutral-500 dark:text-neutral-400",
|
|
55051
|
+
titleScale
|
|
55052
|
+
);
|
|
55053
|
+
const iconNode = hasIcon ? iconBackground ? /* @__PURE__ */ (0, import_jsx_runtime281.jsx)(
|
|
55054
|
+
"span",
|
|
55055
|
+
{
|
|
55056
|
+
className: (0, import_classnames89.default)(
|
|
55057
|
+
"inline-flex flex-none items-center justify-center",
|
|
55058
|
+
tokens.chip,
|
|
55059
|
+
onGradient ? "bg-white/20 text-white" : (0, import_classnames89.default)(chipTokens.base, chipTokens.border)
|
|
55060
|
+
),
|
|
55061
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime281.jsx)(CustomIcon, { icon, size: tokens.icon })
|
|
55062
|
+
}
|
|
55063
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime281.jsx)(
|
|
55064
|
+
"span",
|
|
55065
|
+
{
|
|
55066
|
+
className: (0, import_classnames89.default)(
|
|
55067
|
+
"flex-none",
|
|
55068
|
+
onGradient ? "text-white" : `text-${iconColor}-600 dark:text-${iconColor}-400`
|
|
55069
|
+
),
|
|
55070
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime281.jsx)(CustomIcon, { icon, size: tokens.icon })
|
|
55071
|
+
}
|
|
55072
|
+
) : null;
|
|
55073
|
+
const dividerClass = onGradient ? "border-white/20" : variant && TONED_SURFACE_VARIANTS.includes(variant) ? `border-${tone ?? "neutral"}-400/40 dark:border-${tone ?? "neutral"}-500/40` : statTokens.divider;
|
|
54792
55074
|
const skeleton = /* @__PURE__ */ (0, import_jsx_runtime281.jsxs)("div", { className: "flex min-w-0 flex-1 flex-col gap-3", "aria-hidden": "true", children: [
|
|
54793
|
-
/* @__PURE__ */ (0, import_jsx_runtime281.
|
|
55075
|
+
/* @__PURE__ */ (0, import_jsx_runtime281.jsx)("div", { className: "flex items-start justify-between gap-3", children: iconPlacement === "left" ? /* @__PURE__ */ (0, import_jsx_runtime281.jsxs)("span", { className: "flex min-w-0 flex-1 items-center gap-2", children: [
|
|
55076
|
+
hasIcon && /* @__PURE__ */ (0, import_jsx_runtime281.jsx)(
|
|
55077
|
+
"div",
|
|
55078
|
+
{
|
|
55079
|
+
className: (0, import_classnames89.default)(
|
|
55080
|
+
SKELETON5,
|
|
55081
|
+
iconBackground ? tokens.chip : "h-4 w-4 rounded"
|
|
55082
|
+
)
|
|
55083
|
+
}
|
|
55084
|
+
),
|
|
55085
|
+
/* @__PURE__ */ (0, import_jsx_runtime281.jsx)("div", { className: (0, import_classnames89.default)(SKELETON5, "h-3 w-24 rounded") })
|
|
55086
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime281.jsxs)(import_jsx_runtime281.Fragment, { children: [
|
|
54794
55087
|
/* @__PURE__ */ (0, import_jsx_runtime281.jsx)("div", { className: (0, import_classnames89.default)(SKELETON5, "h-3 w-24 rounded") }),
|
|
54795
|
-
hasIcon && /* @__PURE__ */ (0, import_jsx_runtime281.jsx)(
|
|
54796
|
-
|
|
55088
|
+
hasIcon && /* @__PURE__ */ (0, import_jsx_runtime281.jsx)(
|
|
55089
|
+
"div",
|
|
55090
|
+
{
|
|
55091
|
+
className: (0, import_classnames89.default)(
|
|
55092
|
+
SKELETON5,
|
|
55093
|
+
iconBackground ? tokens.chip : "h-4 w-4 rounded"
|
|
55094
|
+
)
|
|
55095
|
+
}
|
|
55096
|
+
)
|
|
55097
|
+
] }) }),
|
|
54797
55098
|
/* @__PURE__ */ (0, import_jsx_runtime281.jsx)("div", { className: (0, import_classnames89.default)(SKELETON5, "h-8 w-2/3 rounded") }),
|
|
54798
55099
|
hasSubtitle && /* @__PURE__ */ (0, import_jsx_runtime281.jsx)("div", { className: (0, import_classnames89.default)(SKELETON5, "h-3 w-1/2 rounded") }),
|
|
54799
55100
|
(showProgressBar || hasProgressBarLegacy) && /* @__PURE__ */ (0, import_jsx_runtime281.jsx)("div", { className: (0, import_classnames89.default)(SKELETON5, "mt-auto h-2 w-full rounded-full") })
|
|
@@ -54838,33 +55139,23 @@ var StatCard = ({
|
|
|
54838
55139
|
),
|
|
54839
55140
|
...rest,
|
|
54840
55141
|
children: loading && loaderType === "skeleton" ? skeleton : /* @__PURE__ */ (0, import_jsx_runtime281.jsxs)("div", { className: "flex min-w-0 flex-1 flex-col", children: [
|
|
54841
|
-
hasHeader &&
|
|
54842
|
-
|
|
54843
|
-
|
|
54844
|
-
|
|
54845
|
-
|
|
54846
|
-
|
|
54847
|
-
|
|
54848
|
-
|
|
54849
|
-
|
|
54850
|
-
|
|
54851
|
-
|
|
54852
|
-
) : /* @__PURE__ */ (0, import_jsx_runtime281.jsx)("span", {}),
|
|
55142
|
+
hasHeader && (iconPlacement === "left" ? (
|
|
55143
|
+
// Icon then title, as one row centred on the icon; `actions`
|
|
55144
|
+
// still pin to the right edge.
|
|
55145
|
+
/* @__PURE__ */ (0, import_jsx_runtime281.jsxs)("div", { className: "flex items-start justify-between gap-3", children: [
|
|
55146
|
+
/* @__PURE__ */ (0, import_jsx_runtime281.jsxs)("span", { className: "flex min-w-0 flex-1 items-center gap-2", children: [
|
|
55147
|
+
iconNode,
|
|
55148
|
+
hasLabel && /* @__PURE__ */ (0, import_jsx_runtime281.jsx)("span", { className: titleClass, children: label })
|
|
55149
|
+
] }),
|
|
55150
|
+
!isEmpty(actions) && /* @__PURE__ */ (0, import_jsx_runtime281.jsx)("span", { className: "flex flex-none items-center gap-1", children: actions })
|
|
55151
|
+
] })
|
|
55152
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime281.jsxs)("div", { className: "flex items-start justify-between gap-3", children: [
|
|
55153
|
+
hasLabel ? /* @__PURE__ */ (0, import_jsx_runtime281.jsx)("span", { className: titleClass, children: label }) : /* @__PURE__ */ (0, import_jsx_runtime281.jsx)("span", {}),
|
|
54853
55154
|
/* @__PURE__ */ (0, import_jsx_runtime281.jsxs)("span", { className: "flex flex-none items-center gap-1", children: [
|
|
54854
55155
|
!isEmpty(actions) && actions,
|
|
54855
|
-
|
|
54856
|
-
"span",
|
|
54857
|
-
{
|
|
54858
|
-
className: (0, import_classnames89.default)(
|
|
54859
|
-
"inline-flex flex-none items-center justify-center",
|
|
54860
|
-
tokens.chip,
|
|
54861
|
-
onGradient ? "bg-white/20 text-white" : (0, import_classnames89.default)(chipTokens.base, chipTokens.border)
|
|
54862
|
-
),
|
|
54863
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime281.jsx)(CustomIcon, { icon, size: tokens.icon })
|
|
54864
|
-
}
|
|
54865
|
-
)
|
|
55156
|
+
iconNode
|
|
54866
55157
|
] })
|
|
54867
|
-
] }),
|
|
55158
|
+
] })),
|
|
54868
55159
|
isPaged && pagerPlacement === "top" && /* @__PURE__ */ (0, import_jsx_runtime281.jsx)(
|
|
54869
55160
|
StatPager_default,
|
|
54870
55161
|
{
|
|
@@ -55018,10 +55309,7 @@ var StatCard = ({
|
|
|
55018
55309
|
(hasMeta || hasFooter) && !hasError && /* @__PURE__ */ (0, import_jsx_runtime281.jsxs)(
|
|
55019
55310
|
"div",
|
|
55020
55311
|
{
|
|
55021
|
-
className: (0, import_classnames89.default)(
|
|
55022
|
-
"mt-4 border-t pt-4",
|
|
55023
|
-
onGradient ? "border-white/20" : statTokens.divider
|
|
55024
|
-
),
|
|
55312
|
+
className: (0, import_classnames89.default)("mt-4 border-t pt-4", dividerClass),
|
|
55025
55313
|
children: [
|
|
55026
55314
|
hasMeta && /* @__PURE__ */ (0, import_jsx_runtime281.jsx)("div", { className: "flex flex-wrap gap-3", children: meta.map((item, idx) => /* @__PURE__ */ (0, import_jsx_runtime281.jsxs)(
|
|
55027
55315
|
"div",
|
|
@@ -69797,6 +70085,7 @@ var WorkflowTrackerRail = ({
|
|
|
69797
70085
|
collapsed,
|
|
69798
70086
|
defaultCollapsed = false,
|
|
69799
70087
|
onCollapsedChange,
|
|
70088
|
+
motion = "layout",
|
|
69800
70089
|
fillHeight = false,
|
|
69801
70090
|
flush = true,
|
|
69802
70091
|
expandLabel = "Expand workflow rail",
|
|
@@ -69841,11 +70130,39 @@ var WorkflowTrackerRail = ({
|
|
|
69841
70130
|
);
|
|
69842
70131
|
const progress = (0, import_react295.useMemo)(() => computeProgress(steps), [steps]);
|
|
69843
70132
|
const tallies = (0, import_react295.useMemo)(() => computeTallies(steps, customStatuses), [steps, customStatuses]);
|
|
70133
|
+
const reduced = prefersReducedMotion();
|
|
70134
|
+
const slide = motion === "slide";
|
|
70135
|
+
const padPx = getSurfacePaddingPx(cardProps.padding ?? "none");
|
|
70136
|
+
const expandedWidth = typeof style?.width === "number" ? style.width : 360;
|
|
70137
|
+
const [sweepDir, setSweepDir] = (0, import_react295.useState)(null);
|
|
70138
|
+
const sweepKeyRef = (0, import_react295.useRef)(isCollapsed);
|
|
70139
|
+
(0, import_react295.useEffect)(() => {
|
|
70140
|
+
const prev = sweepKeyRef.current;
|
|
70141
|
+
sweepKeyRef.current = isCollapsed;
|
|
70142
|
+
if (!slide || reduced || prev === isCollapsed) return;
|
|
70143
|
+
setSweepDir(isCollapsed ? "out" : "in");
|
|
70144
|
+
}, [slide, reduced, isCollapsed]);
|
|
70145
|
+
const railRef = (0, import_react295.useRef)(null);
|
|
70146
|
+
(0, import_react295.useEffect)(() => {
|
|
70147
|
+
if (!collapsible) return;
|
|
70148
|
+
const prop = side === "left" ? "--page-zone-min-left" : "--page-zone-min-right";
|
|
70149
|
+
const row = railRef.current?.closest("[data-page-row]");
|
|
70150
|
+
if (!row) return;
|
|
70151
|
+
row.style.setProperty(
|
|
70152
|
+
prop,
|
|
70153
|
+
`${isCollapsed ? COLLAPSED_RAIL_WIDTH : expandedWidth}px`
|
|
70154
|
+
);
|
|
70155
|
+
return () => {
|
|
70156
|
+
row.style.removeProperty(prop);
|
|
70157
|
+
};
|
|
70158
|
+
}, [collapsible, side, isCollapsed, expandedWidth]);
|
|
70159
|
+
const sweepProperty = "width";
|
|
69844
70160
|
return /* @__PURE__ */ (0, import_jsx_runtime317.jsxs)(
|
|
69845
70161
|
Panel_default,
|
|
69846
70162
|
{
|
|
69847
70163
|
...cardProps,
|
|
69848
|
-
|
|
70164
|
+
ref: railRef,
|
|
70165
|
+
padding: collapsible ? "none" : cardProps.padding,
|
|
69849
70166
|
scrollable: false,
|
|
69850
70167
|
flexBody: scrollBody,
|
|
69851
70168
|
className: (0, import_classnames117.default)(
|
|
@@ -69856,9 +70173,18 @@ var WorkflowTrackerRail = ({
|
|
|
69856
70173
|
),
|
|
69857
70174
|
style: collapsible ? {
|
|
69858
70175
|
// SidePanel's curve, not `duration-200 ease-in-out` (which read
|
|
69859
|
-
// as a snap)
|
|
69860
|
-
//
|
|
69861
|
-
|
|
70176
|
+
// as a snap), and ONE property: the width carries the sweep,
|
|
70177
|
+
// the inset rides inside the containment on its own element.
|
|
70178
|
+
// Slide mode snaps the flow size (the timeline sweeps instead);
|
|
70179
|
+
// reduced motion takes both off — an instant collapse is the
|
|
70180
|
+
// point, and no 450 ms layout animation to observe per frame.
|
|
70181
|
+
...slide || reduced ? null : { transition: panelSlideTransition(sweepProperty) },
|
|
70182
|
+
// Layout containment bounds the per-frame relayout the sweep
|
|
70183
|
+
// triggers; `paint` deliberately absent — step popovers and
|
|
70184
|
+
// tooltips render outside this box, and paint containment would
|
|
70185
|
+
// amputate them invisibly until someone opened one.
|
|
70186
|
+
contain: "layout style",
|
|
70187
|
+
containIntrinsicSize: "auto",
|
|
69862
70188
|
...style,
|
|
69863
70189
|
width: isCollapsed ? COLLAPSED_RAIL_WIDTH : style?.width ?? 360,
|
|
69864
70190
|
...flush ? side === "left" ? { borderTopLeftRadius: 0, borderBottomLeftRadius: 0 } : { borderTopRightRadius: 0, borderBottomRightRadius: 0 } : {}
|
|
@@ -69891,56 +70217,73 @@ var WorkflowTrackerRail = ({
|
|
|
69891
70217
|
)
|
|
69892
70218
|
}
|
|
69893
70219
|
),
|
|
69894
|
-
|
|
69895
|
-
/* @__PURE__ */ (0, import_jsx_runtime317.jsx)(
|
|
70220
|
+
/* @__PURE__ */ (0, import_jsx_runtime317.jsxs)(
|
|
69896
70221
|
"div",
|
|
69897
70222
|
{
|
|
69898
|
-
|
|
69899
|
-
className: scrollBody
|
|
69900
|
-
|
|
69901
|
-
|
|
69902
|
-
{
|
|
69903
|
-
|
|
69904
|
-
|
|
69905
|
-
|
|
69906
|
-
|
|
69907
|
-
|
|
69908
|
-
|
|
69909
|
-
|
|
69910
|
-
|
|
69911
|
-
|
|
69912
|
-
|
|
69913
|
-
|
|
69914
|
-
|
|
69915
|
-
|
|
69916
|
-
|
|
69917
|
-
|
|
69918
|
-
|
|
69919
|
-
|
|
69920
|
-
|
|
69921
|
-
|
|
69922
|
-
|
|
69923
|
-
|
|
69924
|
-
|
|
69925
|
-
|
|
69926
|
-
|
|
69927
|
-
|
|
69928
|
-
|
|
69929
|
-
|
|
69930
|
-
|
|
69931
|
-
|
|
69932
|
-
|
|
69933
|
-
|
|
69934
|
-
|
|
69935
|
-
|
|
69936
|
-
|
|
69937
|
-
|
|
69938
|
-
|
|
69939
|
-
|
|
69940
|
-
|
|
69941
|
-
|
|
69942
|
-
|
|
69943
|
-
|
|
70223
|
+
"data-rail-inset": true,
|
|
70224
|
+
className: (0, import_classnames117.default)("min-w-0", scrollBody && "flex min-h-0 flex-1 flex-col"),
|
|
70225
|
+
style: {
|
|
70226
|
+
padding: collapsible && !isCollapsed ? padPx : 0,
|
|
70227
|
+
...collapsible && !slide && !reduced ? { transition: panelSlideTransition("padding") } : null,
|
|
70228
|
+
...slide && sweepDir && !reduced ? {
|
|
70229
|
+
"--sp-sweep-x": `${(side === "left" ? -1 : 1) * Math.max(1, expandedWidth - COLLAPSED_RAIL_WIDTH)}px`,
|
|
70230
|
+
animation: `kit-sp-sweep-x-${sweepDir} ${PANEL_SLIDE_DURATION_MS}ms ${PANEL_SLIDE_EASING} both`
|
|
70231
|
+
} : null
|
|
70232
|
+
},
|
|
70233
|
+
children: [
|
|
70234
|
+
collapsible && (isCollapsed || loading || steps.length === 0) && /* @__PURE__ */ (0, import_jsx_runtime317.jsx)("div", { className: "h-10 shrink-0" }),
|
|
70235
|
+
/* @__PURE__ */ (0, import_jsx_runtime317.jsx)(
|
|
70236
|
+
"div",
|
|
70237
|
+
{
|
|
70238
|
+
id: timelineId,
|
|
70239
|
+
className: scrollBody ? "flex min-h-0 flex-1 flex-col" : void 0,
|
|
70240
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime317.jsx)(
|
|
70241
|
+
WorkflowTimeline_default,
|
|
70242
|
+
{
|
|
70243
|
+
controls: renderControls?.({ collapsed: isCollapsed }),
|
|
70244
|
+
controlsHeader: renderControlsHeader?.({ collapsed: isCollapsed }),
|
|
70245
|
+
footerResizable,
|
|
70246
|
+
defaultFooterHeight,
|
|
70247
|
+
footerHeight,
|
|
70248
|
+
onFooterHeightChange,
|
|
70249
|
+
footerLabel,
|
|
70250
|
+
footerResizeLabel,
|
|
70251
|
+
collapsed: isCollapsed,
|
|
70252
|
+
side,
|
|
70253
|
+
hasCollapseToggle: collapsible,
|
|
70254
|
+
renderStepPopover,
|
|
70255
|
+
stepPopoverProps: {
|
|
70256
|
+
placement: side === "left" ? "right" : "left",
|
|
70257
|
+
variant: cardProps.variant,
|
|
70258
|
+
tone: cardProps.tone,
|
|
70259
|
+
corner: cardProps.corner,
|
|
70260
|
+
glassOpacity: cardProps.glassOpacity,
|
|
70261
|
+
vibrancy: cardProps.vibrancy,
|
|
70262
|
+
specularMode: cardProps.specularMode,
|
|
70263
|
+
...stepPopoverProps
|
|
70264
|
+
},
|
|
70265
|
+
fillHeight: scrollBody,
|
|
70266
|
+
steps,
|
|
70267
|
+
activeStepId: active?.step.id,
|
|
70268
|
+
palette,
|
|
70269
|
+
customStatuses,
|
|
70270
|
+
surfaces,
|
|
70271
|
+
labels,
|
|
70272
|
+
progress,
|
|
70273
|
+
tallies,
|
|
70274
|
+
showLegend: showLegend && !loading,
|
|
70275
|
+
loading,
|
|
70276
|
+
loadingRows,
|
|
70277
|
+
emptyState,
|
|
70278
|
+
onStepSelect,
|
|
70279
|
+
disableFutureSteps,
|
|
70280
|
+
onSubStepSelect,
|
|
70281
|
+
onStepAction
|
|
70282
|
+
}
|
|
70283
|
+
)
|
|
70284
|
+
}
|
|
70285
|
+
)
|
|
70286
|
+
]
|
|
69944
70287
|
}
|
|
69945
70288
|
)
|
|
69946
70289
|
]
|
|
@@ -77736,18 +78079,24 @@ var TerminalTabs = (0, import_react321.forwardRef)(
|
|
|
77736
78079
|
// src/components/PageBodyLayout.tsx
|
|
77737
78080
|
var import_classnames143 = __toESM(require("classnames"), 1);
|
|
77738
78081
|
var import_jsx_runtime345 = require("react/jsx-runtime");
|
|
78082
|
+
var REGION_CONTAINMENT = {
|
|
78083
|
+
contain: "layout style",
|
|
78084
|
+
containIntrinsicSize: "auto"
|
|
78085
|
+
};
|
|
77739
78086
|
var PAGE_BODY_LAYOUT_VARIANTS = ["none", ...SURFACE_VARIANTS];
|
|
77740
78087
|
function PageBodyLayout({ header, left, right, bottom, children, className, minCenterWidth = 240, minCenterHeight = 120, gap = 8, padding = "xs", centerPadding = "none", variant = "outlined", ...surface }) {
|
|
77741
78088
|
const plain = variant === "none" || variant === "plain";
|
|
78089
|
+
const zoneGaps = gap * ((hasZone(left) ? 1 : 0) + (hasZone(right) ? 1 : 0));
|
|
78090
|
+
const floorPx = minCenterWidth + zoneGaps + (plain ? 0 : getSurfacePaddingPx(padding) * 2);
|
|
77742
78091
|
const body = /* @__PURE__ */ (0, import_jsx_runtime345.jsxs)(import_jsx_runtime345.Fragment, { children: [
|
|
77743
78092
|
header && /* @__PURE__ */ (0, import_jsx_runtime345.jsx)("div", { className: "shrink-0", children: header }),
|
|
77744
|
-
/* @__PURE__ */ (0, import_jsx_runtime345.jsx)("div", { className: (0, import_classnames143.default)("min-h-0 min-w-0 flex-1 overflow-auto", THIN_SCROLLBAR), children: /* @__PURE__ */ (0, import_jsx_runtime345.jsxs)("div", { className: (0, import_classnames143.default)("flex h-full min-h-0", !plain && getSurfacePaddingClass(padding)), style: { minWidth:
|
|
77745
|
-
hasZone(left) && /* @__PURE__ */ (0, import_jsx_runtime345.jsx)("div", { "data-page-region": "left", className: "flex min-h-0 shrink-0", children: left }),
|
|
78093
|
+
/* @__PURE__ */ (0, import_jsx_runtime345.jsx)("div", { className: (0, import_classnames143.default)("min-h-0 min-w-0 flex-1 overflow-auto", THIN_SCROLLBAR), children: /* @__PURE__ */ (0, import_jsx_runtime345.jsxs)("div", { "data-page-row": true, className: (0, import_classnames143.default)("flex h-full min-h-0", !plain && getSurfacePaddingClass(padding)), style: { minWidth: `calc(var(--page-zone-min-left, 0px) + var(--page-zone-min-right, 0px) + ${floorPx}px)`, gap, ...plain ? { paddingTop: header ? gap : 0 } : {} }, children: [
|
|
78094
|
+
hasZone(left) && /* @__PURE__ */ (0, import_jsx_runtime345.jsx)("div", { "data-page-region": "left", className: "flex min-h-0 shrink-0", style: REGION_CONTAINMENT, children: left }),
|
|
77746
78095
|
/* @__PURE__ */ (0, import_jsx_runtime345.jsxs)("div", { className: "flex min-h-0 flex-1 flex-col", style: { gap, minWidth: minCenterWidth }, children: [
|
|
77747
|
-
/* @__PURE__ */ (0, import_jsx_runtime345.jsx)("div", { "data-page-region": "center", className: (0, import_classnames143.default)("min-w-0 flex-1 overflow-auto", THIN_SCROLLBAR, getSurfacePaddingClass(centerPadding)), style: { minHeight: minCenterHeight }, children }),
|
|
77748
|
-
hasZone(bottom) && /* @__PURE__ */ (0, import_jsx_runtime345.jsx)("div", { "data-page-region": "bottom", className: "flex min-w-0 shrink-0 flex-col", children: bottom })
|
|
78096
|
+
/* @__PURE__ */ (0, import_jsx_runtime345.jsx)("div", { "data-page-region": "center", className: (0, import_classnames143.default)("min-w-0 flex-1 overflow-auto", THIN_SCROLLBAR, getSurfacePaddingClass(centerPadding)), style: { minHeight: minCenterHeight, ...REGION_CONTAINMENT }, children }),
|
|
78097
|
+
hasZone(bottom) && /* @__PURE__ */ (0, import_jsx_runtime345.jsx)("div", { "data-page-region": "bottom", className: "flex min-w-0 shrink-0 flex-col", style: REGION_CONTAINMENT, children: bottom })
|
|
77749
78098
|
] }),
|
|
77750
|
-
hasZone(right) && /* @__PURE__ */ (0, import_jsx_runtime345.jsx)("div", { "data-page-region": "right", className: "flex min-h-0 shrink-0", children: right })
|
|
78099
|
+
hasZone(right) && /* @__PURE__ */ (0, import_jsx_runtime345.jsx)("div", { "data-page-region": "right", className: "flex min-h-0 shrink-0", style: REGION_CONTAINMENT, children: right })
|
|
77751
78100
|
] }) })
|
|
77752
78101
|
] });
|
|
77753
78102
|
return plain ? /* @__PURE__ */ (0, import_jsx_runtime345.jsx)("div", { "data-page-layout": "none", className: (0, import_classnames143.default)("flex h-full min-h-0 min-w-0 flex-col", className), children: body }) : /* @__PURE__ */ (0, import_jsx_runtime345.jsx)(Panel_default, { ...surface, variant, padding: "none", scrollable: false, flexBody: true, className: (0, import_classnames143.default)("h-full min-h-0 min-w-0", className), children: body });
|
|
@@ -81759,6 +82108,7 @@ function NetworkGraph({
|
|
|
81759
82108
|
PAGE_HEADER_VARIANTS,
|
|
81760
82109
|
PANEL_HERO_TITLE_ELEMENTS,
|
|
81761
82110
|
PANEL_HERO_VARIANTS,
|
|
82111
|
+
PANEL_MOTIONS,
|
|
81762
82112
|
PANEL_SLIDE_DURATION_MS,
|
|
81763
82113
|
PANEL_SLIDE_EASING,
|
|
81764
82114
|
PANEL_TONE_FOR_FIELD,
|
|
@@ -81812,6 +82162,7 @@ function NetworkGraph({
|
|
|
81812
82162
|
SPLIT_VIEW_VARIANTS,
|
|
81813
82163
|
STATUS_ICON,
|
|
81814
82164
|
STATUS_TONE,
|
|
82165
|
+
STAT_CARD_ICON_PLACEMENTS,
|
|
81815
82166
|
STAT_CARD_LOADERS,
|
|
81816
82167
|
STAT_CARD_PROGRESS_TYPES,
|
|
81817
82168
|
STAT_GRAPH_CHART_TYPES,
|
|
@@ -82083,6 +82434,7 @@ function NetworkGraph({
|
|
|
82083
82434
|
getSurfaceGutterClass,
|
|
82084
82435
|
getSurfacePaddingClass,
|
|
82085
82436
|
getSurfacePaddingClasses,
|
|
82437
|
+
getSurfacePaddingPx,
|
|
82086
82438
|
getSurfaceTextTokens,
|
|
82087
82439
|
getSurfaceTokens,
|
|
82088
82440
|
getSurfaceTransparencyClasses,
|