@alfadocs/ui-kit-debug 0.80.1 → 0.82.0

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,13 +1,13 @@
1
- import { jsxs as S, jsx as c } from "react/jsx-runtime";
2
- import { forwardRef as X, useId as tt, useMemo as d, useRef as et, useState as $, useEffect as G, useImperativeHandle as rt } from "react";
3
- import { c as at } from "./index-D2ZczOXr.js";
4
- import { useTranslation as ot } from "react-i18next";
5
- import nt from "react-apexcharts";
6
- import U from "apexcharts";
7
- import { u as it, g as k } from "./apexcharts-theme-BJigns_V.js";
8
- import { u as st } from "./use-prefers-reduced-motion-BMwIQRjB.js";
9
- import { u as ct } from "./registry-DvAUVLHh.js";
10
- const dt = {
1
+ import { jsxs as S, jsx as d } from "react/jsx-runtime";
2
+ import { forwardRef as et, useId as rt, useMemo as c, useRef as at, useState as U, useEffect as k, useImperativeHandle as ot } from "react";
3
+ import { c as nt } from "./index-D2ZczOXr.js";
4
+ import { useTranslation as it } from "react-i18next";
5
+ import st from "react-apexcharts";
6
+ import H from "apexcharts";
7
+ import { u as ct, g as _ } from "./apexcharts-theme-BJigns_V.js";
8
+ import { u as dt } from "./use-prefers-reduced-motion-BMwIQRjB.js";
9
+ import { u as lt } from "./registry-DvAUVLHh.js";
10
+ const mt = {
11
11
  id: "chart",
12
12
  capabilities: [],
13
13
  state: {},
@@ -75,7 +75,7 @@ const dt = {
75
75
  description: "Sourced from the id prop."
76
76
  }
77
77
  }
78
- }, lt = at("ds:relative ds:block ds:w-full", {
78
+ }, ut = nt("ds:relative ds:block ds:w-full", {
79
79
  variants: {
80
80
  density: {
81
81
  compact: "ds:min-h-[var(--chart-min-height-compact)]",
@@ -87,20 +87,20 @@ const dt = {
87
87
  }
88
88
  },
89
89
  defaultVariants: { density: "comfortable" }
90
- }), mt = [
90
+ }), pt = [
91
91
  "verticalLines",
92
92
  "horizontalLines",
93
93
  "slantedLines",
94
94
  "squares",
95
95
  "circles"
96
- ], ut = ["line", "bar", "area"], pt = ["pie", "donut", "radialBar"];
96
+ ], ht = ["line", "bar", "area"], ft = ["pie", "donut", "radialBar"];
97
97
  function T(o) {
98
- return pt.includes(o);
98
+ return ft.includes(o);
99
99
  }
100
- function ht(o) {
101
- return ut.includes(o);
100
+ function bt(o) {
101
+ return ht.includes(o);
102
102
  }
103
- function ft(o, l) {
103
+ function gt(o, l) {
104
104
  return T(l) ? [
105
105
  {
106
106
  name: "",
@@ -108,45 +108,46 @@ function ft(o, l) {
108
108
  }
109
109
  ] : o;
110
110
  }
111
- const bt = X(
111
+ const yt = et(
112
112
  ({
113
113
  title: o,
114
114
  id: l,
115
115
  type: r,
116
116
  series: h,
117
- categories: g,
118
- labels: y,
117
+ categories: y,
118
+ labels: f,
119
119
  height: O,
120
- width: H,
120
+ width: M,
121
121
  patterns: A = !1,
122
122
  colors: v,
123
123
  toolbar: x = !1,
124
- locale: _,
124
+ locale: j,
125
125
  radialValueFormatter: m,
126
- density: M,
127
- className: j
128
- }, D) => {
129
- const { t: a, i18n: W } = ot(), N = tt(), u = d(
130
- () => `chart-${N.replace(/[^a-zA-Z0-9-_]/g, "")}`,
131
- [N]
132
- ), R = `${u}-summary`, I = et(null), [P, q] = $(0);
133
- it(I);
134
- const p = _ ?? W.language ?? "en", [z, Y] = $(
126
+ valueFormatter: N,
127
+ density: D,
128
+ className: W
129
+ }, q) => {
130
+ const { t: a, i18n: Y } = it(), P = rt(), u = c(
131
+ () => `chart-${P.replace(/[^a-zA-Z0-9-_]/g, "")}`,
132
+ [P]
133
+ ), R = `${u}-summary`, I = at(null), [z, Z] = U(0);
134
+ ct(I);
135
+ const p = j ?? Y.language ?? "en", [B, K] = U(
135
136
  () => {
136
137
  try {
137
- return k();
138
+ return _();
138
139
  } catch {
139
140
  return {};
140
141
  }
141
142
  }
142
143
  );
143
- G(() => {
144
+ k(() => {
144
145
  if (typeof document > "u") return;
145
146
  let t;
146
147
  const e = new MutationObserver(() => {
147
148
  clearTimeout(t), t = setTimeout(() => {
148
149
  try {
149
- Y(k());
150
+ K(_());
150
151
  } catch {
151
152
  }
152
153
  }, 50);
@@ -157,36 +158,39 @@ const bt = X(
157
158
  }), () => {
158
159
  clearTimeout(t), e.disconnect();
159
160
  };
160
- }, []), G(() => {
161
+ }, []), k(() => {
161
162
  const t = I.current;
162
163
  if (!t || typeof ResizeObserver > "u") return;
163
164
  const e = new ResizeObserver((n) => {
164
165
  const i = n[0];
165
- i && q(Math.floor(i.contentRect.width));
166
+ i && Z(Math.floor(i.contentRect.width));
166
167
  });
167
168
  return e.observe(t), () => e.disconnect();
168
169
  }, []);
169
- const C = d(
170
+ const C = c(
170
171
  () => ({
171
172
  async dataURI() {
172
- const t = U.getChartByID(u);
173
+ const t = H.getChartByID(u);
173
174
  return t ? (await t.dataURI()).imgURI : "";
174
175
  },
175
176
  updateSeries(t) {
176
- const e = U.getChartByID(u);
177
+ const e = H.getChartByID(u);
177
178
  e && (T(r), e.updateSeries(t));
178
179
  }
179
180
  }),
180
181
  [u, r]
181
182
  );
182
- rt(D, () => C, [C]), ct(dt, C, l);
183
- const w = typeof document < "u" && document.documentElement.dir === "rtl", B = d(
184
- () => ft(h, r),
183
+ ot(q, () => C, [C]), lt(mt, C, l);
184
+ const w = typeof document < "u" && document.documentElement.dir === "rtl", E = c(
185
+ () => gt(h, r),
185
186
  [h, r]
186
- ), f = d(
187
+ ), $ = c(
187
188
  () => new Intl.NumberFormat(p),
188
189
  [p]
189
- ), E = d(
190
+ ), b = c(
191
+ () => N ?? ((t) => $.format(t)),
192
+ [N, $]
193
+ ), G = c(
190
194
  () => ({
191
195
  name: p,
192
196
  options: {
@@ -205,9 +209,9 @@ const bt = X(
205
209
  }
206
210
  }),
207
211
  [p, a]
208
- ), L = st(), Z = d(() => {
209
- var n, i, b;
210
- const t = z, e = {
212
+ ), L = dt(), V = c(() => {
213
+ var n, i, g;
214
+ const t = B, e = {
211
215
  ...t,
212
216
  chart: {
213
217
  ...t.chart,
@@ -218,11 +222,17 @@ const bt = X(
218
222
  enabled: !L,
219
223
  dynamicAnimation: { enabled: !L }
220
224
  },
221
- locales: [E],
225
+ locales: [G],
222
226
  defaultLocale: p,
223
227
  parentHeightOffset: 0
224
228
  },
225
- labels: y,
229
+ // Only set `labels` when the consumer actually supplied them (slice
230
+ // charts). Emitting `labels: undefined` crashes ApexCharts' bar
231
+ // renderer — `parseDataAxisCharts` reads `labels.length` and throws
232
+ // "Cannot read properties of undefined (reading 'length')", which
233
+ // aborts the render and leaves a blank chart. Absent is safe; area /
234
+ // line tolerate the undefined but bar does not, so never pass it.
235
+ ...f ? { labels: f } : {},
226
236
  legend: {
227
237
  ...t.legend,
228
238
  position: "bottom",
@@ -236,21 +246,21 @@ const bt = X(
236
246
  tooltip: {
237
247
  ...t.tooltip,
238
248
  y: {
239
- formatter: (s) => f.format(s)
249
+ formatter: (s) => b(s)
240
250
  }
241
251
  },
242
252
  noData: {
243
253
  text: a("chart.noData")
244
254
  }
245
255
  };
246
- if (v && v.length > 0 && (e.colors = v), ht(r) && (e.xaxis = {
256
+ if (v && v.length > 0 && (e.colors = v), bt(r) && (e.xaxis = {
247
257
  ...t.xaxis,
248
- categories: g ?? []
258
+ categories: y ?? []
249
259
  }, e.yaxis = {
250
260
  ...t.yaxis,
251
261
  opposite: w,
252
262
  labels: {
253
- formatter: (s) => f.format(s)
263
+ formatter: (s) => b(s)
254
264
  }
255
265
  }, e.stroke = {
256
266
  curve: "smooth",
@@ -264,8 +274,8 @@ const bt = X(
264
274
  dataLabels: {
265
275
  ...((n = s.radialBar) == null ? void 0 : n.dataLabels) ?? {},
266
276
  value: {
267
- ...((b = (i = s.radialBar) == null ? void 0 : i.dataLabels) == null ? void 0 : b.value) ?? {},
268
- formatter: (Q) => m(Number(Q))
277
+ ...((g = (i = s.radialBar) == null ? void 0 : i.dataLabels) == null ? void 0 : g.value) ?? {},
278
+ formatter: (tt) => m(Number(tt))
269
279
  }
270
280
  }
271
281
  }
@@ -275,7 +285,7 @@ const bt = X(
275
285
  type: "pattern",
276
286
  opacity: r === "area" ? 0.3 : 1,
277
287
  pattern: {
278
- style: [...mt],
288
+ style: [...pt],
279
289
  strokeWidth: 2
280
290
  }
281
291
  } : r === "area" && (e.fill = {
@@ -283,45 +293,45 @@ const bt = X(
283
293
  opacity: 0.3
284
294
  }), e;
285
295
  }, [
286
- z,
296
+ B,
287
297
  u,
288
298
  x,
289
299
  L,
290
- E,
300
+ G,
291
301
  p,
292
- y,
293
302
  f,
303
+ b,
294
304
  a,
295
305
  r,
296
- g,
306
+ y,
297
307
  w,
298
308
  A,
299
309
  v,
300
310
  m
301
- ]), K = H ?? (P > 0 ? P : "100%"), F = O ?? 320, V = d(() => {
302
- const t = T(r) ? y ?? [] : g ?? [], e = B;
311
+ ]), F = M ?? (z > 0 ? z : "100%"), J = O ?? 320, Q = c(() => {
312
+ const t = T(r) ? f ?? [] : y ?? [], e = E;
303
313
  return /* @__PURE__ */ S("table", { id: R, className: "ds:sr-only", children: [
304
- /* @__PURE__ */ c("caption", { children: o }),
305
- /* @__PURE__ */ c("thead", { children: /* @__PURE__ */ S("tr", { children: [
306
- /* @__PURE__ */ c("th", { scope: "col", children: a("chart.table.series") }),
307
- t.map((n, i) => /* @__PURE__ */ c("th", { scope: "col", children: n }, `${n}-${i}`))
314
+ /* @__PURE__ */ d("caption", { children: o }),
315
+ /* @__PURE__ */ d("thead", { children: /* @__PURE__ */ S("tr", { children: [
316
+ /* @__PURE__ */ d("th", { scope: "col", children: a("chart.table.series") }),
317
+ t.map((n, i) => /* @__PURE__ */ d("th", { scope: "col", children: n }, `${n}-${i}`))
308
318
  ] }) }),
309
- /* @__PURE__ */ c("tbody", { children: e.map((n, i) => /* @__PURE__ */ S("tr", { children: [
310
- /* @__PURE__ */ c("th", { scope: "row", children: n.name || a("chart.table.value") }),
311
- n.data.map((b, s) => /* @__PURE__ */ c("td", { children: r === "radialBar" && m ? m(b) : f.format(b) }, `${i}-${s}`))
319
+ /* @__PURE__ */ d("tbody", { children: e.map((n, i) => /* @__PURE__ */ S("tr", { children: [
320
+ /* @__PURE__ */ d("th", { scope: "row", children: n.name || a("chart.table.value") }),
321
+ n.data.map((g, s) => /* @__PURE__ */ d("td", { children: r === "radialBar" && m ? m(g) : b(g) }, `${i}-${s}`))
312
322
  ] }, `${n.name}-${i}`)) })
313
323
  ] });
314
324
  }, [
315
325
  r,
316
- B,
326
+ E,
327
+ f,
317
328
  y,
318
- g,
319
329
  R,
320
330
  o,
321
331
  a,
322
- f,
332
+ b,
323
333
  m
324
- ]), J = d(() => (T(r), h), [h, r]);
334
+ ]), X = c(() => (T(r), h), [h, r]);
325
335
  return /* @__PURE__ */ S(
326
336
  "div",
327
337
  {
@@ -329,24 +339,24 @@ const bt = X(
329
339
  role: "img",
330
340
  "aria-label": o,
331
341
  "aria-describedby": R,
332
- className: lt({
342
+ className: ut({
333
343
  // Explicit height wins over the density min-height unless the
334
344
  // caller also asked for a density explicitly.
335
- density: M ?? (O !== void 0 ? "none" : void 0),
336
- className: j
345
+ density: D ?? (O !== void 0 ? "none" : void 0),
346
+ className: W
337
347
  }),
338
348
  "data-component": "chart",
339
349
  "data-component-id": l,
340
350
  children: [
341
- V,
342
- /* @__PURE__ */ c(
343
- nt,
351
+ Q,
352
+ /* @__PURE__ */ d(
353
+ st,
344
354
  {
345
355
  type: r,
346
- series: J,
347
- options: Z,
348
- width: K,
349
- height: F,
356
+ series: X,
357
+ options: V,
358
+ width: F,
359
+ height: J,
350
360
  "aria-hidden": "true"
351
361
  }
352
362
  )
@@ -355,10 +365,10 @@ const bt = X(
355
365
  );
356
366
  }
357
367
  );
358
- bt.displayName = "Chart";
368
+ yt.displayName = "Chart";
359
369
  export {
360
- bt as C,
361
- lt as a,
362
- dt as c
370
+ yt as C,
371
+ ut as a,
372
+ mt as c
363
373
  };
364
- //# sourceMappingURL=chart-CMr3eW62.js.map
374
+ //# sourceMappingURL=chart-CpkpA74k.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"chart-CpkpA74k.js","sources":["../../src/components/chart/chart.agent.ts","../../src/components/chart/chart.tsx"],"sourcesContent":["import type { AgentAdapter } from '../../agent/types';\nimport type { ChartHandle } from './chart';\n\nexport const chartAgent: AgentAdapter<ChartHandle> = {\n id: 'chart',\n capabilities: [],\n state: {},\n actions: {\n update_series: {\n // Replacing the rendered series mutates what the chart displays — it\n // is a write, reversible by pushing the prior series back.\n safety: 'write',\n argsType: 'series',\n // `series` is `ChartSeries[]` (line/bar/area) OR `number[]`\n // (pie/donut/radialBar). Both shapes are accepted; the handle routes\n // by chart type internally.\n argsSchema: {\n type: 'object',\n properties: {\n series: {\n oneOf: [\n {\n type: 'array',\n description: 'Categorical series for line / bar / area charts.',\n items: {\n type: 'object',\n properties: {\n name: { type: 'string' },\n data: { type: 'array', items: { type: 'number' } },\n },\n required: ['name', 'data'],\n },\n },\n {\n type: 'array',\n description: 'Flat values for pie / donut / radialBar charts.',\n items: { type: 'number' },\n },\n ],\n },\n },\n required: ['series'],\n },\n idempotent: true,\n descriptionKey: 'ui.agent.chart.actions.updateSeries',\n description: 'Replace the chart series without remounting.',\n invoke: (\n handle,\n args: { series: Parameters<ChartHandle['updateSeries']>[0] },\n ) => {\n handle.updateSeries(args.series);\n },\n },\n export_png: {\n safety: 'read',\n returns: 'string (PNG data URI)',\n returnsSchema: {\n type: 'string',\n description: 'A `data:image/png;base64,…` URI of the rendered chart.',\n },\n idempotent: true,\n descriptionKey: 'ui.agent.chart.actions.exportPng',\n description:\n 'Return a PNG data URI of the chart for export or screenshotting.',\n invoke: (handle) => handle.dataURI(),\n },\n },\n domHooks: {\n root: { attr: 'data-component', value: 'chart' },\n instanceId: {\n attr: 'data-component-id',\n sourceProp: 'id',\n description: 'Sourced from the id prop.',\n },\n },\n};\n","/* ------------------------------------------------------------------ */\n/* Chart — thin, typed wrapper over ApexCharts (react-apexcharts). */\n/* */\n/* - All chrome, colours, and fonts flow from */\n/* `src/tokens/apexcharts-theme.ts` — never hex literals in user */\n/* code. A MutationObserver on `<html class>` re-reads the bridge so */\n/* theme changes repaint without remount. */\n/* - A ResizeObserver on the wrapper keeps the chart responsive */\n/* without listening on `window.resize`. */\n/* - Accessibility: the wrapper carries `role=\"img\"` + `aria-label` */\n/* (required `title` prop) + `aria-describedby` pointing at a */\n/* visually-hidden `<table>` that mirrors series × categories. */\n/* - Colour-blind users: `patterns` prop flips `fill.type` to pattern */\n/* using ApexCharts' built-in pattern presets. */\n/* - Numbers format via `Intl.NumberFormat(locale)` — no hand-rolled */\n/* `toFixed()`. */\n/* ------------------------------------------------------------------ */\n\nimport {\n forwardRef,\n useEffect,\n useId,\n useImperativeHandle,\n useMemo,\n useRef,\n useState,\n} from 'react';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { useTranslation } from 'react-i18next';\nimport ReactApexChart from 'react-apexcharts';\nimport ApexCharts from 'apexcharts';\nimport { getApexChartsTheme } from '../../tokens/apexcharts-theme';\nimport { usePrefersReducedMotion } from '../../hooks';\nimport { useNeutraliseHiddenFocus } from '../_shared/use-neutralize-hidden-focus';\nimport { useAgentRegistration } from '../../agent/registry';\nimport { chartAgent } from './chart.agent';\n\n/* ------------------------------------------------------------------ */\n/* CVA */\n/* ------------------------------------------------------------------ */\n\nconst chartVariants = cva('ds:relative ds:block ds:w-full', {\n variants: {\n density: {\n compact: 'ds:min-h-[var(--chart-min-height-compact)]',\n comfortable: 'ds:min-h-[var(--chart-min-height-comfortable)]',\n // Applied when an explicit `height` prop is given and no density was\n // requested: the wrapper must not exceed the caller's height (a 96px\n // KPI chart inside a card must not reserve 320px).\n none: '',\n },\n },\n defaultVariants: { density: 'comfortable' },\n});\n\n/* ------------------------------------------------------------------ */\n/* Public types */\n/* ------------------------------------------------------------------ */\n\nexport type ChartType = 'line' | 'bar' | 'pie' | 'donut' | 'area' | 'radialBar';\n\nexport interface ChartSeries {\n name: string;\n data: number[];\n}\n\nexport interface ChartProps extends VariantProps<typeof chartVariants> {\n /** Required — drives aria-label and sr-only table caption. */\n title: string;\n /** Opaque instance id — emitted as `data-component-id` for the agent registry. */\n id?: string;\n /** Chart visual type. */\n type: ChartType;\n /**\n * For `line` / `bar` / `area`: an array of `ChartSeries`.\n * For `pie` / `donut` / `radialBar`: an array of numbers matched to `labels`.\n */\n series: ChartSeries[] | number[];\n /** Category axis labels (line / bar / area). */\n categories?: string[];\n /** Slice labels (pie / donut / radialBar). */\n labels?: string[];\n /** Height override. Defaults to 320px. */\n height?: number | string;\n /** Width override. Defaults to 100% of container. */\n width?: number | string;\n /** Opt-in pattern fills for colour-blind users. */\n patterns?: boolean;\n /**\n * Override the series colour ramp. Pass **already-resolved** colour strings\n * (e.g. the live value of `var(--success)` sampled by the consumer) — these\n * are handed straight to ApexCharts, which can't read CSS custom properties.\n * When omitted, the theme bridge's `colors` ramp from `apexcharts-theme.ts`\n * is used, so existing consumers are unaffected. Typical use: a single-arc\n * `radialBar` gauge (e.g. BMI) that must change hue with the value —\n * green in the healthy band, amber/red outside it.\n */\n colors?: string[];\n /** Show the ApexCharts toolbar. Defaults to false. */\n toolbar?: boolean;\n /** Locale override — defaults to the active i18next language. */\n locale?: string;\n /**\n * radialBar only. Formats the value printed in the ring centre. Use when the\n * gauge represents a non-percentage figure: pass the arc fill (0–100) as the\n * single `series` value and return the real figure here (e.g. `(_, ) => '22.4'`).\n * Ignored for every other chart type. Defaults to ApexCharts' `${value}%`.\n */\n radialValueFormatter?: (value: number) => string;\n /**\n * Formats the numeric value of each data point wherever it is surfaced as\n * text — the tooltip, the value (y) axis on categorical charts, and the\n * screen-reader summary table. Use it to append a unit or currency symbol,\n * e.g. `(v) => new Intl.NumberFormat(locale, { style: 'currency', currency:\n * 'EUR' }).format(v)`. Defaults to `Intl.NumberFormat(locale)` (grouped\n * number, no unit). Does not apply to a `radialBar` ring centre — use\n * `radialValueFormatter` for that.\n */\n valueFormatter?: (value: number) => string;\n /** Extra class names on the wrapper. */\n className?: string;\n}\n\nexport interface ChartHandle {\n /** Returns a PNG data URI for the chart. */\n dataURI: () => Promise<string>;\n /** Updates series without remounting. */\n updateSeries: (next: ChartProps['series']) => void;\n}\n\n/* ------------------------------------------------------------------ */\n/* Constants */\n/* ------------------------------------------------------------------ */\n\nconst PATTERN_STYLES = [\n 'verticalLines',\n 'horizontalLines',\n 'slantedLines',\n 'squares',\n 'circles',\n] as const;\n\n/** Types where `categories` belong on an x-axis. */\nconst CATEGORICAL_TYPES: ReadonlyArray<ChartType> = ['line', 'bar', 'area'];\n\n/** Types where `series` is a flat `number[]` paired with `labels`. */\nconst SLICE_TYPES: ReadonlyArray<ChartType> = ['pie', 'donut', 'radialBar'];\n\n/* ------------------------------------------------------------------ */\n/* Helpers */\n/* ------------------------------------------------------------------ */\n\nfunction isSliceType(type: ChartType): boolean {\n return SLICE_TYPES.includes(type);\n}\n\nfunction isCategoricalType(type: ChartType): boolean {\n return CATEGORICAL_TYPES.includes(type);\n}\n\n/** Coerce `series` into `ChartSeries[]` for shared logic (table, aria). */\nfunction normaliseSeries(\n series: ChartSeries[] | number[],\n type: ChartType,\n): ChartSeries[] {\n if (isSliceType(type)) {\n const nums = series as number[];\n return [\n {\n name: '',\n data: nums,\n },\n ];\n }\n return series as ChartSeries[];\n}\n\n/* ------------------------------------------------------------------ */\n/* Chart component */\n/* ------------------------------------------------------------------ */\n\nexport const Chart = forwardRef<ChartHandle, ChartProps>(\n (\n {\n title,\n id,\n type,\n series,\n categories,\n labels,\n height,\n width,\n patterns = false,\n colors,\n toolbar = false,\n locale: localeProp,\n radialValueFormatter,\n valueFormatter,\n density,\n className,\n },\n ref,\n ) => {\n const { t, i18n } = useTranslation();\n const rawId = useId();\n const chartId = useMemo(\n () => `chart-${rawId.replace(/[^a-zA-Z0-9-_]/g, '')}`,\n [rawId],\n );\n const summaryId = `${chartId}-summary`;\n\n const wrapperRef = useRef<HTMLDivElement>(null);\n const [containerWidth, setContainerWidth] = useState(0);\n\n /* ApexCharts injects focusable canvases inside the `aria-hidden` */\n /* chart wrapper. Neutralise their tabindex so axe's */\n /* `aria-hidden-focus` rule passes. Same hook used in Sparkline. */\n useNeutraliseHiddenFocus(wrapperRef);\n\n const locale = localeProp ?? i18n.language ?? 'en';\n\n /* ---- dev warning if title missing ------------------------------ */\n if (import.meta.env.DEV && !title) {\n console.warn(\n 'Chart: `title` prop is required. It drives aria-label and the screen-reader summary table.',\n );\n }\n\n /* ---- theme-reactive state -------------------------------------- */\n const [themeOptions, setThemeOptions] = useState<ApexCharts.ApexOptions>(\n () => {\n try {\n return getApexChartsTheme();\n } catch {\n return {};\n }\n },\n );\n\n /* ---- MutationObserver: re-read theme on class change ------------ */\n useEffect(() => {\n if (typeof document === 'undefined') return undefined;\n let timer: ReturnType<typeof setTimeout>;\n const observer = new MutationObserver(() => {\n clearTimeout(timer);\n timer = setTimeout(() => {\n try {\n setThemeOptions(getApexChartsTheme());\n } catch {\n /* no-op in non-browser environments */\n }\n }, 50);\n });\n observer.observe(document.documentElement, {\n attributes: true,\n attributeFilter: ['class'],\n });\n return () => {\n clearTimeout(timer);\n observer.disconnect();\n };\n }, []);\n\n /* ---- ResizeObserver: track container width --------------------- */\n useEffect(() => {\n const el = wrapperRef.current;\n if (!el || typeof ResizeObserver === 'undefined') return undefined;\n const ro = new ResizeObserver((entries) => {\n const entry = entries[0];\n if (entry) setContainerWidth(Math.floor(entry.contentRect.width));\n });\n ro.observe(el);\n return () => ro.disconnect();\n }, []);\n\n /* ---- imperative handle ----------------------------------------- */\n const agentHandle = useMemo<ChartHandle>(\n () => ({\n async dataURI(): Promise<string> {\n const instance = ApexCharts.getChartByID(chartId);\n if (!instance) return '';\n const result = await instance.dataURI();\n return (result as { imgURI: string }).imgURI;\n },\n updateSeries(next) {\n const instance = ApexCharts.getChartByID(chartId);\n if (!instance) return;\n if (isSliceType(type)) {\n instance.updateSeries(next as number[]);\n } else {\n instance.updateSeries(next as ChartSeries[]);\n }\n },\n }),\n [chartId, type],\n );\n useImperativeHandle(ref, () => agentHandle, [agentHandle]);\n useAgentRegistration(chartAgent, agentHandle, id);\n\n /* ---- RTL detection --------------------------------------------- */\n const isRtl =\n typeof document !== 'undefined' && document.documentElement.dir === 'rtl';\n\n /* ---- normalised series for sr-only table ----------------------- */\n const tableSeries = useMemo(\n () => normaliseSeries(series, type),\n [series, type],\n );\n\n /* ---- Intl formatter -------------------------------------------- */\n const numberFormatter = useMemo(\n () => new Intl.NumberFormat(locale),\n [locale],\n );\n\n /* ---- resolved value formatter ---------------------------------- */\n /* The consumer's `valueFormatter` (e.g. a currency formatter) wins */\n /* everywhere a data-point value is surfaced as text; otherwise we */\n /* fall back to the locale-aware grouped number. */\n const formatValue = useMemo(\n () =>\n valueFormatter ?? ((value: number) => numberFormatter.format(value)),\n [valueFormatter, numberFormatter],\n );\n\n /* ---- toolbar localisation -------------------------------------- */\n const toolbarLocale = useMemo(\n () => ({\n name: locale,\n options: {\n toolbar: {\n download: t('chart.toolbar.download'),\n selection: t('chart.toolbar.selection'),\n selectionZoom: t('chart.toolbar.selectionZoom'),\n zoomIn: t('chart.toolbar.zoomIn'),\n zoomOut: t('chart.toolbar.zoomOut'),\n pan: t('chart.toolbar.pan'),\n reset: t('chart.toolbar.reset'),\n exportToSVG: t('chart.toolbar.exportToSVG'),\n exportToPNG: t('chart.toolbar.exportToPNG'),\n exportToCSV: t('chart.toolbar.exportToCSV'),\n },\n },\n }),\n [locale, t],\n );\n\n /* ---- build ApexOptions ----------------------------------------- */\n const reducedMotion = usePrefersReducedMotion();\n\n const chartOptions: ApexCharts.ApexOptions = useMemo(() => {\n const base = themeOptions;\n\n const options: ApexCharts.ApexOptions = {\n ...base,\n chart: {\n ...base.chart,\n id: chartId,\n toolbar: { show: toolbar },\n zoom: { enabled: toolbar },\n animations: {\n enabled: !reducedMotion,\n dynamicAnimation: { enabled: !reducedMotion },\n },\n locales: [toolbarLocale],\n defaultLocale: locale,\n parentHeightOffset: 0,\n },\n // Only set `labels` when the consumer actually supplied them (slice\n // charts). Emitting `labels: undefined` crashes ApexCharts' bar\n // renderer — `parseDataAxisCharts` reads `labels.length` and throws\n // \"Cannot read properties of undefined (reading 'length')\", which\n // aborts the render and leaves a blank chart. Absent is safe; area /\n // line tolerate the undefined but bar does not, so never pass it.\n ...(labels ? { labels } : {}),\n legend: {\n ...base.legend,\n position: 'bottom',\n // ApexCharts legend.horizontalAlign is a physical prop mapped internally\n // to the chart's own text flow. For RTL we flip via `yaxis.opposite`\n // and ApexCharts' own `direction: 'rtl'` handling; legend stays anchored\n // to the inline-start by asking for 'left' on LTR and 'right' on RTL.\n horizontalAlign: isRtl ? 'right' : 'left',\n fontFamily: 'inherit',\n },\n tooltip: {\n ...base.tooltip,\n y: {\n formatter: (value: number) => formatValue(value),\n },\n },\n noData: {\n text: t('chart.noData'),\n },\n };\n\n // Consumer-supplied, already-resolved colour ramp wins over the theme\n // bridge's `colors`. Ignored when absent so existing charts keep the\n // tokenised ramp. ApexCharts can't read `var(--…)`, so the consumer is\n // responsible for sampling the live token value before passing it in.\n if (colors && colors.length > 0) {\n options.colors = colors;\n }\n\n if (isCategoricalType(type)) {\n options.xaxis = {\n ...base.xaxis,\n categories: categories ?? [],\n };\n options.yaxis = {\n ...base.yaxis,\n opposite: isRtl,\n labels: {\n formatter: (value: number) => formatValue(value),\n },\n };\n options.stroke = {\n curve: 'smooth',\n width: type === 'bar' ? 0 : 2,\n };\n options.dataLabels = { enabled: false };\n }\n\n if (type === 'radialBar' && radialValueFormatter) {\n // ApexCharts treats a radialBar series value as a 0–100 percent and\n // renders it verbatim in the ring centre. When the displayed value is\n // NOT a percentage (e.g. a BMI), the consumer scales the series to a\n // percent for the arc and supplies `radialValueFormatter` to print the\n // real value in the centre. Without this, the gauge would read \"56%\"\n // for a BMI of 22.4 — misleading. Default behaviour is untouched.\n const basePlot = (base.plotOptions ?? {}) as NonNullable<\n ApexCharts.ApexOptions['plotOptions']\n >;\n options.plotOptions = {\n ...basePlot,\n radialBar: {\n ...(basePlot.radialBar ?? {}),\n dataLabels: {\n ...(basePlot.radialBar?.dataLabels ?? {}),\n value: {\n ...(basePlot.radialBar?.dataLabels?.value ?? {}),\n formatter: (val: number) => radialValueFormatter(Number(val)),\n },\n },\n },\n };\n }\n\n if (patterns) {\n options.fill = {\n type: 'pattern',\n opacity: type === 'area' ? 0.3 : 1,\n pattern: {\n style: [...PATTERN_STYLES],\n strokeWidth: 2,\n },\n };\n } else if (type === 'area') {\n options.fill = {\n type: 'gradient',\n opacity: 0.3,\n };\n }\n\n return options;\n }, [\n themeOptions,\n chartId,\n toolbar,\n reducedMotion,\n toolbarLocale,\n locale,\n labels,\n formatValue,\n t,\n type,\n categories,\n isRtl,\n patterns,\n colors,\n radialValueFormatter,\n ]);\n\n /* ---- resolved dimensions --------------------------------------- */\n const resolvedWidth =\n width ?? (containerWidth > 0 ? containerWidth : '100%');\n const resolvedHeight = height ?? 320;\n\n /* ---- sr-only data table --------------------------------------- */\n const srTable = useMemo(() => {\n const columnLabels = isSliceType(type)\n ? (labels ?? [])\n : (categories ?? []);\n const rows = tableSeries;\n return (\n <table id={summaryId} className=\"ds:sr-only\">\n <caption>{title}</caption>\n <thead>\n <tr>\n <th scope=\"col\">{t('chart.table.series')}</th>\n {columnLabels.map((col, i) => (\n <th key={`${col}-${i}`} scope=\"col\">\n {col}\n </th>\n ))}\n </tr>\n </thead>\n <tbody>\n {rows.map((row, rowIndex) => (\n <tr key={`${row.name}-${rowIndex}`}>\n <th scope=\"row\">{row.name || t('chart.table.value')}</th>\n {row.data.map((value, colIndex) => (\n <td key={`${rowIndex}-${colIndex}`}>\n {/* For a radialBar gauge the series is a synthetic arc\n percent — announce the consumer's display value (e.g.\n the real BMI) instead of the raw fill so AT users get\n the same figure sighted users see in the ring. */}\n {type === 'radialBar' && radialValueFormatter\n ? radialValueFormatter(value)\n : formatValue(value)}\n </td>\n ))}\n </tr>\n ))}\n </tbody>\n </table>\n );\n }, [\n type,\n tableSeries,\n labels,\n categories,\n summaryId,\n title,\n t,\n formatValue,\n radialValueFormatter,\n ]);\n\n /* ---- ApexCharts `series` prop shape ----------------------------- */\n const apexSeries = useMemo(() => {\n if (isSliceType(type)) {\n return series as number[];\n }\n return series as ChartSeries[];\n }, [series, type]);\n\n return (\n <div\n ref={wrapperRef}\n role=\"img\"\n aria-label={title}\n aria-describedby={summaryId}\n className={chartVariants({\n // Explicit height wins over the density min-height unless the\n // caller also asked for a density explicitly.\n density: density ?? (height !== undefined ? 'none' : undefined),\n className,\n })}\n data-component=\"chart\"\n data-component-id={id}\n >\n {srTable}\n <ReactApexChart\n type={type}\n series={apexSeries as ApexCharts.ApexOptions['series']}\n options={chartOptions}\n width={resolvedWidth}\n height={resolvedHeight}\n aria-hidden=\"true\"\n />\n </div>\n );\n },\n);\n\nChart.displayName = 'Chart';\n\n/* ------------------------------------------------------------------ */\n/* Re-export internal helper for downstream theming (kept narrow). */\n/* ------------------------------------------------------------------ */\n\nexport { chartVariants };\n"],"names":["chartAgent","handle","args","chartVariants","cva","PATTERN_STYLES","CATEGORICAL_TYPES","SLICE_TYPES","isSliceType","type","isCategoricalType","normaliseSeries","series","Chart","forwardRef","title","id","categories","labels","height","width","patterns","colors","toolbar","localeProp","radialValueFormatter","valueFormatter","density","className","ref","t","i18n","useTranslation","rawId","useId","chartId","useMemo","summaryId","wrapperRef","useRef","containerWidth","setContainerWidth","useState","useNeutraliseHiddenFocus","locale","themeOptions","setThemeOptions","getApexChartsTheme","useEffect","timer","observer","el","ro","entries","entry","agentHandle","instance","ApexCharts","next","useImperativeHandle","useAgentRegistration","isRtl","tableSeries","numberFormatter","formatValue","value","toolbarLocale","reducedMotion","usePrefersReducedMotion","chartOptions","base","options","basePlot","_a","_c","_b","val","resolvedWidth","resolvedHeight","srTable","columnLabels","rows","jsx","jsxs","col","row","rowIndex","colIndex","apexSeries","ReactApexChart"],"mappings":";;;;;;;;;AAGO,MAAMA,KAAwC;AAAA,EACnD,IAAI;AAAA,EACJ,cAAc,CAAA;AAAA,EACd,OAAO,CAAA;AAAA,EACP,SAAS;AA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AAA;AAAA,UAGvB,SAASwB,MAAYR,MAAW,SAAY,SAAS;AAAA,UACrD,WAAAS;AAAA,QAAA,CACD;AAAA,QACD,kBAAe;AAAA,QACf,qBAAmBZ;AAAA,QAElB,UAAA;AAAA,UAAA+D;AAAA,UACD,gBAAAG;AAAA,YAACO;AAAA,YAAA;AAAA,cACC,MAAAhF;AAAA,cACA,QAAQ+E;AAAA,cACR,SAASnB;AAAA,cACT,OAAOQ;AAAA,cACP,QAAQC;AAAA,cACR,eAAY;AAAA,YAAA;AAAA,UAAA;AAAA,QACd;AAAA,MAAA;AAAA,IAAA;AAAA,EAGN;AACF;AAEAjE,GAAM,cAAc;"}
@@ -3,7 +3,7 @@ import { forwardRef as $, useId as H, useMemo as I } from "react";
3
3
  import { c as B } from "./index-D2ZczOXr.js";
4
4
  import { useTranslation as G } from "react-i18next";
5
5
  import { B as K } from "./badge-DCOqV9mI.js";
6
- import { C as R } from "./card-DPmk26CL.js";
6
+ import { C as k } from "./card-DPmk26CL.js";
7
7
  import { D as d } from "./description-list-ClNLdRMy.js";
8
8
  import { K as O, a as Y } from "./key-value-pair-LHKfDT_9.js";
9
9
  import { T as j, A as te } from "./transaction-chip-DJCstquX.js";
@@ -100,7 +100,7 @@ const ue = [
100
100
  },
101
101
  defaultVariants: { surface: "elevated" }
102
102
  });
103
- function k(a, l, r) {
103
+ function R(a, l, r) {
104
104
  try {
105
105
  return new Intl.NumberFormat(r, {
106
106
  style: "currency",
@@ -200,13 +200,13 @@ const xe = $(
200
200
  value: i.operatorName
201
201
  });
202
202
  const U = I(
203
- () => n != null ? k(n, u, o) : void 0,
203
+ () => n != null ? R(n, u, o) : void 0,
204
204
  [n, u, o]
205
205
  ), _ = I(
206
- () => h != null ? k(h, u, o) : void 0,
206
+ () => h != null ? R(h, u, o) : void 0,
207
207
  [h, u, o]
208
208
  ), V = I(
209
- () => m != null ? k(m, u, o) : void 0,
209
+ () => m != null ? R(m, u, o) : void 0,
210
210
  [m, u, o]
211
211
  ), Z = U != null || _ != null || V != null, ee = !!b && b.length > 0, F = /* @__PURE__ */ c("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-md)]", children: [
212
212
  /* @__PURE__ */ c("div", { className: "ds:flex ds:items-start ds:gap-[var(--spacing-md)] ds:flex-wrap", children: [
@@ -274,7 +274,7 @@ const xe = $(
274
274
  vat: s.vatPercentage,
275
275
  defaultValue: "{{description}} (VAT {{vat}}%)"
276
276
  }) : s.description }),
277
- /* @__PURE__ */ e(d.Detail, { numeric: !0, children: k(s.amountCents, u, o) })
277
+ /* @__PURE__ */ e(d.Detail, { numeric: !0, children: R(s.amountCents, u, o) })
278
278
  ] }, `${s.description}-${ae}`))
279
279
  }
280
280
  )
@@ -297,7 +297,7 @@ const xe = $(
297
297
  id: a,
298
298
  className: ge({ surface: x, className: f }),
299
299
  ...S,
300
- children: x === "elevated" ? /* @__PURE__ */ e(R, { variant: "elevated", children: /* @__PURE__ */ e(R.Body, { children: F }) }) : /* @__PURE__ */ e("div", { className: X({ surface: "flat" }), children: F })
300
+ children: x === "elevated" ? /* @__PURE__ */ e(k, { variant: "elevated", children: /* @__PURE__ */ e(k.Body, { children: F }) }) : /* @__PURE__ */ e("div", { className: X({ surface: "flat" }), children: F })
301
301
  }
302
302
  );
303
303
  }
@@ -341,7 +341,7 @@ const Pe = {
341
341
  paid: "Paid",
342
342
  failed: "Failed",
343
343
  cancelled: "Cancelled"
344
- }, ke = B("ds:w-full ds:text-[color:var(--foreground)]", {
344
+ }, Re = B("ds:w-full ds:text-[color:var(--foreground)]", {
345
345
  variants: {
346
346
  surface: {
347
347
  flat: "",
@@ -350,7 +350,7 @@ const Pe = {
350
350
  },
351
351
  defaultVariants: { surface: "elevated" }
352
352
  });
353
- function Re(a, l) {
353
+ function ke(a, l) {
354
354
  const r = new Date(a);
355
355
  if (Number.isNaN(r.getTime())) return a;
356
356
  try {
@@ -398,7 +398,7 @@ const De = $(
398
398
  key: "dueDate",
399
399
  icon: /* @__PURE__ */ e(se, { "aria-hidden": "true" }),
400
400
  label: f("paymentRequestCard.label.dueDate", "Due date"),
401
- value: Re(v, t)
401
+ value: ke(v, t)
402
402
  }), m && g.push({
403
403
  key: "carePlan",
404
404
  icon: /* @__PURE__ */ e(Q, { "aria-hidden": "true" }),
@@ -451,18 +451,20 @@ const De = $(
451
451
  "data-component-id": a,
452
452
  "data-status": n,
453
453
  id: a,
454
- className: ke({ surface: b, className: u }),
454
+ className: Re({ surface: b, className: u }),
455
455
  ...x,
456
- children: b === "elevated" ? /* @__PURE__ */ e(R, { variant: "elevated", children: /* @__PURE__ */ e(R.Body, { children: T }) }) : /* @__PURE__ */ e("div", { className: X({ surface: "flat" }), children: T })
456
+ children: b === "elevated" ? /* @__PURE__ */ e(k, { variant: "elevated", children: /* @__PURE__ */ e(k.Body, { children: T }) }) : /* @__PURE__ */ e("div", { className: X({ surface: "flat" }), children: T })
457
457
  }
458
458
  );
459
459
  }
460
460
  );
461
461
  De.displayName = "PaymentRequestCard";
462
462
  export {
463
+ M as C,
463
464
  xe as P,
465
+ pe as R,
464
466
  De as a,
465
467
  Pe as b,
466
468
  he as p
467
469
  };
468
- //# sourceMappingURL=payment-request-card-C0fqlKqO.js.map
470
+ //# sourceMappingURL=payment-request-card-d-RmzsUd.js.map