@keboola/design 6.5.0 → 8.0.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 (49) hide show
  1. package/AGENTS.md +7 -7
  2. package/COMPONENT-API.md +3 -9
  3. package/README.md +1 -1
  4. package/dist/charts.cjs +22 -22
  5. package/dist/charts.cjs.map +1 -1
  6. package/dist/charts.d.cts +5 -5
  7. package/dist/charts.d.ts +5 -5
  8. package/dist/charts.js +22 -22
  9. package/dist/charts.js.map +1 -1
  10. package/dist/editors.cjs +590 -432
  11. package/dist/editors.cjs.map +1 -1
  12. package/dist/editors.d.cts +8 -4
  13. package/dist/editors.d.ts +8 -4
  14. package/dist/editors.js +591 -416
  15. package/dist/editors.js.map +1 -1
  16. package/dist/icons.cjs +23817 -45
  17. package/dist/icons.cjs.map +1 -1
  18. package/dist/icons.d.cts +12 -3
  19. package/dist/icons.d.ts +12 -3
  20. package/dist/icons.js +297 -40
  21. package/dist/icons.js.map +1 -1
  22. package/dist/index.cjs +4702 -4755
  23. package/dist/index.cjs.map +1 -1
  24. package/dist/index.d.cts +183 -169
  25. package/dist/index.d.ts +183 -169
  26. package/dist/index.js +4700 -4754
  27. package/dist/index.js.map +1 -1
  28. package/dist/markdown-editor.cjs +817 -923
  29. package/dist/markdown-editor.cjs.map +1 -1
  30. package/dist/markdown-editor.js +818 -923
  31. package/dist/markdown-editor.js.map +1 -1
  32. package/dist/mermaid.cjs +308 -425
  33. package/dist/mermaid.cjs.map +1 -1
  34. package/dist/mermaid.d.cts +5 -1
  35. package/dist/mermaid.d.ts +5 -1
  36. package/dist/mermaid.js +310 -408
  37. package/dist/mermaid.js.map +1 -1
  38. package/dist/rjsf.cjs +1398 -1225
  39. package/dist/rjsf.cjs.map +1 -1
  40. package/dist/rjsf.js +1399 -1225
  41. package/dist/rjsf.js.map +1 -1
  42. package/dist/styles.css +2 -5
  43. package/dist/testing.cjs +86 -82
  44. package/dist/testing.cjs.map +1 -1
  45. package/dist/testing.js +86 -82
  46. package/dist/testing.js.map +1 -1
  47. package/package.json +26 -19
  48. package/src/styles.css +125 -105
  49. package/src/theme.css +264 -0
package/AGENTS.md CHANGED
@@ -36,12 +36,12 @@ The root barrel (`@keboola/design`) is **not** the whole package. These live onl
36
36
 
37
37
  The API is "shadcn-shaped" enough to invite copy-paste but different enough to break it — copied shadcn code fails type-check. Translate these before emitting:
38
38
 
39
- | Component | shadcn shape (wrong here) | `@keboola/design` shape |
40
- | --------------------- | ------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
41
- | `DropdownMenu` | named parts `DropdownMenuTrigger` / `DropdownMenuContent` / `DropdownMenuItem` | **compound** — only `DropdownMenu` exports; use `DropdownMenu.Trigger` / `.Content` / `.Item` / `.Label` / `.Separator` |
42
- | `Tabs` | `<Tabs><TabsList><TabsTrigger/></TabsList><TabsContent/>` | data-driven — `<Tabs triggers={[{ value, title }]}>` + `TabsContent` children. **No** `TabsList` / `TabsTrigger` export |
43
- | `Select` | composed children `<Select><SelectTrigger/><SelectContent><SelectItem/></SelectContent></Select>` | data-driven — `Select` takes **`items`**; the form connector `SelectField` also takes **`items`** (canonical), with `options` as a deprecated alias. Same `{ value, label }` shape |
44
- | `Sidebar.SearchInput` | `asChild`-wrappable trigger | concrete `<input>` (`ComponentProps<'input'>`), **no `asChild`** — put a custom search affordance in a plain element inside `Sidebar.Header` |
39
+ | Component | shadcn shape (wrong here) | `@keboola/design` shape |
40
+ | --------------------- | ------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
41
+ | `DropdownMenu` | named parts `DropdownMenuTrigger` / `DropdownMenuContent` / `DropdownMenuItem` | **compound** — only `DropdownMenu` exports; use `DropdownMenu.Trigger` / `.Content` / `.Item` / `.Label` / `.Separator` |
42
+ | `Tabs` | `<Tabs><TabsList><TabsTrigger/></TabsList><TabsContent/>` | data-driven — `<Tabs triggers={[{ value, title }]}>` + `TabsContent` children. **No** `TabsList` / `TabsTrigger` export |
43
+ | `Select` | composed children `<Select><SelectTrigger/><SelectContent><SelectItem/></SelectContent></Select>` | data-driven — `Select` takes **`items`**, and the form connector `SelectField` delegates to it, so both take the same `items`: flat `{ value, label, icon?, disabled? }` or groups of them (`{ label?, items }`) |
44
+ | `Sidebar.SearchInput` | `asChild`-wrappable trigger | concrete `<input>` (`ComponentProps<'input'>`), **no `asChild`** — put a custom search affordance in a plain element inside `Sidebar.Header` |
45
45
 
46
46
  Other compound (not named-export) components in the barrel: `Modal.*`, `Sheet.*`, `Card.*`, `Sidebar.*`, `PageHeader.Index` / `.Detail`, `EmptyState.*`, `Pagination.*`, `Popover.*` — reach for the dotted sub-parts, not flat `XContent` / `XTrigger` named imports. (The root `SearchInput` block is distinct from `Sidebar.SearchInput` and is fully composable.)
47
47
 
@@ -426,7 +426,7 @@ Controlled (opened from elsewhere, no `Trigger`): pass `open` + `onOpenChange` t
426
426
 
427
427
  ## Icons
428
428
 
429
- Canonical icon surface is `@keboola/design/icons` — a wildcard re-export of [lucide-react](https://lucide.dev) plus Keboola-custom inline-SVG icons. Follow **shadcn convention**: import named icons directly, no wrapper component. Every Lucide icon is available without any package edit.
429
+ Canonical icon surface is `@keboola/design/icons` — a re-export of every [lucide-react](https://lucide.dev) icon plus Keboola-custom inline-SVG icons. Follow **shadcn convention**: import named icons directly, no wrapper component. Every Lucide icon is available without any package edit.
430
430
 
431
431
  ```tsx
432
432
  import { ChevronDown, Keboola, Loader2 } from '@keboola/design/icons';
package/COMPONENT-API.md CHANGED
@@ -267,27 +267,21 @@ Source: `src/blocks/Form/connectors/NumberField.tsx`
267
267
 
268
268
  Source: `src/blocks/Form/connectors/SelectField.tsx`
269
269
 
270
- > Pass `items` (canonical, matches the base `Select`) or the deprecated `options` alias — one is required.
271
-
272
270
  | Prop | Type | Required | Default | Description |
273
271
  | ------------------ | ---------------------------------------------- | -------- | ------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
272
+ | `items` | `readonly (SelectItem \| SelectItemGroup)[]` | yes | — | |
274
273
  | `action` | `ReactNode` | no | — | Optional node rendered at the trailing edge of the label row (opposite the label) — e.g. a "Forgot password?" link beside a Password label. Presentational placement only; it is a sibling of the `<Label>`, not part of the field's accessible name. Provide an interactive element (`ButtonInline` / `Link`). |
275
274
  | `aria-describedby` | `string` | no | — | |
276
275
  | `autoComplete` | `string` | no | — | |
277
276
  | `className` | `string` | no | — | |
278
277
  | `defaultOpen` | `boolean` | no | — | |
279
- | `defaultValue` | `string` | no | — | |
280
278
  | `dir` | `"rtl" \| "ltr"` | no | — | |
281
279
  | `disabled` | `boolean` | no | — | |
282
280
  | `form` | `string` | no | — | |
283
281
  | `help` | `ReactNode` | no | — | |
284
- | `items` | `readonly Option[]` | no | — | |
285
282
  | `label` | `ReactNode` | no | — | |
286
- | `name` | `string` | no | — | |
287
283
  | `onOpenChange` | `((open: boolean) => void)` | no | — | |
288
284
  | `open` | `boolean` | no | — | |
289
- | `options` | `readonly Option[]` | no | — | @deprecated use `items` |
290
- | `placeholder` | `string` | no | — | |
291
285
  | `required` | `boolean` | no | — | |
292
286
  | `requiredMark` | `RequiredMark` | no | — | Which marker to show beside the label — gated by `required` so it never lies: `'required'` renders `*` only when the field is `required`; `'optional'` renders `(optional)` only when it is not; `'hidden'` renders neither. Defaults to `'required'`. |
293
287
  | `sizing` | `"small" \| "medium" \| "default" \| null` | no | — | |
@@ -400,7 +394,7 @@ Source: `src/components/Card/CardTitle.tsx`
400
394
 
401
395
  | Prop | Type | Required | Default | Description |
402
396
  | ---- | -------------- | -------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- |
403
- | `as` | `HeadingLevel` | no | — | Heading tag to render. Defaults to `h3`; set explicitly to avoid a heading-order skip (e.g. `as="h2"` when the Card sits directly under a page's `h1`). |
397
+ | `as` | `HeadingLevel` | no | `h3` | Heading tag to render. Defaults to `h3`; set explicitly to avoid a heading-order skip (e.g. `as="h2"` when the Card sits directly under a page's `h1`). |
404
398
 
405
399
  ### `Card.Content`
406
400
 
@@ -436,7 +430,7 @@ Source: `src/components/BrandLogo/BrandLogo.tsx`
436
430
 
437
431
  | Prop | Type | Required | Default | Description |
438
432
  | ----------- | ---------------------- | -------- | ---------- | -------------------------------------------------------------------------------------- |
439
- | `className` | `string` | no | — | Sets the logo height; aspect ratio is preserved (e.g. `tw-h-7`). |
433
+ | `className` | `string` | no | — | Sets the logo height; aspect ratio is preserved (e.g. `tw:h-7`). |
440
434
  | `variant` | `"mark" \| "wordmark"` | no | `wordmark` | `wordmark` (default, full logo) or `mark` (square icon); each falls back to the other. |
441
435
 
442
436
  ## Layout & shell
package/README.md CHANGED
@@ -140,7 +140,7 @@ Same prerequisites as `test:stories` (build workspace deps, install Chromium). R
140
140
 
141
141
  ### Icons
142
142
 
143
- Import icons directly from `@keboola/design/icons` — a wildcard re-export of [lucide-react](https://lucide.dev) plus Keboola-custom inline-SVG icons. See `AGENTS.md` for the full mapping and conventions.
143
+ Import icons directly from `@keboola/design/icons` — a re-export of every [lucide-react](https://lucide.dev) icon plus Keboola-custom inline-SVG icons. See `AGENTS.md` for the full mapping and conventions.
144
144
 
145
145
  ```tsx
146
146
  import { ChevronDown, Keboola } from '@keboola/design/icons';
package/dist/charts.cjs CHANGED
@@ -7,7 +7,7 @@ var jsxRuntime = require('react/jsx-runtime');
7
7
 
8
8
  // src/blocks/Charts/ChartContainer.tsx
9
9
  var twMerge = tailwindMerge.extendTailwindMerge({
10
- prefix: "tw-"
10
+ prefix: "tw"
11
11
  });
12
12
  var cn = (...classes) => twMerge(clsx.clsx(...classes));
13
13
  var ChartContainer = ({
@@ -20,19 +20,19 @@ var ChartContainer = ({
20
20
  "div",
21
21
  {
22
22
  className: cn(
23
- "tw-text-xs",
23
+ "tw:text-xs",
24
24
  // Axis ticks and labels follow the muted foreground token.
25
- "[&_.recharts-cartesian-axis-tick_text]:tw-fill-muted-foreground",
26
- "[&_.recharts-polar-angle-axis-tick_text]:tw-fill-muted-foreground",
27
- "[&_.recharts-label]:tw-fill-muted-foreground",
28
- "[&_.recharts-legend-item-text]:!tw-text-muted-foreground",
25
+ "tw:[&_.recharts-cartesian-axis-tick_text]:fill-muted-foreground",
26
+ "tw:[&_.recharts-polar-angle-axis-tick_text]:fill-muted-foreground",
27
+ "tw:[&_.recharts-label]:fill-muted-foreground",
28
+ "tw:[&_.recharts-legend-item-text]:!text-muted-foreground",
29
29
  // Grid lines, axis lines and the hover cursor follow the border token.
30
- "[&_.recharts-cartesian-grid_line]:tw-stroke-border/60",
31
- "[&_.recharts-cartesian-axis-line]:tw-stroke-border",
32
- "[&_.recharts-cartesian-axis-tick-line]:tw-stroke-border",
33
- "[&_.recharts-curve.recharts-tooltip-cursor]:tw-stroke-border",
34
- "[&_.recharts-rectangle.recharts-tooltip-cursor]:tw-fill-muted/60",
35
- "[&_.recharts-surface]:tw-outline-none",
30
+ "tw:[&_.recharts-cartesian-grid_line]:stroke-border/60",
31
+ "tw:[&_.recharts-cartesian-axis-line]:stroke-border",
32
+ "tw:[&_.recharts-cartesian-axis-tick-line]:stroke-border",
33
+ "tw:[&_.recharts-curve.recharts-tooltip-cursor]:stroke-border",
34
+ "tw:[&_.recharts-rectangle.recharts-tooltip-cursor]:fill-muted/60",
35
+ "tw:[&_.recharts-surface]:outline-hidden",
36
36
  className
37
37
  ),
38
38
  ...props,
@@ -51,12 +51,12 @@ var ChartTooltipContent = ({
51
51
  "div",
52
52
  {
53
53
  className: cn(
54
- "tw-min-w-32 tw-rounded-md tw-border tw-border-border tw-bg-popover tw-px-2.5 tw-py-1.5 tw-text-xs tw-text-popover-foreground tw-shadow-md",
54
+ "tw:min-w-32 tw:rounded-md tw:border tw:border-border tw:bg-popover tw:px-2.5 tw:py-1.5 tw:text-xs tw:text-popover-foreground tw:shadow-md",
55
55
  className
56
56
  ),
57
57
  children: [
58
- label != null && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "tw-mb-1 tw-font-medium", children: label }),
59
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "tw-flex tw-flex-col tw-gap-1", children: payload.map((entry) => {
58
+ label != null && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "tw:mb-1 tw:font-medium", children: label }),
59
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "tw:flex tw:flex-col tw:gap-1", children: payload.map((entry) => {
60
60
  const name = String(entry.name ?? entry.dataKey ?? "");
61
61
  const value = entry.value;
62
62
  const hasNumber = value != null && value !== "" && Number.isFinite(Number(value));
@@ -64,19 +64,19 @@ var ChartTooltipContent = ({
64
64
  return /* @__PURE__ */ jsxRuntime.jsxs(
65
65
  "div",
66
66
  {
67
- className: "tw-flex tw-items-center tw-justify-between tw-gap-3",
67
+ className: "tw:flex tw:items-center tw:justify-between tw:gap-3",
68
68
  children: [
69
- /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "tw-flex tw-items-center tw-gap-1.5", children: [
69
+ /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "tw:flex tw:items-center tw:gap-1.5", children: [
70
70
  /* @__PURE__ */ jsxRuntime.jsx(
71
71
  "span",
72
72
  {
73
- className: "tw-size-2 tw-shrink-0 tw-rounded-[2px]",
73
+ className: "tw:size-2 tw:shrink-0 tw:rounded-[2px]",
74
74
  style: { backgroundColor: entry.color }
75
75
  }
76
76
  ),
77
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "tw-text-muted-foreground", children: name })
77
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "tw:text-muted-foreground", children: name })
78
78
  ] }),
79
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "tw-font-medium tw-tabular-nums", children: display })
79
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "tw:font-medium tw:tabular-nums", children: display })
80
80
  ]
81
81
  },
82
82
  String(entry.dataKey ?? name)
@@ -138,7 +138,7 @@ var cartesianChrome = ({
138
138
  var CHART_TOKEN_COUNT = 5;
139
139
  var chartTokenColor = (index) => {
140
140
  const slot = (index % CHART_TOKEN_COUNT + CHART_TOKEN_COUNT) % CHART_TOKEN_COUNT + 1;
141
- return `rgb(var(--color-chart-${slot}))`;
141
+ return `rgb(var(--chart-${slot}))`;
142
142
  };
143
143
  var resolveSeriesColor = (index, token) => chartTokenColor(token ? token - 1 : index);
144
144
  var LineChart = ({
@@ -249,7 +249,7 @@ var PieChart = ({
249
249
  nameKey,
250
250
  dataKey,
251
251
  innerRadius,
252
- stroke: "rgb(var(--color-background))",
252
+ stroke: "rgb(var(--background))",
253
253
  isAnimationActive: false,
254
254
  children: data.map((datum, index) => /* @__PURE__ */ jsxRuntime.jsx(recharts.Cell, { fill: chartTokenColor(index) }, String(datum[nameKey] ?? index)))
255
255
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/utils/classNames.ts","../src/blocks/Charts/ChartContainer.tsx","../src/blocks/Charts/ChartTooltip.tsx","../src/blocks/Charts/format.ts","../src/blocks/Charts/cartesian.tsx","../src/blocks/Charts/theme.ts","../src/blocks/Charts/LineChart.tsx","../src/blocks/Charts/BarChart.tsx","../src/blocks/Charts/AreaChart.tsx","../src/blocks/Charts/PieChart.tsx"],"names":["extendTailwindMerge","clsx","jsx","ResponsiveContainer","jsxs","RechartsTooltip","Fragment","CartesianGrid","XAxis","YAxis","Legend","RechartsLineChart","Line","RechartsBarChart","Bar","RechartsAreaChart","Area","RechartsPieChart","Pie","Cell"],"mappings":";;;;;;;;AAGA,IAAM,UAAUA,iCAAA,CAAoB;AAAA,EAClC,MAAA,EAAQ;AACV,CAAC,CAAA;AAEM,IAAM,KAAK,CAAA,GAAI,OAAA,KAA0B,QAAQC,SAAA,CAAK,GAAG,OAAO,CAAC,CAAA;ACoBjE,IAAM,iBAAiB,CAAC;AAAA,EAC7B,MAAA,GAAS,GAAA;AAAA,EACT,KAAA,GAAQ,MAAA;AAAA,EACR,SAAA;AAAA,EACA,QAAA;AAAA,EACA,GAAG;AACL,CAAA,qBACEC,cA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AAA;AAAA,EACA,OAAA;AAAA,EACA,OAAA;AAAA,EACA,WAAA,GAAc,CAAA;AAAA,EACd,MAAA;AAAA,EACA,KAAA;AAAA,EACA,SAAA;AAAA,EACA,UAAA,GAAa,IAAA;AAAA,EACb,WAAA,GAAc,IAAA;AAAA,EACd;AACF,CAAA,qBACEd,eAAC,cAAA,EAAA,EAAe,MAAA,EAAgB,OAAc,SAAA,EAC5C,QAAA,kBAAAE,gBAACa,iBAAA,EAAA,EACE,QAAA,EAAA;AAAA,EAAA,WAAA,oBACCf,cAAAA;AAAA,IAAC,YAAA;AAAA,IAAA;AAAA,MACC,gBACE,cAAA,GAAiB,CAAC,UAAU,WAAA,CAAY,KAAA,EAAO,cAAc,CAAA,GAAI;AAAA;AAAA,GAErE;AAAA,EAED,UAAA,oBAAcA,cAAAA,CAACQ,eAAAA,EAAA,EAAO,YAAA,EAAc,EAAE,QAAA,EAAU,EAAA,EAAG,EAAG,CAAA;AAAA,kBACvDR,cAAAA;AAAA,IAACgB,YAAA;AAAA,IAAA;AAAA,MACC,IAAA;AAAA,MACA,OAAA;AAAA,MACA,OAAA;AAAA,MACA,WAAA;AAAA,MAGA,MAAA,EAAO,8BAAA;AAAA,MACP,iBAAA,EAAmB,KAAA;AAAA,MAElB,eAAK,GAAA,CAAI,CAAC,OAAO,KAAA,qBAChBhB,eAACiB,aAAA,EAAA,EAA2C,IAAA,EAAM,eAAA,CAAgB,KAAK,KAA5D,MAAA,CAAO,KAAA,CAAM,OAAO,CAAA,IAAK,KAAK,CAAiC,CAC3E;AAAA;AAAA;AACH,CAAA,EACF,CAAA,EACF","file":"charts.cjs","sourcesContent":["import { type ClassValue, clsx } from 'clsx';\nimport { extendTailwindMerge } from 'tailwind-merge';\n\nconst twMerge = extendTailwindMerge({\n prefix: 'tw-',\n});\n\nexport const cn = (...classes: ClassValue[]) => twMerge(clsx(...classes));\n","import { type ComponentProps, type ReactElement } from 'react';\nimport { ResponsiveContainer } from 'recharts';\n\nimport { cn } from '../../utils';\n\n/** A length that recharts' `<ResponsiveContainer>` accepts: px number or `\"NN%\"`. */\nexport type ChartDimension = number | `${number}%`;\n\nexport type ChartContainerProps = Omit<ComponentProps<'div'>, 'children'> & {\n /**\n * Height as a px number or percentage string. Charts have no intrinsic\n * height, so a container needs one either here or from a sized ancestor.\n * Defaults to 300.\n */\n height?: ChartDimension;\n /** Width as a px number or percentage. Defaults to `\"100%\"` (fills parent). */\n width?: ChartDimension;\n /** A single recharts chart element (`<LineChart>`, `<BarChart>`, …). */\n children: ReactElement;\n};\n\n/**\n * Responsive, brand-themed frame for a chart. Wraps the chart in recharts'\n * `<ResponsiveContainer>` and applies the semantic-token chrome (axis text,\n * grid, cursor) through CSS so every chart inside inherits it. Sizing is\n * intrinsic: give it a `height` (default 300) and it fills the parent width.\n */\nexport const ChartContainer = ({\n height = 300,\n width = '100%',\n className,\n children,\n ...props\n}: ChartContainerProps) => (\n <div\n className={cn(\n 'tw-text-xs',\n // Axis ticks and labels follow the muted foreground token.\n '[&_.recharts-cartesian-axis-tick_text]:tw-fill-muted-foreground',\n '[&_.recharts-polar-angle-axis-tick_text]:tw-fill-muted-foreground',\n '[&_.recharts-label]:tw-fill-muted-foreground',\n '[&_.recharts-legend-item-text]:!tw-text-muted-foreground',\n // Grid lines, axis lines and the hover cursor follow the border token.\n '[&_.recharts-cartesian-grid_line]:tw-stroke-border/60',\n '[&_.recharts-cartesian-axis-line]:tw-stroke-border',\n '[&_.recharts-cartesian-axis-tick-line]:tw-stroke-border',\n '[&_.recharts-curve.recharts-tooltip-cursor]:tw-stroke-border',\n '[&_.recharts-rectangle.recharts-tooltip-cursor]:tw-fill-muted/60',\n '[&_.recharts-surface]:tw-outline-none',\n className,\n )}\n {...props}\n >\n <ResponsiveContainer width={width} height={height}>\n {children}\n </ResponsiveContainer>\n </div>\n);\n","import { type ComponentProps } from 'react';\nimport { Tooltip as RechartsTooltip } from 'recharts';\n\nimport { cn } from '../../utils';\n\ntype TooltipPayloadEntry = {\n name?: string | number;\n value?: string | number;\n color?: string;\n dataKey?: string | number;\n};\n\ntype ChartTooltipContentProps = {\n active?: boolean;\n label?: string | number;\n payload?: TooltipPayloadEntry[];\n /** Format a value for display (e.g. currency, percentage). */\n valueFormatter?: (value: string | number, name: string) => string;\n className?: string;\n};\n\n/**\n * Brand-themed tooltip body. Surfaces (background, border, text) resolve from\n * semantic tokens, and each series swatch reuses the recharts-provided series\n * `color` (already a `--color-chart-*` token from this package's charts).\n */\nexport const ChartTooltipContent = ({\n active,\n label,\n payload,\n valueFormatter,\n className,\n}: ChartTooltipContentProps) => {\n if (!active || !payload?.length) return null;\n\n return (\n <div\n className={cn(\n 'tw-min-w-32 tw-rounded-md tw-border tw-border-border tw-bg-popover tw-px-2.5 tw-py-1.5 tw-text-xs tw-text-popover-foreground tw-shadow-md',\n className,\n )}\n >\n {label != null && <div className=\"tw-mb-1 tw-font-medium\">{label}</div>}\n <div className=\"tw-flex tw-flex-col tw-gap-1\">\n {payload.map((entry) => {\n const name = String(entry.name ?? entry.dataKey ?? '');\n const value = entry.value;\n // Missing / non-numeric values render blank rather than \"NaN\"/\"0\";\n // only well-formed numbers reach the formatter.\n const hasNumber = value != null && value !== '' && Number.isFinite(Number(value));\n const display = hasNumber\n ? valueFormatter\n ? valueFormatter(Number(value), name)\n : String(Number(value))\n : (value ?? '');\n return (\n <div\n key={String(entry.dataKey ?? name)}\n className=\"tw-flex tw-items-center tw-justify-between tw-gap-3\"\n >\n <span className=\"tw-flex tw-items-center tw-gap-1.5\">\n <span\n className=\"tw-size-2 tw-shrink-0 tw-rounded-[2px]\"\n style={{ backgroundColor: entry.color }}\n />\n <span className=\"tw-text-muted-foreground\">{name}</span>\n </span>\n <span className=\"tw-font-medium tw-tabular-nums\">{display}</span>\n </div>\n );\n })}\n </div>\n </div>\n );\n};\n\nexport type ChartTooltipProps = ComponentProps<typeof RechartsTooltip> & {\n valueFormatter?: (value: string | number, name: string) => string;\n};\n\n/**\n * Drop-in recharts `<Tooltip>` pre-wired to render {@link ChartTooltipContent}.\n * Each chart mounts one by default; pass `showTooltip={false}` on the chart to omit.\n */\nexport const ChartTooltip = ({ valueFormatter, ...props }: ChartTooltipProps) => (\n <RechartsTooltip\n cursor={{ strokeWidth: 1 }}\n content={<ChartTooltipContent valueFormatter={valueFormatter} />}\n {...props}\n />\n);\n","/**\n * Apply a numeric `valueFormatter` safely. recharts hands axis ticks and\n * tooltip payload values as `string | number | null | undefined`, and partial\n * or streaming data can carry gaps. Coercing those straight through\n * `Number(value)` would render `$0` (empty string → 0) or `$NaN` (non-numeric),\n * so a missing / non-finite value is rendered as an empty string instead of\n * being fed to the formatter.\n */\nexport const formatValue = (\n value: string | number | null | undefined,\n valueFormatter?: (value: number) => string,\n): string => {\n if (value == null || value === '') return '';\n const num = Number(value);\n if (!Number.isFinite(num)) return '';\n return valueFormatter ? valueFormatter(num) : String(num);\n};\n","import { CartesianGrid, Legend, XAxis, YAxis } from 'recharts';\n\nimport { ChartTooltip } from './ChartTooltip';\nimport { formatValue } from './format';\nimport { type CartesianChartProps } from './types';\n\nconst AXIS_PROPS = {\n tickLine: false,\n axisLine: false,\n tick: { fontSize: 11 },\n} as const;\n\n/**\n * The grid + axes + tooltip + legend shared by the line, bar, and area charts.\n * Colors are applied via `ChartContainer`'s CSS chrome, not inline props, so\n * these stay brand-safe.\n */\nexport const cartesianChrome = ({\n xKey,\n showGrid = true,\n showYAxis = true,\n showLegend = false,\n showTooltip = true,\n valueFormatter,\n}: Pick<\n CartesianChartProps,\n 'xKey' | 'showGrid' | 'showYAxis' | 'showLegend' | 'showTooltip' | 'valueFormatter'\n>) => (\n <>\n {showGrid && <CartesianGrid strokeDasharray=\"3 3\" vertical={false} />}\n <XAxis dataKey={xKey} {...AXIS_PROPS} />\n {showYAxis && (\n <YAxis\n width={48}\n {...AXIS_PROPS}\n tickFormatter={\n valueFormatter\n ? (value: string | number) => formatValue(value, valueFormatter)\n : undefined\n }\n />\n )}\n {showTooltip && (\n <ChartTooltip\n valueFormatter={valueFormatter ? (value) => formatValue(value, valueFormatter) : undefined}\n />\n )}\n {showLegend && <Legend wrapperStyle={{ fontSize: 11 }} />}\n </>\n);\n","/**\n * The design system ships a five-slot categorical chart palette as CSS\n * variables (`--color-chart-1` … `--color-chart-5`). Charts resolve their\n * series colors from these tokens only — never from inline hex or a primitive\n * scale — so they follow both the active color scheme (light/dark, via\n * `data-theme` in `styles.css`) and the active brand: a brand reskins charts\n * by defining `colors.chart` (and `colorsDark.chart`) in its\n * `@keboola/brand-registry` definition, which `ThemeProvider` emits as the\n * `--color-chart-*` variables.\n *\n * The CSS variables hold raw `R G B` channels (for Tailwind's `<alpha-value>`\n * opacity modifiers), so they are wrapped in `rgb(...)` before handing them to\n * recharts as ordinary SVG `stroke` / `fill` strings.\n */\nconst CHART_TOKEN_COUNT = 5;\n\n/** Number of the semantic chart token (`1`–`5`) a series maps to. */\nexport type ChartColorToken = 1 | 2 | 3 | 4 | 5;\n\n/**\n * The CSS color for a chart token. `index` is 0-based (series position); it\n * wraps around the five-slot palette so any number of series stays on-brand.\n */\nexport const chartTokenColor = (index: number): string => {\n // Euclidean modulo so negative indices still land in 1..CHART_TOKEN_COUNT\n // (plain `%` would yield e.g. `--color-chart-0` for index -1).\n const slot = (((index % CHART_TOKEN_COUNT) + CHART_TOKEN_COUNT) % CHART_TOKEN_COUNT) + 1;\n return `rgb(var(--color-chart-${slot}))`;\n};\n\n/** Resolve an explicit token (1–5) or fall back to the series position. */\nexport const resolveSeriesColor = (index: number, token?: ChartColorToken): string =>\n chartTokenColor(token ? token - 1 : index);\n","import { Line, LineChart as RechartsLineChart } from 'recharts';\n\nimport { cartesianChrome } from './cartesian';\nimport { ChartContainer } from './ChartContainer';\nimport { resolveSeriesColor } from './theme';\nimport { type CartesianChartProps } from './types';\n\n/**\n * A themed multi-series line chart. Each series' color comes from the semantic\n * `--color-chart-*` palette (by order, or pinned via `series[].color`), which\n * follows the active color scheme and the active brand's `colors.chart` when it\n * defines one. Wrap-free — mounts its own {@link ChartContainer}.\n *\n * @example\n * <LineChart\n * data={data}\n * xKey=\"month\"\n * series={[{ dataKey: 'revenue', name: 'Revenue' }, { dataKey: 'cost' }]}\n * />\n */\nexport const LineChart = ({\n data,\n xKey,\n series,\n height,\n width,\n className,\n ...chrome\n}: CartesianChartProps) => (\n <ChartContainer height={height} width={width} className={className}>\n <RechartsLineChart data={data} margin={{ top: 8, right: 8, left: 0, bottom: 0 }}>\n {cartesianChrome({ xKey, ...chrome })}\n {series.map((s, index) => {\n const color = resolveSeriesColor(index, s.color);\n return (\n <Line\n key={s.dataKey}\n type=\"monotone\"\n dataKey={s.dataKey}\n name={s.name ?? s.dataKey}\n stroke={color}\n strokeWidth={2}\n dot={{ r: 3, fill: color, stroke: color }}\n activeDot={{ r: 4 }}\n isAnimationActive={false}\n />\n );\n })}\n </RechartsLineChart>\n </ChartContainer>\n);\n","import { Bar, BarChart as RechartsBarChart } from 'recharts';\n\nimport { cartesianChrome } from './cartesian';\nimport { ChartContainer } from './ChartContainer';\nimport { resolveSeriesColor } from './theme';\nimport { type CartesianChartProps } from './types';\n\nexport type BarChartProps = CartesianChartProps & {\n /** Stack the series into a single bar per category. Defaults to grouped. */\n stacked?: boolean;\n};\n\n/**\n * A themed multi-series bar chart. Series colors come from the semantic\n * `--color-chart-*` palette (by order, or pinned via `series[].color`), which\n * follows the active color scheme and the active brand's `colors.chart` when it\n * defines one. Pass `stacked` to stack the series instead of grouping them.\n *\n * @example\n * <BarChart data={data} xKey=\"month\" series={[{ dataKey: 'revenue' }]} />\n */\nexport const BarChart = ({\n data,\n xKey,\n series,\n height,\n width,\n className,\n stacked = false,\n ...chrome\n}: BarChartProps) => (\n <ChartContainer height={height} width={width} className={className}>\n <RechartsBarChart data={data} margin={{ top: 8, right: 8, left: 0, bottom: 0 }}>\n {cartesianChrome({ xKey, ...chrome })}\n {series.map((s, index) => (\n <Bar\n key={s.dataKey}\n dataKey={s.dataKey}\n name={s.name ?? s.dataKey}\n fill={resolveSeriesColor(index, s.color)}\n radius={stacked ? 0 : [4, 4, 0, 0]}\n stackId={stacked ? 'stack' : undefined}\n isAnimationActive={false}\n />\n ))}\n </RechartsBarChart>\n </ChartContainer>\n);\n","import { Area, AreaChart as RechartsAreaChart } from 'recharts';\n\nimport { cartesianChrome } from './cartesian';\nimport { ChartContainer } from './ChartContainer';\nimport { resolveSeriesColor } from './theme';\nimport { type CartesianChartProps } from './types';\n\nexport type AreaChartProps = CartesianChartProps & {\n /** Stack the series into a cumulative area. Defaults to overlaid. */\n stacked?: boolean;\n};\n\n/**\n * A themed multi-series area chart. Each series is stroked and softly filled\n * from the semantic `--color-chart-*` palette (by order, or pinned via\n * `series[].color`), which follows the active color scheme and the active\n * brand's `colors.chart` when it defines one. Pass `stacked` to stack the\n * series cumulatively.\n *\n * @example\n * <AreaChart data={data} xKey=\"month\" series={[{ dataKey: 'revenue' }]} />\n */\nexport const AreaChart = ({\n data,\n xKey,\n series,\n height,\n width,\n className,\n stacked = false,\n ...chrome\n}: AreaChartProps) => (\n <ChartContainer height={height} width={width} className={className}>\n <RechartsAreaChart data={data} margin={{ top: 8, right: 8, left: 0, bottom: 0 }}>\n {cartesianChrome({ xKey, ...chrome })}\n {series.map((s, index) => {\n const color = resolveSeriesColor(index, s.color);\n return (\n <Area\n key={s.dataKey}\n type=\"monotone\"\n dataKey={s.dataKey}\n name={s.name ?? s.dataKey}\n stroke={color}\n fill={color}\n fillOpacity={0.15}\n strokeWidth={2}\n stackId={stacked ? 'stack' : undefined}\n isAnimationActive={false}\n />\n );\n })}\n </RechartsAreaChart>\n </ChartContainer>\n);\n","import { Cell, Legend, Pie, PieChart as RechartsPieChart } from 'recharts';\n\nimport { ChartContainer, type ChartDimension } from './ChartContainer';\nimport { ChartTooltip } from './ChartTooltip';\nimport { formatValue } from './format';\nimport { chartTokenColor } from './theme';\nimport { type ChartDatum } from './types';\n\nexport type PieChartProps = {\n /** The rows to plot — one sector per row. */\n data: ChartDatum[];\n /** Key into each datum for the sector label. */\n nameKey: string;\n /** Key into each datum for the sector value. */\n dataKey: string;\n /** Render as a donut with a hole of this inner radius (px or %). */\n innerRadius?: ChartDimension;\n /** Height as a px number or percentage. Defaults to 300. */\n height?: ChartDimension;\n /** Width as a px number or percentage. Defaults to `\"100%\"`. */\n width?: ChartDimension;\n /** Show a legend below the chart. Defaults to `true`. */\n showLegend?: boolean;\n /** Show the hover tooltip. Defaults to `true`. */\n showTooltip?: boolean;\n /** Format a sector value for the tooltip. */\n valueFormatter?: (value: number) => string;\n className?: string;\n};\n\n/**\n * A themed pie / donut chart. Each sector cycles through the semantic\n * `--color-chart-*` palette, which follows the active color scheme and the\n * active brand's `colors.chart` when it defines one. Pass `innerRadius` to make\n * a donut.\n *\n * @example\n * <PieChart data={data} nameKey=\"engine\" dataKey=\"rows\" innerRadius=\"60%\" />\n */\nexport const PieChart = ({\n data,\n nameKey,\n dataKey,\n innerRadius = 0,\n height,\n width,\n className,\n showLegend = true,\n showTooltip = true,\n valueFormatter,\n}: PieChartProps) => (\n <ChartContainer height={height} width={width} className={className}>\n <RechartsPieChart>\n {showTooltip && (\n <ChartTooltip\n valueFormatter={\n valueFormatter ? (value) => formatValue(value, valueFormatter) : undefined\n }\n />\n )}\n {showLegend && <Legend wrapperStyle={{ fontSize: 11 }} />}\n <Pie\n data={data}\n nameKey={nameKey}\n dataKey={dataKey}\n innerRadius={innerRadius}\n // Separate sectors with the brand surface color rather than recharts'\n // hardcoded white default.\n stroke=\"rgb(var(--color-background))\"\n isAnimationActive={false}\n >\n {data.map((datum, index) => (\n <Cell key={String(datum[nameKey] ?? index)} fill={chartTokenColor(index)} />\n ))}\n </Pie>\n </RechartsPieChart>\n </ChartContainer>\n);\n"]}
1
+ {"version":3,"sources":["../src/utils/classNames.ts","../src/blocks/Charts/ChartContainer.tsx","../src/blocks/Charts/ChartTooltip.tsx","../src/blocks/Charts/format.ts","../src/blocks/Charts/cartesian.tsx","../src/blocks/Charts/theme.ts","../src/blocks/Charts/LineChart.tsx","../src/blocks/Charts/BarChart.tsx","../src/blocks/Charts/AreaChart.tsx","../src/blocks/Charts/PieChart.tsx"],"names":["extendTailwindMerge","clsx","jsx","ResponsiveContainer","jsxs","RechartsTooltip","Fragment","CartesianGrid","XAxis","YAxis","Legend","RechartsLineChart","Line","RechartsBarChart","Bar","RechartsAreaChart","Area","RechartsPieChart","Pie","Cell"],"mappings":";;;;;;;;AAKA,IAAM,UAAUA,iCAAA,CAAoB;AAAA,EAClC,MAAA,EAAQ;AACV,CAAC,CAAA;AAEM,IAAM,KAAK,CAAA,GAAI,OAAA,KAA0B,QAAQC,SAAA,CAAK,GAAG,OAAO,CAAC,CAAA;ACkBjE,IAAM,iBAAiB,CAAC;AAAA,EAC7B,MAAA,GAAS,GAAA;AAAA,EACT,KAAA,GAAQ,MAAA;AAAA,EACR,SAAA;AAAA,EACA,QAAA;AAAA,EACA,GAAG;AACL,CAAA,qBACEC,cAAA;AAAA,EAAC,KAAA;AAAA,EAAA;AAAA,IACC,SAAA,EAAW,EAAA;AAAA,MACT,YAAA;AAAA;AAAA,MAEA,iEAAA;AAAA,MACA,mEAAA;AAAA,MACA,8CAAA;AAAA,MACA,0DAAA;AAAA;AAAA,MAEA,uDAAA;AAAA,MACA,oDAAA;AAAA,MACA,yDAAA;AAAA,MACA,8DAAA;AAAA,MACA,kEAAA;AAAA,MACA,yCAAA;AAAA,MACA;AAAA,KACF;AAAA,IACC,GAAG,KAAA;AAAA,IAEJ,QAAA,kBAAAA,cAAA,CAACC,4BAAA,EAAA,EAAoB,KAAA,EAAc,MAAA,EAChC,QAAA,EACH;AAAA;AACF;AC9BK,IAAM,sBAAsB,CAAC;AAAA,EAClC,MAAA;AAAA,EACA,KAAA;AAAA,EACA,OAAA;AAAA,EACA,cAAA;AAAA,EACA;AACF,CAAA,KAAgC;AAC9B,EAAA,IAAI,CAAC,MAAA,IAAU,CAAC,OAAA,EAAS,QAAQ,OAAO,IAAA;AAExC,EAAA,uBACEC,eAAA;AA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C,IAAA;AAAA,MACA,OAAA;AAAA,MACA,OAAA;AAAA,MACA,WAAA;AAAA,MAGA,MAAA,EAAO,wBAAA;AAAA,MACP,iBAAA,EAAmB,KAAA;AAAA,MAElB,eAAK,GAAA,CAAI,CAAC,OAAO,KAAA,qBAChBhB,eAACiB,aAAA,EAAA,EAA2C,IAAA,EAAM,eAAA,CAAgB,KAAK,KAA5D,MAAA,CAAO,KAAA,CAAM,OAAO,CAAA,IAAK,KAAK,CAAiC,CAC3E;AAAA;AAAA;AACH,CAAA,EACF,CAAA,EACF","file":"charts.cjs","sourcesContent":["import { type ClassValue, clsx } from 'clsx';\nimport { extendTailwindMerge } from 'tailwind-merge';\n\n// tailwind-merge v3 (Tailwind v4): the prefix drops the trailing separator —\n// `tw:` → `tw` (the `:` separator is implied).\nconst twMerge = extendTailwindMerge({\n prefix: 'tw',\n});\n\nexport const cn = (...classes: ClassValue[]) => twMerge(clsx(...classes));\n","import { type ComponentProps, type ReactElement } from 'react';\nimport { ResponsiveContainer } from 'recharts';\n\nimport { cn } from '../../utils';\n\n/** A length that recharts' `<ResponsiveContainer>` accepts: px number or `\"NN%\"`. */\nexport type ChartDimension = number | `${number}%`;\n\nexport type ChartContainerProps = Omit<ComponentProps<'div'>, 'children'> & {\n /**\n * Height as a px number or percentage string. Charts have no intrinsic\n * height, so a container needs one either here or from a sized ancestor.\n * Defaults to 300.\n */\n height?: ChartDimension;\n /** Width as a px number or percentage. Defaults to `\"100%\"` (fills parent). */\n width?: ChartDimension;\n /** A single recharts chart element (`<LineChart>`, `<BarChart>`, …). */\n children: ReactElement;\n};\n\n/**\n * Responsive, brand-themed frame for a chart. Wraps the chart in recharts'\n * `<ResponsiveContainer>` and applies the semantic-token chrome (axis text,\n * grid, cursor) through CSS so every chart inside inherits it. Sizing is\n * intrinsic: give it a `height` (default 300) and it fills the parent width.\n */\nexport const ChartContainer = ({\n height = 300,\n width = '100%',\n className,\n children,\n ...props\n}: ChartContainerProps) => (\n <div\n className={cn(\n 'tw:text-xs',\n // Axis ticks and labels follow the muted foreground token.\n 'tw:[&_.recharts-cartesian-axis-tick_text]:fill-muted-foreground',\n 'tw:[&_.recharts-polar-angle-axis-tick_text]:fill-muted-foreground',\n 'tw:[&_.recharts-label]:fill-muted-foreground',\n 'tw:[&_.recharts-legend-item-text]:!text-muted-foreground',\n // Grid lines, axis lines and the hover cursor follow the border token.\n 'tw:[&_.recharts-cartesian-grid_line]:stroke-border/60',\n 'tw:[&_.recharts-cartesian-axis-line]:stroke-border',\n 'tw:[&_.recharts-cartesian-axis-tick-line]:stroke-border',\n 'tw:[&_.recharts-curve.recharts-tooltip-cursor]:stroke-border',\n 'tw:[&_.recharts-rectangle.recharts-tooltip-cursor]:fill-muted/60',\n 'tw:[&_.recharts-surface]:outline-hidden',\n className,\n )}\n {...props}\n >\n <ResponsiveContainer width={width} height={height}>\n {children}\n </ResponsiveContainer>\n </div>\n);\n","import { type ComponentProps } from 'react';\nimport { Tooltip as RechartsTooltip } from 'recharts';\n\nimport { cn } from '../../utils';\n\ntype TooltipPayloadEntry = {\n name?: string | number;\n value?: string | number;\n color?: string;\n dataKey?: string | number;\n};\n\ntype ChartTooltipContentProps = {\n active?: boolean;\n label?: string | number;\n payload?: TooltipPayloadEntry[];\n /** Format a value for display (e.g. currency, percentage). */\n valueFormatter?: (value: string | number, name: string) => string;\n className?: string;\n};\n\n/**\n * Brand-themed tooltip body. Surfaces (background, border, text) resolve from\n * semantic tokens, and each series swatch reuses the recharts-provided series\n * `color` (already a `--chart-*` token from this package's charts).\n */\nexport const ChartTooltipContent = ({\n active,\n label,\n payload,\n valueFormatter,\n className,\n}: ChartTooltipContentProps) => {\n if (!active || !payload?.length) return null;\n\n return (\n <div\n className={cn(\n 'tw:min-w-32 tw:rounded-md tw:border tw:border-border tw:bg-popover tw:px-2.5 tw:py-1.5 tw:text-xs tw:text-popover-foreground tw:shadow-md',\n className,\n )}\n >\n {label != null && <div className=\"tw:mb-1 tw:font-medium\">{label}</div>}\n <div className=\"tw:flex tw:flex-col tw:gap-1\">\n {payload.map((entry) => {\n const name = String(entry.name ?? entry.dataKey ?? '');\n const value = entry.value;\n // Missing / non-numeric values render blank rather than \"NaN\"/\"0\";\n // only well-formed numbers reach the formatter.\n const hasNumber = value != null && value !== '' && Number.isFinite(Number(value));\n const display = hasNumber\n ? valueFormatter\n ? valueFormatter(Number(value), name)\n : String(Number(value))\n : (value ?? '');\n return (\n <div\n key={String(entry.dataKey ?? name)}\n className=\"tw:flex tw:items-center tw:justify-between tw:gap-3\"\n >\n <span className=\"tw:flex tw:items-center tw:gap-1.5\">\n <span\n className=\"tw:size-2 tw:shrink-0 tw:rounded-[2px]\"\n style={{ backgroundColor: entry.color }}\n />\n <span className=\"tw:text-muted-foreground\">{name}</span>\n </span>\n <span className=\"tw:font-medium tw:tabular-nums\">{display}</span>\n </div>\n );\n })}\n </div>\n </div>\n );\n};\n\nexport type ChartTooltipProps = ComponentProps<typeof RechartsTooltip> & {\n valueFormatter?: (value: string | number, name: string) => string;\n};\n\n/**\n * Drop-in recharts `<Tooltip>` pre-wired to render {@link ChartTooltipContent}.\n * Each chart mounts one by default; pass `showTooltip={false}` on the chart to omit.\n */\nexport const ChartTooltip = ({ valueFormatter, ...props }: ChartTooltipProps) => (\n <RechartsTooltip\n cursor={{ strokeWidth: 1 }}\n content={<ChartTooltipContent valueFormatter={valueFormatter} />}\n {...props}\n />\n);\n","/**\n * Apply a numeric `valueFormatter` safely. recharts hands axis ticks and\n * tooltip payload values as `string | number | null | undefined`, and partial\n * or streaming data can carry gaps. Coercing those straight through\n * `Number(value)` would render `$0` (empty string → 0) or `$NaN` (non-numeric),\n * so a missing / non-finite value is rendered as an empty string instead of\n * being fed to the formatter.\n */\nexport const formatValue = (\n value: string | number | null | undefined,\n valueFormatter?: (value: number) => string,\n): string => {\n if (value == null || value === '') return '';\n const num = Number(value);\n if (!Number.isFinite(num)) return '';\n return valueFormatter ? valueFormatter(num) : String(num);\n};\n","import { CartesianGrid, Legend, XAxis, YAxis } from 'recharts';\n\nimport { ChartTooltip } from './ChartTooltip';\nimport { formatValue } from './format';\nimport { type CartesianChartProps } from './types';\n\nconst AXIS_PROPS = {\n tickLine: false,\n axisLine: false,\n tick: { fontSize: 11 },\n} as const;\n\n/**\n * The grid + axes + tooltip + legend shared by the line, bar, and area charts.\n * Colors are applied via `ChartContainer`'s CSS chrome, not inline props, so\n * these stay brand-safe.\n */\nexport const cartesianChrome = ({\n xKey,\n showGrid = true,\n showYAxis = true,\n showLegend = false,\n showTooltip = true,\n valueFormatter,\n}: Pick<\n CartesianChartProps,\n 'xKey' | 'showGrid' | 'showYAxis' | 'showLegend' | 'showTooltip' | 'valueFormatter'\n>) => (\n <>\n {showGrid && <CartesianGrid strokeDasharray=\"3 3\" vertical={false} />}\n <XAxis dataKey={xKey} {...AXIS_PROPS} />\n {showYAxis && (\n <YAxis\n width={48}\n {...AXIS_PROPS}\n tickFormatter={\n valueFormatter\n ? (value: string | number) => formatValue(value, valueFormatter)\n : undefined\n }\n />\n )}\n {showTooltip && (\n <ChartTooltip\n valueFormatter={valueFormatter ? (value) => formatValue(value, valueFormatter) : undefined}\n />\n )}\n {showLegend && <Legend wrapperStyle={{ fontSize: 11 }} />}\n </>\n);\n","/**\n * The design system ships a five-slot categorical chart palette as CSS\n * variables (`--chart-1` … `--chart-5`). Charts resolve their\n * series colors from these tokens only — never from inline hex or a primitive\n * scale — so they follow both the active color scheme (light/dark, via\n * `data-theme` in `styles.css`) and the active brand: a brand reskins charts\n * by defining `colors.chart` (and `colorsDark.chart`) in its\n * `@keboola/brand-registry` definition, which `ThemeProvider` emits as the\n * `--chart-*` variables.\n *\n * The CSS variables hold raw `R G B` channels (for Tailwind's `<alpha-value>`\n * opacity modifiers), so they are wrapped in `rgb(...)` before handing them to\n * recharts as ordinary SVG `stroke` / `fill` strings.\n */\nconst CHART_TOKEN_COUNT = 5;\n\n/** Number of the semantic chart token (`1`–`5`) a series maps to. */\nexport type ChartColorToken = 1 | 2 | 3 | 4 | 5;\n\n/**\n * The CSS color for a chart token. `index` is 0-based (series position); it\n * wraps around the five-slot palette so any number of series stays on-brand.\n */\nexport const chartTokenColor = (index: number): string => {\n // Euclidean modulo so negative indices still land in 1..CHART_TOKEN_COUNT\n // (plain `%` would yield e.g. `--chart-0` for index -1).\n const slot = (((index % CHART_TOKEN_COUNT) + CHART_TOKEN_COUNT) % CHART_TOKEN_COUNT) + 1;\n return `rgb(var(--chart-${slot}))`;\n};\n\n/** Resolve an explicit token (1–5) or fall back to the series position. */\nexport const resolveSeriesColor = (index: number, token?: ChartColorToken): string =>\n chartTokenColor(token ? token - 1 : index);\n","import { Line, LineChart as RechartsLineChart } from 'recharts';\n\nimport { cartesianChrome } from './cartesian';\nimport { ChartContainer } from './ChartContainer';\nimport { resolveSeriesColor } from './theme';\nimport { type CartesianChartProps } from './types';\n\n/**\n * A themed multi-series line chart. Each series' color comes from the semantic\n * `--chart-*` palette (by order, or pinned via `series[].color`), which\n * follows the active color scheme and the active brand's `colors.chart` when it\n * defines one. Wrap-free — mounts its own {@link ChartContainer}.\n *\n * @example\n * <LineChart\n * data={data}\n * xKey=\"month\"\n * series={[{ dataKey: 'revenue', name: 'Revenue' }, { dataKey: 'cost' }]}\n * />\n */\nexport const LineChart = ({\n data,\n xKey,\n series,\n height,\n width,\n className,\n ...chrome\n}: CartesianChartProps) => (\n <ChartContainer height={height} width={width} className={className}>\n <RechartsLineChart data={data} margin={{ top: 8, right: 8, left: 0, bottom: 0 }}>\n {cartesianChrome({ xKey, ...chrome })}\n {series.map((s, index) => {\n const color = resolveSeriesColor(index, s.color);\n return (\n <Line\n key={s.dataKey}\n type=\"monotone\"\n dataKey={s.dataKey}\n name={s.name ?? s.dataKey}\n stroke={color}\n strokeWidth={2}\n dot={{ r: 3, fill: color, stroke: color }}\n activeDot={{ r: 4 }}\n isAnimationActive={false}\n />\n );\n })}\n </RechartsLineChart>\n </ChartContainer>\n);\n","import { Bar, BarChart as RechartsBarChart } from 'recharts';\n\nimport { cartesianChrome } from './cartesian';\nimport { ChartContainer } from './ChartContainer';\nimport { resolveSeriesColor } from './theme';\nimport { type CartesianChartProps } from './types';\n\nexport type BarChartProps = CartesianChartProps & {\n /** Stack the series into a single bar per category. Defaults to grouped. */\n stacked?: boolean;\n};\n\n/**\n * A themed multi-series bar chart. Series colors come from the semantic\n * `--chart-*` palette (by order, or pinned via `series[].color`), which\n * follows the active color scheme and the active brand's `colors.chart` when it\n * defines one. Pass `stacked` to stack the series instead of grouping them.\n *\n * @example\n * <BarChart data={data} xKey=\"month\" series={[{ dataKey: 'revenue' }]} />\n */\nexport const BarChart = ({\n data,\n xKey,\n series,\n height,\n width,\n className,\n stacked = false,\n ...chrome\n}: BarChartProps) => (\n <ChartContainer height={height} width={width} className={className}>\n <RechartsBarChart data={data} margin={{ top: 8, right: 8, left: 0, bottom: 0 }}>\n {cartesianChrome({ xKey, ...chrome })}\n {series.map((s, index) => (\n <Bar\n key={s.dataKey}\n dataKey={s.dataKey}\n name={s.name ?? s.dataKey}\n fill={resolveSeriesColor(index, s.color)}\n radius={stacked ? 0 : [4, 4, 0, 0]}\n stackId={stacked ? 'stack' : undefined}\n isAnimationActive={false}\n />\n ))}\n </RechartsBarChart>\n </ChartContainer>\n);\n","import { Area, AreaChart as RechartsAreaChart } from 'recharts';\n\nimport { cartesianChrome } from './cartesian';\nimport { ChartContainer } from './ChartContainer';\nimport { resolveSeriesColor } from './theme';\nimport { type CartesianChartProps } from './types';\n\nexport type AreaChartProps = CartesianChartProps & {\n /** Stack the series into a cumulative area. Defaults to overlaid. */\n stacked?: boolean;\n};\n\n/**\n * A themed multi-series area chart. Each series is stroked and softly filled\n * from the semantic `--chart-*` palette (by order, or pinned via\n * `series[].color`), which follows the active color scheme and the active\n * brand's `colors.chart` when it defines one. Pass `stacked` to stack the\n * series cumulatively.\n *\n * @example\n * <AreaChart data={data} xKey=\"month\" series={[{ dataKey: 'revenue' }]} />\n */\nexport const AreaChart = ({\n data,\n xKey,\n series,\n height,\n width,\n className,\n stacked = false,\n ...chrome\n}: AreaChartProps) => (\n <ChartContainer height={height} width={width} className={className}>\n <RechartsAreaChart data={data} margin={{ top: 8, right: 8, left: 0, bottom: 0 }}>\n {cartesianChrome({ xKey, ...chrome })}\n {series.map((s, index) => {\n const color = resolveSeriesColor(index, s.color);\n return (\n <Area\n key={s.dataKey}\n type=\"monotone\"\n dataKey={s.dataKey}\n name={s.name ?? s.dataKey}\n stroke={color}\n fill={color}\n fillOpacity={0.15}\n strokeWidth={2}\n stackId={stacked ? 'stack' : undefined}\n isAnimationActive={false}\n />\n );\n })}\n </RechartsAreaChart>\n </ChartContainer>\n);\n","import { Cell, Legend, Pie, PieChart as RechartsPieChart } from 'recharts';\n\nimport { ChartContainer, type ChartDimension } from './ChartContainer';\nimport { ChartTooltip } from './ChartTooltip';\nimport { formatValue } from './format';\nimport { chartTokenColor } from './theme';\nimport { type ChartDatum } from './types';\n\nexport type PieChartProps = {\n /** The rows to plot — one sector per row. */\n data: ChartDatum[];\n /** Key into each datum for the sector label. */\n nameKey: string;\n /** Key into each datum for the sector value. */\n dataKey: string;\n /** Render as a donut with a hole of this inner radius (px or %). */\n innerRadius?: ChartDimension;\n /** Height as a px number or percentage. Defaults to 300. */\n height?: ChartDimension;\n /** Width as a px number or percentage. Defaults to `\"100%\"`. */\n width?: ChartDimension;\n /** Show a legend below the chart. Defaults to `true`. */\n showLegend?: boolean;\n /** Show the hover tooltip. Defaults to `true`. */\n showTooltip?: boolean;\n /** Format a sector value for the tooltip. */\n valueFormatter?: (value: number) => string;\n className?: string;\n};\n\n/**\n * A themed pie / donut chart. Each sector cycles through the semantic\n * `--chart-*` palette, which follows the active color scheme and the\n * active brand's `colors.chart` when it defines one. Pass `innerRadius` to make\n * a donut.\n *\n * @example\n * <PieChart data={data} nameKey=\"engine\" dataKey=\"rows\" innerRadius=\"60%\" />\n */\nexport const PieChart = ({\n data,\n nameKey,\n dataKey,\n innerRadius = 0,\n height,\n width,\n className,\n showLegend = true,\n showTooltip = true,\n valueFormatter,\n}: PieChartProps) => (\n <ChartContainer height={height} width={width} className={className}>\n <RechartsPieChart>\n {showTooltip && (\n <ChartTooltip\n valueFormatter={\n valueFormatter ? (value) => formatValue(value, valueFormatter) : undefined\n }\n />\n )}\n {showLegend && <Legend wrapperStyle={{ fontSize: 11 }} />}\n <Pie\n data={data}\n nameKey={nameKey}\n dataKey={dataKey}\n innerRadius={innerRadius}\n // Separate sectors with the brand surface color rather than recharts'\n // hardcoded white default.\n stroke=\"rgb(var(--background))\"\n isAnimationActive={false}\n >\n {data.map((datum, index) => (\n <Cell key={String(datum[nameKey] ?? index)} fill={chartTokenColor(index)} />\n ))}\n </Pie>\n </RechartsPieChart>\n </ChartContainer>\n);\n"]}
package/dist/charts.d.cts CHANGED
@@ -41,7 +41,7 @@ type ChartTooltipContentProps = {
41
41
  /**
42
42
  * Brand-themed tooltip body. Surfaces (background, border, text) resolve from
43
43
  * semantic tokens, and each series swatch reuses the recharts-provided series
44
- * `color` (already a `--color-chart-*` token from this package's charts).
44
+ * `color` (already a `--chart-*` token from this package's charts).
45
45
  */
46
46
  declare const ChartTooltipContent: ({ active, label, payload, valueFormatter, className, }: ChartTooltipContentProps) => react_jsx_runtime.JSX.Element | null;
47
47
  type ChartTooltipProps = ComponentProps<typeof Tooltip> & {
@@ -102,7 +102,7 @@ type CartesianChartProps = {
102
102
 
103
103
  /**
104
104
  * A themed multi-series line chart. Each series' color comes from the semantic
105
- * `--color-chart-*` palette (by order, or pinned via `series[].color`), which
105
+ * `--chart-*` palette (by order, or pinned via `series[].color`), which
106
106
  * follows the active color scheme and the active brand's `colors.chart` when it
107
107
  * defines one. Wrap-free — mounts its own {@link ChartContainer}.
108
108
  *
@@ -121,7 +121,7 @@ type BarChartProps = CartesianChartProps & {
121
121
  };
122
122
  /**
123
123
  * A themed multi-series bar chart. Series colors come from the semantic
124
- * `--color-chart-*` palette (by order, or pinned via `series[].color`), which
124
+ * `--chart-*` palette (by order, or pinned via `series[].color`), which
125
125
  * follows the active color scheme and the active brand's `colors.chart` when it
126
126
  * defines one. Pass `stacked` to stack the series instead of grouping them.
127
127
  *
@@ -136,7 +136,7 @@ type AreaChartProps = CartesianChartProps & {
136
136
  };
137
137
  /**
138
138
  * A themed multi-series area chart. Each series is stroked and softly filled
139
- * from the semantic `--color-chart-*` palette (by order, or pinned via
139
+ * from the semantic `--chart-*` palette (by order, or pinned via
140
140
  * `series[].color`), which follows the active color scheme and the active
141
141
  * brand's `colors.chart` when it defines one. Pass `stacked` to stack the
142
142
  * series cumulatively.
@@ -169,7 +169,7 @@ type PieChartProps = {
169
169
  };
170
170
  /**
171
171
  * A themed pie / donut chart. Each sector cycles through the semantic
172
- * `--color-chart-*` palette, which follows the active color scheme and the
172
+ * `--chart-*` palette, which follows the active color scheme and the
173
173
  * active brand's `colors.chart` when it defines one. Pass `innerRadius` to make
174
174
  * a donut.
175
175
  *
package/dist/charts.d.ts CHANGED
@@ -41,7 +41,7 @@ type ChartTooltipContentProps = {
41
41
  /**
42
42
  * Brand-themed tooltip body. Surfaces (background, border, text) resolve from
43
43
  * semantic tokens, and each series swatch reuses the recharts-provided series
44
- * `color` (already a `--color-chart-*` token from this package's charts).
44
+ * `color` (already a `--chart-*` token from this package's charts).
45
45
  */
46
46
  declare const ChartTooltipContent: ({ active, label, payload, valueFormatter, className, }: ChartTooltipContentProps) => react_jsx_runtime.JSX.Element | null;
47
47
  type ChartTooltipProps = ComponentProps<typeof Tooltip> & {
@@ -102,7 +102,7 @@ type CartesianChartProps = {
102
102
 
103
103
  /**
104
104
  * A themed multi-series line chart. Each series' color comes from the semantic
105
- * `--color-chart-*` palette (by order, or pinned via `series[].color`), which
105
+ * `--chart-*` palette (by order, or pinned via `series[].color`), which
106
106
  * follows the active color scheme and the active brand's `colors.chart` when it
107
107
  * defines one. Wrap-free — mounts its own {@link ChartContainer}.
108
108
  *
@@ -121,7 +121,7 @@ type BarChartProps = CartesianChartProps & {
121
121
  };
122
122
  /**
123
123
  * A themed multi-series bar chart. Series colors come from the semantic
124
- * `--color-chart-*` palette (by order, or pinned via `series[].color`), which
124
+ * `--chart-*` palette (by order, or pinned via `series[].color`), which
125
125
  * follows the active color scheme and the active brand's `colors.chart` when it
126
126
  * defines one. Pass `stacked` to stack the series instead of grouping them.
127
127
  *
@@ -136,7 +136,7 @@ type AreaChartProps = CartesianChartProps & {
136
136
  };
137
137
  /**
138
138
  * A themed multi-series area chart. Each series is stroked and softly filled
139
- * from the semantic `--color-chart-*` palette (by order, or pinned via
139
+ * from the semantic `--chart-*` palette (by order, or pinned via
140
140
  * `series[].color`), which follows the active color scheme and the active
141
141
  * brand's `colors.chart` when it defines one. Pass `stacked` to stack the
142
142
  * series cumulatively.
@@ -169,7 +169,7 @@ type PieChartProps = {
169
169
  };
170
170
  /**
171
171
  * A themed pie / donut chart. Each sector cycles through the semantic
172
- * `--color-chart-*` palette, which follows the active color scheme and the
172
+ * `--chart-*` palette, which follows the active color scheme and the
173
173
  * active brand's `colors.chart` when it defines one. Pass `innerRadius` to make
174
174
  * a donut.
175
175
  *
package/dist/charts.js CHANGED
@@ -5,7 +5,7 @@ import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
5
5
 
6
6
  // src/blocks/Charts/ChartContainer.tsx
7
7
  var twMerge = extendTailwindMerge({
8
- prefix: "tw-"
8
+ prefix: "tw"
9
9
  });
10
10
  var cn = (...classes) => twMerge(clsx(...classes));
11
11
  var ChartContainer = ({
@@ -18,19 +18,19 @@ var ChartContainer = ({
18
18
  "div",
19
19
  {
20
20
  className: cn(
21
- "tw-text-xs",
21
+ "tw:text-xs",
22
22
  // Axis ticks and labels follow the muted foreground token.
23
- "[&_.recharts-cartesian-axis-tick_text]:tw-fill-muted-foreground",
24
- "[&_.recharts-polar-angle-axis-tick_text]:tw-fill-muted-foreground",
25
- "[&_.recharts-label]:tw-fill-muted-foreground",
26
- "[&_.recharts-legend-item-text]:!tw-text-muted-foreground",
23
+ "tw:[&_.recharts-cartesian-axis-tick_text]:fill-muted-foreground",
24
+ "tw:[&_.recharts-polar-angle-axis-tick_text]:fill-muted-foreground",
25
+ "tw:[&_.recharts-label]:fill-muted-foreground",
26
+ "tw:[&_.recharts-legend-item-text]:!text-muted-foreground",
27
27
  // Grid lines, axis lines and the hover cursor follow the border token.
28
- "[&_.recharts-cartesian-grid_line]:tw-stroke-border/60",
29
- "[&_.recharts-cartesian-axis-line]:tw-stroke-border",
30
- "[&_.recharts-cartesian-axis-tick-line]:tw-stroke-border",
31
- "[&_.recharts-curve.recharts-tooltip-cursor]:tw-stroke-border",
32
- "[&_.recharts-rectangle.recharts-tooltip-cursor]:tw-fill-muted/60",
33
- "[&_.recharts-surface]:tw-outline-none",
28
+ "tw:[&_.recharts-cartesian-grid_line]:stroke-border/60",
29
+ "tw:[&_.recharts-cartesian-axis-line]:stroke-border",
30
+ "tw:[&_.recharts-cartesian-axis-tick-line]:stroke-border",
31
+ "tw:[&_.recharts-curve.recharts-tooltip-cursor]:stroke-border",
32
+ "tw:[&_.recharts-rectangle.recharts-tooltip-cursor]:fill-muted/60",
33
+ "tw:[&_.recharts-surface]:outline-hidden",
34
34
  className
35
35
  ),
36
36
  ...props,
@@ -49,12 +49,12 @@ var ChartTooltipContent = ({
49
49
  "div",
50
50
  {
51
51
  className: cn(
52
- "tw-min-w-32 tw-rounded-md tw-border tw-border-border tw-bg-popover tw-px-2.5 tw-py-1.5 tw-text-xs tw-text-popover-foreground tw-shadow-md",
52
+ "tw:min-w-32 tw:rounded-md tw:border tw:border-border tw:bg-popover tw:px-2.5 tw:py-1.5 tw:text-xs tw:text-popover-foreground tw:shadow-md",
53
53
  className
54
54
  ),
55
55
  children: [
56
- label != null && /* @__PURE__ */ jsx("div", { className: "tw-mb-1 tw-font-medium", children: label }),
57
- /* @__PURE__ */ jsx("div", { className: "tw-flex tw-flex-col tw-gap-1", children: payload.map((entry) => {
56
+ label != null && /* @__PURE__ */ jsx("div", { className: "tw:mb-1 tw:font-medium", children: label }),
57
+ /* @__PURE__ */ jsx("div", { className: "tw:flex tw:flex-col tw:gap-1", children: payload.map((entry) => {
58
58
  const name = String(entry.name ?? entry.dataKey ?? "");
59
59
  const value = entry.value;
60
60
  const hasNumber = value != null && value !== "" && Number.isFinite(Number(value));
@@ -62,19 +62,19 @@ var ChartTooltipContent = ({
62
62
  return /* @__PURE__ */ jsxs(
63
63
  "div",
64
64
  {
65
- className: "tw-flex tw-items-center tw-justify-between tw-gap-3",
65
+ className: "tw:flex tw:items-center tw:justify-between tw:gap-3",
66
66
  children: [
67
- /* @__PURE__ */ jsxs("span", { className: "tw-flex tw-items-center tw-gap-1.5", children: [
67
+ /* @__PURE__ */ jsxs("span", { className: "tw:flex tw:items-center tw:gap-1.5", children: [
68
68
  /* @__PURE__ */ jsx(
69
69
  "span",
70
70
  {
71
- className: "tw-size-2 tw-shrink-0 tw-rounded-[2px]",
71
+ className: "tw:size-2 tw:shrink-0 tw:rounded-[2px]",
72
72
  style: { backgroundColor: entry.color }
73
73
  }
74
74
  ),
75
- /* @__PURE__ */ jsx("span", { className: "tw-text-muted-foreground", children: name })
75
+ /* @__PURE__ */ jsx("span", { className: "tw:text-muted-foreground", children: name })
76
76
  ] }),
77
- /* @__PURE__ */ jsx("span", { className: "tw-font-medium tw-tabular-nums", children: display })
77
+ /* @__PURE__ */ jsx("span", { className: "tw:font-medium tw:tabular-nums", children: display })
78
78
  ]
79
79
  },
80
80
  String(entry.dataKey ?? name)
@@ -136,7 +136,7 @@ var cartesianChrome = ({
136
136
  var CHART_TOKEN_COUNT = 5;
137
137
  var chartTokenColor = (index) => {
138
138
  const slot = (index % CHART_TOKEN_COUNT + CHART_TOKEN_COUNT) % CHART_TOKEN_COUNT + 1;
139
- return `rgb(var(--color-chart-${slot}))`;
139
+ return `rgb(var(--chart-${slot}))`;
140
140
  };
141
141
  var resolveSeriesColor = (index, token) => chartTokenColor(token ? token - 1 : index);
142
142
  var LineChart = ({
@@ -247,7 +247,7 @@ var PieChart = ({
247
247
  nameKey,
248
248
  dataKey,
249
249
  innerRadius,
250
- stroke: "rgb(var(--color-background))",
250
+ stroke: "rgb(var(--background))",
251
251
  isAnimationActive: false,
252
252
  children: data.map((datum, index) => /* @__PURE__ */ jsx(Cell, { fill: chartTokenColor(index) }, String(datum[nameKey] ?? index)))
253
253
  }