@tetrascience-npm/tetrascience-react-ui 0.7.0-beta.106.1 → 0.7.0-beta.108.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (51) hide show
  1. package/README.md +1 -1
  2. package/dist/components/charts/ChromatogramChart/ChromatogramChart.cjs +1 -1
  3. package/dist/components/charts/ChromatogramChart/ChromatogramChart.cjs.map +1 -1
  4. package/dist/components/charts/ChromatogramChart/ChromatogramChart.js +221 -207
  5. package/dist/components/charts/ChromatogramChart/ChromatogramChart.js.map +1 -1
  6. package/dist/components/charts/ChromatogramChart/annotations.cjs +1 -1
  7. package/dist/components/charts/ChromatogramChart/annotations.cjs.map +1 -1
  8. package/dist/components/charts/ChromatogramChart/annotations.js +99 -36
  9. package/dist/components/charts/ChromatogramChart/annotations.js.map +1 -1
  10. package/dist/components/charts/ChromatogramChart/boundaryMarkers.cjs +1 -1
  11. package/dist/components/charts/ChromatogramChart/boundaryMarkers.cjs.map +1 -1
  12. package/dist/components/charts/ChromatogramChart/boundaryMarkers.js +12 -12
  13. package/dist/components/charts/ChromatogramChart/boundaryMarkers.js.map +1 -1
  14. package/dist/components/charts/ChromatogramChart/constants.cjs +1 -1
  15. package/dist/components/charts/ChromatogramChart/constants.cjs.map +1 -1
  16. package/dist/components/charts/ChromatogramChart/constants.js +11 -5
  17. package/dist/components/charts/ChromatogramChart/constants.js.map +1 -1
  18. package/dist/components/charts/ChromatogramChart/dataProcessing.cjs +1 -1
  19. package/dist/components/charts/ChromatogramChart/dataProcessing.cjs.map +1 -1
  20. package/dist/components/charts/ChromatogramChart/dataProcessing.js +49 -38
  21. package/dist/components/charts/ChromatogramChart/dataProcessing.js.map +1 -1
  22. package/dist/components/charts/ChromatogramChart/plotBuilder.cjs +2 -0
  23. package/dist/components/charts/ChromatogramChart/plotBuilder.cjs.map +1 -0
  24. package/dist/components/charts/ChromatogramChart/plotBuilder.js +207 -0
  25. package/dist/components/charts/ChromatogramChart/plotBuilder.js.map +1 -0
  26. package/dist/components/charts/ChromatogramChart/regionOverlays.cjs +2 -0
  27. package/dist/components/charts/ChromatogramChart/regionOverlays.cjs.map +1 -0
  28. package/dist/components/charts/ChromatogramChart/regionOverlays.js +26 -0
  29. package/dist/components/charts/ChromatogramChart/regionOverlays.js.map +1 -0
  30. package/dist/components/charts/StackedChromatogramChart/StackedChromatogramChart.cjs +2 -0
  31. package/dist/components/charts/StackedChromatogramChart/StackedChromatogramChart.cjs.map +1 -0
  32. package/dist/components/charts/StackedChromatogramChart/StackedChromatogramChart.js +40 -0
  33. package/dist/components/charts/StackedChromatogramChart/StackedChromatogramChart.js.map +1 -0
  34. package/dist/components/charts/StackedChromatogramChart/transforms.cjs +2 -0
  35. package/dist/components/charts/StackedChromatogramChart/transforms.cjs.map +1 -0
  36. package/dist/components/charts/StackedChromatogramChart/transforms.js +31 -0
  37. package/dist/components/charts/StackedChromatogramChart/transforms.js.map +1 -0
  38. package/dist/index.cjs +1 -1
  39. package/dist/index.css +1 -1
  40. package/dist/index.d.ts +141 -34
  41. package/dist/index.js +570 -582
  42. package/dist/index.tailwind.css +1 -1
  43. package/package.json +2 -4
  44. package/dist/components/ui/drawer.cjs +0 -2
  45. package/dist/components/ui/drawer.cjs.map +0 -1
  46. package/dist/components/ui/drawer.js +0 -125
  47. package/dist/components/ui/drawer.js.map +0 -1
  48. package/dist/components/ui/input-otp.cjs +0 -2
  49. package/dist/components/ui/input-otp.cjs.map +0 -1
  50. package/dist/components/ui/input-otp.js +0 -82
  51. package/dist/components/ui/input-otp.js.map +0 -1
package/dist/index.d.ts CHANGED
@@ -20,7 +20,6 @@ import { DayPicker } from 'react-day-picker';
20
20
  import { default as default_2 } from 'react';
21
21
  import { default as default_3 } from 'embla-carousel-react';
22
22
  import { Dialog as Dialog_2 } from 'radix-ui';
23
- import { Drawer as Drawer_2 } from 'vaul';
24
23
  import { DropdownMenu as DropdownMenu_2 } from 'radix-ui';
25
24
  import { DynamicToolUIPart } from 'ai';
26
25
  import { ElementType } from 'react';
@@ -39,7 +38,6 @@ import { Menubar as Menubar_2 } from 'radix-ui';
39
38
  import { MouseEvent as MouseEvent_2 } from 'react';
40
39
  import { NavigationMenu as NavigationMenu_2 } from 'radix-ui';
41
40
  import { OnChange } from '@monaco-editor/react';
42
- import { OTPInput } from 'input-otp';
43
41
  import { PaginationState } from '@tanstack/react-table';
44
42
  import { Popover as Popover_2 } from 'radix-ui';
45
43
  import { PropsWithChildren } from 'react';
@@ -123,6 +121,8 @@ export declare function allPositions(dims: PlateDimensions): WellId[];
123
121
 
124
122
  export declare function applyFilterCondition(cellValue: string, operator: FilterOperator, filterValue: string): boolean;
125
123
 
124
+ export declare function applyStackingTransform(inputSeries: ChromatogramSeries[], inputAnnotations: PeakAnnotation[][] | undefined, mode: StackingMode, stackOffset: number, stackingOrder?: "first-on-bottom" | "first-on-top"): TransformResult;
125
+
126
126
  export declare interface AreaDataSeries {
127
127
  x: number[];
128
128
  y: number[];
@@ -808,6 +808,44 @@ export declare interface ChromatogramChartProps {
808
808
  annotationOverlapThreshold?: number;
809
809
  /** Show export button in modebar (default: true) */
810
810
  showExportButton?: boolean;
811
+ /**
812
+ * IDs of peaks that should render in the "selected" visual state.
813
+ * Fully controlled — the component owns no selection state of its own.
814
+ * IDs match the id field on PeakAnnotation (user-provided) or the
815
+ * auto-generated IDs for auto-detected peaks ("peak-{seriesIndex}-{peakIndex}").
816
+ */
817
+ selectedPeakIds?: string[];
818
+ /**
819
+ * Called when the user clicks on a peak annotation or its invisible hit target.
820
+ * The consumer decides whether to add/remove the id from selectedPeakIds
821
+ * (toggle vs. replace behaviour is the consumer's responsibility).
822
+ */
823
+ onPeakClick?: (event: PeakSelectEvent) => void;
824
+ /**
825
+ * Called when the cursor enters or leaves a peak hit target.
826
+ * Receives null on unhover. As a side-effect, the series line for the
827
+ * hovered peak thickens by selectionAppearance.hoverLineWidthMultiplier.
828
+ */
829
+ onPeakHover?: (event: PeakSelectEvent | null) => void;
830
+ /**
831
+ * Override the default visual behaviour for selected / unselected / hover states.
832
+ * All sub-fields are optional — defaults are applied for any omitted value.
833
+ * Only has a visual effect when selectedPeakIds or onPeakClick/onPeakHover are used.
834
+ */
835
+ selectionAppearance?: PeakSelectionAppearance;
836
+ /**
837
+ * Annotation label style (default: "arrow").
838
+ * - "arrow" — arrowhead pointing to the peak with a floating label box
839
+ * - "inline" — no arrow; label sits 4 px above the actual trace Y value
840
+ */
841
+ annotationStyle?: "arrow" | "inline";
842
+ /** Title font size in pixels (default: 20) */
843
+ titleFontSize?: number;
844
+ /**
845
+ * Top margin override when a title is shown (default: from
846
+ * CHROMATOGRAM_LAYOUT.MARGIN_TOP_WITH_TITLE).
847
+ */
848
+ titleTopMargin?: number;
811
849
  }
812
850
 
813
851
  export declare interface ChromatogramProps {
@@ -1396,26 +1434,6 @@ export declare type DotPlotProps = {
1396
1434
 
1397
1435
  export declare type DotPlotVariant = "default" | "stacked";
1398
1436
 
1399
- export declare function Drawer({ ...props }: React_2.ComponentProps<typeof Drawer_2.Root>): JSX.Element;
1400
-
1401
- export declare function DrawerClose({ ...props }: React_2.ComponentProps<typeof Drawer_2.Close>): JSX.Element;
1402
-
1403
- export declare function DrawerContent({ className, children, ...props }: React_2.ComponentProps<typeof Drawer_2.Content>): JSX.Element;
1404
-
1405
- export declare function DrawerDescription({ className, ...props }: React_2.ComponentProps<typeof Drawer_2.Description>): JSX.Element;
1406
-
1407
- export declare function DrawerFooter({ className, ...props }: React_2.ComponentProps<"div">): JSX.Element;
1408
-
1409
- export declare function DrawerHeader({ className, ...props }: React_2.ComponentProps<"div">): JSX.Element;
1410
-
1411
- export declare function DrawerOverlay({ className, ...props }: React_2.ComponentProps<typeof Drawer_2.Overlay>): JSX.Element;
1412
-
1413
- export declare function DrawerPortal({ ...props }: React_2.ComponentProps<typeof Drawer_2.Portal>): JSX.Element;
1414
-
1415
- export declare function DrawerTitle({ className, ...props }: React_2.ComponentProps<typeof Drawer_2.Title>): JSX.Element;
1416
-
1417
- export declare function DrawerTrigger({ ...props }: React_2.ComponentProps<typeof Drawer_2.Trigger>): JSX.Element;
1418
-
1419
1437
  export declare function DropdownMenu({ ...props }: React_2.ComponentProps<typeof DropdownMenu_2.Root>): JSX.Element;
1420
1438
 
1421
1439
  export declare function DropdownMenuCheckboxItem({ className, children, checked, inset, ...props }: React_2.ComponentProps<typeof DropdownMenu_2.CheckboxItem> & {
@@ -1737,18 +1755,6 @@ export declare function InputGroupText({ className, ...props }: React_2.Componen
1737
1755
 
1738
1756
  export declare function InputGroupTextarea({ className, ...props }: React_2.ComponentProps<"textarea">): JSX.Element;
1739
1757
 
1740
- export declare function InputOTP({ className, containerClassName, ...props }: React_2.ComponentProps<typeof OTPInput> & {
1741
- containerClassName?: string;
1742
- }): JSX.Element;
1743
-
1744
- export declare function InputOTPGroup({ className, ...props }: React_2.ComponentProps<"div">): JSX.Element;
1745
-
1746
- export declare function InputOTPSeparator({ ...props }: React_2.ComponentProps<"div">): JSX.Element;
1747
-
1748
- export declare function InputOTPSlot({ index, className, ...props }: React_2.ComponentProps<"div"> & {
1749
- index: number;
1750
- }): JSX.Element;
1751
-
1752
1758
  export declare function Item({ className, variant, size, asChild, ...props }: React_2.ComponentProps<"div"> & VariantProps<typeof itemVariants> & {
1753
1759
  asChild?: boolean;
1754
1760
  }): JSX.Element;
@@ -2160,6 +2166,13 @@ export declare function parseRowLabel(label: string): number;
2160
2166
  * Used for both user-provided annotations and auto-detected peaks.
2161
2167
  */
2162
2168
  export declare interface PeakAnnotation {
2169
+ /**
2170
+ * Stable identifier used for selection (selectedPeakIds).
2171
+ * Auto-generated by the component if omitted:
2172
+ * - User annotations: "user-ann-{index}"
2173
+ * - Auto-detected peaks: "peak-{seriesIndex}-{peakIndex}"
2174
+ */
2175
+ id?: string;
2163
2176
  /** Retention time of the peak (x-axis position) */
2164
2177
  x: number;
2165
2178
  /** Signal intensity at peak (y-axis position) */
@@ -2178,6 +2191,23 @@ export declare interface PeakAnnotation {
2178
2191
  startMarker?: BoundaryMarkerType;
2179
2192
  /** Marker style for end boundary (default: "diamond") */
2180
2193
  endMarker?: BoundaryMarkerType;
2194
+ /**
2195
+ * Optional per-peak color override. When set, overrides the default
2196
+ * series-color / grey for the annotation label, arrow, border, and boundary markers.
2197
+ */
2198
+ color?: string;
2199
+ /**
2200
+ * When true, overlay a thickened line along the underlying trace between startX and endX.
2201
+ * Requires startX/endX. Uses peak.color if set, otherwise series color.
2202
+ */
2203
+ regionOverlay?: boolean;
2204
+ /** Line width for the region overlay (default: 3.5) */
2205
+ regionOverlayWidth?: number;
2206
+ /**
2207
+ * Plotly hovertemplate HTML string used by the region overlay and the invisible
2208
+ * hit-area marker for this peak. Falls back to a default summary when omitted.
2209
+ */
2210
+ hoverText?: string;
2181
2211
  /* Excluded from this release type: _computed */
2182
2212
  }
2183
2213
 
@@ -2206,6 +2236,48 @@ export declare interface PeakDetectionOptions {
2206
2236
  relativeThreshold?: boolean;
2207
2237
  }
2208
2238
 
2239
+ /**
2240
+ * Payload delivered to onPeakClick and onPeakHover callbacks.
2241
+ */
2242
+ declare interface PeakSelectEvent {
2243
+ /** The resolved peak ID (matches id field on PeakAnnotation) */
2244
+ id: string;
2245
+ /** The annotation object for this peak */
2246
+ peak: PeakAnnotation;
2247
+ /** Index of the series this peak belongs to (0-based; -1 for legacy user annotations) */
2248
+ seriesIndex: number;
2249
+ /** Display name of the series */
2250
+ seriesName: string;
2251
+ /** True when the peak was found by automatic peak detection, false for user-provided annotations */
2252
+ isAutoDetected: boolean;
2253
+ }
2254
+
2255
+ /**
2256
+ * Visual overrides for the selected / unselected / hover states.
2257
+ * All fields are optional — defaults are applied for any omitted field.
2258
+ *
2259
+ * Defaults:
2260
+ * selected.borderColor "#3b82f6"
2261
+ * selected.backgroundColor "#dbeafe"
2262
+ * selected.bold true
2263
+ * unselected.opacity 0.4 (applied when any other peak is selected)
2264
+ * hoverLineWidthMultiplier 1.67 (1.5 px → ~2.5 px)
2265
+ */
2266
+ declare interface PeakSelectionAppearance {
2267
+ selected?: {
2268
+ borderColor?: string;
2269
+ backgroundColor?: string;
2270
+ /** Wrap annotation text in <b> tags when selected */
2271
+ bold?: boolean;
2272
+ };
2273
+ unselected?: {
2274
+ /** Opacity of annotations whose peak is NOT selected while another peak IS selected (0–1) */
2275
+ opacity?: number;
2276
+ };
2277
+ /** Multiplier applied to the base line width (1.5 px) on peak hover */
2278
+ hoverLineWidthMultiplier?: number;
2279
+ }
2280
+
2209
2281
  export declare const PieChart: default_2.FC<PieChartProps>;
2210
2282
 
2211
2283
  export declare type PieChartProps = {
@@ -3535,6 +3607,35 @@ export declare const spinnerVariants: (props?: ({
3535
3607
  size?: "default" | "sm" | "lg" | "md" | null | undefined;
3536
3608
  } & ClassProp) | undefined) => string;
3537
3609
 
3610
+ export declare function StackedChromatogramChart({ series, stackingMode, stackOffset, stackingOrder, annotations, ...restProps }: StackedChromatogramChartProps): JSX.Element;
3611
+
3612
+ export declare interface StackedChromatogramChartProps extends Omit<ChromatogramChartProps, "series" | "annotations" | "yRange"> {
3613
+ /** Array of data series to display */
3614
+ series: ChromatogramSeries[];
3615
+ /** Stacking mode: 'overlay' (default) or 'stack' */
3616
+ stackingMode?: StackingMode;
3617
+ /**
3618
+ * Y-offset between stacked series in data units (e.g., AU).
3619
+ * Only applies in 'stack' mode; ignored in 'overlay'.
3620
+ */
3621
+ stackOffset?: number;
3622
+ /**
3623
+ * Peak annotations per series, parallel to the series array.
3624
+ * annotations[i] corresponds to series[i].
3625
+ * In stack mode, y values are shifted by the series offset.
3626
+ */
3627
+ annotations?: PeakAnnotation[][];
3628
+ /**
3629
+ * Controls which end of the stack series[0] lands on (stack mode only).
3630
+ * - "first-on-bottom" (default) — series[0] sits at the base; series[N-1] is highest.
3631
+ * - "first-on-top" — series[0] is shifted to the top; series[N-1] is at the base.
3632
+ * Annotations follow the chosen direction.
3633
+ */
3634
+ stackingOrder?: "first-on-bottom" | "first-on-top";
3635
+ }
3636
+
3637
+ export declare type StackingMode = "overlay" | "stack";
3638
+
3538
3639
  export declare function StatCard({ label, value, delta, deltaLabel, trend, description, className, ...props }: StatCardProps): JSX.Element;
3539
3640
 
3540
3641
  export declare interface StatCardProps extends React_2.ComponentProps<"div"> {
@@ -4034,6 +4135,12 @@ declare type ToolUIPartApproval = {
4034
4135
  */
4035
4136
  export declare const toPlotlyColorscale: (ramp: readonly string[]) => Array<[number, string]>;
4036
4137
 
4138
+ declare interface TransformResult {
4139
+ series: ChromatogramSeries[];
4140
+ annotations: PeakAnnotation[];
4141
+ yRange: [number, number];
4142
+ }
4143
+
4037
4144
  export declare function triagePlateMapCsvByBarcode(text: string, options?: PlateMapCsvTriageOptions): PlateMapCsvTriage;
4038
4145
 
4039
4146
  export declare function triagePlateMapCsvFile(file: File, options?: PlateMapCsvTriageOptions): Promise<PlateMapCsvTriage | undefined>;