import {
  Meta,
  Title,
  Subtitle,
  Description,
  Primary,
  Controls,
  Stories,
} from '@storybook/addon-docs/blocks';
import * as MapScaleBarStories from './map-scale-bar.stories';

<Meta of={MapScaleBarStories} />

<Title />
<Subtitle>Graphic scale bar, recalculated on every zoom change.</Subtitle>

<Description />

<Primary />

<Controls />

---

## Variations

<Stories />

---

## AI Best Practices

> [!IMPORTANT]
>
> - **Prefer `<Map scaleBar />`** over mounting this directly — the map already knows its zoom and latitude and computes `metersPerPixel` for you.
> - **Always include it on a map that will be printed or exported.** A static map with no scale cannot support a claim about distance.
> - The bar picks a round distance (1, 2 or 5 × a power of ten) on purpose: a bar labelled 1.37 km is useless for estimating by eye.
