@alfadocs/ui-kit-debug 0.82.0 → 0.83.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.
Files changed (130) hide show
  1. package/dist/_chunks/{actions-cell-renderer-DLrcSTK_.js → actions-cell-renderer-DaL80uqL.js} +2 -2
  2. package/dist/_chunks/{actions-cell-renderer-DLrcSTK_.js.map → actions-cell-renderer-DaL80uqL.js.map} +1 -1
  3. package/dist/_chunks/chart-GFLv4cXm.js +609 -0
  4. package/dist/_chunks/chart-GFLv4cXm.js.map +1 -0
  5. package/dist/_chunks/{editable-currency-cell-renderer-GwfA9tTR.js → editable-currency-cell-renderer-Dus_sBvX.js} +2 -2
  6. package/dist/_chunks/{editable-currency-cell-renderer-GwfA9tTR.js.map → editable-currency-cell-renderer-Dus_sBvX.js.map} +1 -1
  7. package/dist/_chunks/{face-scheme-C0rk21gg.js → face-scheme-CjQAHvSP.js} +2 -2
  8. package/dist/_chunks/{face-scheme-C0rk21gg.js.map → face-scheme-CjQAHvSP.js.map} +1 -1
  9. package/dist/_chunks/{file-manager-DfTG7bxx.js → file-manager-DLJlinIO.js} +3 -3
  10. package/dist/_chunks/{file-manager-DfTG7bxx.js.map → file-manager-DLJlinIO.js.map} +1 -1
  11. package/dist/_chunks/{header-settings-DMfdx0Vq.js → header-settings-CLwFqMHI.js} +2 -2
  12. package/dist/_chunks/{header-settings-DMfdx0Vq.js.map → header-settings-CLwFqMHI.js.map} +1 -1
  13. package/dist/_chunks/{icon-button-group-C_lqXTAj.js → icon-button-group-BLHPN6jg.js} +178 -163
  14. package/dist/_chunks/icon-button-group-BLHPN6jg.js.map +1 -0
  15. package/dist/_chunks/{marketplace-app-shell-Bxq1PYAj.js → marketplace-app-shell-Br2yebEK.js} +2 -2
  16. package/dist/_chunks/{marketplace-app-shell-Bxq1PYAj.js.map → marketplace-app-shell-Br2yebEK.js.map} +1 -1
  17. package/dist/_chunks/{patient-table-DweKjiXg.js → patient-table-BHzmUbzu.js} +2 -2
  18. package/dist/_chunks/{patient-table-DweKjiXg.js.map → patient-table-BHzmUbzu.js.map} +1 -1
  19. package/dist/_chunks/{theme-toggle-BJCz_UOi.js → theme-toggle-B4mOrQX1.js} +2 -2
  20. package/dist/_chunks/{theme-toggle-BJCz_UOi.js.map → theme-toggle-B4mOrQX1.js.map} +1 -1
  21. package/dist/agent-catalog.json +57 -4
  22. package/dist/agent-i18n/en.json +7 -1
  23. package/dist/components/chart/chart.agent.d.ts.map +1 -1
  24. package/dist/components/chart/chart.d.ts +36 -1
  25. package/dist/components/chart/chart.d.ts.map +1 -1
  26. package/dist/components/chart/index.js +1 -1
  27. package/dist/components/data-table/index.js +2 -2
  28. package/dist/components/face-scheme/index.js +1 -1
  29. package/dist/components/file-manager/index.js +1 -1
  30. package/dist/components/header-settings/index.js +1 -1
  31. package/dist/components/icon-button-group/icon-button-group.d.ts.map +1 -1
  32. package/dist/components/icon-button-group/index.js +1 -1
  33. package/dist/components/patient-table/index.js +1 -1
  34. package/dist/components/theme-toggle/index.js +1 -1
  35. package/dist/i18n/locales/ar.d.ts +8 -0
  36. package/dist/i18n/locales/ar.d.ts.map +1 -1
  37. package/dist/i18n/locales/ar.js +8 -0
  38. package/dist/i18n/locales/ar.js.map +1 -1
  39. package/dist/i18n/locales/de.d.ts +8 -0
  40. package/dist/i18n/locales/de.d.ts.map +1 -1
  41. package/dist/i18n/locales/de.js +8 -0
  42. package/dist/i18n/locales/de.js.map +1 -1
  43. package/dist/i18n/locales/el.d.ts +8 -0
  44. package/dist/i18n/locales/el.d.ts.map +1 -1
  45. package/dist/i18n/locales/el.js +8 -0
  46. package/dist/i18n/locales/el.js.map +1 -1
  47. package/dist/i18n/locales/en.d.ts +8 -0
  48. package/dist/i18n/locales/en.d.ts.map +1 -1
  49. package/dist/i18n/locales/en.js +8 -0
  50. package/dist/i18n/locales/en.js.map +1 -1
  51. package/dist/i18n/locales/es.d.ts +8 -0
  52. package/dist/i18n/locales/es.d.ts.map +1 -1
  53. package/dist/i18n/locales/es.js +8 -0
  54. package/dist/i18n/locales/es.js.map +1 -1
  55. package/dist/i18n/locales/fr.d.ts +8 -0
  56. package/dist/i18n/locales/fr.d.ts.map +1 -1
  57. package/dist/i18n/locales/fr.js +8 -0
  58. package/dist/i18n/locales/fr.js.map +1 -1
  59. package/dist/i18n/locales/hi.d.ts +8 -0
  60. package/dist/i18n/locales/hi.d.ts.map +1 -1
  61. package/dist/i18n/locales/hi.js +8 -0
  62. package/dist/i18n/locales/hi.js.map +1 -1
  63. package/dist/i18n/locales/it.d.ts +8 -0
  64. package/dist/i18n/locales/it.d.ts.map +1 -1
  65. package/dist/i18n/locales/it.js +8 -0
  66. package/dist/i18n/locales/it.js.map +1 -1
  67. package/dist/i18n/locales/ja.d.ts +8 -0
  68. package/dist/i18n/locales/ja.d.ts.map +1 -1
  69. package/dist/i18n/locales/ja.js +8 -0
  70. package/dist/i18n/locales/ja.js.map +1 -1
  71. package/dist/i18n/locales/nl.d.ts +8 -0
  72. package/dist/i18n/locales/nl.d.ts.map +1 -1
  73. package/dist/i18n/locales/nl.js +8 -0
  74. package/dist/i18n/locales/nl.js.map +1 -1
  75. package/dist/i18n/locales/pl.d.ts +8 -0
  76. package/dist/i18n/locales/pl.d.ts.map +1 -1
  77. package/dist/i18n/locales/pl.js +8 -0
  78. package/dist/i18n/locales/pl.js.map +1 -1
  79. package/dist/i18n/locales/pt.d.ts +8 -0
  80. package/dist/i18n/locales/pt.d.ts.map +1 -1
  81. package/dist/i18n/locales/pt.js +8 -0
  82. package/dist/i18n/locales/pt.js.map +1 -1
  83. package/dist/i18n/locales/ro.d.ts +8 -0
  84. package/dist/i18n/locales/ro.d.ts.map +1 -1
  85. package/dist/i18n/locales/ro.js +8 -0
  86. package/dist/i18n/locales/ro.js.map +1 -1
  87. package/dist/i18n/locales/ru.d.ts +8 -0
  88. package/dist/i18n/locales/ru.d.ts.map +1 -1
  89. package/dist/i18n/locales/ru.js +8 -0
  90. package/dist/i18n/locales/ru.js.map +1 -1
  91. package/dist/i18n/locales/sq.d.ts +8 -0
  92. package/dist/i18n/locales/sq.d.ts.map +1 -1
  93. package/dist/i18n/locales/sq.js +8 -0
  94. package/dist/i18n/locales/sq.js.map +1 -1
  95. package/dist/i18n/locales/sv.d.ts +8 -0
  96. package/dist/i18n/locales/sv.d.ts.map +1 -1
  97. package/dist/i18n/locales/sv.js +8 -0
  98. package/dist/i18n/locales/sv.js.map +1 -1
  99. package/dist/i18n/locales/tr.d.ts +8 -0
  100. package/dist/i18n/locales/tr.d.ts.map +1 -1
  101. package/dist/i18n/locales/tr.js +8 -0
  102. package/dist/i18n/locales/tr.js.map +1 -1
  103. package/dist/i18n/locales/zh.d.ts +8 -0
  104. package/dist/i18n/locales/zh.d.ts.map +1 -1
  105. package/dist/i18n/locales/zh.js +8 -0
  106. package/dist/i18n/locales/zh.js.map +1 -1
  107. package/dist/index.js +9 -9
  108. package/dist/locales/ar.json +8 -0
  109. package/dist/locales/de.json +8 -0
  110. package/dist/locales/el.json +8 -0
  111. package/dist/locales/en.json +8 -0
  112. package/dist/locales/es.json +8 -0
  113. package/dist/locales/fr.json +8 -0
  114. package/dist/locales/hi.json +8 -0
  115. package/dist/locales/it.json +8 -0
  116. package/dist/locales/ja.json +8 -0
  117. package/dist/locales/nl.json +8 -0
  118. package/dist/locales/pl.json +8 -0
  119. package/dist/locales/pt.json +8 -0
  120. package/dist/locales/ro.json +8 -0
  121. package/dist/locales/ru.json +8 -0
  122. package/dist/locales/sq.json +8 -0
  123. package/dist/locales/sv.json +8 -0
  124. package/dist/locales/tr.json +8 -0
  125. package/dist/locales/zh.json +8 -0
  126. package/dist/patterns/marketplace-app-shell/index.js +1 -1
  127. package/package.json +1 -1
  128. package/dist/_chunks/chart-CpkpA74k.js +0 -374
  129. package/dist/_chunks/chart-CpkpA74k.js.map +0 -1
  130. package/dist/_chunks/icon-button-group-C_lqXTAj.js.map +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"chart-GFLv4cXm.js","sources":["../../node_modules/lucide-react/dist/esm/icons/chart-area.mjs","../../node_modules/lucide-react/dist/esm/icons/chart-column.mjs","../../node_modules/lucide-react/dist/esm/icons/chart-line.mjs","../../node_modules/lucide-react/dist/esm/icons/chart-pie.mjs","../../node_modules/lucide-react/dist/esm/icons/donut.mjs","../../src/components/chart/chart.agent.ts","../../src/components/chart/chart.tsx"],"sourcesContent":["/**\n * @license lucide-react v1.22.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.mjs';\n\nconst __iconNode = [\n [\"path\", { d: \"M3 3v16a2 2 0 0 0 2 2h16\", key: \"c24i48\" }],\n [\n \"path\",\n {\n d: \"M7 11.207a.5.5 0 0 1 .146-.353l2-2a.5.5 0 0 1 .708 0l3.292 3.292a.5.5 0 0 0 .708 0l4.292-4.292a.5.5 0 0 1 .854.353V16a1 1 0 0 1-1 1H8a1 1 0 0 1-1-1z\",\n key: \"q0gr47\"\n }\n ]\n];\nconst ChartArea = createLucideIcon(\"chart-area\", __iconNode);\n\nexport { __iconNode, ChartArea as default };\n//# sourceMappingURL=chart-area.mjs.map\n","/**\n * @license lucide-react v1.22.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.mjs';\n\nconst __iconNode = [\n [\"path\", { d: \"M3 3v16a2 2 0 0 0 2 2h16\", key: \"c24i48\" }],\n [\"path\", { d: \"M18 17V9\", key: \"2bz60n\" }],\n [\"path\", { d: \"M13 17V5\", key: \"1frdt8\" }],\n [\"path\", { d: \"M8 17v-3\", key: \"17ska0\" }]\n];\nconst ChartColumn = createLucideIcon(\"chart-column\", __iconNode);\n\nexport { __iconNode, ChartColumn as default };\n//# sourceMappingURL=chart-column.mjs.map\n","/**\n * @license lucide-react v1.22.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.mjs';\n\nconst __iconNode = [\n [\"path\", { d: \"M3 3v16a2 2 0 0 0 2 2h16\", key: \"c24i48\" }],\n [\"path\", { d: \"m19 9-5 5-4-4-3 3\", key: \"2osh9i\" }]\n];\nconst ChartLine = createLucideIcon(\"chart-line\", __iconNode);\n\nexport { __iconNode, ChartLine as default };\n//# sourceMappingURL=chart-line.mjs.map\n","/**\n * @license lucide-react v1.22.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.mjs';\n\nconst __iconNode = [\n [\n \"path\",\n {\n d: \"M21 12c.552 0 1.005-.449.95-.998a10 10 0 0 0-8.953-8.951c-.55-.055-.998.398-.998.95v8a1 1 0 0 0 1 1z\",\n key: \"pzmjnu\"\n }\n ],\n [\"path\", { d: \"M21.21 15.89A10 10 0 1 1 8 2.83\", key: \"k2fpak\" }]\n];\nconst ChartPie = createLucideIcon(\"chart-pie\", __iconNode);\n\nexport { __iconNode, ChartPie as default };\n//# sourceMappingURL=chart-pie.mjs.map\n","/**\n * @license lucide-react v1.22.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.mjs';\n\nconst __iconNode = [\n [\n \"path\",\n {\n d: \"M20.5 10a2.5 2.5 0 0 1-2.4-3H18a2.95 2.95 0 0 1-2.6-4.4 10 10 0 1 0 6.3 7.1c-.3.2-.8.3-1.2.3\",\n key: \"19sr3x\"\n }\n ],\n [\"circle\", { cx: \"12\", cy: \"12\", r: \"3\", key: \"1v7zrd\" }]\n];\nconst Donut = createLucideIcon(\"donut\", __iconNode);\n\nexport { __iconNode, Donut as default };\n//# sourceMappingURL=donut.mjs.map\n","import type { AgentAdapter } from '../../agent/types';\nimport type { ChartHandle } from './chart';\n\nexport const chartAgent: AgentAdapter<ChartHandle> = {\n id: 'chart',\n // view_change backs the opt-in type switcher (`switchableTypes` prop):\n // the same chart re-presented as line / bar / area / pie / donut.\n capabilities: ['view_change'],\n state: {\n declaredType: {\n type: \"'line' | 'bar' | 'pie' | 'donut' | 'area' | 'radialBar'\",\n descriptionKey: 'ui.agent.chart.state.declaredType',\n description:\n 'The consumer-declared chart type — the shape `update_series` expects.',\n read: (handle) => handle.getTypeState().declaredType,\n },\n effectiveType: {\n type: \"'line' | 'bar' | 'pie' | 'donut' | 'area' | 'radialBar'\",\n descriptionKey: 'ui.agent.chart.state.effectiveType',\n description:\n 'The type currently rendered — differs from declaredType after a type-switcher pick.',\n read: (handle) => handle.getTypeState().effectiveType,\n },\n availableTypes: {\n type: 'ChartType[]',\n descriptionKey: 'ui.agent.chart.state.availableTypes',\n description:\n 'Types the switcher offers. Empty when the chart has no type switcher.',\n read: (handle) => handle.getTypeState().availableTypes,\n },\n },\n actions: {\n change_view: {\n // Switching the presentation is a write (it changes what the user\n // sees) but is trivially reversible by switching back.\n safety: 'write',\n argsType: 'type',\n argsSchema: {\n type: 'object',\n properties: {\n type: {\n type: 'string',\n enum: ['line', 'bar', 'area', 'pie', 'donut'],\n description: 'The chart type to render.',\n },\n },\n required: ['type'],\n },\n returns: 'boolean (accepted)',\n returnsSchema: {\n type: 'boolean',\n description:\n 'True when the switch was applied; false when the chart has no type switcher or the type is not offered (check availableTypes first).',\n },\n idempotent: true,\n descriptionKey: 'ui.agent.chart.actions.changeView',\n description:\n 'Switch the rendered chart type via the type switcher. No-op (returns false) when the chart has no switcher or the type is not offered.',\n invoke: (handle, args: { type: string }) =>\n handle.setType(args.type as Parameters<ChartHandle['setType']>[0]),\n },\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:\n 'Replace the chart series without remounting. Pass the DECLARED type’s shape (see declaredType state) — when the user has switched the view cross-shape the values are converted to the rendered shape. The write targets the live instance only: a later type switch re-reads the original props and discards it.',\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 {\n ChartArea,\n ChartColumn,\n ChartLine,\n ChartPie,\n Donut,\n} from 'lucide-react';\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';\nimport { IconButton } from '../button/icon-button';\nimport { IconButtonGroup } from '../icon-button-group';\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 /**\n * Opt-in type switcher. Pass two or more of `'line' | 'bar' | 'area' |\n * 'pie' | 'donut'` to render an icon radiogroup (an `IconButtonGroup`)\n * above the plot that lets the user flip the chart between those types.\n * `type` is the initial selection and is always offered; the user's pick\n * then sticks across re-renders (remount with a new `key` to reset it).\n * When the picked type reads the other data shape, the data adapts: axis\n * series collapse to one slice per series (that series' total) for `pie` /\n * `donut`, and slice values become a single-series axis chart with\n * `labels` as the categories. `radialBar` cannot participate — such\n * entries are ignored (DEV warning) and a `radialBar` chart never shows\n * the switcher.\n */\n switchableTypes?: ChartType[];\n /** Called when the user picks a different type via the switcher. */\n onTypeChange?: (type: ChartType) => void;\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 /**\n * Updates series without remounting. Always pass the DECLARED `type`'s\n * shape — while the user has switched the view across the axis/slice\n * boundary the values (and, for axis→slice, the slice labels) are\n * converted to the rendered shape; for slice→axis the categories stay\n * the `labels` prop, so keep the value count stable. The update writes\n * to the live ApexCharts instance only: a later type switch remounts\n * from the original props and discards it.\n */\n updateSeries: (next: ChartProps['series']) => void;\n /**\n * Switches the rendered type via the type switcher. Returns `false`\n * (no-op) when the switcher is not enabled or the type is not offered.\n */\n setType: (next: ChartType) => boolean;\n /** Declared vs rendered type plus the types the switcher offers ([] when disabled). */\n getTypeState: () => {\n declaredType: ChartType;\n effectiveType: ChartType;\n availableTypes: ChartType[];\n };\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/** Types the switcher may offer. `radialBar` is excluded — its series are\n * synthetic arc percents that cannot be re-plotted on an axis or as slices. */\nconst SWITCHABLE_TYPES: ReadonlyArray<ChartType> = [\n 'line',\n 'bar',\n 'area',\n 'pie',\n 'donut',\n];\n\ntype SwitchableType = Exclude<ChartType, 'radialBar'>;\n\n/* Static key map (not template-built) so the i18n coverage tooling can see\n every key literally. */\nconst TYPE_SWITCHER_LABEL_KEYS: Record<SwitchableType, string> = {\n line: 'chart.typeSwitcher.line',\n bar: 'chart.typeSwitcher.bar',\n area: 'chart.typeSwitcher.area',\n pie: 'chart.typeSwitcher.pie',\n donut: 'chart.typeSwitcher.donut',\n};\n\nconst TYPE_SWITCHER_ICONS: Record<SwitchableType, React.ReactNode> = {\n line: <ChartLine />,\n bar: <ChartColumn />,\n area: <ChartArea />,\n pie: <ChartPie />,\n donut: <Donut />,\n};\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 switchableTypes,\n onTypeChange,\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 /* ---- type switcher ---------------------------------------------- */\n const switcherTypes = useMemo<SwitchableType[]>(() => {\n if (!switchableTypes || switchableTypes.length === 0) return [];\n const valid = switchableTypes.filter((entry): entry is SwitchableType =>\n SWITCHABLE_TYPES.includes(entry),\n );\n if (import.meta.env.DEV && valid.length !== switchableTypes.length) {\n console.warn(\n \"Chart: `switchableTypes` accepts 'line' | 'bar' | 'area' | 'pie' | 'donut' — other entries are ignored.\",\n );\n }\n if (!SWITCHABLE_TYPES.includes(type)) {\n if (import.meta.env.DEV && valid.length > 0) {\n console.warn(\n 'Chart: the type switcher is unavailable when `type` is \"radialBar\".',\n );\n }\n return [];\n }\n const withCurrent = valid.includes(type as SwitchableType)\n ? valid\n : [type as SwitchableType, ...valid];\n return [...new Set(withCurrent)];\n }, [switchableTypes, type]);\n const switcherEnabled = switcherTypes.length >= 2;\n\n const [pickedType, setPickedType] = useState<SwitchableType | null>(null);\n const effectiveType: ChartType =\n switcherEnabled && pickedType && switcherTypes.includes(pickedType)\n ? pickedType\n : type;\n\n /* ---- data adaptation for the switcher --------------------------- */\n /* Axis and slice types read different `series` shapes. When the user */\n /* switches across that boundary the data adapts: each axis series */\n /* becomes one slice (its total across the categories), and slice */\n /* values become one axis series with `labels` as the categories. */\n /* Same-shape switches (line/bar/area, pie/donut) pass through as-is. */\n const declaredIsSlice = isSliceType(type);\n const effectiveIsSlice = isSliceType(effectiveType);\n const { effectiveSeries, effectiveCategories, effectiveLabels } =\n useMemo(() => {\n if (declaredIsSlice === effectiveIsSlice) {\n return {\n effectiveSeries: series,\n effectiveCategories: categories,\n effectiveLabels: labels,\n };\n }\n if (!declaredIsSlice) {\n const rows = series as ChartSeries[];\n const totals = rows.map((row) =>\n row.data.reduce((sum, v) => sum + v, 0),\n );\n if (import.meta.env.DEV && totals.some((v) => v < 0)) {\n console.warn(\n 'Chart: the axis→slice adaptation produced a negative series total — pie/donut cannot represent negative values. Offer only axis types in `switchableTypes` for delta-style data.',\n );\n }\n return {\n effectiveSeries: totals,\n effectiveCategories: undefined,\n effectiveLabels: rows.map((row) => row.name),\n };\n }\n const values = series as number[];\n return {\n effectiveSeries: [\n { name: t('chart.table.value'), data: values },\n ] as ChartSeries[],\n effectiveCategories: labels ?? [],\n effectiveLabels: undefined,\n };\n }, [series, categories, labels, declaredIsSlice, effectiveIsSlice, t]);\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 // Callers always pass the DECLARED type's shape. When the user has\n // switched the view across the axis/slice boundary, convert to what\n // the live instance actually renders (mirrors the render-time\n // adaptation) so the update never hits a mismatched instance.\n const declaredSlice = isSliceType(type);\n const renderedSlice = isSliceType(effectiveType);\n if (declaredSlice === renderedSlice) {\n if (declaredSlice) instance.updateSeries(next as number[]);\n else instance.updateSeries(next as ChartSeries[]);\n return;\n }\n if (!declaredSlice) {\n const rows = next as ChartSeries[];\n // Keep slice labels in step with the incoming series — without\n // this, a series-count or name change desyncs slices from the\n // labels captured at the last React render.\n instance.updateOptions(\n { labels: rows.map((row) => row.name) },\n false,\n true,\n );\n instance.updateSeries(\n rows.map((row) => row.data.reduce((sum, v) => sum + v, 0)),\n );\n return;\n }\n instance.updateSeries([\n { name: t('chart.table.value'), data: next as number[] },\n ]);\n },\n setType(next: ChartType): boolean {\n if (!switcherEnabled) return false;\n if (!switcherTypes.includes(next as SwitchableType)) return false;\n setPickedType(next as SwitchableType);\n return true;\n },\n getTypeState() {\n return {\n declaredType: type,\n effectiveType,\n availableTypes: switcherEnabled\n ? ([...switcherTypes] as ChartType[])\n : [],\n };\n },\n }),\n [chartId, type, effectiveType, t, switcherEnabled, switcherTypes],\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(effectiveSeries, effectiveType),\n [effectiveSeries, effectiveType],\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 effective type actually has 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 ...(effectiveLabels ? { labels: effectiveLabels } : {}),\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(effectiveType)) {\n options.xaxis = {\n ...base.xaxis,\n categories: effectiveCategories ?? [],\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: effectiveType === 'bar' ? 0 : 2,\n };\n options.dataLabels = { enabled: false };\n }\n\n if (effectiveType === '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: effectiveType === 'area' ? 0.3 : 1,\n pattern: {\n style: [...PATTERN_STYLES],\n strokeWidth: 2,\n },\n };\n } else if (effectiveType === '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 effectiveLabels,\n formatValue,\n t,\n effectiveType,\n effectiveCategories,\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(effectiveType)\n ? (effectiveLabels ?? [])\n : (effectiveCategories ?? []);\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 {effectiveType === 'radialBar' && radialValueFormatter\n ? radialValueFormatter(value)\n : formatValue(value)}\n </td>\n ))}\n </tr>\n ))}\n </tbody>\n </table>\n );\n }, [\n effectiveType,\n tableSeries,\n effectiveLabels,\n effectiveCategories,\n summaryId,\n title,\n t,\n formatValue,\n radialValueFormatter,\n ]);\n\n /* ---- ApexCharts `series` prop shape ----------------------------- */\n const apexSeries = useMemo(() => {\n if (isSliceType(effectiveType)) {\n return effectiveSeries as number[];\n }\n return effectiveSeries as ChartSeries[];\n }, [effectiveSeries, effectiveType]);\n\n /* `key={effectiveType}` remounts ApexCharts on a switch: its in-place\n axis↔slice type transitions are unreliable (stale internal scales),\n and a clean mount is the documented-safe path. */\n const chartRegion = (\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: switcherEnabled ? undefined : className,\n })}\n {...(switcherEnabled\n ? {}\n : { 'data-component': 'chart', 'data-component-id': id })}\n >\n {srTable}\n <ReactApexChart\n key={effectiveType}\n type={effectiveType}\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 if (!switcherEnabled) return chartRegion;\n\n /* The switcher cannot live inside the `role=\"img\"` region — that role\n makes the whole subtree presentational, which would strip the radios\n from the accessibility tree. It renders as a sibling above the plot,\n and the bounding `data-component` marker moves to this shared\n wrapper so the component boundary still encloses everything. */\n return (\n <div\n data-component=\"chart\"\n data-component-id={id}\n className={`ds:block ds:w-full ${className ?? ''}`.trim()}\n >\n <div className=\"ds:mb-[var(--spacing-xs)] ds:flex ds:justify-end\">\n <IconButtonGroup\n role=\"radiogroup\"\n mode=\"toggle-single\"\n size=\"sm\"\n aria-label={t('chart.typeSwitcher.label')}\n value={effectiveType}\n onValueChange={(next) => {\n // Guard: keyboard paths can re-commit the current value; the\n // contract is \"called when the user picks a DIFFERENT type\".\n if (next === effectiveType) return;\n setPickedType(next as SwitchableType);\n onTypeChange?.(next as ChartType);\n }}\n >\n {switcherTypes.map((entry) => (\n <IconButton\n key={entry}\n value={entry}\n // Explicit — the default (submit) would post a surrounding\n // consumer <form> on click/Space.\n type=\"button\"\n icon={TYPE_SWITCHER_ICONS[entry]}\n aria-label={t(TYPE_SWITCHER_LABEL_KEYS[entry])}\n />\n ))}\n </IconButtonGroup>\n </div>\n {chartRegion}\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":["__iconNode","ChartArea","createLucideIcon","ChartColumn","ChartLine","ChartPie","Donut","chartAgent","handle","args","chartVariants","cva","PATTERN_STYLES","CATEGORICAL_TYPES","SLICE_TYPES","SWITCHABLE_TYPES","TYPE_SWITCHER_LABEL_KEYS","TYPE_SWITCHER_ICONS","isSliceType","type","isCategoricalType","normaliseSeries","series","Chart","forwardRef","title","id","categories","labels","height","width","patterns","colors","toolbar","localeProp","radialValueFormatter","valueFormatter","switchableTypes","onTypeChange","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","switcherTypes","valid","withCurrent","switcherEnabled","pickedType","setPickedType","effectiveType","declaredIsSlice","effectiveIsSlice","effectiveSeries","effectiveCategories","effectiveLabels","rows","row","sum","v","values","agentHandle","instance","ApexCharts","next","declaredSlice","renderedSlice","useImperativeHandle","useAgentRegistration","isRtl","tableSeries","numberFormatter","formatValue","value","toolbarLocale","reducedMotion","usePrefersReducedMotion","chartOptions","base","options","basePlot","_a","_c","_b","val","resolvedWidth","resolvedHeight","srTable","columnLabels","jsx","jsxs","col","i","rowIndex","colIndex","apexSeries","chartRegion","ReactApexChart","IconButtonGroup","IconButton"],"mappings":";;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AASA,MAAMA,KAAa;AAAA,EACjB,CAAC,QAAQ,EAAE,GAAG,4BAA4B,KAAK,SAAQ,CAAE;AAAA,EACzD;AAAA,IACE;AAAA,IACA;AAAA,MACE,GAAG;AAAA,MACH,KAAK;AAAA,IACX;AAAA,EACA;AACA,GACMC,KAAYC,EAAiB,cAAcF,EAAU;ACnB3D;AAAA;AAAA;AAAA;AAAA;AAAA;AASA,MAAMA,KAAa;AAAA,EACjB,CAAC,QAAQ,EAAE,GAAG,4BAA4B,KAAK,SAAQ,CAAE;AAAA,EACzD,CAAC,QAAQ,EAAE,GAAG,YAAY,KAAK,SAAQ,CAAE;A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ACR,eAAY;AAAA,YAAA;AAAA,YANPpC;AAAA,UAAA;AAAA,QAOP;AAAA,MAAA;AAAA,IAAA;AAIJ,WAAKH,IAQH,gBAAA2C;AAAA,MAAC;AAAA,MAAA;AAAA,QACC,kBAAe;AAAA,QACf,qBAAmBvF;AAAA,QACnB,WAAW,sBAAsBc,KAAa,EAAE,GAAG,KAAA;AAAA,QAEnD,UAAA;AAAA,UAAA,gBAAAwE,EAAC,OAAA,EAAI,WAAU,oDACb,UAAA,gBAAAA;AAAA,YAACS;AAAA,YAAA;AAAA,cACC,MAAK;AAAA,cACL,MAAK;AAAA,cACL,MAAK;AAAA,cACL,cAAY/E,EAAE,0BAA0B;AAAA,cACxC,OAAO+B;AAAA,cACP,eAAe,CAACc,MAAS;AAGvB,gBAAIA,MAASd,MACbD,EAAce,CAAsB,GACpCjD,KAAA,QAAAA,EAAeiD;AAAA,cACjB;AAAA,cAEC,UAAApB,EAAc,IAAI,CAACD,MAClB,gBAAA8C;AAAA,gBAACU;AAAA,gBAAA;AAAA,kBAEC,OAAOxD;AAAA,kBAGP,MAAK;AAAA,kBACL,MAAMjD,GAAoBiD,CAAK;AAAA,kBAC/B,cAAYxB,EAAE1B,GAAyBkD,CAAK,CAAC;AAAA,gBAAA;AAAA,gBANxCA;AAAA,cAAA,CAQR;AAAA,YAAA;AAAA,UAAA,GAEL;AAAA,UACCqD;AAAA,QAAA;AAAA,MAAA;AAAA,IAAA,IAzCwBA;AAAA,EA4C/B;AACF;AAEAhG,GAAM,cAAc;","x_google_ignoreList":[0,1,2,3,4]}
@@ -3,7 +3,7 @@ import { jsx as l, jsxs as L } from "react/jsx-runtime";
3
3
  import { T as V } from "./tag-3wgkwwDB.js";
4
4
  import { useTranslation as x } from "react-i18next";
5
5
  import { I as z } from "./icon-button-C_kbcd7I.js";
6
- import { I as $ } from "./icon-button-group-C_lqXTAj.js";
6
+ import { I as $ } from "./icon-button-group-BLHPN6jg.js";
7
7
  import { c as D } from "./createLucideIcon-DhHxpK9K.js";
8
8
  import { S as H } from "./square-check-big-dj0o8yA3.js";
9
9
  import { S as q } from "./square-DASBRZ0U.js";
@@ -407,4 +407,4 @@ export {
407
407
  ve as r,
408
408
  be as u
409
409
  };
410
- //# sourceMappingURL=editable-currency-cell-renderer-GwfA9tTR.js.map
410
+ //# sourceMappingURL=editable-currency-cell-renderer-Dus_sBvX.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"editable-currency-cell-renderer-GwfA9tTR.js","sources":["../../node_modules/lucide-react/dist/esm/icons/arrow-down.mjs","../../node_modules/lucide-react/dist/esm/icons/arrow-up.mjs","../../src/components/data-table/hooks/use-total-row.ts","../../src/components/data-table/cell-renderers/tooth-cell-renderer.tsx","../../src/components/data-table/cell-renderers/reorder-cell-renderer.tsx","../../src/components/data-table/cell-renderers/toggle-cell-renderer.tsx","../../src/components/data-table/cell-renderers/color-dot-cell-renderer.tsx","../../src/components/data-table/cell-renderers/balance-cell-renderer.tsx","../../src/components/data-table/cell-renderers/editable-text-cell-renderer.tsx","../../src/components/data-table/cell-renderers/editable-currency-cell-renderer.tsx"],"sourcesContent":["/**\n * @license lucide-react v1.22.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.mjs';\n\nconst __iconNode = [\n [\"path\", { d: \"M12 5v14\", key: \"s699le\" }],\n [\"path\", { d: \"m19 12-7 7-7-7\", key: \"1idqje\" }]\n];\nconst ArrowDown = createLucideIcon(\"arrow-down\", __iconNode);\n\nexport { __iconNode, ArrowDown as default };\n//# sourceMappingURL=arrow-down.mjs.map\n","/**\n * @license lucide-react v1.22.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.mjs';\n\nconst __iconNode = [\n [\"path\", { d: \"m5 12 7-7 7 7\", key: \"hav0vg\" }],\n [\"path\", { d: \"M12 19V5\", key: \"x0mq9r\" }]\n];\nconst ArrowUp = createLucideIcon(\"arrow-up\", __iconNode);\n\nexport { __iconNode, ArrowUp as default };\n//# sourceMappingURL=arrow-up.mjs.map\n","import { useMemo } from 'react';\n\n/**\n * Compute a pinned total row from a dataset and a list of numeric fields.\n *\n * The returned object is structurally a `TData` with non-summed fields left\n * `undefined` — plug it into `pinnedBottomRowData={[totalRow]}`. Cell renderers\n * in the non-summed columns receive `undefined`, so they should render nothing\n * (all of the DS cell renderers short-circuit on `null`/`undefined`).\n *\n * Pass an optional `labelField` + `labelValue` to show a static caption such\n * as \"Total\" in the first column of the pinned row.\n */\nexport function useTotalRow<TData>(\n rowData: TData[] | undefined,\n sumFields: Array<keyof TData & string>,\n options?: {\n labelField?: keyof TData & string;\n labelValue?: string;\n },\n): TData {\n return useMemo(() => {\n const row: Record<string, unknown> = {};\n\n for (const field of sumFields) {\n let total = 0;\n for (const r of rowData ?? []) {\n const raw = (r as Record<string, unknown>)[field];\n const n = typeof raw === 'number' ? raw : Number(raw);\n if (Number.isFinite(n)) total += n;\n }\n row[field] = total;\n }\n\n if (options?.labelField && options.labelValue !== undefined) {\n row[options.labelField] = options.labelValue;\n }\n\n return row as TData;\n }, [rowData, sumFields, options?.labelField, options?.labelValue]);\n}\n","import type { CustomCellRendererProps } from 'ag-grid-react';\nimport { Tag } from '../../tag/tag';\n\n// Tooth glyph — lucide ships no dental icon, so this is a small inline tooth\n// (a crown narrowing to two roots) tinted with `currentColor`, so it inherits\n// the Tag's text colour. Decorative; the FDI numbers are the accessible label.\nfunction ToothIcon() {\n return (\n <svg\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth={1.75}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n aria-hidden=\"true\"\n className=\"ds:size-3.5\"\n >\n <path d=\"M12 5.5c-1.074 -1.426 -2.45 -2.2 -4 -2c-2.5 .323 -3.7 2.5 -3.5 5c.1 1.5 .5 3 .5 4.5c0 1.5 .5 3.5 1 5c.3 .9 .5 2 1.5 2s1.3 -1.5 1.5 -2.5c.2 -1 .5 -2 1.5 -2s1.3 1 1.5 2c.2 1 .5 2.5 1.5 2.5s1.2 -1.1 1.5 -2c.5 -1.5 1 -3.5 1 -5c0 -1.5 .4 -3 .5 -4.5c.2 -2.5 -1 -4.677 -3.5 -5c-1.55 -.2 -2.926 .574 -4 2z\" />\n </svg>\n );\n}\n\nexport interface ToothCellRendererParams {\n /** Max inline size of the chip before its label truncates (with a tooltip). */\n maxInlineSize?: string;\n}\n\n/**\n * Renders an array of tooth ids (FDI notation) as a single outlined Tag — the\n * teeth comma-separated and prefixed with a tooth glyph, so dentition reads at\n * a glance instead of as bare numbers.\n */\nexport function ToothCellRenderer(\n props: CustomCellRendererProps<unknown, string[]> & ToothCellRendererParams,\n) {\n const { value, maxInlineSize = '8rem' } = props;\n if (!Array.isArray(value) || value.length === 0) return null;\n\n return (\n <Tag\n label={value.join(', ')}\n size=\"sm\"\n fill=\"outline\"\n leading={<ToothIcon />}\n maxInlineSize={maxInlineSize}\n />\n );\n}\n","import type { CustomCellRendererProps } from 'ag-grid-react';\nimport { useTranslation } from 'react-i18next';\nimport { ArrowUp, ArrowDown } from 'lucide-react';\nimport { IconButton } from '../../button/icon-button';\nimport { IconButtonGroup } from '../../icon-button-group';\n\n/**\n * Keyboard-accessible row-reorder cell. AG Grid's native row dragging is\n * mouse/touch only; this renderer adds move-up / move-down buttons so the order\n * is reachable by keyboard too (the missing accessible half of the\n * \"drag-sortable column\" primitive). The consumer owns `rowData` order and\n * reorders it in `onMove` — the same controlled contract as the editable cells.\n */\nexport interface ReorderCellRendererParams<TData = unknown> {\n /** Move the row one step in the given direction (consumer reorders rowData). */\n onMove: (data: TData, direction: 'up' | 'down') => void;\n /** Accessible name for the move-up button (defaults to a kit string). */\n moveUpLabel?: string;\n /** Accessible name for the move-down button (defaults to a kit string). */\n moveDownLabel?: string;\n /** Button intent (default `ghost`). */\n intent?: 'ghost' | 'outline';\n /** Render the two buttons as a connected `IconButtonGroup` (default true). */\n group?: boolean;\n /**\n * Disable move-up on the first displayed row and move-down on the last\n * (default true). Turn off when the grid is filtered/sorted and the ends are\n * not meaningful.\n */\n disableAtEnds?: boolean;\n}\n\n/**\n * Pixel width a reorder column needs for the two `sm` IconButtons (32px each)\n * plus the data-table cell's inline padding so the controls never clip. Mirrors\n * {@link actionsColumnWidth}.\n */\nexport function reorderColumnWidth(): number {\n const SM_BUTTON = 32;\n const CELL_INSET = 26;\n return SM_BUTTON * 2 + CELL_INSET;\n}\n\nexport function ReorderCellRenderer<TData = unknown>(\n props: CustomCellRendererProps<TData> & ReorderCellRendererParams<TData>,\n) {\n const {\n data,\n node,\n api,\n onMove,\n moveUpLabel,\n moveDownLabel,\n intent = 'ghost',\n group = true,\n disableAtEnds = true,\n } = props;\n const { t } = useTranslation();\n if (!data) return null;\n\n const rowIndex = node.rowIndex ?? -1;\n const lastIndex = api.getDisplayedRowCount() - 1;\n const atFirst = disableAtEnds && rowIndex <= 0;\n const atLast = disableAtEnds && rowIndex >= lastIndex;\n\n const upLabel = moveUpLabel ?? t('dataTable.moveUp', 'Move up');\n const downLabel = moveDownLabel ?? t('dataTable.moveDown', 'Move down');\n\n // An ARRAY of IconButtons (not a Fragment): IconButtonGroup inspects its\n // direct children and rejects anything that isn't a DS IconButton.\n const buttons = [\n <IconButton\n key=\"up\"\n size=\"sm\"\n intent={intent}\n icon={<ArrowUp aria-hidden className=\"ds:size-4\" />}\n tooltip={upLabel}\n aria-label={upLabel}\n disabled={atFirst}\n onClick={(event) => {\n event.stopPropagation();\n onMove(data, 'up');\n }}\n />,\n <IconButton\n key=\"down\"\n size=\"sm\"\n intent={intent}\n icon={<ArrowDown aria-hidden className=\"ds:size-4\" />}\n tooltip={downLabel}\n aria-label={downLabel}\n disabled={atLast}\n onClick={(event) => {\n event.stopPropagation();\n onMove(data, 'down');\n }}\n />,\n ];\n\n return group ? (\n <IconButtonGroup\n aria-label={t('dataTable.reorder', 'Reorder row')}\n size=\"sm\"\n >\n {buttons}\n </IconButtonGroup>\n ) : (\n <span className=\"ds:inline-flex ds:items-center ds:gap-[var(--spacing-xs)]\">\n {buttons}\n </span>\n );\n}\n","import { useState, type ReactNode } from 'react';\nimport type { CustomCellRendererProps } from 'ag-grid-react';\nimport { CheckSquare, Square } from 'lucide-react';\nimport { useTranslation } from 'react-i18next';\n\nexport interface ToggleCellRendererParams<TData = unknown> {\n /**\n * Fires with the row and the new target value. May return a `Promise` —\n * if it rejects, the consumer is expected to revert the underlying value\n * and flash the row with `data-table-row-error` (return that row class\n * from `getRowClass`). Use `onError` below to be notified inside this\n * renderer.\n */\n onToggle: (data: TData, newValue: boolean) => void | Promise<void>;\n /**\n * Optional reject hook. Fires when the `onToggle` promise rejects, with\n * the row and the error. The button auto-disables during the in-flight\n * promise and re-enables on either settle.\n */\n onError?: (data: TData, error: unknown) => void;\n /** Icon shown when the current value is truthy. */\n trueIcon?: ReactNode;\n /** Icon shown when the current value is falsy. */\n falseIcon?: ReactNode;\n /** Extra classes applied to the \"on\" icon — defaults to success token. */\n trueClass?: string;\n /** Extra classes applied to the \"off\" icon. */\n falseClass?: string;\n /** Accessible label. Falls back to the default on/off announcements. */\n label?: string;\n}\n\nexport function ToggleCellRenderer<TData = unknown>(\n props: CustomCellRendererProps<TData, boolean> &\n ToggleCellRendererParams<TData>,\n) {\n const {\n value,\n data,\n onToggle,\n onError,\n trueIcon,\n falseIcon,\n trueClass = 'ds:text-[color:var(--success)]',\n falseClass = 'ds:text-[color:var(--muted-foreground)]',\n label,\n } = props;\n const { t } = useTranslation();\n const [pending, setPending] = useState(false);\n if (!data) return null;\n\n const isOn = Boolean(value);\n const icon = isOn\n ? (trueIcon ?? <CheckSquare aria-hidden className=\"ds:size-4\" />)\n : (falseIcon ?? <Square aria-hidden className=\"ds:size-4\" />);\n const stateClass = isOn ? trueClass : falseClass;\n const resolvedLabel =\n label ?? (isOn ? t('inputs.switch.on') : t('inputs.switch.off'));\n\n async function handleClick(event: React.MouseEvent) {\n event.stopPropagation();\n if (pending || !data) return;\n const next = !isOn;\n const result = onToggle(data, next);\n if (result && typeof (result as Promise<void>).then === 'function') {\n setPending(true);\n try {\n await result;\n } catch (err) {\n onError?.(data, err);\n } finally {\n setPending(false);\n }\n }\n }\n\n return (\n <button\n type=\"button\"\n role=\"switch\"\n aria-checked={isOn}\n aria-busy={pending}\n aria-label={resolvedLabel}\n disabled={pending}\n onClick={handleClick}\n className={[\n 'ds:inline-flex ds:items-center ds:justify-center',\n 'ds:min-h-[var(--min-target-size)] ds:min-w-[var(--min-target-size)]',\n 'ds:appearance-none ds:bg-transparent ds:p-[var(--spacing-xs)]',\n 'ds:rounded-[var(--radius-sm)]',\n 'ds:focus-visible:outline-[length:var(--focus-ring-width)]',\n 'ds:focus-visible:outline-solid',\n 'ds:focus-visible:outline-[color:var(--ring)]',\n 'ds:focus-visible:outline-offset-[length:var(--focus-ring-offset)]',\n 'ds:disabled:opacity-50',\n stateClass,\n ].join(' ')}\n >\n {icon}\n </button>\n );\n}\n","import { useRef } from 'react';\nimport type { CustomCellRendererProps } from 'ag-grid-react';\nimport { useIsomorphicLayoutEffect } from '../../../hooks/use-isomorphic-layout-effect';\n\nexport interface ColorDotCellRendererParams {\n /** Field name on the row whose value holds the hex color. */\n colorField: string;\n /** Visual size of the dot. */\n size?: 'sm' | 'md' | 'lg';\n /** Optional label shown next to the dot. */\n labelField?: string;\n}\n\nconst SIZE_CLASS: Record<\n NonNullable<ColorDotCellRendererParams['size']>,\n string\n> = {\n sm: 'ds:size-[var(--icon-size-sm)]',\n md: 'ds:size-[var(--icon-size-md)]',\n lg: 'ds:size-[var(--icon-size-lg)]',\n};\n\nfunction readField(row: unknown, field: string): string | undefined {\n if (!row || typeof row !== 'object') return undefined;\n const value = (row as Record<string, unknown>)[field];\n return typeof value === 'string' ? value : undefined;\n}\n\n// Only accept trusted CSS color forms. Anything outside this allow-list\n// (including smuggled `url()` or extra declarations) is dropped so the\n// CSS custom-property writer can't be used to inject styles.\nconst HEX_RE = /^#(?:[0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})$/i;\nconst RGB_RE = /^rgba?\\(\\s*[\\d.\\s,%/]+\\)$/i;\nconst HSL_RE = /^hsla?\\(\\s*[\\d.\\s,%/]+\\)$/i;\nconst CSS_VAR_RE = /^var\\(--[a-z0-9-]+(?:,\\s*[^)]+)?\\)$/i;\n\nfunction sanitizeColor(raw: string | undefined): string | undefined {\n if (!raw) return undefined;\n const v = raw.trim();\n if (\n HEX_RE.test(v) ||\n RGB_RE.test(v) ||\n HSL_RE.test(v) ||\n CSS_VAR_RE.test(v)\n ) {\n return v;\n }\n return undefined;\n}\n\nexport function ColorDotCellRenderer<TData = unknown>(\n props: CustomCellRendererProps<TData> & ColorDotCellRendererParams,\n) {\n const { data, colorField, size = 'md', labelField } = props;\n const dotRef = useRef<HTMLSpanElement | null>(null);\n const rawColor = data ? readField(data, colorField) : undefined;\n const color = sanitizeColor(rawColor);\n const label = data && labelField ? readField(data, labelField) : undefined;\n\n // Apply the dynamic color via a CSS custom property on the element.\n // Keeps hex/rgb literals out of JSX (constraint #2 and #4). The data\n // itself drives the color — constraints only forbid hardcoded colors\n // in component source, not in consumer row data.\n useIsomorphicLayoutEffect(() => {\n const el = dotRef.current;\n if (!el) return;\n if (color) {\n el.style.setProperty('--data-table-dot-color', color);\n } else {\n el.style.removeProperty('--data-table-dot-color');\n }\n }, [color]);\n\n if (!color) return null;\n\n return (\n <span className=\"ds:inline-flex ds:items-center ds:gap-[var(--spacing-sm)]\">\n <span\n ref={dotRef}\n aria-hidden=\"true\"\n className={[\n 'ds:inline-block ds:shrink-0 ds:rounded-[var(--radius-full)]',\n 'ds:bg-[var(--data-table-dot-color)]',\n 'ds:border ds:border-[color:var(--border)]',\n SIZE_CLASS[size],\n ].join(' ')}\n />\n {label ? <span>{label}</span> : null}\n </span>\n );\n}\n","import type { ColDef } from 'ag-grid-community';\nimport type { CustomCellRendererProps } from 'ag-grid-react';\nimport { useTranslation } from 'react-i18next';\n\nexport interface BalanceLine {\n /** User-visible label for this line. */\n label: string;\n /** Field name on the row whose numeric value is rendered. */\n valueField: string;\n /** `'currency'` renders via Intl, `'percent'` appends `%`, `'number'` raw. Default `'number'`. */\n format?: 'currency' | 'percent' | 'number';\n}\n\nexport interface BalanceCellRendererParams {\n lines: BalanceLine[];\n /** ISO 4217 code, used by `currency`-formatted lines. Default `'EUR'`. */\n currency?: string;\n /** Apply destructive color to negative values. */\n highlightNegative?: boolean;\n}\n\nfunction readNumber(row: unknown, field: string): number | null {\n if (!row || typeof row !== 'object') return null;\n const raw = (row as Record<string, unknown>)[field];\n const n = typeof raw === 'number' ? raw : Number(raw);\n return Number.isFinite(n) ? n : null;\n}\n\n/**\n * Renders a compact set of label / value pairs inside a single AG Grid cell.\n *\n * Layout is **horizontal** with middle-dot separators so the cell fits\n * inside the default AG Grid row height without spilling into the row\n * below. Use the SALDI / Listini patterns (Totale · Incassato · Da Incassare)\n * as the canonical example.\n *\n * If a consumer's content wraps (long localized labels, narrow columns)\n * they can opt into row auto-growth by spreading\n * {@link balanceCellRendererColDefDefaults} onto the column definition.\n */\nexport function BalanceCellRenderer<TData = unknown>(\n props: CustomCellRendererProps<TData> & BalanceCellRendererParams,\n) {\n const { data, lines, currency = 'EUR', highlightNegative } = props;\n const { i18n } = useTranslation();\n if (!data) return null;\n\n const locale = i18n.language || 'en';\n\n const formatLine = (\n line: BalanceLine,\n ): { label: string; formatted: string; negative: boolean } | null => {\n const n = readNumber(data, line.valueField);\n if (n === null) return null;\n\n let formatted: string;\n switch (line.format ?? 'number') {\n case 'currency':\n formatted = new Intl.NumberFormat(locale, {\n style: 'currency',\n currency,\n }).format(n);\n break;\n case 'percent':\n formatted = new Intl.NumberFormat(locale, {\n style: 'percent',\n maximumFractionDigits: 1,\n }).format(n / 100);\n break;\n default:\n formatted = new Intl.NumberFormat(locale).format(n);\n }\n\n return {\n label: line.label,\n formatted,\n negative: Boolean(highlightNegative) && n < 0,\n };\n };\n\n const rendered = lines\n .map(formatLine)\n .filter(\n (x): x is { label: string; formatted: string; negative: boolean } =>\n x !== null,\n );\n if (rendered.length === 0) return null;\n\n return (\n <div\n className={[\n 'ds:flex',\n 'ds:flex-wrap',\n 'ds:items-center',\n 'ds:gap-x-[var(--spacing-sm)]',\n 'ds:gap-y-0',\n 'type-meta',\n 'ds:leading-tight',\n ].join(' ')}\n >\n {rendered.map((item, idx) => (\n <span\n key={`${item.label}-${idx}`}\n className=\"ds:inline-flex ds:items-baseline ds:gap-x-[var(--spacing-xs)]\"\n >\n {idx > 0 ? (\n <span\n aria-hidden=\"true\"\n className=\"ds:me-[var(--spacing-xs)] ds:text-[color:var(--muted-foreground)]\"\n >\n ·\n </span>\n ) : null}\n <span className=\"ds:text-[color:var(--muted-foreground)]\">\n {item.label}\n </span>\n <span\n className={[\n 'ds:tabular-nums',\n 'ds:font-medium',\n item.negative ? 'ds:text-[color:var(--destructive)]' : '',\n ]\n .filter(Boolean)\n .join(' ')}\n >\n {item.formatted}\n </span>\n </span>\n ))}\n </div>\n );\n}\n\n/**\n * Column-definition defaults consumers can spread onto a `ColDef` when they\n * want the renderer's wrapped / multi-line behaviour to grow the row.\n *\n * The default compact horizontal layout is engineered to fit the standard\n * AG Grid row height, so this opt-in is only needed when a long label set\n * wraps across two or more lines and the consumer would rather grow the\n * row than wrap silently.\n *\n * AG Grid does NOT auto-grow row height to fit a tall cell unless\n * `autoHeight` and `wrapText` are set on the colDef itself — a cell\n * renderer can't impose that from inside.\n *\n * @example\n * ```ts\n * {\n * headerName: 'Saldi',\n * cellRenderer: BalanceCellRenderer,\n * cellRendererParams: { lines, currency: 'EUR' },\n * ...balanceCellRendererColDefDefaults,\n * }\n * ```\n */\nexport const balanceCellRendererColDefDefaults: Readonly<\n Pick<ColDef, 'autoHeight' | 'wrapText'>\n> = {\n autoHeight: true,\n wrapText: true,\n};\n","import { useEffect, useRef, useState } from 'react';\nimport type { CustomCellEditorProps } from 'ag-grid-react';\nimport {\n INPUT_SURFACE_CHROME,\n INPUT_SURFACE_HEIGHT,\n INPUT_SURFACE_PADDING_X,\n INPUT_SURFACE_TEXT,\n} from '../../_shared/input-surface';\n\n/**\n * Inline text editor that visually matches `<TextInput size=\"sm\">`. Use as\n * `cellEditor` on a colDef with `editable: true`. The cell renderer (default\n * or custom) takes over again once editing stops.\n *\n * AG Grid commits on Enter or Tab or blur; cancels on Escape. The consumer\n * receives the committed value via `onCellValueChanged`.\n */\nexport function EditableTextCellRenderer<TData = unknown>(\n props: CustomCellEditorProps<TData, string>,\n) {\n const { initialValue, onValueChange, stopEditing, column } = props;\n const [value, setValue] = useState<string>(initialValue ?? '');\n const inputRef = useRef<HTMLInputElement | null>(null);\n\n // Focus + select on mount so typing replaces the current value.\n useEffect(() => {\n const el = inputRef.current;\n if (!el) return;\n el.focus();\n el.select();\n }, []);\n\n // The current value is pushed to AG Grid via `onValueChange` on every\n // keystroke — AG Grid commits the most recent value when editing stops.\n // No `useGridCellEditor` hook needed for that contract.\n\n // Thread the column header into the input's accessible name so screen\n // readers announce \"Edit text, {column}\" instead of an unlabelled input.\n // AG Grid doesn't auto-wire the column header to cell editors.\n const headerName =\n (column?.getColDef?.()?.headerName as string | undefined) ?? undefined;\n\n return (\n <input\n ref={inputRef}\n type=\"text\"\n value={value}\n aria-label={headerName}\n onChange={(e) => {\n const next = e.target.value;\n setValue(next);\n onValueChange(next);\n }}\n onKeyDown={(e) => {\n // Escape cancels, Enter/Tab commit — AG Grid handles both, but we\n // explicitly stop editing on Enter so the consumer sees the commit\n // immediately rather than waiting for the next focus blur.\n if (e.key === 'Enter') {\n e.preventDefault();\n stopEditing();\n }\n }}\n className={[\n 'ds:block ds:w-full ds:appearance-none',\n // Input surface chrome: rounded border + bg + focus halo.\n INPUT_SURFACE_CHROME,\n // Use the `md` height (`--min-target-size`) so the input\n // auto-lifts to 48px under `.theme-accessible` to satisfy\n // WCAG 2.5.5 target size.\n INPUT_SURFACE_HEIGHT.md,\n INPUT_SURFACE_TEXT.sm,\n INPUT_SURFACE_PADDING_X.sm,\n ].join(' ')}\n />\n );\n}\n","import { useEffect, useRef, useState } from 'react';\nimport type { CustomCellEditorProps } from 'ag-grid-react';\nimport { useTranslation } from 'react-i18next';\nimport {\n INPUT_SURFACE_CHROME,\n INPUT_SURFACE_HEIGHT,\n INPUT_SURFACE_PADDING_X,\n INPUT_SURFACE_TEXT,\n} from '../../_shared/input-surface';\n\nexport interface EditableCurrencyCellEditorParams {\n /** ISO 4217 currency code (e.g. `EUR`, `USD`). Defaults to `EUR`. */\n currency?: string;\n /** Decimal places allowed in the editor. Defaults to 2 (cents precision). */\n decimals?: number;\n /** Minimum allowed value — values below this are clamped on commit. */\n min?: number;\n /** Maximum allowed value — values above this are clamped on commit. */\n max?: number;\n}\n\n/**\n * Inline numeric editor that visually matches `<TextInput size=\"sm\">`. Use as\n * `cellEditor` on a colDef with `editable: true`. The display formatting is\n * still the renderer's job — once editing stops, the cell hands back to\n * `CurrencyCellRenderer` (or whichever renderer the colDef declares).\n *\n * Stores a Number, not a string, so consumers receive `row.amount = 12.5`\n * not `\"12.5\"`. Strips locale separators on each change so commas/dots in\n * any language convert to a clean numeric value.\n */\nexport function EditableCurrencyCellRenderer<TData = unknown>(\n props: CustomCellEditorProps<TData, number> &\n EditableCurrencyCellEditorParams,\n) {\n const {\n initialValue,\n onValueChange,\n stopEditing,\n column,\n decimals = 2,\n min,\n max,\n } = props;\n const { i18n } = useTranslation();\n const inputRef = useRef<HTMLInputElement | null>(null);\n // Thread the column header into the input's accessible name — see\n // editable-text-cell-renderer.tsx for the rationale.\n const headerName =\n (column?.getColDef?.()?.headerName as string | undefined) ?? undefined;\n\n // Local string state so the user can type intermediate values like \"12.\"\n // before the trailing zero arrives. We commit a Number to AG Grid on each\n // change for consumers that watch row state live; the final commit fires\n // when editing stops.\n const [draft, setDraft] = useState<string>(() => {\n if (initialValue == null || Number.isNaN(initialValue)) return '';\n return String(initialValue);\n });\n\n useEffect(() => {\n const el = inputRef.current;\n if (!el) return;\n el.focus();\n el.select();\n }, []);\n\n function parseDraft(input: string): number | null {\n if (input.trim().length === 0) return null;\n // Accept either the user's locale decimal separator or a `.`. Strip\n // grouping characters (locale thousands separators, plus spaces).\n const lang = i18n.language || 'en';\n const partsFmt = new Intl.NumberFormat(lang).formatToParts(12345.6);\n const groupChar = partsFmt.find((p) => p.type === 'group')?.value ?? '';\n const decimalChar =\n partsFmt.find((p) => p.type === 'decimal')?.value ?? '.';\n const cleaned = input\n .replace(new RegExp(`\\\\${groupChar}`, 'g'), '')\n .replace(decimalChar, '.')\n .replace(/[^\\d.-]/g, '');\n const n = Number(cleaned);\n return Number.isFinite(n) ? n : null;\n }\n\n function commit(input: string) {\n const parsed = parseDraft(input);\n if (parsed == null) {\n onValueChange(null);\n return;\n }\n // Clamp first, then round to the declared precision so we never\n // persist floating-point dust from string parsing.\n let clamped = parsed;\n if (typeof min === 'number') clamped = Math.max(min, clamped);\n if (typeof max === 'number') clamped = Math.min(max, clamped);\n const factor = 10 ** decimals;\n onValueChange(Math.round(clamped * factor) / factor);\n }\n\n return (\n <input\n ref={inputRef}\n type=\"text\"\n // Inputmode hints mobile keyboards to show the decimal pad instead\n // of the full keyboard. type=\"number\" would also work but spinners\n // and locale parsing are inconsistent across browsers.\n inputMode=\"decimal\"\n value={draft}\n aria-label={headerName}\n onChange={(e) => {\n const next = e.target.value;\n setDraft(next);\n commit(next);\n }}\n onKeyDown={(e) => {\n if (e.key === 'Enter') {\n e.preventDefault();\n stopEditing();\n }\n // Escape — AG Grid cancels by default; the editor doesn't need\n // explicit handling beyond what AG Grid wires automatically.\n }}\n className={[\n 'ds:block ds:w-full ds:appearance-none ds:text-end ds:tabular-nums',\n INPUT_SURFACE_CHROME,\n // Use `md` height — see editable-text-cell-renderer for rationale.\n INPUT_SURFACE_HEIGHT.md,\n INPUT_SURFACE_TEXT.sm,\n INPUT_SURFACE_PADDING_X.sm,\n ].join(' ')}\n />\n );\n}\n"],"names":["__iconNode","ArrowDown","createLucideIcon","ArrowUp","useTotalRow","rowData","sumFields","options","useMemo","row","field","total","r","raw","n","ToothIcon","jsx","ToothCellRenderer","props","value","maxInlineSize","Tag","reorderColumnWidth","ReorderCellRenderer","data","node","api","onMove","moveUpLabel","moveDownLabel","intent","group","disableAtEnds","t","useTranslation","rowIndex","lastIndex","atFirst","atLast","upLabel","downLabel","buttons","IconButton","event","IconButtonGroup","ToggleCellRenderer","onToggle","onError","trueIcon","falseIcon","trueClass","falseClass","label","pending","setPending","useState","isOn","icon","CheckSquare","Square","stateClass","resolvedLabel","handleClick","result","err","SIZE_CLASS","readField","HEX_RE","RGB_RE","HSL_RE","CSS_VAR_RE","sanitizeColor","v","ColorDotCellRenderer","colorField","size","labelField","dotRef","useRef","rawColor","color","useIsomorphicLayoutEffect","el","jsxs","readNumber","BalanceCellRenderer","lines","currency","highlightNegative","i18n","locale","formatLine","line","formatted","rendered","x","item","idx","EditableTextCellRenderer","initialValue","onValueChange","stopEditing","column","setValue","inputRef","useEffect","headerName","_b","_a","e","next","INPUT_SURFACE_CHROME","INPUT_SURFACE_HEIGHT","INPUT_SURFACE_TEXT","INPUT_SURFACE_PADDING_X","EditableCurrencyCellRenderer","decimals","min","max","draft","setDraft","parseDraft","input","lang","partsFmt","groupChar","p","decimalChar","cleaned","commit","parsed","clamped","factor"],"mappings":";;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AASA,MAAMA,IAAa;AAAA,EACjB,CAAC,QAAQ,EAAE,GAAG,YAAY,KAAK,SAAQ,CAAE;AAAA,EACzC,CAAC,QAAQ,EAAE,GAAG,kBAAkB,KAAK,SAAQ,CAAE;AACjD,GACMC,IAAYC,EAAiB,cAAcF,CAAU;ACb3D;AAAA;AAAA;AAAA;AAAA;AAAA;AASA,MAAMA,IAAa;AAAA,EACjB,CAAC,QAAQ,EAAE,GAAG,iBAAiB,KAAK,SAAQ,CAAE;AAAA,EAC9C,CAAC,QAAQ,EAAE,GAAG,Y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A,GAAKc,CAAO,IACxD,OAAOb,KAAQ,iBAAoB,KAAK,IAAIA,GAAKa,CAAO;AAC5D,UAAMC,IAAS,MAAMhB;AACrB,IAAAhB,EAAc,KAAK,MAAM+B,IAAUC,CAAM,IAAIA,CAAM;AAAA,EACrD;AAEA,SACE,gBAAApH;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,KAAKwF;AAAA,MACL,MAAK;AAAA,MAIL,WAAU;AAAA,MACV,OAAOe;AAAA,MACP,cAAYb;AAAA,MACZ,UAAU,CAACG,MAAM;AACf,cAAMC,IAAOD,EAAE,OAAO;AACtB,QAAAW,EAASV,CAAI,GACbmB,EAAOnB,CAAI;AAAA,MACb;AAAA,MACA,WAAW,CAACD,MAAM;AAChB,QAAIA,EAAE,QAAQ,YACZA,EAAE,eAAA,GACFR,EAAA;AAAA,MAIJ;AAAA,MACA,WAAW;AAAA,QACT;AAAA,QACAU;AAAA;AAAA,QAEAC,EAAqB;AAAA,QACrBC,EAAmB;AAAA,QACnBC,EAAwB;AAAA,MAAA,EACxB,KAAK,GAAG;AAAA,IAAA;AAAA,EAAA;AAGhB;","x_google_ignoreList":[0,1]}
1
+ {"version":3,"file":"editable-currency-cell-renderer-Dus_sBvX.js","sources":["../../node_modules/lucide-react/dist/esm/icons/arrow-down.mjs","../../node_modules/lucide-react/dist/esm/icons/arrow-up.mjs","../../src/components/data-table/hooks/use-total-row.ts","../../src/components/data-table/cell-renderers/tooth-cell-renderer.tsx","../../src/components/data-table/cell-renderers/reorder-cell-renderer.tsx","../../src/components/data-table/cell-renderers/toggle-cell-renderer.tsx","../../src/components/data-table/cell-renderers/color-dot-cell-renderer.tsx","../../src/components/data-table/cell-renderers/balance-cell-renderer.tsx","../../src/components/data-table/cell-renderers/editable-text-cell-renderer.tsx","../../src/components/data-table/cell-renderers/editable-currency-cell-renderer.tsx"],"sourcesContent":["/**\n * @license lucide-react v1.22.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.mjs';\n\nconst __iconNode = [\n [\"path\", { d: \"M12 5v14\", key: \"s699le\" }],\n [\"path\", { d: \"m19 12-7 7-7-7\", key: \"1idqje\" }]\n];\nconst ArrowDown = createLucideIcon(\"arrow-down\", __iconNode);\n\nexport { __iconNode, ArrowDown as default };\n//# sourceMappingURL=arrow-down.mjs.map\n","/**\n * @license lucide-react v1.22.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.mjs';\n\nconst __iconNode = [\n [\"path\", { d: \"m5 12 7-7 7 7\", key: \"hav0vg\" }],\n [\"path\", { d: \"M12 19V5\", key: \"x0mq9r\" }]\n];\nconst ArrowUp = createLucideIcon(\"arrow-up\", __iconNode);\n\nexport { __iconNode, ArrowUp as default };\n//# sourceMappingURL=arrow-up.mjs.map\n","import { useMemo } from 'react';\n\n/**\n * Compute a pinned total row from a dataset and a list of numeric fields.\n *\n * The returned object is structurally a `TData` with non-summed fields left\n * `undefined` — plug it into `pinnedBottomRowData={[totalRow]}`. Cell renderers\n * in the non-summed columns receive `undefined`, so they should render nothing\n * (all of the DS cell renderers short-circuit on `null`/`undefined`).\n *\n * Pass an optional `labelField` + `labelValue` to show a static caption such\n * as \"Total\" in the first column of the pinned row.\n */\nexport function useTotalRow<TData>(\n rowData: TData[] | undefined,\n sumFields: Array<keyof TData & string>,\n options?: {\n labelField?: keyof TData & string;\n labelValue?: string;\n },\n): TData {\n return useMemo(() => {\n const row: Record<string, unknown> = {};\n\n for (const field of sumFields) {\n let total = 0;\n for (const r of rowData ?? []) {\n const raw = (r as Record<string, unknown>)[field];\n const n = typeof raw === 'number' ? raw : Number(raw);\n if (Number.isFinite(n)) total += n;\n }\n row[field] = total;\n }\n\n if (options?.labelField && options.labelValue !== undefined) {\n row[options.labelField] = options.labelValue;\n }\n\n return row as TData;\n }, [rowData, sumFields, options?.labelField, options?.labelValue]);\n}\n","import type { CustomCellRendererProps } from 'ag-grid-react';\nimport { Tag } from '../../tag/tag';\n\n// Tooth glyph — lucide ships no dental icon, so this is a small inline tooth\n// (a crown narrowing to two roots) tinted with `currentColor`, so it inherits\n// the Tag's text colour. Decorative; the FDI numbers are the accessible label.\nfunction ToothIcon() {\n return (\n <svg\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth={1.75}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n aria-hidden=\"true\"\n className=\"ds:size-3.5\"\n >\n <path d=\"M12 5.5c-1.074 -1.426 -2.45 -2.2 -4 -2c-2.5 .323 -3.7 2.5 -3.5 5c.1 1.5 .5 3 .5 4.5c0 1.5 .5 3.5 1 5c.3 .9 .5 2 1.5 2s1.3 -1.5 1.5 -2.5c.2 -1 .5 -2 1.5 -2s1.3 1 1.5 2c.2 1 .5 2.5 1.5 2.5s1.2 -1.1 1.5 -2c.5 -1.5 1 -3.5 1 -5c0 -1.5 .4 -3 .5 -4.5c.2 -2.5 -1 -4.677 -3.5 -5c-1.55 -.2 -2.926 .574 -4 2z\" />\n </svg>\n );\n}\n\nexport interface ToothCellRendererParams {\n /** Max inline size of the chip before its label truncates (with a tooltip). */\n maxInlineSize?: string;\n}\n\n/**\n * Renders an array of tooth ids (FDI notation) as a single outlined Tag — the\n * teeth comma-separated and prefixed with a tooth glyph, so dentition reads at\n * a glance instead of as bare numbers.\n */\nexport function ToothCellRenderer(\n props: CustomCellRendererProps<unknown, string[]> & ToothCellRendererParams,\n) {\n const { value, maxInlineSize = '8rem' } = props;\n if (!Array.isArray(value) || value.length === 0) return null;\n\n return (\n <Tag\n label={value.join(', ')}\n size=\"sm\"\n fill=\"outline\"\n leading={<ToothIcon />}\n maxInlineSize={maxInlineSize}\n />\n );\n}\n","import type { CustomCellRendererProps } from 'ag-grid-react';\nimport { useTranslation } from 'react-i18next';\nimport { ArrowUp, ArrowDown } from 'lucide-react';\nimport { IconButton } from '../../button/icon-button';\nimport { IconButtonGroup } from '../../icon-button-group';\n\n/**\n * Keyboard-accessible row-reorder cell. AG Grid's native row dragging is\n * mouse/touch only; this renderer adds move-up / move-down buttons so the order\n * is reachable by keyboard too (the missing accessible half of the\n * \"drag-sortable column\" primitive). The consumer owns `rowData` order and\n * reorders it in `onMove` — the same controlled contract as the editable cells.\n */\nexport interface ReorderCellRendererParams<TData = unknown> {\n /** Move the row one step in the given direction (consumer reorders rowData). */\n onMove: (data: TData, direction: 'up' | 'down') => void;\n /** Accessible name for the move-up button (defaults to a kit string). */\n moveUpLabel?: string;\n /** Accessible name for the move-down button (defaults to a kit string). */\n moveDownLabel?: string;\n /** Button intent (default `ghost`). */\n intent?: 'ghost' | 'outline';\n /** Render the two buttons as a connected `IconButtonGroup` (default true). */\n group?: boolean;\n /**\n * Disable move-up on the first displayed row and move-down on the last\n * (default true). Turn off when the grid is filtered/sorted and the ends are\n * not meaningful.\n */\n disableAtEnds?: boolean;\n}\n\n/**\n * Pixel width a reorder column needs for the two `sm` IconButtons (32px each)\n * plus the data-table cell's inline padding so the controls never clip. Mirrors\n * {@link actionsColumnWidth}.\n */\nexport function reorderColumnWidth(): number {\n const SM_BUTTON = 32;\n const CELL_INSET = 26;\n return SM_BUTTON * 2 + CELL_INSET;\n}\n\nexport function ReorderCellRenderer<TData = unknown>(\n props: CustomCellRendererProps<TData> & ReorderCellRendererParams<TData>,\n) {\n const {\n data,\n node,\n api,\n onMove,\n moveUpLabel,\n moveDownLabel,\n intent = 'ghost',\n group = true,\n disableAtEnds = true,\n } = props;\n const { t } = useTranslation();\n if (!data) return null;\n\n const rowIndex = node.rowIndex ?? -1;\n const lastIndex = api.getDisplayedRowCount() - 1;\n const atFirst = disableAtEnds && rowIndex <= 0;\n const atLast = disableAtEnds && rowIndex >= lastIndex;\n\n const upLabel = moveUpLabel ?? t('dataTable.moveUp', 'Move up');\n const downLabel = moveDownLabel ?? t('dataTable.moveDown', 'Move down');\n\n // An ARRAY of IconButtons (not a Fragment): IconButtonGroup inspects its\n // direct children and rejects anything that isn't a DS IconButton.\n const buttons = [\n <IconButton\n key=\"up\"\n size=\"sm\"\n intent={intent}\n icon={<ArrowUp aria-hidden className=\"ds:size-4\" />}\n tooltip={upLabel}\n aria-label={upLabel}\n disabled={atFirst}\n onClick={(event) => {\n event.stopPropagation();\n onMove(data, 'up');\n }}\n />,\n <IconButton\n key=\"down\"\n size=\"sm\"\n intent={intent}\n icon={<ArrowDown aria-hidden className=\"ds:size-4\" />}\n tooltip={downLabel}\n aria-label={downLabel}\n disabled={atLast}\n onClick={(event) => {\n event.stopPropagation();\n onMove(data, 'down');\n }}\n />,\n ];\n\n return group ? (\n <IconButtonGroup\n aria-label={t('dataTable.reorder', 'Reorder row')}\n size=\"sm\"\n >\n {buttons}\n </IconButtonGroup>\n ) : (\n <span className=\"ds:inline-flex ds:items-center ds:gap-[var(--spacing-xs)]\">\n {buttons}\n </span>\n );\n}\n","import { useState, type ReactNode } from 'react';\nimport type { CustomCellRendererProps } from 'ag-grid-react';\nimport { CheckSquare, Square } from 'lucide-react';\nimport { useTranslation } from 'react-i18next';\n\nexport interface ToggleCellRendererParams<TData = unknown> {\n /**\n * Fires with the row and the new target value. May return a `Promise` —\n * if it rejects, the consumer is expected to revert the underlying value\n * and flash the row with `data-table-row-error` (return that row class\n * from `getRowClass`). Use `onError` below to be notified inside this\n * renderer.\n */\n onToggle: (data: TData, newValue: boolean) => void | Promise<void>;\n /**\n * Optional reject hook. Fires when the `onToggle` promise rejects, with\n * the row and the error. The button auto-disables during the in-flight\n * promise and re-enables on either settle.\n */\n onError?: (data: TData, error: unknown) => void;\n /** Icon shown when the current value is truthy. */\n trueIcon?: ReactNode;\n /** Icon shown when the current value is falsy. */\n falseIcon?: ReactNode;\n /** Extra classes applied to the \"on\" icon — defaults to success token. */\n trueClass?: string;\n /** Extra classes applied to the \"off\" icon. */\n falseClass?: string;\n /** Accessible label. Falls back to the default on/off announcements. */\n label?: string;\n}\n\nexport function ToggleCellRenderer<TData = unknown>(\n props: CustomCellRendererProps<TData, boolean> &\n ToggleCellRendererParams<TData>,\n) {\n const {\n value,\n data,\n onToggle,\n onError,\n trueIcon,\n falseIcon,\n trueClass = 'ds:text-[color:var(--success)]',\n falseClass = 'ds:text-[color:var(--muted-foreground)]',\n label,\n } = props;\n const { t } = useTranslation();\n const [pending, setPending] = useState(false);\n if (!data) return null;\n\n const isOn = Boolean(value);\n const icon = isOn\n ? (trueIcon ?? <CheckSquare aria-hidden className=\"ds:size-4\" />)\n : (falseIcon ?? <Square aria-hidden className=\"ds:size-4\" />);\n const stateClass = isOn ? trueClass : falseClass;\n const resolvedLabel =\n label ?? (isOn ? t('inputs.switch.on') : t('inputs.switch.off'));\n\n async function handleClick(event: React.MouseEvent) {\n event.stopPropagation();\n if (pending || !data) return;\n const next = !isOn;\n const result = onToggle(data, next);\n if (result && typeof (result as Promise<void>).then === 'function') {\n setPending(true);\n try {\n await result;\n } catch (err) {\n onError?.(data, err);\n } finally {\n setPending(false);\n }\n }\n }\n\n return (\n <button\n type=\"button\"\n role=\"switch\"\n aria-checked={isOn}\n aria-busy={pending}\n aria-label={resolvedLabel}\n disabled={pending}\n onClick={handleClick}\n className={[\n 'ds:inline-flex ds:items-center ds:justify-center',\n 'ds:min-h-[var(--min-target-size)] ds:min-w-[var(--min-target-size)]',\n 'ds:appearance-none ds:bg-transparent ds:p-[var(--spacing-xs)]',\n 'ds:rounded-[var(--radius-sm)]',\n 'ds:focus-visible:outline-[length:var(--focus-ring-width)]',\n 'ds:focus-visible:outline-solid',\n 'ds:focus-visible:outline-[color:var(--ring)]',\n 'ds:focus-visible:outline-offset-[length:var(--focus-ring-offset)]',\n 'ds:disabled:opacity-50',\n stateClass,\n ].join(' ')}\n >\n {icon}\n </button>\n );\n}\n","import { useRef } from 'react';\nimport type { CustomCellRendererProps } from 'ag-grid-react';\nimport { useIsomorphicLayoutEffect } from '../../../hooks/use-isomorphic-layout-effect';\n\nexport interface ColorDotCellRendererParams {\n /** Field name on the row whose value holds the hex color. */\n colorField: string;\n /** Visual size of the dot. */\n size?: 'sm' | 'md' | 'lg';\n /** Optional label shown next to the dot. */\n labelField?: string;\n}\n\nconst SIZE_CLASS: Record<\n NonNullable<ColorDotCellRendererParams['size']>,\n string\n> = {\n sm: 'ds:size-[var(--icon-size-sm)]',\n md: 'ds:size-[var(--icon-size-md)]',\n lg: 'ds:size-[var(--icon-size-lg)]',\n};\n\nfunction readField(row: unknown, field: string): string | undefined {\n if (!row || typeof row !== 'object') return undefined;\n const value = (row as Record<string, unknown>)[field];\n return typeof value === 'string' ? value : undefined;\n}\n\n// Only accept trusted CSS color forms. Anything outside this allow-list\n// (including smuggled `url()` or extra declarations) is dropped so the\n// CSS custom-property writer can't be used to inject styles.\nconst HEX_RE = /^#(?:[0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})$/i;\nconst RGB_RE = /^rgba?\\(\\s*[\\d.\\s,%/]+\\)$/i;\nconst HSL_RE = /^hsla?\\(\\s*[\\d.\\s,%/]+\\)$/i;\nconst CSS_VAR_RE = /^var\\(--[a-z0-9-]+(?:,\\s*[^)]+)?\\)$/i;\n\nfunction sanitizeColor(raw: string | undefined): string | undefined {\n if (!raw) return undefined;\n const v = raw.trim();\n if (\n HEX_RE.test(v) ||\n RGB_RE.test(v) ||\n HSL_RE.test(v) ||\n CSS_VAR_RE.test(v)\n ) {\n return v;\n }\n return undefined;\n}\n\nexport function ColorDotCellRenderer<TData = unknown>(\n props: CustomCellRendererProps<TData> & ColorDotCellRendererParams,\n) {\n const { data, colorField, size = 'md', labelField } = props;\n const dotRef = useRef<HTMLSpanElement | null>(null);\n const rawColor = data ? readField(data, colorField) : undefined;\n const color = sanitizeColor(rawColor);\n const label = data && labelField ? readField(data, labelField) : undefined;\n\n // Apply the dynamic color via a CSS custom property on the element.\n // Keeps hex/rgb literals out of JSX (constraint #2 and #4). The data\n // itself drives the color — constraints only forbid hardcoded colors\n // in component source, not in consumer row data.\n useIsomorphicLayoutEffect(() => {\n const el = dotRef.current;\n if (!el) return;\n if (color) {\n el.style.setProperty('--data-table-dot-color', color);\n } else {\n el.style.removeProperty('--data-table-dot-color');\n }\n }, [color]);\n\n if (!color) return null;\n\n return (\n <span className=\"ds:inline-flex ds:items-center ds:gap-[var(--spacing-sm)]\">\n <span\n ref={dotRef}\n aria-hidden=\"true\"\n className={[\n 'ds:inline-block ds:shrink-0 ds:rounded-[var(--radius-full)]',\n 'ds:bg-[var(--data-table-dot-color)]',\n 'ds:border ds:border-[color:var(--border)]',\n SIZE_CLASS[size],\n ].join(' ')}\n />\n {label ? <span>{label}</span> : null}\n </span>\n );\n}\n","import type { ColDef } from 'ag-grid-community';\nimport type { CustomCellRendererProps } from 'ag-grid-react';\nimport { useTranslation } from 'react-i18next';\n\nexport interface BalanceLine {\n /** User-visible label for this line. */\n label: string;\n /** Field name on the row whose numeric value is rendered. */\n valueField: string;\n /** `'currency'` renders via Intl, `'percent'` appends `%`, `'number'` raw. Default `'number'`. */\n format?: 'currency' | 'percent' | 'number';\n}\n\nexport interface BalanceCellRendererParams {\n lines: BalanceLine[];\n /** ISO 4217 code, used by `currency`-formatted lines. Default `'EUR'`. */\n currency?: string;\n /** Apply destructive color to negative values. */\n highlightNegative?: boolean;\n}\n\nfunction readNumber(row: unknown, field: string): number | null {\n if (!row || typeof row !== 'object') return null;\n const raw = (row as Record<string, unknown>)[field];\n const n = typeof raw === 'number' ? raw : Number(raw);\n return Number.isFinite(n) ? n : null;\n}\n\n/**\n * Renders a compact set of label / value pairs inside a single AG Grid cell.\n *\n * Layout is **horizontal** with middle-dot separators so the cell fits\n * inside the default AG Grid row height without spilling into the row\n * below. Use the SALDI / Listini patterns (Totale · Incassato · Da Incassare)\n * as the canonical example.\n *\n * If a consumer's content wraps (long localized labels, narrow columns)\n * they can opt into row auto-growth by spreading\n * {@link balanceCellRendererColDefDefaults} onto the column definition.\n */\nexport function BalanceCellRenderer<TData = unknown>(\n props: CustomCellRendererProps<TData> & BalanceCellRendererParams,\n) {\n const { data, lines, currency = 'EUR', highlightNegative } = props;\n const { i18n } = useTranslation();\n if (!data) return null;\n\n const locale = i18n.language || 'en';\n\n const formatLine = (\n line: BalanceLine,\n ): { label: string; formatted: string; negative: boolean } | null => {\n const n = readNumber(data, line.valueField);\n if (n === null) return null;\n\n let formatted: string;\n switch (line.format ?? 'number') {\n case 'currency':\n formatted = new Intl.NumberFormat(locale, {\n style: 'currency',\n currency,\n }).format(n);\n break;\n case 'percent':\n formatted = new Intl.NumberFormat(locale, {\n style: 'percent',\n maximumFractionDigits: 1,\n }).format(n / 100);\n break;\n default:\n formatted = new Intl.NumberFormat(locale).format(n);\n }\n\n return {\n label: line.label,\n formatted,\n negative: Boolean(highlightNegative) && n < 0,\n };\n };\n\n const rendered = lines\n .map(formatLine)\n .filter(\n (x): x is { label: string; formatted: string; negative: boolean } =>\n x !== null,\n );\n if (rendered.length === 0) return null;\n\n return (\n <div\n className={[\n 'ds:flex',\n 'ds:flex-wrap',\n 'ds:items-center',\n 'ds:gap-x-[var(--spacing-sm)]',\n 'ds:gap-y-0',\n 'type-meta',\n 'ds:leading-tight',\n ].join(' ')}\n >\n {rendered.map((item, idx) => (\n <span\n key={`${item.label}-${idx}`}\n className=\"ds:inline-flex ds:items-baseline ds:gap-x-[var(--spacing-xs)]\"\n >\n {idx > 0 ? (\n <span\n aria-hidden=\"true\"\n className=\"ds:me-[var(--spacing-xs)] ds:text-[color:var(--muted-foreground)]\"\n >\n ·\n </span>\n ) : null}\n <span className=\"ds:text-[color:var(--muted-foreground)]\">\n {item.label}\n </span>\n <span\n className={[\n 'ds:tabular-nums',\n 'ds:font-medium',\n item.negative ? 'ds:text-[color:var(--destructive)]' : '',\n ]\n .filter(Boolean)\n .join(' ')}\n >\n {item.formatted}\n </span>\n </span>\n ))}\n </div>\n );\n}\n\n/**\n * Column-definition defaults consumers can spread onto a `ColDef` when they\n * want the renderer's wrapped / multi-line behaviour to grow the row.\n *\n * The default compact horizontal layout is engineered to fit the standard\n * AG Grid row height, so this opt-in is only needed when a long label set\n * wraps across two or more lines and the consumer would rather grow the\n * row than wrap silently.\n *\n * AG Grid does NOT auto-grow row height to fit a tall cell unless\n * `autoHeight` and `wrapText` are set on the colDef itself — a cell\n * renderer can't impose that from inside.\n *\n * @example\n * ```ts\n * {\n * headerName: 'Saldi',\n * cellRenderer: BalanceCellRenderer,\n * cellRendererParams: { lines, currency: 'EUR' },\n * ...balanceCellRendererColDefDefaults,\n * }\n * ```\n */\nexport const balanceCellRendererColDefDefaults: Readonly<\n Pick<ColDef, 'autoHeight' | 'wrapText'>\n> = {\n autoHeight: true,\n wrapText: true,\n};\n","import { useEffect, useRef, useState } from 'react';\nimport type { CustomCellEditorProps } from 'ag-grid-react';\nimport {\n INPUT_SURFACE_CHROME,\n INPUT_SURFACE_HEIGHT,\n INPUT_SURFACE_PADDING_X,\n INPUT_SURFACE_TEXT,\n} from '../../_shared/input-surface';\n\n/**\n * Inline text editor that visually matches `<TextInput size=\"sm\">`. Use as\n * `cellEditor` on a colDef with `editable: true`. The cell renderer (default\n * or custom) takes over again once editing stops.\n *\n * AG Grid commits on Enter or Tab or blur; cancels on Escape. The consumer\n * receives the committed value via `onCellValueChanged`.\n */\nexport function EditableTextCellRenderer<TData = unknown>(\n props: CustomCellEditorProps<TData, string>,\n) {\n const { initialValue, onValueChange, stopEditing, column } = props;\n const [value, setValue] = useState<string>(initialValue ?? '');\n const inputRef = useRef<HTMLInputElement | null>(null);\n\n // Focus + select on mount so typing replaces the current value.\n useEffect(() => {\n const el = inputRef.current;\n if (!el) return;\n el.focus();\n el.select();\n }, []);\n\n // The current value is pushed to AG Grid via `onValueChange` on every\n // keystroke — AG Grid commits the most recent value when editing stops.\n // No `useGridCellEditor` hook needed for that contract.\n\n // Thread the column header into the input's accessible name so screen\n // readers announce \"Edit text, {column}\" instead of an unlabelled input.\n // AG Grid doesn't auto-wire the column header to cell editors.\n const headerName =\n (column?.getColDef?.()?.headerName as string | undefined) ?? undefined;\n\n return (\n <input\n ref={inputRef}\n type=\"text\"\n value={value}\n aria-label={headerName}\n onChange={(e) => {\n const next = e.target.value;\n setValue(next);\n onValueChange(next);\n }}\n onKeyDown={(e) => {\n // Escape cancels, Enter/Tab commit — AG Grid handles both, but we\n // explicitly stop editing on Enter so the consumer sees the commit\n // immediately rather than waiting for the next focus blur.\n if (e.key === 'Enter') {\n e.preventDefault();\n stopEditing();\n }\n }}\n className={[\n 'ds:block ds:w-full ds:appearance-none',\n // Input surface chrome: rounded border + bg + focus halo.\n INPUT_SURFACE_CHROME,\n // Use the `md` height (`--min-target-size`) so the input\n // auto-lifts to 48px under `.theme-accessible` to satisfy\n // WCAG 2.5.5 target size.\n INPUT_SURFACE_HEIGHT.md,\n INPUT_SURFACE_TEXT.sm,\n INPUT_SURFACE_PADDING_X.sm,\n ].join(' ')}\n />\n );\n}\n","import { useEffect, useRef, useState } from 'react';\nimport type { CustomCellEditorProps } from 'ag-grid-react';\nimport { useTranslation } from 'react-i18next';\nimport {\n INPUT_SURFACE_CHROME,\n INPUT_SURFACE_HEIGHT,\n INPUT_SURFACE_PADDING_X,\n INPUT_SURFACE_TEXT,\n} from '../../_shared/input-surface';\n\nexport interface EditableCurrencyCellEditorParams {\n /** ISO 4217 currency code (e.g. `EUR`, `USD`). Defaults to `EUR`. */\n currency?: string;\n /** Decimal places allowed in the editor. Defaults to 2 (cents precision). */\n decimals?: number;\n /** Minimum allowed value — values below this are clamped on commit. */\n min?: number;\n /** Maximum allowed value — values above this are clamped on commit. */\n max?: number;\n}\n\n/**\n * Inline numeric editor that visually matches `<TextInput size=\"sm\">`. Use as\n * `cellEditor` on a colDef with `editable: true`. The display formatting is\n * still the renderer's job — once editing stops, the cell hands back to\n * `CurrencyCellRenderer` (or whichever renderer the colDef declares).\n *\n * Stores a Number, not a string, so consumers receive `row.amount = 12.5`\n * not `\"12.5\"`. Strips locale separators on each change so commas/dots in\n * any language convert to a clean numeric value.\n */\nexport function EditableCurrencyCellRenderer<TData = unknown>(\n props: CustomCellEditorProps<TData, number> &\n EditableCurrencyCellEditorParams,\n) {\n const {\n initialValue,\n onValueChange,\n stopEditing,\n column,\n decimals = 2,\n min,\n max,\n } = props;\n const { i18n } = useTranslation();\n const inputRef = useRef<HTMLInputElement | null>(null);\n // Thread the column header into the input's accessible name — see\n // editable-text-cell-renderer.tsx for the rationale.\n const headerName =\n (column?.getColDef?.()?.headerName as string | undefined) ?? undefined;\n\n // Local string state so the user can type intermediate values like \"12.\"\n // before the trailing zero arrives. We commit a Number to AG Grid on each\n // change for consumers that watch row state live; the final commit fires\n // when editing stops.\n const [draft, setDraft] = useState<string>(() => {\n if (initialValue == null || Number.isNaN(initialValue)) return '';\n return String(initialValue);\n });\n\n useEffect(() => {\n const el = inputRef.current;\n if (!el) return;\n el.focus();\n el.select();\n }, []);\n\n function parseDraft(input: string): number | null {\n if (input.trim().length === 0) return null;\n // Accept either the user's locale decimal separator or a `.`. Strip\n // grouping characters (locale thousands separators, plus spaces).\n const lang = i18n.language || 'en';\n const partsFmt = new Intl.NumberFormat(lang).formatToParts(12345.6);\n const groupChar = partsFmt.find((p) => p.type === 'group')?.value ?? '';\n const decimalChar =\n partsFmt.find((p) => p.type === 'decimal')?.value ?? '.';\n const cleaned = input\n .replace(new RegExp(`\\\\${groupChar}`, 'g'), '')\n .replace(decimalChar, '.')\n .replace(/[^\\d.-]/g, '');\n const n = Number(cleaned);\n return Number.isFinite(n) ? n : null;\n }\n\n function commit(input: string) {\n const parsed = parseDraft(input);\n if (parsed == null) {\n onValueChange(null);\n return;\n }\n // Clamp first, then round to the declared precision so we never\n // persist floating-point dust from string parsing.\n let clamped = parsed;\n if (typeof min === 'number') clamped = Math.max(min, clamped);\n if (typeof max === 'number') clamped = Math.min(max, clamped);\n const factor = 10 ** decimals;\n onValueChange(Math.round(clamped * factor) / factor);\n }\n\n return (\n <input\n ref={inputRef}\n type=\"text\"\n // Inputmode hints mobile keyboards to show the decimal pad instead\n // of the full keyboard. type=\"number\" would also work but spinners\n // and locale parsing are inconsistent across browsers.\n inputMode=\"decimal\"\n value={draft}\n aria-label={headerName}\n onChange={(e) => {\n const next = e.target.value;\n setDraft(next);\n commit(next);\n }}\n onKeyDown={(e) => {\n if (e.key === 'Enter') {\n e.preventDefault();\n stopEditing();\n }\n // Escape — AG Grid cancels by default; the editor doesn't need\n // explicit handling beyond what AG Grid wires automatically.\n }}\n className={[\n 'ds:block ds:w-full ds:appearance-none ds:text-end ds:tabular-nums',\n INPUT_SURFACE_CHROME,\n // Use `md` height — see editable-text-cell-renderer for rationale.\n INPUT_SURFACE_HEIGHT.md,\n INPUT_SURFACE_TEXT.sm,\n INPUT_SURFACE_PADDING_X.sm,\n ].join(' ')}\n />\n );\n}\n"],"names":["__iconNode","ArrowDown","createLucideIcon","ArrowUp","useTotalRow","rowData","sumFields","options","useMemo","row","field","total","r","raw","n","ToothIcon","jsx","ToothCellRenderer","props","value","maxInlineSize","Tag","reorderColumnWidth","ReorderCellRenderer","data","node","api","onMove","moveUpLabel","moveDownLabel","intent","group","disableAtEnds","t","useTranslation","rowIndex","lastIndex","atFirst","atLast","upLabel","downLabel","buttons","IconButton","event","IconButtonGroup","ToggleCellRenderer","onToggle","onError","trueIcon","falseIcon","trueClass","falseClass","label","pending","setPending","useState","isOn","icon","CheckSquare","Square","stateClass","resolvedLabel","handleClick","result","err","SIZE_CLASS","readField","HEX_RE","RGB_RE","HSL_RE","CSS_VAR_RE","sanitizeColor","v","ColorDotCellRenderer","colorField","size","labelField","dotRef","useRef","rawColor","color","useIsomorphicLayoutEffect","el","jsxs","readNumber","BalanceCellRenderer","lines","currency","highlightNegative","i18n","locale","formatLine","line","formatted","rendered","x","item","idx","EditableTextCellRenderer","initialValue","onValueChange","stopEditing","column","setValue","inputRef","useEffect","headerName","_b","_a","e","next","INPUT_SURFACE_CHROME","INPUT_SURFACE_HEIGHT","INPUT_SURFACE_TEXT","INPUT_SURFACE_PADDING_X","EditableCurrencyCellRenderer","decimals","min","max","draft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9
  import { I as Ze } from "./icon-button-C_kbcd7I.js";
10
10
  import { B as es } from "./button-group-DzV5wgnx.js";
11
11
  import { C as ts } from "./combobox-DiMLItyu.js";
12
- import { I as vn } from "./icon-button-group-C_lqXTAj.js";
12
+ import { I as vn } from "./icon-button-group-BLHPN6jg.js";
13
13
  import { T as Ar } from "./text-input-CUvCb6ST.js";
14
14
  import { C as Oe } from "./card-DPmk26CL.js";
15
15
  import { S as Tt } from "./separator-CYU_bGFn.js";
@@ -3143,4 +3143,4 @@ export {
3143
3143
  Nn as t,
3144
3144
  Kr as u
3145
3145
  };
3146
- //# sourceMappingURL=face-scheme-C0rk21gg.js.map
3146
+ //# sourceMappingURL=face-scheme-CjQAHvSP.js.map