@besaitech/ng-design-system 0.0.65 → 0.0.67

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.
package/README.md CHANGED
@@ -180,6 +180,7 @@ Import names are the `Sl…` classes; the markup selectors are `sds-…`.
180
180
  | `SdsSelect` | `<sds-select>` | CVA single-select dropdown |
181
181
  | `SdsMultiSelect` | `<sds-multi-select>` | CVA multi-select with chips; `(opened)` / `(closed)` (emits the selection) |
182
182
  | `SdsDatePicker` / `SdsCalendar` | `<sds-date-picker>` / `<sds-calendar>` | CVA date field + popover calendar (`date-utils` helpers) |
183
+ | `SdsDateRangePicker` / `SdsRangeCalendar` | `<sds-date-range-picker>` / `<sds-range-calendar>` | Range field: presets column + two-month range calendar, pending until Apply; `[(value)]` is an `SdsDateRange \| null` (`{ start, end }`, end inclusive); `(presetSelect)` emits the preset id; helpers `sdsLastDays(n)`, `sdsLastMonths(n)`, `formatDateRange()` |
183
184
  | `SdsPhoneInput` | `<sds-phone-input>` | CVA phone field with country selector (`phone-countries`) |
184
185
  | `SdsIcon` | `<sds-icon>` | Inline-SVG icon; `name`, `size`, `strokeWidth`, `filled` |
185
186
  | `SdsAvatar` | `<sds-avatar>` | Image, initials or `fallbackIcon` + status dot; `shape` (circle·rounded·square), `decorative`; broken image falls back |
@@ -203,6 +204,53 @@ Import names are the `Sl…` classes; the markup selectors are `sds-…`.
203
204
  | `SdsTopbar` | `<sds-topbar>` | `appName`, `user`, `(logout)`; `[sdsLogo]` slot |
204
205
  | `SdsSidebar` + `SdsNavGroup` + `SdsNavItem` | `<sds-sidebar>` … | Collapsible nav rail; collapse state via root-provided `SidebarStore`; items render `routerLink` or `<button>` |
205
206
 
207
+ **Charts** (D3 does the maths, Angular renders the SVG, so they are OnPush, SSR-safe and themed by tokens)
208
+
209
+ | Component | Selector | Notes |
210
+ | --- | --- | --- |
211
+ | `SdsLineChart` | `<sds-line-chart>` | Time / numeric / category x; multi-series, `area`, `stack` (stacked · percent), `curve`, log `yScale`, `annotations`, dashed forecast series, `endLabels`, crosshair tooltip |
212
+ | `SdsBarChart` | `<sds-bar-chart>` | `orientation`, `stack`, negatives, `showValues`, `sort`, `barColor`, `highlight`, combo `type: 'line'` series |
213
+ | `SdsScatterChart` | `<sds-scatter-chart>` | `x`/`y`, bubble `size`, `group`, `trendline`, log/time axes, nearest-point hover |
214
+ | `SdsDonutChart` | `<sds-donut-chart>` | Donut · pie · `half`; tail folds into "Other" past `maxSlices`; centre total / hovered slice (`centerLabel=""` hides the centre readout) |
215
+ | `SdsHeatmap` | `<sds-heatmap>` | Two categorical dims × a measure; `scheme` sequential · diverging, `showValues` |
216
+ | `SdsTreemap` | `<sds-treemap>` | Nested `{ name, value?, children? }`; branch colours, click-to-zoom breadcrumb |
217
+ | `SdsSparkline` | `<sds-sparkline>` | Word-sized line · area · bar; `band`, `reference`, `showMinMax` |
218
+ | `SdsKpi` | `<sds-kpi>` | Stat tile: value, change vs `previous` (good/bad via `upIsGood`), optional sparkline `trend` |
219
+
220
+ Every chart reads plain rows through accessors (a property name or `(row, i) => value`), so API data
221
+ plots without reshaping; has an interactive legend (colour follows the series, never its rank), a
222
+ keyboard-navigable tooltip, a data-table twin (`tableToggle`), `loading` / empty states, and a
223
+ `(pointClick)` output. Colours come from the colour-blind-safe `--sds-chart-1…8` slots in `base.css`
224
+ (override any slot in your preset). Set app-wide defaults once:
225
+
226
+ ```ts
227
+ providers: [provideSdsCharts({ locale: 'fr-FR', labels: CHART_LABELS_FR })]
228
+ // or, switching live with the app language (both functions are read inside computed()s):
229
+ providers: [provideSdsCharts({ locale: () => lang(), labels: () => chartLabelsFor(lang()) })]
230
+ ```
231
+
232
+ **Chart strings.** Every built-in string — empty state, table toggle and headers, tooltip rows, the
233
+ spoken summaries, role descriptions, the KPI's change sentence — is an `SdsChartLabels` key with an
234
+ English default (`SDS_CHART_LABELS_EN`). Translate them once through `provideSdsCharts({ labels })`
235
+ (a `Partial<SdsChartLabels>`, merged over the English defaults); parameterised ones are functions
236
+ (`sliceCount(n)`, `gridSize(rows, columns)`, `labelValue(label, value)`, `zoomedTo(path)`,
237
+ `versus(y, x)`, `sparklineSummary({ label, first, last, min, max, count })`,
238
+ `kpiChange({ direction, delta, period, good })`, …). Per-chart inputs (`emptyText`, `otherLabel`,
239
+ `centerLabel`, `valueLabel`, `rootLabel`, `sizeLabel`) still win for one chart; left unset (`null`)
240
+ they fall back to the configured labels.
241
+
242
+ ```html
243
+ <sds-line-chart
244
+ heading="Admissions"
245
+ [data]="rows"
246
+ x="date"
247
+ [series]="[{ key: 'urgences', label: 'Urgences' }, { key: 'programmees', label: 'Programmées' }]"
248
+ [annotations]="[{ type: 'line', value: 150, label: 'Capacité' }]"
249
+ />
250
+ ```
251
+
252
+ Custom tooltip body: `<ng-template sdsChartTooltip let-tip>…</ng-template>` inside any chart.
253
+
206
254
  ## Theme & cross-app preferences
207
255
 
208
256
  `SdsThemeService` holds the person's **mode** — `'system' | 'light' | 'dark'`, persisted to `localStorage`