@galaxy-io/dls 1.4.11 → 1.4.13

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.
@@ -2,31 +2,7 @@ import { createContext, useCallback, useMemo, useState } from "react";
2
2
  import { jsx } from "react/jsx-runtime";
3
3
  //#region src/charts/DashboardProvider.tsx
4
4
  var DashboardContext = createContext(null);
5
- /**
6
- * Shares the hovered category between the cartesian charts inside it.
7
- *
8
- * Hovering a category in one chart shows the same category emphasized in every
9
- * sibling — matched by raw category label, so charts whose category sets only
10
- * partially overlap simply show nothing for the labels they lack. The tooltip
11
- * stays local to the chart under the pointer; siblings get the quiet emphasis
12
- * only (LineChart its cursor line and dots, BarChart its category muting).
13
- *
14
- * Scope, deliberately narrow:
15
- * - Only the category axis syncs. Legend (series) hover stays local.
16
- * - PieChart never participates — it has no category axis.
17
- * - There is no per-chart opt-out prop. The opt-out is rendering the chart
18
- * outside the provider, and nesting a second provider isolates a subset —
19
- * charts sync with their nearest ancestor.
20
- *
21
- * Renders no DOM and holds no layout opinion — unlike `OverlayProvider` it is
22
- * not a page-root singleton, and several can coexist on a page.
23
- *
24
- * Plain context state is the right transport here: entries change at category
25
- * granularity (once per hit band crossed, not per mousemove), so a sweep
26
- * across a chart re-renders the group a handful of times. No subscription or
27
- * selector machinery is warranted.
28
- */
29
- var DashboardProvider = ({ children }) => {
5
+ var DashboardProvider = ({ sharedTooltip = false, children }) => {
30
6
  const [activeEntry, setActiveEntry] = useState(null);
31
7
  const setActive = useCallback((entry) => {
32
8
  setActiveEntry((prev) => prev !== null && prev.sourceId === entry.sourceId && prev.categoryKey === entry.categoryKey ? prev : entry);
@@ -37,11 +13,13 @@ var DashboardProvider = ({ children }) => {
37
13
  const contextValue = useMemo(() => ({
38
14
  activeEntry,
39
15
  setActive,
40
- clearActive
16
+ clearActive,
17
+ sharedTooltip
41
18
  }), [
42
19
  activeEntry,
43
20
  setActive,
44
- clearActive
21
+ clearActive,
22
+ sharedTooltip
45
23
  ]);
46
24
  return /* @__PURE__ */ jsx(DashboardContext.Provider, {
47
25
  value: contextValue,
@@ -69,7 +69,7 @@ var LineChart = ({ series, lines, categories, width, height, fillWidth, fillHeig
69
69
  categoryCount: geometry.columns.length,
70
70
  seriesKeys: legendKeys,
71
71
  categoryKeys: geometry.categories,
72
- disabled: noTooltip || isLoading || isEmpty,
72
+ isDisabled: noTooltip || isLoading || isEmpty,
73
73
  isLoading
74
74
  });
75
75
  const activeColumn = interaction.activeIndex === null ? null : geometry.columns[interaction.activeIndex];
@@ -76,7 +76,7 @@ var PieChart = ({ series, slices, width, height, fillWidth, fillHeight, aspectRa
76
76
  const interaction = useChartInteraction({
77
77
  categoryCount: geometry.arcs.length,
78
78
  seriesKeys: legendKeys,
79
- disabled: noTooltip || isLoading || isEmpty,
79
+ isDisabled: noTooltip || isLoading || isEmpty,
80
80
  isLoading
81
81
  });
82
82
  const buildCategoryTooltip = useCallback((index) => {
@@ -181,6 +181,14 @@ export declare const CHART_TRANSITION_MS = 100;
181
181
  */
182
182
  export declare const CHART_MARK_OPACITY_ACTIVE = 1;
183
183
  export declare const CHART_MARK_OPACITY_MUTED = 0.1;
184
+ /**
185
+ * The whisper tier, for `ChartMarkState.DIMMED`.
186
+ *
187
+ * Deliberately far gentler than MUTED: it is used where another affordance —
188
+ * BarChart's cursor band — already marks the hovered category, so the
189
+ * off-category marks only need to step back, not disappear.
190
+ */
191
+ export declare const CHART_MARK_OPACITY_DIMMED = 0.4;
184
192
  /** Distance in px between the tooltip and its anchor. */
185
193
  export declare const CHART_TOOLTIP_OFFSET = 10;
186
194
  /** Minimum width of the tooltip, in px. */
@@ -190,15 +198,17 @@ export declare const CHART_TOOLTIP_MAX_WIDTH = 320;
190
198
  /** Gap in px between the plot box and a side-placed legend. */
191
199
  export declare const CHART_LEGEND_SIDE_GAP = 16;
192
200
  /**
193
- * Gap in px between entries in a horizontal legend.
201
+ * Spacing in px between entries in a horizontal legend.
194
202
  *
195
- * Also the number the fit computation adds between measured entries, so the
196
- * CSS and the arithmetic cannot disagree which is what makes the collapse
197
- * exact rather than "usually right".
203
+ * Applied as each entry's *trailing padding*, not a flex gap on the row: a gap
204
+ * is dead space between hover targets, and sweeping across it drops the series
205
+ * isolation between every pair of entries. Because the padding lives inside
206
+ * the entries, measured entry sizes already include the spacing and the fit
207
+ * computation needs no separate gap term.
198
208
  */
199
209
  export declare const CHART_LEGEND_COLUMN_GAP = 16;
200
- /** Gap in px between entries in a vertical legend. Same contract as
201
- * {@link CHART_LEGEND_COLUMN_GAP}: shared by the CSS and the fit arithmetic. */
210
+ /** Spacing in px between entries in a vertical legend. Same contract as
211
+ * {@link CHART_LEGEND_COLUMN_GAP}: trailing padding on the entry, no flex gap. */
202
212
  export declare const CHART_LEGEND_VERTICAL_GAP = 8;
203
213
  /**
204
214
  * Ceiling on the collapsed-legend popover's height, in px.
@@ -191,6 +191,14 @@ var CHART_TRANSITION_MS = 100;
191
191
  */
192
192
  var CHART_MARK_OPACITY_ACTIVE = 1;
193
193
  var CHART_MARK_OPACITY_MUTED = .1;
194
+ /**
195
+ * The whisper tier, for `ChartMarkState.DIMMED`.
196
+ *
197
+ * Deliberately far gentler than MUTED: it is used where another affordance —
198
+ * BarChart's cursor band — already marks the hovered category, so the
199
+ * off-category marks only need to step back, not disappear.
200
+ */
201
+ var CHART_MARK_OPACITY_DIMMED = .4;
194
202
  /** Distance in px between the tooltip and its anchor. */
195
203
  var CHART_TOOLTIP_OFFSET = 10;
196
204
  /** Minimum width of the tooltip, in px. */
@@ -200,15 +208,17 @@ var CHART_TOOLTIP_MAX_WIDTH = 320;
200
208
  /** Gap in px between the plot box and a side-placed legend. */
201
209
  var CHART_LEGEND_SIDE_GAP = 16;
202
210
  /**
203
- * Gap in px between entries in a horizontal legend.
211
+ * Spacing in px between entries in a horizontal legend.
204
212
  *
205
- * Also the number the fit computation adds between measured entries, so the
206
- * CSS and the arithmetic cannot disagree which is what makes the collapse
207
- * exact rather than "usually right".
213
+ * Applied as each entry's *trailing padding*, not a flex gap on the row: a gap
214
+ * is dead space between hover targets, and sweeping across it drops the series
215
+ * isolation between every pair of entries. Because the padding lives inside
216
+ * the entries, measured entry sizes already include the spacing and the fit
217
+ * computation needs no separate gap term.
208
218
  */
209
219
  var CHART_LEGEND_COLUMN_GAP = 16;
210
- /** Gap in px between entries in a vertical legend. Same contract as
211
- * {@link CHART_LEGEND_COLUMN_GAP}: shared by the CSS and the fit arithmetic. */
220
+ /** Spacing in px between entries in a vertical legend. Same contract as
221
+ * {@link CHART_LEGEND_COLUMN_GAP}: trailing padding on the entry, no flex gap. */
212
222
  var CHART_LEGEND_VERTICAL_GAP = 8;
213
223
  /**
214
224
  * Ceiling on the collapsed-legend popover's height, in px.
@@ -266,4 +276,4 @@ var CHART_PALETTE_ORDER = [
266
276
  ChartPalette.RED
267
277
  ];
268
278
  //#endregion
269
- export { AGGREGATED_SLICE_KEY, AUTO_MARGIN_LEFT_STEP, AXIS_TITLE_BAND, AXIS_TITLE_GAP, BAR_GAP_COMFORTABLE, BAR_GAP_MEDIUM, BAR_GAP_TIGHT, BAR_RADIUS, BAR_RADIUS_NARROW, BAR_WIDTH_RATIO, CAPTION_CHAR_WIDTH_PX, CATEGORY_AXIS_LABEL_GAP, CATEGORY_AXIS_LABEL_HEIGHT, CHART_LEGEND_COLUMN_GAP, CHART_LEGEND_OVERFLOW_MAX_HEIGHT, CHART_LEGEND_SIDE_GAP, CHART_LEGEND_VERTICAL_GAP, CHART_MARK_OPACITY_ACTIVE, CHART_MARK_OPACITY_MUTED, CHART_PALETTE_ORDER, CHART_TOOLTIP_MAX_WIDTH, CHART_TOOLTIP_MIN_WIDTH, CHART_TOOLTIP_OFFSET, CHART_TRANSITION_MS, DEFAULT_CHART_MARGIN, DEFAULT_LINE_STROKE_WIDTH, DEFAULT_VALUE_TICK_COUNT, GRID_LINE_BLEED, GROUP_GAP_COMFORTABLE, GROUP_GAP_MEDIUM, GROUP_GAP_TIGHT, LINE_AREA_OPACITY, LINE_POINT_RADIUS, MAX_AUTO_MARGIN_LEFT, MAX_BAR_WIDTH, MAX_GAP_SHARE, MIN_AUTO_MARGIN_LEFT, MIN_BARS_FOR_TIGHT_SPACING, MIN_BAR_LENGTH, MIN_CATEGORY_LABEL_GAP, NARROW_BAR_WIDTH, PIE_CHART_MARGIN, PIE_CORNER_RADIUS, PIE_DONUT_INNER_RATIO, PIE_MAX_AUTO_INNER_RATIO, PIE_MAX_INSET_SHARE, PIE_MIN_SLICE_SHARE, PIE_PAD_ANGLE, PIE_TOOLTIP_ANCHOR_INSET, STACK_SEGMENT_GAP, VALUE_AXIS_LABEL_HEIGHT, VALUE_AXIS_TICK_GAP, WIDTH_FOR_MEDIUM_SPACING, WIDTH_FOR_TIGHT_SPACING };
279
+ export { AGGREGATED_SLICE_KEY, AUTO_MARGIN_LEFT_STEP, AXIS_TITLE_BAND, AXIS_TITLE_GAP, BAR_GAP_COMFORTABLE, BAR_GAP_MEDIUM, BAR_GAP_TIGHT, BAR_RADIUS, BAR_RADIUS_NARROW, BAR_WIDTH_RATIO, CAPTION_CHAR_WIDTH_PX, CATEGORY_AXIS_LABEL_GAP, CATEGORY_AXIS_LABEL_HEIGHT, CHART_LEGEND_COLUMN_GAP, CHART_LEGEND_OVERFLOW_MAX_HEIGHT, CHART_LEGEND_SIDE_GAP, CHART_LEGEND_VERTICAL_GAP, CHART_MARK_OPACITY_ACTIVE, CHART_MARK_OPACITY_DIMMED, CHART_MARK_OPACITY_MUTED, CHART_PALETTE_ORDER, CHART_TOOLTIP_MAX_WIDTH, CHART_TOOLTIP_MIN_WIDTH, CHART_TOOLTIP_OFFSET, CHART_TRANSITION_MS, DEFAULT_CHART_MARGIN, DEFAULT_LINE_STROKE_WIDTH, DEFAULT_VALUE_TICK_COUNT, GRID_LINE_BLEED, GROUP_GAP_COMFORTABLE, GROUP_GAP_MEDIUM, GROUP_GAP_TIGHT, LINE_AREA_OPACITY, LINE_POINT_RADIUS, MAX_AUTO_MARGIN_LEFT, MAX_BAR_WIDTH, MAX_GAP_SHARE, MIN_AUTO_MARGIN_LEFT, MIN_BARS_FOR_TIGHT_SPACING, MIN_BAR_LENGTH, MIN_CATEGORY_LABEL_GAP, NARROW_BAR_WIDTH, PIE_CHART_MARGIN, PIE_CORNER_RADIUS, PIE_DONUT_INNER_RATIO, PIE_MAX_AUTO_INNER_RATIO, PIE_MAX_INSET_SHARE, PIE_MIN_SLICE_SHARE, PIE_PAD_ANGLE, PIE_TOOLTIP_ANCHOR_INSET, STACK_SEGMENT_GAP, VALUE_AXIS_LABEL_HEIGHT, VALUE_AXIS_TICK_GAP, WIDTH_FOR_MEDIUM_SPACING, WIDTH_FOR_TIGHT_SPACING };
@@ -153,8 +153,16 @@ export declare enum ChartCategoryLabelMode {
153
153
  export declare enum ChartMarkState {
154
154
  /** Full strength — the default, and the hovered category. */
155
155
  ACTIVE = "active",
156
- /** Softened, for categories other than the hovered one. */
157
- MUTED = "muted"
156
+ /** Softened, for marks outside the engaged series or category. */
157
+ MUTED = "muted",
158
+ /**
159
+ * Barely softened — a whisper of {@link MUTED}.
160
+ *
161
+ * Used where another affordance already carries the emphasis and strong
162
+ * muting would be a second, louder voice: BarChart's category axis dims
163
+ * like this because the cursor band is the highlight.
164
+ */
165
+ DIMMED = "dimmed"
158
166
  }
159
167
  /** Which pair of a rectangle's corners carries the radius. */
160
168
  export declare enum BarCorners {
@@ -314,7 +322,14 @@ export interface ChartPlotTooltipModel {
314
322
  anchorX: number;
315
323
  anchorY: number;
316
324
  }
317
- /** Render prop for replacing the tooltip body. Positioning stays with the chart. */
325
+ /**
326
+ * Render prop for replacing the tooltip body. Positioning stays with the chart.
327
+ *
328
+ * Never called with empty `rows` — with a custom renderer installed, a
329
+ * hovered category with no data opens no tooltip at all (the built-in body
330
+ * is the one that knows how to say "No data") — so `rows[0]`-style
331
+ * assumptions are safe here.
332
+ */
318
333
  export type ChartTooltipRenderer = (model: ChartTooltipModel) => ReactNode;
319
334
  /** Which shape a category's hit target is drawn as. */
320
335
  export declare enum ChartTargetShape {
@@ -115,8 +115,16 @@ var ChartCategoryLabelMode = /* @__PURE__ */ function(ChartCategoryLabelMode) {
115
115
  var ChartMarkState = /* @__PURE__ */ function(ChartMarkState) {
116
116
  /** Full strength — the default, and the hovered category. */
117
117
  ChartMarkState["ACTIVE"] = "active";
118
- /** Softened, for categories other than the hovered one. */
118
+ /** Softened, for marks outside the engaged series or category. */
119
119
  ChartMarkState["MUTED"] = "muted";
120
+ /**
121
+ * Barely softened — a whisper of {@link MUTED}.
122
+ *
123
+ * Used where another affordance already carries the emphasis and strong
124
+ * muting would be a second, louder voice: BarChart's category axis dims
125
+ * like this because the cursor band is the highlight.
126
+ */
127
+ ChartMarkState["DIMMED"] = "dimmed";
120
128
  return ChartMarkState;
121
129
  }({});
122
130
  /** Which pair of a rectangle's corners carries the radius. */
@@ -11,11 +11,12 @@ import { ChartMarkState } from "./types";
11
11
  *
12
12
  * Plus one read-only source: inside a `DashboardProvider`, a chart that
13
13
  * supplies {@link UseChartInteractionOptions.categoryKeys} follows the category
14
- * hovered in a sibling chart, matched by raw label. Following emphasizes it
15
- * never opens the tooltip, which is what {@link ChartInteraction.hasLocalHover}
16
- * distinguishes. The series axis deliberately does not sync: series keys are
17
- * chart-local vocabulary, and isolating "Delivered" in a chart that happens to
18
- * share the name would correlate nothing.
14
+ * hovered in a sibling chart, matched by raw label. Following emphasizes; it
15
+ * opens the tooltip only when the provider opts in via `sharedTooltip`, which
16
+ * is what {@link ChartInteraction.showTooltip} folds together. The series axis
17
+ * deliberately does not sync: series keys are chart-local vocabulary, and
18
+ * isolating "Delivered" in a chart that happens to share the name would
19
+ * correlate nothing.
19
20
  *
20
21
  * Deliberately no click layer. Clicking used to pin the hover so it survived
21
22
  * the pointer leaving, and it read as the chart getting stuck — the emphasis
@@ -33,12 +34,21 @@ interface UseChartInteractionOptions {
33
34
  * two charts formatting the same label differently must still match.
34
35
  */
35
36
  categoryKeys?: string[];
37
+ /**
38
+ * How marks outside the active category recede. Defaults to
39
+ * {@link ChartMarkState.MUTED}; BarChart passes
40
+ * {@link ChartMarkState.DIMMED} because its cursor band already carries the
41
+ * category highlight and strong muting on top of it would shout. Only the
42
+ * category axis softens — series (legend) isolation always mutes fully,
43
+ * since there the muting *is* the affordance.
44
+ */
45
+ categoryMuteState?: ChartMarkState;
36
46
  /** Suppress all interaction — used while loading and when the tooltip is off. */
37
- disabled?: boolean;
47
+ isDisabled?: boolean;
38
48
  /**
39
49
  * Render every mark muted, whatever the two axes say.
40
50
  *
41
- * Distinct from {@link disabled}, which suppresses *input*. Loading suppresses
51
+ * Distinct from {@link isDisabled}, which suppresses *input*. Loading suppresses
42
52
  * *emphasis*: there is nothing yet worth drawing attention to. Folded in here
43
53
  * rather than left to each mark, because the alternative is the same
44
54
  * `isLoading ? MUTED : getMarkState(…)` ternary hand-copied at every mark —
@@ -59,11 +69,11 @@ export interface ChartInteraction {
59
69
  */
60
70
  activeIndex: number | null;
61
71
  /**
62
- * True when {@link activeIndex} comes from this chart's own pointer rather
63
- * than a synced sibling. Gates the tooltip: only the chart under the pointer
64
- * opens one.
72
+ * True when this chart should present its tooltip for {@link activeIndex}:
73
+ * its own pointer hover always, a synced sibling's only when the
74
+ * `DashboardProvider` opts in via `sharedTooltip`.
65
75
  */
66
- hasLocalHover: boolean;
76
+ showTooltip: boolean;
67
77
  hoveredSeriesKey: string | null;
68
78
  /**
69
79
  * Emphasis for one mark, composed from both axes.
@@ -82,5 +92,5 @@ export interface ChartInteraction {
82
92
  onSeriesEnter: (seriesKey: string) => void;
83
93
  onSeriesLeave: () => void;
84
94
  }
85
- export declare function useChartInteraction({ categoryCount, seriesKeys, categoryKeys, disabled, isLoading, }: UseChartInteractionOptions): ChartInteraction;
95
+ export declare function useChartInteraction({ categoryCount, seriesKeys, categoryKeys, categoryMuteState, isDisabled, isLoading, }: UseChartInteractionOptions): ChartInteraction;
86
96
  export {};
@@ -2,7 +2,7 @@ import { ChartMarkState } from "./types.js";
2
2
  import { DashboardContext } from "./DashboardProvider.js";
3
3
  import { useCallback, useContext, useEffect, useId, useMemo, useState } from "react";
4
4
  //#region src/charts/useChartInteraction.ts
5
- function useChartInteraction({ categoryCount, seriesKeys, categoryKeys, disabled = false, isLoading = false }) {
5
+ function useChartInteraction({ categoryCount, seriesKeys, categoryKeys, categoryMuteState = ChartMarkState.MUTED, isDisabled = false, isLoading = false }) {
6
6
  const [hoveredIndex, setHoveredIndex] = useState(null);
7
7
  const [hoveredSeriesKey, setHoveredSeriesKey] = useState(null);
8
8
  const sync = useContext(DashboardContext);
@@ -60,14 +60,15 @@ function useChartInteraction({ categoryCount, seriesKeys, categoryKeys, disabled
60
60
  categoryKeys
61
61
  ]);
62
62
  const effectiveIndex = safeHovered ?? followedIndex;
63
+ const showTooltip = safeHovered !== null || followedIndex !== null && (sync?.sharedTooltip ?? false);
63
64
  const onCategoryEnter = useCallback((categoryIndex) => {
64
- if (disabled) return;
65
+ if (isDisabled) return;
65
66
  setHoveredIndex(categoryIndex);
66
- }, [disabled]);
67
+ }, [isDisabled]);
67
68
  const onCategoryLeave = useCallback(() => {
68
- if (disabled) return;
69
+ if (isDisabled) return;
69
70
  setHoveredIndex(null);
70
- }, [disabled]);
71
+ }, [isDisabled]);
71
72
  const onSeriesEnter = useCallback((seriesKey) => {
72
73
  setHoveredSeriesKey(seriesKey);
73
74
  }, []);
@@ -76,15 +77,19 @@ function useChartInteraction({ categoryCount, seriesKeys, categoryKeys, disabled
76
77
  }, []);
77
78
  const getMarkState = useCallback(({ categoryIndex, seriesKey }) => {
78
79
  if (isLoading) return ChartMarkState.MUTED;
79
- return categoryIndex !== void 0 && effectiveIndex !== null && categoryIndex !== effectiveIndex || seriesKey !== void 0 && safeHoveredSeries !== null && seriesKey !== safeHoveredSeries ? ChartMarkState.MUTED : ChartMarkState.ACTIVE;
80
+ const categoryMuted = categoryIndex !== void 0 && effectiveIndex !== null && categoryIndex !== effectiveIndex;
81
+ if (seriesKey !== void 0 && safeHoveredSeries !== null && seriesKey !== safeHoveredSeries) return ChartMarkState.MUTED;
82
+ if (categoryMuted) return categoryMuteState;
83
+ return ChartMarkState.ACTIVE;
80
84
  }, [
81
85
  isLoading,
82
86
  effectiveIndex,
83
- safeHoveredSeries
87
+ safeHoveredSeries,
88
+ categoryMuteState
84
89
  ]);
85
90
  return useMemo(() => ({
86
91
  activeIndex: effectiveIndex,
87
- hasLocalHover: safeHovered !== null,
92
+ showTooltip,
88
93
  hoveredSeriesKey: safeHoveredSeries,
89
94
  getMarkState,
90
95
  onCategoryEnter,
@@ -93,7 +98,7 @@ function useChartInteraction({ categoryCount, seriesKeys, categoryKeys, disabled
93
98
  onSeriesLeave
94
99
  }), [
95
100
  effectiveIndex,
96
- safeHovered,
101
+ showTooltip,
97
102
  safeHoveredSeries,
98
103
  getMarkState,
99
104
  onCategoryEnter,
package/dist/styles.css CHANGED
@@ -24,27 +24,28 @@
24
24
  .c1hcga6s{position:relative;display:var(--c1hcga6s-0);-webkit-flex-direction:var(--c1hcga6s-1);-ms-flex-direction:var(--c1hcga6s-1);flex-direction:var(--c1hcga6s-1);-webkit-align-items:var(--c1hcga6s-2);-webkit-box-align:var(--c1hcga6s-2);-ms-flex-align:var(--c1hcga6s-2);align-items:var(--c1hcga6s-2);-webkit-box-pack:var(--c1hcga6s-3);-ms-flex-pack:var(--c1hcga6s-3);-webkit-justify-content:var(--c1hcga6s-3);justify-content:var(--c1hcga6s-3);width:var(--c1hcga6s-4);min-width:0;height:var(--c1hcga6s-5);min-height:0;}
25
25
  .c1fvbgkp{position:relative;width:var(--c1fvbgkp-0);min-width:0;aspect-ratio:var(--c1fvbgkp-1);height:var(--c1fvbgkp-2);-webkit-flex:var(--c1fvbgkp-3);-ms-flex:var(--c1fvbgkp-3);flex:var(--c1fvbgkp-3);min-height:var(--c1fvbgkp-4);}
26
26
  .c10uj5yt{display:block;overflow:visible;}
27
- .cyuty3o{opacity:1;}.cyuty3o[data-state="muted"]{opacity:0.1;}
28
- .c1ob2op2{fill:none;stroke-linecap:round;stroke-linejoin:round;pointer-events:none;opacity:1;}.c1ob2op2[data-state="muted"]{opacity:0.1;}
29
- .c8c506o{stroke:none;pointer-events:none;opacity:1;}.c8c506o[data-state="muted"]{opacity:0.1;}
30
- .ceqlpek{pointer-events:none;opacity:1;}.ceqlpek[data-state="muted"]{opacity:0.1;}
31
- .c1fcbddl{opacity:1;}.c1fcbddl[data-state="muted"]{opacity:0.1;}
27
+ .cyuty3o{opacity:1;}.cyuty3o[data-state="muted"]{opacity:0.1;}.cyuty3o[data-state="dimmed"]{opacity:0.4;}
28
+ .c1ob2op2{fill:none;stroke-linecap:round;stroke-linejoin:round;pointer-events:none;opacity:1;}.c1ob2op2[data-state="muted"]{opacity:0.1;}.c1ob2op2[data-state="dimmed"]{opacity:0.4;}
29
+ .c8c506o{stroke:none;pointer-events:none;opacity:1;}.c8c506o[data-state="muted"]{opacity:0.1;}.c8c506o[data-state="dimmed"]{opacity:0.4;}
30
+ .ceqlpek{pointer-events:none;opacity:1;}.ceqlpek[data-state="muted"]{opacity:0.1;}.ceqlpek[data-state="dimmed"]{opacity:0.4;}
31
+ .c1fcbddl{opacity:1;}.c1fcbddl[data-state="muted"]{opacity:0.1;}.c1fcbddl[data-state="dimmed"]{opacity:0.4;}
32
32
  .cpcxr59{fill:transparent;outline:none;}
33
33
  .c1wvzvu4{fill:transparent;outline:none;}
34
34
  .c17guewt{stroke:var(--c17guewt-0);shape-rendering:crispEdges;}
35
35
  .cblgiyf{stroke:var(--cblgiyf-0);pointer-events:none;}
36
- .c1lr03cc{overflow:visible;pointer-events:none;}
37
- .cizy1s8{position:absolute;z-index:10;pointer-events:none;left:var(--cizy1s8-0);top:var(--cizy1s8-1);min-width:168px;max-width:320px;padding:10px 12px;border:0.5px solid var(--cizy1s8-2);border-radius:6px;background-color:var(--cizy1s8-3);opacity:var(--cizy1s8-4);-webkit-transition:opacity 100ms ease-in-out,left 100ms ease-out,top 100ms ease-out;transition:opacity 100ms ease-in-out,left 100ms ease-out,top 100ms ease-out;}@media (prefers-reduced-motion: reduce){.cizy1s8{-webkit-transition:none;transition:none;}}
38
- .c1ukq11d{display:-ms-grid;display:grid;-ms-grid-columns:minmax(0, 1fr) auto;grid-template-columns:minmax(0, 1fr) auto;-webkit-column-gap:16px;column-gap:16px;row-gap:6px;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;width:100%;}
39
- .cwcko2m{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;gap:6px;min-width:0;}
40
- .cqwhvyz{text-align:right;white-space:nowrap;}
41
- .c1iaray{position:absolute;left:var(--c1iaray-0);top:var(--c1iaray-1);width:var(--c1iaray-2);height:var(--c1iaray-2);-webkit-transform:translate(-50%, -50%);-moz-transform:translate(-50%, -50%);-ms-transform:translate(-50%, -50%);transform:translate(-50%, -50%);pointer-events:none;text-align:center;}
42
- .cz6jod1{position:absolute;top:38%;left:50%;-webkit-transform:translate(-50%, -50%);-moz-transform:translate(-50%, -50%);-ms-transform:translate(-50%, -50%);transform:translate(-50%, -50%);max-width:60%;padding:6px 8px;border:0.5px solid var(--cz6jod1-0);border-radius:6px;background-color:var(--cz6jod1-1);pointer-events:none;text-align:center;}
43
- .c1de5mqk{position:relative;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-direction:var(--c1de5mqk-0);-ms-flex-direction:var(--c1de5mqk-0);flex-direction:var(--c1de5mqk-0);-webkit-box-flex-wrap:nowrap;-webkit-flex-wrap:nowrap;-ms-flex-wrap:nowrap;flex-wrap:nowrap;-webkit-align-items:var(--c1de5mqk-1);-webkit-box-align:var(--c1de5mqk-1);-ms-flex-align:var(--c1de5mqk-1);align-items:var(--c1de5mqk-1);-webkit-box-pack:var(--c1de5mqk-2);-ms-flex-pack:var(--c1de5mqk-2);-webkit-justify-content:var(--c1de5mqk-2);justify-content:var(--c1de5mqk-2);gap:var(--c1de5mqk-3);width:var(--c1de5mqk-4);min-width:var(--c1de5mqk-5);height:var(--c1de5mqk-6);-webkit-flex-shrink:0;-ms-flex-negative:0;flex-shrink:0;padding-top:var(--c1de5mqk-7);padding-left:var(--c1de5mqk-8);}
44
- .cjirv6a{position:absolute;visibility:hidden;pointer-events:none;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-direction:var(--cjirv6a-0);-ms-flex-direction:var(--cjirv6a-0);flex-direction:var(--cjirv6a-0);-webkit-box-flex-wrap:nowrap;-webkit-flex-wrap:nowrap;-ms-flex-wrap:nowrap;flex-wrap:nowrap;-webkit-align-items:var(--cjirv6a-1);-webkit-box-align:var(--cjirv6a-1);-ms-flex-align:var(--cjirv6a-1);align-items:var(--cjirv6a-1);gap:var(--cjirv6a-2);width:-webkit-max-content;width:-moz-max-content;width:max-content;height:-webkit-max-content;height:-moz-max-content;height:max-content;white-space:nowrap;}
45
- .c1armna5{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;-webkit-align-items:flex-start;-webkit-box-align:flex-start;-ms-flex-align:flex-start;align-items:flex-start;gap:8px;max-height:208px;overflow-y:auto;}
46
- .cgd77rv{display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;gap:6px;-webkit-appearance:none;-moz-appearance:none;-ms-appearance:none;appearance:none;background:none;border:0;padding:0;margin:0;font:inherit;color:inherit;cursor:default;border-radius:2px;opacity:1;}.cgd77rv[data-state="muted"]{opacity:0.1;}.cgd77rv:focus-visible{outline:1.5px solid currentColor;outline-offset:2px;}
47
- .cutidpi{display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;gap:6px;opacity:1;}.cutidpi[data-state="muted"]{opacity:0.1;}
36
+ .c1lr03cc{fill:var(--c1lr03cc-0);pointer-events:none;}
37
+ .cizy1s8{overflow:visible;pointer-events:none;}
38
+ .c1ukq11d{position:absolute;z-index:10;pointer-events:none;left:var(--c1ukq11d-0);top:var(--c1ukq11d-1);min-width:168px;max-width:320px;padding:10px 12px;border:0.5px solid var(--c1ukq11d-2);border-radius:6px;background-color:var(--c1ukq11d-3);opacity:var(--c1ukq11d-4);-webkit-transition:opacity 100ms ease-in-out,left 100ms ease-out,top 100ms ease-out;transition:opacity 100ms ease-in-out,left 100ms ease-out,top 100ms ease-out;}@media (prefers-reduced-motion: reduce){.c1ukq11d{-webkit-transition:none;transition:none;}}
39
+ .cwcko2m{display:-ms-grid;display:grid;-ms-grid-columns:minmax(0, 1fr) auto;grid-template-columns:minmax(0, 1fr) auto;-webkit-column-gap:16px;column-gap:16px;row-gap:6px;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;width:100%;}
40
+ .cqwhvyz{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;gap:6px;min-width:0;}
41
+ .c1iaray{text-align:right;white-space:nowrap;}
42
+ .cz6jod1{position:absolute;left:var(--cz6jod1-0);top:var(--cz6jod1-1);width:var(--cz6jod1-2);height:var(--cz6jod1-2);-webkit-transform:translate(-50%, -50%);-moz-transform:translate(-50%, -50%);-ms-transform:translate(-50%, -50%);transform:translate(-50%, -50%);pointer-events:none;text-align:center;}
43
+ .c1de5mqk{position:absolute;top:38%;left:50%;-webkit-transform:translate(-50%, -50%);-moz-transform:translate(-50%, -50%);-ms-transform:translate(-50%, -50%);transform:translate(-50%, -50%);max-width:60%;padding:6px 8px;border:0.5px solid var(--c1de5mqk-0);border-radius:6px;background-color:var(--c1de5mqk-1);pointer-events:none;text-align:center;}
44
+ .cjirv6a{position:relative;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-direction:var(--cjirv6a-0);-ms-flex-direction:var(--cjirv6a-0);flex-direction:var(--cjirv6a-0);-webkit-box-flex-wrap:nowrap;-webkit-flex-wrap:nowrap;-ms-flex-wrap:nowrap;flex-wrap:nowrap;-webkit-align-items:var(--cjirv6a-1);-webkit-box-align:var(--cjirv6a-1);-ms-flex-align:var(--cjirv6a-1);align-items:var(--cjirv6a-1);-webkit-box-pack:var(--cjirv6a-2);-ms-flex-pack:var(--cjirv6a-2);-webkit-justify-content:var(--cjirv6a-2);justify-content:var(--cjirv6a-2);width:var(--cjirv6a-3);min-width:var(--cjirv6a-4);height:var(--cjirv6a-5);-webkit-flex-shrink:0;-ms-flex-negative:0;flex-shrink:0;padding-top:var(--cjirv6a-6);padding-left:var(--cjirv6a-7);}
45
+ .c1armna5{position:absolute;visibility:hidden;pointer-events:none;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-direction:var(--c1armna5-0);-ms-flex-direction:var(--c1armna5-0);flex-direction:var(--c1armna5-0);-webkit-box-flex-wrap:nowrap;-webkit-flex-wrap:nowrap;-ms-flex-wrap:nowrap;flex-wrap:nowrap;-webkit-align-items:var(--c1armna5-1);-webkit-box-align:var(--c1armna5-1);-ms-flex-align:var(--c1armna5-1);align-items:var(--c1armna5-1);width:-webkit-max-content;width:-moz-max-content;width:max-content;height:-webkit-max-content;height:-moz-max-content;height:max-content;white-space:nowrap;}
46
+ .cgd77rv{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;-webkit-align-items:flex-start;-webkit-box-align:flex-start;-ms-flex-align:flex-start;align-items:flex-start;max-height:208px;overflow-y:auto;}
47
+ .cutidpi{display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;gap:6px;-webkit-appearance:none;-moz-appearance:none;-ms-appearance:none;appearance:none;background:none;border:0;padding:var(--cutidpi-0);margin:0;font:inherit;color:inherit;cursor:default;border-radius:2px;opacity:1;}.cutidpi[data-state="muted"]{opacity:0.1;}.cutidpi[data-state="dimmed"]{opacity:0.4;}.cutidpi:focus-visible{outline:1.5px solid currentColor;outline-offset:2px;}
48
+ .ccpczg{display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;gap:6px;padding:var(--ccpczg-0);opacity:1;}.ccpczg[data-state="muted"]{opacity:0.1;}.ccpczg[data-state="dimmed"]{opacity:0.4;}
48
49
  .cmbdg2q{width:var(--cmbdg2q-0);height:var(--cmbdg2q-0);border-radius:50%;background-color:var(--cmbdg2q-1);}
49
50
  .tbnx4ok{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;}
50
51
  .tjda4tq{display:inline-block;width:-webkit-fit-content;width:-moz-fit-content;width:fit-content;max-width:-webkit-max-content;max-width:-moz-max-content;max-width:max-content;padding:var(--tjda4tq-0);background-color:var(--tjda4tq-1);border:var(--tjda4tq-2);border-radius:5px;}
@@ -141,7 +142,7 @@
141
142
  .c1yt5ynl{width:6px;height:6px;border-radius:50%;-webkit-flex-shrink:0;-ms-flex-negative:0;flex-shrink:0;background-color:var(--c1yt5ynl-0);-webkit-animation:var(--c1yt5ynl-1);animation:var(--c1yt5ynl-1);}@-webkit-keyframes enrichPulse-c1yt5ynl{0%,100%{opacity:1;}50%{opacity:0.3;}}@keyframes enrichPulse-c1yt5ynl{0%,100%{opacity:1;}50%{opacity:0.3;}}@media (prefers-reduced-motion: reduce){.c1yt5ynl{-webkit-animation:none;animation:none;}}
142
143
  .c1kvxq2r{position:absolute;inset:0;z-index:10;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;box-sizing:border-box;background-color:var(--c1kvxq2r-0);border:1.5px solid var(--c1kvxq2r-1);border-radius:4px;}
143
144
  .cz6gl36{width:100%;height:12px;border-radius:4px;background-color:var(--cz6gl36-0);-webkit-animation:spreadsheetSkeletonPulse-cz6gl36 1.4s ease-in-out infinite;animation:spreadsheetSkeletonPulse-cz6gl36 1.4s ease-in-out infinite;}@-webkit-keyframes spreadsheetSkeletonPulse-cz6gl36{0%,100%{opacity:1;}50%{opacity:0.4;}}@keyframes spreadsheetSkeletonPulse-cz6gl36{0%,100%{opacity:1;}50%{opacity:0.4;}}@media (prefers-reduced-motion: reduce){.cz6gl36{-webkit-animation:none;animation:none;}}
144
- .tldpbjd{width:var(--tldpbjd-0);height:var(--tldpbjd-1);position:relative;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;border-radius:5px;overflow:hidden;}
145
+ .tldpbjd{width:var(--tldpbjd-0);height:var(--tldpbjd-1);min-height:var(--tldpbjd-2);max-height:var(--tldpbjd-3);position:relative;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;border-radius:5px;overflow:hidden;}
145
146
  .t1ltwowk{-webkit-flex:1;-ms-flex:1;flex:1;overflow:auto;position:relative;min-height:0;overflow-anchor:none;overscroll-behavior-x:none;-webkit-overflow-scrolling:touch;padding-bottom:var(--t1ltwowk-0);}
146
147
  .sfoers7{width:100%;min-width:var(--sfoers7-0);border-collapse:separate;border-spacing:0;table-layout:fixed;}
147
148
  .tmoy46{display:table-header-group;position:-webkit-sticky;position:sticky;top:0px;z-index:20;}
@@ -27,7 +27,7 @@ import { flexRender, getCoreRowModel, getExpandedRowModel, getSortedRowModel, us
27
27
  * `VirtualizedInfiniteTable`, which shares the same column and row API.
28
28
  */
29
29
  function InfiniteTable(props) {
30
- const { columns, data, getRowId, height, width, fillWidth, fillHeight, density = TableDensity.MEDIUM, variant = TableVariant.PRIMARY, hasNextPage, isFetchingNextPage, fetchNextPage, enableRowSelection, enableMultiRowSelection = true, rowSelection, defaultRowSelection, onRowSelectionChange, onSelectedRowsChange, showSelectionColumn = false, selectionColumnPin = ColumnPin.LEFT, enableSelectAll, enableSelectionRange = true, selectAllAriaLabel = "Select all rows", getRowSelectAriaLabel, enableSorting = false, enableMultiSort = false, sorting, onSortingChange, manualSorting = false, isLoading = false, isError = false, error, loadingRowCount = 5, contentWhenEmpty, contentWhenError, noHeader = false, noLastRowBorder = false, noLastRowPadding = false, onRowClick, onRowDoubleClick, onRowActivate, onRowExpand, expandedRowIds, defaultExpandedRowIds, onExpandedChange, getRowCanExpand, enableMultiRowExpansion = true, showExpandColumn = true, expandColumnPin = ColumnPin.LEFT, enableColumnResizing = false, columnSizing, defaultColumnSizing, onColumnSizingChange, columnResizeMode = ColumnResizeMode.ON_CHANGE, ariaLabel, ariaLabelledBy, getRowAriaLabel, enableRowFocus, onTableReady } = props;
30
+ const { columns, data, getRowId, height, minHeight, maxHeight, width, fillWidth, fillHeight, density = TableDensity.MEDIUM, variant = TableVariant.PRIMARY, hasNextPage, isFetchingNextPage, fetchNextPage, enableRowSelection, enableMultiRowSelection = true, rowSelection, defaultRowSelection, onRowSelectionChange, onSelectedRowsChange, showSelectionColumn = false, selectionColumnPin = ColumnPin.LEFT, enableSelectAll, enableSelectionRange = true, selectAllAriaLabel = "Select all rows", getRowSelectAriaLabel, enableSorting = false, enableMultiSort = false, sorting, onSortingChange, manualSorting = false, isLoading = false, isError = false, error, loadingRowCount = 5, contentWhenEmpty, contentWhenError, noHeader = false, noLastRowBorder = false, noLastRowPadding = false, onRowClick, onRowDoubleClick, onRowActivate, onRowExpand, expandedRowIds, defaultExpandedRowIds, onExpandedChange, getRowCanExpand, enableMultiRowExpansion = true, showExpandColumn = true, expandColumnPin = ColumnPin.LEFT, enableColumnResizing = false, columnSizing, defaultColumnSizing, onColumnSizingChange, columnResizeMode = ColumnResizeMode.ON_CHANGE, ariaLabel, ariaLabelledBy, getRowAriaLabel, enableRowFocus, onTableReady } = props;
31
31
  const instanceId = useId();
32
32
  const scrollContainerRef = useRef(null);
33
33
  const headerRef = useRef(null);
@@ -292,6 +292,8 @@ function InfiniteTable(props) {
292
292
  return /* @__PURE__ */ jsx(TableOuterContainer, {
293
293
  $width: width,
294
294
  $height: height,
295
+ $minHeight: minHeight,
296
+ $maxHeight: maxHeight,
295
297
  $fillWidth: fillWidth,
296
298
  $fillHeight: fillHeight,
297
299
  children: /* @__PURE__ */ jsxs(TableScrollContainer, {
@@ -12,17 +12,21 @@ import { ColumnAlign, ColumnPin, TableDensity, TableVariant } from "./types";
12
12
  export declare const TableOuterContainer: import("react").ComponentType<Pick<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & {
13
13
  $width?: number | string;
14
14
  $height?: number | string;
15
+ $minHeight?: number | string;
16
+ $maxHeight?: number | string;
15
17
  $fillWidth?: boolean;
16
18
  $fillHeight?: boolean;
17
19
  } & {
18
20
  theme: import("../theme").Theme;
19
21
  } & {
20
22
  as?: React.ElementType;
21
- }, "$width" | "$height" | "$fillWidth" | "$fillHeight" | "as" | keyof import("react").ClassAttributes<HTMLDivElement> | keyof import("react").HTMLAttributes<HTMLDivElement>> & {
23
+ }, "$width" | "$height" | "$fillWidth" | "$fillHeight" | "$minHeight" | "$maxHeight" | "as" | keyof import("react").ClassAttributes<HTMLDivElement> | keyof import("react").HTMLAttributes<HTMLDivElement>> & {
22
24
  theme?: import("@callstack/react-theme-provider").$DeepPartial<import("../theme").Theme> | undefined;
23
25
  }> & import("@callstack/react-theme-provider/typings/hoist-non-react-statics").NonReactStatics<import("react").ComponentType<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & {
24
26
  $width?: number | string;
25
27
  $height?: number | string;
28
+ $minHeight?: number | string;
29
+ $maxHeight?: number | string;
26
30
  $fillWidth?: boolean;
27
31
  $fillHeight?: boolean;
28
32
  } & {
@@ -34,6 +38,8 @@ export declare const TableOuterContainer: import("react").ComponentType<Pick<imp
34
38
  } & import("react").FunctionComponent<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & {
35
39
  $width?: number | string;
36
40
  $height?: number | string;
41
+ $minHeight?: number | string;
42
+ $maxHeight?: number | string;
37
43
  $fillWidth?: boolean;
38
44
  $fillHeight?: boolean;
39
45
  } & {