@langchain/macaw-components 1.7.14 → 1.7.16

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.
@@ -17,7 +17,7 @@ var VIEWBOX_WIDTH = 440;
17
17
  var VIEWBOX_HEIGHT = 340;
18
18
  var CENTER_X = VIEWBOX_WIDTH / 2;
19
19
  var CENTER_Y = VIEWBOX_HEIGHT / 2;
20
- var RADIUS = 96;
20
+ var RADIUS = 106;
21
21
  var LABEL_RADIUS = 116;
22
22
  var LABEL_WIDTH = 100;
23
23
  var LABEL_LINE_HEIGHT = 20;
@@ -60,6 +60,7 @@ var getAxisLayouts = (axes, labelHeight) => axes.map(({ id }, index) => {
60
60
  labelX: CENTER_X + unitX * LABEL_RADIUS - side.offset,
61
61
  labelY: CENTER_Y + unitY * LABEL_RADIUS - (isAbove ? labelHeight : isBelow ? 0 : labelHeight / 2),
62
62
  align: side.align,
63
+ justify: isAbove ? "justify-end" : isBelow ? "justify-start" : "justify-center",
63
64
  tooltipSide: isAbove ? "top" : isBelow ? "bottom" : unitX < 0 ? "left" : "right",
64
65
  tooltipAlign: isAbove || isBelow ? side.tooltipAlign : "center"
65
66
  };
@@ -120,7 +121,7 @@ var RadarChart = (props) => {
120
121
  width: LABEL_WIDTH,
121
122
  height,
122
123
  children: /* @__PURE__ */ jsx("div", {
123
- className: cn("flex h-full flex-col justify-center", layout.align),
124
+ className: cn("flex h-full flex-col", layout.justify, layout.align),
124
125
  title: isInteractive ? void 0 : summary,
125
126
  children: lines
126
127
  })
@@ -176,7 +177,7 @@ var RadarChart = (props) => {
176
177
  /* @__PURE__ */ jsx("circle", {
177
178
  cx: pointX,
178
179
  cy: pointY,
179
- r: 8,
180
+ r: 6,
180
181
  fill: "none",
181
182
  stroke: datum.color,
182
183
  strokeWidth: 1.5,
@@ -192,12 +193,12 @@ var RadarChart = (props) => {
192
193
  }),
193
194
  renderLabel(layout, labelHeight, summary, /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(Text, {
194
195
  variant: "xs",
195
- className: "truncate",
196
+ className: "truncate leading-tight",
196
197
  children: datum.label
197
198
  }), /* @__PURE__ */ jsx(Text, {
198
199
  variant: "xs",
199
200
  color: "secondary",
200
- className: "truncate tabular-nums",
201
+ className: "truncate leading-tight tabular-nums",
201
202
  children: formattedValue
202
203
  })] }))
203
204
  ]
@@ -290,7 +291,7 @@ var RadarChart = (props) => {
290
291
  }),
291
292
  renderLabel(layout, LABEL_LINE_HEIGHT, summary, /* @__PURE__ */ jsx(Text, {
292
293
  variant: "xs",
293
- className: "truncate",
294
+ className: "truncate leading-tight",
294
295
  children: axis.label
295
296
  }))
296
297
  ]
@@ -1 +1 @@
1
- {"version":3,"file":"RadarChart.js","names":[],"sources":["../../../src/components/RadarChart/RadarChart.tsx"],"sourcesContent":["import {\n useId,\n useRef,\n useState,\n type HTMLAttributes,\n type ReactElement,\n type ReactNode,\n} from 'react';\n\nimport * as TooltipPrimitive from '@radix-ui/react-tooltip';\n\nimport {\n CHART_SINGLE_FILL_COLOR,\n getCategoricalFillChartColor,\n getCategoricalFillColor,\n getCategoricalLineChartColor,\n} from '../../utils/chartColors';\nimport { CHART_DIMMED_OPACITY } from '../../utils/chartConstants';\nimport { cn } from '../../utils/cn';\nimport { useZIndex } from '../../utils/useZIndex';\nimport { ZIndexProvider } from '../../utils/ZIndexContext';\nimport zIndices from '../../utils/zIndices';\nimport { ChartTooltip } from '../ChartTooltip';\nimport { Text } from '../Text';\n\nexport type RadarChartDatum = {\n /** Unique, stable identifier for this axis. */\n id: string;\n label: string;\n value: number;\n /** Semantic chart color; defaults to the categorical fill palette in axis order. */\n color?: string;\n};\n\nexport type RadarChartAxis = {\n /** Unique, stable identifier; keys each series' `values`. */\n id: string;\n label: string;\n};\n\nexport type RadarChartSeries = {\n /** Unique, stable identifier; use it as the matching legend item's id. */\n id: string;\n label: string;\n /** Values keyed by axis id. Missing, negative, and non-finite values plot at zero. */\n values: Readonly<Record<string, number | undefined>>;\n /**\n * Outline color; defaults to the categorical line palette in series order.\n * The area uses the hue-matched fill color.\n */\n color?: string;\n};\n\n/** One axis and every visible series' value on it, for multi-series tooltips. */\nexport type RadarChartAxisValues = RadarChartAxis & {\n /** Visible series in input order, with sanitized values and outline colors. */\n values: readonly {\n id: string;\n label: string;\n value: number;\n color: string;\n }[];\n};\n\ntype RadarChartBaseProps = Omit<HTMLAttributes<HTMLDivElement>, 'children'> & {\n /** Shared axis maximum; defaults to the largest finite positive value. */\n maxValue?: number;\n /** Formats labels and the accessible data summary. */\n formatValue?: (value: number) => string;\n};\n\nexport type RadarChartSingleSeriesProps = RadarChartBaseProps & {\n /** Axes in clockwise order, beginning at the top. Supply at least three. */\n data: readonly RadarChartDatum[];\n /**\n * Content inside ChartTooltip on point or label hover and keyboard focus.\n * Receives the sanitized value and resolved color. Compose ChartTooltipHeader,\n * ChartTooltipBody, and ChartTooltipRow here; omit for a static chart.\n */\n renderTooltip?: (datum: RadarChartDatum) => ReactNode;\n axes?: never;\n series?: never;\n renderAxisTooltip?: never;\n selectedIds?: never;\n excludedIds?: never;\n activeLegendItemId?: never;\n};\n\nexport type RadarChartMultiSeriesProps = RadarChartBaseProps & {\n /** Axes in clockwise order, beginning at the top. Supply at least three. */\n axes: readonly RadarChartAxis[];\n /**\n * Overlapping areas on the shared axes, drawn in input order. Keep to about\n * four; beyond that, filter series or use small multiples.\n */\n series: readonly RadarChartSeries[];\n /**\n * Content inside ChartTooltip when an axis is hovered anywhere in its sector\n * or focused. Compose one ChartTooltipRow per series; omit for a static chart.\n */\n renderAxisTooltip?: (axis: RadarChartAxisValues) => ReactNode;\n /** When non-empty, only these series are drawn. Colors keep their series order. */\n selectedIds?: ReadonlySet<string>;\n /** Series left out, whatever `selectedIds` holds. */\n excludedIds?: ReadonlySet<string>;\n /** Emphasizes one series from an external legend and dims the rest. */\n activeLegendItemId?: string | null;\n data?: never;\n renderTooltip?: never;\n};\n\nexport type RadarChartProps =\n | RadarChartSingleSeriesProps\n | RadarChartMultiSeriesProps;\n\ntype AxisLayout = {\n id: string;\n unitX: number;\n unitY: number;\n labelX: number;\n labelY: number;\n align: 'text-left' | 'text-center' | 'text-right';\n tooltipSide: 'top' | 'right' | 'bottom' | 'left';\n tooltipAlign: 'start' | 'center' | 'end';\n};\n\nconst numberFormatter = new Intl.NumberFormat('en-US');\nconst formatNumber = (value: number) => numberFormatter.format(value);\nconst sanitize = (value: number | undefined) =>\n value !== undefined && Number.isFinite(value) ? Math.max(0, value) : 0;\n// Layout uses SVG units, which scale together with the viewBox. This canvas\n// fits the plot plus outside labels, with extra width for horizontal text.\nconst VIEWBOX_WIDTH = 440;\nconst VIEWBOX_HEIGHT = 340;\nconst CENTER_X = VIEWBOX_WIDTH / 2;\nconst CENTER_Y = VIEWBOX_HEIGHT / 2;\n// A 96-unit plot leaves room for a 20-unit gap and the two-line label boxes.\nconst RADIUS = 96;\nconst LABEL_RADIUS = RADIUS + 20;\n// Reserve 100 units for truncated names and 20 per text line: single-series\n// labels pair the name with its value; multi-series labels show the name.\nconst LABEL_WIDTH = 100;\nconst LABEL_LINE_HEIGHT = 20;\n// Labels left of center end at their axis; labels right of it start there.\nconst LABEL_SIDES = {\n left: { offset: LABEL_WIDTH, align: 'text-right', tooltipAlign: 'start' },\n center: {\n offset: LABEL_WIDTH / 2,\n align: 'text-center',\n tooltipAlign: 'center',\n },\n right: { offset: 0, align: 'text-left', tooltipAlign: 'end' },\n} as const;\n// Absorb trig rounding at alignment boundaries so mirrored labels line up.\nconst ALIGNMENT_EPSILON = 1e-6;\n// Four equally spaced rings represent fractions of the shared axis maximum.\nconst GRID_LEVELS = [0.25, 0.5, 0.75, 1];\n// Overlapping areas lead with their outlines: a faint wash keeps stacked\n// areas from mixing into a muddy tint. While one series is emphasized, it\n// alone keeps a fill, and the other series recede to dimmed outlines.\nconst SERIES_FILL_OPACITY = 0.08;\nconst EMPHASIZED_SERIES_FILL_OPACITY = 0.2;\n\nconst getAxisLayouts = (\n axes: readonly { id: string }[],\n labelHeight: number\n): AxisLayout[] =>\n axes.map(({ id }, index) => {\n const angle = (index * Math.PI * 2) / axes.length - Math.PI / 2;\n const unitX = Math.cos(angle);\n const unitY = Math.sin(angle);\n // Center labels within ~6 degrees of vertical (|cos| <= 0.1).\n const side =\n LABEL_SIDES[unitX < -0.1 ? 'left' : unitX > 0.1 ? 'right' : 'center'];\n // At 30 degrees or more above/below horizontal (|sin| >= 0.5), place the\n // whole label box outside the axis instead of straddling it.\n const isAbove = unitY <= -0.5 + ALIGNMENT_EPSILON;\n const isBelow = unitY >= 0.5 - ALIGNMENT_EPSILON;\n return {\n id,\n unitX,\n unitY,\n labelX: CENTER_X + unitX * LABEL_RADIUS - side.offset,\n labelY:\n CENTER_Y +\n unitY * LABEL_RADIUS -\n (isAbove ? labelHeight : isBelow ? 0 : labelHeight / 2),\n align: side.align,\n // Open outward, past the label and away from the plot.\n tooltipSide: isAbove\n ? 'top'\n : isBelow\n ? 'bottom'\n : unitX < 0\n ? 'left'\n : 'right',\n tooltipAlign: isAbove || isBelow ? side.tooltipAlign : 'center',\n };\n });\n\nconst getPoint = (axis: AxisLayout, ratio: number): [number, number] => [\n CENTER_X + axis.unitX * RADIUS * ratio,\n CENTER_Y + axis.unitY * RADIUS * ratio,\n];\n\nconst toPoints = (points: readonly (readonly [number, number])[]) =>\n points.map(([x, y]) => `${x},${y}`).join(' ');\n\nconst getMaximum = (values: readonly number[], maxValue?: number) =>\n maxValue !== undefined && Number.isFinite(maxValue) && maxValue > 0\n ? maxValue\n : values.reduce((largest, value) => Math.max(largest, value), 0) || 1;\n\n/**\n * A radar with a shared scale and clockwise, outside axis labels. Pass `data`\n * for one series with categorical points, or `axes` and `series` for\n * overlapping areas identified by an external legend.\n */\nexport const RadarChart = (props: RadarChartProps) => {\n // Mode-specific props are read from `props` so TypeScript narrows them by\n // mode; they are destructured here only to keep them off the wrapper div.\n const {\n data: _data,\n axes: _axes,\n series: _series,\n renderTooltip: _renderTooltip,\n renderAxisTooltip: _renderAxisTooltip,\n selectedIds,\n excludedIds,\n activeLegendItemId,\n maxValue,\n formatValue = formatNumber,\n className,\n 'aria-label': ariaLabel = 'Radar chart',\n 'aria-labelledby': ariaLabelledBy,\n 'aria-describedby': ariaDescribedBy,\n ...divProps\n } = props;\n const summaryId = useId();\n const [activeTooltip, setActiveTooltip] = useState<string | null>(null);\n const isPointerDownRef = useRef(false);\n const tooltipZIndex = useZIndex(zIndices.tooltip);\n const isInteractive =\n (props.series !== undefined\n ? props.renderAxisTooltip\n : props.renderTooltip) !== undefined;\n\n const withTooltip = (\n id: string,\n mark: ReactElement,\n content: ReactNode,\n layout?: AxisLayout\n ) => (\n <TooltipPrimitive.Root\n key={id}\n open={activeTooltip === id}\n onOpenChange={(open) =>\n setActiveTooltip((active) =>\n open ? id : active === id ? null : active\n )\n }\n >\n <TooltipPrimitive.Trigger\n asChild\n onPointerDown={(event) => {\n isPointerDownRef.current = true;\n event.currentTarget.ownerDocument.addEventListener(\n 'pointerup',\n () => {\n isPointerDownRef.current = false;\n },\n { once: true }\n );\n }}\n onFocus={(event) => {\n // Wait for keyboard focus to scroll an offscreen axis into\n // view; otherwise Radix closes the tooltip on that scroll.\n // Like Radix, focus from a pointer press stays closed.\n event.preventDefault();\n if (isPointerDownRef.current) return;\n const target = event.currentTarget;\n requestAnimationFrame(() => {\n if (target === target.ownerDocument.activeElement) {\n setActiveTooltip(id);\n }\n });\n }}\n >\n {mark}\n </TooltipPrimitive.Trigger>\n <TooltipPrimitive.Portal>\n <TooltipPrimitive.Content\n asChild\n side={layout?.tooltipSide}\n align={layout?.tooltipAlign}\n // Leave an 8px gap from the trigger and viewport edges.\n sideOffset={8}\n collisionPadding={8}\n >\n <ChartTooltip style={{ zIndex: tooltipZIndex }}>\n <ZIndexProvider value={tooltipZIndex}>{content}</ZIndexProvider>\n </ChartTooltip>\n </TooltipPrimitive.Content>\n </TooltipPrimitive.Portal>\n </TooltipPrimitive.Root>\n );\n\n const renderLabel = (\n layout: AxisLayout,\n height: number,\n summary: string,\n lines: ReactNode\n ) => (\n <foreignObject\n x={layout.labelX}\n y={layout.labelY}\n width={LABEL_WIDTH}\n height={height}\n >\n <div\n className={cn('flex h-full flex-col justify-center', layout.align)}\n title={isInteractive ? undefined : summary}\n >\n {lines}\n </div>\n </foreignObject>\n );\n\n const renderSingleSeries = (\n data: readonly RadarChartDatum[],\n renderDatumTooltip?: (datum: RadarChartDatum) => ReactNode\n ) => {\n const labelHeight = LABEL_LINE_HEIGHT * 2;\n const layouts = getAxisLayouts(data, labelHeight);\n const values = data.map(({ value }) => sanitize(value));\n const maximum = getMaximum(values, maxValue);\n const axes = data.map((datum, index) => {\n const value = values[index];\n const formattedValue = formatValue(value);\n return {\n layout: layouts[index],\n datum: {\n ...datum,\n value,\n color: datum.color ?? getCategoricalFillChartColor(index),\n },\n formattedValue,\n summary: `${datum.label}: ${formattedValue}`,\n point: getPoint(layouts[index], Math.min(1, value / maximum)),\n };\n });\n\n return {\n layouts,\n summary: axes.map(({ summary }) => summary).join('; '),\n marks: (\n <>\n <polygon\n aria-hidden=\"true\"\n points={toPoints(axes.map(({ point }) => point))}\n fill={CHART_SINGLE_FILL_COLOR}\n // A light wash and subdued outline keep the category points prominent.\n // Dark surfaces need slightly more opacity to preserve the shape.\n className=\"dark:[fill-opacity:0.24] dark:[stroke-opacity:0.8]\"\n fillOpacity={0.16}\n stroke={getCategoricalLineChartColor(0)}\n strokeOpacity={0.55}\n strokeWidth={1.25}\n strokeLinejoin=\"round\"\n />\n {axes.map(({ layout, datum, formattedValue, summary, point }) => {\n const [pointX, pointY] = point;\n const mark = (\n <g\n key={datum.id}\n className=\"group outline-hidden\"\n role={isInteractive ? 'img' : undefined}\n aria-label={isInteractive ? summary : undefined}\n aria-hidden={isInteractive ? undefined : true}\n tabIndex={isInteractive ? 0 : undefined}\n >\n {/* A 24-unit hit target surrounds the 8-unit point; the\n 16-unit ring shows hover in the axis color and keyboard\n focus in the shared focus color without changing layout. */}\n <circle cx={pointX} cy={pointY} r={12} fill=\"transparent\" />\n <circle\n cx={pointX}\n cy={pointY}\n r={8}\n fill=\"none\"\n stroke={datum.color}\n strokeWidth={1.5}\n className=\"opacity-0 group-hover:opacity-100 group-focus-visible:stroke-focus group-focus-visible:opacity-100\"\n />\n <circle\n cx={pointX}\n cy={pointY}\n r={4}\n fill={datum.color}\n // A thin surface-colored separator avoids heavy dark borders.\n className=\"stroke-surface-level-1\"\n strokeWidth={1}\n />\n {renderLabel(\n layout,\n labelHeight,\n summary,\n <>\n <Text variant=\"xs\" className=\"truncate\">\n {datum.label}\n </Text>\n <Text\n variant=\"xs\"\n color=\"secondary\"\n className=\"truncate tabular-nums\"\n >\n {formattedValue}\n </Text>\n </>\n )}\n </g>\n );\n return renderDatumTooltip\n ? withTooltip(datum.id, mark, renderDatumTooltip(datum))\n : mark;\n })}\n </>\n ),\n };\n };\n\n const renderMultiSeries = (\n axes: readonly RadarChartAxis[],\n series: readonly RadarChartSeries[],\n renderAxisTooltip?: (axis: RadarChartAxisValues) => ReactNode\n ) => {\n const layouts = getAxisLayouts(axes, LABEL_LINE_HEIGHT);\n // Resolve colors before filtering so each series keeps its hue.\n const resolvedSeries = series.map((item, index) => {\n const color = item.color ?? getCategoricalLineChartColor(index);\n return {\n id: item.id,\n label: item.label,\n color,\n fill: getCategoricalFillColor(color),\n values: axes.map(({ id }) => sanitize(item.values[id])),\n };\n });\n const visibleSeries = resolvedSeries.filter(\n ({ id }) =>\n (selectedIds === undefined ||\n selectedIds.size === 0 ||\n selectedIds.has(id)) &&\n !excludedIds?.has(id)\n );\n const maximum = getMaximum(\n visibleSeries.flatMap(({ values }) => values),\n maxValue\n );\n const plottedSeries = visibleSeries.map((item) => ({\n ...item,\n points: item.values.map((value, index) =>\n getPoint(layouts[index], Math.min(1, value / maximum))\n ),\n }));\n const emphasizedId = plottedSeries.some(\n ({ id }) => id === activeLegendItemId\n )\n ? activeLegendItemId\n : null;\n const getSeriesOpacity = (id: string) =>\n emphasizedId != null && id !== emphasizedId ? CHART_DIMMED_OPACITY : 1;\n\n return {\n layouts,\n summary: plottedSeries\n .map(\n (item) =>\n `${item.label}: ${axes\n .map(\n (axis, index) =>\n `${axis.label} ${formatValue(item.values[index])}`\n )\n .join(', ')}`\n )\n .join('; '),\n marks: (\n <>\n {/* Draw the emphasized series last so its outline sits on top. */}\n {[\n ...plottedSeries.filter(({ id }) => id !== emphasizedId),\n ...plottedSeries.filter(({ id }) => id === emphasizedId),\n ].map((item) => {\n const isEmphasized = item.id === emphasizedId;\n return (\n <polygon\n key={item.id}\n aria-hidden=\"true\"\n points={toPoints(item.points)}\n fill={item.fill}\n fillOpacity={\n isEmphasized\n ? EMPHASIZED_SERIES_FILL_OPACITY\n : emphasizedId == null\n ? SERIES_FILL_OPACITY\n : 0\n }\n className=\"transition-[opacity,fill-opacity] duration-fast motion-reduce:transition-none\"\n opacity={getSeriesOpacity(item.id)}\n stroke={item.color}\n strokeWidth={1.5}\n strokeLinejoin=\"round\"\n />\n );\n })}\n {axes.map((axis, index) => {\n const layout = layouts[index];\n const values = plottedSeries.map((item) => ({\n id: item.id,\n label: item.label,\n value: item.values[index],\n color: item.color,\n }));\n const summary = values.length\n ? `${axis.label}: ${values\n .map(({ label, value }) => `${label} ${formatValue(value)}`)\n .join(', ')}`\n : axis.label;\n const [outerX, outerY] = getPoint(layout, 1);\n const [previousX, previousY] = getPoint(\n layouts[(index - 1 + layouts.length) % layouts.length],\n 1\n );\n const [nextX, nextY] = getPoint(\n layouts[(index + 1) % layouts.length],\n 1\n );\n const mark = (\n <g\n key={axis.id}\n className=\"group outline-hidden\"\n role={isInteractive ? 'img' : undefined}\n aria-label={isInteractive ? summary : undefined}\n aria-hidden={isInteractive ? undefined : true}\n tabIndex={isInteractive ? 0 : undefined}\n >\n {/* Each axis owns the sector between its neighbors' edge\n midpoints, so hovering anywhere in the plot inspects the\n nearest axis. */}\n <polygon\n points={toPoints([\n [CENTER_X, CENTER_Y],\n [(previousX + outerX) / 2, (previousY + outerY) / 2],\n [outerX, outerY],\n [(outerX + nextX) / 2, (outerY + nextY) / 2],\n ])}\n fill=\"transparent\"\n />\n {/* Hover strengthens the spoke and reveals each series'\n vertex; keyboard focus uses the shared focus color. */}\n <g className=\"opacity-0 transition-opacity duration-fast group-hover:opacity-100 group-focus-visible:opacity-100 motion-reduce:transition-none\">\n <line\n x1={CENTER_X}\n y1={CENTER_Y}\n x2={outerX}\n y2={outerY}\n stroke=\"var(--border-default)\"\n className=\"group-focus-visible:stroke-focus\"\n />\n {plottedSeries.map((item) => (\n <circle\n key={item.id}\n cx={item.points[index][0]}\n cy={item.points[index][1]}\n r={3.5}\n fill={item.color}\n opacity={getSeriesOpacity(item.id)}\n // A surface-colored separator keeps coincident vertices distinct.\n className=\"stroke-surface-level-1\"\n strokeWidth={1.5}\n />\n ))}\n </g>\n {renderLabel(\n layout,\n LABEL_LINE_HEIGHT,\n summary,\n <Text variant=\"xs\" className=\"truncate\">\n {axis.label}\n </Text>\n )}\n </g>\n );\n return renderAxisTooltip\n ? withTooltip(\n axis.id,\n mark,\n renderAxisTooltip({ id: axis.id, label: axis.label, values }),\n layout\n )\n : mark;\n })}\n </>\n ),\n };\n };\n\n const axisCount = (props.series !== undefined ? props.axes : props.data)\n .length;\n const chart =\n axisCount < 3\n ? null\n : props.series !== undefined\n ? renderMultiSeries(props.axes, props.series, props.renderAxisTooltip)\n : renderSingleSeries(props.data, props.renderTooltip);\n\n return (\n <div className={cn('w-full overflow-x-auto', className)} {...divProps}>\n {chart === null ? (\n <div className=\"flex h-80 items-center justify-center\" role=\"status\">\n <Text variant=\"sm\" color=\"secondary\">\n At least three axes are needed to display a radar chart.\n </Text>\n </div>\n ) : (\n <TooltipPrimitive.Provider\n // Brief hover delay avoids flashes when crossing between axes.\n delayDuration={150}\n >\n <svg\n viewBox={`0 0 ${VIEWBOX_WIDTH} ${VIEWBOX_HEIGHT}`}\n className=\"block w-full\"\n // Preserve the labels' base font size; narrow containers scroll.\n style={{ minWidth: VIEWBOX_WIDTH }}\n role={isInteractive ? 'group' : 'img'}\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledBy}\n aria-describedby={[summaryId, ariaDescribedBy]\n .filter(Boolean)\n .join(' ')}\n >\n <desc id={summaryId}>{chart.summary}</desc>\n <g aria-hidden=\"true\" fill=\"none\" stroke=\"var(--border-subtle)\">\n {GRID_LEVELS.map((level) => (\n <polygon\n key={level}\n points={toPoints(\n chart.layouts.map((layout) => getPoint(layout, level))\n )}\n />\n ))}\n {chart.layouts.map((layout) => {\n const [x, y] = getPoint(layout, 1);\n return (\n <line\n key={layout.id}\n x1={CENTER_X}\n y1={CENTER_Y}\n x2={x}\n y2={y}\n />\n );\n })}\n </g>\n {chart.marks}\n </svg>\n </TooltipPrimitive.Provider>\n )}\n </div>\n );\n};\n"],"mappings":";;;;;;;;;;;;AA8HA,IAAM,kBAAkB,IAAI,KAAK,aAAa,OAAO;AACrD,IAAM,gBAAgB,UAAkB,gBAAgB,OAAO,KAAK;AACpE,IAAM,YAAY,UAChB,UAAU,KAAA,KAAa,OAAO,SAAS,KAAK,IAAI,KAAK,IAAI,GAAG,KAAK,IAAI;AAGvE,IAAM,gBAAgB;AACtB,IAAM,iBAAiB;AACvB,IAAM,WAAW,gBAAgB;AACjC,IAAM,WAAW,iBAAiB;AAElC,IAAM,SAAS;AACf,IAAM,eAAe;AAGrB,IAAM,cAAc;AACpB,IAAM,oBAAoB;AAE1B,IAAM,cAAc;CAClB,MAAM;EAAE,QAAQ;EAAa,OAAO;EAAc,cAAc;CAAQ;CACxE,QAAQ;EACN,QAAQ,cAAc;EACtB,OAAO;EACP,cAAc;CAChB;CACA,OAAO;EAAE,QAAQ;EAAG,OAAO;EAAa,cAAc;CAAM;AAC9D;AAIA,IAAM,cAAc;CAAC;CAAM;CAAK;CAAM;AAAC;AAIvC,IAAM,sBAAsB;AAC5B,IAAM,iCAAiC;AAEvC,IAAM,kBACJ,MACA,gBAEA,KAAK,KAAK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AAM,MAAM,aAAa;CAE1D,OACE,oBAAC,OAAD;EAAK,WAAW,GAAG,0BAA0B,SAAS;EAAG,GAAI;EAC1D,UAAA,UAAU,OACT,oBAAC,OAAD;GAAK,WAAU;GAAwC,MAAK;GAC1D,UAAA,oBAAC,MAAD;IAAM,SAAQ;IAAK,OAAM;IAAY,UAAA;GAE/B,CAAA;EACH,CAAA,IAEL,oBAAC,iBAAiB,UAAlB;GAEE,eAAe;GAEf,UAAA,qBAAC,OAAD;IACE,SAAS,OAAO,cAAc,GAAG;IACjC,WAAU;IAEV,OAAO,EAAE,UAAU,cAAc;IACjC,MAAM,gBAAgB,UAAU;IAChC,cAAY;IACZ,mBAAiB;IACjB,oBAAkB,CAAC,WAAW,eAAe,CAAC,CAC3C,OAAO,OAAO,CAAC,CACf,KAAK,GAAG;IAVb,UAAA;KAYE,oBAAC,QAAD;MAAM,IAAI;MAAY,UAAA,MAAM;KAAc,CAAA;KAC1C,qBAAC,KAAD;MAAG,eAAY;MAAO,MAAK;MAAO,QAAO;MAAzC,UAAA,CACG,YAAY,KAAK,UAChB,oBAAC,WAAD,EAEE,QAAQ,SACN,MAAM,QAAQ,KAAK,WAAW,SAAS,QAAQ,KAAK,CAAC,CACvD,EACD,GAJM,KAIN,CACF,GACA,MAAM,QAAQ,KAAK,WAAW;OAC7B,MAAM,CAAC,GAAG,KAAK,SAAS,QAAQ,CAAC;OACjC,OACE,oBAAC,QAAD;QAEE,IAAI;QACJ,IAAI;QACJ,IAAI;QACJ,IAAI;OACL,GALM,OAAO,EAKb;MAEL,CAAC,CACA;;KACF,MAAM;IACJ;;EACoB,CAAA;CAE1B,CAAA;AAET"}
1
+ {"version":3,"file":"RadarChart.js","names":[],"sources":["../../../src/components/RadarChart/RadarChart.tsx"],"sourcesContent":["import {\n useId,\n useRef,\n useState,\n type HTMLAttributes,\n type ReactElement,\n type ReactNode,\n} from 'react';\n\nimport * as TooltipPrimitive from '@radix-ui/react-tooltip';\n\nimport {\n CHART_SINGLE_FILL_COLOR,\n getCategoricalFillChartColor,\n getCategoricalFillColor,\n getCategoricalLineChartColor,\n} from '../../utils/chartColors';\nimport { CHART_DIMMED_OPACITY } from '../../utils/chartConstants';\nimport { cn } from '../../utils/cn';\nimport { useZIndex } from '../../utils/useZIndex';\nimport { ZIndexProvider } from '../../utils/ZIndexContext';\nimport zIndices from '../../utils/zIndices';\nimport { ChartTooltip } from '../ChartTooltip';\nimport { Text } from '../Text';\n\nexport type RadarChartDatum = {\n /** Unique, stable identifier for this axis. */\n id: string;\n label: string;\n value: number;\n /** Semantic chart color; defaults to the categorical fill palette in axis order. */\n color?: string;\n};\n\nexport type RadarChartAxis = {\n /** Unique, stable identifier; keys each series' `values`. */\n id: string;\n label: string;\n};\n\nexport type RadarChartSeries = {\n /** Unique, stable identifier; use it as the matching legend item's id. */\n id: string;\n label: string;\n /** Values keyed by axis id. Missing, negative, and non-finite values plot at zero. */\n values: Readonly<Record<string, number | undefined>>;\n /**\n * Outline color; defaults to the categorical line palette in series order.\n * The area uses the hue-matched fill color.\n */\n color?: string;\n};\n\n/** One axis and every visible series' value on it, for multi-series tooltips. */\nexport type RadarChartAxisValues = RadarChartAxis & {\n /** Visible series in input order, with sanitized values and outline colors. */\n values: readonly {\n id: string;\n label: string;\n value: number;\n color: string;\n }[];\n};\n\ntype RadarChartBaseProps = Omit<HTMLAttributes<HTMLDivElement>, 'children'> & {\n /** Shared axis maximum; defaults to the largest finite positive value. */\n maxValue?: number;\n /** Formats labels and the accessible data summary. */\n formatValue?: (value: number) => string;\n};\n\nexport type RadarChartSingleSeriesProps = RadarChartBaseProps & {\n /** Axes in clockwise order, beginning at the top. Supply at least three. */\n data: readonly RadarChartDatum[];\n /**\n * Content inside ChartTooltip on point or label hover and keyboard focus.\n * Receives the sanitized value and resolved color. Compose ChartTooltipHeader,\n * ChartTooltipBody, and ChartTooltipRow here; omit for a static chart.\n */\n renderTooltip?: (datum: RadarChartDatum) => ReactNode;\n axes?: never;\n series?: never;\n renderAxisTooltip?: never;\n selectedIds?: never;\n excludedIds?: never;\n activeLegendItemId?: never;\n};\n\nexport type RadarChartMultiSeriesProps = RadarChartBaseProps & {\n /** Axes in clockwise order, beginning at the top. Supply at least three. */\n axes: readonly RadarChartAxis[];\n /**\n * Overlapping areas on the shared axes, drawn in input order. Keep to about\n * four; beyond that, filter series or use small multiples.\n */\n series: readonly RadarChartSeries[];\n /**\n * Content inside ChartTooltip when an axis is hovered anywhere in its sector\n * or focused. Compose one ChartTooltipRow per series; omit for a static chart.\n */\n renderAxisTooltip?: (axis: RadarChartAxisValues) => ReactNode;\n /** When non-empty, only these series are drawn. Colors keep their series order. */\n selectedIds?: ReadonlySet<string>;\n /** Series left out, whatever `selectedIds` holds. */\n excludedIds?: ReadonlySet<string>;\n /** Emphasizes one series from an external legend and dims the rest. */\n activeLegendItemId?: string | null;\n data?: never;\n renderTooltip?: never;\n};\n\nexport type RadarChartProps =\n | RadarChartSingleSeriesProps\n | RadarChartMultiSeriesProps;\n\ntype AxisLayout = {\n id: string;\n unitX: number;\n unitY: number;\n labelX: number;\n labelY: number;\n align: 'text-left' | 'text-center' | 'text-right';\n /** Labels above or below the plot sit against the box edge facing it. */\n justify: 'justify-start' | 'justify-center' | 'justify-end';\n tooltipSide: 'top' | 'right' | 'bottom' | 'left';\n tooltipAlign: 'start' | 'center' | 'end';\n};\n\nconst numberFormatter = new Intl.NumberFormat('en-US');\nconst formatNumber = (value: number) => numberFormatter.format(value);\nconst sanitize = (value: number | undefined) =>\n value !== undefined && Number.isFinite(value) ? Math.max(0, value) : 0;\n// Layout uses SVG units, which scale together with the viewBox. This canvas\n// fits the plot plus outside labels, with extra width for horizontal text.\nconst VIEWBOX_WIDTH = 440;\nconst VIEWBOX_HEIGHT = 340;\nconst CENTER_X = VIEWBOX_WIDTH / 2;\nconst CENTER_Y = VIEWBOX_HEIGHT / 2;\n// A 106-unit plot leaves room for a 10-unit gap and the two-line label boxes;\n// the narrow gap keeps each label visibly tied to its spoke.\nconst RADIUS = 106;\nconst LABEL_RADIUS = RADIUS + 10;\n// Reserve 100 units for truncated names and 20 per text line: single-series\n// labels pair the name with its value; multi-series labels show the name.\nconst LABEL_WIDTH = 100;\nconst LABEL_LINE_HEIGHT = 20;\n// Labels left of center end at their axis; labels right of it start there.\nconst LABEL_SIDES = {\n left: { offset: LABEL_WIDTH, align: 'text-right', tooltipAlign: 'start' },\n center: {\n offset: LABEL_WIDTH / 2,\n align: 'text-center',\n tooltipAlign: 'center',\n },\n right: { offset: 0, align: 'text-left', tooltipAlign: 'end' },\n} as const;\n// Absorb trig rounding at alignment boundaries so mirrored labels line up.\nconst ALIGNMENT_EPSILON = 1e-6;\n// Four equally spaced rings represent fractions of the shared axis maximum.\nconst GRID_LEVELS = [0.25, 0.5, 0.75, 1];\n// Overlapping areas lead with their outlines: a faint wash keeps stacked\n// areas from mixing into a muddy tint. While one series is emphasized, it\n// alone keeps a fill, and the other series recede to dimmed outlines.\nconst SERIES_FILL_OPACITY = 0.08;\nconst EMPHASIZED_SERIES_FILL_OPACITY = 0.2;\n\nconst getAxisLayouts = (\n axes: readonly { id: string }[],\n labelHeight: number\n): AxisLayout[] =>\n axes.map(({ id }, index) => {\n const angle = (index * Math.PI * 2) / axes.length - Math.PI / 2;\n const unitX = Math.cos(angle);\n const unitY = Math.sin(angle);\n // Center labels within ~6 degrees of vertical (|cos| <= 0.1).\n const side =\n LABEL_SIDES[unitX < -0.1 ? 'left' : unitX > 0.1 ? 'right' : 'center'];\n // At 30 degrees or more above/below horizontal (|sin| >= 0.5), place the\n // whole label box outside the axis instead of straddling it.\n const isAbove = unitY <= -0.5 + ALIGNMENT_EPSILON;\n const isBelow = unitY >= 0.5 - ALIGNMENT_EPSILON;\n return {\n id,\n unitX,\n unitY,\n labelX: CENTER_X + unitX * LABEL_RADIUS - side.offset,\n labelY:\n CENTER_Y +\n unitY * LABEL_RADIUS -\n (isAbove ? labelHeight : isBelow ? 0 : labelHeight / 2),\n align: side.align,\n justify: isAbove\n ? 'justify-end'\n : isBelow\n ? 'justify-start'\n : 'justify-center',\n // Open outward, past the label and away from the plot.\n tooltipSide: isAbove\n ? 'top'\n : isBelow\n ? 'bottom'\n : unitX < 0\n ? 'left'\n : 'right',\n tooltipAlign: isAbove || isBelow ? side.tooltipAlign : 'center',\n };\n });\n\nconst getPoint = (axis: AxisLayout, ratio: number): [number, number] => [\n CENTER_X + axis.unitX * RADIUS * ratio,\n CENTER_Y + axis.unitY * RADIUS * ratio,\n];\n\nconst toPoints = (points: readonly (readonly [number, number])[]) =>\n points.map(([x, y]) => `${x},${y}`).join(' ');\n\nconst getMaximum = (values: readonly number[], maxValue?: number) =>\n maxValue !== undefined && Number.isFinite(maxValue) && maxValue > 0\n ? maxValue\n : values.reduce((largest, value) => Math.max(largest, value), 0) || 1;\n\n/**\n * A radar with a shared scale and clockwise, outside axis labels. Pass `data`\n * for one series with categorical points, or `axes` and `series` for\n * overlapping areas identified by an external legend.\n */\nexport const RadarChart = (props: RadarChartProps) => {\n // Mode-specific props are read from `props` so TypeScript narrows them by\n // mode; they are destructured here only to keep them off the wrapper div.\n const {\n data: _data,\n axes: _axes,\n series: _series,\n renderTooltip: _renderTooltip,\n renderAxisTooltip: _renderAxisTooltip,\n selectedIds,\n excludedIds,\n activeLegendItemId,\n maxValue,\n formatValue = formatNumber,\n className,\n 'aria-label': ariaLabel = 'Radar chart',\n 'aria-labelledby': ariaLabelledBy,\n 'aria-describedby': ariaDescribedBy,\n ...divProps\n } = props;\n const summaryId = useId();\n const [activeTooltip, setActiveTooltip] = useState<string | null>(null);\n const isPointerDownRef = useRef(false);\n const tooltipZIndex = useZIndex(zIndices.tooltip);\n const isInteractive =\n (props.series !== undefined\n ? props.renderAxisTooltip\n : props.renderTooltip) !== undefined;\n\n const withTooltip = (\n id: string,\n mark: ReactElement,\n content: ReactNode,\n layout?: AxisLayout\n ) => (\n <TooltipPrimitive.Root\n key={id}\n open={activeTooltip === id}\n onOpenChange={(open) =>\n setActiveTooltip((active) =>\n open ? id : active === id ? null : active\n )\n }\n >\n <TooltipPrimitive.Trigger\n asChild\n onPointerDown={(event) => {\n isPointerDownRef.current = true;\n event.currentTarget.ownerDocument.addEventListener(\n 'pointerup',\n () => {\n isPointerDownRef.current = false;\n },\n { once: true }\n );\n }}\n onFocus={(event) => {\n // Wait for keyboard focus to scroll an offscreen axis into\n // view; otherwise Radix closes the tooltip on that scroll.\n // Like Radix, focus from a pointer press stays closed.\n event.preventDefault();\n if (isPointerDownRef.current) return;\n const target = event.currentTarget;\n requestAnimationFrame(() => {\n if (target === target.ownerDocument.activeElement) {\n setActiveTooltip(id);\n }\n });\n }}\n >\n {mark}\n </TooltipPrimitive.Trigger>\n <TooltipPrimitive.Portal>\n <TooltipPrimitive.Content\n asChild\n side={layout?.tooltipSide}\n align={layout?.tooltipAlign}\n // Leave an 8px gap from the trigger and viewport edges.\n sideOffset={8}\n collisionPadding={8}\n >\n <ChartTooltip style={{ zIndex: tooltipZIndex }}>\n <ZIndexProvider value={tooltipZIndex}>{content}</ZIndexProvider>\n </ChartTooltip>\n </TooltipPrimitive.Content>\n </TooltipPrimitive.Portal>\n </TooltipPrimitive.Root>\n );\n\n const renderLabel = (\n layout: AxisLayout,\n height: number,\n summary: string,\n lines: ReactNode\n ) => (\n <foreignObject\n x={layout.labelX}\n y={layout.labelY}\n width={LABEL_WIDTH}\n height={height}\n >\n <div\n className={cn('flex h-full flex-col', layout.justify, layout.align)}\n title={isInteractive ? undefined : summary}\n >\n {lines}\n </div>\n </foreignObject>\n );\n\n const renderSingleSeries = (\n data: readonly RadarChartDatum[],\n renderDatumTooltip?: (datum: RadarChartDatum) => ReactNode\n ) => {\n const labelHeight = LABEL_LINE_HEIGHT * 2;\n const layouts = getAxisLayouts(data, labelHeight);\n const values = data.map(({ value }) => sanitize(value));\n const maximum = getMaximum(values, maxValue);\n const axes = data.map((datum, index) => {\n const value = values[index];\n const formattedValue = formatValue(value);\n return {\n layout: layouts[index],\n datum: {\n ...datum,\n value,\n color: datum.color ?? getCategoricalFillChartColor(index),\n },\n formattedValue,\n summary: `${datum.label}: ${formattedValue}`,\n point: getPoint(layouts[index], Math.min(1, value / maximum)),\n };\n });\n\n return {\n layouts,\n summary: axes.map(({ summary }) => summary).join('; '),\n marks: (\n <>\n <polygon\n aria-hidden=\"true\"\n points={toPoints(axes.map(({ point }) => point))}\n fill={CHART_SINGLE_FILL_COLOR}\n // A light wash and subdued outline keep the category points prominent.\n // Dark surfaces need slightly more opacity to preserve the shape.\n className=\"dark:[fill-opacity:0.24] dark:[stroke-opacity:0.8]\"\n fillOpacity={0.16}\n stroke={getCategoricalLineChartColor(0)}\n strokeOpacity={0.55}\n strokeWidth={1.25}\n strokeLinejoin=\"round\"\n />\n {axes.map(({ layout, datum, formattedValue, summary, point }) => {\n const [pointX, pointY] = point;\n const mark = (\n <g\n key={datum.id}\n className=\"group outline-hidden\"\n role={isInteractive ? 'img' : undefined}\n aria-label={isInteractive ? summary : undefined}\n aria-hidden={isInteractive ? undefined : true}\n tabIndex={isInteractive ? 0 : undefined}\n >\n {/* A 24-unit hit target surrounds the 8-unit point; the\n 12-unit ring shows hover in the axis color and keyboard\n focus in the shared focus color without changing layout.\n The ring stays inside the label gap, so a point at the\n maximum doesn't draw it over its label. */}\n <circle cx={pointX} cy={pointY} r={12} fill=\"transparent\" />\n <circle\n cx={pointX}\n cy={pointY}\n r={6}\n fill=\"none\"\n stroke={datum.color}\n strokeWidth={1.5}\n className=\"opacity-0 group-hover:opacity-100 group-focus-visible:stroke-focus group-focus-visible:opacity-100\"\n />\n <circle\n cx={pointX}\n cy={pointY}\n r={4}\n fill={datum.color}\n // A thin surface-colored separator avoids heavy dark borders.\n className=\"stroke-surface-level-1\"\n strokeWidth={1}\n />\n {renderLabel(\n layout,\n labelHeight,\n summary,\n <>\n <Text variant=\"xs\" className=\"truncate leading-tight\">\n {datum.label}\n </Text>\n <Text\n variant=\"xs\"\n color=\"secondary\"\n className=\"truncate leading-tight tabular-nums\"\n >\n {formattedValue}\n </Text>\n </>\n )}\n </g>\n );\n return renderDatumTooltip\n ? withTooltip(datum.id, mark, renderDatumTooltip(datum))\n : mark;\n })}\n </>\n ),\n };\n };\n\n const renderMultiSeries = (\n axes: readonly RadarChartAxis[],\n series: readonly RadarChartSeries[],\n renderAxisTooltip?: (axis: RadarChartAxisValues) => ReactNode\n ) => {\n const layouts = getAxisLayouts(axes, LABEL_LINE_HEIGHT);\n // Resolve colors before filtering so each series keeps its hue.\n const resolvedSeries = series.map((item, index) => {\n const color = item.color ?? getCategoricalLineChartColor(index);\n return {\n id: item.id,\n label: item.label,\n color,\n fill: getCategoricalFillColor(color),\n values: axes.map(({ id }) => sanitize(item.values[id])),\n };\n });\n const visibleSeries = resolvedSeries.filter(\n ({ id }) =>\n (selectedIds === undefined ||\n selectedIds.size === 0 ||\n selectedIds.has(id)) &&\n !excludedIds?.has(id)\n );\n const maximum = getMaximum(\n visibleSeries.flatMap(({ values }) => values),\n maxValue\n );\n const plottedSeries = visibleSeries.map((item) => ({\n ...item,\n points: item.values.map((value, index) =>\n getPoint(layouts[index], Math.min(1, value / maximum))\n ),\n }));\n const emphasizedId = plottedSeries.some(\n ({ id }) => id === activeLegendItemId\n )\n ? activeLegendItemId\n : null;\n const getSeriesOpacity = (id: string) =>\n emphasizedId != null && id !== emphasizedId ? CHART_DIMMED_OPACITY : 1;\n\n return {\n layouts,\n summary: plottedSeries\n .map(\n (item) =>\n `${item.label}: ${axes\n .map(\n (axis, index) =>\n `${axis.label} ${formatValue(item.values[index])}`\n )\n .join(', ')}`\n )\n .join('; '),\n marks: (\n <>\n {/* Draw the emphasized series last so its outline sits on top. */}\n {[\n ...plottedSeries.filter(({ id }) => id !== emphasizedId),\n ...plottedSeries.filter(({ id }) => id === emphasizedId),\n ].map((item) => {\n const isEmphasized = item.id === emphasizedId;\n return (\n <polygon\n key={item.id}\n aria-hidden=\"true\"\n points={toPoints(item.points)}\n fill={item.fill}\n fillOpacity={\n isEmphasized\n ? EMPHASIZED_SERIES_FILL_OPACITY\n : emphasizedId == null\n ? SERIES_FILL_OPACITY\n : 0\n }\n className=\"transition-[opacity,fill-opacity] duration-fast motion-reduce:transition-none\"\n opacity={getSeriesOpacity(item.id)}\n stroke={item.color}\n strokeWidth={1.5}\n strokeLinejoin=\"round\"\n />\n );\n })}\n {axes.map((axis, index) => {\n const layout = layouts[index];\n const values = plottedSeries.map((item) => ({\n id: item.id,\n label: item.label,\n value: item.values[index],\n color: item.color,\n }));\n const summary = values.length\n ? `${axis.label}: ${values\n .map(({ label, value }) => `${label} ${formatValue(value)}`)\n .join(', ')}`\n : axis.label;\n const [outerX, outerY] = getPoint(layout, 1);\n const [previousX, previousY] = getPoint(\n layouts[(index - 1 + layouts.length) % layouts.length],\n 1\n );\n const [nextX, nextY] = getPoint(\n layouts[(index + 1) % layouts.length],\n 1\n );\n const mark = (\n <g\n key={axis.id}\n className=\"group outline-hidden\"\n role={isInteractive ? 'img' : undefined}\n aria-label={isInteractive ? summary : undefined}\n aria-hidden={isInteractive ? undefined : true}\n tabIndex={isInteractive ? 0 : undefined}\n >\n {/* Each axis owns the sector between its neighbors' edge\n midpoints, so hovering anywhere in the plot inspects the\n nearest axis. */}\n <polygon\n points={toPoints([\n [CENTER_X, CENTER_Y],\n [(previousX + outerX) / 2, (previousY + outerY) / 2],\n [outerX, outerY],\n [(outerX + nextX) / 2, (outerY + nextY) / 2],\n ])}\n fill=\"transparent\"\n />\n {/* Hover strengthens the spoke and reveals each series'\n vertex; keyboard focus uses the shared focus color. */}\n <g className=\"opacity-0 transition-opacity duration-fast group-hover:opacity-100 group-focus-visible:opacity-100 motion-reduce:transition-none\">\n <line\n x1={CENTER_X}\n y1={CENTER_Y}\n x2={outerX}\n y2={outerY}\n stroke=\"var(--border-default)\"\n className=\"group-focus-visible:stroke-focus\"\n />\n {plottedSeries.map((item) => (\n <circle\n key={item.id}\n cx={item.points[index][0]}\n cy={item.points[index][1]}\n r={3.5}\n fill={item.color}\n opacity={getSeriesOpacity(item.id)}\n // A surface-colored separator keeps coincident vertices distinct.\n className=\"stroke-surface-level-1\"\n strokeWidth={1.5}\n />\n ))}\n </g>\n {renderLabel(\n layout,\n LABEL_LINE_HEIGHT,\n summary,\n <Text variant=\"xs\" className=\"truncate leading-tight\">\n {axis.label}\n </Text>\n )}\n </g>\n );\n return renderAxisTooltip\n ? withTooltip(\n axis.id,\n mark,\n renderAxisTooltip({ id: axis.id, label: axis.label, values }),\n layout\n )\n : mark;\n })}\n </>\n ),\n };\n };\n\n const axisCount = (props.series !== undefined ? props.axes : props.data)\n .length;\n const chart =\n axisCount < 3\n ? null\n : props.series !== undefined\n ? renderMultiSeries(props.axes, props.series, props.renderAxisTooltip)\n : renderSingleSeries(props.data, props.renderTooltip);\n\n return (\n <div className={cn('w-full overflow-x-auto', className)} {...divProps}>\n {chart === null ? (\n <div className=\"flex h-80 items-center justify-center\" role=\"status\">\n <Text variant=\"sm\" color=\"secondary\">\n At least three axes are needed to display a radar chart.\n </Text>\n </div>\n ) : (\n <TooltipPrimitive.Provider\n // Brief hover delay avoids flashes when crossing between axes.\n delayDuration={150}\n >\n <svg\n viewBox={`0 0 ${VIEWBOX_WIDTH} ${VIEWBOX_HEIGHT}`}\n className=\"block w-full\"\n // Preserve the labels' base font size; narrow containers scroll.\n style={{ minWidth: VIEWBOX_WIDTH }}\n role={isInteractive ? 'group' : 'img'}\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledBy}\n aria-describedby={[summaryId, ariaDescribedBy]\n .filter(Boolean)\n .join(' ')}\n >\n <desc id={summaryId}>{chart.summary}</desc>\n <g aria-hidden=\"true\" fill=\"none\" stroke=\"var(--border-subtle)\">\n {GRID_LEVELS.map((level) => (\n <polygon\n key={level}\n points={toPoints(\n chart.layouts.map((layout) => getPoint(layout, level))\n )}\n />\n ))}\n {chart.layouts.map((layout) => {\n const [x, y] = getPoint(layout, 1);\n return (\n <line\n key={layout.id}\n x1={CENTER_X}\n y1={CENTER_Y}\n x2={x}\n y2={y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,UAAU;IAChC,cAAY;IACZ,mBAAiB;IACjB,oBAAkB,CAAC,WAAW,eAAe,CAAC,CAC3C,OAAO,OAAO,CAAC,CACf,KAAK,GAAG;IAVb,UAAA;KAYE,oBAAC,QAAD;MAAM,IAAI;MAAY,UAAA,MAAM;KAAc,CAAA;KAC1C,qBAAC,KAAD;MAAG,eAAY;MAAO,MAAK;MAAO,QAAO;MAAzC,UAAA,CACG,YAAY,KAAK,UAChB,oBAAC,WAAD,EAEE,QAAQ,SACN,MAAM,QAAQ,KAAK,WAAW,SAAS,QAAQ,KAAK,CAAC,CACvD,EACD,GAJM,KAIN,CACF,GACA,MAAM,QAAQ,KAAK,WAAW;OAC7B,MAAM,CAAC,GAAG,KAAK,SAAS,QAAQ,CAAC;OACjC,OACE,oBAAC,QAAD;QAEE,IAAI;QACJ,IAAI;QACJ,IAAI;QACJ,IAAI;OACL,GALM,OAAO,EAKb;MAEL,CAAC,CACA;;KACF,MAAM;IACJ;;EACoB,CAAA;CAE1B,CAAA;AAET"}
@@ -12,6 +12,8 @@ export interface SelectOption<T extends string = string> {
12
12
  rightDecorator?: ReactNode;
13
13
  /** Whether this option is disabled */
14
14
  disabled?: boolean;
15
+ /** Extra search terms, such as a provider name */
16
+ keywords?: string[];
15
17
  }
16
18
  export interface SelectGroup<T extends string = string> {
17
19
  heading?: string;
@@ -61,6 +63,8 @@ interface SelectBaseProps<T extends string = string> extends DataAttributes {
61
63
  variant?: SelectVariant;
62
64
  /** Additional class name for the popover content */
63
65
  contentClassName?: string;
66
+ /** Content below the list, such as a link to manage the options */
67
+ footer?: ReactNode;
64
68
  /** Custom render function for the selected value in the trigger */
65
69
  renderValue?: (option: SelectOption<T>) => ReactNode;
66
70
  /** Custom render function for each option in the list */
@@ -4,6 +4,7 @@ import { CONTROL_SIZES } from "../../utils/componentSizes.js";
4
4
  import { Text } from "../Text/Text.js";
5
5
  import { Button } from "../Button/Button.js";
6
6
  import { Icon } from "../Icon/Icon.js";
7
+ import { SPACE_SCALE_PX } from "../../utils/spacing.js";
7
8
  import { pickDataAttributes } from "../../utils/dataAttributes.js";
8
9
  import { Popover, PopoverContent, PopoverTrigger } from "../Popover/Popover.js";
9
10
  import { CONTROL_ICON_SIZES } from "../../utils/controlIconSizes.js";
@@ -18,10 +19,10 @@ function optionToItem(opt) {
18
19
  description: opt.description,
19
20
  rightDecorator: opt.rightDecorator,
20
21
  disabled: opt.disabled,
21
- keywords: opt.label ? [opt.label] : void 0
22
+ keywords: opt.keywords
22
23
  };
23
24
  }
24
- function OptionSelect({ value, onChange, options, groups, placeholder = "Select...", searchPlaceholder = "Search...", disabled = false, size = "sm", emptyText = "No results found.", open: controlledOpen, onOpenChange: controlledOnOpenChange, allowDeselect, hideSearch = true, disableFilter, onSearchChange, loading, loadingRows, onEndReached, endReachedThresholdPx, triggerClassName, variant = "outlined", contentClassName, renderValue, renderOption, side, align = "start", onCloseAutoFocus, "aria-label": ariaLabel, "data-testid": dataTestId, ...rest }) {
25
+ function OptionSelect({ value, onChange, options, groups, placeholder = "Select...", searchPlaceholder = "Search...", disabled = false, size = "sm", emptyText = "No results found.", open: controlledOpen, onOpenChange: controlledOnOpenChange, allowDeselect, hideSearch = true, disableFilter, onSearchChange, loading, loadingRows, onEndReached, endReachedThresholdPx, triggerClassName, variant = "outlined", contentClassName, footer, renderValue, renderOption, side, align = "start", onCloseAutoFocus, "aria-label": ariaLabel, "data-testid": dataTestId, ...rest }) {
25
26
  const [uncontrolledOpen, setUncontrolledOpen] = useState(false);
26
27
  const isControlled = controlledOpen !== void 0;
27
28
  const open = isControlled ? controlledOpen : uncontrolledOpen;
@@ -30,7 +31,7 @@ function OptionSelect({ value, onChange, options, groups, placeholder = "Select.
30
31
  const selectedOption = useMemo(() => allOptions.find((opt) => opt.value === value), [allOptions, value]);
31
32
  const handleSelect = useCallback((optionValue) => {
32
33
  const match = allOptions.find((o) => o.value === optionValue);
33
- if (!match) return;
34
+ if (!match || match.disabled || disabled) return;
34
35
  if (allowDeselect && match.value === value) onChange(void 0);
35
36
  else onChange(match.value);
36
37
  setOpen(false);
@@ -39,7 +40,8 @@ function OptionSelect({ value, onChange, options, groups, placeholder = "Select.
39
40
  value,
40
41
  onChange,
41
42
  setOpen,
42
- allOptions
43
+ allOptions,
44
+ disabled
43
45
  ]);
44
46
  const items = useMemo(() => (options ?? []).map(optionToItem), [options]);
45
47
  const commandGroups = useMemo(() => groups?.map((g) => ({
@@ -99,18 +101,23 @@ function OptionSelect({ value, onChange, options, groups, placeholder = "Select.
99
101
  weight: "regular"
100
102
  })]
101
103
  })
102
- }), /* @__PURE__ */ jsx(PopoverContent, {
103
- className: cn("w-max min-w-[var(--radix-popover-trigger-width)] max-w-[min(24rem,calc(100vw-1rem))] p-0 text-primary", contentClassName),
104
+ }), /* @__PURE__ */ jsxs(PopoverContent, {
105
+ className: cn("flex max-h-[var(--radix-popover-content-available-height)] w-max min-w-[var(--radix-popover-trigger-width)] max-w-[min(24rem,var(--radix-popover-content-available-width),calc(100vw-1rem))] flex-col overflow-hidden p-0 text-primary", contentClassName),
106
+ "aria-label": ariaLabel ?? placeholder,
107
+ collisionPadding: SPACE_SCALE_PX[2],
104
108
  side,
105
109
  align,
106
110
  onCloseAutoFocus,
107
- children: commandGroups ? /* @__PURE__ */ jsx(CommandMenu, {
111
+ children: [commandGroups ? /* @__PURE__ */ jsx(CommandMenu, {
108
112
  groups: commandGroups,
109
113
  ...commandMenuSharedProps
110
114
  }) : /* @__PURE__ */ jsx(CommandMenu, {
111
115
  items,
112
116
  ...commandMenuSharedProps
113
- })
117
+ }), footer != null && /* @__PURE__ */ jsx("div", {
118
+ className: "shrink-0 border-t border-subtle p-space-1",
119
+ children: footer
120
+ })]
114
121
  })]
115
122
  });
116
123
  }
@@ -1 +1 @@
1
- {"version":3,"file":"Select.js","names":[],"sources":["../../../src/components/Select/Select.tsx"],"sourcesContent":["import type { ReactNode } from 'react';\nimport { useCallback, useMemo, useState } from 'react';\n\nimport { CaretDownIcon } from '../../icons/PaddedPhosphorIcons';\nimport { cn } from '../../utils/cn';\nimport {\n CONTROL_SIZES,\n type ControlSize,\n type OptionRowSize,\n} from '../../utils/componentSizes';\nimport { CONTROL_ICON_SIZES } from '../../utils/controlIconSizes';\nimport {\n type DataAttributes,\n pickDataAttributes,\n} from '../../utils/dataAttributes';\nimport { Button } from '../Button';\nimport { CommandMenu } from '../Command/CommandMenu';\nimport type { CommandMenuGroup, CommandMenuItem } from '../Command/CommandMenu';\nimport { Icon } from '../Icon';\nimport { Popover, PopoverContent, PopoverTrigger } from '../Popover';\nimport { Text } from '../Text';\n\nexport interface SelectOption<T extends string = string> {\n /** The value used for selection and filtering */\n value: T;\n /** Display label (defaults to value if not provided) */\n label?: string;\n /** Secondary description text displayed below the label */\n description?: string;\n /** Element displayed on the right side of the item (e.g. badge, shortcut) */\n rightDecorator?: ReactNode;\n /** Whether this option is disabled */\n disabled?: boolean;\n}\n\nexport interface SelectGroup<T extends string = string> {\n heading?: string;\n options: SelectOption<T>[];\n}\n\nexport type SelectSize = ControlSize;\n\nexport type SelectVariant = 'outlined' | 'plain';\n\ninterface SelectBaseProps<T extends string = string> extends DataAttributes {\n /** The currently selected value */\n value?: T;\n /** Callback when selection changes. Receives undefined when deselected. */\n onChange: (value: T | undefined) => void;\n /** Placeholder text when no value is selected */\n placeholder?: string;\n /** Placeholder text for the search input */\n searchPlaceholder?: string;\n /** Whether the select is disabled */\n disabled?: boolean;\n /** Exact trigger height: xs=20px, sm=24px, md=32px, lg=40px. */\n size?: SelectSize;\n /** Text to show when no options match the search */\n emptyText?: string;\n /** Allow deselecting the current value by clicking it again (default: false) */\n allowDeselect?: boolean;\n /** Hide the search input (default: true, search is hidden) */\n hideSearch?: boolean;\n /** Disable client-side filtering by cmdk (default: false). Set true for server-side filtering. */\n disableFilter?: boolean;\n /** Callback when the search input value changes. Useful for server-side filtering. */\n onSearchChange?: (query: string) => void;\n /** Whether more items are currently being loaded */\n loading?: boolean;\n /** Number of skeleton rows to show while loading (default: 5) */\n loadingRows?: number;\n /** Callback when the user scrolls near the end of the list. Use for infinite loading. */\n onEndReached?: () => void;\n /** Distance in pixels from the bottom to trigger onEndReached (default: 50) */\n endReachedThresholdPx?: number;\n /** Additional class name for the trigger button */\n triggerClassName?: string;\n /**\n * Trigger appearance. `outlined` (default) is a full-width form field.\n * `plain` drops the field fill and border and sizes the trigger to its\n * value, so it reads as text until hovered — for an inline setting in a row,\n * such as a member's role, where a field box would crowd it.\n */\n variant?: SelectVariant;\n /** Additional class name for the popover content */\n contentClassName?: string;\n /** Custom render function for the selected value in the trigger */\n renderValue?: (option: SelectOption<T>) => ReactNode;\n /** Custom render function for each option in the list */\n renderOption?: (option: SelectOption<T>, isSelected: boolean) => ReactNode;\n /** Side of the trigger to align the popover */\n side?: 'top' | 'bottom' | 'left' | 'right';\n /** Alignment of the popover relative to the trigger */\n align?: 'start' | 'center' | 'end';\n /**\n * Called when the menu closes, before focus returns to the trigger. Move\n * focus elsewhere and call `event.preventDefault()` to keep it there.\n */\n onCloseAutoFocus?: (event: Event) => void;\n /** aria-label for the trigger button */\n 'aria-label'?: string;\n /** Test id for the trigger button */\n 'data-testid'?: string;\n}\n\nexport type SelectProps<T extends string = string> = SelectBaseProps<T> &\n (\n | {\n options: SelectOption<T>[];\n groups?: never;\n }\n | {\n groups: SelectGroup<T>[];\n options?: never;\n }\n ) &\n (\n | {\n /** Controlled open state */\n open: boolean;\n /** Callback when open state changes (required when `open` is provided) */\n onOpenChange: (open: boolean) => void;\n }\n | {\n open?: never;\n onOpenChange?: never;\n }\n );\n\nfunction optionToItem(opt: SelectOption): CommandMenuItem {\n return {\n value: opt.value,\n label: opt.label,\n description: opt.description,\n rightDecorator: opt.rightDecorator,\n disabled: opt.disabled,\n keywords: opt.label ? [opt.label] : undefined,\n };\n}\n\nfunction OptionSelect<T extends string = string>({\n value,\n onChange,\n options,\n groups,\n placeholder = 'Select...',\n searchPlaceholder = 'Search...',\n disabled = false,\n size = 'sm',\n emptyText = 'No results found.',\n open: controlledOpen,\n onOpenChange: controlledOnOpenChange,\n allowDeselect,\n hideSearch = true,\n disableFilter,\n onSearchChange,\n loading,\n loadingRows,\n onEndReached,\n endReachedThresholdPx,\n triggerClassName,\n variant = 'outlined',\n contentClassName,\n renderValue,\n renderOption,\n side,\n align = 'start',\n onCloseAutoFocus,\n 'aria-label': ariaLabel,\n 'data-testid': dataTestId,\n ...rest\n}: SelectProps<T>) {\n const [uncontrolledOpen, setUncontrolledOpen] = useState(false);\n const isControlled = controlledOpen !== undefined;\n const open = isControlled ? controlledOpen : uncontrolledOpen;\n const setOpen = isControlled ? controlledOnOpenChange : setUncontrolledOpen;\n\n const allOptions = useMemo<SelectOption<T>[]>(\n () => (groups ? groups.flatMap((g) => g.options) : (options ?? [])),\n [groups, options]\n );\n\n const selectedOption = useMemo(\n () => allOptions.find((opt) => opt.value === value),\n [allOptions, value]\n );\n\n const handleSelect = useCallback(\n (optionValue: string) => {\n const match = allOptions.find((o) => o.value === optionValue);\n if (!match) return;\n if (allowDeselect && match.value === value) {\n onChange(undefined);\n } else {\n onChange(match.value);\n }\n setOpen(false);\n },\n [allowDeselect, value, onChange, setOpen, allOptions]\n );\n\n const items: CommandMenuItem[] = useMemo(\n () => (options ?? []).map(optionToItem),\n [options]\n );\n\n const commandGroups: CommandMenuGroup[] | undefined = useMemo(\n () =>\n groups?.map((g) => ({\n heading: g.heading,\n items: g.options.map(optionToItem),\n })),\n [groups]\n );\n\n const renderItem = renderOption\n ? (item: CommandMenuItem, isSelected: boolean) => {\n const option = allOptions.find((o) => o.value === item.value);\n return option ? renderOption(option, isSelected) : null;\n }\n : undefined;\n const searchInputSize = size === 'xs' ? 'sm' : size === 'lg' ? 'md' : size;\n const triggerButtonSize = size === 'lg' ? 'md' : size;\n const itemRowSize: OptionRowSize =\n size === 'xs' || size === 'sm' ? 'sm' : 'md';\n\n const commandMenuSharedProps = {\n value,\n onSelect: handleSelect,\n placeholder: searchPlaceholder,\n emptyText,\n hideSearch,\n disableFilter,\n onSearchChange,\n loading,\n loadingRows,\n onEndReached,\n endReachedThresholdPx,\n renderItem,\n inputSize: searchInputSize,\n itemRowSize,\n };\n\n const triggerContent =\n selectedOption && renderValue ? (\n renderValue(selectedOption)\n ) : (\n <Text\n as=\"span\"\n variant={triggerButtonSize}\n weight=\"normal\"\n className=\"min-w-0 truncate text-left\"\n >\n {selectedOption\n ? (selectedOption.label ?? selectedOption.value)\n : placeholder}\n </Text>\n );\n\n return (\n <Popover open={open} onOpenChange={setOpen}>\n <PopoverTrigger asChild>\n <Button\n {...pickDataAttributes(rest)}\n role=\"combobox\"\n aria-expanded={open}\n aria-label={ariaLabel ?? placeholder}\n variant={variant}\n color=\"secondary\"\n size={triggerButtonSize}\n className={cn(\n 'box-border justify-between py-0',\n CONTROL_SIZES[size].heightClassName,\n variant === 'plain'\n ? cn(\n 'w-auto max-w-full gap-space-1 px-space-1',\n // The shared disabled fill, in both themes.\n disabled && 'bg-disabled text-disabled dark:bg-disabled'\n )\n : cn(\n 'w-full',\n disabled\n ? 'border-muted bg-input-disabled text-disabled dark:bg-input-disabled'\n : 'bg-input border-input shadow-none hover:bg-input-hover hover:border-input-hover focus-visible:border-focus focus-visible:shadow-[0_0_0_1px_var(--border-focus)] focus-visible:outline-none'\n ),\n triggerClassName\n )}\n disabled={disabled}\n data-testid={dataTestId}\n >\n {triggerContent}\n <Icon\n aria-hidden\n icon={CaretDownIcon}\n iconClassName={CONTROL_ICON_SIZES[size].iconClassName}\n className={disabled ? 'text-icon-disabled' : 'text-inherit'}\n weight=\"regular\"\n />\n </Button>\n </PopoverTrigger>\n <PopoverContent\n className={cn(\n 'w-max min-w-[var(--radix-popover-trigger-width)] max-w-[min(24rem,calc(100vw-1rem))] p-0 text-primary',\n contentClassName\n )}\n side={side}\n align={align}\n onCloseAutoFocus={onCloseAutoFocus}\n >\n {commandGroups ? (\n <CommandMenu groups={commandGroups} {...commandMenuSharedProps} />\n ) : (\n <CommandMenu items={items} {...commandMenuSharedProps} />\n )}\n </PopoverContent>\n </Popover>\n );\n}\n\nexport function Select<T extends string = string>(\n props: SelectProps<T>\n): React.ReactElement<unknown> {\n return <OptionSelect {...props} />;\n}\n"],"mappings":";;;;;;;;;;;;;AAiIA,SAAS,aAAa,KAAoC;CACxD,OAAO;EACL,OAAO,IAAI;EACX,OAAO,IAAI;EACX,aAAa,IAAI;EACjB,gBAAgB,IAAI;EACpB,UAAU,IAAI;EACd,UAAU,IAAI,QAAQ,CAAC,IAAI,KAAK,IAAI,KAAA;CACtC;AACF;AAEA,SAAS,aAAwC,EAC/C,OACA,UACA,SACA,QACA,cAAc,aACd,oBAAoB,aACpB,WAAW,OACX,OAAO,MACP,YAAY,qBACZ,MAAM,gBACN,cAAc,wBACd,eACA,aAAa,MACb,eACA,gBACA,SACA,aACA,cACA,uBACA,kBACA,UAAU,YACV,kBACA,aACA,cACA,MACA,QAAQ,SACR,kBACA,cAAc,WACd,eAAe,YACf,GAAG,QACc;CACjB,MAAM,CAAC,kBAAkB,uBAAuB,SAAS,KAAK;CAC9D,MAAM,eAAe,mBAAmB,KAAA;CACxC,MAAM,OAAO,eAAe,iBAAiB;CAC7C,MAAM,UAAU,eAAe,yBAAyB;CAExD,MAAM,aAAa,cACV,SAAS,OAAO,SAAS,MAAM,EAAE,OAAO,IAAK,WAAW,CAAC,GAChE,CAAC,QAAQ,OAAO,CAClB;CAEA,MAAM,iBAAiB,cACf,WAAW,MAAM,QAAQ,IAAI,UAAU,KAAK,GAClD,CAAC,YAAY,KAAK,CACpB;CAEA,MAAM,eAAe,aAClB,gBAAwB;EACvB,MAAM,QAAQ,WAAW,MAAM,MAAM,EAAE,UAAU,WAAW;EAC5D,IAAI,CAAC,OAAO;EACZ,IAAI,iBAAiB,MAAM,UAAU,OACnC,SAAS,KAAA,CAAS;OAElB,SAAS,MAAM,KAAK;EAEtB,QAAQ,KAAK;CACf,GACA;EAAC;EAAe;EAAO;EAAU;EAAS;CAAU,CACtD;CAEA,MAAM,QAA2B,eACxB,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uB;KAC7C,QAAO;IACR,CAAA,CACK;;EACM,CAAA,GAChB,oBAAC,gBAAD;GACE,WAAW,GACT,yGACA,gBACF;GACM;GACC;GACW;GAEjB,UAAA,gBACC,oBAAC,aAAD;IAAa,QAAQ;IAAe,GAAI;GAAyB,CAAA,IAEjE,oBAAC,aAAD;IAAoB;IAAO,GAAI;GAAyB,CAAA;EAE5C,CAAA,CACT;;AAEb;AAEA,SAAgB,OACd,OAC6B;CAC7B,OAAO,oBAAC,cAAD,EAAc,GAAI,MAAQ,CAAA;AACnC"}
1
+ {"version":3,"file":"Select.js","names":[],"sources":["../../../src/components/Select/Select.tsx"],"sourcesContent":["import type { ReactNode } from 'react';\nimport { useCallback, useMemo, useState } from 'react';\n\nimport { CaretDownIcon } from '../../icons/PaddedPhosphorIcons';\nimport { cn } from '../../utils/cn';\nimport {\n CONTROL_SIZES,\n type ControlSize,\n type OptionRowSize,\n} from '../../utils/componentSizes';\nimport { CONTROL_ICON_SIZES } from '../../utils/controlIconSizes';\nimport {\n type DataAttributes,\n pickDataAttributes,\n} from '../../utils/dataAttributes';\nimport { SPACE_SCALE_PX } from '../../utils/spacing';\nimport { Button } from '../Button';\nimport { CommandMenu } from '../Command/CommandMenu';\nimport type { CommandMenuGroup, CommandMenuItem } from '../Command/CommandMenu';\nimport { Icon } from '../Icon';\nimport { Popover, PopoverContent, PopoverTrigger } from '../Popover';\nimport { Text } from '../Text';\n\nexport interface SelectOption<T extends string = string> {\n /** The value used for selection and filtering */\n value: T;\n /** Display label (defaults to value if not provided) */\n label?: string;\n /** Secondary description text displayed below the label */\n description?: string;\n /** Element displayed on the right side of the item (e.g. badge, shortcut) */\n rightDecorator?: ReactNode;\n /** Whether this option is disabled */\n disabled?: boolean;\n /** Extra search terms, such as a provider name */\n keywords?: string[];\n}\n\nexport interface SelectGroup<T extends string = string> {\n heading?: string;\n options: SelectOption<T>[];\n}\n\nexport type SelectSize = ControlSize;\n\nexport type SelectVariant = 'outlined' | 'plain';\n\ninterface SelectBaseProps<T extends string = string> extends DataAttributes {\n /** The currently selected value */\n value?: T;\n /** Callback when selection changes. Receives undefined when deselected. */\n onChange: (value: T | undefined) => void;\n /** Placeholder text when no value is selected */\n placeholder?: string;\n /** Placeholder text for the search input */\n searchPlaceholder?: string;\n /** Whether the select is disabled */\n disabled?: boolean;\n /** Exact trigger height: xs=20px, sm=24px, md=32px, lg=40px. */\n size?: SelectSize;\n /** Text to show when no options match the search */\n emptyText?: string;\n /** Allow deselecting the current value by clicking it again (default: false) */\n allowDeselect?: boolean;\n /** Hide the search input (default: true, search is hidden) */\n hideSearch?: boolean;\n /** Disable client-side filtering by cmdk (default: false). Set true for server-side filtering. */\n disableFilter?: boolean;\n /** Callback when the search input value changes. Useful for server-side filtering. */\n onSearchChange?: (query: string) => void;\n /** Whether more items are currently being loaded */\n loading?: boolean;\n /** Number of skeleton rows to show while loading (default: 5) */\n loadingRows?: number;\n /** Callback when the user scrolls near the end of the list. Use for infinite loading. */\n onEndReached?: () => void;\n /** Distance in pixels from the bottom to trigger onEndReached (default: 50) */\n endReachedThresholdPx?: number;\n /** Additional class name for the trigger button */\n triggerClassName?: string;\n /**\n * Trigger appearance. `outlined` (default) is a full-width form field.\n * `plain` drops the field fill and border and sizes the trigger to its\n * value, so it reads as text until hovered — for an inline setting in a row,\n * such as a member's role, where a field box would crowd it.\n */\n variant?: SelectVariant;\n /** Additional class name for the popover content */\n contentClassName?: string;\n /** Content below the list, such as a link to manage the options */\n footer?: ReactNode;\n /** Custom render function for the selected value in the trigger */\n renderValue?: (option: SelectOption<T>) => ReactNode;\n /** Custom render function for each option in the list */\n renderOption?: (option: SelectOption<T>, isSelected: boolean) => ReactNode;\n /** Side of the trigger to align the popover */\n side?: 'top' | 'bottom' | 'left' | 'right';\n /** Alignment of the popover relative to the trigger */\n align?: 'start' | 'center' | 'end';\n /**\n * Called when the menu closes, before focus returns to the trigger. Move\n * focus elsewhere and call `event.preventDefault()` to keep it there.\n */\n onCloseAutoFocus?: (event: Event) => void;\n /** aria-label for the trigger button */\n 'aria-label'?: string;\n /** Test id for the trigger button */\n 'data-testid'?: string;\n}\n\nexport type SelectProps<T extends string = string> = SelectBaseProps<T> &\n (\n | {\n options: SelectOption<T>[];\n groups?: never;\n }\n | {\n groups: SelectGroup<T>[];\n options?: never;\n }\n ) &\n (\n | {\n /** Controlled open state */\n open: boolean;\n /** Callback when open state changes (required when `open` is provided) */\n onOpenChange: (open: boolean) => void;\n }\n | {\n open?: never;\n onOpenChange?: never;\n }\n );\n\nfunction optionToItem(opt: SelectOption): CommandMenuItem {\n return {\n value: opt.value,\n label: opt.label,\n description: opt.description,\n rightDecorator: opt.rightDecorator,\n disabled: opt.disabled,\n keywords: opt.keywords,\n };\n}\n\nfunction OptionSelect<T extends string = string>({\n value,\n onChange,\n options,\n groups,\n placeholder = 'Select...',\n searchPlaceholder = 'Search...',\n disabled = false,\n size = 'sm',\n emptyText = 'No results found.',\n open: controlledOpen,\n onOpenChange: controlledOnOpenChange,\n allowDeselect,\n hideSearch = true,\n disableFilter,\n onSearchChange,\n loading,\n loadingRows,\n onEndReached,\n endReachedThresholdPx,\n triggerClassName,\n variant = 'outlined',\n contentClassName,\n footer,\n renderValue,\n renderOption,\n side,\n align = 'start',\n onCloseAutoFocus,\n 'aria-label': ariaLabel,\n 'data-testid': dataTestId,\n ...rest\n}: SelectProps<T>) {\n const [uncontrolledOpen, setUncontrolledOpen] = useState(false);\n const isControlled = controlledOpen !== undefined;\n const open = isControlled ? controlledOpen : uncontrolledOpen;\n const setOpen = isControlled ? controlledOnOpenChange : setUncontrolledOpen;\n\n const allOptions = useMemo<SelectOption<T>[]>(\n () => (groups ? groups.flatMap((g) => g.options) : (options ?? [])),\n [groups, options]\n );\n\n const selectedOption = useMemo(\n () => allOptions.find((opt) => opt.value === value),\n [allOptions, value]\n );\n\n const handleSelect = useCallback(\n (optionValue: string) => {\n const match = allOptions.find((o) => o.value === optionValue);\n if (!match || match.disabled || disabled) return;\n if (allowDeselect && match.value === value) {\n onChange(undefined);\n } else {\n onChange(match.value);\n }\n setOpen(false);\n },\n [allowDeselect, value, onChange, setOpen, allOptions, disabled]\n );\n\n const items: CommandMenuItem[] = useMemo(\n () => (options ?? []).map(optionToItem),\n [options]\n );\n\n const commandGroups: CommandMenuGroup[] | undefined = useMemo(\n () =>\n groups?.map((g) => ({\n heading: g.heading,\n items: g.options.map(optionToItem),\n })),\n [groups]\n );\n\n const renderItem = renderOption\n ? (item: CommandMenuItem, isSelected: boolean) => {\n const option = allOptions.find((o) => o.value === item.value);\n return option ? renderOption(option, isSelected) : null;\n }\n : undefined;\n const searchInputSize = size === 'xs' ? 'sm' : size === 'lg' ? 'md' : size;\n const triggerButtonSize = size === 'lg' ? 'md' : size;\n const itemRowSize: OptionRowSize =\n size === 'xs' || size === 'sm' ? 'sm' : 'md';\n\n const commandMenuSharedProps = {\n value,\n onSelect: handleSelect,\n placeholder: searchPlaceholder,\n emptyText,\n hideSearch,\n disableFilter,\n onSearchChange,\n loading,\n loadingRows,\n onEndReached,\n endReachedThresholdPx,\n renderItem,\n inputSize: searchInputSize,\n itemRowSize,\n };\n\n const triggerContent =\n selectedOption && renderValue ? (\n renderValue(selectedOption)\n ) : (\n <Text\n as=\"span\"\n variant={triggerButtonSize}\n weight=\"normal\"\n className=\"min-w-0 truncate text-left\"\n >\n {selectedOption\n ? (selectedOption.label ?? selectedOption.value)\n : placeholder}\n </Text>\n );\n\n return (\n <Popover open={open} onOpenChange={setOpen}>\n <PopoverTrigger asChild>\n <Button\n {...pickDataAttributes(rest)}\n role=\"combobox\"\n aria-expanded={open}\n aria-label={ariaLabel ?? placeholder}\n variant={variant}\n color=\"secondary\"\n size={triggerButtonSize}\n className={cn(\n 'box-border justify-between py-0',\n CONTROL_SIZES[size].heightClassName,\n variant === 'plain'\n ? cn(\n 'w-auto max-w-full gap-space-1 px-space-1',\n // The shared disabled fill, in both themes.\n disabled && 'bg-disabled text-disabled dark:bg-disabled'\n )\n : cn(\n 'w-full',\n disabled\n ? 'border-muted bg-input-disabled text-disabled dark:bg-input-disabled'\n : 'bg-input border-input shadow-none hover:bg-input-hover hover:border-input-hover focus-visible:border-focus focus-visible:shadow-[0_0_0_1px_var(--border-focus)] focus-visible:outline-none'\n ),\n triggerClassName\n )}\n disabled={disabled}\n data-testid={dataTestId}\n >\n {triggerContent}\n <Icon\n aria-hidden\n icon={CaretDownIcon}\n iconClassName={CONTROL_ICON_SIZES[size].iconClassName}\n className={disabled ? 'text-icon-disabled' : 'text-inherit'}\n weight=\"regular\"\n />\n </Button>\n </PopoverTrigger>\n <PopoverContent\n className={cn(\n 'flex max-h-[var(--radix-popover-content-available-height)] w-max min-w-[var(--radix-popover-trigger-width)] max-w-[min(24rem,var(--radix-popover-content-available-width),calc(100vw-1rem))] flex-col overflow-hidden p-0 text-primary',\n contentClassName\n )}\n aria-label={ariaLabel ?? placeholder}\n collisionPadding={SPACE_SCALE_PX[2]}\n side={side}\n align={align}\n onCloseAutoFocus={onCloseAutoFocus}\n >\n {commandGroups ? (\n <CommandMenu groups={commandGroups} {...commandMenuSharedProps} />\n ) : (\n <CommandMenu items={items} {...commandMenuSharedProps} />\n )}\n {footer != null && (\n <div className=\"shrink-0 border-t border-subtle p-space-1\">\n {footer}\n </div>\n )}\n </PopoverContent>\n </Popover>\n );\n}\n\nexport function Select<T extends string = string>(\n props: SelectProps<T>\n): React.ReactElement<unknown> {\n return <OptionSelect {...props} />;\n}\n"],"mappings":";;;;;;;;;;;;;;AAsIA,SAAS,aAAa,KAAoC;CACxD,OAAO;EACL,OAAO,IAAI;EACX,OAAO,IAAI;EACX,aAAa,IAAI;EACjB,gBAAgB,IAAI;EACpB,UAAU,IAAI;EACd,UAAU,IAAI;CAChB;AACF;AAEA,SAAS,aAAwC,EAC/C,OACA,UACA,SACA,QACA,cAAc,aACd,oBAAoB,aACpB,WAAW,OACX,OAAO,MACP,YAAY,qBACZ,MAAM,gBACN,cAAc,wBACd,eACA,aAAa,MACb,eACA,gBACA,SACA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@@ -29,7 +29,7 @@ export type { StatusBadgeProps, StatusBadgeSize, StatusBadgeVariant, } from './S
29
29
  export { Banner } from './Banner/Banner.js';
30
30
  export type { BannerProps } from './Banner/Banner.js';
31
31
  export { ChatComposer, ChatComposerAction, ChatComposerAttachment, ChatComposerAttachmentMenu, ChatComposerAttachments, ChatComposerContext, ChatComposerInput, ChatComposerModelSelect, ChatComposerTextarea, ChatComposerToolbar, } from './ChatComposer/index.js';
32
- export type { ChatComposerActionProps, ChatComposerAttachmentMenuProps, ChatComposerAttachmentProps, ChatComposerAttachmentsProps, ChatComposerContextValue, ChatComposerDrawerIntent, ChatComposerInputHandle, ChatComposerInputProps, ChatComposerModelSelectProps, ChatComposerProps, ChatComposerTextareaProps, ChatComposerToolbarProps, } from './ChatComposer/index.js';
32
+ export type { ChatComposerActionProps, ChatComposerAttachmentMenuProps, ChatComposerAttachmentProps, ChatComposerAttachmentsProps, ChatComposerContextValue, ChatComposerDrawerIntent, ChatComposerInputHandle, ChatComposerInputProps, ChatComposerModelOption, ChatComposerModelSelectProps, ChatComposerProps, ChatComposerTextareaProps, ChatComposerToolbarProps, } from './ChatComposer/index.js';
33
33
  export { ChatConversation } from './ChatConversation/index.js';
34
34
  export type { ChatConversationProps } from './ChatConversation/index.js';
35
35
  export { ChatRichContent, ChatRichContentChoices, ChatRichContentFallback, } from './ChatRichContent/index.js';