@acronis-platform/ui-react 0.58.0 → 0.60.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 (73) hide show
  1. package/dist/components/ui/area-chart/area-chart.js +91 -63
  2. package/dist/components/ui/area-chart/area-chart.js.map +1 -1
  3. package/dist/components/ui/bar-chart/bar-chart.js +104 -73
  4. package/dist/components/ui/bar-chart/bar-chart.js.map +1 -1
  5. package/dist/components/ui/calendar/calendar.js +17 -15
  6. package/dist/components/ui/calendar/calendar.js.map +1 -1
  7. package/dist/components/ui/carousel-dialog/carousel-dialog.js +87 -0
  8. package/dist/components/ui/carousel-dialog/carousel-dialog.js.map +1 -0
  9. package/dist/components/ui/category-bar/category-bar.js +126 -0
  10. package/dist/components/ui/category-bar/category-bar.js.map +1 -0
  11. package/dist/components/ui/chart/chart-format.js +40 -0
  12. package/dist/components/ui/chart/chart-format.js.map +1 -0
  13. package/dist/components/ui/chart/chart.js.map +1 -1
  14. package/dist/components/ui/composed-chart/composed-chart.js +91 -63
  15. package/dist/components/ui/composed-chart/composed-chart.js.map +1 -1
  16. package/dist/components/ui/confidence-cone/confidence-cone.js +113 -85
  17. package/dist/components/ui/confidence-cone/confidence-cone.js.map +1 -1
  18. package/dist/components/ui/dialog/dialog.js +29 -29
  19. package/dist/components/ui/dialog/dialog.js.map +1 -1
  20. package/dist/components/ui/dialog-footer-carousel/dialog-footer-carousel.js +57 -0
  21. package/dist/components/ui/dialog-footer-carousel/dialog-footer-carousel.js.map +1 -0
  22. package/dist/components/ui/dialog-footer-default/dialog-footer-default.js +1 -1
  23. package/dist/components/ui/dialog-footer-default/dialog-footer-default.js.map +1 -1
  24. package/dist/components/ui/dialog-welcome/dialog-welcome.js +272 -0
  25. package/dist/components/ui/dialog-welcome/dialog-welcome.js.map +1 -0
  26. package/dist/components/ui/histogram/histogram.js +89 -61
  27. package/dist/components/ui/histogram/histogram.js.map +1 -1
  28. package/dist/components/ui/input/input.js.map +1 -1
  29. package/dist/components/ui/line-chart/line-chart.js +120 -92
  30. package/dist/components/ui/line-chart/line-chart.js.map +1 -1
  31. package/dist/components/ui/sankey-chart/sankey-chart.js +192 -0
  32. package/dist/components/ui/sankey-chart/sankey-chart.js.map +1 -0
  33. package/dist/components/ui/scatter-chart/scatter-chart.js +79 -51
  34. package/dist/components/ui/scatter-chart/scatter-chart.js.map +1 -1
  35. package/dist/components/ui/toolbar/toolbar.js +82 -92
  36. package/dist/components/ui/toolbar/toolbar.js.map +1 -1
  37. package/dist/index.js +461 -439
  38. package/dist/index.js.map +1 -1
  39. package/dist/lib/breakpoints.js +9 -6
  40. package/dist/lib/breakpoints.js.map +1 -1
  41. package/dist/node_modules/.pnpm/embla-carousel-react@8.6.0_react@19.2.6/node_modules/embla-carousel-react/esm/embla-carousel-react.esm.js +25 -0
  42. package/dist/node_modules/.pnpm/embla-carousel-react@8.6.0_react@19.2.6/node_modules/embla-carousel-react/esm/embla-carousel-react.esm.js.map +1 -0
  43. package/dist/node_modules/.pnpm/embla-carousel-reactive-utils@8.6.0_embla-carousel@8.6.0/node_modules/embla-carousel-reactive-utils/esm/embla-carousel-reactive-utils.esm.js +36 -0
  44. package/dist/node_modules/.pnpm/embla-carousel-reactive-utils@8.6.0_embla-carousel@8.6.0/node_modules/embla-carousel-reactive-utils/esm/embla-carousel-reactive-utils.esm.js.map +1 -0
  45. package/dist/node_modules/.pnpm/embla-carousel@8.6.0/node_modules/embla-carousel/esm/embla-carousel.esm.js +1205 -0
  46. package/dist/node_modules/.pnpm/embla-carousel@8.6.0/node_modules/embla-carousel/esm/embla-carousel.esm.js.map +1 -0
  47. package/dist/react.js +461 -439
  48. package/dist/react.js.map +1 -1
  49. package/dist/src/components/ui/area-chart/area-chart.d.ts +2 -17
  50. package/dist/src/components/ui/bar-chart/bar-chart.d.ts +2 -17
  51. package/dist/src/components/ui/carousel-dialog/carousel-dialog.d.ts +28 -0
  52. package/dist/src/components/ui/carousel-dialog/index.d.ts +1 -0
  53. package/dist/src/components/ui/category-bar/category-bar.d.ts +51 -0
  54. package/dist/src/components/ui/category-bar/index.d.ts +1 -0
  55. package/dist/src/components/ui/chart/__tests__/chart-format.test.d.ts +1 -0
  56. package/dist/src/components/ui/chart/chart-format.d.ts +111 -0
  57. package/dist/src/components/ui/chart/chart.d.ts +2 -0
  58. package/dist/src/components/ui/chart/index.d.ts +3 -1
  59. package/dist/src/components/ui/composed-chart/composed-chart.d.ts +2 -17
  60. package/dist/src/components/ui/confidence-cone/confidence-cone.d.ts +2 -19
  61. package/dist/src/components/ui/dialog-footer-carousel/dialog-footer-carousel.d.ts +9 -0
  62. package/dist/src/components/ui/dialog-footer-carousel/index.d.ts +1 -0
  63. package/dist/src/components/ui/dialog-welcome/dialog-welcome.d.ts +54 -0
  64. package/dist/src/components/ui/dialog-welcome/dialog-welcome.docs.d.ts +55 -0
  65. package/dist/src/components/ui/dialog-welcome/index.d.ts +1 -0
  66. package/dist/src/components/ui/histogram/histogram.d.ts +2 -17
  67. package/dist/src/components/ui/line-chart/line-chart.d.ts +2 -17
  68. package/dist/src/components/ui/sankey-chart/index.d.ts +2 -0
  69. package/dist/src/components/ui/sankey-chart/sankey-chart.d.ts +69 -0
  70. package/dist/src/components/ui/scatter-chart/scatter-chart.d.ts +2 -17
  71. package/dist/src/index.d.ts +5 -0
  72. package/dist/ui-react.css +1 -1
  73. package/package.json +5 -4
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sankey-chart.js","sources":["../../../../src/components/ui/sankey-chart/sankey-chart.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { Sankey as RechartsSankey, Rectangle } from 'recharts';\n\nimport { cn } from '@/lib/utils';\nimport {\n ChartContainer,\n ChartStyle,\n ChartTooltip,\n type ChartConfig,\n} from '../chart';\n\n// A typed recharts composition over the shared `Chart` primitives — a flow\n// diagram where link width is proportional to the value flowing between nodes.\n// Like Treemap/Funnel it's a single recharts element (`<Sankey>`) themed through\n// custom `node` / `link` renderers (recharts' defaults paint one flat grey and\n// carry no token hooks). No CVA variant: a Sankey's expressiveness is the\n// nodes/links graph + geometry (plain props), not a visual \"mode\".\n//\n// Node `name`s are the color keys: each must match a `config` entry, so they\n// must be CSS-safe (they become part of a `--color-<name>` custom property).\n// The human-readable text comes from `config[name].label`.\n\n/** A node in the flow — `name` is its color/config key (CSS-safe, unique). */\nexport interface SankeyChartNode {\n name: string;\n}\n\n/** A directed flow between two nodes, referenced by their index in `nodes`. */\nexport interface SankeyChartLink {\n /** Index of the source node in `data.nodes`. */\n source: number;\n /** Index of the target node in `data.nodes`. */\n target: number;\n /** Flow magnitude — drives the link's width. */\n value: number;\n /**\n * Ribbon color (any CSS color, e.g. a `var(--ui-*)` token), rendered at **full\n * opacity** so it matches its node bar. Omit to use the target node's color at\n * 35% (the default tinted ribbon).\n */\n color?: string;\n}\n\nexport interface SankeyChartProps\n extends Omit<React.ComponentProps<'div'>, 'children'> {\n /** The graph: `nodes` (color keys) + `links` (source/target indices + value). */\n data: {\n nodes: ReadonlyArray<SankeyChartNode>;\n links: ReadonlyArray<SankeyChartLink>;\n };\n /**\n * Per-node map of `label` / `color`, keyed by the node's `name` (imported from\n * the shared `Chart` primitives). Turned into `--color-<name>` custom\n * properties. Colors are caller-supplied — reference an existing semantic\n * `--ui-*` token; there is no chart palette tier yet.\n */\n config: ChartConfig;\n /** Vertical gap between nodes in the same column. */\n nodePadding?: number;\n /** Thickness of each node bar. */\n nodeWidth?: number;\n /** Curviness of the links (0 = straight, 1 = fully curved). */\n linkCurvature?: number;\n /**\n * Sort nodes vertically to minimize link crossings (recharts' relaxation).\n * Defaults to `false` — nodes render in the order given by `data.nodes` within\n * each column, which keeps curated flows tidy; set `true` to auto-order.\n */\n sort?: boolean;\n /** Render each node's label (from `config[name].label`) beside its bar. */\n showLabels?: boolean;\n /** Render a legend (color dot + label + value + % per node) below the chart. */\n showLegend?: boolean;\n /** Show a hover tooltip on nodes and links (dot + `source → target` + value). */\n showTooltip?: boolean;\n /**\n * Replace the default tooltip. Pass a configured `ChartTooltipContent`\n * (imported from this library) — e.g. with a `formatter` / `labelFormatter` —\n * to customize formatting without composing recharts yourself. Ignored when\n * `showTooltip` is false.\n */\n tooltipContent?: React.ComponentProps<typeof ChartTooltip>['content'];\n}\n\n// recharts injects these into the `node` / `link` render functions but doesn't\n// export their prop types from the package root, so we type the fields we use\n// (structurally compatible with recharts' internal NodeProps / LinkProps).\ninterface SankeyNodeShapeProps {\n x: number;\n y: number;\n width: number;\n height: number;\n index: number;\n payload: { name: string; value: number };\n}\n\ninterface SankeyLinkShapeProps {\n sourceX: number;\n targetX: number;\n sourceY: number;\n targetY: number;\n sourceControlX: number;\n targetControlX: number;\n linkWidth: number;\n // recharts spreads the original link onto `payload` (then overrides\n // source/target with node objects), so a custom `color` survives here.\n payload: {\n source: { name: string };\n target: { name: string };\n value: number;\n color?: string;\n };\n}\n\n// Node bar: a rect filled from `--color-<name>`, with the config label placed on\n// whichever side keeps it inside the plot — to the right for nodes that have\n// outgoing links (sources), to the left for terminal nodes (sinks).\nfunction makeNodeRenderer(\n config: ChartConfig,\n sourceIndices: ReadonlySet<number>,\n showLabels: boolean\n) {\n return function SankeyNodeShape({\n x,\n y,\n width,\n height,\n index,\n payload,\n }: SankeyNodeShapeProps) {\n const name = String(payload.name);\n const label = config[name]?.label ?? name;\n const isSource = sourceIndices.has(index);\n return (\n <g>\n <Rectangle\n x={x}\n y={y}\n width={width}\n height={height}\n fill={`var(--color-${name})`}\n radius={2}\n />\n {showLabels && (\n <text\n x={isSource ? x + width + 6 : x - 6}\n y={y + height / 2}\n textAnchor={isSource ? 'start' : 'end'}\n dominantBaseline=\"middle\"\n className=\"fill-foreground text-xs\"\n >\n {label}\n </text>\n )}\n </g>\n );\n };\n}\n\n// Link ribbon: a bezier stroked at 35% opacity in the link's own `color` if\n// given (recharts preserves custom link fields on the render `payload`), else\n// the **target** node's color (so a flow reads as \"where it goes\"). Drawn as a\n// stroke, not a fill, so the ribbon width comes from `linkWidth`.\nfunction SankeyLinkShape({\n sourceX,\n targetX,\n sourceY,\n targetY,\n sourceControlX,\n targetControlX,\n linkWidth,\n payload,\n}: SankeyLinkShapeProps) {\n const targetName = String(payload.target.name);\n const stroke = payload.color ?? `var(--color-${targetName})`;\n return (\n <path\n d={`M${sourceX},${sourceY}C${sourceControlX},${sourceY} ${targetControlX},${targetY} ${targetX},${targetY}`}\n fill=\"none\"\n stroke={stroke}\n strokeWidth={Math.max(1, linkWidth)}\n // An explicit per-link color is the caller's exact choice — render it at\n // full opacity (so it matches its node bar); the default target-tint is\n // dimmed to 35% so ribbons don't overwhelm the nodes.\n strokeOpacity={payload.color ? 1 : 0.35}\n />\n );\n}\n\n// Default tooltip: recharts' Sankey payload carries no config color, and labels\n// a hovered link \"source - target\" using the node keys (a node is a single key).\n// Parse that name to a color dot (the target node's color) + the mapped config\n// labels joined with an arrow + the value — driven by `config`, so it's reliable\n// where the shared ChartTooltipContent can't resolve the Sankey payload.\n//\n// Exported (module-only, not from the package barrel) so its branches can be\n// unit-tested directly: recharts can't lay out a Sankey in happy-dom, and its\n// hover tooltip has no statically-open form the component exposes, so rendering\n// `<SankeyChart>` never reaches this code.\nexport function makeSankeyTooltip(\n config: ChartConfig,\n links: ReadonlyArray<SankeyChartLink>,\n nodes: ReadonlyArray<SankeyChartNode>\n) {\n const labelFor = (key: string): React.ReactNode => config[key]?.label ?? key;\n // Resolve each link's dot color by its \"source - target\" name (which is the\n // tooltip item's name): the link's own color if set, else the target's, via\n // the `--color-<name>` bridge so a per-theme config resolves too.\n const styleByName = new Map<string, { color: string; opacity: number }>();\n for (const link of links) {\n const source = nodes[link.source]?.name ?? '';\n const target = nodes[link.target]?.name ?? '';\n // Mirror the ribbon: an explicit color renders full-opacity; the default\n // target tint renders at 35%.\n styleByName.set(source + ' - ' + target, {\n color: link.color ?? `var(--color-${target})`,\n opacity: link.color ? 1 : 0.35,\n });\n }\n\n return function SankeyTooltipContent({\n active,\n payload,\n }: {\n active?: boolean;\n payload?: ReadonlyArray<{\n name?: string | number;\n value?: number | string | ReadonlyArray<number | string>;\n }>;\n }) {\n if (!active || !payload?.length) return null;\n const item = payload[0];\n const parts = String(item?.name ?? '').split(' - ');\n const targetKey = parts[parts.length - 1];\n const linkStyle = styleByName.get(String(item?.name ?? ''));\n const dotColor = linkStyle?.color ?? `var(--color-${targetKey})`;\n const dotOpacity = linkStyle?.opacity ?? 1;\n const value = item?.value;\n return (\n <div className=\"flex items-center gap-2 rounded-[var(--ui-tooltip-container-border-radius)] border border-border bg-background px-[var(--ui-tooltip-container-padding-x)] py-[var(--ui-tooltip-container-padding-y)] text-xs text-foreground shadow-md\">\n <span\n className=\"h-2.5 w-2.5 shrink-0 rounded-[2px]\"\n style={{ backgroundColor: dotColor, opacity: dotOpacity }}\n />\n <span className=\"text-muted-foreground\">\n {/* A config label can be any ReactNode, so the arrow-joined label is\n built as nodes rather than stringified. */}\n {parts.map((key, index) => (\n <React.Fragment key={`${key}-${index}`}>\n {index > 0 && ' → '}\n {labelFor(key)}\n </React.Fragment>\n ))}\n </span>\n {value != null && (\n <span className=\"ms-2 font-medium tabular-nums\">\n {formatTooltipValue(value)}\n </span>\n )}\n </div>\n );\n };\n}\n\n// recharts types a tooltip item's value as a scalar *or* a range tuple; a plain\n// `String()` would print \"1,2\" for the tuple, so format each part and join.\nfunction formatTooltipValue(\n value: number | string | ReadonlyArray<number | string>\n): string {\n if (Array.isArray(value)) {\n return value.map((part) => formatTooltipValue(part)).join(' – ');\n }\n return typeof value === 'number'\n ? value.toLocaleString()\n : String(value as string);\n}\n\nconst SankeyChart = React.forwardRef<HTMLDivElement, SankeyChartProps>(\n (\n {\n className,\n config,\n data,\n nodePadding = 24,\n nodeWidth = 12,\n linkCurvature = 0.5,\n sort = false,\n showLabels = true,\n showLegend = false,\n showTooltip = true,\n tooltipContent,\n ...props\n },\n ref\n ) => {\n const uniqueId = React.useId();\n const chartId = `chart-${uniqueId.replace(/:/g, '')}`;\n\n // Node indices that appear as a link `source` have outgoing flow — used by\n // the node renderer to place the label on the readable side.\n const sourceIndices = React.useMemo(\n () => new Set(data.links.map((link) => link.source)),\n [data.links]\n );\n\n const nodeRenderer = React.useMemo(\n () => makeNodeRenderer(config, sourceIndices, showLabels),\n [config, sourceIndices, showLabels]\n );\n\n const defaultTooltip = React.useMemo(\n () => makeSankeyTooltip(config, data.links, data.nodes),\n [config, data.links, data.nodes]\n );\n\n // Per-node value (incoming flow, or outgoing for a source with no incoming)\n // and its share of the largest node — drives the legend's count + %.\n const nodeStats = React.useMemo(() => {\n const incoming = new Map<number, number>();\n const outgoing = new Map<number, number>();\n for (const link of data.links) {\n outgoing.set(link.source, (outgoing.get(link.source) ?? 0) + link.value);\n incoming.set(link.target, (incoming.get(link.target) ?? 0) + link.value);\n }\n const values = data.nodes.map(\n (_, i) => incoming.get(i) ?? outgoing.get(i) ?? 0\n );\n const total = values.length ? Math.max(...values) : 0;\n return data.nodes.map((node, i) => ({\n name: node.name,\n value: values[i],\n pct: total > 0 ? Math.round((values[i] / total) * 100) : 0,\n }));\n }, [data]);\n\n return (\n <div\n ref={ref}\n // The legend sits outside `ChartContainer`, so the root carries its own\n // `--color-<name>` scope for it (the plot and the recharts-portaled\n // tooltip resolve theirs from ChartContainer's).\n data-chart={chartId}\n className={cn('flex flex-col', className)}\n {...props}\n >\n <ChartStyle id={chartId} config={config} />\n <ChartContainer config={config} className=\"min-h-0 flex-1\">\n <RechartsSankey\n data={data as { nodes: SankeyChartNode[]; links: SankeyChartLink[] }}\n node={nodeRenderer}\n link={SankeyLinkShape}\n nodePadding={nodePadding}\n nodeWidth={nodeWidth}\n linkCurvature={linkCurvature}\n sort={sort}\n // recharts defaults to `justify`, which right-aligns sink nodes to\n // the last column — so a terminal node like \"No certification\" would\n // jump to the far right instead of staying at its real depth. `left`\n // positions every node by its distance from the source, keeping the\n // flow's columns intact.\n align=\"left\"\n // Node labels never extend past the plot's right edge: a node in the\n // last column has no outgoing links, so its label is drawn to the\n // LEFT of its bar (see the node renderer). Only a small gutter is\n // needed here — a wide reserve would just shrink the diagram.\n margin={{ top: 8, right: 24, bottom: 8, left: 24 }}\n >\n {showTooltip && (\n <ChartTooltip content={tooltipContent ?? defaultTooltip} />\n )}\n </RechartsSankey>\n </ChartContainer>\n {showLegend && (\n <div className=\"mt-3 grid grid-cols-2 gap-x-6 gap-y-1.5 text-xs\">\n {nodeStats.map(({ name, value, pct }) => (\n <div key={name} className=\"flex items-center gap-2\">\n <span\n className=\"size-2.5 shrink-0 rounded-full\"\n style={{ backgroundColor: `var(--color-${name})` }}\n />\n <span className=\"truncate text-muted-foreground\">\n {config[name]?.label ?? name}\n </span>\n <span className=\"ms-auto font-semibold tabular-nums\">\n {value.toLocaleString()}\n </span>\n <span className=\"w-9 shrink-0 text-end tabular-nums text-muted-foreground\">\n {pct}%\n </span>\n </div>\n ))}\n </div>\n )}\n </div>\n );\n }\n);\nSankeyChart.displayName = 'SankeyChart';\n\nexport { SankeyChart };\n"],"names":["makeNodeRenderer","config","sourceIndices","showLabels","x","y","width","height","index","payload","name","label","_a","isSource","jsx","Rectangle","SankeyLinkShape","sourceX","targetX","sourceY","targetY","sourceControlX","targetControlX","linkWidth","targetName","stroke","makeSankeyTooltip","links","nodes","labelFor","key","styleByName","link","source","target","_b","active","item","parts","targetKey","linkStyle","dotColor","dotOpacity","value","jsxs","React","formatTooltipValue","part","SankeyChart","className","data","nodePadding","nodeWidth","linkCurvature","sort","showLegend","showTooltip","tooltipContent","props","ref","chartId","nodeRenderer","defaultTooltip","nodeStats","incoming","outgoing","values","_","i","total","node","cn","ChartStyle","ChartContainer","RechartsSankey","ChartTooltip","pct"],"mappings":";;;;;AAuHA,SAASA,EACPC,GACAC,GACAC,GACA;AACA,SAAO,SAAyB;AAAA,IAC9B,GAAAC;AAAA,IACA,GAAAC;AAAA,IACA,OAAAC;AAAA,IACA,QAAAC;AAAA,IACA,OAAAC;AAAA,IACA,SAAAC;AAAA,EAAA,GACuB;;AACvB,UAAMC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AAAA,cACN,MAAM7C;AAAA,cACN,aAAAmC;AAAA,cACA,WAAAC;AAAA,cACA,eAAAC;AAAA,cACA,MAAAC;AAAA,cAMA,OAAM;AAAA,cAKN,QAAQ,EAAE,KAAK,GAAG,OAAO,IAAI,QAAQ,GAAG,MAAM,GAAA;AAAA,cAE7C,UAAAE,KACC,gBAAA1C,EAAC6D,GAAA,EAAa,SAASlB,KAAkBK,EAAA,CAAgB;AAAA,YAAA;AAAA,UAAA,GAG/D;AAAA,UACCP,KACC,gBAAAzC,EAAC,OAAA,EAAI,WAAU,mDACZ,YAAU,IAAI,CAAC,EAAE,MAAAJ,GAAM,OAAAiC,GAAO,KAAAiC,EAAA;;AAC7B,mCAAAhC,EAAC,OAAA,EAAe,WAAU,2BACxB,UAAA;AAAA,cAAA,gBAAA9B;AAAA,gBAAC;AAAA,gBAAA;AAAA,kBACC,WAAU;AAAA,kBACV,OAAO,EAAE,iBAAiB,eAAeJ,CAAI,IAAA;AAAA,gBAAI;AAAA,cAAA;AAAA,cAEnD,gBAAAI,EAAC,UAAK,WAAU,kCACb,kBAAOJ,CAAI,wBAAG,UAASA,GAC1B;AAAA,gCACC,QAAA,EAAK,WAAU,sCACb,UAAAiC,EAAM,kBACT;AAAA,cACA,gBAAAC,EAAC,QAAA,EAAK,WAAU,4DACb,UAAA;AAAA,gBAAAgC;AAAA,gBAAI;AAAA,cAAA,EAAA,CACP;AAAA,YAAA,EAAA,GAbQlE,CAcV;AAAA,WACD,EAAA,CACH;AAAA,QAAA;AAAA,MAAA;AAAA,IAAA;AAAA,EAIR;AACF;AACAsC,EAAY,cAAc;"}
@@ -1,92 +1,120 @@
1
- import { jsx as t, jsxs as S } from "react/jsx-runtime";
2
- import * as A from "react";
3
- import { ScatterChart as T, CartesianGrid as b, XAxis as L, YAxis as N, ZAxis as j, Scatter as w } from "recharts";
4
- import { cn as M } from "../../../lib/utils.js";
5
- import { ChartContainer as R, ChartTooltip as $, ChartTooltipContent as B, ChartLegend as D, ChartLegendContent as G } from "../chart/chart.js";
6
- const X = A.forwardRef(
1
+ import { jsx as t, jsxs as H } from "react/jsx-runtime";
2
+ import * as X from "react";
3
+ import { ScatterChart as Y, CartesianGrid as Z, XAxis as _, YAxis as q, ZAxis as z, Scatter as E } from "recharts";
4
+ import { cn as I } from "../../../lib/utils.js";
5
+ import { ChartContainer as J, ChartTooltip as O, ChartTooltipContent as P, ChartLegend as Q, ChartLegendContent as U } from "../chart/chart.js";
6
+ import { resolveAxisDomain as V } from "../chart/chart-format.js";
7
+ const W = X.forwardRef(
7
8
  ({
8
- className: l,
9
+ className: c,
9
10
  config: s,
10
- series: c,
11
+ series: m,
11
12
  xKey: n,
12
- yKey: o,
13
- zKey: a,
14
- zRange: m = [60, 400],
15
- shape: d = "circle",
13
+ yKey: l,
14
+ zKey: i,
15
+ zRange: d = [60, 400],
16
+ shape: h = "circle",
16
17
  xAxisLabel: r,
17
- yAxisLabel: i,
18
- xUnit: f,
19
- yUnit: h,
18
+ yAxisLabel: o,
19
+ xUnit: u,
20
+ yUnit: f,
20
21
  showGrid: p = !0,
21
- showTooltip: u = !0,
22
+ showTooltip: v = !0,
22
23
  showLegend: C = !0,
23
- tooltipContent: g,
24
- ...v
25
- }, k) => {
26
- const y = r ? { value: r, position: "insideBottom", offset: -8 } : void 0, x = i ? {
27
- value: i,
24
+ showXAxis: k = !0,
25
+ showYAxis: g = !0,
26
+ xTickFormatter: y,
27
+ yTickFormatter: S,
28
+ xAxisAngle: e,
29
+ xAxisInterval: D,
30
+ yAxisTickCount: T,
31
+ yAxisDomain: N,
32
+ gridDashed: b,
33
+ gridHorizontal: j,
34
+ gridVertical: w,
35
+ tooltipContent: F,
36
+ ...L
37
+ }, M) => {
38
+ const R = r ? { value: r, position: "insideBottom", offset: -8 } : void 0, $ = o ? {
39
+ value: o,
28
40
  angle: -90,
29
41
  position: "insideLeft",
30
42
  style: { textAnchor: "middle" }
31
- } : void 0;
32
- return /* @__PURE__ */ t("div", { ref: k, className: M(l), ...v, children: /* @__PURE__ */ t(
33
- R,
43
+ } : void 0, B = V(N), G = r || e != null ? 30 + (e != null ? 20 : 0) + (r ? 18 : 0) : void 0;
44
+ return /* @__PURE__ */ t("div", { ref: M, className: I(c), ...L, children: /* @__PURE__ */ t(
45
+ J,
34
46
  {
35
47
  config: s,
36
48
  className: "size-full [&_.recharts-label]:fill-foreground",
37
- children: /* @__PURE__ */ S(
38
- T,
49
+ children: /* @__PURE__ */ H(
50
+ Y,
39
51
  {
40
52
  margin: { top: 16, right: 16, bottom: 16, left: 16 },
41
53
  children: [
42
- p && /* @__PURE__ */ t(b, {}),
54
+ p && /* @__PURE__ */ t(
55
+ Z,
56
+ {
57
+ horizontal: j ?? !0,
58
+ vertical: w ?? !0,
59
+ strokeDasharray: b ? "3 3" : void 0
60
+ }
61
+ ),
43
62
  /* @__PURE__ */ t(
44
- L,
63
+ _,
45
64
  {
46
65
  type: "number",
47
66
  dataKey: n,
48
67
  name: n,
49
- unit: f,
68
+ unit: u,
69
+ hide: !k,
50
70
  tickLine: !1,
51
71
  axisLine: !1,
52
72
  tickMargin: 8,
53
- height: r ? 48 : void 0,
54
- label: y
73
+ tickFormatter: y,
74
+ angle: e,
75
+ interval: D,
76
+ textAnchor: e != null ? e < 0 ? "end" : "start" : void 0,
77
+ height: G,
78
+ label: R
55
79
  }
56
80
  ),
57
81
  /* @__PURE__ */ t(
58
- N,
82
+ q,
59
83
  {
60
84
  type: "number",
61
- dataKey: o,
62
- name: o,
63
- unit: h,
85
+ dataKey: l,
86
+ name: l,
87
+ unit: f,
88
+ hide: !g,
64
89
  tickLine: !1,
65
90
  axisLine: !1,
66
91
  tickMargin: 8,
67
- width: i ? 72 : void 0,
68
- label: x
92
+ tickFormatter: S,
93
+ tickCount: T,
94
+ domain: B,
95
+ width: o ? 72 : void 0,
96
+ label: $
69
97
  }
70
98
  ),
71
- a && /* @__PURE__ */ t(j, { type: "number", dataKey: a, range: m, name: a }),
72
- u && /* @__PURE__ */ t(
73
- $,
99
+ i && /* @__PURE__ */ t(z, { type: "number", dataKey: i, range: d, name: i }),
100
+ v && /* @__PURE__ */ t(
101
+ O,
74
102
  {
75
103
  cursor: { strokeDasharray: "3 3" },
76
- content: g ?? /* @__PURE__ */ t(B, {})
104
+ content: F ?? /* @__PURE__ */ t(P, {})
77
105
  }
78
106
  ),
79
- C && /* @__PURE__ */ t(D, { content: /* @__PURE__ */ t(G, {}) }),
80
- c.map((e) => /* @__PURE__ */ t(
81
- w,
107
+ C && /* @__PURE__ */ t(Q, { content: /* @__PURE__ */ t(U, {}) }),
108
+ m.map((a) => /* @__PURE__ */ t(
109
+ E,
82
110
  {
83
- name: e.key,
84
- data: e.data,
85
- fill: `var(--color-${e.key})`,
86
- shape: d,
111
+ name: a.key,
112
+ data: a.data,
113
+ fill: `var(--color-${a.key})`,
114
+ shape: h,
87
115
  isAnimationActive: !1
88
116
  },
89
- e.key
117
+ a.key
90
118
  ))
91
119
  ]
92
120
  }
@@ -95,8 +123,8 @@ const X = A.forwardRef(
95
123
  ) });
96
124
  }
97
125
  );
98
- X.displayName = "ScatterChart";
126
+ W.displayName = "ScatterChart";
99
127
  export {
100
- X as ScatterChart
128
+ W as ScatterChart
101
129
  };
102
130
  //# sourceMappingURL=scatter-chart.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"scatter-chart.js","sources":["../../../../src/components/ui/scatter-chart/scatter-chart.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport {\n CartesianGrid,\n Scatter,\n ScatterChart as RechartsScatterChart,\n XAxis,\n YAxis,\n ZAxis,\n} from 'recharts';\n\nimport { cn } from '@/lib/utils';\nimport {\n ChartContainer,\n ChartLegend,\n ChartLegendContent,\n ChartTooltip,\n ChartTooltipContent,\n type ChartConfig,\n} from '../chart';\n\n// A typed recharts composition over the shared `Chart` primitives. Unlike the\n// other chart types, a scatter has no visual \"mode\" to model as a CVA variant —\n// its shape is fixed (x/y points, optionally sized by z) and its expressiveness\n// comes from the data mapping. So there is no `cva` axis here (matches the\n// skill's \"usually none\"); marker `shape` and bubble sizing are plain props.\n// Each series carries its own point array (points aren't columns of a shared\n// row the way bar/line/area series are), so the API takes a `series` list rather\n// than `dataKeys` over one `data` array.\nexport type ScatterMarkerShape =\n | 'circle'\n | 'cross'\n | 'diamond'\n | 'square'\n | 'star'\n | 'triangle'\n | 'wye';\n\nexport interface ScatterSeries {\n /** Series key — must match a `config` entry; drives its `--color-<key>` fill and legend label. */\n key: string;\n /** This series' points — each row holds at least `xKey` and `yKey` (and `zKey` when used). */\n data: ReadonlyArray<Record<string, number>>;\n}\n\nexport interface ScatterChartProps\n extends Omit<React.ComponentProps<'div'>, 'children'> {\n /** One `<Scatter>` per entry — each with its own point array. Use a single entry for an ungrouped scatter. */\n series: ScatterSeries[];\n /**\n * Per-series map of `label` / `color`, keyed by `series[].key` (imported from\n * the shared `Chart` primitives). Turned into `--color-<key>` custom\n * properties. Colors are caller-supplied — reference an existing semantic\n * `--ui-*` token; there is no chart palette tier yet.\n */\n config: ChartConfig;\n /** Numeric field for the horizontal axis. */\n xKey: string;\n /** Numeric field for the vertical axis. */\n yKey: string;\n /** Title rendered beneath the horizontal (X) axis. */\n xAxisLabel?: string;\n /** Title rendered beside the vertical (Y) axis (rotated). */\n yAxisLabel?: string;\n /** Unit suffix appended to X-axis tick values (recharts `unit`). */\n xUnit?: string;\n /** Unit suffix appended to Y-axis tick values (recharts `unit`). */\n yUnit?: string;\n /** Optional numeric field mapped to point size (a bubble chart), via recharts `ZAxis`. */\n zKey?: string;\n /** Point-size range `[min, max]` the `zKey` maps into. Ignored when `zKey` is unset (points use recharts' default size). */\n zRange?: [number, number];\n /** Marker shape for every point. */\n shape?: ScatterMarkerShape;\n showGrid?: boolean;\n showTooltip?: boolean;\n showLegend?: boolean;\n /**\n * Replace the default tooltip. Pass a configured `ChartTooltipContent`\n * (imported from this library) — e.g. with a `formatter` / `labelFormatter` /\n * `indicator` — to customize formatting, per-series rows, or extra fields\n * without composing recharts yourself. Ignored when `showTooltip` is false.\n */\n tooltipContent?: React.ComponentProps<typeof ChartTooltip>['content'];\n}\n\nconst ScatterChart = React.forwardRef<HTMLDivElement, ScatterChartProps>(\n (\n {\n className,\n config,\n series,\n xKey,\n yKey,\n zKey,\n zRange = [60, 400],\n shape = 'circle',\n xAxisLabel,\n yAxisLabel,\n xUnit,\n yUnit,\n showGrid = true,\n showTooltip = true,\n showLegend = true,\n tooltipContent,\n ...props\n },\n ref\n ) => {\n // Axis titles: the X title sits below the ticks; the Y title is rotated in\n // the left gutter. Passed to recharts' native `label` (themed via the\n // `.recharts-label` fill selector on the container).\n const xAxisTitle = xAxisLabel\n ? { value: xAxisLabel, position: 'insideBottom' as const, offset: -8 }\n : undefined;\n const yAxisTitle = yAxisLabel\n ? {\n value: yAxisLabel,\n angle: -90,\n position: 'insideLeft' as const,\n style: { textAnchor: 'middle' as const },\n }\n : undefined;\n\n return (\n <div ref={ref} className={cn(className)} {...props}>\n <ChartContainer\n config={config}\n className=\"size-full [&_.recharts-label]:fill-foreground\"\n >\n <RechartsScatterChart\n margin={{ top: 16, right: 16, bottom: 16, left: 16 }}\n >\n {showGrid && <CartesianGrid />}\n <XAxis\n type=\"number\"\n dataKey={xKey}\n name={xKey}\n unit={xUnit}\n tickLine={false}\n axisLine={false}\n tickMargin={8}\n height={xAxisLabel ? 48 : undefined}\n label={xAxisTitle}\n />\n <YAxis\n type=\"number\"\n dataKey={yKey}\n name={yKey}\n unit={yUnit}\n tickLine={false}\n axisLine={false}\n tickMargin={8}\n width={yAxisLabel ? 72 : undefined}\n label={yAxisTitle}\n />\n {zKey && (\n <ZAxis type=\"number\" dataKey={zKey} range={zRange} name={zKey} />\n )}\n {showTooltip && (\n <ChartTooltip\n cursor={{ strokeDasharray: '3 3' }}\n content={tooltipContent ?? <ChartTooltipContent />}\n />\n )}\n {showLegend && <ChartLegend content={<ChartLegendContent />} />}\n {series.map((s) => (\n <Scatter\n key={s.key}\n name={s.key}\n data={s.data as Record<string, number>[]}\n fill={`var(--color-${s.key})`}\n shape={shape}\n isAnimationActive={false}\n />\n ))}\n </RechartsScatterChart>\n </ChartContainer>\n </div>\n );\n }\n);\nScatterChart.displayName = 'ScatterChart';\n\nexport { ScatterChart };\n"],"names":["ScatterChart","React","className","config","series","xKey","yKey","zKey","zRange","shape","xAxisLabel","yAxisLabel","xUnit","yUnit","showGrid","showTooltip","showLegend","tooltipContent","props","ref","xAxisTitle","yAxisTitle","jsx","cn","ChartContainer","jsxs","RechartsScatterChart","CartesianGrid","XAxis","YAxis","ZAxis","ChartTooltip","ChartTooltipContent","ChartLegend","ChartLegendContent","s","Scatter"],"mappings":";;;;;AAuFA,MAAMA,IAAeC,EAAM;AAAA,EACzB,CACE;AAAA,IACE,WAAAC;AAAA,IACA,QAAAC;AAAA,IACA,QAAAC;AAAA,IACA,MAAAC;AAAA,IACA,MAAAC;AAAA,IACA,MAAAC;AAAA,IACA,QAAAC,IAAS,CAAC,IAAI,GAAG;AAAA,IACjB,OAAAC,IAAQ;AAAA,IACR,YAAAC;AAAA,IACA,YAAAC;AAAA,IACA,OAAAC;AAAA,IACA,OAAAC;AAAA,IACA,UAAAC,IAAW;AAAA,IACX,aAAAC,IAAc;AAAA,IACd,YAAAC,IAAa;AAAA,IACb,gBAAAC;AAAA,IACA,GAAGC;AAAA,EAAA,GAELC,MACG;AAIH,UAAMC,IAAaV,IACf,EAAE,OAAOA,GAAY,UAAU,gBAAyB,QAAQ,GAAA,IAChE,QACEW,IAAaV,IACf;AAAA,MACE,OAAOA;AAAA,MACP,OAAO;AAAA,MACP,UAAU;AAAA,MACV,OAAO,EAAE,YAAY,SAAA;AAAA,IAAkB,IAEzC;AAEJ,WACE,gBAAAW,EAAC,SAAI,KAAAH,GAAU,WAAWI,EAAGrB,CAAS,GAAI,GAAGgB,GAC3C,UAAA,gBAAAI;AAAA,MAACE;AAAA,MAAA;AAAA,QACC,QAAArB;AAAA,QACA,WAAU;AAAA,QAEV,UAAA,gBAAAsB;AAAA,UA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AAA,gBAAA;AAAA,gBALd0B,EAAE;AAAA,cAAA,CAOV;AAAA,YAAA;AAAA,UAAA;AAAA,QAAA;AAAA,MACH;AAAA,IAAA,GAEJ;AAAA,EAEJ;AACF;AACAnC,EAAa,cAAc;"}
1
+ {"version":3,"file":"scatter-chart.js","sources":["../../../../src/components/ui/scatter-chart/scatter-chart.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport {\n CartesianGrid,\n Scatter,\n ScatterChart as RechartsScatterChart,\n XAxis,\n YAxis,\n ZAxis,\n} from 'recharts';\n\nimport { cn } from '@/lib/utils';\nimport {\n ChartContainer,\n ChartLegend,\n ChartLegendContent,\n ChartTooltip,\n ChartTooltipContent,\n resolveAxisDomain,\n type ChartConfig,\n type CartesianChartProps,\n} from '../chart';\n\n// A typed recharts composition over the shared `Chart` primitives. Unlike the\n// other chart types, a scatter has no visual \"mode\" to model as a CVA variant —\n// its shape is fixed (x/y points, optionally sized by z) and its expressiveness\n// comes from the data mapping. So there is no `cva` axis here (matches the\n// skill's \"usually none\"); marker `shape` and bubble sizing are plain props.\n// Each series carries its own point array (points aren't columns of a shared\n// row the way bar/line/area series are), so the API takes a `series` list rather\n// than `dataKeys` over one `data` array.\nexport type ScatterMarkerShape =\n | 'circle'\n | 'cross'\n | 'diamond'\n | 'square'\n | 'star'\n | 'triangle'\n | 'wye';\n\nexport interface ScatterSeries {\n /** Series key — must match a `config` entry; drives its `--color-<key>` fill and legend label. */\n key: string;\n /** This series' points — each row holds at least `xKey` and `yKey` (and `zKey` when used). */\n data: ReadonlyArray<Record<string, number>>;\n}\n\nexport interface ScatterChartProps\n extends Omit<React.ComponentProps<'div'>, 'children'>,\n CartesianChartProps {\n /** One `<Scatter>` per entry — each with its own point array. Use a single entry for an ungrouped scatter. */\n series: ScatterSeries[];\n /**\n * Per-series map of `label` / `color`, keyed by `series[].key` (imported from\n * the shared `Chart` primitives). Turned into `--color-<key>` custom\n * properties. Colors are caller-supplied — reference an existing semantic\n * `--ui-*` token; there is no chart palette tier yet.\n */\n config: ChartConfig;\n /** Numeric field for the horizontal axis. */\n xKey: string;\n /** Numeric field for the vertical axis. */\n yKey: string;\n /** Unit suffix appended to X-axis tick values (recharts `unit`). */\n xUnit?: string;\n /** Optional numeric field mapped to point size (a bubble chart), via recharts `ZAxis`. */\n zKey?: string;\n /** Point-size range `[min, max]` the `zKey` maps into. Ignored when `zKey` is unset (points use recharts' default size). */\n zRange?: [number, number];\n /** Marker shape for every point. */\n shape?: ScatterMarkerShape;\n showLegend?: boolean;\n}\n\nconst ScatterChart = React.forwardRef<HTMLDivElement, ScatterChartProps>(\n (\n {\n className,\n config,\n series,\n xKey,\n yKey,\n zKey,\n zRange = [60, 400],\n shape = 'circle',\n xAxisLabel,\n yAxisLabel,\n xUnit,\n yUnit,\n showGrid = true,\n showTooltip = true,\n showLegend = true,\n showXAxis = true,\n showYAxis = true,\n xTickFormatter,\n yTickFormatter,\n xAxisAngle,\n xAxisInterval,\n yAxisTickCount,\n yAxisDomain,\n gridDashed,\n gridHorizontal,\n gridVertical,\n tooltipContent,\n ...props\n },\n ref\n ) => {\n // Axis titles: the X title sits below the ticks; the Y title is rotated in\n // the left gutter. Passed to recharts' native `label` (themed via the\n // `.recharts-label` fill selector on the container).\n const xAxisTitle = xAxisLabel\n ? { value: xAxisLabel, position: 'insideBottom' as const, offset: -8 }\n : undefined;\n const yAxisTitle = yAxisLabel\n ? {\n value: yAxisLabel,\n angle: -90,\n position: 'insideLeft' as const,\n style: { textAnchor: 'middle' as const },\n }\n : undefined;\n\n const yDomain = resolveAxisDomain(yAxisDomain);\n\n // Room for the X tick row: recharts' default 30, plus a rotated tick row\n // (+20) and/or the axis title (+18). Additive — both can be present at once,\n // which the old label-or-angle ternary under-allocated.\n const xAxisHeight =\n xAxisLabel || xAxisAngle != null\n ? 30 + (xAxisAngle != null ? 20 : 0) + (xAxisLabel ? 18 : 0)\n : undefined;\n\n return (\n <div ref={ref} className={cn(className)} {...props}>\n <ChartContainer\n config={config}\n className=\"size-full [&_.recharts-label]:fill-foreground\"\n >\n <RechartsScatterChart\n margin={{ top: 16, right: 16, bottom: 16, left: 16 }}\n >\n {showGrid && (\n <CartesianGrid\n horizontal={gridHorizontal ?? true}\n vertical={gridVertical ?? true}\n strokeDasharray={gridDashed ? '3 3' : undefined}\n />\n )}\n <XAxis\n type=\"number\"\n dataKey={xKey}\n name={xKey}\n unit={xUnit}\n hide={!showXAxis}\n tickLine={false}\n axisLine={false}\n tickMargin={8}\n tickFormatter={xTickFormatter}\n angle={xAxisAngle}\n interval={xAxisInterval}\n textAnchor={\n xAxisAngle != null ? (xAxisAngle < 0 ? 'end' : 'start') : undefined\n }\n height={xAxisHeight}\n label={xAxisTitle}\n />\n <YAxis\n type=\"number\"\n dataKey={yKey}\n name={yKey}\n unit={yUnit}\n hide={!showYAxis}\n tickLine={false}\n axisLine={false}\n tickMargin={8}\n tickFormatter={yTickFormatter}\n tickCount={yAxisTickCount}\n domain={yDomain}\n width={yAxisLabel ? 72 : undefined}\n label={yAxisTitle}\n />\n {zKey && (\n <ZAxis type=\"number\" dataKey={zKey} range={zRange} name={zKey} />\n )}\n {showTooltip && (\n <ChartTooltip\n cursor={{ strokeDasharray: '3 3' }}\n content={tooltipContent ?? <ChartTooltipContent />}\n />\n )}\n {showLegend && <ChartLegend content={<ChartLegendContent />} />}\n {series.map((s) => (\n <Scatter\n key={s.key}\n name={s.key}\n data={s.data as Record<string, number>[]}\n fill={`var(--color-${s.key})`}\n shape={shape}\n isAnimationActive={false}\n />\n ))}\n </RechartsScatterChart>\n </ChartContainer>\n </div>\n );\n }\n);\nScatterChart.displayName = 'ScatterChart';\n\nexport { ScatterChart };\n"],"names":["ScatterChart","React","className","config","series","xKey","yKey","zKey","zRange","shape","xAxisLabel","yAxisLabel","xUnit","yUnit","showGrid","showTooltip","showLegend","showXAxis","showYAxis","xTickFormatter","yTickFormatter","xAxisAngle","xAxisInterval","yAxisTickCount","yAxisDomain","gridDashed","gridHorizontal","gridVertical","tooltipContent","props","ref","xAxisTitle","yAxisTitle","yDomain","resolveAxisDomain","xAxisHeight","jsx","cn","ChartContainer","jsxs","RechartsScatterChart","CartesianGrid","XAxis","YAxis","ZAxis","ChartTooltip","ChartTooltipContent","ChartLegend","ChartLegendContent","s","Scatter"],"mappings":";;;;;;AA2EA,MAAMA,IAAeC,EAAM;AAAA,EACzB,CACE;AAAA,IACE,WAAAC;AAAA,IACA,QAAAC;AAAA,IACA,QAAAC;AAAA,IACA,MAAAC;AAAA,IACA,MAAAC;AAAA,IACA,MAAAC;AAAA,IACA,QAAAC,IAAS,CAAC,IAAI,GAAG;AAAA,IACjB,OAAAC,IAAQ;AAAA,IACR,YAAAC;AAAA,IACA,YAAAC;AAAA,IACA,OAAAC;AAAA,IACA,OAAAC;AAAA,IACA,UAAAC,IAAW;AAAA,IACX,aAAAC,IAAc;AAAA,IACd,YAAAC,IAAa;AAAA,IACb,WAAAC,IAAY;AAAA,IACZ,WAAAC,IAAY;AAAA,IACZ,gBAAAC;AAAA,IACA,gBAAAC;AAAA,IACA,YAAAC;AAAA,IACA,eAAAC;AAAA,IACA,gBAAAC;AAAA,IACA,aAAAC;AAAA,IACA,YAAAC;AAAA,IACA,gBAAAC;AAAA,IACA,cAAAC;AAAA,IACA,gBAAAC;AAAA,IACA,GAAGC;AAAA,EAAA,GAELC,MACG;AAIH,UAAMC,IAAarB,IACf,EAAE,OAAOA,GAAY,UAAU,gBAAyB,QAAQ,GAAA,IAChE,QACEsB,IAAarB,IACf;AAAA,MACE,OAAOA;AAAA,MACP,OAAO;AAAA,MACP,UAAU;AAAA,MACV,OAAO,EAAE,YAAY,SAAA;AAAA,IAAkB,IAEzC,QAEEsB,IAAUC,EAAkBV,CAAW,GAKvCW,IACJzB,KAAcW,KAAc,OACxB,MAAMA,KAAc,OAAO,KAAK,MAAMX,IAAa,KAAK,KACxD;AAEN,WACE,gBAAA0B,EAAC,SAAI,KAAAN,GAAU,WAAWO,EAAGnC,CAAS,GAA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,CAAM;AAAA,cAEhEQ,KACC,gBAAAqB;AAAA,gBAACS;AAAA,gBAAA;AAAA,kBACC,QAAQ,EAAE,iBAAiB,MAAA;AAAA,kBAC3B,SAASjB,KAAkB,gBAAAQ,EAACU,GAAA,CAAA,CAAoB;AAAA,gBAAA;AAAA,cAAA;AAAA,cAGnD9B,KAAc,gBAAAoB,EAACW,GAAA,EAAY,SAAS,gBAAAX,EAACY,KAAmB,GAAI;AAAA,cAC5D5C,EAAO,IAAI,CAAC6C,MACX,gBAAAb;AAAA,gBAACc;AAAA,gBAAA;AAAA,kBAEC,MAAMD,EAAE;AAAA,kBACR,MAAMA,EAAE;AAAA,kBACR,MAAM,eAAeA,EAAE,GAAG;AAAA,kBAC1B,OAAAxC;AAAA,kBACA,mBAAmB;AAAA,gBAAA;AAAA,gBALdwC,EAAE;AAAA,cAAA,CAOV;AAAA,YAAA;AAAA,UAAA;AAAA,QAAA;AAAA,MACH;AAAA,IAAA,GAEJ;AAAA,EAEJ;AACF;AACAjD,EAAa,cAAc;"}
@@ -1,26 +1,27 @@
1
- import { jsx as a, jsxs as R } from "react/jsx-runtime";
2
- import * as l from "react";
3
- import { Toolbar as v } from "@base-ui/react/toolbar";
1
+ import { jsx as l, jsxs as C } from "react/jsx-runtime";
2
+ import * as i from "react";
3
+ import { Toolbar as R } from "@base-ui/react/toolbar";
4
4
  import { cn as T } from "../../../lib/utils.js";
5
- import { Button as x } from "../button/button.js";
6
- import { DropdownMenu as F, DropdownMenuTrigger as L, DropdownMenuContent as _, DropdownMenuItem as I } from "../dropdown-menu/dropdown-menu.js";
5
+ import { Button as E } from "../button/button.js";
6
+ import { DropdownMenu as _, DropdownMenuTrigger as F, DropdownMenuContent as I, DropdownMenuItem as P } from "../dropdown-menu/dropdown-menu.js";
7
7
  import { ButtonMenu as A } from "../button-menu/button-menu.js";
8
- const j = l.forwardRef(
9
- ({ className: r, ...t }, n) => /* @__PURE__ */ a(
8
+ const k = i.createContext(!1), j = i.forwardRef(
9
+ ({ className: r, disabled: t, ...n }, c) => /* @__PURE__ */ l(k.Provider, { value: !!t, children: /* @__PURE__ */ l(
10
10
  "fieldset",
11
11
  {
12
- ref: n,
12
+ ref: c,
13
13
  className: T(
14
14
  "m-0 flex min-w-0 items-center gap-4 border-0 p-0",
15
15
  r
16
16
  ),
17
- ...t
17
+ disabled: t,
18
+ ...n
18
19
  }
19
- )
20
+ ) })
20
21
  );
21
22
  j.displayName = "Toolbar";
22
- const P = l.forwardRef(
23
- ({ className: r, ...t }, n) => /* @__PURE__ */ a(
23
+ const X = i.forwardRef(
24
+ ({ className: r, ...t }, n) => /* @__PURE__ */ l(
24
25
  "div",
25
26
  {
26
27
  ref: n,
@@ -32,21 +33,21 @@ const P = l.forwardRef(
32
33
  }
33
34
  )
34
35
  );
35
- P.displayName = "ToolbarActions";
36
+ X.displayName = "ToolbarActions";
36
37
  const M = 16;
37
- function X(r, t, n, m) {
38
+ function G(r, t, n, c) {
38
39
  const d = r.length;
39
40
  if (d === 0) return 0;
40
- if (r.reduce((c, h) => c + h, 0) + n * (d - 1) <= m) return d;
41
+ if (r.reduce((u, p) => u + p, 0) + n * (d - 1) <= c) return d;
41
42
  let o = t, s = 0;
42
- for (let c = 0; c < d; c++) {
43
- const h = o + r[c] + n;
44
- if (h > m) break;
45
- o = h, s++;
43
+ for (let u = 0; u < d; u++) {
44
+ const p = o + r[u] + n;
45
+ if (p > c) break;
46
+ o = p, s++;
46
47
  }
47
48
  return s;
48
49
  }
49
- function G(r) {
50
+ function V(r) {
50
51
  const t = Array.from(r.childNodes).filter(
51
52
  (o) => {
52
53
  var s;
@@ -54,74 +55,63 @@ function G(r) {
54
55
  }
55
56
  );
56
57
  if (t.length === 0) return r.getBoundingClientRect().width;
57
- const n = getComputedStyle(r), m = parseFloat(n.columnGap) || 0, d = (parseFloat(n.paddingLeft) || 0) + (parseFloat(n.paddingRight) || 0) + (parseFloat(n.borderLeftWidth) || 0) + (parseFloat(n.borderRightWidth) || 0);
58
+ const n = getComputedStyle(r), c = parseFloat(n.columnGap) || 0, d = (parseFloat(n.paddingLeft) || 0) + (parseFloat(n.paddingRight) || 0) + (parseFloat(n.borderLeftWidth) || 0) + (parseFloat(n.borderRightWidth) || 0);
58
59
  return t.map((o) => {
59
60
  if (o.nodeType === Node.TEXT_NODE) {
60
61
  const s = document.createRange();
61
62
  return s.selectNodeContents(o), s.getBoundingClientRect().width;
62
63
  }
63
64
  return o.getBoundingClientRect().width;
64
- }).reduce((o, s) => o + s, 0) + m * (t.length - 1) + d;
65
+ }).reduce((o, s) => o + s, 0) + c * (t.length - 1) + d;
65
66
  }
66
- function V(...r) {
67
+ function z(...r) {
67
68
  return (t) => {
68
69
  for (const n of r)
69
70
  n && (typeof n == "function" ? n(t) : n.current = t);
70
71
  };
71
72
  }
72
- const z = l.forwardRef(
73
- ({ className: r, actions: t, moreActionsLabel: n = "More actions", ...m }, d) => {
74
- const u = l.useRef(null), o = l.useRef(
73
+ const $ = i.forwardRef(
74
+ ({ className: r, actions: t, moreActionsLabel: n = "More actions", ...c }, d) => {
75
+ const f = i.useRef(null), o = i.useRef(
75
76
  /* @__PURE__ */ new Map()
76
- ), s = l.useRef(null), [c, h] = l.useState(t.length), [k, C] = l.useState(!1), [g, B] = l.useState(!1);
77
- l.useEffect(() => {
78
- var p;
79
- const e = (p = u.current) == null ? void 0 : p.closest("fieldset");
80
- if (!e) return;
81
- const i = () => B(e.disabled);
82
- i();
83
- const f = new MutationObserver(i);
84
- return f.observe(e, {
85
- attributes: !0,
86
- attributeFilter: ["disabled"]
87
- }), () => f.disconnect();
88
- }, []), l.useEffect(() => {
89
- g && C(!1);
90
- }, [g]);
91
- const y = l.useCallback(() => {
92
- var E;
93
- const e = u.current, i = e == null ? void 0 : e.parentElement;
94
- if (!e || !i) return;
95
- const f = Array.from(i.children).filter((b) => b !== e).reduce((b, w) => b + G(w), 0), p = Math.max(i.children.length - 1, 0), O = i.clientWidth - f - M * p, S = t.map(
96
- (b) => {
77
+ ), s = i.useRef(null), [u, p] = i.useState(t.length), [B, v] = i.useState(!1), m = i.useContext(k), D = B && !m;
78
+ i.useEffect(() => {
79
+ m && v(!1);
80
+ }, [m]);
81
+ const y = i.useCallback(() => {
82
+ var x;
83
+ const e = f.current, a = e == null ? void 0 : e.parentElement;
84
+ if (!e || !a) return;
85
+ const g = Array.from(a.children).filter((h) => h !== e).reduce((h, w) => h + V(w), 0), b = Math.max(a.children.length - 1, 0), W = a.clientWidth - g - M * b, L = t.map(
86
+ (h) => {
97
87
  var w;
98
- return ((w = o.current.get(b.key)) == null ? void 0 : w.getBoundingClientRect().width) ?? 0;
88
+ return ((w = o.current.get(h.key)) == null ? void 0 : w.getBoundingClientRect().width) ?? 0;
99
89
  }
100
- ), W = ((E = s.current) == null ? void 0 : E.getBoundingClientRect().width) ?? 0;
101
- h(
102
- X(
90
+ ), S = ((x = s.current) == null ? void 0 : x.getBoundingClientRect().width) ?? 0;
91
+ p(
92
+ G(
93
+ L,
103
94
  S,
104
- W,
105
95
  M,
106
- O
96
+ W
107
97
  )
108
98
  );
109
99
  }, [t]);
110
- l.useLayoutEffect(() => {
111
- var f;
100
+ i.useLayoutEffect(() => {
101
+ var g;
112
102
  y();
113
- const e = (f = u.current) == null ? void 0 : f.parentElement;
103
+ const e = (g = f.current) == null ? void 0 : g.parentElement;
114
104
  if (!e) return;
115
- const i = new ResizeObserver(y);
116
- return i.observe(e), Array.from(e.children).forEach((p) => {
117
- p !== u.current && i.observe(p);
118
- }), () => i.disconnect();
105
+ const a = new ResizeObserver(y);
106
+ return a.observe(e), Array.from(e.children).forEach((b) => {
107
+ b !== f.current && a.observe(b);
108
+ }), () => a.disconnect();
119
109
  }, [y, t]);
120
- const D = t.slice(0, c), N = t.slice(c);
121
- return /* @__PURE__ */ R(
122
- v.Root,
110
+ const O = t.slice(0, u), N = t.slice(u);
111
+ return /* @__PURE__ */ C(
112
+ R.Root,
123
113
  {
124
- ref: V(u, d),
114
+ ref: z(f, d),
125
115
  className: T(
126
116
  // `overflow-hidden` clips the invisible measurement clone below —
127
117
  // it's `position: absolute` + `visibility: hidden`, which keeps
@@ -133,40 +123,40 @@ const z = l.forwardRef(
133
123
  "relative flex min-w-0 flex-nowrap items-center gap-4 overflow-hidden",
134
124
  r
135
125
  ),
136
- ...m,
126
+ ...c,
137
127
  children: [
138
- D.map((e) => /* @__PURE__ */ a(
139
- v.Button,
128
+ O.map((e) => /* @__PURE__ */ l(
129
+ R.Button,
140
130
  {
141
131
  disabled: e.disabled,
142
132
  focusableWhenDisabled: !e.disabled,
143
133
  onClick: e.onSelect,
144
- render: /* @__PURE__ */ a(x, { variant: "ghost", children: e.label })
134
+ render: /* @__PURE__ */ l(E, { variant: "ghost", children: e.label })
145
135
  },
146
136
  e.key
147
137
  )),
148
- N.length > 0 && /* @__PURE__ */ R(
149
- F,
138
+ N.length > 0 && /* @__PURE__ */ C(
139
+ _,
150
140
  {
151
- open: k,
152
- onOpenChange: C,
153
- disabled: g,
141
+ open: D,
142
+ onOpenChange: v,
143
+ disabled: m,
154
144
  children: [
155
- /* @__PURE__ */ a(
156
- v.Button,
145
+ /* @__PURE__ */ l(
146
+ R.Button,
157
147
  {
158
- render: /* @__PURE__ */ a(
159
- L,
148
+ render: /* @__PURE__ */ l(
149
+ F,
160
150
  {
161
- render: /* @__PURE__ */ a(A, { variant: "secondary", children: n })
151
+ render: /* @__PURE__ */ l(A, { variant: "secondary", children: n })
162
152
  }
163
153
  )
164
154
  }
165
155
  ),
166
- /* @__PURE__ */ a(_, { align: "start", children: N.map((e) => /* @__PURE__ */ a(
167
- I,
156
+ /* @__PURE__ */ l(I, { align: "start", children: N.map((e) => /* @__PURE__ */ l(
157
+ P,
168
158
  {
169
- disabled: e.disabled || g,
159
+ disabled: e.disabled || m,
170
160
  onClick: e.onSelect,
171
161
  children: e.label
172
162
  },
@@ -175,18 +165,18 @@ const z = l.forwardRef(
175
165
  ]
176
166
  }
177
167
  ),
178
- /* @__PURE__ */ R(
168
+ /* @__PURE__ */ C(
179
169
  "div",
180
170
  {
181
171
  "aria-hidden": !0,
182
172
  inert: !0,
183
173
  className: "pointer-events-none invisible absolute start-0 top-0 flex items-center gap-4",
184
174
  children: [
185
- t.map((e) => /* @__PURE__ */ a(
186
- x,
175
+ t.map((e) => /* @__PURE__ */ l(
176
+ E,
187
177
  {
188
- ref: (i) => {
189
- o.current.set(e.key, i);
178
+ ref: (a) => {
179
+ o.current.set(e.key, a);
190
180
  },
191
181
  variant: "ghost",
192
182
  tabIndex: -1,
@@ -194,7 +184,7 @@ const z = l.forwardRef(
194
184
  },
195
185
  e.key
196
186
  )),
197
- /* @__PURE__ */ a(A, { ref: s, variant: "secondary", tabIndex: -1, children: n })
187
+ /* @__PURE__ */ l(A, { ref: s, variant: "secondary", tabIndex: -1, children: n })
198
188
  ]
199
189
  }
200
190
  )
@@ -203,12 +193,12 @@ const z = l.forwardRef(
203
193
  );
204
194
  }
205
195
  );
206
- z.displayName = "ToolbarActionList";
196
+ $.displayName = "ToolbarActionList";
207
197
  export {
208
198
  j as Toolbar,
209
- z as ToolbarActionList,
210
- P as ToolbarActions,
211
- X as computeVisibleActionCount,
212
- G as measureNaturalWidth
199
+ $ as ToolbarActionList,
200
+ X as ToolbarActions,
201
+ G as computeVisibleActionCount,
202
+ V as measureNaturalWidth
213
203
  };
214
204
  //# sourceMappingURL=toolbar.js.map