@wallarm-org/design-system 4.19.1-rc-fix-WDS-206.1 → 4.19.2
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.
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "4.19.
|
|
3
|
-
"generatedAt": "2026-11-
|
|
2
|
+
"version": "4.19.1",
|
|
3
|
+
"generatedAt": "2026-11-17T08:53:17.637Z",
|
|
4
4
|
"components": [
|
|
5
5
|
{
|
|
6
6
|
"name": "Accordion",
|
|
@@ -36885,7 +36885,7 @@
|
|
|
36885
36885
|
},
|
|
36886
36886
|
{
|
|
36887
36887
|
"name": "LineChart",
|
|
36888
|
-
"markdown": "# LineChart\n\n## Overview\n\n`LineChart` is a composable time-series chart for `SimpleCharts` cards — request volume, error rate, latency, anything where the X axis reads left-to-right and the Y axis is a continuous number. The SVG is drawn by [`recharts`](https://recharts.org/); we own the visual tokens, the popover surfaces, the legend layout, the empty/loading frames, and the cross-component sync (hover ↔ legend ↔ lines ↔ tooltip ↔ zoom).\n\nThe root takes `data` and `series` as two flat arrays — `data` is one row per X position with denormalised series values, `series` is the schema. Axes, grid, lines, tooltip, legend, and zoom brush are all opt-in slots, so a 200×196 sparkline is the same component as a fully-instrumented dashboard panel — only the children differ.\n\nUse it whenever a chart needs the same card frame as `BarList` / `PieChart` but the data is a trend (or any ordered X axis). Pick `BarList` for top-N comparisons and `PieChart` for share-of-total.\n\nPer the anatomy, a chart may also carry a **metric + legend** row between the card header and the grid: the shared `Metric` bricks (`MetricHeader` + `MetricValue` + `MetricDelta`) on the left, the legend on the right, in one `justify-between` row. This is pure consumer composition (the `WithMetric` story) — no chart props involved; the card grows by the row's height.\n\n## API\n\nCompound component. There is no single \"render everything\" prop — callers pick the slots they need.\n\n### Compositional groups (at a glance)\n\nNineteen named components collapse into seven compositional groups. Each group is independent — pick the slots from the groups you need; ignore the rest.\n\n| Group | Members | Purpose |\n| ------------------ | ---------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------- |\n| **Root + body** | `LineChart`, `LineChartBody` | Provides the chart context + renders the recharts container. |\n| **Plot** | `LineChartGrid`, `LineChartXAxis`, `LineChartYAxis`, `LineChartLine` | Direct children of `<LineChartBody>` — the SVG geometry. |\n| **Range** | `LineChartRange` | Highlighted X range (spike, incident) with labels and in-range recolouring. |\n| **HoverPopover.*** | `LineChartTooltip`, `LineChartHoverPopover`, `LineChartHoverPopoverTimestamp`, `LineChartHoverPopoverRow`, `LineChartHoverPopoverDot` | Cursor-driven popover that reads `{ rows, xValue }` from the tooltip render-prop. |\n| **ZoomPopover.*** | `LineChartZoomBrush`, `LineChartZoomPopover`, `LineChartZoomPopoverRange`, `LineChartZoomPopoverConfirm` | Drag-to-zoom brush + the two-phase confirm popover. |\n| **Legend** | `LineChartLegend`, `LineChartLegendItem` | Accessible series legend; participates in hover sync. |\n| **Frame states** | `LineChartEmpty` | Static dashed-grid frame for empty-data and loading states. |\n\nThe flat-named exports stay the canonical form — the table above is just for quick discovery.\n\n### Root + body\n\n- `LineChart<T extends LineChartDatum = LineChartDatum>` — root. Owns `data`, `series`, `xKey`, the controlled series highlight (`activeKey`), the controlled filter (`filteredKeys`), the zoom event (`onZoomChange`), and cross-chart sync (`syncId`, `syncMethod`). **Generic over the datum shape**: pass a concrete `T` to turn `xKey` and `series[].key` into compile-time-checked `keyof T` unions (`<LineChart<RequestRow> data={rows} xKey='timestamp' />`). Leaving the default `LineChartDatum` keeps the loose untyped form. Provides five contexts to its children (data, active key, selection, zoom, range registry). The root renders a vertical-flex `<div data-slot='line-chart'>`; **legend placement is structural, not configured** — see the *Layout* section below.\n- `LineChartBody` — wraps recharts' `<ResponsiveContainer>` + `<LineChart>` and passes children through so they can self-register as recharts primitives. Default height is `LINE_CARD_HEIGHT - LINE_HEADER_HEIGHT` (164px) — override with `height`. `aria-hidden='true'` (the legend is the canonical accessible representation). Resizes re-render the plot at most every `LINE_RESIZE_DEBOUNCE_MS` (50ms, recharts' `debounce`); in between the body clips the previous width (`overflow-x-clip`) instead of letting it spill past the card.\n\n### Plot primitives (children of `LineChartBody`)\n\n- `LineChartLine` — one per series. Required `seriesKey` joins to `LineChartSeries.key`. Per-line `curve` (`'monotone'` default, `'linear'`), `disableAnimation`, `connectNulls`, `strokeWidth`, and `onClick`/`onMouseEnter`/`onMouseLeave`. Returns the bare recharts `<Line>` (no wrapper element) so recharts can hoist it into its layout.\n- `LineChartGrid` — wraps `<CartesianGrid>` with the dashed horizontal grid (`stroke='var(--color-border-primary-light)'`, `strokeDasharray='4 4'`). Drops the topmost grid line when it would visually crowd the chart's top edge (Figma \"no top x-line\") and unconditionally drops the bottommost line (the X-axis line owns the bottom rail). Escape hatches: `keepTopLine`, `keepBottomLine`. Opt into vertical grid via `vertical`.\n- `LineChartXAxis` — wraps `<XAxis>`. Reads `xKey` from context. Defaults: `tickLine={false}`, solid `axisLine` (the bottom rail of the plot), 10px sans secondary tick labels. First/last visible tick labels are anchored to their inside edges (`text-anchor: start` on the first, `end` on the last) so they cannot overflow the plot area; middle ticks stay center-anchored. Curated tick-spacing preset via `density: 'sparse' | 'normal' | 'dense'` (maps to `minTickGap` 64/32/16). Advanced escape-hatch props (`tickFormatter`, `interval`, `tickCount`, `ticks`, `minTickGap`, `domain`, `padding`, `type`) forward to recharts when no preset fits. `hideTicks` keeps the layout reservation but skips labels. `axisLine={false}` for sparkline-style plots — pair with `<LineChartGrid keepBottomLine />` so the bottom rail does not vanish.\n- `LineChartYAxis` — wraps `<YAxis>`. Default `width={LINE_Y_LABEL_WIDTH}` (38px, the Figma-mandated gutter). Defaults: `tickLine={false}`, `axisLine={false}`, the topmost tick label is skipped so no value sits flush against the chart's top edge. `interval={0}` disables recharts' built-in collision filter — combined with the top-tick skip, it gives a deterministic four-tick axis.\n- `LineChartTooltip` — wraps `<Tooltip>`. Renders the default `<LineChartHoverPopover>` body or accepts a render-prop child receiving `{ datum, rows, xValue }`. `rows` is the visible series pre-joined with each row's value at the active index — `rows.map(({ series, value }) => …)` is the canonical iteration pattern. Each row also carries `inRange: boolean` — `true` only when a `<LineChartRange>` whose `seriesKey` is that row's series contains the hovered datum; the default popover paints that row's dot `red`. **The popover Y is locked to the plot's vertical centre** (via recharts' `usePlotArea` + a `-translate-y-1/2` wrapper) so the popover does not jump between peaks and valleys; the dashed cursor guideline still tracks the cursor X. Cursor stroke matches Figma `7527-32438`: `var(--color-border-strong-primary)` (slate-500), 1px stroke, `4 2` dash pattern. `xTickFormatter` formats the default timestamp slot.\n- `LineChartRange` — highlights an X range inside `<LineChartBody>`. Props: `from: number | string` (required, an `xKey` value), `to?: number | string` (omitted = ongoing), `seriesKey?: string` (series recoloured inside the range), `startLabel?: string | number`, `endLabel?: string | number` (plain text — labels are SVG `<text>`; ongoing default `\"Ongoing\"`), `description?: string` (screen-reader text). Draws a `var(--color-states-danger-hover)` fill with 1px dashed (`3 3`) `var(--color-border-danger)` edges above the grid and under the lines, plus 10px medium `text-danger` labels 4px from the plot top: start label outside the left edge, end label outside the right edge (ongoing: inside, right-aligned to the plot edge). The `seriesKey` line switches to `var(--color-bg-fill-danger)` inside every range that names it — a danger copy of the line clipped to the range rectangles, so the switch lands on the exact edge pixel. Each mounted range registers in its own context on the root (`LineChartRangeContext`), so range changes never invalidate `LineChartDataContext`. Test IDs: `{root}--range`, `--range-start-label`, `--range-end-label`, and `--line-in-range` on the danger line copy.\n- `LineChartZoomBrush` — enables drag-to-zoom on the plot. Mount once anywhere inside `<LineChartBody>`. `disabled` removes the interaction; `formatRange(range)` overrides the popover range text; `confirmLabel` overrides the button copy; `container` overrides the portal target (defaults to `document.body` — pass a dialog node when the chart lives inside a focus-trapped modal). See the *Interactions* section for the full two-phase lifecycle.\n\n### Hover popover slots\n\nCompose these inside the `LineChartTooltip` render-prop, or use the default body.\n\n- `LineChartHoverPopover` — the popover surface. `role='tooltip'`, `aria-live='polite'`, `bg-bg-surface-2`, `rounded-12`, `shadow-md`, `min-w-160`.\n- `LineChartHoverPopoverTimestamp` — sans heading (`text-xs font-medium`, primary text). The top row of the default body.\n- `LineChartHoverPopoverRow` — `<dot> <label … value>` row. Required `series` (drives colour and label), optional `value`, optional `formatValue`, optional `color` (dot colour override, palette token or CSS colour; defaults to `series.color`). Default formatter `toLocaleString()` for numbers, `String()` otherwise, `—` for `null`/`undefined`. Pass `children` to fully override the inner layout.\n- `LineChartHoverPopoverDot` — 8×8 `rounded-2` colour swatch reused by the legend and the popover rows. `color` accepts a palette token (`'brand'`, `'red'`, …) **or** any CSS colour string (`'var(--color-violet-500)'`, `'#8b5cf6'`, `'oklch(…)'`). Consumer-supplied `style.backgroundColor` wins.\n\n### Zoom popover slots\n\n- `LineChartZoomPopover` — popover surface. `role='dialog'`, `aria-modal='false'` (non-modal — focus stays on the chart, the popover is a transient affordance).\n- `LineChartZoomPopoverRange` — text-xs primary range string. Default content comes from `lib/formatRange.ts` (e.g. `26 Dec 00:00 → 3 Jan 23:59`); override via `formatRange` on `<LineChartZoomBrush>`.\n- `LineChartZoomPopoverConfirm` — brand-tinted \"Zoom in\" button. `aria-keyshortcuts='Enter'` so screen readers announce the shortcut. Wires to the context's `confirmZoom`.\n\n### Legend\n\n- `LineChartLegend` — row container. `orientation: 'horizontal' | 'vertical'` (default `'horizontal'`) — the only knob the legend exposes. `align: 'start' | 'center' | 'end'`. **No `position` prop** — placement is JSX-structural.\n- `LineChartLegendItem` — row. Required `seriesKey` joins to a `LineChartSeries.key`. `selected` is explicit; when omitted it falls back to `!hiddenSet.has(seriesKey)`. Becomes interactive when `onClick` is passed (`role='button'`, `tabIndex=0`, Enter/Space dispatch). Hovering / focusing pushes `activeKey` into the context — this is what dims sibling lines.\n\n### Empty state\n\n- `LineChartEmpty` — Figma \"No data\" frame. Three dashed grid lines + one solid bottom axis. Pass `children` for the empty copy (e.g. `<LineChartEmpty>No data</LineChartEmpty>`); omit them to render only the grid frame (the idiom the `Loading` and `Refreshing` stories use). There is **no default copy**.\n\n### `LineChartDatum`\n\n```ts\ntype LineChartDatum = Record<string, number | string | null | undefined>;\n```\n\nOne row per X position. The X value lives under the `xKey` (required — no default); every other series reads from `datum[series.key]`. `null` / `undefined` values create a gap in the line (unless the line opts into `connectNulls`).\n\nPass a concrete interface to `LineChart<T>` to gain compile-time safety on `xKey` and `series[].key`. The generic defaults to the loose `LineChartDatum` form so existing call sites stay typed against `Record<string, …>`.\n\n```ts\ninterface RequestRow { timestamp: number; requests: number; errors: number }\n\n<LineChart<RequestRow> data={rows} xKey='timestamp' /> // ✅\n<LineChart<RequestRow> data={rows} xKey='timetamp' /> // ❌ Type error: 'timetamp' is not keyof RequestRow\n```\n\n### `LineChartSeries`\n\n```ts\ninterface LineChartSeries<K extends string = string> {\n key: K; // unique join key (keyof T when LineChart<T> is used)\n label: string; // visible label\n color?: ChartColor | (string & {}); // palette token or any CSS colour string\n variant?: 'solid' | 'dashed'; // default 'solid'\n}\n```\n\n`color` is shared between the line stroke and the legend/tooltip dot — pass one value, both surfaces stay in sync. Palette tokens (`'brand'`, `'red'`, …) resolve via `LINE_STROKE_FILL`; any other string passes through verbatim, so `'var(--color-violet-500)'`, `'#8b5cf6'`, and `'oklch(…)'` all work. `'slate'` is the implicit fallback when `color` is omitted.\n\n### `LineChartZoomRange`\n\n```ts\ninterface LineChartZoomRange {\n fromIndex: number; // inclusive index into `data`\n toIndex: number; // inclusive index into `data`\n from: number | string; // data[fromIndex][xKey]\n to: number | string; // data[toIndex][xKey]\n}\n```\n\nEmitted via `onZoomChange` exactly once per confirmed brush selection.\n\n## Data model\n\n- **`data`** (required, `LineChartDatum[]`) — single source of truth for both the lines and the tooltip rows. **The caller sorts ascending by `xKey`.** Recharts assumes an ordered domain; unsorted data draws the line backwards. A `console.warn` fires in development on the first inversion.\n- **`series`** (required, `LineChartSeries[]`) — the schema. `key` must be unique and must appear on at least one datum (a development warning fires for series whose key never resolves to a value). Series declared but never composed as a `<LineChartLine>` are valid — you can render legend rows without lines.\n- **`xKey`** (required, `Extract<keyof T, string>`) — the field on each datum used as the X axis. Required because no default matched any real call site (every story passes `'timestamp'`). When `LineChart<T>` is parameterised with a concrete datum type, `xKey` must be one of `T`'s keys; a typo is a compile error. X values must be `number` or `string` — pass `Date.getTime()` timestamps rather than `Date` instances. `Date` is intentionally not in the type union because recharts handles it inconsistently (sorting works, but `ReferenceArea` lookup in the zoom brush silently falls through).\n- **`activeKey`** / **`onActiveKeyChange`** (optional, `string | null`) — controlled hover series. When omitted, the chart manages it internally with `useState`. Use the controlled mode to share the *series highlight* across sibling charts (line dimming + legend hover). The root resolves `activeKey` against the current `seriesByKey` map — if the previously hovered series disappears (filter, refresh, or a controlled value pointing at a missing key), the highlight collapses to `null` instead of dimming every line. In **controlled** mode the chart calls `onActiveKeyChange(null)` from an effect so sibling charts stop highlighting a stale key — wire your external state accordingly so the snap-to-null write does not surprise you. In uncontrolled mode the internal state is left as-is and the next hover overwrites it.\n- **`syncId`** (optional, `string | number`) — pair two or more charts with the same `syncId` and recharts' built-in middleware syncs their *cursor X* (tooltip cursor + brush) — hovering one chart highlights the matching X on every sibling. This is independent of `activeKey`: `syncId` handles the tooltip cursor, `activeKey` handles the series highlight. Use both together for full cross-chart sync, or either one alone.\n- **`syncMethod`** (optional, `'index' | 'value' | (ticks, data) => number`) — how sibling `syncId` charts match X positions. Defaults to `'index'` (recharts' default — match by position in `data`). Use `'value'` when the synced charts have different dataset lengths but share categorical X values.\n- **`filteredKeys`** (optional, `string[]`) — keys to **hide** from the plot. The matching `<LineChartLine>` skips rendering, the tooltip row disappears, and the legend row paints at `opacity-40` with `data-selected='false'`. Stable references only — an inline array literal recreates on every parent render and invalidates the internal `Set` memo. The per-row `selected` prop still wins when set explicitly.\n- **`onZoomChange`** (optional, `(range: LineChartZoomRange | null) => void`) — fires when the user confirms a brush selection. The chart never persists the zoom window — `data` is always the truth. The consumer decides whether to narrow `data` upstream, push to a router, refetch, etc.\n\n`LineChart` does not sort, aggregate, or downsample. Callers prepare the data array.\n\n### Filter mental model (vs. `PieChart`)\n\n`PieChart` uses `selectedNames` (the keys to **highlight**; the rest dim). `LineChart` uses `filteredKeys` (the keys to **hide**). The divergence is intentional — the dominant interaction on the line chart is \"click a legend row to toggle the line off\", not \"click to emphasise one slice\". Consumers of both charts should not expect the two props to behave the same.\n\n## Layout\n\nThe chart is layout-agnostic. The root is a vertical flex container; **JSX child order picks placement**:\n\n```tsx\n// Legend on top:\n<LineChart …>\n <LineChartLegend>…</LineChartLegend>\n <LineChartBody>…</LineChartBody>\n</LineChart>\n\n// Legend on bottom:\n<LineChart …>\n <LineChartBody>…</LineChartBody>\n <LineChartLegend>…</LineChartLegend>\n</LineChart>\n\n// Legend on the side — wrap body+legend in any row flex container\n// (`<HStack>` from the design system is the canonical choice). Pair\n// with `<LineChartLegend orientation='vertical'>` for the legend's own\n// row→column layout.\n<LineChart …>\n <HStack flexGrow gap={12}>\n <LineChartLegend orientation='vertical'>…</LineChartLegend>\n <LineChartBody>…</LineChartBody>\n </HStack>\n</LineChart>\n```\n\nThere is no `position` prop on the legend or on the root. The legend's only knob is its own `orientation` (`'horizontal'` | `'vertical'`); placement is structural and lives in user-land. The `LegendPlacements` story demonstrates all four placements side by side.\n\n## States\n\n| State | Trigger | Behaviour |\n| --------------- | -------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- |\n| Default | — | Lines use `LINE_STROKE_FILL[color]` at full opacity. Mount animation: `400 ms ease-out`, honours `prefers-reduced-motion`. |\n| Hover (line) | Pointer over a `<LineChartLine>` path | No dimming — the plot stays at full opacity. The consumer's `onMouseEnter` / `onMouseLeave` still fire. The dashed cursor guideline and hover popover track the pointer via recharts' tooltip state. |\n| Hover (legend) | Pointer / focus over a `<LineChartLegendItem>` | `activeKey` snaps to that series; sibling lines fade to `LINE_INACTIVE_OPACITY` (0.3). The row paints `bg-states-primary-hover`. |\n| Hover (point) | Pointer over the plot body | Recharts' tooltip state snaps to the nearest X. The Y-locked popover renders one row per visible series at that index. The dashed vertical cursor guideline tracks the cursor X — this is the only on-plot hover affordance; no per-point dots render (`dot={false}` and `activeDot={false}`). Sibling charts that share a `syncId` mirror the highlight automatically. |\n| Focus | Keyboard focus on an interactive legend row | `bg-states-primary-hover` + `ring-focus-primary` inset ring (`focus-visible`). |\n| Filtered | `series.key` ∈ `filteredKeys` | `<LineChartLine>` does not render. Legend row paints at `opacity-40` with `aria-current` removed. |\n| Zoom-dragging | Pointer down → drag on the plot while `<LineChartZoomBrush>` is mounted | Borderless gray `<ReferenceArea>` (`fill: var(--color-states-primary-hover)`, no stroke) follows the cursor; a floating popover tracks the cursor with the live range text. Hover popover and dashed cursor guideline are suppressed — the zoom popover owns the cursor. |\n| Zoom-pending | Mouse release after a non-zero drag | Selection rectangle stays; popover becomes interactive with the \"Zoom in\" button. Hover popover stays suppressed until the pending state resolves. Click outside / Escape dismisses; Enter or button click confirms. |\n| Loading | Render `<LineChartEmpty>{null}</LineChartEmpty>` (or a `Skeleton` strip) | Dashed grid only — no labels, no line trace. Mirrors Figma `7519-2591`. The `Refreshing` story is the canonical pattern. |\n| Empty | `data.length === 0` | Compose `<LineChartEmpty>No data</LineChartEmpty>` in the body slot — the chart itself renders nothing without it. |\n| SinglePoint | `data.length === 1` | Nothing geometric renders — `dot={false}` + `activeDot={false}` mean no marker, and a one-point line has zero length. Hover still surfaces the value via the dashed cursor + popover. |\n| Range | `<LineChartRange from to>` (`Highlighted Range` story) | Danger fill + dashed edges, start/end labels outside the edges, `seriesKey` line red inside the range. |\n| Range hover | Pointer over a bucket inside the range (`Highlighted Range Hover`) | The `seriesKey` row's popover dot turns `red`; other rows unchanged. The bucket heading (`11:25 – 11:30`) comes from the consumer's `xTickFormatter`. |\n| Ongoing range | `to` omitted (`Ongoing Range`) | Range runs to the plot's right edge; end label defaults to `Ongoing`, drawn inside the range. |\n| Several ranges | 2+ visible `<LineChartRange>` (`Several Ranges`) | No labels at all. A range starting before the first datum clamps to the plot's left edge (its edge line still draws). |\n| Range + legend | `LineChartLegend` + `LineChartBody height={140}` (`Range With Legend`) | The usual-level series is an ordinary dashed series with a normal square-dot legend item. |\n| Gapped | `null` / `undefined` value on a datum for a given series | The line splits at the gap (recharts default `connectNulls={false}`). Set `<LineChartLine connectNulls>` to bridge. |\n\n## Interactions\n\n- **Hover sync (legend ↔ tooltip)** — pointer / focus on a `<LineChartLegendItem>` pushes `activeKey` into the active context; lines whose key does not match fade to 30% and the matching line gets `data-active='true'`. Hovering a line itself does **not** drive `activeKey` — the plot stays at full opacity so the cursor sweeping across multiple series does not flash sibling lines on and off. `<LineChartLegendItem>` uses `isHoverSyncTarget(event.relatedTarget)` in its `mouseLeave` / `blur` handlers to skip the `null`-clear when focus / pointer is moving directly between legend rows; without it React would render an intermediate `activeKey=null` frame on every crossing and the dimmed lines would flicker.\n- **Hover popover Y-lock** — `<LineChartTooltip>` reads recharts' inner plot rectangle via `usePlotArea()` and anchors the popover at `plotArea.y + plotArea.height / 2`. A wrapping `<div className='-translate-y-1/2'>` turns that coordinate into the popover's visual centre. `isAnimationActive={false}` is non-negotiable — without it recharts interpolates the popover Y between frames and defeats the lock. The first paint falls back to `HOVER_POPOVER_TOP` (8px) until recharts measures the plot.\n- **Click-to-filter** — caller-driven. Attach `onClick` to `<LineChartLegendItem>`; toggle the matching key in your own `filteredKeys` state. Enter/Space dispatch a click on the row.\n- **Cross-chart hover sync** — two layers compose:\n 1. **Cursor X (tooltip + brush)** — pass the same `syncId` to every chart that should mirror the cursor. Recharts' own redux middleware handles the wiring; no controlled state needed. `syncMethod='value'` lets datasets of different lengths sync by shared category instead of by position.\n 2. **Series highlight (line dimming + legend)** — wire each chart's `activeKey` / `onActiveKeyChange` to a shared `useState<string | null>`. The internal `lastActiveKeyRef` dedupe prevents the per-pixel mousemove flood from spamming the callback. See the `CrossChartHoverSync` story for the canonical recipe pairing both layers.\n- **Zoom (drag → pending → confirm)** — `<LineChartZoomBrush>` enables a crosshair drag on the plot. Two-phase:\n 1. **Drag** — `mousedown` on the plot starts a drag at the active tooltip index. A borderless gray `<ReferenceArea>` (`fill: var(--color-states-primary-hover)`, no stroke) follows the cursor; a portalled floating popover tracks the cursor position and renders the live range string. The hover popover and cursor guideline are hidden while dragging. Drag is followed at the *window* level so the popover keeps tracking when the cursor leaves the SVG and the release still commits even outside the chart. Escape mid-drag cancels outright (no pending popover).\n 2. **Pending** — `mouseup` after a non-zero drag locks the selection and turns the popover interactive (`pointer-events: auto`). Hover suppression continues — the chart reads as non-interactive until the user confirms or dismisses. The \"Zoom in\" button confirms — Enter does the same. Escape, click outside the popover, or starting a new drag dismisses without emitting. The popover stops a bubbling `mousedown` on its surface so clicking the confirm button does not start a fresh drag.\n 3. **Confirm** — fires `onZoomChange({ from, to, fromIndex, toIndex })` exactly once. The consumer narrows `data`; the brush state resets automatically.\n- **Zoom keyboard contract** — the keydown listener is gated to events whose target is inside the chart container, inside the popover, or ambient (focus on `<body>` / `<html>`). It does **not** hijack Enter for forms / dialogs / focused inputs elsewhere on the page.\n- **Single-index click (no zoom)** — clicking the plot without dragging produces a zero-width range and is dropped silently so users cannot accidentally surface a confirm popover on a plain click.\n- **Data refresh while zoom-pending** — the root resets `zoomDrag` and `zoomPending` whenever `data` or `xKey` changes. Emitting a stale range against a no-longer-current dataset would point at nothing meaningful.\n\n## Edge cases & unclear states\n\n- **Per-series hover and per-index hover are different things.** Pointing at a legend row sets the **series** active (dims sibling lines, keeps the popover off). Pointing at the plot body sets the **index** active (lights up the popover for every visible series at that X). They live in separate contexts on purpose so the lines don't re-render on every cursor frame. Hovering a line in the plot does **not** dim siblings — only the legend drives the series dim.\n- **The popover Y is locked, not the X.** The dashed cursor guideline still tracks the cursor's X; the popover surface stays put on Y so it does not jump between peaks and valleys. Disabling animation (`isAnimationActive={false}`) is required — without it recharts interpolates Y between frames.\n- **Filtering down to zero series.** The plot renders an empty frame (grid + axes still visible). Recommend swapping the body for `<LineChartEmpty>No data</LineChartEmpty>` when the consumer's filter UI produces this state.\n- **`null` / `undefined` datum values.** Recharts splits the line at the gap (default `connectNulls={false}`). The tooltip row formats `null` / `undefined` as `—`. Pass `<LineChartLine connectNulls>` to bridge.\n- **`NaN` values.** Recharts coerces `NaN` to `null` (gap behaviour). Pre-filter upstream if you need different handling.\n- **Single point (`data.length === 1`).** Recharts renders nothing geometric — `dot={false}` and `activeDot={false}` mean there is no marker, and a one-point line has zero length. Hover still works (the dashed cursor + popover surface the value). Consider falling back to a different chart type for single-point data.\n- **`xKey` typing.** The public union is `number | string` (no `Date`). Pass `Date.getTime()` timestamps and format with `tickFormatter`; the chart's own `<ReferenceArea>` lookups (zoom brush) rely on this contract — a stray `Date` instance breaks them silently.\n- **Mount animation.** `400 ms ease-out`, `begin=0`. `isAnimationActive='auto'` (the default) honours `prefers-reduced-motion`. Force off with `<LineChartLine disableAnimation />` — useful for E2E screenshot stability.\n- **`className` on a `LineChartLine`.** Recharts paints the line as `<path>` — only `stroke-*` Tailwind utilities take effect, **not** `bg-*` or `fill-*`. The same trap `PieChart` documents for slices applies here in mirror.\n- **Stale `activeKey` after a series disappears.** The root resolves `activeKey` against `seriesByKey`. In **controlled** mode the chart calls `onActiveKeyChange(null)` from an effect — make `onActiveKeyChange` stable so the reset lands in the same render cycle as the data change. In **uncontrolled** mode the internal state is left as-is; the next hover overwrites it. Either way the visible state never gets stuck at \"every line dimmed\".\n- **Stale tooltip cursor after `data` shrinks.** Recharts manages tooltip state internally and resets the cursor on every `data` update. There is no out-of-range slot to clamp — the chart simply re-renders the cursor against the new dataset on the next pointer event.\n- **Brush popover positioning.** The popover is `position: fixed` portalled to `document.body`. **X tracks the cursor** (`clientX` from the latest mousemove, offset right of the pointer); **Y is locked to the plot-area centre** via recharts' `usePlotArea()` + the recharts surface's viewport rect, then offset up by half its own height (`translateY(-50%)`) so the popover's vertical centre matches `<LineChartTooltip>`. Before recharts has measured the plot, Y falls back to the current pointer `clientY` for the one or two frames until `plotArea` lands. While the popover is open the chart subscribes to `window` `scroll` and `resize` (capture phase) and bumps a render tick, so the memoised viewport rect re-reads — without that subscription the portal's `position: fixed` would pin the popover to the original release point as the page scrolls and the chart would slide away beneath it. During **pending** the captured `clientX` is offset by the chart's horizontal scroll delta (the chart's viewport-`left` at release vs. now) so the popover stays anchored to the plot column, not the viewport.\n- **Two charts on one page, both with zoom.** The pending-zoom keydown handler is scoped to the owning chart via `LineChartZoomContext.rootRef`. Enter and Escape only commit / dismiss the chart whose root currently contains the event target (plus the portalled popover and the ambient body/html case). Sibling charts on the same page do not see each other's keystrokes.\n- **Long datasets.** The chart still works at 1000+ points (the `LongTimeRange` story stresses this) but recharts' tick generator and interpolation cost climb past ~5000 points. Downsample upstream.\n- **Edge tick text anchor uses the original `payload.coordinate`, not `props.x`/`props.y`.** Recharts pre-shifts the first/last tick's `tickCoord` inward so a *middle-anchored* label cannot overflow the plot. Our edge ticks override the anchor to `start` / `end`, so that shift would float the text edge ~10px off its tick (e.g. `23:00` landing visually near the `22:00` band). `renderAxisTick` re-anchors to `payload.coordinate` whenever the caller overrides the anchor, so the text's leading/trailing edge lands directly under the tick.\n- **`LineChartXAxis` defaults `interval` to `'preserveStartEnd'`.** Recharts' own default (`preserveEnd`) drops the first data tick whenever it collides with a neighbour, leaving the leftmost label visibly indented from the plot's left edge. We force both edges to render so `index === 0` and `index === visibleTicksCount - 1` are always the actual data edges — which is what the `renderTick` anchor override assumes when it pins the first label flush-left and the last flush-right.\n- **`LineChartEmpty` with no `children`.** Renders only the dashed grid frame — the idiom the `Loading` and `Refreshing` stories use, paired with a `<Skeleton>` strip in place of the legend rows. `null`/`undefined` children are both treated the same (no message overlay).\n- **Recharts requires axes / grid / lines / tooltip / brush to be direct children of `<RechartsLineChart>`.** Our wrappers (`LineChartXAxis`, `LineChartYAxis`, `LineChartGrid`, `LineChartLine`, `LineChartTooltip`, `LineChartZoomBrush`) all return bare recharts elements (or `null`); in recharts v3 each primitive self-registers via Redux dispatch, so mounting them anywhere inside the `<RechartsLineChart>` subtree wires up correctly.\n- **Inline event handlers on controlled mode.** Wrap `onActiveKeyChange` / `onZoomChange` in `useCallback` (or hoist them) — an inline arrow handler recreates every render and propagates through the data context, invalidating memoised legend rows. Not a correctness bug, but kills `React.memo` opportunities for custom row children.\n\n- **Range edge between two buckets.** The X axis is a category axis, so the scale knows only data X values. A numeric edge that falls between two data points is linearly interpolated between their pixels (11:52 sits 2/5 of the way from 11:50 to 11:55); a string X must match a datum exactly. A range that can never be drawn on the data (a string edge with no matching datum, an edge type that differs from the X type, numeric X that is not strictly ascending, `from` after `to`) logs a dev-mode `console.warn`, draws nothing and marks no popover row `inRange`. The line's colour switch uses the same pixel.\n- **Range clamping.** `from` at or before the first datum clamps to the plot's left edge (no start label); `to` omitted or at or after the last datum clamps to the right edge. A range fully outside the data is not drawn; unsorted or single-datum data draws no range.\n- **Overlapping ranges** are drawn as is (fills stack) and log a dev-mode `console.warn`.\n- **Range labels** are hidden when 2+ ranges are visible, when a label would leave the plot area, or when the two labels would collide. Widths are estimated from the character count.\n- **Range on a filtered series.** The fill and edges still draw; there is simply no line to recolour.\n\n## Accessibility notes\n\n- The chart body (`<LineChartBody>`) is `aria-hidden='true'` — the SVG is decorative. The legend is the canonical screen-reader representation.\n- Recharts' default keyboard a11y layer is disabled (`accessibilityLayer={false}`) — it puts `tabindex=0` + `role='application'` on the SVG and would conflict with `aria-hidden` on our wrapper. The legend rows are the accessible alternative.\n- Interactive `<LineChartLegendItem>` rows expose `role='button'`, `tabIndex=0`; Enter/Space dispatch a click. `aria-current='true'` when the row is selected. Focus ring uses `focus-visible` so keyboard users see the ring and pointer clicks don't.\n- The hover popover (`<LineChartHoverPopover>`) is `role='tooltip'` + `aria-live='polite'`. `<LineChartHoverPopoverDot>` is `aria-hidden` so screen readers don't pronounce the colour swatch.\n- The zoom popover (`<LineChartZoomPopover>`) is `role='dialog'`, `aria-modal='false'` (non-modal — focus stays on the chart). The confirm button advertises `aria-keyshortcuts='Enter'`.\n- Ranges: the root renders a visually hidden list (`sr-only` `<ul>`, test ID `{root}--range-descriptions`) with one `<li>` per mounted `<LineChartRange>` that has a `description` — including ranges outside the visible window, since the registry stores raw props only. Nothing renders when no range has one. The wording is the consumer's.\n- `<LineChartEmpty>` is a static frame — pass meaningful `children` (`'No data'`, `'Loading'`, etc.) for the screen-reader announcement.\n\n## Open questions / known limitations\n\n- **Stacked / area / scatter / step variants.** Out of scope for this PR — each is its own compound.\n- **Reference / threshold lines** (`<LineChartReferenceLine>`). Out of scope; will be added when a product use case lands.\n- **Multi-axis** (separate left + right Y). Out of scope.\n- **Built-in zoom-out / reset chip.** Out of scope — consumers render their own affordance in `<ChartActions>` and call `setRange(null)` (the `Zoom` story is the canonical pattern).\n- **Tooltip pinning** (\"click to keep open\"). Hover-only for v1.\n- **Cross-chart hover registry.** `syncId` (cursor X) + controlled `activeKey` (series highlight) cover the one-parent / multiple-charts case. A `ChartGroup` provider would live one level above this component to share an `activeKey` `useState` across an arbitrary number of charts.\n- **Internationalised range / tick formatting.** Caller supplies `tickFormatter` and `formatRange`. The chart does not call `Intl.DateTimeFormat` itself.\n- **Range line width.** Figma draws the series at 1.5px; we keep `LINE_STROKE_WIDTH` at 2 for consistency with every other chart.\n- **Range colours.** The in-range popover dot is palette `red` (red-500) while the in-range line is `var(--color-bg-fill-danger)` (red-600) — different by design, as in Figma."
|
|
36888
|
+
"markdown": "# LineChart\n\n## Overview\n\n`LineChart` is a composable time-series chart for `SimpleCharts` cards — request volume, error rate, latency, anything where the X axis reads left-to-right and the Y axis is a continuous number. The SVG is drawn by [`recharts`](https://recharts.org/); we own the visual tokens, the popover surfaces, the legend layout, the empty/loading frames, and the cross-component sync (hover ↔ legend ↔ lines ↔ tooltip ↔ zoom).\n\nThe root takes `data` and `series` as two flat arrays — `data` is one row per X position with denormalised series values, `series` is the schema. Axes, grid, lines, tooltip, legend, and zoom brush are all opt-in slots, so a 200×196 sparkline is the same component as a fully-instrumented dashboard panel — only the children differ.\n\nUse it whenever a chart needs the same card frame as `BarList` / `PieChart` but the data is a trend (or any ordered X axis). Pick `BarList` for top-N comparisons and `PieChart` for share-of-total.\n\nPer the anatomy, a chart may also carry a **metric + legend** row between the card header and the grid: the shared `Metric` bricks (`MetricHeader` + `MetricValue` + `MetricDelta`) on the left, the legend on the right, in one `justify-between` row. This is pure consumer composition (the `WithMetric` story) — no chart props involved; the card grows by the row's height.\n\n## API\n\nCompound component. There is no single \"render everything\" prop — callers pick the slots they need.\n\n### Compositional groups (at a glance)\n\nNineteen named components collapse into seven compositional groups. Each group is independent — pick the slots from the groups you need; ignore the rest.\n\n| Group | Members | Purpose |\n| ------------------ | ---------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------- |\n| **Root + body** | `LineChart`, `LineChartBody` | Provides the chart context + renders the recharts container. |\n| **Plot** | `LineChartGrid`, `LineChartXAxis`, `LineChartYAxis`, `LineChartLine` | Direct children of `<LineChartBody>` — the SVG geometry. |\n| **Range** | `LineChartRange` | Highlighted X range (spike, incident) with labels and in-range recolouring. |\n| **HoverPopover.*** | `LineChartTooltip`, `LineChartHoverPopover`, `LineChartHoverPopoverTimestamp`, `LineChartHoverPopoverRow`, `LineChartHoverPopoverDot` | Cursor-driven popover that reads `{ rows, xValue }` from the tooltip render-prop. |\n| **ZoomPopover.*** | `LineChartZoomBrush`, `LineChartZoomPopover`, `LineChartZoomPopoverRange`, `LineChartZoomPopoverConfirm` | Drag-to-zoom brush + the two-phase confirm popover. |\n| **Legend** | `LineChartLegend`, `LineChartLegendItem` | Accessible series legend; participates in hover sync. |\n| **Frame states** | `LineChartEmpty` | Static dashed-grid frame for empty-data and loading states. |\n\nThe flat-named exports stay the canonical form — the table above is just for quick discovery.\n\n### Root + body\n\n- `LineChart<T extends LineChartDatum = LineChartDatum>` — root. Owns `data`, `series`, `xKey`, the controlled series highlight (`activeKey`), the controlled filter (`filteredKeys`), the zoom event (`onZoomChange`), and cross-chart sync (`syncId`, `syncMethod`). **Generic over the datum shape**: pass a concrete `T` to turn `xKey` and `series[].key` into compile-time-checked `keyof T` unions (`<LineChart<RequestRow> data={rows} xKey='timestamp' />`). Leaving the default `LineChartDatum` keeps the loose untyped form. Provides five contexts to its children (data, active key, selection, zoom, range registry). The root renders a vertical-flex `<div data-slot='line-chart'>`; **legend placement is structural, not configured** — see the *Layout* section below.\n- `LineChartBody` — wraps recharts' `<ResponsiveContainer>` + `<LineChart>` and passes children through so they can self-register as recharts primitives. Default height is `LINE_CARD_HEIGHT - LINE_HEADER_HEIGHT` (164px) — override with `height`. `aria-hidden='true'` (the legend is the canonical accessible representation). Resizes re-render the plot at most every `LINE_RESIZE_DEBOUNCE_MS` (50ms, recharts' `debounce`); in between the body clips the previous width (`overflow-x-clip`) instead of letting it spill past the card.\n\n### Plot primitives (children of `LineChartBody`)\n\n- `LineChartLine` — one per series. Required `seriesKey` joins to `LineChartSeries.key`. Per-line `curve` (`'monotone'` default, `'linear'`), `disableAnimation`, `connectNulls`, `strokeWidth`, and `onClick`/`onMouseEnter`/`onMouseLeave`. Returns the bare recharts `<Line>` (no wrapper element) so recharts can hoist it into its layout.\n- `LineChartGrid` — wraps `<CartesianGrid>` with the dashed horizontal grid (`stroke='var(--color-border-primary-light)'`, `strokeDasharray='4 4'`). Drops the topmost grid line when it would visually crowd the chart's top edge (Figma \"no top x-line\") and unconditionally drops the bottommost line (the X-axis line owns the bottom rail). Escape hatches: `keepTopLine`, `keepBottomLine`. Opt into vertical grid via `vertical`.\n- `LineChartXAxis` — wraps `<XAxis>`. Reads `xKey` from context. Defaults: `tickLine={false}`, solid `axisLine` (the bottom rail of the plot), 10px sans secondary tick labels. First/last visible tick labels are anchored to their inside edges (`text-anchor: start` on the first, `end` on the last) so they cannot overflow the plot area; middle ticks stay center-anchored. Curated tick-spacing preset via `density: 'sparse' | 'normal' | 'dense'` (maps to `minTickGap` 64/32/16). Advanced escape-hatch props (`tickFormatter`, `interval`, `tickCount`, `ticks`, `minTickGap`, `domain`, `padding`, `type`) forward to recharts when no preset fits. `hideTicks` keeps the layout reservation but skips labels. `axisLine={false}` for sparkline-style plots — pair with `<LineChartGrid keepBottomLine />` so the bottom rail does not vanish.\n- `LineChartYAxis` — wraps `<YAxis>`. Default `width={LINE_Y_LABEL_WIDTH}` (38px, the Figma-mandated gutter). Defaults: `tickLine={false}`, `axisLine={false}`, the topmost tick label is skipped so no value sits flush against the chart's top edge. `interval={0}` disables recharts' built-in collision filter — combined with the top-tick skip, it gives a deterministic four-tick axis.\n- `LineChartTooltip` — wraps `<Tooltip>`. Renders the default `<LineChartHoverPopover>` body or accepts a render-prop child receiving `{ datum, rows, xValue }`. `rows` is the visible series pre-joined with each row's value at the active index — `rows.map(({ series, value }) => …)` is the canonical iteration pattern. Each row also carries `inRange: boolean` — `true` only when a `<LineChartRange>` whose `seriesKey` is that row's series contains the hovered datum; the default popover paints that row's dot `red`. **The popover Y is locked to the plot's vertical centre** (via recharts' `usePlotArea` + a `-translate-y-1/2` wrapper) so the popover does not jump between peaks and valleys; the dashed cursor guideline still tracks the cursor X. Cursor stroke matches Figma `7527-32438`: `var(--color-border-strong-primary)` (slate-500), 1px stroke, `4 2` dash pattern. `xTickFormatter` formats the default timestamp slot.\n- `LineChartRange` — highlights an X range inside `<LineChartBody>`. Props: `from: number | string` (required, an `xKey` value), `to?: number | string` (omitted = ongoing), `seriesKey?: string` (series recoloured inside the range), `startLabel?: string | number`, `endLabel?: string | number` (plain text — labels are SVG `<text>`; ongoing default `\"Ongoing\"`), `description?: string` (screen-reader text). Draws a `var(--color-states-danger-hover)` fill with 1px dashed (`3 3`) `var(--color-border-danger)` edges above the grid and under the lines, plus 10px regular `text-danger` labels 4px from the plot top: start label outside the left edge, end label outside the right edge (ongoing: inside, right-aligned to the plot edge). The `seriesKey` line switches to `var(--color-bg-fill-danger)` inside every range that names it — a danger copy of the line clipped to the range rectangles, so the switch lands on the exact edge pixel. Each mounted range registers in its own context on the root (`LineChartRangeContext`), so range changes never invalidate `LineChartDataContext`. Test IDs: `{root}--range`, `--range-start-label`, `--range-end-label`, and `--line-in-range` on the danger line copy.\n- `LineChartZoomBrush` — enables drag-to-zoom on the plot. Mount once anywhere inside `<LineChartBody>`. `disabled` removes the interaction; `formatRange(range)` overrides the popover range text; `confirmLabel` overrides the button copy; `container` overrides the portal target (defaults to `document.body` — pass a dialog node when the chart lives inside a focus-trapped modal). See the *Interactions* section for the full two-phase lifecycle.\n\n### Hover popover slots\n\nCompose these inside the `LineChartTooltip` render-prop, or use the default body.\n\n- `LineChartHoverPopover` — the popover surface. `role='tooltip'`, `aria-live='polite'`, `bg-bg-surface-2`, `rounded-12`, `shadow-md`, `min-w-160`.\n- `LineChartHoverPopoverTimestamp` — sans heading (`text-xs font-medium`, primary text). The top row of the default body.\n- `LineChartHoverPopoverRow` — `<dot> <label … value>` row. Required `series` (drives colour and label), optional `value`, optional `formatValue`, optional `color` (dot colour override, palette token or CSS colour; defaults to `series.color`). Default formatter `toLocaleString()` for numbers, `String()` otherwise, `—` for `null`/`undefined`. Pass `children` to fully override the inner layout.\n- `LineChartHoverPopoverDot` — 8×8 `rounded-2` colour swatch reused by the legend and the popover rows. `color` accepts a palette token (`'brand'`, `'red'`, …) **or** any CSS colour string (`'var(--color-violet-500)'`, `'#8b5cf6'`, `'oklch(…)'`). Consumer-supplied `style.backgroundColor` wins.\n\n### Zoom popover slots\n\n- `LineChartZoomPopover` — popover surface. `role='dialog'`, `aria-modal='false'` (non-modal — focus stays on the chart, the popover is a transient affordance).\n- `LineChartZoomPopoverRange` — text-xs primary range string. Default content comes from `lib/formatRange.ts` (e.g. `26 Dec 00:00 → 3 Jan 23:59`); override via `formatRange` on `<LineChartZoomBrush>`.\n- `LineChartZoomPopoverConfirm` — brand-tinted \"Zoom in\" button. `aria-keyshortcuts='Enter'` so screen readers announce the shortcut. Wires to the context's `confirmZoom`.\n\n### Legend\n\n- `LineChartLegend` — row container. `orientation: 'horizontal' | 'vertical'` (default `'horizontal'`) — the only knob the legend exposes. `align: 'start' | 'center' | 'end'`. **No `position` prop** — placement is JSX-structural.\n- `LineChartLegendItem` — row. Required `seriesKey` joins to a `LineChartSeries.key`. `selected` is explicit; when omitted it falls back to `!hiddenSet.has(seriesKey)`. Becomes interactive when `onClick` is passed (`role='button'`, `tabIndex=0`, Enter/Space dispatch). Hovering / focusing pushes `activeKey` into the context — this is what dims sibling lines.\n\n### Empty state\n\n- `LineChartEmpty` — Figma \"No data\" frame. Three dashed grid lines + one solid bottom axis. Pass `children` for the empty copy (e.g. `<LineChartEmpty>No data</LineChartEmpty>`); omit them to render only the grid frame (the idiom the `Loading` and `Refreshing` stories use). There is **no default copy**.\n\n### `LineChartDatum`\n\n```ts\ntype LineChartDatum = Record<string, number | string | null | undefined>;\n```\n\nOne row per X position. The X value lives under the `xKey` (required — no default); every other series reads from `datum[series.key]`. `null` / `undefined` values create a gap in the line (unless the line opts into `connectNulls`).\n\nPass a concrete interface to `LineChart<T>` to gain compile-time safety on `xKey` and `series[].key`. The generic defaults to the loose `LineChartDatum` form so existing call sites stay typed against `Record<string, …>`.\n\n```ts\ninterface RequestRow { timestamp: number; requests: number; errors: number }\n\n<LineChart<RequestRow> data={rows} xKey='timestamp' /> // ✅\n<LineChart<RequestRow> data={rows} xKey='timetamp' /> // ❌ Type error: 'timetamp' is not keyof RequestRow\n```\n\n### `LineChartSeries`\n\n```ts\ninterface LineChartSeries<K extends string = string> {\n key: K; // unique join key (keyof T when LineChart<T> is used)\n label: string; // visible label\n color?: ChartColor | (string & {}); // palette token or any CSS colour string\n variant?: 'solid' | 'dashed'; // default 'solid'\n}\n```\n\n`color` is shared between the line stroke and the legend/tooltip dot — pass one value, both surfaces stay in sync. Palette tokens (`'brand'`, `'red'`, …) resolve via `LINE_STROKE_FILL`; any other string passes through verbatim, so `'var(--color-violet-500)'`, `'#8b5cf6'`, and `'oklch(…)'` all work. `'slate'` is the implicit fallback when `color` is omitted.\n\n### `LineChartZoomRange`\n\n```ts\ninterface LineChartZoomRange {\n fromIndex: number; // inclusive index into `data`\n toIndex: number; // inclusive index into `data`\n from: number | string; // data[fromIndex][xKey]\n to: number | string; // data[toIndex][xKey]\n}\n```\n\nEmitted via `onZoomChange` exactly once per confirmed brush selection.\n\n## Data model\n\n- **`data`** (required, `LineChartDatum[]`) — single source of truth for both the lines and the tooltip rows. **The caller sorts ascending by `xKey`.** Recharts assumes an ordered domain; unsorted data draws the line backwards. A `console.warn` fires in development on the first inversion.\n- **`series`** (required, `LineChartSeries[]`) — the schema. `key` must be unique and must appear on at least one datum (a development warning fires for series whose key never resolves to a value). Series declared but never composed as a `<LineChartLine>` are valid — you can render legend rows without lines.\n- **`xKey`** (required, `Extract<keyof T, string>`) — the field on each datum used as the X axis. Required because no default matched any real call site (every story passes `'timestamp'`). When `LineChart<T>` is parameterised with a concrete datum type, `xKey` must be one of `T`'s keys; a typo is a compile error. X values must be `number` or `string` — pass `Date.getTime()` timestamps rather than `Date` instances. `Date` is intentionally not in the type union because recharts handles it inconsistently (sorting works, but `ReferenceArea` lookup in the zoom brush silently falls through).\n- **`activeKey`** / **`onActiveKeyChange`** (optional, `string | null`) — controlled hover series. When omitted, the chart manages it internally with `useState`. Use the controlled mode to share the *series highlight* across sibling charts (line dimming + legend hover). The root resolves `activeKey` against the current `seriesByKey` map — if the previously hovered series disappears (filter, refresh, or a controlled value pointing at a missing key), the highlight collapses to `null` instead of dimming every line. In **controlled** mode the chart calls `onActiveKeyChange(null)` from an effect so sibling charts stop highlighting a stale key — wire your external state accordingly so the snap-to-null write does not surprise you. In uncontrolled mode the internal state is left as-is and the next hover overwrites it.\n- **`syncId`** (optional, `string | number`) — pair two or more charts with the same `syncId` and recharts' built-in middleware syncs their *cursor X* (tooltip cursor + brush) — hovering one chart highlights the matching X on every sibling. This is independent of `activeKey`: `syncId` handles the tooltip cursor, `activeKey` handles the series highlight. Use both together for full cross-chart sync, or either one alone.\n- **`syncMethod`** (optional, `'index' | 'value' | (ticks, data) => number`) — how sibling `syncId` charts match X positions. Defaults to `'index'` (recharts' default — match by position in `data`). Use `'value'` when the synced charts have different dataset lengths but share categorical X values.\n- **`filteredKeys`** (optional, `string[]`) — keys to **hide** from the plot. The matching `<LineChartLine>` skips rendering, the tooltip row disappears, and the legend row paints at `opacity-40` with `data-selected='false'`. Stable references only — an inline array literal recreates on every parent render and invalidates the internal `Set` memo. The per-row `selected` prop still wins when set explicitly.\n- **`onZoomChange`** (optional, `(range: LineChartZoomRange | null) => void`) — fires when the user confirms a brush selection. The chart never persists the zoom window — `data` is always the truth. The consumer decides whether to narrow `data` upstream, push to a router, refetch, etc.\n\n`LineChart` does not sort, aggregate, or downsample. Callers prepare the data array.\n\n### Filter mental model (vs. `PieChart`)\n\n`PieChart` uses `selectedNames` (the keys to **highlight**; the rest dim). `LineChart` uses `filteredKeys` (the keys to **hide**). The divergence is intentional — the dominant interaction on the line chart is \"click a legend row to toggle the line off\", not \"click to emphasise one slice\". Consumers of both charts should not expect the two props to behave the same.\n\n## Layout\n\nThe chart is layout-agnostic. The root is a vertical flex container; **JSX child order picks placement**:\n\n```tsx\n// Legend on top:\n<LineChart …>\n <LineChartLegend>…</LineChartLegend>\n <LineChartBody>…</LineChartBody>\n</LineChart>\n\n// Legend on bottom:\n<LineChart …>\n <LineChartBody>…</LineChartBody>\n <LineChartLegend>…</LineChartLegend>\n</LineChart>\n\n// Legend on the side — wrap body+legend in any row flex container\n// (`<HStack>` from the design system is the canonical choice). Pair\n// with `<LineChartLegend orientation='vertical'>` for the legend's own\n// row→column layout.\n<LineChart …>\n <HStack flexGrow gap={12}>\n <LineChartLegend orientation='vertical'>…</LineChartLegend>\n <LineChartBody>…</LineChartBody>\n </HStack>\n</LineChart>\n```\n\nThere is no `position` prop on the legend or on the root. The legend's only knob is its own `orientation` (`'horizontal'` | `'vertical'`); placement is structural and lives in user-land. The `LegendPlacements` story demonstrates all four placements side by side.\n\n## States\n\n| State | Trigger | Behaviour |\n| --------------- | -------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- |\n| Default | — | Lines use `LINE_STROKE_FILL[color]` at full opacity. Mount animation: `400 ms ease-out`, honours `prefers-reduced-motion`. |\n| Hover (line) | Pointer over a `<LineChartLine>` path | No dimming — the plot stays at full opacity. The consumer's `onMouseEnter` / `onMouseLeave` still fire. The dashed cursor guideline and hover popover track the pointer via recharts' tooltip state. |\n| Hover (legend) | Pointer / focus over a `<LineChartLegendItem>` | `activeKey` snaps to that series; sibling lines fade to `LINE_INACTIVE_OPACITY` (0.3). The row paints `bg-states-primary-hover`. |\n| Hover (point) | Pointer over the plot body | Recharts' tooltip state snaps to the nearest X. The Y-locked popover renders one row per visible series at that index. The dashed vertical cursor guideline tracks the cursor X — this is the only on-plot hover affordance; no per-point dots render (`dot={false}` and `activeDot={false}`). Sibling charts that share a `syncId` mirror the highlight automatically. |\n| Focus | Keyboard focus on an interactive legend row | `bg-states-primary-hover` + `ring-focus-primary` inset ring (`focus-visible`). |\n| Filtered | `series.key` ∈ `filteredKeys` | `<LineChartLine>` does not render. Legend row paints at `opacity-40` with `aria-current` removed. |\n| Zoom-dragging | Pointer down → drag on the plot while `<LineChartZoomBrush>` is mounted | Borderless gray `<ReferenceArea>` (`fill: var(--color-states-primary-hover)`, no stroke) follows the cursor; a floating popover tracks the cursor with the live range text. Hover popover and dashed cursor guideline are suppressed — the zoom popover owns the cursor. |\n| Zoom-pending | Mouse release after a non-zero drag | Selection rectangle stays; popover becomes interactive with the \"Zoom in\" button. Hover popover stays suppressed until the pending state resolves. Click outside / Escape dismisses; Enter or button click confirms. |\n| Loading | Render `<LineChartEmpty>{null}</LineChartEmpty>` (or a `Skeleton` strip) | Dashed grid only — no labels, no line trace. Mirrors Figma `7519-2591`. The `Refreshing` story is the canonical pattern. |\n| Empty | `data.length === 0` | Compose `<LineChartEmpty>No data</LineChartEmpty>` in the body slot — the chart itself renders nothing without it. |\n| SinglePoint | `data.length === 1` | Nothing geometric renders — `dot={false}` + `activeDot={false}` mean no marker, and a one-point line has zero length. Hover still surfaces the value via the dashed cursor + popover. |\n| Range | `<LineChartRange from to>` (`Highlighted Range` story) | Danger fill + dashed edges, start/end labels outside the edges, `seriesKey` line red inside the range. |\n| Range hover | Pointer over a bucket inside the range (`Highlighted Range Hover`) | The `seriesKey` row's popover dot turns `red`; other rows unchanged. The bucket heading (`11:25 – 11:30`) comes from the consumer's `xTickFormatter`. |\n| Ongoing range | `to` omitted (`Ongoing Range`) | Range runs to the plot's right edge; end label defaults to `Ongoing`, drawn inside the range. |\n| Several ranges | 2+ visible `<LineChartRange>` (`Several Ranges`) | No labels at all. A range starting before the first datum clamps to the plot's left edge (its edge line still draws). |\n| Range + legend | `LineChartLegend` + `LineChartBody height={140}` (`Range With Legend`) | The usual-level series is an ordinary dashed series with a normal square-dot legend item. |\n| Gapped | `null` / `undefined` value on a datum for a given series | The line splits at the gap (recharts default `connectNulls={false}`). Set `<LineChartLine connectNulls>` to bridge. |\n\n## Interactions\n\n- **Hover sync (legend ↔ tooltip)** — pointer / focus on a `<LineChartLegendItem>` pushes `activeKey` into the active context; lines whose key does not match fade to 30% and the matching line gets `data-active='true'`. Hovering a line itself does **not** drive `activeKey` — the plot stays at full opacity so the cursor sweeping across multiple series does not flash sibling lines on and off. `<LineChartLegendItem>` uses `isHoverSyncTarget(event.relatedTarget)` in its `mouseLeave` / `blur` handlers to skip the `null`-clear when focus / pointer is moving directly between legend rows; without it React would render an intermediate `activeKey=null` frame on every crossing and the dimmed lines would flicker.\n- **Hover popover Y-lock** — `<LineChartTooltip>` reads recharts' inner plot rectangle via `usePlotArea()` and anchors the popover at `plotArea.y + plotArea.height / 2`. A wrapping `<div className='-translate-y-1/2'>` turns that coordinate into the popover's visual centre. `isAnimationActive={false}` is non-negotiable — without it recharts interpolates the popover Y between frames and defeats the lock. The first paint falls back to `HOVER_POPOVER_TOP` (8px) until recharts measures the plot.\n- **Click-to-filter** — caller-driven. Attach `onClick` to `<LineChartLegendItem>`; toggle the matching key in your own `filteredKeys` state. Enter/Space dispatch a click on the row.\n- **Cross-chart hover sync** — two layers compose:\n 1. **Cursor X (tooltip + brush)** — pass the same `syncId` to every chart that should mirror the cursor. Recharts' own redux middleware handles the wiring; no controlled state needed. `syncMethod='value'` lets datasets of different lengths sync by shared category instead of by position.\n 2. **Series highlight (line dimming + legend)** — wire each chart's `activeKey` / `onActiveKeyChange` to a shared `useState<string | null>`. The internal `lastActiveKeyRef` dedupe prevents the per-pixel mousemove flood from spamming the callback. See the `CrossChartHoverSync` story for the canonical recipe pairing both layers.\n- **Zoom (drag → pending → confirm)** — `<LineChartZoomBrush>` enables a crosshair drag on the plot. Two-phase:\n 1. **Drag** — `mousedown` on the plot starts a drag at the active tooltip index. A borderless gray `<ReferenceArea>` (`fill: var(--color-states-primary-hover)`, no stroke) follows the cursor; a portalled floating popover tracks the cursor position and renders the live range string. The hover popover and cursor guideline are hidden while dragging. Drag is followed at the *window* level so the popover keeps tracking when the cursor leaves the SVG and the release still commits even outside the chart. Escape mid-drag cancels outright (no pending popover).\n 2. **Pending** — `mouseup` after a non-zero drag locks the selection and turns the popover interactive (`pointer-events: auto`). Hover suppression continues — the chart reads as non-interactive until the user confirms or dismisses. The \"Zoom in\" button confirms — Enter does the same. Escape, click outside the popover, or starting a new drag dismisses without emitting. The popover stops a bubbling `mousedown` on its surface so clicking the confirm button does not start a fresh drag.\n 3. **Confirm** — fires `onZoomChange({ from, to, fromIndex, toIndex })` exactly once. The consumer narrows `data`; the brush state resets automatically.\n- **Zoom keyboard contract** — the keydown listener is gated to events whose target is inside the chart container, inside the popover, or ambient (focus on `<body>` / `<html>`). It does **not** hijack Enter for forms / dialogs / focused inputs elsewhere on the page.\n- **Single-index click (no zoom)** — clicking the plot without dragging produces a zero-width range and is dropped silently so users cannot accidentally surface a confirm popover on a plain click.\n- **Data refresh while zoom-pending** — the root resets `zoomDrag` and `zoomPending` whenever `data` or `xKey` changes. Emitting a stale range against a no-longer-current dataset would point at nothing meaningful.\n\n## Edge cases & unclear states\n\n- **Per-series hover and per-index hover are different things.** Pointing at a legend row sets the **series** active (dims sibling lines, keeps the popover off). Pointing at the plot body sets the **index** active (lights up the popover for every visible series at that X). They live in separate contexts on purpose so the lines don't re-render on every cursor frame. Hovering a line in the plot does **not** dim siblings — only the legend drives the series dim.\n- **The popover Y is locked, not the X.** The dashed cursor guideline still tracks the cursor's X; the popover surface stays put on Y so it does not jump between peaks and valleys. Disabling animation (`isAnimationActive={false}`) is required — without it recharts interpolates Y between frames.\n- **Filtering down to zero series.** The plot renders an empty frame (grid + axes still visible). Recommend swapping the body for `<LineChartEmpty>No data</LineChartEmpty>` when the consumer's filter UI produces this state.\n- **`null` / `undefined` datum values.** Recharts splits the line at the gap (default `connectNulls={false}`). The tooltip row formats `null` / `undefined` as `—`. Pass `<LineChartLine connectNulls>` to bridge.\n- **`NaN` values.** Recharts coerces `NaN` to `null` (gap behaviour). Pre-filter upstream if you need different handling.\n- **Single point (`data.length === 1`).** Recharts renders nothing geometric — `dot={false}` and `activeDot={false}` mean there is no marker, and a one-point line has zero length. Hover still works (the dashed cursor + popover surface the value). Consider falling back to a different chart type for single-point data.\n- **`xKey` typing.** The public union is `number | string` (no `Date`). Pass `Date.getTime()` timestamps and format with `tickFormatter`; the chart's own `<ReferenceArea>` lookups (zoom brush) rely on this contract — a stray `Date` instance breaks them silently.\n- **Mount animation.** `400 ms ease-out`, `begin=0`. `isAnimationActive='auto'` (the default) honours `prefers-reduced-motion`. Force off with `<LineChartLine disableAnimation />` — useful for E2E screenshot stability.\n- **`className` on a `LineChartLine`.** Recharts paints the line as `<path>` — only `stroke-*` Tailwind utilities take effect, **not** `bg-*` or `fill-*`. The same trap `PieChart` documents for slices applies here in mirror.\n- **Stale `activeKey` after a series disappears.** The root resolves `activeKey` against `seriesByKey`. In **controlled** mode the chart calls `onActiveKeyChange(null)` from an effect — make `onActiveKeyChange` stable so the reset lands in the same render cycle as the data change. In **uncontrolled** mode the internal state is left as-is; the next hover overwrites it. Either way the visible state never gets stuck at \"every line dimmed\".\n- **Stale tooltip cursor after `data` shrinks.** Recharts manages tooltip state internally and resets the cursor on every `data` update. There is no out-of-range slot to clamp — the chart simply re-renders the cursor against the new dataset on the next pointer event.\n- **Brush popover positioning.** The popover is `position: fixed` portalled to `document.body`. **X tracks the cursor** (`clientX` from the latest mousemove, offset right of the pointer); **Y is locked to the plot-area centre** via recharts' `usePlotArea()` + the recharts surface's viewport rect, then offset up by half its own height (`translateY(-50%)`) so the popover's vertical centre matches `<LineChartTooltip>`. Before recharts has measured the plot, Y falls back to the current pointer `clientY` for the one or two frames until `plotArea` lands. While the popover is open the chart subscribes to `window` `scroll` and `resize` (capture phase) and bumps a render tick, so the memoised viewport rect re-reads — without that subscription the portal's `position: fixed` would pin the popover to the original release point as the page scrolls and the chart would slide away beneath it. During **pending** the captured `clientX` is offset by the chart's horizontal scroll delta (the chart's viewport-`left` at release vs. now) so the popover stays anchored to the plot column, not the viewport.\n- **Two charts on one page, both with zoom.** The pending-zoom keydown handler is scoped to the owning chart via `LineChartZoomContext.rootRef`. Enter and Escape only commit / dismiss the chart whose root currently contains the event target (plus the portalled popover and the ambient body/html case). Sibling charts on the same page do not see each other's keystrokes.\n- **Long datasets.** The chart still works at 1000+ points (the `LongTimeRange` story stresses this) but recharts' tick generator and interpolation cost climb past ~5000 points. Downsample upstream.\n- **Edge tick text anchor uses the original `payload.coordinate`, not `props.x`/`props.y`.** Recharts pre-shifts the first/last tick's `tickCoord` inward so a *middle-anchored* label cannot overflow the plot. Our edge ticks override the anchor to `start` / `end`, so that shift would float the text edge ~10px off its tick (e.g. `23:00` landing visually near the `22:00` band). `renderAxisTick` re-anchors to `payload.coordinate` whenever the caller overrides the anchor, so the text's leading/trailing edge lands directly under the tick.\n- **`LineChartXAxis` defaults `interval` to `'preserveStartEnd'`.** Recharts' own default (`preserveEnd`) drops the first data tick whenever it collides with a neighbour, leaving the leftmost label visibly indented from the plot's left edge. We force both edges to render so `index === 0` and `index === visibleTicksCount - 1` are always the actual data edges — which is what the `renderTick` anchor override assumes when it pins the first label flush-left and the last flush-right.\n- **`LineChartEmpty` with no `children`.** Renders only the dashed grid frame — the idiom the `Loading` and `Refreshing` stories use, paired with a `<Skeleton>` strip in place of the legend rows. `null`/`undefined` children are both treated the same (no message overlay).\n- **Recharts requires axes / grid / lines / tooltip / brush to be direct children of `<RechartsLineChart>`.** Our wrappers (`LineChartXAxis`, `LineChartYAxis`, `LineChartGrid`, `LineChartLine`, `LineChartTooltip`, `LineChartZoomBrush`) all return bare recharts elements (or `null`); in recharts v3 each primitive self-registers via Redux dispatch, so mounting them anywhere inside the `<RechartsLineChart>` subtree wires up correctly.\n- **Inline event handlers on controlled mode.** Wrap `onActiveKeyChange` / `onZoomChange` in `useCallback` (or hoist them) — an inline arrow handler recreates every render and propagates through the data context, invalidating memoised legend rows. Not a correctness bug, but kills `React.memo` opportunities for custom row children.\n\n- **Range edge between two buckets.** The X axis is a category axis, so the scale knows only data X values. A numeric edge that falls between two data points is linearly interpolated between their pixels (11:52 sits 2/5 of the way from 11:50 to 11:55); a string X must match a datum exactly. A range that can never be drawn on the data (a string edge with no matching datum, an edge type that differs from the X type, numeric X that is not strictly ascending, `from` after `to`) logs a dev-mode `console.warn`, draws nothing and marks no popover row `inRange`. The line's colour switch uses the same pixel.\n- **Range clamping.** `from` at or before the first datum clamps to the plot's left edge (no start label); `to` omitted or at or after the last datum clamps to the right edge. A range fully outside the data is not drawn; unsorted or single-datum data draws no range.\n- **Overlapping ranges** are drawn as is (fills stack) and log a dev-mode `console.warn`.\n- **Range labels** are hidden when 2+ ranges are visible, when a label would leave the plot area, or when the two labels would collide. Widths are estimated from the character count.\n- **Range on a filtered series.** The fill and edges still draw; there is simply no line to recolour.\n\n## Accessibility notes\n\n- The chart body (`<LineChartBody>`) is `aria-hidden='true'` — the SVG is decorative. The legend is the canonical screen-reader representation.\n- Recharts' default keyboard a11y layer is disabled (`accessibilityLayer={false}`) — it puts `tabindex=0` + `role='application'` on the SVG and would conflict with `aria-hidden` on our wrapper. The legend rows are the accessible alternative.\n- Interactive `<LineChartLegendItem>` rows expose `role='button'`, `tabIndex=0`; Enter/Space dispatch a click. `aria-current='true'` when the row is selected. Focus ring uses `focus-visible` so keyboard users see the ring and pointer clicks don't.\n- The hover popover (`<LineChartHoverPopover>`) is `role='tooltip'` + `aria-live='polite'`. `<LineChartHoverPopoverDot>` is `aria-hidden` so screen readers don't pronounce the colour swatch.\n- The zoom popover (`<LineChartZoomPopover>`) is `role='dialog'`, `aria-modal='false'` (non-modal — focus stays on the chart). The confirm button advertises `aria-keyshortcuts='Enter'`.\n- Ranges: the root renders a visually hidden list (`sr-only` `<ul>`, test ID `{root}--range-descriptions`) with one `<li>` per mounted `<LineChartRange>` that has a `description` — including ranges outside the visible window, since the registry stores raw props only. Nothing renders when no range has one. The wording is the consumer's.\n- `<LineChartEmpty>` is a static frame — pass meaningful `children` (`'No data'`, `'Loading'`, etc.) for the screen-reader announcement.\n\n## Open questions / known limitations\n\n- **Stacked / area / scatter / step variants.** Out of scope for this PR — each is its own compound.\n- **Reference / threshold lines** (`<LineChartReferenceLine>`). Out of scope; will be added when a product use case lands.\n- **Multi-axis** (separate left + right Y). Out of scope.\n- **Built-in zoom-out / reset chip.** Out of scope — consumers render their own affordance in `<ChartActions>` and call `setRange(null)` (the `Zoom` story is the canonical pattern).\n- **Tooltip pinning** (\"click to keep open\"). Hover-only for v1.\n- **Cross-chart hover registry.** `syncId` (cursor X) + controlled `activeKey` (series highlight) cover the one-parent / multiple-charts case. A `ChartGroup` provider would live one level above this component to share an `activeKey` `useState` across an arbitrary number of charts.\n- **Internationalised range / tick formatting.** Caller supplies `tickFormatter` and `formatRange`. The chart does not call `Intl.DateTimeFormat` itself.\n- **Range line width.** Figma draws the series at 1.5px; we keep `LINE_STROKE_WIDTH` at 2 for consistency with every other chart.\n- **Range colours.** The in-range popover dot is palette `red` (red-500) while the in-range line is `var(--color-bg-fill-danger)` (red-600) — different by design, as in Figma."
|
|
36889
36889
|
},
|
|
36890
36890
|
{
|
|
36891
36891
|
"name": "Metric",
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "4.19.
|
|
2
|
+
"version": "4.19.1",
|
|
3
3
|
"rules": "Every numeric utility is in px, not 4px steps: p-16 is 16px, p-4 is 4px. Translate Tailwind habits (p-4 → p-16, gap-6 → gap-24, w-64 → w-256).\n\nBefore composing a screen, call get_guideline for the pattern (app shell, list page, table, drawer, form, dialog, filters, empty state, settings, auth). Wrong → right:\n\n- p-5, gap-3, p-10 → stay on the scale: 1, 2, 4, 6, 8, 12, 16, 20, 24, 28, 32, 40, 48, 64…\n- space-y-4, margins per child → <VStack gap={16}>, <HStack gap={8}>\n- Padded page wrapper → PageHeader / PageToolbar / PageContent own the 24px gutter\n- p-* on Card, DrawerBody, DialogBody, PageToolbar, Table → none; they own their padding\n- className on Text, Heading, Field, Drawer/Dialog Header/Body/Footer → wrap in your own element\n- Raw <h1>, <p>, <label> → <Heading as=\"h2\" size=\"lg\">, <Text size=\"sm\">, Field\n- <Text> default (16px) for body → size=\"sm\"\n- leading-none (0px), leading-5 (5px) → leading-sm, leading-20\n- weight=\"semibold\" → weight is light|regular|medium|bold (medium = 450)\n- bg-primary, text-muted, bg-card, bg-white → bg-bg-primary, text-text-secondary, bg-bg-surface-1\n- text-error, bg-red-500 → danger tokens; categorical color → Badge color\n- dark: variant, setting data-theme → semantic tokens, useTheme().setTheme()\n- rounded-lg, rounded, rounded-[15px] → rounded-8 (controls), rounded-12 (panels)\n- shadow-* on DS components, z-* on overlays → never; they own both\n- focus:ring → focus-visible:ring-3 ring-focus-primary outline-none\n- size, DIALOG/DRAWER_SIZES → width: Dialog 400 confirm, 560 default, 960 picker; Drawer 640 default, 700 Timeline form\n- Dialog, useToast from the root → @wallarm-org/design-system/Dialog, /Toast\n- Field invalid → error on the control + FieldError\n- Table actions column → meta.renderMenuAction on the master column\n- Hand-built side menu → RemoteShell config={NavConfig}\n- ConfirmDialog, FilterBar, Combobox → compose Dialog parts, PageToolbar + FilterDropdown, Select + useSelectSearch\n- data-slot in tests → data-testid\n",
|
|
4
4
|
"guidelines": [
|
|
5
5
|
{
|
package/package.json
CHANGED