# XWUICapacityRail

A side rail that shows each person's load for a week: "n of 40 h" with a percentage, a bar with a capacity marker (red and hatched when over), a cell per day with its percentage (days off hatched), a rebalance suggestion with Apply and Ignore, and a plural "n people over capacity" flag. Each person is also a drop target for a card dragged from `XWUIKanbanBoard`, so a card can be reassigned by dropping it on someone.

It composes the shared work-management contracts: the work calendar (working week and holidays), `initialsOf` / `avatarTint` for people, and Western digits unless `numberingSystem` says otherwise.

## Basic Usage

Three people over a Monday to Friday week. Without `weekStart` the rail starts on the earliest planned day; without `workCalendar` every day counts as worked.

```example
file: examples/BasicUsage.ts
html: examples/BasicUsage.html
title: Basic Usage
description: Three people, one week: hours of capacity, a bar with a capacity line and a cell per day.
```

## Work management rail

Five people for the week of 27 Sep worked Sunday to Thursday: Friday and Saturday are hatched, Faisal is at 130 percent, and the suggestion moves a card from him to Nora.

```example
file: examples/WorkManagement.ts
html: examples/WorkManagement.html
title: Work management capacity rail
description: Per-person week load with a capacity marker, day cells with hatched days off, an over-capacity count, a rebalance suggestion and card drops.
```

## Data

`people[]`: `{ id, name, label?, avatar?, tint?, hours?, capacity?, days?: [{ date, hours, items? }] }`. `hours` defaults to the sum of the worked days in `days`; `capacity` defaults to `dayCapacity` (8) times the worked days of the grid. `suggestions[]`: `{ id, text, after? }`, computed by the host.

## Options

| Option | Default | What it does |
| --- | --- | --- |
| `weekStart`, `days` | earliest planned day, `7` | The days of the grid. |
| `workCalendar` | every day worked | `{ workWeek, holidays }`. A day off is hatched and carries no hours. |
| `showNonWorking` | `true` | `false` drops the days off from the grid; capacity is unchanged. |
| `dayCapacity` | `8` | Hours of one worked day; a day cell shows hours over this. |
| `barMaxPercent` | `150` | Percent the bar track stands for, at least; it widens for every bar when someone is past it. |
| `dayLabels` | Intl short names | Seven day names, Sunday first. |
| `title`, `weekLabel`, `note`, `showNote` | locale pack | Heading, week caption and the footer ("Capacity 8 h a day, Sunday to Thursday"). |
| `overCountKey` | `xwui.capacity_rail.over_count` | Plural key of the over-capacity flag; the pack carries `_one`, `_other` (and Arabic `_two`, `_few`, `_many`) forms with `{n}`. |
| `locale`, `numberingSystem` | page language, `'latn'` | Date and number formatting. |
| `acceptCardDrops` | `true` | Accept cards dragged from a board. It reacts only to a drag that carries the card payload. |

## Events

`onSuggestionApply(id)` and `onSuggestionDismiss(id)` (the suggestion closes at once; the host sends fresh data, which offers any new suggestion again), `onCardDrop(cardId, personId)`. A drop is also announced on `document` as `xwui:kanban-card-drop`, which a board with `externalDrop: true` turns into its own `onExternalDrop`.

```api
```
